Skip to contentSkip to conversation

ARM: at91: at91sam9rlek: add mmc config for at91sam9rlek

PATCH New Josh Wu 3 participants 6 messages Feb 2, 2015 – Mar 18, 2015

Subsystems (2)
lore
Share & tools
lore

Josh Wu

author
#0 lore raw

cover ARM: at91: at91sam9rlek: add mmc config for at91sam9rlek

This patch series will enable mmc support on at91sam9rlek board. And also add a MMC config for it.

Josh Wu (2):
ARM: at91: at91sam9rlek: add mci support
ARM: at91: at91sam9rlek: add mmc environment configuration

 arch/arm/cpu/arm926ejs/at91/at91sam9rl_devices.c | 17 ++++++++++++++
 board/atmel/at91sam9rlek/at91sam9rlek.c          | 10 ++++++++
 configs/at91sam9rlek_mmc_defconfig               |  3 +++
 include/configs/at91sam9rlek.h                   | 29 +++++++++++++++++++++++-
 4 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 configs/at91sam9rlek_mmc_defconfig
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 ARM: at91: at91sam9rlek: add mci support

This patch enable the MCI support for at91sam9rlek board.

---

 arch/arm/cpu/arm926ejs/at91/at91sam9rl_devices.c | 17 +++++++++++++++++
 board/atmel/at91sam9rlek/at91sam9rlek.c          | 10 ++++++++++
 include/configs/at91sam9rlek.h                   | 11 +++++++++++
 3 files changed, 38 insertions(+)
arch/arm/cpu/arm926ejs/at91/at91sam9rl_devices.c +17 -0
index 0ec32c3..857c864 100644
@@ -101,3 +101,20 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	}
 }
 #endif
+
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+void at91_mci_hw_init(void)
+{
+	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+	at91_set_a_periph(AT91_PIO_PORTA, 2, 0);        /* MCI CLK */
+	at91_set_a_periph(AT91_PIO_PORTA, 1, 0);        /* MCI CDA */
+	at91_set_a_periph(AT91_PIO_PORTA, 0, 0);        /* MCI DA0 */
+	at91_set_a_periph(AT91_PIO_PORTA, 3, 0);        /* MCI DA1 */
+	at91_set_a_periph(AT91_PIO_PORTA, 4, 0);        /* MCI DA2 */
+	at91_set_a_periph(AT91_PIO_PORTA, 5, 0);        /* MCI DA3 */
+
+	/* Enable clock */
+	writel(1 << ATMEL_ID_MCI, &pmc->pcer);
+}
+#endif
board/atmel/at91sam9rlek/at91sam9rlek.c +10 -0
index 56ca1d4..f995cef 100644
@@ -19,6 +19,7 @@
 
 #include <lcd.h>
 #include <atmel_lcdc.h>
+#include <atmel_mci.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
@@ -162,6 +163,15 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+int board_mmc_init(bd_t *bis)
+{
+	at91_mci_hw_init();
+
+	return atmel_mci_init((void *)ATMEL_BASE_MCI);
+}
+#endif
+
 int board_early_init_f(void)
 {
 	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
include/configs/at91sam9rlek.h +11 -0
index f790fcf..c15e999 100644
@@ -124,6 +124,17 @@
 
 #endif
 
+/* MMC */
+#define CONFIG_CMD_MMC
+
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_GENERIC_ATMEL_MCI
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+#endif
+
 /* Ethernet - not present */
 
 /* USB - not supported */
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/2 ARM: at91: at91sam9rlek: add mci support

Dear Josh Wu,

Quoted 11 lines · Josh Wu

This patch enable the MCI support for at91sam9rlek board.

---

arch/arm/mach-at91/arm926ejs/at91sam9rl_devices.c | 17 +++++++++++++++++
board/atmel/at91sam9rlek/at91sam9rlek.c | 10 ++++++++++
include/configs/at91sam9rlek.h | 11 +++++++++++

3 files changed, 38 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

author
#3 lore raw

PATCH 2/2 ARM: at91: at91sam9rlek: add mmc environment configuration

In reply to Josh Wu

Add a mmc default config, which will save the environment in a FAT file (uboot.env) of MMC.

---

 configs/at91sam9rlek_mmc_defconfig |  3 +++
 include/configs/at91sam9rlek.h     | 18 +++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 configs/at91sam9rlek_mmc_defconfig
configs/at91sam9rlek_mmc_defconfig new file +3 -0
new file mode 100644
index 0000000..b93c881
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9RL,SYS_USE_MMC"
+CONFIG_ARM=y
+CONFIG_TARGET_AT91SAM9RLEK=y
include/configs/at91sam9rlek.h +17 -1
index c15e999..122844d 100644
@@ -158,7 +158,7 @@
 				"mtdparts=atmel_nand:-(root) "\
 				"rw rootfstype=jffs2"
 
-#else /* CONFIG_SYS_USE_NANDFLASH */
+#elif CONFIG_SYS_USE_NANDFLASH
 
 /* bootstrap + u-boot + env + linux in nandflash */
 #define CONFIG_ENV_IS_IN_NAND		1
@@ -173,6 +173,22 @@
 				"512k(dtb),6M(kernel)ro,-(rootfs) "				\
 				"rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
 
+#else /* CONFIG_SYS_USE_MMC */
+
+/* bootstrap + u-boot + env + linux in mmc */
+#define CONFIG_ENV_IS_IN_FAT
+#define CONFIG_FAT_WRITE
+#define FAT_ENV_INTERFACE	"mmc"
+#define FAT_ENV_FILE		"uboot.env"
+#define FAT_ENV_DEVICE_AND_PART	"0"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_BOOTCOMMAND	"fatload mmc 0:1 0x21000000 at91sam9rlek.dtb; " \
+				"fatload mmc 0:1 0x22000000 zImage; " \
+				"bootz 0x22000000 - 0x21000000"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"mtdparts=atmel_nand:" \
+				"8M(bootstrap/uboot/kernel)ro,-(rootfs) " \
+				"root=/dev/mmcblk0p2 rw rootwait"
 #endif
 
 #define CONFIG_SYS_PROMPT		"U-Boot> "
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/2 ARM: at91: at91sam9rlek: add mmc environment configuration

Dear Josh Wu,

Quoted 10 lines · Josh Wu

Add a mmc default config, which will save the environment in a FAT file (uboot.env) of MMC.

---

configs/at91sam9rlek_mmc_defconfig | 3 +++
include/configs/at91sam9rlek.h | 18 +++++++++++++++++-

2 files changed, 20 insertions(+), 1 deletion(-)

create mode 100644 configs/at91sam9rlek_mmc_defconfig

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bie?mann

#5 lore raw

cover ARM: at91: at91sam9rlek: add mmc config for at91sam9rlek

In reply to Josh Wu

Hi Josh,

Quoted 7 lines · Josh Wu

This patch series will enable mmc support on at91sam9rlek board. And also add a MMC config for it.

Josh Wu (2):
ARM: at91: at91sam9rlek: add mci support
ARM: at91: at91sam9rlek: add mmc environment configuration

For this series:

Quoted 7 lines
  arch/arm/cpu/arm926ejs/at91/at91sam9rl_devices.c | 17 ++++++++++++++
  board/atmel/at91sam9rlek/at91sam9rlek.c          | 10 ++++++++
  configs/at91sam9rlek_mmc_defconfig               |  3 +++
  include/configs/at91sam9rlek.h                   | 29 +++++++++++++++++++++++-
  4 files changed, 58 insertions(+), 1 deletion(-)

create mode 100644 configs/at91sam9rlek_mmc_defconfig

Best Regards,
Bo Shen