| 1 |
|
| 2 |
|
| 3 |
#ifndef DCP847SKE_SUPERIO_H |
| 4 |
#define DCP847SKE_SUPERIO_H |
| 5 |
|
| 6 |
#include <arch/io.h> |
| 7 |
#include <superio/hwm5_conf.h> |
| 8 |
|
| 9 |
#define NUVOTON_PORT 0x4e |
| 10 |
#define HWM_PORT 0x0a30 |
| 11 |
#define GPIO_PORT 0x0a80 |
| 12 |
|
| 13 |
#define SUPERIO_BANK(x) (0x0700 | x) |
| 14 |
#define SUPERIO_INITVAL(reg, data) ((reg << 8) | (data)) |
| 15 |
#define HWM_BANK(x) (0x4e00 | x) |
| 16 |
#define HWM_INITVAL SUPERIO_INITVAL |
| 17 |
|
| 18 |
#define SUPERIO_UNLOCK do { \ |
| 19 |
outb(0x87, NUVOTON_PORT); \ |
| 20 |
outb(0x87, NUVOTON_PORT); \ |
| 21 |
} while (0) |
| 22 |
|
| 23 |
#define SUPERIO_LOCK do { \ |
| 24 |
outb(0xaa, NUVOTON_PORT); \ |
| 25 |
} while (0) |
| 26 |
|
| 27 |
#define SUPERIO_WRITE(reg, data) do { \ |
| 28 |
outb((reg), NUVOTON_PORT); \ |
| 29 |
outb((data), NUVOTON_PORT + 1); \ |
| 30 |
} while (0) |
| 31 |
|
| 32 |
#define SUPERIO_WRITE_INITVAL(val) SUPERIO_WRITE((val) >> 8, (val) & 0xff) |
| 33 |
|
| 34 |
#define HWM_WRITE_INITVAL(val) pnp_write_hwm5_index(HWM_PORT, (val) >> 8, (val) & 0xff) |
| 35 |
|
| 36 |
#endif |