Skip to contentSkip to conversation

sunxi: support for a second SD card socket

PATCH New Karsten Merker 2 participants 4 messages Dec 16, 2015 – Dec 20, 2015 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

v2 cover sunxi: support for a second SD card socket

Hello,

this patchset enables the full-size SD card socket on the A20-Olimex-SOM-EVB baseboard in u-boot and adds support for including this kind of secondary socket into the boot environment provided by config_distro_bootcmd.h on sunxi-based systems.

The latter is particularly useful on the A20-Olimex-SOM-EVB as changing the card in the primary micro-SD socket is kind of fiddly when the SOM is plugged into the baseboard.

Changes since V1:
I had botched the patch generation for V1 so that the posted patch was incomplete. This is now the complete patch.

Regards,
Karsten

Karsten Merker (2):
sunxi: A20-Olimex-SOM-EVB defconfig: enable mmc3
sunxi: Enable a second mmc socket as boot target in the environment

 configs/A20-Olimex-SOM-EVB_defconfig | 3 +++
 include/configs/sunxi-common.h       | 7 +++++++
 2 files changed, 10 insertions(+)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/2 sunxi: A20-Olimex-SOM-EVB defconfig: enable mmc3

The Olimex A20-SOM-EVB is an evaluation board for the Olimex A20-SOM system-on-module. The baseboard provides a full-size SD socket (connected to mmc3) in addition to the micro-SD socket on the SOM itself (which is connected to mmc0).

Enable the mmc3 controller in the board defconfig.

---
 configs/A20-Olimex-SOM-EVB_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/A20-Olimex-SOM-EVB_defconfig +3 -0
index 5166c06..34b3f36 100644
@@ -3,6 +3,9 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_MMC3_CD_PIN="PH0"
+CONFIG_MMC3_PINS="PH"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_USB0_VBUS_PIN="PB9"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olimex-som-evb"
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 2/2 sunxi: Enable a second mmc socket as boot target in the environment

In reply to Karsten Merker

Some sunxi-based boards (such as the Olimex A20-SOM-EVB) have a second MMC socket. This socket is not bootable hardware-wise, i.e. u-boot itself cannot be loaded from it, but once u-boot has started, the second socket can be used in the boot process provided by config_distro_bootcmd.h.

If a second MMC socket is present, place it in the boot order after the first MMC socket.

---
 include/configs/sunxi-common.h | 7 +++++++
 1 file changed, 7 insertions(+)
include/configs/sunxi-common.h +7 -0
index 98a2c74..33f765c 100644
@@ -418,8 +418,14 @@ extern int soft_i2c_gpio_scl;
 
 #ifdef CONFIG_MMC
 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+#define BOOT_TARGET_DEVICES_MMC_EXTRA(func) func(MMC, mmc, 1)
+#else
+#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
+#endif
 #else
 #define BOOT_TARGET_DEVICES_MMC(func)
+#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
 #endif
 
 #ifdef CONFIG_AHCI
@@ -447,6 +453,7 @@ extern int soft_i2c_gpio_scl;
 #define BOOT_TARGET_DEVICES(func) \
 	func(FEL, fel, na) \
 	BOOT_TARGET_DEVICES_MMC(func) \
+	BOOT_TARGET_DEVICES_MMC_EXTRA(func) \
 	BOOT_TARGET_DEVICES_SCSI(func) \
 	BOOT_TARGET_DEVICES_USB(func) \
 	func(PXE, pxe, na) \
Signature · 1 line
2.1.4
#3 lore raw

v2 cover sunxi: support for a second SD card socket

In reply to Karsten Merker

Hi,

Quoted 7 lines · Karsten Merker

Hello,

this patchset enables the full-size SD card socket on the A20-Olimex-SOM-EVB baseboard in u-boot and adds support for including this kind of secondary socket into the boot environment provided by config_distro_bootcmd.h on sunxi-based systems.

Quoted 7 lines

The latter is particularly useful on the A20-Olimex-SOM-EVB as changing the card in the primary micro-SD socket is kind of fiddly when the SOM is plugged into the baseboard.

Changes since V1:
I had botched the patch generation for V1 so that the posted patch was incomplete. This is now the complete patch.

Thanks, both patches look good to me. I've added them to my sunxi-wip tree (for now) and I will include them in the next sunxi pull-req.

Regards,

Hans