Simon Glass | b255efc | 2022-04-24 23:31:24 -0600 | [diff] [blame] | 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 | |
| 9 | #ifndef __bootstd_common_h |
| 10 | #define __bootstd_common_h |
| 11 | |
Simon Glass | 8025346 | 2022-10-11 09:47:13 -0600 | [diff] [blame] | 12 | #include <version_string.h> |
| 13 | |
Simon Glass | b255efc | 2022-04-24 23:31:24 -0600 | [diff] [blame] | 14 | /* Declare a new bootdev test */ |
| 15 | #define BOOTSTD_TEST(_name, _flags) \ |
| 16 | UNIT_TEST(_name, _flags, bootstd_test) |
| 17 | |
Simon Glass | 8025346 | 2022-10-11 09:47:13 -0600 | [diff] [blame] | 18 | #define NVDATA_START_BLK ((0x400 + 0x400) / MMC_MAX_BLOCK_LEN) |
| 19 | #define VERSION_START_BLK ((0x400 + 0x800) / MMC_MAX_BLOCK_LEN) |
| 20 | #define TEST_VERSION "U-Boot v2022.04-local2" |
| 21 | #define TEST_VERNUM 0x00010002 |
| 22 | |
Simon Glass | b255efc | 2022-04-24 23:31:24 -0600 | [diff] [blame] | 23 | struct unit_test_state; |
| 24 | |
| 25 | /** |
| 26 | * bootstd_test_drop_bootdev_order() - Remove the existing boot order |
| 27 | * |
| 28 | * Drop the boot order so that all bootdevs are used in their alias order |
| 29 | * |
| 30 | * @uts: Unit test state to use for ut_assert...() functions |
| 31 | */ |
| 32 | int bootstd_test_drop_bootdev_order(struct unit_test_state *uts); |
| 33 | |
Simon Glass | 8025346 | 2022-10-11 09:47:13 -0600 | [diff] [blame] | 34 | /** |
| 35 | * bootstd_setup_for_tests() - Set up MMC data for VBE tests |
| 36 | * |
| 37 | * Some data is needed for VBE tests to work. This function sets that up. |
| 38 | * |
| 39 | * @return 0 if OK, -ve on error |
| 40 | */ |
| 41 | int bootstd_setup_for_tests(void); |
| 42 | |
Simon Glass | b255efc | 2022-04-24 23:31:24 -0600 | [diff] [blame] | 43 | #endif |