diff options
author | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2017-07-17 02:22:54 +0300 |
---|---|---|
committer | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2017-07-17 02:24:32 +0300 |
commit | 7a8bbdb6c34d4017c9c15edb0ddc818c7937e6c5 (patch) | |
tree | 25806c24359f9da13b7e938f32773d7f36edb8ca /meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware | |
parent | 5ef3abf88acdef2bb46a9f2c19f8a0d9975a7e47 (diff) |
arm-trusted-firmware: add nonsecure hyperflash access
this fixes non-secure hyperflash access on ws2.0
Diffstat (limited to 'meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware')
3 files changed, 86 insertions, 50 deletions
diff --git a/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend b/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend index 355b83d..9d4c1a9 100644 --- a/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend +++ b/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend @@ -1,7 +1,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" ATFW_OPT_append = " ${@base_conditional("CA57CA53BOOT", "1", " PSCI_DISABLE_BIGLITTLE_IN_CA57BOOT=0", "", d)}" +ATFW_OPT_append += " ${@base_conditional("DISABLE_RPC_ACCESS", "1", " RCAR_DISABLE_NONSECURE_RPC_ACCESS=1", "", d)}" SRC_URI_append = " \ - file://0001-plat-rcar-bl2_secure_setting-Enable-access-to-RPC.patch \ + file://0001-plat-renesas-rcar-Make-RPC-secure-settings-optional.patch \ " diff --git a/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-rcar-bl2_secure_setting-Enable-access-to-RPC.patch b/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-rcar-bl2_secure_setting-Enable-access-to-RPC.patch deleted file mode 100644 index 5806406..0000000 --- a/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-rcar-bl2_secure_setting-Enable-access-to-RPC.patch +++ /dev/null @@ -1,49 +0,0 @@ -From ffdc1370686caa18fd6e44952d7293dc1a19e897 Mon Sep 17 00:00:00 2001 -From: Vladimir Barinov <vladimir.barinov@cogentembedded.com> -Date: Sun, 11 Sep 2016 00:50:06 +0300 -Subject: [PATCH] plat: rcar: bl2_secure_setting: Enable access to RPC - -This enables access to RPC flash from non-secure mode. -This is needed to access flash from U-Boot and Linux kernel. - -Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com> -Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> ---- - plat/renesas/rcar/bl2_secure_setting.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/plat/renesas/rcar/bl2_secure_setting.c b/plat/renesas/rcar/bl2_secure_setting.c -index b83c8ce..7240b3e 100644 ---- a/plat/renesas/rcar/bl2_secure_setting.c -+++ b/plat/renesas/rcar/bl2_secure_setting.c -@@ -105,10 +105,12 @@ static const struct { - /** Security attribute setting for slave ports 12 */ - /* {SEC_SEL12, 0xFFFFFFFFU},*/ - -+#if 0 - /** Security attribute setting for slave ports 13 */ - /* Bit22: RPC slave ports. */ - /* 0: registers can be accessed from secure resource only. */ - {SEC_SEL13, 0xFFBFFFFFU}, -+#endif - - /** Security attribute setting for slave ports 14 */ - /* Bit27: System Timer (SCMT) slave ports. */ -@@ -228,12 +230,14 @@ static const struct { - /* {SEC_GRP0COND12, 0x00000000U},*/ - /* {SEC_GRP1COND12, 0x00000000U},*/ - -+#if 0 - /** Security group 0 attribute setting for slave ports 13 */ - /** Security group 1 attribute setting for slave ports 13 */ - /* Bit22: RPC slave ports. */ - /* SecurityGroup3 */ - {SEC_GRP0COND13, 0x00400000U}, - {SEC_GRP1COND13, 0x00400000U}, -+#endif - - /** Security group 0 attribute setting for slave ports 14 */ - /** Security group 1 attribute setting for slave ports 14 */ --- -1.9.1 - diff --git a/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-renesas-rcar-Make-RPC-secure-settings-optional.patch b/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-renesas-rcar-Make-RPC-secure-settings-optional.patch new file mode 100644 index 0000000..06a6fe1 --- /dev/null +++ b/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/files/0001-plat-renesas-rcar-Make-RPC-secure-settings-optional.patch @@ -0,0 +1,84 @@ +From 88373fb822f737b60c8c71ca799ec50efaebf5bc Mon Sep 17 00:00:00 2001 +From: Valentine Barshak <valentine.barshak@cogentembedded.com> +Date: Tue, 4 Jul 2017 21:09:26 +0300 +Subject: [PATCH] plat: renesas: rcar: Make RPC secure settings optional + +This adds RCAR_DISABLE_NONSECURE_RPC_ACCESS make variable which +disables non-secure RPC access when set to a non-zero value. + +Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com> +--- + plat/renesas/rcar/bl2_secure_setting.c | 4 ++++ + plat/renesas/rcar/bl31_rcar_setup.c | 16 ++++++++++++++++ + plat/renesas/rcar/platform.mk | 6 ++++++ + 3 files changed, 26 insertions(+) + +diff --git a/plat/renesas/rcar/bl2_secure_setting.c b/plat/renesas/rcar/bl2_secure_setting.c +index 3ab651f..40e6a36 100644 +--- a/plat/renesas/rcar/bl2_secure_setting.c ++++ b/plat/renesas/rcar/bl2_secure_setting.c +@@ -108,7 +108,9 @@ static const struct { + /** Security attribute setting for slave ports 13 */ + /* Bit22: RPC slave ports. */ + /* 0: registers can be accessed from secure resource only. */ ++#if (RCAR_DISABLE_NONSECURE_RPC_ACCESS != 0) + {SEC_SEL13, 0xFFBFFFFFU}, ++#endif + + /** Security attribute setting for slave ports 14 */ + /* Bit27: System Timer (SCMT) slave ports. */ +@@ -232,8 +234,10 @@ static const struct { + /** Security group 1 attribute setting for slave ports 13 */ + /* Bit22: RPC slave ports. */ + /* SecurityGroup3 */ ++#if (RCAR_DISABLE_NONSECURE_RPC_ACCESS != 0) + {SEC_GRP0COND13, 0x00400000U}, + {SEC_GRP1COND13, 0x00400000U}, ++#endif + + /** Security group 0 attribute setting for slave ports 14 */ + /** Security group 1 attribute setting for slave ports 14 */ +diff --git a/plat/renesas/rcar/bl31_rcar_setup.c b/plat/renesas/rcar/bl31_rcar_setup.c +index cc6ad2c..c91297d 100644 +--- a/plat/renesas/rcar/bl31_rcar_setup.c ++++ b/plat/renesas/rcar/bl31_rcar_setup.c +@@ -232,3 +232,19 @@ int32_t bl31_plat_denied_cpu_off_chk(void) + return rc; + } + ++/******************************************************************************* ++ * Perform the runtime platform specific setup here. ++ ******************************************************************************/ ++void bl31_plat_runtime_setup(void) ++{ ++#if (RCAR_DISABLE_NONSECURE_RPC_ACCESS == 0) ++ /* Enable non-secure access to the RPC HyperFlash region. */ ++ mmio_write_32(0xee2000b8, 0x155); ++ mmio_write_32(0xee200000, mmio_read_32(0xee200000) & 0x7fffffff); ++#endif ++ /* ++ * Finish the use of console driver in BL31 so that any runtime logs ++ * from BL31 will be suppressed. ++ */ ++ console_uninit(); ++} +diff --git a/plat/renesas/rcar/platform.mk b/plat/renesas/rcar/platform.mk +index 6abc088..60f41ae 100644 +--- a/plat/renesas/rcar/platform.mk ++++ b/plat/renesas/rcar/platform.mk +@@ -223,6 +223,12 @@ RCAR_GEN3_ULCB := 0 + endif + $(eval $(call add_define,RCAR_GEN3_ULCB)) + ++# Process RCAR_DISABLE_NONSECURE_RPC_ACCESS flag ++ifndef RCAR_DISABLE_NONSECURE_RPC_ACCESS ++RCAR_DISABLE_NONSECURE_RPC_ACCESS := 0 ++endif ++$(eval $(call add_define,RCAR_DISABLE_NONSECURE_RPC_ACCESS)) ++ + include plat/renesas/rcar/ddr/ddr.mk + include plat/renesas/rcar/qos/qos.mk + include plat/renesas/rcar/pfc/pfc.mk +-- +2.7.5 + |