From 6127767ae5416a453bf4e501e4737baca9c0d30c Mon Sep 17 00:00:00 2001 From: Madhukar Pappireddy Date: Fri, 11 Mar 2022 20:49:20 +0100 Subject: [PATCH 1/3] Revert "feat(sgi): add page table translation entry for secure uart" Revert submission 14286-uart_segregation Reason for revert: Need to wait for companion patches in CI and UEFI/Linux to be upstreamed. Reverted Changes: I8574b31d5:feat(sgi): add page table translation entry for se... I8896ae05e:feat(sgi): route TF-A logs via secure uart I39170848e:feat(sgi): deviate from arm css common uart relate... Change-Id: I9bec02496f826e184c6efa643f869b2eb3b52539 --- .../css/sgi/include/sgi_base_platform_def.h | 18 ++---------------- plat/arm/css/sgi/sgi_plat.c | 3 +-- plat/arm/css/sgi/sgi_plat_v2.c | 3 +-- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/plat/arm/css/sgi/include/sgi_base_platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h index 93609b9e4..9c3beb5b3 100644 --- a/plat/arm/css/sgi/include/sgi_base_platform_def.h +++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h @@ -35,8 +35,8 @@ # if SPM_MM # define PLAT_ARM_MMAP_ENTRIES (9 + ((CSS_SGI_CHIP_COUNT - 1) * 3)) # define MAX_XLAT_TABLES (7 + ((CSS_SGI_CHIP_COUNT - 1) * 3)) -# define PLAT_SP_IMAGE_MMAP_REGIONS 10 -# define PLAT_SP_IMAGE_MAX_XLAT_TABLES 12 +# define PLAT_SP_IMAGE_MMAP_REGIONS 9 +# define PLAT_SP_IMAGE_MAX_XLAT_TABLES 11 # else # define PLAT_ARM_MMAP_ENTRIES (5 + ((CSS_SGI_CHIP_COUNT - 1) * 3)) # define MAX_XLAT_TABLES (6 + ((CSS_SGI_CHIP_COUNT - 1) * 3)) @@ -273,18 +273,4 @@ CSS_SGI_REMOTE_CHIP_MEM_OFFSET(n) + ARM_DRAM2_END, \ ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS} -#if SPM_MM - -/* - * Stand-alone MM logs would be routed via secure UART. Define page table - * entry for secure UART which would be common to all platforms. - */ -#define SOC_PLATFORM_SECURE_UART MAP_REGION_FLAT( \ - SOC_CSS_SEC_UART_BASE, \ - SOC_CSS_UART_SIZE, \ - MT_DEVICE | MT_RW | \ - MT_SECURE | MT_USER) - -#endif - #endif /* SGI_BASE_PLATFORM_DEF_H */ diff --git a/plat/arm/css/sgi/sgi_plat.c b/plat/arm/css/sgi/sgi_plat.c index a0199c348..20c52e9c5 100644 --- a/plat/arm/css/sgi/sgi_plat.c +++ b/plat/arm/css/sgi/sgi_plat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -89,7 +89,6 @@ const mmap_region_t plat_arm_mmap[] = { const mmap_region_t plat_arm_secure_partition_mmap[] = { PLAT_ARM_SECURE_MAP_SYSTEMREG, PLAT_ARM_SECURE_MAP_NOR2, - SOC_PLATFORM_SECURE_UART, PLAT_ARM_SECURE_MAP_DEVICE, ARM_SP_IMAGE_MMAP, ARM_SP_IMAGE_NS_BUF_MMAP, diff --git a/plat/arm/css/sgi/sgi_plat_v2.c b/plat/arm/css/sgi/sgi_plat_v2.c index cef5345cd..1a2a96629 100644 --- a/plat/arm/css/sgi/sgi_plat_v2.c +++ b/plat/arm/css/sgi/sgi_plat_v2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -83,7 +83,6 @@ const mmap_region_t plat_arm_mmap[] = { const mmap_region_t plat_arm_secure_partition_mmap[] = { PLAT_ARM_SECURE_MAP_SYSTEMREG, PLAT_ARM_SECURE_MAP_NOR2, - SOC_PLATFORM_SECURE_UART, SOC_PLATFORM_PERIPH_MAP_DEVICE_USER, ARM_SP_IMAGE_MMAP, ARM_SP_IMAGE_NS_BUF_MMAP, From 162f7923f1a57646c86d4ba6ec41dab4837bc5eb Mon Sep 17 00:00:00 2001 From: Madhukar Pappireddy Date: Fri, 11 Mar 2022 20:49:20 +0100 Subject: [PATCH 2/3] Revert "feat(sgi): route TF-A logs via secure uart" Revert submission 14286-uart_segregation Reason for revert: Need to wait for companion patches in CI and UEFI/Linux to be upstreamed. Reverted Changes: I8574b31d5:feat(sgi): add page table translation entry for se... I8896ae05e:feat(sgi): route TF-A logs via secure uart I39170848e:feat(sgi): deviate from arm css common uart relate... Change-Id: I7c488aed9fcb70c55686d705431b3fe017b8927d --- .../css/sgi/include/sgi_base_platform_def.h | 17 +------------- plat/arm/css/sgi/include/sgi_soc_css_def.h | 10 +++++++++ plat/arm/css/sgi/include/sgi_soc_css_def_v2.h | 22 ++++++++++++++++++- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/plat/arm/css/sgi/include/sgi_base_platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h index 9c3beb5b3..c9c8c0463 100644 --- a/plat/arm/css/sgi/include/sgi_base_platform_def.h +++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -130,21 +130,6 @@ # define PLATFORM_STACK_SIZE 0x440 #endif -/* PL011 UART related constants */ -#define SOC_CSS_SEC_UART_BASE UL(0x2A410000) -#define SOC_CSS_NSEC_UART_BASE UL(0x2A400000) -#define SOC_CSS_UART_SIZE UL(0x10000) -#define SOC_CSS_UART_CLK_IN_HZ UL(7372800) - -/* UART related constants */ -#define PLAT_ARM_BOOT_UART_BASE SOC_CSS_SEC_UART_BASE -#define PLAT_ARM_BOOT_UART_CLK_IN_HZ SOC_CSS_UART_CLK_IN_HZ - -#define PLAT_ARM_RUN_UART_BASE SOC_CSS_SEC_UART_BASE -#define PLAT_ARM_RUN_UART_CLK_IN_HZ SOC_CSS_UART_CLK_IN_HZ - -#define PLAT_ARM_CRASH_UART_BASE SOC_CSS_SEC_UART_BASE -#define PLAT_ARM_CRASH_UART_CLK_IN_HZ SOC_CSS_UART_CLK_IN_HZ #define PLAT_ARM_NSTIMER_FRAME_ID 0 diff --git a/plat/arm/css/sgi/include/sgi_soc_css_def.h b/plat/arm/css/sgi/include/sgi_soc_css_def.h index f78b45a28..8d3d1b99e 100644 --- a/plat/arm/css/sgi/include/sgi_soc_css_def.h +++ b/plat/arm/css/sgi/include/sgi_soc_css_def.h @@ -44,4 +44,14 @@ #define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE #define PLAT_ARM_NVM_SIZE (V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) +/* UART related constants */ +#define PLAT_ARM_BOOT_UART_BASE SOC_CSS_UART0_BASE +#define PLAT_ARM_BOOT_UART_CLK_IN_HZ SOC_CSS_UART0_CLK_IN_HZ + +#define PLAT_ARM_RUN_UART_BASE SOC_CSS_UART1_BASE +#define PLAT_ARM_RUN_UART_CLK_IN_HZ SOC_CSS_UART1_CLK_IN_HZ + +#define PLAT_ARM_CRASH_UART_BASE PLAT_ARM_RUN_UART_BASE +#define PLAT_ARM_CRASH_UART_CLK_IN_HZ PLAT_ARM_RUN_UART_CLK_IN_HZ + #endif /* SGI_SOC_CSS_DEF_H */ diff --git a/plat/arm/css/sgi/include/sgi_soc_css_def_v2.h b/plat/arm/css/sgi/include/sgi_soc_css_def_v2.h index acf31ebba..639b687f1 100644 --- a/plat/arm/css/sgi/include/sgi_soc_css_def_v2.h +++ b/plat/arm/css/sgi/include/sgi_soc_css_def_v2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -24,10 +24,17 @@ #define SOC_CSS_PCIE_CONTROL_BASE UL(0x0ef20000) +/* PL011 UART related constants */ +#define SOC_CSS_UART1_BASE UL(0x0ef80000) +#define SOC_CSS_UART0_BASE UL(0x0ef70000) + /* Memory controller */ #define SOC_MEMCNTRL_BASE UL(0x10000000) #define SOC_MEMCNTRL_SIZE UL(0x10000000) +#define SOC_CSS_UART0_CLK_IN_HZ UL(7372800) +#define SOC_CSS_UART1_CLK_IN_HZ UL(7372800) + /* SoC NIC-400 Global Programmers View (GPV) */ #define SOC_CSS_NIC400_BASE UL(0x0ED00000) @@ -199,4 +206,17 @@ #define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE #define PLAT_ARM_NVM_SIZE (V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) +/* UART related constants */ +#define PLAT_ARM_BOOT_UART_BASE SOC_CSS_UART0_BASE +#define PLAT_ARM_BOOT_UART_CLK_IN_HZ SOC_CSS_UART0_CLK_IN_HZ + +#define PLAT_ARM_RUN_UART_BASE SOC_CSS_UART1_BASE +#define PLAT_ARM_RUN_UART_CLK_IN_HZ SOC_CSS_UART1_CLK_IN_HZ + +#define PLAT_ARM_SP_MIN_RUN_UART_BASE SOC_CSS_UART1_BASE +#define PLAT_ARM_SP_MIN_RUN_UART_CLK_IN_HZ SOC_CSS_UART1_CLK_IN_HZ + +#define PLAT_ARM_CRASH_UART_BASE PLAT_ARM_RUN_UART_BASE +#define PLAT_ARM_CRASH_UART_CLK_IN_HZ PLAT_ARM_RUN_UART_CLK_IN_HZ + #endif /* SGI_SOC_CSS_DEF_V2_H */ From 64e04687d3b04e98c1f988d7fe77025c6dad2dfe Mon Sep 17 00:00:00 2001 From: Madhukar Pappireddy Date: Fri, 11 Mar 2022 20:49:20 +0100 Subject: [PATCH 3/3] Revert "feat(sgi): deviate from arm css common uart related defi..." Revert submission 14286-uart_segregation Reason for revert: Need to wait for companion patches in CI and UEFI/Linux to be upstreamed. Reverted Changes: I8574b31d5:feat(sgi): add page table translation entry for se... I8896ae05e:feat(sgi): route TF-A logs via secure uart I39170848e:feat(sgi): deviate from arm css common uart relate... Change-Id: I28a370dd8b3a37087da621460eccc1acd7a30287 --- plat/arm/css/sgi/include/sgi_soc_css_def.h | 57 ------------------- .../css/sgi/include/sgi_soc_platform_def.h | 6 +- 2 files changed, 3 insertions(+), 60 deletions(-) delete mode 100644 plat/arm/css/sgi/include/sgi_soc_css_def.h diff --git a/plat/arm/css/sgi/include/sgi_soc_css_def.h b/plat/arm/css/sgi/include/sgi_soc_css_def.h deleted file mode 100644 index 8d3d1b99e..000000000 --- a/plat/arm/css/sgi/include/sgi_soc_css_def.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef SGI_SOC_CSS_DEF_H -#define SGI_SOC_CSS_DEF_H - -#include -#include -#include -#include - -/* - * Definitions common to all ARM CSSv1-based development platforms - */ - -/* Platform ID address */ -#define BOARD_CSS_PLAT_ID_REG_ADDR UL(0x7ffe00e0) - -/* Platform ID related accessors */ -#define BOARD_CSS_PLAT_ID_REG_ID_MASK 0x0f -#define BOARD_CSS_PLAT_ID_REG_ID_SHIFT 0x0 -#define BOARD_CSS_PLAT_TYPE_EMULATOR 0x02 - -#ifndef __ASSEMBLER__ - -#include - -#define BOARD_CSS_GET_PLAT_TYPE(addr) \ - ((mmio_read_32(addr) & BOARD_CSS_PLAT_ID_REG_ID_MASK) \ - >> BOARD_CSS_PLAT_ID_REG_ID_SHIFT) - -#endif /* __ASSEMBLER__ */ - -#define MAX_IO_DEVICES 3 -#define MAX_IO_HANDLES 4 - -/* Reserve the last block of flash for PSCI MEM PROTECT flag */ -#define PLAT_ARM_FLASH_IMAGE_BASE V2M_FLASH0_BASE -#define PLAT_ARM_FLASH_IMAGE_MAX_SIZE (V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) - -#define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE -#define PLAT_ARM_NVM_SIZE (V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) - -/* UART related constants */ -#define PLAT_ARM_BOOT_UART_BASE SOC_CSS_UART0_BASE -#define PLAT_ARM_BOOT_UART_CLK_IN_HZ SOC_CSS_UART0_CLK_IN_HZ - -#define PLAT_ARM_RUN_UART_BASE SOC_CSS_UART1_BASE -#define PLAT_ARM_RUN_UART_CLK_IN_HZ SOC_CSS_UART1_CLK_IN_HZ - -#define PLAT_ARM_CRASH_UART_BASE PLAT_ARM_RUN_UART_BASE -#define PLAT_ARM_CRASH_UART_CLK_IN_HZ PLAT_ARM_RUN_UART_CLK_IN_HZ - -#endif /* SGI_SOC_CSS_DEF_H */ diff --git a/plat/arm/css/sgi/include/sgi_soc_platform_def.h b/plat/arm/css/sgi/include/sgi_soc_platform_def.h index 3b8d9c664..405d62f12 100644 --- a/plat/arm/css/sgi/include/sgi_soc_platform_def.h +++ b/plat/arm/css/sgi/include/sgi_soc_platform_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2020-2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,10 +7,10 @@ #ifndef SGI_SOC_PLATFORM_DEF_H #define SGI_SOC_PLATFORM_DEF_H +#include +#include #include #include -#include -#include /* Map the System registers to access from S-EL0 */ #define CSS_SYSTEMREG_DEVICE_BASE (0x1C010000)