Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2025
-gerrit
commit b08602e7b16ccafe437139a407742e589aea7f75
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Tue Dec 11 15:59:08 2012 -0800
Update 3rdparty to it's HEAD
Change-Id: I51137bfb3a25e24028b8a05a39339cc67c784980
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
3rdparty | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/3rdparty b/3rdparty
index b617b81..7eb78b1 160000
--- a/3rdparty
+++ b/3rdparty
@@ -1 +1 @@
-Subproject commit b617b812e3cf1d2c4e60efc90bf8b60232124192
+Subproject commit 7eb78b1109242653c60cccd741951dcb58f51cec
the following patch was just integrated into master:
commit 3600e960b603a610064c6024c275e149944df1ca
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Tue Dec 11 12:49:32 2012 -0800
Fix UART8250 console prototypes
and disable IO mapped UARTs on ARMV7 per default
Change-Id: I712c4677cbc8519323970556718f9bb6327d83c8
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Reviewed-on: http://review.coreboot.org/2021
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Tested-by: build bot (Jenkins)
Build-Tested: build bot (Jenkins) at Tue Dec 11 22:33:44 2012, giving +1
See http://review.coreboot.org/2021 for details.
-gerrit
the following patch was just integrated into master:
commit de48f0fd4213f8d0e2c71cbd3929e629fd76eb96
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Tue Dec 11 11:20:35 2012 -0800
Fix up Maxim MAX77686 driver
... to fit into the naming convention
Change-Id: I4a7d81c4d6674d001fc831df863bd2343f6c636f
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Reviewed-on: http://review.coreboot.org/2020
Reviewed-by: Ronald G. Minnich <rminnich(a)gmail.com>
Tested-by: build bot (Jenkins)
Build-Tested: build bot (Jenkins) at Tue Dec 11 22:19:38 2012, giving +1
See http://review.coreboot.org/2020 for details.
-gerrit
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2018
-gerrit
commit 34c5a26c769dfecb761fcc21ac31e0de08cca74a
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 16:13:43 2012 -0800
Add minimal mainboard support for snow
This is the minimal set of sources that allow the board to build.
These need to be filled in with actual code. But if we get these in upstream
we can stop working against a WIP patch.
Change-Id: I9347a573bb40761f6a12be3ee8febe3ca4be55a3
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/mainboard/Kconfig | 3 +
src/mainboard/google/Kconfig | 35 ++++++
src/mainboard/google/snow/Kconfig | 180 +++++++++++++++++++++++++++++++
src/mainboard/google/snow/Makefile.inc | 36 +++++++
src/mainboard/google/snow/devicetree.cb | 26 +++++
src/mainboard/google/snow/mainboard.c | 34 ++++++
src/mainboard/google/snow/romstage.c | 32 ++++++
src/mainboard/google/snow/smdk5250_spl.c | 78 ++++++++++++++
8 files changed, 424 insertions(+)
diff --git a/src/mainboard/Kconfig b/src/mainboard/Kconfig
index da76327..66168ea 100644
--- a/src/mainboard/Kconfig
+++ b/src/mainboard/Kconfig
@@ -58,6 +58,8 @@ config VENDOR_GETAC
bool "Getac"
config VENDOR_GIGABYTE
bool "GIGABYTE"
+config VENDOR_GOOGLE
+ bool "Google"
config VENDOR_HP
bool "HP"
config VENDOR_IBASE
@@ -158,6 +160,7 @@ source "src/mainboard/ecs/Kconfig"
source "src/mainboard/emulation/Kconfig"
source "src/mainboard/getac/Kconfig"
source "src/mainboard/gigabyte/Kconfig"
+source "src/mainboard/google/Kconfig"
source "src/mainboard/hp/Kconfig"
source "src/mainboard/ibase/Kconfig"
source "src/mainboard/ibm/Kconfig"
diff --git a/src/mainboard/google/Kconfig b/src/mainboard/google/Kconfig
new file mode 100644
index 0000000..cf2fad3
--- /dev/null
+++ b/src/mainboard/google/Kconfig
@@ -0,0 +1,35 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors
+##
+## 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
+##
+if VENDOR_GOOGLE
+
+choice
+ prompt "Mainboard model"
+
+config BOARD_GOOGLE_SNOW
+ bool "Snow"
+
+endchoice
+
+source "src/mainboard/google/snow/Kconfig"
+
+config MAINBOARD_VENDOR
+ string
+ default "Google"
+
+endif # VENDOR_GOOGLE
diff --git a/src/mainboard/google/snow/Kconfig b/src/mainboard/google/snow/Kconfig
new file mode 100644
index 0000000..8c465b2
--- /dev/null
+++ b/src/mainboard/google/snow/Kconfig
@@ -0,0 +1,180 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+if BOARD_GOOGLE_SNOW
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select ARCH_ARMV7
+ select CPU_SAMSUNG_EXYNOS5
+ select HAVE_UART_MEMORY_MAPPED
+ select CONSOLE_SERIAL_NONSTANDARD_MEM # enable serial debugging
+# select EC_GOOGLE_CHROMEEC
+ select BOARD_ROMSIZE_KB_4096
+ select DRIVER_MAXIM_77686
+# select HAVE_ACPI_TABLES
+# select MMCONF_SUPPORT
+# select CHROMEOS
+
+config MAINBOARD_DIR
+ string
+ default google/snow
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "SNOW"
+
+#config MMCONF_BASE_ADDRESS
+# hex
+# default 0xf0000000
+
+#config IRQ_SLOT_COUNT
+# int
+# default 18
+
+config MAX_CPUS
+ int
+ default 2
+
+config MAINBOARD_VENDOR
+ string
+ default "Samsung"
+
+# SPL (second-phase loader) stuff
+config SPL_TEXT_BASE
+ hex
+ default 0x02023400
+ help
+ Location of SPL. Default location is within iRAM region.
+
+# FIXME: increased "SPL" size to get around build issues
+#config SPL_MAX_SIZE
+# hex "SPL executable max size"
+# default 0x3800
+# help
+# Max size of SPL. Default is 14KB
+config SPL_MAX_SIZE
+ hex
+ default 0x8000
+ help
+ Max size of SPL. Let's say 32KB for now...
+
+config DRAM_SIZE_MB
+ int
+ default 2048
+
+config NR_DRAM_BANKS
+ int
+ default 1
+
+choice
+ prompt "Serial Console UART"
+ default CONSOLE_SERIAL_UART3
+ depends on CONSOLE_SERIAL_NONSTANDARD_MEM
+
+config CONSOLE_SERIAL_UART0
+ bool "UART0"
+ help
+ Serial console on UART0
+
+config CONSOLE_SERIAL_UART1
+ bool "UART1"
+ help
+ Serial console on UART1
+
+config CONSOLE_SERIAL_UART2
+ bool "UART2"
+ help
+ Serial console on UART2
+
+config CONSOLE_SERIAL_UART3
+ bool "UART3"
+ help
+ Serial console on UART3
+
+endchoice
+
+config CONSOLE_SERIAL_UART_ADDRESS
+ hex
+ depends on CONSOLE_SERIAL_NONSTANDARD_MEM
+ default 0x12c00000 if CONSOLE_SERIAL_UART0
+ default 0x12c10000 if CONSOLE_SERIAL_UART1
+ default 0x12c20000 if CONSOLE_SERIAL_UART2
+ default 0x12c30000 if CONSOLE_SERIAL_UART3
+ help
+ Map the UART names to the respective MMIO address.
+
+#################################################################
+# stuff from smdk5250.h #
+# FIXME: can we move some of these to exynos5250's Kconfig? #
+#################################################################
+config SYS_I2C_SPEED
+ int
+ default 100000
+
+config SYS_I2C_SLAVE
+ hex
+ default 0x0
+
+config I2C_MULTI_BUS
+ bool
+ default y
+
+#config HARD_I2C
+# bool
+# default y
+#CMD_I2C
+#I2C_EDID
+#DRIVER_S3C24X0_I2C
+
+config VDD_ARM_MV
+ int
+ default 1300 #1.3V
+
+config VDD_INT_UV
+ int
+ default 1012500 # 1.0125v
+
+config VDD_MIF_MV
+ int
+ default 1000 # 1.0v
+
+config VDD_G3D_MV
+ int
+ default 1200 # 1.2v
+
+config VDD_LDO2_MV
+ int
+ default 1500 # 1.5v
+
+config VDD_LDO3_MV
+ int
+ default 1800 # 1.8v
+
+config VDD_LDO5_MV
+ int
+ default 1800 # 1.8v
+
+config VDD_LDO10_MV
+ int
+ default 1800 # 1.8v
+
+######### smdk5250.h ########
+
+endif # BOARD_GOOGLE_SNOW
diff --git a/src/mainboard/google/snow/Makefile.inc b/src/mainboard/google/snow/Makefile.inc
new file mode 100644
index 0000000..01488d0
--- /dev/null
+++ b/src/mainboard/google/snow/Makefile.inc
@@ -0,0 +1,36 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+#romstage-y += romstage.c
+
+# ramstage-y += ec.c
+
+# FIXME: smdk5250_spl and mainboard.c are a mess. In the long
+# run we'll want to replace low-level code that calls mainboard code
+# with mainboard code that calls low-level code with appropriate
+# parameters. Grep around for spl_get_machine_params for examples.
+romstage-y += smdk5250_spl.c
+ramstage-y += smdk5250_spl.c
+#ramstage-y += mainboard.c
+
+# romstage-$(CONFIG_CHROMEOS) += chromeos.c
+
+# FIXME: we should do something similar to x86 platforms for Snow SPDs
+
+SRC_ROOT = $(src)/mainboard/google/snow
diff --git a/src/mainboard/google/snow/devicetree.cb b/src/mainboard/google/snow/devicetree.cb
new file mode 100644
index 0000000..f88835e
--- /dev/null
+++ b/src/mainboard/google/snow/devicetree.cb
@@ -0,0 +1,26 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+# FIXME: this is just a stub for now
+chip cpu/samsung/exynos5250
+ chip drivers/generic/generic # I2C0 controller
+ device i2c 6 on end # ?
+ device i2c 9 on end # ?
+ end
+end
diff --git a/src/mainboard/google/snow/mainboard.c b/src/mainboard/google/snow/mainboard.c
new file mode 100644
index 0000000..00b3e93
--- /dev/null
+++ b/src/mainboard/google/snow/mainboard.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012 The ChromeOS Authors
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <device/device.h>
+
+// mainboard_enable is executed as first thing after
+// enumerate_buses().
+
+static void mainboard_enable(device_t dev)
+{
+ //dev->ops->init = mainboard_init;
+}
+
+struct chip_operations mainboard_ops = {
+ .name = "Samsung/Google ARM ChromeBook",
+ .enable_dev = mainboard_enable,
+};
+
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
new file mode 100644
index 0000000..29e4555
--- /dev/null
+++ b/src/mainboard/google/snow/romstage.c
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The ChromiumOS Authors. 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
+ */
+
+#include <types.h>
+#include <system.h>
+#include <cache.h>
+
+static void mmu_setup(void)
+{
+ dram_bank_mmu_setup(CONFIG_SYS_SDRAM_BASE, CONFIG_DRAM_SIZE_MB * 1024);
+}
+
+void main(unsigned long bist)
+{
+ mmu_setup();
+}
diff --git a/src/mainboard/google/snow/smdk5250_spl.c b/src/mainboard/google/snow/smdk5250_spl.c
new file mode 100644
index 0000000..204e411
--- /dev/null
+++ b/src/mainboard/google/snow/smdk5250_spl.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <arch/gpio.h>
+#include <cpu/samsung/exynos5-common/spl.h>
+#include <cpu/samsung/exynos5250/gpio.h>
+
+#define SIGNATURE 0xdeadbeef
+
+/* Parameters of early board initialization in SPL */
+static struct spl_machine_param machine_param
+ __attribute__((section(".machine_param"))) = {
+ .signature = SIGNATURE,
+ .version = 1,
+ .params = "vmubfasirMw",
+ .size = sizeof(machine_param),
+
+ .mem_iv_size = 0x1f,
+ .mem_type = DDR_MODE_DDR3,
+
+ /*
+ * Set uboot_size to 0x100000 bytes.
+ *
+ * This is an overly conservative value chosen to accommodate all
+ * possible U-Boot image. You are advised to set this value to a
+ * smaller realistic size via scripts that modifies the .machine_param
+ * section of output U-Boot image.
+ */
+ .uboot_size = 0x100000,
+
+ .boot_source = BOOT_MODE_OM,
+ .frequency_mhz = 800,
+ .arm_freq_mhz = 1700,
+ .serial_base = 0x12c30000,
+ .i2c_base = 0x12c60000,
+ .board_rev_gpios = GPIO_D00 | (GPIO_D01 << 16),
+ .mem_manuf = MEM_MANUF_SAMSUNG,
+ .bad_wake_gpio = GPIO_Y10,
+};
+
+struct spl_machine_param *spl_get_machine_params(void)
+{
+ if (machine_param.signature != SIGNATURE) {
+ /* TODO: Call panic() here */
+ while (1)
+ ;
+ }
+
+ return &machine_param;
+}
+
+int board_wakeup_permitted(void)
+{
+ struct spl_machine_param *param = spl_get_machine_params();
+ const int gpio = param->bad_wake_gpio;
+ int is_bad_wake;
+
+ /* We're a bad wakeup if the gpio was defined and was high */
+ is_bad_wake = ((gpio != -1) && gpio_get_value(gpio));
+
+ return !is_bad_wake;
+}
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2020
-gerrit
commit c9386a2f9d57d597d6de02061a3562684a1ec5b4
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Tue Dec 11 11:20:35 2012 -0800
Fix up Maxim MAX77686 driver
... to fit into the naming convention
Change-Id: I4a7d81c4d6674d001fc831df863bd2343f6c636f
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/cpu/samsung/exynos5250/power.c | 2 +-
src/drivers/Kconfig | 1 +
src/drivers/Makefile.inc | 1 +
src/drivers/maxim/Kconfig | 20 +++
src/drivers/maxim/Makefile.inc | 20 +++
src/drivers/maxim/max77686/Kconfig | 24 +++
src/drivers/maxim/max77686/Makefile.inc | 20 +++
src/drivers/maxim/max77686/max77686.c | 257 ++++++++++++++++++++++++++++++++
src/drivers/maxim/max77686/max77686.h | 134 +++++++++++++++++
src/drivers/power/Kconfig | 5 -
src/drivers/power/Makefile.inc | 20 ---
src/drivers/power/max77686.c | 257 --------------------------------
src/drivers/power/max77686.h | 134 -----------------
13 files changed, 478 insertions(+), 417 deletions(-)
diff --git a/src/cpu/samsung/exynos5250/power.c b/src/cpu/samsung/exynos5250/power.c
index f8062d1..7d294ed 100644
--- a/src/cpu/samsung/exynos5250/power.c
+++ b/src/cpu/samsung/exynos5250/power.c
@@ -29,7 +29,7 @@
#include <cpu/samsung/exynos5250/power.h>
#include <cpu/samsung/exynos5250/sysreg.h>
#include <cpu/samsung/exynos5-common/spl.h>
-#include <drivers/power/max77686.h>
+#include <drivers/maxim/max77686/max77686.h>
static void ps_hold_setup(void)
{
diff --git a/src/drivers/Kconfig b/src/drivers/Kconfig
index ef38f34..897b665 100644
--- a/src/drivers/Kconfig
+++ b/src/drivers/Kconfig
@@ -25,6 +25,7 @@ source src/drivers/generic/Kconfig
source src/drivers/i2c/Kconfig
source src/drivers/ics/Kconfig
source src/drivers/ipmi/Kconfig
+source src/drivers/maxim/Kconfig
source src/drivers/oxford/Kconfig
if PC80_SYSTEM
source src/drivers/pc80/Kconfig
diff --git a/src/drivers/Makefile.inc b/src/drivers/Makefile.inc
index a02b705..b2aa0c8 100644
--- a/src/drivers/Makefile.inc
+++ b/src/drivers/Makefile.inc
@@ -22,6 +22,7 @@ subdirs-y += dec
subdirs-y += emulation
subdirs-y += generic
subdirs-y += i2c
+subdirs-y += maxim
subdirs-y += oxford
subdirs-y += realtek
subdirs-y += sil
diff --git a/src/drivers/maxim/Kconfig b/src/drivers/maxim/Kconfig
new file mode 100644
index 0000000..7d0b0ed
--- /dev/null
+++ b/src/drivers/maxim/Kconfig
@@ -0,0 +1,20 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The Chromium OS Authors.
+##
+## 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
+##
+
+source src/drivers/maxim/max77686/Kconfig
diff --git a/src/drivers/maxim/Makefile.inc b/src/drivers/maxim/Makefile.inc
new file mode 100644
index 0000000..31c3d75
--- /dev/null
+++ b/src/drivers/maxim/Makefile.inc
@@ -0,0 +1,20 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The Chromium OS Authors.
+##
+## 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
+##
+
+subdirs-$(CONFIG_DRIVERS_MAXIM_MAX77676) += max77686
diff --git a/src/drivers/maxim/max77686/Kconfig b/src/drivers/maxim/max77686/Kconfig
new file mode 100644
index 0000000..ada06f6
--- /dev/null
+++ b/src/drivers/maxim/max77686/Kconfig
@@ -0,0 +1,24 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors
+##
+## 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
+##
+
+config DRIVER_MAXIM_77686
+ bool
+ default n
+ help
+ Maxim 77686 power regulator
diff --git a/src/drivers/maxim/max77686/Makefile.inc b/src/drivers/maxim/max77686/Makefile.inc
new file mode 100644
index 0000000..3fc7104
--- /dev/null
+++ b/src/drivers/maxim/max77686/Makefile.inc
@@ -0,0 +1,20 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors
+##
+## 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
+##
+
+driver-$(CONFIG_DRIVER_MAXIM_77686) += max77686.c
diff --git a/src/drivers/maxim/max77686/max77686.c b/src/drivers/maxim/max77686/max77686.c
new file mode 100644
index 0000000..8fbcb8f
--- /dev/null
+++ b/src/drivers/maxim/max77686/max77686.c
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Alim Akhtar <alim.akhtar(a)samsung.com>
+ *
+ * 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 <common.h>
+#include <smbus.h>
+#include <max77686.h>
+
+/* Chip register numbers (not exported from this module) */
+enum {
+ REG_BBAT = 0x7e,
+
+ /* Bits for BBAT */
+ BBAT_BBCHOSTEN_MASK = 1 << 0,
+ BBAT_BBCVS_SHIFT = 3,
+ BBAT_BBCVS_MASK = 3 << BBAT_BBCVS_SHIFT,
+};
+
+/*
+ * Max77686 parameters values
+ * see max77686.h for parameters details
+ */
+struct max77686_para max77686_param[] = {/*{regnum, vol_addr, vol_bitpos,
+ vol_bitmask, reg_enaddr, reg_enbitpos, reg_enbitmask, reg_enbiton,
+ reg_enbitoff, vol_min, vol_div}*/
+ {PMIC_BUCK1, 0x11, 0x0, 0x3F, 0x10, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_BUCK2, 0x14, 0x0, 0xFF, 0x12, 0x4, 0x3, 0x1, 0x0, 600, 12500},
+ {PMIC_BUCK3, 0x1E, 0x0, 0xFF, 0x1C, 0x4, 0x3, 0x1, 0x0, 600, 12500},
+ {PMIC_BUCK4, 0x28, 0x0, 0xFF, 0x26, 0x4, 0x3, 0x1, 0x0, 600, 12500},
+ {PMIC_BUCK5, 0x31, 0x0, 0x3F, 0x30, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_BUCK6, 0x33, 0x0, 0x3F, 0x32, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_BUCK7, 0x35, 0x0, 0x3F, 0x34, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_BUCK8, 0x37, 0x0, 0x3F, 0x36, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_BUCK9, 0x39, 0x0, 0x3F, 0x38, 0x0, 0x3, 0x3, 0x0, 750, 50000},
+ {PMIC_LDO1, 0x40, 0x0, 0x3F, 0x40, 0x6, 0x3, 0x3, 0x0, 800, 25000},
+ {PMIC_LDO2, 0x41, 0x0, 0x3F, 0x41, 0x6, 0x3, 0x1, 0x0, 800, 25000},
+ {PMIC_LDO3, 0x42, 0x0, 0x3F, 0x42, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO4, 0x43, 0x0, 0x3F, 0x43, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO5, 0x44, 0x0, 0x3F, 0x44, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO6, 0x45, 0x0, 0x3F, 0x45, 0x6, 0x3, 0x1, 0x0, 800, 25000},
+ {PMIC_LDO7, 0x46, 0x0, 0x3F, 0x46, 0x6, 0x3, 0x1, 0x0, 800, 25000},
+ {PMIC_LDO8, 0x47, 0x0, 0x3F, 0x47, 0x6, 0x3, 0x1, 0x0, 800, 25000},
+ {PMIC_LDO9, 0x48, 0x0, 0x3F, 0x48, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO10, 0x49, 0x0, 0x3F, 0x49, 0x6, 0x3, 0x1, 0x0, 800, 50000},
+ {PMIC_LDO11, 0x4A, 0x0, 0x3F, 0x4A, 0x6, 0x3, 0x1, 0x0, 800, 50000},
+ {PMIC_LDO12, 0x4B, 0x0, 0x3F, 0x4B, 0x6, 0x3, 0x1, 0x0, 800, 50000},
+ {PMIC_LDO13, 0x4C, 0x0, 0x3F, 0x4C, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO14, 0x4D, 0x0, 0x3F, 0x4D, 0x6, 0x3, 0x1, 0x0, 800, 50000},
+ {PMIC_LDO15, 0x4E, 0x0, 0x3F, 0x4E, 0x6, 0x3, 0x1, 0x0, 800, 25000},
+ {PMIC_LDO16, 0x4F, 0x0, 0x3F, 0x4F, 0x6, 0x3, 0x1, 0x0, 800, 50000},
+ {PMIC_LDO17, 0x50, 0x0, 0x3F, 0x50, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO18, 0x51, 0x0, 0x3F, 0x51, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO19, 0x52, 0x0, 0x3F, 0x52, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO20, 0x53, 0x0, 0x3F, 0x53, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO21, 0x54, 0x0, 0x3F, 0x54, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO22, 0x55, 0x0, 0x3F, 0x55, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO23, 0x56, 0x0, 0x3F, 0x56, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO24, 0x57, 0x0, 0x3F, 0x57, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO25, 0x58, 0x0, 0x3F, 0x58, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_LDO26, 0x59, 0x0, 0x3F, 0x59, 0x6, 0x3, 0x3, 0x0, 800, 50000},
+ {PMIC_EN32KHZ_CP, 0x0, 0x0, 0x0, 0x7F, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0},
+};
+
+/*
+ * Write a value to a register
+ *
+ * @param chip_addr i2c addr for max77686
+ * @param reg reg number to write
+ * @param val value to be written
+ *
+ */
+static inline int max77686_i2c_write(unsigned char chip_addr,
+ unsigned int reg, unsigned char val)
+{
+ return i2c_write(chip_addr, reg, 1, &val, 1);
+}
+
+/*
+ * Read a value from a register
+ *
+ * @param chip_addr i2c addr for max77686
+ * @param reg reg number to write
+ * @param val value to be written
+ *
+ */
+static inline int max77686_i2c_read(unsigned char chip_addr,
+ unsigned int reg, unsigned char *val)
+{
+ return i2c_read(chip_addr, reg, 1, val, 1);
+}
+
+/*
+ * Enable the max77686 register
+ *
+ * @param reg register number of buck/ldo to be enabled
+ * @param enable enable or disable bit
+ *
+ * REG_DISABLE = 0,
+ needed to set the buck/ldo enable bit OFF
+ * @return Return 0 if ok, else -1
+ */
+static int max77686_enablereg(enum max77686_regnum reg, int enable)
+{
+ struct max77686_para *pmic;
+ unsigned char read_data;
+ int ret;
+
+ pmic = &max77686_param[reg];
+
+ ret = max77686_i2c_read(MAX77686_I2C_ADDR, pmic->reg_enaddr,
+ &read_data);
+ if (ret != 0) {
+ debug("max77686 i2c read failed.\n");
+ return -1;
+ }
+
+ if (enable == REG_DISABLE) {
+ clrbits_8(&read_data,
+ pmic->reg_enbitmask << pmic->reg_enbitpos);
+ } else {
+ clrsetbits_8(&read_data,
+ pmic->reg_enbitmask << pmic->reg_enbitpos,
+ pmic->reg_enbiton << pmic->reg_enbitpos);
+ }
+
+ ret = max77686_i2c_write(MAX77686_I2C_ADDR,
+ pmic->reg_enaddr, read_data);
+ if (ret != 0) {
+ debug("max77686 i2c write failed.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int max77686_do_volsetting(enum max77686_regnum reg, unsigned int volt,
+ int enable, int volt_units)
+{
+ struct max77686_para *pmic;
+ unsigned char read_data;
+ int vol_level = 0;
+ int ret;
+
+ pmic = &max77686_param[reg];
+
+ if (pmic->vol_addr == 0) {
+ debug("not a voltage register.\n");
+ return -1;
+ }
+
+ ret = max77686_i2c_read(MAX77686_I2C_ADDR, pmic->vol_addr, &read_data);
+ if (ret != 0) {
+ debug("max77686 i2c read failed.\n");
+ return -1;
+ }
+
+ if (volt_units == MAX77686_UV)
+ vol_level = volt - pmic->vol_min * 1000;
+ else
+ vol_level = (volt - pmic->vol_min) * 1000;
+
+ if (vol_level < 0) {
+ debug("Not a valid voltage level to set\n");
+ return -1;
+ }
+ vol_level /= pmic->vol_div;
+
+ clrsetbits_8(&read_data, pmic->vol_bitmask << pmic->vol_bitpos,
+ vol_level << pmic->vol_bitpos);
+
+ ret = max77686_i2c_write(MAX77686_I2C_ADDR, pmic->vol_addr, read_data);
+ if (ret != 0) {
+ debug("max77686 i2c write failed.\n");
+ return -1;
+ }
+
+ ret = max77686_enablereg(reg, enable);
+ if (ret != 0) {
+ debug("Failed to enable buck/ldo.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+int max77686_volsetting(enum max77686_regnum reg, unsigned int volt,
+ int enable, int volt_units)
+{
+ int old_bus = i2c_get_bus_num();
+ int ret;
+
+ i2c_set_bus_num(0);
+ ret = max77686_do_volsetting(reg, volt, enable, volt_units);
+ i2c_set_bus_num(old_bus);
+ return ret;
+}
+
+int max77686_enable_32khz_cp(void)
+{
+ i2c_set_bus_num(0);
+ return max77686_enablereg(PMIC_EN32KHZ_CP, REG_ENABLE);
+}
+
+int max77686_disable_backup_batt(void)
+{
+ unsigned char val;
+ int ret;
+
+ i2c_set_bus_num(0);
+ ret = max77686_i2c_read(MAX77686_I2C_ADDR, REG_BBAT, &val);
+ if (ret) {
+ debug("max77686 i2c read failed\n");
+ return ret;
+ }
+
+ /* If we already have the correct values, exit */
+ if ((val & (BBAT_BBCVS_MASK | BBAT_BBCHOSTEN_MASK)) ==
+ BBAT_BBCVS_MASK)
+ return 0;
+
+ /* First disable charging */
+ val &= ~BBAT_BBCHOSTEN_MASK;
+ ret = max77686_i2c_write(MAX77686_I2C_ADDR, REG_BBAT, val);
+ if (ret) {
+ debug("max77686 i2c write failed\n");
+ return -1;
+ }
+
+ /* Finally select 3.5V to minimize power consumption */
+ val |= BBAT_BBCVS_MASK;
+ ret = max77686_i2c_write(MAX77686_I2C_ADDR, REG_BBAT, val);
+ if (ret) {
+ debug("max77686 i2c write failed\n");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/src/drivers/maxim/max77686/max77686.h b/src/drivers/maxim/max77686/max77686.h
new file mode 100644
index 0000000..345471e
--- /dev/null
+++ b/src/drivers/maxim/max77686/max77686.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Alim Akhtar <alim.akhtar(a)samsung.com>
+ *
+ * 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
+ */
+
+#ifndef __MAX77686_H_
+#define __MAX77686_H_
+
+enum max77686_regnum {
+ PMIC_BUCK1 = 0,
+ PMIC_BUCK2,
+ PMIC_BUCK3,
+ PMIC_BUCK4,
+ PMIC_BUCK5,
+ PMIC_BUCK6,
+ PMIC_BUCK7,
+ PMIC_BUCK8,
+ PMIC_BUCK9,
+ PMIC_LDO1,
+ PMIC_LDO2,
+ PMIC_LDO3,
+ PMIC_LDO4,
+ PMIC_LDO5,
+ PMIC_LDO6,
+ PMIC_LDO7,
+ PMIC_LDO8,
+ PMIC_LDO9,
+ PMIC_LDO10,
+ PMIC_LDO11,
+ PMIC_LDO12,
+ PMIC_LDO13,
+ PMIC_LDO14,
+ PMIC_LDO15,
+ PMIC_LDO16,
+ PMIC_LDO17,
+ PMIC_LDO18,
+ PMIC_LDO19,
+ PMIC_LDO20,
+ PMIC_LDO21,
+ PMIC_LDO22,
+ PMIC_LDO23,
+ PMIC_LDO24,
+ PMIC_LDO25,
+ PMIC_LDO26,
+ PMIC_EN32KHZ_CP,
+};
+
+/**
+ * struct max77686_para - max77686 register parameters
+ * @param vol_addr i2c address of the given buck/ldo register
+ * @param vol_bitpos bit position to be set or clear within register
+ * @param vol_bitmask bit mask value
+ * @param reg_enaddr control register address, which enable the given
+ * given buck/ldo.
+ * @param reg_enbitpos bit position to be enabled
+ * @param reg_enbiton value to be written to buck/ldo to make it ON
+ * @param reg_enbitoff value to be written to buck/ldo to make it OFF
+ * @param vol_min minimum voltage level supported by given buck/ldo
+ * @param vol_div voltage division value of given buck/ldo
+ */
+struct max77686_para {
+ enum max77686_regnum regnum;
+ u8 vol_addr;
+ u8 vol_bitpos;
+ u8 vol_bitmask;
+ u8 reg_enaddr;
+ u8 reg_enbitpos;
+ u8 reg_enbitmask;
+ u8 reg_enbiton;
+ u8 reg_enbitoff;
+ u32 vol_min;
+ u32 vol_div;
+};
+
+/* I2C device address for pmic max77686 */
+#define MAX77686_I2C_ADDR (0x12 >> 1)
+
+enum {
+ REG_DISABLE = 0,
+ REG_ENABLE
+};
+
+enum {
+ MAX77686_MV = 0, /* mili volt */
+ MAX77686_UV /* micro volt */
+};
+
+/**
+ * This function enables the 32KHz coprocessor clock.
+ *
+ * Return 0 if ok, else -1
+ */
+int max77686_enable_32khz_cp(void);
+
+/**
+ * Set the required voltage level of pmic
+ *
+ * @param reg register number of buck/ldo to be set
+ * @param volt voltage level to be set
+ * @param enable enable or disable bit
+ * @param volt_units MAX77686_MV or MAX77686_UV, unit of the
+ * voltage parameters
+ *
+ * @return Return 0 if ok, else -1
+ */
+int max77686_volsetting(enum max77686_regnum reg, unsigned int volt,
+ int enable, int volt_units);
+
+/**
+ * Disable charging of the RTC backup battery
+ *
+ * @return Return 0 if ok, else -1
+ */
+int max77686_disable_backup_batt(void);
+
+#endif /* __MAX77686_PMIC_H_ */
diff --git a/src/drivers/power/Kconfig b/src/drivers/power/Kconfig
deleted file mode 100644
index 84ace13..0000000
--- a/src/drivers/power/Kconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-config DRIVER_MAXIM_77686
- bool "Maxim 77686"
- default n
- help
- Maxim 77686 power regulator
diff --git a/src/drivers/power/Makefile.inc b/src/drivers/power/Makefile.inc
deleted file mode 100644
index 3fc7104..0000000
--- a/src/drivers/power/Makefile.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-##
-## This file is part of the coreboot project.
-##
-## Copyright (C) 2012 The ChromiumOS Authors
-##
-## 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
-##
-
-driver-$(CONFIG_DRIVER_MAXIM_77686) += max77686.c
diff --git a/src/drivers/power/max77686.c b/src/drivers/power/max77686.c
deleted file mode 100644
index 8fbcb8f..0000000
--- a/src/drivers/power/max77686.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics
- * Alim Akhtar <alim.akhtar(a)samsung.com>
- *
- * 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 <common.h>
-#include <smbus.h>
-#include <max77686.h>
-
-/* Chip register numbers (not exported from this module) */
-enum {
- REG_BBAT = 0x7e,
-
- /* Bits for BBAT */
- BBAT_BBCHOSTEN_MASK = 1 << 0,
- BBAT_BBCVS_SHIFT = 3,
- BBAT_BBCVS_MASK = 3 << BBAT_BBCVS_SHIFT,
-};
-
-/*
- * Max77686 parameters values
- * see max77686.h for parameters details
- */
-struct max77686_para max77686_param[] = {/*{regnum, vol_addr, vol_bitpos,
- vol_bitmask, reg_enaddr, reg_enbitpos, reg_enbitmask, reg_enbiton,
- reg_enbitoff, vol_min, vol_div}*/
- {PMIC_BUCK1, 0x11, 0x0, 0x3F, 0x10, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_BUCK2, 0x14, 0x0, 0xFF, 0x12, 0x4, 0x3, 0x1, 0x0, 600, 12500},
- {PMIC_BUCK3, 0x1E, 0x0, 0xFF, 0x1C, 0x4, 0x3, 0x1, 0x0, 600, 12500},
- {PMIC_BUCK4, 0x28, 0x0, 0xFF, 0x26, 0x4, 0x3, 0x1, 0x0, 600, 12500},
- {PMIC_BUCK5, 0x31, 0x0, 0x3F, 0x30, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_BUCK6, 0x33, 0x0, 0x3F, 0x32, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_BUCK7, 0x35, 0x0, 0x3F, 0x34, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_BUCK8, 0x37, 0x0, 0x3F, 0x36, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_BUCK9, 0x39, 0x0, 0x3F, 0x38, 0x0, 0x3, 0x3, 0x0, 750, 50000},
- {PMIC_LDO1, 0x40, 0x0, 0x3F, 0x40, 0x6, 0x3, 0x3, 0x0, 800, 25000},
- {PMIC_LDO2, 0x41, 0x0, 0x3F, 0x41, 0x6, 0x3, 0x1, 0x0, 800, 25000},
- {PMIC_LDO3, 0x42, 0x0, 0x3F, 0x42, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO4, 0x43, 0x0, 0x3F, 0x43, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO5, 0x44, 0x0, 0x3F, 0x44, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO6, 0x45, 0x0, 0x3F, 0x45, 0x6, 0x3, 0x1, 0x0, 800, 25000},
- {PMIC_LDO7, 0x46, 0x0, 0x3F, 0x46, 0x6, 0x3, 0x1, 0x0, 800, 25000},
- {PMIC_LDO8, 0x47, 0x0, 0x3F, 0x47, 0x6, 0x3, 0x1, 0x0, 800, 25000},
- {PMIC_LDO9, 0x48, 0x0, 0x3F, 0x48, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO10, 0x49, 0x0, 0x3F, 0x49, 0x6, 0x3, 0x1, 0x0, 800, 50000},
- {PMIC_LDO11, 0x4A, 0x0, 0x3F, 0x4A, 0x6, 0x3, 0x1, 0x0, 800, 50000},
- {PMIC_LDO12, 0x4B, 0x0, 0x3F, 0x4B, 0x6, 0x3, 0x1, 0x0, 800, 50000},
- {PMIC_LDO13, 0x4C, 0x0, 0x3F, 0x4C, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO14, 0x4D, 0x0, 0x3F, 0x4D, 0x6, 0x3, 0x1, 0x0, 800, 50000},
- {PMIC_LDO15, 0x4E, 0x0, 0x3F, 0x4E, 0x6, 0x3, 0x1, 0x0, 800, 25000},
- {PMIC_LDO16, 0x4F, 0x0, 0x3F, 0x4F, 0x6, 0x3, 0x1, 0x0, 800, 50000},
- {PMIC_LDO17, 0x50, 0x0, 0x3F, 0x50, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO18, 0x51, 0x0, 0x3F, 0x51, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO19, 0x52, 0x0, 0x3F, 0x52, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO20, 0x53, 0x0, 0x3F, 0x53, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO21, 0x54, 0x0, 0x3F, 0x54, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO22, 0x55, 0x0, 0x3F, 0x55, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO23, 0x56, 0x0, 0x3F, 0x56, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO24, 0x57, 0x0, 0x3F, 0x57, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO25, 0x58, 0x0, 0x3F, 0x58, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_LDO26, 0x59, 0x0, 0x3F, 0x59, 0x6, 0x3, 0x3, 0x0, 800, 50000},
- {PMIC_EN32KHZ_CP, 0x0, 0x0, 0x0, 0x7F, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0},
-};
-
-/*
- * Write a value to a register
- *
- * @param chip_addr i2c addr for max77686
- * @param reg reg number to write
- * @param val value to be written
- *
- */
-static inline int max77686_i2c_write(unsigned char chip_addr,
- unsigned int reg, unsigned char val)
-{
- return i2c_write(chip_addr, reg, 1, &val, 1);
-}
-
-/*
- * Read a value from a register
- *
- * @param chip_addr i2c addr for max77686
- * @param reg reg number to write
- * @param val value to be written
- *
- */
-static inline int max77686_i2c_read(unsigned char chip_addr,
- unsigned int reg, unsigned char *val)
-{
- return i2c_read(chip_addr, reg, 1, val, 1);
-}
-
-/*
- * Enable the max77686 register
- *
- * @param reg register number of buck/ldo to be enabled
- * @param enable enable or disable bit
- *
- * REG_DISABLE = 0,
- needed to set the buck/ldo enable bit OFF
- * @return Return 0 if ok, else -1
- */
-static int max77686_enablereg(enum max77686_regnum reg, int enable)
-{
- struct max77686_para *pmic;
- unsigned char read_data;
- int ret;
-
- pmic = &max77686_param[reg];
-
- ret = max77686_i2c_read(MAX77686_I2C_ADDR, pmic->reg_enaddr,
- &read_data);
- if (ret != 0) {
- debug("max77686 i2c read failed.\n");
- return -1;
- }
-
- if (enable == REG_DISABLE) {
- clrbits_8(&read_data,
- pmic->reg_enbitmask << pmic->reg_enbitpos);
- } else {
- clrsetbits_8(&read_data,
- pmic->reg_enbitmask << pmic->reg_enbitpos,
- pmic->reg_enbiton << pmic->reg_enbitpos);
- }
-
- ret = max77686_i2c_write(MAX77686_I2C_ADDR,
- pmic->reg_enaddr, read_data);
- if (ret != 0) {
- debug("max77686 i2c write failed.\n");
- return -1;
- }
-
- return 0;
-}
-
-static int max77686_do_volsetting(enum max77686_regnum reg, unsigned int volt,
- int enable, int volt_units)
-{
- struct max77686_para *pmic;
- unsigned char read_data;
- int vol_level = 0;
- int ret;
-
- pmic = &max77686_param[reg];
-
- if (pmic->vol_addr == 0) {
- debug("not a voltage register.\n");
- return -1;
- }
-
- ret = max77686_i2c_read(MAX77686_I2C_ADDR, pmic->vol_addr, &read_data);
- if (ret != 0) {
- debug("max77686 i2c read failed.\n");
- return -1;
- }
-
- if (volt_units == MAX77686_UV)
- vol_level = volt - pmic->vol_min * 1000;
- else
- vol_level = (volt - pmic->vol_min) * 1000;
-
- if (vol_level < 0) {
- debug("Not a valid voltage level to set\n");
- return -1;
- }
- vol_level /= pmic->vol_div;
-
- clrsetbits_8(&read_data, pmic->vol_bitmask << pmic->vol_bitpos,
- vol_level << pmic->vol_bitpos);
-
- ret = max77686_i2c_write(MAX77686_I2C_ADDR, pmic->vol_addr, read_data);
- if (ret != 0) {
- debug("max77686 i2c write failed.\n");
- return -1;
- }
-
- ret = max77686_enablereg(reg, enable);
- if (ret != 0) {
- debug("Failed to enable buck/ldo.\n");
- return -1;
- }
-
- return 0;
-}
-
-int max77686_volsetting(enum max77686_regnum reg, unsigned int volt,
- int enable, int volt_units)
-{
- int old_bus = i2c_get_bus_num();
- int ret;
-
- i2c_set_bus_num(0);
- ret = max77686_do_volsetting(reg, volt, enable, volt_units);
- i2c_set_bus_num(old_bus);
- return ret;
-}
-
-int max77686_enable_32khz_cp(void)
-{
- i2c_set_bus_num(0);
- return max77686_enablereg(PMIC_EN32KHZ_CP, REG_ENABLE);
-}
-
-int max77686_disable_backup_batt(void)
-{
- unsigned char val;
- int ret;
-
- i2c_set_bus_num(0);
- ret = max77686_i2c_read(MAX77686_I2C_ADDR, REG_BBAT, &val);
- if (ret) {
- debug("max77686 i2c read failed\n");
- return ret;
- }
-
- /* If we already have the correct values, exit */
- if ((val & (BBAT_BBCVS_MASK | BBAT_BBCHOSTEN_MASK)) ==
- BBAT_BBCVS_MASK)
- return 0;
-
- /* First disable charging */
- val &= ~BBAT_BBCHOSTEN_MASK;
- ret = max77686_i2c_write(MAX77686_I2C_ADDR, REG_BBAT, val);
- if (ret) {
- debug("max77686 i2c write failed\n");
- return -1;
- }
-
- /* Finally select 3.5V to minimize power consumption */
- val |= BBAT_BBCVS_MASK;
- ret = max77686_i2c_write(MAX77686_I2C_ADDR, REG_BBAT, val);
- if (ret) {
- debug("max77686 i2c write failed\n");
- return -1;
- }
-
- return 0;
-}
diff --git a/src/drivers/power/max77686.h b/src/drivers/power/max77686.h
deleted file mode 100644
index 345471e..0000000
--- a/src/drivers/power/max77686.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics
- * Alim Akhtar <alim.akhtar(a)samsung.com>
- *
- * 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
- */
-
-#ifndef __MAX77686_H_
-#define __MAX77686_H_
-
-enum max77686_regnum {
- PMIC_BUCK1 = 0,
- PMIC_BUCK2,
- PMIC_BUCK3,
- PMIC_BUCK4,
- PMIC_BUCK5,
- PMIC_BUCK6,
- PMIC_BUCK7,
- PMIC_BUCK8,
- PMIC_BUCK9,
- PMIC_LDO1,
- PMIC_LDO2,
- PMIC_LDO3,
- PMIC_LDO4,
- PMIC_LDO5,
- PMIC_LDO6,
- PMIC_LDO7,
- PMIC_LDO8,
- PMIC_LDO9,
- PMIC_LDO10,
- PMIC_LDO11,
- PMIC_LDO12,
- PMIC_LDO13,
- PMIC_LDO14,
- PMIC_LDO15,
- PMIC_LDO16,
- PMIC_LDO17,
- PMIC_LDO18,
- PMIC_LDO19,
- PMIC_LDO20,
- PMIC_LDO21,
- PMIC_LDO22,
- PMIC_LDO23,
- PMIC_LDO24,
- PMIC_LDO25,
- PMIC_LDO26,
- PMIC_EN32KHZ_CP,
-};
-
-/**
- * struct max77686_para - max77686 register parameters
- * @param vol_addr i2c address of the given buck/ldo register
- * @param vol_bitpos bit position to be set or clear within register
- * @param vol_bitmask bit mask value
- * @param reg_enaddr control register address, which enable the given
- * given buck/ldo.
- * @param reg_enbitpos bit position to be enabled
- * @param reg_enbiton value to be written to buck/ldo to make it ON
- * @param reg_enbitoff value to be written to buck/ldo to make it OFF
- * @param vol_min minimum voltage level supported by given buck/ldo
- * @param vol_div voltage division value of given buck/ldo
- */
-struct max77686_para {
- enum max77686_regnum regnum;
- u8 vol_addr;
- u8 vol_bitpos;
- u8 vol_bitmask;
- u8 reg_enaddr;
- u8 reg_enbitpos;
- u8 reg_enbitmask;
- u8 reg_enbiton;
- u8 reg_enbitoff;
- u32 vol_min;
- u32 vol_div;
-};
-
-/* I2C device address for pmic max77686 */
-#define MAX77686_I2C_ADDR (0x12 >> 1)
-
-enum {
- REG_DISABLE = 0,
- REG_ENABLE
-};
-
-enum {
- MAX77686_MV = 0, /* mili volt */
- MAX77686_UV /* micro volt */
-};
-
-/**
- * This function enables the 32KHz coprocessor clock.
- *
- * Return 0 if ok, else -1
- */
-int max77686_enable_32khz_cp(void);
-
-/**
- * Set the required voltage level of pmic
- *
- * @param reg register number of buck/ldo to be set
- * @param volt voltage level to be set
- * @param enable enable or disable bit
- * @param volt_units MAX77686_MV or MAX77686_UV, unit of the
- * voltage parameters
- *
- * @return Return 0 if ok, else -1
- */
-int max77686_volsetting(enum max77686_regnum reg, unsigned int volt,
- int enable, int volt_units);
-
-/**
- * Disable charging of the RTC backup battery
- *
- * @return Return 0 if ok, else -1
- */
-int max77686_disable_backup_batt(void);
-
-#endif /* __MAX77686_PMIC_H_ */
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2018
-gerrit
commit ac59b0e4901f3d1a0bb2a5a1b6b8141bcc03371d
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 16:13:43 2012 -0800
Add minimal mainboard support for snow
This is the minimal set of sources that allow the board to build.
These need to be filled in with actual code. But if we get these in upstream
we can stop working against a WIP patch.
Change-Id: I9347a573bb40761f6a12be3ee8febe3ca4be55a3
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/mainboard/Kconfig | 3 +
src/mainboard/google/Kconfig | 35 ++++++
src/mainboard/google/snow/Kconfig | 180 +++++++++++++++++++++++++++++++
src/mainboard/google/snow/Makefile.inc | 36 +++++++
src/mainboard/google/snow/devicetree.cb | 26 +++++
src/mainboard/google/snow/mainboard.c | 34 ++++++
src/mainboard/google/snow/romstage.c | 32 ++++++
src/mainboard/google/snow/smdk5250_spl.c | 78 ++++++++++++++
8 files changed, 424 insertions(+)
diff --git a/src/mainboard/Kconfig b/src/mainboard/Kconfig
index da76327..66168ea 100644
--- a/src/mainboard/Kconfig
+++ b/src/mainboard/Kconfig
@@ -58,6 +58,8 @@ config VENDOR_GETAC
bool "Getac"
config VENDOR_GIGABYTE
bool "GIGABYTE"
+config VENDOR_GOOGLE
+ bool "Google"
config VENDOR_HP
bool "HP"
config VENDOR_IBASE
@@ -158,6 +160,7 @@ source "src/mainboard/ecs/Kconfig"
source "src/mainboard/emulation/Kconfig"
source "src/mainboard/getac/Kconfig"
source "src/mainboard/gigabyte/Kconfig"
+source "src/mainboard/google/Kconfig"
source "src/mainboard/hp/Kconfig"
source "src/mainboard/ibase/Kconfig"
source "src/mainboard/ibm/Kconfig"
diff --git a/src/mainboard/google/Kconfig b/src/mainboard/google/Kconfig
new file mode 100644
index 0000000..cf2fad3
--- /dev/null
+++ b/src/mainboard/google/Kconfig
@@ -0,0 +1,35 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors
+##
+## 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
+##
+if VENDOR_GOOGLE
+
+choice
+ prompt "Mainboard model"
+
+config BOARD_GOOGLE_SNOW
+ bool "Snow"
+
+endchoice
+
+source "src/mainboard/google/snow/Kconfig"
+
+config MAINBOARD_VENDOR
+ string
+ default "Google"
+
+endif # VENDOR_GOOGLE
diff --git a/src/mainboard/google/snow/Kconfig b/src/mainboard/google/snow/Kconfig
new file mode 100644
index 0000000..8c465b2
--- /dev/null
+++ b/src/mainboard/google/snow/Kconfig
@@ -0,0 +1,180 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+if BOARD_GOOGLE_SNOW
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select ARCH_ARMV7
+ select CPU_SAMSUNG_EXYNOS5
+ select HAVE_UART_MEMORY_MAPPED
+ select CONSOLE_SERIAL_NONSTANDARD_MEM # enable serial debugging
+# select EC_GOOGLE_CHROMEEC
+ select BOARD_ROMSIZE_KB_4096
+ select DRIVER_MAXIM_77686
+# select HAVE_ACPI_TABLES
+# select MMCONF_SUPPORT
+# select CHROMEOS
+
+config MAINBOARD_DIR
+ string
+ default google/snow
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "SNOW"
+
+#config MMCONF_BASE_ADDRESS
+# hex
+# default 0xf0000000
+
+#config IRQ_SLOT_COUNT
+# int
+# default 18
+
+config MAX_CPUS
+ int
+ default 2
+
+config MAINBOARD_VENDOR
+ string
+ default "Samsung"
+
+# SPL (second-phase loader) stuff
+config SPL_TEXT_BASE
+ hex
+ default 0x02023400
+ help
+ Location of SPL. Default location is within iRAM region.
+
+# FIXME: increased "SPL" size to get around build issues
+#config SPL_MAX_SIZE
+# hex "SPL executable max size"
+# default 0x3800
+# help
+# Max size of SPL. Default is 14KB
+config SPL_MAX_SIZE
+ hex
+ default 0x8000
+ help
+ Max size of SPL. Let's say 32KB for now...
+
+config DRAM_SIZE_MB
+ int
+ default 2048
+
+config NR_DRAM_BANKS
+ int
+ default 1
+
+choice
+ prompt "Serial Console UART"
+ default CONSOLE_SERIAL_UART3
+ depends on CONSOLE_SERIAL_NONSTANDARD_MEM
+
+config CONSOLE_SERIAL_UART0
+ bool "UART0"
+ help
+ Serial console on UART0
+
+config CONSOLE_SERIAL_UART1
+ bool "UART1"
+ help
+ Serial console on UART1
+
+config CONSOLE_SERIAL_UART2
+ bool "UART2"
+ help
+ Serial console on UART2
+
+config CONSOLE_SERIAL_UART3
+ bool "UART3"
+ help
+ Serial console on UART3
+
+endchoice
+
+config CONSOLE_SERIAL_UART_ADDRESS
+ hex
+ depends on CONSOLE_SERIAL_NONSTANDARD_MEM
+ default 0x12c00000 if CONSOLE_SERIAL_UART0
+ default 0x12c10000 if CONSOLE_SERIAL_UART1
+ default 0x12c20000 if CONSOLE_SERIAL_UART2
+ default 0x12c30000 if CONSOLE_SERIAL_UART3
+ help
+ Map the UART names to the respective MMIO address.
+
+#################################################################
+# stuff from smdk5250.h #
+# FIXME: can we move some of these to exynos5250's Kconfig? #
+#################################################################
+config SYS_I2C_SPEED
+ int
+ default 100000
+
+config SYS_I2C_SLAVE
+ hex
+ default 0x0
+
+config I2C_MULTI_BUS
+ bool
+ default y
+
+#config HARD_I2C
+# bool
+# default y
+#CMD_I2C
+#I2C_EDID
+#DRIVER_S3C24X0_I2C
+
+config VDD_ARM_MV
+ int
+ default 1300 #1.3V
+
+config VDD_INT_UV
+ int
+ default 1012500 # 1.0125v
+
+config VDD_MIF_MV
+ int
+ default 1000 # 1.0v
+
+config VDD_G3D_MV
+ int
+ default 1200 # 1.2v
+
+config VDD_LDO2_MV
+ int
+ default 1500 # 1.5v
+
+config VDD_LDO3_MV
+ int
+ default 1800 # 1.8v
+
+config VDD_LDO5_MV
+ int
+ default 1800 # 1.8v
+
+config VDD_LDO10_MV
+ int
+ default 1800 # 1.8v
+
+######### smdk5250.h ########
+
+endif # BOARD_GOOGLE_SNOW
diff --git a/src/mainboard/google/snow/Makefile.inc b/src/mainboard/google/snow/Makefile.inc
new file mode 100644
index 0000000..01488d0
--- /dev/null
+++ b/src/mainboard/google/snow/Makefile.inc
@@ -0,0 +1,36 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+#romstage-y += romstage.c
+
+# ramstage-y += ec.c
+
+# FIXME: smdk5250_spl and mainboard.c are a mess. In the long
+# run we'll want to replace low-level code that calls mainboard code
+# with mainboard code that calls low-level code with appropriate
+# parameters. Grep around for spl_get_machine_params for examples.
+romstage-y += smdk5250_spl.c
+ramstage-y += smdk5250_spl.c
+#ramstage-y += mainboard.c
+
+# romstage-$(CONFIG_CHROMEOS) += chromeos.c
+
+# FIXME: we should do something similar to x86 platforms for Snow SPDs
+
+SRC_ROOT = $(src)/mainboard/google/snow
diff --git a/src/mainboard/google/snow/devicetree.cb b/src/mainboard/google/snow/devicetree.cb
new file mode 100644
index 0000000..f88835e
--- /dev/null
+++ b/src/mainboard/google/snow/devicetree.cb
@@ -0,0 +1,26 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2012 The ChromiumOS Authors. 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
+##
+
+# FIXME: this is just a stub for now
+chip cpu/samsung/exynos5250
+ chip drivers/generic/generic # I2C0 controller
+ device i2c 6 on end # ?
+ device i2c 9 on end # ?
+ end
+end
diff --git a/src/mainboard/google/snow/mainboard.c b/src/mainboard/google/snow/mainboard.c
new file mode 100644
index 0000000..00b3e93
--- /dev/null
+++ b/src/mainboard/google/snow/mainboard.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2012 The ChromeOS Authors
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <device/device.h>
+
+// mainboard_enable is executed as first thing after
+// enumerate_buses().
+
+static void mainboard_enable(device_t dev)
+{
+ //dev->ops->init = mainboard_init;
+}
+
+struct chip_operations mainboard_ops = {
+ .name = "Samsung/Google ARM ChromeBook",
+ .enable_dev = mainboard_enable,
+};
+
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
new file mode 100644
index 0000000..29e4555
--- /dev/null
+++ b/src/mainboard/google/snow/romstage.c
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The ChromiumOS Authors. 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
+ */
+
+#include <types.h>
+#include <system.h>
+#include <cache.h>
+
+static void mmu_setup(void)
+{
+ dram_bank_mmu_setup(CONFIG_SYS_SDRAM_BASE, CONFIG_DRAM_SIZE_MB * 1024);
+}
+
+void main(unsigned long bist)
+{
+ mmu_setup();
+}
diff --git a/src/mainboard/google/snow/smdk5250_spl.c b/src/mainboard/google/snow/smdk5250_spl.c
new file mode 100644
index 0000000..204e411
--- /dev/null
+++ b/src/mainboard/google/snow/smdk5250_spl.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <arch/gpio.h>
+#include <cpu/samsung/exynos5-common/spl.h>
+#include <cpu/samsung/exynos5250/gpio.h>
+
+#define SIGNATURE 0xdeadbeef
+
+/* Parameters of early board initialization in SPL */
+static struct spl_machine_param machine_param
+ __attribute__((section(".machine_param"))) = {
+ .signature = SIGNATURE,
+ .version = 1,
+ .params = "vmubfasirMw",
+ .size = sizeof(machine_param),
+
+ .mem_iv_size = 0x1f,
+ .mem_type = DDR_MODE_DDR3,
+
+ /*
+ * Set uboot_size to 0x100000 bytes.
+ *
+ * This is an overly conservative value chosen to accommodate all
+ * possible U-Boot image. You are advised to set this value to a
+ * smaller realistic size via scripts that modifies the .machine_param
+ * section of output U-Boot image.
+ */
+ .uboot_size = 0x100000,
+
+ .boot_source = BOOT_MODE_OM,
+ .frequency_mhz = 800,
+ .arm_freq_mhz = 1700,
+ .serial_base = 0x12c30000,
+ .i2c_base = 0x12c60000,
+ .board_rev_gpios = GPIO_D00 | (GPIO_D01 << 16),
+ .mem_manuf = MEM_MANUF_SAMSUNG,
+ .bad_wake_gpio = GPIO_Y10,
+};
+
+struct spl_machine_param *spl_get_machine_params(void)
+{
+ if (machine_param.signature != SIGNATURE) {
+ /* TODO: Call panic() here */
+ while (1)
+ ;
+ }
+
+ return &machine_param;
+}
+
+int board_wakeup_permitted(void)
+{
+ struct spl_machine_param *param = spl_get_machine_params();
+ const int gpio = param->bad_wake_gpio;
+ int is_bad_wake;
+
+ /* We're a bad wakeup if the gpio was defined and was high */
+ is_bad_wake = ((gpio != -1) && gpio_get_value(gpio));
+
+ return !is_bad_wake;
+}