summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-02-13 10:51:00 -0500
committerTom Rini <trini@konsulko.com>2018-02-13 10:51:00 -0500
commit85f855cf024ba04ef9ffc3dad92ddfbb75bd10ba (patch)
treead29913ef40fc002705169f4090f429561d4bffe
parentebdb098c67c8fa1e9eb3d4e2f6a6a380fc222188 (diff)
parenta5af51a703c3c68a56cfcf16ca6caa1dd8a6b934 (diff)
Merge git://git.denx.de/u-boot-rockchip
-rw-r--r--common/fdt_support.c78
-rw-r--r--drivers/gpio/rk_gpio.c4
2 files changed, 39 insertions, 43 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 724452d7545..17623a1728f 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -410,45 +410,6 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf;
}
-int fdt_record_loadable(void *blob, u32 index, const char *name,
- uintptr_t load_addr, u32 size, uintptr_t entry_point,
- const char *type, const char *os)
-{
- int err, node;
-
- err = fdt_check_header(blob);
- if (err < 0) {
- printf("%s: %s\n", __func__, fdt_strerror(err));
- return err;
- }
-
- /* find or create "/fit-images" node */
- node = fdt_find_or_add_subnode(blob, 0, "fit-images");
- if (node < 0)
- return node;
-
- /* find or create "/fit-images/<name>" node */
- node = fdt_find_or_add_subnode(blob, node, name);
- if (node < 0)
- return node;
-
- /*
- * We record these as 32bit entities, possibly truncating addresses.
- * However, spl_fit.c is not 64bit safe either: i.e. we should not
- * have an issue here.
- */
- fdt_setprop_u32(blob, node, "load-addr", load_addr);
- if (entry_point != -1)
- fdt_setprop_u32(blob, node, "entry-point", entry_point);
- fdt_setprop_u32(blob, node, "size", size);
- if (type)
- fdt_setprop_string(blob, node, "type", type);
- if (os)
- fdt_setprop_string(blob, node, "os", os);
-
- return node;
-}
-
#ifdef CONFIG_NR_DRAM_BANKS
#define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
#else
@@ -584,6 +545,45 @@ void fdt_fixup_ethernet(void *fdt)
}
}
+int fdt_record_loadable(void *blob, u32 index, const char *name,
+ uintptr_t load_addr, u32 size, uintptr_t entry_point,
+ const char *type, const char *os)
+{
+ int err, node;
+
+ err = fdt_check_header(blob);
+ if (err < 0) {
+ printf("%s: %s\n", __func__, fdt_strerror(err));
+ return err;
+ }
+
+ /* find or create "/fit-images" node */
+ node = fdt_find_or_add_subnode(blob, 0, "fit-images");
+ if (node < 0)
+ return node;
+
+ /* find or create "/fit-images/<name>" node */
+ node = fdt_find_or_add_subnode(blob, node, name);
+ if (node < 0)
+ return node;
+
+ /*
+ * We record these as 32bit entities, possibly truncating addresses.
+ * However, spl_fit.c is not 64bit safe either: i.e. we should not
+ * have an issue here.
+ */
+ fdt_setprop_u32(blob, node, "load-addr", load_addr);
+ if (entry_point != -1)
+ fdt_setprop_u32(blob, node, "entry-point", entry_point);
+ fdt_setprop_u32(blob, node, "size", size);
+ if (type)
+ fdt_setprop_string(blob, node, "type", type);
+ if (os)
+ fdt_setprop_string(blob, node, "os", os);
+
+ return node;
+}
+
/* Resize the fdt to its actual size + a bit of padding */
int fdt_shrink_to_minimum(void *blob, uint extrasize)
{
diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index 11fc3e26bd7..2419636c5f5 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -86,10 +86,6 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
ret = pinctrl_get_gpio_mux(priv->pinctrl, priv->bank, offset);
if (ret)
return ret;
-
- /* If it's not 0, then it is not a GPIO */
- if (ret)
- return GPIOF_FUNC;
is_output = readl(&regs->swport_ddr) & OFFSET_TO_BIT(offset);
return is_output ? GPIOF_OUTPUT : GPIOF_INPUT;