Skip to content

Commit

Permalink
support mac_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
user authored and YuzukiTsuru committed Dec 12, 2023
1 parent 1008cc5 commit 59eac3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/syter_boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ static const char *find_entry_value(const IniEntry *entries, int entry_count, co
static int update_bootargs_from_config(uint64_t dram_size) {
int ret = 0;
char *bootargs_str_config = NULL;
char *mac_addr = NULL;

/* Check if using config file, get bootargs in the config file */
if (image.is_config) {
Expand All @@ -341,6 +342,7 @@ static int update_bootargs_from_config(uint64_t dram_size) {
printk(LOG_LEVEL_DEBUG, "INI: [%s] %s = %s\n", entries[i].section, entries[i].key, entries[i].value);
}
bootargs_str_config = find_entry_value(entries, entry_count, "configs", "bootargs");
mac_addr = find_entry_value(entries, entry_count, "configs", "mac_addr");
}

/* Force image.dest to be a pointer to fdt_header structure */
Expand Down Expand Up @@ -369,6 +371,12 @@ static int update_bootargs_from_config(uint64_t dram_size) {
bootargs_str_config = bootargs_str;
}

/* update mac address of board */
if (mac_addr != NULL) {
strcat(bootargs_str_config, " mac_addr=");
strcat(bootargs_str_config, mac_addr);
}

/* Add dram size to dtb */
char dram_size_str[8];
strcat(bootargs_str_config, " mem=");
Expand Down

0 comments on commit 59eac3b

Please sign in to comment.