make main() in snow's romstage.c our romstage entry point
Our earlier attempt was jumping straight from asm to the old u-boot board_init_f in lowlevel_init_c.c. We are getting ready to transition to using a real bootblock for ARM, so add romstage.c to the files compiled and we'll make main() our entry point. This also updates romstage.ld to place main() (*(.text.startup)) at the beginning of romstage. Change-Id: Ifc77a6bfba27d915c4cad62c6c8040665294628a Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/2163 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
88c4939c1b
commit
e2851f2812
|
@ -148,6 +148,7 @@ CFLAGS += \
|
||||||
# For various headers imported from Linux
|
# For various headers imported from Linux
|
||||||
CFLAGS += -D__LINUX_ARM_ARCH__=7
|
CFLAGS += -D__LINUX_ARM_ARCH__=7
|
||||||
|
|
||||||
|
#crt0s = $(src)/arch/armv7/bootblock.inc
|
||||||
ldscripts =
|
ldscripts =
|
||||||
ldscripts += $(src)/arch/armv7/romstage.ld
|
ldscripts += $(src)/arch/armv7/romstage.ld
|
||||||
|
|
||||||
|
@ -164,17 +165,18 @@ ifeq ($(CONFIG_LLSHELL),y)
|
||||||
crt0s += $(src)/arch/armv7/llshell/llshell.inc
|
crt0s += $(src)/arch/armv7/llshell/llshell.inc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
crt0s += $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc
|
# FIXME: do we need romstage.inc? Maybe just get rid of this entirely.
|
||||||
|
#crt0s += $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc
|
||||||
|
|
||||||
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
||||||
@printf " CC romstage.inc\n"
|
@printf " CC romstage.inc\n"
|
||||||
$(CC) -MMD $(CFLAGS) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
$(CC) -MMD $(CFLAGS) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
||||||
|
|
||||||
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc
|
#$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc
|
||||||
@printf " POST romstage.inc\n"
|
# @printf " POST romstage.inc\n"
|
||||||
sed -e 's/\.rodata/.rom.data/g' -e 's/\^\.text/.section .rom.text/g' \
|
# sed -e 's/\.rodata/.rom.data/g' -e 's/\^\.text/.section .rom.text/g' \
|
||||||
-e 's/\^\.section \.text/.section .rom.text/g' $^ > $@.tmp
|
# -e 's/\^\.section \.text/.section .rom.text/g' $^ > $@.tmp
|
||||||
mv $@.tmp $@
|
# mv $@.tmp $@
|
||||||
|
|
||||||
# Things that appear in every board
|
# Things that appear in every board
|
||||||
romstage-srcs += $(objgenerated)/crt0.s
|
romstage-srcs += $(objgenerated)/crt0.s
|
||||||
|
|
|
@ -43,6 +43,8 @@ SECTIONS
|
||||||
|
|
||||||
.romtext . : {
|
.romtext . : {
|
||||||
_rom = .;
|
_rom = .;
|
||||||
|
_start = .;
|
||||||
|
*(.text.startup);
|
||||||
*(.text);
|
*(.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
##
|
##
|
||||||
|
|
||||||
#romstage-y += romstage.c
|
romstage-y += romstage.c
|
||||||
|
|
||||||
# ramstage-y += ec.c
|
# ramstage-y += ec.c
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue