From 236efae6a954eaf6323f57466bc753fcdfefc9e2 Mon Sep 17 00:00:00 2001 From: Mathew Kanner Date: Wed, 31 Mar 2004 00:11:24 +0000 Subject: [PATCH] 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(-) diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 376fee83464..2cb9118de7f 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -692,13 +692,24 @@ ich_pci_attach(device_t dev) sc->sample_size = 2; } + /* + * 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;