};
#endif
-struct rk29_sdmmc_platform_data {
- unsigned int host_caps;
- unsigned int host_ocr_avail;
- unsigned int use_dma:1;
- char dma_name[8];
- int (*io_init)(void);
- int (*io_deinit)(void);
- void (*set_iomux)(int device_id, unsigned int bus_width);//added by xbw at 2011-10-13
- int (*status)(struct device *);
- int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
- int detect_irq;
- int enable_sd_wakeup;
- int write_prt;
-};
struct rk29_i2c_platform_data {
int bus_num;
unsigned int flags;
};
#endif
+#ifdef CONFIG_SDMMC0_RK29
+static struct resource resources_sdmmc0[] = {
+ {
+ .start = IRQ_SDMMC,
+ .end = IRQ_SDMMC,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = RK30_SDMMC0_PHYS,
+ .end = RK30_SDMMC0_PHYS + RK30_SDMMC0_SIZE -1,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct platform_device device_sdmmc0 = {
+ .name = "rk29_sdmmc",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(resources_sdmmc0),
+ .resource = resources_sdmmc0,
+ .dev = {
+ .platform_data = &default_sdmmc0_data,
+ },
+};
+#endif
+
+#ifdef CONFIG_SDMMC1_RK29
+static struct resource resources_sdmmc1[] = {
+ {
+ .start = IRQ_SDIO,
+ .end = IRQ_SDIO,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = RK30_SDIO_PHYS,
+ .end = RK30_SDIO_PHYS + RK30_SDIO_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct platform_device device_sdmmc1 = {
+ .name = "rk29_sdmmc",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(resources_sdmmc1),
+ .resource = resources_sdmmc1,
+ .dev = {
+ .platform_data = &default_sdmmc1_data,
+ },
+};
+#endif
+
+static void __init rk30_init_sdmmc(void)
+{
+#ifdef CONFIG_SDMMC0_RK29
+ platform_device_register(&device_sdmmc0);
+#endif
+#ifdef CONFIG_SDMMC1_RK29
+ platform_device_register(&device_sdmmc1);
+#endif
+}
+
static int __init rk30_init_devices(void)
{
rk30_init_dma();
#ifdef CONFIG_TSADC_RK30
platform_device_register(&device_tsadc);
#endif
+ rk30_init_sdmmc();
return 0;
}
void (*exit_platform_hw)(void);
};
+extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
+extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
void __init rk30_map_common_io(void);
void __init rk30_init_irq(void);
--- /dev/null
+#include <plat/dma-pl330.h>
#ifndef __PLAT_BOARD_H
#define __PLAT_BOARD_H
+
#include <linux/types.h>
#include <linux/init.h>
+#include <linux/device.h>
/*spi*/
struct spi_cs_gpio {
unsigned int delay_ms; /* in milliseconds */
};
-#define BOOT_MODE_NORMAL 0
-#define BOOT_MODE_FACTORY2 1
-#define BOOT_MODE_RECOVERY 2
-#define BOOT_MODE_CHARGE 3
-#define BOOT_MODE_POWER_TEST 4
-#define BOOT_MODE_OFFMODE_CHARGING 5
-#define BOOT_MODE_REBOOT 6
-#define BOOT_MODE_PANIC 7
-
struct rk29lcd_info {
u32 lcd_id;
u32 txd_pin;
int (*io_disable)(void);
};
+struct rk29_sdmmc_platform_data {
+ unsigned int host_caps;
+ unsigned int host_ocr_avail;
+ unsigned int use_dma:1;
+ char dma_name[8];
+ int (*io_init)(void);
+ int (*io_deinit)(void);
+ void (*set_iomux)(int device_id, unsigned int bus_width);//added by xbw at 2011-10-13
+ int (*status)(struct device *);
+ int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
+ int detect_irq;
+ int enable_sd_wakeup;
+ int write_prt;
+};
+
+#define BOOT_MODE_NORMAL 0
+#define BOOT_MODE_FACTORY2 1
+#define BOOT_MODE_RECOVERY 2
+#define BOOT_MODE_CHARGE 3
+#define BOOT_MODE_POWER_TEST 4
+#define BOOT_MODE_OFFMODE_CHARGING 5
+#define BOOT_MODE_REBOOT 6
+#define BOOT_MODE_PANIC 7
int board_boot_mode(void);
/* for USB detection */
config SDMMC_RK29
tristate "RK29 SDMMC controller suppport"
- depends on ARCH_RK29
+ depends on PLAT_RK
help
This selects the RK29 SDMMC controller.
SDMMC0 used for sd/mmc card, and SDMMC1 used for sdio.
config SDMMC0_RK29
tristate "RK29 SDMMC0 controller support(sdmmc)"
default y
- depends on ARCH_RK29
help
This supports the use of the SDMMC0 controller on Rk29 processors.
config SDMMC1_RK29
tristate "RK29 SDMMC1 controller support(sdio)"
default y
- depends on ARCH_RK29
help
This supports the use of the SDMMC1 controller on Rk29 processors.
config SDMMC1_RK29_WRITE_PROTECT
#include <linux/mmc/card.h>
#include <mach/board.h>
-#include <mach/rk29_iomap.h>
+#include <mach/io.h>
#include <mach/gpio.h>
#include <mach/iomux.h>
#include <asm/dma.h>
-#include <mach/rk29-dma-pl330.h>
+#include <mach/dma-pl330.h>
#include <asm/scatterlist.h>
#include "rk29_sdmmc.h"