From: Nishanth Menon Date: Thu, 24 Sep 2009 04:02:45 +0300 Subject: [PATCH] [RFC] OMAP3:EVM: remove direct gpio hits Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de ONLY COMPILE TESTED replace gpio direct access with gpio api calls Signed-off-by: Nishanth Menon --- board/ti/evm/evm.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 0718a08..f0ebaad 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "evm.h" /* @@ -92,7 +93,6 @@ void set_muxconf_regs(void) */ static void setup_net_chip(void) { - struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE; struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE; /* Configure GPMC registers */ @@ -112,15 +112,15 @@ static void setup_net_chip(void) writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00, &ctrl_base->gpmc_nadv_ale); - /* Make GPIO 64 as output pin */ - writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe); - - /* Now send a pulse on the GPIO pin */ - writel(GPIO0, &gpio3_base->setdataout); - udelay(1); - writel(GPIO0, &gpio3_base->cleardataout); - udelay(1); - writel(GPIO0, &gpio3_base->setdataout); + /* Make GPIO 64 as output pin and send a magic pulse through it */ + if (!omap_request_gpio(64)) { + omap_set_gpio_direction(64, 0); + omap_set_gpio_dataout(64, 1); + udelay(1); + omap_set_gpio_dataout(64, 0); + udelay(1); + omap_set_gpio_dataout(64, 1); + } } int board_eth_init(bd_t *bis) -- 1.6.0.4 --------------070100000504080108000804--