]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merged EDMA branch from git://github.com/ohporter/linux.git
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 27 Mar 2013 15:19:09 +0000 (16:19 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 2 Apr 2013 09:53:02 +0000 (11:53 +0200)
arch/arm/boot/dts/am33xx.dtsi
arch/arm/mach-omap2/board-am33xx-dt.c [new file with mode: 0644]
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/plat-omap/dma.c
drivers/i2c/busses/i2c-omap.c
drivers/mmc/host/Kconfig
drivers/mmc/host/omap_hsmmc.c
drivers/video/omap2/dss/dss_features.c
drivers/watchdog/omap_wdt.c

index d4f75aba1ccd873090b85c77aae78a794c761d1c..e686291ce82c40fdc58b00f3154646232780bd6b 100644 (file)
                        reg = <0x44e3e000 0x1000>;
                        interrupts = <75
                                      76>;
+                       interrupt-parent = <&intc>;
                        ti,hwmods = "rtc";
                };
 
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x48030000 0x400>;
-                       interrupt = <65>;
+                       interrupts = <65>;
                        ti,spi-num-cs = <2>;
                        ti,hwmods = "spi0";
                        dmas = <&edma 16
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x481a0000 0x400>;
-                       interrupt = <125>;
+                       interrupts = <125>;
                        ti,spi-num-cs = <2>;
                        ti,hwmods = "spi1";
                        dmas = <&edma 42
                        status = "disabled";
                };
 
+               mmchs0: mmc@48060000 {
+                       compatible = "ti,omap4-hsmmc";
+                       reg = <0x48060200 0x400>;
+                       interrupts = <64>;
+                       ti,hwmods = "mmc1";
+                       ti,needs-special-reset;
+                       ti,needs-special-hs-handling;
+                       max-frequency = <48000000>;
+                       status = "disabled";
+               };
+
+               mmchs1: mmc@481d8000 {
+                       compatible = "ti,omap4-hsmmc";
+                       reg = <0x481d8000 0x400>;
+                       interrupts = <28>;
+                       ti,hwmods = "mmc2";
+                       ti,needs-special-reset;
+                       ti,needs-special-hs-handling;
+                       max-frequency = <48000000>;
+                       status = "disabled";
+               };
+
+               mmchs2: mmc@47810000 {
+                       compatible = "ti,omap4-hsmmc";
+                       reg = <0x47810000 0x400>;
+                       interrupts = <29>;
+                       ti,hwmods = "mmc3";
+                       ti,needs-special-reset;
+                       ti,needs-special-hs-handling;
+                       max-frequency = <48000000>;
+                       status = "disabled";
+               };
+
                usb@47400000 {
                        compatible = "ti,musb-am33xx";
                        reg = <0x47400000 0x1000        /* usbss */
                        ti,hwmods = "usb_otg_hs";
                };
 
+               gpmc: gpmc@50000000 {
+                       compatible = "ti,am3352-gpmc";
+                       ti,hwmods = "gpmc";
+                       reg = <0x50000000 0x2000>;
+                       interrupts = <100>;
+
+                       gpmc,num-cs = <8>;
+                       gpmc,num-waitpins = <2>;
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0x08000000 0x10000000>; /* CS0 @addr 0x8000000, size 0x10000000 */
+               };
+
+               elm: elm@0 {
+                       compatible = "ti,am3352-elm";
+                       reg = <0x48080000 0x2000>;
+                       interrupts = <4>;
+               };
+
                mac: ethernet@4a100000 {
                        compatible = "ti,cpsw";
                        ti,hwmods = "cpgmac0";
diff --git a/arch/arm/mach-omap2/board-am33xx-dt.c b/arch/arm/mach-omap2/board-am33xx-dt.c
new file mode 100644 (file)
index 0000000..a08d3d5
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * arch/arm/mach-omap2/board-am335xtx48.c
+ *
+ * Copyright (C) 2013 Lothar Waßmann <LW@KARO-electronics.de>
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/of_gpio.h>
+#include <linux/i2c.h>
+#include <linux/i2c/tsc2007.h>
+
+#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2007)
+#define GPIO_NR(g, p)          ((g) * 32 + (p))
+#define TX48_PENDOWN_GPIO      GPIO_NR(3, 16)
+static struct gpio tsc2007_pendown_gpio = {
+       .gpio = -EINVAL,
+       .label = "TSC2007 PEN",
+};
+
+static int tx48_get_pendown_state(void)
+{
+       if (tsc2007_pendown_gpio.flags & OF_GPIO_ACTIVE_LOW)
+               return !gpio_get_value(tsc2007_pendown_gpio.gpio);
+       else
+               return gpio_get_value(tsc2007_pendown_gpio.gpio);
+}
+
+static int tx48_tsc2007_hw_init(void)
+{
+       if (!gpio_is_valid(tsc2007_pendown_gpio.gpio))
+               return tsc2007_pendown_gpio.gpio;
+       return gpio_request_one(tsc2007_pendown_gpio.gpio, GPIOF_IN,
+                               tsc2007_pendown_gpio.label);
+}
+
+static void tx48_tsc2007_hw_exit(void)
+{
+       gpio_free(tsc2007_pendown_gpio.gpio);
+}
+
+static struct tsc2007_platform_data tx48_tsc2007_pdata = {
+       .model = 2007,
+       .x_plate_ohms = 660,
+       .get_pendown_state = tx48_get_pendown_state,
+       .init_platform_hw = tx48_tsc2007_hw_init,
+       .exit_platform_hw = tx48_tsc2007_hw_exit,
+};
+
+static int tx48_touchscreen_notifier_call(struct notifier_block *nb,
+                                       unsigned long event, void *__dev)
+{
+       int ret;
+       struct device *dev = __dev;
+
+printk(KERN_DEBUG "%s: event=%lu dev=%s\n", __func__, event, dev_name(dev));
+       if ((event == BUS_NOTIFY_ADD_DEVICE) &&
+           of_device_is_compatible(dev->of_node, "ti,tsc2007")) {
+               struct device_node *np = dev->of_node;
+               const u32 *prop;
+               enum of_gpio_flags gpio_flags;
+
+printk(KERN_DEBUG "%s: dev=%s\n", __func__, dev_name(dev));
+               prop = of_get_property(np, "x-plate-ohms", NULL);
+               if (prop)
+                       tx48_tsc2007_pdata.x_plate_ohms = be32_to_cpu(*prop);
+
+               prop = of_get_property(np, "max-rt", NULL);
+               if (prop)
+                       tx48_tsc2007_pdata.max_rt = be32_to_cpu(*prop);
+
+               prop = of_get_property(np, "poll-delay", NULL);
+               if (prop)
+                       tx48_tsc2007_pdata.poll_delay = be32_to_cpu(*prop);
+
+               prop = of_get_property(np, "poll-period", NULL);
+               if (prop)
+                       tx48_tsc2007_pdata.poll_period = be32_to_cpu(*prop);
+
+               ret = of_get_named_gpio_flags(np, "pendown-gpios", 0,
+                                       &gpio_flags);
+               if (!gpio_is_valid(ret)) {
+                       dev_err(dev, "'pendown-gpios' property not found: %d\n",
+                               ret);
+                       return ret;
+               }
+               tsc2007_pendown_gpio.gpio = ret;
+               tsc2007_pendown_gpio.flags = gpio_flags;
+               dev->platform_data = &tx48_tsc2007_pdata;
+               return NOTIFY_OK;
+       }
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block tx48_touchscreen_nb = {
+       .notifier_call = tx48_touchscreen_notifier_call,
+};
+
+static int __init tx48_tsc2007_init(void)
+{
+printk(KERN_DEBUG "%s:\n", __func__);
+       bus_register_notifier(&i2c_bus_type, &tx48_touchscreen_nb);
+       return 0;
+}
+
+static int __init am33xx_dt_init(void)
+{
+       int ret = 0;
+
+printk(KERN_DEBUG "%s:\n", __func__);
+       if (of_machine_is_compatible("karo,am335x-tx48"))
+               ret = tx48_tsc2007_init();
+
+       if (ret)
+               return ret;
+
+       return 0;
+}
+arch_initcall(am33xx_dt_init);
+#endif
index ede9d495a9e2c625d434e1b0e4c686ed1ec6ca1e..3a6a91e8fa81ccd782993182ed6b5c4983ed51c8 100644 (file)
  * appropriate
  */
 #undef DEBUG
+#define DEBUG
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -3945,7 +3946,7 @@ int omap_hwmod_for_each_by_class(const char *classname,
                                 void *user)
 {
        struct omap_hwmod *temp_oh;
-       int ret = 0;
+       int ret = -ENOENT;
 
        if (!classname || !fn)
                return -EINVAL;
index e06c34bdc34aa11c2bcac80097391dddfb552f5d..6aa8c3f52e458eadef57a0664be75edf03ede79f 100644 (file)
@@ -136,6 +136,25 @@ static inline void omap_enable_channel_irq(int lch);
 
 #define REVISIT_24XX()         printk(KERN_ERR "FIXME: no %s on 24xx\n", \
                                                __func__);
+#if 1
+static inline void __spin_lock_irqsave(spinlock_t *lock, unsigned long *flags,
+                               const char *fn, int ln)
+{
+       printk("%s@%d: Obtaining spinlock %p\n", fn, ln, lock);
+//     spin_lock_irqsave(lock, *flags);
+}
+#undef spin_lock_irqsave
+#define spin_lock_irqsave(lock, flags) __spin_lock_irqsave(lock, &flags, __func__, __LINE__)
+
+static inline void __spin_unlock_irqrestore(spinlock_t *lock, unsigned long *flags,
+                                       const char *fn, int ln)
+{
+       printk("%s@%d: Releasing spinlock %p\n", fn, ln, lock);
+//     spin_unlock_irqrestore(lock, *flags);
+}
+#undef spin_unlock_irqrestore
+#define spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, &flags, __func__, __LINE__)
+#endif
 
 #ifdef CONFIG_ARCH_OMAP15XX
 /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
@@ -697,12 +716,16 @@ int omap_request_dma(int dev_id, const char *dev_name,
        unsigned long flags;
        struct omap_dma_lch *chan;
 
+       printk(KERN_DEBUG "Requesting DMA chan %d\n", dev_id);
+
        spin_lock_irqsave(&dma_chan_lock, flags);
        for (ch = 0; ch < dma_chan_count; ch++) {
+               printk(KERN_DEBUG "free_ch=%d dev_id[%d]=%d\n", free_ch, ch,
+                       dma_chan[ch].dev_id);
                if (free_ch == -1 && dma_chan[ch].dev_id == -1) {
+                       printk(KERN_DEBUG "Selected channel %d\n", ch);
                        free_ch = ch;
-                       if (dev_id == 0)
-                               break;
+                       break;
                }
        }
        if (free_ch == -1) {
@@ -2122,12 +2145,14 @@ static int omap_system_dma_remove(struct platform_device *pdev)
 
        if (dma_omap2plus()) {
                char irq_name[4];
+
                strcpy(irq_name, "0");
                dma_irq = platform_get_irq_byname(pdev, irq_name);
                remove_irq(dma_irq, &omap24xx_dma_irq);
        } else {
-               int irq_rel = 0;
-               for ( ; irq_rel < dma_chan_count; irq_rel++) {
+               int irq_rel;
+
+               for (irq_rel = 0; irq_rel < dma_chan_count; irq_rel++) {
                        dma_irq = platform_get_irq(pdev, irq_rel);
                        free_irq(dma_irq, (void *)(irq_rel + 1));
                }
index e02f9e36a7b2071ee7c63efa36a5efbf1878d00e..62b1bf8998f61e64891dcf6fe12e44e192ceb98d 100644 (file)
@@ -884,7 +884,7 @@ omap_i2c_isr(int irq, void *dev_id)
        spin_lock(&dev->lock);
        mask = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
        stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
-
+printk("%s@%d: mask=%08x stat=%08x\n", __func__, __LINE__, mask, stat);
        if (stat & mask)
                ret = IRQ_WAKE_THREAD;
 
@@ -906,6 +906,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
        do {
                bits = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
                stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+printk("%s@%d: mask=%08x stat=%08x\n", __func__, __LINE__, bits, stat);
                stat &= bits;
 
                /* If we're in receiver mode, ignore XDR/XRDY */
index f83f2454e33ba2bb5d749f3e45e2f212c975f78e..ca0f332b7bc66130ad9c661572687010629a40ac 100644 (file)
@@ -273,7 +273,7 @@ config MMC_OMAP
 
 config MMC_OMAP_HS
        tristate "TI OMAP High Speed Multimedia Card Interface support"
-       depends on SOC_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4
+       depends on SOC_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4 || SOC_AM33XX
        help
          This selects the TI OMAP High Speed Multimedia card Interface.
          If you have an OMAP2430 or OMAP3 board or OMAP4 board with a
index 6e44025acf01fcf9669567dff93b8c3d712b2519..1c903ccd8d1959cb86dd21f8865dfd88b7013b31 100644 (file)
@@ -1802,8 +1802,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        irq = platform_get_irq(pdev, 0);
-       if (res == NULL || irq < 0)
+       if (res == NULL || irq < 0) {
+               dev_err(&pdev->dev, "irq=%d res=%p\n", irq, res);
                return -ENXIO;
+       }
 
        res = request_mem_region(res->start, resource_size(res), pdev->name);
        if (res == NULL)
index 7f791aeda4d24a1025e4d712f11e1b828cdb8b24..1e9772581abf75c8d3339f538ff05cb33ae16dc1 100644 (file)
@@ -936,8 +936,10 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
        return omap_current_dss_features->supported_rotation_types & rot_type;
 }
 
-void dss_features_init(enum omapdss_version version)
+void __init dss_features_init(enum omapdss_version version)
 {
+       printk(KERN_DEBUG "%s: setting up omap_current_dss_features for OMAP %d\n", __func__,
+               version);
        switch (version) {
        case OMAPDSS_VER_OMAP24xx:
                omap_current_dss_features = &omap2_dss_features;
@@ -976,4 +978,6 @@ void dss_features_init(enum omapdss_version version)
                DSSWARN("Unsupported OMAP version");
                break;
        }
+       printk(KERN_DEBUG "%s: omap_current_dss_features=%p\n", __func__,
+               omap_current_dss_features);
 }
index af88ffd1068f57ebd50354c7a6dd06fdf54af1f4..865cb044a86be6738ebd4fc5687e380927b77da2 100644 (file)
@@ -98,6 +98,7 @@ static void omap_wdt_disable(struct omap_wdt_dev *wdev)
 {
        void __iomem *base = wdev->base;
 
+       printk("Disabling WATCHDOG\n");
        /* sequence required to disable watchdog */
        __raw_writel(0xAAAA, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */
        while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x10)
@@ -267,7 +268,9 @@ static int omap_wdt_probe(struct platform_device *pdev)
                                WDIOF_CARDRESET : 0;
 
        omap_wdt_disable(wdev);
-
+#if 1
+       omap_wdt_set_timer(wdev, 10000000);
+#endif
        ret = watchdog_register_device(omap_wdt);
        if (ret) {
                pm_runtime_disable(wdev->dev);
@@ -370,7 +373,21 @@ static struct platform_driver omap_wdt_driver = {
        },
 };
 
+#if 0
 module_platform_driver(omap_wdt_driver);
+#else
+static int __init omap_wdt_init(void)
+{
+       return platform_driver_register(&omap_wdt_driver);
+}
+subsys_initcall(omap_wdt_init);
+
+static void __init omap_wdt_exit(void)
+{
+       platform_driver_unregister(&omap_wdt_driver);
+}
+module_exit(omap_wdt_exit);
+#endif
 
 MODULE_AUTHOR("George G. Davis");
 MODULE_LICENSE("GPL");