Skip to content

Add board support for Spacemit K1 SoC in SPL

Raymond Mao u-boot 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest16 patches 7 repliesIn review
  2. v216 patches 6 repliesSuperseded
  3. v117 patches 19 repliesSuperseded

Changes in v3 from the cover letter

- Merge CONFIG_ARCH_K1 and CONFIG_TARGET_BANANAPI_F3 into CONFIG_TARGET_SPACEMIT_K1. This configuration should be used for all boards with Spacemit K1 SoC.
- Remove CONFIG_SPL_RESET_SPACEMIT_K1, CONFIG_SPL_CLK_SPACEMIT_K1, CONFIG_SPL_PMIC_SPACEMIT_P1, CONFIG_SPL_DM_REGULATOR_SPACEMIT_P1. Since they're redundant for SPL stage.
- Fix the calculation on clock ID. While the clock driver is initialized in uboot stage, it'll be run twice. Without the protection, it'll cause panic in the second time.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16spacemit: k1: support multi-board infrastructurearch/riscv/Kconfig arch/riscv/cpu/k1/Kconfig arch/riscv/dts/Makefile +7 more+16 -120 replies
2/16spacemit: k1: enable SPL with debug UARTarch/riscv/cpu/k1/Kconfig arch/riscv/dts/Makefile arch/riscv/dts/k1-spl.dts +5 more+80 -50 replies
3/16configs: k1: enable early timer supportconfigs/spacemit_k1_defconfig include/configs/k1.h+5 -00 replies
4/16reset: k1: remove TWSI8 reset restrictiondrivers/reset/reset-spacemit-k1.c+0 -40 replies
5/16dt-bindings: clock: import k1-syscon from upstreaminclude/dt-bindings/clock/spacemit,k1-syscon.h+253 -00 replies
6/16dts: k1: import dts file from upstream folderarch/riscv/dts/k1.dtsi+460 -1020 replies
7/16clk: spacemit: Add support for K1 SoCdrivers/clk/Kconfig drivers/clk/Makefile drivers/clk/spacemit/Kconfig +10 more+3070 -20 replies
8/16dts: k1: enable clocks in SPLarch/riscv/dts/k1-spl.dts+48 -10 replies
9/16board: k1: initialize clock and serial devices in SPLboard/spacemit/k1/spl.c+39 -00 replies
10/16configs: k1: add default option for clock driver in SPLconfigs/spacemit_k1_defconfig+12 -00 replies
11/16i2c: k1: add I2C driver supportdrivers/i2c/Kconfig drivers/i2c/Makefile drivers/i2c/k1_i2c.c +1 more+593 -00 replies
12/16spacemit: k1: add TLV EEPROM support in SPLarch/riscv/dts/k1-spl.dts arch/riscv/dts/k1.dtsi board/spacemit/k1/spl.c +2 more+269 -10 replies
13/16spacemit: k1: Add DDR firmware support to SPLarch/riscv/dts/k1-spl.dts board/spacemit/k1/Makefile board/spacemit/k1/spl.c+165 -10 replies
14/16power: pmic: add support for Spacemit P1 PMICdrivers/power/pmic/Kconfig drivers/power/pmic/Makefile drivers/power/pmic/pmic_spacemit_p1.c +1 more+266 -00 replies
15/16power: regulator: add support for Spacemit P1 SoCdrivers/power/regulator/Kconfig drivers/power/regulator/Makefile drivers/power/regulator/spacemit_p1_regulator.c+469 -00 replies
16/16board: k1: enable pmic in splarch/riscv/dts/k1-spl.dts board/spacemit/k1/MAINTAINERS board/spacemit/k1/spl.c +1 more+201 -230 replies

Reviews trailers per patch

3 of 16 patches have a Reviewed-by or Acked-by.

PatchHeiko SchocherPeng FanVincent Legoll
SeriesT-b
1/16
2/16
3/16
4/16
5/16
6/16
7/16
8/16
9/16
10/16
11/16R-b
12/16
13/16
14/16A-b
15/16A-b
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/16] Add board support for Spacemit K1 SoC in SPL

From: Raymond Mao <[email protected]>

This series adds SPL support for the SpacemiT K1 SoC, enabling boot on K1-based boards such as the BananaPi F3.

To verify, please refer to the doc patch "doc: spacemit: add K1 SPL build and test guide" [1], which is still valid and suggest to be included to riscv/next.

[1] https://lore.kernel.org/u-boot/[email protected]/

Changes in v3:
- Merge CONFIG_ARCH_K1 and CONFIG_TARGET_BANANAPI_F3 into CONFIG_TARGET_SPACEMIT_K1. This configuration should be used for all boards with Spacemit K1 SoC.
- Remove CONFIG_SPL_RESET_SPACEMIT_K1, CONFIG_SPL_CLK_SPACEMIT_K1, CONFIG_SPL_PMIC_SPACEMIT_P1, CONFIG_SPL_DM_REGULATOR_SPACEMIT_P1. Since they're redundant for SPL stage.
- Fix the calculation on clock ID. While the clock driver is initialized in uboot stage, it'll be run twice. Without the protection, it'll cause panic in the second time.

Change in v2:
- Use read_poll_timeout() in k1 i2c driver.
- Abandon to parse offset and size from Kconfig & Makefile for binman.
- Abandon to attach firmware image into the patch set.
- Update the related document and some minor changes.

Junhui Liu (1):
clk: spacemit: Add support for K1 SoC

Raymond Mao (15):
spacemit: k1: support multi-board infrastructure
spacemit: k1: enable SPL with debug UART
configs: k1: enable early timer support
reset: k1: remove TWSI8 reset restriction
dt-bindings: clock: import k1-syscon from upstream
dts: k1: import dts file from upstream folder
dts: k1: enable clocks in SPL
board: k1: initialize clock and serial devices in SPL
configs: k1: add default option for clock driver in SPL
i2c: k1: add I2C driver support
spacemit: k1: add TLV EEPROM support in SPL
spacemit: k1: Add DDR firmware support to SPL
power: pmic: add support for Spacemit P1 PMIC
power: regulator: add support for Spacemit P1 SoC
board: k1: enable pmic in spl

 arch/riscv/Kconfig                            |    8 +-
 arch/riscv/cpu/k1/Kconfig                     |    6 +
 arch/riscv/dts/Makefile                       |    2 +-
 arch/riscv/dts/k1-spl.dts                     |  228 +++
 arch/riscv/dts/k1.dtsi                        |  666 +++++-
 board/spacemit/bananapi-f3/MAINTAINERS        |    6 -
 board/spacemit/bananapi-f3/Makefile           |    5 -
 board/spacemit/{bananapi-f3 => k1}/Kconfig    |    6 +-
 board/spacemit/k1/MAINTAINERS                 |   11 +
 board/spacemit/k1/Makefile                    |   27 +
 board/spacemit/{bananapi-f3 => k1}/board.c    |    0
 board/spacemit/k1/spl.c                       |  347 ++++
 board/spacemit/k1/tlv_codes.h                 |   22 +
 configs/bananapi-f3_defconfig                 |   24 -
 configs/spacemit_k1_defconfig                 |   76 +
 doc/board/spacemit/bananapi-f3.rst            |    2 +-
 drivers/clk/Kconfig                           |    5 +-
 drivers/clk/Makefile                          |    1 +
 drivers/clk/spacemit/Kconfig                  |   22 +
 drivers/clk/spacemit/Makefile                 |    7 +
 drivers/clk/spacemit/clk-k1.c                 | 1798 +++++++++++++++++
 drivers/clk/spacemit/clk_common.h             |   79 +
 drivers/clk/spacemit/clk_ddn.c                |   93 +
 drivers/clk/spacemit/clk_ddn.h                |   53 +
 drivers/clk/spacemit/clk_mix.c                |  403 ++++
 drivers/clk/spacemit/clk_mix.h                |  224 ++
 drivers/clk/spacemit/clk_pll.c                |  157 ++
 drivers/clk/spacemit/clk_pll.h                |   81 +
 drivers/i2c/Kconfig                           |    7 +
 drivers/i2c/Makefile                          |    1 +
 drivers/i2c/k1_i2c.c                          |  516 +++++
 drivers/i2c/k1_i2c.h                          |   69 +
 drivers/power/pmic/Kconfig                    |    8 +
 drivers/power/pmic/Makefile                   |    1 +
 drivers/power/pmic/pmic_spacemit_p1.c         |   94 +
 drivers/power/regulator/Kconfig               |    8 +
 drivers/power/regulator/Makefile              |    1 +
 .../power/regulator/spacemit_p1_regulator.c   |  460 +++++
 drivers/reset/reset-spacemit-k1.c             |    4 -
 include/configs/bananapi-f3.h                 |   13 -
 include/configs/k1.h                          |   19 +
 .../dt-bindings/clock/spacemit,k1-syscon.h    |  253 +++
 include/power/spacemit_p1.h                   |  163 ++
 include/soc/spacemit/k1-syscon.h              |  149 ++
 44 files changed, 5960 insertions(+), 165 deletions(-)
 create mode 100644 arch/riscv/dts/k1-spl.dts
 delete mode 100644 board/spacemit/bananapi-f3/MAINTAINERS
 delete mode 100644 board/spacemit/bananapi-f3/Makefile
 rename board/spacemit/{bananapi-f3 => k1}/Kconfig (79%)
 create mode 100644 board/spacemit/k1/MAINTAINERS
 create mode 100644 board/spacemit/k1/Makefile
 rename board/spacemit/{bananapi-f3 => k1}/board.c (100%)
 create mode 100644 board/spacemit/k1/spl.c
 create mode 100644 board/spacemit/k1/tlv_codes.h
 delete mode 100644 configs/bananapi-f3_defconfig
 create mode 100644 configs/spacemit_k1_defconfig
 create mode 100644 drivers/clk/spacemit/Kconfig
 create mode 100644 drivers/clk/spacemit/Makefile
 create mode 100644 drivers/clk/spacemit/clk-k1.c
 create mode 100644 drivers/clk/spacemit/clk_common.h
 create mode 100644 drivers/clk/spacemit/clk_ddn.c
 create mode 100644 drivers/clk/spacemit/clk_ddn.h
 create mode 100644 drivers/clk/spacemit/clk_mix.c
 create mode 100644 drivers/clk/spacemit/clk_mix.h
 create mode 100644 drivers/clk/spacemit/clk_pll.c
 create mode 100644 drivers/clk/spacemit/clk_pll.h
 create mode 100644 drivers/i2c/k1_i2c.c
 create mode 100644 drivers/i2c/k1_i2c.h
 create mode 100644 drivers/power/pmic/pmic_spacemit_p1.c
 create mode 100644 drivers/power/regulator/spacemit_p1_regulator.c
 delete mode 100644 include/configs/bananapi-f3.h
 create mode 100644 include/configs/k1.h
 create mode 100644 include/dt-bindings/clock/spacemit,k1-syscon.h
 create mode 100644 include/power/spacemit_p1.h
 create mode 100644 include/soc/spacemit/k1-syscon.h
Signature · 1 line
2.25.1