Skip to contentSkip to conversation

*** Commonize board code for K3 based SoMs ***

PATCH In review Wadim Egorov 2 participants 4 messages Apr 24, 2024 – May 10, 2024

lore
Share & tools
lore
#0 lore raw

cover *** Commonize board code for K3 based SoMs ***

Factor out code that we can reuse across all our K3 based SoMs. 2nd patch of this series require patch [1] to be applied first.

[1] https://lists.denx.de/pipermail/u-boot/2024-April/552021.html

Wadim Egorov (2):
board: phytec: Commonize board code for K3 based SoMs phycore_am64x_a53_defconfig: Enable CONFIG_BOARD_LATE_INIT

 board/phytec/common/Makefile               |  2 +
 board/phytec/common/k3/Makefile            |  2 +
 board/phytec/common/k3/board.c             | 73 ++++++++++++++++++++++
 board/phytec/phycore_am62x/phycore-am62x.c | 67 --------------------
 configs/phycore_am64x_a53_defconfig        |  1 +
 5 files changed, 78 insertions(+), 67 deletions(-)
 create mode 100644 board/phytec/common/k3/Makefile
 create mode 100644 board/phytec/common/k3/board.c
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 board: phytec: Commonize board code for K3 based SoMs

Environment handling code can be reused across all our K3 based SoMs. Instead of adding the same code for every new SoM, move it to a common board.c file.

---
 board/phytec/common/Makefile               |  2 +
 board/phytec/common/k3/Makefile            |  2 +
 board/phytec/common/k3/board.c             | 73 ++++++++++++++++++++++
 board/phytec/phycore_am62x/phycore-am62x.c | 67 --------------------
 4 files changed, 77 insertions(+), 67 deletions(-)
 create mode 100644 board/phytec/common/k3/Makefile
 create mode 100644 board/phytec/common/k3/board.c
board/phytec/common/Makefile +2 -0
index 35c81741306..0c738041565 100644
@@ -5,6 +5,8 @@
 ifdef CONFIG_SPL_BUILD
 # necessary to create built-in.o
 obj- := __dummy__.o
+else
+obj-$(CONFIG_ARCH_K3) += k3/
 endif
 
 obj-y += phytec_som_detection.o
board/phytec/common/k3/Makefile new file +2 -0
new file mode 100644
index 00000000000..bcca1a9f846
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0+
+obj-y += board.o
board/phytec/common/k3/board.c new file +73 -0

73 lines not on this page · raw message

board/phytec/phycore_am62x/phycore-am62x.c +0 -67

78 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 phycore_am64x_a53_defconfig: Enable CONFIG_BOARD_LATE_INIT

In reply to Wadim Egorov

Enable CONFIG_BOARD_LATE_INIT to use PHYTECs common board_late_init() to set handy environment variables for u-boot.
Also, resync after savedefconfig.

---
 configs/phycore_am64x_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/phycore_am64x_a53_defconfig +1 -0
index bd1e05bee58..8990d08d30a 100644
@@ -38,6 +38,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_BOOTSTD_FULL=y
 CONFIG_BOOTCOMMAND="run mmcboot; bootflow scan -lb"
 CONFIG_DEFAULT_FDT_FILE="oftree"
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x180000
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
Signature · 1 line
2.34.1