summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91_machdep.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2012-06-01 02:55:42 +0000
committerimp <imp@FreeBSD.org>2012-06-01 02:55:42 +0000
commitefd4b91d2ad754279cdcf0d60327eb7eea86523a (patch)
tree770e2102502eadbba882cf074fa93784b15e80d6 /sys/arm/at91/at91_machdep.c
parent561f6739ea31a62502eb6920aacd8d77195503b7 (diff)
downloadFreeBSD-src-efd4b91d2ad754279cdcf0d60327eb7eea86523a.zip
FreeBSD-src-efd4b91d2ad754279cdcf0d60327eb7eea86523a.tar.gz
Initialize the clocks before we call cninit() so that the serial
console so initialized will work upon return from cninit. While this is the very next line, other platforms setup all this stuff before calling cninit. Also, initialize the SDRAM base register in the inner block in at91_ramsize().
Diffstat (limited to 'sys/arm/at91/at91_machdep.c')
-rw-r--r--sys/arm/at91/at91_machdep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c
index 28e6913..7b165a8 100644
--- a/sys/arm/at91/at91_machdep.c
+++ b/sys/arm/at91/at91_machdep.c
@@ -209,12 +209,11 @@ const struct pmap_devmap at91_devmap[] = {
long
at91_ramsize(void)
{
- uint32_t *SDRAMC = (uint32_t *)(AT91_BASE + AT91RM92_SDRAMC_BASE);
uint32_t cr, mr;
int banks, rows, cols, bw;
if (at91_is_rm92()) {
- SDRAMC = (uint32_t *)(AT91_BASE + AT91RM92_SDRAMC_BASE);
+ uint32_t *SDRAMC = (uint32_t *)(AT91_BASE + AT91RM92_SDRAMC_BASE);
cr = SDRAMC[AT91RM92_SDRAMC_CR / 4];
mr = SDRAMC[AT91RM92_SDRAMC_MR / 4];
banks = (cr & AT91RM92_SDRAMC_CR_NB_4) ? 2 : 1;
@@ -222,9 +221,9 @@ at91_ramsize(void)
cols = (cr & AT91RM92_SDRAMC_CR_NC_MASK) + 8;
bw = (mr & AT91RM92_SDRAMC_MR_DBW_16) ? 1 : 2;
} else {
- /* This should be good for the 9260, 9261 and 9G20 as addresses
+ /* This should be good for the 9260, 9261, 9G20, 9G35 and 9X25 as addresses
* and registers are the same */
- SDRAMC = (uint32_t *)(AT91_BASE + AT91SAM9G20_SDRAMC_BASE);
+ uint32_t *SDRAMC = (uint32_t *)(AT91_BASE + AT91SAM9G20_SDRAMC_BASE);
cr = SDRAMC[AT91SAM9G20_SDRAMC_CR / 4];
mr = SDRAMC[AT91SAM9G20_SDRAMC_MR / 4];
banks = (cr & AT91SAM9G20_SDRAMC_CR_NB_4) ? 2 : 1;
@@ -361,12 +360,13 @@ initarm(void *arg, void *arg2)
cpu_tlb_flushID();
cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
- cninit();
+ /* Initialize all the clocks, so that the console can work */
+ at91_pmc_init_clock();
- at91_pmc_init_clock();
/* Get chip id so device drivers know about differences */
- at91_chip_id = *(volatile uint32_t *)
- (AT91_BASE + AT91_DBGU_BASE + DBGU_C1R);
+ at91_chip_id = *(uint32_t *)(AT91_BASE + AT91_DBGU_BASE + DBGU_C1R);
+
+ cninit();
memsize = board_init();
physmem = memsize / PAGE_SIZE;
OpenPOWER on IntegriCloud