diff options
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0.c | 4 | ||||
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_apm.c | 20 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_apm.c | 4 |
3 files changed, 23 insertions, 5 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0.c b/sys/arch/arm/xscale/pxa2x0.c index f3dc031ddff..aaef057b383 100644 --- a/sys/arch/arm/xscale/pxa2x0.c +++ b/sys/arch/arm/xscale/pxa2x0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0.c,v 1.9 2005/05/27 10:54:03 uwe Exp $ */ +/* $OpenBSD: pxa2x0.c,v 1.10 2005/10/31 05:23:32 deraadt Exp $ */ /* $NetBSD: pxa2x0.c,v 1.5 2003/12/12 16:42:44 thorpej Exp $ */ /* @@ -161,6 +161,7 @@ void pxaip_attach(struct device *parent, struct device *self, void *aux) { struct pxaip_softc *sc = (struct pxaip_softc *)self; + extern int freq; int cpuclock; pxaip_sc = sc; @@ -180,6 +181,7 @@ pxaip_attach(struct device *parent, struct device *self, void *aux) * This takes 2 secs at most. */ cpuclock = pxaip_measure_cpuclock(sc) / 1000; + freq = cpuclock / 1000; printf(": CPU clock = %d.%03d MHz\n", cpuclock/1000, cpuclock%1000); diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c index ebe1fd1af0a..d43bf0c381a 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ b/sys/arch/arm/xscale/pxa2x0_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.16 2005/10/31 04:56:14 drahn Exp $ */ +/* $OpenBSD: pxa2x0_apm.c,v 1.17 2005/10/31 05:23:32 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -92,7 +92,10 @@ int apm_handle_event(struct pxa2x0_apm_softc *, u_int); void apm_thread_create(void *); void apm_thread(void *); +extern int perflevel; +int freq; int pxa2x0_setperf(int speed); +int pxa2x0_cpuspeed(int *speed); int apm_record_event(struct pxa2x0_apm_softc *, u_int); void filt_apmrdetach(struct knote *kn); @@ -1154,6 +1157,8 @@ suspend_again: restore_interrupts(save); + pxa2x0_setperf(perflevel); + out: if (ost_ioh != (bus_space_handle_t)0) bus_space_unmap(sc->sc_iot, ost_ioh, PXA2X0_OST_SIZE); @@ -1380,14 +1385,13 @@ pxa2x0_pi2c_print(struct pxa2x0_apm_softc *sc) } #endif -extern int perflevel; int pxa2x0_setperf(int speed) { struct pxa2x0_apm_softc *sc; int s; - sc = apm_cd.cd_devs[0]; + sc = apm_cd.cd_devs[0]; s = disable_interrupts(I32_bit|F32_bit); @@ -1396,6 +1400,7 @@ pxa2x0_setperf(int speed) pxa27x_fastbus_run_mode(0, MDREFR_LOW); delay(1); pxa27x_cpu_speed_91(); + freq = 91; if (perflevel > 50) pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, PI2C_VOLTAGE_LOW); @@ -1412,6 +1417,7 @@ pxa2x0_setperf(int speed) delay(1); pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); + freq = 208; perflevel = 50; } else { if (perflevel < 50) @@ -1431,6 +1437,7 @@ pxa2x0_setperf(int speed) pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | CCCR_RUN_X16, CLKCFG_B | CLKCFG_F | CLKCFG_T, &pxa2x0_memcfg); + freq = 416; perflevel = 100; } @@ -1438,3 +1445,10 @@ pxa2x0_setperf(int speed) return 0; } + +int +pxa2x0_cpuspeed(int *freqp) +{ + *freqp = freq; + return 0; +} diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c index 6ae4960c825..7678c021df7 100644 --- a/sys/arch/zaurus/dev/zaurus_apm.c +++ b/sys/arch/zaurus/dev/zaurus_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_apm.c,v 1.9 2005/10/31 04:56:14 drahn Exp $ */ +/* $OpenBSD: zaurus_apm.c,v 1.10 2005/10/31 05:23:33 deraadt Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> @@ -148,6 +148,7 @@ void zapm_power_info(struct pxa2x0_apm_softc *, struct apm_power_info *); void zapm_suspend(struct pxa2x0_apm_softc *); int zapm_resume(struct pxa2x0_apm_softc *); int pxa2x0_setperf(int); +int pxa2x0_cpuspeed(int *); int @@ -195,6 +196,7 @@ apm_attach(struct device *parent, struct device *self, void *aux) #endif cpu_setperf = pxa2x0_setperf; + cpu_cpuspeed = pxa2x0_cpuspeed; } #if 0 |