blob: 62624d553c04ee287ac51666c0d0047f3f27a3dd [file] [log] [blame]
Jagan Tekif76b9382020-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
11#if CONFIG_IS_ENABLED(CMD_SF)
12#define BOOTENV_SHARED_SF(devtypel) \
Wolfgang Denk0cf207e2021-09-27 17:42:39 +020013 #devtypel "_boot=" \
Jagan Tekif76b9382020-04-10 23:56:29 +053014 "if " #devtypel " probe ${busnum}; then " \
Wolfgang Denk0cf207e2021-09-27 17:42:39 +020015 "devtype=" #devtypel "; " \
16 "run scan_sf_for_scripts; " \
Jagan Tekif76b9382020-04-10 23:56:29 +053017 "fi\0"
Wolfgang Denk0cf207e2021-09-27 17:42:39 +020018#define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \
19 "bootcmd_" #devtypel #instance "=" \
20 "busnum=" #instance "; " \
Jagan Tekif76b9382020-04-10 23:56:29 +053021 "run " #devtypel "_boot\0"
Wolfgang Denk0cf207e2021-09-27 17:42:39 +020022#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \
Jagan Tekif76b9382020-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 */