From fe8b788a12b225ae45ecb26625cfd2588d193ff3 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Thu, 22 May 2014 08:22:51 -0700 Subject: [PATCH] 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 Original-Reviewed-on: https://chromium-review.googlesource.com/201082 Original-Reviewed-by: Aaron Durbin (cherry picked from commit f40e447cee84ebd04ab8a57250d0f56f508d52f2) Signed-off-by: Marc Jones Change-Id: I9c10b08c3e640642e3c75696a233051bb34a2123 Reviewed-on: http://review.coreboot.org/8006 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/samus/Makefile.inc | 31 +------------ src/mainboard/google/samus/romstage.c | 2 +- src/mainboard/google/samus/spd/Makefile.inc | 46 +++++++++++++++++++ .../google/samus/{ => spd}/elpida_4Gb.spd.hex | 0 .../google/samus/{ => spd}/elpida_8Gb.spd.hex | 0 .../google/samus/{ => spd}/empty.spd.hex | 0 .../samus/{ => spd}/samsung_4Gb.spd.hex | 0 .../samus/{ => spd}/samsung_8Gb.spd.hex | 0 src/mainboard/google/samus/{ => spd}/spd.c | 4 +- src/mainboard/google/samus/{ => spd}/spd.h | 0 10 files changed, 51 insertions(+), 32 deletions(-) create mode 100644 src/mainboard/google/samus/spd/Makefile.inc rename src/mainboard/google/samus/{ => spd}/elpida_4Gb.spd.hex (100%) rename src/mainboard/google/samus/{ => spd}/elpida_8Gb.spd.hex (100%) rename src/mainboard/google/samus/{ => spd}/empty.spd.hex (100%) rename src/mainboard/google/samus/{ => spd}/samsung_4Gb.spd.hex (100%) rename src/mainboard/google/samus/{ => spd}/samsung_8Gb.spd.hex (100%) rename src/mainboard/google/samus/{ => spd}/spd.c (97%) rename src/mainboard/google/samus/{ => spd}/spd.h (100%) diff --git a/src/mainboard/google/samus/Makefile.inc b/src/mainboard/google/samus/Makefile.inc index f23352f471..502204e990 100644 --- a/src/mainboard/google/samus/Makefile.inc +++ b/src/mainboard/google/samus/Makefile.inc @@ -17,6 +17,8 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +subdirs-y += spd + ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c romstage-y += chromeos.c @@ -26,32 +28,3 @@ smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c romstage-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 diff --git a/src/mainboard/google/samus/romstage.c b/src/mainboard/google/samus/romstage.c index f0609c84a7..9af4ffbc5c 100644 --- a/src/mainboard/google/samus/romstage.c +++ b/src/mainboard/google/samus/romstage.c @@ -26,7 +26,7 @@ #include #include #include -#include "spd.h" +#include #include "gpio.h" void mainboard_romstage_entry(struct romstage_params *rp) diff --git a/src/mainboard/google/samus/spd/Makefile.inc b/src/mainboard/google/samus/spd/Makefile.inc new file mode 100644 index 0000000000..657a09d01e --- /dev/null +++ b/src/mainboard/google/samus/spd/Makefile.inc @@ -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 diff --git a/src/mainboard/google/samus/elpida_4Gb.spd.hex b/src/mainboard/google/samus/spd/elpida_4Gb.spd.hex similarity index 100% rename from src/mainboard/google/samus/elpida_4Gb.spd.hex rename to src/mainboard/google/samus/spd/elpida_4Gb.spd.hex diff --git a/src/mainboard/google/samus/elpida_8Gb.spd.hex b/src/mainboard/google/samus/spd/elpida_8Gb.spd.hex similarity index 100% rename from src/mainboard/google/samus/elpida_8Gb.spd.hex rename to src/mainboard/google/samus/spd/elpida_8Gb.spd.hex diff --git a/src/mainboard/google/samus/empty.spd.hex b/src/mainboard/google/samus/spd/empty.spd.hex similarity index 100% rename from src/mainboard/google/samus/empty.spd.hex rename to src/mainboard/google/samus/spd/empty.spd.hex diff --git a/src/mainboard/google/samus/samsung_4Gb.spd.hex b/src/mainboard/google/samus/spd/samsung_4Gb.spd.hex similarity index 100% rename from src/mainboard/google/samus/samsung_4Gb.spd.hex rename to src/mainboard/google/samus/spd/samsung_4Gb.spd.hex diff --git a/src/mainboard/google/samus/samsung_8Gb.spd.hex b/src/mainboard/google/samus/spd/samsung_8Gb.spd.hex similarity index 100% rename from src/mainboard/google/samus/samsung_8Gb.spd.hex rename to src/mainboard/google/samus/spd/samsung_8Gb.spd.hex diff --git a/src/mainboard/google/samus/spd.c b/src/mainboard/google/samus/spd/spd.c similarity index 97% rename from src/mainboard/google/samus/spd.c rename to src/mainboard/google/samus/spd/spd.c index 4371da9bd8..331fc6dc0f 100644 --- a/src/mainboard/google/samus/spd.c +++ b/src/mainboard/google/samus/spd/spd.c @@ -24,8 +24,8 @@ #include #include #include -#include "gpio.h" -#include "spd.h" +#include +#include static void mainboard_print_spd_info(uint8_t spd[]) { diff --git a/src/mainboard/google/samus/spd.h b/src/mainboard/google/samus/spd/spd.h similarity index 100% rename from src/mainboard/google/samus/spd.h rename to src/mainboard/google/samus/spd/spd.h