From 4535a24c0c06e367bc40c43b4807bdb335513a1a Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Mon, 18 Nov 2013 08:07:23 +0100 Subject: arm926ejs, at91: add common phy_reset function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add common phy reset code into a common function. Signed-off-by: Heiko Schocher Cc: Andreas Bießmann Cc: Bo Shen Cc: Jens Scharsig Cc: Sergey Lapin Cc: Stelian Pop Cc: Albin Tonnerre Cc: Eric Benard Cc: Markus Hubig Acked-by: Jens Scharsig (BuS Elektronik) Tested-by: Jens Scharsig (BuS Elektronik) Tested-by: Bo Shen Acked-by: Bo Shen Signed-off-by: Andreas Bießmann --- board/eukrea/cpu9260/cpu9260.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'board/eukrea') diff --git a/board/eukrea/cpu9260/cpu9260.c b/board/eukrea/cpu9260/cpu9260.c index 5e1524e..274f72d 100644 --- a/board/eukrea/cpu9260/cpu9260.c +++ b/board/eukrea/cpu9260/cpu9260.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -89,29 +88,14 @@ static void cpu9260_nand_hw_init(void) #ifdef CONFIG_MACB static void cpu9260_macb_hw_init(void) { - unsigned long rstcmr; at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC; - at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC; /* Enable clock */ writel(1 << ATMEL_ID_EMAC0, &pmc->pcer); at91_set_pio_pullup(AT91_PIO_PORTA, 17, 1); - rstcmr = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK; - - /* Need to reset PHY -> 500ms reset */ - writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0xD) | - AT91_RSTC_MR_URSTEN, &rstc->mr); - - writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr); - - /* Wait for end hardware reset */ - while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL)) - ; - - /* Restore NRST value */ - writel(AT91_RSTC_KEY | rstcmr | AT91_RSTC_MR_URSTEN, &rstc->mr); + at91_phy_reset(); at91_macb_hw_init(); } -- cgit v1.1 From ac45bb1646e866b463405fade65bac4d877d4209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Date: Fri, 29 Nov 2013 12:13:45 +0100 Subject: at91: nand: switch atmel_nand to generic GPIO API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Bießmann Acked-by: Jens Scharsig (BuS Elektronik) Tested-by: Jens Scharsig (BuS Elektronik) Acked-by: Scott Wood --- board/eukrea/cpu9260/cpu9260.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'board/eukrea') diff --git a/board/eukrea/cpu9260/cpu9260.c b/board/eukrea/cpu9260/cpu9260.c index 274f72d..01ecccb 100644 --- a/board/eukrea/cpu9260/cpu9260.c +++ b/board/eukrea/cpu9260/cpu9260.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -78,10 +79,10 @@ static void cpu9260_nand_hw_init(void) writel(1 << ATMEL_ID_PIOC, &pmc->pcer); /* Configure RDY/BSY */ - at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1); + gpio_direction_input(CONFIG_SYS_NAND_READY_PIN); /* Enable NandFlash */ - at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); + gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); } #endif -- cgit v1.1