Chapter 12 bypass information – IBASE FWA8206 User Manual

Page 28

Advertising
background image

FWA8206 Series User’s Manual

16

Chapter 12

Bypass Information

If jumpers are removed from JP4 leaving 1-2 & 3-4 to open status, ETH0 & ETH1 will be under
Bypass mode (Bypass LED off).
User could initiate it to the Normal mode (Bypass LED light up) then re-trigger it in a loop.
Once the system hangs, ETH0 & ETH1 will switch to Bypass mode after timeout.
The following is the example code for the Bypass function.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <asm/io.h> /* linux-specific */


#ifdef __GLIBC__
# include <sys/perm.h>
#endif


void by_pass_init (void) {

unsigned int i=0;

outb(0x87,0x4e);//Enter extended function mode
outb(0x87,0x4e);

outb(0x2b,0x4e);
i = inb(0x4f);
i &= 0xef;//Configure bit 4 as 0 to be watchdog function.
outb(0x2b,0x4e);
outb(i,0x4f);

outb(0x7,0x4e);
outb(0x8,0x4f);//watchdog in logic device 8

outb(0x30,0x4e);//Active wdt
outb(0x1,0x4f);

outb(0xf5,0x4e);
i = inb(0x4f);
i &= 0xf7;
outb(0xf5,0x4e);
outb(i,0x4f);

outb(0xf6,0x4e);
outb(1,0x4f);//Set timeout value to inital the normal mode.

outb(0xf7,0x4e);
outb(0x0,0x4f);

outb(0xaa,0x4e); // Exit extended mode

Advertising