Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/pci ichlpcib(4), tco(4): Rename iot -> pmt, ioh...
details: https://anonhg.NetBSD.org/src/rev/1cb4df49b726
branches: trunk
changeset: 370644:1cb4df49b726
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Sep 22 14:42:29 2022 +0000
description:
ichlpcib(4), tco(4): Rename iot -> pmt, ioh -> pmh.
Makes it clearer that this is specifically about the power management
controller (PMC) registers relative to PMBASE.
diffstat:
sys/arch/x86/pci/ichlpcib.c | 26 +++++++++++++-------------
sys/arch/x86/pci/tco.c | 44 ++++++++++++++++++++++----------------------
sys/arch/x86/pci/tco.h | 6 +++---
3 files changed, 38 insertions(+), 38 deletions(-)
diffs (244 lines):
diff -r f48b861b6c4b -r 1cb4df49b726 sys/arch/x86/pci/ichlpcib.c
--- a/sys/arch/x86/pci/ichlpcib.c Thu Sep 22 14:42:09 2022 +0000
+++ b/sys/arch/x86/pci/ichlpcib.c Thu Sep 22 14:42:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ichlpcib.c,v 1.57 2022/09/22 14:42:09 riastradh Exp $ */
+/* $NetBSD: ichlpcib.c,v 1.58 2022/09/22 14:42:29 riastradh Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.57 2022/09/22 14:42:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.58 2022/09/22 14:42:29 riastradh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -85,8 +85,8 @@
pcireg_t sc_rcba_reg;
/* Power management variables. */
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
+ bus_space_tag_t sc_pmt;
+ bus_space_handle_t sc_pmh;
bus_size_t sc_iosize;
/* HPET variables. */
@@ -339,10 +339,10 @@
* than LPCIB_PCI_PM_SIZE. It makes impossible to use
* pci_mapreg_submap() because the function does range check.
*/
- sc->sc_iot = pa->pa_iot;
+ sc->sc_pmt = pa->pa_iot;
pmbase = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_PCI_PMBASE);
- if (bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(pmbase),
- LPCIB_PCI_PM_SIZE, 0, &sc->sc_ioh) != 0) {
+ if (bus_space_map(sc->sc_pmt, PCI_MAPREG_IO_ADDR(pmbase),
+ LPCIB_PCI_PM_SIZE, 0, &sc->sc_pmh) != 0) {
aprint_error_dev(self,
"can't map power management i/o space\n");
return;
@@ -517,7 +517,7 @@
if (sc->sc_has_rcba)
bus_space_unmap(sc->sc_rcbat, sc->sc_rcbah, LPCIB_RCBA_SIZE);
- bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
+ bus_space_unmap(sc->sc_pmt, sc->sc_pmh, sc->sc_iosize);
return pcibdetach(self, flags);
}
@@ -606,7 +606,7 @@
}
/* Attach our PM timer with the generic acpipmtimer function */
- sc->sc_pmtimer = acpipmtimer_attach(self, sc->sc_iot, sc->sc_ioh,
+ sc->sc_pmtimer = acpipmtimer_attach(self, sc->sc_pmt, sc->sc_pmh,
PMC_PM1_TMR, 0);
}
@@ -639,8 +639,8 @@
arg.ta_version = TCO_VERSION_RCBA;
else
arg.ta_version = TCO_VERSION_PCIB;
- arg.ta_iot = sc->sc_iot;
- arg.ta_ioh = sc->sc_ioh;
+ arg.ta_pmt = sc->sc_pmt;
+ arg.ta_pmh = sc->sc_pmh;
arg.ta_rcbat = sc->sc_rcbat;
arg.ta_rcbah = sc->sc_rcbah;
arg.ta_pcib = &sc->sc_pcib;
@@ -667,9 +667,9 @@
* Intel ICH SpeedStep support.
*/
#define SS_READ(sc, reg) \
- bus_space_read_1((sc)->sc_iot, (sc)->sc_ioh, (reg))
+ bus_space_read_1((sc)->sc_pmt, (sc)->sc_pmh, (reg))
#define SS_WRITE(sc, reg, val) \
- bus_space_write_1((sc)->sc_iot, (sc)->sc_ioh, (reg), (val))
+ bus_space_write_1((sc)->sc_pmt, (sc)->sc_pmh, (reg), (val))
/*
* Linux driver says that SpeedStep on older chipsets cause
diff -r f48b861b6c4b -r 1cb4df49b726 sys/arch/x86/pci/tco.c
--- a/sys/arch/x86/pci/tco.c Thu Sep 22 14:42:09 2022 +0000
+++ b/sys/arch/x86/pci/tco.c Thu Sep 22 14:42:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tco.c,v 1.6 2022/09/22 14:42:09 riastradh Exp $ */
+/* $NetBSD: tco.c,v 1.7 2022/09/22 14:42:29 riastradh Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tco.c,v 1.6 2022/09/22 14:42:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tco.c,v 1.7 2022/09/22 14:42:29 riastradh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -55,8 +55,8 @@
struct tco_softc {
struct sysmon_wdog sc_smw;
- bus_space_tag_t sc_iot;
- bus_space_handle_t sc_ioh;
+ bus_space_tag_t sc_pmt;
+ bus_space_handle_t sc_pmh;
bus_space_tag_t sc_rcbat;
bus_space_handle_t sc_rcbah;
struct pcib_softc * sc_pcib;
@@ -90,7 +90,7 @@
{
struct tco_attach_args *ta = aux;
- if (ta->ta_iot == 0)
+ if (ta->ta_pmt == 0)
return 0;
switch (ta->ta_version) {
@@ -113,8 +113,8 @@
/* Retrieve bus info shared with parent/siblings */
sc->sc_version = ta->ta_version;
- sc->sc_iot = ta->ta_iot;
- sc->sc_ioh = ta->ta_ioh;
+ sc->sc_pmt = ta->ta_pmt;
+ sc->sc_pmh = ta->ta_pmh;
sc->sc_rcbat = ta->ta_rcbat;
sc->sc_rcbah = ta->ta_rcbah;
sc->sc_pcib = ta->ta_pcib;
@@ -129,7 +129,7 @@
* Enable TCO timeout SMI only if the hardware reset does not
* work. We don't know what the SMBIOS does.
*/
- ioreg = bus_space_read_4(sc->sc_iot, sc->sc_ioh, PMC_SMI_EN);
+ ioreg = bus_space_read_4(sc->sc_pmt, sc->sc_pmh, PMC_SMI_EN);
ioreg &= ~PMC_SMI_EN_TCO_EN;
/*
@@ -140,7 +140,7 @@
ioreg |= PMC_SMI_EN_TCO_EN;
}
if ((ioreg & PMC_SMI_EN_GBL_SMI_EN) != 0) {
- bus_space_write_4(sc->sc_iot, sc->sc_ioh, PMC_SMI_EN, ioreg);
+ bus_space_write_4(sc->sc_pmt, sc->sc_pmh, PMC_SMI_EN, ioreg);
}
/* Reset the watchdog status registers. */
@@ -243,18 +243,18 @@
switch (sc->sc_version) {
case TCO_VERSION_RCBA:
/* ICH6 or newer */
- ich6period = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
+ ich6period = bus_space_read_2(sc->sc_pmt, sc->sc_pmh,
PMC_TCO_TMR2);
ich6period &= 0xfc00;
- bus_space_write_2(sc->sc_iot, sc->sc_ioh,
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh,
PMC_TCO_TMR2, ich6period | period);
break;
case TCO_VERSION_PCIB:
/* ICH5 or older */
- ich5period = bus_space_read_1(sc->sc_iot, sc->sc_ioh,
+ ich5period = bus_space_read_1(sc->sc_pmt, sc->sc_pmh,
PMC_TCO_TMR);
ich5period &= 0xc0;
- bus_space_write_1(sc->sc_iot, sc->sc_ioh,
+ bus_space_write_1(sc->sc_pmt, sc->sc_pmh,
PMC_TCO_TMR, ich5period | period);
break;
}
@@ -275,10 +275,10 @@
/* any value is allowed */
switch (sc->sc_version) {
case TCO_VERSION_RCBA:
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO_RLD, 1);
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO_RLD, 1);
break;
case TCO_VERSION_PCIB:
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, PMC_TCO_RLD, 1);
+ bus_space_write_1(sc->sc_pmt, sc->sc_pmh, PMC_TCO_RLD, 1);
break;
}
@@ -290,9 +290,9 @@
{
uint16_t ioreg;
- ioreg = bus_space_read_2(sc->sc_iot, sc->sc_ioh, PMC_TCO1_CNT);
+ ioreg = bus_space_read_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO1_CNT);
ioreg |= PMC_TCO1_CNT_TCO_TMR_HLT;
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO1_CNT, ioreg);
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO1_CNT, ioreg);
}
static void
@@ -300,19 +300,19 @@
{
uint16_t ioreg;
- ioreg = bus_space_read_2(sc->sc_iot, sc->sc_ioh, PMC_TCO1_CNT);
+ ioreg = bus_space_read_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO1_CNT);
ioreg &= ~PMC_TCO1_CNT_TCO_TMR_HLT;
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO1_CNT, ioreg);
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO1_CNT, ioreg);
}
static void
tcotimer_status_reset(struct tco_softc *sc)
{
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO1_STS,
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO1_STS,
PMC_TCO1_STS_TIMEOUT);
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO2_STS,
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO2_STS,
PMC_TCO2_STS_BOOT_STS);
- bus_space_write_2(sc->sc_iot, sc->sc_ioh, PMC_TCO2_STS,
+ bus_space_write_2(sc->sc_pmt, sc->sc_pmh, PMC_TCO2_STS,
PMC_TCO2_STS_SECONDS_TO_STS);
}
diff -r f48b861b6c4b -r 1cb4df49b726 sys/arch/x86/pci/tco.h
--- a/sys/arch/x86/pci/tco.h Thu Sep 22 14:42:09 2022 +0000
+++ b/sys/arch/x86/pci/tco.h Thu Sep 22 14:42:29 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tco.h,v 1.3 2022/09/22 14:41:49 riastradh Exp $ */
+/* $NetBSD: tco.h,v 1.4 2022/09/22 14:42:29 riastradh Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -41,8 +41,8 @@
TCO_VERSION_PCIB = 0,
TCO_VERSION_RCBA = 1,
} ta_version;
- bus_space_tag_t ta_iot;
- bus_space_handle_t ta_ioh;
+ bus_space_tag_t ta_pmt;
+ bus_space_handle_t ta_pmh;
bus_space_tag_t ta_rcbat;
bus_space_handle_t ta_rcbah;
struct pcib_softc * ta_pcib;
Home |
Main Index |
Thread Index |
Old Index