Changeset 5157
- Timestamp:
- Feb 24, 2010 2:58:23 PM (3 years ago)
- Location:
- trunk/src/arch/i386
- Files:
-
- 2 edited
- 2 copied
- 2 moved
-
Kconfig (modified) (1 diff)
-
Makefile.bootblock.inc (moved) (moved from trunk/src/arch/i386/Makefile.tinybootblock.inc) (1 diff)
-
Makefile.inc (modified) (1 diff)
-
include/bootblock_common.h (moved) (moved from trunk/src/arch/i386/init/bootblock.c) (1 diff)
-
init/bootblock_normal.c (copied) (copied from trunk/src/arch/i386/init/bootblock.c) (2 diffs)
-
init/bootblock_simple.c (copied) (copied from trunk/src/arch/i386/init/bootblock.c) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/arch/i386/Kconfig
r5103 r5157 50 50 default y 51 51 52 choice 53 prompt "Bootblock behaviour" 54 default BOOTBLOCK_SIMPLE 55 depends on TINY_BOOTBLOCK 56 57 config BOOTBLOCK_SIMPLE 58 bool "Always load fallback" 59 60 config BOOTBLOCK_NORMAL 61 bool "Switch to normal if CMOS says so" 62 63 endchoice 64 65 config BOOTBLOCK_SOURCE 66 string 67 default "bootblock_simple.c" if BOOTBLOCK_SIMPLE 68 default "bootblock_normal.c" if BOOTBLOCK_NORMAL 69 52 70 config UPDATE_IMAGE 53 71 bool "Update existing coreboot.rom image" -
trunk/src/arch/i386/Makefile.bootblock.inc
r5156 r5157 64 64 $(CC) -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -I$(obj)/bootblock -include $(obj)/config.h -I. -I$(src) $< > $@.new && mv $@.new $@ 65 65 66 $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/ bootblock.c$(obj)/romcc66 $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(obj)/romcc 67 67 $(obj)/romcc $(bootblock_romccflags) -O2 $(ROMCCFLAGS) $(INCLUDES) $< -o $@ 68 68 -
trunk/src/arch/i386/Makefile.inc
r5119 r5157 96 96 97 97 ifeq ($(CONFIG_TINY_BOOTBLOCK),y) 98 include $(src)/arch/i386/Makefile. tinybootblock.inc98 include $(src)/arch/i386/Makefile.bootblock.inc 99 99 else 100 100 include $(src)/arch/i386/Makefile.bigbootblock.inc -
trunk/src/arch/i386/include/bootblock_common.h
r5156 r5157 32 32 asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist)); 33 33 } 34 35 static void main(unsigned long bist)36 {37 if (boot_cpu()) {38 bootblock_northbridge_init();39 bootblock_southbridge_init();40 }41 const char* target1 = "fallback/romstage";42 unsigned long entry;43 entry = findstage(target1);44 if (entry) call(entry, bist);45 asm volatile ("1:\n\thlt\n\tjmp 1b\n\t");46 }47 -
trunk/src/arch/i386/init/bootblock_normal.c
r5156 r5157 1 #define __PRE_RAM__ 2 #if CONFIG_LOGICAL_CPUS && \ 3 (defined(CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT) || defined(CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT)) 4 #include <cpu/x86/lapic/boot_cpu.c> 5 #else 6 #define boot_cpu(x) 1 7 #endif 1 #include <bootblock_common.h> 8 2 9 #ifdef CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT 10 #include CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT 11 #else 12 static void bootblock_northbridge_init(void) { } 13 #endif 14 #ifdef CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT 15 #include CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT 16 #else 17 static void bootblock_southbridge_init(void) { } 18 #endif 19 20 static unsigned long findstage(char* target) 21 { 22 unsigned long entry; 23 asm volatile ( 24 "mov $1f, %%esp\n\t" 25 "jmp walkcbfs\n\t" 26 "1:\n\t" : "=a" (entry) : "S" (target) : "ebx", "ecx", "edi", "esp"); 27 return entry; 28 } 29 30 static void call(unsigned long addr, unsigned long bist) 31 { 32 asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist)); 33 } 3 #include <arch/io.h> 4 #include "arch/romcc_io.h" 5 #include "pc80/mc146818rtc_early.c" 34 6 35 7 static void main(unsigned long bist) … … 39 11 bootblock_southbridge_init(); 40 12 } 41 const char* target1 = "fallback/romstage"; 13 42 14 unsigned long entry; 43 entry = findstage(target1); 15 if (do_normal_boot()) 16 entry = findstage("normal/romstage"); 17 else 18 entry = findstage("fallback/romstage"); 19 44 20 if (entry) call(entry, bist); 21 22 /* run fallback if normal can't be found */ 23 entry = findstage("fallback/romstage"); 24 if (entry) call(entry, bist); 25 26 /* duh. we're stuck */ 45 27 asm volatile ("1:\n\thlt\n\tjmp 1b\n\t"); 46 28 } -
trunk/src/arch/i386/init/bootblock_simple.c
r5156 r5157 1 #define __PRE_RAM__ 2 #if CONFIG_LOGICAL_CPUS && \ 3 (defined(CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT) || defined(CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT)) 4 #include <cpu/x86/lapic/boot_cpu.c> 5 #else 6 #define boot_cpu(x) 1 7 #endif 8 9 #ifdef CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT 10 #include CONFIG_BOOTBLOCK_NORTHBRIDGE_INIT 11 #else 12 static void bootblock_northbridge_init(void) { } 13 #endif 14 #ifdef CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT 15 #include CONFIG_BOOTBLOCK_SOUTHBRIDGE_INIT 16 #else 17 static void bootblock_southbridge_init(void) { } 18 #endif 19 20 static unsigned long findstage(char* target) 21 { 22 unsigned long entry; 23 asm volatile ( 24 "mov $1f, %%esp\n\t" 25 "jmp walkcbfs\n\t" 26 "1:\n\t" : "=a" (entry) : "S" (target) : "ebx", "ecx", "edi", "esp"); 27 return entry; 28 } 29 30 static void call(unsigned long addr, unsigned long bist) 31 { 32 asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist)); 33 } 1 #include <bootblock_common.h> 34 2 35 3 static void main(unsigned long bist)
Note: See TracChangeset
for help on using the changeset viewer.
