diff options
| author | Tom Rini <trini@konsulko.com> | 2021-01-28 11:37:58 -0500 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2021-01-28 11:37:58 -0500 |
| commit | 07394fb05e4d48fee360ef38c96b3ef0576b7352 (patch) | |
| tree | eaf9b03553cbea1907d578a86799aafaf4887504 /include | |
| parent | 8b195f4b716e4d802768e0e2cd63b417a4690b7f (diff) | |
| parent | 54f884bb0b1ebc16946890bb8349fe0ca2455bb2 (diff) | |
| download | u-boot-07394fb05e4d48fee360ef38c96b3ef0576b7352.tar.gz u-boot-07394fb05e4d48fee360ef38c96b3ef0576b7352.tar.xz u-boot-07394fb05e4d48fee360ef38c96b3ef0576b7352.zip | |
Merge branch '2021-01-27-assorted-fixes-and-improvements'
- A wide variety of fixes throughout the tree.
Diffstat (limited to 'include')
| -rw-r--r-- | include/binman.h | 14 | ||||
| -rw-r--r-- | include/bloblist.h | 10 | ||||
| -rw-r--r-- | include/bootcount.h | 6 | ||||
| -rw-r--r-- | include/linux/arm-smccc.h | 4 | ||||
| -rw-r--r-- | include/spl.h | 53 | ||||
| -rw-r--r-- | include/uuid.h | 1 | ||||
| -rw-r--r-- | include/video.h | 14 |
7 files changed, 97 insertions, 5 deletions
diff --git a/include/binman.h b/include/binman.h index 8b89a9666d..5958dfb448 100644 --- a/include/binman.h +++ b/include/binman.h @@ -71,6 +71,20 @@ int binman_entry_find(const char *name, struct binman_entry *entry); ofnode binman_section_find_node(const char *name); /** + * binman_select_subnode() - Select a subnode to use to find entries + * + * Normally binman selects the top-level node for future entry requests, such as + * binman_entry_find(). This function allows a subnode to be chosen instead. + * + * @name: Name of subnode, typically a section. This must be in the top-level + * binman node + * @return 0 if OK, -EINVAL if there is no /binman node, -ECHILD if multiple + * images are being used but the first image is not available, -ENOENT if + * the requested subnode cannot be found + */ +int binman_select_subnode(const char *name); + +/** * binman_init() - Set up the binman symbol information * * This locates the binary symbol information in the device tree ready for use diff --git a/include/bloblist.h b/include/bloblist.h index 8cdce61187..964b974fda 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -243,6 +243,16 @@ void bloblist_show_list(void); const char *bloblist_tag_name(enum bloblist_tag_t tag); /** + * bloblist_reloc() - Relocate the bloblist and optionally resize it + * + * @to: Pointer to new bloblist location (must not overlap old location) + * @to:size: New size for bloblist (must be larger than from_size) + * @from: Pointer to bloblist to relocate + * @from_size: Size of bloblist to relocate + */ +void bloblist_reloc(void *to, uint to_size, void *from, uint from_size); + +/** * bloblist_init() - Init the bloblist system with a single bloblist * * This uses CONFIG_BLOBLIST_ADDR and CONFIG_BLOBLIST_SIZE to set up a bloblist diff --git a/include/bootcount.h b/include/bootcount.h index cd30403984..b1d1fe53d1 100644 --- a/include/bootcount.h +++ b/include/bootcount.h @@ -69,7 +69,7 @@ void bootcount_store(ulong); */ ulong bootcount_load(void); -#if defined(CONFIG_SPL_BOOTCOUNT_LIMIT) || defined(CONFIG_BOOTCOUNT_LIMIT) +#if defined(CONFIG_SPL_BOOTCOUNT_LIMIT) || defined(CONFIG_TPL_BOOTCOUNT_LIMIT) || defined(CONFIG_BOOTCOUNT_LIMIT) #if !defined(CONFIG_SYS_BOOTCOUNT_LE) && !defined(CONFIG_SYS_BOOTCOUNT_BE) # if __BYTE_ORDER == __LITTLE_ENDIAN @@ -130,7 +130,7 @@ static inline void bootcount_inc(void) #ifndef CONFIG_SPL_BUILD /* Only increment bootcount when no bootcount support in SPL */ -#ifndef CONFIG_SPL_BOOTCOUNT_LIMIT +#if !defined(CONFIG_SPL_BOOTCOUNT_LIMIT) && !defined(CONFIG_TPL_BOOTCOUNT_LIMIT) bootcount_store(++bootcount); #endif env_set_ulong("bootcount", bootcount); @@ -140,5 +140,5 @@ static inline void bootcount_inc(void) #else static inline int bootcount_error(void) { return 0; } static inline void bootcount_inc(void) {} -#endif /* CONFIG_SPL_BOOTCOUNT_LIMIT || CONFIG_BOOTCOUNT_LIMIT */ +#endif /* CONFIG_SPL_BOOTCOUNT_LIMIT || CONFIG_TPL_BOOTCOUNT_LIMIT || CONFIG_BOOTCOUNT_LIMIT */ #endif /* _BOOTCOUNT_H__ */ diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index 2d1e6cc156..7f2be23394 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -11,8 +11,8 @@ * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html */ -#define ARM_SMCCC_STD_CALL 0 -#define ARM_SMCCC_FAST_CALL 1 +#define ARM_SMCCC_STD_CALL 0UL +#define ARM_SMCCC_FAST_CALL 1UL #define ARM_SMCCC_TYPE_SHIFT 31 #define ARM_SMCCC_SMC_32 0 diff --git a/include/spl.h b/include/spl.h index a7648787b7..faffeb519a 100644 --- a/include/spl.h +++ b/include/spl.h @@ -58,6 +58,7 @@ static inline bool u_boot_first_phase(void) } enum u_boot_phase { + PHASE_NONE, /* Invalid phase, signifying before U-Boot */ PHASE_TPL, /* Running in TPL */ PHASE_SPL, /* Running in SPL */ PHASE_BOARD_F, /* Running in U-Boot before relocation */ @@ -123,6 +124,58 @@ static inline enum u_boot_phase spl_phase(void) #endif } +/** + * spl_prev_phase() - Figure out the previous U-Boot phase + * + * @return the previous phase from this one, e.g. if called in SPL this returns + * PHASE_TPL, if TPL is enabled + */ +static inline enum u_boot_phase spl_prev_phase(void) +{ +#ifdef CONFIG_TPL_BUILD + return PHASE_NONE; +#elif defined(CONFIG_SPL_BUILD) + return IS_ENABLED(CONFIG_TPL) ? PHASE_TPL : PHASE_NONE; +#else + return IS_ENABLED(CONFIG_SPL) ? PHASE_SPL : PHASE_NONE; +#endif +} + +/** + * spl_next_phase() - Figure out the next U-Boot phase + * + * @return the next phase from this one, e.g. if called in TPL this returns + * PHASE_SPL + */ +static inline enum u_boot_phase spl_next_phase(void) +{ +#ifdef CONFIG_TPL_BUILD + return PHASE_SPL; +#else + return PHASE_BOARD_F; +#endif +} + +/** + * spl_phase_name() - Get the name of the current phase + * + * @return phase name + */ +static inline const char *spl_phase_name(enum u_boot_phase phase) +{ + switch (phase) { + case PHASE_TPL: + return "TPL"; + case PHASE_SPL: + return "SPL"; + case PHASE_BOARD_F: + case PHASE_BOARD_R: + return "U-Boot"; + default: + return "phase?"; + } +} + /* A string name for SPL or TPL */ #ifdef CONFIG_SPL_BUILD # ifdef CONFIG_TPL_BUILD diff --git a/include/uuid.h b/include/uuid.h index 0c653cb087..4a4883d3b5 100644 --- a/include/uuid.h +++ b/include/uuid.h @@ -23,6 +23,7 @@ struct uuid { #define UUID_STR_FORMAT_GUID BIT(0) #define UUID_STR_UPPER_CASE BIT(1) +/* Use UUID_STR_LEN + 1 for string space */ #define UUID_STR_LEN 36 #define UUID_BIN_LEN sizeof(struct uuid) diff --git a/include/video.h b/include/video.h index 74d822fadb..827733305e 100644 --- a/include/video.h +++ b/include/video.h @@ -246,11 +246,25 @@ void video_set_default_colors(struct udevice *dev, bool invert); * frame buffer start */ int video_sync_copy(struct udevice *dev, void *from, void *to); + +/** + * video_sync_copy_all() - Sync the entire framebuffer to the copy + * + * @dev: Vidconsole device being updated + * @return 0 (always) + */ +int video_sync_copy_all(struct udevice *dev); #else static inline int video_sync_copy(struct udevice *dev, void *from, void *to) { return 0; } + +static inline int video_sync_copy_all(struct udevice *dev) +{ + return 0; +} + #endif #ifndef CONFIG_DM_VIDEO |
