From cebc8161708e357758c407eaa79a8cd66ee68fde Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Sun, 15 May 2022 21:40:29 +0300 Subject: event: fix static events for CONFIG_NEEDS_MANUAL_RELOC Static events do not currently work post-relocation for boards that enable CONFIG_NEEDS_MANUAL_RELOC. Relocate event handler pointers for all event spies to fix this. Tested on Microblaze. Signed-off-by: Ovidiu Panait --- common/board_r.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/board_r.c') diff --git a/common/board_r.c b/common/board_r.c index 22b5deaa8c2..4e3cf1f4ecc 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -612,6 +612,9 @@ static init_fnc_t init_sequence_r[] = { */ #endif initr_reloc_global_data, +#if CONFIG_IS_ENABLED(NEEDS_MANUAL_RELOC) && CONFIG_IS_ENABLED(EVENT) + event_manual_reloc, +#endif #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) initr_unlock_ram_in_cache, #endif -- cgit v1.2.3 From e5e04eaa2f1cb4dc37a12551018a00a18cab19de Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 20 May 2022 13:19:08 +0200 Subject: common/board_r.c: drop legacy and unused bi_enetaddr The bi_enetaddr field in struct bd_info is write-only; nothing ever reads back the value. Moreover, the value we write is more or less random, and certainly not something one can rely on: If the board has a writable environment and the mac address has been stored there, we fetch that value. But if the board doesn't, this code runs before initr_net() -> eth_initialize(), and thus before the code in eth-uclass which fetches MAC addresses from eeprom, fuses or whatnot and populates the (run-time) environment with those values. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- common/board_r.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'common/board_r.c') diff --git a/common/board_r.c b/common/board_r.c index 4e3cf1f4ecc..ed29069d2de 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -469,18 +469,6 @@ static int initr_malloc_bootparams(void) } #endif -#ifdef CONFIG_CMD_NET -static int initr_ethaddr(void) -{ - struct bd_info *bd = gd->bd; - - /* kept around for legacy kernels only ... ignore the next section */ - eth_env_get_enetaddr("ethaddr", bd->bi_enetaddr); - - return 0; -} -#endif /* CONFIG_CMD_NET */ - #if defined(CONFIG_LED_STATUS) static int initr_status_led(void) { @@ -759,9 +747,6 @@ static init_fnc_t init_sequence_r[] = { initr_status_led, #endif /* PPC has a udelay(20) here dating from 2002. Why? */ -#ifdef CONFIG_CMD_NET - initr_ethaddr, -#endif #if defined(CONFIG_GPIO_HOG) gpio_hog_probe_all, #endif -- cgit v1.2.3