2010-08-19 18:06:32 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) ST-Ericsson SA 2010
|
|
|
|
*
|
|
|
|
* Author: Hanumath Prasad <hanumath.prasad@stericsson.com>
|
|
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/gpio.h>
|
|
|
|
#include <linux/amba/bus.h>
|
|
|
|
#include <linux/amba/mmci.h>
|
|
|
|
#include <linux/mmc/host.h>
|
|
|
|
#include <linux/platform_device.h>
|
2012-10-18 19:20:16 +07:00
|
|
|
#include <linux/platform_data/dma-ste-dma40.h>
|
2010-08-19 18:06:32 +07:00
|
|
|
|
2011-02-15 21:01:35 +07:00
|
|
|
#include <asm/mach-types.h>
|
2010-08-19 18:06:32 +07:00
|
|
|
|
2013-03-19 21:41:55 +07:00
|
|
|
#include "db8500-regs.h"
|
2010-08-19 18:06:32 +07:00
|
|
|
#include "board-mop500.h"
|
2010-10-14 18:57:59 +07:00
|
|
|
#include "ste-dma40-db8500.h"
|
2010-08-19 18:06:32 +07:00
|
|
|
|
2011-12-15 19:38:40 +07:00
|
|
|
/*
|
|
|
|
* v2 has a new version of this block that need to be forced, the number found
|
|
|
|
* in hardware is incorrect
|
|
|
|
*/
|
|
|
|
#define U8500_SDI_V2_PERIPHID 0x10480180
|
|
|
|
|
2010-08-09 20:48:17 +07:00
|
|
|
/*
|
|
|
|
* SDI 0 (MicroSD slot)
|
|
|
|
*/
|
|
|
|
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_DEV_TO_MEM,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV29_SD_MM0,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_MEM_TO_DEV,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV29_SD_MM0,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2012-05-29 13:40:04 +07:00
|
|
|
struct mmci_platform_data mop500_sdi0_data = {
|
2013-05-23 20:13:45 +07:00
|
|
|
.f_max = 100000000,
|
2011-03-30 21:00:39 +07:00
|
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
|
|
MMC_CAP_SD_HIGHSPEED |
|
2013-05-23 20:13:48 +07:00
|
|
|
MMC_CAP_MMC_HIGHSPEED |
|
2013-05-23 20:13:50 +07:00
|
|
|
MMC_CAP_ERASE |
|
|
|
|
MMC_CAP_UHS_SDR12 |
|
|
|
|
MMC_CAP_UHS_SDR25,
|
2010-08-09 20:48:17 +07:00
|
|
|
.gpio_wp = -1,
|
2011-12-13 22:57:55 +07:00
|
|
|
.sigdir = MCI_ST_FBCLKEN |
|
|
|
|
MCI_ST_CMDDIREN |
|
|
|
|
MCI_ST_DATA0DIREN |
|
|
|
|
MCI_ST_DATA2DIREN,
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
.dma_filter = stedma40_filter,
|
|
|
|
.dma_rx_param = &mop500_sdi0_dma_cfg_rx,
|
|
|
|
.dma_tx_param = &mop500_sdi0_dma_cfg_tx,
|
|
|
|
#endif
|
2010-08-09 20:48:17 +07:00
|
|
|
};
|
|
|
|
|
2011-10-26 15:50:42 +07:00
|
|
|
/*
|
|
|
|
* SDI1 (SDIO WLAN)
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
static struct stedma40_chan_cfg sdi1_dma_cfg_rx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_DEV_TO_MEM,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV32_SD_MM1,
|
2011-10-26 15:50:42 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stedma40_chan_cfg sdi1_dma_cfg_tx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_MEM_TO_DEV,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV32_SD_MM1,
|
2011-10-26 15:50:42 +07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2012-08-30 22:11:08 +07:00
|
|
|
struct mmci_platform_data mop500_sdi1_data = {
|
2011-10-26 15:50:42 +07:00
|
|
|
.ocr_mask = MMC_VDD_29_30,
|
2013-05-23 20:13:45 +07:00
|
|
|
.f_max = 100000000,
|
2013-05-23 20:13:49 +07:00
|
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
|
|
MMC_CAP_NONREMOVABLE,
|
2011-10-26 15:50:42 +07:00
|
|
|
.gpio_cd = -1,
|
|
|
|
.gpio_wp = -1,
|
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
.dma_filter = stedma40_filter,
|
|
|
|
.dma_rx_param = &sdi1_dma_cfg_rx,
|
|
|
|
.dma_tx_param = &sdi1_dma_cfg_tx,
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2010-08-19 18:06:32 +07:00
|
|
|
/*
|
|
|
|
* SDI 2 (POP eMMC, not on DB8500ed)
|
|
|
|
*/
|
|
|
|
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_DEV_TO_MEM,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV28_SD_MM2,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_MEM_TO_DEV,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV28_SD_MM2,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2012-08-30 22:11:08 +07:00
|
|
|
struct mmci_platform_data mop500_sdi2_data = {
|
2010-08-19 18:06:32 +07:00
|
|
|
.ocr_mask = MMC_VDD_165_195,
|
2013-05-23 20:13:45 +07:00
|
|
|
.f_max = 100000000,
|
2013-05-23 20:13:47 +07:00
|
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
|
|
MMC_CAP_8_BIT_DATA |
|
2013-05-23 20:13:49 +07:00
|
|
|
MMC_CAP_NONREMOVABLE |
|
2013-05-23 20:13:47 +07:00
|
|
|
MMC_CAP_MMC_HIGHSPEED |
|
2013-05-23 20:13:48 +07:00
|
|
|
MMC_CAP_ERASE |
|
2013-05-23 20:13:47 +07:00
|
|
|
MMC_CAP_CMD23,
|
2010-08-19 18:06:32 +07:00
|
|
|
.gpio_cd = -1,
|
|
|
|
.gpio_wp = -1,
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
.dma_filter = stedma40_filter,
|
|
|
|
.dma_rx_param = &mop500_sdi2_dma_cfg_rx,
|
|
|
|
.dma_tx_param = &mop500_sdi2_dma_cfg_tx,
|
|
|
|
#endif
|
2010-08-19 18:06:32 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SDI 4 (on-board eMMC)
|
|
|
|
*/
|
|
|
|
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_DEV_TO_MEM,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV42_SD_MM4,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
|
|
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
2013-05-15 16:51:53 +07:00
|
|
|
.dir = DMA_MEM_TO_DEV,
|
2013-05-03 21:31:56 +07:00
|
|
|
.dev_type = DB8500_DMA_DEV42_SD_MM4,
|
2010-10-14 18:57:59 +07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2012-05-29 13:40:04 +07:00
|
|
|
struct mmci_platform_data mop500_sdi4_data = {
|
2013-05-23 20:13:45 +07:00
|
|
|
.f_max = 100000000,
|
2013-05-23 20:13:47 +07:00
|
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
|
|
MMC_CAP_8_BIT_DATA |
|
2013-05-23 20:13:49 +07:00
|
|
|
MMC_CAP_NONREMOVABLE |
|
2013-05-23 20:13:47 +07:00
|
|
|
MMC_CAP_MMC_HIGHSPEED |
|
2013-05-23 20:13:48 +07:00
|
|
|
MMC_CAP_ERASE |
|
2013-05-23 20:13:47 +07:00
|
|
|
MMC_CAP_CMD23,
|
2010-08-19 18:06:32 +07:00
|
|
|
.gpio_cd = -1,
|
|
|
|
.gpio_wp = -1,
|
2010-10-14 18:57:59 +07:00
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
|
|
.dma_filter = stedma40_filter,
|
|
|
|
.dma_rx_param = &mop500_sdi4_dma_cfg_rx,
|
|
|
|
.dma_tx_param = &mop500_sdi4_dma_cfg_tx,
|
|
|
|
#endif
|
2010-08-19 18:06:32 +07:00
|
|
|
};
|