Per Forlin | bab263e | 2010-12-05 12:49:03 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) ST-Ericsson SA 2010 |
| 3 | * |
| 4 | * Author: Hanumath Prasad <ulf.hansson@stericsson.com> |
| 5 | * License terms: GNU General Public License (GPL) version 2 |
| 6 | */ |
| 7 | |
| 8 | #include <linux/amba/mmci.h> |
| 9 | #include <linux/mmc/host.h> |
Per Forlin | bab263e | 2010-12-05 12:49:03 +0100 | [diff] [blame] | 10 | |
| 11 | #include <plat/pincfg.h> |
Linus Walleij | 0f33286 | 2011-08-22 08:33:30 +0100 | [diff] [blame] | 12 | #include <plat/gpio-nomadik.h> |
Per Forlin | bab263e | 2010-12-05 12:49:03 +0100 | [diff] [blame] | 13 | #include <mach/db5500-regs.h> |
| 14 | #include <plat/ste_dma40.h> |
| 15 | |
| 16 | #include "pins-db5500.h" |
| 17 | #include "devices-db5500.h" |
| 18 | #include "ste-dma40-db5500.h" |
| 19 | |
| 20 | static pin_cfg_t u5500_sdi_pins[] = { |
| 21 | /* SDI0 (POP eMMC) */ |
| 22 | GPIO5_MC0_DAT0 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 23 | GPIO6_MC0_DAT1 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 24 | GPIO7_MC0_DAT2 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 25 | GPIO8_MC0_DAT3 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 26 | GPIO9_MC0_DAT4 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 27 | GPIO10_MC0_DAT5 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 28 | GPIO11_MC0_DAT6 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 29 | GPIO12_MC0_DAT7 | PIN_DIR_INPUT | PIN_PULL_UP, |
| 30 | GPIO13_MC0_CMD | PIN_DIR_INPUT | PIN_PULL_UP, |
| 31 | GPIO14_MC0_CLK | PIN_DIR_OUTPUT | PIN_VAL_LOW, |
| 32 | }; |
| 33 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 34 | #ifdef CONFIG_STE_DMA40 |
| 35 | struct stedma40_chan_cfg u5500_sdi0_dma_cfg_rx = { |
| 36 | .mode = STEDMA40_MODE_LOGICAL, |
| 37 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 38 | .src_dev_type = DB5500_DMA_DEV24_SDMMC0_RX, |
| 39 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 40 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 41 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 42 | }; |
| 43 | |
| 44 | static struct stedma40_chan_cfg u5500_sdi0_dma_cfg_tx = { |
| 45 | .mode = STEDMA40_MODE_LOGICAL, |
| 46 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 47 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 48 | .dst_dev_type = DB5500_DMA_DEV24_SDMMC0_TX, |
| 49 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 50 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 51 | }; |
| 52 | #endif |
| 53 | |
Per Forlin | bab263e | 2010-12-05 12:49:03 +0100 | [diff] [blame] | 54 | static struct mmci_platform_data u5500_sdi0_data = { |
| 55 | .ocr_mask = MMC_VDD_165_195, |
| 56 | .f_max = 50000000, |
| 57 | .capabilities = MMC_CAP_4_BIT_DATA | |
| 58 | MMC_CAP_8_BIT_DATA | |
| 59 | MMC_CAP_MMC_HIGHSPEED, |
| 60 | .gpio_cd = -1, |
| 61 | .gpio_wp = -1, |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 62 | #ifdef CONFIG_STE_DMA40 |
| 63 | .dma_filter = stedma40_filter, |
| 64 | .dma_rx_param = &u5500_sdi0_dma_cfg_rx, |
| 65 | .dma_tx_param = &u5500_sdi0_dma_cfg_tx, |
| 66 | #endif |
Per Forlin | bab263e | 2010-12-05 12:49:03 +0100 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | void __init u5500_sdi_init(void) |
| 70 | { |
| 71 | nmk_config_pins(u5500_sdi_pins, ARRAY_SIZE(u5500_sdi_pins)); |
| 72 | |
| 73 | db5500_add_sdi0(&u5500_sdi0_data); |
| 74 | } |