Author: myles Date: 2008-11-15 00:03:54 +0100 (Sat, 15 Nov 2008) New Revision: 1028
Modified: coreboot-v3/superio/fintek/f71805f/dts coreboot-v3/superio/fintek/f71805f/superio.c coreboot-v3/superio/ite/it8712f/dts coreboot-v3/superio/ite/it8712f/superio.c coreboot-v3/superio/ite/it8716f/dts coreboot-v3/superio/ite/it8716f/superio.c Log: This patch updates the other supported SuperIOs to use the PNP dts changes.
It shouldn't break anything that was working, but I didn't try to fix SuperIOs that weren't compiling when I started.
Compile tested on 1. amd/dbm690t for ite/it8712f 2. amp/tinygx for ite/it8716f
I'd already updated fintek/f71805 before I realized jetway doesn't compile.
Signed-off-by: Myles Watson mylesgw@gmail.com Acked-by: Ronald G. Minnich rminnich@gmail.com
Modified: coreboot-v3/superio/fintek/f71805f/dts =================================================================== --- coreboot-v3/superio/fintek/f71805f/dts 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/fintek/f71805f/dts 2008-11-14 23:03:54 UTC (rev 1028) @@ -22,42 +22,35 @@ device_operations = "f71805f_ops";
/* Floppy */ - floppydev = "0"; floppyenable = "0"; floppyio = "0x3f0"; floppyirq = "6"; floppydrq = "2";
/* COM1 */ - com1dev = "1"; com1enable = "0"; com1io = "0x3f8"; com1irq = "4";
/* COM2 */ - com2dev = "2"; com2enable = "0"; com2io = "0x2f8"; com2irq = "3";
/* Parallel port */ - ppdev = "3"; ppenable = "0"; ppio = "0x378"; ppirq = "7"; /* Hardware Monitor */ - hwmdev = "4"; hwmenable = "0"; hwmio = "0x295"; hwmirq = "0"; /* TODO? */
/* GPIO */ - gpiodev = "6"; gpioenable = "0"; gpioirq = "0"; /* TODO? */
/* PME */ - pmedev = "10"; pmeenable = "0"; };
Modified: coreboot-v3/superio/fintek/f71805f/superio.c =================================================================== --- coreboot-v3/superio/fintek/f71805f/superio.c 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/fintek/f71805f/superio.c 2008-11-14 23:03:54 UTC (rev 1028) @@ -38,25 +38,25 @@ static void pnp_enter_conf_state(struct device *dev); static void pnp_exit_conf_state(struct device *dev);
-static void pnp_enter_conf_state(struct device *dev) +static void pnp_enter_conf_state(struct device *dev) { outb(0x87, dev->path.pnp.port); }
-static void pnp_exit_conf_state(struct device *dev) +static void pnp_exit_conf_state(struct device *dev) { outb(0xaa, dev->path.pnp.port); }
void f71805f_pnp_set_resources(struct device *dev) { - pnp_enter_conf_state(dev); + pnp_enter_conf_state(dev); pnp_set_resources(dev); - pnp_exit_conf_state(dev); -} + pnp_exit_conf_state(dev); +}
void f71805f_pnp_enable_resources(struct device *dev) -{ +{ pnp_enter_conf_state(dev); pnp_enable_resources(dev); pnp_exit_conf_state(dev); @@ -64,10 +64,10 @@
void f71805f_pnp_enable(struct device *dev) { - pnp_enter_conf_state(dev); + pnp_enter_conf_state(dev); pnp_set_logical_device(dev); pnp_set_enable(dev, dev->enabled); - pnp_exit_conf_state(dev); + pnp_exit_conf_state(dev); }
static void f71805f_init(struct device *dev) @@ -77,19 +77,19 @@
if (!dev->enabled) return; - + switch (dev->path.pnp.device) { - case F71805F_COM1: + case F71805F_COM1: res0 = find_resource(dev, PNP_IDX_IO0); /* TODO: Fix these */ //uart8250_init(res0->base, &conf->sp1); break; - + case F71805F_COM2: res1 = find_resource(dev, PNP_IDX_IO0); //uart8250_init(res0->base, &conf->sp2); break; - + /* No KBC on F71805f */ } } @@ -113,5 +113,27 @@
static void phase2_setup_scan_bus(struct device *dev) { + /* Get dts values and populate pnp_dev_info. */ + const struct superio_fintek_f71805f_dts_config * const conf = dev->device_configuration; + + /* COM1 */ + pnp_dev_info[F71805F_COM1].enable = conf->com1enable; + pnp_dev_info[F71805F_COM1].io0.val = conf->com1io; + pnp_dev_info[F71805F_COM1].irq0.val = conf->com1irq; + + /* COM2 */ + pnp_dev_info[F71805F_COM2].enable = conf->com2enable; + pnp_dev_info[F71805F_COM2].io0.val = conf->com2io; + pnp_dev_info[F71805F_COM2].irq0.val = conf->com2irq; + + /* Initialize SuperIO for PNP children. */ + if (!dev->links) { + dev->links = 1; + dev->link[0].dev = dev; + dev->link[0].children = NULL; + dev->link[0].link = 0; + } + + /* Call init with updated tables to create children. */ pnp_enable_devices(dev, &f71805f_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); }
Modified: coreboot-v3/superio/ite/it8712f/dts =================================================================== --- coreboot-v3/superio/ite/it8712f/dts 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/ite/it8712f/dts 2008-11-14 23:03:54 UTC (rev 1028) @@ -22,65 +22,54 @@ device_operations = "it8712f_ops";
/* Floppy */ - floppydev = "0"; floppyenable = "0"; floppyio = "0x3f0"; floppyirq = "6"; floppydrq = "2";
/* COM1 */ - com1dev = "1"; com1enable = "0"; com1io = "0x3f8"; com1irq = "4";
/* COM2 */ - com2dev = "2"; com2enable = "0"; com2io = "0x2f8"; com2irq = "3";
/* Parallel port */ - ppdev = "3"; ppenable = "0"; ppio = "0x378"; ppirq = "7";
/* Environment controller */ - ecdev = "4"; ecenable = "0"; ecio = "0x290"; ecirq = "9";
/* PS/2 keyboard */ - kbdev = "5"; kbenable = "0"; kbio = "0x60"; kbio2 = "0x64"; kbirq = "1";
/* PS/2 mouse */ - mousedev = "6"; mouseenable = "0"; mouseirq = "12";
/* GPIO */ - gpiodev = "7"; gpioenable = "0";
/* MIDI port */ - mididev = "8"; midienable = "0"; midiio = "0x300"; midiirq = "10";
/* Game port */ - gamedev = "9"; gameenable = "0"; gameio = "0x201";
/* Consumer IR */ - cirdev = "10"; cirenable = "0"; cirio = "0x310"; cirirq = "11";
Modified: coreboot-v3/superio/ite/it8712f/superio.c =================================================================== --- coreboot-v3/superio/ite/it8712f/superio.c 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/ite/it8712f/superio.c 2008-11-14 23:03:54 UTC (rev 1028) @@ -102,11 +102,12 @@ pnp_set_enable(dev, dev->enabled); pnp_exit_ext_func_mode(dev); } + static void it8712f_setup_scan_bus(struct device *dev);
struct device_operations it8712f_ops = { .phase3_chip_setup_dev = it8712f_setup_scan_bus, - .phase3_enable = it8712f_pnp_enable_resources, + .phase3_enable = it8712f_pnp_enable_resources, .phase4_read_resources = pnp_read_resources, .phase4_set_resources = it8712f_pnp_set_resources, .phase5_enable_resources = it8712f_pnp_enable, @@ -114,22 +115,86 @@ };
static struct pnp_info pnp_dev_info[] = { - {&it8712f_ops, IT8712F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0xff8, 0},}, - {&it8712f_ops, IT8712F_SP1, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, - {&it8712f_ops, IT8712F_SP2, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, - {&it8712f_ops, IT8712F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0xffc, 0},}, - {&it8712f_ops, IT8712F_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0xff8, 0}, {0xff8, 4},}, - {&it8712f_ops, IT8712F_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0xfff, 0}, {0xfff, 4},}, - {&it8712f_ops, IT8712F_KBCM, PNP_IRQ0,}, - {&it8712f_ops, IT8712F_GPIO,}, - {&it8712f_ops, IT8712F_MIDI, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, - {&it8712f_ops, IT8712F_GAME, PNP_IO0, {0xfff, 0},}, - {&it8712f_ops, IT8712F_IR, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, + /* Enable, All resources need by dev, io_info_structs */ + {&it8712f_ops, IT8712F_FDC, 0, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0xff8, 0},}, + {&it8712f_ops, IT8712F_SP1, 0, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, + {&it8712f_ops, IT8712F_SP2, 0, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, + {&it8712f_ops, IT8712F_PP, 0, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0xffc, 0},}, + {&it8712f_ops, IT8712F_EC, 0, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0xff8, 0}, {0xff8, 4},}, + {&it8712f_ops, IT8712F_KBCK, 0, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0xfff, 0}, {0xfff, 4},}, + {&it8712f_ops, IT8712F_KBCM, 0, PNP_IRQ0,}, + {&it8712f_ops, IT8712F_GPIO, 0, }, + {&it8712f_ops, IT8712F_MIDI, 0, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, + {&it8712f_ops, IT8712F_GAME, 0, PNP_IO0, {0xfff, 0},}, + {&it8712f_ops, IT8712F_IR, 0, PNP_IO0 | PNP_IRQ0, {0xff8, 0},}, };
static void it8712f_setup_scan_bus(struct device *dev) { + const struct superio_ite_it8712f_dts_config * const conf = dev->device_configuration; + + /* Floppy */ + pnp_dev_info[IT8712F_FDC].enable = conf->floppyenable; + pnp_dev_info[IT8712F_FDC].io0.val = conf->floppyio; + pnp_dev_info[IT8712F_FDC].irq0.val = conf->floppyirq; + pnp_dev_info[IT8712F_FDC].drq0.val = conf->floppydrq; + + /* COM1 */ + pnp_dev_info[IT8712F_SP1].enable = conf->com1enable; + pnp_dev_info[IT8712F_SP1].io0.val = conf->com1io; + pnp_dev_info[IT8712F_SP1].irq0.val = conf->com1irq; + + /* COM2 */ + pnp_dev_info[IT8712F_SP2].enable = conf->com2enable; + pnp_dev_info[IT8712F_SP2].io0.val = conf->com2io; + pnp_dev_info[IT8712F_SP2].irq0.val = conf->com2irq; + + /* Parallel port */ + pnp_dev_info[IT8712F_PP].enable = conf->ppenable; + pnp_dev_info[IT8712F_PP].io0.val = conf->ppio; + pnp_dev_info[IT8712F_PP].irq0.val = conf->ppirq; + + /* Environment controller */ + pnp_dev_info[IT8712F_EC].enable = conf->ecenable; + pnp_dev_info[IT8712F_EC].io0.val = conf->ecio; + pnp_dev_info[IT8712F_EC].irq0.val = conf->ecirq; + + /* Keyboard */ + pnp_dev_info[IT8712F_KBCK].enable = conf->kbenable; + pnp_dev_info[IT8712F_KBCK].io0.val = conf->kbio; + pnp_dev_info[IT8712F_KBCK].io1.val = conf->kbio2; + pnp_dev_info[IT8712F_KBCK].irq0.val = conf->kbirq; + + /* PS/2 mouse */ + pnp_dev_info[IT8712F_KBCM].enable = conf->mouseenable; + pnp_dev_info[IT8712F_KBCM].irq0.val = conf->mouseirq; + + /* GPIO */ + pnp_dev_info[IT8712F_GPIO].enable = conf->gpioenable; + + /* MIDI port */ + pnp_dev_info[IT8712F_MIDI].enable = conf->midienable; + pnp_dev_info[IT8712F_MIDI].io0.val = conf->midiio; + pnp_dev_info[IT8712F_MIDI].irq0.val = conf->midiirq; + + /* Game port */ + pnp_dev_info[IT8712F_GAME].enable = conf->gameenable; + pnp_dev_info[IT8712F_GAME].io0.val = conf->gameio; + + /* Consumer IR */ + pnp_dev_info[IT8712F_IR].enable = conf->cirenable; + pnp_dev_info[IT8712F_IR].io0.val = conf->cirio; + pnp_dev_info[IT8712F_IR].irq0.val = conf->cirirq; + + /* Initialize SuperIO for PNP children. */ + if (!dev->links) { + dev->links = 1; + dev->link[0].dev = dev; + dev->link[0].children = NULL; + dev->link[0].link = 0; + } + + /* Call init with updated tables to create children. */ pnp_enable_devices(dev, &it8712f_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } -
Modified: coreboot-v3/superio/ite/it8716f/dts =================================================================== --- coreboot-v3/superio/ite/it8716f/dts 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/ite/it8716f/dts 2008-11-14 23:03:54 UTC (rev 1028) @@ -22,65 +22,54 @@ device_operations = "it8716f_ops";
/* Floppy */ - floppydev = "0"; floppyenable = "0"; floppyio = "0x3f0"; floppyirq = "6"; floppydrq = "2";
/* COM1 */ - com1dev = "1"; com1enable = "0"; com1io = "0x3f8"; com1irq = "4";
/* COM2 */ - com2dev = "2"; com2enable = "0"; com2io = "0x2f8"; com2irq = "3";
/* Parallel port */ - ppdev = "3"; ppenable = "0"; ppio = "0x378"; ppirq = "7";
/* Environment controller */ - ecdev = "4"; ecenable = "0"; ecio = "0x290"; ecirq = "9";
/* PS/2 keyboard */ - kbdev = "5"; kbenable = "0"; kbio = "0x60"; kbio2 = "0x64"; kbirq = "1";
/* PS/2 mouse */ - mousedev = "6"; mouseenable = "0"; mouseirq = "12";
/* GPIO */ - gpiodev = "7"; gpioenable = "0";
/* MIDI port */ - mididev = "8"; midienable = "0"; midiio = "0x300"; midiirq = "10";
/* Game port */ - gamedev = "9"; gameenable = "0"; gameio = "0x201";
/* Consumer IR */ - cirdev = "10"; cirenable = "0"; cirio = "0x310"; cirirq = "11";
Modified: coreboot-v3/superio/ite/it8716f/superio.c =================================================================== --- coreboot-v3/superio/ite/it8716f/superio.c 2008-11-14 21:45:10 UTC (rev 1027) +++ coreboot-v3/superio/ite/it8716f/superio.c 2008-11-14 23:03:54 UTC (rev 1028) @@ -144,32 +144,99 @@ }
static void it8716f_setup_scan_bus(struct device *dev); + struct device_operations it8716f_ops = { - .phase2_setup_scan_bus = it8716f_setup_scan_bus, + .phase3_chip_setup_dev = it8716f_setup_scan_bus, + .phase3_enable = it8716f_pnp_enable_disable, .phase4_read_resources = pnp_read_resources, .phase4_set_resources = it8716f_pnp_set_resources, - .phase4_enable_disable = it8716f_pnp_enable_disable, .phase5_enable_resources = it8716f_pnp_enable_resources, .phase6_init = it8716f_init, };
static struct pnp_info pnp_dev_info[] = { - {&it8716f_ops, IT8716F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07f8, 0},}, - {&it8716f_ops, IT8716F_SP1, PNP_IO0 | PNP_IRQ0, {0x7f8, 0},}, - {&it8716f_ops, IT8716F_SP2, PNP_IO0 | PNP_IRQ0, {0x7f8, 0},}, - {&it8716f_ops, IT8716F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07f8, 0},}, - {&it8716f_ops, IT8716F_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x7f8, 0}, + /* Enable, All resources need by dev, io_info_structs */ + {&it8716f_ops, IT8716F_FDC, 0, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07f8, 0},}, + {&it8716f_ops, IT8716F_SP1, 0, PNP_IO0 | PNP_IRQ0, {0x7f8, 0},}, + {&it8716f_ops, IT8716F_SP2, 0, PNP_IO0 | PNP_IRQ0, {0x7f8, 0},}, + {&it8716f_ops, IT8716F_PP, 0, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07f8, 0},}, + {&it8716f_ops, IT8716F_EC, 0, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x7f8, 0}, {0x7f8, 0x4},}, - {&it8716f_ops, IT8716F_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x7ff, 0}, + {&it8716f_ops, IT8716F_KBCK, 0, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x7ff, 0}, {0x7ff, 0x4},}, - {&it8716f_ops, IT8716F_KBCM, PNP_IRQ0,}, - {&it8716f_ops, IT8716F_GPIO, PNP_IO1 | PNP_IO2, {0, 0}, {0x7f8, 0}, {0x7f8, 0},}, - {&it8716f_ops, IT8716F_MIDI, PNP_IO0 | PNP_IRQ0, {0x7fe, 0x4},}, - {&it8716f_ops, IT8716F_GAME, PNP_IO0, {0x7ff, 0},}, - {&it8716f_ops, IT8716F_IR,}, + {&it8716f_ops, IT8716F_KBCM, 0, PNP_IRQ0,}, + {&it8716f_ops, IT8716F_GPIO, 0, PNP_IO1 | PNP_IO2, {0, 0}, {0x7f8, 0}, {0x7f8, 0},}, + {&it8716f_ops, IT8716F_MIDI, 0, PNP_IO0 | PNP_IRQ0, {0x7fe, 0x4},}, + {&it8716f_ops, IT8716F_GAME, 0, PNP_IO0, {0x7ff, 0},}, + {&it8716f_ops, IT8716F_IR, 0,}, };
static void it8716f_setup_scan_bus(struct device *dev) { - pnp_enable_devices(dev, &it8716f_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); + const struct superio_ite_it8716f_dts_config * const conf = dev->device_configuration; + + /* Floppy */ + pnp_dev_info[IT8716F_FDC].enable = conf->floppyenable; + pnp_dev_info[IT8716F_FDC].io0.val = conf->floppyio; + pnp_dev_info[IT8716F_FDC].irq0.val = conf->floppyirq; + pnp_dev_info[IT8716F_FDC].drq0.val = conf->floppydrq; + + /* COM1 */ + pnp_dev_info[IT8716F_SP1].enable = conf->com1enable; + pnp_dev_info[IT8716F_SP1].io0.val = conf->com1io; + pnp_dev_info[IT8716F_SP1].irq0.val = conf->com1irq; + + /* COM2 */ + pnp_dev_info[IT8716F_SP2].enable = conf->com2enable; + pnp_dev_info[IT8716F_SP2].io0.val = conf->com2io; + pnp_dev_info[IT8716F_SP2].irq0.val = conf->com2irq; + + /* Parallel port */ + pnp_dev_info[IT8716F_PP].enable = conf->ppenable; + pnp_dev_info[IT8716F_PP].io0.val = conf->ppio; + pnp_dev_info[IT8716F_PP].irq0.val = conf->ppirq; + + /* Environment controller */ + pnp_dev_info[IT8716F_EC].enable = conf->ecenable; + pnp_dev_info[IT8716F_EC].io0.val = conf->ecio; + pnp_dev_info[IT8716F_EC].irq0.val = conf->ecirq; + + /* Keyboard */ + pnp_dev_info[IT8716F_KBCK].enable = conf->kbenable; + pnp_dev_info[IT8716F_KBCK].io0.val = conf->kbio; + pnp_dev_info[IT8716F_KBCK].io1.val = conf->kbio2; + pnp_dev_info[IT8716F_KBCK].irq0.val = conf->kbirq; + + /* PS/2 mouse */ + pnp_dev_info[IT8716F_KBCM].enable = conf->mouseenable; + pnp_dev_info[IT8716F_KBCM].irq0.val = conf->mouseirq; + + /* GPIO */ + pnp_dev_info[IT8716F_GPIO].enable = conf->gpioenable; + + /* MIDI port */ + pnp_dev_info[IT8716F_MIDI].enable = conf->midienable; + pnp_dev_info[IT8716F_MIDI].io0.val = conf->midiio; + pnp_dev_info[IT8716F_MIDI].irq0.val = conf->midiirq; + + /* Game port */ + pnp_dev_info[IT8716F_GAME].enable = conf->gameenable; + pnp_dev_info[IT8716F_GAME].io0.val = conf->gameio; + + /* Consumer IR */ + pnp_dev_info[IT8716F_IR].enable = conf->cirenable; + pnp_dev_info[IT8716F_IR].io0.val = conf->cirio; + pnp_dev_info[IT8716F_IR].irq0.val = conf->cirirq; + + /* Initialize SuperIO for PNP children. */ + if (!dev->links) { + dev->links = 1; + dev->link[0].dev = dev; + dev->link[0].children = NULL; + dev->link[0].link = 0; + } + + /* Call init with updated tables to create children. */ + pnp_enable_devices(dev, &it8716f_ops, + ARRAY_SIZE(pnp_dev_info), pnp_dev_info); }