Hi,
after moving crt0s and lscripts away from the mainboards' Makefiles, those Makefiles are rather simple now, with more opportunities to move out things.
Attached patch does: - make HAVE_HARD_RESET match what newconfig did - introduce BOARD_HAS_HARD_RESET and use it if a board provides hard_reset in $(MAINBOARDDIR)/reset.c, instead of some chipset component - move a couple of rules out of the mainboards' Makefiles into src/arch/i386/Makefile.inc: initobj-y += crt0.o obj-y += mainboard.o obj-$(CONFIG_GENERATE_MP_TABLE) += mptable.o obj-$(CONFIG_GENERATE_PIRQ_TABLE) += irq_tables.o obj-$(CONFIG_BOARD_HAS_HARD_RESET) += reset.o - remove Makefile.incs that are empty (or comment-only) after these changes, incl. Makefile.romccboard.inc (and references to it) - Make include not fail if file doesn't exist.
reset.o used to be HAVE_HARD_RESET, but to make this rule more universal, that new variable had to be introduced.
The rationale for this work is that it unifies the mainboard layout, which leads to less cargo cult when creating a new board, which we usually start by copying from a similar one. It also makes it easier to do global changes, as more common functionality is in common files.
It's build tested and has no regression vs. current HEAD (ie. the same two boards fail for the same reason) and is boot tested on kontron/986lcd-m.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Future work in this area: Move ROMCCFLAGS into Kconfig or global Makefiles, same for the ACPI related rules. Many more mainboard-Makefiles can be removed then.
Patrick
On Fri, Feb 26, 2010 at 3:38 PM, Patrick Georgi patrick@georgi-clan.dewrote:
Hi,
after moving crt0s and lscripts away from the mainboards' Makefiles, those Makefiles are rather simple now, with more opportunities to move out things.
Attached patch does:
- make HAVE_HARD_RESET match what newconfig did
- introduce BOARD_HAS_HARD_RESET and use it if a board provides
hard_reset in $(MAINBOARDDIR)/reset.c, instead of some chipset component
- move a couple of rules out of the mainboards' Makefiles into
src/arch/i386/Makefile.inc: initobj-y += crt0.o obj-y += mainboard.o obj-$(CONFIG_GENERATE_MP_TABLE) += mptable.o obj-$(CONFIG_GENERATE_PIRQ_TABLE) += irq_tables.o obj-$(CONFIG_BOARD_HAS_HARD_RESET) += reset.o
- remove Makefile.incs that are empty (or comment-only) after these
changes, incl. Makefile.romccboard.inc (and references to it)
- Make include not fail if file doesn't exist.
reset.o used to be HAVE_HARD_RESET, but to make this rule more universal, that new variable had to be introduced.
Can we put HAVE_HARD_RESET into the ck804 Kconfig instead of into all the ck804 mainboards?
It's build tested and has no regression vs. current HEAD (ie. the same two boards fail for the same reason) and is boot tested on kontron/986lcd-m.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
Patrick Georgi wrote:
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Peter Stuge peter@stuge.se
Future work in this area: Move ROMCCFLAGS into Kconfig or global Makefiles, same for the ACPI related rules.
I'm tempted to say Kconfig, though I'm not sure I will like the outcome.
Many more mainboard-Makefiles can be removed then.
Awesome progress, this!
//Peter
On 2/26/10 11:38 PM, Patrick Georgi wrote:
config HAVE_HARD_RESET bool
- default y if BOARD_HAS_HARD_RESET default n
- help
This variable specifies whether a given board has a hard_reset
function, no matter if it's provided by board code or chipset code.
+config BOARD_HAS_HARD_RESET
- bool
- default n
- help
This variable specifies whether a given board has a reset.c
file containing a hard_reset() function.
Hm this is kind of semi-beautiful, but I think it's good for getting the job done... Fight them mainboard makefiles!
Acked-by: Stefan Reinauer stepan@coresystems.de
Happy weekend everyone!
Stefan
Stefan Reinauer wrote:
+config BOARD_HAS_HARD_RESET
Hm this is kind of semi-beautiful, but I think it's good for getting the job done... Fight them mainboard makefiles!
The alternative would be to move all reset functions out of board code into chipset code. Maybe that's actually feasible?
//Peter
On 2/27/10 1:19 AM, Peter Stuge wrote:
Stefan Reinauer wrote:
+config BOARD_HAS_HARD_RESET
Hm this is kind of semi-beautiful, but I think it's good for getting the job done... Fight them mainboard makefiles!
The alternative would be to move all reset functions out of board code into chipset code. Maybe that's actually feasible?
Yes, I start believing reset code belongs into the southbridge, because the southbridge decodes cf9. But that's good for another day. Patrick has done incredible work on simplifying coreboot, let's go one step at once.
Stefan
Stefan Reinauer wrote:
The alternative would be to move all reset functions out of board code into chipset code. Maybe that's actually feasible?
Yes, I start believing reset code belongs into the southbridge, because the southbridge decodes cf9.
Makes sense.
But that's good for another day. Patrick has done incredible work on simplifying coreboot,
Yes indeed.
let's go one step at once.
Fair. :)
//Peter