aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJorge Ramirez-Ortiz <jramirez@baylibre.com>2018-09-23 09:36:13 +0200
committerldts <jorge.ramirez.ortiz@gmail.com>2018-10-17 18:38:33 +0200
commit7e532c4bf7229f0771cae95b2572f7cb5103a4ae (patch)
tree6a7585b10f3152c9859e579e25ec1136b1b6efff /tools
parent0a09313ec780d2f66efcda3eb2a5d1632719bd81 (diff)
downloadtrusted-firmware-a-7e532c4bf7229f0771cae95b2572f7cb5103a4ae.tar.gz
rcar-gen3: initial commit for the rcar-gen3 boards
Reference code: ============== rar_gen3: IPL and Secure Monitor Rev1.0.22 https://github.com/renesas-rcar/arm-trusted-firmware [rcar_gen3] Author: Takuya Sakata <takuya.sakata.wz@bp.renesas.com> Date: Thu Aug 30 21:26:41 2018 +0900 Update IPL and Secure Monitor Rev1.0.22 General Information: =================== This port has been tested on the Salvator-X Soc_id r8a7795 revision ES1.1 (uses an SPD). Build Tested: ------------- ATFW_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1" MBEDTLS_DIR=$mbedtls $ make clean bl2 bl31 rcar PLAT=rcar ${ATFW_OPT} SPD=opteed Other dependencies: ------------------ * mbed_tls: git@github.com:ARMmbed/mbedtls.git [devel] Merge: 68dbc94 f34a4c1 Author: Simon Butcher <simon.butcher@arm.com> Date: Thu Aug 30 00:57:28 2018 +0100 * optee_os: https://github.com/BayLibre/optee_os Until it gets merged into OP-TEE, the port requires Renesas' Trusted Environment with a modification to support power management. Author: Jorge Ramirez-Ortiz <jramirez@baylibre.com> Date: Thu Aug 30 16:49:49 2018 +0200 plat-rcar: cpu-suspend: handle the power level Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com> * u-boot: The port has beent tested using mainline uboot. Author: Fabio Estevam <festevam@gmail.com> Date: Tue Sep 4 10:23:12 2018 -0300 *linux: The port has beent tested using mainline kernel. Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Sep 16 11:52:37 2018 -0700 Linux 4.19-rc4 Overview --------- BOOTROM starts the cpu at EL3; In this port BL2 will therefore be entered at this exception level (the Renesas' ATF reference tree [1] resets into EL1 before entering BL2 - see its bl2.ld.S) BL2 initializes DDR (and i2c to talk to the PMIC on some platforms) before determining the boot reason (cold or warm). During suspend all CPUs are switched off and the DDR is put in backup mode (some kind of self-refresh mode). This means that BL2 is always entered in a cold boot scenario. Once BL2 boots, it determines the boot reason, writes it to shared memory (BOOT_KIND_BASE) together with the BL31 parameters (PARAMS_BASE) and jumps to BL31. To all effects, BL31 is as if it is being entered in reset mode since it still needs to initialize the rest of the cores; this is the reason behind using direct shared memory access to BOOT_KIND_BASE and PARAMS_BASE instead of using registers to get to those locations (see el3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use case). Depending on the boot reason BL31 initializes the rest of the cores: in case of suspend, it uses a MBOX memory region to recover the program counters. [1] https://github.com/renesas-rcar/arm-trusted-firmware Tests ----- * cpuidle ------- enable kernel's cpuidle arm_idle driver and boot * system suspend -------------- $ cat suspend.sh #!/bin/bash i2cset -f -y 7 0x30 0x20 0x0F read -p "Switch off SW23 and press return " foo echo mem > /sys/power/state * cpu hotplug: ------------ $ cat offline.sh #!/bin/bash nbr=$1 echo 0 > /sys/devices/system/cpu/cpu$nbr/online printf "ONLINE: " && cat /sys/devices/system/cpu/online printf "OFFLINE: " && cat /sys/devices/system/cpu/offline $ cat online.sh #!/bin/bash nbr=$1 echo 1 > /sys/devices/system/cpu/cpu$nbr/online printf "ONLINE: " && cat /sys/devices/system/cpu/online printf "OFFLINE: " && cat /sys/devices/system/cpu/offline Signed-off-by: ldts <jramirez@baylibre.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/renesas/rcar_layout_create/makefile112
-rw-r--r--tools/renesas/rcar_layout_create/sa0.c30
-rw-r--r--tools/renesas/rcar_layout_create/sa0.ld.S28
-rw-r--r--tools/renesas/rcar_layout_create/sa6.c185
-rw-r--r--tools/renesas/rcar_layout_create/sa6.ld.S114
5 files changed, 469 insertions, 0 deletions
diff --git a/tools/renesas/rcar_layout_create/makefile b/tools/renesas/rcar_layout_create/makefile
new file mode 100644
index 0000000000..b3af401c5d
--- /dev/null
+++ b/tools/renesas/rcar_layout_create/makefile
@@ -0,0 +1,112 @@
+#
+# Copyright (c) 2015-2018, Renesas Electronics Corporation. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+###################################################
+# makefile
+###################################################
+
+#output file name
+FILE_NAME_SA0 = bootparam_sa0
+FILE_NAME_SA6 = cert_header_sa6
+
+OUTPUT_FILE_SA0 = $(FILE_NAME_SA0).elf
+OUTPUT_FILE_SA6 = $(FILE_NAME_SA6).elf
+
+#object file name
+OBJ_FILE_SA0 = sa0.o
+OBJ_FILE_SA6 = sa6.o
+
+#linker script name
+MEMORY_DEF_SA0 = sa0.ld.S
+MEMORY_DEF_SA6 = sa6.ld.S
+
+###################################################
+# Convenience function for adding build definitions
+# $(eval $(call add_define,FOO)) will have:
+# -DFOO if $(FOO) is empty; -DFOO=$(FOO) otherwise
+define add_define
+DEFINES += -D$(1)$(if $(value $(1)),=$(value $(1)),)
+endef
+
+# Process RCAR_SA0_SIZE flag
+ifndef RCAR_SA0_SIZE
+RCAR_SA0_SIZE := 1
+else
+ifeq (${RCAR_SA0_SIZE},0)
+RCAR_SA0_SIZE := 0
+else
+RCAR_SA0_SIZE := 1
+endif
+endif
+$(eval $(call add_define,RCAR_SA0_SIZE))
+
+# Process RCAR_SA6_TYPE flag
+ifndef RCAR_SA6_TYPE
+RCAR_SA6_TYPE := 0
+else
+ifeq (${RCAR_SA6_TYPE},0)
+RCAR_SA6_TYPE := 0
+else
+RCAR_SA6_TYPE := 1
+endif
+endif
+$(eval $(call add_define,RCAR_SA6_TYPE))
+
+###################################################
+
+#c compiler
+CC = $(CROSS_COMPILE)gcc
+CFLAGS += ${DEFINES}
+CFLAGS += -I../../include/lib/stdlib
+
+#Linker
+LD = $(CROSS_COMPILE)ld
+
+#objcopy
+objcopy = $(CROSS_COMPILE)objcopy
+
+#clean
+CL = rm -f
+
+###################################################
+.SUFFIXES : .s .c .o
+
+###################################################
+# command
+
+.PHONY: all
+all: $(OUTPUT_FILE_SA0) $(OUTPUT_FILE_SA6)
+###################################################
+# Linker
+###################################################
+$(OUTPUT_FILE_SA0) : $(MEMORY_DEF_SA0) $(OBJ_FILE_SA0)
+ $(LD) $(OBJ_FILE_SA0) \
+ -T $(MEMORY_DEF_SA0) \
+ -o $(OUTPUT_FILE_SA0) \
+ -Map $(FILE_NAME_SA0).map \
+
+ $(objcopy) -O srec --adjust-vma=0xE6320000 --srec-forceS3 $(OUTPUT_FILE_SA0) $(FILE_NAME_SA0).srec
+ $(objcopy) -O binary --adjust-vma=0xE6320000 --srec-forceS3 $(OUTPUT_FILE_SA0) $(FILE_NAME_SA0).bin
+
+$(OUTPUT_FILE_SA6) : $(MEMORY_DEF_SA6) $(OBJ_FILE_SA6)
+ $(LD) $(OBJ_FILE_SA6) \
+ -T $(MEMORY_DEF_SA6) \
+ -o $(OUTPUT_FILE_SA6) \
+ -Map $(FILE_NAME_SA6).map \
+
+ $(objcopy) -O srec --adjust-vma=0xE6320000 --srec-forceS3 $(OUTPUT_FILE_SA6) $(FILE_NAME_SA6).srec
+ $(objcopy) -O binary --adjust-vma=0xE6320000 --srec-forceS3 $(OUTPUT_FILE_SA6) $(FILE_NAME_SA6).bin
+
+###################################################
+# Compile
+###################################################
+
+%.o:../%.c
+ $(CC) -c -I $< -o $@
+
+.PHONY: clean
+clean:
+ $(CL) *.bin *.map *.srec *.elf *.o
diff --git a/tools/renesas/rcar_layout_create/sa0.c b/tools/renesas/rcar_layout_create/sa0.c
new file mode 100644
index 0000000000..b902d3373a
--- /dev/null
+++ b/tools/renesas/rcar_layout_create/sa0.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015-2018, Renesas Electronics Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#define RCAR_SA0_SIZE_SMALL (0) /* for E3 */
+#define RCAR_SA0_SIZE_NORMAL (1) /* for H3/M3/M3N */
+
+#define BL2_ADDRESS (0xE6304000) /* BL2 start address */
+
+#if (RCAR_SA0_SIZE == RCAR_SA0_SIZE_SMALL)
+#define BL2_SIZE (80*1024/4) /* BL2 size is 80KB(0x00005000) */
+#else /* (RCAR_SA0_SIZE == RCAR_SA0_SIZE_SMALL) */
+#define BL2_SIZE (170*1024/4) /* BL2 size is 170KB(0x0000AA00) */
+#endif /* (RCAR_SA0_SIZE == RCAR_SA0_SIZE_SMALL) */
+
+/* SA0 */
+/* 0x00000000 */
+const unsigned int __attribute__ ((section (".sa0_bootrom"))) bootrom_paramA = 0x00000100;
+/* 0x00000080 (Map Type 3 for eMMC Boot)*/
+/* 0x000001D4 */
+const unsigned int __attribute__ ((section (".sa0_bl2dst_addr3"))) bl2dst_addr3 = BL2_ADDRESS;
+/* 0x000002E4 */
+const unsigned int __attribute__ ((section (".sa0_bl2dst_size3"))) bl2dst_size3 = BL2_SIZE;
+/* 0x00000C00 (Map Type 1 for HyperFlash/QSPI Flash Boot)*/
+/* 0x00000D54 */
+const unsigned int __attribute__ ((section (".sa0_bl2dst_addr1"))) bl2dst_addr1 = BL2_ADDRESS;
+/* 0x00000E64 */
+const unsigned int __attribute__ ((section (".sa0_bl2dst_size1"))) bl2dst_size1 = BL2_SIZE;
diff --git a/tools/renesas/rcar_layout_create/sa0.ld.S b/tools/renesas/rcar_layout_create/sa0.ld.S
new file mode 100644
index 0000000000..98fee23af1
--- /dev/null
+++ b/tools/renesas/rcar_layout_create/sa0.ld.S
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2017, Renesas Electronics Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+SECTIONS
+{
+ . = 0x00000000;
+ .rodata : {
+ KEEP(*(.sa0_bootrom))
+ /* Map Type 3 for eMMC Boot */
+ /* A-side IPL content cert "Start Address" */
+ . = 0x000001D4; /* H'00000080 + H'00000154 */
+ KEEP(*(.sa0_bl2dst_addr3))
+ /* A-side IPL content cert "Size" */
+ . = 0x000002E4; /* H'00000080 + H'00000264 */
+ KEEP(*(.sa0_bl2dst_size3))
+ /* Map Type 1 for HyperFlash/QSPI Flash Boot */
+ /* A-side IPL content cert "Start Address" */
+ . = 0x00000D54; /* H'00000C00 + H'00000154 */
+ KEEP(*(.sa0_bl2dst_addr1))
+ /* A-side IPL content cert "Size" */
+ . = 0x00000E64; /* H'00000C00 + H'00000264 */
+ KEEP(*(.sa0_bl2dst_size1))
+ }
+
+}
diff --git a/tools/renesas/rcar_layout_create/sa6.c b/tools/renesas/rcar_layout_create/sa6.c
new file mode 100644
index 0000000000..fa828b9ac2
--- /dev/null
+++ b/tools/renesas/rcar_layout_create/sa6.c
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2015-2017, Renesas Electronics Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdint.h>
+
+#define RCAR_SA6_TYPE_HYPERFLASH (0)
+#define RCAR_SA6_TYPE_EMMC (1)
+
+#if (RCAR_SA6_TYPE == RCAR_SA6_TYPE_HYPERFLASH)
+
+/* Number of content cert for Non-secure Target Program(BL33x) */
+#define RCAR_IMAGE_NUM (0x00000001U)
+/* Source address on flash for BL31 */
+#define RCAR_BL31SRC_ADDRESS (0x001C0000U)
+/* Reserved */
+#define RCAR_BL31_PARTITION (0x00000000U)
+/* Source address on flash for BL32 */
+#define RCAR_BL32SRC_ADDRESS (0x00200000U)
+/* Reserved */
+#define RCAR_BL32_PARTITION (0x00000000U)
+/* Source address on flash for BL33 */
+#define RCAR_BL33SRC_ADDRESS (0x00640000U)
+/* Reserved */
+#define RCAR_BL33_PARTITION (0x00000000U)
+#define RCAR_BL332SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL332_PARTITION (0x00000000U)
+#define RCAR_BL333SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL333_PARTITION (0x00000000U)
+#define RCAR_BL334SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL334_PARTITION (0x00000000U)
+#define RCAR_BL335SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL335_PARTITION (0x00000000U)
+#define RCAR_BL336SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL336_PARTITION (0x00000000U)
+#define RCAR_BL337SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL337_PARTITION (0x00000000U)
+#define RCAR_BL338SRC_ADDRESS (0x00000000U)
+/* Reserved */
+#define RCAR_BL338_PARTITION (0x00000000U)
+
+#else /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_HYPERFLASH */
+
+/* Number of content cert for Non-secure Target Program(BL33x) */
+#define RCAR_IMAGE_NUM (0x00000001U)
+/* Source address on eMMC for BL31 */
+#define RCAR_BL31SRC_ADDRESS (0x00040000U)
+/* Source partition on eMMC for BL31 */
+#define RCAR_BL31_PARTITION (0x00000001U)
+/* Source address on eMMC for BL32 */
+#define RCAR_BL32SRC_ADDRESS (0x00200000U)
+/* Source partition on eMMC for BL32 */
+#define RCAR_BL32_PARTITION (0x00000001U)
+/* Source address on eMMC for BL33 */
+#define RCAR_BL33SRC_ADDRESS (0x00000000U)
+/* Source partition on eMMC for BL33 */
+#define RCAR_BL33_PARTITION (0x00000002U)
+/* Reserved */
+#define RCAR_BL332SRC_ADDRESS (0x00000000U)
+#define RCAR_BL332_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL333SRC_ADDRESS (0x00000000U)
+#define RCAR_BL333_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL334SRC_ADDRESS (0x00000000U)
+#define RCAR_BL334_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL335SRC_ADDRESS (0x00000000U)
+#define RCAR_BL335_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL336SRC_ADDRESS (0x00000000U)
+#define RCAR_BL336_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL337SRC_ADDRESS (0x00000000U)
+#define RCAR_BL337_PARTITION (0x00000000U)
+/* Reserved */
+#define RCAR_BL338SRC_ADDRESS (0x00000000U)
+#define RCAR_BL338_PARTITION (0x00000000U)
+
+#endif /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_HYPERFLASH */
+
+/* Destination address for BL31 */
+#define RCAR_BL31DST_ADDRESS (0x44000000U)
+#define RCAR_BL31DST_ADDRESSH (0x00000000U)
+/* Destination size for BL31 */
+#define RCAR_BL31DST_SIZE (0x00004000U)
+/* Destination address for BL32 */
+#define RCAR_BL32DST_ADDRESS (0x44100000U)
+#define RCAR_BL32DST_ADDRESSH (0x00000000U)
+/* Destination size for BL32 */
+#define RCAR_BL32DST_SIZE (0x00040000U)
+/* Destination address for BL33 */
+#define RCAR_BL33DST_ADDRESS (0x50000000U)
+#define RCAR_BL33DST_ADDRESSH (0x00000000U)
+/* Destination size for BL33 */
+#define RCAR_BL33DST_SIZE (0x00040000U)
+/* Reserved */
+#define RCAR_BL332DST_ADDRESS (0x00000000U)
+#define RCAR_BL332DST_ADDRESSH (0x00000000U)
+#define RCAR_BL332DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL333DST_ADDRESS (0x00000000U)
+#define RCAR_BL333DST_ADDRESSH (0x00000000U)
+#define RCAR_BL333DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL334DST_ADDRESS (0x00000000U)
+#define RCAR_BL334DST_ADDRESSH (0x00000000U)
+#define RCAR_BL334DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL335DST_ADDRESS (0x00000000U)
+#define RCAR_BL335DST_ADDRESSH (0x00000000U)
+#define RCAR_BL335DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL336DST_ADDRESS (0x00000000U)
+#define RCAR_BL336DST_ADDRESSH (0x00000000U)
+#define RCAR_BL336DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL337DST_ADDRESS (0x00000000U)
+#define RCAR_BL337DST_ADDRESSH (0x00000000U)
+#define RCAR_BL337DST_SIZE (0x00000000U)
+/* Reserved */
+#define RCAR_BL338DST_ADDRESS (0x00000000U)
+#define RCAR_BL338DST_ADDRESSH (0x00000000U)
+#define RCAR_BL338DST_SIZE (0x00000000U)
+
+/* SA6 */
+const uint64_t __attribute__ ((section (".sa6_image_num"))) image_num = RCAR_IMAGE_NUM;
+const uint64_t __attribute__ ((section (".sa6_bl31src_addr"))) bl31src_addr = RCAR_BL31SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl31partition"))) bl31partition = RCAR_BL31_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl32src_addr"))) bl32src_addr = RCAR_BL32SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl32partition"))) bl32partition = RCAR_BL32_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl33src_addr"))) bl33src_addr = RCAR_BL33SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl33partition"))) bl33partition = RCAR_BL33_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl332src_addr"))) bl332src_addr = RCAR_BL332SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl332partition")))bl332partition = RCAR_BL332_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl333src_addr"))) bl333src_addr = RCAR_BL333SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl333partition")))bl333partition = RCAR_BL333_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl334src_addr"))) bl334src_addr = RCAR_BL334SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl334partition")))bl334partition = RCAR_BL334_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl335src_addr"))) bl335src_addr = RCAR_BL335SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl335partition")))bl335partition = RCAR_BL335_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl336src_addr"))) bl336src_addr = RCAR_BL336SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl336partition")))bl336partition = RCAR_BL336_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl337src_addr"))) bl337src_addr = RCAR_BL337SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl337partition")))bl337partition = RCAR_BL337_PARTITION;
+const uint64_t __attribute__ ((section (".sa6_bl338src_addr"))) bl338src_addr = RCAR_BL338SRC_ADDRESS;
+const uint64_t __attribute__ ((section (".sa6_bl338partition")))bl338partition = RCAR_BL338_PARTITION;
+const uint32_t __attribute__ ((section (".sa6_bl31dst_addr"))) bl31dst_addr = RCAR_BL31DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl31dst_addrh"))) bl31dst_addrh = RCAR_BL31DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl31dst_size"))) bl31dst_size = RCAR_BL31DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl32dst_addr"))) bl32dst_addr = RCAR_BL32DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl32dst_addrh"))) bl32dst_addrh = RCAR_BL32DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl32dst_size"))) bl32dst_size = RCAR_BL32DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl33dst_addr"))) bl33dst_addr = RCAR_BL33DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl33dst_addrh"))) bl33dst_addrh = RCAR_BL33DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl33dst_size"))) bl33dst_size = RCAR_BL33DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl332dst_addr"))) bl332dst_addr = RCAR_BL332DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl332dst_addrh")))bl332dst_addrh = RCAR_BL332DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl332dst_size"))) bl332dst_size = RCAR_BL332DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl333dst_addr"))) bl333dst_addr = RCAR_BL333DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl333dst_addrh")))bl333dst_addrh = RCAR_BL333DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl333dst_size"))) bl333dst_size = RCAR_BL333DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl334dst_addr"))) bl334dst_addr = RCAR_BL334DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl334dst_addrh")))bl334dst_addrh = RCAR_BL334DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl334dst_size"))) bl334dst_size = RCAR_BL334DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl335dst_addr"))) bl335dst_addr = RCAR_BL335DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl335dst_addrh")))bl335dst_addrh = RCAR_BL335DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl335dst_size"))) bl335dst_size = RCAR_BL335DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl336dst_addr"))) bl336dst_addr = RCAR_BL336DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl336dst_addrh")))bl336dst_addrh = RCAR_BL336DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl336dst_size"))) bl336dst_size = RCAR_BL336DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl337dst_addr"))) bl337dst_addr = RCAR_BL337DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl337dst_addrh")))bl337dst_addrh = RCAR_BL337DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl337dst_size"))) bl337dst_size = RCAR_BL337DST_SIZE;
+const uint32_t __attribute__ ((section (".sa6_bl338dst_addr"))) bl338dst_addr = RCAR_BL338DST_ADDRESS;
+const uint32_t __attribute__ ((section (".sa6_bl338dst_addrh")))bl338dst_addrh = RCAR_BL338DST_ADDRESSH;
+const uint32_t __attribute__ ((section (".sa6_bl338dst_size"))) bl338dst_size = RCAR_BL338DST_SIZE;
diff --git a/tools/renesas/rcar_layout_create/sa6.ld.S b/tools/renesas/rcar_layout_create/sa6.ld.S
new file mode 100644
index 0000000000..9ca0c1d084
--- /dev/null
+++ b/tools/renesas/rcar_layout_create/sa6.ld.S
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2015-2017, Renesas Electronics Corporation. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+SECTIONS
+{
+ . = 0x00000000;
+ .rodata : {
+ KEEP(*(.sa6_image_num))
+ . = 0x00000008;
+ KEEP(*(.sa6_bl31src_addr))
+ . = 0x00000010;
+ KEEP(*(.sa6_bl31partition))
+ . = 0x00000018;
+ KEEP(*(.sa6_bl32src_addr))
+ . = 0x00000020;
+ KEEP(*(.sa6_bl32partition))
+ . = 0x00000028;
+ KEEP(*(.sa6_bl33src_addr))
+ . = 0x00000030;
+ KEEP(*(.sa6_bl33partition))
+ . = 0x00000038;
+ KEEP(*(.sa6_bl332src_addr))
+ . = 0x00000040;
+ KEEP(*(.sa6_bl332partition))
+ . = 0x00000048;
+ KEEP(*(.sa6_bl333src_addr))
+ . = 0x00000050;
+ KEEP(*(.sa6_bl333partition))
+ . = 0x00000058;
+ KEEP(*(.sa6_bl334src_addr))
+ . = 0x00000060;
+ KEEP(*(.sa6_bl334partition))
+ . = 0x00000068;
+ KEEP(*(.sa6_bl335src_addr))
+ . = 0x00000070;
+ KEEP(*(.sa6_bl335partition))
+ . = 0x00000078;
+ KEEP(*(.sa6_bl336src_addr))
+ . = 0x00000080;
+ KEEP(*(.sa6_bl336partition))
+ . = 0x00000088;
+ KEEP(*(.sa6_bl337src_addr))
+ . = 0x00000090;
+ KEEP(*(.sa6_bl337partition))
+ . = 0x00000098;
+ KEEP(*(.sa6_bl338src_addr))
+ . = 0x000000A0;
+ KEEP(*(.sa6_bl338partition))
+ . = 0x00000554;
+ KEEP(*(.sa6_bl31dst_addr))
+ . = 0x00000558;
+ KEEP(*(.sa6_bl31dst_addrh))
+ . = 0x00000664;
+ KEEP(*(.sa6_bl31dst_size))
+ . = 0x00000D54;
+ KEEP(*(.sa6_bl32dst_addr))
+ . = 0x00000D58;
+ KEEP(*(.sa6_bl32dst_addrh))
+ . = 0x00000E64;
+ KEEP(*(.sa6_bl32dst_size))
+ . = 0x00001554;
+ KEEP(*(.sa6_bl33dst_addr))
+ . = 0x00001558;
+ KEEP(*(.sa6_bl33dst_addrh))
+ . = 0x00001664;
+ KEEP(*(.sa6_bl33dst_size))
+ . = 0x00001D54;
+ KEEP(*(.sa6_bl332dst_addr))
+ . = 0x00001D58;
+ KEEP(*(.sa6_bl332dst_addrh))
+ . = 0x00001E64;
+ KEEP(*(.sa6_bl332dst_size))
+ . = 0x00002554;
+ KEEP(*(.sa6_bl333dst_addr))
+ . = 0x00002558;
+ KEEP(*(.sa6_bl333dst_addrh))
+ . = 0x00002664;
+ KEEP(*(.sa6_bl333dst_size))
+ . = 0x00002D54;
+ KEEP(*(.sa6_bl334dst_addr))
+ . = 0x00002D58;
+ KEEP(*(.sa6_bl334dst_addrh))
+ . = 0x00002E64;
+ KEEP(*(.sa6_bl334dst_size))
+ . = 0x00003554;
+ KEEP(*(.sa6_bl335dst_addr))
+ . = 0x00003558;
+ KEEP(*(.sa6_bl335dst_addrh))
+ . = 0x00003664;
+ KEEP(*(.sa6_bl335dst_size))
+ . = 0x00003D54;
+ KEEP(*(.sa6_bl336dst_addr))
+ . = 0x00003D58;
+ KEEP(*(.sa6_bl336dst_addrh))
+ . = 0x00003E64;
+ KEEP(*(.sa6_bl336dst_size))
+ . = 0x00004554;
+ KEEP(*(.sa6_bl337dst_addr))
+ . = 0x00004558;
+ KEEP(*(.sa6_bl337dst_addrh))
+ . = 0x00004664;
+ KEEP(*(.sa6_bl337dst_size))
+ . = 0x00004D54;
+ KEEP(*(.sa6_bl338dst_addr))
+ . = 0x00004D58;
+ KEEP(*(.sa6_bl338dst_addrh))
+ . = 0x00004E64;
+ KEEP(*(.sa6_bl338dst_size))
+ }
+
+}