Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Theobroma Systems Design und Consulting GmH |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <spl.h> |
| 8 | |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 9 | __weak int board_return_to_bootrom(struct spl_image_info *spl_image, |
| 10 | struct spl_boot_device *bootdev) |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 11 | { |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 12 | return 0; |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | static int spl_return_to_bootrom(struct spl_image_info *spl_image, |
| 16 | struct spl_boot_device *bootdev) |
| 17 | { |
| 18 | /* |
| 19 | * If the board implements a way to return to its ROM (with |
| 20 | * the expectation that the next stage of will be booted by |
| 21 | * the ROM), it will implement board_return_to_bootrom() and |
| 22 | * should not return from it. |
| 23 | */ |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 24 | return board_return_to_bootrom(spl_image, bootdev); |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | SPL_LOAD_IMAGE_METHOD("BOOTROM", 0, BOOT_DEVICE_BOOTROM, spl_return_to_bootrom); |