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";
--- /dev/null
+/*
+ * 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
* appropriate
*/
#undef DEBUG
+#define DEBUG
#include <linux/kernel.h>
#include <linux/errno.h>
void *user)
{
struct omap_hwmod *temp_oh;
- int ret = 0;
+ int ret = -ENOENT;
if (!classname || !fn)
return -EINVAL;
#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 */
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) {
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));
}
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;
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 */
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
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)
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;
DSSWARN("Unsupported OMAP version");
break;
}
+ printk(KERN_DEBUG "%s: omap_current_dss_features=%p\n", __func__,
+ omap_current_dss_features);
}
{
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)
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);
},
};
+#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");