summaryrefslogtreecommitdiff
path: root/src/mainboard/pcengines/apu2/BiosCallOuts.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-01-16 19:58:53 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-01-21 08:50:28 +0100
commitc27df8787801dac421b98c4dbb447e519065ae95 (patch)
treebed7950203810f7140a7a817b851183f8bc5c643 /src/mainboard/pcengines/apu2/BiosCallOuts.c
parent0a06205ec65ea626ab94fa67680476266890044b (diff)
downloadcoreboot-c27df8787801dac421b98c4dbb447e519065ae95.tar.xz
pcengines/apu2: Refactor reading memory strap
Change-Id: Ie4f80619d9417200a007fc65154b97a5bc05f2f8 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/18152 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/mainboard/pcengines/apu2/BiosCallOuts.c')
-rw-r--r--src/mainboard/pcengines/apu2/BiosCallOuts.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mainboard/pcengines/apu2/BiosCallOuts.c b/src/mainboard/pcengines/apu2/BiosCallOuts.c
index bba814412a..fe64d64449 100644
--- a/src/mainboard/pcengines/apu2/BiosCallOuts.c
+++ b/src/mainboard/pcengines/apu2/BiosCallOuts.c
@@ -22,6 +22,7 @@
#include "heapManager.h"
#include "FchPlatform.h"
#include "cbfs.h"
+#include "gpio_ftns.h"
#if IS_ENABLED(CONFIG_HUDSON_IMC_FWM)
#include "imc.h"
#endif
@@ -125,13 +126,12 @@ static AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr)
return AGESA_SUCCESS;
}
-
static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
AGESA_STATUS Status = AGESA_UNSUPPORTED;
#ifdef __PRE_RAM__
AGESA_READ_SPD_PARAMS *info = ConfigPtr;
- int index = 0;
+ u8 index = get_spd_offset();
if (info->MemChannelId > 0)
return AGESA_UNSUPPORTED;
@@ -140,14 +140,7 @@ static AGESA_STATUS board_ReadSpd_from_cbfs(UINT32 Func, UINT32 Data, VOID *Conf
if (info->DimmId != 0)
return AGESA_UNSUPPORTED;
- /* One SPD file contains all 4 options, determine which index to read here, then call into the standard routines*/
-
- u8 *gpio_bank0_ptr = (u8 *)(ACPI_MMIO_BASE + GPIO_BANK0_BASE);
- if (*(gpio_bank0_ptr + (0x40 << 2) + 2) & BIT0) index |= BIT0;
- if (*(gpio_bank0_ptr + (0x41 << 2) + 2) & BIT0) index |= BIT1;
-
- printk(BIOS_INFO, "Reading SPD index %d\n", index);
-
+ /* Read index 0, first SPD_SIZE bytes of spd.bin file. */
if (read_spd_from_cbfs((u8*)info->Buffer, index) < 0)
die("No SPD data\n");