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 | |
| 11 | #if CONFIG_IS_ENABLED(CMD_SF) |
| 12 | #define BOOTENV_SHARED_SF(devtypel) \ |
| 13 | #devtypel "_boot=" \ |
| 14 | "if " #devtypel " probe ${busnum}; then " \ |
| 15 | "devtype=" #devtypel "; " \ |
| 16 | "run scan_sf_for_scripts; " \ |
| 17 | "fi\0" |
| 18 | #define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \ |
| 19 | "bootcmd_" #devtypel #instance "=" \ |
| 20 | "busnum=" #instance "; " \ |
| 21 | "run " #devtypel "_boot\0" |
| 22 | #define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \ |
| 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 */ |