Commit 99d37c8c authored by Yann Gautier's avatar Yann Gautier
Browse files

fix(plat/imx): 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] 13f3c516

 ("mmc:prevent accessing to the released space in case of wrong usage")
Signed-off-by: default avatarYann Gautier <yann.gautier@foss.st.com>
Change-Id: Iba0424a5787f9e510a60696d4033db1b49b243b2
parent e55d12b7
/*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
......@@ -43,6 +43,8 @@
IOMUXC_SW_PAD_CTL_PAD_SD3_SLEW_SLOW | \
IOMUXC_SW_PAD_CTL_PAD_SD3_DSE_3_X6)
static struct mmc_device_info mmc_info;
static void picopi_setup_pinmux(void)
{
/* Configure UART5 TX */
......@@ -93,14 +95,13 @@ static void picopi_setup_pinmux(void)
static void picopi_usdhc_setup(void)
{
imx_usdhc_params_t params;
struct mmc_device_info info;
zeromem(&params, sizeof(imx_usdhc_params_t));
params.reg_base = PLAT_PICOPI_BOOT_MMC_BASE;
params.clk_rate = 25000000;
params.bus_width = MMC_BUS_WIDTH_8;
info.mmc_dev_type = MMC_IS_EMMC;
imx_usdhc_init(&params, &info);
mmc_info.mmc_dev_type = MMC_IS_EMMC;
imx_usdhc_init(&params, &mmc_info);
}
static void picopi_setup_usb_clocks(void)
......
/*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
......@@ -69,6 +69,8 @@
IOMUXC_SW_PAD_CTL_PAD_ECSPI1_SCLK_HYS_EN | \
IOMUXC_SW_PAD_CTL_PAD_ECSPI1_SCLK_DSE_1_X4)
static struct mmc_device_info mmc_info;
static void warp7_setup_pinmux(void)
{
/* Configure UART1 TX */
......@@ -99,14 +101,13 @@ static void warp7_setup_pinmux(void)
static void warp7_usdhc_setup(void)
{
imx_usdhc_params_t params;
struct mmc_device_info info;
zeromem(&params, sizeof(imx_usdhc_params_t));
params.reg_base = PLAT_WARP7_BOOT_MMC_BASE;
params.clk_rate = 25000000;
params.bus_width = MMC_BUS_WIDTH_8;
info.mmc_dev_type = MMC_IS_EMMC;
imx_usdhc_init(&params, &info);
mmc_info.mmc_dev_type = MMC_IS_EMMC;
imx_usdhc_init(&params, &mmc_info);
}
static void warp7_setup_usb_clocks(void)
......
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