Skip to contentSkip to conversation

kirkwood stack size

DISCUSSION Marek Behún 2 participants 2 messages Oct 27, 2021 – Oct 28, 2021

lore
Share & tools
lore
#0 lore raw

Hello Stefan,

do you have some ARM Kirkwood board? I am working on some env patches, because the code in the env/ directory is a pain in the ass of old relics, and Kirkwood is the only platform using the eeprom environment driver.

I would like to ask about Kirkwood stack size.

In arch/arm/mach-kirkwood/include/mach/config.h it says

/* Kirkwood has 2k of Security SRAM, use it for SP */
#define CONFIG_SYS_INIT_SP_ADDR 0xC8012000

So if I understand correctly, Kirkwood has only 2k of init stack.

But the env_eeprom_load() method in env/eeprom.c allocates a CONFIG_ENV_SIZE bytes long array for environment, and CONFIG_ENV_SIZE is 2k.

Is the init stack changed to another stack before environment is loaded? I couldn't find code which would do that. As far as I am able to determine, this 2k long init stack is used, and this means that the code in env/eeprom.c is wrong, since it allocates below stack space.

Maybe no one used newer U-Boot on Kirkwood for a long time and this was not noticed? Should we remove support for Kirkwood?

Marek

#1 lore raw

Hi Marek,

Quoted 3 lines · Marek Behún

Hello Stefan,

do you have some ARM Kirkwood board?

No, I don't have of them here. Sorry.

Quoted 18 lines

I am working on some env patches,
because the code in the env/ directory is a pain in the ass of old relics, and Kirkwood is the only platform using the eeprom environment driver.

I would like to ask about Kirkwood stack size.

In arch/arm/mach-kirkwood/include/mach/config.h it says

/* Kirkwood has 2k of Security SRAM, use it for SP */
#define CONFIG_SYS_INIT_SP_ADDR 0xC8012000

So if I understand correctly, Kirkwood has only 2k of init stack.

But the env_eeprom_load() method in env/eeprom.c allocates a CONFIG_ENV_SIZE bytes long array for environment, and CONFIG_ENV_SIZE is 2k.

Quoted 7 lines

Is the init stack changed to another stack before environment is loaded? I couldn't find code which would do that. As far as I am able to determine, this 2k long init stack is used, and this means that the code in env/eeprom.c is wrong, since it allocates below stack space.

Maybe no one used newer U-Boot on Kirkwood for a long time and this was not noticed? Should we remove support for Kirkwood?

As you have noticed, Tony is actively working on Kirkwood support lately.

Thanks,
Stefan