samus: Move SPD related information to spd directory

Put all the SPD related information in one place including
the onboard SPD sources and the board specific parsing.

BUG=chrome-os-partner:28234
TEST=Build and boot on samus

Original-Change-Id: If5cd826ecc9cc856008b7c29aa3cfade5ae7f685
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/201082
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit f40e447cee84ebd04ab8a57250d0f56f508d52f2)
Signed-off-by: Marc Jones <marc.jones@se-eng.com>

Change-Id: I9c10b08c3e640642e3c75696a233051bb34a2123
Reviewed-on: http://review.coreboot.org/8006
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Duncan Laurie 2014-05-22 08:22:51 -07:00 committed by Marc Jones
parent 0aa06cbf18
commit fe8b788a12
10 changed files with 51 additions and 32 deletions

View File

@ -17,6 +17,8 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
## ##
subdirs-y += spd
ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c
romstage-y += chromeos.c romstage-y += chromeos.c
@ -26,32 +28,3 @@ smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
romstage-y += pei_data.c romstage-y += pei_data.c
ramstage-y += pei_data.c ramstage-y += pei_data.c
## DIMM SPD for on-board memory
romstage-y += spd.c
SPD_BIN = $(obj)/spd.bin
# Order of names in SPD_SOURCES is important!
# { GPIO69, GPIO68, GPIO67 }
SPD_SOURCES = empty # 0: { 0, 0, 0 }
SPD_SOURCES += elpida_4Gb # 1: { 0, 0, 1 }
SPD_SOURCES += empty # 2: { 0, 1, 0 }
SPD_SOURCES += elpida_8Gb # 3: { 0, 1, 1 }
SPD_SOURCES += empty # 4: { 1, 0, 0 }
SPD_SOURCES += samsung_8Gb # 5: { 1, 0, 1 }
SPD_SOURCES += samsung_4Gb # 6: { 1, 1, 0 }
SPD_SOURCES += empty # 7: { 1, 1, 1 }
SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/$(f).spd.hex)
# Include spd rom data
$(SPD_BIN): $(SPD_DEPS)
for f in $+; \
do for c in $$(cat $$f | grep -v ^#); \
do echo -e -n "\\x$$c"; \
done; \
done > $@
cbfs-files-y += spd.bin
spd.bin-file := $(SPD_BIN)
spd.bin-type := 0xab

View File

@ -26,7 +26,7 @@
#include <broadwell/pei_data.h> #include <broadwell/pei_data.h>
#include <broadwell/pei_wrapper.h> #include <broadwell/pei_wrapper.h>
#include <broadwell/romstage.h> #include <broadwell/romstage.h>
#include "spd.h" #include <mainboard/google/samus/spd/spd.h>
#include "gpio.h" #include "gpio.h"
void mainboard_romstage_entry(struct romstage_params *rp) void mainboard_romstage_entry(struct romstage_params *rp)

View File

@ -0,0 +1,46 @@
##
## This file is part of the coreboot project.
##
## Copyright (C) 2014 Google Inc.
##
## 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.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
romstage-y += spd.c
SPD_BIN = $(obj)/spd.bin
# { GPIO69, GPIO68, GPIO67 }
SPD_SOURCES = empty # 0: { 0, 0, 0 }
SPD_SOURCES += elpida_4Gb # 1: { 0, 0, 1 }
SPD_SOURCES += empty # 2: { 0, 1, 0 }
SPD_SOURCES += elpida_8Gb # 3: { 0, 1, 1 }
SPD_SOURCES += empty # 4: { 1, 0, 0 }
SPD_SOURCES += samsung_8Gb # 5: { 1, 0, 1 }
SPD_SOURCES += samsung_4Gb # 6: { 1, 1, 0 }
SPD_SOURCES += empty # 7: { 1, 1, 1 }
SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
# Include spd rom data
$(SPD_BIN): $(SPD_DEPS)
for f in $+; \
do for c in $$(cat $$f | grep -v ^#); \
do echo -e -n "\\x$$c"; \
done; \
done > $@
cbfs-files-y += spd.bin
spd.bin-file := $(SPD_BIN)
spd.bin-type := 0xab

View File

@ -24,8 +24,8 @@
#include <broadwell/gpio.h> #include <broadwell/gpio.h>
#include <broadwell/pei_data.h> #include <broadwell/pei_data.h>
#include <broadwell/romstage.h> #include <broadwell/romstage.h>
#include "gpio.h" #include <mainboard/google/samus/gpio.h>
#include "spd.h" #include <mainboard/google/samus/spd/spd.h>
static void mainboard_print_spd_info(uint8_t spd[]) static void mainboard_print_spd_info(uint8_t spd[])
{ {