From: Anatolij Gustschin Date: Mon, 13 Aug 2012 11:38:10 +0200 Subject: [U-Boot] [PATCH 2/4] mpc5xxx: add GPIO port configuration In-Reply-To: <1344850692-29748-1-git-send-email-agust@denx.de> References: <1344850692-29748-1-git-send-email-agust@denx.de> Message-ID: <1344850692-29748-2-git-send-email-agust@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add posibility for board specifig GPIO configurations using various CONFIG_SYS_ macros. Signed-off-by: Anatolij Gustschin --- arch/powerpc/cpu/mpc5xxx/cpu_init.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/cpu/mpc5xxx/cpu_init.c b/arch/powerpc/cpu/mpc5xxx/cpu_init.c index 9daf375..3044b41 100644 --- a/arch/powerpc/cpu/mpc5xxx/cpu_init.c +++ b/arch/powerpc/cpu/mpc5xxx/cpu_init.c @@ -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)); -- 1.7.7.6