1 #include <device/pnp_def.h>
3 #define SCH4307_CONFIG_PORT 0x162e
4 static inline void shc4307_enter_ext_func_mode(device_t dev)
6 unsigned port = dev >> 8;
10 static inline void shc4307_exit_ext_func_mode(device_t dev)
12 unsigned port = dev >> 8;
16 #define CMOS_DEV PNP_DEV(SCH4307_CONFIG_PORT, 0x6)
17 #define KBD_DEV PNP_DEV(SCH4307_CONFIG_PORT, 0x7)
18 #define DBG_DEV PNP_DEV(SCH4307_CONFIG_PORT, 0x3)
19 #define REGS_DEV PNP_DEV(SCH4307_CONFIG_PORT, 0xa)
21 void shc4307_init(void)
23 shc4307_enter_ext_func_mode(CMOS_DEV);
24 pnp_set_logical_device(CMOS_DEV); /* CMOS/RTC */
25 pnp_set_iobase(CMOS_DEV, PNP_IDX_IO0, 0x70);
26 pnp_set_iobase(CMOS_DEV, PNP_IDX_IO1, 0x72);
27 pnp_set_irq(CMOS_DEV, PNP_IDX_IRQ0, 8);
28 /* pnp_set_enable(CMOS_DEV, 3); */
29 pnp_write_config(CMOS_DEV, 0x30, 3);
31 pnp_set_logical_device(KBD_DEV); /* Keyboard */
32 pnp_set_irq(KBD_DEV, PNP_IDX_IRQ0, 1);
33 pnp_set_enable(KBD_DEV, 1);
35 pnp_set_logical_device(DBG_DEV); /* Debug */
36 pnp_set_iobase(DBG_DEV, PNP_IDX_IO0, 0x80);
37 pnp_set_enable(DBG_DEV, 1);
39 pnp_set_logical_device(REGS_DEV);
40 pnp_set_iobase(REGS_DEV, PNP_IDX_IO0, 0x600);
41 pnp_set_enable(REGS_DEV, 1);
43 shc4307_exit_ext_func_mode(CMOS_DEV);
46 static void bootblock_southbridge_init(void) {