aboutsummaryrefslogtreecommitdiff
path: root/src/soc/marvell/mvmap2315/bootblock.c
diff options
context:
space:
mode:
authorHakim Giydan <hgiydan@marvell.com>2016-09-08 10:51:13 -0700
committerMartin Roth <martinroth@google.com>2016-09-13 16:58:01 +0200
commit5251a08d6807ecd76acb78eddbc3bbca4785bfbe (patch)
tree7a88da871ef1e5a65de056c59bccaaca8a34d8f9 /src/soc/marvell/mvmap2315/bootblock.c
parent53620b85be65f5582791ed670a3ccfa9bdcc86ee (diff)
soc/marvell/mvmap2315: Add PMIC driver
Testing: booted successfully. Change-Id: I168206585f403d2259efe424e563982be661df0b Signed-off-by: Hakim Giydan <hgiydan@marvell.com> Reviewed-on: https://review.coreboot.org/16149 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/marvell/mvmap2315/bootblock.c')
-rw-r--r--src/soc/marvell/mvmap2315/bootblock.c28
1 files changed, 26 insertions, 2 deletions
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 <soc/bdb.h>
#include <soc/gic.h>
#include <soc/load_validate.h>
+#include <soc/pmic.h>
#include <soc/uart.h>
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;