From 3058e283b885d80fbaaaaed6f597a068188be948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Thu, 20 Jan 2022 01:04:42 +0100 Subject: fdt_support: Add fdt_for_each_node_by_compatible() helper macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add macro fdt_for_each_node_by_compatible() to allow iterating over fdt nodes by compatible string. Convert various usages of off = fdt_node_offset_by_compatible(fdt, start, compat); while (off > 0) { code(); off = fdt_node_offset_by_compatible(fdt, off, compat); } and similar, to fdt_for_each_node_by_compatible(off, fdt, start, compat) code(); Signed-off-by: Marek Behún Reviewed-by: Stefan Roese Reviewed-by: Simon Glass --- include/fdt_support.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/fdt_support.h b/include/fdt_support.h index 8ec461a..852040f 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -289,6 +289,12 @@ int fdt_node_offset_by_compat_reg(void *blob, const char *compat, phys_addr_t compat_off); int fdt_node_offset_by_pathf(void *blob, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + +#define fdt_for_each_node_by_compatible(node, fdt, start, compat) \ + for (node = fdt_node_offset_by_compatible(fdt, start, compat); \ + node >= 0; \ + node = fdt_node_offset_by_compatible(fdt, node, compat)) + int fdt_set_phandle(void *fdt, int nodeoffset, uint32_t phandle); unsigned int fdt_create_phandle(void *fdt, int nodeoffset); unsigned int fdt_create_phandle_by_compatible(void *fdt, const char *compat); -- cgit v1.1 From 2e0429bcc1a9cf2c3b4cc0e8af7199f031a3b8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Fri, 14 Jan 2022 14:31:38 +0100 Subject: SPL: Add struct spl_boot_device parameter into spl_parse_board_header() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add parameter spl_boot_device to spl_parse_board_header(), which allows the implementations to see from which device we are booting and do boot-device-specific checks of the image header. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- include/sdp.h | 3 ++- include/spl.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 6ac64fb..6d89baa 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -14,7 +14,8 @@ int sdp_init(int controller_index); #ifdef CONFIG_SPL_BUILD #include -int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image); +int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image, + struct spl_boot_device *bootdev); #else int sdp_handle(int controller_index); #endif diff --git a/include/spl.h b/include/spl.h index 0af0ee3..469e7fe 100644 --- a/include/spl.h +++ b/include/spl.h @@ -29,6 +29,7 @@ struct image_header; struct blk_desc; struct image_header; +struct spl_boot_device; /* * u_boot_first_phase() - check if this is the first U-Boot phase @@ -340,6 +341,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, * Returns 0 on success. */ int spl_load_legacy_img(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev, struct spl_load_info *load, ulong header); /** @@ -438,6 +440,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image); * @return 0 if a header was correctly parsed, -ve on error */ int spl_parse_image_header(struct spl_image_info *spl_image, + const struct spl_boot_device *bootdev, const struct image_header *header); void spl_board_prepare_for_linux(void); @@ -574,18 +577,22 @@ static inline const char *spl_loader_name(const struct spl_image_loader *loader) /* SPL FAT image functions */ int spl_load_image_fat(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev, struct blk_desc *block_dev, int partition, const char *filename); int spl_load_image_fat_os(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev, struct blk_desc *block_dev, int partition); void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image); /* SPL EXT image functions */ int spl_load_image_ext(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev, struct blk_desc *block_dev, int partition, const char *filename); int spl_load_image_ext_os(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev, struct blk_desc *block_dev, int partition); /** -- cgit v1.1 From 2928d2cd502a73eca2773f9ce3d5d96daca72788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Tue, 18 Jan 2022 10:33:20 +0100 Subject: phy: marvell: Remove unused function comphy_update_map() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This weak function is not used anymore, so completely remove it. Private struct comphy_map is not used by any board code anymore, so move it into private driver header file comphy_core.h. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- include/mvebu/comphy.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'include') diff --git a/include/mvebu/comphy.h b/include/mvebu/comphy.h index 4d1b703..1443157 100644 --- a/include/mvebu/comphy.h +++ b/include/mvebu/comphy.h @@ -6,17 +6,6 @@ #ifndef _MVEBU_COMPHY_H_ #define _MVEBU_COMPHY_H_ -#include - -struct comphy_map { - u32 type; - u32 speed; - u32 invert; - bool clk_src; - bool end_point; -}; - int comphy_rx_training(struct udevice *dev, u32 lane); -int comphy_update_map(struct comphy_map *serdes_map, int count); #endif /* _MVEBU_COMPHY_H_ */ -- cgit v1.1