1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2017 Theobroma Systems Design und Consulting GmH
4  */
5 
6 #include <spl.h>
7 
board_return_to_bootrom(struct spl_image_info * spl_image,struct spl_boot_device * bootdev)8 __weak int board_return_to_bootrom(struct spl_image_info *spl_image,
9 				   struct spl_boot_device *bootdev)
10 {
11 	return 0;
12 }
13 
spl_return_to_bootrom(struct spl_image_info * spl_image,struct spl_boot_device * bootdev)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 	 */
23 	return board_return_to_bootrom(spl_image, bootdev);
24 }
25 
26 SPL_LOAD_IMAGE_METHOD("BOOTROM", 0, BOOT_DEVICE_BOOTROM, spl_return_to_bootrom);
27