[U-Boot] [PATCH 2/4] sama5d2_xplained: add support of QSPI controllers

Cyrille Pitchen cyrille.pitchen at atmel.com
Wed Mar 16 17:41:26 CET 2016


Signed-off-by: Cyrille Pitchen <cyrille.pitchen at atmel.com>
---
 board/atmel/sama5d2_xplained/Kconfig            |  6 ++++++
 board/atmel/sama5d2_xplained/sama5d2_xplained.c | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/board/atmel/sama5d2_xplained/Kconfig b/board/atmel/sama5d2_xplained/Kconfig
index d4106b90f599..1659a2043b04 100644
--- a/board/atmel/sama5d2_xplained/Kconfig
+++ b/board/atmel/sama5d2_xplained/Kconfig
@@ -26,4 +26,10 @@ config ATMEL_SDHCI1
 	select ATMEL_SDHCI
 	default y
 
+config ATMEL_QSPI0
+	bool "QSPI0"
+	select DM_SPI
+	select ATMEL_QSPI
+	default n
+
 endif
diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
index 4dd83e5e991f..6d4c2da99bc3 100644
--- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c
+++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
@@ -55,6 +55,21 @@ static void board_spi0_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_ATMEL_QSPI0
+static void board_qspi0_hw_init(void)
+{
+	/* QSPI0 - ioset 3 */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 22, 0);	/* SCK */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 23, 0); /* CS */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 24, 1); /* IO0 */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 25, 1); /* IO1 */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 26, 1); /* IO2 */
+	atmel_pio4_set_f_periph(AT91_PIO_PORTA, 27, 1); /* IO3 */
+
+	at91_periph_clk_enable(ATMEL_ID_QSPI0);
+}
+#endif
+
 static void board_usb_hw_init(void)
 {
 	atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1);
@@ -241,6 +256,9 @@ int board_init(void)
 #ifdef CONFIG_ATMEL_SPI0
 	board_spi0_hw_init();
 #endif
+#ifdef CONFIG_ATMEL_QSPI0
+	board_qspi0_hw_init();
+#endif
 #ifdef CONFIG_ATMEL_SDHCI0
 	board_sdhci0_hw_init();
 #endif
-- 
1.8.2.2



More information about the U-Boot mailing list