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 f6df8ac9e6817a5a023cb1d1748c97922917f401
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/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 ++++++++++++++
6 files changed, 386 insertions(+)
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;
+}
the following patch was just integrated into master:
commit 0dbb329b7d3edf9c9ac426e31109bdc14b1b7bf2
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 21:27:02 2012 -0800
Remove un-needed i2c.h include
When we need i2c for this cpu we will use the coreboot
smbus code.
Change-Id: I4ba4cc9ae10e5ca830d621ee9c8d9f7bd2129e2f
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2019
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Tue Dec 11 06:41:51 2012, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Tue Dec 11 19:50:27 2012, giving +2
See http://review.coreboot.org/2019 for details.
-gerrit
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2019
-gerrit
commit 261af0dddc7390357feb7fd54545c59e10be31a6
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 21:27:02 2012 -0800
Remove un-needed i2c.h include
When we need i2c for this cpu we will use the coreboot
smbus code.
Change-Id: I4ba4cc9ae10e5ca830d621ee9c8d9f7bd2129e2f
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/cpu/samsung/exynos5250/power.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/cpu/samsung/exynos5250/power.c b/src/cpu/samsung/exynos5250/power.c
index 5135ae6..f8062d1 100644
--- a/src/cpu/samsung/exynos5250/power.c
+++ b/src/cpu/samsung/exynos5250/power.c
@@ -29,7 +29,6 @@
#include <cpu/samsung/exynos5250/power.h>
#include <cpu/samsung/exynos5250/sysreg.h>
#include <cpu/samsung/exynos5-common/spl.h>
-#include <device/i2c.h>
#include <drivers/power/max77686.h>
static void ps_hold_setup(void)
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2016
-gerrit
commit c47c0b6350b8acbd99d6fa4c459ffd295b97c755
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 13:59:07 2012 -0800
Add include file for i2c code
This formalizes a lot of i2c defines that can be placed here.
Change-Id: Id378bac5ae719bd3f5063f18dc8b34486add73d2
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/include/device/i2c.h | 279 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 279 insertions(+)
diff --git a/src/include/device/i2c.h b/src/include/device/i2c.h
new file mode 100644
index 0000000..f1275e3
--- /dev/null
+++ b/src/include/device/i2c.h
@@ -0,0 +1,279 @@
+/*
+ * (C) Copyright 2001
+ * Gerald Van Baren, Custom IDEAS, vanbaren(a)cideas.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
+ *
+ * The original I2C interface was
+ * (C) 2000 by Paolo Scaffardi (arsenio(a)tin.it)
+ * AIRVENT SAM s.p.a - RIMINI(ITALY)
+ * but has been changed substantially.
+ */
+
+#ifndef _I2C_H_
+#define _I2C_H_
+
+/*
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ *
+ * The implementation MUST NOT use static or global variables if the
+ * I2C routines are used to read SDRAM configuration information
+ * because this is done before the memories are initialized. Limited
+ * use of stack-based variables are OK (the initial stack size is
+ * limited).
+ *
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ */
+
+/*
+ * Configuration items.
+ */
+#define I2C_RXTX_LEN 128 /* maximum tx/rx buffer length */
+
+#ifdef CONFIG_I2C_MULTI_BUS
+#define MAX_I2C_BUS 2
+#define I2C_MULTI_BUS 1
+#else
+#define MAX_I2C_BUS 1
+#define I2C_MULTI_BUS 0
+#endif
+
+#if !defined(CONFIG_SYS_MAX_I2C_BUS)
+#define CONFIG_SYS_MAX_I2C_BUS MAX_I2C_BUS
+#endif
+
+/* define the I2C bus number for RTC and DTT if not already done */
+#if !defined(CONFIG_SYS_RTC_BUS_NUM)
+#define CONFIG_SYS_RTC_BUS_NUM 0
+#endif
+#if !defined(CONFIG_SYS_DTT_BUS_NUM)
+#define CONFIG_SYS_DTT_BUS_NUM 0
+#endif
+#if !defined(CONFIG_SYS_SPD_BUS_NUM)
+#define CONFIG_SYS_SPD_BUS_NUM 0
+#endif
+
+#ifndef I2C_SOFT_DECLARATIONS
+# if defined(CONFIG_MPC8260)
+# define I2C_SOFT_DECLARATIONS volatile ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, I2C_PORT);
+# elif defined(CONFIG_8xx)
+# define I2C_SOFT_DECLARATIONS volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+
+# elif (defined(CONFIG_AT91RM9200) || \
+ defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) || \
+ defined(CONFIG_AT91SAM9263)) && !defined(CONFIG_AT91_LEGACY)
+# define I2C_SOFT_DECLARATIONS at91_pio_t *pio = (at91_pio_t *) ATMEL_BASE_PIOA;
+# else
+# define I2C_SOFT_DECLARATIONS
+# endif
+#endif
+
+#ifdef CONFIG_8xx
+/* Set default value for the I2C bus speed on 8xx. In the
+ * future, we'll define these in all 8xx board config files.
+ */
+#ifndef CONFIG_SYS_I2C_SPEED
+#define CONFIG_SYS_I2C_SPEED 50000
+#endif
+#endif
+
+/*
+ * Many boards/controllers/drivers don't support an I2C slave interface so
+ * provide a default slave address for them for use in common code. A real
+ * value for CONFIG_SYS_I2C_SLAVE should be defined for any board which does
+ * support a slave interface.
+ */
+#ifndef CONFIG_SYS_I2C_SLAVE
+#define CONFIG_SYS_I2C_SLAVE 0xfe
+#endif
+
+/*
+ * Initialization, must be called once on start up, may be called
+ * repeatedly to change the speed and slave addresses.
+ */
+void i2c_init(int speed, int slaveaddr);
+void i2c_init_board(void);
+#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
+void i2c_board_late_init(void);
+#endif
+
+#if defined(CONFIG_I2C_MUX)
+
+typedef struct _mux {
+ uchar chip;
+ uchar channel;
+ char *name;
+ struct _mux *next;
+} I2C_MUX;
+
+typedef struct _mux_device {
+ int busid;
+ I2C_MUX *mux; /* List of muxes, to reach the device */
+ struct _mux_device *next;
+} I2C_MUX_DEVICE;
+
+I2C_MUX_DEVICE *i2c_mux_search_device(int id);
+I2C_MUX_DEVICE *i2c_mux_ident_muxstring (uchar *buf);
+int i2x_mux_select_mux(int bus);
+int i2c_mux_ident_muxstring_f (uchar *buf);
+#endif
+
+/*
+ * Probe the given I2C chip address. Returns 0 if a chip responded,
+ * not 0 on failure.
+ */
+int i2c_probe(uchar chip);
+
+/*
+ * Read/Write interface:
+ * chip: I2C chip address, range 0..127
+ * addr: Memory (register) address within the chip
+ * alen: Number of bytes to use for addr (typically 1, 2 for larger
+ * memories, 0 for register type devices with only one
+ * register)
+ * buffer: Where to read/write the data
+ * len: How many bytes to read/write
+ *
+ * Returns: 0 on success, not 0 on failure
+ */
+int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
+int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
+
+/*
+ * Utility routines to read/write registers.
+ */
+static inline u8 i2c_reg_read(u8 addr, u8 reg)
+{
+ u8 buf;
+
+#ifdef CONFIG_8xx
+ /* MPC8xx needs this. Maybe one day we can get rid of it. */
+ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+#ifdef DEBUG
+ printf("%s: addr=0x%02x, reg=0x%02x\n", __func__, addr, reg);
+#endif
+
+ i2c_read(addr, reg, 1, &buf, 1);
+
+ return buf;
+}
+
+static inline void i2c_reg_write(u8 addr, u8 reg, u8 val)
+{
+#ifdef CONFIG_8xx
+ /* MPC8xx needs this. Maybe one day we can get rid of it. */
+ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
+
+#ifdef DEBUG
+ printf("%s: addr=0x%02x, reg=0x%02x, val=0x%02x\n",
+ __func__, addr, reg, val);
+#endif
+
+ i2c_write(addr, reg, 1, &val, 1);
+}
+
+/*
+ * Functions for setting the current I2C bus and its speed
+ */
+
+/*
+ * i2c_set_bus_num:
+ *
+ * Change the active I2C bus. Subsequent read/write calls will
+ * go to this one.
+ *
+ * bus - bus index, zero based
+ *
+ * Returns: 0 on success, not 0 on failure
+ *
+ */
+int i2c_set_bus_num(unsigned int bus);
+
+/*
+ * i2c_get_bus_num:
+ *
+ * Returns index of currently active I2C bus. Zero-based.
+ */
+
+unsigned int i2c_get_bus_num(void);
+
+/*
+ * i2c_set_bus_speed:
+ *
+ * Change the speed of the active I2C bus
+ *
+ * speed - bus speed in Hz
+ *
+ * Returns: 0 on success, not 0 on failure
+ *
+ */
+int i2c_set_bus_speed(unsigned int);
+
+/*
+ * i2c_get_bus_speed:
+ *
+ * Returns speed of currently active I2C bus in Hz
+ */
+
+unsigned int i2c_get_bus_speed(void);
+
+/* NOTE: These two functions MUST be always_inline to avoid code growth! */
+static inline unsigned int I2C_GET_BUS(void) __attribute__((always_inline));
+static inline unsigned int I2C_GET_BUS(void)
+{
+ return I2C_MULTI_BUS ? i2c_get_bus_num() : 0;
+}
+
+static inline void I2C_SET_BUS(unsigned int bus) __attribute__((always_inline));
+static inline void I2C_SET_BUS(unsigned int bus)
+{
+ if (I2C_MULTI_BUS)
+ i2c_set_bus_num(bus);
+}
+
+/*
+ * Set an early register base for a given i2c peripheral.
+ * This is used to access a single i2c bus early on in the boot sequence.
+ *
+ * @param base: The base address of the i2c peripheral's register map
+ */
+void i2c_set_early_reg(unsigned int base);
+
+/**
+ * Find the I2C bus number by given a FDT I2C node.
+ *
+ * @param blob Device tree blbo
+ * @param node FDT I2C node to find
+ * @return the number of I2C bus (zero based), or -1 on error
+ */
+int i2c_get_bus_num_fdt(const void *blob, int node);
+
+/**
+ * Reset the I2C bus represented by the given a FDT I2C node.
+ *
+ * @param blob Device tree blbo
+ * @param node FDT I2C node to find
+ * @return 0 if port was reset, -1 if not found
+ */
+int i2c_reset_port_fdt(const void *blob, int node);
+
+#endif /* _I2C_H_ */
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2018
-gerrit
commit 5d4b0b84066ccdbe3eee4527acb37932fa557f78
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/google/snow/Kconfig | 161 +++++++++++++++++++++++++++++++
src/mainboard/google/snow/Makefile.inc | 36 +++++++
src/mainboard/google/snow/board.h | 33 +++++++
src/mainboard/google/snow/devicetree.cb | 7 ++
src/mainboard/google/snow/mainboard.c | 37 +++++++
src/mainboard/google/snow/romstage.c | 33 +++++++
src/mainboard/google/snow/smdk5250_spl.c | 81 ++++++++++++++++
7 files changed, 388 insertions(+)
diff --git a/src/mainboard/google/snow/Kconfig b/src/mainboard/google/snow/Kconfig
new file mode 100644
index 0000000..98ffa0e
--- /dev/null
+++ b/src/mainboard/google/snow/Kconfig
@@ -0,0 +1,161 @@
+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 "SPL executable base"
+ 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 "SPL executable max size"
+ default 0x8000
+ help
+ Max size of SPL. Let's say 32KB for now...
+
+config DRAM_SIZE_MB
+ int "DRAM size (MB)"
+ default 2048
+
+config NR_DRAM_BANKS
+ int "Number of DRAM banks"
+ 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/board.h b/src/mainboard/google/snow/board.h
new file mode 100644
index 0000000..bedd740
--- /dev/null
+++ b/src/mainboard/google/snow/board.h
@@ -0,0 +1,33 @@
+/*
+ * Board header file for Exynos boards
+ *
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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 __SAMSUNG_BOARD_H
+#define __SAMSUNG_BOARD_H
+
+/* Init the SPI driver */
+void spi_init(void);
+
+/* Init the I2C driver */
+void board_i2c_init(const void *blob);
+
+#endif
diff --git a/src/mainboard/google/snow/devicetree.cb b/src/mainboard/google/snow/devicetree.cb
new file mode 100644
index 0000000..1d9d553
--- /dev/null
+++ b/src/mainboard/google/snow/devicetree.cb
@@ -0,0 +1,7 @@
+# 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..8e51b73
--- /dev/null
+++ b/src/mainboard/google/snow/mainboard.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 The ChromeOS Authors
+ *
+ * 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 <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..a059f2b
--- /dev/null
+++ b/src/mainboard/google/snow/romstage.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2010 coresystems GmbH
+ * Copyright (C) 2011 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..f3a88f3
--- /dev/null
+++ b/src/mainboard/google/snow/smdk5250_spl.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ *
+ * 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 <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;
+}
the following patch was just integrated into master:
commit ae06e61ee388c02f4c446cb6af65980070de87ce
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Mon Dec 10 14:51:09 2012 -0800
Correct the location of the include file
The max include file is in src/drivers/power.
Change-Id: I2e663b472cade17fc50edbb449c0e54fd4a991eb
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
Reviewed-on: http://review.coreboot.org/2017
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
Build-Tested: build bot (Jenkins) at Mon Dec 10 23:58:18 2012, giving +1
Reviewed-By: David Hendricks <dhendrix(a)chromium.org> at Tue Dec 11 02:21:36 2012, giving +2
See http://review.coreboot.org/2017 for details.
-gerrit
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2018
-gerrit
commit ad1018829dd9a9c526caae9313f60b95f10bf6ea
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/google/snow/Kconfig | 161 +++++++++++++++++++++++++++++++
src/mainboard/google/snow/Makefile.inc | 36 +++++++
src/mainboard/google/snow/board.h | 33 +++++++
src/mainboard/google/snow/devicetree.cb | 7 ++
src/mainboard/google/snow/mainboard.c | 37 +++++++
src/mainboard/google/snow/romstage.c | 33 +++++++
src/mainboard/google/snow/smdk5250_spl.c | 81 ++++++++++++++++
7 files changed, 388 insertions(+)
diff --git a/src/mainboard/google/snow/Kconfig b/src/mainboard/google/snow/Kconfig
new file mode 100644
index 0000000..98ffa0e
--- /dev/null
+++ b/src/mainboard/google/snow/Kconfig
@@ -0,0 +1,161 @@
+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 "SPL executable base"
+ 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 "SPL executable max size"
+ default 0x8000
+ help
+ Max size of SPL. Let's say 32KB for now...
+
+config DRAM_SIZE_MB
+ int "DRAM size (MB)"
+ default 2048
+
+config NR_DRAM_BANKS
+ int "Number of DRAM banks"
+ 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/board.h b/src/mainboard/google/snow/board.h
new file mode 100644
index 0000000..bedd740
--- /dev/null
+++ b/src/mainboard/google/snow/board.h
@@ -0,0 +1,33 @@
+/*
+ * Board header file for Exynos boards
+ *
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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 __SAMSUNG_BOARD_H
+#define __SAMSUNG_BOARD_H
+
+/* Init the SPI driver */
+void spi_init(void);
+
+/* Init the I2C driver */
+void board_i2c_init(const void *blob);
+
+#endif
diff --git a/src/mainboard/google/snow/devicetree.cb b/src/mainboard/google/snow/devicetree.cb
new file mode 100644
index 0000000..1d9d553
--- /dev/null
+++ b/src/mainboard/google/snow/devicetree.cb
@@ -0,0 +1,7 @@
+# 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..8e51b73
--- /dev/null
+++ b/src/mainboard/google/snow/mainboard.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 The ChromeOS Authors
+ *
+ * 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 <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..a059f2b
--- /dev/null
+++ b/src/mainboard/google/snow/romstage.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2010 coresystems GmbH
+ * Copyright (C) 2011 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..f3a88f3
--- /dev/null
+++ b/src/mainboard/google/snow/smdk5250_spl.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ *
+ * 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 <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;
+}
Dave Frodin (dave.frodin(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1983
-gerrit
commit 1f33e8f212ddc7fd76f6b661b24243af4c34a91b
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Wed Dec 5 17:22:47 2012 -0700
coreinfo: changes to get the USB keyboard working
A call to usb_initialize() was needed. Also needed to set several
curses flags. One to prevent keystrokes echoing to the display,
and one to allow extended keystrokes (like the KEY_F(n)) to be
seen when calling getch();
Change-Id: I495b42055a54603e4efb92b2845051434d88432d
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
payloads/coreinfo/coreinfo.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/payloads/coreinfo/coreinfo.c b/payloads/coreinfo/coreinfo.c
index 7e8b201..97538a0 100644
--- a/payloads/coreinfo/coreinfo.c
+++ b/payloads/coreinfo/coreinfo.c
@@ -271,6 +271,10 @@ int main(void)
{
int i, j;
+#if defined(CONFIG_USB)
+ usb_initialize();
+#endif
+
initscr();
start_color();
@@ -292,6 +296,9 @@ int main(void)
categories[i].modules[j]->init();
}
+ noecho(); /* don't let curses echo keyboard chars */
+ keypad(stdscr, TRUE); /* allow KEY_F(n) keys to be seen */
+
loop();
return 0;