[U-Boot] litesom.c: Board stuff in SOC ?

Stefano Babic sbabic at denx.de
Thu May 18 15:20:27 UTC 2017


Hi Marcin,

On 18/05/2017 16:57, Marcin Niestroj wrote:
> Hi Stefano,
> 
> On 18.05.2017 16:28, Stefano Babic wrote:
>> Hi Marcin,
>>
>> even if it was already merged (and maybe I am guilty of it because I
>> have not noted before), it is completely crazy that a board is stored
>> inside the SOC directory. The litesom board is in fact in
>> ./arch/arm/cpu/armv7/mx6/litesom.c, and there is nothing that justify
>> this. The code has just board related stuff and nothing common for all
>> SOC.
> 
> litesom is not a board, but a SOM.

It does not matter, sorry. The code is not common for all boards (and if
you like it, all SOMs) sharing the same SOC or SOC family. In this case,
i.MX6.

There is plenty of such as example in U-Boot, please check it in code.
SOM support is in the boards directory and it must not be here. It will
be removed.

> It has only RAM and eMMC memory
> included with the processor.

Like all SOMs you find in u-boot from a lot of different vendors...just
check it.

> litesom cannot work on it's own. It needs
> to be part of some board. An example board is liteboard, which support
> is included in board/grinn/liteboard/. Please visit [2] to visualize
> what the litesom device is.

Thanks, nothing new.

Again: the SOM is specific to a vendor and cannot be in the SOC
directory. There should be then a board/grinn/common (or whatever you
want) where SOM code is put. And again, not in SOC directory.

> 
> The idea about creating a separate file in arch/arm/cpu/armv7/mx6/

The idea is correct, just in wrong place. There are plenty of examples
doing this:

./engicam/common
./freescale/common
./compulab/common


.... and many others.

> was to be able to reuse code when new boards, that use litesom
> as it's core, will be added. And these boards need not to be
> manufactured or designed by Grinn.

Right, so why are we discussing ? They belong to grinn, that means the
code should be in board/<vendor>, that is board/grinn. Please move it !

> So if some other vendor wants
> to add support for it's board (which will be based on litesom),
> the code to initialize RAM and eMMC can be reused.

They will be put code into the grimm directory. See all other vendors
selling SOMs.

> When litesom
> code would be part of board/grinn/ directory, then other vendors
> could not easily add support for their boards without copying
> litesom sources.

I will take care that the code will not be duplicated - not worry.

Please move it or it will be removed, thanks !

> 
> [2] http://grinn-global.com/litesom/
> 
>>
>> I just took again the commit and I see:
>>
>> Moving arch/arm/mach-litesom/ to arch/arm/cpu/armv7/mx6/ was requested
>> in [1] during discussion of chiliSOM support patches.
>>
>> [1] http://lists.denx.de/pipermail/u-boot/2017-January/279137.html
>>
>>
>> But [1] has nothing to do with the context.  I will tend to revert this
>> patch and wait for an appropriate patch that add support for the board
>> just like all other boards in U-Boot - as it is currently, it is wrong.
> 
> Link [1] was a discussion of adding chilisom support into u-boot.
> The idea was the same - allow to reuse SOM code for vendors creating
> their own board based on our SOMs.

Idea is already used in U-Boot and the SOM vendor has priority. Else
code inside arch/arm/cpu/*, that must be common to all boards and *all*
SOMs using those processor is becoming a mess. Please move it.

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list