diff options
| author | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
|---|---|---|
| committer | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
| commit | b786f20bbab5a59046aa78a2c6c2a11536497202 (patch) | |
| tree | 0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /os/ipengine/flash28f320b3b.c | |
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
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 0000000..27bb90d --- /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); +} |
