[PATCH 1/3] imx: imx8mm_beacon: Eliminate a few extras to free up SPL space

Peng Fan peng.fan at oss.nxp.com
Tue Oct 25 03:29:38 CEST 2022



On 10/25/2022 4:47 AM, Tim Harvey wrote:
> On Mon, Oct 24, 2022 at 1:26 PM Adam Ford <aford173 at gmail.com> wrote:
>>
>> On Mon, Oct 24, 2022 at 2:57 PM Tim Harvey <tharvey at gateworks.com> wrote:
>>>
>>> On Sat, Oct 22, 2022 at 7:28 AM Adam Ford <aford173 at gmail.com> wrote:
>>>>
>>>> There are a few functions which are not essential for use in
>>>> SPL, but they take up enough space to make other preferred
>>>> features not fit.  Remove the extras.
>>>>
>>>> Signed-off-by: Adam Ford <aford173 at gmail.com>
>>>>
>>>> diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c
>>>> index a93cc93878..b0e9d918da 100644
>>>> --- a/board/beacon/imx8mm/spl.c
>>>> +++ b/board/beacon/imx8mm/spl.c
>>>> @@ -44,11 +44,6 @@ static void spl_dram_init(void)
>>>>          ddr_init(&dram_timing);
>>>>   }
>>>>
>>>> -void spl_board_init(void)
>>>> -{
>>>> -       debug("Normal Boot\n");
>>>> -}
>>>> -
>>>>   #ifdef CONFIG_SPL_LOAD_FIT
>>>>   int board_fit_config_name_match(const char *name)
>>>>   {
>>>> diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
>>>> index e37ce01c19..f6a1012d8a 100644
>>>> --- a/configs/imx8mm_beacon_defconfig
>>>> +++ b/configs/imx8mm_beacon_defconfig
>>>> @@ -29,7 +29,6 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-beacon-kit.dtb"
>>>>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
>>>>   CONFIG_SPL_BSS_START_ADDR=0x910000
>>>>   CONFIG_SPL_BSS_MAX_SIZE=0x2000
>>>> -CONFIG_SPL_BOARD_INIT=y
>>>>   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
>>>>   CONFIG_SPL_STACK=0x920000
>>>>   CONFIG_SYS_SPL_MALLOC=y
>>>> @@ -88,12 +87,9 @@ CONFIG_DM_PCA953X=y
>>>>   CONFIG_DM_I2C=y
>>>>   CONFIG_SUPPORT_EMMC_BOOT=y
>>>>   CONFIG_MMC_IO_VOLTAGE=y
>>>> -CONFIG_SPL_MMC_IO_VOLTAGE=y
>>>>   CONFIG_MMC_UHS_SUPPORT=y
>>>> -CONFIG_SPL_MMC_UHS_SUPPORT=y
>>>>   CONFIG_MMC_HS400_ES_SUPPORT=y
>>>>   CONFIG_MMC_HS400_SUPPORT=y
>>>> -CONFIG_SPL_MMC_HS400_SUPPORT=y
>>>>   CONFIG_FSL_USDHC=y
>>>>   CONFIG_MTD=y
>>>>   CONFIG_DM_MTD=y
>>>> @@ -113,14 +109,12 @@ CONFIG_PINCTRL_IMX8M=y
>>>>   CONFIG_POWER_DOMAIN=y
>>>>   CONFIG_IMX8M_POWER_DOMAIN=y
>>>>   CONFIG_DM_PMIC=y
>>>> +# CONFIG_SPL_PMIC_CHILDREN is not set
>>>>   CONFIG_DM_PMIC_BD71837=y
>>>>   CONFIG_SPL_DM_PMIC_BD71837=y
>>>>   CONFIG_DM_REGULATOR=y
>>>> -CONFIG_SPL_DM_REGULATOR=y
>>>>   CONFIG_DM_REGULATOR_BD71837=y
>>>> -CONFIG_SPL_DM_REGULATOR_BD71837=y
>>>>   CONFIG_DM_REGULATOR_FIXED=y
>>>> -CONFIG_SPL_DM_REGULATOR_FIXED=y
>>>>   CONFIG_DM_REGULATOR_GPIO=y
>>>>   CONFIG_DM_SERIAL=y
>>>>   CONFIG_MXC_UART=y
>>>> --
>>>> 2.34.1
>>>>
>>>
>>> Adam,
>>>
>>> I'm looking at your patches as I'm also trying to strip down the
>>> imx8mm-venice SPL so that I can fit DM USB support. It seems that
>>> all/most of the imx8m boards have a spl_board_init() which calls
>>> arch_misc_init(). I'm curious why your not calling that function?
>>
>> As of right now, we're not using the CAAM which is initialized in
>> arch_misc_init.  If/When we do, we'll likely have to pull that in.
>>
> 
> ok - makes sense.
> 
>>>
>>> Another config that I've found to save a lot of space for imx8m
>>> without any negative impact I can see is CONFIG_SPL_MMC_TINY=y
>>
>> I experimented a bit with that too, but I hadn't fully tested
>> switching between booting between MMC1 and MMC2, so I wasn't quite
>> ready to enable it, but I'll spend some more time with it to see how
>> much more space I can shave off SPL.
>> Getting rid of the PMIC children in SPL helped me quite a bit.
> 
> I see. It appears to save about 2K and Fabio's imx8mm clk reduction
> series that made it in saves another 800 bytes or so.
> 
> Regardless I'm still oversize for imx8mm-venice by 2K bytes and
> looking for things to prune. My issue is that I have 4 DRAM configs to
> support which suck up 3K each I believe.

Why has so many DRAM configs? Use one image to support multiple boards?

Regards,
Peng.

> 
> Tim


More information about the U-Boot mailing list