From f8a2dddb573faef41ad43ee111d91d4c5259ad59 Mon Sep 17 00:00:00 2001 From: Eric Biederman Date: Sat, 30 Oct 2004 08:05:41 +0000 Subject: - To reduce confuse rename the parts of linuxbios bios that run from ram linuxbios_ram instead of linuxbios_c and linuxbios_payload... - Reordered the linker sections so the LinuxBIOS fallback image can take more the 64KiB on x86 - ROM_IMAGE_SIZE now will work when it is specified as larger than 64KiB. - Tweaked the reset16.inc and reset16.lds to move the sanity check to see if everything will work. - Start using romcc's built in preprocessor (This will simplify header compiler checks) - Add helper functions for examining all of the resources - Remove debug strings from chip.h - Add llshell to src/arch/i386/llshell (Sometime later I can try it...) - Add the ability to catch exceptions on x86 - Add gdb_stub support to x86 - Removed old cpu options - Added an option so we can detect movnti support - Remove some duplicate definitions from pci_ids.h - Remove the 64bit resource code in amdk8/northbridge.c in preparation for making it generic - Minor romcc bug fixes git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1727 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/config/Config.lb | 34 ++++++------- src/config/Options.lb | 39 ++++----------- src/config/linuxbios_c.ld | 114 -------------------------------------------- src/config/linuxbios_ram.ld | 114 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 160 deletions(-) delete mode 100644 src/config/linuxbios_c.ld create mode 100644 src/config/linuxbios_ram.ld (limited to 'src/config') diff --git a/src/config/Config.lb b/src/config/Config.lb index 70b3dc9630..c9c03bb604 100644 --- a/src/config/Config.lb +++ b/src/config/Config.lb @@ -32,40 +32,40 @@ makerule linuxbios.strip action "$(OBJCOPY) -O binary linuxbios linuxbios.strip" end -makerule linuxbios_c.o +makerule linuxbios_ram.o depends "$(DRIVER) linuxbios.a $(LIBGCC_FILE_NAME)" action "$(CC) -nostdlib -r -o $@ c_start.o $(DRIVER) linuxbios.a $(LIBGCC_FILE_NAME)" end -makerule linuxbios_c - depends "linuxbios_c.o $(TOP)/src/config/linuxbios_c.ld ldoptions" - action "$(CC) -nostdlib -nostartfiles -static -o $@ -T $(TOP)/src/config/linuxbios_c.ld linuxbios_c.o" - action "$(CROSS_COMPILE)nm -n linuxbios_c | sort > linuxbios_c.map" +makerule linuxbios_ram + depends "linuxbios_ram.o $(TOP)/src/config/linuxbios_ram.ld ldoptions" + action "$(CC) -nostdlib -nostartfiles -static -o $@ -T $(TOP)/src/config/linuxbios_ram.ld linuxbios_ram.o" + action "$(CROSS_COMPILE)nm -n linuxbios_ram | sort > linuxbios_ram.map" end ## -## By default compress the C part of linuxbios +## By default compress the part of linuxbios that runs from RAM ## -makedefine LINUXBIOS_PAYLOAD-$(CONFIG_COMPRESS):=linuxbios_payload.nrv2b -makedefine LINUXBIOS_PAYLOAD-$(CONFIG_UNCOMPRESSED):=linuxbios_payload.bin +makedefine LINUXBIOS_RAM-$(CONFIG_COMPRESS):=linuxbios_ram.nrv2b +makedefine LINUXBIOS_RAM-$(CONFIG_UNCOMPRESSED):=linuxbios_ram.bin -makerule linuxbios_payload.bin - depends "linuxbios_c" +makerule linuxbios_ram.bin + depends "linuxbios_ram" action "$(OBJCOPY) -O binary $< $@" end -makerule linuxbios_payload.nrv2b - depends "linuxbios_payload.bin nrv2b" +makerule linuxbios_ram.nrv2b + depends "linuxbios_ram.bin nrv2b" action "./nrv2b e $< $@" end -makerule linuxbios_payload - depends "$(LINUXBIOS_PAYLOAD-1)" - action "cp $(LINUXBIOS_PAYLOAD-1) linuxbios_payload" +makerule linuxbios_ram.rom + depends "$(LINUXBIOS_RAM-1)" + action "cp $(LINUXBIOS_RAM-1) linuxbios_ram.rom" end makerule linuxbios - depends "crt0.o $(INIT-OBJECTS) linuxbios_payload ldscript.ld" + depends "crt0.o $(INIT-OBJECTS) linuxbios_ram.rom ldscript.ld" action "$(CC) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld crt0.o $(INIT-OBJECTS)" action "$(CROSS_COMPILE)nm -n linuxbios | sort > linuxbios.map" end @@ -155,7 +155,7 @@ makerule clean action "rm -f ldscript.ld" action "rm -f a.out *.s *.l *.o *.E *.inc" action "rm -f TAGS tags romcc" - action "rm -f docipl buildrom chips.c *chip.c linuxbios_c* linuxbios_pay*" + action "rm -f docipl buildrom chips.c *chip.c linuxbios_ram* linuxbios_pay*" action "rm -f build_opt_tbl option_table.c crt0.S" end diff --git a/src/config/Options.lb b/src/config/Options.lb index d3800976d4..eb6736f5de 100644 --- a/src/config/Options.lb +++ b/src/config/Options.lb @@ -61,35 +61,10 @@ define ARCH export always comment "Default architecture is i386, options are alpha and ppc" end -define k7 - default none - export used - comment "We're a k7" -end -define k8 - default none - export used - comment "We're a k8" -end -define i586 - default none - export used - comment "We're a 586" -end -define i686 - default none - export used - comment "We're a 686" -end -define i786 - default none - export used - comment "We're a 786" -end -define CPU_FIXUP - default none - export used - comment "Do CPU fixups" +define HAVE_MOVNTI + default 0 + export always + comment "This cpu supports the MOVNTI directive" end ############################################### @@ -702,6 +677,12 @@ end # Misc options ############################################### +define CONFIG_GDB_STUB + default 0 + export used + comment "Compile in gdb stub support?" +end + define HAVE_INIT_TIMER default 0 export always diff --git a/src/config/linuxbios_c.ld b/src/config/linuxbios_c.ld deleted file mode 100644 index 6fa311fc0e..0000000000 --- a/src/config/linuxbios_c.ld +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Memory map: - * - * _RAMBASE - * : data segment - * : bss segment - * : heap - * : stack - */ -/* - * Bootstrap code for the STPC Consumer - * Copyright (c) 1999 by Net Insight AB. All Rights Reserved. - */ - -/* - * Written by Johan Rydberg, based on work by Daniel Kahlin. - * Rewritten by Eric Biederman - */ -/* - * We use ELF as output format. So that we can - * debug the code in some form. - */ -INCLUDE ldoptions - -ENTRY(_start) - -SECTIONS -{ - . = _RAMBASE; - /* - * First we place the code and read only data (typically const declared). - * This get placed in rom. - */ - .text : { - _text = .; - *(.text); - *(.text.*); - . = ALIGN(16); - _etext = .; - } - .rodata : { - _rodata = .; - . = ALIGN(4); - console_drivers = .; - *(.rodata.console_drivers) - econsole_drivers = . ; - . = ALIGN(4); - pci_drivers = . ; - *(.rodata.pci_driver) - epci_drivers = . ; - cpu_drivers = . ; - *(.rodata.cpu_driver) - ecpu_drivers = . ; - *(.rodata) - *(.rodata.*) - /* - * kevinh/Ispiri - Added an align, because the objcopy tool - * incorrectly converts sections that are not long word aligned. - * This breaksthe linuxbios.strip target. - */ - . = ALIGN(4); - - _erodata = .; - } - /* - * After the code we place initialized data (typically initialized - * global variables). This gets copied into ram by startup code. - * __data_start and __data_end shows where in ram this should be placed, - * whereas __data_loadstart and __data_loadend shows where in rom to - * copy from. - */ - .data : { - _data = .; - *(.data) - _edata = .; - } - /* - * bss does not contain data, it is just a space that should be zero - * initialized on startup. (typically uninitialized global variables) - * crt0.S fills between _bss and _ebss with zeroes. - */ - _bss = .; - .bss . : { - *(.bss) - *(.sbss) - *(COMMON) - } - _ebss = .; - _end = .; - . = ALIGN(STACK_SIZE); - _stack = .; - .stack . : { - /* Reserve a stack for each possible cpu */ - . = (CONFIG_MAX_CPUS * STACK_SIZE) ; - } - _estack = .; - _heap = .; - .heap . : { - /* Reserve 256K for the heap */ - . = HEAP_SIZE ; - . = ALIGN(4); - } - _eheap = .; - /* The ram segment - * This is all address of the memory resident copy of linuxBIOS. - */ - _ram_seg = _text; - _eram_seg = _eheap; - /DISCARD/ : { - *(.comment) - *(.note) - *(.note.*) - } -} diff --git a/src/config/linuxbios_ram.ld b/src/config/linuxbios_ram.ld new file mode 100644 index 0000000000..6fa311fc0e --- /dev/null +++ b/src/config/linuxbios_ram.ld @@ -0,0 +1,114 @@ +/* + * Memory map: + * + * _RAMBASE + * : data segment + * : bss segment + * : heap + * : stack + */ +/* + * Bootstrap code for the STPC Consumer + * Copyright (c) 1999 by Net Insight AB. All Rights Reserved. + */ + +/* + * Written by Johan Rydberg, based on work by Daniel Kahlin. + * Rewritten by Eric Biederman + */ +/* + * We use ELF as output format. So that we can + * debug the code in some form. + */ +INCLUDE ldoptions + +ENTRY(_start) + +SECTIONS +{ + . = _RAMBASE; + /* + * First we place the code and read only data (typically const declared). + * This get placed in rom. + */ + .text : { + _text = .; + *(.text); + *(.text.*); + . = ALIGN(16); + _etext = .; + } + .rodata : { + _rodata = .; + . = ALIGN(4); + console_drivers = .; + *(.rodata.console_drivers) + econsole_drivers = . ; + . = ALIGN(4); + pci_drivers = . ; + *(.rodata.pci_driver) + epci_drivers = . ; + cpu_drivers = . ; + *(.rodata.cpu_driver) + ecpu_drivers = . ; + *(.rodata) + *(.rodata.*) + /* + * kevinh/Ispiri - Added an align, because the objcopy tool + * incorrectly converts sections that are not long word aligned. + * This breaksthe linuxbios.strip target. + */ + . = ALIGN(4); + + _erodata = .; + } + /* + * After the code we place initialized data (typically initialized + * global variables). This gets copied into ram by startup code. + * __data_start and __data_end shows where in ram this should be placed, + * whereas __data_loadstart and __data_loadend shows where in rom to + * copy from. + */ + .data : { + _data = .; + *(.data) + _edata = .; + } + /* + * bss does not contain data, it is just a space that should be zero + * initialized on startup. (typically uninitialized global variables) + * crt0.S fills between _bss and _ebss with zeroes. + */ + _bss = .; + .bss . : { + *(.bss) + *(.sbss) + *(COMMON) + } + _ebss = .; + _end = .; + . = ALIGN(STACK_SIZE); + _stack = .; + .stack . : { + /* Reserve a stack for each possible cpu */ + . = (CONFIG_MAX_CPUS * STACK_SIZE) ; + } + _estack = .; + _heap = .; + .heap . : { + /* Reserve 256K for the heap */ + . = HEAP_SIZE ; + . = ALIGN(4); + } + _eheap = .; + /* The ram segment + * This is all address of the memory resident copy of linuxBIOS. + */ + _ram_seg = _text; + _eram_seg = _eheap; + /DISCARD/ : { + *(.comment) + *(.note) + *(.note.*) + } +} -- cgit v1.2.3