summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-01-22 16:08:34 -0600
committerTom Rini <[email protected]>2025-01-22 17:08:47 -0600
commita3b71cc6f5cc74d4edc5808790a3d2999ea3f7fe (patch)
treebf148f9145392c695ffb623ef8c307a4a3fe8e82 /include
parent2eed5a1ff36217372e19f7513bd07077fc76718a (diff)
parent8985ff56b16dc6c04da2c96d48e7f6f54d04e3ff (diff)
Merge patch series "upl: Prerequite patches for updated spec"
Simon Glass <[email protected]> says: The current UPL spec[1] has been tidied up and improved over the last year, since U-Boot's original UPL support was written. This series includes some prerequisite patches needed for the real UPL patches. It is split from [2] [1] https://github.com/UniversalPayload/spec/tree/3f1450d [2] https://patchwork.ozlabs.org/project/uboot/list/?series=438574&state=* Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
-rw-r--r--include/abuf.h25
-rw-r--r--include/cpu.h14
-rw-r--r--include/dm/ofnode.h35
-rw-r--r--include/image.h8
-rw-r--r--include/video.h2
5 files changed, 75 insertions, 9 deletions
diff --git a/include/abuf.h b/include/abuf.h
index be98ec78c86..62ff6499a0c 100644
--- a/include/abuf.h
+++ b/include/abuf.h
@@ -9,7 +9,11 @@
#ifndef __ABUF_H
#define __ABUF_H
+#ifdef USE_HOSTCC
+#include <sys/types.h>
+#else
#include <linux/types.h>
+#endif
/**
* struct abuf - buffer that can be allocated and freed
@@ -43,6 +47,14 @@ static inline size_t abuf_size(const struct abuf *abuf)
}
/**
+ * abuf_addr() - Get the address of a buffer's data
+ *
+ * @abuf: Buffer to check
+ * Return: address of buffer
+ */
+ulong abuf_addr(const struct abuf *abuf);
+
+/**
* abuf_set() - set the (unallocated) data in a buffer
*
* This simply makes the abuf point to the supplied data, which must be live
@@ -146,6 +158,19 @@ void abuf_init_move(struct abuf *abuf, void *data, size_t size);
void abuf_init_set(struct abuf *abuf, void *data, size_t size);
/**
+ * abuf_init_const() - Set up a new const abuf
+ *
+ * Inits a new abuf and sets up its (unallocated) data. The only current
+ * difference between this and abuf_init_set() is the 'data' parameter is a
+ * const pointer. At some point a flag could be used to indicate const-ness.
+ *
+ * @abuf: abuf to set up
+ * @data: New contents of abuf
+ * @size: New size of abuf
+ */
+void abuf_init_const(struct abuf *abuf, const void *data, size_t size);
+
+/**
* abuf_uninit() - Free any memory used by an abuf
*
* The buffer must be inited before this can be called.
diff --git a/include/cpu.h b/include/cpu.h
index 0018910d61f..d0cd104c05a 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -179,4 +179,18 @@ struct udevice *cpu_get_current_dev(void);
* @return 0 if OK, -ve on error
*/
int cpu_release_core(const struct udevice *dev, phys_addr_t addr);
+
+/**
+ * cpu_phys_address_size() - Get the physical-address size for the CPU
+ *
+ * x86 CPUs have a setting which indicates how many bits of address space are
+ * available on the CPU. This is 32 for older CPUs but newer ones may support 36
+ * or more.
+ *
+ * For non-x86 CPUs the result may simply be 32 for 32-bit CPUS or 64 for 64-bit
+ *
+ * Return: address size (typically 32 or 36)
+ */
+int cpu_phys_address_size(void);
+
#endif
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 890f0e6cf40..120393426db 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -386,16 +386,29 @@ static inline oftree oftree_from_np(struct device_node *root)
void oftree_dispose(oftree tree);
/**
- * ofnode_name_eq() - Check if the node name is equivalent to a given name
- * ignoring the unit address
+ * ofnode_name_eq() - Check a node name ignoring its unit address
*
- * @node: valid node reference that has to be compared
- * @name: name that has to be compared with the node name
+ * @node: valid node to compared, which may have a unit address
+ * @name: name (without unit address) to compare with the node name
* Return: true if matches, false if it doesn't match
*/
bool ofnode_name_eq(ofnode node, const char *name);
/**
+ * ofnode_name_eq_unit() - Check a node name ignoring its unit address
+ *
+ * This is separate from ofnode_name_eq() to avoid code-size increase for
+ * boards which don't need this function
+ *
+ * @node: valid node to compared, which may have a unit address
+ * @name: name to compare with the node name. If this contains a unit
+ * address, it is matched, otherwise the unit address is ignored
+ * when searching for matches
+ * Return: true if matches, false if it doesn't match
+ */
+bool ofnode_name_eq_unit(ofnode node, const char *name);
+
+/**
* ofnode_read_u8() - Read a 8-bit integer from a property
*
* @node: valid node reference to read property from
@@ -594,6 +607,18 @@ bool ofnode_read_bool(ofnode node, const char *propname);
*/
ofnode ofnode_find_subnode(ofnode node, const char *subnode_name);
+/**
+ * ofnode_find_subnode_unit() - find a named subnode of a parent node
+ *
+ * @node: valid reference to parent node
+ * @subnode_name: name of subnode to find, including any unit address. If the
+ * unit address is omitted, any subnode which matches the name (excluding
+ * any unit address) is returned
+ * Return: reference to subnode (which can be invalid if there is no such
+ * subnode)
+ */
+ofnode ofnode_find_subnode_unit(ofnode node, const char *subnode_name);
+
#if CONFIG_IS_ENABLED(DM_INLINE_OFNODE)
#include <asm/global_data.h>
@@ -1809,7 +1834,7 @@ static inline int ofnode_read_bootscript_flash(u64 *bootscr_flash_offset,
* of_add_subnode() - add a new subnode to a node
*
* @parent: parent node to add to
- * @name: name of subnode
+ * @name: name of subnode (allocated by this function)
* @nodep: returns pointer to new subnode (valid if the function returns 0
* or -EEXIST)
* Returns 0 if OK, -EEXIST if already exists, -ENOMEM if out of memory, other
diff --git a/include/image.h b/include/image.h
index 0a61dfd556c..8a9f779d3ff 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1160,16 +1160,16 @@ int fit_image_get_type(const void *fit, int noffset, uint8_t *type);
int fit_image_get_comp(const void *fit, int noffset, uint8_t *comp);
int fit_image_get_load(const void *fit, int noffset, ulong *load);
int fit_image_get_entry(const void *fit, int noffset, ulong *entry);
-int fit_image_get_data(const void *fit, int noffset,
- const void **data, size_t *size);
+int fit_image_get_emb_data(const void *fit, int noffset, const void **data,
+ size_t *size);
int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset);
int fit_image_get_data_position(const void *fit, int noffset,
int *data_position);
int fit_image_get_data_size(const void *fit, int noffset, int *data_size);
int fit_image_get_data_size_unciphered(const void *fit, int noffset,
size_t *data_size);
-int fit_image_get_data_and_size(const void *fit, int noffset,
- const void **data, size_t *size);
+int fit_image_get_data(const void *fit, int noffset, const void **data,
+ size_t *size);
/**
* fit_image_get_phase() - Get the phase from a FIT image
diff --git a/include/video.h b/include/video.h
index 4ec71ab16da..a1f7fd7e839 100644
--- a/include/video.h
+++ b/include/video.h
@@ -150,6 +150,7 @@ struct video_ops {
* set by the driver, but if not, the uclass will set it after
* probing
* @bpix: Encoded bits per pixel (enum video_log2_bpp)
+ * @format: Video format (enum video_format)
*/
struct video_handoff {
u64 fb;
@@ -158,6 +159,7 @@ struct video_handoff {
u16 ysize;
u32 line_length;
u8 bpix;
+ u8 format;
};
/** enum colour_idx - the 16 colors supported by consoles */