[U-Boot] [PATCH 0/2] Drive stregth for sama5d2_ptc_ek

These patches are originally created by Ludovic Desroches.
For the Sama5d2_ptc_ek board, we need to set nand PIO drive strength. Created macros for drive strength configuration. The drive strength has to be set to medium for the NAND data lines. With a low drive, we can get some data corruption.
Ludovic Desroches (2): gpio: atmel_pio4: add drive strength macros board: atmel: sama5d2_ptc_ek: update pin configuration for NAND
arch/arm/mach-at91/include/mach/atmel_pio4.h | 4 ++++ board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-)

From: Ludovic Desroches ludovic.desroches@microchip.com
Macros for drive strength configuration were missing.
Signed-off-by: Ludovic Desroches ludovic.desroches@microchip.com --- arch/arm/mach-at91/include/mach/atmel_pio4.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-at91/include/mach/atmel_pio4.h b/arch/arm/mach-at91/include/mach/atmel_pio4.h index 6760bec..aa49c7f 100644 --- a/arch/arm/mach-at91/include/mach/atmel_pio4.h +++ b/arch/arm/mach-at91/include/mach/atmel_pio4.h @@ -48,6 +48,10 @@ struct atmel_pio4_port { #define ATMEL_PIO_IFSCEN_MASK BIT(13) #define ATMEL_PIO_OPD_MASK BIT(14) #define ATMEL_PIO_SCHMITT_MASK BIT(15) +#define ATMEL_PIO_DRVSTR_MASK GENMASK(17, 16) +#define ATMEL_PIO_DRVSTR_LO (1 << 16) +#define ATMEL_PIO_DRVSTR_ME (2 << 16) +#define ATMEL_PIO_DRVSTR_HI (3 << 16) #define ATMEL_PIO_CFGR_EVTSEL_MASK GENMASK(26, 24) #define ATMEL_PIO_CFGR_EVTSEL_FALLING (0 << 24) #define ATMEL_PIO_CFGR_EVTSEL_RISING (1 << 24)

On Mon, Apr 23, 2018 at 10:59:49AM +0300, Eugen Hristev wrote:
From: Ludovic Desroches ludovic.desroches@microchip.com
Macros for drive strength configuration were missing.
Signed-off-by: Ludovic Desroches ludovic.desroches@microchip.com
Applied to u-boot/master, thanks!

From: Ludovic Desroches ludovic.desroches@microchip.com
The drive strength has to be set to medium for the NAND data lines. With a low drive, we can get some data corruption.
Signed-off-by: Ludovic Desroches ludovic.desroches@microchip.com --- board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c index 4c2e209..607abfe 100644 --- a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c +++ b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c @@ -49,14 +49,14 @@ static void board_nand_hw_init(void) AT91_SMC_MODE_TDF_CYCLE(3), &smc->cs[3].mode);
- atmel_pio4_set_b_periph(AT91_PIO_PORTA, 22, 0); /* D0 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 23, 0); /* D1 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 24, 0); /* D2 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 25, 0); /* D3 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 26, 0); /* D4 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 27, 0); /* D5 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 28, 0); /* D6 */ - atmel_pio4_set_b_periph(AT91_PIO_PORTA, 29, 0); /* D7 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 22, ATMEL_PIO_DRVSTR_ME); /* D0 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 23, ATMEL_PIO_DRVSTR_ME); /* D1 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 24, ATMEL_PIO_DRVSTR_ME); /* D2 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 25, ATMEL_PIO_DRVSTR_ME); /* D3 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 26, ATMEL_PIO_DRVSTR_ME); /* D4 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 27, ATMEL_PIO_DRVSTR_ME); /* D5 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 28, ATMEL_PIO_DRVSTR_ME); /* D6 */ + atmel_pio4_set_b_periph(AT91_PIO_PORTA, 29, ATMEL_PIO_DRVSTR_ME); /* D7 */ atmel_pio4_set_b_periph(AT91_PIO_PORTB, 2, 0); /* RE */ atmel_pio4_set_b_periph(AT91_PIO_PORTA, 30, 0); /* WE */ atmel_pio4_set_b_periph(AT91_PIO_PORTA, 31, 1); /* NCS */

On Mon, Apr 23, 2018 at 10:59:50AM +0300, Eugen Hristev wrote:
From: Ludovic Desroches ludovic.desroches@microchip.com
The drive strength has to be set to medium for the NAND data lines. With a low drive, we can get some data corruption.
Signed-off-by: Ludovic Desroches ludovic.desroches@microchip.com
Applied to u-boot/master, thanks!
participants (2)
-
Eugen Hristev
-
Tom Rini