Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Nov 2012 16:59:13 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242700 - in head/sys/arm: arm at91
Message-ID:  <201211071659.qA7GxDrg068372@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Nov  7 16:59:12 2012
New Revision: 242700
URL: http://svnweb.freebsd.org/changeset/base/242700

Log:
  Minor cosmetic changes to bring atmel's initarm and the default
  initarm for FDT closer together.  More to follow.

Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm/at91/at91_machdep.c

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Wed Nov  7 16:52:01 2012	(r242699)
+++ head/sys/arm/arm/machdep.c	Wed Nov  7 16:59:12 2012	(r242700)
@@ -1206,6 +1206,9 @@ initarm(struct arm_boot_params *abp)
 
 	pcpu0_init();
 
+	/* Do basic tuning, hz etc */
+	init_param1();
+
 	/* Calculate number of L2 tables needed for mapping vm_page_array */
 	l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page);
 	l2size = (l2size >> L1_S_SHIFT) + 1;
@@ -1219,17 +1222,16 @@ initarm(struct arm_boot_params *abp)
 	/* Make it divisible by 4 */
 	l2size = (l2size + 3) & ~3;
 
-#define KERNEL_TEXT_BASE (KERNBASE)
 	freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK;
 
 	/* Define a macro to simplify memory allocation */
-#define valloc_pages(var, np)                   \
-	alloc_pages((var).pv_va, (np));         \
+#define valloc_pages(var, np)						\
+	alloc_pages((var).pv_va, (np));					\
 	(var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR);
 
-#define alloc_pages(var, np)			\
-	(var) = freemempos;		\
-	freemempos += (np * PAGE_SIZE);		\
+#define alloc_pages(var, np)						\
+	(var) = freemempos;						\
+	freemempos += (np * PAGE_SIZE);					\
 	memset((char *)(var), 0, ((np) * PAGE_SIZE));
 
 	while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0)
@@ -1266,9 +1268,6 @@ initarm(struct arm_boot_params *abp)
 	valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU));
 	valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU));
 	valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU));
-
-	init_param1();
-
 	valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
 
 	/*
@@ -1323,8 +1322,7 @@ initarm(struct arm_boot_params *abp)
 	err_devmap = platform_devmap_init();
 	pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table);
 
-	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) |
-	    DOMAIN_CLIENT);
+	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT);
 	pmap_pa = kernel_l1pt.pv_pa;
 	setttb(kernel_l1pt.pv_pa);
 	cpu_tlb_flushID();
@@ -1403,7 +1401,6 @@ initarm(struct arm_boot_params *abp)
 	 */
 	physmap_init(availmem_regions, availmem_regions_sz);
 
-	/* Do basic tuning, hz etc */
 	init_param2(physmem);
 	kdb_init();
 

Modified: head/sys/arm/at91/at91_machdep.c
==============================================================================
--- head/sys/arm/at91/at91_machdep.c	Wed Nov  7 16:52:01 2012	(r242699)
+++ head/sys/arm/at91/at91_machdep.c	Wed Nov  7 16:59:12 2012	(r242700)
@@ -496,9 +496,9 @@ initarm(struct arm_boot_params *abp)
 		}
 	}
 	/*
-	 * Allocate a page for the system page mapped to V0x00000000
-	 * This page will just contain the system vectors and can be
-	 * shared by all processes.
+	 * Allocate a page for the system page mapped to 0x00000000
+	 * or 0xffff0000. This page will just contain the system vectors
+	 * and can be shared by all processes.
 	 */
 	valloc_pages(systempage, 1);
 
@@ -565,10 +565,10 @@ initarm(struct arm_boot_params *abp)
 	}
 
 	pmap_devmap_bootstrap(l1pagetable, at91_devmap);
-	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);
+	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT);
 	setttb(kernel_l1pt.pv_pa);
 	cpu_tlb_flushID();
-	cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2));
+	cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2));
 
 	at91_soc_id();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211071659.qA7GxDrg068372>