blob: 070a79c1b97e9a27d1ec505f12e1a08ab98e9608 [file] [log] [blame]
Simon Glassb0edea32018-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
13#include <asm/handoff.h>
14
15/**
16 * struct spl_handoff - information passed from SPL to U-Boot proper
17 *
18 * @ram_size: Value to use for gd->ram_size
19 */
20struct spl_handoff {
21 struct arch_spl_handoff arch;
22 u64 ram_size;
Simon Glassb0edea32018-11-15 18:44:09 -070023 struct {
24 u64 start;
25 u64 size;
26 } ram_bank[CONFIG_NR_DRAM_BANKS];
Simon Glassb0edea32018-11-15 18:44:09 -070027};
28
29void handoff_save_dram(struct spl_handoff *ho);
30void handoff_load_dram_size(struct spl_handoff *ho);
31void handoff_load_dram_banks(struct spl_handoff *ho);
Simon Glass366291a2019-09-25 08:11:18 -060032
33/**
34 * handoff_arch_save() - Save arch-specific info into the handoff area
35 *
36 * This is defined to an empty function by default, but arch-specific code can
37 * define it to write to spi_handoff->arch. It is called from
38 * write_spl_handoff().
39 *
40 * @ho: Handoff area to fill in
41 * @return 0 if OK, -ve on error
42 */
43int handoff_arch_save(struct spl_handoff *ho);
44
Simon Glassb0edea32018-11-15 18:44:09 -070045#endif
46
47#endif