]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux... ti2014.10.00
authorDan Murphy <DMurphy@ti.com>
Fri, 10 Oct 2014 17:29:20 +0000 (12:29 -0500)
committerDan Murphy <DMurphy@ti.com>
Fri, 10 Oct 2014 17:29:20 +0000 (12:29 -0500)
TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  drm/tilcdc: make frame completion interrupt always enabled
  drm/tilcdc: correct the dmachannel tracking logic

Signed-off-by: Dan Murphy <DMurphy@ti.com>
50 files changed:
Documentation/devicetree/bindings/hwlock/hwlock.txt [new file with mode: 0644]
Documentation/devicetree/bindings/hwlock/omap-hwspinlock.txt [new file with mode: 0644]
Documentation/hwspinlock.txt
MAINTAINERS
arch/arm/boot/dts/am335x-evm.dts
arch/arm/boot/dts/am335x-evmsk.dts
arch/arm/boot/dts/am437x-gp-evm.dts
arch/arm/boot/dts/am437x-sk-evm.dts
arch/arm/boot/dts/am43x-epos-evm.dts
arch/arm/boot/dts/dra7-evm.dts
arch/arm/boot/dts/dra72-evm.dts
arch/arm/common/edma.c
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/clockdomains7xx_data.c
arch/arm/mach-omap2/hwspinlock.c [deleted file]
arch/arm/mach-omap2/pdata-quirks.c
arch/arm/mach-omap2/sleep43xx.S
drivers/clk/ti/clk-7xx.c
drivers/clk/ti/clk-dra7-atl.c
drivers/clk/ti/dpll.c
drivers/dma/edma.c
drivers/dma/omap-dma.c
drivers/hwspinlock/Kconfig
drivers/hwspinlock/hwspinlock_core.c
drivers/hwspinlock/hwspinlock_internal.h
drivers/hwspinlock/omap_hwspinlock.c
drivers/iio/adc/ti_am335x_adc.c
drivers/input/touchscreen/ti_am335x_tsc.c
drivers/iommu/omap-iommu-debug.c
drivers/iommu/omap-iommu.c
drivers/iommu/omap-iommu.h
drivers/iommu/omap-iommu2.c
drivers/mfd/ti_am335x_tscadc.c
drivers/mtd/tests/oobtest.c
drivers/net/can/c_can/c_can_platform.c
drivers/net/ethernet/ti/Kconfig
drivers/pwm/Kconfig
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h
drivers/usb/dwc3/dwc3-omap.c
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c
drivers/usb/dwc3/gadget.h
drivers/usb/musb/musb_dsps.c
include/linux/hwspinlock.h
include/linux/mfd/ti_am335x_tscadc.h
ti_config_fragments/am33xx_only.cfg [new file with mode: 0644]
ti_config_fragments/am43xx_only.cfg [new file with mode: 0644]
ti_config_fragments/baseport.cfg
ti_config_fragments/ipc.cfg

diff --git a/Documentation/devicetree/bindings/hwlock/hwlock.txt b/Documentation/devicetree/bindings/hwlock/hwlock.txt
new file mode 100644 (file)
index 0000000..24993dd
--- /dev/null
@@ -0,0 +1,55 @@
+Generic hwlock bindings
+=======================
+
+Generic bindings that are common to all the hwlock platform specific driver
+implementations.
+
+The validity and need of these common properties may vary from one platform
+implementation to another. The platform specific bindings should explicitly
+state if an optional property is used. Please also look through the individual
+platform specific hwlock binding documentations for identifying the applicable
+properties.
+
+Common properties:
+- #hwlock-cells:       Specifies the number of cells needed to represent a
+                       specific lock. This property is mandatory for all
+                       platform implementations.
+- hwlock-num-locks:    Number of locks present in a hwlock device. This
+                       property is needed on hwlock devices, where the number
+                       of supported locks within a hwlock device cannot be
+                       read from a register.
+- hwlock-base-id:      An unique base Id for the locks for a particular hwlock
+                       device. This property is mandatory if a SoC has several
+                       hwlock devices.
+
+Hwlock Users:
+=============
+
+Nodes that require specific hwlock(s) should specify them using the property
+"hwlocks", each containing a phandle to the hwlock node and an args specifier
+value as indicated by #hwlock-cells. Multiple hwlocks can be requested using
+an array of the phandle and hwlock number specifier tuple.
+
+1. Example of a node using a single specific hwlock:
+
+The following example has a node requesting a hwlock in the bank defined by
+the node hwlock1. hwlock1 is a hwlock provider with an argument specifier
+of length 1.
+
+       node {
+               ...
+               hwlocks = <&hwlock1 2>;
+               ...
+       };
+
+2. Example of a node using multiple specific hwlocks:
+
+The following example has a node requesting two hwlocks, a hwlock within
+the hwlock device node 'hwlock1' with #hwlock-cells value of 1, and another
+hwlock within the hwlock device node 'hwlock2' with #hwlock-cells value of 2.
+
+       node {
+               ...
+               hwlocks = <&hwlock1 2>, <&hwlock2 0 3>;
+               ...
+       };
diff --git a/Documentation/devicetree/bindings/hwlock/omap-hwspinlock.txt b/Documentation/devicetree/bindings/hwlock/omap-hwspinlock.txt
new file mode 100644 (file)
index 0000000..568eae2
--- /dev/null
@@ -0,0 +1,24 @@
+OMAP4+ HwSpinlock Driver
+========================
+
+Required properties:
+- compatible:          Should be "ti,omap4-hwspinlock" for
+                           OMAP44xx, OMAP54xx, AM33xx, AM43xx, DRA7xx SoCs
+- reg:                 Contains the hwspinlock module register address space
+                       (base address and length)
+- ti,hwmods:           Name of the hwmod associated with the hwspinlock device
+- #hwlock-cells:       Should be 1. The OMAP hwspinlock users will use a
+                       0-indexed relative hwlock number as the argument
+                       specifier value for requesting a specific hwspinlock
+                       within a hwspinlock bank.
+
+
+Example:
+
+/* OMAP4 */
+hwspinlock: spinlock@4a0f6000 {
+       compatible = "ti,omap4-hwspinlock";
+       reg = <0x4a0f6000 0x1000>;
+       ti,hwmods = "spinlock";
+       #hwlock-cells = <1>;
+};
index 62f7d4ea6e26459b74cdccbca9f7a3532ab4900b..cdcfdff342fd6d3d1ff455235a5dc15b26a9b1d7 100644 (file)
@@ -48,6 +48,16 @@ independent, drivers.
      ids for predefined purposes.
      Should be called from a process context (might sleep).
 
+  int of_hwspin_lock_get_id(struct device_node *np, int index);
+   - retrieve the global lock id for an OF phandle-based specific lock.
+     This function provides a means for DT users of a hwspinlock module
+     to get the global lock id of a specific hwspinlock, so that it can
+     be requested using the normal hwspin_lock_request_specific() API.
+     The function returns a valid lock id number on success, -EPROBE_DEFER
+     if the hwspinlock device is not yet registered with the core, or other
+     error values.
+     Should be called from a process context (might sleep).
+
   int hwspin_lock_free(struct hwspinlock *hwlock);
    - free a previously-assigned hwspinlock; returns 0 on success, or an
      appropriate error code on failure (e.g. -EINVAL if the hwspinlock
@@ -243,6 +253,22 @@ int hwspinlock_example2(void)
      Returns the address of hwspinlock on success, or NULL on error (e.g.
      if the hwspinlock is still in use).
 
+  int of_hwspin_lock_get_num_locks(struct device_node *dn);
+   - is a common OF helper function that can be used by some underlying
+     vendor-specific implementations. This can be used by implementations
+     that require and define the number of locks supported within a hwspinlock
+     bank as a device tree node property. This function should be called by
+     needed implementations before registering a hwspinlock device with the
+     core.
+
+  int of_hwspin_lock_get_base_id(struct device_node *dn);
+   - is a common OF helper function that can be used by some underlying
+     vendor-specific implementations. This can be used by implementations
+     that require and define the base index for a block of locks present
+     within a hwspinlock bank as a device tree node property. This function
+     should be called by needed implementations before registering a hwspinlock
+     device with the core.
+
 5. Important structs
 
 struct hwspinlock_device is a device which usually contains a bank
@@ -251,6 +277,7 @@ implementation using the hwspin_lock_register() API.
 
 /**
  * struct hwspinlock_device - a device which usually spans numerous hwspinlocks
+ * @list: list element to link hwspinlock devices together
  * @dev: underlying device, will be used to invoke runtime PM api
  * @ops: platform-specific hwspinlock handlers
  * @base_id: id index of the first lock in this device
@@ -258,6 +285,7 @@ implementation using the hwspin_lock_register() API.
  * @lock: dynamically allocated array of 'struct hwspinlock'
  */
 struct hwspinlock_device {
+       struct list_head list;
        struct device *dev;
        const struct hwspinlock_ops *ops;
        int base_id;
@@ -272,11 +300,13 @@ of which represents a single hardware lock:
  * struct hwspinlock - this struct represents a single hwspinlock instance
  * @bank: the hwspinlock_device structure which owns this lock
  * @lock: initialized and used by hwspinlock core
+ * @type: type of lock, used to distinguish regular locks from reserved locks
  * @priv: private data, owned by the underlying platform-specific hwspinlock drv
  */
 struct hwspinlock {
        struct hwspinlock_device *bank;
        spinlock_t lock;
+       unsigned int type;
        void *priv;
 };
 
index 4a4296ed99299dbe7c3bc1595812f100411644b1..d1fbdb3e17f97433abd7e305a848903c3135eacd 100644 (file)
@@ -6263,7 +6263,6 @@ M:        Ohad Ben-Cohen <ohad@wizery.com>
 L:     linux-omap@vger.kernel.org
 S:     Maintained
 F:     drivers/hwspinlock/omap_hwspinlock.c
-F:     arch/arm/mach-omap2/hwspinlock.c
 
 OMAP MMC SUPPORT
 M:     Jarkko Lavinen <jarkko.lavinen@nokia.com>
index 5abf0843c938fdf50703a49ba93081098aa78a61..2b5aca15129f5ea1fd1780fa061d96579d388ff1 100644 (file)
        pinctrl-0 = <&mmc1_pins_default>;
        pinctrl-1 = <&mmc1_pins_sleep>;
        cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
 };
 
 &mmc3 {
index a139dd78a194d1cb55c869d9b35236291f18e7e0..506176a57c565d4f4c3f259c5a8aaf4db1b5a786 100644 (file)
        usb@47401000 {
                status = "okay";
        };
+
+       dma-controller@47402000  {
+               status = "okay";
+       };
 };
 
 &epwmss2 {
index 25f4f328bb626bd77e921409c41475e780733776..047f8df896b621f8a3a3de4462d004e4681c322c 100644 (file)
                        compatible = "ti,tps65218-dcdc3";
                        regulator-name = "vdcdc3";
                        regulator-suspend-enable;
-                       regulator-min-microvolt = <1350000>;
-                       regulator-max-microvolt = <1350000>;
+                       regulator-min-microvolt = <1500000>;
+                       regulator-max-microvolt = <1500000>;
                        regulator-boot-on;
                        regulator-always-on;
                };
+
                dcdc5: regulator-dcdc5 {
                        compatible = "ti,tps65218-dcdc5";
                        regulator-name = "v1_0bat";
index d92e3818cc36b260c695e4a29041ab5d907586e1..f4af8ca0cd66e89dc663d4a645390c2f5591a797 100644 (file)
                        0x238 (PIN_OUTPUT_PULLUP | MUX_MODE7)
                >;
        };
+
+       usb2_phy1_pins: usb2_phy1_pins {
+               pinctrl-single,pins = <
+                       0x2c0 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)
+               >;
+       };
+
+       usb2_phy2_pins: usb2_phy2_pins {
+               pinctrl-single,pins = <
+                       0x2c0 (PIN_OUTPUT_PULLUP | MUX_MODE0)
+               >;
+       };
 };
 
 &i2c0 {
                dcdc3: regulator-dcdc3 {
                        compatible = "ti,tps65218-dcdc3";
                        regulator-name = "vdds_ddr";
-                       regulator-min-microvolt = <1350000>;
-                       regulator-max-microvolt = <1350000>;
+                       regulator-min-microvolt = <1500000>;
+                       regulator-max-microvolt = <1500000>;
                        regulator-boot-on;
                        regulator-always-on;
                };
 
 &usb2_phy1 {
        status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb2_phy1_pins>;
 };
 
 &usb1 {
 
 &usb2_phy2 {
        status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb2_phy2_pins>;
 };
 
 &usb2 {
index 9efad06da8d6ba449cbefa73fd61af4292de43e5..76b92bdaf74c3ecf50adb0298dd41f051d590681 100644 (file)
                dcdc3: regulator-dcdc3 {
                        compatible = "ti,tps65218-dcdc3";
                        regulator-name = "vdcdc3";
-                       regulator-min-microvolt = <1350000>;
-                       regulator-max-microvolt = <1350000>;
+                       regulator-min-microvolt = <1500000>;
+                       regulator-max-microvolt = <1500000>;
                        regulator-boot-on;
                        regulator-always-on;
                };
index b0b83f107d0ac9cf8edcce96688248d67a63d1c5..08a803bf86cb0613df172ffe5376f94e1c9543b6 100644 (file)
                >;
        };
 
-       dcan1_pins_default: dcan1_pins_default {
-               pinctrl-single,pins = <
-                       0x3d4   (PIN_INPUT | MUX_MODE0)         /* dcan1_tx */
-                       0x3d8   (PIN_INPUT | MUX_MODE0)         /* dcan1_rx */
-               >;
-       };
-
-       dcan1_pins_sleep: dcan1_pins_sleep {
-               pinctrl-single,pins = <
-                       0x3d4   (PIN_INPUT | MUX_MODE15)        /* dcan1_tx */
-                       0x3d8   (PIN_INPUT | MUX_MODE15)        /* dcan1_rx */
-               >;
-       };
-
        atl_pins: pinmux_atl_pins {
                pinctrl-single,pins = <
                        0x298 (PIN_OUTPUT | MUX_MODE5)  /* xref_clk1.atl_clk1 */
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-parent = <&gpio6>;
-               interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
+               interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
                interrupt-controller;
                #interrupt-cells = <2>;
        };
                };
                partition@5 {
                        label = "QSPI.u-boot-spl-os";
-                       reg = <0x00140000 0x00010000>;
+                       reg = <0x00140000 0x00080000>;
                };
                partition@6 {
                        label = "QSPI.u-boot-env";
-                       reg = <0x00150000 0x00010000>;
+                       reg = <0x001c0000 0x00010000>;
                };
                partition@7 {
                        label = "QSPI.u-boot-env.backup1";
-                       reg = <0x00160000 0x0010000>;
+                       reg = <0x001d0000 0x0010000>;
                };
                partition@8 {
                        label = "QSPI.kernel";
-                       reg = <0x00170000 0x0800000>;
+                       reg = <0x001e0000 0x0800000>;
                };
                partition@9 {
                        label = "QSPI.file-system";
-                       reg = <0x00970000 0x01690000>;
+                       reg = <0x009e0000 0x01690000>;
                };
        };
 };
        };
 };
 
-&dcan1 {
-       status = "ok";
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&dcan1_pins_default>;
-       pinctrl-1 = <&dcan1_pins_sleep>;
-};
-
 &mailbox5 {
        status = "okay";
        mbox_ipu1_legacy: mbox_ipu1_legacy {
index 05e69534f425b5b92c612e0418ee166589cf0c6a..57253d06d852a439bc38d5345e0377d332994e7d 100644 (file)
                >;
        };
 
-       dcan1_pins_default: dcan1_pins_default {
-               pinctrl-single,pins = <
-                       0x3d4   (PIN_INPUT | MUX_MODE0)         /* dcan1_tx */
-                       0x418   (PIN_INPUT | MUX_MODE1)         /* wakeup0.dcan1_rx */
-               >;
-       };
-
-       dcan1_pins_sleep: dcan1_pins_sleep {
-               pinctrl-single,pins = <
-                       0x3d4   (PIN_INPUT | MUX_MODE15)        /* dcan1_tx.off */
-                       0x418   (PIN_INPUT | MUX_MODE15)        /* wakeup0.off */
-               >;
-       };
-
        vout1_pins: pinmux_vout1_pins {
                pinctrl-single,pins = <
                        0x1C8   (PIN_OUTPUT | MUX_MODE0)        /* vout1_clk */
                        0x284 (PIN_INPUT_SLEW | MUX_MODE0) /* usb2_drvvbus */
                 >;
         };
+
+       qspi1_pins: pinmux_qspi1_pins {
+               pinctrl-single,pins = <
+                       0x74 (PIN_OUTPUT | MUX_MODE1)   /* gpmc_a13.qspi1_rtclk */
+                       0x78 (PIN_INPUT | MUX_MODE1)    /* gpmc_a14.qspi1_d3 */
+                       0x7c (PIN_INPUT | MUX_MODE1)    /* gpmc_a15.qspi1_d2 */
+                       0x80 (PIN_INPUT | MUX_MODE1)    /* gpmc_a16.qspi1_d1 */
+                       0x84 (PIN_INPUT | MUX_MODE1)    /* gpmc_a17.qspi1_d0 */
+                       0x88 (PIN_OUTPUT | MUX_MODE1)   /* qpmc_a18.qspi1_sclk */
+                       0xb8 (PIN_OUTPUT | MUX_MODE1)   /* gpmc_cs2.qspi1_cs0 */
+               >;
+       };
 };
 
 &i2c1 {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cpsw_default>;
        pinctrl-1 = <&cpsw_sleep>;
+       active_slave = <1>;
 };
 
 &cpsw_emac0 {
        vdda_video-supply = <&ldo5_reg>;
 };
 
-
-&dcan1 {
-       status = "ok";
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&dcan1_pins_default>;
-       pinctrl-1 = <&dcan1_pins_sleep>;
-};
-
 &hdmi {
        status = "ok";
        vdda-supply = <&ldo3_reg>;
        pinctrl-names = "default";
        pinctrl-0 = <&usb2_pins>;
 };
+
+&qspi {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&qspi1_pins>;
+
+       spi-max-frequency = <48000000>;
+       m25p80@0 {
+               compatible = "s25fl256s1";
+               spi-max-frequency = <48000000>;
+               reg = <0>;
+               spi-tx-bus-width = <1>;
+               spi-rx-bus-width = <4>;
+               spi-cpol;
+               spi-cpha;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               /* MTD partition table.
+                * The ROM checks the first four physical blocks
+                * for a valid file to boot and the flash here is
+                * 64KiB block size.
+                */
+               partition@0 {
+                       label = "QSPI.SPL";
+                       reg = <0x00000000 0x000010000>;
+               };
+               partition@1 {
+                       label = "QSPI.SPL.backup1";
+                       reg = <0x00010000 0x00010000>;
+               };
+               partition@2 {
+                       label = "QSPI.SPL.backup2";
+                       reg = <0x00020000 0x00010000>;
+               };
+               partition@3 {
+                       label = "QSPI.SPL.backup3";
+                       reg = <0x00030000 0x00010000>;
+               };
+               partition@4 {
+                       label = "QSPI.u-boot";
+                       reg = <0x00040000 0x00100000>;
+               };
+               partition@5 {
+                       label = "QSPI.u-boot-spl-os";
+                       reg = <0x00140000 0x00080000>;
+               };
+               partition@6 {
+                       label = "QSPI.u-boot-env";
+                       reg = <0x001c0000 0x00010000>;
+               };
+               partition@7 {
+                       label = "QSPI.u-boot-env.backup1";
+                       reg = <0x001d0000 0x0010000>;
+               };
+               partition@8 {
+                       label = "QSPI.kernel";
+                       reg = <0x001e0000 0x0800000>;
+               };
+               partition@9 {
+                       label = "QSPI.file-system";
+                       reg = <0x009e0000 0x01690000>;
+               };
+       };
+};
index 73d715bd1c0da9189bcac5580f3fa2f9305a0feb..67586c51361fb17c1de80e236d91aa7645580848 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/of_dma.h>
 #include <linux/of_irq.h>
 #include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
 
 #include <linux/platform_data/edma.h>
 
@@ -1606,6 +1607,18 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
 }
 #endif
 
+static const struct platform_device_info edma_dmaengine_dev[EDMA_MAX_CC] = {
+       {
+               .name = "edma-dma-engine",
+               .id = 0,
+               .dma_mask = DMA_BIT_MASK(32),
+       }, {
+               .name = "edma-dma-engine",
+               .id = 1,
+               .dma_mask = DMA_BIT_MASK(32),
+       },
+};
+
 static int edma_probe(struct platform_device *pdev)
 {
        struct edma_soc_info    **info = pdev->dev.platform_data;
@@ -1623,6 +1636,7 @@ static int edma_probe(struct platform_device *pdev)
        char                    res_name[10];
        struct device_node      *node = pdev->dev.of_node;
        struct device           *dev = &pdev->dev;
+       struct platform_device  *dmaengine_pdev;
        int                     ret;
 
        if (node) {
@@ -1793,7 +1807,16 @@ static int edma_probe(struct platform_device *pdev)
                        edma_write_array2(j, EDMA_DRAE, i, 1, 0x0);
                        edma_write_array(j, EDMA_QRAE, i, 0x0);
                }
+
                edma_cc[j]->info = info[j];
+
+               dmaengine_pdev = platform_device_register_full(
+                                                       &edma_dmaengine_dev[j]);
+               if (IS_ERR(dmaengine_pdev))
+                       dev_err(dev,
+                               "device%d for dmaengine register failed (%ld)",
+                               j, PTR_ERR(dmaengine_pdev));
+
                arch_num_cc++;
        }
 
index c38e0696c017a2ffbfde89e65caefa352b439f4a..477e7efb12f1c30640a41bb838ff6306445760bc 100644 (file)
@@ -90,9 +90,10 @@ ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_ARCH_OMAP2)               += pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)               += sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)               += pm34xx.o sleep34xx.o
-obj-$(CONFIG_ARCH_OMAP4)               += pm44xx.o omap-mpuss-lowpower.o
-obj-$(CONFIG_SOC_OMAP5)                        += omap-mpuss-lowpower.o
-obj-$(CONFIG_SOC_DRA7XX)               += omap-mpuss-lowpower.o
+omap-4-5-pm-common                             =  pm44xx.o omap-mpuss-lowpower.o
+obj-$(CONFIG_ARCH_OMAP4)               += $(omap-4-5-pm-common)
+obj-$(CONFIG_SOC_OMAP5)                        += $(omap-4-5-pm-common)
+obj-$(CONFIG_SOC_DRA7XX)               += $(omap-4-5-pm-common)
 obj-$(CONFIG_SOC_AM33XX)               += pm33xx.o sleep33xx.o
 obj-$(CONFIG_SOC_AM43XX)               += pm33xx.o sleep43xx.o
 obj-$(CONFIG_PM_DEBUG)                 += pm-debug.o
@@ -111,7 +112,10 @@ ifeq ($(CONFIG_CPU_IDLE),y)
 obj-$(CONFIG_SOC_AM33XX)                += cpuidle33xx.o
 obj-$(CONFIG_SOC_AM43XX)                += cpuidle43xx.o
 obj-$(CONFIG_ARCH_OMAP3)                += cpuidle34xx.o
-obj-$(CONFIG_ARCH_OMAP4)                += cpuidle44xx.o
+omap-4-5-idle-common                   =  cpuidle44xx.o
+obj-$(CONFIG_ARCH_OMAP4)               += $(omap-4-5-idle-common)
+obj-$(CONFIG_SOC_OMAP5)                        += $(omap-4-5-idle-common)
+obj-$(CONFIG_SOC_DRA7XX)               += $(omap-4-5-idle-common)
 endif
 
 # PRCM
@@ -301,9 +305,6 @@ obj-y                                       += $(smc91x-m) $(smc91x-y)
 
 smsc911x-$(CONFIG_SMSC911X)            := gpmc-smsc911x.o
 obj-y                                  += $(smsc911x-m) $(smsc911x-y)
-ifneq ($(CONFIG_HWSPINLOCK_OMAP),)
-obj-y                                  += hwspinlock.o
-endif
 
 emac-$(CONFIG_TI_DAVINCI_EMAC)         := am35xx-emac.o
 obj-y                                  += $(emac-m) $(emac-y)
index 9df148dd30e2e99de5349ae2fad3ae9fdf9ab0e1..d5a8b1ff27ee15081826b465acf2b83e84fdfd32 100644 (file)
@@ -409,7 +409,7 @@ static struct clockdomain l4sec_7xx_clkdm = {
        .dep_bit          = DRA7XX_L4SEC_STATDEP_SHIFT,
        .wkdep_srcs       = l4sec_wkup_sleep_deps,
        .sleepdep_srcs    = l4sec_wkup_sleep_deps,
-       .flags            = CLKDM_CAN_HWSUP_SWSUP,
+       .flags            = CLKDM_CAN_SWSUP,
 };
 
 static struct clockdomain l3main1_7xx_clkdm = {
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
deleted file mode 100644 (file)
index ef175ac..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * OMAP hardware spinlock device initialization
- *
- * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
- *
- * Contact: Simon Que <sque@ti.com>
- *          Hari Kanigeri <h-kanigeri2@ti.com>
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/err.h>
-#include <linux/hwspinlock.h>
-
-#include "soc.h"
-#include "omap_hwmod.h"
-#include "omap_device.h"
-
-static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = {
-       .base_id = 0,
-};
-
-static int __init hwspinlocks_init(void)
-{
-       int retval = 0;
-       struct omap_hwmod *oh;
-       struct platform_device *pdev;
-       const char *oh_name = "spinlock";
-       const char *dev_name = "omap_hwspinlock";
-
-       /*
-        * Hwmod lookup will fail in case our platform doesn't support the
-        * hardware spinlock module, so it is safe to run this initcall
-        * on all omaps
-        */
-       oh = omap_hwmod_lookup(oh_name);
-       if (oh == NULL)
-               return -EINVAL;
-
-       pdev = omap_device_build(dev_name, 0, oh, &omap_hwspinlock_pdata,
-                               sizeof(struct hwspinlock_pdata));
-       if (IS_ERR(pdev)) {
-               pr_err("Can't build omap_device for %s:%s\n", dev_name,
-                                                               oh_name);
-               retval = PTR_ERR(pdev);
-       }
-
-       return retval;
-}
-/* early board code might need to reserve specific hwspinlock instances */
-omap_postcore_initcall(hwspinlocks_init);
index 05aaa1b76f12d425126373d7ab65e98478ae1c83..7079114b4e08b59727a7cd94d59ef90e40f8d3cd 100644 (file)
@@ -325,11 +325,13 @@ static void __init am43x_epos_evm_legacy_init(void)
 }
 #endif
 
+#ifdef CONFIG_SOC_DRA7XX
 static struct pci_dra7xx_platform_data dra7xx_pci_pdata = {
        .reset_name = "pcie",
        .assert_reset = omap_device_assert_hardreset,
        .deassert_reset = omap_device_deassert_hardreset,
 };
+#endif
 
 static struct pcs_pdata pcs_pdata;
 
index dde628ba2b98a63aa4bcd681263c23a626ec2af0..d7fbbec741e7450681c8cfd64c95266aa68c56c4 100644 (file)
@@ -218,6 +218,15 @@ sync:
        bne     sync
 #endif
 
+       ldr     r1, am43xx_virt_mpu_clkctrl
+       ldr     r2, [r1]
+
+       ldr     r1, am43xx_virt_mpu_clkstctrl
+       ldr     r2, [r1]
+
+       ldr     r1, am43xx_virt_emif_clkctrl
+       ldr     r2, [r1]
+
        ldr     r0, emif_addr_virt
        /* Put SDRAM in self-refresh */
        ldr     r1, [r0, #EMIF_POWER_MANAGEMENT_CONTROL]
@@ -225,8 +234,10 @@ sync:
        orr     r1, r1, #EMIF_POWER_MGMT_SELF_REFRESH_MODE
        str     r1, [r0, #EMIF_POWER_MANAGEMENT_CONTROL]
 
-       ldr     r1, dram_sync_word      @ a dummy access to DDR as per spec
+       ldr     r1, dram_sync_word      @ access DRAM
        ldr     r2, [r1, #0]
+       str     r2, [r1, #0]
+       isb
 
        mov     r1, #EMIF_POWER_MGMT_DELAY_PERIOD       @ Wait for system
 wait_self_refresh:                                     @ to enter SR
@@ -290,6 +301,11 @@ am43xx_deep_sleep_suspend:
        ldr     r1, am43xx_virt_mpu_clkstctrl
        mov     r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_SW_SLEEP
        str     r2, [r1]
+bus_sync:
+       ldr     r1, ddr_start           @ access SRAM
+       str     r1, ddr_start
+
+       isb
 
        /*
         * Execute a barrier instruction to ensure that all cache,
@@ -298,6 +314,7 @@ am43xx_deep_sleep_suspend:
         */
        dsb
        dmb
+       isb
 
        /*
         * Execute a WFI instruction and wait until the
index 1379f0b3af23c6339cc6c8b08b0fcd73be9c5e1e..3c218280e23a83f3ba5e72f2f1a4ee59e5eec5bf 100644 (file)
 #include <linux/clkdev.h>
 #include <linux/clk/ti.h>
 
-#define DRA7_DPLL_ABE_DEFFREQ                          361267200
+#define DRA7_DPLL_ABE_DEFFREQ                          180633600
 #define DRA7_DPLL_GMAC_DEFFREQ                         1000000000
 #define DRA7_DPLL_DSP_DEFFREQ                          600000000
 #define DRA7_DPLL_DSP_GFCLK_NOMFREQ                    600000000
 #define DRA7_DPLL_EVE_GCLK_NOMFREQ                     400000000
 
+#define DRA7_ATL_DEFFREQ                               5644800
 
 static struct ti_dt_clk dra7xx_clks[] = {
        DT_CLK(NULL, "atl_clkin0_ck", "atl_clkin0_ck"),
@@ -313,6 +314,7 @@ int __init dra7xx_dt_clk_init(void)
        struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck, *dss_deshdcp_ck;
        struct clk *ipu1_gfclk, *ipu1_gfclk_parent;
        struct clk *dsp_dpll, *dsp_m2_dpll, *dsp_m3x2_dpll;
+       struct clk *atl_fck, *atl_parent;
 
        ti_dt_clocks_register(dra7xx_clks);
 
@@ -328,6 +330,11 @@ int __init dra7xx_dt_clk_init(void)
        if (rc)
                pr_err("%s: failed to configure ABE DPLL!\n", __func__);
 
+       dpll_ck = clk_get_sys(NULL, "dpll_abe_m2x2_ck");
+       rc = clk_set_rate(dpll_ck, DRA7_DPLL_ABE_DEFFREQ * 2);
+       if (rc)
+               pr_err("%s: failed to configure ABE DPLL m2x2!\n", __func__);
+
        dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck");
        rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ);
        if (rc)
@@ -362,5 +369,21 @@ int __init dra7xx_dt_clk_init(void)
                pr_err("%s: failed to configure DSP DPLL!\n", __func__);
        }
 
+       atl_fck = clk_get_sys(NULL, "atl_gfclk_mux");
+       atl_parent = clk_get_sys(NULL, "dpll_abe_m2_ck");
+       rc = clk_set_parent(atl_fck, atl_parent);
+       if (rc)
+               pr_err("%s: failed to reparent atl_gfclk_mux\n", __func__);
+
+       atl_fck = clk_get_sys(NULL, "atl_clkin2_ck");
+       rc = clk_set_rate(atl_fck, DRA7_ATL_DEFFREQ);
+       if (rc)
+               pr_err("%s: failed to set atl_clkin2_ck\n", __func__);
+
+       atl_fck = clk_get_sys(NULL, "atl_clkin1_ck");
+       rc = clk_set_rate(atl_fck, DRA7_ATL_DEFFREQ);
+       if (rc)
+               pr_err("%s: failed to set atl_clkin1_ck\n", __func__);
+
        return rc;
 }
index 3f9308afdc2852d97561a91f92271a8bb81e4de3..c375cfb59ac93391a17339f2247f7f529088990a 100644 (file)
@@ -225,6 +225,7 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
        cinfo->iobase = of_iomap(node, 0);
        cinfo->dev = &pdev->dev;
        pm_runtime_enable(cinfo->dev);
+       pm_runtime_irq_safe(cinfo->dev);
 
        pm_runtime_get_sync(cinfo->dev);
        atl_write(cinfo, DRA7_ATL_PCLKMUX_REG(0), DRA7_ATL_PCLKMUX);
index 7a706749af62db05dd3889ad51db69d7aa9afec2..a808c36e9ac3f639c599248c76690f28bcb46d20 100644 (file)
@@ -167,7 +167,8 @@ cleanup:
 }
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-       defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX)
+       defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \
+       defined(CONFIG_SOC_AM43XX)
 /**
  * ti_clk_register_dpll_x2 - Registers a DPLLx2 clock
  * @node: device node for this clock
@@ -328,7 +329,7 @@ CLK_OF_DECLARE(ti_omap4_dpll_x2_clock, "ti,omap4-dpll-x2-clock",
               of_ti_omap4_dpll_x2_setup);
 #endif
 
-#ifdef CONFIG_SOC_AM33XX
+#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
 static void __init of_ti_am3_dpll_x2_setup(struct device_node *node)
 {
        ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, NULL);
index bbac5287181334fcd463a7b990e5f4ef3a472a76..00f0a3bd8ecb743e05658011abd276603fa162d8 100644 (file)
@@ -1105,52 +1105,14 @@ bool edma_filter_fn(struct dma_chan *chan, void *param)
 }
 EXPORT_SYMBOL(edma_filter_fn);
 
-static struct platform_device *pdev0, *pdev1;
-
-static const struct platform_device_info edma_dev_info0 = {
-       .name = "edma-dma-engine",
-       .id = 0,
-       .dma_mask = DMA_BIT_MASK(32),
-};
-
-static const struct platform_device_info edma_dev_info1 = {
-       .name = "edma-dma-engine",
-       .id = 1,
-       .dma_mask = DMA_BIT_MASK(32),
-};
-
 static int edma_init(void)
 {
-       int ret = platform_driver_register(&edma_driver);
-
-       if (ret == 0) {
-               pdev0 = platform_device_register_full(&edma_dev_info0);
-               if (IS_ERR(pdev0)) {
-                       platform_driver_unregister(&edma_driver);
-                       ret = PTR_ERR(pdev0);
-                       goto out;
-               }
-       }
-
-       if (EDMA_CTLRS == 2) {
-               pdev1 = platform_device_register_full(&edma_dev_info1);
-               if (IS_ERR(pdev1)) {
-                       platform_driver_unregister(&edma_driver);
-                       platform_device_unregister(pdev0);
-                       ret = PTR_ERR(pdev1);
-               }
-       }
-
-out:
-       return ret;
+       return platform_driver_register(&edma_driver);
 }
 subsys_initcall(edma_init);
 
 static void __exit edma_exit(void)
 {
-       platform_device_unregister(pdev0);
-       if (pdev1)
-               platform_device_unregister(pdev1);
        platform_driver_unregister(&edma_driver);
 }
 module_exit(edma_exit);
index 0437fb84aa1e0a4e87444e89ad7e5f1c9261eea3..fd671d09d950940bd5c107426fea372d08de4207 100644 (file)
@@ -1038,6 +1038,11 @@ static int omap_dma_resume(struct omap_chan *c)
                return -EINVAL;
 
        if (c->paused) {
+               mb();
+
+               /* Restore channel link register */
+               omap_dma_chan_write(c, CLNK_CTRL, c->desc->clnk_ctrl);
+
                omap_dma_start(c, c->desc);
                c->paused = false;
        }
index 70637d23b1f92ad6688300060dadeb4f892ccff9..3612cb5b30b206a066c75d835402654cacf7d002 100644 (file)
@@ -10,7 +10,7 @@ menu "Hardware Spinlock drivers"
 
 config HWSPINLOCK_OMAP
        tristate "OMAP Hardware Spinlock device"
-       depends on ARCH_OMAP4 || SOC_OMAP5
+       depends on ARCH_OMAP4 || SOC_OMAP5 || SOC_DRA7XX || SOC_AM33XX || SOC_AM43XX
        select HWSPINLOCK
        help
          Say y here to support the OMAP Hardware Spinlock device (firstly
index 461a0d739d75b0d646d9197a89ed6852f932be07..d49a077ceb0ae20dc1a5c69511c55372a3b36c16 100644 (file)
 #include <linux/hwspinlock.h>
 #include <linux/pm_runtime.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 
 #include "hwspinlock_internal.h"
 
 /* radix tree tags */
 #define HWSPINLOCK_UNUSED      (0) /* tags an hwspinlock as unused */
+#define HWSPINLOCK_RESERVED    (1) /* tags an hwspinlock as reserved */
 
 /*
  * A radix tree is used to maintain the available hwspinlock instances.
@@ -59,6 +61,11 @@ static RADIX_TREE(hwspinlock_tree, GFP_KERNEL);
  */
 static DEFINE_MUTEX(hwspinlock_tree_lock);
 
+/*
+ * A linked list for maintaining all the registered hwspinlock devices.
+ * The list is maintained in an ordered-list of the supported locks group.
+ */
+static LIST_HEAD(hwspinlock_devices);
 
 /**
  * __hwspin_trylock() - attempt to lock a specific hwspinlock
@@ -257,6 +264,127 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
 }
 EXPORT_SYMBOL_GPL(__hwspin_unlock);
 
+/**
+ * of_hwspin_lock_simple_xlate - translate hwlock_spec to return a lock id
+ * @bank: the hwspinlock device bank
+ * @hwlock_spec: hwlock specifier as found in the device tree
+ *
+ * This is a simple translation function, suitable for hwspinlock platform
+ * drivers that only has a lock specifier length of 1.
+ *
+ * Returns a negative value on error, and a relative index of the lock within
+ * a specified bank on success.
+ */
+static int of_hwspin_lock_simple_xlate(struct hwspinlock_device *bank,
+                               const struct of_phandle_args *hwlock_spec)
+{
+       /* sanity check (these shouldn't happen) */
+       if (WARN_ON(!bank->dev->of_node))
+               return -EINVAL;
+
+       if (WARN_ON(hwlock_spec->args_count != 1))
+               return -EINVAL;
+
+       return hwlock_spec->args[0];
+}
+
+/**
+ * of_hwspin_lock_get_id() - get lock id for an OF phandle-based specific lock
+ * @np: device node from which to request the specific hwlock
+ * @index: index of the hwlock in the list of values
+ *
+ * This function provides a means for DT users of the hwspinlock module to
+ * get the global lock id of a specific hwspinlock using the phandle of the
+ * hwspinlock device, so that it can be requested using the normal
+ * hwspin_lock_request_specific() API.
+ *
+ * Returns the global lock id number on success, -EPROBE_DEFER if the hwspinlock
+ * device is not yet registered, -EINVAL on invalid args specifier value or an
+ * appropriate error as returned from the OF parsing of the DT user node.
+ */
+int of_hwspin_lock_get_id(struct device_node *np, int index)
+{
+       struct hwspinlock_device *bank;
+       struct of_phandle_args args;
+       int id;
+       int ret;
+
+       ret = of_parse_phandle_with_args(np, "hwlocks", "#hwlock-cells", index,
+                                        &args);
+       if (ret)
+               return ret;
+
+       mutex_lock(&hwspinlock_tree_lock);
+       list_for_each_entry(bank, &hwspinlock_devices, list)
+               if (bank->dev->of_node == args.np)
+                       break;
+       mutex_unlock(&hwspinlock_tree_lock);
+       if (&bank->list == &hwspinlock_devices) {
+               ret = -EPROBE_DEFER;
+               goto out;
+       }
+
+       id = of_hwspin_lock_simple_xlate(bank, &args);
+       if (id < 0 || id >= bank->num_locks) {
+               ret = -EINVAL;
+               goto out;
+       }
+       id += bank->base_id;
+
+out:
+       of_node_put(args.np);
+       return ret ? ret : id;
+}
+EXPORT_SYMBOL_GPL(of_hwspin_lock_get_id);
+
+/**
+ * of_hwspin_lock_get_base_id() - OF helper to retrieve base id
+ * @dn: device node pointer
+ *
+ * This is an OF helper function that can be called by the underlying
+ * platform-specific implementations, to retrieve the base id for the
+ * set of locks present within a hwspinlock device instance.
+ *
+ * Returns the base id value on success, or an appropriate error code
+ * as returned by the OF layer
+ */
+int of_hwspin_lock_get_base_id(struct device_node *dn)
+{
+       unsigned int val;
+       int ret;
+
+       ret = of_property_read_u32(dn, "hwlock-base-id", &val);
+       return ret ? ret : val;
+}
+EXPORT_SYMBOL_GPL(of_hwspin_lock_get_base_id);
+
+/**
+ * of_hwspin_lock_get_num_locks() - OF helper to retrieve number of locks
+ * @dn: device node pointer
+ *
+ * This is an OF helper function that can be called by the underlying
+ * platform-specific implementations, to retrieve the number of locks
+ * present within a hwspinlock device instance. The hwlock-num-locks
+ * DT property may be optional for some platforms, while mandatory for
+ * some others, so this function is typically called only by needed
+ * platform-specific implementations.
+ *
+ * Returns a positive number of locks on success, -ENODEV on generic
+ * failure or an appropriate error code as returned by the OF layer
+ */
+int of_hwspin_lock_get_num_locks(struct device_node *dn)
+{
+       unsigned int val;
+       int ret = -ENODEV;
+
+       ret = of_property_read_u32(dn, "hwlock-num-locks", &val);
+       if (!ret)
+               ret = val ? val : -ENODEV;
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(of_hwspin_lock_get_num_locks);
+
 static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
 {
        struct hwspinlock *tmp;
@@ -272,7 +400,7 @@ static int hwspin_lock_register_single(struct hwspinlock *hwlock, int id)
        }
 
        /* mark this hwspinlock as available */
-       tmp = radix_tree_tag_set(&hwspinlock_tree, id, HWSPINLOCK_UNUSED);
+       tmp = radix_tree_tag_set(&hwspinlock_tree, id, hwlock->type);
 
        /* self-sanity check which should never fail */
        WARN_ON(tmp != hwlock);
@@ -282,29 +410,114 @@ out:
        return 0;
 }
 
-static struct hwspinlock *hwspin_lock_unregister_single(unsigned int id)
+static int hwspin_lock_unregister_single(struct hwspinlock *hwlock, int id)
 {
-       struct hwspinlock *hwlock = NULL;
-       int ret;
+       struct hwspinlock *tmp = NULL;
+       int ret = 0;
 
        mutex_lock(&hwspinlock_tree_lock);
 
        /* make sure the hwspinlock is not in use (tag is set) */
-       ret = radix_tree_tag_get(&hwspinlock_tree, id, HWSPINLOCK_UNUSED);
-       if (ret == 0) {
+       if (!radix_tree_tag_get(&hwspinlock_tree, id, hwlock->type)) {
                pr_err("hwspinlock %d still in use (or not present)\n", id);
+               ret = -EBUSY;
                goto out;
        }
 
-       hwlock = radix_tree_delete(&hwspinlock_tree, id);
-       if (!hwlock) {
+       tmp = radix_tree_delete(&hwspinlock_tree, id);
+       if (!tmp) {
                pr_err("failed to delete hwspinlock %d\n", id);
+               ret = -EIO;
                goto out;
        }
 
+       /* self-sanity check that should never fail */
+       WARN_ON(tmp != hwlock);
+
 out:
        mutex_unlock(&hwspinlock_tree_lock);
-       return hwlock;
+       return ret;
+}
+
+/*
+ * Add a new hwspinlock device to the global list, keeping the list of
+ * devices sorted by base order.
+ *
+ * Returns 0 on success, or -EBUSY if the new device overlaps with some
+ * other device's lock space.
+ */
+static int hwspinlock_device_add(struct hwspinlock_device *bank)
+{
+       struct list_head *entry = &hwspinlock_devices;
+       struct hwspinlock_device *_bank;
+       int ret = 0;
+
+       list_for_each(entry, &hwspinlock_devices) {
+               _bank = list_entry(entry, struct hwspinlock_device, list);
+               if (_bank->base_id >= bank->base_id + bank->num_locks)
+                       break;
+       }
+
+       if (entry != &hwspinlock_devices &&
+           entry->prev != &hwspinlock_devices) {
+               _bank = list_entry(entry->prev, struct hwspinlock_device, list);
+               if (_bank->base_id + _bank->num_locks > bank->base_id) {
+                       dev_err(bank->dev, "hwlock space overlap, cannot add device\n");
+                       ret = -EBUSY;
+               }
+       }
+
+       if (!ret)
+               list_add_tail(&bank->list, entry);
+
+       return ret;
+}
+
+/**
+ * hwspin_mark_reserved_locks() - mark reserved locks
+ *
+ * This is an internal function that mark all the reserved locks within
+ * a hwspinlock device during the registration phase, and is applicable
+ * only for device-tree boots. The locks are marked by browsing through
+ * all the user nodes with the property "hwlocks", so that a separate
+ * property is not needed in the hwspinlock device itself. Note that it
+ * also marks locks used on disabled user nodes.
+ */
+static void hwspin_mark_reserved_locks(struct hwspinlock_device *bank)
+{
+       struct device_node *np = bank->dev->of_node;
+       const char *prop_name = "hwlocks";
+       const char *cells_name = "#hwlock-cells";
+       struct device_node *node = NULL;
+       struct of_phandle_args args;
+       struct hwspinlock *hwlock;
+       int i, id, count, ret;
+
+       for_each_node_with_property(node, prop_name) {
+               count = of_count_phandle_with_args(node, prop_name, cells_name);
+               if (count <= 0)
+                       continue;
+
+               for (i = 0; i < count; i++, of_node_put(args.np)) {
+                       args.np = NULL;
+                       ret = of_parse_phandle_with_args(node, prop_name,
+                                                        cells_name, i, &args);
+                       if (ret || np != args.np)
+                               continue;
+
+                       id = of_hwspin_lock_simple_xlate(bank, &args);
+                       if (id < 0 || id >= bank->num_locks)
+                               continue;
+
+                       hwlock = &bank->lock[id];
+                       if (hwlock->type == HWSPINLOCK_RESERVED) {
+                               dev_err(bank->dev, "potential reuse of hwspinlock %d between multiple clients on %s\n",
+                                       id, np->full_name);
+                               continue;
+                       }
+                       hwlock->type = HWSPINLOCK_RESERVED;
+               }
+       }
 }
 
 /**
@@ -339,11 +552,22 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
        bank->base_id = base_id;
        bank->num_locks = num_locks;
 
+       mutex_lock(&hwspinlock_tree_lock);
+       ret = hwspinlock_device_add(bank);
+       mutex_unlock(&hwspinlock_tree_lock);
+       if (ret)
+               return ret;
+
+       if (dev->of_node)
+               hwspin_mark_reserved_locks(bank);
+
        for (i = 0; i < num_locks; i++) {
                hwlock = &bank->lock[i];
 
                spin_lock_init(&hwlock->lock);
                hwlock->bank = bank;
+               if (hwlock->type != HWSPINLOCK_RESERVED)
+                       hwlock->type = HWSPINLOCK_UNUSED;
 
                ret = hwspin_lock_register_single(hwlock, base_id + i);
                if (ret)
@@ -353,8 +577,13 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
        return 0;
 
 reg_failed:
-       while (--i >= 0)
-               hwspin_lock_unregister_single(base_id + i);
+       while (--i >= 0) {
+               hwlock =  &bank->lock[i];
+               hwspin_lock_unregister_single(hwlock, base_id + i);
+       }
+       mutex_lock(&hwspinlock_tree_lock);
+       list_del(&bank->list);
+       mutex_unlock(&hwspinlock_tree_lock);
        return ret;
 }
 EXPORT_SYMBOL_GPL(hwspin_lock_register);
@@ -372,20 +601,20 @@ EXPORT_SYMBOL_GPL(hwspin_lock_register);
  */
 int hwspin_lock_unregister(struct hwspinlock_device *bank)
 {
-       struct hwspinlock *hwlock, *tmp;
-       int i;
+       struct hwspinlock *hwlock;
+       int i, ret;
 
        for (i = 0; i < bank->num_locks; i++) {
                hwlock = &bank->lock[i];
 
-               tmp = hwspin_lock_unregister_single(bank->base_id + i);
-               if (!tmp)
+               ret = hwspin_lock_unregister_single(hwlock, bank->base_id + i);
+               if (ret)
                        return -EBUSY;
-
-               /* self-sanity check that should never fail */
-               WARN_ON(tmp != hwlock);
        }
 
+       mutex_lock(&hwspinlock_tree_lock);
+       list_del(&bank->list);
+       mutex_unlock(&hwspinlock_tree_lock);
        return 0;
 }
 EXPORT_SYMBOL_GPL(hwspin_lock_unregister);
@@ -423,7 +652,7 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock)
 
        /* mark hwspinlock as used, should not fail */
        tmp = radix_tree_tag_clear(&hwspinlock_tree, hwlock_to_id(hwlock),
-                                                       HWSPINLOCK_UNUSED);
+                                                       hwlock->type);
 
        /* self-sanity check that should never fail */
        WARN_ON(tmp != hwlock);
@@ -521,8 +750,14 @@ struct hwspinlock *hwspin_lock_request_specific(unsigned int id)
        /* sanity check (this shouldn't happen) */
        WARN_ON(hwlock_to_id(hwlock) != id);
 
-       /* make sure this hwspinlock is unused */
-       ret = radix_tree_tag_get(&hwspinlock_tree, id, HWSPINLOCK_UNUSED);
+       if (hwlock->bank->dev->of_node && hwlock->type != HWSPINLOCK_RESERVED) {
+               pr_warn("hwspinlock %u is not a reserved lock\n", id);
+               hwlock = NULL;
+               goto out;
+       }
+
+       /* make sure this hwspinlock is an unused reserved lock */
+       ret = radix_tree_tag_get(&hwspinlock_tree, id, hwlock->type);
        if (ret == 0) {
                pr_warn("hwspinlock %u is already in use\n", id);
                hwlock = NULL;
@@ -568,7 +803,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock)
 
        /* make sure the hwspinlock is used */
        ret = radix_tree_tag_get(&hwspinlock_tree, hwlock_to_id(hwlock),
-                                                       HWSPINLOCK_UNUSED);
+                                                       hwlock->type);
        if (ret == 1) {
                dev_err(dev, "%s: hwlock is already free\n", __func__);
                dump_stack();
@@ -583,7 +818,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock)
 
        /* mark this hwspinlock as available */
        tmp = radix_tree_tag_set(&hwspinlock_tree, hwlock_to_id(hwlock),
-                                                       HWSPINLOCK_UNUSED);
+                                                       hwlock->type);
 
        /* sanity check (this shouldn't happen) */
        WARN_ON(tmp != hwlock);
index d26f78b8f214d226de7bf8c1b523257f2956a7e0..4ebed1a074d87347e6ab3acad6e9a613a55bc024 100644 (file)
@@ -43,16 +43,19 @@ struct hwspinlock_ops {
  * struct hwspinlock - this struct represents a single hwspinlock instance
  * @bank: the hwspinlock_device structure which owns this lock
  * @lock: initialized and used by hwspinlock core
+ * @type: type of lock, used to distinguish regular locks from reserved locks
  * @priv: private data, owned by the underlying platform-specific hwspinlock drv
  */
 struct hwspinlock {
        struct hwspinlock_device *bank;
        spinlock_t lock;
+       unsigned int type;
        void *priv;
 };
 
 /**
  * struct hwspinlock_device - a device which usually spans numerous hwspinlocks
+ * @list: list element to link hwspinlock devices together
  * @dev: underlying device, will be used to invoke runtime PM api
  * @ops: platform-specific hwspinlock handlers
  * @base_id: id index of the first lock in this device
@@ -60,6 +63,7 @@ struct hwspinlock {
  * @lock: dynamically allocated array of 'struct hwspinlock'
  */
 struct hwspinlock_device {
+       struct list_head list;
        struct device *dev;
        const struct hwspinlock_ops *ops;
        int base_id;
index 292869cc90343fd330ce29e9bcdf3c8575a2b7f7..2e8c7c32ade9d57f87e27f926df6bf2a6fb1d6ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * OMAP hardware spinlock driver
  *
- * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2010-2014 Texas Instruments Incorporated - http://www.ti.com
  *
  * Contact: Simon Que <sque@ti.com>
  *          Hari Kanigeri <h-kanigeri2@ti.com>
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/hwspinlock.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 
 #include "hwspinlock_internal.h"
@@ -80,16 +81,21 @@ static const struct hwspinlock_ops omap_hwspinlock_ops = {
 
 static int omap_hwspinlock_probe(struct platform_device *pdev)
 {
-       struct hwspinlock_pdata *pdata = pdev->dev.platform_data;
+       struct device_node *node = pdev->dev.of_node;
        struct hwspinlock_device *bank;
        struct hwspinlock *hwlock;
        struct resource *res;
        void __iomem *io_base;
-       int num_locks, i, ret;
+       int num_locks, i, ret, base_id;
 
-       if (!pdata)
+       if (!node)
                return -ENODEV;
 
+       ret = of_hwspin_lock_get_base_id(node);
+       if (ret < 0 && ret != -EINVAL)
+               return -ENODEV;
+       base_id = (ret > 0 ? ret : 0);
+
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
                return -ENODEV;
@@ -98,10 +104,29 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
        if (!io_base)
                return -ENOMEM;
 
+       /*
+        * make sure the module is enabled and clocked before reading
+        * the module SYSSTATUS register
+        */
+       pm_runtime_enable(&pdev->dev);
+       ret = pm_runtime_get_sync(&pdev->dev);
+       if (ret < 0) {
+               pm_runtime_put_noidle(&pdev->dev);
+               goto iounmap_base;
+       }
+
        /* Determine number of locks */
        i = readl(io_base + SYSSTATUS_OFFSET);
        i >>= SPINLOCK_NUMLOCKS_BIT_OFFSET;
 
+       /*
+        * runtime PM will make sure the clock of this module is
+        * enabled again iff at least one lock is requested
+        */
+       ret = pm_runtime_put(&pdev->dev);
+       if (ret < 0)
+               goto iounmap_base;
+
        /* one of the four lsb's must be set, and nothing else */
        if (hweight_long(i & 0xf) != 1 || i > 8) {
                ret = -EINVAL;
@@ -121,23 +146,17 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
        for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++)
                hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
 
-       /*
-        * runtime PM will make sure the clock of this module is
-        * enabled iff at least one lock is requested
-        */
-       pm_runtime_enable(&pdev->dev);
-
        ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops,
-                                               pdata->base_id, num_locks);
+                                               base_id, num_locks);
        if (ret)
                goto reg_fail;
 
        return 0;
 
 reg_fail:
-       pm_runtime_disable(&pdev->dev);
        kfree(bank);
 iounmap_base:
+       pm_runtime_disable(&pdev->dev);
        iounmap(io_base);
        return ret;
 }
@@ -161,12 +180,19 @@ static int omap_hwspinlock_remove(struct platform_device *pdev)
        return 0;
 }
 
+static const struct of_device_id omap_hwspinlock_of_match[] = {
+       { .compatible = "ti,omap4-hwspinlock", },
+       { /* end */ },
+};
+MODULE_DEVICE_TABLE(of, omap_hwspinlock_of_match);
+
 static struct platform_driver omap_hwspinlock_driver = {
        .probe          = omap_hwspinlock_probe,
        .remove         = omap_hwspinlock_remove,
        .driver         = {
                .name   = "omap_hwspinlock",
                .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(omap_hwspinlock_of_match),
        },
 };
 
index 63b2bb6bdbbcc7cd1064e9649c7d2825d83ffcc8..aa146cbda721c30a6e6cc96b53c57950ce80506f 100644 (file)
@@ -99,7 +99,7 @@ static void tiadc_step_config(struct iio_dev *indio_dev)
         * needs to be given to ADC to digitalize data.
         */
 
-       steps = TOTAL_STEPS - adc_dev->channels;
+       steps = 0;
        if (iio_buffer_enabled(indio_dev))
                stepconfig = STEPCONFIG_AVG_16 | STEPCONFIG_FIFO1
                                        | STEPCONFIG_MODE_SWCNT;
index 4e793a17361f7b2e02955e7e6e02ece9151f8063..23198a2823e6769a097f25136c47cf0956ede01d 100644 (file)
@@ -121,7 +121,7 @@ static void titsc_step_config(struct titsc *ts_dev)
 {
        unsigned int    config;
        int i;
-       int end_step;
+       int end_step, first_step, tsc_steps;
        u32 stepenable;
 
        config = STEPCONFIG_MODE_HWSYNC |
@@ -140,9 +140,11 @@ static void titsc_step_config(struct titsc *ts_dev)
                break;
        }
 
-       /* 1 â€¦ coordinate_readouts is for X */
-       end_step = ts_dev->coordinate_readouts;
-       for (i = 0; i < end_step; i++) {
+       tsc_steps = ts_dev->coordinate_readouts * 2 + 2;
+       first_step = TOTAL_STEPS - tsc_steps;
+       /* Steps 16 to 16-coordinate_readouts is for X */
+       end_step = first_step + tsc_steps;
+       for (i = end_step - ts_dev->coordinate_readouts; i < end_step; i++) {
                titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
                titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
        }
@@ -164,22 +166,20 @@ static void titsc_step_config(struct titsc *ts_dev)
                break;
        }
 
-       /* coordinate_readouts â€¦ coordinate_readouts * 2 is for Y */
-       end_step = ts_dev->coordinate_readouts * 2;
-       for (i = ts_dev->coordinate_readouts; i < end_step; i++) {
+       /* 1 ... coordinate_readouts is for Y */
+       end_step = first_step + ts_dev->coordinate_readouts;
+       for (i = first_step; i < end_step; i++) {
                titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
                titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
        }
 
-       /* Charge step configuration */
-       config = ts_dev->bit_xp | ts_dev->bit_yn |
-                       STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR |
-                       STEPCHARGE_INM_AN1 | STEPCHARGE_INP(ts_dev->inp_yp);
+       /* Make CHARGECONFIG same as IDLECONFIG */
 
+       config = titsc_readl(ts_dev, REG_IDLECONFIG);
        titsc_writel(ts_dev, REG_CHARGECONFIG, config);
        titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
 
-       /* coordinate_readouts * 2 â€¦ coordinate_readouts * 2 + 2 is for Z */
+       /* coordinate_readouts + 1 ... coordinate_readouts + 2 is for Z */
        config = STEPCONFIG_MODE_HWSYNC |
                        STEPCONFIG_AVG_16 | ts_dev->bit_yp |
                        ts_dev->bit_xn | STEPCONFIG_INM_ADCREFM |
@@ -194,8 +194,11 @@ static void titsc_step_config(struct titsc *ts_dev)
        titsc_writel(ts_dev, REG_STEPDELAY(end_step),
                        STEPCONFIG_OPENDLY);
 
-       /* The steps1 â€¦ end and bit 0 for TS_Charge */
-       stepenable = (1 << (end_step + 2)) - 1;
+       /* The steps end ... end - readouts * 2 + 2 and bit 0 for TS_Charge */
+       stepenable = 1;
+       for (i = 0; i < tsc_steps; i++)
+               stepenable |= 1 << (first_step + i + 1);
+
        ts_dev->step_mask = stepenable;
        am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
 }
@@ -209,6 +212,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
        unsigned int read, diff;
        unsigned int i, channel;
        unsigned int creads = ts_dev->coordinate_readouts;
+       unsigned int first_step = TOTAL_STEPS - (creads * 2 + 2);
 
        *z1 = *z2 = 0;
        if (fifocount % (creads * 2 + 2))
@@ -226,7 +230,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
 
                channel = (read & 0xf0000) >> 16;
                read &= 0xfff;
-               if (channel < creads) {
+               if (channel > first_step + creads + 2) {
                        diff = abs(read - prev_val_x);
                        if (diff < prev_diff_x) {
                                prev_diff_x = diff;
@@ -234,19 +238,19 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
                        }
                        prev_val_x = read;
 
-               } else if (channel < creads * 2) {
+               } else if (channel == first_step + creads + 1) {
+                       *z1 = read;
+
+               } else if (channel == first_step + creads + 2) {
+                       *z2 = read;
+
+               } else if (channel > first_step) {
                        diff = abs(read - prev_val_y);
                        if (diff < prev_diff_y) {
                                prev_diff_y = diff;
                                *y = read;
                        }
                        prev_val_y = read;
-
-               } else if (channel < creads * 2 + 1) {
-                       *z1 = read;
-
-               } else if (channel < creads * 2 + 2) {
-                       *z2 = read;
                }
        }
 }
@@ -258,9 +262,24 @@ static irqreturn_t titsc_irq(int irq, void *dev)
        unsigned int status, irqclr = 0;
        unsigned int x = 0, y = 0;
        unsigned int z1, z2, z;
-       unsigned int fsm;
 
-       status = titsc_readl(ts_dev, REG_IRQSTATUS);
+       status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
+       if (status & IRQENB_HW_PEN) {
+               ts_dev->pen_down = true;
+               irqclr |= IRQENB_HW_PEN;
+       }
+
+       if (status & IRQENB_PENUP) {
+               ts_dev->pen_down = false;
+               input_report_key(input_dev, BTN_TOUCH, 0);
+               input_report_abs(input_dev, ABS_PRESSURE, 0);
+               input_sync(input_dev);
+               irqclr |= IRQENB_PENUP;
+       }
+
+       if (status & IRQENB_EOS)
+               irqclr |= IRQENB_EOS;
+
        /*
         * ADC and touchscreen share the IRQ line.
         * FIFO1 interrupts are used by ADC. Handle FIFO0 IRQs here only
@@ -291,34 +310,6 @@ static irqreturn_t titsc_irq(int irq, void *dev)
                }
                irqclr |= IRQENB_FIFO0THRES;
        }
-
-       /*
-        * Time for sequencer to settle, to read
-        * correct state of the sequencer.
-        */
-       udelay(SEQ_SETTLE);
-
-       status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
-       if (status & IRQENB_PENUP) {
-               /* Pen up event */
-               fsm = titsc_readl(ts_dev, REG_ADCFSM);
-               if (fsm == ADCFSM_STEPID) {
-                       ts_dev->pen_down = false;
-                       input_report_key(input_dev, BTN_TOUCH, 0);
-                       input_report_abs(input_dev, ABS_PRESSURE, 0);
-                       input_sync(input_dev);
-               } else {
-                       ts_dev->pen_down = true;
-               }
-               irqclr |= IRQENB_PENUP;
-       }
-
-       if (status & IRQENB_HW_PEN) {
-
-               titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00);
-               titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
-       }
-
        if (irqclr) {
                titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
                am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
@@ -408,6 +399,7 @@ static int titsc_probe(struct platform_device *pdev)
        }
 
        titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
+       titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS);
        err = titsc_config_wires(ts_dev);
        if (err) {
                dev_err(&pdev->dev, "wrong i/p wire configuration\n");
index 80fffba7f12dfd77dcff90d06a9783613d131827..0b7dfaa3767294ea0afdc7539e653c437e86cb26 100644 (file)
 #include "omap-iopgtable.h"
 #include "omap-iommu.h"
 
-#define MAXCOLUMN 100 /* for short messages */
-
 static DEFINE_MUTEX(iommu_debug_lock);
 
 static struct dentry *iommu_debug_root;
 
-static ssize_t debug_read_ver(struct file *file, char __user *userbuf,
-                             size_t count, loff_t *ppos)
+static inline bool is_omap_iommu_detached(struct omap_iommu *obj)
 {
-       u32 ver = omap_iommu_arch_version();
-       char buf[MAXCOLUMN], *p = buf;
-
-       p += sprintf(p, "H/W version: %d.%d\n", (ver >> 4) & 0xf , ver & 0xf);
-
-       return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
+       return !obj->domain;
 }
 
 static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
@@ -49,6 +41,9 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
        char *p, *buf;
        ssize_t bytes;
 
+       if (is_omap_iommu_detached(obj))
+               return -EPERM;
+
        buf = kmalloc(count, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
@@ -73,6 +68,9 @@ static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
        char *p, *buf;
        ssize_t bytes, rest;
 
+       if (is_omap_iommu_detached(obj))
+               return -EPERM;
+
        buf = kmalloc(count, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
@@ -93,124 +91,57 @@ static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
        return bytes;
 }
 
-static ssize_t debug_write_pagetable(struct file *file,
-                    const char __user *userbuf, size_t count, loff_t *ppos)
+static void dump_ioptable(struct seq_file *s)
 {
-       struct iotlb_entry e;
-       struct cr_regs cr;
-       int err;
-       struct device *dev = file->private_data;
+       int i, j;
+       u32 da;
+       u32 *iopgd, *iopte;
+       struct device *dev = s->private;
        struct omap_iommu *obj = dev_to_omap_iommu(dev);
-       char buf[MAXCOLUMN], *p = buf;
-
-       count = min(count, sizeof(buf));
-
-       mutex_lock(&iommu_debug_lock);
-       if (copy_from_user(p, userbuf, count)) {
-               mutex_unlock(&iommu_debug_lock);
-               return -EFAULT;
-       }
-
-       sscanf(p, "%x %x", &cr.cam, &cr.ram);
-       if (!cr.cam || !cr.ram) {
-               mutex_unlock(&iommu_debug_lock);
-               return -EINVAL;
-       }
-
-       omap_iotlb_cr_to_e(&cr, &e);
-       err = omap_iopgtable_store_entry(obj, &e);
-       if (err)
-               dev_err(obj->dev, "%s: fail to store cr\n", __func__);
-
-       mutex_unlock(&iommu_debug_lock);
-       return count;
-}
-
-#define dump_ioptable_entry_one(lv, da, val)                   \
-       ({                                                      \
-               int __err = 0;                                  \
-               ssize_t bytes;                                  \
-               const int maxcol = 22;                          \
-               const char *str = "%d: %08x %08x\n";            \
-               bytes = snprintf(p, maxcol, str, lv, da, val);  \
-               p += bytes;                                     \
-               len -= bytes;                                   \
-               if (len < maxcol)                               \
-                       __err = -ENOMEM;                        \
-               __err;                                          \
-       })
-
-static ssize_t dump_ioptable(struct omap_iommu *obj, char *buf, ssize_t len)
-{
-       int i;
-       u32 *iopgd;
-       char *p = buf;
 
        spin_lock(&obj->page_table_lock);
 
        iopgd = iopgd_offset(obj, 0);
        for (i = 0; i < PTRS_PER_IOPGD; i++, iopgd++) {
-               int j, err;
-               u32 *iopte;
-               u32 da;
-
                if (!*iopgd)
                        continue;
 
                if (!(*iopgd & IOPGD_TABLE)) {
                        da = i << IOPGD_SHIFT;
-
-                       err = dump_ioptable_entry_one(1, da, *iopgd);
-                       if (err)
-                               goto out;
+                       seq_printf(s, "1: 0x%08x 0x%08x\n", da, *iopgd);
                        continue;
                }
 
                iopte = iopte_offset(iopgd, 0);
-
                for (j = 0; j < PTRS_PER_IOPTE; j++, iopte++) {
                        if (!*iopte)
                                continue;
 
                        da = (i << IOPGD_SHIFT) + (j << IOPTE_SHIFT);
-                       err = dump_ioptable_entry_one(2, da, *iopgd);
-                       if (err)
-                               goto out;
+                       seq_printf(s, "1: 0x%08x 0x%08x\n", da, *iopte);
                }
        }
-out:
-       spin_unlock(&obj->page_table_lock);
 
-       return p - buf;
+       spin_unlock(&obj->page_table_lock);
 }
 
-static ssize_t debug_read_pagetable(struct file *file, char __user *userbuf,
-                                   size_t count, loff_t *ppos)
+static int debug_read_pagetable(struct seq_file *s, void *data)
 {
-       struct device *dev = file->private_data;
+       struct device *dev = s->private;
        struct omap_iommu *obj = dev_to_omap_iommu(dev);
-       char *p, *buf;
-       size_t bytes;
-
-       buf = (char *)__get_free_page(GFP_KERNEL);
-       if (!buf)
-               return -ENOMEM;
-       p = buf;
 
-       p += sprintf(p, "L: %8s %8s\n", "da:", "pa:");
-       p += sprintf(p, "-----------------------------------------\n");
+       if (is_omap_iommu_detached(obj))
+               return -EPERM;
 
        mutex_lock(&iommu_debug_lock);
 
-       bytes = PAGE_SIZE - (p - buf);
-       p += dump_ioptable(obj, p, bytes);
-
-       bytes = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
+       seq_printf(s, "L: %8s %8s\n", "da:", "pte:");
+       seq_puts(s, "--------------------------\n");
+       dump_ioptable(s);
 
        mutex_unlock(&iommu_debug_lock);
-       free_page((unsigned long)buf);
 
-       return bytes;
+       return 0;
 }
 
 static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,
@@ -323,6 +254,19 @@ err_out:
        return count;
 }
 
+#define DEBUG_SEQ_FOPS_RO(name)                                                       \
+       static int debug_open_##name(struct inode *inode, struct file *file)   \
+       {                                                                      \
+               return single_open(file, debug_read_##name, inode->i_private); \
+       }                                                                      \
+                                                                              \
+       static const struct file_operations debug_##name##_fops = {            \
+               .open           = debug_open_##name,                           \
+               .read           = seq_read,                                    \
+               .llseek         = seq_lseek,                                   \
+               .release        = single_release,                              \
+       }
+
 #define DEBUG_FOPS(name)                                               \
        static const struct file_operations debug_##name##_fops = {     \
                .open = simple_open,                                    \
@@ -338,10 +282,9 @@ err_out:
                .llseek = generic_file_llseek,                          \
        };
 
-DEBUG_FOPS_RO(ver);
 DEBUG_FOPS_RO(regs);
 DEBUG_FOPS_RO(tlb);
-DEBUG_FOPS(pagetable);
+DEBUG_SEQ_FOPS_RO(pagetable);
 DEBUG_FOPS_RO(mmap);
 DEBUG_FOPS(mem);
 
@@ -380,15 +323,14 @@ static int iommu_debug_register(struct device *dev, void *data)
                goto nomem;
        parent = d;
 
-       d = debugfs_create_u8("nr_tlb_entries", 400, parent,
+       d = debugfs_create_u8("nr_tlb_entries", 0400, parent,
                              (u8 *)&obj->nr_tlb_entries);
        if (!d)
                goto nomem;
 
-       DEBUG_ADD_FILE_RO(ver);
        DEBUG_ADD_FILE_RO(regs);
        DEBUG_ADD_FILE_RO(tlb);
-       DEBUG_ADD_FILE(pagetable);
+       DEBUG_ADD_FILE_RO(pagetable);
        DEBUG_ADD_FILE_RO(mmap);
        DEBUG_ADD_FILE(mem);
 
@@ -416,7 +358,7 @@ static int __init iommu_debug_init(void)
        struct dentry *d;
        int err;
 
-       d = debugfs_create_dir("iommu", NULL);
+       d = debugfs_create_dir("omap_iommu", NULL);
        if (!d)
                return -ENOMEM;
        iommu_debug_root = d;
index 1e3969447a598f04394a6d6a644077fedf5c6f18..c34e3ce54281d317e546b87e216c583da6b2b4f9 100644 (file)
@@ -160,15 +160,6 @@ void omap_iommu_restore_ctx(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(omap_iommu_restore_ctx);
 
-/**
- * omap_iommu_arch_version - Return running iommu arch version
- **/
-u32 omap_iommu_arch_version(void)
-{
-       return arch_iommu->version;
-}
-EXPORT_SYMBOL_GPL(omap_iommu_arch_version);
-
 static int iommu_enable(struct omap_iommu *obj)
 {
        int err;
@@ -833,8 +824,9 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
        u32 *iopgd, *iopte;
        struct omap_iommu *obj = data;
        struct iommu_domain *domain = obj->domain;
+       struct omap_iommu_domain *omap_domain = domain->priv;
 
-       if (!obj->refcount)
+       if (!omap_domain->attached)
                return IRQ_NONE;
 
        errs = iommu_report_fault(obj, &da);
@@ -894,34 +886,18 @@ static struct omap_iommu *omap_iommu_attach(const char *name, u32 *iopgd)
 
        spin_lock(&obj->iommu_lock);
 
-       /* an iommu device can only be attached once */
-       if (++obj->refcount > 1) {
-               dev_err(dev, "%s: already attached!\n", obj->name);
-               err = -EBUSY;
-               goto err_enable;
-       }
-
        obj->iopgd = iopgd;
        err = iommu_enable(obj);
        if (err)
                goto err_enable;
        flush_iotlb_all(obj);
 
-       if (!try_module_get(obj->owner)) {
-               err = -ENODEV;
-               goto err_module;
-       }
-
        spin_unlock(&obj->iommu_lock);
 
        dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
        return obj;
 
-err_module:
-       if (obj->refcount == 1)
-               iommu_disable(obj);
 err_enable:
-       obj->refcount--;
        spin_unlock(&obj->iommu_lock);
        return ERR_PTR(err);
 }
@@ -937,11 +913,7 @@ static void omap_iommu_detach(struct omap_iommu *obj)
 
        spin_lock(&obj->iommu_lock);
 
-       if (--obj->refcount == 0)
-               iommu_disable(obj);
-
-       module_put(obj->owner);
-
+       iommu_disable(obj);
        obj->iopgd = NULL;
 
        spin_unlock(&obj->iommu_lock);
@@ -1260,14 +1232,13 @@ omap_iommu_attach_dev(struct iommu_domain *domain, struct device *dev)
        int ret = 0;
        int i;
 
-       spin_lock(&omap_domain->lock);
-
-       if (!arch_data) {
+       if (!arch_data || !arch_data->name) {
                dev_err(dev, "device doesn't have an associated iommu\n");
-               ret = -EINVAL;
-               goto out;
+               return -EINVAL;
        }
 
+       spin_lock(&omap_domain->lock);
+
        /* only a single client device can be attached to a domain */
        if (omap_domain->attached) {
                dev_err(dev, "iommu domain is already attached\n");
@@ -1308,6 +1279,7 @@ attach_fail:
                omap_iommu_detach(oiommu);
                iommu->iommu_dev = NULL;
                arch_data->iommu_dev = NULL;
+               oiommu->domain = NULL;
        };
 init_fail:
        omap_iommu_detach_fini(omap_domain);
@@ -1348,6 +1320,7 @@ static void _omap_iommu_detach_dev(struct omap_iommu_domain *omap_domain,
                omap_iommu_detach(oiommu);
                iommu->iommu_dev = NULL;
                arch_data->iommu_dev = NULL;
+               oiommu->domain = NULL;
        }
 
        omap_iommu_detach_fini(omap_domain);
index a0efe7bae016d3bef87699a44d372e2a291d9b60..c1c0d824c79b59cd1c3c1975ce65031bfd3a50f7 100644 (file)
@@ -10,6 +10,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef _OMAP_IOMMU_H
+#define _OMAP_IOMMU_H
+
 #if defined(CONFIG_ARCH_OMAP1)
 #error "iommu for this processor not implemented yet"
 #endif
@@ -28,14 +31,12 @@ struct iotlb_entry {
 
 struct omap_iommu {
        const char      *name;
-       struct module   *owner;
        void __iomem    *regbase;
        void __iomem    *syscfgbase;
        struct device   *dev;
        void            *isr_priv;
        struct iommu_domain *domain;
 
-       unsigned int    refcount;
        spinlock_t      iommu_lock;     /* global for this whole object */
 
        /*
@@ -77,8 +78,6 @@ struct cr_regs {
 
 /* architecture specific functions */
 struct iommu_functions {
-       unsigned long   version;
-
        int (*enable)(struct omap_iommu *obj);
        void (*disable)(struct omap_iommu *obj);
        void (*set_twl)(struct omap_iommu *obj, bool on);
@@ -102,7 +101,6 @@ struct iommu_functions {
        ssize_t (*dump_ctx)(struct omap_iommu *obj, char *buf, ssize_t len);
 };
 
-#ifdef CONFIG_IOMMU_API
 /**
  * dev_to_omap_iommu() - retrieves an omap iommu object from a user device
  * @dev: iommu client device
@@ -113,7 +111,6 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
 
        return arch_data->iommu_dev;
 }
-#endif
 
 /*
  * MMU Register offsets
@@ -210,16 +207,11 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct device *dev)
 /*
  * global functions
  */
-extern u32 omap_iommu_arch_version(void);
-
 extern void omap_iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e);
 
 extern int
 omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e);
 
-extern void omap_iommu_save_ctx(struct device *dev);
-extern void omap_iommu_restore_ctx(struct device *dev);
-
 extern int omap_foreach_iommu_device(void *data,
                                int (*fn)(struct device *, void *));
 
@@ -243,3 +235,5 @@ static inline void iommu_write_reg(struct omap_iommu *obj, u32 val, size_t offs)
 {
        __raw_writel(val, obj->regbase + offs);
 }
+
+#endif /* _OMAP_IOMMU_H */
index 570643d2d5701c00b74ef95434b49a48494cdd32..8234752872352437f5bcc11ca83f34bcf66fb895 100644 (file)
@@ -26,8 +26,6 @@
 /*
  * omap2 architecture specific register bit definitions
  */
-#define IOMMU_ARCH_VERSION     0x00000011
-
 /* IRQSTATUS & IRQENABLE */
 #define MMU_IRQ_MULTIHITFAULT  (1 << 4)
 #define MMU_IRQ_TABLEWALKFAULT (1 << 3)
         ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 :    \
         ((pgsz) == MMU_CAM_PGSZ_4K)  ? 0xfffff000 : 0)
 
-/* IOMMU errors */
-#define OMAP_IOMMU_ERR_TLB_MISS                (1 << 0)
-#define OMAP_IOMMU_ERR_TRANS_FAULT     (1 << 1)
-#define OMAP_IOMMU_ERR_EMU_MISS                (1 << 2)
-#define OMAP_IOMMU_ERR_TBLWALK_FAULT   (1 << 3)
-#define OMAP_IOMMU_ERR_MULTIHIT_FAULT  (1 << 4)
-
 static void dra7_cfg_dspsys_mmu(struct omap_iommu *obj, bool enable)
 {
        u32 val, mask;
@@ -144,7 +135,6 @@ static void omap2_iommu_set_twl(struct omap_iommu *obj, bool on)
 static u32 omap2_iommu_fault_isr(struct omap_iommu *obj, u32 *ra)
 {
        u32 stat, da;
-       u32 errs = 0;
 
        stat = iommu_read_reg(obj, MMU_IRQSTATUS);
        stat &= MMU_IRQ_MASK;
@@ -156,19 +146,9 @@ static u32 omap2_iommu_fault_isr(struct omap_iommu *obj, u32 *ra)
        da = iommu_read_reg(obj, MMU_FAULT_AD);
        *ra = da;
 
-       if (stat & MMU_IRQ_TLBMISS)
-               errs |= OMAP_IOMMU_ERR_TLB_MISS;
-       if (stat & MMU_IRQ_TRANSLATIONFAULT)
-               errs |= OMAP_IOMMU_ERR_TRANS_FAULT;
-       if (stat & MMU_IRQ_EMUMISS)
-               errs |= OMAP_IOMMU_ERR_EMU_MISS;
-       if (stat & MMU_IRQ_TABLEWALKFAULT)
-               errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT;
-       if (stat & MMU_IRQ_MULTIHITFAULT)
-               errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT;
        iommu_write_reg(obj, stat, MMU_IRQSTATUS);
 
-       return errs;
+       return stat;
 }
 
 static void omap2_tlb_read_cr(struct omap_iommu *obj, struct cr_regs *cr)
@@ -288,8 +268,6 @@ static void omap2_iommu_save_ctx(struct omap_iommu *obj)
                p[i] = iommu_read_reg(obj, i * sizeof(u32));
                dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
        }
-
-       BUG_ON(p[0] != IOMMU_ARCH_VERSION);
 }
 
 static void omap2_iommu_restore_ctx(struct omap_iommu *obj)
@@ -301,8 +279,6 @@ static void omap2_iommu_restore_ctx(struct omap_iommu *obj)
                iommu_write_reg(obj, p[i], i * sizeof(u32));
                dev_dbg(obj->dev, "%s\t[%02d] %08x\n", __func__, i, p[i]);
        }
-
-       BUG_ON(p[0] != IOMMU_ARCH_VERSION);
 }
 
 static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
@@ -317,8 +293,6 @@ static void omap2_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e)
 }
 
 static const struct iommu_functions omap2_iommu_ops = {
-       .version        = IOMMU_ARCH_VERSION,
-
        .enable         = omap2_iommu_enable,
        .disable        = omap2_iommu_disable,
        .set_twl        = omap2_iommu_set_twl,
index e87a2485468f27813ba82da1bde89cb810a243c3..f461014d077833838b4b3b58ea30ec02408bb520 100644 (file)
@@ -87,8 +87,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
                spin_lock_irq(&tsadc->reg_lock);
                finish_wait(&tsadc->reg_se_wait, &wait);
 
+               /*
+                * Sequencer should either be idle or
+                * busy applying the charge step.
+                */
                reg = tscadc_readl(tsadc, REG_ADCFSM);
-               WARN_ON(reg & SEQ_STATUS);
+               WARN_ON(reg & SEQ_STATUS & (!CHARGE_STEP));
                tsadc->adc_waiting = false;
        }
        tsadc->adc_in_use = true;
@@ -97,7 +101,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
 void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
 {
        spin_lock_irq(&tsadc->reg_lock);
-       tsadc->reg_se_cache |= val;
        am335x_tscadc_need_adc(tsadc);
 
        tscadc_writel(tsadc, REG_SE, val);
index f19ab1acde1f22dedaf700e5dd8919bebf33f2c4..96042b17d58412189f1a0cd2614b894fb40acfb8 100644 (file)
 #include "mtd_test.h"
 
 static int dev = -EINVAL;
+static int bitflip_limit;
 module_param(dev, int, S_IRUGO);
 MODULE_PARM_DESC(dev, "MTD device number to use");
+module_param(bitflip_limit, int, S_IRUGO);
+MODULE_PARM_DESC(bitflip_limit, "Max. allowed bitflips per page");
 
 static struct mtd_info *mtd;
 static unsigned char *readbuf;
@@ -115,12 +118,35 @@ static int write_whole_device(void)
        return 0;
 }
 
+/* Display the address, offset and data bytes at comparison failure */
+static size_t memcmpshow(loff_t addr, const void *cs, const void *ct, size_t count)
+{
+       const unsigned char *su1, *su2;
+       int res;
+       int ret = 0;
+       size_t i = 0;
+       size_t bitflips = 0;
+
+       for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--, i++) {
+               res = *su1 ^ *su2;
+               if (res) {
+                       pr_info("error @addr[0x%lx:0x%x] 0x%x -> 0x%x diff 0x%x\n",
+                               (unsigned long)addr, i, *su1, *su2, res);
+                       bitflips += hweight8(res);
+                       ret = 1;
+               }
+       }
+
+       return bitflips;
+}
+
 static int verify_eraseblock(int ebnum)
 {
        int i;
        struct mtd_oob_ops ops;
        int err = 0;
        loff_t addr = ebnum * mtd->erasesize;
+       size_t bitflips;
 
        prandom_bytes_state(&rnd_state, writebuf, use_len_max * pgcnt);
        for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
@@ -139,15 +165,19 @@ static int verify_eraseblock(int ebnum)
                        errcnt += 1;
                        return err ? err : -1;
                }
-               if (memcmp(readbuf, writebuf + (use_len_max * i) + use_offset,
-                          use_len)) {
-                       pr_err("error: verify failed at %#llx\n",
-                              (long long)addr);
+               bitflips = memcmpshow(addr, readbuf,
+                                     writebuf + (use_len_max * i) + use_offset,
+                                     use_len);
+               if (bitflips > bitflip_limit) {
+                       pr_err("error: verify failed at block %d addr %#llx\n",
+                              ebnum, (long long)addr);
                        errcnt += 1;
                        if (errcnt > 1000) {
                                pr_err("error: too many errors\n");
                                return -1;
                        }
+               } else if (bitflips) {
+                       pr_info("ignoring error as within bitflip limit\n");
                }
                if (use_offset != 0 || use_len < mtd->ecclayout->oobavail) {
                        int k;
@@ -167,9 +197,10 @@ static int verify_eraseblock(int ebnum)
                                errcnt += 1;
                                return err ? err : -1;
                        }
-                       if (memcmp(readbuf + use_offset,
-                                  writebuf + (use_len_max * i) + use_offset,
-                                  use_len)) {
+                       bitflips = memcmpshow(addr, readbuf + use_offset,
+                                             writebuf + (use_len_max * i) + use_offset,
+                                             use_len);
+                       if (bitflips > bitflip_limit) {
                                pr_err("error: verify failed at %#llx\n",
                                                (long long)addr);
                                errcnt += 1;
@@ -177,6 +208,8 @@ static int verify_eraseblock(int ebnum)
                                        pr_err("error: too many errors\n");
                                        return -1;
                                }
+                       } else if (bitflips) {
+                               pr_info("ignoring error as within bitflip limit\n");
                        }
                        for (k = 0; k < use_offset; ++k)
                                if (readbuf[k] != 0xff) {
@@ -216,6 +249,9 @@ static int verify_eraseblock_in_one_go(int ebnum)
        int err = 0;
        loff_t addr = ebnum * mtd->erasesize;
        size_t len = mtd->ecclayout->oobavail * pgcnt;
+       size_t oobavail = mtd->ecclayout->oobavail;
+       size_t bitflips;
+       int i;
 
        prandom_bytes_state(&rnd_state, writebuf, len);
        ops.mode      = MTD_OPS_AUTO_OOB;
@@ -226,6 +262,8 @@ static int verify_eraseblock_in_one_go(int ebnum)
        ops.ooboffs   = 0;
        ops.datbuf    = NULL;
        ops.oobbuf    = readbuf;
+
+       /* read entire block at one go */
        err = mtd_read_oob(mtd, addr, &ops);
        if (err || ops.oobretlen != len) {
                pr_err("error: readoob failed at %#llx\n",
@@ -233,13 +271,21 @@ static int verify_eraseblock_in_one_go(int ebnum)
                errcnt += 1;
                return err ? err : -1;
        }
-       if (memcmp(readbuf, writebuf, len)) {
-               pr_err("error: verify failed at %#llx\n",
-                      (long long)addr);
-               errcnt += 1;
-               if (errcnt > 1000) {
-                       pr_err("error: too many errors\n");
-                       return -1;
+
+       /* verify one page at a time for bitflip per page limit check */
+       for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
+               bitflips = memcmpshow(addr, readbuf + (i * oobavail),
+                                     writebuf + (i * oobavail), oobavail);
+               if (bitflips > bitflip_limit) {
+                       pr_err("error: verify failed at block %d addr %#llx\n",
+                              ebnum, (long long)addr);
+                       errcnt += 1;
+                       if (errcnt > 1000) {
+                               pr_err("error: too many errors\n");
+                               return -1;
+                       }
+               } else if (bitflips) {
+                       pr_info("ignoring error as within bitflip limit\n");
                }
        }
 
@@ -304,9 +350,10 @@ static int __init mtd_oobtest_init(void)
 
        pr_info("MTD device size %llu, eraseblock size %u, "
               "page size %u, count of eraseblocks %u, pages per "
-              "eraseblock %u, OOB size %u\n",
+              "eraseblock %u, OOB size %u, OOB available %u\n",
               (unsigned long long)mtd->size, mtd->erasesize,
-              mtd->writesize, ebcnt, pgcnt, mtd->oobsize);
+              mtd->writesize, ebcnt, pgcnt, mtd->oobsize,
+              mtd->ecclayout->oobavail);
 
        err = -ENOMEM;
        readbuf = kmalloc(mtd->erasesize, GFP_KERNEL);
@@ -610,7 +657,8 @@ static int __init mtd_oobtest_init(void)
                err = mtd_read_oob(mtd, addr, &ops);
                if (err)
                        goto out;
-               if (memcmp(readbuf, writebuf, mtd->ecclayout->oobavail * 2)) {
+               if (memcmpshow(addr, readbuf, writebuf,
+                              mtd->ecclayout->oobavail * 2)) {
                        pr_err("error: verify failed at %#llx\n",
                               (long long)addr);
                        errcnt += 1;
index fdc222d0966628b7abe0dc2ab191ac57dfa44f0a..a71ae213370c40a8d4c956f653cd1ff28943021a 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/of_device.h>
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <linux/can/dev.h>
 
index 53150c25a96bd455f58dc30ca3c592b6a598461e..adfc87cfa5dc6acdd16fbe6d01e5cad12340187a 100644 (file)
@@ -5,7 +5,7 @@
 config NET_VENDOR_TI
        bool "Texas Instruments (TI) devices"
        default y
-       depends on PCI || EISA || AR7 || (ARM && (ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX))
+       depends on PCI || EISA || AR7 || (ARM && (ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX || SOC_AM43XX))
        ---help---
          If you have a network (Ethernet) card belonging to this class, say Y
          and read the Ethernet-HOWTO, available from
@@ -32,7 +32,7 @@ config TI_DAVINCI_EMAC
 
 config TI_DAVINCI_MDIO
        tristate "TI DaVinci MDIO Support"
-       depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX )
+       depends on ARM && (ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX || SOC_AM43XX)
        select PHYLIB
        ---help---
          This driver supports TI's DaVinci MDIO module.
@@ -42,7 +42,7 @@ config TI_DAVINCI_MDIO
 
 config TI_DAVINCI_CPDMA
        tristate "TI DaVinci CPDMA Support"
-       depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX )
+       depends on ARM && (ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX || SOC_AM43XX)
        ---help---
          This driver supports TI's DaVinci CPDMA dma engine.
 
@@ -58,7 +58,7 @@ config TI_CPSW_PHY_SEL
 
 config TI_CPSW
        tristate "TI CPSW Switch Support"
-       depends on ARM && (ARCH_DAVINCI || SOC_AM33XX)
+       depends on ARM && (ARCH_DAVINCI || SOC_AM33XX || SOC_AM43XX)
        select TI_DAVINCI_CPDMA
        select TI_DAVINCI_MDIO
        select TI_CPSW_PHY_SEL
index 22f2f2857b820675950fdd11f34470789cf81ff0..466b78c7a8be832296e8adfc1f6088beea672f65 100644 (file)
@@ -199,7 +199,7 @@ config PWM_TEGRA
 
 config  PWM_TIECAP
        tristate "ECAP PWM support"
-       depends on SOC_AM33XX || ARCH_DAVINCI_DA8XX
+       depends on SOC_AM43XX || SOC_AM33XX || ARCH_DAVINCI_DA8XX
        help
          PWM driver support for the ECAP APWM controller found on AM33XX
          TI SOC
@@ -209,7 +209,7 @@ config  PWM_TIECAP
 
 config  PWM_TIEHRPWM
        tristate "EHRPWM PWM support"
-       depends on SOC_AM33XX || ARCH_DAVINCI_DA8XX
+       depends on SOC_AM43XX || SOC_AM33XX || ARCH_DAVINCI_DA8XX
        help
          PWM driver support for the EHRPWM controller found on AM33XX
          TI SOC
@@ -219,7 +219,7 @@ config  PWM_TIEHRPWM
 
 config  PWM_TIPWMSS
        bool
-       default y if SOC_AM33XX && (PWM_TIECAP || PWM_TIEHRPWM)
+       default y if (SOC_AM43XX || SOC_AM33XX) && (PWM_TIECAP || PWM_TIEHRPWM)
        help
          PWM Subsystem driver support for AM33xx SOC.
 
index 8f6d4b1b6e17a479f366a75e4089dfb97b8ea03e..fc79e27406ddcefd671db33773ced27a3a35bd3f 100644 (file)
@@ -826,50 +826,6 @@ static int dwc3_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int dwc3_prepare(struct device *dev)
-{
-       struct dwc3     *dwc = dev_get_drvdata(dev);
-       unsigned long   flags;
-
-       spin_lock_irqsave(&dwc->lock, flags);
-
-       switch (dwc->dr_mode) {
-       case USB_DR_MODE_PERIPHERAL:
-       case USB_DR_MODE_OTG:
-               dwc3_gadget_prepare(dwc);
-               /* FALLTHROUGH */
-       case USB_DR_MODE_HOST:
-       default:
-               dwc3_event_buffers_cleanup(dwc);
-               break;
-       }
-
-       spin_unlock_irqrestore(&dwc->lock, flags);
-
-       return 0;
-}
-
-static void dwc3_complete(struct device *dev)
-{
-       struct dwc3     *dwc = dev_get_drvdata(dev);
-       unsigned long   flags;
-
-       spin_lock_irqsave(&dwc->lock, flags);
-
-       dwc3_event_buffers_setup(dwc);
-       switch (dwc->dr_mode) {
-       case USB_DR_MODE_PERIPHERAL:
-       case USB_DR_MODE_OTG:
-               dwc3_gadget_complete(dwc);
-               /* FALLTHROUGH */
-       case USB_DR_MODE_HOST:
-       default:
-               break;
-       }
-
-       spin_unlock_irqrestore(&dwc->lock, flags);
-}
-
 static int dwc3_suspend(struct device *dev)
 {
        struct dwc3     *dwc = dev_get_drvdata(dev);
@@ -884,7 +840,7 @@ static int dwc3_suspend(struct device *dev)
                /* FALLTHROUGH */
        case USB_DR_MODE_HOST:
        default:
-               /* do nothing */
+               dwc3_event_buffers_cleanup(dwc);
                break;
        }
 
@@ -918,6 +874,7 @@ static int dwc3_resume(struct device *dev)
        spin_lock_irqsave(&dwc->lock, flags);
 
        dwc3_writel(dwc->regs, DWC3_GCTL, dwc->gctl);
+       dwc3_event_buffers_setup(dwc);
 
        switch (dwc->dr_mode) {
        case USB_DR_MODE_PERIPHERAL:
@@ -945,9 +902,6 @@ err_usb2phy_init:
 }
 
 static const struct dev_pm_ops dwc3_dev_pm_ops = {
-       .prepare        = dwc3_prepare,
-       .complete       = dwc3_complete,
-
        SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume)
 };
 
index e453d6b968dce0c5d5594fb6e4cedeae0d357796..e5699b3529de2e37627f0409a9d7ba5efc92df6d 100644 (file)
 #define DWC3_GHWPARAMS4_HIBER_SCRATCHBUFS(n)   (((n) & (0x0f << 13)) >> 13)
 #define DWC3_MAX_HIBER_SCRATCHBUFS             15
 
+/* Global FIFO Space Register */
+#define DWC3_GDBGFIFOSPACE_TXFIFO              (0 << 5)
+#define DWC3_GDBGFIFOSPACE_RXFIFO              (1 << 5)
+#define DWC3_GDBGFIFOSPACE_TXREQ_Q             (2 << 5)
+#define DWC3_GDBGFIFOSPACE_RXREQ_Q             (3 << 5)
+
+#define DWC3_GDBGFIFOSPACE_SPACE_AVAIL(num)    (((num) & 0xffff0000) >> 16)
+
 /* Device Configuration Register */
 #define DWC3_DCFG_DEVADDR(addr)        ((addr) << 3)
 #define DWC3_DCFG_DEVADDR_MASK DWC3_DCFG_DEVADDR(0x7f)
@@ -947,20 +955,9 @@ static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
 
 /* power management interface */
 #if !IS_ENABLED(CONFIG_USB_DWC3_HOST)
-int dwc3_gadget_prepare(struct dwc3 *dwc);
-void dwc3_gadget_complete(struct dwc3 *dwc);
 int dwc3_gadget_suspend(struct dwc3 *dwc);
 int dwc3_gadget_resume(struct dwc3 *dwc);
 #else
-static inline int dwc3_gadget_prepare(struct dwc3 *dwc)
-{
-       return 0;
-}
-
-static inline void dwc3_gadget_complete(struct dwc3 *dwc)
-{
-}
-
 static inline int dwc3_gadget_suspend(struct dwc3 *dwc)
 {
        return 0;
index 72c0799c737b2c3d439a0e4285bc233f232aebc1..ddcf31d3d9a4f6c1192e517b5ef6fd8ed6254832 100644 (file)
@@ -604,38 +604,12 @@ static const struct of_device_id of_dwc3_match[] = {
 MODULE_DEVICE_TABLE(of, of_dwc3_match);
 
 #ifdef CONFIG_PM_SLEEP
-static int dwc3_omap_prepare(struct device *dev)
-{
-       struct dwc3_omap        *omap = dev_get_drvdata(dev);
-
-       dwc3_omap_write_irqmisc_set(omap, 0x00);
-
-       return 0;
-}
-
-static void dwc3_omap_complete(struct device *dev)
-{
-       struct dwc3_omap        *omap = dev_get_drvdata(dev);
-       u32                     reg;
-
-       reg = (USBOTGSS_IRQMISC_OEVT |
-                       USBOTGSS_IRQMISC_DRVVBUS_RISE |
-                       USBOTGSS_IRQMISC_CHRGVBUS_RISE |
-                       USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
-                       USBOTGSS_IRQMISC_IDPULLUP_RISE |
-                       USBOTGSS_IRQMISC_DRVVBUS_FALL |
-                       USBOTGSS_IRQMISC_CHRGVBUS_FALL |
-                       USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
-                       USBOTGSS_IRQMISC_IDPULLUP_FALL);
-
-       dwc3_omap_write_irqmisc_set(omap, reg);
-}
-
 static int dwc3_omap_suspend(struct device *dev)
 {
        struct dwc3_omap        *omap = dev_get_drvdata(dev);
 
        omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap);
+       dwc3_omap_disable_irqs(omap);
 
        return 0;
 }
@@ -645,6 +619,7 @@ static int dwc3_omap_resume(struct device *dev)
        struct dwc3_omap        *omap = dev_get_drvdata(dev);
 
        dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
+       dwc3_omap_enable_irqs(omap);
 
        pm_runtime_disable(dev);
        pm_runtime_set_active(dev);
@@ -654,9 +629,6 @@ static int dwc3_omap_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
-       .prepare        = dwc3_omap_prepare,
-       .complete       = dwc3_omap_complete,
-
        SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
 };
 
index 21a352079bc25fdd0fe33ddba1a3191b29b812f0..dbf3d332f2adb836ce1fe16aa79788745f29b5d3 100644 (file)
@@ -251,7 +251,7 @@ static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
 
        /* stall is always issued on EP0 */
        dep = dwc->eps[0];
-       __dwc3_gadget_ep_set_halt(dep, 1);
+       __dwc3_gadget_ep_set_halt(dep, 1, false);
        dep->flags = DWC3_EP_ENABLED;
        dwc->delayed_status = false;
 
@@ -266,7 +266,7 @@ static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
        dwc3_ep0_out_start(dwc);
 }
 
-int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
+int __dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
 {
        struct dwc3_ep                  *dep = to_dwc3_ep(ep);
        struct dwc3                     *dwc = dep->dwc;
@@ -276,6 +276,20 @@ int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
        return 0;
 }
 
+int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
+{
+       struct dwc3_ep                  *dep = to_dwc3_ep(ep);
+       struct dwc3                     *dwc = dep->dwc;
+       unsigned long                   flags;
+       int                             ret;
+
+       spin_lock_irqsave(&dwc->lock, flags);
+       ret = __dwc3_gadget_ep0_set_halt(ep, value);
+       spin_unlock_irqrestore(&dwc->lock, flags);
+
+       return ret;
+}
+
 void dwc3_ep0_out_start(struct dwc3 *dwc)
 {
        int                             ret;
@@ -461,7 +475,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
                                return -EINVAL;
                        if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
                                break;
-                       ret = __dwc3_gadget_ep_set_halt(dep, set);
+                       ret = __dwc3_gadget_ep_set_halt(dep, set, true);
                        if (ret)
                                return -EINVAL;
                        break;
@@ -767,9 +781,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 
        dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS;
 
-       r = next_request(&ep0->request_list);
-       ur = &r->request;
-
        trb = dwc->ep0_trb;
 
        status = DWC3_TRB_SIZE_TRBSTS(trb->size);
@@ -782,6 +793,12 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
                return;
        }
 
+       r = next_request(&ep0->request_list);
+       if (!r)
+               return;
+
+       ur = &r->request;
+
        length = trb->size & DWC3_TRB_SIZE_MASK;
 
        if (dwc->ep0_bounced) {
@@ -803,12 +820,18 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 
                dwc3_ep0_stall_and_restart(dwc);
        } else {
-               /*
-                * handle the case where we have to send a zero packet. This
-                * seems to be case when req.length > maxpacket. Could it be?
-                */
-               if (r)
-                       dwc3_gadget_giveback(ep0, r, 0);
+               dwc3_gadget_giveback(ep0, r, 0);
+
+               if (IS_ALIGNED(ur->length, ep0->endpoint.maxpacket)) {
+                       int ret;
+
+                       dwc->ep0_next_event = DWC3_EP0_COMPLETE;
+
+                       ret = dwc3_ep0_start_trans(dwc, epnum,
+                                       dwc->ctrl_req_addr, 0,
+                                       DWC3_TRBCTL_CONTROL_DATA);
+                       WARN_ON(ret < 0);
+               }
        }
 }
 
index 14a4b97d5785d59db1f12de8e80def4dd9120617..7f196374ea7d96022283be4c9e79f1e31ebe92aa 100644 (file)
@@ -665,7 +665,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
 
        /* make sure HW endpoint isn't stalled */
        if (dep->flags & DWC3_EP_STALL)
-               __dwc3_gadget_ep_set_halt(dep, 0);
+               __dwc3_gadget_ep_set_halt(dep, 0, false);
 
        reg = dwc3_readl(dwc->regs, DWC3_DALEPENA);
        reg &= ~DWC3_DALEPENA_EP(dep->number);
@@ -1281,15 +1281,28 @@ out0:
        return ret;
 }
 
-int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
+int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol)
 {
        struct dwc3_gadget_ep_cmd_params        params;
        struct dwc3                             *dwc = dep->dwc;
        int                                     ret;
 
+       if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
+               dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name);
+               return -EINVAL;
+       }
+
        memset(&params, 0x00, sizeof(params));
 
        if (value) {
+               if (!protocol && ((dep->direction && dep->flags & DWC3_EP_BUSY) ||
+                               (!list_empty(&dep->req_queued) ||
+                                !list_empty(&dep->request_list)))) {
+                       dev_dbg(dwc->dev, "%s: pending request, cannot halt\n",
+                                       dep->name);
+                       return -EAGAIN;
+               }
+
                ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
                        DWC3_DEPCMD_SETSTALL, &params);
                if (ret)
@@ -1320,15 +1333,7 @@ static int dwc3_gadget_ep_set_halt(struct usb_ep *ep, int value)
        int                             ret;
 
        spin_lock_irqsave(&dwc->lock, flags);
-
-       if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
-               dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name);
-               ret = -EINVAL;
-               goto out;
-       }
-
-       ret = __dwc3_gadget_ep_set_halt(dep, value);
-out:
+       ret = __dwc3_gadget_ep_set_halt(dep, value, false);
        spin_unlock_irqrestore(&dwc->lock, flags);
 
        return ret;
@@ -1339,15 +1344,18 @@ static int dwc3_gadget_ep_set_wedge(struct usb_ep *ep)
        struct dwc3_ep                  *dep = to_dwc3_ep(ep);
        struct dwc3                     *dwc = dep->dwc;
        unsigned long                   flags;
+       int                             ret;
 
        spin_lock_irqsave(&dwc->lock, flags);
        dep->flags |= DWC3_EP_WEDGE;
-       spin_unlock_irqrestore(&dwc->lock, flags);
 
        if (dep->number == 0 || dep->number == 1)
-               return dwc3_gadget_ep0_set_halt(ep, 1);
+               ret = __dwc3_gadget_ep0_set_halt(ep, 1);
        else
-               return dwc3_gadget_ep_set_halt(ep, 1);
+               ret = __dwc3_gadget_ep_set_halt(dep, 1, false);
+       spin_unlock_irqrestore(&dwc->lock, flags);
+
+       return ret;
 }
 
 /* -------------------------------------------------------------------------- */
@@ -2827,26 +2835,15 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
                        dwc->ctrl_req, dwc->ctrl_req_addr);
 }
 
-int dwc3_gadget_prepare(struct dwc3 *dwc)
+int dwc3_gadget_suspend(struct dwc3 *dwc)
 {
        if (dwc->pullups_connected) {
                dwc3_gadget_disable_irq(dwc);
-               dwc3_gadget_run_stop(dwc, true, true);
-       }
-
-       return 0;
-}
-
-void dwc3_gadget_complete(struct dwc3 *dwc)
-{
-       if (dwc->pullups_connected) {
-               dwc3_gadget_enable_irq(dwc);
-               dwc3_gadget_run_stop(dwc, true, false);
+               dwc3_gadget_run_stop(dwc, false, true);
+               /* remember to connect back on resume */
+               dwc->pullups_connected = true;
        }
-}
 
-int dwc3_gadget_suspend(struct dwc3 *dwc)
-{
        __dwc3_gadget_ep_disable(dwc->eps[0]);
        __dwc3_gadget_ep_disable(dwc->eps[1]);
 
@@ -2879,6 +2876,11 @@ int dwc3_gadget_resume(struct dwc3 *dwc)
 
        dwc3_writel(dwc->regs, DWC3_DCFG, dwc->dcfg);
 
+       if (dwc->pullups_connected) {
+               dwc3_gadget_enable_irq(dwc);
+               dwc3_gadget_run_stop(dwc, true, false);
+       }
+
        return 0;
 
 err1:
index a0ee75b68a803bd74d40a925930ff6767c29c392..9b68577105ee2ea5baf8c69dcdc28edc2d58f43c 100644 (file)
@@ -82,10 +82,11 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
 void dwc3_ep0_interrupt(struct dwc3 *dwc,
                const struct dwc3_event_depevt *event);
 void dwc3_ep0_out_start(struct dwc3 *dwc);
+int __dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value);
 int dwc3_gadget_ep0_set_halt(struct usb_ep *ep, int value);
 int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
                gfp_t gfp_flags);
-int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value);
+int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol);
 
 /**
  * dwc3_gadget_ep_get_transfer_index - Gets transfer index from HW
index a82fa6703b310bd0d0f9e53e0b01f23e49f493a7..310f4fd731231513401619441f178a15d35a19e5 100644 (file)
@@ -861,8 +861,13 @@ static int dsps_suspend(struct device *dev)
        struct dsps_glue *glue = dev_get_drvdata(dev);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
        struct musb *musb = platform_get_drvdata(glue->musb);
-       void __iomem *mbase = musb->ctrl_base;
+       void __iomem *mbase;
 
+       if (!musb)
+               /* This can happen if musb is still defered */
+               return 0;
+
+       mbase = musb->ctrl_base;
        del_timer_sync(&glue->timer);
        glue->context.control = dsps_readl(mbase, wrp->control);
        glue->context.epintr = dsps_readl(mbase, wrp->epintr_set);
@@ -880,8 +885,12 @@ static int dsps_resume(struct device *dev)
        struct dsps_glue *glue = dev_get_drvdata(dev);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
        struct musb *musb = platform_get_drvdata(glue->musb);
-       void __iomem *mbase = musb->ctrl_base;
+       void __iomem *mbase;
+
+       if (!musb)
+               return 0;
 
+       mbase = musb->ctrl_base;
        dsps_writel(mbase, wrp->control, glue->context.control);
        dsps_writel(mbase, wrp->epintr_set, glue->context.epintr);
        dsps_writel(mbase, wrp->coreintr_set, glue->context.coreintr);
index 3343298e40e83453e84dad4d8704af95ef57b5f7..a9eeb4f73ea1b7ae54a1046172ff5953b68bd2d9 100644 (file)
@@ -26,6 +26,7 @@
 #define HWLOCK_IRQ     0x02    /* Disable interrupts, don't save state */
 
 struct device;
+struct device_node;
 struct hwspinlock;
 struct hwspinlock_device;
 struct hwspinlock_ops;
@@ -60,12 +61,15 @@ struct hwspinlock_pdata {
 
 #if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
 
+int of_hwspin_lock_get_base_id(struct device_node *dn);
+int of_hwspin_lock_get_num_locks(struct device_node *dn);
 int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
                const struct hwspinlock_ops *ops, int base_id, int num_locks);
 int hwspin_lock_unregister(struct hwspinlock_device *bank);
 struct hwspinlock *hwspin_lock_request(void);
 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
 int hwspin_lock_free(struct hwspinlock *hwlock);
+int of_hwspin_lock_get_id(struct device_node *np, int index);
 int hwspin_lock_get_id(struct hwspinlock *hwlock);
 int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
                                                        unsigned long *);
@@ -80,9 +84,9 @@ void __hwspin_unlock(struct hwspinlock *, int, unsigned long *);
  * code path get compiled away. This way, if CONFIG_HWSPINLOCK is not
  * required on a given setup, users will still work.
  *
- * The only exception is hwspin_lock_register/hwspin_lock_unregister, with which
- * we _do_ want users to fail (no point in registering hwspinlock instances if
- * the framework is not available).
+ * The only exception is hwspin_lock_register/hwspin_lock_unregister and
+ * associated OF helpers, with which we _do_ want users to fail (no point
+ * in registering hwspinlock instances if the framework is not available).
  *
  * Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
  * users. Others, which care, can still check this with IS_ERR.
@@ -120,6 +124,11 @@ void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
 {
 }
 
+static inline int of_hwspin_lock_get_id(struct device_node *np, int index)
+{
+       return 0;
+}
+
 static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
 {
        return 0;
index fb96c84dada50c0f425681e71fff1ca5702aa342..91e9d1b4dd13ce6a4b0df25dd6becc9888f333d5 100644 (file)
@@ -52,6 +52,7 @@
 
 /* IRQ enable */
 #define IRQENB_HW_PEN          BIT(0)
+#define IRQENB_EOS             BIT(1)
 #define IRQENB_FIFO0THRES      BIT(2)
 #define IRQENB_FIFO0OVRRUN     BIT(3)
 #define IRQENB_FIFO0UNDRFLW    BIT(4)
 /* Charge delay */
 #define CHARGEDLY_OPEN_MASK    (0x3FFFF << 0)
 #define CHARGEDLY_OPEN(val)    ((val) << 0)
-#define CHARGEDLY_OPENDLY      CHARGEDLY_OPEN(1)
+#define CHARGEDLY_OPENDLY      CHARGEDLY_OPEN(0x400)
 
 /* Control register */
 #define CNTRLREG_TSCSSENB      BIT(0)
 
 /* Sequencer Status */
 #define SEQ_STATUS BIT(5)
+#define CHARGE_STEP            0x11
 
 #define ADC_CLK                        3000000
 #define TOTAL_STEPS            16
diff --git a/ti_config_fragments/am33xx_only.cfg b/ti_config_fragments/am33xx_only.cfg
new file mode 100644 (file)
index 0000000..8c3f1ca
--- /dev/null
@@ -0,0 +1,14 @@
+##################################################
+# TI AM33XX specific config options
+##################################################
+
+# Disable Socs other than AM33xx
+CONFIG_ARCH_OMAP2=n
+CONFIG_ARCH_OMAP3=n
+CONFIG_ARCH_OMAP4=n
+CONFIG_SOC_OMAP5=n
+CONFIG_SOC_AM43XX=n
+CONFIG_SOC_DRA7XX=n
+
+#Disable CONFIG_SMP
+CONFIG_SMP=n
diff --git a/ti_config_fragments/am43xx_only.cfg b/ti_config_fragments/am43xx_only.cfg
new file mode 100644 (file)
index 0000000..fcc1657
--- /dev/null
@@ -0,0 +1,14 @@
+##################################################
+# TI AM43XX specific config options
+##################################################
+
+# Disable Socs other than AM43xx
+CONFIG_ARCH_OMAP2=n
+CONFIG_ARCH_OMAP3=n
+CONFIG_ARCH_OMAP4=n
+CONFIG_SOC_OMAP5=n
+CONFIG_SOC_AM33XX=n
+CONFIG_SOC_DRA7XX=n
+
+#Disable CONFIG_SMP
+CONFIG_SMP=n
index 3c3ac921220cd2709a47b9068472d6ddcff6475f..c1fe5120ade8b5d7a462397362e43c2bf693798e 100644 (file)
@@ -9,3 +9,7 @@ CONFIG_REGULATOR_GPIO=y
 CONFIG_CRYPTO_DEV_OMAP_SHAM=y
 CONFIG_CRYPTO_DEV_OMAP_AES=y
 CONFIG_CRYPTO_DEV_OMAP_DES=y
+CONFIG_CRYPTO_USER_API_HASH=y
+CONFIG_CRYPTO_USER_API_SKCIPHER=y
+
+CONFIG_PREEMPT_VOLUNTARY=y
index 6673376cf7e2bf8eeaaac3b8daf70add91897d3f..e12ba965d65fa86bc6e8a8157eed6daaaf36eac2 100644 (file)
@@ -1,6 +1,9 @@
 ##################################################
 # TI RPMsg config options
 ##################################################
+# HwSpinLock
+CONFIG_HWSPINLOCK_OMAP=y
+
 # Mailbox
 CONFIG_OMAP2PLUS_MBOX=y