summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2012-11-07 16:59:12 +0000
committerimp <imp@FreeBSD.org>2012-11-07 16:59:12 +0000
commit144b70190ee8018085ca83ac2cc7b79d56dda2a6 (patch)
tree26fbf731ad5f9abd7e3b98cd75425cd0842f8598
parent90e6035f952b122b3eebd3e757a4e1908a090735 (diff)
downloadFreeBSD-src-144b70190ee8018085ca83ac2cc7b79d56dda2a6.zip
FreeBSD-src-144b70190ee8018085ca83ac2cc7b79d56dda2a6.tar.gz
Minor cosmetic changes to bring atmel's initarm and the default
initarm for FDT closer together. More to follow.
-rw-r--r--sys/arm/arm/machdep.c21
-rw-r--r--sys/arm/at91/at91_machdep.c10
2 files changed, 14 insertions, 17 deletions
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 06c702a..07f6f78 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -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();
diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c
index 51e7b81..d16ce19 100644
--- a/sys/arm/at91/at91_machdep.c
+++ b/sys/arm/at91/at91_machdep.c
@@ -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();
OpenPOWER on IntegriCloud