diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2006-03-04 05:36:43 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2006-03-04 05:36:43 +0000 |
commit | 2f6b75939571c8eda00d4473203ef29575b9ac20 (patch) | |
tree | 16fe231e9fdbd510cff2a823270ec03f29642364 /sys/dev | |
parent | 13f7d32584514eeffeea39f3ffd0bb2a51d5640d (diff) |
Add the gasio magic to slow/speed cpu.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpicpu.c | 53 | ||||
-rw-r--r-- | sys/dev/acpi/acpidev.h | 19 |
2 files changed, 44 insertions, 28 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index 11f5f6e2401..2c700b36370 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.5 2006/02/26 17:28:26 marco Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.6 2006/03/04 05:36:42 marco Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -70,6 +70,9 @@ acpicpu_match(struct device *parent, void *match, void *aux) { struct acpi_attach_args *aa = aux; struct cfdata *cf = match; + + printf("acpicpu_match: %s %s\n", + aa->aaa_name, cf->cf_driver->cd_name); /* sanity */ if (aa->aaa_name == NULL || @@ -125,6 +128,7 @@ acpicpu_getpct(struct acpicpu_softc *sc) { struct aml_value res, env; struct acpi_context *ctx; + char pb[8]; memset(&res, 0, sizeof(res)); memset(&env, 0, sizeof(env)); @@ -158,20 +162,47 @@ acpicpu_getpct(struct acpicpu_softc *sc) dnprintf(10, "_PCT(ctrl) : %02x %04x %02x %02x %02x %02x %016x\n", sc->sc_pct.pct_ctrl.grd_descriptor, sc->sc_pct.pct_ctrl.grd_length, - sc->sc_pct.pct_ctrl.grd_access_type, - sc->sc_pct.pct_ctrl.grd_reg_width, - sc->sc_pct.pct_ctrl.grd_reg_bit_offset, - sc->sc_pct.pct_ctrl.grd_address_size, - sc->sc_pct.pct_ctrl.grd_address); + sc->sc_pct.pct_ctrl.grd_gas.address_space_id, + sc->sc_pct.pct_ctrl.grd_gas.register_bit_width, + sc->sc_pct.pct_ctrl.grd_gas.register_bit_offset, + sc->sc_pct.pct_ctrl.grd_gas.access_size, + sc->sc_pct.pct_ctrl.grd_gas.address); dnprintf(10, "_PCT(status): %02x %04x %02x %02x %02x %02x %016x\n", sc->sc_pct.pct_status.grd_descriptor, sc->sc_pct.pct_status.grd_length, - sc->sc_pct.pct_status.grd_access_type, - sc->sc_pct.pct_status.grd_reg_width, - sc->sc_pct.pct_status.grd_reg_bit_offset, - sc->sc_pct.pct_status.grd_address_size, - sc->sc_pct.pct_status.grd_address); + sc->sc_pct.pct_status.grd_gas.address_space_id, + sc->sc_pct.pct_status.grd_gas.register_bit_width, + sc->sc_pct.pct_status.grd_gas.register_bit_offset, + sc->sc_pct.pct_status.grd_gas.access_size, + sc->sc_pct.pct_status.grd_gas.address); + + acpi_debug = 111; + acpi_gasio(sc->sc_acpi, ACPI_IOREAD, + sc->sc_pct.pct_ctrl.grd_gas.address_space_id, + sc->sc_pct.pct_ctrl.grd_gas.address, + 1, + 4, + //sc->sc_pct.pct_ctrl.grd_gas.register_bit_width >> 3, + pb); + + acpi_gasio(sc->sc_acpi, ACPI_IOWRITE, + sc->sc_pct.pct_ctrl.grd_gas.address_space_id, + sc->sc_pct.pct_ctrl.grd_gas.address, + 1, + 4, + //sc->sc_pct.pct_ctrl.grd_gas.register_bit_width >> 3, + &sc->sc_pss[3].pss_ctrl); + + acpi_gasio(sc->sc_acpi, ACPI_IOREAD, + sc->sc_pct.pct_ctrl.grd_gas.address_space_id, + sc->sc_pct.pct_ctrl.grd_gas.address, + 1, + 4, + //sc->sc_pct.pct_ctrl.grd_gas.register_bit_width >> 3, + pb); + printf("acpicpu: %02x %02x %02x %02x\n", pb[0], pb[1], pb[2], pb[3]); + acpi_debug = 21; return (0); } diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h index fb1ef045001..b34e8fbc032 100644 --- a/sys/dev/acpi/acpidev.h +++ b/sys/dev/acpi/acpidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidev.h,v 1.7 2006/02/26 17:05:33 marco Exp $ */ +/* $OpenBSD: acpidev.h,v 1.8 2006/03/04 05:36:42 marco Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> @@ -226,22 +226,7 @@ struct acpicpu_pss { struct acpi_grd { u_int8_t grd_descriptor; u_int16_t grd_length; - u_int8_t grd_access_type; -#define GRD_SYS_MEM 0x00 -#define GRD_SYS_IO 0x01 -#define GRD_SYS_PCICONFIG 0x02 -#define GRD_SYS_EMBEDCTRL 0x03 -#define GRD_SYS_SMBUS 0x04 -#define GRD_SYS_FIXEDHW 0x7f - u_int8_t grd_reg_width; - u_int8_t grd_reg_bit_offset; - u_int8_t grd_address_size; -#define GRD_ADDR_UNDEFINED 0x00 -#define GRD_ADDR_BYTE 0x01 -#define GRD_ADDR_WORD 0x02 -#define GRD_ADDR_DWORD 0x03 -#define GRD_ADDR_QWORD 0x04 - u_int64_t grd_address; + struct acpi_gas grd_gas; } __packed; /* |