]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/exynos/pinmux.c
Merge branch 'u-boot/master' into 'u-boot-arm/master'
[u-boot] / arch / arm / cpu / armv7 / exynos / pinmux.c
index ee58dac3a0f5e1f3e6c59c99657a253835142dd0..bd499b47614ca2b1af126642931fa627d14f45ca 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <fdtdec.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sromc.h>
@@ -447,3 +448,31 @@ int exynos_pinmux_config(int peripheral, int flags)
                return -1;
        }
 }
+
+#ifdef CONFIG_OF_CONTROL
+static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
+{
+       int err;
+       u32 cell[3];
+
+       err = fdtdec_get_int_array(blob, node, "interrupts", cell,
+                                       ARRAY_SIZE(cell));
+       if (err)
+               return PERIPH_ID_NONE;
+
+       /* check for invalid peripheral id */
+       if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
+               return cell[1];
+
+       debug(" invalid peripheral id\n");
+       return PERIPH_ID_NONE;
+}
+
+int pinmux_decode_periph_id(const void *blob, int node)
+{
+       if (cpu_is_exynos5())
+               return  exynos5_pinmux_decode_periph_id(blob, node);
+       else
+               return PERIPH_ID_NONE;
+}
+#endif