[PATCH] arm64: versal-net: Add support for SPP production version

Production version restarting platform version field from 0 that's why add new calculation to be able to use different DT for these platforms. Requested DT names for production silicons for IPP/SPP and EMU platform are versal-net-ipp-rev2.0.dts and versal-net-emu-rev2.0.dts. If platform version increase numbers revision can be even higher. As of today platform version is 2 that's why expected is rev2.2.
Signed-off-by: Michal Simek michal.simek@amd.com ---
.../mach-versal-net/include/mach/hardware.h | 1 + board/xilinx/versal-net/board.c | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-versal-net/include/mach/hardware.h b/arch/arm/mach-versal-net/include/mach/hardware.h index c5e4e22040e2..3de9d439bc5c 100644 --- a/arch/arm/mach-versal-net/include/mach/hardware.h +++ b/arch/arm/mach-versal-net/include/mach/hardware.h @@ -44,6 +44,7 @@ struct iou_scntrs_regs { #define PMC_TAP_VERSION (PMC_TAP + 0x4) # define PMC_VERSION_MASK GENMASK(7, 0) # define PS_VERSION_MASK GENMASK(15, 8) +# define PS_VERSION_PRODUCTION 0x20 # define RTL_VERSION_MASK GENMASK(23, 16) # define PLATFORM_MASK GENMASK(27, 24) # define PLATFORM_VERSION_MASK GENMASK(31, 28) diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c index 6724c7290f8e..0e1321734f32 100644 --- a/board/xilinx/versal-net/board.c +++ b/board/xilinx/versal-net/board.c @@ -74,32 +74,45 @@ char *soc_name_decode(void)
bool soc_detection(void) { - u32 version; + u32 version, ps_version;
version = readl(PMC_TAP_VERSION); platform_id = FIELD_GET(PLATFORM_MASK, version); + ps_version = FIELD_GET(PS_VERSION_MASK, version);
debug("idcode %x, version %x, usercode %x\n", readl(PMC_TAP_IDCODE), version, readl(PMC_TAP_USERCODE));
- debug("pmc_ver %lx, ps version %lx, rtl version %lx\n", + debug("pmc_ver %lx, ps version %x, rtl version %lx\n", FIELD_GET(PMC_VERSION_MASK, version), - FIELD_GET(PS_VERSION_MASK, version), + ps_version, FIELD_GET(RTL_VERSION_MASK, version));
platform_version = FIELD_GET(PLATFORM_VERSION_MASK, version);
if (platform_id == VERSAL_NET_SPP || platform_id == VERSAL_NET_EMU) { - /* - * 9 is diff for - * 0 means 0.9 version - * 1 means 1.0 version - * 2 means 1.1 version - * etc, - */ - platform_version += 9; + if (ps_version == PS_VERSION_PRODUCTION) { + /* + * ES1 version ends at 1.9 version where there was +9 + * used because of IPP/SPP conversion. Production + * version have platform_version started from 0 again + * that's why adding +20 to continue with the same line. + * It means the last ES1 version ends at 1.9 version and + * new PRODUCTION line starts at 2.0. + */ + platform_version += 20; + } else { + /* + * 9 is diff for + * 0 means 0.9 version + * 1 means 1.0 version + * 2 means 1.1 version + * etc, + */ + platform_version += 9; + } }
debug("Platform id: %d version: %d.%d\n", platform_id,

On 5/17/23 10:21, Michal Simek wrote:
Production version restarting platform version field from 0 that's why add new calculation to be able to use different DT for these platforms. Requested DT names for production silicons for IPP/SPP and EMU platform are versal-net-ipp-rev2.0.dts and versal-net-emu-rev2.0.dts. If platform version increase numbers revision can be even higher. As of today platform version is 2 that's why expected is rev2.2.
Signed-off-by: Michal Simek michal.simek@amd.com
.../mach-versal-net/include/mach/hardware.h | 1 + board/xilinx/versal-net/board.c | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-versal-net/include/mach/hardware.h b/arch/arm/mach-versal-net/include/mach/hardware.h index c5e4e22040e2..3de9d439bc5c 100644 --- a/arch/arm/mach-versal-net/include/mach/hardware.h +++ b/arch/arm/mach-versal-net/include/mach/hardware.h @@ -44,6 +44,7 @@ struct iou_scntrs_regs { #define PMC_TAP_VERSION (PMC_TAP + 0x4) # define PMC_VERSION_MASK GENMASK(7, 0) # define PS_VERSION_MASK GENMASK(15, 8) +# define PS_VERSION_PRODUCTION 0x20 # define RTL_VERSION_MASK GENMASK(23, 16) # define PLATFORM_MASK GENMASK(27, 24) # define PLATFORM_VERSION_MASK GENMASK(31, 28) diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c index 6724c7290f8e..0e1321734f32 100644 --- a/board/xilinx/versal-net/board.c +++ b/board/xilinx/versal-net/board.c @@ -74,32 +74,45 @@ char *soc_name_decode(void)
bool soc_detection(void) {
- u32 version;
u32 version, ps_version;
version = readl(PMC_TAP_VERSION); platform_id = FIELD_GET(PLATFORM_MASK, version);
ps_version = FIELD_GET(PS_VERSION_MASK, version);
debug("idcode %x, version %x, usercode %x\n", readl(PMC_TAP_IDCODE), version, readl(PMC_TAP_USERCODE));
- debug("pmc_ver %lx, ps version %lx, rtl version %lx\n",
- debug("pmc_ver %lx, ps version %x, rtl version %lx\n", FIELD_GET(PMC_VERSION_MASK, version),
FIELD_GET(PS_VERSION_MASK, version),
ps_version, FIELD_GET(RTL_VERSION_MASK, version));
platform_version = FIELD_GET(PLATFORM_VERSION_MASK, version);
if (platform_id == VERSAL_NET_SPP || platform_id == VERSAL_NET_EMU) {
/*
* 9 is diff for
* 0 means 0.9 version
* 1 means 1.0 version
* 2 means 1.1 version
* etc,
*/
platform_version += 9;
if (ps_version == PS_VERSION_PRODUCTION) {
/*
* ES1 version ends at 1.9 version where there was +9
* used because of IPP/SPP conversion. Production
* version have platform_version started from 0 again
* that's why adding +20 to continue with the same line.
* It means the last ES1 version ends at 1.9 version and
* new PRODUCTION line starts at 2.0.
*/
platform_version += 20;
} else {
/*
* 9 is diff for
* 0 means 0.9 version
* 1 means 1.0 version
* 2 means 1.1 version
* etc,
*/
platform_version += 9;
}
}
debug("Platform id: %d version: %d.%d\n", platform_id,
Applied. M
participants (1)
-
Michal Simek