blob: e172a2d7b83c0811a2abe558380fc25a32208e2f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Philipp Tomsich83ad7022017-06-22 23:38:36 +02002/*
3 * Copyright (C) 2017 Theobroma Systems Design und Consulting GmH
Philipp Tomsich83ad7022017-06-22 23:38:36 +02004 */
5
Philipp Tomsich83ad7022017-06-22 23:38:36 +02006#include <spl.h>
7
Peng Fanaa050c52019-08-07 06:40:53 +00008__weak int board_return_to_bootrom(struct spl_image_info *spl_image,
9 struct spl_boot_device *bootdev)
Philipp Tomsich83ad7022017-06-22 23:38:36 +020010{
Peng Fanaa050c52019-08-07 06:40:53 +000011 return 0;
Philipp Tomsich83ad7022017-06-22 23:38:36 +020012}
13
14static 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 Fanaa050c52019-08-07 06:40:53 +000023 return board_return_to_bootrom(spl_image, bootdev);
Philipp Tomsich83ad7022017-06-22 23:38:36 +020024}
25
26SPL_LOAD_IMAGE_METHOD("BOOTROM", 0, BOOT_DEVICE_BOOTROM, spl_return_to_bootrom);