From 0998a20cfc6b57e271d597153e39439c37034206 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Thu, 29 Dec 2022 11:52:59 -0500 Subject: misc: fs_loader: Add function to get the chosen loader The fs_loader device is used to pull in settings via the chosen node. However, there was no library function for this, so arria10 was doing it explicitly. This function subsumes that, and uses ofnode_get_chosen_node instead of navigating the device tree directly. Because fs_loader pulls its config from the environment by default, it's fine to create a device with nothing backing it at all. Doing this allows enabling CONFIG_FS_LOADER without needing to modify the device tree. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass Reviewed-by: Ramon Fried --- include/fs_loader.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/fs_loader.h b/include/fs_loader.h index 8de7cb18dc7..5eb5b7ab4a1 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -52,4 +52,16 @@ struct device_plat { int request_firmware_into_buf(struct udevice *dev, const char *name, void *buf, size_t size, u32 offset); + +/** + * get_fs_loader() - Get the chosen filesystem loader + * @dev: Where to store the device + * + * This gets a filesystem loader device based on the value of + * /chosen/firmware-loader. If no such property exists, it returns a + * firmware loader which is configured by environmental variables. + * + * Return: 0 on success, negative value on error + */ +int get_fs_loader(struct udevice **dev); #endif -- cgit v1.2.3 From d0ba0ca45a49d6a062d0bc94b3380ea9b9616284 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 5 Jan 2023 14:08:23 +0100 Subject: distro_bootcmd: Set distro_bootpart_uuid for block devices The assignment of block device nodes in Linux is not deterministic by default, i.e. a newly added eMMC controller or other block device can change the assignment of /dev/mmcblkN (or other block device node like e.g. /dev/sdXy) and prevent the system from picking the correct block device for root filesystem in case the root filesystem is specified on kernel command line using 'root=/dev/mmcblkNpM' (or 'root=/dev/sdXy' etc.). One way out is to derive PARTUUID in U-Boot, which is unique identifier of a partition, and pass that as root=PARTUUID= to Linux via kernel command line. Linux would then find the partition using PARTUUID, no matter on which block device the partition resides and which node was assigned to that block device. Derive the PARTUUID before scanning for extlinux presence and assign it into distro_bootpart_uuid environment variable, which can then be used in extlinux.conf kernel command line specifier. Note that it is not possible to do this in scan_dev_for_extlinux script because this script is called from scan_dev_for_boot script, which is called for both block devices as well as UBI volumes, and we can not derive PARTUUID for UBI volumes. Signed-off-by: Marek Vasut --- include/config_distro_bootcmd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index c3a2414b914..9d2a225e7eb 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -521,6 +521,9 @@ "if fstype ${devtype} " \ "${devnum}:${distro_bootpart} " \ "bootfstype; then " \ + "part uuid ${devtype} " \ + "${devnum}:${distro_bootpart} " \ + "distro_bootpart_uuid ; " \ "run scan_dev_for_boot; " \ "fi; " \ "done; " \ -- cgit v1.2.3 From 48b3ecbedf8208845ac5956a3fb8817269fafedd Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Sep 2022 17:53:26 +0200 Subject: gpio: Get rid of gpio_hog_probe_all() The gpio_hog_probe_all() functionality can be perfectly well replaced by DM_FLAG_PROBE_AFTER_BIND DM flag, which would trigger .probe() callback of each GPIO hog driver instance after .bind() and thus configure the hogged GPIO accordingly. Signed-off-by: Marek Vasut Signed-off-by: Quentin Schulz Reviewed-by: Patrick Delaunay Reviewed-by: Samuel Holland --- include/asm-generic/gpio.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 0fcf70983fb..dd0bdf2315e 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -461,14 +461,6 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc); */ int gpio_hog_lookup_name(const char *name, struct gpio_desc **desc); -/** - * gpio_hog_probe_all() - probe all gpio devices with - * gpio-hog subnodes. - * - * @return: Returns return value from device_probe() - */ -int gpio_hog_probe_all(void); - /** * gpio_lookup_name - Look up a GPIO name and return its details * -- cgit v1.2.3