From patchwork Thu Mar 11 13:49:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Green Wan X-Patchwork-Id: 1451177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dx9MB5zMbz9sRN for ; Fri, 12 Mar 2021 00:50:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 865E6827E3; Thu, 11 Mar 2021 14:50:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2554982900; Thu, 11 Mar 2021 14:50:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 Received: from transporter.internal.sifive.com (unknown [64.62.193.209]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 78242827DE for ; Thu, 11 Mar 2021 14:50:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=green.wan@sifive.com Received: from gamma15.internal.sifive.com (gamma15.internal.sifive.com [10.14.21.64]) by transporter.internal.sifive.com (Postfix) with ESMTPS id 38C24204A1; Thu, 11 Mar 2021 05:50:02 -0800 (PST) Received: from localhost (gamma15.internal.sifive.com [local]) by gamma15.internal.sifive.com (OpenSMTPD) with ESMTPA id 362241fe; Thu, 11 Mar 2021 13:50:01 +0000 (UTC) From: Green Wan To: Cc: bmeng.cn@gmail.com, Green Wan , Rick Chen , Paul Walmsley , Palmer Dabbelt , Anup Patel , Atish Patra , Pragnesh Patel , Lukasz Majewski , Joe Hershberger , Ramon Fried , u-boot@lists.denx.de Subject: [PATCH 0/7] Add FU740 chip and HiFive Unmatched board support Date: Thu, 11 Mar 2021 05:49:41 -0800 Message-Id: <1615470589-130546-1-git-send-email-green.wan@sifive.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Thu, 11 Mar 2021 14:50:36 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean 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 6/7]. Green Wan (7): riscv: dts: add fu740 support riscv: cpu: fu740: Add support for cpu fu740 drivers: clk: add fu740 support drivers: ram: add fu740 support drivers: pci: add pcie support for fu740 board: sifive: add HiFive Unmatched board support drivers: net: macb: add fu740 support arch/riscv/Kconfig | 8 + 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 +++++ arch/riscv/dts/fu740-hifive-unmatched-a00-ddr.dtsi | 1489 ++++++++++++++++++++ arch/riscv/dts/hifive-unmatched-a00-u-boot.dtsi | 40 + arch/riscv/dts/hifive-unmatched-a00.dts | 263 ++++ 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/fu540/Kconfig | 1 - board/sifive/fu540/fu540.c | 2 +- board/sifive/hifive_unmatched_fu740/Kconfig | 50 + board/sifive/hifive_unmatched_fu740/MAINTAINERS | 8 + board/sifive/hifive_unmatched_fu740/Makefile | 9 + .../hifive-unmatched-fu740.c | 24 + board/sifive/hifive_unmatched_fu740/spl.c | 85 ++ common/spl/Kconfig | 5 +- configs/sifive_hifive_unmatched_fu740_defconfig | 57 + doc/board/sifive/fu540.rst | 19 +- 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 | 8 +- 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 +- drivers/ram/sifive/sifive_ddr.c | 410 ++++++ drivers/reset/Kconfig | 2 +- include/configs/sifive-fu540.h | 5 - include/configs/sifive-hifive-unmatched-fu740.h | 88 ++ include/dt-bindings/clock/sifive-fu740-prci.h | 25 + include/dt-bindings/reset/sifive-fu740-prci.h | 19 + 50 files changed, 5782 insertions(+), 781 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/hifive_unmatched_fu740/Kconfig create mode 100644 board/sifive/hifive_unmatched_fu740/MAINTAINERS create mode 100644 board/sifive/hifive_unmatched_fu740/Makefile create mode 100644 board/sifive/hifive_unmatched_fu740/hifive-unmatched-fu740.c create mode 100644 board/sifive/hifive_unmatched_fu740/spl.c create mode 100644 configs/sifive_hifive_unmatched_fu740_defconfig 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 create mode 100644 drivers/ram/sifive/sifive_ddr.c create mode 100644 include/configs/sifive-hifive-unmatched-fu740.h create mode 100644 include/dt-bindings/clock/sifive-fu740-prci.h create mode 100644 include/dt-bindings/reset/sifive-fu740-prci.h