]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mpc5xxx: add GPIO port configuration
authorAnatolij Gustschin <agust@denx.de>
Sun, 12 Aug 2012 23:38:10 +0000 (23:38 +0000)
committerWolfgang Denk <wd@denx.de>
Sat, 1 Sep 2012 12:19:52 +0000 (14:19 +0200)
Add posibility for board specifig GPIO configurations using
various CONFIG_SYS_ macros.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
arch/powerpc/cpu/mpc5xxx/cpu_init.c

index 9daf3755acd90ca9ebf442242cbcaf73542e2e56..3044b4171a0f37762c333869d641e70f3589541d 100644 (file)
@@ -169,6 +169,20 @@ void cpu_init_f (void)
        out_be32(&gpio->port_config, CONFIG_SYS_GPS_PORT_CONFIG);
 #endif
 
+       /* Setup gpios */
+#if defined(CONFIG_SYS_GPIO_DATADIR)
+       out_be32(&gpio->simple_ddr, CONFIG_SYS_GPIO_DATADIR);
+#endif
+#if defined(CONFIG_SYS_GPIO_OPENDRAIN)
+       out_be32(&gpio->simple_ode, CONFIG_SYS_GPIO_OPENDRAIN);
+#endif
+#if defined(CONFIG_SYS_GPIO_DATAVALUE)
+       out_be32(&gpio->simple_dvo, CONFIG_SYS_GPIO_DATAVALUE);
+#endif
+#if defined(CONFIG_SYS_GPIO_ENABLE)
+       out_be32(&gpio->simple_gpioe, CONFIG_SYS_GPIO_ENABLE);
+#endif
+
        /* enable timebase */
        setbits_be32(&xlb->config, (1 << 13));