sf.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2020 Amarula Solutions(India)
  4. *
  5. * SF distro configurations.
  6. */
  7. #ifndef __DISTRO_SF_CONFIG_H
  8. #define __DISTRO_SF_CONFIG_H
  9. #if CONFIG_IS_ENABLED(CMD_SF)
  10. #define BOOTENV_SHARED_SF(devtypel) \
  11. #devtypel "_boot=" \
  12. "if " #devtypel " probe ${busnum}; then " \
  13. "devtype=" #devtypel "; " \
  14. "run scan_sf_for_scripts; " \
  15. "fi\0"
  16. #define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \
  17. "bootcmd_" #devtypel #instance "=" \
  18. "busnum=" #instance "; " \
  19. "run " #devtypel "_boot\0"
  20. #define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \
  21. #devtypel #instance " "
  22. #else
  23. #define BOOTENV_SHARED_SF(devtypel)
  24. #define BOOTENV_DEV_SF \
  25. BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
  26. #define BOOTENV_DEV_NAME_SF \
  27. BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
  28. #endif /* CONFIG_CMD_SF */
  29. #define BOOTENV_SF \
  30. BOOTENV_SHARED_SF(sf) \
  31. "scan_sf_for_scripts=" \
  32. "${devtype} read ${scriptaddr} " \
  33. "${script_offset_f} ${script_size_f}; " \
  34. "source ${scriptaddr}; " \
  35. "echo SCRIPT FAILED: continuing...\0"
  36. #endif /* __DISTRO_SF_CONFIG_H */