summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dm/uclass.h11
-rw-r--r--include/log.h25
-rw-r--r--include/part.h29
-rw-r--r--include/part_efi.h3
-rw-r--r--include/test/ut.h18
-rw-r--r--include/uuid.h4
6 files changed, 78 insertions, 12 deletions
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index b5f066dbf48..d95683740cb 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -377,6 +377,17 @@ int uclass_first_device_drvdata(enum uclass_id id, ulong driver_data,
struct udevice **devp);
/**
+ * uclass_probe_all() - Probe all devices based on an uclass ID
+ *
+ * This function probes all devices associated with a uclass by
+ * looking for its ID.
+ *
+ * @id: uclass ID to look up
+ * @return 0 if OK, other -ve on error
+ */
+int uclass_probe_all(enum uclass_id id);
+
+/**
* uclass_id_foreach_dev() - Helper function to iteration through devices
*
* This creates a for() loop which works through the available devices in
diff --git a/include/log.h b/include/log.h
index 6bce5606489..2d27f9f657e 100644
--- a/include/log.h
+++ b/include/log.h
@@ -156,6 +156,9 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
*/
#if CONFIG_IS_ENABLED(LOG)
#define _LOG_MAX_LEVEL CONFIG_VAL(LOG_MAX_LEVEL)
+#define log_emer(_fmt...) log(LOG_CATEGORY, LOGL_EMERG, ##_fmt)
+#define log_alert(_fmt...) log(LOG_CATEGORY, LOGL_ALERT, ##_fmt)
+#define log_crit(_fmt...) log(LOG_CATEGORY, LOGL_CRIT, ##_fmt)
#define log_err(_fmt...) log(LOG_CATEGORY, LOGL_ERR, ##_fmt)
#define log_warning(_fmt...) log(LOG_CATEGORY, LOGL_WARNING, ##_fmt)
#define log_notice(_fmt...) log(LOG_CATEGORY, LOGL_NOTICE, ##_fmt)
@@ -163,12 +166,17 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
#define log_debug(_fmt...) log(LOG_CATEGORY, LOGL_DEBUG, ##_fmt)
#define log_content(_fmt...) log(LOG_CATEGORY, LOGL_DEBUG_CONTENT, ##_fmt)
#define log_io(_fmt...) log(LOG_CATEGORY, LOGL_DEBUG_IO, ##_fmt)
+#define log_cont(_fmt...) log(LOGC_CONT, LOGL_CONT, ##_fmt)
#else
#define _LOG_MAX_LEVEL LOGL_INFO
+#define log_emerg(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
+#define log_alert(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
+#define log_crit(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
#define log_err(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
#define log_warning(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
#define log_notice(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
#define log_info(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
+#define log_cont(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
#define log_debug(_fmt, ...) debug(_fmt, ##__VA_ARGS__)
#define log_content(_fmt...) log_nop(LOG_CATEGORY, \
LOGL_DEBUG_CONTENT, ##_fmt)
@@ -217,10 +225,9 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
#if !_DEBUG && CONFIG_IS_ENABLED(LOG)
#define debug_cond(cond, fmt, args...) \
- do { \
- if (1) \
- log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
- } while (0)
+({ \
+ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
+})
#else /* _DEBUG */
@@ -229,11 +236,11 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
* computed by a preprocessor in the best case, allowing for the best
* optimization.
*/
-#define debug_cond(cond, fmt, args...) \
- do { \
- if (cond) \
- printf(pr_fmt(fmt), ##args); \
- } while (0)
+#define debug_cond(cond, fmt, args...) \
+({ \
+ if (cond) \
+ printf(pr_fmt(fmt), ##args); \
+})
#endif /* _DEBUG */
diff --git a/include/part.h b/include/part.h
index fac36364bd4..815515aa809 100644
--- a/include/part.h
+++ b/include/part.h
@@ -9,6 +9,7 @@
#include <blk.h>
#include <ide.h>
#include <uuid.h>
+#include <linker_lists.h>
#include <linux/list.h>
struct block_drvr {
@@ -481,5 +482,33 @@ int layout_mbr_partitions(struct disk_partition *p, int count,
#endif
+#ifdef CONFIG_PARTITIONS
+/**
+ * part_driver_get_count() - get partition driver count
+ *
+ * @return - number of partition drivers
+ */
+static inline int part_driver_get_count(void)
+{
+ return ll_entry_count(struct part_driver, part_driver);
+}
+
+/**
+ * part_driver_get_first() - get first partition driver
+ *
+ * @return - pointer to first partition driver on success, otherwise NULL
+ */
+static inline struct part_driver *part_driver_get_first(void)
+{
+ return ll_entry_start(struct part_driver, part_driver);
+}
+
+#else
+static inline int part_driver_get_count(void)
+{ return 0; }
+
+static inline struct part_driver *part_driver_get_first(void)
+{ return NULL; }
+#endif /* CONFIG_PARTITIONS */
#endif /* _PART_H */
diff --git a/include/part_efi.h b/include/part_efi.h
index 1929e4400f1..c68529b4daf 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -56,6 +56,9 @@
#define PARTITION_LINUX_LVM_GUID \
EFI_GUID( 0xe6d6d379, 0xf507, 0x44c2, \
0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28)
+#define PARTITION_U_BOOT_ENVIRONMENT \
+ EFI_GUID( 0x3de21764, 0x95bd, 0x54bd, \
+ 0xa5, 0xc3, 0x4a, 0xbe, 0x78, 0x6f, 0x38, 0xa8)
/* linux/include/efi.h */
typedef u16 efi_char16_t;
diff --git a/include/test/ut.h b/include/test/ut.h
index 3f2ee7514b8..17400c73ea9 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -338,4 +338,22 @@ ulong ut_check_free(void);
*/
long ut_check_delta(ulong last);
+/**
+ * ut_silence_console() - Silence the console if requested by the user
+ *
+ * This stops test output from appear on the console. It is the default on
+ * sandbox, unless the -v flag is given. For other boards, this does nothing.
+ *
+ * @uts: Test state (in case in future we want to keep state here)
+ */
+void ut_silence_console(struct unit_test_state *uts);
+
+/**
+ * ut_unsilence_console() - Unsilence the console after a test
+ *
+ * This restarts console output again and turns off console recording. This
+ * happens on all boards, including sandbox.
+ */
+void ut_unsilence_console(struct unit_test_state *uts);
+
#endif
diff --git a/include/uuid.h b/include/uuid.h
index 73c5a89ec7c..0c653cb0874 100644
--- a/include/uuid.h
+++ b/include/uuid.h
@@ -39,10 +39,8 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin,
int str_format);
void uuid_bin_to_str(const unsigned char *uuid_bin, char *uuid_str,
int str_format);
-#ifdef CONFIG_PARTITION_TYPE_GUID
int uuid_guid_get_bin(const char *guid_str, unsigned char *guid_bin);
-int uuid_guid_get_str(const unsigned char *guid_bin, char *guid_str);
-#endif
+const char *uuid_guid_get_str(const unsigned char *guid_bin);
void gen_rand_uuid(unsigned char *uuid_bin);
void gen_rand_uuid_str(char *uuid_str, int str_format);
#endif