[PATCH V4] ARM add initial support for the Phytium Pe2201 Board.

2023-12-25 Thread TracyMg_Li
From: TracyMg_Li 

Add pe2201 platform code and the device tree of pe2201 platform board.
The initial support comprises the UART and PCIe.

Signed-off-by: TracyMg_Li 
Changes since v1:
fix space corrupt.
Changes since v2:
switch to bootstd and text environment.
Changes since v3:
add environment variables.
---
 arch/arm/Kconfig |   7 ++
 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/phytium-pe2201.dts  |  43 +++
 board/phytium/pe2201/Kconfig |  12 ++
 board/phytium/pe2201/MAINTAINERS |   8 ++
 board/phytium/pe2201/Makefile|  12 ++
 board/phytium/pe2201/cpu.h   |  64 +++
 board/phytium/pe2201/ddr.c   | 190 +++
 board/phytium/pe2201/pcie.c  |  60 ++
 board/phytium/pe2201/pe2201.c|  92 +++
 board/phytium/pe2201/pe2201.env  |  25 
 board/phytium/pe2201/pll.c   |  75 
 board/phytium/pe2201/sec.c   |  37 ++
 configs/pe2201_defconfig |  42 +++
 include/configs/pe2201.h |  16 +++
 15 files changed, 684 insertions(+)
 create mode 100644 arch/arm/dts/phytium-pe2201.dts
 create mode 100644 board/phytium/pe2201/Kconfig
 create mode 100644 board/phytium/pe2201/MAINTAINERS
 create mode 100644 board/phytium/pe2201/Makefile
 create mode 100644 board/phytium/pe2201/cpu.h
 create mode 100644 board/phytium/pe2201/ddr.c
 create mode 100644 board/phytium/pe2201/pcie.c
 create mode 100644 board/phytium/pe2201/pe2201.c
 create mode 100644 board/phytium/pe2201/pe2201.env
 create mode 100644 board/phytium/pe2201/pll.c
 create mode 100644 board/phytium/pe2201/sec.c
 create mode 100644 configs/pe2201_defconfig
 create mode 100644 include/configs/pe2201.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d812685c98..358c515a93 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2060,6 +2060,12 @@ config TARGET_POMELO
   Support for pomelo platform.
   It has 8GB Sdram, uart and pcie.
 
+config TARGET_PE2201
+   bool "Support Phytium PE2201 Platform"
+   select ARM64
+   help
+ Support for pe2201 platform.It has 2GB Sdram, uart and pcie.
+
 config TARGET_PRESIDIO_ASIC
bool "Support Cortina Presidio ASIC Platform"
select ARM64
@@ -2336,6 +2342,7 @@ source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/phytium/durian/Kconfig"
 source "board/phytium/pomelo/Kconfig"
+source "board/phytium/pe2201/Kconfig"
 source "board/xen/xenguest_arm64/Kconfig"
 
 source "arch/arm/Kconfig.debug"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5fc888680b..ce2fc626b0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1469,6 +1469,7 @@ dtb-$(CONFIG_TARGET_TOTAL_COMPUTE) += total_compute.dtb
 
 dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
 dtb-$(CONFIG_TARGET_POMELO) += phytium-pomelo.dtb
+dtb-$(CONFIG_TARGET_PE2201) += phytium-pe2201.dtb
 
 dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
 
diff --git a/arch/arm/dts/phytium-pe2201.dts b/arch/arm/dts/phytium-pe2201.dts
new file mode 100644
index 00..959584fbbb
--- /dev/null
+++ b/arch/arm/dts/phytium-pe2201.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  dts file for Phytium pe2201 board
+ *  Copyright (C) 2023, Phytium Technology Co., Ltd.
+ * lixinde 
+ * weichangzheng   
+ */
+/dts-v1/;
+
+/ {
+   model = "Phytium pe2201 Board";
+   compatible = "phytium,pe2201";
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   aliases {
+   serial0 = 
+   };
+
+   uart0: serial@2800c000 {
+   compatible = "arm,pl011", "arm,primecell";
+   reg = <0x0 0x2800c000 0x0 0x1000>;
+   clock = <1>;
+   };
+
+   soc {
+   compatible = "simple-bus";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   pcie@4000 {
+   compatible = "pci-host-ecam-generic";
+   device_type = "pci";
+   #address-cells = <3>;
+   #size-cells = <2>;
+   reg = <0x0 0x4000 0x0 0x1000>;
+   ranges = <0x0100 0x00 0x 0x0 0x5000 0x0 
0x00F0>,
+   <0x0200 0x00 0x5800 0x0 0x5800 0x0 
0x2800>,
+   <0x4300 0x10 0x 0x10 0x 0x10 
0x>;
+   };
+   };
+};
diff --git a/board/phytium/pe2201/Kconfig b/board/phytium/pe2201/Kconfig
new file mode 100644
index 00..f2f222b5d3
--- /dev/null
+++ b/board/phytium/pe2201/Kconfig
@@ -0,0 +1,12 @@
+if TA

[PATCH V3] ARM add initial support for the Phytium Pe2201 Board.

2023-12-19 Thread TracyMg_Li
From: TracyMg_Li 

Add pe2201 platform code and the device tree of pe2201 platform board.
The initial support comprises the UART and PCIe.

Signed-off-by: TracyMg_Li 
Changes since v1:
fix space corrupt.
Changes since v2:
switch to bootstd and text environment.
---
 arch/arm/Kconfig |   7 ++
 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/phytium-pe2201.dts  |  43 +++
 board/phytium/pe2201/Kconfig |  12 ++
 board/phytium/pe2201/MAINTAINERS |   8 ++
 board/phytium/pe2201/Makefile|  12 ++
 board/phytium/pe2201/cpu.h   |  64 +++
 board/phytium/pe2201/ddr.c   | 190 +++
 board/phytium/pe2201/pcie.c  |  60 ++
 board/phytium/pe2201/pe2201.c|  92 +++
 board/phytium/pe2201/pe2201.env  |  12 ++
 board/phytium/pe2201/pll.c   |  75 
 board/phytium/pe2201/sec.c   |  37 ++
 configs/pe2201_defconfig |  41 +++
 include/configs/pe2201.h |  22 
 15 files changed, 676 insertions(+)
 create mode 100644 arch/arm/dts/phytium-pe2201.dts
 create mode 100644 board/phytium/pe2201/Kconfig
 create mode 100644 board/phytium/pe2201/MAINTAINERS
 create mode 100644 board/phytium/pe2201/Makefile
 create mode 100644 board/phytium/pe2201/cpu.h
 create mode 100644 board/phytium/pe2201/ddr.c
 create mode 100644 board/phytium/pe2201/pcie.c
 create mode 100644 board/phytium/pe2201/pe2201.c
 create mode 100644 board/phytium/pe2201/pe2201.env
 create mode 100644 board/phytium/pe2201/pll.c
 create mode 100644 board/phytium/pe2201/sec.c
 create mode 100644 configs/pe2201_defconfig
 create mode 100644 include/configs/pe2201.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d812685c98..358c515a93 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2060,6 +2060,12 @@ config TARGET_POMELO
   Support for pomelo platform.
   It has 8GB Sdram, uart and pcie.
 
+config TARGET_PE2201
+   bool "Support Phytium PE2201 Platform"
+   select ARM64
+   help
+ Support for pe2201 platform.It has 2GB Sdram, uart and pcie.
+
 config TARGET_PRESIDIO_ASIC
bool "Support Cortina Presidio ASIC Platform"
select ARM64
@@ -2336,6 +2342,7 @@ source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/phytium/durian/Kconfig"
 source "board/phytium/pomelo/Kconfig"
+source "board/phytium/pe2201/Kconfig"
 source "board/xen/xenguest_arm64/Kconfig"
 
 source "arch/arm/Kconfig.debug"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5fc888680b..ce2fc626b0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1469,6 +1469,7 @@ dtb-$(CONFIG_TARGET_TOTAL_COMPUTE) += total_compute.dtb
 
 dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
 dtb-$(CONFIG_TARGET_POMELO) += phytium-pomelo.dtb
+dtb-$(CONFIG_TARGET_PE2201) += phytium-pe2201.dtb
 
 dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
 
diff --git a/arch/arm/dts/phytium-pe2201.dts b/arch/arm/dts/phytium-pe2201.dts
new file mode 100644
index 00..959584fbbb
--- /dev/null
+++ b/arch/arm/dts/phytium-pe2201.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  dts file for Phytium pe2201 board
+ *  Copyright (C) 2023, Phytium Technology Co., Ltd.
+ * lixinde 
+ * weichangzheng   
+ */
+/dts-v1/;
+
+/ {
+   model = "Phytium pe2201 Board";
+   compatible = "phytium,pe2201";
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   aliases {
+   serial0 = 
+   };
+
+   uart0: serial@2800c000 {
+   compatible = "arm,pl011", "arm,primecell";
+   reg = <0x0 0x2800c000 0x0 0x1000>;
+   clock = <1>;
+   };
+
+   soc {
+   compatible = "simple-bus";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   pcie@4000 {
+   compatible = "pci-host-ecam-generic";
+   device_type = "pci";
+   #address-cells = <3>;
+   #size-cells = <2>;
+   reg = <0x0 0x4000 0x0 0x1000>;
+   ranges = <0x0100 0x00 0x 0x0 0x5000 0x0 
0x00F0>,
+   <0x0200 0x00 0x5800 0x0 0x5800 0x0 
0x2800>,
+   <0x4300 0x10 0x 0x10 0x 0x10 
0x>;
+   };
+   };
+};
diff --git a/board/phytium/pe2201/Kconfig b/board/phytium/pe2201/Kconfig
new file mode 100644
index 00..f2f222b5d3
--- /dev/null
+++ b/board/phytium/pe2201/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_PE2201
+
+config SYS_BOARD
+  

[patch v2] ARM add initial support for the Phytium Pe2201 Board. Add pe2201 platform code and the device tree of pe2201 platform board. The initial support comprises the UART and PCIe.

2023-12-15 Thread TracyMg_Li
From: TracyMg_Li 

Signed-off-by: TracyMg_Li 
---
 arch/arm/Kconfig |   7 ++
 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/phytium-pe2201.dts  |  43 +++
 board/phytium/pe2201/Kconfig |  12 ++
 board/phytium/pe2201/MAINTAINERS |   8 ++
 board/phytium/pe2201/Makefile|  12 ++
 board/phytium/pe2201/cpu.h   |  64 +++
 board/phytium/pe2201/ddr.c   | 190 +++
 board/phytium/pe2201/pcie.c  |  60 ++
 board/phytium/pe2201/pe2201.c|  92 +++
 board/phytium/pe2201/pll.c   |  75 
 board/phytium/pe2201/sec.c   |  37 ++
 configs/pe2201_defconfig |  40 +++
 include/configs/pe2201.h |  32 ++
 14 files changed, 673 insertions(+)
 create mode 100644 arch/arm/dts/phytium-pe2201.dts
 create mode 100644 board/phytium/pe2201/Kconfig
 create mode 100644 board/phytium/pe2201/MAINTAINERS
 create mode 100644 board/phytium/pe2201/Makefile
 create mode 100644 board/phytium/pe2201/cpu.h
 create mode 100644 board/phytium/pe2201/ddr.c
 create mode 100644 board/phytium/pe2201/pcie.c
 create mode 100644 board/phytium/pe2201/pe2201.c
 create mode 100644 board/phytium/pe2201/pll.c
 create mode 100644 board/phytium/pe2201/sec.c
 create mode 100644 configs/pe2201_defconfig
 create mode 100644 include/configs/pe2201.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d812685c98..358c515a93 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2060,6 +2060,12 @@ config TARGET_POMELO
   Support for pomelo platform.
   It has 8GB Sdram, uart and pcie.
 
+config TARGET_PE2201
+   bool "Support Phytium PE2201 Platform"
+   select ARM64
+   help
+ Support for pe2201 platform.It has 2GB Sdram, uart and pcie.
+
 config TARGET_PRESIDIO_ASIC
bool "Support Cortina Presidio ASIC Platform"
select ARM64
@@ -2336,6 +2342,7 @@ source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/phytium/durian/Kconfig"
 source "board/phytium/pomelo/Kconfig"
+source "board/phytium/pe2201/Kconfig"
 source "board/xen/xenguest_arm64/Kconfig"
 
 source "arch/arm/Kconfig.debug"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5fc888680b..ce2fc626b0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1469,6 +1469,7 @@ dtb-$(CONFIG_TARGET_TOTAL_COMPUTE) += total_compute.dtb
 
 dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
 dtb-$(CONFIG_TARGET_POMELO) += phytium-pomelo.dtb
+dtb-$(CONFIG_TARGET_PE2201) += phytium-pe2201.dtb
 
 dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
 
diff --git a/arch/arm/dts/phytium-pe2201.dts b/arch/arm/dts/phytium-pe2201.dts
new file mode 100644
index 00..959584fbbb
--- /dev/null
+++ b/arch/arm/dts/phytium-pe2201.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  dts file for Phytium pe2201 board
+ *  Copyright (C) 2023, Phytium Technology Co., Ltd.
+ * lixinde 
+ * weichangzheng   
+ */
+/dts-v1/;
+
+/ {
+   model = "Phytium pe2201 Board";
+   compatible = "phytium,pe2201";
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   aliases {
+   serial0 = 
+   };
+
+   uart0: serial@2800c000 {
+   compatible = "arm,pl011", "arm,primecell";
+   reg = <0x0 0x2800c000 0x0 0x1000>;
+   clock = <1>;
+   };
+
+   soc {
+   compatible = "simple-bus";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   pcie@4000 {
+   compatible = "pci-host-ecam-generic";
+   device_type = "pci";
+   #address-cells = <3>;
+   #size-cells = <2>;
+   reg = <0x0 0x4000 0x0 0x1000>;
+   ranges = <0x0100 0x00 0x 0x0 0x5000 0x0 
0x00F0>,
+   <0x0200 0x00 0x5800 0x0 0x5800 0x0 
0x2800>,
+   <0x4300 0x10 0x 0x10 0x 0x10 
0x>;
+   };
+   };
+};
diff --git a/board/phytium/pe2201/Kconfig b/board/phytium/pe2201/Kconfig
new file mode 100644
index 00..f2f222b5d3
--- /dev/null
+++ b/board/phytium/pe2201/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_PE2201
+
+config SYS_BOARD
+   default "pe2201"
+
+config SYS_VENDOR
+   default "phytium"
+
+config SYS_CONFIG_NAME
+   default "pe2201"
+
+endif
diff --git a/board/phytium/pe2201/MAINTAINERS b/board/phytium/pe2201/MAINTAINERS
new file mode 100644
index 00..f583d631d2
--- /dev/null
+++ b/board/phytium/pe2201/MAINTAINERS
@@ -0,

[patch v1] arm add initial support for the Phytium Pe2201 Board board:phytium:add pe2201 folder,It initializes pcie, ddr and other aspects of phytium pe2201 board dts:add phytium_pe2201.dts,it is dev

2023-12-13 Thread TracyMg_Li
From: TracyMg_Li 

Signed-off-by: TracyMg_Li 
---
 arch/arm/Kconfig |   8 ++
 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/phytium-pe2201.dts  |  43 +++
 board/phytium/pe2201/Kconfig |  12 ++
 board/phytium/pe2201/MAINTAINERS |   8 ++
 board/phytium/pe2201/Makefile|  12 ++
 board/phytium/pe2201/cpu.h   |  64 +++
 board/phytium/pe2201/ddr.c   | 190 +++
 board/phytium/pe2201/pcie.c  |  60 ++
 board/phytium/pe2201/pe2201.c|  92 +++
 board/phytium/pe2201/pll.c   |  75 
 board/phytium/pe2201/sec.c   |  37 ++
 configs/pe2201_defconfig |  40 +++
 include/configs/pe2201.h |  32 ++
 14 files changed, 674 insertions(+)
 create mode 100644 arch/arm/dts/phytium-pe2201.dts
 create mode 100644 board/phytium/pe2201/Kconfig
 create mode 100644 board/phytium/pe2201/MAINTAINERS
 create mode 100644 board/phytium/pe2201/Makefile
 create mode 100644 board/phytium/pe2201/cpu.h
 create mode 100644 board/phytium/pe2201/ddr.c
 create mode 100644 board/phytium/pe2201/pcie.c
 create mode 100644 board/phytium/pe2201/pe2201.c
 create mode 100644 board/phytium/pe2201/pll.c
 create mode 100644 board/phytium/pe2201/sec.c
 create mode 100644 configs/pe2201_defconfig
 create mode 100644 include/configs/pe2201.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d812685c98..8a8f8805a0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2060,6 +2060,13 @@ config TARGET_POMELO
   Support for pomelo platform.
   It has 8GB Sdram, uart and pcie.
 
+config TARGET_PE2201
+bool "Support Phytium PE2201 Platform"
+select ARM64
+help
+  Support for pe2201 platform.
+  It has 2GB Sdram, uart and pcie.
+
 config TARGET_PRESIDIO_ASIC
bool "Support Cortina Presidio ASIC Platform"
select ARM64
@@ -2336,6 +2343,7 @@ source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/phytium/durian/Kconfig"
 source "board/phytium/pomelo/Kconfig"
+source "board/phytium/pe2201/Kconfig"
 source "board/xen/xenguest_arm64/Kconfig"
 
 source "arch/arm/Kconfig.debug"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5fc888680b..ce2fc626b0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1469,6 +1469,7 @@ dtb-$(CONFIG_TARGET_TOTAL_COMPUTE) += total_compute.dtb
 
 dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
 dtb-$(CONFIG_TARGET_POMELO) += phytium-pomelo.dtb
+dtb-$(CONFIG_TARGET_PE2201) += phytium-pe2201.dtb
 
 dtb-$(CONFIG_TARGET_PRESIDIO_ASIC) += ca-presidio-engboard.dtb
 
diff --git a/arch/arm/dts/phytium-pe2201.dts b/arch/arm/dts/phytium-pe2201.dts
new file mode 100644
index 00..e661e80f06
--- /dev/null
+++ b/arch/arm/dts/phytium-pe2201.dts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  dts file for Phytium pe2201 board
+ *  Copyright (C) 2023, Phytium Technology Co., Ltd.
+ * lixinde 
+ * weichangzheng   
+ */
+/dts-v1/;
+
+/ {
+   model = "Phytium pe2201 Board";
+   compatible = "phytium,pe2201";
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   aliases {
+   serial0 = 
+   };
+
+   uart0: serial@2800c000 {
+   compatible = "arm,pl011", "arm,primecell";
+   reg = <0x0 0x2800c000 0x0 0x1000>;
+   clock = <1>;
+   };
+
+   soc {
+   compatible = "simple-bus";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   pcie@4000 {
+   compatible = "pci-host-ecam-generic";
+   device_type = "pci";
+   #address-cells = <3>;
+   #size-cells = <2>;
+   reg = <0x0 0x4000 0x0 0x1000>;
+   ranges = <0x0100 0x00 0x 0x0 0x5000 0x0 
0x00F0>,
+   <0x0200 0x00 0x5800 0x0 0x5800 0x0 
0x2800>,
+   <0x4300 0x10 0x 0x10 0x 0x10 
0x>;
+   };
+   };
+};
diff --git a/board/phytium/pe2201/Kconfig b/board/phytium/pe2201/Kconfig
new file mode 100644
index 00..f2f222b5d3
--- /dev/null
+++ b/board/phytium/pe2201/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_PE2201
+
+config SYS_BOARD
+   default "pe2201"
+
+config SYS_VENDOR
+   default "phytium"
+
+config SYS_CONFIG_NAME
+   default "pe2201"
+
+endif
diff --git a/board/phytium/pe2201/MAINTAINERS b/board/phytium/pe2201/MAINTAINERS
new file mode 100644
index 00..f583d631d2
--- /dev/null
+++ b/board/phytium/pe2201/MAINTAINE