diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-15 01:59:45 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-15 01:59:45 +0000 |
commit | 7185dc2440c81feae80539ecc8d1e0c9e133497b (patch) | |
tree | b01c98dfee8ccdd18862f3049d7dfdcca7828c3a /target/linux/lantiq/patches-3.7/0303-vmmc.patch | |
parent | 502a3e0f56d6af2fee94bfd4c6e05c8361ccde6c (diff) |
[lantiq] add linux-v3.7
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34687 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/patches-3.7/0303-vmmc.patch')
-rw-r--r-- | target/linux/lantiq/patches-3.7/0303-vmmc.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-3.7/0303-vmmc.patch b/target/linux/lantiq/patches-3.7/0303-vmmc.patch new file mode 100644 index 000000000..f0bd584e3 --- /dev/null +++ b/target/linux/lantiq/patches-3.7/0303-vmmc.patch @@ -0,0 +1,79 @@ +Index: linux-3.7-rc8/arch/mips/lantiq/xway/Makefile +=================================================================== +--- linux-3.7-rc8.orig/arch/mips/lantiq/xway/Makefile 2012-12-13 13:40:23.000000000 +0100 ++++ linux-3.7-rc8/arch/mips/lantiq/xway/Makefile 2012-12-13 13:40:49.788556963 +0100 +@@ -1,5 +1,5 @@ + obj-y := prom.o sysctrl.o clk.o reset.o dma.o timer.o dcdc.o + +-obj-y += ath_eep.o rt_eep.o eth_mac.o ++obj-y += ath_eep.o rt_eep.o eth_mac.o vmmc.o + + obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o +Index: linux-3.7-rc8/arch/mips/lantiq/xway/vmmc.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-3.7-rc8/arch/mips/lantiq/xway/vmmc.c 2012-12-13 13:40:30.520556476 +0100 +@@ -0,0 +1,63 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ * ++ * Copyright (C) 2012 John Crispin <blogic@openwrt.org> ++ */ ++ ++#include <linux/module.h> ++#include <linux/of_platform.h> ++#include <linux/of_gpio.h> ++#include <linux/dma-mapping.h> ++ ++#include <lantiq_soc.h> ++ ++static unsigned int *cp1_base = 0; ++unsigned int* ltq_get_cp1_base(void) ++{ ++ if (!cp1_base) ++ panic("no cp1 base was set\n"); ++ return cp1_base; ++} ++EXPORT_SYMBOL(ltq_get_cp1_base); ++ ++static int __devinit vmmc_probe(struct platform_device *pdev) ++{ ++#define CP1_SIZE (1 << 20) ++ int gpio_count; ++ dma_addr_t dma; ++ cp1_base = ++ (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC)); ++ ++ gpio_count = of_gpio_count(pdev->dev.of_node); ++ while (gpio_count) { ++ enum of_gpio_flags flags; ++ int gpio = of_get_gpio_flags(pdev->dev.of_node, --gpio_count, &flags); ++ if (gpio_request(gpio, "vmmc-relay")) ++ continue; ++ dev_info(&pdev->dev, "requested GPIO %d\n", gpio); ++ gpio_direction_output(gpio, (flags & OF_GPIO_ACTIVE_LOW) ? (0) : (1)); ++ } ++ ++ dev_info(&pdev->dev, "reserved %dMB at 0x%p", CP1_SIZE >> 20, cp1_base); ++ ++ return 0; ++} ++ ++static const struct of_device_id vmmc_match[] = { ++ { .compatible = "lantiq,vmmc" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, vmmc_match); ++ ++static struct platform_driver vmmc_driver = { ++ .probe = vmmc_probe, ++ .driver = { ++ .name = "lantiq,vmmc", ++ .owner = THIS_MODULE, ++ .of_match_table = vmmc_match, ++ }, ++}; ++ ++module_platform_driver(vmmc_driver); |