From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Tomsich Date: Mon, 11 Sep 2017 13:59:03 +0200 Subject: [U-Boot] [PATCH 03/10] rockchip: spl: add documentation for spl_node_to_boot_device() In-Reply-To: <1505131150-39480-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505131150-39480-1-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: <1505131150-39480-4-git-send-email-philipp.tomsich@theobroma-systems.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In the expectation that the spl-boot-order code will eventually gain use outside of mach-rockchip: let's add documentation on the spl_node_to_boot_device() function, which is likely to become a publicly exported function. Signed-off-by: Philipp Tomsich --- arch/arm/mach-rockchip/spl-boot-order.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-rockchip/spl-boot-order.c b/arch/arm/mach-rockchip/spl-boot-order.c index 4f78c72..0bb9a73 100644 --- a/arch/arm/mach-rockchip/spl-boot-order.c +++ b/arch/arm/mach-rockchip/spl-boot-order.c @@ -10,6 +10,25 @@ #include #if CONFIG_IS_ENABLED(OF_CONTROL) +/** + * spl_node_to_boot_device() - maps from a DT-node to a SPL boot device + * @node: of_offset of the node + * + * The SPL framework uses BOOT_DEVICE_... constants to identify its boot + * sources. These may take on a device-specific meaning, depending on + * what nodes are enabled in a DTS (e.g. BOOT_DEVICE_MMC1 may refer to + * different controllers/block-devices, depending on which SD/MMC controllers + * are enabled in any given DTS). This function maps from a DT-node back + * onto a BOOT_DEVICE_... constant, considering the currently active devices. + * + * Returns + * -ENOENT, if no device matching the node could be found + * -ENOSYS, if the device matching the node can not be mapped onto a + * SPL boot device (e.g. the third MMC device) + * -1, for unspecified failures + * a positive integer (from the BOOT_DEVICE_... family) on succes. + */ + static int spl_node_to_boot_device(int node) { struct udevice *parent; -- 2.1.4