svn commit: r235698 - head/sys/arm/at91
Warner Losh
imp at FreeBSD.org
Sun May 20 20:50:42 UTC 2012
Author: imp
Date: Sun May 20 20:50:40 2012
New Revision: 235698
URL: http://svn.freebsd.org/changeset/base/235698
Log:
Minor cleanup before some more major changes:
o main_clock_hz isn't used, eliminate it
o move main clock calculation code and table so we have only one ifdef.
Modified:
head/sys/arm/at91/at91_pmc.c
Modified: head/sys/arm/at91/at91_pmc.c
==============================================================================
--- head/sys/arm/at91/at91_pmc.c Sun May 20 20:25:57 2012 (r235697)
+++ head/sys/arm/at91/at91_pmc.c Sun May 20 20:50:40 2012 (r235698)
@@ -55,7 +55,6 @@ static struct at91_pmc_softc {
bus_space_handle_t sc_sh;
struct resource *mem_res; /* Memory resource */
device_t dev;
- unsigned int main_clock_hz;
uint32_t pllb_init;
} *pmc_softc;
@@ -147,18 +146,6 @@ static struct at91_pmc_clock *clock_list
&cpu
};
-#if !defined(AT91C_MAIN_CLOCK)
-static const unsigned int at91_mainf_tbl[] = {
- 3000000, 3276800, 3686400, 3840000, 4000000,
- 4433619, 4915200, 5000000, 5242880, 6000000,
- 6144000, 6400000, 6553600, 7159090, 7372800,
- 7864320, 8000000, 9830400, 10000000, 11059200,
- 12000000, 12288000, 13560000, 14318180, 14745600,
- 16000000, 17344700, 18432000, 20000000
-};
-#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl))
-#endif
-
static inline uint32_t
RD4(struct at91_pmc_softc *sc, bus_size_t off)
{
@@ -412,7 +399,6 @@ at91_pmc_init_clock(struct at91_pmc_soft
udpck.pmc_mask = PMC_SCER_UDP_SAM9;
}
mckr = RD4(sc, PMC_MCKR);
- sc->main_clock_hz = main_clock;
main_ck.hz = main_clock;
at91_pmc_pll_rate(&plla, RD4(sc, CKGR_PLLAR));
@@ -465,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft
device_printf(sc->dev,
"Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n",
- sc->main_clock_hz,
+ main_clock,
plla.hz / 1000000,
cpu.hz / 1000000, mck.hz / 1000000);
@@ -520,6 +506,16 @@ at91_pmc_probe(device_t dev)
}
#if !defined(AT91C_MAIN_CLOCK)
+static const unsigned int at91_mainf_tbl[] = {
+ 3000000, 3276800, 3686400, 3840000, 4000000,
+ 4433619, 4915200, 5000000, 5242880, 6000000,
+ 6144000, 6400000, 6553600, 7159090, 7372800,
+ 7864320, 8000000, 9830400, 10000000, 11059200,
+ 12000000, 12288000, 13560000, 14318180, 14745600,
+ 16000000, 17344700, 18432000, 20000000
+};
+#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl))
+
static unsigned int
at91_pmc_sense_mainf(struct at91_pmc_softc *sc)
{
More information about the svn-src-head
mailing list