diff options
Diffstat (limited to 'os/ipengine/flash28f320b3b.c')
| -rw-r--r-- | os/ipengine/flash28f320b3b.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/os/ipengine/flash28f320b3b.c b/os/ipengine/flash28f320b3b.c new file mode 100644 index 00000000..27bb90d6 --- /dev/null +++ b/os/ipengine/flash28f320b3b.c @@ -0,0 +1,43 @@ +#include "u.h" +#include "../port/lib.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "io.h" +#include "../port/error.h" + +#include "../port/flashif.h" + +/* + * Intel 28F320B3B in word mode + */ + +#define I(x) (x) +enum { + ReadArray = 0x00FF, +}; + +#include "../port/flashintel" + +static int +reset(Flash *f) +{ + f->id = 0x0089; /* can't use autoselect: might be running in flash */ + f->devid = 0x8897; + f->write = intelwrite2; + f->erasezone = intelerase; + f->width = 2; + f->cmask = 0x00FF; + *(ushort*)f->addr = ClearStatus; + *(ushort*)f->addr = ReadArray; + f->nr = 2; + f->regions[0] = (Flashregion){8, 0, 8*(8*1024), 8*1024, 0}; + f->regions[1] = (Flashregion){63, 64*1024, 4*1024*1024, 64*1024, 0}; + return 0; +} + +void +flash28f320b3blink(void) +{ + addflashcard("Intel28F320B3B", reset); +} |
