Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 1 | /* 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 Rini | 728cb88 | 2024-04-27 08:11:00 -0600 | [diff] [blame] | 13 | #include <linux/types.h> |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 14 | #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 | */ |
| 21 | struct spl_handoff { |
| 22 | struct arch_spl_handoff arch; |
| 23 | u64 ram_size; |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 24 | struct { |
| 25 | u64 start; |
| 26 | u64 size; |
| 27 | } ram_bank[CONFIG_NR_DRAM_BANKS]; |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | void handoff_save_dram(struct spl_handoff *ho); |
| 31 | void handoff_load_dram_size(struct spl_handoff *ho); |
| 32 | void handoff_load_dram_banks(struct spl_handoff *ho); |
Simon Glass | c5d2720 | 2019-09-25 08:11:18 -0600 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * handoff_arch_save() - Save arch-specific info into the handoff area |
| 36 | * |
| 37 | * This is defined to an empty function by default, but arch-specific code can |
| 38 | * define it to write to spi_handoff->arch. It is called from |
| 39 | * write_spl_handoff(). |
| 40 | * |
| 41 | * @ho: Handoff area to fill in |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 42 | * Return: 0 if OK, -ve on error |
Simon Glass | c5d2720 | 2019-09-25 08:11:18 -0600 | [diff] [blame] | 43 | */ |
| 44 | int handoff_arch_save(struct spl_handoff *ho); |
| 45 | |
Simon Glass | e14f1a2 | 2018-11-15 18:44:09 -0700 | [diff] [blame] | 46 | #endif |
| 47 | |
| 48 | #endif |