summaryrefslogtreecommitdiffstats
path: root/sys/arm/xscale/ixp425
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-02-09 01:21:30 +0000
committerian <ian@FreeBSD.org>2014-02-09 01:21:30 +0000
commit0a15dbb231ef45e0d61995ff08d080a85ea69172 (patch)
tree0eff37ba787fd6a17d552d58ecd6c682d97b8a62 /sys/arm/xscale/ixp425
parent30d95028f0a5b80653b6cba27633bbdca56f156b (diff)
downloadFreeBSD-src-0a15dbb231ef45e0d61995ff08d080a85ea69172.zip
FreeBSD-src-0a15dbb231ef45e0d61995ff08d080a85ea69172.tar.gz
Replace compile-time constant KERNPHYSADDR with abp_physaddr (determined
at runtime) where it's trivial to do so. Another breadcrumb on the trail to a kernel that can be loaded at any 1MB boundary.
Diffstat (limited to 'sys/arm/xscale/ixp425')
-rw-r--r--sys/arm/xscale/ixp425/avila_machdep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/arm/xscale/ixp425/avila_machdep.c b/sys/arm/xscale/ixp425/avila_machdep.c
index 7b63f92..e79e430 100644
--- a/sys/arm/xscale/ixp425/avila_machdep.c
+++ b/sys/arm/xscale/ixp425/avila_machdep.c
@@ -92,11 +92,6 @@ __FBSDID("$FreeBSD$");
#include <arm/xscale/ixp425/ixp425reg.h>
#include <arm/xscale/ixp425/ixp425var.h>
-/* kernel text starts where we were loaded at boot */
-#define KERNEL_TEXT_OFF (KERNPHYSADDR - PHYSADDR)
-#define KERNEL_TEXT_BASE (KERNBASE + KERNEL_TEXT_OFF)
-#define KERNEL_TEXT_PHYS (PHYSADDR + KERNEL_TEXT_OFF)
-
#define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */
#define KERNEL_PT_IO 1
#define KERNEL_PT_IO_NUM 3
@@ -221,6 +216,11 @@ initarm(struct arm_boot_params *abp)
vm_offset_t lastaddr;
uint32_t memsize;
+ /* kernel text starts where we were loaded at boot */
+#define KERNEL_TEXT_OFF (abp->abp_physaddr - PHYSADDR)
+#define KERNEL_TEXT_BASE (KERNBASE + KERNEL_TEXT_OFF)
+#define KERNEL_TEXT_PHYS (PHYSADDR + KERNEL_TEXT_OFF)
+
lastaddr = parse_boot_param(abp);
set_cpufuncs(); /* NB: sets cputype */
pcpu_init(pcpup, 0, sizeof(struct pcpu));
@@ -238,7 +238,7 @@ initarm(struct arm_boot_params *abp)
* write-through). Note this leaves a gap for expansion
* (or might be repurposed).
*/
- freemempos = KERNPHYSADDR;
+ freemempos = abp->abp_physaddr;
/* macros to simplify initial memory allocation */
#define alloc_pages(var, np) do { \
@@ -249,7 +249,7 @@ initarm(struct arm_boot_params *abp)
} while (0)
#define valloc_pages(var, np) do { \
alloc_pages((var).pv_pa, (np)); \
- (var).pv_va = (var).pv_pa + (KERNVIRTADDR - KERNPHYSADDR); \
+ (var).pv_va = (var).pv_pa + (KERNVIRTADDR - abp->abp_physaddr); \
} while (0)
/* force L1 page table alignment */
@@ -268,7 +268,7 @@ initarm(struct arm_boot_params *abp)
L2_TABLE_SIZE_REAL;
kernel_pt_table[loop].pv_va =
kernel_pt_table[loop].pv_pa +
- (KERNVIRTADDR - KERNPHYSADDR);
+ (KERNVIRTADDR - abp->abp_physaddr);
}
}
freemem_pt = freemempos; /* base of allocated pt's */
OpenPOWER on IntegriCloud