Hi Uwe
I just applied your patch and looked at the common/gx1-base/*. How do I add my board to the code tree?
It seems board specific codes which used to be in independent files are now placed in #ifdef chain. Should I add another #elif...? That sounds not right. Is there other way to refactor?
Regards, Kenji Noguchi
2007/10/18, Uwe Hermann uwe@hermann-uwe.de:
Hi,
here's a first patch (in a row of a bunch of other, similar planned patches) which reduces the amount of crappy, duplicated mainboard code in the repository.
(it also adds support for a new target, the Advantech PCM-5820, btw.)
This common code supports three different GX1-boards, more will follow. We have at least 7 of them in the repo right now (and I'll add more), duplicating the same crap in each mainboard/* directory again and again is definately not what we want to do.
This is build-tested, and runtime-tested on hardware on two boards. Erwan Velu erwan@seanodes.com will likely be able to test on the Advantech PCM-5820 soon.
I'm planning similar patches for unifying the code for CK804 based boards, and others. E.g. we can easily support the
- ASUS A8NE-FM/S
- ASUS A8N-E
- ASUS A85NX
- and probably lots more very similar boards
from one common code base (and we should!).
Note: I'm not saying that we _must_ do this with _all_ boards in the repository. If the differences are too big, this doesn't make too much sense. But I have a very strong opinion that we should indeed do it for all boards which are reasonably similar.
The savings even in this (GX1) case are pretty large, but if you look at some CK804/MCP55 boards, you'll see that it makes a _dramatic_ difference in the amount of code whether you copy-paste or use a generic common code base.
Comments welcome, Uwe.
http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHF/F/XdVoV3jWIbQRAm8WAKCIvs1FF6a8spNDKwFhzvvPJQP/uQCeOApS Ztstiz7PtF5HAR/mxi801EY= =vVrH -----END PGP SIGNATURE-----
-- linuxbios mailing list linuxbios@linuxbios.org http://www.linuxbios.org/mailman/listinfo/linuxbios