diff options
author | andrew <andrew@FreeBSD.org> | 2012-09-23 03:46:03 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2012-09-23 03:46:03 +0000 |
commit | dd6a23c4f5fa55e20c9f42dccf0148a82c3210ac (patch) | |
tree | 104d5a982f719dbec7477f1544fda5ad02444006 /sys/arm/mv/mv_machdep.c | |
parent | d9ebf06192583d13a8f9b61c12451be1e98c3984 (diff) | |
download | FreeBSD-src-dd6a23c4f5fa55e20c9f42dccf0148a82c3210ac.zip FreeBSD-src-dd6a23c4f5fa55e20c9f42dccf0148a82c3210ac.tar.gz |
Pull out the SoC specific parts of initarm into separate functions
Diffstat (limited to 'sys/arm/mv/mv_machdep.c')
-rw-r--r-- | sys/arm/mv/mv_machdep.c | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c index 80d841b..19d66c0 100644 --- a/sys/arm/mv/mv_machdep.c +++ b/sys/arm/mv/mv_machdep.c @@ -334,11 +334,8 @@ initarm(struct arm_boot_params *abp) &memsize) != 0) while(1); - if (fdt_immr_addr(MV_BASE) != 0) - while (1); - /* Platform-specific initialisation */ - pmap_bootstrap_lastaddr = fdt_immr_va - ARM_NOCACHE_KVA_SIZE; + pmap_bootstrap_lastaddr = initarm_lastaddr(); pcpu0_init(); @@ -472,12 +469,7 @@ initarm(struct arm_boot_params *abp) */ OF_interpret("perform-fixup", 0); - /* - * Re-initialise MPP. It is important to call this prior to using - * console as the physical connection can be routed via MPP. - */ - if (platform_mpp_init() != 0) - while (1); + initarm_gpio_init(); cninit(); @@ -494,17 +486,7 @@ initarm(struct arm_boot_params *abp) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); - /* - * Re-initialise decode windows - */ -#if !defined(SOC_MV_FREY) - if (soc_decode_win() != 0) - printf("WARNING: could not re-initialise decode windows! " - "Running with existing settings...\n"); -#else - /* Disable watchdog and timers */ - write_cpu_ctrl(CPU_TIMERS_BASE + CPU_TIMER_CONTROL, 0); -#endif + initarm_late_init(); /* * Pages were allocated during the secondary bootstrap for the @@ -692,6 +674,45 @@ moveon: return (0); } +vm_offset_t +initarm_lastaddr(void) +{ + + if (fdt_immr_addr(MV_BASE) != 0) + while (1); + + /* Platform-specific initialisation */ + return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); +} + +void +initarm_gpio_init(void) +{ + + /* + * Re-initialise MPP. It is important to call this prior to using + * console as the physical connection can be routed via MPP. + */ + if (platform_mpp_init() != 0) + while (1); +} + +void +initarm_late_init(void) +{ + /* + * Re-initialise decode windows + */ +#if !defined(SOC_MV_FREY) + if (soc_decode_win() != 0) + printf("WARNING: could not re-initialise decode windows! " + "Running with existing settings...\n"); +#else + /* Disable watchdog and timers */ + write_cpu_ctrl(CPU_TIMERS_BASE + CPU_TIMER_CONTROL, 0); +#endif +} + #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } |