diff options
author | Yann Gautier <yann.gautier@foss.st.com> | 2021-03-22 14:21:15 +0100 |
---|---|---|
committer | Yann Gautier <yann.gautier@foss.st.com> | 2021-04-08 08:44:57 +0200 |
commit | 9171ced3419de8083d26418d95b795cadbc84b1b (patch) | |
tree | cbf6d3c5bf97b6e4ba6f7b3b2a14096246d8f6e8 /plat/hisilicon/hikey | |
parent | 4ecd2417c888e1ca8002ccf14eff5e812167548e (diff) | |
download | trusted-firmware-a-9171ced3419de8083d26418d95b795cadbc84b1b.tar.gz |
plat/hisilicon: do not keep mmc_device_info in stack
Create a dedicated static struct mmc_device_info mmc_info mmc_info
instead of having this in stack.
A boot issue has been seen on some platform when applying patch [1].
[1] 13f3c5166f1 ("mmc:prevent accessing to the released space in case of wrong usage")
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: If5db8857cccec2e677b16a38eb3eeb41628a264c
Diffstat (limited to 'plat/hisilicon/hikey')
-rw-r--r-- | plat/hisilicon/hikey/hikey_bl1_setup.c | 8 | ||||
-rw-r--r-- | plat/hisilicon/hikey/hikey_bl2_setup.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plat/hisilicon/hikey/hikey_bl1_setup.c b/plat/hisilicon/hikey/hikey_bl1_setup.c index 86e4fd6376..01c48ec58a 100644 --- a/plat/hisilicon/hikey/hikey_bl1_setup.c +++ b/plat/hisilicon/hikey/hikey_bl1_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -27,6 +27,7 @@ /* Data structure which holds the extents of the trusted RAM for BL1 */ static meminfo_t bl1_tzram_layout; static console_t console; +static struct mmc_device_info mmc_info; enum { BOOT_NORMAL = 0, @@ -78,7 +79,6 @@ void bl1_plat_arch_setup(void) void bl1_platform_setup(void) { dw_mmc_params_t params; - struct mmc_device_info info; assert((HIKEY_BL1_MMC_DESC_BASE >= SRAM_BASE) && ((SRAM_BASE + SRAM_SIZE) >= @@ -99,8 +99,8 @@ void bl1_platform_setup(void) params.clk_rate = 24 * 1000 * 1000; params.bus_width = MMC_BUS_WIDTH_8; params.flags = MMC_FLAG_CMD23; - info.mmc_dev_type = MMC_IS_EMMC; - dw_mmc_init(¶ms, &info); + mmc_info.mmc_dev_type = MMC_IS_EMMC; + dw_mmc_init(¶ms, &mmc_info); hikey_io_setup(); } diff --git a/plat/hisilicon/hikey/hikey_bl2_setup.c b/plat/hisilicon/hikey/hikey_bl2_setup.c index feb7f8a46e..a90f12c704 100644 --- a/plat/hisilicon/hikey/hikey_bl2_setup.c +++ b/plat/hisilicon/hikey/hikey_bl2_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -33,6 +33,7 @@ static meminfo_t bl2_el3_tzram_layout; static console_t console; +static struct mmc_device_info mmc_info; enum { BOOT_MODE_RECOVERY = 0, @@ -290,7 +291,6 @@ void bl2_el3_plat_arch_setup(void) void bl2_platform_setup(void) { dw_mmc_params_t params; - struct mmc_device_info info; hikey_sp804_init(); hikey_gpio_init(); @@ -322,8 +322,8 @@ void bl2_platform_setup(void) params.clk_rate = 24 * 1000 * 1000; params.bus_width = MMC_BUS_WIDTH_8; params.flags = MMC_FLAG_CMD23; - info.mmc_dev_type = MMC_IS_EMMC; - dw_mmc_init(¶ms, &info); + mmc_info.mmc_dev_type = MMC_IS_EMMC; + dw_mmc_init(¶ms, &mmc_info); hikey_io_setup(); } |