diff options
author | Hakim Giydan <hgiydan@marvell.com> | 2016-09-08 10:47:55 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-09-13 16:57:23 +0200 |
commit | 93e6f1a917b6b17c6e62ad0fff1699416ab00d29 (patch) | |
tree | 28a8b82d9fa1da60487fe3b88f89bebc0b400ff4 /src/soc/marvell/mvmap2315/bootblock.c | |
parent | 6a1a36f7e9afc9a9dbdee813613243805e829a85 (diff) |
soc/marvell/mvmap2315: Add load_validate driver
Load_validate: it loads and validates images from
flash using hash values stored in the BDB.
Testing: booted successfully.
Change-Id: I0b00e8c60ed76622d03cb232d5c4273b4077aae7
Signed-off-by: Hakim Giydan <hgiydan@marvell.com>
Reviewed-on: https://review.coreboot.org/16148
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.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/soc/marvell/mvmap2315/bootblock.c b/src/soc/marvell/mvmap2315/bootblock.c index 5aa9eb547b..47bf470abb 100644 --- a/src/soc/marvell/mvmap2315/bootblock.c +++ b/src/soc/marvell/mvmap2315/bootblock.c @@ -17,11 +17,15 @@ #include <stdint.h> #include <stdlib.h> +#include <arch/io.h> #include <bootblock_common.h> #include <console/console.h> #include <timestamp.h> #include <console/uart.h> +#include <soc/addressmap.h> +#include <soc/bdb.h> #include <soc/gic.h> +#include <soc/load_validate.h> #include <soc/uart.h> void bootblock_soc_early_init(void) @@ -37,10 +41,32 @@ void bootblock_soc_early_init(void) void bootblock_soc_init(void) { + struct bdb_pointer bdb_info; + + write32((void *)MVMAP2315_BOOTBLOCK_CB1, 0); + write32((void *)MVMAP2315_BOOTBLOCK_CB2, 0); + + set_bdb_pointers((u8 *)MVMAP2315_BDB_LCM_BASE, &bdb_info); + + printk(BIOS_DEBUG, "loading and validating APMU firmware.\n"); + load_and_validate(&bdb_info, APMU_FIRMWARE); + + printk(BIOS_DEBUG, "loading and validating MCU firmware.\n"); + load_and_validate(&bdb_info, MCU_FIRMWARE); + /* initializing UART1 to free UART0 to be used by romstage */ uart_num = 1; uart_init(uart_num); + while (read32((void *)MVMAP2315_BOOTBLOCK_CB1) != 0x4) + ; + + printk(BIOS_DEBUG, "loading and validating AP_RW firmware.\n"); + load_and_validate(&bdb_info, AP_RW_FIRMWARE); + + write32((void *)MVMAP2315_BOOTBLOCK_CB2, 0x4) + ; + while (1) ; } |