From patchwork Wed Jan 15 22:45:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 239624 List-Id: U-Boot discussion From: seanga2 at gmail.com (Sean Anderson) Date: Wed, 15 Jan 2020 17:45:42 -0500 Subject: [PATCH v2 00/11] riscv: Add Sipeed Maix support Message-ID: <3411d84b-5a56-ae4e-1deb-085ef1a4971d@gmail.com> 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. This series depends on (clk: Include missing headers for linux/clk-provider.h). To flash u-boot to a maix bit, run kflash -tp /dev/ -B bit_mic u-boot-dtb.bin Boot output should look like the following: U-Boot 2020.01-00455-gad03fd83e1 (Jan 15 2020 - 17:10:24 -0500) DRAM: 8 MiB MMC: spi at 52000000:slot at 0: 0 In: serial at 38000000 Out: serial at 38000000 Err: serial at 38000000 => I would really appreciate feedback! Many of the changes I had to make for this revision were fairly trivial and could have been caught by someone more familiar with the source code than I. In particular, there are still some questions in individual patches which have yet to be answered. 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 (11): clk: Always use the supplied struct clk clk: Check that ops of composite clock components exist before calling riscv: Add headers for asm/global_data.h riscv: Add an option to default to RV64I riscv: Add option to disable writes to mcounteren riscv: Fix incorrect cpu frequency on RV64 riscv: Add initial Sipeed Maix support riscv: Add device tree for K210 riscv: Add K210 sysctl support riscv: Add K210 pll support riscv: Add K210 clock support arch/riscv/Kconfig | 19 + arch/riscv/cpu/cpu.c | 2 + arch/riscv/dts/Makefile | 1 + arch/riscv/dts/k210-maix-bit.dts | 42 ++ arch/riscv/dts/k210.dtsi | 453 ++++++++++++++++++ arch/riscv/include/asm/global_data.h | 2 + arch/riscv/include/asm/k210_sysctl.h | 43 ++ arch/riscv/lib/Makefile | 1 + arch/riscv/lib/k210_sysctl.c | 21 + board/sipeed/maix/Kconfig | 49 ++ board/sipeed/maix/MAINTAINERS | 13 + board/sipeed/maix/Makefile | 5 + board/sipeed/maix/maix.c | 9 + configs/sipeed_maix_bitm_defconfig | 95 ++++ drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/clk-composite.c | 65 ++- 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/imx/clk-gate2.c | 4 +- drivers/clk/kendryte/Kconfig | 7 + drivers/clk/kendryte/Makefile | 1 + drivers/clk/kendryte/clk.c | 390 ++++++++++++++++ drivers/clk/kendryte/clk.h | 27 ++ drivers/clk/kendryte/pll.c | 598 ++++++++++++++++++++++++ drivers/clk/kendryte/pll.h | 38 ++ drivers/cpu/riscv_cpu.c | 2 + include/configs/sipeed-maix.h | 19 + include/dt-bindings/clock/k210-sysctl.h | 54 +++ include/dt-bindings/reset/k210-sysctl.h | 38 ++ 32 files changed, 1985 insertions(+), 42 deletions(-) create mode 100644 arch/riscv/dts/k210-maix-bit.dts create mode 100644 arch/riscv/dts/k210.dtsi create mode 100644 arch/riscv/include/asm/k210_sysctl.h create mode 100644 arch/riscv/lib/k210_sysctl.c 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 drivers/clk/kendryte/Kconfig create mode 100644 drivers/clk/kendryte/Makefile create mode 100644 drivers/clk/kendryte/clk.c create mode 100644 drivers/clk/kendryte/clk.h create mode 100644 drivers/clk/kendryte/pll.c create mode 100644 drivers/clk/kendryte/pll.h create mode 100644 include/configs/sipeed-maix.h create mode 100644 include/dt-bindings/clock/k210-sysctl.h create mode 100644 include/dt-bindings/reset/k210-sysctl.h