/*
- * C Bootstrap code for the LinuxBIOS
+ * C Bootstrap code for the coreboot
*/
-
#include <console/console.h>
#include <version.h>
-#include <boot/tables.h>
#include <device/device.h>
#include <device/pci.h>
#include <delay.h>
#include <stdlib.h>
#include <part/hard_reset.h>
#include <part/init_timer.h>
+#include <boot/tables.h>
#include <boot/elf.h>
+#include <cbfs.h>
+#if CONFIG_HAVE_ACPI_RESUME
+#include <arch/acpi.h>
+#endif
+#if CONFIG_WRITE_HIGH_TABLES
+#include <cbmem.h>
+#endif
/**
- * @brief Main function of the DRAM part of LinuxBIOS.
- *
- * LinuxBIOS is divided into Pre-DRAM part and DRAM part.
+ * @brief Main function of the RAM part of coreboot.
*
+ * Coreboot is divided into Pre-RAM part and RAM part.
*
* Device Enumeration:
* In the dev_enumerate() phase,
*/
+
void hardwaremain(int boot_complete)
{
struct lb_memory *lb_mem;
post_code(0x80);
- /* displayinit MUST PRECEDE ALL PRINTK! */
+ /* console_init() MUST PRECEDE ALL printk()! */
console_init();
post_code(0x39);
- printk_notice("LinuxBIOS-%s%s %s %s...\n",
- linuxbios_version, linuxbios_extra_version, linuxbios_build,
+ printk(BIOS_NOTICE, "coreboot-%s%s %s %s...\n",
+ coreboot_version, coreboot_extra_version, coreboot_build,
(boot_complete)?"rebooting":"booting");
post_code(0x40);
dev_initialize();
post_code(0x89);
+#if CONFIG_WRITE_HIGH_TABLES == 1
+ cbmem_initialize();
+#endif
+#if CONFIG_HAVE_ACPI_RESUME == 1
+ suspend_resume();
+ post_code(0x8a);
+#endif
+
/* Now that we have collected all of our information
* write our configuration tables.
*/
lb_mem = write_tables();
-
-#if CONFIG_FS_PAYLOAD == 1
- filo(lb_mem);
+#if CONFIG_USE_FALLBACK_IMAGE == 1
+ cbfs_load_payload(lb_mem, "fallback/payload");
#else
- elfboot(lb_mem);
+ cbfs_load_payload(lb_mem, "normal/payload");
#endif
+ printk(BIOS_ERR, "Boot failed.\n");
}