diff options
author | Rajeshwari Shinde <rajeshwari.s@samsung.com> | 2012-12-26 20:03:11 +0000 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2013-01-08 10:54:32 +0900 |
commit | d055911887583e36e550900506c80fbd73c89a58 (patch) | |
tree | f199a616d70d105944d0a195c82e6d1dbc3f1d98 /arch/arm/cpu/armv7 | |
parent | c34253d1fc83e4cf231af77c667827a51c3f28cb (diff) | |
download | u-boot-imx-d055911887583e36e550900506c80fbd73c89a58.zip u-boot-imx-d055911887583e36e550900506c80fbd73c89a58.tar.gz u-boot-imx-d055911887583e36e550900506c80fbd73c89a58.tar.bz2 |
EXYNOS5: FDT : Decode peripheral id
Api is added to decode peripheral id based on the interrupt number
of the peripheral.
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r-- | arch/arm/cpu/armv7/exynos/pinmux.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c index ee58dac..bd499b4 100644 --- a/arch/arm/cpu/armv7/exynos/pinmux.c +++ b/arch/arm/cpu/armv7/exynos/pinmux.c @@ -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 |