mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] at91sam926x_lowlevel_init: use pio macro
Date: Sun,  3 Feb 2013 16:24:11 +0100	[thread overview]
Message-ID: <1359905053-13109-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1359905053-13109-1-git-send-email-plagnioj@jcrosoft.com>

this will make the code more readble

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-at91/at91sam926x_lowlevel_init.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
index b62615e..75b080d 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
@@ -24,6 +24,9 @@
 #include <init.h>
 #include <sizes.h>
 
+#define __gpio_init inline
+#include "gpio.h"
+
 static void inline access_sdram(void)
 {
 	writel(0x00000000, AT91_SDRAM_BASE);
@@ -59,10 +62,10 @@ void __bare_init at91sam926x_lowlevel_init(void *pio, bool is_pio_asr,
 	__raw_writel(cfg.wdt_mr, AT91_BASE_WDT + AT91_WDT_MR);
 
 	/* configure PIOx as EBI0 D[16-31] */
-	__raw_writel(cfg.ebi_pio_pdr, pio + PIO_PDR);
-	__raw_writel(cfg.ebi_pio_ppudr, pio + PIO_PUDR);
+	at91_mux_gpio_disable(pio, cfg.ebi_pio_pdr);
+	at91_mux_set_pullup(pio, cfg.ebi_pio_ppudr, true);
 	if (is_pio_asr)
-		__raw_writel(cfg.ebi_pio_ppudr, pio + PIO_ASR);
+		at91_mux_set_A_periph(pio, cfg.ebi_pio_ppudr);
 
 	at91_sys_write(matrix_csa, cfg.ebi_csa);
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-02-03 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 15:22 [PATCH 0/5] at91sam926x: drop AT91_BASE_SYS for sdram controller + gpio cleanup Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 15:24 ` [PATCH 1/5] usb-a926x: only provide the resource if the driver is enable Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 15:24   ` [PATCH 2/5] at91: gpio: split accessor so we can use them for early init Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 15:24   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-02-03 15:24   ` [PATCH 4/5] at91sam926x_lowlevel_init: use struct to pass soc config Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 15:24   ` [PATCH 5/5] at91sam9: drop AT91_BASE_SYS for sdram controller Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 18:32   ` [PATCH 1/5] usb-a926x: only provide the resource if the driver is enable Jean-Christophe PLAGNIOL-VILLARD
2013-02-06 20:18 ` [PATCH 0/5] at91sam926x: drop AT91_BASE_SYS for sdram controller + gpio cleanup Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359905053-13109-3-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox