mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
0bf6a210a4
These changes are all driver specific and cross over between arm-soc contents and some other subsystem, in these cases cpufreq, crypto, dma, pinctrl, mailbox and usb, and the subsystem owners agreed to have these changes merged through arm-soc. As we proceed to untangle the dependencies between platform code and driver code, the amount of changes in this category is fortunately shrinking, for 3.11 we have 16 branches here and 101 non-merge changesets, the majority of which are for the stedma40 dma engine driver used in the ux500 platform. Cleaning up that code touches multiple subsystems, but gets rid of the dependency in the end. The mailbox code moved out from mach-omap2 to drivers/mailbox is an intermediate step and is still omap specific at the moment. Patches exist to generalize the subsystem and add other drivers with the same API, but those did not make it for 3.11. Conflicts: * In cpu-db8500.c results from the removal of the u8500_of_init_devices function in combination with the split of u8500_auxdata_lookup. * In arch/arm/mach-omap2/devices.c, the includes got reshuffled. we need to keep linux/wl12xx.h and linux/platform_data/mailbox-omap.h. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAUdLnomCrR//JCVInAQJI/A/9FydsQa9sdnzLFgcdX5BeRRwkXLfDifCM zDTfUBo+LriKOs7QHblmDg1MnY1UMB2IfrdHD0FsjK7WbZ/91EMAGDPYcI7Fu4+u pGStxwWi2v+oCT1jjeOkCPT7hdCqogsSpybYq8itSb+zdvdOi6U35dWEKz8xGqz4 vTL9gTZbJP0kowkjIcaryk7FIj7BTIvMCW8n55JZEkDe0BuSJGYn5c3Mntut12ZK 5xM2PeNe2sd3dIdA6XbM2ye/XmYa8xY8Qu4/ijxfH1gnJLvz9Unp96nRXpEbIeMb BH2Sro8dxsMCaweIQhSRKGnUWMYO/Rh7/+5EqzJ163Ezthx9nvHXJY2ndWuD7uM1 IcGrMxLtqP22TEMtZAVEATDp/5ymxEo5GM+eayUojQDn213wOJjRs5xz5IBsH4KM 8CM/gpadWmLjWku72yEV4lryLcdS0NVQzpTnEbILEGOU4u7qJtxRAp7x7tWBtFg8 4m/eWcSVk/U2SYbXmQHsfukuWgKY0cnZbctPcdnaqXwTP7toJEAK3gxoMtWh49Jq 2M2PVFyFejaaq5b/71wAJ7ePYw56H0N/F3RsGpPE55AY15++gSoQ+3t2Si68hDw8 NtyJMkQYpTvtqJbHXWpQQ3Zfs7pDBe01WDV7i+m4JTNggxUDaO/t1Fqp+fEksm4J r+luEf5Gcgk= =mJsI -----END PGP SIGNATURE----- Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC driver specific changes from Arnd Bergmann: "These changes are all driver specific and cross over between arm-soc contents and some other subsystem, in these cases cpufreq, crypto, dma, pinctrl, mailbox and usb, and the subsystem owners agreed to have these changes merged through arm-soc. As we proceed to untangle the dependencies between platform code and driver code, the amount of changes in this category is fortunately shrinking, for 3.11 we have 16 branches here and 101 non-merge changesets, the majority of which are for the stedma40 dma engine driver used in the ux500 platform. Cleaning up that code touches multiple subsystems, but gets rid of the dependency in the end. The mailbox code moved out from mach-omap2 to drivers/mailbox is an intermediate step and is still omap specific at the moment. Patches exist to generalize the subsystem and add other drivers with the same API, but those did not make it for 3.11." * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (101 commits) crypto: ux500: use dmaengine_submit API crypto: ux500: use dmaengine_prep_slave_sg API crypto: ux500: use dmaengine_device_control API crypto: ux500/crypt: add missing __iomem qualifiers crypto: ux500/hash: add missing static qualifiers crypto: ux500/hash: use readl on iomem addresses dmaengine: ste_dma40: Declare memcpy config as static ARM: ux500: Remove mop500_snowball_ethernet_clock_enable() ARM: ux500: Correct the EN_3v3 regulator's on/off GPIO ARM: ux500: Provide a AB8500 GPIO Device Tree node gpio: rcar: fix gpio_rcar_of_table gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections gpio-rcar: Reference core gpio documentation in the DT bindings clk: exynos5250: Add enum entries for divider clock of i2s1 and i2s2 ARM: dts: Update Samsung I2S documentation ARM: dts: add clock provider information for i2s controllers in Exynos5250 ARM: dts: add Exynos audio subsystem clock controller node clk: samsung: register audio subsystem clocks using common clock framework ARM: dts: use #include for all device trees for Samsung pinctrl: s3c24xx: use correct header for chained_irq functions ...
220 lines
5.3 KiB
C
220 lines
5.3 KiB
C
/*
|
|
* 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>
|
|
#include <linux/platform_data/dma-ste-dma40.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
#include "devices.h"
|
|
|
|
#include "db8500-regs.h"
|
|
#include "devices-db8500.h"
|
|
#include "board-mop500.h"
|
|
#include "ste-dma40-db8500.h"
|
|
|
|
/*
|
|
* 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
|
|
|
|
/*
|
|
* SDI 0 (MicroSD slot)
|
|
*/
|
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_DEV_TO_MEM,
|
|
.dev_type = DB8500_DMA_DEV29_SD_MM0,
|
|
};
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_MEM_TO_DEV,
|
|
.dev_type = DB8500_DMA_DEV29_SD_MM0,
|
|
};
|
|
#endif
|
|
|
|
struct mmci_platform_data mop500_sdi0_data = {
|
|
.f_max = 100000000,
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
MMC_CAP_SD_HIGHSPEED |
|
|
MMC_CAP_MMC_HIGHSPEED |
|
|
MMC_CAP_ERASE |
|
|
MMC_CAP_UHS_SDR12 |
|
|
MMC_CAP_UHS_SDR25,
|
|
.gpio_wp = -1,
|
|
.sigdir = MCI_ST_FBCLKEN |
|
|
MCI_ST_CMDDIREN |
|
|
MCI_ST_DATA0DIREN |
|
|
MCI_ST_DATA2DIREN,
|
|
#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
|
|
};
|
|
|
|
static void sdi0_configure(struct device *parent)
|
|
{
|
|
/* Add the device, force v2 to subrevision 1 */
|
|
db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
|
|
}
|
|
|
|
void mop500_sdi_tc35892_init(struct device *parent)
|
|
{
|
|
mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
|
|
sdi0_configure(parent);
|
|
}
|
|
|
|
/*
|
|
* SDI1 (SDIO WLAN)
|
|
*/
|
|
#ifdef CONFIG_STE_DMA40
|
|
static struct stedma40_chan_cfg sdi1_dma_cfg_rx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_DEV_TO_MEM,
|
|
.dev_type = DB8500_DMA_DEV32_SD_MM1,
|
|
};
|
|
|
|
static struct stedma40_chan_cfg sdi1_dma_cfg_tx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_MEM_TO_DEV,
|
|
.dev_type = DB8500_DMA_DEV32_SD_MM1,
|
|
};
|
|
#endif
|
|
|
|
struct mmci_platform_data mop500_sdi1_data = {
|
|
.ocr_mask = MMC_VDD_29_30,
|
|
.f_max = 100000000,
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
MMC_CAP_NONREMOVABLE,
|
|
.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
|
|
};
|
|
|
|
/*
|
|
* SDI 2 (POP eMMC, not on DB8500ed)
|
|
*/
|
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_DEV_TO_MEM,
|
|
.dev_type = DB8500_DMA_DEV28_SD_MM2,
|
|
};
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_MEM_TO_DEV,
|
|
.dev_type = DB8500_DMA_DEV28_SD_MM2,
|
|
};
|
|
#endif
|
|
|
|
struct mmci_platform_data mop500_sdi2_data = {
|
|
.ocr_mask = MMC_VDD_165_195,
|
|
.f_max = 100000000,
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
MMC_CAP_8_BIT_DATA |
|
|
MMC_CAP_NONREMOVABLE |
|
|
MMC_CAP_MMC_HIGHSPEED |
|
|
MMC_CAP_ERASE |
|
|
MMC_CAP_CMD23,
|
|
.gpio_cd = -1,
|
|
.gpio_wp = -1,
|
|
#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
|
|
};
|
|
|
|
/*
|
|
* SDI 4 (on-board eMMC)
|
|
*/
|
|
|
|
#ifdef CONFIG_STE_DMA40
|
|
struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_DEV_TO_MEM,
|
|
.dev_type = DB8500_DMA_DEV42_SD_MM4,
|
|
};
|
|
|
|
static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
|
|
.mode = STEDMA40_MODE_LOGICAL,
|
|
.dir = DMA_MEM_TO_DEV,
|
|
.dev_type = DB8500_DMA_DEV42_SD_MM4,
|
|
};
|
|
#endif
|
|
|
|
struct mmci_platform_data mop500_sdi4_data = {
|
|
.f_max = 100000000,
|
|
.capabilities = MMC_CAP_4_BIT_DATA |
|
|
MMC_CAP_8_BIT_DATA |
|
|
MMC_CAP_NONREMOVABLE |
|
|
MMC_CAP_MMC_HIGHSPEED |
|
|
MMC_CAP_ERASE |
|
|
MMC_CAP_CMD23,
|
|
.gpio_cd = -1,
|
|
.gpio_wp = -1,
|
|
#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
|
|
};
|
|
|
|
void __init mop500_sdi_init(struct device *parent)
|
|
{
|
|
/* PoP:ed eMMC */
|
|
db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
|
|
/* On-board eMMC */
|
|
db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
|
|
|
|
/*
|
|
* On boards with the TC35892 GPIO expander, sdi0 will finally
|
|
* be added when the TC35892 initializes and calls
|
|
* mop500_sdi_tc35892_init() above.
|
|
*/
|
|
}
|
|
|
|
void __init snowball_sdi_init(struct device *parent)
|
|
{
|
|
/* On Snowball MMC_CAP_SD_HIGHSPEED isn't supported (Hardware issue?) */
|
|
mop500_sdi0_data.capabilities &= ~MMC_CAP_SD_HIGHSPEED;
|
|
/* On-board eMMC */
|
|
db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
|
|
/* External Micro SD slot */
|
|
mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
|
|
mop500_sdi0_data.cd_invert = true;
|
|
sdi0_configure(parent);
|
|
}
|
|
|
|
void __init hrefv60_sdi_init(struct device *parent)
|
|
{
|
|
/* PoP:ed eMMC */
|
|
db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
|
|
/* On-board eMMC */
|
|
db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
|
|
/* External Micro SD slot */
|
|
mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
|
|
sdi0_configure(parent);
|
|
/* WLAN SDIO channel */
|
|
db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
|
|
}
|