| 1 |
|
| 2 |
|
| 3 |
#include <arch/io.h> |
| 4 |
#include <device/pnp_ops.h> |
| 5 |
#include "sch555x.h" |
| 6 |
|
| 7 |
uint8_t sch555x_emi_read8(uint16_t addr) |
| 8 |
{ |
| 9 |
outw(addr | 0x8000, SCH555x_EMI_IOBASE + 2); |
| 10 |
return inb(SCH555x_EMI_IOBASE + 4); |
| 11 |
} |
| 12 |
|
| 13 |
uint16_t sch555x_emi_read16(uint16_t addr) |
| 14 |
{ |
| 15 |
outw(addr | 0x8001, SCH555x_EMI_IOBASE + 2); |
| 16 |
return inw(SCH555x_EMI_IOBASE + 4); |
| 17 |
} |
| 18 |
|
| 19 |
uint32_t sch555x_emi_read32(uint16_t addr) |
| 20 |
{ |
| 21 |
outw(addr | 0x8002, SCH555x_EMI_IOBASE + 2); |
| 22 |
return inl(SCH555x_EMI_IOBASE + 4); |
| 23 |
} |
| 24 |
|
| 25 |
void sch555x_emi_write8(uint16_t addr, uint8_t val) |
| 26 |
{ |
| 27 |
outw(addr | 0x8000, SCH555x_EMI_IOBASE + 2); |
| 28 |
outb(val, SCH555x_EMI_IOBASE + 4); |
| 29 |
} |
| 30 |
|
| 31 |
void sch555x_emi_write16(uint16_t addr, uint16_t val) |
| 32 |
{ |
| 33 |
outw(addr | 0x8001, SCH555x_EMI_IOBASE + 2); |
| 34 |
outw(val, SCH555x_EMI_IOBASE + 4); |
| 35 |
} |
| 36 |
|
| 37 |
void sch555x_emi_write32(uint16_t addr, uint32_t val) |
| 38 |
{ |
| 39 |
outw(addr | 0x8002, SCH555x_EMI_IOBASE + 2); |
| 40 |
outl(val, SCH555x_EMI_IOBASE + 4); |
| 41 |
} |