Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 1 | /* 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 Glass | 5036ffd | 2023-02-05 15:36:41 -0700 | [diff] [blame] | 11 | #if IS_ENABLED(CONFIG_CMD_SF) |
Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 12 | #define BOOTENV_SHARED_SF(devtypel) \ |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 13 | #devtypel "_boot=" \ |
Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 14 | "if " #devtypel " probe ${busnum}; then " \ |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 15 | "devtype=" #devtypel "; " \ |
| 16 | "run scan_sf_for_scripts; " \ |
Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 17 | "fi\0" |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 18 | #define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \ |
| 19 | "bootcmd_" #devtypel #instance "=" \ |
| 20 | "busnum=" #instance "; " \ |
Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 21 | "run " #devtypel "_boot\0" |
Wolfgang Denk | 62fb2b4 | 2021-09-27 17:42:39 +0200 | [diff] [blame] | 22 | #define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \ |
Jagan Teki | 1bd914b | 2020-04-10 23:56:29 +0530 | [diff] [blame] | 23 | #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 */ |