[PATCH 3/5] at91sam926x_lowlevel_init: use pio macro
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Sun Feb 3 10:24:11 EST 2013
this will make the code more readble
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at 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
More information about the barebox
mailing list