[coreboot] mainboard.c: init() still being called?
JRottmann at LiPPERTEmbedded.de
Mon Aug 16 15:57:33 CEST 2010
in Nov 2008 (around rev. 3760) I had done Coreboot support for 2 of our boards
(LiPPERT RoadRunner-LX and SpaceRunner-LX). Now I'd like to add support for 2
more, based on the code for the previous ones as the hardware is quite similar.
However in the past 2 years / 2000 revs Coreboot has evolved quite a lot! Even
though SpaceRunner support still compiles, it doesn't quite seem to work as it
did back then. Looks like I have to try and bring the 2 older board's code up to
scratch first before I can base anything on it.
The old code defined a config byte (for some GPIOs) in struct
mainboard_lippert_spacerunner_lx_config (chip.h), which used to be set in
Config.lb with a simple register "..." = "..." statement and used in
mainboard.c's init() by casting dev->chip_info to struct
The current code still has the struct (renamed to mainboard_config), but while
changing Config.lb to devicetree.cb the register statement got dropped so
there's no longer any value assigned to the config byte. I tried to re-add the
register line where it was before (before chip northbridge/...) but this seems
no longer to be allowed. And more importantly, init() which uses the config byte
is still there but does not seem to be executed any more. At least I couldn't
see its debug output.
I tried to look at the AMD DB800, which had served as my example at the time,
but the DB800 code hasn't changed, so probably its init() isn't called now
either. (Only the DB800 doesn't do anything important there.)
I noticed that enable_dev() is still being called. Is this a bug? Or is this on
purpose? Am I meant to move my code from init() to enable_dev()? But then why
does dev->ops still contain an init field?
I tried reading the docs both in the wiki and the documentation/ dir, but this
seems seriously outdated and more misleading than helpful, because I as a newbie
cannot possibly know which parts of the docs still apply and which to ignore.
Doxygen produced 50998 files with details about each function and struct, which
is rather overwhelming when you don't even know what you're looking for and
trying to get sort of a general overview.
I tried looking at other boards which define something in struct
mainboard_config, but they all seemed to have suffered a similar fate, I
couldn't find one which still assigns a value to it in devicetree.cb. About a
dozen use dev->ops->init in mainboard.c but I can't see what they would do
differently that their init() would be actually called. - Maybe it isn't either?
Any pointer in the right direction would be appreciated.
Thanks in advance,
More information about the coreboot