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 | |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 6 | #include <spl.h> |
| 7 | |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 8 | __weak int board_return_to_bootrom(struct spl_image_info *spl_image, |
| 9 | struct spl_boot_device *bootdev) |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 10 | { |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 11 | return 0; |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | static int spl_return_to_bootrom(struct spl_image_info *spl_image, |
| 15 | struct spl_boot_device *bootdev) |
| 16 | { |
| 17 | /* |
| 18 | * If the board implements a way to return to its ROM (with |
| 19 | * the expectation that the next stage of will be booted by |
| 20 | * the ROM), it will implement board_return_to_bootrom() and |
| 21 | * should not return from it. |
| 22 | */ |
Peng Fan | aa050c5 | 2019-08-07 06:40:53 +0000 | [diff] [blame] | 23 | return board_return_to_bootrom(spl_image, bootdev); |
Philipp Tomsich | 83ad702 | 2017-06-22 23:38:36 +0200 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | SPL_LOAD_IMAGE_METHOD("BOOTROM", 0, BOOT_DEVICE_BOOTROM, spl_return_to_bootrom); |