riscv: spacemit: add support for bananapi-f3
Subsystems (2)
v3 cover riscv: spacemit: add support for bananapi-f3
Banana Pi F3 board is a industrial grade RISC-V development board, it design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB 3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera.
This patch introduces fundamental support for the Banana Pi F3 board, encompassing UART, CPU, and PLIC support. This ensures that U-Boot can operate in serial console mode.
Changes in v3:
- Add memory node for dts
- Add base commit
- Add ft_board_setup function for kernel memory init
- Change license to GPL-2.0-or-later
- Clear redifinition warning while building in UART_IIR_ID
- Change underscore to dash in bananapi*f3
- Update maintainer
- Use default prompt
- link to v2 https://lore.kernel.org/u-boot/[email protected]/
---
Kongyang Liu (2):
riscv: spacemit: bananapi_f3: initial support added
doc: spacemit: bananapi_f3: document Banana Pi F3 board
arch/riscv/Kconfig | 5 + arch/riscv/cpu/k1/Kconfig | 18 ++ arch/riscv/cpu/k1/Makefile | 6 + arch/riscv/cpu/k1/cpu.c | 9 + arch/riscv/cpu/k1/dram.c | 54 ++++ arch/riscv/dts/Makefile | 1 + arch/riscv/dts/k1-bananapi-f3.dts | 25 ++ arch/riscv/dts/k1.dtsi | 459 +++++++++++++++++++++++++++++++++ board/spacemit/bananapi-f3/Kconfig | 25 ++ board/spacemit/bananapi-f3/MAINTAINERS | 7 + board/spacemit/bananapi-f3/Makefile | 5 + board/spacemit/bananapi-f3/board.c | 9 + configs/bananapi-f3_defconfig | 20 ++ doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++ doc/board/spacemit/index.rst | 8 + include/configs/bananapi-f3.h | 13 + 17 files changed, 743 insertions(+)
---
base-commit: 40c45a57974bdb09fffa31dde65ddf69e5de53eb
change-id: 20241112-pickup-bpif3-245ab208b9a4
Best regards,
Signature · 1 line
Huan Zhou <[email protected]>
PATCH v3 1/2 riscv: spacemit: bananapi_f3: initial support added
From: Kongyang Liu <[email protected]>
Add basic support for SpacemiT's Banana Pi F3 board. Update the k1.dtsi align with mainline.
Note that the device tree files follow the mainline Linux source[1].
[1]. https://patches.linaro.org/project/linux-serial/patch/[email protected]/
--- arch/riscv/Kconfig | 5 + arch/riscv/cpu/k1/Kconfig | 18 ++ arch/riscv/cpu/k1/Makefile | 6 + arch/riscv/cpu/k1/cpu.c | 9 + arch/riscv/cpu/k1/dram.c | 54 ++++ arch/riscv/dts/Makefile | 1 + arch/riscv/dts/k1-bananapi-f3.dts | 25 ++ arch/riscv/dts/k1.dtsi | 459 +++++++++++++++++++++++++++++++++ board/spacemit/bananapi-f3/Kconfig | 25 ++ board/spacemit/bananapi-f3/MAINTAINERS | 7 + board/spacemit/bananapi-f3/Makefile | 5 + board/spacemit/bananapi-f3/board.c | 9 + configs/bananapi-f3_defconfig | 20 ++ include/configs/bananapi-f3.h | 13 + 14 files changed, 656 insertions(+)
arch/riscv/Kconfig +5 -0
@@ -11,6 +11,9 @@ choice config TARGET_ANDES_AE350 bool "Support Andes ae350" +config TARGET_BANANAPI_F3 + bool "Support BananaPi F3 Board" + config TARGET_MICROCHIP_ICICLE bool "Support Microchip PolarFire-SoC Icicle Board"
@@ -88,6 +91,7 @@ source "board/sifive/unleashed/Kconfig" source "board/sifive/unmatched/Kconfig" source "board/sipeed/maix/Kconfig" source "board/sophgo/milkv_duo/Kconfig" +source "board/spacemit/bananapi-f3/Kconfig" source "board/starfive/visionfive2/Kconfig" source "board/thead/th1520_lpi4a/Kconfig" source "board/xilinx/mbv/Kconfig"
@@ -99,6 +103,7 @@ source "arch/riscv/cpu/fu540/Kconfig" source "arch/riscv/cpu/fu740/Kconfig" source "arch/riscv/cpu/generic/Kconfig" source "arch/riscv/cpu/jh7110/Kconfig" +source "arch/riscv/cpu/k1/Kconfig" # architecture-specific options below
arch/riscv/cpu/k1/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2024, Kongyang Liu <[email protected]> + +config SPACEMIT_K1 + bool + select BINMAN + select ARCH_EARLY_INIT_R + select SYS_CACHE_SHIFT_6 + imply CPU + imply CPU_RISCV + imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) + imply RISCV_ACLINT if RISCV_MMODE + imply SPL_RISCV_ACLINT if SPL_RISCV_MMODE + imply CMD_CPU + imply SPL_CPU + imply SPL_OPENSBI + imply SPL_LOAD_FIT
arch/riscv/cpu/k1/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (c) 2024, Kongyang Liu <[email protected]> + +obj-y += dram.o +obj-y += cpu.o
arch/riscv/cpu/k1/cpu.c new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2024, Kongyang Liu <[email protected]> +*/ + +int cleanup_before_linux (void ) +{ +return 0 ; +}
arch/riscv/cpu/k1/dram.c new file +54 -0
54 lines not on this page · raw message
arch/riscv/dts/Makefile +1 -0
@@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ dtb-$(CONFIG_TARGET_ANDES_AE350) += ae350_32.dtb ae350_64.dtb +dtb-$(CONFIG_TARGET_BANANAPI_F3) += k1-bananapi-f3.dtb dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += mpfs-icicle-kit.dtb dtb-$(CONFIG_TARGET_MILKV_DUO) += cv1800b-milkv-duo.dtb dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt32.dtb qemu-virt64.dtb
arch/riscv/dts/k1-bananapi-f3.dts new file +25 -0
@@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (C) 2024 Yangyu Chen <[email protected]> + */ + +#include "k1.dtsi" +#include "binman.dtsi" + +/ { + model = "Banana Pi BPI-F3"; + compatible = "bananapi,bpi-f3", "spacemit,k1"; + + chosen { + stdout-path = "serial0"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x80000000>; + }; +}; + +&uart0 { + status = "okay"; +};
arch/riscv/dts/k1.dtsi new file +459 -0
460 lines not on this page · raw message
board/spacemit/bananapi-f3/Kconfig new file +25 -0
@@ -0,0 +1,25 @@ +if TARGET_BANANAPI_F3 + +config SYS_BOARD + default "bananapi-f3" + +config SYS_VENDOR + default "spacemit" + +config SYS_CPU + default "k1" + +config SYS_CONFIG_NAME + default "bananapi-f3" + +config TEXT_BASE + default 0x00200000 + +config SPL_OPENSBI_LOAD_ADDR + default 0x00000000 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select SPACEMIT_K1 + +endif
board/spacemit/bananapi-f3/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +BananaPi F3 +M: Kongyang Liu <[email protected]> +M: Huan Zhou <pericycle.cc@@gmail.com> +S: Maintained +F: board/spacemit/bananapi-f3/ +F: configs/bananapi-f3_defconfig +F: doc/board/spacemit/bananapi-f3.rst
board/spacemit/bananapi-f3/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (c) 2024, Kongyang Liu <[email protected]> + +obj-y := board.o
board/spacemit/bananapi-f3/board.c new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) 2024, Kongyang Liu <[email protected]> +*/ + +int board_init (void ) +{ +return 0 ; +}
configs/bananapi-f3_defconfig new file +20 -0
@@ -0,0 +1,20 @@ +CONFIG_RISCV=y +CONFIG_SYS_MALLOC_LEN=0x1000000 +CONFIG_NR_DRAM_BANKS=2 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x1000000 +CONFIG_DEFAULT_DEVICE_TREE="k1-bananapi-f3" +CONFIG_SYS_LOAD_ADDR=0x200000 +CONFIG_TARGET_BANANAPI_F3=y +CONFIG_ARCH_RV64I=y +CONFIG_RISCV_SMODE=y +CONFIG_FIT=y +CONFIG_SYS_BOOTM_LEN=0xa000000 +CONFIG_SUPPORT_RAW_INITRD=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_CBSIZE=256 +CONFIG_SYS_PBSIZE=276 +CONFIG_HUSH_PARSER=y +CONFIG_ENV_OVERWRITE=y +CONFIG_SYS_NS16550=y +CONFIG_SYS_NS16550_MEM32=y
include/configs/bananapi-f3.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright (c) 2024, Kongyang Liu <[email protected]> +* +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CFG_SYS_SDRAM_BASE 0x0 +#define CFG_SYS_NS16550_IER 0x40 + +#endif /* __CONFIG_H */
Signature · 1 line
2.39.5
PATCH v3 2/2 doc: spacemit: bananapi_f3: document Banana Pi F3 board
In reply to Huan ZhouFrom: Kongyang Liu <[email protected]>
Add document for Banana Pi F3 board which based on SpacemiT's K1 SoC.
--- doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++++++++++++++++++++++++++++++++++ doc/board/spacemit/index.rst | 8 ++++ 3 files changed, 87 insertions(+)
doc/board/index.rst +1 -0
@@ -51,6 +51,7 @@ Board-specific doc sipeed/index socionext/index sophgo/index + spacemit/index st/index starfive/index ste/index
doc/board/spacemit/bananapi-f3.rst new file +78 -0
78 lines not on this page · raw message
doc/board/spacemit/index.rst new file +8 -0
@@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +SpacemiT +======== +.. toctree:: + :maxdepth: 1 + + bananapi-f3
Signature · 1 line
2.39.5
Re: [PATCH v3 2/2] doc: spacemit: bananapi_f3: document Banana Pi F3 board
Quoted 30 lines · Huan Zhou
From: Kongyang Liu <[email protected]>
Add document for Banana Pi F3 board which based on SpacemiT's K1 SoC.
Signed-off-by Kongyang Liu <[email protected]>Signed-off-by Huan Zhou <[email protected]>--- doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++++++++++++++++++++++++++++++++++ doc/board/spacemit/index.rst | 8 ++++ 3 files changed, 87 insertions(+)doc/board/index.rst +1
-0@@ -51,6 +51,7 @@ Board-specific doc sipeed/index socionext/index sophgo/index + spacemit/index st/index starfive/index ste/indexdoc/board/spacemit/bananapi-f3.rst new file +0
-0
doc/board/spacemit/bananapi-f3.rst line 7
Quoted 7 lines
doc/board/spacemit/bananapi-f3.rst new file +7
-0@@ -0,0 +1,78 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Banana Pi F3 +============ + +About This +----------
Thank you for documenting the new board.
For such a short article we don't need three levels of sections:
Banana Pi F3
|- About This | |- Building | |- Booting.
The 'About This' title could be completely removed. Otherwise, please, put it on the same level as the other sub-sections.
doc/board/spacemit/bananapi-f3.rst line 15
Quoted 8 lines
doc/board/spacemit/bananapi-f3.rst new file +8
-0+Banana Pi F3 board is a industrial grade RISC-V development board, it +design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI +computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB +3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera. + +Building +~~~~~~~~ +1. Add the RISC-V toolchain to your PATH.
If we use CROSS_COMPILE, the toolchain does not need to be on the PATH. You could use an absolute path like
CROSS_COMPILE=/home/user/my_tools_dir/riscv64-linux-gnu-
doc/board/spacemit/bananapi-f3.rst line 16
Quoted 1 line
doc/board/spacemit/bananapi-f3.rst new file +1
-0+2. Setup ARCH & cross compilation environment variable:
Environment variable ARCH is not used when building U-Boot. The only usage is in scripts/decodecode.
Quoted 20 lines
doc/board/spacemit/bananapi-f3.rst new file +20
-0+ +.. code-block:: console + + export CROSS_COMPILE=<riscv64 toolchain prefix> + +3. Before building U-Boot, OpenSBI should be built first. OpenSBI can be +built for SpacemiT K1 SoC as below: + +.. code-block:: console + + git clone https://github.com/cyyself/opensbi -b k1-opensbi + cd opensbi + make PLATFORM=generic + +4. Then build U-Boot as following: + +.. code-block:: console + + cd <U-Boot-dir> + make bananapi-f3_defconfig
doc/board/spacemit/bananapi-f3.rst line 46
Quoted 10 lines
doc/board/spacemit/bananapi-f3.rst new file +10
-0+ make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin + +This will generate u-boot.itb + +Booting +~~~~~~~ +Currently, we use a modified vendor's U-Boot SPL to load a FIT image that +includes OpenSBI and U-Boot. Fully describing how to boot into U-Boot is a +challenging task. And the booting method will be added after the SPL +support is available.
Could you, please, describe how to build and use the 'modified vendor's U-Boot SPL' so that others can test and contribute.
Best regards
Heinrich
Quoted 47 lines
doc/board/spacemit/bananapi-f3.rst new file +32
-0+ +Sample boot log from Banana Pi F3 board +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: none + + U-Boot 2024.07-00686-g608f2d51760c (Jul 08 2024 - 14:53:51 +0800) + + DRAM: 4 GiB + Core: 18 devices, 7 uclasses, devicetree: separate + Loading Environment from nowhere... OK + In: serial@d4017000 + Out: serial@d4017000 + Err: serial@d4017000 + Net: No ethernet found. + bananapi_f3# cpu detail + 0: cpu@0 spacemit,x60 + ID = 0, freq = 0 Hz: MMU + 1: cpu@1 spacemit,x60 + ID = 1, freq = 0 Hz: MMU + 2: cpu@2 spacemit,x60 + ID = 2, freq = 0 Hz: MMU + 3: cpu@3 spacemit,x60 + ID = 3, freq = 0 Hz: MMU + 4: cpu@4 spacemit,x60 + ID = 4, freq = 0 Hz: MMU + 5: cpu@5 spacemit,x60 + ID = 5, freq = 0 Hz: MMU + 6: cpu@6 spacemit,x60 + ID = 6, freq = 0 Hz: MMU + 7: cpu@7 spacemit,x60 + ID = 7, freq = 0 Hz: MMU + bananapi_f3#doc/board/spacemit/index.rst new file +8
-0@@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +SpacemiT +======== +.. toctree:: + :maxdepth: 1 + + bananapi-f3
Re: [PATCH v3 2/2] doc: spacemit: bananapi_f3: document Banana Pi F3 board
Hi
Quoted 95 lines · Heinrich Schuchardt
Quoted 30 lines · Huan Zhou
From: Kongyang Liu <[email protected]>
Add document for Banana Pi F3 board which based on SpacemiT's K1 SoC.
Signed-off-by Kongyang Liu <[email protected]>Signed-off-by Huan Zhou <[email protected]>--- doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++++++++++++++++++++++++++++++++++ doc/board/spacemit/index.rst | 8 ++++ 3 files changed, 87 insertions(+)doc/board/index.rst +1
-0@@ -51,6 +51,7 @@ Board-specific doc sipeed/index socionext/index sophgo/index + spacemit/index st/index starfive/index ste/indexdoc/board/spacemit/bananapi-f3.rst new file +0
-0doc/board/spacemit/bananapi-f3.rst line 7
Quoted 7 lines
doc/board/spacemit/bananapi-f3.rst new file +7
-0@@ -0,0 +1,78 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Banana Pi F3 +============ + +About This +----------Thank you for documenting the new board.
For such a short article we don't need three levels of sections:
Banana Pi F3
|- About This | |- Building | |- Booting.The 'About This' title could be completely removed. Otherwise, please, put it on the same level as the other sub-sections.
doc/board/spacemit/bananapi-f3.rst line 15
Quoted 8 lines
doc/board/spacemit/bananapi-f3.rst new file +8
-0+Banana Pi F3 board is a industrial grade RISC-V development board, it +design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI +computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB +3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera. + +Building +~~~~~~~~ +1. Add the RISC-V toolchain to your PATH.If we use
CROSS_COMPILE, the toolchain does not need to be on the PATH. You could use an absolute path likeCROSS_COMPILE=/home/user/my_tools_dir/riscv64-linux-gnu-
doc/board/spacemit/bananapi-f3.rst line 16
Quoted 1 line
doc/board/spacemit/bananapi-f3.rst new file +1
-0+2. Setup ARCH & cross compilation environment variable:Environment variable ARCH is not used when building U-Boot. The only usage is in
scripts/decodecode.Quoted 25 lines
doc/board/spacemit/bananapi-f3.rst new file +25
-0+ +.. code-block:: console + + export CROSS_COMPILE=<riscv64 toolchain prefix> + +3. Before building U-Boot, OpenSBI should be built first. OpenSBI can be +built for SpacemiT K1 SoC as below: + +.. code-block:: console + + git clone https://github.com/cyyself/opensbi -b k1-opensbi + cd opensbi + make PLATFORM=generic + +4. Then build U-Boot as following: + +.. code-block:: console + + cd <U-Boot-dir> + make bananapi-f3_defconfig + make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin + +This will generate u-boot.itb + +Booting
Quoted 9 lines
doc/board/spacemit/bananapi-f3.rst line 46
Quoted 5 lines
doc/board/spacemit/bananapi-f3.rst new file +5
-0+~~~~~~~ +Currently, we use a modified vendor's U-Boot SPL to load a FIT image that +includes OpenSBI and U-Boot. Fully describing how to boot into U-Boot is a +challenging task. And the booting method will be added after the SPL +support is available.Could you, please, describe how to build and use the 'modified vendor's U-Boot SPL' so that others can test and contribute.
I suspect there might be some patches needed, but fine if we can do it manually via command,
in additio to "for others to test and contribute", describing how to flash the firmware to
storage (either sd/emmc/spiflash) would be also required, vendor using fastboot..
Quoted 52 lines
Best regards
Heinrich
Quoted 47 lines
doc/board/spacemit/bananapi-f3.rst new file +32
-0+ +Sample boot log from Banana Pi F3 board +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: none + + U-Boot 2024.07-00686-g608f2d51760c (Jul 08 2024 - 14:53:51 +0800) + + DRAM: 4 GiB + Core: 18 devices, 7 uclasses, devicetree: separate + Loading Environment from nowhere... OK + In: serial@d4017000 + Out: serial@d4017000 + Err: serial@d4017000 + Net: No ethernet found. + bananapi_f3# cpu detail + 0: cpu@0 spacemit,x60 + ID = 0, freq = 0 Hz: MMU + 1: cpu@1 spacemit,x60 + ID = 1, freq = 0 Hz: MMU + 2: cpu@2 spacemit,x60 + ID = 2, freq = 0 Hz: MMU + 3: cpu@3 spacemit,x60 + ID = 3, freq = 0 Hz: MMU + 4: cpu@4 spacemit,x60 + ID = 4, freq = 0 Hz: MMU + 5: cpu@5 spacemit,x60 + ID = 5, freq = 0 Hz: MMU + 6: cpu@6 spacemit,x60 + ID = 6, freq = 0 Hz: MMU + 7: cpu@7 spacemit,x60 + ID = 7, freq = 0 Hz: MMU + bananapi_f3#doc/board/spacemit/index.rst new file +8
-0@@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +SpacemiT +======== +.. toctree:: + :maxdepth: 1 + + bananapi-f3
Signature · 3 lines
Yixun Lan (dlan) Gentoo Linux Developer GPG Key ID AABEFD55
Re: [PATCH v3 2/2] doc: spacemit: bananapi_f3: document Banana Pi F3 board
In reply to Heinrich SchuchardtQuoted 43 lines · Heinrich Schuchardt
Quoted 30 lines · Huan Zhou
From: Kongyang Liu <[email protected]>
Add document for Banana Pi F3 board which based on SpacemiT's K1 SoC.
Signed-off-by Kongyang Liu <[email protected]>Signed-off-by Huan Zhou <[email protected]>--- doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++++++++++++++++++++++++++++++++++ doc/board/spacemit/index.rst | 8 ++++ 3 files changed, 87 insertions(+)doc/board/index.rst +1
-0@@ -51,6 +51,7 @@ Board-specific doc sipeed/index socionext/index sophgo/index + spacemit/index st/index starfive/index ste/indexdoc/board/spacemit/bananapi-f3.rst new file +0
-0doc/board/spacemit/bananapi-f3.rst line 7
Quoted 7 lines
doc/board/spacemit/bananapi-f3.rst new file +7
-0@@ -0,0 +1,78 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Banana Pi F3 +============ + +About This +----------Thank you for documenting the new board.
For such a short article we don't need three levels of sections:
Quoted 7 lines
Banana Pi F3
|- About This | |- Building | |- Booting.The 'About This' title could be completely removed. Otherwise, please, put it on the same level as the other sub-sections.
removed in next version.
Quoted 10 lines
doc/board/spacemit/bananapi-f3.rst line 15
Quoted 9 lines
doc/board/spacemit/bananapi-f3.rst new file +8
-0+Banana Pi F3 board is a industrial grade RISC-V development board, it +design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI +computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB +3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera. + +Building +~~~~~~~~ +1. Add the RISC-V toolchain to your PATH.
changed in next version.
Quoted 10 lines
If we use
CROSS_COMPILE, the toolchain does not need to be on the PATH. You could use an absolute path likeCROSS_COMPILE=/home/user/my_tools_dir/riscv64-linux-gnu-
doc/board/spacemit/bananapi-f3.rst line 16
Quoted 1 line
doc/board/spacemit/bananapi-f3.rst new file +1
-0+2. Setup ARCH & cross compilation environment variable:Environment variable ARCH is not used when building U-Boot. The only usage is in
scripts/decodecode.
got it.
Quoted 25 lines
Quoted 25 lines
doc/board/spacemit/bananapi-f3.rst new file +25
-0+ +.. code-block:: console + + export CROSS_COMPILE=<riscv64 toolchain prefix> + +3. Before building U-Boot, OpenSBI should be built first. OpenSBI can be +built for SpacemiT K1 SoC as below: + +.. code-block:: console + + git clone https://github.com/cyyself/opensbi -b k1-opensbi + cd opensbi + make PLATFORM=generic + +4. Then build U-Boot as following: + +.. code-block:: console + + cd <U-Boot-dir> + make bananapi-f3_defconfig + make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin + +This will generate u-boot.itb + +Booting
Quoted 9 lines
doc/board/spacemit/bananapi-f3.rst line 46
Quoted 5 lines
doc/board/spacemit/bananapi-f3.rst new file +5
-0+~~~~~~~ +Currently, we use a modified vendor's U-Boot SPL to load a FIT image that +includes OpenSBI and U-Boot. Fully describing how to boot into U-Boot is a +challenging task. And the booting method will be added after the SPL +support is available.Could you, please, describe how to build and use the 'modified vendor's U-Boot SPL' so that others can test and contribute.
ok, will be discribed with more details in next version:-)
Quoted 43 lines
Best regards
Heinrich
Quoted 39 lines
doc/board/spacemit/bananapi-f3.rst new file +32
-0+ +Sample boot log from Banana Pi F3 board +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: none + + U-Boot 2024.07-00686-g608f2d51760c (Jul 08 2024 - 14:53:51 +0800) + + DRAM: 4 GiB + Core: 18 devices, 7 uclasses, devicetree: separate + Loading Environment from nowhere... OK + In: serial@d4017000 + Out: serial@d4017000 + Err: serial@d4017000 + Net: No ethernet found. + bananapi_f3# cpu detail + 0: cpu@0 spacemit,x60 + ID = 0, freq = 0 Hz: MMU + 1: cpu@1 spacemit,x60 + ID = 1, freq = 0 Hz: MMU + 2: cpu@2 spacemit,x60 + ID = 2, freq = 0 Hz: MMU + 3: cpu@3 spacemit,x60 + ID = 3, freq = 0 Hz: MMU + 4: cpu@4 spacemit,x60 + ID = 4, freq = 0 Hz: MMU + 5: cpu@5 spacemit,x60 + ID = 5, freq = 0 Hz: MMU + 6: cpu@6 spacemit,x60 + ID = 6, freq = 0 Hz: MMU + 7: cpu@7 spacemit,x60 + ID = 7, freq = 0 Hz: MMU + bananapi_f3#doc/board/spacemit/index.rst new file +1
-0@@ -0,0 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later
Quoted 9 lines
doc/board/spacemit/index.rst line 8
Quoted 8 lines
doc/board/spacemit/index.rst new file +7
-0+ +SpacemiT +======== +.. toctree:: + :maxdepth: 1 + + bananapi-f3
Best regards,
Huan Zhou
Hi Huan:
Quoted 9 lines · Huan Zhou
Banana Pi F3 board is a industrial grade RISC-V development board, it design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB 3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera.
This patch introduces fundamental support for the Banana Pi F3 board, encompassing UART, CPU, and PLIC support. This ensures that U-Boot can operate in serial console mode.
Quoted 11 lines
Changes in v3:
- Add memory node for dts
- Add base commit
- Addft_board_setupfunction for kernel memory init
- Change license to GPL-2.0-or-later
- Clear redifinition warning while building inUART_IIR_ID
- Change underscore to dash in bananapi*f3
- Update maintainer
- Use default prompt
- link to v2 https://lore.kernel.org/u-boot/[email protected]/
although you're taking over this patch, the "Changes in v2" log should be preserved better also add the "link to v1" URL
Quoted 33 lines
Signed-off-by Huan Zhou <[email protected]>Signed-off-by Kongyang Liu <[email protected]>---
Kongyang Liu (2):
riscv: spacemit:bananapi_f3: initial support added
doc: spacemit:bananapi_f3: document Banana Pi F3 boardarch/riscv/Kconfig | 5 + arch/riscv/cpu/k1/Kconfig | 18 ++ arch/riscv/cpu/k1/Makefile | 6 + arch/riscv/cpu/k1/cpu.c | 9 + arch/riscv/cpu/k1/dram.c | 54 ++++ arch/riscv/dts/Makefile | 1 + arch/riscv/dts/k1-bananapi-f3.dts | 25 ++ arch/riscv/dts/k1.dtsi | 459 +++++++++++++++++++++++++++++++++ board/spacemit/bananapi-f3/Kconfig | 25 ++ board/spacemit/bananapi-f3/MAINTAINERS | 7 + board/spacemit/bananapi-f3/Makefile | 5 + board/spacemit/bananapi-f3/board.c | 9 + configs/bananapi-f3_defconfig | 20 ++ doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++ doc/board/spacemit/index.rst | 8 + include/configs/bananapi-f3.h | 13 + 17 files changed, 743 insertions(+)---
base-commit:40c45a57974bdb09fffa31dde65ddf69e5de53eb
change-id: 20241112-pickup-bpif3-245ab208b9a4Best regards,
Signature · 1 line
Huan Zhou <[email protected]>
Signature · 3 lines
Yixun Lan (dlan) Gentoo Linux Developer GPG Key ID AABEFD55
Quoted 23 lines · Yixun Lan
Hi Huan:
Quoted 9 lines · Huan Zhou
Banana Pi F3 board is a industrial grade RISC-V development board, it design with SpacemiT K1 8 core RISC-V chip, CPU integrates 2.0 TOPs AI computing power. 4G DDR and 16G eMMC onboard. 2x GbE Ethernet port, 4x USB 3.0 and PCIe for M.2 interface, support HDMI and Dual MIPI-CSI Camera.
This patch introduces fundamental support for the Banana Pi F3 board, encompassing UART, CPU, and PLIC support. This ensures that U-Boot can operate in serial console mode.
Quoted 11 lines
Changes in v3:
- Add memory node for dts
- Add base commit
- Addft_board_setupfunction for kernel memory init
- Change license to GPL-2.0-or-later
- Clear redifinition warning while building inUART_IIR_ID
- Change underscore to dash in bananapi*f3
- Update maintainer
- Use default prompt
- link to v2 https://lore.kernel.org/u-boot/[email protected]/
Quoted 2 lines
although you're taking over this patch, the "Changes in v2" log should be preserved better also add the "link to v1" URL
ok, will be added in next version
Quoted 40 lines
Quoted 35 lines
Signed-off-by Huan Zhou <[email protected]>Signed-off-by Kongyang Liu <[email protected]>---
Kongyang Liu (2):
riscv: spacemit:bananapi_f3: initial support added
doc: spacemit:bananapi_f3: document Banana Pi F3 boardarch/riscv/Kconfig | 5 + arch/riscv/cpu/k1/Kconfig | 18 ++ arch/riscv/cpu/k1/Makefile | 6 + arch/riscv/cpu/k1/cpu.c | 9 + arch/riscv/cpu/k1/dram.c | 54 ++++ arch/riscv/dts/Makefile | 1 + arch/riscv/dts/k1-bananapi-f3.dts | 25 ++ arch/riscv/dts/k1.dtsi | 459 +++++++++++++++++++++++++++++++++ board/spacemit/bananapi-f3/Kconfig | 25 ++ board/spacemit/bananapi-f3/MAINTAINERS | 7 + board/spacemit/bananapi-f3/Makefile | 5 + board/spacemit/bananapi-f3/board.c | 9 + configs/bananapi-f3_defconfig | 20 ++ doc/board/index.rst | 1 + doc/board/spacemit/bananapi-f3.rst | 78 ++++++ doc/board/spacemit/index.rst | 8 + include/configs/bananapi-f3.h | 13 + 17 files changed, 743 insertions(+)---
base-commit:40c45a57974bdb09fffa31dde65ddf69e5de53eb
change-id: 20241112-pickup-bpif3-245ab208b9a4Best regards,
Signature · 1 line
Huan Zhou <[email protected]>Signature · 3 lines
Yixun Lan (dlan) Gentoo Linux Developer GPG Key ID AABEFD55