4 #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
5 #define do_extend_cmdline 1
7 #define do_extend_cmdline 0
10 static int node_offset(
void *fdt,
const char *node_path)
18 static int setprop(
void *fdt,
const char *node_path,
const char *
property,
21 int offset = node_offset(fdt, node_path);
24 return fdt_setprop(fdt, offset, property, val_array, size);
27 static int setprop_string(
void *fdt,
const char *node_path,
28 const char *property,
const char *
string)
30 int offset = node_offset(fdt, node_path);
36 static int setprop_cell(
void *fdt,
const char *node_path,
39 int offset = node_offset(fdt, node_path);
42 return fdt_setprop_cell(fdt, offset, property, val);
45 static const void *getprop(
const void *fdt,
const char *node_path,
46 const char *property,
int *len)
56 static void merge_fdt_bootargs(
void *fdt,
const char *fdt_cmdline)
59 const char *fdt_bootargs;
64 fdt_bootargs = getprop(fdt,
"/chosen",
"bootargs", &len);
67 memcpy(ptr, fdt_bootargs, len);
78 memcpy(ptr, fdt_cmdline, len);
84 setprop_string(fdt,
"/chosen",
"bootargs", cmdline);
97 struct tag *atag = atag_list;
103 if ((
u32)atag_list & 0x3)
113 atag->
hdr.size != 2))
130 merge_fdt_bootargs(fdt,
133 setprop_string(fdt,
"/chosen",
"bootargs",
136 if (memcount >=
sizeof(mem_reg_property)/4)
138 if (!atag->
u.
mem.size)
144 initrd_start = atag->
u.
initrd.start;
145 initrd_size = atag->
u.
initrd.size;
146 setprop_cell(fdt,
"/chosen",
"linux,initrd-start",
148 setprop_cell(fdt,
"/chosen",
"linux,initrd-end",
149 initrd_start + initrd_size);
154 setprop(fdt,
"/memory",
"reg", mem_reg_property, 4*memcount);