Merge branch 'master' of git://git.denx.de/u-boot
[oweals/u-boot.git] / common / spl / spl_bootrom.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2017 Theobroma Systems Design und Consulting GmH
4  */
5
6 #include <common.h>
7 #include <spl.h>
8
9 __weak int board_return_to_bootrom(struct spl_image_info *spl_image,
10                                    struct spl_boot_device *bootdev)
11 {
12         return 0;
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          */
24         return board_return_to_bootrom(spl_image, bootdev);
25 }
26
27 SPL_LOAD_IMAGE_METHOD("BOOTROM", 0, BOOT_DEVICE_BOOTROM, spl_return_to_bootrom);