blob: 0072ea832f83828de3a1a5bc2749cabe83f422c6 [file] [log] [blame]
Simon Glasse14f1a22018-11-15 18:44:09 -07001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Passing basic information from SPL to U-Boot proper
4 *
5 * Copyright 2018 Google, Inc
6 */
7
8#ifndef __HANDOFF_H
9#define __HANDOFF_H
10
11#if CONFIG_IS_ENABLED(HANDOFF)
12
Tom Rinidec7ea02024-05-20 13:35:03 -060013#include <linux/types.h>
Simon Glasse14f1a22018-11-15 18:44:09 -070014#include <asm/handoff.h>
15
16/**
17 * struct spl_handoff - information passed from SPL to U-Boot proper
18 *
19 * @ram_size: Value to use for gd->ram_size
20 */
21struct spl_handoff {
22 struct arch_spl_handoff arch;
23 u64 ram_size;
Simon Glasse14f1a22018-11-15 18:44:09 -070024 struct {
25 u64 start;
26 u64 size;
27 } ram_bank[CONFIG_NR_DRAM_BANKS];
Simon Glasse14f1a22018-11-15 18:44:09 -070028};
29
30void handoff_save_dram(struct spl_handoff *ho);
31void handoff_load_dram_size(struct spl_handoff *ho);
32void handoff_load_dram_banks(struct spl_handoff *ho);
Simon Glassc5d27202019-09-25 08:11:18 -060033
34/**
Simon Glassb711ef72024-08-21 10:19:13 -060035 * handoff_get() - Get the SPL handoff information
36 *
37 * Return: Pointer to SPL handoff if received, else NULL
38 */
39struct spl_handoff *handoff_get(void);
40
41/**
Simon Glassc5d27202019-09-25 08:11:18 -060042 * handoff_arch_save() - Save arch-specific info into the handoff area
43 *
44 * This is defined to an empty function by default, but arch-specific code can
45 * define it to write to spi_handoff->arch. It is called from
46 * write_spl_handoff().
47 *
48 * @ho: Handoff area to fill in
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010049 * Return: 0 if OK, -ve on error
Simon Glassc5d27202019-09-25 08:11:18 -060050 */
51int handoff_arch_save(struct spl_handoff *ho);
52
Simon Glasse14f1a22018-11-15 18:44:09 -070053#endif
54
55#endif