From bc542b543dceb077637763284c40ef7de01cc60a Mon Sep 17 00:00:00 2001 From: matk Date: Wed, 31 Mar 2004 00:11:24 +0000 Subject: By default, ich4 has NAMBAR and NABMBAR i/o spaces as read-only. Need to enable "legacy support", by poking into pci config space. (comment from the patch) Submited by: Autrijus Tang Approved by: tanimura (mentor) --- sys/dev/sound/pci/ich.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 376fee8..2cb9118 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -693,12 +693,23 @@ ich_pci_attach(device_t dev) } /* + * By default, ich4 has NAMBAR and NABMBAR i/o spaces as + * read-only. Need to enable "legacy support", by poking into + * pci config space. The driver should use MMBAR and MBBAR, + * but doing so will mess things up here. ich4 has enough new + * features it warrants it's own driver. + */ + if (pci_get_devid(dev) == ICH4ID) { + pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1); + } + + /* * Enable bus master. On ich4/5 this may prevent the detection of * the primary codec becoming ready in ich_init(). */ pci_enable_busmaster(dev); - if ((pci_get_devid(dev) == ICH4ID) || (pci_get_devid(dev) == ICH5ID)) { + if (pci_get_devid(dev) == ICH5ID) { sc->nambarid = PCIR_MMBAR; sc->nabmbarid = PCIR_MBBAR; sc->regtype = SYS_RES_MEMORY; -- cgit v1.1