From 5251a08d6807ecd76acb78eddbc3bbca4785bfbe Mon Sep 17 00:00:00 2001 From: Hakim Giydan Date: Thu, 8 Sep 2016 10:51:13 -0700 Subject: soc/marvell/mvmap2315: Add PMIC driver Testing: booted successfully. Change-Id: I168206585f403d2259efe424e563982be661df0b Signed-off-by: Hakim Giydan Reviewed-on: https://review.coreboot.org/16149 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/marvell/mvmap2315/bootblock.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/soc/marvell/mvmap2315/bootblock.c') diff --git a/src/soc/marvell/mvmap2315/bootblock.c b/src/soc/marvell/mvmap2315/bootblock.c index 8d7b0cbfd9..22a8387f7f 100644 --- a/src/soc/marvell/mvmap2315/bootblock.c +++ b/src/soc/marvell/mvmap2315/bootblock.c @@ -27,6 +27,7 @@ #include #include #include +#include #include void bootblock_soc_early_init(void) @@ -43,6 +44,7 @@ void bootblock_soc_early_init(void) void bootblock_soc_init(void) { struct bdb_pointer bdb_info; + u32 boot_path; write32((void *)MVMAP2315_BOOTBLOCK_CB1, 0); write32((void *)MVMAP2315_BOOTBLOCK_CB2, 0); @@ -54,8 +56,30 @@ void bootblock_soc_init(void) apmu_start(); - printk(BIOS_DEBUG, "loading and validating MCU firmware.\n"); - load_and_validate(&bdb_info, MCU_FIRMWARE); + if (!(read32((void *)MVMAP2315_LOWPWR_REG) & MVMAP2315_LOWPWR_FLAG)) { + printk(BIOS_DEBUG, "loading and validating MCU firmware.\n"); + load_and_validate(&bdb_info, MCU_FIRMWARE); + mcu_start(); + boot_path = get_boot_path(); + } else { + printk(BIOS_DEBUG, "Low power restart. Skip MCU code load.\n"); + boot_path = get_boot_path(); + } + + switch (boot_path) { + case NO_BOOT: + no_boot(); + break; + case CHARGING_SCREEN: + charging_screen(); + break; + case FULL_BOOT: + full_boot(); + break; + } + + printk(BIOS_DEBUG, "Powering up the AP core0.\n"); + ap_start((void *)MVMAP2315_ROMSTAGE_BASE); /* initializing UART1 to free UART0 to be used by romstage */ uart_num = 1; -- cgit v1.2.3