summaryrefslogtreecommitdiffstats
path: root/sys/arm/mv/armadaxp
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2015-03-26 19:33:07 +0000
committerian <ian@FreeBSD.org>2015-03-26 19:33:07 +0000
commit29347aa216ea477f1139d0415aa98b12601852f6 (patch)
tree565ca23ade36508a75672b5611479fd26cc59e54 /sys/arm/mv/armadaxp
parentcd9d558324fbd7f712d086ffaadc5a0e6093cb4f (diff)
downloadFreeBSD-src-29347aa216ea477f1139d0415aa98b12601852f6.zip
FreeBSD-src-29347aa216ea477f1139d0415aa98b12601852f6.tar.gz
Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying
the startup trampoline code. The old code allocated a kva page, mapped it using using pmap_kenter_nocache(), then freed the kva without destroying the mapping. This is the only use of pmap_kenter_nocache() in the system, so redoing this one use of allows it to be garbage collected in the near future.
Diffstat (limited to 'sys/arm/mv/armadaxp')
-rw-r--r--sys/arm/mv/armadaxp/armadaxp_mp.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/arm/mv/armadaxp/armadaxp_mp.c b/sys/arm/mv/armadaxp/armadaxp_mp.c
index 6e93d35..775fc09 100644
--- a/sys/arm/mv/armadaxp/armadaxp_mp.c
+++ b/sys/arm/mv/armadaxp/armadaxp_mp.c
@@ -106,7 +106,7 @@ void
platform_mp_start_ap(void)
{
uint32_t reg, *src, *dst, cpu_num, div_val, cputype;
- vm_offset_t smp_boot, pmu_boot_off;
+ vm_offset_t pmu_boot_off;
/*
* Initialization procedure depends on core revision,
* in this step CHIP ID is checked to choose proper procedure
@@ -114,22 +114,18 @@ platform_mp_start_ap(void)
cputype = cpufunc_id();
cputype &= CPU_ID_CPU_MASK;
- smp_boot = kva_alloc(PAGE_SIZE);
- pmap_kenter_nocache(smp_boot, 0xffff0000);
- dst = (uint32_t *) smp_boot;
/*
* Set the PA of CPU0 Boot Address Redirect register used in
* mptramp according to the actual SoC registers' base address.
*/
pmu_boot_off = (CPU_PMU(0) - MV_BASE) + CPU_PMU_BOOT;
mptramp_pmu_boot = fdt_immr_pa + pmu_boot_off;
-
+ dst = pmap_mapdev(0xffff0000, PAGE_SIZE);
for (src = (uint32_t *)mptramp; src < (uint32_t *)mptramp_end;
src++, dst++) {
*dst = *src;
}
- kva_free(smp_boot, PAGE_SIZE);
-
+ pmap_unmapdev((vm_offset_t)dst, PAGE_SIZE);
if (cputype == CPU_ID_MV88SV584X_V7) {
/* Core rev A0 */
div_val = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1);
OpenPOWER on IntegriCloud