Plumb in the ability for U-Boot proper to accept an incoming standard passage from a previous phase, such as SPL or TF-A. This allows data to be passed from binary to binary when firmware is booting. Series-changes: 2 - Rebase to master - Rework global_data for new stdpass convention Series-changes: 3 - Move passage.h into this patch - Add passage_valid() to decide if stdpass was provided - Move arch_passage_entry() into this patch - Make the global_data fields present only when needed Signed-off-by: Simon Glass <sjg@chromium.org>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Standard passage implementation
|
|
*
|
|
* Copyright 2022 Google LLC
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
*/
|
|
|
|
#ifndef __PASSAGE_H
|
|
#define __PASSAGE_H
|
|
|
|
#include <stdbool.h>
|
|
#include <asm/global_data.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
enum {
|
|
PASSAGE_ABI_MACH = 0x4a0fb10bul,
|
|
PASSAGE_ABI_VERSION = 1ul,
|
|
};
|
|
|
|
static inline ulong passage_mach_version(void)
|
|
{
|
|
#if BITS_PER_LONG == 64
|
|
return PASSAGE_ABI_MACH | (ulong)PASSAGE_ABI_VERSION << 32;
|
|
#else
|
|
return (PASSAGE_ABI_MACH & 0xffffff) | (PASSAGE_ABI_VERSION << 24);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* passage_valid() - See if standard passage was provided by the previous phase
|
|
*
|
|
* Return: true if standard passage was provided, else false
|
|
*/
|
|
static inline bool passage_valid(void)
|
|
{
|
|
#if CONFIG_IS_ENABLED(BLOBLIST_PASSAGE)
|
|
return gd->passage_mach == passage_mach_version();
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
|
|
/* arch_passage_entry() - Jump to the next phase, using standard passage
|
|
*
|
|
* @entry_addr: Address to jump to
|
|
* @bloblist: Bloblist address to pass
|
|
* @fdt: FDT to pass
|
|
*/
|
|
void __noreturn arch_passage_entry(ulong entry_addr, ulong bloblist, ulong fdt);
|
|
|
|
#endif
|