bootstd_common.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Common header file for bootdev, bootflow, bootmeth tests
  4. *
  5. * Copyright 2021 Google LLC
  6. * Written by Simon Glass <sjg@chromium.org>
  7. */
  8. #ifndef __bootstd_common_h
  9. #define __bootstd_common_h
  10. #include <version_string.h>
  11. /* Declare a new bootdev test */
  12. #define BOOTSTD_TEST(_name, _flags) \
  13. UNIT_TEST(_name, _flags, bootstd_test)
  14. #define NVDATA_START_BLK ((0x400 + 0x400) / MMC_MAX_BLOCK_LEN)
  15. #define VERSION_START_BLK ((0x400 + 0x800) / MMC_MAX_BLOCK_LEN)
  16. #define TEST_VERSION "U-Boot v2022.04-local2"
  17. #define TEST_VERNUM 0x00010002
  18. enum {
  19. MAX_HUNTER = 9,
  20. MMC_HUNTER = 3, /* ID of MMC hunter */
  21. };
  22. struct unit_test_state;
  23. /**
  24. * bootstd_test_drop_bootdev_order() - Remove the existing boot order
  25. *
  26. * Drop the boot order so that all bootdevs are used in their alias order
  27. *
  28. * @uts: Unit test state to use for ut_assert...() functions
  29. */
  30. int bootstd_test_drop_bootdev_order(struct unit_test_state *uts);
  31. /**
  32. * bootstd_setup_for_tests() - Set up MMC data for VBE tests
  33. *
  34. * Some data is needed for VBE tests to work. This function sets that up.
  35. *
  36. * @return 0 if OK, -ve on error
  37. */
  38. int bootstd_setup_for_tests(void);
  39. /**
  40. * bootstd_test_check_mmc_hunter() - Check that the mmc bootdev hunter was used
  41. *
  42. * @uts: Unit test state to use for ut_assert...() functions
  43. * Returns: 0 if OK (used), other value on error (not used)
  44. */
  45. int bootstd_test_check_mmc_hunter(struct unit_test_state *uts);
  46. #endif