libs-y += lib/
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
libs-y += $(CPUDIR)/
-ifdef SOC
-libs-y += $(CPUDIR)/$(SOC)/
-endif
libs-$(CONFIG_OF_EMBED) += dts/
libs-y += arch/$(ARCH)/lib/
libs-y += fs/
endif
ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
+ # We can't do this yet due to the need for binary blobs
+ # ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
+
# enable combined SPL/u-boot/dtb rules for tegra
ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
u-boot.hex u-boot.srec: u-boot FORCE
$(call if_changed,objcopy)
- OBJCOPYFLAGS_u-boot.bin := -O binary
+ OBJCOPYFLAGS_u-boot.bin := -O binary \
+ $(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
binary_size_check: u-boot.bin FORCE
@file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
$(call if_changed,mkimage)
@dd if=/dev/zero bs=8 count=1 2>/dev/null >> $@
+ # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
+ # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
+ # the middle.
+ ifneq ($(CONFIG_X86_RESET_VECTOR),)
+ rom: u-boot.rom FORCE
+
+ u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin \
+ $(srctree)/board/$(BOARDDIR)/mrc.bin
+ $(objtree)/tools/ifdtool -c -r $(CONFIG_ROM_SIZE) u-boot.tmp
+ if [ -n "$(CONFIG_HAVE_INTEL_ME)" ]; then \
+ $(objtree)/tools/ifdtool -D \
+ $(srctree)/board/$(BOARDDIR)/descriptor.bin u-boot.tmp; \
+ $(objtree)/tools/ifdtool \
+ -i ME:$(srctree)/board/$(BOARDDIR)/me.bin u-boot.tmp; \
+ fi
+ $(objtree)/tools/ifdtool -w \
+ $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-dtb.bin u-boot.tmp
+ $(objtree)/tools/ifdtool -w \
+ $(CONFIG_X86_MRC_START):$(srctree)/board/$(BOARDDIR)/mrc.bin \
+ u-boot.tmp
+ $(objtree)/tools/ifdtool -w \
+ $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin \
+ u-boot.tmp
+ mv u-boot.tmp $@
+
+ OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
+ u-boot-x86-16bit.bin: u-boot FORCE
+ $(call if_changed,objcopy)
+ endif
+
ifneq ($(CONFIG_SUNXI),)
OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
--pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
extra-y = start.o
obj-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o
obj-y += interrupts.o cpu.o call64.o
+
+obj-$(CONFIG_SYS_COREBOOT) += coreboot/
+ obj-$(CONFIG_PCI) += pci.o
#include <pci.h>
#include <asm/pci.h>
- static struct pci_controller coreboot_hose;
-
static void config_pci_bridge(struct pci_controller *hose, pci_dev_t dev,
struct pci_config_table *table)
{
u8 secondary;
hose->read_byte(hose, dev, PCI_SECONDARY_BUS, &secondary);
- hose->last_busno = max(hose->last_busno, secondary);
+ hose->last_busno = max(hose->last_busno, (int)secondary);
pci_hose_scan_bus(hose, secondary);
}
{}
};
- void pci_init_board(void)
+ void board_pci_setup_hose(struct pci_controller *hose)
{
- coreboot_hose.config_table = pci_coreboot_config_table;
- coreboot_hose.first_busno = 0;
- coreboot_hose.last_busno = 0;
-
- pci_set_region(coreboot_hose.regions + 0, 0x0, 0x0, 0xffffffff,
- PCI_REGION_MEM);
- coreboot_hose.region_count = 1;
-
- pci_setup_type1(&coreboot_hose);
-
- pci_register_hose(&coreboot_hose);
+ hose->config_table = pci_coreboot_config_table;
+ hose->first_busno = 0;
+ hose->last_busno = 0;
- pci_hose_scan(&coreboot_hose);
+ pci_set_region(hose->regions + 0, 0x0, 0x0, 0xffffffff,
+ PCI_REGION_MEM);
+ hose->region_count = 1;
}
#include <asm/e820.h>
#include <asm/u-boot-x86.h>
#include <asm/global_data.h>
+ #include <asm/init_helpers.h>
#include <asm/processor.h>
#include <asm/sections.h>
+ #include <asm/zimage.h>
#include <asm/arch/sysinfo.h>
#include <asm/arch/tables.h>
{
int i;
- unsigned num_entries = min(lib_sysinfo.n_memranges, max_entries);
+ unsigned num_entries = min((unsigned)lib_sysinfo.n_memranges, max_entries);
if (num_entries < lib_sysinfo.n_memranges) {
printf("Warning: Limiting e820 map to %d entries.\n",
num_entries);
return (ulong)dest_addr;
}
- int dram_init_f(void)
+ int dram_init(void)
{
int i;
phys_size_t ram_size = 0;
gd->ram_size = ram_size;
if (ram_size == 0)
return -1;
- return 0;
+
+ return calculate_relocation_address();
}
- int dram_init_banksize(void)
+ void dram_init_banksize(void)
{
int i, j;
}
}
}
- return 0;
- }
-
- int dram_init(void)
- {
- return dram_init_banksize();
}
static int display_text_info(void)
{
#ifndef CONFIG_SANDBOX
- ulong bss_start, bss_end;
+ ulong bss_start, bss_end, text_base;
bss_start = (ulong)&__bss_start;
bss_end = (ulong)&__bss_end;
- debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
#ifdef CONFIG_SYS_TEXT_BASE
- CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
+ text_base = CONFIG_SYS_TEXT_BASE;
#else
- CONFIG_SYS_MONITOR_BASE, bss_start, bss_end);
+ text_base = CONFIG_SYS_MONITOR_BASE;
#endif
+
+ debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n",
+ text_base, bss_start, bss_end);
#endif
#ifdef CONFIG_MODEM_SUPPORT
struct sandbox_state *state = state_get_current();
const char *fname = state->fdt_fname;
void *blob;
- ssize_t size;
+ loff_t size;
int err;
int fd;
return -EINVAL;
}
- size = os_get_filesize(fname);
- if (size < 0) {
+ err = os_get_filesize(fname, &size);
+ if (err < 0) {
printf("Failed to file FDT file '%s'\n", fname);
- return -ENOENT;
+ return err;
}
fd = os_open(fname, OS_O_RDONLY);
if (fd < 0) {
gd->irq_sp = gd->start_addr_sp;
# endif
#else
-# ifdef CONFIG_PPC
+# if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
ulong *s;
# endif
s = (ulong *) gd->start_addr_sp;
*s = 0; /* Terminate back chain */
*++s = 0; /* NULL return address */
+# elif defined(CONFIG_MIPS)
+ /* Clear initial stack frame */
+ s = (ulong *) gd->start_addr_sp;
+ *s-- = 0;
+ *s-- = 0;
+ gd->start_addr_sp = (ulong) s;
# endif /* Architecture specific code */
return 0;
setup_mon_len,
setup_fdt,
trace_early_init,
+ initf_malloc,
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/* TODO: can this go into arch_cpu_init()? */
probecpu,
#endif
arch_cpu_init, /* basic arch cpu dependent setup */
- #ifdef CONFIG_X86
- cpu_init_f, /* TODO(sjg@chromium.org): remove */
- # ifdef CONFIG_OF_CONTROL
- find_fdt, /* TODO(sjg@chromium.org): remove */
- # endif
- #endif
mark_bootstage,
#ifdef CONFIG_OF_CONTROL
fdtdec_check_fdt,
#endif
- initf_malloc,
initf_dm,
#if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
#endif
#if defined(CONFIG_HARD_SPI)
init_func_spi,
- #endif
- #ifdef CONFIG_X86
- dram_init_f, /* configure available RAM banks */
- calculate_relocation_address,
#endif
announce_dram_init,
/* TODO: unify all these dram functions? */
- #ifdef CONFIG_ARM
+ #if defined(CONFIG_ARM) || defined(CONFIG_X86)
dram_init, /* configure available RAM banks */
#endif
#if defined(CONFIG_MIPS) || defined(CONFIG_PPC)