Hung-Te Lin (hungte@chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2308
-gerrit
commit 765ff16ba41f077df045be26868f256d7a3a0dfa Author: Hung-Te Lin hungte@chromium.org Date: Thu Feb 7 13:22:29 2013 +0800
armv7/snow: Simplify bootblock.
I2C, power, and max77686 are not required for bootblock to initialize. We only need SPI and clock to load romstage.
Change-Id: Ic863e222871a157ba4279a673775b1e18c6eac0d Signed-off-by: Hung-Te Lin hungte@chromium.org --- src/cpu/samsung/exynos5250/Makefile.inc | 11 ++++------- src/cpu/samsung/exynos5250/uart.c | 4 ++++ src/cpu/samsung/s5p-common/Makefile.inc | 1 - src/drivers/maxim/max77686/Makefile.inc | 1 - src/mainboard/google/snow/Makefile.inc | 4 ---- src/mainboard/google/snow/bootblock.c | 22 ---------------------- src/mainboard/google/snow/romstage.c | 15 ++++++++++++--- 7 files changed, 20 insertions(+), 38 deletions(-)
diff --git a/src/cpu/samsung/exynos5250/Makefile.inc b/src/cpu/samsung/exynos5250/Makefile.inc index 7e11536..3aff95c 100644 --- a/src/cpu/samsung/exynos5250/Makefile.inc +++ b/src/cpu/samsung/exynos5250/Makefile.inc @@ -3,14 +3,11 @@ # image outside of CBFS #INTERMEDIATE += exynos5250_add_bl1
-# Clock init is done in bootblock to support UART output for -# debugging. We may add a Kconfig option to disable clock init -# in the bootblock and try moving it entirely into romstage. -bootblock-y += clock_init.c +# clock and clock_init are included for SPI to work. bootblock-y += clock.c -bootblock-y += pinmux.c -bootblock-y += power.c -bootblock-y += soc.c +bootblock-y += clock_init.c +bootblock-$(CONFIG_EARLY_CONSOLE) += pinmux.c +bootblock-$(CONFIG_EARLY_CONSOLE) += soc.c bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c
romstage-y += clock.c diff --git a/src/cpu/samsung/exynos5250/uart.c b/src/cpu/samsung/exynos5250/uart.c index dacdc10..a6ff139 100644 --- a/src/cpu/samsung/exynos5250/uart.c +++ b/src/cpu/samsung/exynos5250/uart.c @@ -121,6 +121,10 @@ static void exynos5_init_dev(void) // struct s5p_uart *const uart = s5p_get_base_uart(dev_index); struct s5p_uart *uart = (struct s5p_uart *)base_port;
+ // TODO setup pinmux properly by dev_index and base_port, or move this + // to console driver. + exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); + /* enable FIFOs */ writel(0x1, &uart->ufcon); writel(0, &uart->umcon); diff --git a/src/cpu/samsung/s5p-common/Makefile.inc b/src/cpu/samsung/s5p-common/Makefile.inc index 621576d..0f4200c 100644 --- a/src/cpu/samsung/s5p-common/Makefile.inc +++ b/src/cpu/samsung/s5p-common/Makefile.inc @@ -1,5 +1,4 @@ bootblock-y += pwm.c -bootblock-y += s3c24x0_i2c.c bootblock-y += s5p_gpio.c bootblock-y += timer.c
diff --git a/src/drivers/maxim/max77686/Makefile.inc b/src/drivers/maxim/max77686/Makefile.inc index 097b291..a5d7b90 100644 --- a/src/drivers/maxim/max77686/Makefile.inc +++ b/src/drivers/maxim/max77686/Makefile.inc @@ -17,6 +17,5 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ##
-bootblock-$(CONFIG_DRIVER_MAXIM_MAX77686) += max77686.c romstage-$(CONFIG_DRIVER_MAXIM_MAX77686) += max77686.c ramstage-$(CONFIG_DRIVER_MAXIM_MAX77686) += max77686.c diff --git a/src/mainboard/google/snow/Makefile.inc b/src/mainboard/google/snow/Makefile.inc index 04bf543..b56a1a4 100644 --- a/src/mainboard/google/snow/Makefile.inc +++ b/src/mainboard/google/snow/Makefile.inc @@ -17,10 +17,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ##
-# needed for system_clock_init() -bootblock-y += mainboard.c -bootblock-y += memory.c - romstage-y += mainboard.c romstage-y += memory.c romstage-y += romstage.c diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c index be5a99f..b220112 100644 --- a/src/mainboard/google/snow/bootblock.c +++ b/src/mainboard/google/snow/bootblock.c @@ -17,33 +17,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <types.h> -#include <arch/io.h> -#include <device/i2c.h> -#include <cpu/samsung/exynos5250/clk.h> -#include <cpu/samsung/exynos5250/dmc.h> -#include <cpu/samsung/exynos5250/periph.h> -#include <cpu/samsung/exynos5250/clock_init.h> -#include <src/cpu/samsung/exynos5250/power.h> -#include <drivers/maxim/max77686/max77686.h> #include <console/console.h>
-#define I2C0_BASE 0x12c60000 - void bootblock_mainboard_init(void); void bootblock_mainboard_init(void) { - struct mem_timings *mem; - struct arm_clk_ratios *arm_ratios; - - i2c_set_early_reg(I2C0_BASE); - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); - power_init(); - mem = get_mem_timings(); - arm_ratios = get_arm_clk_ratios(); - system_clock_init(mem, arm_ratios); - exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); - console_init(); printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__); } diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index b8e5116..20f4e81 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -24,6 +24,8 @@ #include <cbfs.h> #include <common.h>
+#include <arch/hlt.h> +#include <cpu/samsung/exynos5250/clock_init.h> #include <cpu/samsung/exynos5250/dmc.h> #include <cpu/samsung/exynos5250/setup.h>
@@ -47,9 +49,10 @@ static int board_wakeup_permitted(void)
void main(void) { - struct mem_timings *mem; int ret; void *entry; + struct mem_timings *mem; + struct arm_clk_ratios *arm_ratios;
console_init(); printk(BIOS_INFO, "hello from romstage\n"); @@ -57,8 +60,14 @@ void main(void) mem = get_mem_timings(); if (!mem) { printk(BIOS_CRIT, "Unable to auto-detect memory timings\n"); - while(1); + hlt(); } + arm_ratios = get_arm_clk_ratios(); + system_clock_init(mem, arm_ratios); + + /* Re-initialize console in case clock is changed. */ + console_init(); + printk(BIOS_SPEW, "man: 0x%x type: 0x%x, div: 0x%x, mhz: 0x%x\n", mem->mem_manuf, mem->mem_type, @@ -69,7 +78,7 @@ void main(void) if (ret) { printk(BIOS_ERR, "Memory controller init failed, err: %x\n", ret); - while(1); + hlt(); }
printk(BIOS_INFO, "ddr3_init done\n");