From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:12:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 909D7547; Sat, 14 Dec 2013 01:12:15 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A53F124A; Sat, 14 Dec 2013 01:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1CFnU017578; Sat, 14 Dec 2013 01:12:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1CDIF017564; Sat, 14 Dec 2013 01:12:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140112.rBE1CDIF017564@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:12:13 +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: r259377 - in stable/10/sys/arm: arm at91 econa s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:12:15 -0000 Author: ian Date: Sat Dec 14 01:12:13 2013 New Revision: 259377 URL: http://svnweb.freebsd.org/changeset/base/259377 Log: MFC r258392, r258412: Call cpu_setup() immediately after the page tables are installed. This enables data cache and other chip-specific features. It was previously done via an early SYSINIT, but it was being done after pmap and vm setup, and those setups need to use mutexes. On some modern ARM platforms, the ldrex/strex instructions that implement mutexes require the data cache to be enabled. Call cpu_setup() from the initarm() routine on platforms that don't use the common FDT-aware initarm() in arm/machdep.c. Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/sa11x0/assabet_machdep.c stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/arm/machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -361,7 +361,6 @@ cpu_startup(void *dummy) #endif #endif - cpu_setup(""); identify_arm_cpu(); printf("real memory = %ju (%ju MB)\n", (uintmax_t)ptoa(physmem), @@ -1427,6 +1426,12 @@ initarm(struct arm_boot_params *abp) cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); /* + * Now that proper page tables are installed, call cpu_setup() to enable + * instruction and data caches and other chip-specific features. + */ + cpu_setup(""); + + /* * Only after the SOC registers block is mapped we can perform device * tree fixups, as they may attempt to read parameters from hardware. */ Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -604,6 +604,7 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); + cpu_setup(""); set_stackptrs(0); Modified: stable/10/sys/arm/econa/econa_machdep.c ============================================================================== --- stable/10/sys/arm/econa/econa_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/econa/econa_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -309,6 +309,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Set stack for exception handlers */ data_abort_handler_address = (u_int)data_abort_handler; Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -355,6 +355,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Disable all peripheral interrupts */ ioreg_write32(S3C24X0_INTCTL_BASE + INTCTL_INTMSK, ~0); Modified: stable/10/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- stable/10/sys/arm/sa11x0/assabet_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/sa11x0/assabet_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -371,6 +371,7 @@ initarm(struct arm_boot_params *abp) cpufunc_control(0x337f, 0x107d); arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); + cpu_setup(""); pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000; Modified: stable/10/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -334,6 +334,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: stable/10/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -335,6 +335,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: stable/10/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -320,6 +320,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + i80321_calibrate_delay(); i81342_sdram_bounds(&obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -405,6 +405,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* ready to setup the console (XXX move earlier if possible) */ cninit(); /* Modified: stable/10/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -317,6 +317,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* * Sort out bus_space for on-board devices.