memory@00000000 {
device_type = "memory";
- linux,usable-memory = <0x0 0x0100000 0x0 0x7ff00000>;
+ linux,usable-memory-2g = <0x0 0x00100000 0x0 0x7ff00000>;
+ linux,usable-memory-3g = <0x0 0x00100000 0x0 0xbff00000>;
};
reserved-memory {
display_size_default = <1920 1080 1920 3240 32>;
/*1920*1080*4*3 = 0x17BB000*/
mem_alloc = <1>;
- logo_addr = "0x7dc00000";
+ logo_addr_2g = "0x7dc00000";
+ logo_addr_3g = "0xbdc00000";
};
ge2d {
compatible = "amlogic, ge2d-gxm";
return of_read_number(p, s);
}
+static int get_ddr_size(void)
+{
+ int ddr_size = 0;
+ if (strstr(boot_command_line, "ddr_size=2"))
+ ddr_size = 2;
+ else if (strstr(boot_command_line, "ddr_size=3"))
+ ddr_size = 3;
+ else
+ ddr_size = 0;
+
+ return ddr_size;
+}
+
/**
* early_init_dt_scan_memory - Look for an parse memory nodes
*/
{
const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
const __be32 *reg, *endp;
- int l;
+ int l, ddr_size;
/* We are scanning "memory" nodes only */
if (type == NULL) {
} else if (strcmp(type, "memory") != 0)
return 0;
- reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
+ ddr_size = get_ddr_size();
+ if (ddr_size == 2)
+ reg = of_get_flat_dt_prop(node, "linux,usable-memory-2g", &l);
+ else if (ddr_size == 3)
+ reg = of_get_flat_dt_prop(node, "linux,usable-memory-3g", &l);
+ else
+ reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
+
if (reg == NULL)
reg = of_get_flat_dt_prop(node, "reg", &l);
if (reg == NULL)