blob: ee48a8a4e8fe4cb16d3ae09baac88c173d39d463 [file] [log] [blame]
Jagan Teki1bd914b2020-04-10 23:56:29 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2020 Amarula Solutions(India)
4 *
5 * SF distro configurations.
6 */
7
8#ifndef __DISTRO_SF_CONFIG_H
9#define __DISTRO_SF_CONFIG_H
10
Simon Glass5036ffd2023-02-05 15:36:41 -070011#if IS_ENABLED(CONFIG_CMD_SF)
Jagan Teki1bd914b2020-04-10 23:56:29 +053012#define BOOTENV_SHARED_SF(devtypel) \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020013 #devtypel "_boot=" \
Jagan Teki1bd914b2020-04-10 23:56:29 +053014 "if " #devtypel " probe ${busnum}; then " \
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020015 "devtype=" #devtypel "; " \
16 "run scan_sf_for_scripts; " \
Jagan Teki1bd914b2020-04-10 23:56:29 +053017 "fi\0"
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020018#define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \
19 "bootcmd_" #devtypel #instance "=" \
20 "busnum=" #instance "; " \
Jagan Teki1bd914b2020-04-10 23:56:29 +053021 "run " #devtypel "_boot\0"
Wolfgang Denk62fb2b42021-09-27 17:42:39 +020022#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \
Jagan Teki1bd914b2020-04-10 23:56:29 +053023 #devtypel #instance " "
24#else
25#define BOOTENV_SHARED_SF(devtypel)
26#define BOOTENV_DEV_SF \
27 BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
28#define BOOTENV_DEV_NAME_SF \
29 BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
30
31#endif /* CONFIG_CMD_SF */
32
33#define BOOTENV_SF \
34 BOOTENV_SHARED_SF(sf) \
35 "scan_sf_for_scripts=" \
36 "${devtype} read ${scriptaddr} " \
37 "${script_offset_f} ${script_size_f}; " \
38 "source ${scriptaddr}; " \
39 "echo SCRIPT FAILED: continuing...\0"
40
41#endif /* __DISTRO_SF_CONFIG_H */