storm: Add skeleton support for storm in deptcharge

Add basic skeleton to allow compilation of depthcharge for storm. All the config
files are copied over from nyan.

BUG=None
BRANCH=None
TEST=emerge-storm depthcharge compiles successfully

Change-Id: I3f31b351eb649891976fa9c4dfe52bced8d4de94
Reviewed-on: https://chromium-review.googlesource.com/195642
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
diff --git a/board/storm/defconfig b/board/storm/defconfig
new file mode 100644
index 0000000..b4a0418
--- /dev/null
+++ b/board/storm/defconfig
@@ -0,0 +1,33 @@
+#(TODO Furquan: Copied from nyan. Update variables as required)
+# Arch
+CONFIG_ARCH_ARM=y
+
+# Board
+CONFIG_BOARD="storm"
+
+# Image
+CONFIG_BASE_ADDRESS=0x83000000
+CONFIG_FMAP_OFFSET=0x00100000
+CONFIG_HEAP_SIZE=0x00600000
+CONFIG_KERNEL_START=0x81000000
+
+# Vboot
+CONFIG_EC_SOFTWARE_SYNC=y
+CONFIG_RO_NORMAL_SUPPORT=y
+CONFIG_VIRTUAL_DEV_SWITCH=y
+
+CONFIG_CROSSYSTEM_FDT=y
+CONFIG_NV_STORAGE_CROS_EC=y
+
+# Kernel format
+CONFIG_KERNEL_FIT=y
+CONFIG_KERNEL_FIT_FDT_ADDR=0x9ff00000
+
+# Drivers
+#TODO Furquan: Only those CONFIG options are enabled which are required for
+#skeleton compilation for now. Update as required.
+
+CONFIG_DRIVER_EC_CROS=y
+CONFIG_DRIVER_EC_CROS_SPI=y
+CONFIG_DRIVER_FLASH_SPI=y
+CONFIG_DRIVER_TPM_SLB9635_I2C=y
diff --git a/board/storm/fmap.dts b/board/storm/fmap.dts
new file mode 100644
index 0000000..06a1999
--- /dev/null
+++ b/board/storm/fmap.dts
@@ -0,0 +1,210 @@
+/dts-v1/;
+/*TODO Furquan: Copied from nyan. Update when required */
+/ {
+	model = "Google Storm";
+	config {
+		hwid = "Storm TEST 1";
+	};
+	chromeos-config {
+		/* Enable factory-friendly features. */
+		gbb-flag-dev-screen-short-delay;
+		gbb-flag-force-dev-switch-on;
+		gbb-flag-force-dev-boot-usb;
+		gbb-flag-disable-fw-rollback-check;
+	};
+	flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "chromeos,flashmap";
+		reg = <0x00000000 0x00400000>;
+
+		/* ---- Section: Read-only ---- */
+		wp-ro {
+			label = "wp-ro";
+			reg = <0x00000000 0x00200000>;
+			read-only;
+		};
+
+		ro-section {
+			label = "ro-section";
+			reg = <0x00000000 0x001f0000>;
+			read-only;
+		};
+		ro-boot {
+			label = "coreboot";
+			size = <0x00100000>;
+			read-only;
+			type = "blob coreboot";
+			required;
+		};
+
+		ro-fmap {
+			label = "fmap";
+
+			/* We encourage to align FMAP partition in as large
+			 * block as possible so that flashrom can find it soon.
+			 * For example, aligning to 512KB is better than to
+			 * 256KB. */
+
+			reg = <0x00100000 0x00001000>;
+			read-only;
+			type = "fmap";
+			ver-major = <1>;
+			ver-minor = <0>;
+		};
+
+		ro-gbb {
+			label = "gbb";
+
+			/* GBB offset must be aligned to 4K bytes */
+			reg = <0x00101000 0x000eef00>;
+			read-only;
+			type = "blob gbb";
+		};
+
+		ro-firmware-id {
+			label = "ro-frid";
+			reg = <0x001eff00 0x00000100>;
+			read-only;
+			type = "blobstring fwid";
+		};
+
+		/* ---- Section: Vital-product data (VPD) ---- */
+		ro-vpd {
+			label = "ro-vpd";
+
+			/* VPD offset must be aligned to 4K bytes */
+			reg = <0x001f0000 0x00010000>;
+			read-only;
+			type = "wiped";
+			wipe-value = [ff];
+		};
+
+		/* ---- Section: Rewritable slot A ---- */
+		rw-a {
+			label = "rw-section-a";
+			/* Alignment: 4k (for updating) */
+			reg = <0x00200000 0x00078000>;
+		};
+		rw-a-vblock {
+			label = "vblock-a";
+			/*
+			 * Alignment: 4k (for updating) and must be in start of
+			 * each RW_SECTION.
+			 */
+			reg = <0x00200000 0x00002000>;
+			type = "keyblock boot,ecrwhash,ramstage";
+			with_index;
+			keyblock = "firmware.keyblock";
+			signprivate = "firmware_data_key.vbprivk";
+			version = <1>;
+			kernelkey = "kernel_subkey.vbpubk";
+			preamble-flags = <0>;
+		};
+		rw-a-boot {
+			/* Alignment: no requirement (yet). */
+			label = "fw-main-a";
+			reg = <0x00202000 0x00056000>;
+			type = "blob boot,ecrwhash,ramstage";
+			with_index;
+		};
+		rw-a-ec-boot {
+			label = "ec-main-a";
+			type = "blob ecbin";
+			reg = <0x00258000 0x0001ff00>;
+			with_index;
+		};
+		rw-a-firmware-id {
+			/* Alignment: no requirement. */
+			label = "rw-fwid-a";
+			reg = <0x00277f00 0x00000100>;
+			read-only;
+			type = "blobstring fwid";
+		};
+
+		/* ---- Section: Rewritable shared 16 KB---- */
+		shared-section {
+			/*
+			 * Alignment: 4k (for updating).
+			 * Anything in this range may be updated in recovery.
+			 */
+			label = "rw-shared";
+			reg = <0x00278000 0x00004000>;
+		};
+		shared-data {
+			label = "shared-data";
+			/*
+			 * Alignment: 4k (for random read/write).
+			 * RW firmware can put calibration data here.
+			 */
+			reg = <0x00278000 0x00004000>;
+			type = "wiped";
+			wipe-value = [00];
+		};
+
+		/* ---- Section: Rewritable Event Log 16KB ---- */
+		rw-elog {
+			label = "rw-elog";
+			/* Alignment: 4K (for updating) */
+			reg = <0x0027c000 0x00004000>;
+			type = "wiped";
+			wipe-value = [ff];
+		};
+
+		/* ---- Section: Rewritable slot B ---- */
+		rw-b {
+			label = "rw-section-b";
+			/* Alignment: 4k (for updating) */
+			reg = <0x00280000 0x00078000>;
+		};
+		rw-b-vblock {
+			label = "vblock-b";
+			/*
+			 * Alignment: 4k (for updating) and must be in start of
+			 * each RW_SECTION.
+			 */
+			reg = <0x00280000 0x00002000>;
+			type = "keyblock boot,ecrwhash,ramstage";
+			with_index;
+			keyblock = "firmware.keyblock";
+			signprivate = "firmware_data_key.vbprivk";
+			version = <1>;
+			kernelkey = "kernel_subkey.vbpubk";
+			preamble-flags = <0>;
+		};
+		rw-b-boot {
+			label = "fw-main-b";
+			/* Alignment: no requirement (yet). */
+			reg = <0x00282000 0x00056000>;
+			type = "blob boot,ecrwhash,ramstage";
+			with_index;
+		};
+		rw-b-ec-boot {
+			label = "ec-main-b";
+			type = "blob ecbin";
+			reg = <0x002d8000 0x0001ff00>;
+			with_index;
+		};
+		rw-b-firmware-id {
+			label = "rw-fwid-b";
+			/* Alignment: no requirement. */
+			reg = <0x002f7f00 0x00000100>;
+			read-only;
+			type = "blobstring fwid";
+		};
+
+		/* ---- Section: Rewritable VPD 32 KB ---- */
+		rw-vpd {
+			label = "rw-vpd";
+			/* Alignment: 4k (for updating) */
+			reg = <0x002f8000 0x00008000>;
+			type = "wiped";
+			wipe-value = [ff];
+		};
+
+		rw-legacy {
+			label = "rw-legacy";
+			reg = <0x00300000 0x00100000>;
+		};
+	};
+};
diff --git a/src/board/Kconfig b/src/board/Kconfig
index ca48f1e..1b041e1 100644
--- a/src/board/Kconfig
+++ b/src/board/Kconfig
@@ -70,5 +70,8 @@
 if BOARD = "slippy"
 source src/board/slippy/Kconfig
 endif
+if BOARD = "storm"
+source src/board/storm/Kconfig
+endif
 
 endmenu
diff --git a/src/board/storm/Kconfig b/src/board/storm/Kconfig
new file mode 100644
index 0000000..b13e809
--- /dev/null
+++ b/src/board/storm/Kconfig
@@ -0,0 +1,15 @@
+##
+## Copyright 2014 Google Inc.  All rights reserved.
+##
+## 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
diff --git a/src/board/storm/Makefile.inc b/src/board/storm/Makefile.inc
new file mode 100644
index 0000000..f45aade
--- /dev/null
+++ b/src/board/storm/Makefile.inc
@@ -0,0 +1,20 @@
+##
+## Copyright 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
+##
+
+depthcharge-y += board.c
+#TODO Furquan: Add power_ops.c and power_ops.h when required
+
diff --git a/src/board/storm/board.c b/src/board/storm/board.c
new file mode 100644
index 0000000..3b74c45
--- /dev/null
+++ b/src/board/storm/board.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <libpayload.h>
+
+#include "base/init_funcs.h"
+
+static uint8_t board_id(void)
+{
+	static int id = -1;
+
+	return id;
+}
+
+static int board_setup(void)
+{
+	uint8_t id = board_id();
+
+	return id;
+}
+
+INIT_FUNC(board_setup);