Module Name: src
Committed By: jmcneill
Date: Wed Mar 4 23:18:21 UTC 2015
Modified Files:
src/sys/arch/arm/cortex: a9tmr.c a9wdt.c
Log Message:
print "A5" instead of "A9" at attach time if running on a Cortex-A5
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/cortex/a9tmr.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/cortex/a9wdt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/cortex/a9tmr.c
diff -u src/sys/arch/arm/cortex/a9tmr.c:1.11 src/sys/arch/arm/cortex/a9tmr.c:1.12
--- src/sys/arch/arm/cortex/a9tmr.c:1.11 Fri Feb 27 18:26:49 2015
+++ src/sys/arch/arm/cortex/a9tmr.c Wed Mar 4 23:18:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: a9tmr.c,v 1.11 2015/02/27 18:26:49 jmcneill Exp $ */
+/* $NetBSD: a9tmr.c,v 1.12 2015/03/04 23:18:21 jmcneill Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.11 2015/02/27 18:26:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.12 2015/03/04 23:18:21 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -120,6 +120,7 @@ a9tmr_attach(device_t parent, device_t s
struct mpcore_attach_args * const mpcaa = aux;
prop_dictionary_t dict = device_properties(self);
char freqbuf[sizeof("XXX SHz")];
+ const char *cpu_type;
/*
* This runs at the ARM PERIPHCLOCK which should be 1/2 of the CPU clock.
@@ -130,7 +131,12 @@ a9tmr_attach(device_t parent, device_t s
humanize_number(freqbuf, sizeof(freqbuf), sc->sc_freq, "Hz", 1000);
aprint_naive("\n");
- aprint_normal(": A9 Global 64-bit Timer (%s)\n", freqbuf);
+ if (CPU_ID_CORTEX_A5_P(curcpu()->ci_arm_cpuid)) {
+ cpu_type = "A5";
+ } else {
+ cpu_type = "A9";
+ }
+ aprint_normal(": %s Global 64-bit Timer (%s)\n", cpu_type, freqbuf);
self->dv_private = sc;
sc->sc_dev = self;
Index: src/sys/arch/arm/cortex/a9wdt.c
diff -u src/sys/arch/arm/cortex/a9wdt.c:1.3 src/sys/arch/arm/cortex/a9wdt.c:1.4
--- src/sys/arch/arm/cortex/a9wdt.c:1.3 Fri Feb 27 18:43:28 2015
+++ src/sys/arch/arm/cortex/a9wdt.c Wed Mar 4 23:18:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: a9wdt.c,v 1.3 2015/02/27 18:43:28 jmcneill Exp $ */
+/* $NetBSD: a9wdt.c,v 1.4 2015/03/04 23:18:21 jmcneill Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.3 2015/02/27 18:43:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.4 2015/03/04 23:18:21 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -186,6 +186,7 @@ a9wdt_attach(device_t parent, device_t s
struct a9wdt_softc * const sc = device_private(self);
struct mpcore_attach_args * const mpcaa = aux;
prop_dictionary_t dict = device_properties(self);
+ const char *cpu_type;
sc->sc_dev = self;
sc->sc_memt = mpcaa->mpcaa_memt;
@@ -230,8 +231,13 @@ a9wdt_attach(device_t parent, device_t s
sc->sc_wdog_armed = true;
aprint_naive("\n");
- aprint_normal(": A9 Watchdog Timer, default period is %u seconds%s\n",
- sc->sc_wdog_period,
+ if (CPU_ID_CORTEX_A5_P(curcpu()->ci_arm_cpuid)) {
+ cpu_type = "A5";
+ } else {
+ cpu_type = "A9";
+ }
+ aprint_normal(": %s Watchdog Timer, default period is %u seconds%s\n",
+ cpu_type, sc->sc_wdog_period,
sc->sc_wdog_armed ? " (armed)" : "");
sc->sc_smw.smw_name = device_xname(self);