Go to the documentation of this file.
47 "File %s doesn't seem to be a DTB.\n", filename);
64 const char *root_path =
"/";
65 const char *node_name =
"chosen";
66 const char *full_path_node_name =
"/chosen";
67 const char *property_name =
"bootargs";
71 uint8_t *fdt_buf_w_space =
new uint8_t[newLen];
73 int ret = fdt_open_into((
void *)
fileData, (
void *)fdt_buf_w_space, newLen);
75 warn(
"Error resizing buffer of flattened device tree, "
77 delete [] fdt_buf_w_space;
82 int offset = fdt_path_offset((
void *)fdt_buf_w_space, full_path_node_name);
85 offset = fdt_path_offset((
void *)fdt_buf_w_space, root_path);
86 offset = fdt_add_subnode((
void *)fdt_buf_w_space,
offset, node_name);
89 offset = fdt_path_offset((
void *)fdt_buf_w_space,
93 warn(
"Error finding or adding \"chosen\" subnode to flattened "
94 "device tree, errno: %d\n",
offset);
95 delete [] fdt_buf_w_space;
101 ret = fdt_setprop((
void *)fdt_buf_w_space,
offset, property_name,
102 (
const void *)_args,
len+1);
104 warn(
"Error setting \"bootargs\" property to flattened device tree, "
106 delete [] fdt_buf_w_space;
111 ret = fdt_pack((
void *)fdt_buf_w_space);
113 warn(
"Error re-packing flattened device tree structure, "
115 delete [] fdt_buf_w_space;
134 int offset = fdt_path_offset(
fd,
"/cpus/cpu@0");
137 const void *temp = fdt_getprop(
fd,
offset,
"cpu-release-addr", &
len);
141 rel_addr =
betoh(*
static_cast<const uint32_t *
>(temp));
143 rel_addr = (rel_addr << 32) |
144 betoh(*(
static_cast<const uint32_t *
>(temp) + 1));
bool addBootCmdLine(const char *_args, size_t len)
Adds the passed in Command Line options for the kernel to the proper location in the device tree.
std::shared_ptr< ImageFileData > ImageFileDataPtr
DtbFile(const std::string &name)
bool fileDataMmapped
Bool marking if this dtb file has replaced the original read in DTB file with a new modified buffer.
MemoryImage buildImage() const override
ImageFileDataPtr imageData
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr findReleaseAddr()
Parse the DTB file enough to find the provided release address and return it.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17