Skip to contentSkip to conversation

arm: mach-sc5xx: Remove manual bss_clear

PATCH In review Greg Malysa 2 participants 3 messages Feb 28, 2025 – Mar 13, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: mach-sc5xx: Remove manual bss_clear

The arm library includes an implementation of bss_clear that is already called from crt0.S. This re-clearing of BSS should not be performed in the machine code and should therefore be removed.

---

 arch/arm/mach-sc5xx/soc.c | 26 --------------------------
 1 file changed, 26 deletions(-)
arch/arm/mach-sc5xx/soc.c +0 -26
index f3619206e91..9bf7c314e01 100644
@@ -172,34 +172,8 @@ void fixup_dp83867_phy(struct phy_device *phydev)
 		phy_write(phydev, MDIO_DEVAD_NONE, 0, 0x3100);
 }
 
-extern char __bss_start, __bss_end;
-extern char __rel_dyn_end;
-
-void bss_clear(void)
-{
-	char *bss_start = &__bss_start;
-	char *bss_end = &__bss_end;
-	char *rel_dyn_end = &__rel_dyn_end;
-
-	char *start;
-
-	if (rel_dyn_end >= bss_start && rel_dyn_end <= bss_end)
-		start = rel_dyn_end;
-	else
-		start = bss_start;
-
-	u32 *pt;
-	size_t sz = bss_end - start;
-
-	for (int i = 0; i < sz; i += 4) {
-		pt = (u32 *)(start + i);
-		*pt = 0;
-	}
-}
-
 int board_early_init_f(void)
 {
-	bss_clear();
 	return 0;
 }
 
Signature · 1 line
2.45.2
#1 lore raw

PATCH 2/2 arm: mach-sc5xx: Remove inappropriate board-specific functions

The sc5xx machine code includes implementations of board_init and board_early_init_f which should not be included in the base soc support code, as they should be implemented by a board where necessary.

This removes the default empty implementations of both from mach-sc5xx.

---

 arch/arm/mach-sc5xx/soc.c | 10 ----------
 1 file changed, 10 deletions(-)
arch/arm/mach-sc5xx/soc.c +0 -10
index 9bf7c314e01..8f13127a660 100644
@@ -172,16 +172,6 @@ void fixup_dp83867_phy(struct phy_device *phydev)
 		phy_write(phydev, MDIO_DEVAD_NONE, 0, 0x3100);
 }
 
-int board_early_init_f(void)
-{
-	return 0;
-}
-
-int board_init(void)
-{
-	return 0;
-}
-
 int dram_init(void)
 {
 	gd->ram_size = CFG_SYS_SDRAM_SIZE;
Signature · 1 line
2.45.2
#2 lore raw
In reply to Greg Malysa
Quoted 5 lines · Greg Malysa

The arm library includes an implementation of bss_clear that is already called from crt0.S. This re-clearing of BSS should not be performed in the machine code and should therefore be removed.

Applied to u-boot/next, thanks!

[1/2] arm: mach-sc5xx: Remove manual bss_clear

      commit: 3ce975ab888b583cb5816b1aa453136ea9549a3c
[2/2] arm: mach-sc5xx: Remove inappropriate board-specific functions
      commit: 74f4170a87a72438842ec7084741968dbc270702
Signature · 1 line
Tom