CSS: Remove the constants MHU_SECURE_BASE/SIZE
authorSandrine Bailleux <sandrine.bailleux@arm.com>
Tue, 9 Jun 2015 10:53:33 +0000 (11:53 +0100)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Tue, 9 Jun 2015 12:03:45 +0000 (13:03 +0100)
For CSS based platforms, the constants MHU_SECURE_BASE and
MHU_SECURE_SIZE used to define the extents of the Trusted Mailboxes.
As such, they were misnamed because the mailboxes are completely
unrelated to the MHU hardware.

This patch removes the MHU_SECURE_BASE and MHU_SECURE_SIZE #defines.
The address of the Trusted Mailboxes is now relative to the base of
the Trusted SRAM.

This patch also introduces a new constant, SCP_COM_SHARED_MEM_BASE,
which is the address of the first memory region used for communication
between AP and SCP. This is used by the BOM and SCPI protocols.

Change-Id: Ib200f057b19816bf05e834d111271c3ea777291f

include/plat/arm/css/common/css_def.h
plat/arm/css/common/css_scp_bootloader.c
plat/arm/css/common/css_scpi.c

index 12e7541337a5e2ffbc53f4078e594c92ef4a7840..268438ff69404a86a5790ebff9f70a64a534d06e 100644 (file)
 /*************************************************************************
  * Definitions common to all ARM Compute SubSystems (CSS)
  *************************************************************************/
-#define MHU_SECURE_BASE                        ARM_SHARED_RAM_BASE
-#define MHU_SECURE_SIZE                        ARM_SHARED_RAM_SIZE
 #define MHU_PAYLOAD_CACHED             0
 
-#define TRUSTED_MAILBOXES_BASE         MHU_SECURE_BASE
+#define TRUSTED_MAILBOXES_BASE         ARM_TRUSTED_SRAM_BASE
 #define TRUSTED_MAILBOX_SHIFT          4
 
 #define NSROM_BASE                     0x1f000000
 #define PRIMARY_CPU_SHIFT              8
 #define PRIMARY_CPU_BIT_WIDTH          4
 
+/*
+ * Base address of the first memory region used for communication between AP
+ * and SCP. Used by the BOM and SCPI protocols.
+ *
+ * Note that this is located at the same address as SCP_BOOT_CFG_ADDR, which
+ * means the SCP/AP configuration data gets overwritten when the AP initiates
+ * communication with the SCP.
+ */
+#define SCP_COM_SHARED_MEM_BASE                (ARM_TRUSTED_SRAM_BASE + 0x80)
 
 #define CSS_MAP_DEVICE                 MAP_REGION_FLAT(                \
                                                CSS_DEVICE_BASE,        \
index 6cf1667c3e818d4054941a105aa2b3eed0b7c4a4..acc7351ce728d45b0d530794b0da920563619ba0 100644 (file)
@@ -60,7 +60,7 @@ typedef struct {
  * Unlike the SCPI protocol, the boot protocol uses the same memory region
  * for both AP -> SCP and SCP -> AP transfers; define the address of this...
  */
-#define BOM_SHARED_MEM         (MHU_SECURE_BASE + 0x0080)
+#define BOM_SHARED_MEM         SCP_COM_SHARED_MEM_BASE
 #define BOM_CMD_HEADER         ((bom_cmd_t *) BOM_SHARED_MEM)
 #define BOM_CMD_PAYLOAD                ((void *) (BOM_SHARED_MEM + sizeof(bom_cmd_t)))
 
@@ -181,7 +181,7 @@ int scp_bootloader_transfer(void *image, unsigned int image_size)
 
        BOM_CMD_HEADER->id = BOOT_CMD_DATA;
        cmd_data_payload = BOM_CMD_PAYLOAD;
-       cmd_data_payload->offset = (uintptr_t) image - MHU_SECURE_BASE;
+       cmd_data_payload->offset = (uintptr_t) image - ARM_TRUSTED_SRAM_BASE;
        cmd_data_payload->block_size = image_size;
 
        scp_boot_message_send(sizeof(*cmd_data_payload));
index 9127259042b10fe7fec8024e76aae2d85c6fac5c..0a4eafe0cb546bc7010557f07c766fb4db5eb92a 100644 (file)
@@ -37,8 +37,8 @@
 #include "css_mhu.h"
 #include "css_scpi.h"
 
-#define SCPI_SHARED_MEM_SCP_TO_AP      (MHU_SECURE_BASE + 0x0080)
-#define SCPI_SHARED_MEM_AP_TO_SCP      (MHU_SECURE_BASE + 0x0180)
+#define SCPI_SHARED_MEM_SCP_TO_AP      SCP_COM_SHARED_MEM_BASE
+#define SCPI_SHARED_MEM_AP_TO_SCP      (SCP_COM_SHARED_MEM_BASE + 0x100)
 
 #define SCPI_CMD_HEADER_AP_TO_SCP              \
        ((scpi_cmd_t *) SCPI_SHARED_MEM_AP_TO_SCP)