Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 3/7] drivers: dma-contiguous: add initialization from device tree
From: Marek Szyprowski @ 2014-02-20 10:52 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linaro-mm-sig, devicetree,
	linux-doc
  Cc: Marek Szyprowski, Benjamin Herrenschmidt, Arnd Bergmann,
	Michal Nazarewicz, Grant Likely, Tomasz Figa, Sascha Hauer,
	Laura Abbott, Rob Herring, Olof Johansson, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Tomasz Figa,
	Kumar Gala, Nishanth Peethambaran, Marc, Josh Cartwright,
	Catalin Marinas, Will Deacon, Paul Mackerras
In-Reply-To: <1392893567-31623-1-git-send-email-m.szyprowski@samsung.com>

Refactor internal dma_contiguous_init_reserved_mem() function, which
creates CMA area from previously reserved memory region and add support
for handling 'shared-dma-pool' reserved-memory device tree nodes.

Based on previous code provided by Josh Cartwright <joshc@codeaurora.org>

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/base/dma-contiguous.c |  130 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 108 insertions(+), 22 deletions(-)

diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 165c2c299e57..5dfcc3743d9b 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -182,6 +182,49 @@ static int __init cma_init_reserved_areas(void)
 core_initcall(cma_init_reserved_areas);
 
 /**
+ * dma_contiguous_init_reserved_mem() - reserve custom contiguous area
+ * @size: Size of the reserved area (in bytes),
+ * @base: Base address of the reserved area optional, use 0 for any
+ * @limit: End address of the reserved memory (optional, 0 for any).
+ * @res_cma: Pointer to store the created cma region.
+ *
+ * This function reserves memory from early allocator. It should be
+ * called by arch specific code once the early allocator (memblock or bootmem)
+ * has been activated and all other subsystems have already allocated/reserved
+ * memory. This function allows to create custom reserved areas for specific
+ * devices.
+ */
+static int __init dma_contiguous_init_reserved_mem(phys_addr_t size,
+					phys_addr_t base, struct cma **res_cma)
+{
+	struct cma *cma = &cma_areas[cma_area_count];
+	phys_addr_t alignment;
+
+	/* Sanity checks */
+	if (cma_area_count == ARRAY_SIZE(cma_areas)) {
+		pr_err("Not enough slots for CMA reserved regions!\n");
+		return -ENOSPC;
+	}
+
+	if (!size || !memblock_is_region_reserved(base, size))
+		return -EINVAL;
+
+	/* Sanitise input arguments */
+	alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
+	if (ALIGN(base, alignment) != base || ALIGN(size, alignment) != size)
+		return -EINVAL;
+
+	cma->base_pfn = PFN_DOWN(base);
+	cma->count = size >> PAGE_SHIFT;
+	*res_cma = cma;
+	cma_area_count++;
+
+	/* Architecture specific contiguous memory fixup. */
+	dma_contiguous_early_fixup(base, size);
+	return 0;
+}
+
+/**
  * dma_contiguous_reserve_area() - reserve custom contiguous area
  * @size: Size of the reserved area (in bytes),
  * @base: Base address of the reserved area optional, use 0 for any
@@ -197,7 +240,6 @@ core_initcall(cma_init_reserved_areas);
 int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
 				       phys_addr_t limit, struct cma **res_cma)
 {
-	struct cma *cma = &cma_areas[cma_area_count];
 	phys_addr_t alignment;
 	int ret = 0;
 
@@ -205,12 +247,6 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
 		 (unsigned long)size, (unsigned long)base,
 		 (unsigned long)limit);
 
-	/* Sanity checks */
-	if (cma_area_count == ARRAY_SIZE(cma_areas)) {
-		pr_err("Not enough slots for CMA reserved regions!\n");
-		return -ENOSPC;
-	}
-
 	if (!size)
 		return -EINVAL;
 
@@ -241,21 +277,12 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
 		}
 	}
 
-	/*
-	 * Each reserved area must be initialised later, when more kernel
-	 * subsystems (like slab allocator) are available.
-	 */
-	cma->base_pfn = PFN_DOWN(base);
-	cma->count = size >> PAGE_SHIFT;
-	*res_cma = cma;
-	cma_area_count++;
-
-	pr_info("CMA: reserved %ld MiB at %08lx\n", (unsigned long)size / SZ_1M,
-		(unsigned long)base);
-
-	/* Architecture specific contiguous memory fixup. */
-	dma_contiguous_early_fixup(base, size);
-	return 0;
+	ret = dma_contiguous_init_reserved_mem(size, base, res_cma);
+	if (ret == 0) {
+		pr_info("CMA: reserved %ld MiB at %08lx\n",
+			(unsigned long)size / SZ_1M, (unsigned long)base);
+		return 0;
+	}
 err:
 	pr_err("CMA: failed to reserve %ld MiB\n", (unsigned long)size / SZ_1M);
 	return ret;
@@ -357,3 +384,62 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages,
 
 	return true;
 }
+
+/*
+ * Support for reserved memory regions defined in device tree
+ */
+#ifdef CONFIG_OF_RESERVED_MEM
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_reserved_mem.h>
+
+#undef pr_fmt
+#define pr_fmt(fmt) fmt
+
+static void rmem_cma_device_init(struct reserved_mem *rmem,
+			 struct device *dev, struct of_phandle_args *args)
+{
+	struct cma *cma = rmem->priv;
+	dev_set_cma_area(dev, cma);
+}
+
+static const struct reserved_mem_ops rmem_cma_ops = {
+	.device_init	= rmem_cma_device_init,
+};
+
+static int __init rmem_cma_setup(struct reserved_mem *rmem,
+				 unsigned long node,
+				 const char *uname)
+{
+	phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
+	phys_addr_t mask = align - 1;
+	struct cma *cma;
+	int err;
+
+	if (!of_get_flat_dt_prop(node, "reusable", NULL))
+		return -EINVAL;
+
+	if ((rmem->base & mask) || (rmem->size & mask)) {
+		pr_err("Reserved memory: incorrect alignment of CMA region\n");
+		return -EINVAL;
+	}
+
+	err = dma_contiguous_init_reserved_mem(rmem->size, rmem->base, &cma);
+	if (err) {
+		pr_err("Reserved memory: unable to setup CMA region\n");
+		return err;
+	}
+
+	if (of_get_flat_dt_prop(node, "linux,cma-default", NULL))
+		dma_contiguous_set_default(cma);
+
+	rmem->ops = &rmem_cma_ops;
+	rmem->priv = cma;
+
+	pr_info("Reserved memory: created CMA memory pool at %pa, size %ld MiB\n",
+		&rmem->base, (unsigned long)rmem->size / SZ_1M);
+
+	return 0;
+}
+RESERVEDMEM_OF_DECLARE(cma, "shared-dma-pool", rmem_cma_setup);
+#endif
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH v4 4/7] of: document bindings for reserved-memory nodes
From: Marek Szyprowski @ 2014-02-20 10:52 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linaro-mm-sig, devicetree,
	linux-doc
  Cc: Mark Rutland, Benjamin Herrenschmidt, Tomasz Figa, Will Deacon,
	Tomasz Figa, Paul Mackerras, Marek Szyprowski, Arnd Bergmann,
	Josh Cartwright, Catalin Marinas, Grant Likely, Laura Abbott,
	Ian Campbell, Pawel Moll, Stephen Warren, Sascha Hauer,
	Michal Nazarewicz, Marc, Nishanth Peethambaran, Rob Herring,
	Kumar Gala, Olof Johansson
In-Reply-To: <1392893567-31623-1-git-send-email-m.szyprowski@samsung.com>

From: Grant Likely <grant.likely@linaro.org>

Reserved memory nodes allow for the reservation of static (fixed
address) regions, or dynamically allocated regions for a specific
purpose.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
[joshc: Based on binding document proposed (in non-patch form) here:
 http://lkml.kernel.org/g/20131030134702.19B57C402A0@trevor.secretlab.ca
 adapted to support #memory-region-cells]
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 .../bindings/reserved-memory/reserved-memory.txt   |  138 ++++++++++++++++++++
 1 file changed, 138 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt

diff --git a/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
new file mode 100644
index 000000000000..a606ce90c9c4
--- /dev/null
+++ b/Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
@@ -0,0 +1,138 @@
+*** Reserved memory regions ***
+
+Reserved memory is specified as a node under the /reserved-memory node.
+The operating system shall exclude reserved memory from normal usage
+one can create child nodes describing particular reserved (excluded from
+normal use) memory regions. Such memory regions are usually designed for
+the special usage by various device drivers.
+
+Parameters for each memory region can be encoded into the device tree
+with the following nodes:
+
+/reserved-memory node
+---------------------
+#address-cells, #size-cells (required) - standard definition
+    - Should use the same values as the root node
+#memory-region-cells (required) - dictates number of cells used in the child
+                                  nodes memory-region specifier
+ranges (required) - standard definition
+    - Should be empty
+
+/reserved-memory/ child nodes
+-----------------------------
+Each child of the reserved-memory node specifies one or more regions of
+reserved memory. Each child node may either use a 'reg' property to
+specify a specific range of reserved memory, or a 'size' property with
+optional constraints to request a dynamically allocated block of memory.
+
+Following the generic-names recommended practice, node names should
+reflect the purpose of the node (ie. "framebuffer" or "dma-pool"). Unit
+address (@<address>) should be appended to the name if the node is a
+static allocation.
+
+Properties:
+Requires either a) or b) below.
+a) static allocation
+   reg (required) - standard definition
+b) dynamic allocation
+   size (required) - length based on parent's #size-cells
+                   - Size in bytes of memory to reserve.
+   alignment (optional) - length based on parent's #size-cells
+                        - Address boundary for alignment of allocation.
+   alloc-ranges (optional) - prop-encoded-array (address, length pairs).
+                           - Specifies regions of memory that are
+                             acceptable to allocate from.
+
+If both reg and size are present, then the reg property takes precedence
+and size is ignored.
+
+Additional properties:
+compatible (optional) - standard definition
+    - may contain the following strings:
+        - shared-dma-pool: This indicates a region of memory meant to be
+          used as a shared pool of DMA buffers for a set of devices. It can
+          be used by an operating system to instanciate the necessary pool
+          management subsystem if necessary.
+        - vendor specific string in the form <vendor>,[<device>-]<usage>
+no-map (optional) - empty property
+    - Indicates the operating system must not create a virtual mapping
+      of the region as part of its standard mapping of system memory,
+      nor permit speculative access to it under any circumstances other
+      than under the control of the device driver using the region.
+reusable (optional) - empty property
+    - The operating system can use the memory in this region with the
+      limitation that the device driver(s) owning the region need to be
+      able to reclaim it back. Typically that means that the operating
+      system can use that region to store volatile or cached data that
+      can be otherwise regenerated or migrated elsewhere.
+
+Linux implementation note:
+- If a "linux,cma-default" property is present, then Linux will use the
+  region for the default pool of the contiguous memory allocator.
+
+Device node references to reserved memory
+-----------------------------------------
+Regions in the /reserved-memory node may be referenced by other device
+nodes by adding a memory-region property to the device node.
+
+memory-region (optional) - phandle, specifier pairs to children of /reserved-memory
+
+Example
+-------
+This example defines 3 contiguous regions are defined for Linux kernel:
+one default of all device drivers (named linux,cma@72000000 and 64MiB in size),
+one dedicated to the framebuffer device (named framebuffer@78000000, 8MiB), and
+one for multimedia processing (named multimedia-memory@77000000, 64MiB).
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	memory {
+		reg = <0x40000000 0x40000000>;
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		/* global autoconfigured region for contiguous allocations */
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			#memory-region-cells = <0>;
+			size = <0x4000000>;
+			alignment = <0x2000>;
+			linux,cma-default;
+		};
+
+		display_reserved: framebuffer@78000000 {
+			#memory-region-cells = <0>;
+			reg = <0x78000000 0x800000>;
+		};
+
+		multimedia_reserved: multimedia@77000000 {
+			compatible = "acme,multimedia-memory";
+			#memory-region-cells = <1>;
+			reg = <0x77000000 0x4000000>;
+		};
+	};
+
+	/* ... */
+
+	fb0: video@12300000 {
+		memory-region = <&display_reserved>;
+		/* ... */
+	};
+
+	scaler: scaler@12500000 {
+		memory-region = <&multimedia_reserved 0xdeadbeef>;
+		/* ... */
+	};
+
+	codec: codec@12600000 {
+		memory-region = <&multimedia_reserved 0xfeebdaed>;
+		/* ... */
+	};
+};
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v4 5/7] arm: add support for reserved memory defined by device tree
From: Marek Szyprowski @ 2014-02-20 10:52 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linaro-mm-sig, devicetree,
	linux-doc
  Cc: Marek Szyprowski, Benjamin Herrenschmidt, Arnd Bergmann,
	Michal Nazarewicz, Grant Likely, Tomasz Figa, Sascha Hauer,
	Laura Abbott, Rob Herring, Olof Johansson, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Tomasz Figa,
	Kumar Gala, Nishanth Peethambaran, Marc, Josh Cartwright,
	Catalin Marinas, Will Deacon, Paul Mackerras
In-Reply-To: <1392893567-31623-1-git-send-email-m.szyprowski@samsung.com>

Enable reserved memory initialization from device tree.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/Kconfig   |    1 +
 arch/arm/mm/init.c |    3 +++
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e25419817791..d0262bea8020 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1918,6 +1918,7 @@ config USE_OF
 	select IRQ_DOMAIN
 	select OF
 	select OF_EARLY_FLATTREE
+	select OF_RESERVED_MEM
 	help
 	  Include support for flattened device tree machine descriptions.
 
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 804d61566a53..eee55d75bbfa 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -17,6 +17,7 @@
 #include <linux/nodemask.h>
 #include <linux/initrd.h>
 #include <linux/of_fdt.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/highmem.h>
 #include <linux/gfp.h>
 #include <linux/memblock.h>
@@ -323,6 +324,8 @@ void __init arm_memblock_init(struct meminfo *mi,
 	if (mdesc->reserve)
 		mdesc->reserve();
 
+	early_init_fdt_scan_reserved_mem();
+
 	/*
 	 * reserve memory for DMA contigouos allocations,
 	 * must come from DMA area inside low memory
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v4 6/7] arm64: add support for reserved memory defined by device tree
From: Marek Szyprowski @ 2014-02-20 10:52 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linaro-mm-sig, devicetree,
	linux-doc
  Cc: Marek Szyprowski, Benjamin Herrenschmidt, Arnd Bergmann,
	Michal Nazarewicz, Grant Likely, Tomasz Figa, Sascha Hauer,
	Laura Abbott, Rob Herring, Olof Johansson, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Tomasz Figa,
	Kumar Gala, Nishanth Peethambaran, Marc, Josh Cartwright,
	Catalin Marinas, Will Deacon, Paul Mackerras
In-Reply-To: <1392893567-31623-1-git-send-email-m.szyprowski@samsung.com>

Enable reserved memory initialization from device tree.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm64/Kconfig   |    1 +
 arch/arm64/mm/init.c |    2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 27bbcfc7202a..6abf15407dca 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -43,6 +43,7 @@ config ARM64
 	select NO_BOOTMEM
 	select OF
 	select OF_EARLY_FLATTREE
+	select OF_RESERVED_MEM
 	select PERF_USE_VMALLOC
 	select POWER_RESET
 	select POWER_SUPPLY
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index d0b4c2efda90..447550d6bd9b 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -30,6 +30,7 @@
 #include <linux/memblock.h>
 #include <linux/sort.h>
 #include <linux/of_fdt.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/dma-contiguous.h>
 
 #include <asm/sections.h>
@@ -160,6 +161,7 @@ void __init arm64_memblock_init(void)
 		memblock_reserve(base, size);
 	}
 
+	early_init_fdt_scan_reserved_mem();
 	dma_contiguous_reserve(0);
 
 	memblock_allow_resize();
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v4 7/7] powerpc: add support for reserved memory defined by device tree
From: Marek Szyprowski @ 2014-02-20 10:52 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linaro-mm-sig, devicetree,
	linux-doc
  Cc: Marek Szyprowski, Benjamin Herrenschmidt, Arnd Bergmann,
	Michal Nazarewicz, Grant Likely, Tomasz Figa, Sascha Hauer,
	Laura Abbott, Rob Herring, Olof Johansson, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Tomasz Figa,
	Kumar Gala, Nishanth Peethambaran, Marc, Josh Cartwright,
	Catalin Marinas, Will Deacon, Paul Mackerras
In-Reply-To: <1392893567-31623-1-git-send-email-m.szyprowski@samsung.com>

Enable reserved memory initialization from device tree.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/powerpc/Kconfig       |    1 +
 arch/powerpc/kernel/prom.c |    3 +++
 2 files changed, 4 insertions(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf344c0f5..3b6617fed8fc 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -90,6 +90,7 @@ config PPC
 	select BINFMT_ELF
 	select OF
 	select OF_EARLY_FLATTREE
+	select OF_RESERVED_MEM
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_DYNAMIC_FTRACE
 	select HAVE_FUNCTION_TRACER
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index f58c0d3aaeb4..b814262a2048 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -33,6 +33,7 @@
 #include <linux/irq.h>
 #include <linux/memblock.h>
 #include <linux/of.h>
+#include <linux/of_reserved_mem.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -588,6 +589,8 @@ static void __init early_reserve_mem_dt(void)
 			memblock_reserve(base, size);
 		}
 	}
+
+	early_init_fdt_scan_reserved_mem();
 }
 
 static void __init early_reserve_mem(void)
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH v4 0/4] Bugfix for of_match_node ordering
From: Kevin Hao @ 2014-02-20 10:55 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Grant Likely, devicetree@vger.kernel.org, LKML, Rob Herring,
	Sebastian Hesselbarth, linux-samsung-soc
In-Reply-To: <CAK9yfHzM_kyXMrnLC=M0qiLHKWxE41E-MdyGtipKA7AwoLnOqg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

On Thu, Feb 20, 2014 at 03:57:07PM +0530, Sachin Kamat wrote:
> Hi Kevin,
> 
> On 20 February 2014 15:42, Kevin Hao <haokexin@gmail.com> wrote:
> > On Thu, Feb 20, 2014 at 02:09:08PM +0530, Sachin Kamat wrote:
> >> Hi Grant,
> >>
> >> I observe the following boot failure with today's (next-20140220) linux-next
> >> tree on Exynos based boards with the default exynos_defconfig.
> >
> > Does this help?
> 
> The below patch works for me. Thanks for the fix.

Thanks Sachin.

Hi Grant,

I assume you would fold this change into the original patch. But if you want
a separate patch, please let me know.

Thanks,
Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH 3/4] tty: serial: bcm63xx_uart: add support for DT probing
From: Jonas Gorski @ 2014-02-20 10:59 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-serial, devicetree@vger.kernel.org, Maxime Bizon,
	Greg Kroah-Hartman
In-Reply-To: <CAGVrzcYEWJ6nKncSx3jjWFp9TXf8PFJnd-joPwSe0mDh-CeMiw@mail.gmail.com>

On Thu, Feb 20, 2014 at 2:29 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 2014-02-19 16:00 GMT-08:00 Jonas Gorski <jogo@openwrt.org>:
>> On Thu, Feb 20, 2014 at 12:22 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> @@ -857,6 +861,12 @@ static int bcm_uart_remove(struct platform_device *pdev)
>>>         return 0;
>>>  }
>>>
>>> +static const struct of_device_id bcm63xx_of_match[] = {
>>> +       { .compatible = "brcm,bcm63xx-uart" },
>>
>> From my understanding, this should be "brcm,bcm6345-uart", because
>> this kind of uart appeared first on bcm6345 (well, maybe bcm6335, no
>> idea which one of these two was first, but the latter was never
>> supported in mainline anyway).
>
> That's right, in fact, I think it might be desirable to handle both
> compatible string, just as a hint that it is compatible with the
> entire bcm63xx family. Would that work for you?

I think using a "generic" compatible string is rather frowned upon
(what do you do if there is eventually a bcm63xx chip with an
incompatible uart?), but I'm no device tree expert.


Jonas

^ permalink raw reply

* Re: [PATCH v4 0/4] Bugfix for of_match_node ordering
From: Sachin Kamat @ 2014-02-20 11:13 UTC (permalink / raw)
  To: Kevin Hao
  Cc: Grant Likely, devicetree@vger.kernel.org, LKML, Rob Herring,
	Sebastian Hesselbarth, linux-samsung-soc
In-Reply-To: <20140220105540.GB3745@pek-khao-d1.corp.ad.wrs.com>

On 20 February 2014 16:25, Kevin Hao <haokexin@gmail.com> wrote:
> On Thu, Feb 20, 2014 at 03:57:07PM +0530, Sachin Kamat wrote:
>> Hi Kevin,
>>
>> On 20 February 2014 15:42, Kevin Hao <haokexin@gmail.com> wrote:
>> > On Thu, Feb 20, 2014 at 02:09:08PM +0530, Sachin Kamat wrote:
>> >> Hi Grant,
>> >>
>> >> I observe the following boot failure with today's (next-20140220) linux-next
>> >> tree on Exynos based boards with the default exynos_defconfig.
>> >
>> > Does this help?
>>
>> The below patch works for me. Thanks for the fix.
>
> Thanks Sachin.
>
> Hi Grant,
>
> I assume you would fold this change into the original patch. But if you want
> a separate patch, please let me know.
>
> Thanks,
> Kevin

FWIW, On Exynos platform
Tested-by: Sachin Kamat <sachin.kamat@linaro.org>


-- 
With warm regards,
Sachin

^ permalink raw reply

* Re: [PATCH v4 0/4] Bugfix for of_match_node ordering
From: Grant Likely @ 2014-02-20 11:29 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: devicetree@vger.kernel.org, LKML, Kevin Hao, Rob Herring,
	Sebastian Hesselbarth, linux-samsung-soc
In-Reply-To: <CAK9yfHwwmZkFMRvxsxjBAfUbVXU3V+iPFDZO=DwQsFvJ3NQyKA@mail.gmail.com>

On Thu, Feb 20, 2014 at 8:39 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Hi Grant,
>
> I observe the following boot failure with today's (next-20140220) linux-next
> tree on Exynos based boards with the default exynos_defconfig.

Ugh, nested locking. that is not good. Kevin's patch looks correct and
I'll merge it in. I'm a little disturbed though that you're the only
one who has reported problems. Looking at what it does I would expect
pretty much every SMP platform for freak out about this, but I've
heard nothing from the powerpc guys.

I'll merge in the fix of course, but I'd like to know what I'm missing.

g.

>
> Uncompressing Linux... done, booting the kernel.
> [    0.000000] Booting Linux on physical CPU 0x900
> [    0.000000] Linux version 3.14.0-rc3-next-20140220 (sachin@linaro)
> (gcc version 4.8.2 20130805 (prerelease) (crosstool-NG linaro-1.
> 13.1-4.8-2013.08 - Linaro GCC 2013.08) ) #1132 SMP PREEMPT Thu Feb 20
> 13:49:27 IST 2014
> [    0.000000] CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c5387d
> [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
> instruction cache
> [    0.000000] Machine model: Insignal Origen evaluation board based
> on Exynos4210
> [    0.000000] bootconsole [earlycon0] enabled
> [    0.000000] Memory policy: Data cache writealloc
> [    0.000000] CPU EXYNOS4210 (id 0x43210011)
> [    0.000000] On node 0 totalpages: 258048
> [    0.000000]   Normal zone: 1520 pages used for memmap
> [    0.000000]   Normal zone: 0 pages reserved
> [    0.000000]   Normal zone: 190464 pages, LIFO batch:31
> [    0.000000]   HighMem zone: 528 pages used for memmap
> [    0.000000]   HighMem zone: 67584 pages, LIFO batch:15
> [    0.000000] BUG: spinlock recursion on CPU#0, swapper/0
> [    0.000000]  lock: devtree_lock+0x0/0x10, .magic: dead4ead, .owner:
> swapper/0, .owner_cpu: 0
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
> 3.14.0-rc3-next-20140220 #1132
> [    0.000000] [<c0013e9c>] (unwind_backtrace) from [<c0011250>]
> (show_stack+0x10/0x14)
> [    0.000000] [<c0011250>] (show_stack) from [<c0386740>]
> (dump_stack+0x7c/0xbc)
> [    0.000000] [<c0386740>] (dump_stack) from [<c005501c>]
> (do_raw_spin_lock+0x188/0x18c)
> [    0.000000] [<c005501c>] (do_raw_spin_lock) from [<c038b614>]
> (_raw_spin_lock_irqsave+0x20/0x28)
> [    0.000000] [<c038b614>] (_raw_spin_lock_irqsave) from [<c02de37c>]
> (of_find_property+0x20/0x4c)
> [    0.000000] [<c02de37c>] (of_find_property) from [<c02df110>]
> (__of_device_is_compatible+0xb4/0x110)
> [    0.000000] [<c02df110>] (__of_device_is_compatible) from
> [<c02df22c>] (of_find_compatible_node+0x4c/0x7c)
> [    0.000000] [<c02df22c>] (of_find_compatible_node) from
> [<c04cedf4>] (exynos_firmware_init+0x18/0x7c)
> [    0.000000] [<c04cedf4>] (exynos_firmware_init) from [<c04caef0>]
> (setup_arch+0x860/0x898)
> [    0.000000] [<c04caef0>] (setup_arch) from [<c04c7820>]
> (start_kernel+0x80/0x3dc)
> [    0.000000] [<c04c7820>] (start_kernel) from [<40008074>] (0x40008074)
> [    0.000000] BUG: spinlock lockup suspected on CPU#0, swapper/0
> [    0.000000]  lock: devtree_lock+0x0/0x10, .magic: dead4ead, .owner:
> swapper/0, .owner_cpu: 0
> [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
> 3.14.0-rc3-next-20140220 #1132
> [    0.000000] [<c0013e9c>] (unwind_backtrace) from [<c0011250>]
> (show_stack+0x10/0x14)
> [    0.000000] [<c0011250>] (show_stack) from [<c0386740>]
> (dump_stack+0x7c/0xbc)
> [    0.000000] [<c0386740>] (dump_stack) from [<c0054fac>]
> (do_raw_spin_lock+0x118/0x18c)
> [    0.000000] [<c0054fac>] (do_raw_spin_lock) from [<c038b614>]
> (_raw_spin_lock_irqsave+0x20/0x28)
> [    0.000000] [<c038b614>] (_raw_spin_lock_irqsave) from [<c02de37c>]
> (of_find_property+0x20/0x4c)
> [    0.000000] [<c02de37c>] (of_find_property) from [<c02df110>]
> (__of_device_is_compatible+0xb4/0x110)
> [    0.000000] [<c02df110>] (__of_device_is_compatible) from
> [<c02df22c>] (of_find_compatible_node+0x4c/0x7c)
> [    0.000000] [<c02df22c>] (of_find_compatible_node) from
> [<c04cedf4>] (exynos_firmware_init+0x18/0x7c)
> [    0.000000] [<c04cedf4>] (exynos_firmware_init) from [<c04caef0>]
> (setup_arch+0x860/0x898)
> [    0.000000] [<c04caef0>] (setup_arch) from [<c04c7820>]
> (start_kernel+0x80/0x3dc)
> [    0.000000] [<c04c7820>] (start_kernel) from [<40008074>] (0x40008074)
>
> Regards,
> Sachin
>
>
>
> On 19 February 2014 19:44, Grant Likely <grant.likely@linaro.org> wrote:
>> Hi all,
>>
>> I've taken Kevin's latest rework and done even more rework on it. :-) I
>> didn't quite like how it was looking so I rolled his scoring code
>> directly into __of_device_is_compatible() so that the function always
>> returns a score in a way that is still compatible with the existing
>> users (ie. non-zero == successful match). This eliminates the need for a
>> separate pscore argument and it also let me roll the type and name
>> checks into the same function. I'm a lot happier with it overall and it
>> makes for a slightly smaller number of lines of code changed. Please
>> take a look and give it a spin. This is basically a bug fix so I'll need
>> to push it out to Linus in the near future.
>>
>> Acks and Tested-bys would be particularly appreciated.
>>
>> Thanks,
>> g.
>>
>> Kevin Hao (2):
>>         Revert "of: search the best compatible match first in __of_match_node()"
>>         of: reimplement the matching method for __of_match_node()
>>
>> Grant Likely (2):
>>         of: Move testcase FDT data into drivers/of
>>         of: Add self test for of_match_node()
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: [PATCH v5 1/4] ASoC: tlv320aic32x4: Support for master clock
From: Markus Pargmann @ 2014-02-20 11:37 UTC (permalink / raw)
  To: Mark Brown
  Cc: Mark Rutland, devicetree, alsa-devel, Lars-Peter Clausen,
	Pawel Moll, Ian Campbell, Liam Girdwood, Rob Herring, kernel,
	Kumar Gala
In-Reply-To: <20140219035406.GP2669@sirena.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1795 bytes --]

Hi,

On Wed, Feb 19, 2014 at 12:54:06PM +0900, Mark Brown wrote:
> On Tue, Feb 18, 2014 at 09:46:46PM +0100, Markus Pargmann wrote:
> > On Tue, Feb 18, 2014 at 10:23:29AM +0900, Mark Brown wrote:
> 
> > > Looking at the code the clock isn't physically optional, why not make it
> > > mandatory?  There's only one mainline user, it looks like it should be
> > > straightforward to update with a fixed clock.
> 
> > The masterclock is physically optional. There are several modes to use
> > this codec without master clock. The PLL can use different clock inputs,
> > BCLK, MCLK, etc. and even the PLL is not necessary. Instead BCLK and so
> > on can be used as direct codec clock input. However, most of this is not
> > supported by the driver yet and I can't test these cases.
> 
> Are any of these modes supported by the driver yet?  If there's modes
> that don't use MCLK supported then I'd expect them to only enable MCLK
> if it's actively being used in the current configuration (triggered via
> set_sysclk()).

It seems none of these modes are supported yet. aic32x4_hw_params setups
the clock tree relying on a master clock to be used for the PLL.
Otherwise hw_params fails. So currently mclk is not optional for the
driver. But it is still optional for the real hardware.

What do you think about declaring the mclk as optional property in the
DT bindings documentation but to handle it as a required clock in the
driver?

Thanks,

Markus



-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* Re: devicetree repository separation/migration
From: Grant Likely @ 2014-02-20 11:38 UTC (permalink / raw)
  To: Olof Johansson, Rob Herring
  Cc: Tim Bird, Jason Cooper, Sascha Hauer, Ian Campbell, Pawel Moll,
	Mark Rutland, Kumar Gala, Rob Landley,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-spec-u79uwXL29TY76Z2rM5mHXA,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAOesGMiHOwSYTCUaptacN=_pbXnObU5gqpxQHQ+kRTaW-ow3rA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, 19 Feb 2014 13:20:15 -0800, Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org> wrote:
> On Wed, Feb 19, 2014 at 1:12 PM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > One way to minimize the inconvenience is keep versioning and dev
> > cycles in sync with the kernel. We could also start doing things to
> > align the kernel workflow with how things will work when we do have a
> > separate repository.
> 
> I don't think aligning development cycles is what we want most here it
> might be useful for us in Linux but it'll make things difficult for
> other projects since they're not aware of our release cycles. The
> device tree bindings and DT contents in that repo should be "always
> stable", i.e. no merge window / rc concept. As soon as something goes
> in it's live, and from then out only fixes to the DTS files (or
> appending the binding).
> 
> For example, I don't want to have to track two trees to test against
> -- I'll want to keep one repo of the very latest DT files and always
> use those to boot any and all boards.

This approach does have the subtle side effect that differs from what we
discussed in Edinburgh.  We've talked about always being able to boot a
new kernel on an old devicetree, but not a new devicetree on an old
kernel. With a separate board database repo we are going to hit both
cases. At least to a limited extent we're going to need older kernels
booting with the latest devicetree, and we'll need some rules about how
that gets applied.

The alternative is that binding changes land in .dts files after a
kernel release, and I don't think we want that situation at all.

This is an issue for new bindings, only when a binding is getting
extended or replaced. If the change is merely adding new properties then
there shouldn't be a problem (the old kernel will ignore the new
properties). If it removes properties or creates a new compatible string
(dropping the one supported by an older kernel) then it won't boot.

Ultimately this is probably the right thing to do, but it will be
difficult. Keeping a staging process for new bindings in lock step
with the kernel is probably the way to mitigate this.

g.
--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: devicetree repository separation/migration
From: Grant Likely @ 2014-02-20 11:39 UTC (permalink / raw)
  To: Ian Campbell, Warner Losh
  Cc: Jason Cooper, Olof Johansson, Sascha Hauer, Rob Herring,
	Pawel Moll, Mark Rutland, Kumar Gala, Rob Landley,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-spec-u79uwXL29TY76Z2rM5mHXA,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392889831.23342.11.camel-ommiHX4a84BXesXXhkcM7miJhflN2719@public.gmane.org>

On Thu, 20 Feb 2014 09:50:31 +0000, Ian Campbell <ijc-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org> wrote:
> On Wed, 2014-02-19 at 13:23 -0700, Warner Losh wrote:
> > On Feb 19, 2014, at 11:32 AM, Jason Cooper wrote:
> > 
> > > On Tue, Feb 18, 2014 at 11:47:56AM -0800, Olof Johansson wrote:
> > >> On Tue, Feb 18, 2014 at 10:18 AM, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> > >> I think we have two options:
> > >> 
> > >> 1. Bring out everything in the current kernel repo to a separate one,
> > >> but do it my mirroring over. Changes go into the kernel repo first and
> > >> then comes over to this one, but other projects can mirror the
> > >> standalone repo without downloading a whole kernel tree.
> > > 
> > > I prefer this one.  Assuming that a separate repo is mostly agreed upon,
> > > this allows us to provide the tree in an easily digestible way without
> > > impacting the current workflow.
> > > 
> > > Also, if it works for the other projects, no one says we have to move
> > > beyond this step.
> > 
> > I just joined this list...  What's the scope of what would move into the new
> > repo? The dts files with the binding docs, or also the code to implement
> > those bindings?
> 
> Just the dts(i) and Bindings docs, not the code.
> 
> e.g. something like
> http://xenbits.xen.org/gitweb/?p=people/ianc/device-tree-rebasing.git
> would be the ultimate goal.

And schemas files when we have them.

g.

--
To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: devicetree repository separation/migration
From: Grant Likely @ 2014-02-20 11:39 UTC (permalink / raw)
  To: Warner Losh
  Cc: Jason Cooper, Sascha Hauer, Rob Herring, Ian Campbell,
	Mark Rutland, Kumar Gala, Rob Landley, devicetree@vger.kernel.org,
	devicetree-spec, devicetree-compiler
In-Reply-To: <88923CF8-5E0A-46A4-AAA0-AC277F5C9446@bsdimp.com>

On Wed, 19 Feb 2014 14:43:58 -0700, Warner Losh <wlosh@bsdimp.com> wrote:
> 
> On Feb 19, 2014, at 2:09 PM, Grant Likely wrote:
> 
> > On Tue, Feb 18, 2014 at 6:18 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> >> On Tue, Feb 18, 2014 at 04:57:50PM +0100, Sascha Hauer wrote:
> >>> It will be interesting to see which rules should apply for merging new
> >>> bindings. I know that devicetrees should be OS agnostic, but sometimes
> >>> they are modelled after how Linux currently works. What happens when the
> >>> *BSD guys have different ideas how a good binding looks like? How will
> >>> such conflicts be resolved?
> >> 
> >> That's more a question for Grant.  I assume we'll all put on our big-boy
> >> pants and pick the best technical solution based on their merits. :)
> > 
> > I think you've answered it pretty competently.
> 
> What, the BSDs don't get a free pass to dump junk into the process. I'm shocked :)
> 
> But we have bug-boy pants over in BSD land, so that shouldn't be a problem.

Bug-boy pants? Sounds sticky.

g.

^ permalink raw reply

* [PATCH v8 00/14] USB Host support for OMAP5 uEVM
From: Roger Quadros @ 2014-02-20 11:39 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: nm, devicetree, khilman, linux-usb, linux-kernel, balbi,
	linux-omap, linux-arm-kernel, Roger Quadros

Hi Benoit, Tony & Lee,

This patchset brings up USB Host ports and Ethernet port on
the OMAP5 uEVM board.

It also does some cleanup with respect to DT clock binding
for the mfd/omap-usb-host driver.

Please queue these for -next.

Tested on:
 - OMAP5 uEVM
 - Pandaboard ES Rev. B1
 - Beagleboard-XM Rev C2 (DT + Legacy)
 - Beagleboard Rev C4 (DT + Legacy)

Changelog:

v8:
- Addressed review comments and split patch
  "mfd: omap-usb-host: Get clocks based on hardware revision"
- Removed unnecessary usb host dummy clocks on OMAP3
- Removed unnecessary clock alias "ehci_logic_fck" for OMAP3
- Rebased on 3.14-rc3

v7:
- Rebased on 3.14-rc2
- Removed incompatible ids from DT files and examples

v6:
- Initialized clocks to -ENODEV and split patch 3.

v5:
- Expose all clocks in the DT binding document for mfd:omap-usb-host
and mfd:omap-usb-tll

v4:
- Updated DT binding document for clock binding

v3:
- Rebased on top of 3.13-rc7

cheers,
-roger

---
Roger Quadros (14):
  mfd: omap-usb-host: Get clocks based on hardware revision
  mfd: omap-usb-host: Always fail on clk_get() error
  mfd: omap-usb-host: Use clock names as per function for reference
    clocks
  mfd: omap-usb-host: Update DT clock binding information
  mfd: omap-usb-tll: Update DT clock binding information
  CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks
  ARM: OMAP3: hwmod data: Remove optional clock from usb_host_hs module
  ARM: dts: omap4: Update omap-usb-host node
  ARM: dts: omap5: Update omap-usb-host node
  ARM: dts: omap4-panda: Provide USB PHY clock
  ARM: dts: omap5-uevm: Provide USB PHY clock
  ARM: OMAP2+: Remove legacy_init_ehci_clk()
  ARM: dts: OMAP2+: Get rid of incompatible ids for USB host nodes
  usb: omap: dts: Update DT binding example usage

 .../devicetree/bindings/mfd/omap-usb-host.txt      |  23 ++++
 .../devicetree/bindings/mfd/omap-usb-tll.txt       |  10 ++
 .../devicetree/bindings/usb/ehci-omap.txt          |   2 +-
 .../devicetree/bindings/usb/ohci-omap3.txt         |   2 +-
 arch/arm/boot/dts/omap3.dtsi                       |   4 +-
 arch/arm/boot/dts/omap4-panda-common.dtsi          |   8 +-
 arch/arm/boot/dts/omap4.dtsi                       |  10 +-
 arch/arm/boot/dts/omap5-uevm.dts                   |   8 +-
 arch/arm/boot/dts/omap5.dtsi                       |  10 +-
 arch/arm/mach-omap2/cclock3xxx_data.c              |   4 -
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         |   6 --
 arch/arm/mach-omap2/pdata-quirks.c                 |  16 ---
 drivers/clk/ti/clk-3xxx.c                          |   4 -
 drivers/mfd/omap-usb-host.c                        | 116 ++++++++++++++-------
 14 files changed, 135 insertions(+), 88 deletions(-)

-- 
1.8.3.2

^ permalink raw reply

* [PATCH v8 01/14] mfd: omap-usb-host: Get clocks based on hardware revision
From: Roger Quadros @ 2014-02-20 11:39 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: nm, devicetree, khilman, Samuel Ortiz, linux-usb, linux-kernel,
	balbi, linux-omap, linux-arm-kernel, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

Not all revisions have all the clocks so get the necessary clocks
based on hardware revision.

This should avoid un-necessary clk_get failure messages that were
observed earlier.

CC: Lee Jones <lee.jones@linaro.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 0c3c9a0..c63bfdf 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -665,22 +665,43 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 		goto err_mem;
 	}
 
-	need_logic_fck = false;
+	/* Set all clocks as invalid to begin with */
+	omap->ehci_logic_fck = ERR_PTR(-ENODEV);
+	omap->init_60m_fclk = ERR_PTR(-ENODEV);
+	omap->utmi_p1_gfclk = ERR_PTR(-ENODEV);
+	omap->utmi_p2_gfclk = ERR_PTR(-ENODEV);
+	omap->xclk60mhsp1_ck = ERR_PTR(-ENODEV);
+	omap->xclk60mhsp2_ck = ERR_PTR(-ENODEV);
+
 	for (i = 0; i < omap->nports; i++) {
-		if (is_ehci_phy_mode(i) || is_ehci_tll_mode(i) ||
-			is_ehci_hsic_mode(i))
-				need_logic_fck |= true;
+		omap->utmi_clk[i] = ERR_PTR(-ENODEV);
+		omap->hsic480m_clk[i] = ERR_PTR(-ENODEV);
+		omap->hsic60m_clk[i] = ERR_PTR(-ENODEV);
 	}
 
-	omap->ehci_logic_fck = ERR_PTR(-EINVAL);
-	if (need_logic_fck) {
-		omap->ehci_logic_fck = devm_clk_get(dev, "ehci_logic_fck");
-		if (IS_ERR(omap->ehci_logic_fck)) {
-			ret = PTR_ERR(omap->ehci_logic_fck);
-			dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+	/* for OMAP3 i.e. USBHS REV1 */
+	if (omap->usbhs_rev == OMAP_USBHS_REV1) {
+		need_logic_fck = false;
+		for (i = 0; i < omap->nports; i++) {
+			if (is_ehci_phy_mode(pdata->port_mode[i]) ||
+			    is_ehci_tll_mode(pdata->port_mode[i]) ||
+			    is_ehci_hsic_mode(pdata->port_mode[i]))
+
+				need_logic_fck |= true;
+		}
+
+		if (need_logic_fck) {
+			omap->ehci_logic_fck = devm_clk_get(dev,
+							    "ehci_logic_fck");
+			if (IS_ERR(omap->ehci_logic_fck)) {
+				ret = PTR_ERR(omap->ehci_logic_fck);
+				dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+			}
 		}
+		goto initialize;
 	}
 
+	/* for OMAP4+ i.e. USBHS REV2+ */
 	omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk");
 	if (IS_ERR(omap->utmi_p1_gfclk)) {
 		ret = PTR_ERR(omap->utmi_p1_gfclk);
@@ -748,7 +769,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[0])) {
-		/* for OMAP3, clk_set_parent fails */
 		ret = clk_set_parent(omap->utmi_p1_gfclk,
 					omap->xclk60mhsp1_ck);
 		if (ret != 0)
@@ -776,6 +796,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 					ret);
 	}
 
+initialize:
 	omap_usbhs_init(dev);
 
 	if (dev->of_node) {
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 02/14] mfd: omap-usb-host: Always fail on clk_get() error
From: Roger Quadros @ 2014-02-20 11:39 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: nm, devicetree, khilman, Samuel Ortiz, linux-usb, linux-kernel,
	balbi, linux-omap, linux-arm-kernel, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

Be more strict and always fail on clk_get() error.

For OMAP3 platforms, get the 120MHz EHCI clock by its proper name
'usbhost_120m_fck' instead of its alias 'ehci_logic_fck'.

CC: Lee Jones <lee.jones@linaro.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/mfd/omap-usb-host.c | 65 +++++++++++++++++++++++++++++----------------
 1 file changed, 42 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index c63bfdf..865c276 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -692,10 +692,12 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 
 		if (need_logic_fck) {
 			omap->ehci_logic_fck = devm_clk_get(dev,
-							    "ehci_logic_fck");
+							    "usbhost_120m_fck");
 			if (IS_ERR(omap->ehci_logic_fck)) {
 				ret = PTR_ERR(omap->ehci_logic_fck);
-				dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+				dev_err(dev, "usbhost_120m_fck failed:%d\n",
+					ret);
+				goto err_mem;
 			}
 		}
 		goto initialize;
@@ -749,51 +751,68 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 		 * them
 		 */
 		omap->utmi_clk[i] = devm_clk_get(dev, clkname);
-		if (IS_ERR(omap->utmi_clk[i]))
-			dev_dbg(dev, "Failed to get clock : %s : %ld\n",
-				clkname, PTR_ERR(omap->utmi_clk[i]));
+		if (IS_ERR(omap->utmi_clk[i])) {
+			ret = PTR_ERR(omap->utmi_clk[i]);
+			dev_err(dev, "Failed to get clock : %s : %d\n",
+				clkname, ret);
+			goto err_mem;
+		}
 
 		snprintf(clkname, sizeof(clkname),
 				"usb_host_hs_hsic480m_p%d_clk", i + 1);
 		omap->hsic480m_clk[i] = devm_clk_get(dev, clkname);
-		if (IS_ERR(omap->hsic480m_clk[i]))
-			dev_dbg(dev, "Failed to get clock : %s : %ld\n",
-				clkname, PTR_ERR(omap->hsic480m_clk[i]));
+		if (IS_ERR(omap->hsic480m_clk[i])) {
+			ret = PTR_ERR(omap->hsic480m_clk[i]);
+			dev_err(dev, "Failed to get clock : %s : %d\n",
+				clkname, ret);
+			goto err_mem;
+		}
 
 		snprintf(clkname, sizeof(clkname),
 				"usb_host_hs_hsic60m_p%d_clk", i + 1);
 		omap->hsic60m_clk[i] = devm_clk_get(dev, clkname);
-		if (IS_ERR(omap->hsic60m_clk[i]))
-			dev_dbg(dev, "Failed to get clock : %s : %ld\n",
-				clkname, PTR_ERR(omap->hsic60m_clk[i]));
+		if (IS_ERR(omap->hsic60m_clk[i])) {
+			ret = PTR_ERR(omap->hsic60m_clk[i]);
+			dev_err(dev, "Failed to get clock : %s : %d\n",
+				clkname, ret);
+			goto err_mem;
+		}
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[0])) {
 		ret = clk_set_parent(omap->utmi_p1_gfclk,
 					omap->xclk60mhsp1_ck);
-		if (ret != 0)
-			dev_dbg(dev, "xclk60mhsp1_ck set parent failed: %d\n",
-					ret);
+		if (ret != 0) {
+			dev_err(dev, "xclk60mhsp1_ck set parent failed: %d\n",
+				ret);
+			goto err_mem;
+		}
 	} else if (is_ehci_tll_mode(pdata->port_mode[0])) {
 		ret = clk_set_parent(omap->utmi_p1_gfclk,
 					omap->init_60m_fclk);
-		if (ret != 0)
-			dev_dbg(dev, "P0 init_60m_fclk set parent failed: %d\n",
-					ret);
+		if (ret != 0) {
+			dev_err(dev, "P0 init_60m_fclk set parent failed: %d\n",
+				ret);
+			goto err_mem;
+		}
 	}
 
 	if (is_ehci_phy_mode(pdata->port_mode[1])) {
 		ret = clk_set_parent(omap->utmi_p2_gfclk,
 					omap->xclk60mhsp2_ck);
-		if (ret != 0)
-			dev_dbg(dev, "xclk60mhsp2_ck set parent failed: %d\n",
-					ret);
+		if (ret != 0) {
+			dev_err(dev, "xclk60mhsp2_ck set parent failed: %d\n",
+				ret);
+			goto err_mem;
+		}
 	} else if (is_ehci_tll_mode(pdata->port_mode[1])) {
 		ret = clk_set_parent(omap->utmi_p2_gfclk,
 						omap->init_60m_fclk);
-		if (ret != 0)
-			dev_dbg(dev, "P1 init_60m_fclk set parent failed: %d\n",
-					ret);
+		if (ret != 0) {
+			dev_err(dev, "P1 init_60m_fclk set parent failed: %d\n",
+				ret);
+			goto err_mem;
+		}
 	}
 
 initialize:
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks
From: Roger Quadros @ 2014-02-20 11:39 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: nm, devicetree, khilman, Samuel Ortiz, linux-usb, linux-kernel,
	balbi, linux-omap, linux-arm-kernel, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

Use a meaningful name for the reference clocks so that it indicates the function.

CC: Lee Jones <lee.jones@linaro.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/mfd/omap-usb-host.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 865c276..651e249 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 		goto err_mem;
 	}
 
-	omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
+	omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
 	if (IS_ERR(omap->xclk60mhsp1_ck)) {
 		ret = PTR_ERR(omap->xclk60mhsp1_ck);
-		dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
+		dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
 		goto err_mem;
 	}
 
-	omap->xclk60mhsp2_ck = devm_clk_get(dev, "xclk60mhsp2_ck");
+	omap->xclk60mhsp2_ck = devm_clk_get(dev, "refclk_60m_ext_p2");
 	if (IS_ERR(omap->xclk60mhsp2_ck)) {
 		ret = PTR_ERR(omap->xclk60mhsp2_ck);
-		dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
+		dev_err(dev, "refclk_60m_ext_p2 failed error:%d\n", ret);
 		goto err_mem;
 	}
 
-	omap->init_60m_fclk = devm_clk_get(dev, "init_60m_fclk");
+	omap->init_60m_fclk = devm_clk_get(dev, "refclk_60m_int");
 	if (IS_ERR(omap->init_60m_fclk)) {
 		ret = PTR_ERR(omap->init_60m_fclk);
-		dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
+		dev_err(dev, "refclk_60m_int failed error:%d\n", ret);
 		goto err_mem;
 	}
 
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 04/14] mfd: omap-usb-host: Update DT clock binding information
From: Roger Quadros @ 2014-02-20 11:39 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros, Samuel Ortiz
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The omap-usb-host driver expects certained named clocks.
Add this information to the DT binding document.

CC: Lee Jones <lee.jones@linaro.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 .../devicetree/bindings/mfd/omap-usb-host.txt      | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
index b381fa6..4721b2d 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
@@ -32,6 +32,29 @@ Optional properties:
 - single-ulpi-bypass: Must be present if the controller contains a single
   ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1
 
+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+  clock-names.
+
+- clock-names: should include:
+  For OMAP3
+  * "usbhost_120m_fck" - 120MHz Functional clock.
+
+  For OMAP4+
+  * "refclk_60m_int" - 60MHz internal reference clock for UTMI clock mux
+  * "refclk_60m_ext_p1" - 60MHz external ref. clock for Port 1's UTMI clock mux.
+  * "refclk_60m_ext_p2" - 60MHz external ref. clock for Port 2's UTMI clock mux
+  * "utmi_p1_gfclk" - Port 1 UTMI clock mux.
+  * "utmi_p2_gfclk" - Port 2 UTMI clock mux.
+  * "usb_host_hs_utmi_p1_clk" - Port 1 UTMI clock gate.
+  * "usb_host_hs_utmi_p2_clk" - Port 2 UTMI clock gate.
+  * "usb_host_hs_utmi_p3_clk" - Port 3 UTMI clock gate.
+  * "usb_host_hs_hsic480m_p1_clk" - Port 1 480MHz HSIC clock gate.
+  * "usb_host_hs_hsic480m_p2_clk" - Port 2 480MHz HSIC clock gate.
+  * "usb_host_hs_hsic480m_p3_clk" - Port 3 480MHz HSIC clock gate.
+  * "usb_host_hs_hsic60m_p1_clk" - Port 1 60MHz HSIC clock gate.
+  * "usb_host_hs_hsic60m_p2_clk" - Port 2 60MHz HSIC clock gate.
+  * "usb_host_hs_hsic60m_p3_clk" - Port 3 60MHz HSIC clock gate.
+
 Required properties if child node exists:
 
 - #address-cells: Must be 1
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 05/14] mfd: omap-usb-tll: Update DT clock binding information
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: nm, devicetree, khilman, Samuel Ortiz, linux-usb, linux-kernel,
	balbi, linux-omap, linux-arm-kernel, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The omap-usb-tll driver needs one clock for each TLL channel.
Add this information to the DT binding document.

CC: Lee Jones <lee.jones@linaro.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
index 62fe697..c58d704 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
@@ -7,6 +7,16 @@ Required properties:
 - interrupts : should contain the TLL module's interrupt
 - ti,hwmod : must contain "usb_tll_hs"
 
+Optional properties:
+
+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+  clock-names.
+
+- clock-names: should include:
+  * "usb_tll_hs_usb_ch0_clk" - USB TLL channel 0 clock
+  * "usb_tll_hs_usb_ch1_clk" - USB TLL channel 1 clock
+  * "usb_tll_hs_usb_ch2_clk" - USB TLL channel 2 clock
+
 Example:
 
 	usbhstll: usbhstll@4a062000 {
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 06/14] CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros, Tero Kristo, Mike Turquette
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The OMAP USB Host MFD driver no longer expects these non-existing
clocks from the OMAP3 platform, so get rid of them.

CC: Tero Kristo <t-kristo@ti.com>
CC: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/cclock3xxx_data.c | 4 ----
 drivers/clk/ti/clk-3xxx.c             | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 3b05aea..4299a55 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = {
 	CLK(NULL,	"dss_tv_fck",	&dss_tv_fck),
 	CLK(NULL,	"dss_96m_fck",	&dss_96m_fck),
 	CLK(NULL,	"dss2_alwon_fck",	&dss2_alwon_fck),
-	CLK(NULL,	"utmi_p1_gfclk",	&dummy_ck),
-	CLK(NULL,	"utmi_p2_gfclk",	&dummy_ck),
-	CLK(NULL,	"xclk60mhsp1_ck",	&dummy_ck),
-	CLK(NULL,	"xclk60mhsp2_ck",	&dummy_ck),
 	CLK(NULL,	"init_60m_fclk",	&dummy_ck),
 	CLK(NULL,	"gpt1_fck",	&gpt1_fck),
 	CLK(NULL,	"aes2_ick",	&aes2_ick),
diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
index d323023..0d1750a 100644
--- a/drivers/clk/ti/clk-3xxx.c
+++ b/drivers/clk/ti/clk-3xxx.c
@@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
 	DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
 	DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
 	DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
-	DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
-	DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
-	DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
-	DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
 	DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
 	DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
 	DT_CLK(NULL, "aes2_ick", "aes2_ick"),
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 07/14] ARM: OMAP3: hwmod data: Remove optional clock from usb_host_hs module
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros, Paul Walmsley
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The USB Host driver manages this clock so no need to have it in
the hwmod data. We also get rid of the 'ehci_logic_fck' alias
for 'usbhost_120m_fck' clock.

CC: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4c3b1e6..ad87f46 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1955,10 +1955,6 @@ static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = {
 	.sysc = &omap3xxx_usb_host_hs_sysc,
 };
 
-static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
-	  { .role = "ehci_logic_fck", .clk = "usbhost_120m_fck", },
-};
-
 static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
 	{ .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, },
 	{ .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, },
@@ -1981,8 +1977,6 @@ static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
 			.idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
 		},
 	},
-	.opt_clks	= omap3xxx_usb_host_hs_opt_clks,
-	.opt_clks_cnt	= ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks),
 
 	/*
 	 * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 08/14] ARM: dts: omap4: Update omap-usb-host node
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The omap-usb-host driver expects a certain name for internal
and external reference clocks. Provide these clocks.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/boot/dts/omap4.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index d3f8a6e..39a05ce 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -697,6 +697,12 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
+			clocks = <&init_60m_fclk>,
+				 <&xclk60mhsp1_ck>,
+				 <&xclk60mhsp2_ck>;
+			clock-names = "refclk_60m_int",
+				      "refclk_60m_ext_p1",
+				      "refclk_60m_ext_p2";
 
 			usbhsohci: ohci@4a064800 {
 				compatible = "ti,ohci-omap3", "usb-ohci";
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 09/14] ARM: dts: omap5: Update omap-usb-host node
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The omap-usb-host driver expects a certain name for internal
and external reference clocks. Provide these clocks.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/boot/dts/omap5.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index a72813a..d4dae48 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -775,6 +775,12 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
+			clocks = <&l3init_60m_fclk>,
+				 <&xclk60mhsp1_ck>,
+				 <&xclk60mhsp2_ck>;
+			clock-names = "refclk_60m_int",
+				      "refclk_60m_ext_p1",
+				      "refclk_60m_ext_p2";
 
 			usbhsohci: ohci@4a064800 {
 				compatible = "ti,ohci-omap3", "usb-ohci";
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 10/14] ARM: dts: omap4-panda: Provide USB PHY clock
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The USB PHY gets its clock from AUXCLK3. Provide this
information.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/boot/dts/omap4-panda-common.dtsi | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 88c6a05..50b72966 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -83,12 +83,8 @@
 		compatible = "usb-nop-xceiv";
 		reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;   /* gpio_62 */
 		vcc-supply = <&hsusb1_power>;
-	/**
-	 * FIXME:
-	 * put the right clock phandle here when available
-	 *	clocks = <&auxclk3>;
-	 *	clock-names = "main_clk";
-	 */
+		clocks = <&auxclk3_ck>;
+		clock-names = "main_clk";
 		clock-frequency = <19200000>;
 	};
 
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH v8 11/14] ARM: dts: omap5-uevm: Provide USB PHY clock
From: Roger Quadros @ 2014-02-20 11:40 UTC (permalink / raw)
  To: tony, bcousson, lee.jones
  Cc: balbi, nm, khilman, linux-omap, linux-arm-kernel, linux-kernel,
	devicetree, linux-usb, Roger Quadros
In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com>

The HS USB 2 PHY gets its clock from AUXCLK1. Provide this
information.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/boot/dts/omap5-uevm.dts | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 002fa70..3b99ec2 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -31,12 +31,8 @@
 	hsusb2_phy: hsusb2_phy {
 		compatible = "usb-nop-xceiv";
 		reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
-	/**
-	  * FIXME
-	  * Put the right clock phandle here when available
-	  *	clocks = <&auxclk1>;
-	  *	clock-names = "main_clk";
-	  */
+		clocks = <&auxclk1_ck>;
+		clock-names = "main_clk";
 		clock-frequency = <19200000>;
 	};
 
-- 
1.8.3.2

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox