diff options
author | Tom Rini <trini@konsulko.com> | 2023-11-17 08:38:05 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-17 08:38:05 -0500 |
commit | ae7ec8b0be41b59ef323f7531c0fe6745e8fef45 (patch) | |
tree | d3b5bff2626d743a15533b8400985974817f1cc3 /include/bcb.h | |
parent | 6c1608b1ffb372d4dabf1b879e68428712353709 (diff) | |
parent | b83fae673a9cd9795e531883936c1468e75510a5 (diff) | |
download | u-boot-ae7ec8b0be41b59ef323f7531c0fe6745e8fef45.zip u-boot-ae7ec8b0be41b59ef323f7531c0fe6745e8fef45.tar.gz u-boot-ae7ec8b0be41b59ef323f7531c0fe6745e8fef45.tar.bz2 |
Merge branch '2023-11-16-assorted-updates' into next
- squashfs improvements, remove common.h in some places, assorted code
fixes, fix a few CONFIG symbol names in Kconfig files, bring in
linux's <linux/time.h> conversion functions, poplar updates, bcb
improvements.
Diffstat (limited to 'include/bcb.h')
-rw-r--r-- | include/bcb.h | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/include/bcb.h b/include/bcb.h index 5edb17a..1941d8c 100644 --- a/include/bcb.h +++ b/include/bcb.h @@ -8,14 +8,69 @@ #ifndef __BCB_H__ #define __BCB_H__ +#include <part.h> + +enum bcb_field { + BCB_FIELD_COMMAND, + BCB_FIELD_STATUS, + BCB_FIELD_RECOVERY, + BCB_FIELD_STAGE +}; + #if IS_ENABLED(CONFIG_CMD_BCB) -int bcb_write_reboot_reason(int devnum, char *partp, const char *reasonp); + +int bcb_find_partition_and_load(const char *iface, + int devnum, char *partp); +int bcb_load(struct blk_desc *block_description, + struct disk_partition *disk_partition); +int bcb_set(enum bcb_field field, const char *value); + +/** + * bcb_get() - get the field value. + * @field: field to get + * @value_out: buffer to copy bcb field value to + * @value_size: buffer size to avoid overflow in case + * value_out is smaller then the field value + */ +int bcb_get(enum bcb_field field, char *value_out, size_t value_size); + +int bcb_store(void); +void bcb_reset(void); + #else + #include <linux/errno.h> -static inline int bcb_write_reboot_reason(int devnum, char *partp, const char *reasonp) + +static inline int bcb_load(struct blk_desc *block_description, + struct disk_partition *disk_partition) +{ + return -EOPNOTSUPP; +} + +static inline int bcb_find_partition_and_load(const char *iface, + int devnum, char *partp) +{ + return -EOPNOTSUPP; +} + +static inline int bcb_set(enum bcb_field field, const char *value) +{ + return -EOPNOTSUPP; +} + +static inline int bcb_get(enum bcb_field field, char *value_out) { return -EOPNOTSUPP; } + +static inline int bcb_store(void) +{ + return -EOPNOTSUPP; +} + +static inline void bcb_reset(void) +{ +} #endif #endif /* __BCB_H__ */ |