diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/Config.lb | 41 | ||||
-rw-r--r-- | src/arch/i386/init/crt0.S.lb | 17 | ||||
-rw-r--r-- | src/arch/i386/init/ldscript.lb | 70 | ||||
-rw-r--r-- | src/arch/i386/init/ldscript_fallback.lb | 75 | ||||
-rw-r--r-- | src/arch/i386/lib/Config.lb | 7 | ||||
-rw-r--r-- | src/arch/i386/lib/copy_and_run.c | 53 | ||||
-rw-r--r-- | src/arch/ppc/Config.lb | 7 |
7 files changed, 14 insertions, 256 deletions
diff --git a/src/arch/i386/Config.lb b/src/arch/i386/Config.lb index 380d05ba4d..e5e587c8f7 100644 --- a/src/arch/i386/Config.lb +++ b/src/arch/i386/Config.lb @@ -1,45 +1,29 @@ -uses CONFIG_CBFS uses CONFIG_SMP uses CONFIG_PRECOMPRESSED_PAYLOAD uses CONFIG_USE_INIT uses CONFIG_HAVE_FAILOVER_BOOT uses CONFIG_USE_FAILOVER_IMAGE uses CONFIG_USE_FALLBACK_IMAGE -uses CONFIG_CBFS init init/crt0.S.lb -if CONFIG_CBFS - if CONFIG_USE_FAILOVER_IMAGE - else - initobject /src/lib/cbfs.o - initobject /src/lib/lzma.o - end +if CONFIG_USE_FAILOVER_IMAGE +else + initobject /src/lib/cbfs.o + initobject /src/lib/lzma.o end if CONFIG_HAVE_FAILOVER_BOOT if CONFIG_USE_FAILOVER_IMAGE ldscript init/ldscript_failover.lb else - if CONFIG_CBFS ldscript init/ldscript_cbfs.lb - else - ldscript init/ldscript.lb - end end else - if CONFIG_CBFS - if CONFIG_USE_FALLBACK_IMAGE - ldscript init/ldscript_fallback_cbfs.lb - else - ldscript init/ldscript_cbfs.lb - end + if CONFIG_USE_FALLBACK_IMAGE + ldscript init/ldscript_fallback_cbfs.lb else - if CONFIG_USE_FALLBACK_IMAGE - ldscript init/ldscript_fallback.lb - else - ldscript init/ldscript.lb - end + ldscript init/ldscript_cbfs.lb end end @@ -82,13 +66,6 @@ end # catch the case where there is no compression makedefine PAYLOAD-1:=payload -if CONFIG_CBFS -else -# match the case where a compression type is specified. -makedefine PAYLOAD-$(CONFIG_COMPRESSED_PAYLOAD_NRV2B):=payload.nrv2b -makedefine PAYLOAD-$(CONFIG_COMPRESSED_PAYLOAD_LZMA):=payload.lzma -end - # catch the case where there is precompression. Yes, this bites. if CONFIG_PRECOMPRESSED_PAYLOAD makedefine PAYLOAD-1:=payload @@ -105,8 +82,8 @@ if CONFIG_USE_FAILOVER_IMAGE else makerule coreboot.rom depends "coreboot.strip buildrom $(PAYLOAD-1)" - action "PAYLOAD=$(PAYLOAD-1); if [ $(CONFIG_CBFS) -eq 1 ]; then PAYLOAD=/dev/null; touch cbfs-support; fi; ./buildrom $< $@ $$PAYLOAD $(CONFIG_ROM_IMAGE_SIZE) $(CONFIG_ROM_SECTION_SIZE)" - action "if [ $(CONFIG_COMPRESSED_PAYLOAD_LZMA) -eq 1 -a $(CONFIG_CBFS) -eq 1 ]; then echo l > cbfs-support; fi" + action "touch cbfs-support; ./buildrom $< $@ /dev/null $(CONFIG_ROM_IMAGE_SIZE) $(CONFIG_ROM_SECTION_SIZE)" + action "if [ $(CONFIG_COMPRESSED_PAYLOAD_LZMA) -eq 1 ]; then echo l > cbfs-support; fi" end end diff --git a/src/arch/i386/init/crt0.S.lb b/src/arch/i386/init/crt0.S.lb index 9e8968510d..95764ae596 100644 --- a/src/arch/i386/init/crt0.S.lb +++ b/src/arch/i386/init/crt0.S.lb @@ -74,19 +74,8 @@ __main: movl $0x4000000, %esp movl %esp, %ebp pushl %esi -#if CONFIG_CBFS == 1 pushl $str_coreboot_ram_name call cbfs_and_run_core -#else - movl $_liseg, %esi - movl $_iseg, %edi - movl $_eiseg, %ecx - subl %edi, %ecx - pushl %ecx - pushl %edi - pushl %esi - call copy_and_run_core -#endif .Lhlt: intel_chip_post_macro(0xee) /* post fe */ @@ -148,12 +137,10 @@ str_pre_main: .string "Jumping to coreboot.\r\n" #endif /* ASM_CONSOLE_LOGLEVEL > BIOS_DEBUG */ -#if CONFIG_CBFS == 1 -# if CONFIG_USE_FALLBACK_IMAGE == 1 +#if CONFIG_USE_FALLBACK_IMAGE == 1 str_coreboot_ram_name: .string "fallback/coreboot_ram" -# else +#else str_coreboot_ram_name: .string "normal/coreboot_ram" -# endif #endif #endif /* CONFIG_USE_DCACHE_RAM */ diff --git a/src/arch/i386/init/ldscript.lb b/src/arch/i386/init/ldscript.lb deleted file mode 100644 index 0ed5c47f53..0000000000 --- a/src/arch/i386/init/ldscript.lb +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Memory map: - * - * CONFIG_RAMBASE - * : data segment - * : bss segment - * : heap - * : stack - * CONFIG_ROMBASE - * : coreboot text - * : readonly text - */ -/* - * 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. - */ -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") -OUTPUT_ARCH(i386) - -/* -ENTRY(_start) -*/ - -TARGET(binary) -INPUT(coreboot_ram.rom) -SECTIONS -{ - . = CONFIG_ROMBASE; - - .ram . : { - _ram = . ; - coreboot_ram.rom(*) - _eram = . ; - } - - /* This section might be better named .setup */ - .rom . : { - _rom = .; - *(.rom.text); - *(.rom.data); - *(.rodata.*); - *(.rom.data.*); - . = ALIGN(16); - _erom = .; - } - - _lrom = LOADADDR(.rom); - _elrom = LOADADDR(.rom) + SIZEOF(.rom); - _iseg = CONFIG_RAMBASE; - _eiseg = _iseg + SIZEOF(.ram); - _liseg = _ram; - _eliseg = _eram; - - /DISCARD/ : { - *(.comment) - *(.comment.*) - *(.note) - *(.note.*) - } -} diff --git a/src/arch/i386/init/ldscript_fallback.lb b/src/arch/i386/init/ldscript_fallback.lb deleted file mode 100644 index 6d41cbde87..0000000000 --- a/src/arch/i386/init/ldscript_fallback.lb +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Memory map: - * - * CONFIG_RAMBASE - * : data segment - * : bss segment - * : heap - * : stack - * CONFIG_ROMBASE - * : coreboot text - * : readonly text - */ -/* - * 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. - */ -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") -OUTPUT_ARCH(i386) - -/* -ENTRY(_start) -*/ - -TARGET(binary) -INPUT(coreboot_ram.rom) -SECTIONS -{ - . = CONFIG_ROMBASE; - - .ram . : { - _ram = . ; - coreboot_ram.rom(*) - _eram = . ; - } - - /* cut _start into last 64k*/ - _x = .; - . = (_x < (CONFIG_ROMBASE - 0x10000 + CONFIG_ROM_IMAGE_SIZE)) ? (CONFIG_ROMBASE - 0x10000 + CONFIG_ROM_IMAGE_SIZE) : _x; - - /* This section might be better named .setup */ - .rom . : { - _rom = .; - *(.rom.text); - *(.rom.data); - *(.init.rodata.*); - *(.rodata.*); - *(.rom.data.*); - . = ALIGN(16); - _erom = .; - } - - _lrom = LOADADDR(.rom); - _elrom = LOADADDR(.rom) + SIZEOF(.rom); - _iseg = CONFIG_RAMBASE; - _eiseg = _iseg + SIZEOF(.ram); - _liseg = _ram; - _eliseg = _eram; - - /DISCARD/ : { - *(.comment) - *(.note) - *(.comment.*) - *(.note.*) - } -} diff --git a/src/arch/i386/lib/Config.lb b/src/arch/i386/lib/Config.lb index 0a07e3b9be..1d434e24a4 100644 --- a/src/arch/i386/lib/Config.lb +++ b/src/arch/i386/lib/Config.lb @@ -1,7 +1,6 @@ uses CONFIG_USE_INIT uses CONFIG_USE_PRINTK_IN_CAR uses CONFIG_USE_FAILOVER_IMAGE -uses CONFIG_CBFS object c_start.S object cpu.c @@ -15,9 +14,5 @@ initobject printk_init.o if CONFIG_USE_FAILOVER_IMAGE else - if CONFIG_CBFS - initobject cbfs_and_run.o - else - initobject copy_and_run.o - end + initobject cbfs_and_run.o end diff --git a/src/arch/i386/lib/copy_and_run.c b/src/arch/i386/lib/copy_and_run.c deleted file mode 100644 index 9cec90a81c..0000000000 --- a/src/arch/i386/lib/copy_and_run.c +++ /dev/null @@ -1,53 +0,0 @@ -/* by yhlu 6.2005 - moved from nrv2v.c and some lines from crt0.S - 2006/05/02 - stepan: move nrv2b to an extra file. -*/ - -#include <console/console.h> -#include <stdint.h> -#include <string.h> - -#if CONFIG_COMPRESS -#define ENDIAN 0 -#define BITSIZE 32 -#include "../lib/nrv2b.c" -#endif - -void copy_and_run_core(u8 *src, u8 *dst, unsigned long ilen, unsigned ebp) -{ - unsigned long olen; - -#if CONFIG_USE_INIT - printk_spew("src=%08x\r\n",src); - printk_spew("dst=%08x\r\n",dst); -#else - print_spew("src="); print_spew_hex32((uint32_t)src); print_spew("\r\n"); - print_spew("dst="); print_spew_hex32((uint32_t)dst); print_spew("\r\n"); -#endif - -#if !CONFIG_COMPRESS - print_debug("Copying image to RAM.\r\n"); - memcpy(src, dst, ilen); - olen = ilen; -#else - print_debug("Uncompressing image to RAM.\r\n"); -// dump_mem(src, src+0x100); - olen = unrv2b(src, dst, &ilen); -#endif - -// dump_mem(dst, dst+0x100); -#if CONFIG_USE_INIT - printk_spew("image length = %08x\r\n", olen); -#else - print_spew("image length = "); print_spew_hex32(olen); print_spew("\r\n"); -#endif - print_debug("Jumping to image.\r\n"); - - __asm__ volatile ( - "movl %%eax, %%ebp\n\t" - "cli\n\t" - "jmp *%%edi\n\t" - :: "a"(ebp), "D"(dst) - ); - -} diff --git a/src/arch/ppc/Config.lb b/src/arch/ppc/Config.lb index aba64c1f98..0b06eef37e 100644 --- a/src/arch/ppc/Config.lb +++ b/src/arch/ppc/Config.lb @@ -1,4 +1,3 @@ -uses CONFIG_CBFS ldscript init/ldscript.lb makerule coreboot.strip @@ -11,10 +10,8 @@ makerule coreboot.rom action "cp $< $@" end -if CONFIG_CBFS - initobject /src/lib/cbfs.o - initobject /src/lib/lzma.o -end +initobject /src/lib/cbfs.o +initobject /src/lib/lzma.o dir init dir lib |