Skip to contentSkip to conversation

arm: add initial support for the Phytium Durian Board

PATCH New liu hao 2 participants 2 messages Oct 31, 2019 – Nov 8, 2019

Subsystems (2)
lore
Share & tools
lore

liu hao

author
#0 lore raw

PATCH v5 1/1 arm: add initial support for the Phytium Durian Board

This adds platform code and the device tree for the Phytium Durian Board. The initial support comprises the UART and the PCIE.

Cc Bin Meng <[email protected]>
Cc Kever Yang <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heinrich Schuchardt <[email protected]>

---
Changes for v5:
- Remove the gmac support, including
the gmac node in arch/arm/dts/phytium-durian.dts and some net config in configs/durian_defconfig.
- Modify the board/phytium/durian/README. The flash method is changed.

Changes for v4:
- Drop the changelog from the commit message, and put it after that. @Bin Meng
- Change __FT_2004_CONFIG_H__ to __DURIAN_CONFIG_H__
in include/configs/durian.h file.

Changes for v3:
- Change the board name from ft2004 to durian.
The dts does not on mainline Kernel. @ Kever Yang
- Add pcie driver and boot kernel from scsi-pci card.
Add README about durian board.
The system initialization is worked in BPF that
we do not want to open source.
But the hex file can be gitted referring to the board README. @Tom

Changes for v2:
- Some printf() are removed or replaced by debug(). @Tom
- The ft2004_defconfig file is generated with savedefconfig. @Tom, @Heinrich

---
 MAINTAINERS                      |   7 ++
 arch/arm/Kconfig                 |   8 ++
 arch/arm/dts/Makefile            |   2 +
 arch/arm/dts/phytium-durian.dts  |  33 +++++++
 board/phytium/durian/Kconfig     |  12 +++
 board/phytium/durian/MAINTAINERS |   8 ++
 board/phytium/durian/Makefile    |   9 ++
 board/phytium/durian/README      |  59 ++++++++++++
 board/phytium/durian/cpu.h       |  23 +++++
 board/phytium/durian/durian.c    | 110 +++++++++++++++++++++
 configs/durian_defconfig         |  33 +++++++
 drivers/pci/Kconfig              |   7 ++
 drivers/pci/Makefile             |   1 +
 drivers/pci/pcie_phytium.c       | 200 +++++++++++++++++++++++++++++++++++++++
 include/configs/durian.h         |  44 +++++++++
 15 files changed, 556 insertions(+)
 create mode 100644 arch/arm/dts/phytium-durian.dts
 create mode 100644 board/phytium/durian/Kconfig
 create mode 100644 board/phytium/durian/MAINTAINERS
 create mode 100644 board/phytium/durian/Makefile
 create mode 100644 board/phytium/durian/README
 create mode 100644 board/phytium/durian/cpu.h
 create mode 100644 board/phytium/durian/durian.c
 create mode 100644 configs/durian_defconfig
 create mode 100644 drivers/pci/pcie_phytium.c
 create mode 100644 include/configs/durian.h
MAINTAINERS +7 -0
index 42b5959..49bfdd5 100644
@@ -474,6 +474,13 @@ S:	Maintained
 T:	git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
 F:	arch/arm/mach-zynqmp-r5/
 
+ARM PHYTIUM
+M:	liuhao <[email protected]>
+M:	shuyiqi <[email protected]>
+S:	Maintained
+F:	drivers/pci/pcie_phytium.c
+F:	arch/arm/dts/phytium-durian.dts
+
 BINMAN
 M:	Simon Glass <[email protected]>
 S:	Maintained
arch/arm/Kconfig +8 -0
index 629c5e8..7b80630 100644
@@ -1631,6 +1631,13 @@ config ARCH_ASPEED
 	select OF_CONTROL
 	imply CMD_DM
 
+config TARGET_DURIAN
+	bool "Support Phytium Durian Platform"
+	select ARM64
+	help
+	  Support for durian platform.
+	  It has 2GB Sdram, uart and pcie.
+
 endchoice
 
 config ARCH_SUPPORT_TFABOOT
@@ -1830,6 +1837,7 @@ source "board/woodburn/Kconfig"
 source "board/xilinx/Kconfig"
 source "board/xilinx/zynq/Kconfig"
 source "board/xilinx/zynqmp/Kconfig"
+source "board/phytium/durian/Kconfig"
 
 source "arch/arm/Kconfig.debug"
 
arch/arm/dts/Makefile +2 -0
index 47978e7..4127262 100644
@@ -829,6 +829,8 @@ dtb-$(CONFIG_TARGET_VEXPRESS_CA5X2) += vexpress-v2p-ca5s.dtb
 dtb-$(CONFIG_TARGET_VEXPRESS_CA9X4) += vexpress-v2p-ca9.dtb
 dtb-$(CONFIG_TARGET_VEXPRESS_CA15_TC2) += vexpress-v2p-ca15_a7.dtb
 
+dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
arch/arm/dts/phytium-durian.dts new file +33 -0
new file mode 100644
index 0000000..3b76949
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019, Phytium Ltd.
+ * shuyiqi  <[email protected]>
+ */
+
+/dts-v1/;
+
+/ {
+	model = "Phytium Durian";
+	compatible = "phytium,durian";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	pcie-controller at 40000000 {
+		compatible = "phytium,pcie-host-1.0";
+		device_type = "pci";
+		#address-cells = <3>;
+		#size-cells = <2>;
+		reg = <0x0 0x40000000 0x0 0x10000000>;
+		bus-range = <0x0 0xff>;
+		ranges = <0x1000000 0x0 0x0 0x0 0x50000000 0x0 0xF00000>,
+		<0x2000000 0x0 0x58000000 0x0 0x58000000 0x0 0x28000000>,
+		<0x43000000 0x10 0x00000000 0x10 0x00000000 0x10  0x00000000>;
+	};
+
+	uart at 28001000 {
+		compatible = "arm,pl011";
+		reg = <0x0 0x28001000 0x0 0x1000>;
+		clock = <48000000>;
+	};
+};
+
board/phytium/durian/Kconfig new file +12 -0
new file mode 100644
index 0000000..dc07109
@@ -0,0 +1,12 @@
+if TARGET_DURIAN
+
+config SYS_BOARD
+	default "durian"
+
+config SYS_VENDOR
+	default "phytium"
+
+config SYS_CONFIG_NAME
+	default "durian"
+
+endif
board/phytium/durian/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000..895b762
@@ -0,0 +1,8 @@
+DURIAN BOARD
+M:	liuhao <[email protected]>
+M:	shuyiqi <[email protected]>
+S:	Maintained
+F:	board/phytium/durian/*
+F:	include/configs/durian.h
+F:	configs/durian_defconfig
+
board/phytium/durian/Makefile new file +9 -0
new file mode 100644
index 0000000..c2fbf19
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019
+# shuyiqi  <[email protected]>
+# liuhao   <[email protected]>
+#
+
+obj-y += durian.o
+
board/phytium/durian/README new file +59 -0

59 lines not on this page · raw message

board/phytium/durian/cpu.h new file +23 -0
new file mode 100644
index 0000000..a5a213d
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2019
+ * Phytium Technology Ltd <www.phytium.com>
+ * shuyiqi <[email protected]>
+ */
+
+#ifndef _FT_DURIAN_H
+#define _FT_DURIAN_H
+
+/* FLUSH L3 CASHE */
+#define HNF_COUNT           0x8
+#define HNF_PSTATE_REQ      (HNF_BASE + 0x10)
+#define HNF_PSTATE_STAT     (HNF_BASE + 0x18)
+#define HNF_PSTATE_OFF      0x0
+#define HNF_PSTATE_SFONLY   0x1
+#define HNF_PSTATE_HALF     0x2
+#define HNF_PSTATE_FULL     0x3
+#define HNF_STRIDE          0x10000
+#define HNF_BASE            (unsigned long)(0x3A200000)
+
+#endif /* _FT_DURIAN_H */
+
board/phytium/durian/durian.c new file +110 -0

110 lines not on this page · raw message

configs/durian_defconfig new file +33 -0
new file mode 100644
index 0000000..20177e4
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_TARGET_DURIAN=y
+CONFIG_SYS_TEXT_BASE=0x500000
+CONFIG_NR_DRAM_BANKS=1
+# CONFIG_PSCI_RESET is not set
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0,115200 earlycon=pl011,0x28001000 root=/dev/sda2 rw"
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_LAST_STAGE_INIT=y
+CONFIG_SYS_PROMPT="durian#"
+# CONFIG_CMD_LZMADEC is not set
+# CONFIG_CMD_UNZIP is not set
+CONFIG_CMD_PCI=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="phytium-durian"
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCI_PHYTIUM=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_PL01X_SERIAL=y
drivers/pci/Kconfig +7 -0
index 19e7b50..bfc7f6c 100644
@@ -51,6 +51,13 @@ config PCIE_ECAM_GENERIC
 	  Say Y here if you want to enable support for generic ECAM-based
 	  PCIe host controllers, such as the one emulated by QEMU.
 
+config PCI_PHYTIUM
+	bool "Phytium PCIe support"
+	depends on DM_PCI
+	help
+	  Say Y here if you want to enable PCIe controller support on
+	  Phytium SoCs.
+
 config PCIE_DW_MVEBU
 	bool "Enable Armada-8K PCIe driver (DesignWare core)"
 	depends on DM_PCI
drivers/pci/Makefile +1 -0
index b1d3dc8..ba2aa4b 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_PCIE_LAYERSCAPE) += pcie_layerscape_fixup.o
 obj-$(CONFIG_PCIE_LAYERSCAPE_GEN4) += pcie_layerscape_gen4.o \
 				pcie_layerscape_gen4_fixup.o
 obj-$(CONFIG_PCI_XILINX) += pcie_xilinx.o
+obj-$(CONFIG_PCI_PHYTIUM) += pcie_phytium.o
 obj-$(CONFIG_PCIE_INTEL_FPGA) += pcie_intel_fpga.o
 obj-$(CONFIG_PCI_KEYSTONE) += pcie_dw_ti.o
 obj-$(CONFIG_PCIE_MEDIATEK) += pcie_mediatek.o
drivers/pci/pcie_phytium.c new file +200 -0

200 lines not on this page · raw message

include/configs/durian.h new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v5 1/1 arm: add initial support for the Phytium Durian Board

Quoted 9 lines · liu hao

This adds platform code and the device tree for the Phytium Durian Board. The initial support comprises the UART and the PCIE.

Cc Bin Meng <[email protected]>
Cc Kever Yang <[email protected]>
Cc Tom Rini <[email protected]>
Cc Heinrich Schuchardt <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/51260d36/attachment.sig>