Add FU740 chip and HiFive Unmatched board support
Subsystems (7)
v4 cover Add FU740 chip and HiFive Unmatched board support
This patch set is to add SiFive fu740 chip and HiFive Unmatched board support. Patches are split into several parts:
- [PATCH 1/7] dts for fu740
- [PATCH 2/7] support for fu740 cpu
- [PATCH 3/7- 4/7] support for fu740 clk and ram
- [PATCH 5/7] add pcie driver
- [PATCH 6/7] add unmatched board
- [PATCH 7/7] add fu740 support to macb driver
Description
- For fu740 cpu support, reuse most of fu540 cpu.
- For prci driver, add one abstract layer to separate fu540 and fu740. Move orignal fu540 code to separate files.
- For pcie driver, it depends on gpio, prci, clk and reset drivers to do init&reset works.
- Align with Linux DT file.
Tests and patch checks
- Able to boot both unmatched and unleashed boards.
- PCIe tests
. M.2 NVMe SSD
. e1000 compatibale ethernet adapter (ping&tftpboot) . pci-to-usb adapter(usb mass storage)
- checkpatch is performed. To keep code derived from other boards the same, ignore some warnings/errors in [PATCH 7/8].
Changlogs
- V4
. fixed incorrect file name in ./board/sifive/unmatched/Makefile . fixed link in doc/board/sifive/index.rst, passed 'make htmldocs'
- V3
. Rebase to unleashed rename v2 patch
. Rename
doc/board/sifive/unmatched.rst board/sifive/unmatched/unmatched.c
. Fix tail whitespace
. Add 'git mv' info to ram driver and merge patch back to one . Add comment to macb driver for PLL hardware quirk
. Add reviewed-by to patch [6/7]
. Add 'gpio-poweroff' node for upcoming opensbi integration
- V2
. Rebase to unleashed rename patch
. remove unnessaary fu540 changes
. split ram driver patch into 2 to keep 'git mv' info
. use a shorter name for unmatched support
. Remove redundant&incorrect temperature-sensor in DT
. Remove unnecessary USB EHCI & OHCI from defconfig
. Revised fu740 doc
. Fixed year of copyright
. Add reviewed-by received in v1 patch
David Abdurachmanov (1):
drivers: net: macb: add fu740 support
Green Wan (6):
riscv: dts: add fu740 support
riscv: cpu: fu740: Add support for cpu fu740
drivers: clk: add fu740 support
drivers: ram: sifive: rename fu540_ddr and add fu740 support
drivers: pci: add pcie support for fu740
board: sifive: add HiFive Unmatched board support
arch/riscv/Kconfig | 5 +
arch/riscv/cpu/fu740/Kconfig | 37 +
arch/riscv/cpu/fu740/Makefile | 12 +
arch/riscv/cpu/fu740/cache.c | 55 +
arch/riscv/cpu/fu740/cpu.c | 22 +
arch/riscv/cpu/fu740/dram.c | 38 +
arch/riscv/cpu/fu740/spl.c | 23 +
arch/riscv/dts/Makefile | 1 +
arch/riscv/dts/fu740-c000-u-boot.dtsi | 105 ++
arch/riscv/dts/fu740-c000.dtsi | 329 ++++
.../dts/fu740-hifive-unmatched-a00-ddr.dtsi | 1489 +++++++++++++++++
.../dts/hifive-unmatched-a00-u-boot.dtsi | 40 +
arch/riscv/dts/hifive-unmatched-a00.dts | 259 +++
arch/riscv/include/asm/arch-fu740/cache.h | 14 +
arch/riscv/include/asm/arch-fu740/clk.h | 14 +
arch/riscv/include/asm/arch-fu740/gpio.h | 38 +
arch/riscv/include/asm/arch-fu740/reset.h | 13 +
arch/riscv/include/asm/arch-fu740/spl.h | 14 +
arch/riscv/lib/sifive_clint.c | 1 -
board/sifive/unmatched/Kconfig | 50 +
board/sifive/unmatched/MAINTAINERS | 9 +
board/sifive/unmatched/Makefile | 9 +
board/sifive/unmatched/spl.c | 85 +
board/sifive/unmatched/unmatched.c | 24 +
common/spl/Kconfig | 4 +-
configs/sifive_unmatched_defconfig | 53 +
doc/board/sifive/index.rst | 1 +
doc/board/sifive/unmatched.rst | 536 ++++++
drivers/clk/sifive/Kconfig | 8 +-
drivers/clk/sifive/Makefile | 4 +-
drivers/clk/sifive/fu540-prci.c | 769 +--------
drivers/clk/sifive/fu540-prci.h | 22 +
drivers/clk/sifive/fu740-prci.c | 158 ++
drivers/clk/sifive/fu740-prci.h | 22 +
drivers/clk/sifive/sifive-prci.c | 733 ++++++++
drivers/clk/sifive/sifive-prci.h | 323 ++++
drivers/net/macb.c | 13 +-
drivers/pci/Kconfig | 9 +
drivers/pci/Makefile | 1 +
drivers/pci/pcie_sifive.c | 797 +++++++++
drivers/pci/pcie_sifive.h | 374 +++++
drivers/ram/sifive/Kconfig | 8 +-
drivers/ram/sifive/Makefile | 2 +-
.../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +-
drivers/reset/Kconfig | 2 +-
include/configs/sifive-unmatched.h | 85 +
include/dt-bindings/clock/sifive-fu740-prci.h | 25 +
include/dt-bindings/reset/sifive-fu740-prci.h | 19 +
48 files changed, 5936 insertions(+), 808 deletions(-)
create mode 100644 arch/riscv/cpu/fu740/Kconfig
create mode 100644 arch/riscv/cpu/fu740/Makefile
create mode 100644 arch/riscv/cpu/fu740/cache.c
create mode 100644 arch/riscv/cpu/fu740/cpu.c
create mode 100644 arch/riscv/cpu/fu740/dram.c
create mode 100644 arch/riscv/cpu/fu740/spl.c
create mode 100644 arch/riscv/dts/fu740-c000-u-boot.dtsi
create mode 100644 arch/riscv/dts/fu740-c000.dtsi
create mode 100644 arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi
create mode 100644 arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi
create mode 100644 arch/riscv/dts/hifive-unmatched-a00.dts
create mode 100644 arch/riscv/include/asm/arch-fu740/cache.h
create mode 100644 arch/riscv/include/asm/arch-fu740/clk.h
create mode 100644 arch/riscv/include/asm/arch-fu740/gpio.h
create mode 100644 arch/riscv/include/asm/arch-fu740/reset.h
create mode 100644 arch/riscv/include/asm/arch-fu740/spl.h
create mode 100644 board/sifive/unmatched/Kconfig
create mode 100644 board/sifive/unmatched/MAINTAINERS
create mode 100644 board/sifive/unmatched/Makefile
create mode 100644 board/sifive/unmatched/spl.c
create mode 100644 board/sifive/unmatched/unmatched.c
create mode 100644 configs/sifive_unmatched_defconfig
create mode 100644 doc/board/sifive/unmatched.rst
create mode 100644 drivers/clk/sifive/fu540-prci.h
create mode 100644 drivers/clk/sifive/fu740-prci.c
create mode 100644 drivers/clk/sifive/fu740-prci.h
create mode 100644 drivers/clk/sifive/sifive-prci.c
create mode 100644 drivers/clk/sifive/sifive-prci.h
create mode 100644 drivers/pci/pcie_sifive.c
create mode 100644 drivers/pci/pcie_sifive.h
rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%)
create mode 100644 include/configs/sifive-unmatched.h
create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h
create mode 100644 include/dt-bindings/reset/sifive-fu740-prci.hSignature · 1 line
2.31.0
PATCH v4 1/7 riscv: dts: add fu740 support
Add dts support for fu740. The HiFive Unmatched support is based on fu740 cpu and drivers in following patch set.
--- arch/riscv/dts/Makefile | 1 + arch/riscv/dts/fu740-c000-u-boot.dtsi | 105 ++++++ arch/riscv/dts/fu740-c000.dtsi | 329 ++++++++++++++++++ include/dt-bindings/clock/sifive-fu740-prci.h | 25 ++ include/dt-bindings/reset/sifive-fu740-prci.h | 19 + 5 files changed, 479 insertions(+) create mode 100644 arch/riscv/dts/fu740-c000-u-boot.dtsi create mode 100644 arch/riscv/dts/fu740-c000.dtsi create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h create mode 100644 include/dt-bindings/reset/sifive-fu740-prci.h
arch/riscv/dts/Makefile +1 -0
@@ -2,6 +2,7 @@ dtb-$(CONFIG_TARGET_AX25_AE350) += ae350_32.dtb ae350_64.dtb dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb +dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED) += hifive-unmatched-a00.dtb dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += microchip-mpfs-icicle-kit.dtb
arch/riscv/dts/fu740-c000-u-boot.dtsi new file +105 -0
105 lines not on this page · raw message
arch/riscv/dts/fu740-c000.dtsi new file +329 -0
329 lines not on this page · raw message
include/dt-bindings/clock/sifive-fu740-prci.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +* Wesley Terpstra +* Paul Walmsley +* Zong Li +* Pragnesh Patel +*/ + +#ifndef __DT_BINDINGS_CLOCK_SIFIVE_FU740_PRCI_H +#define __DT_BINDINGS_CLOCK_SIFIVE_FU740_PRCI_H + +/* Clock indexes for use by Device Tree data and the PRCI driver */ + +#define PRCI_CLK_COREPLL 0 +#define PRCI_CLK_DDRPLL 1 +#define PRCI_CLK_GEMGXLPLL 2 +#define PRCI_CLK_DVFSCOREPLL 3 +#define PRCI_CLK_HFPCLKPLL 4 +#define PRCI_CLK_CLTXPLL 5 +#define PRCI_CLK_TLCLK 6 +#define PRCI_CLK_PCLK 7 +#define PRCI_CLK_PCIEAUX 8 + +#endif
include/dt-bindings/reset/sifive-fu740-prci.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* +* Copyright (C) 2020-2021 Sifive, Inc. +* Author: Pragnesh Patel <[email protected]> +*/ + +#ifndef __DT_BINDINGS_RESET_SIFIVE_FU740_PRCI_H +#define __DT_BINDINGS_RESET_SIFIVE_FU740_PRCI_H + +/* Reset indexes for use by device tree data and the PRCI driver */ +#define PRCI_RST_DDR_CTRL_N 0 +#define PRCI_RST_DDR_AXI_N 1 +#define PRCI_RST_DDR_AHB_N 2 +#define PRCI_RST_DDR_PHY_N 3 +#define PRCI_RST_PCIE_POWER_UP_N 4 +#define PRCI_RST_GEMGXL_N 5 +#define PRCI_RST_CLTX_N 6 + +#endif
Signature · 1 line
2.31.0
PATCH v4 2/7 riscv: cpu: fu740: Add support for cpu fu740
In reply to Green WanAdd SiFive fu740 cpu to support RISC-V arch
--- arch/riscv/Kconfig | 1 + arch/riscv/cpu/fu740/Kconfig | 37 +++++++++++++++ arch/riscv/cpu/fu740/Makefile | 12 +++++ arch/riscv/cpu/fu740/cache.c | 55 +++++++++++++++++++++++ arch/riscv/cpu/fu740/cpu.c | 22 +++++++++ arch/riscv/cpu/fu740/dram.c | 38 ++++++++++++++++ arch/riscv/cpu/fu740/spl.c | 23 ++++++++++ arch/riscv/include/asm/arch-fu740/cache.h | 14 ++++++ arch/riscv/include/asm/arch-fu740/clk.h | 14 ++++++ arch/riscv/include/asm/arch-fu740/gpio.h | 38 ++++++++++++++++ arch/riscv/include/asm/arch-fu740/reset.h | 13 ++++++ arch/riscv/include/asm/arch-fu740/spl.h | 14 ++++++ arch/riscv/lib/sifive_clint.c | 1 - 13 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 arch/riscv/cpu/fu740/Kconfig create mode 100644 arch/riscv/cpu/fu740/Makefile create mode 100644 arch/riscv/cpu/fu740/cache.c create mode 100644 arch/riscv/cpu/fu740/cpu.c create mode 100644 arch/riscv/cpu/fu740/dram.c create mode 100644 arch/riscv/cpu/fu740/spl.c create mode 100644 arch/riscv/include/asm/arch-fu740/cache.h create mode 100644 arch/riscv/include/asm/arch-fu740/clk.h create mode 100644 arch/riscv/include/asm/arch-fu740/gpio.h create mode 100644 arch/riscv/include/asm/arch-fu740/reset.h create mode 100644 arch/riscv/include/asm/arch-fu740/spl.h
arch/riscv/Kconfig +1 -0
@@ -61,6 +61,7 @@ source "board/sipeed/maix/Kconfig" # platform-specific options below source "arch/riscv/cpu/ax25/Kconfig" source "arch/riscv/cpu/fu540/Kconfig" +source "arch/riscv/cpu/fu740/Kconfig" source "arch/riscv/cpu/generic/Kconfig" # architecture-specific options below
arch/riscv/cpu/fu740/Kconfig new file +37 -0
@@ -0,0 +1,37 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2020-2021 SiFive, Inc +# Pragnesh Patel <[email protected]> + +config SIFIVE_FU740 + bool + select ARCH_EARLY_INIT_R + select RAM + select SPL_RAM if SPL + imply CPU + imply CPU_RISCV + imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) + imply SIFIVE_CLINT if (RISCV_MMODE || SPL_RISCV_MMODE) + imply CMD_CPU + imply SPL_CPU_SUPPORT + imply SPL_OPENSBI + imply SPL_LOAD_FIT + imply SMP + imply CLK_SIFIVE + imply CLK_SIFIVE_PRCI + imply SIFIVE_SERIAL + imply MACB + imply MII + imply SPI + imply SPI_SIFIVE + imply MMC + imply MMC_SPI + imply MMC_BROKEN_CD + imply CMD_MMC + imply DM_GPIO + imply SIFIVE_GPIO + imply CMD_GPIO + imply MISC + imply SIFIVE_OTP + imply DM_PWM + imply PWM_SIFIVE
arch/riscv/cpu/fu740/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2020-2021 SiFive, Inc +# Pragnesh Patel <[email protected]> + +ifeq ($(CONFIG_SPL_BUILD),y) +obj-y += spl.o +else +obj-y += dram.o +obj-y += cpu.o +obj-y += cache.o +endif
arch/riscv/cpu/fu740/cache.c new file +55 -0
55 lines not on this page · raw message
arch/riscv/cpu/fu740/cpu.c new file +22 -0
@@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2018, Bin Meng <[email protected]> +*/ + +#include <irq_func.h> +#include <asm/cache.h> + +/* +* cleanup_before_linux() is called just before we call linux +* it prepares the processor for linux +* +* we disable interrupt and caches. +*/ +int cleanup_before_linux (void ) +{ +disable_interrupts (); + +cache_flush (); + +return 0 ; +}
arch/riscv/cpu/fu740/dram.c new file +38 -0
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2018, Bin Meng <[email protected]> +*/ + +#include <common.h> +#include <fdtdec.h> +#include <init.h> +#include <linux/sizes.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int dram_init (void ) +{ +return fdtdec_setup_mem_size_base (); +} + +int dram_init_banksize (void ) +{ +return fdtdec_setup_memory_banksize (); +} + +ulong board_get_usable_ram_top (ulong total_size) +{ +#ifdef CONFIG_64BIT +/* +* Ensure that we run from first 4GB so that all +* addresses used by U-Boot are 32bit addresses. +* +* This in-turn ensures that 32bit DMA capable +* devices work fine because DMA mapping APIs will +* provide 32bit DMA addresses only. +*/ +if (gd->ram_top >SZ_4G ) +return SZ_4G ; +#endif +return gd->ram_top; +}
arch/riscv/cpu/fu740/spl.c new file +23 -0
@@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2020-201 SiFive, Inc +* Pragnesh Patel <[email protected]> +*/ + +#include <dm.h> +#include <log.h> + +int spl_soc_init (void ) +{ +int ret; +struct udevice *dev; + +/* DDR init */ + ret =uclass_get_device (UCLASS_RAM ,0 , &dev); +if (ret) { +debug ("DRAM init failed: %d\n" , ret); +return ret; + } + +return 0 ; +}
arch/riscv/include/asm/arch-fu740/cache.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +* +* Authors: +* Pragnesh Patel <[email protected]> +*/ + +#ifndef _CACHE_SIFIVE_H +#define _CACHE_SIFIVE_H + +int cache_enable_ways (void ); + +#endif /* _CACHE_SIFIVE_H */
arch/riscv/include/asm/arch-fu740/clk.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2020-2021 SiFive Inc +* +* Authors: +* Pragnesh Patel <[email protected]> +*/ + +#ifndef __CLK_SIFIVE_H +#define __CLK_SIFIVE_H + +/* Note: This is a placeholder header for driver compilation. */ + +#endif
arch/riscv/include/asm/arch-fu740/gpio.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +*/ + +#ifndef _GPIO_SIFIVE_H +#define _GPIO_SIFIVE_H + +#define GPIO_INPUT_VAL 0x00 +#define GPIO_INPUT_EN 0x04 +#define GPIO_OUTPUT_EN 0x08 +#define GPIO_OUTPUT_VAL 0x0C +#define GPIO_RISE_IE 0x18 +#define GPIO_RISE_IP 0x1C +#define GPIO_FALL_IE 0x20 +#define GPIO_FALL_IP 0x24 +#define GPIO_HIGH_IE 0x28 +#define GPIO_HIGH_IP 0x2C +#define GPIO_LOW_IE 0x30 +#define GPIO_LOW_IP 0x34 +#define GPIO_OUTPUT_XOR 0x40 + +#define NR_GPIOS 16 + +enum gpio_state { +LOW , +HIGH +}; + +/* Details about a GPIO bank */ +struct sifive_gpio_plat { +void *base;/* address of registers in physical memory */ +}; + +#define SIFIVE_GENERIC_GPIO_NR (port, index) \ + (((port) * NR_GPIOS) + ((index) & (NR_GPIOS - 1))) + +#endif /* _GPIO_SIFIVE_H */
arch/riscv/include/asm/arch-fu740/reset.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2020-2021 SiFive, Inc. +* +* Author: Sagar Kadam <[email protected]> +*/ + +#ifndef __RESET_SIFIVE_H +#define __RESET_SIFIVE_H + +int sifive_reset_bind (struct udevice *dev,ulong count); + +#endif
arch/riscv/include/asm/arch-fu740/spl.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +* +* Authors: +* Pragnesh Patel <[email protected]> +*/ + +#ifndef _SPL_SIFIVE_H +#define _SPL_SIFIVE_H + +int spl_soc_init (void ); + +#endif /* _SPL_SIFIVE_H */
arch/riscv/lib/sifive_clint.c +0 -1
@@ -10,7 +10,6 @@#include <common.h> #include <dm.h> -#include <asm/global_data.h> #include <asm/io.h> #include <asm/smp.h> #include <linux/err.h>
Signature · 1 line
2.31.0
PATCH v4 3/7 drivers: clk: add fu740 support
In reply to Green WanAdd fu740 support. One abstract layer is added for supporting multiple chips such as fu540 and fu740.
--- drivers/clk/sifive/Kconfig | 8 +- drivers/clk/sifive/Makefile | 4 +- drivers/clk/sifive/fu540-prci.c | 769 +------------------------------ drivers/clk/sifive/fu540-prci.h | 22 + drivers/clk/sifive/fu740-prci.c | 158 +++++++ drivers/clk/sifive/fu740-prci.h | 22 + drivers/clk/sifive/sifive-prci.c | 733 +++++++++++++++++++++++++++++ drivers/clk/sifive/sifive-prci.h | 323 +++++++++++++ 8 files changed, 1286 insertions(+), 753 deletions(-) create mode 100644 drivers/clk/sifive/fu540-prci.h create mode 100644 drivers/clk/sifive/fu740-prci.c create mode 100644 drivers/clk/sifive/fu740-prci.h create mode 100644 drivers/clk/sifive/sifive-prci.c create mode 100644 drivers/clk/sifive/sifive-prci.h
drivers/clk/sifive/Kconfig +4 -4
@@ -6,11 +6,11 @@ config CLK_SIFIVE help SoC drivers for SiFive Linux-capable SoCs. -config CLK_SIFIVE_FU540_PRCI - bool "PRCI driver for SiFive FU540 SoCs" +config CLK_SIFIVE_PRCI + bool "PRCI driver for SiFive SoCs" depends on CLK_SIFIVE select CLK_ANALOGBITS_WRPLL_CLN28HPC help Supports the Power Reset Clock interface (PRCI) IP block found in - FU540 SoCs. If this kernel is meant to run on a SiFive FU540 SoC, - enable this driver. + FU540/FU740 SoCs. If this kernel is meant to run on a SiFive FU540/ + FU740 SoCs, enable this driver.
drivers/clk/sifive/Makefile +3 -1
@@ -1,3 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ -obj-$(CONFIG_CLK_SIFIVE_FU540_PRCI) += fu540-prci.o +obj-y += sifive-prci.o + +obj-$(CONFIG_CLK_SIFIVE_PRCI) += fu540-prci.o fu740-prci.o
drivers/clk/sifive/fu540-prci.c +21 -748
807 lines not on this page · raw message
drivers/clk/sifive/fu540-prci.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +* Zong Li +* Pragnesh Patel +*/ + +#ifndef __SIFIVE_CLK_FU540_PRCI_H +#define __SIFIVE_CLK_FU540_PRCI_H + +#include "sifive-prci.h" + +#define NUM_CLOCK_FU540 4 + +extern struct __prci_clock __prci_init_clocks_fu540[NUM_CLOCK_FU540 ]; + +static const struct prci_clk_desc prci_clk_fu540 = { + .clks = __prci_init_clocks_fu540, + .num_clks =ARRAY_SIZE (__prci_init_clocks_fu540), +}; + +#endif /* __SIFIVE_CLK_FU540_PRCI_H */
drivers/clk/sifive/fu740-prci.c new file +158 -0
158 lines not on this page · raw message
drivers/clk/sifive/fu740-prci.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020-2021 SiFive, Inc. +* Zong Li +* Pragnesh Patel +*/ + +#ifndef __SIFIVE_CLK_FU740_PRCI_H +#define __SIFIVE_CLK_FU740_PRCI_H + +#include "sifive-prci.h" + +#define NUM_CLOCK_FU740 9 + +extern struct __prci_clock __prci_init_clocks_fu740[NUM_CLOCK_FU740 ]; + +static const struct prci_clk_desc prci_clk_fu740 = { + .clks = __prci_init_clocks_fu740, + .num_clks =ARRAY_SIZE (__prci_init_clocks_fu740), +}; + +#endif /* __SIFIVE_CLK_FU740_PRCI_H */
drivers/clk/sifive/sifive-prci.c new file +733 -0
733 lines not on this page · raw message
drivers/clk/sifive/sifive-prci.h new file +323 -0
323 lines not on this page · raw message
Signature · 1 line
2.31.0
PATCH v4 4/7 drivers: ram: sifive: rename fu540_ddr and add fu740 support
In reply to Green WanRename fu540_ddr.c to sifive_ddr.c and add fu740 support
---
drivers/ram/sifive/Kconfig | 8 +-
drivers/ram/sifive/Makefile | 2 +-
.../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +++++++++----------
3 files changed, 50 insertions(+), 50 deletions(-)
rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%)drivers/ram/sifive/Kconfig +4 -4
@@ -5,9 +5,9 @@ config RAM_SIFIVE help This enables support for ram drivers of SiFive SoCs. -config SIFIVE_FU540_DDR - bool "SiFive FU540 DDR driver" +config SIFIVE_DDR + bool "SiFive DDR driver" depends on RAM_SIFIVE - default y if TARGET_SIFIVE_UNLEASHED + default y if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help - This enables DDR support for the platforms based on SiFive FU540 SoC. + This enables DDR support for the platforms based on SiFive SoC.
drivers/ram/sifive/Makefile +1 -1
@@ -3,4 +3,4 @@ # Copyright (c) 2020 SiFive, Inc # -obj-$(CONFIG_SIFIVE_FU540_DDR) += fu540_ddr.o +obj-$(CONFIG_SIFIVE_DDR) += sifive_ddr.o
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +45 -45
238 lines not on this page · raw message
Signature · 1 line
2.31.0
PATCH v4 4/7 drivers: ram: sifive: rename fu540_ddr and add fu740 support
Quoted 55 lines · Green Wan
Rename
fu540_ddr.ctosifive_ddr.cand add fu740 supportSigned-off-by Green Wan <[email protected]>--- drivers/ram/sifive/Kconfig | 8 +- drivers/ram/sifive/Makefile | 2 +- .../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +++++++++---------- 3 files changed, 50 insertions(+), 50 deletions(-) rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%)drivers/ram/sifive/Kconfig +4
-4@@ -5,9 +5,9 @@ config RAM_SIFIVE help This enables support for ram drivers of SiFive SoCs. -config SIFIVE_FU540_DDR - bool "SiFive FU540 DDR driver" +config SIFIVE_DDR + bool "SiFive DDR driver" depends on RAM_SIFIVE - default y if TARGET_SIFIVE_UNLEASHED + default y if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help - This enables DDR support for the platforms based on SiFive FU540 SoC. + This enables DDR support for the platforms based on SiFive SoC.drivers/ram/sifive/Makefile +1
-1@@ -3,4 +3,4 @@ # Copyright (c) 2020 SiFive, Inc # -obj-$(CONFIG_SIFIVE_FU540_DDR) += fu540_ddr.o +obj-$(CONFIG_SIFIVE_DDR) += sifive_ddr.odrivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +1
-1@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause /* -* (C) Copyright 2020 SiFive, Inc. +* (C) Copyright 2020-2021 SiFive, Inc. * * Authors: * Pragnesh Patel <[email protected]>
drivers/ram/sifive/sifive_ddr.c line 15
Quoted 4 lines
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +0
-1@@ -12,7 +12,6 @@#include <init.h> #include <ram.h> #include <syscon.h> -#include <asm/global_data.h>
Why is this removed?
drivers/ram/sifive/sifive_ddr.c line 65
Quoted 6 lines
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +0
-0#include <asm/io.h> #include <clk.h> #include <wait_bit.h> @@ -65,16 +64,16 @@DECLARE_GLOBAL_DATA_PTR ;
Otherwise LGTM:
PATCH v4 4/7 drivers: ram: sifive: rename fu540_ddr and add fu740 support
Quoted 55 lines · Bin Meng
Quoted 53 lines · Green Wan
Rename
fu540_ddr.ctosifive_ddr.cand add fu740 supportSigned-off-by Green Wan <[email protected]>--- drivers/ram/sifive/Kconfig | 8 +- drivers/ram/sifive/Makefile | 2 +- .../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +++++++++---------- 3 files changed, 50 insertions(+), 50 deletions(-) rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%)drivers/ram/sifive/Kconfig +4
-4@@ -5,9 +5,9 @@ config RAM_SIFIVE help This enables support for ram drivers of SiFive SoCs. -config SIFIVE_FU540_DDR - bool "SiFive FU540 DDR driver" +config SIFIVE_DDR + bool "SiFive DDR driver" depends on RAM_SIFIVE - default y if TARGET_SIFIVE_UNLEASHED + default y if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help - This enables DDR support for the platforms based on SiFive FU540 SoC. + This enables DDR support for the platforms based on SiFive SoC.drivers/ram/sifive/Makefile +1
-1@@ -3,4 +3,4 @@ # Copyright (c) 2020 SiFive, Inc # -obj-$(CONFIG_SIFIVE_FU540_DDR) += fu540_ddr.o +obj-$(CONFIG_SIFIVE_DDR) += sifive_ddr.odrivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +1
-1@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause /* -* (C) Copyright 2020 SiFive, Inc. +* (C) Copyright 2020-2021 SiFive, Inc. * * Authors:
Quoted 9 lines
drivers/ram/sifive/sifive_ddr.c line 15
Quoted 6 lines
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +0
-1* Pragnesh Patel <[email protected]> @@ -12,7 +12,6 @@#include <init.h> #include <ram.h> #include <syscon.h> -#include <asm/global_data.h> Why is this removed?
Hi Bin,
I removed it when I was checking whether there are some unnecessary include files. I didn't notice DECLARE_GLOBAL_DATA_PTR might require it. But it seems to be included somewhere because I didn't encounter the compilation error.
If I want to add it back, do you prefer to do it in v5 patch or another fix patch?
Thanks,
Quoted 9 lines
drivers/ram/sifive/sifive_ddr.c line 65
Quoted 6 lines
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +0
-0#include <asm/io.h> #include <clk.h> #include <wait_bit.h> @@ -65,16 +64,16 @@DECLARE_GLOBAL_DATA_PTR ;Otherwise LGTM:
Reviewed-by Bin Meng <[email protected]>
PATCH v4 4/7 drivers: ram: sifive: rename fu540_ddr and add fu740 support
Hi Green,
Quoted 69 lines · Green Wan
Quoted 55 lines · Bin Meng
Quoted 53 lines · Green Wan
Rename
fu540_ddr.ctosifive_ddr.cand add fu740 supportSigned-off-by Green Wan <[email protected]>--- drivers/ram/sifive/Kconfig | 8 +- drivers/ram/sifive/Makefile | 2 +- .../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +++++++++---------- 3 files changed, 50 insertions(+), 50 deletions(-) rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%)drivers/ram/sifive/Kconfig +4
-4@@ -5,9 +5,9 @@ config RAM_SIFIVE help This enables support for ram drivers of SiFive SoCs. -config SIFIVE_FU540_DDR - bool "SiFive FU540 DDR driver" +config SIFIVE_DDR + bool "SiFive DDR driver" depends on RAM_SIFIVE - default y if TARGET_SIFIVE_UNLEASHED + default y if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help - This enables DDR support for the platforms based on SiFive FU540 SoC. + This enables DDR support for the platforms based on SiFive SoC.drivers/ram/sifive/Makefile +1
-1@@ -3,4 +3,4 @@ # Copyright (c) 2020 SiFive, Inc # -obj-$(CONFIG_SIFIVE_FU540_DDR) += fu540_ddr.o +obj-$(CONFIG_SIFIVE_DDR) += sifive_ddr.odrivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +1
-1@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause /* -* (C) Copyright 2020 SiFive, Inc. +* (C) Copyright 2020-2021 SiFive, Inc. * * Authors: Quoted 9 lines
drivers/ram/sifive/sifive_ddr.c line 15
Quoted 6 lines
drivers/ram/sifive/sifive_ddr.c renamed from drivers/ram/sifive/fu540_ddr.c +0
-1* Pragnesh Patel <[email protected]> @@ -12,7 +12,6 @@#include <init.h> #include <ram.h> #include <syscon.h> -#include <asm/global_data.h> Why is this removed?
Hi Bin,
Quoted 7 lines
I removed it when I was checking whether there are some unnecessary include files. I didn't notice
DECLARE_GLOBAL_DATA_PTRmight require it. But it seems to be included somewhere because I didn't encounter the compilation error.If I want to add it back, do you prefer to do it in v5 patch or another fix patch?
Please send v5.
Regards,
Bin
PATCH v4 5/7 drivers: pci: add pcie support for fu740
In reply to Green WanAdd pcie driver for SiFive fu740, the driver depends on fu740 gpio, clk and reset driver to do init. Force running at Gen1 for better capatible enumeration.
Several devices are tested:
a) M.2 NVMe SSD
b) USB-to-PCI adapter
c) Ethernet adapter (E1000 compatible)
--- drivers/pci/Kconfig | 9 + drivers/pci/Makefile | 1 + drivers/pci/pcie_sifive.c | 797 ++++++++++++++++++++++++++++++++++++++ drivers/pci/pcie_sifive.h | 374 ++++++++++++++++++ 4 files changed, 1181 insertions(+) create mode 100644 drivers/pci/pcie_sifive.c create mode 100644 drivers/pci/pcie_sifive.h
drivers/pci/Kconfig +9 -0
@@ -97,6 +97,15 @@ config PCIE_DW_MVEBU Armada-8K SoCs. The PCIe controller on Armada-8K is based on DesignWare hardware. +config PCIE_SIFIVE_FU740 + bool "Enable SiFive FU740 PCIe" + depends on CLK_SIFIVE_PRCI + depends on RESET_SIFIVE + depends on SIFIVE_GPIO + help + Say Y here if you want to enable PCIe controller support on + FU740. + config PCIE_FSL bool "FSL PowerPC PCIe support" depends on DM_PCI
drivers/pci/Makefile +1 -0
@@ -51,3 +51,4 @@ obj-$(CONFIG_PCIE_ROCKCHIP) += pcie_rockchip.o obj-$(CONFIG_PCIE_DW_ROCKCHIP) += pcie_dw_rockchip.o obj-$(CONFIG_PCI_BRCMSTB) += pcie_brcmstb.o obj-$(CONFIG_PCI_OCTEONTX) += pci_octeontx.o +obj-$(CONFIG_PCIE_SIFIVE_FU740) += pcie_sifive.o
drivers/pci/pcie_sifive.c new file +797 -0
797 lines not on this page · raw message
drivers/pci/pcie_sifive.h new file +374 -0
374 lines not on this page · raw message
Signature · 1 line
2.31.0
PATCH v4 6/7 board: sifive: add HiFive Unmatched board support
In reply to Green WanAdd dts, defconfig and board support for HiFive Unmatched.
--- arch/riscv/Kconfig | 4 + .../dts/fu740-hifive-unmatched-a00-ddr.dtsi | 1489 +++++++++++++++++ .../dts/hifive-unmatched-a00-u-boot.dtsi | 40 + arch/riscv/dts/hifive-unmatched-a00.dts | 259 +++ board/sifive/unmatched/Kconfig | 50 + board/sifive/unmatched/MAINTAINERS | 9 + board/sifive/unmatched/Makefile | 9 + board/sifive/unmatched/spl.c | 85 + board/sifive/unmatched/unmatched.c | 24 + common/spl/Kconfig | 4 +- configs/sifive_unmatched_defconfig | 53 + doc/board/sifive/index.rst | 1 + doc/board/sifive/unmatched.rst | 536 ++++++ drivers/reset/Kconfig | 2 +- include/configs/sifive-unmatched.h | 85 + 15 files changed, 2647 insertions(+), 3 deletions(-) create mode 100644 arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00.dts create mode 100644 board/sifive/unmatched/Kconfig create mode 100644 board/sifive/unmatched/MAINTAINERS create mode 100644 board/sifive/unmatched/Makefile create mode 100644 board/sifive/unmatched/spl.c create mode 100644 board/sifive/unmatched/unmatched.c create mode 100644 configs/sifive_unmatched_defconfig create mode 100644 doc/board/sifive/unmatched.rst create mode 100644 include/configs/sifive-unmatched.h
arch/riscv/Kconfig +4 -0
@@ -20,6 +20,9 @@ config TARGET_QEMU_VIRT config TARGET_SIFIVE_UNLEASHED bool "Support SiFive Unleashed Board" +config TARGET_SIFIVE_UNMATCHED + bool "Support SiFive Unmatched Board" + config TARGET_SIPEED_MAIX bool "Support Sipeed Maix Board"
@@ -56,6 +59,7 @@ source "board/AndesTech/ax25-ae350/Kconfig" source "board/emulation/qemu-riscv/Kconfig" source "board/microchip/mpfs_icicle/Kconfig" source "board/sifive/unleashed/Kconfig" +source "board/sifive/unmatched/Kconfig" source "board/sipeed/maix/Kconfig" # platform-specific options below
arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi new file +1489 -0
1,489 lines not on this page · raw message
arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi new file +40 -0
@@ -0,0 +1,40 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2020-2021 SiFive, Inc + */ + +#include "fu740-c000-u-boot.dtsi" +#include "fu740-hifive-unmatched-a00-ddr.dtsi" + +/ { + aliases { + spi0 = &spi0; + }; + + memory at 80000000 { + u-boot,dm-spl; + }; + + hfclk { + u-boot,dm-spl; + }; + + rtcclk { + u-boot,dm-spl; + }; + +}; + +&clint { + clocks = <&rtcclk>; +}; + +&spi0 { + mmc at 0 { + u-boot,dm-spl; + }; +}; + +&gpio { + u-boot,dm-spl; +};
arch/riscv/dts/hifive-unmatched-a00.dts new file +259 -0
259 lines not on this page · raw message
board/sifive/unmatched/Kconfig new file +50 -0
50 lines not on this page · raw message
board/sifive/unmatched/MAINTAINERS new file +9 -0
@@ -0,0 +1,9 @@ +SiFive HiFive Unmatched FU740 BOARD +M: Paul Walmsley <[email protected]> +M: Pragnesh Patel <[email protected]> +M: Green Wan <[email protected]> +S: Maintained +F: board/sifive/unmatched/ +F: doc/board/sifive/hifive-unmatched-fu740.rst +F: include/configs/sifive-unmatched.h +F: configs/sifive_unmatched_defconfig
board/sifive/unmatched/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2020-2021 SiFive, Inc + +obj-y += unmatched.o + +ifdef CONFIG_SPL_BUILD +obj-y += spl.o +endif
board/sifive/unmatched/spl.c new file +85 -0
85 lines not on this page · raw message
board/sifive/unmatched/unmatched.c new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (c) 2020-2021, SiFive Inc +* +* Authors: +* Pragnesh Patel <[email protected]> +*/ + +#include <common.h> +#include <dm.h> +#include <asm/arch/cache.h> + +int board_init (void ) +{ +int ret; + +/* enable all cache ways */ + ret =cache_enable_ways (); +if (ret) { +debug ("%s: could not enable cache ways\n" , __func__); +return ret; + } +return 0 ; +}
common/spl/Kconfig +2 -2
@@ -318,7 +318,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR ARCH_ROCKCHIP || ARCH_MVEBU || ARCH_SOCFPGA || \ ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \ OMAP44XX || OMAP54XX || AM33XX || AM43XX || \ - TARGET_SIFIVE_UNLEASHED + TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help Use sector number for specifying U-Boot location on MMC/SD in raw mode.
@@ -335,7 +335,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \ OMAP54XX || AM33XX || AM43XX || ARCH_K3 default 0x4000 if ARCH_ROCKCHIP - default 0x822 if TARGET_SIFIVE_UNLEASHED + default 0x822 if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED help Address on the MMC to load U-Boot from, when the MMC is being used in raw mode. Units: MMC sectors (1 sector = 512 bytes).
configs/sifive_unmatched_defconfig new file +53 -0
53 lines not on this page · raw message
doc/board/sifive/index.rst +1 -0
@@ -7,3 +7,4 @@ SiFive :maxdepth: 2 unleashed + unmatched
doc/board/sifive/unmatched.rst new file +536 -0
536 lines not on this page · raw message
drivers/reset/Kconfig +1 -1
@@ -166,7 +166,7 @@ config RESET_IPQ419 config RESET_SIFIVE bool "Reset Driver for SiFive SoC's" - depends on DM_RESET && CLK_SIFIVE_FU540_PRCI && TARGET_SIFIVE_UNLEASHED + depends on DM_RESET && CLK_SIFIVE_FU540_PRCI && (TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED) default y help PRCI module within SiFive SoC's provides mechanism to reset
include/configs/sifive-unmatched.h new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
2.31.0
PATCH v4 7/7 drivers: net: macb: add fu740 support
In reply to Green WanFrom: David Abdurachmanov <[email protected]>
Add fu740 support to macb ethernet driver
There is a PLL HW quirk in FU740. The VSC8541XMV-02 specification requires 125 +/-0.0125 Mhz. But the most close value can be output by PLL is 125.125 MHz and out of VSC8541XMV-02 spec.
--- drivers/net/macb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/macb.c +12 -1
@@ -591,8 +591,17 @@ static int macb_sifive_clk_init(struct udevice *dev, ulong rate)* 0 = GMII mode. Use 125 MHz gemgxlclk from PRCI in TX logic * and output clock on GMII output signal GTX_CLK * 1 = MII mode. Use MII input signal TX_CLK in TX logic +* +* FU740 have a PLL HW quirk. The 125.125 Mhz is actually out of +* VSC8541XMV-02 specification. The tolerance level is +/-100ppm. +* Which means the range should be in between 125MHz +/-0.0125. +* But the most close value can be output by PLL is 125.125 MHz. */ -writel (rate !=125000000 , gemgxl_regs); +if (device_is_compatible (dev,"sifive,fu540-c000-gem" )) +writel (rate !=125000000 , gemgxl_regs); +else if (device_is_compatible (dev,"sifive,fu740-c000-gem" )) +writel (rate !=125125000 , gemgxl_regs); +return 0 ; }
@@ -1507,6 +1516,8 @@ static const struct udevice_id macb_eth_ids[] = { { .compatible = "cdns,zynq-gem" }, { .compatible = "sifive,fu540-c000-gem", .data = (ulong)&sifive_config }, + { .compatible = "sifive,fu740-c000-gem", + .data = (ulong)&sifive_config }, { .compatible = "microchip,mpfs-mss-gem", .data = (ulong)µchip_config }, { }
Signature · 1 line
2.31.0
PATCH v4 7/7 drivers: net: macb: add fu740 support
Quoted 9 lines · Green Wan
From: David Abdurachmanov <[email protected]>
Add fu740 support to macb ethernet driver
There is a PLL HW quirk in FU740. The VSC8541XMV-02 specification requires 125 +/-0.0125 Mhz. But the most close value can be output by PLL is 125.125 MHz and out of VSC8541XMV-02 spec.
Quoted 7 lines
Signed-off-by David Abdurachmanov <[email protected]>Signed-off-by Green Wan <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- drivers/net/macb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
v4 cover Add FU740 chip and HiFive Unmatched board support
In reply to Green WanHi Green,
There seems to be some compilation failure when running CI test.
CI trest result: (https://dev.azure.com/ycliang-tw/u-boot-riscv/_build/results?buildId=24&view=logs&j=24a4c78b-f197-51e6-cd79-c14cda102aad&t=6a1228d0-d58c-5c15-8977-c1c59ea93a2c&l=280)
Could you please also check and fix those errors, thanks!
Best regards,
Leo
Quoted 152 lines · Green Wan
This patch set is to add SiFive fu740 chip and HiFive Unmatched board support. Patches are split into several parts:
- [PATCH 1/7] dts for fu740
- [PATCH 2/7] support for fu740 cpu
- [PATCH 3/7- 4/7] support for fu740 clk and ram
- [PATCH 5/7] add pcie driver
- [PATCH 6/7] add unmatched board
- [PATCH 7/7] add fu740 support to macb driverDescription
- For fu740 cpu support, reuse most of fu540 cpu.
- For prci driver, add one abstract layer to separate fu540 and fu740. Move orignal fu540 code to separate files.
- For pcie driver, it depends on gpio, prci, clk and reset drivers to do init&reset works.
- Align with Linux DT file.Tests and patch checks
- Able to boot both unmatched and unleashed boards.
- PCIe tests
. M.2 NVMe SSD
. e1000 compatibale ethernet adapter (ping&tftpboot) . pci-to-usb adapter(usb mass storage)
- checkpatch is performed. To keep code derived from other boards the same, ignore some warnings/errors in [PATCH 7/8].Changlogs
- V4
. fixed incorrect file name in ./board/sifive/unmatched/Makefile . fixed link indoc/board/sifive/index.rst, passed 'make htmldocs'
- V3
. Rebase to unleashed rename v2 patch
. Rename
doc/board/sifive/unmatched.rstboard/sifive/unmatched/unmatched.c
. Fix tail whitespace
. Add 'git mv' info to ram driver and merge patch back to one . Add comment to macb driver for PLL hardware quirk
. Add reviewed-by to patch [6/7]
. Add 'gpio-poweroff' node for upcoming opensbi integration
- V2
. Rebase to unleashed rename patch
. remove unnessaary fu540 changes
. split ram driver patch into 2 to keep 'git mv' info
. use a shorter name for unmatched support
. Remove redundant&incorrect temperature-sensor in DT
. Remove unnecessary USB EHCI & OHCI from defconfig
. Revised fu740 doc
. Fixed year of copyright
. Add reviewed-by received in v1 patchDavid Abdurachmanov (1):
drivers: net: macb: add fu740 supportGreen Wan (6):
riscv: dts: add fu740 support
riscv: cpu: fu740: Add support for cpu fu740
drivers: clk: add fu740 support
drivers: ram: sifive: renamefu540_ddrand add fu740 support
drivers: pci: add pcie support for fu740
board: sifive: add HiFive Unmatched board supportarch/riscv/Kconfig | 5 + arch/riscv/cpu/fu740/Kconfig | 37 + arch/riscv/cpu/fu740/Makefile | 12 + arch/riscv/cpu/fu740/cache.c | 55 + arch/riscv/cpu/fu740/cpu.c | 22 + arch/riscv/cpu/fu740/dram.c | 38 + arch/riscv/cpu/fu740/spl.c | 23 + arch/riscv/dts/Makefile | 1 + arch/riscv/dts/fu740-c000-u-boot.dtsi | 105 ++ arch/riscv/dts/fu740-c000.dtsi | 329 ++++ .../dts/fu740-hifive-unmatched-a00-ddr.dtsi | 1489 +++++++++++++++++ .../dts/hifive-unmatched-a00-u-boot.dtsi | 40 + arch/riscv/dts/hifive-unmatched-a00.dts | 259 +++ arch/riscv/include/asm/arch-fu740/cache.h | 14 + arch/riscv/include/asm/arch-fu740/clk.h | 14 + arch/riscv/include/asm/arch-fu740/gpio.h | 38 + arch/riscv/include/asm/arch-fu740/reset.h | 13 + arch/riscv/include/asm/arch-fu740/spl.h | 14 + arch/riscv/lib/sifive_clint.c | 1 - board/sifive/unmatched/Kconfig | 50 + board/sifive/unmatched/MAINTAINERS | 9 + board/sifive/unmatched/Makefile | 9 + board/sifive/unmatched/spl.c | 85 + board/sifive/unmatched/unmatched.c | 24 + common/spl/Kconfig | 4 +- configs/sifive_unmatched_defconfig | 53 + doc/board/sifive/index.rst | 1 + doc/board/sifive/unmatched.rst | 536 ++++++ drivers/clk/sifive/Kconfig | 8 +- drivers/clk/sifive/Makefile | 4 +- drivers/clk/sifive/fu540-prci.c | 769 +-------- drivers/clk/sifive/fu540-prci.h | 22 + drivers/clk/sifive/fu740-prci.c | 158 ++ drivers/clk/sifive/fu740-prci.h | 22 + drivers/clk/sifive/sifive-prci.c | 733 ++++++++ drivers/clk/sifive/sifive-prci.h | 323 ++++ drivers/net/macb.c | 13 +- drivers/pci/Kconfig | 9 + drivers/pci/Makefile | 1 + drivers/pci/pcie_sifive.c | 797 +++++++++ drivers/pci/pcie_sifive.h | 374 +++++ drivers/ram/sifive/Kconfig | 8 +- drivers/ram/sifive/Makefile | 2 +- .../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +- drivers/reset/Kconfig | 2 +- include/configs/sifive-unmatched.h | 85 + include/dt-bindings/clock/sifive-fu740-prci.h | 25 + include/dt-bindings/reset/sifive-fu740-prci.h | 19 + 48 files changed, 5936 insertions(+), 808 deletions(-) create mode 100644 arch/riscv/cpu/fu740/Kconfig create mode 100644 arch/riscv/cpu/fu740/Makefile create mode 100644 arch/riscv/cpu/fu740/cache.c create mode 100644 arch/riscv/cpu/fu740/cpu.c create mode 100644 arch/riscv/cpu/fu740/dram.c create mode 100644 arch/riscv/cpu/fu740/spl.c create mode 100644 arch/riscv/dts/fu740-c000-u-boot.dtsi create mode 100644 arch/riscv/dts/fu740-c000.dtsi create mode 100644 arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00.dts create mode 100644 arch/riscv/include/asm/arch-fu740/cache.h create mode 100644 arch/riscv/include/asm/arch-fu740/clk.h create mode 100644 arch/riscv/include/asm/arch-fu740/gpio.h create mode 100644 arch/riscv/include/asm/arch-fu740/reset.h create mode 100644 arch/riscv/include/asm/arch-fu740/spl.h create mode 100644 board/sifive/unmatched/Kconfig create mode 100644 board/sifive/unmatched/MAINTAINERS create mode 100644 board/sifive/unmatched/Makefile create mode 100644 board/sifive/unmatched/spl.c create mode 100644 board/sifive/unmatched/unmatched.c create mode 100644 configs/sifive_unmatched_defconfig create mode 100644 doc/board/sifive/unmatched.rst create mode 100644 drivers/clk/sifive/fu540-prci.h create mode 100644 drivers/clk/sifive/fu740-prci.c create mode 100644 drivers/clk/sifive/fu740-prci.h create mode 100644 drivers/clk/sifive/sifive-prci.c create mode 100644 drivers/clk/sifive/sifive-prci.h create mode 100644 drivers/pci/pcie_sifive.c create mode 100644 drivers/pci/pcie_sifive.h rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%) create mode 100644 include/configs/sifive-unmatched.h create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h create mode 100644 include/dt-bindings/reset/sifive-fu740-prci.hSignature · 1 line
2.31.0
v4 cover Add FU740 chip and HiFive Unmatched board support
Hi Leo,
Thanks, I'll fix it.
Quoted 164 lines · Leo Liang
Hi Green,
There seems to be some compilation failure when running CI test.
CI trest result: (https://dev.azure.com/ycliang-tw/u-boot-riscv/_build/results?buildId=24&view=logs&j=24a4c78b-f197-51e6-cd79-c14cda102aad&t=6a1228d0-d58c-5c15-8977-c1c59ea93a2c&l=280)Could you please also check and fix those errors, thanks!
Best regards,
LeoQuoted 152 lines · Green Wan
This patch set is to add SiFive fu740 chip and HiFive Unmatched board support. Patches are split into several parts:
- [PATCH 1/7] dts for fu740
- [PATCH 2/7] support for fu740 cpu
- [PATCH 3/7- 4/7] support for fu740 clk and ram
- [PATCH 5/7] add pcie driver
- [PATCH 6/7] add unmatched board
- [PATCH 7/7] add fu740 support to macb driverDescription
- For fu740 cpu support, reuse most of fu540 cpu.
- For prci driver, add one abstract layer to separate fu540 and fu740. Move orignal fu540 code to separate files.
- For pcie driver, it depends on gpio, prci, clk and reset drivers to do init&reset works.
- Align with Linux DT file.Tests and patch checks
- Able to boot both unmatched and unleashed boards.
- PCIe tests
. M.2 NVMe SSD
. e1000 compatibale ethernet adapter (ping&tftpboot) . pci-to-usb adapter(usb mass storage)
- checkpatch is performed. To keep code derived from other boards the same, ignore some warnings/errors in [PATCH 7/8].Changlogs
- V4
. fixed incorrect file name in ./board/sifive/unmatched/Makefile . fixed link indoc/board/sifive/index.rst, passed 'make htmldocs'
- V3
. Rebase to unleashed rename v2 patch
. Rename
doc/board/sifive/unmatched.rstboard/sifive/unmatched/unmatched.c
. Fix tail whitespace
. Add 'git mv' info to ram driver and merge patch back to one . Add comment to macb driver for PLL hardware quirk
. Add reviewed-by to patch [6/7]
. Add 'gpio-poweroff' node for upcoming opensbi integration
- V2
. Rebase to unleashed rename patch
. remove unnessaary fu540 changes
. split ram driver patch into 2 to keep 'git mv' info
. use a shorter name for unmatched support
. Remove redundant&incorrect temperature-sensor in DT
. Remove unnecessary USB EHCI & OHCI from defconfig
. Revised fu740 doc
. Fixed year of copyright
. Add reviewed-by received in v1 patchDavid Abdurachmanov (1):
drivers: net: macb: add fu740 supportGreen Wan (6):
riscv: dts: add fu740 support
riscv: cpu: fu740: Add support for cpu fu740
drivers: clk: add fu740 support
drivers: ram: sifive: renamefu540_ddrand add fu740 support
drivers: pci: add pcie support for fu740
board: sifive: add HiFive Unmatched board supportarch/riscv/Kconfig | 5 + arch/riscv/cpu/fu740/Kconfig | 37 + arch/riscv/cpu/fu740/Makefile | 12 + arch/riscv/cpu/fu740/cache.c | 55 + arch/riscv/cpu/fu740/cpu.c | 22 + arch/riscv/cpu/fu740/dram.c | 38 + arch/riscv/cpu/fu740/spl.c | 23 + arch/riscv/dts/Makefile | 1 + arch/riscv/dts/fu740-c000-u-boot.dtsi | 105 ++ arch/riscv/dts/fu740-c000.dtsi | 329 ++++ .../dts/fu740-hifive-unmatched-a00-ddr.dtsi | 1489 +++++++++++++++++ .../dts/hifive-unmatched-a00-u-boot.dtsi | 40 + arch/riscv/dts/hifive-unmatched-a00.dts | 259 +++ arch/riscv/include/asm/arch-fu740/cache.h | 14 + arch/riscv/include/asm/arch-fu740/clk.h | 14 + arch/riscv/include/asm/arch-fu740/gpio.h | 38 + arch/riscv/include/asm/arch-fu740/reset.h | 13 + arch/riscv/include/asm/arch-fu740/spl.h | 14 + arch/riscv/lib/sifive_clint.c | 1 - board/sifive/unmatched/Kconfig | 50 + board/sifive/unmatched/MAINTAINERS | 9 + board/sifive/unmatched/Makefile | 9 + board/sifive/unmatched/spl.c | 85 + board/sifive/unmatched/unmatched.c | 24 + common/spl/Kconfig | 4 +- configs/sifive_unmatched_defconfig | 53 + doc/board/sifive/index.rst | 1 + doc/board/sifive/unmatched.rst | 536 ++++++ drivers/clk/sifive/Kconfig | 8 +- drivers/clk/sifive/Makefile | 4 +- drivers/clk/sifive/fu540-prci.c | 769 +-------- drivers/clk/sifive/fu540-prci.h | 22 + drivers/clk/sifive/fu740-prci.c | 158 ++ drivers/clk/sifive/fu740-prci.h | 22 + drivers/clk/sifive/sifive-prci.c | 733 ++++++++ drivers/clk/sifive/sifive-prci.h | 323 ++++ drivers/net/macb.c | 13 +- drivers/pci/Kconfig | 9 + drivers/pci/Makefile | 1 + drivers/pci/pcie_sifive.c | 797 +++++++++ drivers/pci/pcie_sifive.h | 374 +++++ drivers/ram/sifive/Kconfig | 8 +- drivers/ram/sifive/Makefile | 2 +- .../ram/sifive/{fu540_ddr.c => sifive_ddr.c} | 90 +- drivers/reset/Kconfig | 2 +- include/configs/sifive-unmatched.h | 85 + include/dt-bindings/clock/sifive-fu740-prci.h | 25 + include/dt-bindings/reset/sifive-fu740-prci.h | 19 + 48 files changed, 5936 insertions(+), 808 deletions(-) create mode 100644 arch/riscv/cpu/fu740/Kconfig create mode 100644 arch/riscv/cpu/fu740/Makefile create mode 100644 arch/riscv/cpu/fu740/cache.c create mode 100644 arch/riscv/cpu/fu740/cpu.c create mode 100644 arch/riscv/cpu/fu740/dram.c create mode 100644 arch/riscv/cpu/fu740/spl.c create mode 100644 arch/riscv/dts/fu740-c000-u-boot.dtsi create mode 100644 arch/riscv/dts/fu740-c000.dtsi create mode 100644 arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00.dts create mode 100644 arch/riscv/include/asm/arch-fu740/cache.h create mode 100644 arch/riscv/include/asm/arch-fu740/clk.h create mode 100644 arch/riscv/include/asm/arch-fu740/gpio.h create mode 100644 arch/riscv/include/asm/arch-fu740/reset.h create mode 100644 arch/riscv/include/asm/arch-fu740/spl.h create mode 100644 board/sifive/unmatched/Kconfig create mode 100644 board/sifive/unmatched/MAINTAINERS create mode 100644 board/sifive/unmatched/Makefile create mode 100644 board/sifive/unmatched/spl.c create mode 100644 board/sifive/unmatched/unmatched.c create mode 100644 configs/sifive_unmatched_defconfig create mode 100644 doc/board/sifive/unmatched.rst create mode 100644 drivers/clk/sifive/fu540-prci.h create mode 100644 drivers/clk/sifive/fu740-prci.c create mode 100644 drivers/clk/sifive/fu740-prci.h create mode 100644 drivers/clk/sifive/sifive-prci.c create mode 100644 drivers/clk/sifive/sifive-prci.h create mode 100644 drivers/pci/pcie_sifive.c create mode 100644 drivers/pci/pcie_sifive.h rename drivers/ram/sifive/{fu540_ddr.c => sifive_ddr.c} (81%) create mode 100644 include/configs/sifive-unmatched.h create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h create mode 100644 include/dt-bindings/reset/sifive-fu740-prci.h--
2.31.0