Commit df5a9683 authored by Heiko Stuebner's avatar Heiko Stuebner
Browse files

rockchip: make miniloader ddr_parameter handling optional



Transfering the regions of ddr memory to additionally protect is very much
specific to some rockchip internal first stage bootloader and doesn't get
used in either mainline uboot or even Rockchip's published vendor uboot
sources.

This results in a big error
    ERROR:   over or zero region, nr=0, max=10
getting emitted on every boot for most users and such a message coming
from early firmware might actually confuse developers working with the
system.

As this mechanism seems to be only be used by Rockchip's internal miniloader
hide it behind a build conditional, so it doesn't confuse people too much.
Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
Change-Id: I52c02decc60fd431ea78c7486cad5bac82bdbfbe
parent f55ef85e
...@@ -62,6 +62,7 @@ void secure_timer_init(void) ...@@ -62,6 +62,7 @@ void secure_timer_init(void)
void sgrf_init(void) void sgrf_init(void)
{ {
#ifdef PLAT_RK_SECURE_DDR_MINILOADER
uint32_t i; uint32_t i;
struct param_ddr_usage usg; struct param_ddr_usage usg;
...@@ -74,6 +75,7 @@ void sgrf_init(void) ...@@ -74,6 +75,7 @@ void sgrf_init(void)
for (i = 0; i < usg.s_nr; i++) for (i = 0; i < usg.s_nr; i++)
secure_ddr_region(7 - i, usg.s_top[i], usg.s_base[i]); secure_ddr_region(7 - i, usg.s_top[i], usg.s_base[i]);
#endif
/* secure the trustzone ram */ /* secure the trustzone ram */
secure_ddr_region(0, TZRAM_BASE, TZRAM_SIZE); secure_ddr_region(0, TZRAM_BASE, TZRAM_SIZE);
......
...@@ -46,7 +46,6 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -46,7 +46,6 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
${RK_PLAT_COMMON}/aarch64/platform_common.c \ ${RK_PLAT_COMMON}/aarch64/platform_common.c \
${RK_PLAT_COMMON}/bl31_plat_setup.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \
${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c \
${RK_PLAT_COMMON}/params_setup.c \ ${RK_PLAT_COMMON}/params_setup.c \
${RK_PLAT_COMMON}/pmusram/cpus_on_fixed_addr.S \ ${RK_PLAT_COMMON}/pmusram/cpus_on_fixed_addr.S \
${RK_PLAT_COMMON}/plat_pm.c \ ${RK_PLAT_COMMON}/plat_pm.c \
...@@ -57,6 +56,10 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -57,6 +56,10 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
${RK_PLAT_SOC}/drivers/soc/soc.c \ ${RK_PLAT_SOC}/drivers/soc/soc.c \
${RK_PLAT_SOC}/plat_sip_calls.c ${RK_PLAT_SOC}/plat_sip_calls.c
ifdef PLAT_RK_SECURE_DDR_MINILOADER
BL31_SOURCES += ${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c
endif
ENABLE_PLAT_COMPAT := 0 ENABLE_PLAT_COMPAT := 0
MULTI_CONSOLE_API := 1 MULTI_CONSOLE_API := 1
......
/* /*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -97,6 +97,7 @@ void secure_timer_init(void) ...@@ -97,6 +97,7 @@ void secure_timer_init(void)
void sgrf_init(void) void sgrf_init(void)
{ {
#ifdef PLAT_RK_SECURE_DDR_MINILOADER
uint32_t i, val; uint32_t i, val;
struct param_ddr_usage usg; struct param_ddr_usage usg;
...@@ -115,6 +116,7 @@ void sgrf_init(void) ...@@ -115,6 +116,7 @@ void sgrf_init(void)
FIREWALL_DDR_FW_DDR_RGN(7 - i), FIREWALL_DDR_FW_DDR_RGN(7 - i),
RG_MAP_SECURE(usg.s_top[i], usg.s_base[i])); RG_MAP_SECURE(usg.s_top[i], usg.s_base[i]));
} }
#endif
/* set ddr rgn0_top and rga0_top as 0 */ /* set ddr rgn0_top and rga0_top as 0 */
mmio_write_32(FIREWALL_DDR_BASE + FIREWALL_DDR_FW_DDR_RGN(0), 0x0); mmio_write_32(FIREWALL_DDR_BASE + FIREWALL_DDR_FW_DDR_RGN(0), 0x0);
......
...@@ -42,7 +42,6 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -42,7 +42,6 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
lib/cpus/aarch64/aem_generic.S \ lib/cpus/aarch64/aem_generic.S \
lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a53.S \
${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c \
${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
${RK_PLAT_COMMON}/params_setup.c \ ${RK_PLAT_COMMON}/params_setup.c \
${RK_PLAT_COMMON}/bl31_plat_setup.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \
...@@ -53,6 +52,10 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -53,6 +52,10 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
${RK_PLAT_SOC}/drivers/pmu/pmu.c \ ${RK_PLAT_SOC}/drivers/pmu/pmu.c \
${RK_PLAT_SOC}/drivers/soc/soc.c ${RK_PLAT_SOC}/drivers/soc/soc.c
ifdef PLAT_RK_SECURE_DDR_MINILOADER
BL31_SOURCES += ${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c
endif
include lib/coreboot/coreboot.mk include lib/coreboot/coreboot.mk
include lib/libfdt/libfdt.mk include lib/libfdt/libfdt.mk
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment