diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 897f942e7a..9e6f39388b 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -127,8 +127,9 @@ $(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o $(Q)# leave a .o with full symbols in it for debugging. $(Q)cd $(obj); $(LD) -R $(obj)/stage0.o -Ttext 0x1000 \ - -o $(obj)/linuxbios.stage2.o stage2.o device.o \ - device_util.o root_device.o elfboot.o compute_ip_checksum.o mem.o malloc.o clog2.o mainboard.o \ + --entry=stage2 -o $(obj)/linuxbios.stage2.o \ + stage2.o device.o device_util.o root_device.o elfboot.o \ + compute_ip_checksum.o mem.o malloc.o clog2.o mainboard.o \ statictree.o $(Q)objcopy -O binary $(obj)/linuxbios.stage2.o $(obj)/linuxbios.stage2 diff --git a/arch/x86/cachemain.c b/arch/x86/cachemain.c index 7a69cfc720..b97672b5aa 100644 --- a/arch/x86/cachemain.c +++ b/arch/x86/cachemain.c @@ -63,13 +63,17 @@ void stage1_main(u32 bist) int ret; struct mem_file archive, result; int elfboot_mem(struct lb_memory *mem, void *where, int size); + /* HACK -- fake memory table for now */ - struct lb_memory mem = { + static struct lb_memory mem = { .tag = LB_TAG_MEMORY, .size = 1, - .map = { - { .start = 0, .size = (32*1024*1024), .type = LB_MEM_RAM} - } + .map = { { + .start = { .lo = 0, .hi = 0 }, + .size = { .lo = (32*1024*1024), .hi = 0 }, + .type = LB_MEM_RAM + } } + }; post_code(0x02); @@ -228,7 +232,7 @@ printk(BIOS_INFO, "Start search at 0x%x, size %d\n", archive.start, archive.len) ret = elfboot_mem(&mem, result.start, result.len); - printk("elfboot_mem returns %d\n", ret); + printk(BIOS_INFO, "elfboot_mem returns %d\n", ret); die ("FATAL: This is as far as it goes\n"); } diff --git a/lib/elfboot.c b/lib/elfboot.c index 6c545efdce..717c8ddada 100644 --- a/lib/elfboot.c +++ b/lib/elfboot.c @@ -47,7 +47,7 @@ setupmalloc(void *s, int size) static void *localmalloc(int nbytes) { - char *ret; + unsigned char *ret; if (nbytes > arenasize) return NULL; diff --git a/mainboard/emulation/qemu-i386/Makefile b/mainboard/emulation/qemu-i386/Makefile index 1cca0f45d7..1f87be316c 100644 --- a/mainboard/emulation/qemu-i386/Makefile +++ b/mainboard/emulation/qemu-i386/Makefile @@ -42,7 +42,7 @@ $(obj)/linuxbios.initram: $(obj)/stage0.init $(obj)/stage0.o # initram links against stage0 $(Q)$(CC) $(INITCFLAGS) -c $(src)/mainboard/$(MAINBOARDDIR)/initram.c -o $(obj)/initram.o $(Q)$(LD) -R $(obj)/stage0.o -Ttext 0x80000 $(obj)/initram.o \ - -o $(obj)/linuxbios.initram.o + --entry=main -o $(obj)/linuxbios.initram.o $(Q)objcopy -O binary $(obj)/linuxbios.initram.o $(obj)/linuxbios.initram diff --git a/util/dtc/flattree.c b/util/dtc/flattree.c index 1ce8320b44..dd6f1d7174 100644 --- a/util/dtc/flattree.c +++ b/util/dtc/flattree.c @@ -496,7 +496,7 @@ static void linuxbios_emit_property(void *e, char *label) fprintf(f, "\tu32 p%d = \tOF_DT_PROP;\n", unique++); } -static void linuxbios_emit_special(void *e, struct node *tree) +static void linuxbios_emit_special(FILE *e, struct node *tree) { FILE *f = e; struct property *prop; @@ -871,7 +871,7 @@ void dt_to_blob(FILE *f, struct boot_info *bi, int version, static void dump_stringtable_asm(FILE *f, struct data strbuf) { - char *p; + unsigned char *p; int len; p = strbuf.val; @@ -971,7 +971,7 @@ void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys) static void dump_stringtable_C(FILE *f, struct data strbuf) { - char *p; + unsigned char *p; int len; p = strbuf.val;