[PATCH 1/1] bcm2835: move mci register at board level

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Nov 3 02:07:08 EST 2013


not all board have a SD coard

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/boards/raspberry-pi/rpi.c        | 1 +
 arch/arm/mach-bcm2835/core.c              | 1 -
 arch/arm/mach-bcm2835/include/mach/core.h | 8 ++++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/raspberry-pi/rpi.c b/arch/arm/boards/raspberry-pi/rpi.c
index d4912cc..a3ff746 100644
--- a/arch/arm/boards/raspberry-pi/rpi.c
+++ b/arch/arm/boards/raspberry-pi/rpi.c
@@ -39,6 +39,7 @@ console_initcall(rpi_console_init);
 
 static int rpi_devices_init(void)
 {
+	bcm2835_register_mci();
 	armlinux_set_architecture(MACH_TYPE_BCM2708);
 	armlinux_set_bootparams((void *)(0x00000100));
 	return 0;
diff --git a/arch/arm/mach-bcm2835/core.c b/arch/arm/mach-bcm2835/core.c
index 906e434..f44ecd5 100644
--- a/arch/arm/mach-bcm2835/core.c
+++ b/arch/arm/mach-bcm2835/core.c
@@ -70,7 +70,6 @@ static int bcm2835_dev_init(void)
 {
 	add_generic_device("bcm2835-gpio", 0, NULL, BCM2835_GPIO_BASE, 0xB0, IORESOURCE_MEM, NULL);
 	add_generic_device("bcm2835-cs", DEVICE_ID_SINGLE, NULL, BCM2835_ST_BASE, 0x1C, IORESOURCE_MEM, NULL);
-	add_generic_device("bcm2835_mci", 0, NULL, BCM2835_EMMC_BASE, 0xFC, IORESOURCE_MEM, NULL);
 	return 0;
 }
 coredevice_initcall(bcm2835_dev_init);
diff --git a/arch/arm/mach-bcm2835/include/mach/core.h b/arch/arm/mach-bcm2835/include/mach/core.h
index 9379af2..a095db8 100644
--- a/arch/arm/mach-bcm2835/include/mach/core.h
+++ b/arch/arm/mach-bcm2835/include/mach/core.h
@@ -16,7 +16,15 @@
 #ifndef __BCM2835_CORE_H__
 #define __BCM2835_CORE_H__
 
+#include <mach/platform.h>
+
 void bcm2835_register_uart(void);
 void bcm2835_add_device_sdram(u32 size);
 
+static void inline bcm2835_register_mci(void)
+{
+	add_generic_device("bcm2835_mci", 0, NULL, BCM2835_EMMC_BASE, 0xFC,
+			IORESOURCE_MEM, NULL);
+}
+
 #endif
-- 
1.8.4.rc3




More information about the barebox mailing list