[U-Boot] [RFC PATCH] arm, davinci: Remove board specific code from da850_lowlevel.c

Christian Riesch christian.riesch at omicron.at
Wed Nov 9 09:18:19 CET 2011


Hello Heiko,
Thank you for your reply!

On Wed, Nov 9, 2011 at 6:37 AM, Heiko Schocher <hs at denx.de> wrote:
> Hello Christian,
>
> Christian Riesch wrote:
>> Signed-off-by: Christian Riesch <christian.riesch at omicron.at>
>> ---
>>
>> Hello Heiko,
>>
>> On my board I cannot use your code in arch_cpu_init() in da850_lowlevel.c
>> since I have different versions of my board with different input
>> clock frequencies. Here u-boot should first determine the board
>> revision number and then configure the SoC accordingly. Therefore I would
>> like to move all board-specific parts (and PLL and memory configuration is
>> board-specific since it depends on the memory chips and oscillators
>> deployed on the board) to board_early_init_f which is called right after
>> arch_cpu_init() and keep only a few initializiation steps in arch_cpu_init().
>
> Ok, if you have other needs on your board we must change something.
> But I want to prevent, that all the code you remove in your patch is
> moved to board code, so all boards must (copy?) it. Instead you should
> move it to a weak function, which you can replace for your specific
> needs. (I thought the code was common enough ...)
>
> What do you think?

That's fine for me, I tried it now with

__attribute__((weak))  int arch_cpu_init(void)

and added my own arch_cpu_init() to my board specific file.

Of course I had to add all those CONFIG_SYS_DA850_PINMUXn with dummy
values to my board config file to make it build... I don't like those
defines because the values are difficult to read and we already have
code for pinmuxing in board/davinci/common/davinci_pinmux.c so it is
duplicate code. Couldn't we move this davinci_pinmux.c to
arch/arm/cpu/arm926ejs/davinci and use it instead? What do you think?

I'll submit a patch for adding the weak attribute.

Regards, Christian


More information about the U-Boot mailing list