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