• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootblock_common.h>
4 #include <console/console.h>
5 #include <symbols.h>
6 
7 #include "mmu.h"
8 #include <soc/usbl_if.h>
9 
dump_usbl_report(int section,sbl_ro_info * info)10 static void dump_usbl_report(int section, sbl_ro_info *info)
11 {
12 	int i, num_log_entries;
13 
14 	num_log_entries = info->num_log_entries;
15 	if (!num_log_entries)
16 		return;
17 
18 	printk(BIOS_INFO, "  Section %d log:\n", section);
19 	for (i = 0; i < num_log_entries; i++)
20 		printk(BIOS_INFO, "    %-5d:%2.2x:%.*s\n",
21 		       info->log[i].time_stamp,
22 		       info->log[i].type,
23 		       sizeof(info->log[i].msg),
24 		       info->log[i].msg);
25 }
26 
bootblock_mainboard_init(void)27 void bootblock_mainboard_init(void)
28 {
29 	int i;
30 
31 	setup_mmu(DRAM_NOT_INITIALIZED);
32 
33 	if (((uintptr_t)maskrom_param < (uintptr_t)&_sram) ||
34 	    ((uintptr_t)maskrom_param > (uintptr_t)&_esram)) {
35 		printk(BIOS_INFO, "No uber-sbl parameter detected\n");
36 		return;
37 	}
38 
39 	/* Is maskrom parameter address set to a sensible value? */
40 	if ((maskrom_param->start_magic != UBER_SBL_SHARED_INFO_START_MAGIC) ||
41 	    (maskrom_param->end_magic != UBER_SBL_SHARED_INFO_END_MAGIC)) {
42 		printk(BIOS_INFO, "Uber-sbl: invalid magic!\n");
43 	} else {
44 		printk(BIOS_INFO, "Uber-sbl version: %s\n",
45 		       maskrom_param->version);
46 
47 		for (i = 0; i < maskrom_param->num; i++)
48 			dump_usbl_report(i, &maskrom_param->info[i]);
49 	}
50 }
51