blob: fccd23524d2b2184a295185fbfbdd1761561fea0 [file] [log] [blame]
Angel Pons32859fc2020-04-02 23:48:27 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer52db0b92012-12-07 17:15:04 -08002
Julius Werner86fc11d2015-10-09 13:37:58 -07003#ifndef __BOOTBLOCK_COMMON_H
4#define __BOOTBLOCK_COMMON_H
Vadim Bendebury0b341b32014-04-23 11:09:44 -07005
Lee Leahy538b3242016-06-05 17:20:17 -07006#include <arch/cpu.h>
Aaron Durbin622eea72016-02-10 23:15:07 -06007#include <main_decl.h>
Julius Werner12574dd2018-05-15 17:48:30 -07008#include <timestamp.h>
9#include <types.h>
Aaron Durbin622eea72016-02-10 23:15:07 -060010
Aaron Durbinbe7cbdc2016-02-24 18:56:00 -060011/*
12 * These are defined as weak no-ops that can be overridden by mainboard/SoC.
13 * The 'early' variants are called prior to console initialization. Also, the
Elyes HAOUASf0a58df2018-08-07 12:21:56 +020014 * SoC functions are called prior to the mainboard functions.
Aaron Durbinbe7cbdc2016-02-24 18:56:00 -060015 */
Julius Werner99f46832018-05-16 14:14:04 -070016void decompressor_soc_init(void);
Julius Wernerf1e32102014-11-25 13:22:20 -080017void bootblock_mainboard_early_init(void);
Gabe Black8b685392013-09-29 03:02:55 -070018void bootblock_mainboard_init(void);
Aaron Durbinbe7cbdc2016-02-24 18:56:00 -060019void bootblock_soc_early_init(void);
Vadim Bendebury0b341b32014-04-23 11:09:44 -070020void bootblock_soc_init(void);
Lee Leahy6c3c31e2016-06-05 16:46:48 -070021
22/*
23 * C code entry point for the boot block.
24 */
Lee Leahy22c28e02017-03-07 15:47:44 -080025asmlinkage void bootblock_c_entry(uint64_t base_timestamp);
Kyösti Mälkki05a7ffa2018-12-28 17:05:08 +020026asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist);
Lee Leahy6c3c31e2016-06-05 16:46:48 -070027
Kyösti Mälkki33d0fb82019-11-29 06:38:46 +020028/* To be used when APs execute through bootblock too. */
29asmlinkage void ap_bootblock_c_entry(void);
30
Kyösti Mälkki101ef0b2019-08-18 06:58:42 +030031void bootblock_main_with_basetime(uint64_t base_timestamp);
Kangheui Won18582232020-09-17 16:49:40 +100032void bootblock_main_with_timestamp(uint64_t base_timestamp,
33 struct timestamp_entry *timestamps, size_t num_timestamps);
Vadim Bendebury0b341b32014-04-23 11:09:44 -070034
Julius Werner99f46832018-05-16 14:14:04 -070035/* This is the argument structure passed from decompressor to bootblock. */
36struct bootblock_arg {
37 uint64_t base_timestamp;
Julius Werner6296ca82021-04-02 16:31:21 -070038 void *metadata_hash_anchor;
Julius Werner99f46832018-05-16 14:14:04 -070039 uint32_t num_timestamps;
40 struct timestamp_entry timestamps[];
41};
42
Julius Werner86fc11d2015-10-09 13:37:58 -070043#endif /* __BOOTBLOCK_COMMON_H */