svn commit: r261698 - in head/sys/arm: sa11x0 xscale/i80321 xscale/i8134x xscale/pxa
Ian Lepore
ian at FreeBSD.org
Sun Feb 9 22:10:15 UTC 2014
Author: ian
Date: Sun Feb 9 22:10:14 2014
New Revision: 261698
URL: http://svnweb.freebsd.org/changeset/base/261698
Log:
Update legacy platforms to use new arm_physmem helper routines.
Modified:
head/sys/arm/sa11x0/assabet_machdep.c
head/sys/arm/xscale/i80321/ep80219_machdep.c
head/sys/arm/xscale/i80321/iq31244_machdep.c
head/sys/arm/xscale/i8134x/crb_machdep.c
head/sys/arm/xscale/pxa/pxa_machdep.c
Modified: head/sys/arm/sa11x0/assabet_machdep.c
==============================================================================
--- head/sys/arm/sa11x0/assabet_machdep.c Sun Feb 9 22:10:00 2014 (r261697)
+++ head/sys/arm/sa11x0/assabet_machdep.c Sun Feb 9 22:10:14 2014 (r261698)
@@ -374,16 +374,25 @@ initarm(struct arm_boot_params *abp)
cpu_setup("");
pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000;
-
- dump_avail[0] = phys_avail[0] = round_page(virtual_avail);
- dump_avail[1] = phys_avail[1] = 0xc0000000 + 0x02000000 - 1;
- dump_avail[2] = phys_avail[2] = 0;
- dump_avail[3] = phys_avail[3] = 0;
-
mutex_init();
vm_max_kernel_address = 0xd0000000;
pmap_bootstrap(freemempos, &kernel_l1pt);
+ /*
+ * Add the physical ram we have available.
+ *
+ * Exclude the kernel (and all the things we allocated which immediately
+ * follow the kernel) from the VM allocation pool but not from crash
+ * dumps. virtual_avail is a global variable which tracks the kva we've
+ * "allocated" while setting up pmaps.
+ *
+ * Prepare the list of physical memory available to the vm subsystem.
+ */
+ arm_physmem_hardware_region(physical_start, memsize);
+ arm_physmem_exclude_region(abp->abp_physaddr,
+ virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC);
+ arm_physmem_init_kernel_globals();
+
init_param2(physmem);
kdb_init();
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c
==============================================================================
--- head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Feb 9 22:10:00 2014 (r261697)
+++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Feb 9 22:10:14 2014 (r261698)
@@ -333,24 +333,27 @@ initarm(struct arm_boot_params *abp)
/* Enable MMU, I-cache, D-cache, write buffer. */
arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
- pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
- dump_avail[0] = 0xa0000000;
- dump_avail[1] = 0xa0000000 + memsize;
- dump_avail[2] = 0;
- dump_avail[3] = 0;
-
vm_max_kernel_address = 0xe0000000;
pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, msgbufsize);
mutex_init();
- i = 0;
- phys_avail[i++] = round_page(virtual_avail - KERNBASE + IQ80321_SDRAM_START);
- phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1);
- phys_avail[i++] = 0;
- phys_avail[i] = 0;
-
+ /*
+ * Add the physical ram we have available.
+ *
+ * Exclude the kernel (and all the things we allocated which immediately
+ * follow the kernel) from the VM allocation pool but not from crash
+ * dumps. virtual_avail is a global variable which tracks the kva we've
+ * "allocated" while setting up pmaps.
+ *
+ * Prepare the list of physical memory available to the vm subsystem.
+ */
+ arm_physmem_hardware_region(IQ80321_SDRAM_START, memsize);
+ arm_physmem_exclude_region(abp->abp_physaddr,
+ virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC);
+ arm_physmem_init_kernel_globals();
+
init_param2(physmem);
kdb_init();
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c
==============================================================================
--- head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Feb 9 22:10:00 2014 (r261697)
+++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Feb 9 22:10:14 2014 (r261698)
@@ -335,23 +335,27 @@ initarm(struct arm_boot_params *abp)
arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
- dump_avail[0] = 0xa0000000;
- dump_avail[1] = 0xa0000000 + memsize;
- dump_avail[2] = 0;
- dump_avail[3] = 0;
-
vm_max_kernel_address = 0xe0000000;
pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, msgbufsize);
mutex_init();
- i = 0;
- phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START);
- phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1);
- phys_avail[i++] = 0;
- phys_avail[i] = 0;
-
+ /*
+ * Add the physical ram we have available.
+ *
+ * Exclude the kernel (and all the things we allocated which immediately
+ * follow the kernel) from the VM allocation pool but not from crash
+ * dumps. virtual_avail is a global variable which tracks the kva we've
+ * "allocated" while setting up pmaps.
+ *
+ * Prepare the list of physical memory available to the vm subsystem.
+ */
+ arm_physmem_hardware_region(SDRAM_START, memsize);
+ arm_physmem_exclude_region(abp->abp_physaddr,
+ virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC);
+ arm_physmem_init_kernel_globals();
+
init_param2(physmem);
kdb_init();
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
==============================================================================
--- head/sys/arm/xscale/i8134x/crb_machdep.c Sun Feb 9 22:10:00 2014 (r261697)
+++ head/sys/arm/xscale/i8134x/crb_machdep.c Sun Feb 9 22:10:14 2014 (r261698)
@@ -313,23 +313,27 @@ initarm(struct arm_boot_params *abp)
pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
- dump_avail[0] = 0x00000000;
- dump_avail[1] = 0x00000000 + memsize;
- dump_avail[2] = 0;
- dump_avail[3] = 0;
-
vm_max_kernel_address = 0xe0000000;
pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, msgbufsize);
mutex_init();
-
- i = 0;
- phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START);
- phys_avail[i++] = trunc_page(0x00000000 + memsize - 1);
- phys_avail[i++] = 0;
- phys_avail[i] = 0;
-
+
+ /*
+ * Add the physical ram we have available.
+ *
+ * Exclude the kernel (and all the things we allocated which immediately
+ * follow the kernel) from the VM allocation pool but not from crash
+ * dumps. virtual_avail is a global variable which tracks the kva we've
+ * "allocated" while setting up pmaps.
+ *
+ * Prepare the list of physical memory available to the vm subsystem.
+ */
+ arm_physmem_hardware_region(SDRAM_START, memsize);
+ arm_physmem_exclude_region(abp->abp_physaddr,
+ virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC);
+ arm_physmem_init_kernel_globals();
+
init_param2(physmem);
kdb_init();
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
Modified: head/sys/arm/xscale/pxa/pxa_machdep.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_machdep.c Sun Feb 9 22:10:00 2014 (r261697)
+++ head/sys/arm/xscale/pxa/pxa_machdep.c Sun Feb 9 22:10:14 2014 (r261698)
@@ -308,11 +308,6 @@ initarm(struct arm_boot_params *abp)
*/
pxa_probe_sdram(obio_tag, PXA2X0_MEMCTL_BASE, memstart, memsize);
- physmem = 0;
- for (i = 0; i < PXA2X0_SDRAM_BANKS; i++) {
- physmem += memsize[i] / PAGE_SIZE;
- }
-
/* Fire up consoles. */
cninit();
@@ -328,39 +323,29 @@ initarm(struct arm_boot_params *abp)
arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
pmap_curmaxkvaddr = afterkern + PAGE_SIZE;
- i = 0;
- for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) {
- if (memsize[j] > 0) {
- dump_avail[i++] = round_page(memstart[j]);
- dump_avail[i++] =
- trunc_page(memstart[j] + memsize[j]);
- }
- }
- dump_avail[i] = 0;
- dump_avail[i] = 0;
vm_max_kernel_address = 0xe0000000;
pmap_bootstrap(pmap_curmaxkvaddr, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, msgbufsize);
mutex_init();
- i = 0;
+ /*
+ * Add the physical ram we have available.
+ *
+ * Exclude the kernel (and all the things we allocated which immediately
+ * follow the kernel) from the VM allocation pool but not from crash
+ * dumps. virtual_avail is a global variable which tracks the kva we've
+ * "allocated" while setting up pmaps.
+ *
+ * Prepare the list of physical memory available to the vm subsystem.
+ */
for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) {
- if (memsize[j] > 0) {
- phys_avail[i] = round_page(memstart[j]);
- dump_avail[i++] = round_page(memstart[j]);
- phys_avail[i] =
- trunc_page(memstart[j] + memsize[j]);
- dump_avail[i++] =
- trunc_page(memstart[j] + memsize[j]);
- }
+ if (memsize[j] > 0)
+ arm_physmem_hardware_region(memstart[j], memsize[j]);
}
-
- dump_avail[i] = 0;
- phys_avail[i++] = 0;
- dump_avail[i] = 0;
- phys_avail[i] = 0;
- phys_avail[0] = round_page(virtual_avail - KERNBASE + phys_avail[0]);
+ arm_physmem_exclude_region(abp->abp_physaddr,
+ virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC);
+ arm_physmem_init_kernel_globals();
init_param2(physmem);
kdb_init();
More information about the svn-src-all
mailing list