add static memory init

Change-Id: I8072282a3271d0459cecb7979cf01b331341f72e
This commit is contained in:
Alexander Couzens 2017-10-21 06:46:52 +02:00
parent db1d912133
commit d5ea03ddb8
5 changed files with 92 additions and 7 deletions

View File

@ -1,3 +1,6 @@
subdirs-y += spd
romstage-y += early_southbridge.c
romstage-y += romstage.c
romstage-y += gpio.c
ramstage-y += gnvs.c

View File

@ -63,9 +63,3 @@ void mainboard_config_superio(void)
pilot_early_init(SERIAL_DEV); //config port is being taken from SERIAL_DEV
}
/* FIXME: Put proper SPD map here. */
void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{
read_spd(&spd[1], 0x51, id_only);
read_spd(&spd[3], 0x53, id_only);
}

View File

@ -1 +1,42 @@
/* dummy file */
/*
* This file is part of the coreboot project.
* Copyright (C) 2017 Alexander Couzens <lynxis@fe80.eu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <stdint.h>
#include <string.h>
#include <lib.h>
#include <arch/byteorder.h>
#include <cbfs.h>
#include <console/console.h>
#include <northbridge/intel/sandybridge/raminit_native.h>
void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{
uint8_t *spd_file;
size_t spd_file_len;
spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
&spd_file_len);
if (!spd_file)
die("SPD data not found.");
if (spd_file_len < 256)
die("Missing SPD data.");
memcpy(&spd[0], spd_file, 256);
memcpy(&spd[1], spd_file, 256);
memcpy(&spd[2], spd_file, 256);
memcpy(&spd[3], spd_file, 256);
}

View File

@ -0,0 +1,31 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2017 Alexander Couzens <lynxis@fe80.eu>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; version 2 of the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
SPD_BIN = $(obj)/spd.bin
SPD_SOURCES = lynxis.hex
SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f))
# Include spd ROM data
$(SPD_BIN): $(SPD_DEPS)
for f in $+; \
do for c in $$(cat $$f | grep -v ^#); \
do printf $$(printf '\%o' 0x$$c); \
done; \
done > $@
cbfs-files-y += spd.bin
spd.bin-file := $(SPD_BIN)
spd.bin-type := spd

View File

@ -0,0 +1,16 @@
92 11 0b 03 04 00 00 01 03 52 01 08 0c 00 00 80
e4 78 6c 30 6c 11 20 81 28 08 3c 3c 00 f0 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0b df
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00