Skip to content

riscv: Add Sipeed Maix support

Sean Anderson u-boot 18 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v14 Latest20 patches 0 repliesNew
  2. v1321 patches 0 repliesSuperseded
  3. v1221 patches 0 repliesSuperseded
Earlier versions · 15
VersionPostedPatchesRepliesStatus
v1121 patches0 repliesSuperseded
v1021 patches0 repliesSuperseded
v9 posting 3/30 of 21 patches0 repliesSuperseded
v9 posting 2/321 patches0 repliesSuperseded
v9 posting 1/321 patches0 repliesSuperseded
v8 posting 2/20 of 21 patches0 repliesSuperseded
v8 posting 1/221 patches0 repliesSuperseded
v722 patches0 repliesSuperseded
v619 patches0 repliesSuperseded
v533 patches0 repliesSuperseded
v417 patches0 repliesSuperseded
v312 patches0 repliesSuperseded
v2 posting 2/20 of 11 patches0 repliesSuperseded
v2 posting 1/211 patches0 repliesSuperseded
v111 patches0 repliesSuperseded

Changes in v14 from the cover letter

- Drop [PATCH 03/21] clk: Unconditionally recursively en-/dis-able clocks, as it is no longer necessary for this series.
- Rebase onto upstream/next

Patches in v14 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20clk: Always use the supplied struct clkdoc/imx/clk/ccf.txt drivers/clk/clk-composite.c drivers/clk/clk-divider.c +4 more+50 -510 replies
2/20clk: Check that ops of composite clock components exist before callingdrivers/clk/clk-composite.c+35 -220 replies
3/20clk: Fix clk_get_by_* handling of indexdrivers/clk/clk-uclass.c+4 -40 replies
4/20clk: Add K210 pll supportdrivers/clk/Kconfig drivers/clk/Makefile drivers/clk/kendryte/Kconfig +6 more+786 -00 replies
5/20clk: Add a bypass clock for K210drivers/clk/kendryte/Makefile drivers/clk/kendryte/bypass.c include/kendryte/bypass.h+302 -10 replies
6/20clk: Add K210 clock supportMAINTAINERS doc/device-tree-bindings/mfd/kendryte,k210-sysctl.txt drivers/clk/kendryte/Kconfig +5 more+837 -20 replies
7/20dm: Add support for simple-pm-busarch/sandbox/dts/test.dts arch/sandbox/include/asm/clk.h configs/sandbox_defconfig +6 more+162 -00 replies
8/20dm: Fix error handling for dev_read_addr_ptrdrivers/clk/imx/clk-imx8mp.c drivers/core/read.c drivers/pinctrl/broadcom/pinctrl-bcm283x.c +2 more+7 -50 replies
9/20reset: Add generic reset driverarch/sandbox/dts/test.dts configs/sandbox_defconfig doc/device-tree-bindings/reset/syscon-reset.txt +5 more+200 -00 replies
10/20lib: Always set errno in hcreate_rlib/hashtable.c+6 -20 replies
11/20riscv: Add headers for asm/global_data.harch/riscv/include/asm/global_data.h+2 -00 replies
12/20riscv: Clear pending interrupts before enabling IPIsarch/riscv/cpu/start.S+2 -00 replies
13/20riscv: Clean up IPI initialization codearch/riscv/cpu/cpu.c arch/riscv/include/asm/smp.h arch/riscv/lib/andes_plic.c +4 more+89 -860 replies
14/20riscv: Add option to support RISC-V privileged spec 1.9arch/riscv/Kconfig arch/riscv/cpu/cpu.c arch/riscv/include/asm/csr.h+59 -00 replies
15/20riscv: Allow use of reset driversarch/riscv/lib/reset.c+2 -00 replies
16/20riscv: Try to get cpu frequency from a "clocks" node if it existsdrivers/cpu/riscv_cpu.c+18 -10 replies
17/20riscv: Enable cpu clock if it is presentdrivers/cpu/riscv_cpu.c+20 -00 replies
18/20riscv: Add device tree for K210 and Sipeed Maix BitMarch/riscv/dts/Makefile arch/riscv/dts/k210-maix-bit.dts arch/riscv/dts/k210.dtsi +1 more+680 -00 replies
19/20doc: riscv: Add documentation for Sipeed Maix Bitdoc/board/index.rst doc/board/sipeed/index.rst doc/board/sipeed/maix.rst+308 -00 replies
20/20riscv: Add Sipeed Maix supportarch/riscv/Kconfig board/sipeed/maix/Kconfig board/sipeed/maix/MAINTAINERS +4 more+140 -00 replies

Reviews trailers per patch

13 of 20 patches have a Reviewed-by or Acked-by.

PatchLukasz MajewskiSimon GlassBin MengRick Chen
1/20A-b
2/20A-b
3/20
4/20
5/20
6/20
7/20R-b
8/20R-b R-b
9/20R-b
10/20R-b
11/20R-b
12/20R-b
13/20R-b
14/20R-b
15/20R-b
16/20R-b
17/20R-b
18/20
19/20
20/20

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

Read the v14 thread

Cover letter [PATCH v14 00/20] riscv: Add Sipeed Maix support

This patch series adds support for Sipeed Maix boards and the Kendryte K210 CPU. Currently, only the Maix Bit V2.0 is supported, however other models are similar.

Complete passing CI:
https://travis-ci.org/github/Forty-Bot/u-boot/builds/689529599

Known Bugs/Limitations:
- Accessing the AI ram hangs, limiting available ram to 6M
- Trying to boot an image with bootm fails with
ERROR: Failed to allocate 0x7d60 bytes below 0x80000000.

To flash u-boot to a maix bit, run
kflash -tp /dev/<your tty here> -B bit_mic u-boot-dtb.bin

Boot output should look like the following:

U-Boot 2020.04-rc2-00087-g2221cc09c1-dirty (Feb 28 2020 - 13:53:09 -0500)

DRAM:  8 MiB
In:    serial at 38000000
Out:   serial at 38000000
Err:   serial at 38000000

=>

Changes for v14:
- Drop [PATCH 03/21] clk: Unconditionally recursively en-/dis-able clocks, as it is no longer necessary for this series.
- Rebase onto upstream/next

Changes for v13:
- Fix warnings/errors in CI

Changes for v12:
- Remove sanity check in IPI

Changes for v11:
- Fix hang in SPL because the IPI was not initialized

Changes for v10:
- Fix warnings when casting fdt_addr_t
- Fix warnings about const functions

Changes for v9:
- Fix error in Andes PLIC
- Update MAINTAINERS
- Mark dts blocks in documentation as "none" highlighting

Changes for v8:
- Removed dependency on the patch "clk: Add functions to register CCF clock structs". Hopefully this will make reviewing easier.

Changes for v7:
- Split documentation from other board support
- Split IPI clear from other IPI cleanup
- Rebased onto a clean upstream. Hopefully this fixes any patching problems.

Changes for v6:
- Remove spi, pinmux, gpio, led, and wdt support --- to be added in separate patches
- Rebase onto master
- Clear IPIs before enabling them
- Reorganize code so checkpatch errors less

Changes for v5:
- Rebase onto master
- Add pinconf support
- Add gpio support
- Store environment in spi flash
- Group patches by prefix
- Add additional documentation
- Add SMP support
- Add WDT support

Changes for v4:
- Linted several patches
- Updated the copyright year for several files
- Added tests for syscon-reset, simple-pm-bus, and the pll calc_rate function
- Added/updated documentation
- Fixed SPI for the nor flash
- Fixed PLLs not enabling/setting rate properly
- RISCV_PRIV_1_9_1 now (un)defines all diferring CSRs, and also disables VM
- More devicetree changes

Changes for v3:
- Remove patch to set RV64I as default
- Remove patch for a separate sysctl driver
- Split off cpu frequency patch into its own series
- Reorder support/devicetree patches to come last
- Add patch for reset driver
- Add simple-pm-bus for busses with their own clocks
- Add additional documentation
- Reword mcounteren patch to refer to the RISC-V priv spec 1.9.1
- Many devicetree changes
- Switch to "make savedefconfig" to generate the config

Changes for v2:
- Many bugfixes for the device tree
- Modify the config to build without errors
- Add support for keeping internal PLL frequencies in-range
- Fix several rebase-induced artifacts

Sean Anderson (20):
clk: Always use the supplied struct clk
clk: Check that ops of composite clock components exist before calling
clk: Fix clk_get_by_* handling of index
clk: Add K210 pll support
clk: Add a bypass clock for K210
clk: Add K210 clock support
dm: Add support for simple-pm-bus
dm: Fix error handling for dev_read_addr_ptr
reset: Add generic reset driver
lib: Always set errno in hcreate_r
riscv: Add headers for asm/global_data.h
riscv: Clear pending interrupts before enabling IPIs
riscv: Clean up IPI initialization code
riscv: Add option to support RISC-V privileged spec 1.9
riscv: Allow use of reset drivers
riscv: Try to get cpu frequency from a "clocks" node if it exists
riscv: Enable cpu clock if it is present
riscv: Add device tree for K210 and Sipeed Maix BitM
doc: riscv: Add documentation for Sipeed Maix Bit
riscv: Add Sipeed Maix support

 MAINTAINERS                                   |   7 +
 arch/riscv/Kconfig                            |  14 +
 arch/riscv/cpu/cpu.c                          |  15 +
 arch/riscv/cpu/start.S                        |   2 +
 arch/riscv/dts/Makefile                       |   1 +
 arch/riscv/dts/k210-maix-bit.dts              |  47 ++
 arch/riscv/dts/k210.dtsi                      | 594 ++++++++++++++++
 arch/riscv/include/asm/csr.h                  |  40 ++
 arch/riscv/include/asm/global_data.h          |   2 +
 arch/riscv/include/asm/smp.h                  |  43 ++
 arch/riscv/lib/andes_plic.c                   |  34 +-
 arch/riscv/lib/reset.c                        |   2 +
 arch/riscv/lib/sbi_ipi.c                      |   5 +
 arch/riscv/lib/sifive_clint.c                 |  33 +-
 arch/riscv/lib/smp.c                          |  49 +-
 arch/sandbox/dts/test.dts                     |  21 +
 arch/sandbox/include/asm/clk.h                |   1 +
 board/sipeed/maix/Kconfig                     |  47 ++
 board/sipeed/maix/MAINTAINERS                 |  11 +
 board/sipeed/maix/Makefile                    |   5 +
 board/sipeed/maix/maix.c                      |  41 ++
 common/spl/spl_opensbi.c                      |   5 +
 configs/sandbox_defconfig                     |   3 +
 configs/sipeed_maix_bitm_defconfig            |   8 +
 doc/board/index.rst                           |   1 +
 doc/board/sipeed/index.rst                    |   9 +
 doc/board/sipeed/maix.rst                     | 298 ++++++++
 .../bus/simple-pm-bus.txt                     |  44 ++
 .../mfd/kendryte,k210-sysctl.txt              |  33 +
 .../reset/syscon-reset.txt                    |  36 +
 doc/imx/clk/ccf.txt                           |  63 +-
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/Makefile                          |   1 +
 drivers/clk/clk-composite.c                   |  64 +-
 drivers/clk/clk-divider.c                     |   6 +-
 drivers/clk/clk-fixed-factor.c                |   3 +-
 drivers/clk/clk-gate.c                        |   6 +-
 drivers/clk/clk-mux.c                         |  12 +-
 drivers/clk/clk-uclass.c                      |   8 +-
 drivers/clk/imx/clk-gate2.c                   |   4 +-
 drivers/clk/imx/clk-imx8mp.c                  |   2 +-
 drivers/clk/kendryte/Kconfig                  |  12 +
 drivers/clk/kendryte/Makefile                 |   1 +
 drivers/clk/kendryte/bypass.c                 | 270 +++++++
 drivers/clk/kendryte/clk.c                    | 663 ++++++++++++++++++
 drivers/clk/kendryte/pll.c                    | 601 ++++++++++++++++
 drivers/core/Kconfig                          |   7 +
 drivers/core/Makefile                         |   1 +
 drivers/core/read.c                           |   2 +-
 drivers/core/simple-pm-bus.c                  |  56 ++
 drivers/cpu/riscv_cpu.c                       |  39 +-
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c    |   2 +-
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c |   2 +-
 drivers/reset/Kconfig                         |   5 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-syscon.c                  |  81 +++
 include/configs/sipeed-maix.h                 |  24 +
 include/dm/read.h                             |   4 +-
 include/dt-bindings/clock/k210-sysctl.h       |  59 ++
 include/dt-bindings/mfd/k210-sysctl.h         |  38 +
 include/dt-bindings/reset/k210-sysctl.h       |  38 +
 include/kendryte/bypass.h                     |  31 +
 include/kendryte/clk.h                        |  35 +
 include/kendryte/pll.h                        |  57 ++
 include/test/export.h                         |  16 +
 lib/hashtable.c                               |   8 +-
 test/dm/Makefile                              |   3 +
 test/dm/k210_pll.c                            |  96 +++
 test/dm/simple-pm-bus.c                       |  45 ++
 test/dm/syscon-reset.c                        |  59 ++
 70 files changed, 3706 insertions(+), 171 deletions(-)
 create mode 100644 arch/riscv/dts/k210-maix-bit.dts
 create mode 100644 arch/riscv/dts/k210.dtsi
 create mode 100644 board/sipeed/maix/Kconfig
 create mode 100644 board/sipeed/maix/MAINTAINERS
 create mode 100644 board/sipeed/maix/Makefile
 create mode 100644 board/sipeed/maix/maix.c
 create mode 100644 configs/sipeed_maix_bitm_defconfig
 create mode 100644 doc/board/sipeed/index.rst
 create mode 100644 doc/board/sipeed/maix.rst
 create mode 100644 doc/device-tree-bindings/bus/simple-pm-bus.txt
 create mode 100644 doc/device-tree-bindings/mfd/kendryte,k210-sysctl.txt
 create mode 100644 doc/device-tree-bindings/reset/syscon-reset.txt
 create mode 100644 drivers/clk/kendryte/Kconfig
 create mode 100644 drivers/clk/kendryte/Makefile
 create mode 100644 drivers/clk/kendryte/bypass.c
 create mode 100644 drivers/clk/kendryte/clk.c
 create mode 100644 drivers/clk/kendryte/pll.c
 create mode 100644 drivers/core/simple-pm-bus.c
 create mode 100644 drivers/reset/reset-syscon.c
 create mode 100644 include/configs/sipeed-maix.h
 create mode 100644 include/dt-bindings/clock/k210-sysctl.h
 create mode 100644 include/dt-bindings/mfd/k210-sysctl.h
 create mode 100644 include/dt-bindings/reset/k210-sysctl.h
 create mode 100644 include/kendryte/bypass.h
 create mode 100644 include/kendryte/clk.h
 create mode 100644 include/kendryte/pll.h
 create mode 100644 include/test/export.h
 create mode 100644 test/dm/k210_pll.c
 create mode 100644 test/dm/simple-pm-bus.c
 create mode 100644 test/dm/syscon-reset.c
Signature · 1 line
2.26.2