Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F58649
memsize
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
br
Dec 16 2014, 5:30 PM
2014-12-16 17:30:15 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
memsize
View Options
Index: sys/mips/beri/beri_machdep.c
===================================================================
--- sys/mips/beri/beri_machdep.c (revision 275828)
+++ sys/mips/beri/beri_machdep.c (working copy)
@@ -88,6 +88,11 @@
mips_init(void)
{
int i;
+#ifdef FDT
+ struct mem_region mr[FDT_MEM_REGIONS];
+ int mr_cnt, val;
+ int j;
+#endif
for (i = 0; i < 10; i++) {
phys_avail[i] = 0;
@@ -102,6 +107,29 @@
physmem = realmem;
+#ifdef FDT
+ if (fdt_get_mem_regions(mr, &mr_cnt, &val) == 0) {
+
+ physmem = btoc(val);
+
+ KASSERT((phys_avail[0] >= mr[0].mr_start) && \
+ (phys_avail[0] < (mr[0].mr_start + mr[0].mr_size)),
+ ("First region is not within FDT memory range"));
+
+ /* Limit size of the first region */
+ phys_avail[1] = MIN(mr[0].mr_size, ctob(realmem));
+ dump_avail[1] = phys_avail[1];
+
+ /* Add the rest of regions */
+ for (i = 1, j = 2; i < mr_cnt; i++, j+=2) {
+ phys_avail[j] = mr[i].mr_start;
+ phys_avail[j+1] = mr[i].mr_size;
+ dump_avail[j] = phys_avail[j];
+ dump_avail[j+1] = phys_avail[j+1];
+ }
+ }
+#endif
+
init_param1();
init_param2(physmem);
mips_cpu_init();
Index: sys/boot/fdt/dts/mips/beri-netfpga.dts
===================================================================
--- sys/boot/fdt/dts/mips/beri-netfpga.dts (revision 275828)
+++ sys/boot/fdt/dts/mips/beri-netfpga.dts (working copy)
@@ -82,6 +82,11 @@
*/
};
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0
+ };
+
soc {
#address-cells = <1>;
#size-cells = <1>;
@@ -94,11 +99,6 @@
compatible = "simple-bus", "mips,mips4k";
ranges = <>;
- memory {
- device_type = "memory";
- reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0
- };
-
beripic: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
interrupt-controller;
Index: sys/boot/fdt/dts/mips/beri-sim.dts
===================================================================
--- sys/boot/fdt/dts/mips/beri-sim.dts (revision 275828)
+++ sys/boot/fdt/dts/mips/beri-sim.dts (working copy)
@@ -80,6 +80,11 @@
*/
};
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x4000000>; // 64M at 0x0
+ };
+
soc {
#address-cells = <1>;
#size-cells = <1>;
@@ -92,11 +97,6 @@
compatible = "simple-bus", "mips,mips4k";
ranges = <>;
- memory {
- device_type = "memory";
- reg = <0x0 0x4000000>; // 64M at 0x0
- };
-
beripic0: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
interrupt-controller;
Index: sys/boot/fdt/dts/mips/beripad-de4.dts
===================================================================
--- sys/boot/fdt/dts/mips/beripad-de4.dts (revision 275828)
+++ sys/boot/fdt/dts/mips/beripad-de4.dts (working copy)
@@ -80,6 +80,11 @@
*/
};
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x40000000>; // 1G at 0x0
+ };
+
soc {
#address-cells = <1>;
#size-cells = <1>;
@@ -92,11 +97,6 @@
compatible = "simple-bus", "mips,mips4k";
ranges = <>;
- memory {
- device_type = "memory";
- reg = <0x0 0x40000000>; // 1G at 0x0
- };
-
beripic0: beripic@7f804000 {
compatible = "sri-cambridge,beri-pic";
interrupt-controller;
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
58533
Default Alt Text
memsize (3 KB)
Attached To
Mode
P41 memsize
Attached
Detach File
Event Timeline
Log In to Comment