From 1912ffb2e582b58079d49648b471e61fafbc5a73 Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 29 Jan 2018 00:22:30 +0000 Subject: [PATCH] Add ISA PNP tables to ISA drivers. Fix a few incidental comments. ACPI ISA PBP tables not tagged, there's bigger issues with them. --- sys/amd64/amd64/fpu.c | 1 + sys/dev/ata/ata-isa.c | 1 + sys/dev/atkbdc/psm.c | 2 +- sys/dev/sbni/if_sbni_isa.c | 1 + sys/dev/sound/isa/ess.c | 1 + sys/dev/sound/isa/gusc.c | 3 +-- sys/dev/sound/isa/mss.c | 3 +-- sys/dev/sound/isa/sbc.c | 1 + sys/i386/i386/npx.c | 1 + sys/isa/vga_isa.c | 11 ++++++++++- sys/powerpc/mpc85xx/atpic.c | 6 +++--- sys/sparc64/sparc64/rtc.c | 11 ++++++----- sys/x86/isa/atpic.c | 31 ++++++++++++++++--------------- sys/x86/isa/atrtc.c | 1 + sys/x86/isa/clock.c | 1 + sys/x86/isa/isa_dma.c | 1 + sys/x86/isa/orm.c | 1 + sys/x86/pci/pci_bus.c | 4 ++-- sys/x86/x86/nexus.c | 1 + 19 files changed, 51 insertions(+), 31 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 798e7f4c1515..ede5ad03af01 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -917,6 +917,7 @@ static driver_t fpupnp_driver = { static devclass_t fpupnp_devclass; DRIVER_MODULE(fpupnp, acpi, fpupnp_driver, fpupnp_devclass, 0, 0); +ISA_PNP_INFO(fpupnp_ids); #endif /* DEV_ISA */ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", diff --git a/sys/dev/ata/ata-isa.c b/sys/dev/ata/ata-isa.c index eabb21a8d01e..680d87494fec 100644 --- a/sys/dev/ata/ata-isa.c +++ b/sys/dev/ata/ata-isa.c @@ -207,3 +207,4 @@ static driver_t ata_isa_driver = { DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); +ISA_PNP_INFO(ata_ids); diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 3c59b6518acf..d233304a819f 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -7186,5 +7186,5 @@ psmcpnp_attach(device_t dev) DRIVER_MODULE(psmcpnp, isa, psmcpnp_driver, psmcpnp_devclass, 0, 0); DRIVER_MODULE(psmcpnp, acpi, psmcpnp_driver, psmcpnp_devclass, 0, 0); - +ISA_PNP_INFO(psmcpnp_ids); #endif /* DEV_ISA */ diff --git a/sys/dev/sbni/if_sbni_isa.c b/sys/dev/sbni/if_sbni_isa.c index 9a922b8ec24c..8874fe6e55cf 100644 --- a/sys/dev/sbni/if_sbni_isa.c +++ b/sys/dev/sbni/if_sbni_isa.c @@ -166,3 +166,4 @@ sbni_attach_isa(device_t dev) DRIVER_MODULE(sbni, isa, sbni_isa_driver, sbni_isa_devclass, 0, 0); MODULE_DEPEND(sbni, isa, 1, 1, 1); +ISA_PNP_INFO(sbni_ids); diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 6849830efc0b..c2f50a8a32bd 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -1016,3 +1016,4 @@ static driver_t esscontrol_driver = { DRIVER_MODULE(esscontrol, isa, esscontrol_driver, esscontrol_devclass, 0, 0); DRIVER_MODULE(esscontrol, acpi, esscontrol_driver, esscontrol_devclass, 0, 0); +ISA_PNP_INFO(essc_ids); diff --git a/sys/dev/sound/isa/gusc.c b/sys/dev/sound/isa/gusc.c index 62dc22703675..302f2f180999 100644 --- a/sys/dev/sound/isa/gusc.c +++ b/sys/dev/sound/isa/gusc.c @@ -673,5 +673,4 @@ DRIVER_MODULE(snd_gusc, isa, gusc_driver, gusc_devclass, 0, 0); DRIVER_MODULE(snd_gusc, acpi, gusc_driver, gusc_devclass, 0, 0); MODULE_DEPEND(snd_gusc, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_gusc, 1); - - +ISA_PNP_INFO(gusc_ids); diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index f03f4af26a04..b79c4fc1c337 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -2293,5 +2293,4 @@ static driver_t guspcm_driver = { DRIVER_MODULE(snd_guspcm, gusc, guspcm_driver, pcm_devclass, 0, 0); MODULE_DEPEND(snd_guspcm, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_guspcm, 1); - - +ISA_PNP_INFO(pnpmss_ids); diff --git a/sys/dev/sound/isa/sbc.c b/sys/dev/sound/isa/sbc.c index 8b8fd50d79ec..d16e45bb3011 100644 --- a/sys/dev/sound/isa/sbc.c +++ b/sys/dev/sound/isa/sbc.c @@ -750,3 +750,4 @@ DRIVER_MODULE(snd_sbc, isa, sbc_driver, sbc_devclass, 0, 0); DRIVER_MODULE(snd_sbc, acpi, sbc_driver, sbc_devclass, 0, 0); MODULE_DEPEND(snd_sbc, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_sbc, 1); +ISA_PNP_INFO(sbc_ids); diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index d2a4bd99c391..bbb47b86f184 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -1277,6 +1277,7 @@ static devclass_t npxisa_devclass; DRIVER_MODULE(npxisa, isa, npxisa_driver, npxisa_devclass, 0, 0); DRIVER_MODULE(npxisa, acpi, npxisa_driver, npxisa_devclass, 0, 0); +ISA_PNP_INFO(npxisa_ids); #endif /* DEV_ISA */ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c index b2e32a6c6c90..0d1f042fa78f 100644 --- a/sys/isa/vga_isa.c +++ b/sys/isa/vga_isa.c @@ -61,6 +61,13 @@ __FBSDID("$FreeBSD$"); #include #include +#define VGA_ID 0x0009d041 /* PNP0900 */ + +static struct isa_pnp_id vga_ids[] = { + { VGA_ID, NULL }, /* PNP0900 */ + { 0, NULL }, +}; + static void vga_suspend(device_t dev) { @@ -175,7 +182,8 @@ isavga_probe(device_t dev) adp.va_io_base, adp.va_io_size); bus_set_resource(dev, SYS_RES_MEMORY, 0, adp.va_mem_base, adp.va_mem_size); - isa_set_vendorid(dev, PNP_EISAID("PNP0900")); + isa_set_vendorid(dev, VGA_ID); + isa_set_logicalid(dev, VGA_ID); #if 0 isa_set_port(dev, adp.va_io_base); isa_set_portsize(dev, adp.va_io_size); @@ -383,3 +391,4 @@ static driver_t vgapm_driver = { }; DRIVER_MODULE(vgapm, vgapci, vgapm_driver, vgapm_devclass, 0, 0); +ISA_PNP_INFO(vga_ids); diff --git a/sys/powerpc/mpc85xx/atpic.c b/sys/powerpc/mpc85xx/atpic.c index bb56b709aac2..6675d73f0c89 100644 --- a/sys/powerpc/mpc85xx/atpic.c +++ b/sys/powerpc/mpc85xx/atpic.c @@ -112,13 +112,14 @@ static driver_t atpic_isa_driver = { static devclass_t atpic_devclass; -DRIVER_MODULE(atpic, isa, atpic_isa_driver, atpic_devclass, 0, 0); - static struct isa_pnp_id atpic_ids[] = { { 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, { 0 } }; +DRIVER_MODULE(atpic, isa, atpic_isa_driver, atpic_devclass, 0, 0); +ISA_PNP_INFO(atpic_ids); + static __inline uint8_t atpic_read(struct atpic_softc *sc, int icu, int ofs) { @@ -363,4 +364,3 @@ atpic_ofw_translate_code(device_t dev, u_int irq, int code, *pol = INTR_POLARITY_CONFORM; } } - diff --git a/sys/sparc64/sparc64/rtc.c b/sys/sparc64/sparc64/rtc.c index 61989593062b..abd5825f11b1 100644 --- a/sys/sparc64/sparc64/rtc.c +++ b/sys/sparc64/sparc64/rtc.c @@ -122,7 +122,13 @@ static driver_t rtc_isa_driver = { sizeof(struct mc146818_softc), }; +static struct isa_pnp_id rtc_isa_ids[] = { + { 0x000bd041, RTC_DESC }, /* PNP0B00 */ + { 0 } +}; + DRIVER_MODULE(rtc, isa, rtc_isa_driver, rtc_devclass, 0, 0); +ISA_PNP_INFO(rtc_isa_ids); #endif static u_int pc87317_getcent(device_t dev); @@ -145,11 +151,6 @@ rtc_ebus_probe(device_t dev) } #ifdef DEV_ISA -static struct isa_pnp_id rtc_isa_ids[] = { - { 0x000bd041, RTC_DESC }, /* PNP0B00 */ - { 0 } -}; - static int rtc_isa_probe(device_t dev) { diff --git a/sys/x86/isa/atpic.c b/sys/x86/isa/atpic.c index 8be67f50c859..58baf7c540ab 100644 --- a/sys/x86/isa/atpic.c +++ b/sys/x86/isa/atpic.c @@ -565,6 +565,21 @@ atpic_attach(device_t dev) return (0); } +/* + * Return a bitmap of the current interrupt requests. This is 8259-specific + * and is only suitable for use at probe time. + */ +intrmask_t +isa_irq_pending(void) +{ + u_char irr1; + u_char irr2; + + irr1 = inb(IO_ICU1); + irr2 = inb(IO_ICU2); + return ((irr2 << 8) | irr1); +} + static device_method_t atpic_methods[] = { /* Device interface */ DEVMETHOD(device_probe, atpic_probe), @@ -586,19 +601,5 @@ static devclass_t atpic_devclass; DRIVER_MODULE(atpic, isa, atpic_driver, atpic_devclass, 0, 0); DRIVER_MODULE(atpic, acpi, atpic_driver, atpic_devclass, 0, 0); - -/* - * Return a bitmap of the current interrupt requests. This is 8259-specific - * and is only suitable for use at probe time. - */ -intrmask_t -isa_irq_pending(void) -{ - u_char irr1; - u_char irr2; - - irr1 = inb(IO_ICU1); - irr2 = inb(IO_ICU2); - return ((irr2 << 8) | irr1); -} +ISA_PNP_INFO(atpic_ids); #endif /* DEV_ISA */ diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c index 3a430cb3e112..b481bc6cdb41 100644 --- a/sys/x86/isa/atrtc.c +++ b/sys/x86/isa/atrtc.c @@ -415,6 +415,7 @@ static devclass_t atrtc_devclass; DRIVER_MODULE(atrtc, isa, atrtc_driver, atrtc_devclass, 0, 0); DRIVER_MODULE(atrtc, acpi, atrtc_driver, atrtc_devclass, 0, 0); +ISA_PNP_INFO(atrtc_ids); #include "opt_ddb.h" #ifdef DDB diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c index 4afefd3dad7e..f0162e7af295 100644 --- a/sys/x86/isa/clock.c +++ b/sys/x86/isa/clock.c @@ -667,5 +667,6 @@ static devclass_t attimer_devclass; DRIVER_MODULE(attimer, isa, attimer_driver, attimer_devclass, 0, 0); DRIVER_MODULE(attimer, acpi, attimer_driver, attimer_devclass, 0, 0); +ISA_PNP_INFO(attimer_ids); #endif /* DEV_ISA */ diff --git a/sys/x86/isa/isa_dma.c b/sys/x86/isa/isa_dma.c index 6e48613e34fd..f2f41d13b28b 100644 --- a/sys/x86/isa/isa_dma.c +++ b/sys/x86/isa/isa_dma.c @@ -612,3 +612,4 @@ static devclass_t atdma_devclass; DRIVER_MODULE(atdma, isa, atdma_driver, atdma_devclass, 0, 0); DRIVER_MODULE(atdma, acpi, atdma_driver, atdma_devclass, 0, 0); +ISA_PNP_INFO(atdma_ids); diff --git a/sys/x86/isa/orm.c b/sys/x86/isa/orm.c index 6caee8838855..fee9aae8b5f6 100644 --- a/sys/x86/isa/orm.c +++ b/sys/x86/isa/orm.c @@ -188,3 +188,4 @@ static driver_t orm_driver = { static devclass_t orm_devclass; DRIVER_MODULE(orm, isa, orm_driver, orm_devclass, 0, 0); +ISA_PNP_INFO(orm_ids); diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c index 49254b95253e..7c5df9ae9de0 100644 --- a/sys/x86/pci/pci_bus.c +++ b/sys/x86/pci/pci_bus.c @@ -683,8 +683,7 @@ DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, hostb_devclass, 0, 0); * ID is available and the PCI BIOS isn't, but for now we just * eat the PnP ID and do nothing else. * - * XXX we should silence this probe, as it will generally confuse - * people. + * we silence this probe, as it will generally confuse people. */ static struct isa_pnp_id pcibus_pnp_ids[] = { { 0x030ad041 /* PNP0A03 */, "PCI Bus" }, @@ -747,6 +746,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_1(pcib, pcibios_pcib_driver, pcibios_pcib_pci_methods, sizeof(struct pcib_softc), pcib_driver); DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0); +ISA_PNP_INFO(pcibus_pnp_ids); static int pcibios_pcib_probe(device_t dev) diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c index f115fdd93824..71cd29507420 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -901,4 +901,5 @@ static driver_t sysresource_driver = { static devclass_t sysresource_devclass; DRIVER_MODULE(sysresource, isa, sysresource_driver, sysresource_devclass, 0, 0); +ISA_PNP_INFO(sysresource_ids); #endif /* DEV_ISA */