From owner-svn-src-stable-10@FreeBSD.ORG Sat May 23 23:35:20 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5731C75C; Sat, 23 May 2015 23:35:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38D1E1C52; Sat, 23 May 2015 23:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4NNZK8E067291; Sat, 23 May 2015 23:35:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4NNZJvB067289; Sat, 23 May 2015 23:35:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201505232335.t4NNZJvB067289@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 May 2015 23:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r283340 - stable/10/sys/arm/mv/armadaxp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2015 23:35:20 -0000 Author: ian Date: Sat May 23 23:35:19 2015 New Revision: 283340 URL: https://svnweb.freebsd.org/changeset/base/283340 Log: MFC r262409, r267129, r267130, r280709: Move the declaration for mpentry() into a header file Fix broken SMP startup on Armada XP after r265694 Avoid using hard-coded SoC's register address in mptramp code for Armada XP Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying the startup trampoline code. Modified: stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c stable/10/sys/arm/mv/armadaxp/mptramp.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Sat May 23 23:27:00 2015 (r283339) +++ stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Sat May 23 23:35:19 2015 (r283340) @@ -37,6 +37,8 @@ #include #include +#include + #include #include #include @@ -97,14 +99,14 @@ platform_mp_init_secondary(void) } void mptramp(void); - - +void mptramp_end(void); +extern vm_offset_t mptramp_pmu_boot; void platform_mp_start_ap(void) { uint32_t reg, *src, *dst, cpu_num, div_val, cputype; - vm_offset_t smp_boot; + vm_offset_t pmu_boot_off; /* * Initialization procedure depends on core revision, * in this step CHIP ID is checked to choose proper procedure @@ -112,16 +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; - - for (src = (uint32_t *)mptramp; src < (uint32_t *)mpentry; + /* + * 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); Modified: stable/10/sys/arm/mv/armadaxp/mptramp.S ============================================================================== --- stable/10/sys/arm/mv/armadaxp/mptramp.S Sat May 23 23:27:00 2015 (r283339) +++ stable/10/sys/arm/mv/armadaxp/mptramp.S Sat May 23 23:35:19 2015 (r283340) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); +.global _C_LABEL(mptramp_pmu_boot) + ASENTRY_NP(mptramp) mov r0, #0 mcr p15, 0, r0, c7, c7, 0 @@ -44,13 +46,16 @@ ASENTRY_NP(mptramp) /* Read boot address for CPU */ mov r1, #0x100 mul r2, r0, r1 - ldr r1, Lpmureg + ldr r1, mptramp_pmu_boot add r0, r2, r1 ldr r1, [r0], #0x00 mov pc, r1 -Lpmureg: - .word 0xd0022124 +_C_LABEL(mptramp_pmu_boot): + .word 0x0 + END(mptramp) + .global _C_LABEL(mptramp_end) +_C_LABEL(mptramp_end):