From 59eac3be309a7a27df189621ac2d09a90c54b0cb Mon Sep 17 00:00:00 2001 From: user Date: Tue, 12 Dec 2023 16:37:12 +0800 Subject: [PATCH] support mac_addr --- app/syter_boot/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/syter_boot/main.c b/app/syter_boot/main.c index 160c51be..4f07f8af 100644 --- a/app/syter_boot/main.c +++ b/app/syter_boot/main.c @@ -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) { @@ -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 */ @@ -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=");