On reset, the global variables may not be zero - so zero them explicitly.
static void
ata_init()
{
+ memset(&ATA, 0, sizeof(ATA));
+
// hdidmap and cdidmap init.
u8 device;
for (device=0; device < CONFIG_MAX_ATA_DEVICES; device++) {
coreboot_fill_map()
{
dprintf(3, "Attempting to find coreboot table\n");
+
+ // Init variables set in coreboot table memory scan.
+ PirOffset = 0;
+ RsdpAddr = 0;
+
+ // Find coreboot table.
struct cb_header *cbh = find_cb_header(0, 0x1000);
if (!cbh)
goto fail;
return;
dprintf(3, "init boot device ordering\n");
+ memset(&IPL, 0, sizeof(IPL));
+
// Floppy drive
struct ipl_entry_s *ip = &IPL.table[0];
ip->type = IPL_TYPE_FLOPPY;