Skip to content

Commit

Permalink
yosemite4: Initial commit for meta-yosemite4n
Browse files Browse the repository at this point in the history
Summary:
- Add the meta-yosemite4n layer for Nuvoton management board. This is
  a Linux Foundation-based machine and already upstream.
- Add an u-boot patch for factory memory testing purpose.
- Add kernel driver patches that are still under upstream review.
- Add an entity-manager patch for i3c interface.
- cpld-fw-handler: enable update-ebr-init.

Signed-off-by: Joseph Liu <[email protected]>
Signed-off-by: Marvin Lin <[email protected]>
  • Loading branch information
linkunfa committed Aug 27, 2024
1 parent 21edc27 commit ee37726
Show file tree
Hide file tree
Showing 49 changed files with 11,168 additions and 1 deletion.
6 changes: 6 additions & 0 deletions common/recipes-kernel/linux/linux-nuvoton_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/6.6:"

LINUX_NUVOTON_PATCHES_INC ?= ""
LINUX_NUVOTON_PATCHES_INC:openbmc-fb-lf = "linux-patches-6.6.inc"

include ${LINUX_NUVOTON_PATCHES_INC}
14 changes: 14 additions & 0 deletions meta-facebook/meta-yosemite4/meta-yosemite4n/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"

# Ignore bbappend related to ASPEED in meta-yosemite4
BBMASK += ".*aspeed.*\.bbappend"

BBFILE_COLLECTIONS += "fb-yosemite4n-layer"
BBFILE_PATTERN_fb-yosemite4n-layer := "^${LAYERDIR}/"
LAYERVERSION_fb-yosemite4n-layer = "1"
LAYERSERIES_COMPAT_fb-yosemite4n-layer = "scarthgap nanbield kirkstone"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "8"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
##OEROOT##/meta \
##OEROOT##/meta-openembedded/meta-oe \
##OEROOT##/meta-openembedded/meta-networking \
##OEROOT##/meta-openembedded/meta-python \
##OEROOT##/meta-security/meta-tpm \
##OEROOT##/meta-phosphor \
##OEROOT##/meta-arm/meta-arm \
##OEROOT##/meta-arm/meta-arm-toolchain \
##OEROOT##/meta-nuvoton \
##OEROOT##/meta-facebook \
##OEROOT##/meta-facebook/meta-yosemite4 \
##OEROOT##/meta-facebook/meta-yosemite4/meta-yosemite4n \
##OEROOT##/../.. \
##OEROOT##/../../meta-facebook \
##OEROOT##/../../meta-facebook/meta-yosemite4 \
##OEROOT##/../../meta-facebook/meta-yosemite4/meta-yosemite4n \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Common targets are:
yosemite4n-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Local configuration file for building the OpenBMC image.
#
MACHINE ??= "yosemite4n"
DISTRO ?= "openbmc-fb-lf"
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From fd6c1631c9075161df703e7928063f4acf498113 Mon Sep 17 00:00:00 2001
From: RickyWu-wiwynn <[email protected]>
Date: Mon, 8 Apr 2024 18:07:34 +0800
Subject: [PATCH] cmd: mem: set test result of mtest to enviroment variable

---
cmd/mem.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/cmd/mem.c b/cmd/mem.c
index 5f4e865462..4dee413fea 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -1204,6 +1204,15 @@ static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
+ char *is_done;
+ is_done = env_get("memtest_result");
+ if (is_done != NULL) {
+ env_set("memtest_result", "");
+ env_set("preboot", "");
+ env_save();
+ return 0;
+ }
+
ulong start, end;
vu_long scratch_space;
vu_long *buf, *dummy = &scratch_space;
@@ -1273,6 +1282,13 @@ static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,

printf("\nTested %d iteration(s) with %lu errors.\n", iteration, count);

+ if (errs == 0) {
+ env_set("memtest_result", "pass");
+ } else {
+ env_set("memtest_result", "fail");
+ }
+ env_save();
+
return errs != 0;
}
#endif /* CONFIG_CMD_MEMTEST */
--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

SRC_URI:append = " file://0100-cmd-mem-set-test-result-of-mtest-to-enviroment-varia.patch"

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require recipes-core/images/yosemite4-image.bb

IMAGE_INSTALL:remove = " packagegroup-openbmc-tests2"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EXTRA_OEMESON:append = " -Dupdate-ebr-init=enabled"

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From 9f903328f2169a1d058418a2e49cbe164584b9d9 Mon Sep 17 00:00:00 2001
From: Tomer Maimon <[email protected]>
Date: Mon, 1 Jul 2024 10:10:44 +0300
Subject: [PATCH] dt-bindings: clock: npcm845: Add reference 25m clock property

The NPCM8XX clock driver uses a 25Mhz external clock, therefore adding
clock property.

The new required clock property does not break the NPCM8XX clock ABI
since the NPCM8XX clock driver hasn't merged yet to the Linux vanilla.

This change is also contributing to lf-openbmc upstream for reviewing.
Lore Link: https://lore.kernel.org/all/[email protected]/

Signed-off-by: Tomer Maimon <[email protected]>
---
arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 9 +++++----
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts | 7 +++++++
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index ecd171b2feba..41d345448430 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -52,6 +52,7 @@ rstc: reset-controller@f0801000 {
reg = <0x0 0xf0801000 0x0 0x78>;
#reset-cells = <2>;
nuvoton,sysgcr = <&gcr>;
+ clocks = <&refclk>;
};

clk: clock-controller@f0801000 {
@@ -81,7 +82,7 @@ timer0: timer@8000 {
compatible = "nuvoton,npcm845-timer";
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x8000 0x1C>;
- clocks = <&clk NPCM8XX_CLK_REFCLK>;
+ clocks = <&refclk>;
clock-names = "refclk";
};

@@ -153,7 +154,7 @@ watchdog0: watchdog@801c {
interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x801c 0x4>;
status = "disabled";
- clocks = <&clk NPCM8XX_CLK_REFCLK>;
+ clocks = <&refclk>;
syscon = <&gcr>;
};

@@ -162,7 +163,7 @@ watchdog1: watchdog@901c {
interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x901c 0x4>;
status = "disabled";
- clocks = <&clk NPCM8XX_CLK_REFCLK>;
+ clocks = <&refclk>;
syscon = <&gcr>;
};

@@ -171,7 +172,7 @@ watchdog2: watchdog@a01c {
interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
reg = <0xa01c 0x4>;
status = "disabled";
- clocks = <&clk NPCM8XX_CLK_REFCLK>;
+ clocks = <&refclk>;
syscon = <&gcr>;
};
};
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
index a5ab2bc0f835..83c2f4e138e5 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
@@ -19,6 +19,13 @@ chosen {
memory {
reg = <0x0 0x0 0x0 0x40000000>;
};
+
+ refclk: refclk-25mhz {
+ compatible = "fixed-clock";
+ clock-output-names = "ref";
+ clock-frequency = <25000000>;
+ #clock-cells = <0>;
+ };
};

&serial0 {
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
From 7ada4b7e39819f2cc765b27f3fc1ad38ece3278f Mon Sep 17 00:00:00 2001
From: Tomer Maimon <[email protected]>
Date: Mon, 1 Jul 2024 10:10:46 +0300
Subject: [PATCH] arm64: dts: modify clock property in modules node

Modify clock property handler in UART, CPU, PECI modules to reset
controller.

This change is also contributing to lf-openbmc upstream for reviewing.
Lore Link: https://lore.kernel.org/all/[email protected]/

Signed-off-by: Tomer Maimon <[email protected]>
---
.../boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 16 ++++++++--------
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi | 8 ++++----
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index 41d345448430..92e3b0fe746f 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -73,7 +73,7 @@ peci: peci-controller@100000 {
compatible = "nuvoton,npcm845-peci";
reg = <0x100000 0x1000>;
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk NPCM8XX_CLK_APB3>;
+ clocks = <&rstc NPCM8XX_CLK_APB3>;
cmd-timeout-ms = <1000>;
status = "disabled";
};
@@ -89,7 +89,7 @@ timer0: timer@8000 {
serial0: serial@0 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x0 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -98,7 +98,7 @@ serial0: serial@0 {
serial1: serial@1000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x1000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -107,7 +107,7 @@ serial1: serial@1000 {
serial2: serial@2000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x2000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -116,7 +116,7 @@ serial2: serial@2000 {
serial3: serial@3000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x3000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -125,7 +125,7 @@ serial3: serial@3000 {
serial4: serial@4000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x4000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -134,7 +134,7 @@ serial4: serial@4000 {
serial5: serial@5000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x5000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART>;
interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
@@ -143,7 +143,7 @@ serial5: serial@5000 {
serial6: serial@6000 {
compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
reg = <0x6000 0x1000>;
- clocks = <&clk NPCM8XX_CLK_UART>;
+ clocks = <&rstc NPCM8XX_CLK_UART2>;
interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>;
reg-shift = <2>;
status = "disabled";
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
index 383938dcd3ce..3cbcea65eba2 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
@@ -14,7 +14,7 @@ cpus {
cpu0: cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a35";
- clocks = <&clk NPCM8XX_CLK_CPU>;
+ clocks = <&rstc NPCM8XX_CLK_CPU>;
reg = <0x0 0x0>;
next-level-cache = <&l2>;
enable-method = "psci";
@@ -23,7 +23,7 @@ cpu0: cpu@0 {
cpu1: cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a35";
- clocks = <&clk NPCM8XX_CLK_CPU>;
+ clocks = <&rstc NPCM8XX_CLK_CPU>;
reg = <0x0 0x1>;
next-level-cache = <&l2>;
enable-method = "psci";
@@ -32,7 +32,7 @@ cpu1: cpu@1 {
cpu2: cpu@2 {
device_type = "cpu";
compatible = "arm,cortex-a35";
- clocks = <&clk NPCM8XX_CLK_CPU>;
+ clocks = <&rstc NPCM8XX_CLK_CPU>;
reg = <0x0 0x2>;
next-level-cache = <&l2>;
enable-method = "psci";
@@ -41,7 +41,7 @@ cpu2: cpu@2 {
cpu3: cpu@3 {
device_type = "cpu";
compatible = "arm,cortex-a35";
- clocks = <&clk NPCM8XX_CLK_CPU>;
+ clocks = <&rstc NPCM8XX_CLK_CPU>;
reg = <0x0 0x3>;
next-level-cache = <&l2>;
enable-method = "psci";
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From d197b1fdad05c195a1f40c4575d9b9b802e7ced1 Mon Sep 17 00:00:00 2001
From: Tomer Maimon <[email protected]>
Date: Mon, 1 Jul 2024 10:10:45 +0300
Subject: [PATCH] arm64: dts: npmc8xx: move the clk handler node to the reset
node

Add clk handler node to the reset node and removing the clock node
driver since the reset driver is register the NPCM8xx clock controller
aux device.

We will contribute to lf-openbmc upstream for reviewing.

Signed-off-by: Tomer Maimon <[email protected]>
---
arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
index 92e3b0fe746f..01daf0615ccc 100644
--- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
@@ -47,18 +47,13 @@ ahb {
interrupt-parent = <&gic>;
ranges;

- rstc: reset-controller@f0801000 {
+ clk: rstc: reset-controller@f0801000 {
compatible = "nuvoton,npcm845-reset";
reg = <0x0 0xf0801000 0x0 0x78>;
#reset-cells = <2>;
nuvoton,sysgcr = <&gcr>;
clocks = <&refclk>;
- };
-
- clk: clock-controller@f0801000 {
- compatible = "nuvoton,npcm845-clk";
#clock-cells = <1>;
- reg = <0x0 0xf0801000 0x0 0x1000>;
};

apb {
--
2.34.1

Loading

0 comments on commit ee37726

Please sign in to comment.