* [PATCH v6 2/4] mm: remove x86-only restriction of movable_node
From: Reza Arbab @ 2016-11-07 23:44 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Rob Herring, Frank Rowand, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin
Cc: linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Balbir Singh,
Aneesh Kumar K.V, linux-kernel
In-Reply-To: <1478562276-25539-1-git-send-email-arbab@linux.vnet.ibm.com>
In commit c5320926e370 ("mem-hotplug: introduce movable_node boot
option"), the memblock allocation direction is changed to bottom-up and
then back to top-down like this:
1. memblock_set_bottom_up(true), called by cmdline_parse_movable_node().
2. memblock_set_bottom_up(false), called by x86's numa_init().
Even though (1) occurs in generic mm code, it is wrapped by #ifdef
CONFIG_MOVABLE_NODE, which depends on X86_64.
This means that when we extend CONFIG_MOVABLE_NODE to non-x86 arches,
things will be unbalanced. (1) will happen for them, but (2) will not.
This toggle was added in the first place because x86 has a delay between
adding memblocks and marking them as hotpluggable. Since other arches do
this marking either immediately or not at all, they do not require the
bottom-up toggle.
So, resolve things by moving (1) from cmdline_parse_movable_node() to
x86's setup_arch(), immediately after the movable_node parameter has
been parsed.
Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
---
Documentation/kernel-parameters.txt | 2 +-
arch/x86/kernel/setup.c | 24 ++++++++++++++++++++++++
mm/memory_hotplug.c | 20 --------------------
3 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 37babf9..adcccd5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2401,7 +2401,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
that the amount of memory usable for all allocations
is not too small.
- movable_node [KNL,X86] Boot-time switch to enable the effects
+ movable_node [KNL] Boot-time switch to enable the effects
of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
MTD_Partition= [MTD]
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 9c337b0..4cfba94 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -985,6 +985,30 @@ void __init setup_arch(char **cmdline_p)
parse_early_param();
+#ifdef CONFIG_MEMORY_HOTPLUG
+ /*
+ * Memory used by the kernel cannot be hot-removed because Linux
+ * cannot migrate the kernel pages. When memory hotplug is
+ * enabled, we should prevent memblock from allocating memory
+ * for the kernel.
+ *
+ * ACPI SRAT records all hotpluggable memory ranges. But before
+ * SRAT is parsed, we don't know about it.
+ *
+ * The kernel image is loaded into memory at very early time. We
+ * cannot prevent this anyway. So on NUMA system, we set any
+ * node the kernel resides in as un-hotpluggable.
+ *
+ * Since on modern servers, one node could have double-digit
+ * gigabytes memory, we can assume the memory around the kernel
+ * image is also un-hotpluggable. So before SRAT is parsed, just
+ * allocate memory near the kernel image to try the best to keep
+ * the kernel away from hotpluggable memory.
+ */
+ if (movable_node_is_enabled())
+ memblock_set_bottom_up(true);
+#endif
+
x86_report_nx();
/* after early param, so could get panic from serial */
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index cad4b91..e43142c1 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1727,26 +1727,6 @@ static bool can_offline_normal(struct zone *zone, unsigned long nr_pages)
static int __init cmdline_parse_movable_node(char *p)
{
#ifdef CONFIG_MOVABLE_NODE
- /*
- * Memory used by the kernel cannot be hot-removed because Linux
- * cannot migrate the kernel pages. When memory hotplug is
- * enabled, we should prevent memblock from allocating memory
- * for the kernel.
- *
- * ACPI SRAT records all hotpluggable memory ranges. But before
- * SRAT is parsed, we don't know about it.
- *
- * The kernel image is loaded into memory at very early time. We
- * cannot prevent this anyway. So on NUMA system, we set any
- * node the kernel resides in as un-hotpluggable.
- *
- * Since on modern servers, one node could have double-digit
- * gigabytes memory, we can assume the memory around the kernel
- * image is also un-hotpluggable. So before SRAT is parsed, just
- * allocate memory near the kernel image to try the best to keep
- * the kernel away from hotpluggable memory.
- */
- memblock_set_bottom_up(true);
movable_node_enabled = true;
#else
pr_warn("movable_node option not supported\n");
--
1.8.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 1/4] powerpc/mm: allow memory hotplug into a memoryless node
From: Reza Arbab @ 2016-11-07 23:44 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Rob Herring, Frank Rowand, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin
Cc: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
devicetree-u79uwXL29TY76Z2rM5mHXA, Bharata B Rao, Nathan Fontenot,
Stewart Smith, Alistair Popple, Balbir Singh, Aneesh Kumar K.V,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1478562276-25539-1-git-send-email-arbab-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Remove the check which prevents us from hotplugging into an empty node.
The original commit b226e4621245 ("[PATCH] powerpc: don't add memory to
empty node/zone"), states that this was intended to be a temporary measure.
It is a workaround for an oops which no longer occurs.
Signed-off-by: Reza Arbab <arbab-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Acked-by: Balbir Singh <bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Nathan Fontenot <nfont-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Bharata B Rao <bharata-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
arch/powerpc/mm/numa.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index a51c188..0cb6bd8 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1085,7 +1085,7 @@ static int hot_add_node_scn_to_nid(unsigned long scn_addr)
int hot_add_scn_to_nid(unsigned long scn_addr)
{
struct device_node *memory = NULL;
- int nid, found = 0;
+ int nid;
if (!numa_enabled || (min_common_depth < 0))
return first_online_node;
@@ -1101,17 +1101,6 @@ int hot_add_scn_to_nid(unsigned long scn_addr)
if (nid < 0 || !node_online(nid))
nid = first_online_node;
- if (NODE_DATA(nid)->node_spanned_pages)
- return nid;
-
- for_each_online_node(nid) {
- if (NODE_DATA(nid)->node_spanned_pages) {
- found = 1;
- break;
- }
- }
-
- BUG_ON(!found);
return nid;
}
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* [PATCH v6 0/4] enable movable nodes on non-x86 configs
From: Reza Arbab @ 2016-11-07 23:44 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Rob Herring, Frank Rowand, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin
Cc: linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Balbir Singh,
Aneesh Kumar K.V, linux-kernel
This patchset allows more configs to make use of movable nodes. When
CONFIG_MOVABLE_NODE is selected, there are two ways to introduce such
nodes into the system:
1. Discover movable nodes at boot. Currently this is only possible on
x86, but we will enable configs supporting fdt to do the same.
2. Hotplug and online all of a node's memory using online_movable. This
is already possible on any config supporting memory hotplug, not
just x86, but the Kconfig doesn't say so. We will fix that.
We'll also remove some cruft on power which would prevent (2).
/* changelog */
v6:
* Add a patch enabling the fdt to describe hotpluggable memory.
v5:
* http://lkml.kernel.org/r/1477339089-5455-1-git-send-email-arbab@linux.vnet.ibm.com
* Drop the patches which recognize the "status" property of dt memory
nodes. Firmware can set the size of "linux,usable-memory" to zero instead.
v4:
* http://lkml.kernel.org/r/1475778995-1420-1-git-send-email-arbab@linux.vnet.ibm.com
* Rename of_fdt_is_available() to of_fdt_device_is_available().
Rename of_flat_dt_is_available() to of_flat_dt_device_is_available().
* Instead of restoring top-down allocation, ensure it never goes
bottom-up in the first place, by making movable_node arch-specific.
* Use MEMORY_HOTPLUG instead of PPC64 in the mm/Kconfig patch.
v3:
* http://lkml.kernel.org/r/1474828616-16608-1-git-send-email-arbab@linux.vnet.ibm.com
* Use Rob Herring's suggestions to improve the node availability check.
* More verbose commit log in the patch enabling CONFIG_MOVABLE_NODE.
* Add a patch to restore top-down allocation the way x86 does.
v2:
* http://lkml.kernel.org/r/1473883618-14998-1-git-send-email-arbab@linux.vnet.ibm.com
* Use the "status" property of standard dt memory nodes instead of
introducing a new "ibm,hotplug-aperture" compatible id.
* Remove the patch which explicitly creates a memoryless node. This set
no longer has any bearing on whether the pgdat is created at boot or
at the time of memory addition.
v1:
* http://lkml.kernel.org/r/1470680843-28702-1-git-send-email-arbab@linux.vnet.ibm.com
Reza Arbab (4):
powerpc/mm: allow memory hotplug into a memoryless node
mm: remove x86-only restriction of movable_node
mm: enable CONFIG_MOVABLE_NODE on non-x86 arches
of/fdt: mark hotpluggable memory
Documentation/kernel-parameters.txt | 2 +-
arch/powerpc/mm/numa.c | 13 +------------
arch/x86/kernel/setup.c | 24 ++++++++++++++++++++++++
drivers/of/fdt.c | 6 ++++++
mm/Kconfig | 2 +-
mm/memory_hotplug.c | 20 --------------------
6 files changed, 33 insertions(+), 34 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH v3] tpm_tis: Allow tpm_tis to be bound using DT
From: Jarkko Sakkinen @ 2016-11-07 23:43 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <1478558671-13256-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On Mon, Nov 07, 2016 at 03:44:31PM -0700, Jason Gunthorpe wrote:
> This provides an open firwmare driver binding for tpm_tis. OF
> is useful on arches where ACPI/PNP is not used.
>
> The tcg,tpm-tis-mmio register map interface is specified by the TCG.
>
> Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
/Jarkko
> ---
> .../bindings/security/tpm/tpm_tis_mmio.txt | 25 ++++++++++++++++++++++
> drivers/char/tpm/Kconfig | 2 +-
> drivers/char/tpm/tpm_tis.c | 11 ++++++++++
> 3 files changed, 37 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
>
> diff --git a/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
> new file mode 100644
> index 000000000000..41d740545189
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
> @@ -0,0 +1,25 @@
> +Trusted Computing Group MMIO Trusted Platform Module
> +
> +The TCG defines multi vendor standard for accessing a TPM chip, this
> +is the standard protocol defined to access the TPM via MMIO. Typically
> +this interface will be implemented over Intel's LPC bus.
> +
> +Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG
> +publication for the specification.
> +
> +Required properties:
> +
> +- compatible: should contain a string below for the chip, followed by
> + "tcg,tpm-tis-mmio". Valid chip strings are:
> + * "atmel,at97sc3204"
> +- reg: The location of the MMIO registers, should be at least 0x5000 bytes
> +- interrupt-parent/interrupts: An optional interrupt indicating command completion.
> +
> +Example:
> +
> + tpm_tis@90000 {
> + compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio";
> + reg = <0x90000 0x5000>;
> + interrupt-parent = <&EIC0>;
> + interrupts = <1 2>;
> + };
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 9faa0b1e7766..277186d3b668 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -32,7 +32,7 @@ config TCG_TIS_CORE
>
> config TCG_TIS
> tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface"
> - depends on X86
> + depends on X86 || OF
> select TCG_TIS_CORE
> ---help---
> If you have a TPM security chip that is compliant with the
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index eaf5730d79eb..0127af130cb1 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -28,6 +28,8 @@
> #include <linux/wait.h>
> #include <linux/acpi.h>
> #include <linux/freezer.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> #include "tpm.h"
> #include "tpm_tis_core.h"
>
> @@ -354,12 +356,21 @@ static int tpm_tis_plat_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id tis_of_platform_match[] = {
> + {.compatible = "tcg,tpm-tis-mmio"},
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, tis_of_platform_match);
> +#endif
> +
> static struct platform_driver tis_drv = {
> .probe = tpm_tis_plat_probe,
> .remove = tpm_tis_plat_remove,
> .driver = {
> .name = "tpm_tis",
> .pm = &tpm_tis_pm,
> + .of_match_table = of_match_ptr(tis_of_platform_match),
> },
> };
>
> --
> 2.1.4
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
^ permalink raw reply
* Re: [PATCH resent v3 3/3] ASoC: omap-abe-twl6040: fix typo in bindings documentation
From: Tony Lindgren @ 2016-11-07 23:29 UTC (permalink / raw)
To: Rob Herring
Cc: H. Nikolaus Schaller, Benoît Cousson, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Russell King,
Russell King, ldewangan, linux-omap, devicetree, linux-kernel,
marek, kernel, letux-kernel
In-Reply-To: <20161031030740.lih7ptbzv4vn7ll6@rob-hp-laptop>
* Rob Herring <robh@kernel.org> [161030 20:08]:
> On Tue, Oct 25, 2016 at 07:38:11PM +0200, H. Nikolaus Schaller wrote:
> > Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> > ---
> > Documentation/devicetree/bindings/sound/omap-abe-twl6040.txt | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Acked-by: Rob Herring <robh@kernel.org>
Applying all three into omap-for-v4.9/fixes so we can
avoid the typo getting used somewhere.
Regards,
Tony
^ permalink raw reply
* [PATCH v3] tpm_tis: Allow tpm_tis to be bound using DT
From: Jason Gunthorpe @ 2016-11-07 22:44 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
devicetree-u79uwXL29TY76Z2rM5mHXA
This provides an open firwmare driver binding for tpm_tis. OF
is useful on arches where ACPI/PNP is not used.
The tcg,tpm-tis-mmio register map interface is specified by the TCG.
Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
.../bindings/security/tpm/tpm_tis_mmio.txt | 25 ++++++++++++++++++++++
drivers/char/tpm/Kconfig | 2 +-
drivers/char/tpm/tpm_tis.c | 11 ++++++++++
3 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
diff --git a/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
new file mode 100644
index 000000000000..41d740545189
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
@@ -0,0 +1,25 @@
+Trusted Computing Group MMIO Trusted Platform Module
+
+The TCG defines multi vendor standard for accessing a TPM chip, this
+is the standard protocol defined to access the TPM via MMIO. Typically
+this interface will be implemented over Intel's LPC bus.
+
+Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG
+publication for the specification.
+
+Required properties:
+
+- compatible: should contain a string below for the chip, followed by
+ "tcg,tpm-tis-mmio". Valid chip strings are:
+ * "atmel,at97sc3204"
+- reg: The location of the MMIO registers, should be at least 0x5000 bytes
+- interrupt-parent/interrupts: An optional interrupt indicating command completion.
+
+Example:
+
+ tpm_tis@90000 {
+ compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio";
+ reg = <0x90000 0x5000>;
+ interrupt-parent = <&EIC0>;
+ interrupts = <1 2>;
+ };
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 9faa0b1e7766..277186d3b668 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -32,7 +32,7 @@ config TCG_TIS_CORE
config TCG_TIS
tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface"
- depends on X86
+ depends on X86 || OF
select TCG_TIS_CORE
---help---
If you have a TPM security chip that is compliant with the
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index eaf5730d79eb..0127af130cb1 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -28,6 +28,8 @@
#include <linux/wait.h>
#include <linux/acpi.h>
#include <linux/freezer.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include "tpm.h"
#include "tpm_tis_core.h"
@@ -354,12 +356,21 @@ static int tpm_tis_plat_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id tis_of_platform_match[] = {
+ {.compatible = "tcg,tpm-tis-mmio"},
+ {},
+};
+MODULE_DEVICE_TABLE(of, tis_of_platform_match);
+#endif
+
static struct platform_driver tis_drv = {
.probe = tpm_tis_plat_probe,
.remove = tpm_tis_plat_remove,
.driver = {
.name = "tpm_tis",
.pm = &tpm_tis_pm,
+ .of_match_table = of_match_ptr(tis_of_platform_match),
},
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* Re: [PATCH v2 1/6] pinctrl-aspeed-g5: Never set SCU90[6]
From: Andrew Jeffery @ 2016-11-07 22:42 UTC (permalink / raw)
To: Linus Walleij, Joel Stanley
Cc: Lee Jones, Mark Rutland, Rob Herring,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CACRpkdbH8eubEHwHCsdJsmqVp3hkBW4vb5DCHvJxz+tyfFqbKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 951 bytes --]
On Mon, 2016-11-07 at 10:34 +0100, Linus Walleij wrote:
> > On Thu, Nov 3, 2016 at 11:59 PM, Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org> wrote:
>
> > In the future I think we should send fixes separately from the rest of
> > the series, so it's clear to Linus where we expect patches to end up.
> >
> > Perhaps Linus can share his preference with us?
>
> Just make it clear to me where the patch is headed, if it is
> a fix or a new feature.
>
> Also mixing stuff in big series is of course problematic because
> all the CC:in on MFD patches and whatnot that I don't apply
> makes the picture blurry, but sometimes it is anyways needed
> for context so it is a soft requirement.
Context was my concern here and I would otherwise have split the rest
of the patches along mfd/pinctrl boundaries. I felt the situation was
odd enough to warrant presenting the full picture.
Andrew
>
> Yours,
> Linus Walleij
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH 03/30] usb: dwc2: gadget: Add descriptor DMA binding
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Mark Rutland
Cc: Vahram Aharonyan
In-Reply-To: <cover.1478558343.git.johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
From: Vahram Aharonyan <vahrama-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Add the devicetree binding to enable descriptor DMA and read it in to
the corresponding parameter during probe.
Signed-off-by: Vahram Aharonyan <vahrama-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Signed-off-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
---
Documentation/devicetree/bindings/usb/dwc2.txt | 1 +
drivers/usb/dwc2/core.h | 4 ++++
drivers/usb/dwc2/gadget.c | 11 +++++++++++
drivers/usb/dwc2/params.c | 4 ++++
4 files changed, 20 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
index 389a461..1db9c37 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.txt
+++ b/Documentation/devicetree/bindings/usb/dwc2.txt
@@ -27,6 +27,7 @@ Refer to phy/phy-bindings.txt for generic phy consumer properties
Refer to usb/generic.txt
- snps,host-dma-disable: disable host DMA mode.
- snps,gadget-dma-enable: enable gadget DMA mode.
+- snps,gadget-dma-desc-enable: enable gadget DMA descriptor mode.
- g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index a1075ad..322ffe0 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -421,6 +421,9 @@ enum dwc2_ep0_state {
* @g_dma: If true, enables dma usage on the device. This
* setting is not auto-detected. It must be
* explicitly enabled (default: false).
+ * @g_dma_desc: If true, enables descriptor DMA. this
+ * setting is not auto-detected. It must be
+ * explicitly enabled (default: false).
* @g_rx_fifo_size: The periodic rx fifo size for the device, in
* DWORDS from 16-32768 (default: 2048 if
* possible, otherwise autodetect).
@@ -500,6 +503,7 @@ struct dwc2_core_params {
/* Gadget parameters */
bool g_dma;
+ bool g_dma_desc;
u16 g_rx_fifo_size;
u16 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 1ba0bfc..4013518 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -96,6 +96,17 @@ static inline bool using_dma(struct dwc2_hsotg *hsotg)
return hsotg->params.g_dma;
}
+/*
+ * using_desc_dma - return the descriptor DMA status of the driver.
+ * @hsotg: The driver state.
+ *
+ * Return true if we're using descriptor DMA.
+ */
+static inline bool using_desc_dma(struct dwc2_hsotg *hsotg)
+{
+ return hsotg->params.g_dma_desc;
+}
+
/**
* dwc2_gadget_incr_frame_num - Increments the targeted frame number.
* @hs_ep: The endpoint
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index aeece91..244ac0b 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1172,6 +1172,10 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
false, false,
dma_capable);
+ dwc2_set_param_bool(hsotg, &p->g_dma_desc, true,
+ "snps,gadget-dma-desc-enable",
+ false, false, !!hw->dma_desc_enable);
+
/*
* The values for g_rx_fifo_size (2048) and
* g_np_tx_fifo_size (1024) come from the legacy s3c
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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 related
* [PATCH 03/30] usb: dwc2: gadget: Add descriptor DMA binding
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Mark Rutland
Cc: Vahram Aharonyan
In-Reply-To: <cover.1478558343.git.johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
From: Vahram Aharonyan <vahrama-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Add the devicetree binding to enable descriptor DMA and read it in to
the corresponding parameter during probe.
Signed-off-by: Vahram Aharonyan <vahrama-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Signed-off-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
---
Documentation/devicetree/bindings/usb/dwc2.txt | 1 +
drivers/usb/dwc2/core.h | 4 ++++
drivers/usb/dwc2/gadget.c | 11 +++++++++++
drivers/usb/dwc2/params.c | 4 ++++
4 files changed, 20 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
index 389a461..1db9c37 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.txt
+++ b/Documentation/devicetree/bindings/usb/dwc2.txt
@@ -27,6 +27,7 @@ Refer to phy/phy-bindings.txt for generic phy consumer properties
Refer to usb/generic.txt
- snps,host-dma-disable: disable host DMA mode.
- snps,gadget-dma-enable: enable gadget DMA mode.
+- snps,gadget-dma-desc-enable: enable gadget DMA descriptor mode.
- g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index a1075ad..322ffe0 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -421,6 +421,9 @@ enum dwc2_ep0_state {
* @g_dma: If true, enables dma usage on the device. This
* setting is not auto-detected. It must be
* explicitly enabled (default: false).
+ * @g_dma_desc: If true, enables descriptor DMA. this
+ * setting is not auto-detected. It must be
+ * explicitly enabled (default: false).
* @g_rx_fifo_size: The periodic rx fifo size for the device, in
* DWORDS from 16-32768 (default: 2048 if
* possible, otherwise autodetect).
@@ -500,6 +503,7 @@ struct dwc2_core_params {
/* Gadget parameters */
bool g_dma;
+ bool g_dma_desc;
u16 g_rx_fifo_size;
u16 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 1ba0bfc..4013518 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -96,6 +96,17 @@ static inline bool using_dma(struct dwc2_hsotg *hsotg)
return hsotg->params.g_dma;
}
+/*
+ * using_desc_dma - return the descriptor DMA status of the driver.
+ * @hsotg: The driver state.
+ *
+ * Return true if we're using descriptor DMA.
+ */
+static inline bool using_desc_dma(struct dwc2_hsotg *hsotg)
+{
+ return hsotg->params.g_dma_desc;
+}
+
/**
* dwc2_gadget_incr_frame_num - Increments the targeted frame number.
* @hs_ep: The endpoint
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index aeece91..244ac0b 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1172,6 +1172,10 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
false, false,
dma_capable);
+ dwc2_set_param_bool(hsotg, &p->g_dma_desc, true,
+ "snps,gadget-dma-desc-enable",
+ false, false, !!hw->dma_desc_enable);
+
/*
* The values for g_rx_fifo_size (2048) and
* g_np_tx_fifo_size (1024) come from the legacy s3c
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* [PATCH 01/30] usb: dwc2: Deprecate g-use-dma binding
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Caesar Wang,
Shawn Lin, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Russell King,
Matthias Brugger, Wei Xu, Andy Yan, Mark Rutland, Will Deacon,
Catalin Marinas, Heiko Stuebner
In-Reply-To: <cover.1478558343.git.johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Add a vendor prefix and make the name more consistent by renaming it to
"snps,gadget-dma-enable".
Signed-off-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
---
Documentation/devicetree/bindings/usb/dwc2.txt | 5 ++++-
arch/arm/boot/dts/rk3036.dtsi | 2 +-
arch/arm/boot/dts/rk3288.dtsi | 2 +-
arch/arm/boot/dts/rk3xxx.dtsi | 2 +-
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 2 +-
arch/arm64/boot/dts/rockchip/rk3368.dtsi | 2 +-
drivers/usb/dwc2/params.c | 9 ++++++++-
drivers/usb/dwc2/pci.c | 2 +-
8 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt
index 9472111..389a461 100644
--- a/Documentation/devicetree/bindings/usb/dwc2.txt
+++ b/Documentation/devicetree/bindings/usb/dwc2.txt
@@ -26,11 +26,14 @@ Refer to phy/phy-bindings.txt for generic phy consumer properties
- dr_mode: shall be one of "host", "peripheral" and "otg"
Refer to usb/generic.txt
- snps,host-dma-disable: disable host DMA mode.
-- g-use-dma: enable dma usage in gadget driver.
+- snps,gadget-dma-enable: enable gadget DMA mode.
- g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
+Deprecated properties:
+- g-use-dma: Use "snps,gadget-dma-enable" instead.
+
Example:
usb@101c0000 {
diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
index a935523..2604d2d 100644
--- a/arch/arm/boot/dts/rk3036.dtsi
+++ b/arch/arm/boot/dts/rk3036.dtsi
@@ -204,7 +204,7 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
- g-use-dma;
+ snps,gadget-dma-enable;
status = "disabled";
};
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 17ec2e2..c0db4ae 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -596,7 +596,7 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
- g-use-dma;
+ snps,gadget-dma-enable;
phys = <&usbphy0>;
phy-names = "usb2-phy";
status = "disabled";
diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi
index e15beb3..c96d622 100644
--- a/arch/arm/boot/dts/rk3xxx.dtsi
+++ b/arch/arm/boot/dts/rk3xxx.dtsi
@@ -181,7 +181,7 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
- g-use-dma;
+ snps,gadget-dma-enable;
phys = <&usbphy0>;
phy-names = "usb2-phy";
status = "disabled";
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
index 17839db..fe441f7 100644
--- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
@@ -747,7 +747,7 @@
clocks = <&sys_ctrl HI6220_USBOTG_HCLK>;
clock-names = "otg";
dr_mode = "otg";
- g-use-dma;
+ snps,gadget-dma-enable;
g-rx-fifo-size = <512>;
g-np-tx-fifo-size = <128>;
g-tx-fifo-size = <128 128 128 128 128 128>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 0fcb214..6b44544 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -537,7 +537,7 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
- g-use-dma;
+ snps,gadget-dma-enable;
status = "disabled";
};
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 2eb79e8..aeece91 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1161,10 +1161,17 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
(hsotg->dr_mode == USB_DR_MODE_OTG)) {
dev_dbg(hsotg->dev, "Setting peripheral device properties\n");
- dwc2_set_param_bool(hsotg, &p->g_dma, true, "g-use-dma",
+ dwc2_set_param_bool(hsotg, &p->g_dma, true,
+ "snps,gadget-dma-enable",
false, false,
dma_capable);
+ /* Check the deprecated property. */
+ if (!p->g_dma)
+ dwc2_set_param_bool(hsotg, &p->g_dma, true, "g-use-dma",
+ false, false,
+ dma_capable);
+
/*
* The values for g_rx_fifo_size (2048) and
* g_np_tx_fifo_size (1024) come from the legacy s3c
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
index b3f3b58..46a9d2b 100644
--- a/drivers/usb/dwc2/pci.c
+++ b/drivers/usb/dwc2/pci.c
@@ -67,7 +67,7 @@ static int dwc2_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc2)
if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS &&
pdev->device == PCI_PRODUCT_ID_HAPS_HSOTG) {
struct property_entry properties[] = {
- PROPERTY_ENTRY_BOOL("g-use-dma"),
+ PROPERTY_ENTRY_BOOL("snps,gadget-dma-enable"),
{ },
};
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* [PATCH 00/30] usb: dwc2: Gadget descriptor DMA and IOT
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb, devicetree, Rob Herring,
Caesar Wang, Shawn Lin, linux-rockchip, linux-arm-kernel,
Russell King, Matthias Brugger, Wei Xu, Andy Yan, Mark Rutland,
Will Deacon, Catalin Marinas, Heiko Stuebner
Cc: Vahram Aharonyan, Vardan Mikayelyan
This series implements gadget-side descriptor DMA for the DWC_hsotg
controller.
It also includes support for DWC USB IOT controllers which use the
descriptor DMA mode of operation exclusively. These are two new
device-only USB controller IPs based on DWC_hsotg.
Tested on HAPS platform with:
* HSOTG IP version 3.30a
* FS/LS IOT IP version 1.00a
* HS IOT IP version 1.00a
This series should be applied on top of:
http://marc.info/?l=linux-usb&m=147822095118860&w=2
Regards,
John
John Youn (2):
usb: dwc2: Deprecate g-use-dma binding
usb: dwc2: Enable gadget DDMA by default for HAPS
Vahram Aharonyan (25):
usb: dwc2: Update DMA descriptor structure
usb: dwc2: gadget: Add descriptor DMA binding
usb: dwc2: gadget: Add DMA descriptor status quadlet fields
usb: dwc2: gadget: Enable BNA interrupt in descriptor DMA mode
usb: dwc2: gadget: Add DMA descriptor chains for EP 0
usb: dwc2: host: Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT
usb: dwc2: gadget: Transfer length limit checking for DDMA
usb: dwc2: gadget: Add DDMA chain pointers to dwc2_hsotg_ep structure
usb: dwc2: gadget: Add DDMA chain fill and parse functions
usb: dwc2: gadget: EP 0 specific DDMA programming
usb: dwc2: gadget: DDMA transfer start and complete
usb: dwc2: gadget: Fixes for StsPhseRcvd interrupt
usb: dwc2: gadget: Start DDMA IN status phase in StsPhseRcvd handler
usb: dwc2: gadget: Enable descriptor DMA mode
usb: dwc2: gadget: Add DDMA isoc related fields to dwc2_hsotg_ep
usb: dwc2: gadget: Fill isoc descriptor and start transfer in DDMA
usb: dwc2: gadget: Add completions for DDMA isoc transfers
usb: dwc2: gadget: In DDMA keep incompISOOUT and incompISOIN masked
usb: dwc2: gadget: Add start and complete calls for DDMA ISOC
usb: dwc2: gadget: Adjust ISOC OUT request's actual len for DDMA
usb: dwc2: gadget: Adjustments in debug prints
usb: dwc2: gadget: For DDMA parse setup only after SetUp interrupt
usb: dwc2: gadget: Correct dwc2_hsotg_ep_stop_xfr() function
usb: dwc2: gadget: Disable enabled HW endpoint in
dwc2_hsotg_ep_disable
usb: dwc2: Add support of dedicated full-speed PHY interface
Vardan Mikayelyan (3):
usb: dwc2: gadget: Add IOT device IDs, configure core accordingly
usb: dwc2: gadget: Program ep0_mps for LS
usb: dwc2: gadget: Add new core parameter for low speed
Documentation/devicetree/bindings/usb/dwc2.txt | 6 +-
arch/arm/boot/dts/rk3036.dtsi | 2 +-
arch/arm/boot/dts/rk3288.dtsi | 2 +-
arch/arm/boot/dts/rk3xxx.dtsi | 2 +-
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 2 +-
arch/arm64/boot/dts/rockchip/rk3368.dtsi | 2 +-
drivers/usb/dwc2/core.h | 48 ++
drivers/usb/dwc2/gadget.c | 978 ++++++++++++++++++++++---
drivers/usb/dwc2/hcd.c | 12 +-
drivers/usb/dwc2/hcd.h | 2 +-
drivers/usb/dwc2/hcd_ddma.c | 52 +-
drivers/usb/dwc2/hw.h | 48 +-
drivers/usb/dwc2/params.c | 42 +-
drivers/usb/dwc2/pci.c | 3 +-
14 files changed, 1039 insertions(+), 162 deletions(-)
--
2.10.0
^ permalink raw reply
* [PATCH 00/30] usb: dwc2: Gadget descriptor DMA and IOT
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Caesar Wang,
Shawn Lin, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Russell King,
Matthias Brugger, Wei Xu, Andy Yan, Mark Rutland, Will Deacon,
Catalin Marinas, Heiko Stuebner
Cc: Vardan Mikayelyan, Vahram Aharonyan
This series implements gadget-side descriptor DMA for the DWC_hsotg
controller.
It also includes support for DWC USB IOT controllers which use the
descriptor DMA mode of operation exclusively. These are two new
device-only USB controller IPs based on DWC_hsotg.
Tested on HAPS platform with:
* HSOTG IP version 3.30a
* FS/LS IOT IP version 1.00a
* HS IOT IP version 1.00a
This series should be applied on top of:
http://marc.info/?l=linux-usb&m=147822095118860&w=2
Regards,
John
John Youn (2):
usb: dwc2: Deprecate g-use-dma binding
usb: dwc2: Enable gadget DDMA by default for HAPS
Vahram Aharonyan (25):
usb: dwc2: Update DMA descriptor structure
usb: dwc2: gadget: Add descriptor DMA binding
usb: dwc2: gadget: Add DMA descriptor status quadlet fields
usb: dwc2: gadget: Enable BNA interrupt in descriptor DMA mode
usb: dwc2: gadget: Add DMA descriptor chains for EP 0
usb: dwc2: host: Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT
usb: dwc2: gadget: Transfer length limit checking for DDMA
usb: dwc2: gadget: Add DDMA chain pointers to dwc2_hsotg_ep structure
usb: dwc2: gadget: Add DDMA chain fill and parse functions
usb: dwc2: gadget: EP 0 specific DDMA programming
usb: dwc2: gadget: DDMA transfer start and complete
usb: dwc2: gadget: Fixes for StsPhseRcvd interrupt
usb: dwc2: gadget: Start DDMA IN status phase in StsPhseRcvd handler
usb: dwc2: gadget: Enable descriptor DMA mode
usb: dwc2: gadget: Add DDMA isoc related fields to dwc2_hsotg_ep
usb: dwc2: gadget: Fill isoc descriptor and start transfer in DDMA
usb: dwc2: gadget: Add completions for DDMA isoc transfers
usb: dwc2: gadget: In DDMA keep incompISOOUT and incompISOIN masked
usb: dwc2: gadget: Add start and complete calls for DDMA ISOC
usb: dwc2: gadget: Adjust ISOC OUT request's actual len for DDMA
usb: dwc2: gadget: Adjustments in debug prints
usb: dwc2: gadget: For DDMA parse setup only after SetUp interrupt
usb: dwc2: gadget: Correct dwc2_hsotg_ep_stop_xfr() function
usb: dwc2: gadget: Disable enabled HW endpoint in
dwc2_hsotg_ep_disable
usb: dwc2: Add support of dedicated full-speed PHY interface
Vardan Mikayelyan (3):
usb: dwc2: gadget: Add IOT device IDs, configure core accordingly
usb: dwc2: gadget: Program ep0_mps for LS
usb: dwc2: gadget: Add new core parameter for low speed
Documentation/devicetree/bindings/usb/dwc2.txt | 6 +-
arch/arm/boot/dts/rk3036.dtsi | 2 +-
arch/arm/boot/dts/rk3288.dtsi | 2 +-
arch/arm/boot/dts/rk3xxx.dtsi | 2 +-
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 2 +-
arch/arm64/boot/dts/rockchip/rk3368.dtsi | 2 +-
drivers/usb/dwc2/core.h | 48 ++
drivers/usb/dwc2/gadget.c | 978 ++++++++++++++++++++++---
drivers/usb/dwc2/hcd.c | 12 +-
drivers/usb/dwc2/hcd.h | 2 +-
drivers/usb/dwc2/hcd_ddma.c | 52 +-
drivers/usb/dwc2/hw.h | 48 +-
drivers/usb/dwc2/params.c | 42 +-
drivers/usb/dwc2/pci.c | 3 +-
14 files changed, 1039 insertions(+), 162 deletions(-)
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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
* [PATCH 00/30] usb: dwc2: Gadget descriptor DMA and IOT
From: John Youn @ 2016-11-07 22:39 UTC (permalink / raw)
To: John Youn, Felipe Balbi, linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Caesar Wang,
Shawn Lin, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Russell King,
Matthias Brugger, Wei Xu, Andy Yan, Mark Rutland, Will Deacon,
Catalin Marinas, Heiko Stuebner
Cc: Vardan Mikayelyan, Vahram Aharonyan
This series implements gadget-side descriptor DMA for the DWC_hsotg
controller.
It also includes support for DWC USB IOT controllers which use the
descriptor DMA mode of operation exclusively. These are two new
device-only USB controller IPs based on DWC_hsotg.
Tested on HAPS platform with:
* HSOTG IP version 3.30a
* FS/LS IOT IP version 1.00a
* HS IOT IP version 1.00a
This series should be applied on top of:
http://marc.info/?l=linux-usb&m=147822095118860&w=2
Regards,
John
John Youn (2):
usb: dwc2: Deprecate g-use-dma binding
usb: dwc2: Enable gadget DDMA by default for HAPS
Vahram Aharonyan (25):
usb: dwc2: Update DMA descriptor structure
usb: dwc2: gadget: Add descriptor DMA binding
usb: dwc2: gadget: Add DMA descriptor status quadlet fields
usb: dwc2: gadget: Enable BNA interrupt in descriptor DMA mode
usb: dwc2: gadget: Add DMA descriptor chains for EP 0
usb: dwc2: host: Rename MAX_DMA_DESC_SIZE to HOST_DMA_NBYTES_LIMIT
usb: dwc2: gadget: Transfer length limit checking for DDMA
usb: dwc2: gadget: Add DDMA chain pointers to dwc2_hsotg_ep structure
usb: dwc2: gadget: Add DDMA chain fill and parse functions
usb: dwc2: gadget: EP 0 specific DDMA programming
usb: dwc2: gadget: DDMA transfer start and complete
usb: dwc2: gadget: Fixes for StsPhseRcvd interrupt
usb: dwc2: gadget: Start DDMA IN status phase in StsPhseRcvd handler
usb: dwc2: gadget: Enable descriptor DMA mode
usb: dwc2: gadget: Add DDMA isoc related fields to dwc2_hsotg_ep
usb: dwc2: gadget: Fill isoc descriptor and start transfer in DDMA
usb: dwc2: gadget: Add completions for DDMA isoc transfers
usb: dwc2: gadget: In DDMA keep incompISOOUT and incompISOIN masked
usb: dwc2: gadget: Add start and complete calls for DDMA ISOC
usb: dwc2: gadget: Adjust ISOC OUT request's actual len for DDMA
usb: dwc2: gadget: Adjustments in debug prints
usb: dwc2: gadget: For DDMA parse setup only after SetUp interrupt
usb: dwc2: gadget: Correct dwc2_hsotg_ep_stop_xfr() function
usb: dwc2: gadget: Disable enabled HW endpoint in
dwc2_hsotg_ep_disable
usb: dwc2: Add support of dedicated full-speed PHY interface
Vardan Mikayelyan (3):
usb: dwc2: gadget: Add IOT device IDs, configure core accordingly
usb: dwc2: gadget: Program ep0_mps for LS
usb: dwc2: gadget: Add new core parameter for low speed
Documentation/devicetree/bindings/usb/dwc2.txt | 6 +-
arch/arm/boot/dts/rk3036.dtsi | 2 +-
arch/arm/boot/dts/rk3288.dtsi | 2 +-
arch/arm/boot/dts/rk3xxx.dtsi | 2 +-
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 2 +-
arch/arm64/boot/dts/rockchip/rk3368.dtsi | 2 +-
drivers/usb/dwc2/core.h | 48 ++
drivers/usb/dwc2/gadget.c | 978 ++++++++++++++++++++++---
drivers/usb/dwc2/hcd.c | 12 +-
drivers/usb/dwc2/hcd.h | 2 +-
drivers/usb/dwc2/hcd_ddma.c | 52 +-
drivers/usb/dwc2/hw.h | 48 +-
drivers/usb/dwc2/params.c | 42 +-
drivers/usb/dwc2/pci.c | 3 +-
14 files changed, 1039 insertions(+), 162 deletions(-)
--
2.10.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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: [PATCH v5 1/7] drm: sunxi: Add a basic DRM driver for Allwinner DE2
From: Maxime Ripard @ 2016-11-07 22:37 UTC (permalink / raw)
To: Jean-Francois Moine
Cc: Dave Airlie, Liam Girdwood, Mark Brown, Rob Herring,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <20161028193420.0f7dc67ea1042ff72b09b701-GANU6spQydw@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 9792 bytes --]
Hi,
On Fri, Oct 28, 2016 at 07:34:20PM +0200, Jean-Francois Moine wrote:
> On Fri, 28 Oct 2016 00:03:16 +0200
> Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>
> > On Tue, Oct 25, 2016 at 04:14:41PM +0200, Jean-Francois Moine wrote:
> > > > > +Display controller
> > > > > +==================
> > > > > +
> > > > > +Required properties:
> > > > > +
> > > > > +- compatible: value should be one of the following
> > > > > + "allwinner,sun8i-a83t-display-engine"
> > > > > + "allwinner,sun8i-h3-display-engine"
> > > > > +
> > > > > +- clocks: must include clock specifiers corresponding to entries in the
> > > > > + clock-names property.
> > > > > +
> > > > > +- clock-names: must contain
> > > > > + "gate": for DE activation
> > > > > + "clock": DE clock
> > > >
> > > > We've been calling them bus and mod.
> > >
> > > I can understand "bus" (which is better than "apb"), but why "mod"?
> >
> > Allwinner has been calling the clocks that are supposed to generate
> > the external signals (depending on where you were looking) module or
> > mod clocks (which is also why we have mod in the clock
> > compatibles). The module 1 clocks being used for the audio and the
> > module 0 for the rest (SPI, MMC, NAND, display, etc.)
>
> I did not find any 'module' in the H3 documentation.
> So, is it really a good name?
It's true that they use it less nowadays, but they still do,
ie. https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/drivers/clk/sunxi/clk-sun8iw7.c#L513
And we have to remain consistent anyway.
> > > > > +
> > > > > +- resets: phandle to the reset of the device
> > > > > +
> > > > > +- ports: phandle's to the LCD ports
> > > >
> > > > Please use the OF graph.
> > >
> > > These ports are references to the graph of nodes. See
> > > http://www.kernelhub.org/?msg=911825&p=2
> >
> > In an OF-graph, your phandle to the LCD controller would be replaced
> > by an output endpoint.
>
> This is the DE controller. There is no endpoint link at this level.
The display engine definitely has an endpoint: the TCON.
> The Device Engine just handles the planes of the LCDs, but, indeed,
> the LCDs must know about the DE and the DE must know about the LCDs.
> There are 2 ways to realize this knowledge in the DT:
> 1) either the DE has one or two phandle's to the LCDs,
> 2) or the LCDs have a phandle to the DE.
>
> I chose the 1st way, the DE ports pointing to the endpoint of the LCDs
> which is part of the video link (OF-graph LCD <-> connector).
> It would be possible to have phandles to the LCDs themselves, but this
> asks for more code.
>
> The second way is also possible, but it also complexifies a bit the
> exchanges DE <-> LCD.
I'm still not sure how it would complexify anything, and why you can't
use the display graph to model the relation between the display engine
and the TCON (and why you want to use a generic property that refers
to the of-graph while it really isn't).
> > > > > +void de2_disable_vblank(struct drm_device *drm, unsigned crtc)
> > > > > +{
> > > > > + struct priv *priv = drm->dev_private;
> > > > > + struct lcd *lcd = priv->lcds[crtc];
> > > > > +
> > > > > + tcon_write(lcd->mmio, gint0,
> > > > > + tcon_read(lcd->mmio, gint0) &
> > > > > + ~TCON_GINT0_TCON1_Vb_Int_En);
> > > > > +}
> > > > > +
> > > > > +/* panel functions */
> > > >
> > > > Panel functions? In the CRTC driver?
> > >
> > > Yes, dumb panel.
> >
> > What do you mean by that? Using a Parallel/RGB interface?
>
> Sorry, I though this was a well-known name. The 'dump panel' was used
> in the documentation of my previous ARM machine as the video frame sent
> to the HDMI controller. 'video_frame' is OK for you?
If it's the frame sent to the encoder, then it would be the CRTC by
DRM's nomenclature.
> > > > > +static const struct {
> > > > > + char chan;
> > > > > + char layer;
> > > > > + char pipe;
> > > > > +} plane2layer[DE2_N_PLANES] = {
> > > > > + [DE2_PRIMARY_PLANE] = {0, 0, 0},
> > > > > + [DE2_CURSOR_PLANE] = {1, 0, 1},
> > > > > + [DE2_VI_PLANE] = {0, 1, 0},
> > > > > +};
> > > >
> > > > Comments?
> > >
> > > This
> > > primary plane is channel 0 (VI), layer 0, pipe 0
> > > cursor plane is channel 1 (UI), layer 0, pipe 1
> > > overlay plane is channel 0 (VI), layer 1, pipe 0
> > > or the full explanation:
> > > Constraints:
> > > The VI channels can do RGB or YUV, while UI channels can do RGB
> > > only.
> > > The LCD 0 has 1 VI channel and 4 UI channels, while
> > > LCD 1 has only 1 VI channel and 1 UI channel.
> > > The cursor must go to a channel bigger than the primary channel,
> > > otherwise it is not transparent.
> > > First try:
> > > Letting the primary plane (usually RGB) in the 2nd channel (UI),
> > > as this is done in the legacy driver, asks for the cursor to go
> > > to the next channel (UI), but this one does not exist in LCD1.
> > > Retained layout:
> > > So, we must use only 2 channels for the same behaviour on LCD0
> > > (H3) and LCD1 (A83T)
> > > The retained combination is:
> > > - primary plane in the first channel (VI),
> > > - cursor plane inthe 2nd channel (UI), and
> > > - overlay plane in the 1st channel (VI).
> > >
> > > Note that there could be 3 overlay planes (a channel has 4
> > > layers), but I am not sure that the A83T or the H3 could
> > > support 3 simultaneous video streams...
> >
> > Do you know if the pipe works in the old display engine?
> >
> > Especially about the two-steps composition that wouldn't allow you to
> > have alpha on all the planes?
> >
> > If it is similar, I think hardcoding the pipe number is pretty bad,
> > because that would restrict the combination of planes and formats,
> > while some other might have worked.
>
> From what I understood about the DE2, the pipes just define the priority
> of the overlay channels (one pipe for one channel).
> With the cursor constraint, there must be at least 2 channels in
> order (primary, cursor). Then, with these 2 channels/pipes, there can be
> 6 so-called overlay planes (3 RGB/YUV and 3 RGB only).
> Enabling the pipes 2 and 3 (LCD 0 only) would offer 8 more planes, but
> RGB only. Then, it might be useful to have dynamic pipes.
That's very valuable (and definitely should go into a comment),
thanks!
I still believe that's it should be into a (simple at first)
atomic_check. That would be easier to extend and quite easy to
document and get simply by looking at the code.
> > > > > +static int __init de2_drm_init(void)
> > > > > +{
> > > > > + int ret;
> > > > > +
> > > > > +/* uncomment to activate the drm traces at startup time */
> > > > > +/* drm_debug = DRM_UT_CORE | DRM_UT_DRIVER | DRM_UT_KMS |
> > > > > + DRM_UT_PRIME | DRM_UT_ATOMIC; */
> > > >
> > > > That's useless.
> > >
> > > Right, but it seems that some people don't know how to debug a DRM
> > > driver. This is only a reminder.
> > >
> > > > > + DRM_DEBUG_DRIVER("\n");
> > > > > +
> > > > > + ret = platform_driver_register(&de2_lcd_platform_driver);
> > > > > + if (ret < 0)
> > > > > + return ret;
> > > > > +
> > > > > + ret = platform_driver_register(&de2_drm_platform_driver);
> > > > > + if (ret < 0)
> > > > > + platform_driver_unregister(&de2_lcd_platform_driver);
> > > > > +
> > > > > + return ret;
> > > > > +}
> > > >
> > > > And that really shouldn't be done that way.
> > >
> > > May you explain?
> >
> > This goes against the whole idea of the device and driver
> > model. Drivers should only register themselves, device should be
> > created by buses (or by using some external components if the bus
> > can't: DT, ACPI, etc.). If there's a match, you get probed.
> >
> > A driver that creates its own device just to probe itself violates
> > that.
>
> In this function (module init), there is no driver yet.
> The module contains 2 drivers: the DE (planes) and the LCD (CRTC),
> and there is no macro to handle such modules.
Ah, yes, my bad. I thought you were registering a device and a
driver. Still this is a very unusual pattern. Why do you need to split
the two? Can't you just merge them?
> > > > > +int de2_plane_init(struct drm_device *drm, struct lcd *lcd)
> > > > > +{
> > > > > + int ret, possible_crtcs = 1 << lcd->crtc_idx;
> > > > > +
> > > > > + ret = de2_one_plane_init(drm, &lcd->planes[DE2_PRIMARY_PLANE],
> > > > > + DRM_PLANE_TYPE_PRIMARY, possible_crtcs,
> > > > > + ui_formats, ARRAY_SIZE(ui_formats));
> > > > > + if (ret >= 0)
> > > > > + ret = de2_one_plane_init(drm, &lcd->planes[DE2_CURSOR_PLANE],
> > > > > + DRM_PLANE_TYPE_CURSOR, possible_crtcs,
> > > > > + ui_formats, ARRAY_SIZE(ui_formats));
> > > >
> > > > Nothing looks really special about that cursor plane. Any reasion not
> > > > to make it an overlay?
> > >
> > > As explained above (channel/layer/pipe plane definitions), the cursor
> > > cannot go in a channel lower or equal to the one of the primary plane.
> > > Then, it must be known and, so, have an explicit plane.
> >
> > If you were to make it a plane, you could use atomic_check to check
> > this and make sure this doesn't happen. And you would gain a generic
> > plane that can be used for other purposes if needed.
>
> The function drm_crtc_init_with_planes() offers a cursor plane for free.
> On the other side, having 6 overlay planes is more than the SoCs can
> support.
It's not really for free, it costs you a generic plane that could
definitely be used for something else and cannot anymore because
they've been hardcoded to a cursor.
And having a camera, the VPU or even an application directly output
directly into one of these planes seems a much better use of a generic
plane than a cursor.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH 2/8] ARM64: dts: meson-gxl: Add pinctrl nodes
From: Kevin Hilman @ 2016-11-07 22:30 UTC (permalink / raw)
To: Neil Armstrong
Cc: carlo, linus.walleij, linux-amlogic, linux-arm-kernel,
linux-kernel, devicetree
In-Reply-To: <1477932286-27482-3-git-send-email-narmstrong@baylibre.com>
Neil Armstrong <narmstrong@baylibre.com> writes:
> Add pinctrl nodes and pin definitions for Amlogic Meson GXL.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 168 +++++++++++++++++++++++++++++
> 1 file changed, 168 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> index 13b10ee..ce7f550 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> @@ -42,7 +42,175 @@
> */
>
> #include "meson-gx.dtsi"
> +#include <dt-bindings/gpio/meson-gxl-gpio.h>
Oops, this has a dependency on the patch going through the pinctrl tree,
which causes probelems we like to avoid in the arm-soc tree.
For now, I've changed this to use the GXBB include since the values used
are the same, but we can fix this for good in v4.10-rc, after the GXL
pinctrl changes are merged.
Kevin
[1] [PATCH] pinctrl: meson: Add GXL pinctrl definitions
> / {
> compatible = "amlogic,meson-gxl";
> };
> +
> +&aobus {
> + pinctrl_aobus: pinctrl@14 {
> + compatible = "amlogic,meson-gxl-aobus-pinctrl";
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + gpio_ao: bank@14 {
> + reg = <0x0 0x00014 0x0 0x8>,
> + <0x0 0x0002c 0x0 0x4>,
> + <0x0 0x00024 0x0 0x8>;
> + reg-names = "mux", "pull", "gpio";
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +
> + uart_ao_a_pins: uart_ao_a {
> + mux {
> + groups = "uart_tx_ao_a", "uart_rx_ao_a";
> + function = "uart_ao";
> + };
> + };
> +
> + remote_input_ao_pins: remote_input_ao {
> + mux {
> + groups = "remote_input_ao";
> + function = "remote_input_ao";
> + };
> + };
> + };
> +};
> +
> +&periphs {
> + pinctrl_periphs: pinctrl@4b0 {
> + compatible = "amlogic,meson-gxl-periphs-pinctrl";
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + gpio: bank@4b0 {
> + reg = <0x0 0x004b0 0x0 0x28>,
> + <0x0 0x004e8 0x0 0x14>,
> + <0x0 0x00120 0x0 0x14>,
> + <0x0 0x00430 0x0 0x40>;
> + reg-names = "mux", "pull", "pull-enable", "gpio";
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +
> + emmc_pins: emmc {
> + mux {
> + groups = "emmc_nand_d07",
> + "emmc_cmd",
> + "emmc_clk",
> + "emmc_ds";
> + function = "emmc";
> + };
> + };
> +
> + sdcard_pins: sdcard {
> + mux {
> + groups = "sdcard_d0",
> + "sdcard_d1",
> + "sdcard_d2",
> + "sdcard_d3",
> + "sdcard_cmd",
> + "sdcard_clk";
> + function = "sdcard";
> + };
> + };
> +
> + sdio_pins: sdio {
> + mux {
> + groups = "sdio_d0",
> + "sdio_d1",
> + "sdio_d2",
> + "sdio_d3",
> + "sdio_cmd",
> + "sdio_clk";
> + function = "sdio";
> + };
> + };
> +
> + sdio_irq_pins: sdio_irq {
> + mux {
> + groups = "sdio_irq";
> + function = "sdio";
> + };
> + };
> +
> + uart_a_pins: uart_a {
> + mux {
> + groups = "uart_tx_a",
> + "uart_rx_a";
> + function = "uart_a";
> + };
> + };
> +
> + uart_b_pins: uart_b {
> + mux {
> + groups = "uart_tx_b",
> + "uart_rx_b";
> + function = "uart_b";
> + };
> + };
> +
> + uart_c_pins: uart_c {
> + mux {
> + groups = "uart_tx_c",
> + "uart_rx_c";
> + function = "uart_c";
> + };
> + };
> +
> + i2c_a_pins: i2c_a {
> + mux {
> + groups = "i2c_sck_a",
> + "i2c_sda_a";
> + function = "i2c_a";
> + };
> + };
> +
> + i2c_b_pins: i2c_b {
> + mux {
> + groups = "i2c_sck_b",
> + "i2c_sda_b";
> + function = "i2c_b";
> + };
> + };
> +
> + i2c_c_pins: i2c_c {
> + mux {
> + groups = "i2c_sck_c",
> + "i2c_sda_c";
> + function = "i2c_c";
> + };
> + };
> +
> + eth_pins: eth_c {
> + mux {
> + groups = "eth_mdio",
> + "eth_mdc",
> + "eth_clk_rx_clk",
> + "eth_rx_dv",
> + "eth_rxd0",
> + "eth_rxd1",
> + "eth_rxd2",
> + "eth_rxd3",
> + "eth_rgmii_tx_clk",
> + "eth_tx_en",
> + "eth_txd0",
> + "eth_txd1",
> + "eth_txd2",
> + "eth_txd3";
> + function = "eth";
> + };
> + };
> +
> + pwm_e_pins: pwm_e {
> + mux {
> + groups = "pwm_e";
> + function = "pwm_e";
> + };
> + };
> + };
> +};
^ permalink raw reply
* [PATCH 3/3] ARM64: dts: marvell: Fixup memory DT warning for Armada 37xx
From: Gregory CLEMENT @ 2016-11-07 21:41 UTC (permalink / raw)
To: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Gregory CLEMENT
Cc: Thomas Petazzoni,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161107214128.18401-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
memory has a reg property so the unit name should contain an address.
Signed-off-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm64/boot/dts/marvell/armada-3720-db.dts | 2 +-
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-db.dts b/arch/arm64/boot/dts/marvell/armada-3720-db.dts
index 1372e9a6aaa4..a260ae25b658 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts
@@ -56,7 +56,7 @@
stdout-path = "serial0:115200n8";
};
- memory {
+ memory@0 {
device_type = "memory";
reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
};
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
index eadd5993c7bd..83178d909fc2 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
@@ -55,7 +55,7 @@
stdout-path = "serial0:115200n8";
};
- memory {
+ memory@0 {
device_type = "memory";
reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
};
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* Re: [PATCH v8 3/3] fpga: Add support for Lattice iCE40 FPGAs
From: Moritz Fischer @ 2016-11-07 21:41 UTC (permalink / raw)
To: Joel Holdsworth
Cc: Alan Tull, Geert Uytterhoeven, Rob Herring, Devicetree List,
Linux Kernel Mailing List, linux-spi-u79uwXL29TY76Z2rM5mHXA,
Marek Vašut, clifford-cPpHkPqGOEfk7+2FdBfRIA
In-Reply-To: <da65c3e6-c0cf-df38-7f1b-c05d674f002c-IJEoVVyKhCJXvIrf17iDB/XRex20P6io@public.gmane.org>
Hi Joel,
On Mon, Nov 7, 2016 at 11:02 AM, Joel Holdsworth
<joel-IJEoVVyKhCJXvIrf17iDB/XRex20P6io@public.gmane.org> wrote:
> Hi Moritz - thanks for your comments.
>
>
>>> An example of such a device is the icoBoard; a RaspberryPI HAT which
>>> features an iCE40HX8K with a 1 or 8 MBit SRAM and ports for
>>> Digilent-compatible PMOD modules. A PMOD module may contain a device
>>> with which the kernel communicates, via the FPGA.
>>
>>
>> Personally I find this a bit verbose, but that's just me.
>
>
> I could cut it down a bit if you want. I was just trying to make the case
> for why this *has* to be in the kernel rather than just being done from
> user-space.
>
>
>>> + struct spi_transfer assert_cs_then_reset_delay = {.cs_change = 1,
>>> + .delay_usecs = ICE40_SPI_FPGAMGR_RESET_DELAY};
>>
>>
>> Formatting looks odd, can you move the .cs_change to the next line?
>
>
> Marek made the same comment. I'll make the change.
>
>
>>> +static int ice40_fpga_ops_write_complete(struct fpga_manager *mgr, u32
>>> flags)
>>> +{
>>> + struct ice40_fpga_priv *priv = mgr->priv;
>>> + struct spi_device *dev = priv->dev;
>>> + const u8 padding[ICE40_SPI_FPGAMGR_NUM_ACTIVATION_BYTES] = {0,};
>>> +
>>> + /* Check CDONE is asserted */
>>> + if (!gpiod_get_value(priv->cdone)) {
>>> + dev_err(&dev->dev,
>>> + "CDONE was not asserted after firmware
>>> transfer\n");
>>> + return -EIO;
>>> + }
>>> +
>>> + /* Send of zero-padding to activate the firmware */
>>> + return spi_write(dev, padding, sizeof(padding));
>>
>>
>> I'd move all of these into the write() callback.
>
>
> Is that correct? I was under the impression that write might be called
> multiple times to load firmware in multiple chunks.
Nah, you're right. Don't listen to me :)
>
>
>>> + /* Enter reset */
>>> + gpiod_set_value(priv->reset, 1);
>>
>>
>> I know Marek had suggested this, none of the other drivers behave like
>> that.
>> I'm not sure this is expected behavior for most people.
>
>
> For me it's not a big deal either way, but I think it's quite good for the
> driver to reset the device.
>
> When you remove most other drivers, you expect the driver to shut the device
> down, so isn't this just the same?
>
> ...but then the FPGA manager is a unique best with its own conventions, so
> perhaps it should behave differently.
>
> How can we get a consensus about this?
Fair enough. I don't mind either way all that much, just thought I'd
bring it up.
Thanks,
Moritz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 2/3] arm64: dts: marvell: Fixup config-space DT warning For Armada 7K/8K
From: Gregory CLEMENT @ 2016-11-07 21:41 UTC (permalink / raw)
To: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Gregory CLEMENT
Cc: Thomas Petazzoni,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161107214128.18401-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
config-space has a ranges property so the unit name should contain an
address.
Signed-off-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm64/boot/dts/marvell/armada-ap806.dtsi | 2 +-
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi | 2 +-
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
index 7b6136182ad0..a749ba2edec4 100644
--- a/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-ap806.dtsi
@@ -71,7 +71,7 @@
interrupt-parent = <&gic>;
ranges;
- config-space {
+ config-space@f0000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
index e5e3ed678b6f..607e9a3ef834 100644
--- a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
@@ -52,7 +52,7 @@
interrupt-parent = <&gic>;
ranges;
- config-space {
+ config-space@f2000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
index 842fb333285c..88e74069c666 100644
--- a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
@@ -52,7 +52,7 @@
interrupt-parent = <&gic>;
ranges;
- config-space {
+ config-space@f4000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* [PATCH 1/3] arm64: dts: marvell: Fixup internal-regs DT warning for Armada 37xx
From: Gregory CLEMENT @ 2016-11-07 21:41 UTC (permalink / raw)
To: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Gregory CLEMENT
Cc: Thomas Petazzoni,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161107214128.18401-1-gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
internal-regs has a ranges property so the unit name should contain an
address.
Signed-off-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
index c4762538ec01..f1596daa2bc7 100644
--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
@@ -91,7 +91,7 @@
#size-cells = <2>;
ranges;
- internal-regs {
+ internal-regs@d0000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
* [PATCH 0/3] Various ARM64 Armada DT warning fixup
From: Gregory CLEMENT @ 2016-11-07 21:41 UTC (permalink / raw)
To: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Gregory CLEMENT
Cc: Thomas Petazzoni,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
devicetree-u79uwXL29TY76Z2rM5mHXA
Following the series sent for Armada 370/XP, this patchset fixes up
various warning from the DT compiler when using the flag W=1 with
make.
Being a fresh new port, the arm64 we did a better job for dt than for
the arm32 so there is only a few patches needed.
Gregory
Gregory CLEMENT (3):
arm64: dts: marvell: Fixup internal-regs DT warning for Armada 37xx
arm64: dts: marvell: Fixup config-space DT warning For Armada 7K/8K
ARM64: dts: marvell: Fixup memory DT warning for Armada 37xx
arch/arm64/boot/dts/marvell/armada-3720-db.dts | 2 +-
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts | 2 +-
arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 +-
arch/arm64/boot/dts/marvell/armada-ap806.dtsi | 2 +-
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi | 2 +-
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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: [v15, 3/7] powerpc/fsl: move mpc85xx.h to include/linux/fsl
From: Arnd Bergmann @ 2016-11-07 21:20 UTC (permalink / raw)
To: Y.B. Lu
Cc: linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Scott Wood,
Mark Rutland, Greg Kroah-Hartman, X.B. Xie, M.H. Lian,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Qiang Zhao,
Russell King, Bhupesh Sharma, Joerg Roedel, Claudiu Manoil,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring
In-Reply-To: <DB6PR0401MB2536B1B2E6AC36BDC8FC540DF8AE0-2mNvjAGDOPkZcyyZo0JLBI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
On Monday, October 31, 2016 9:35:33 AM CET Y.B. Lu wrote:
> >
> > I don't see any of the contents of this header referenced by the soc
> > driver any more. I think you can just drop this patch.
> >
>
> [Lu Yangbo-B47093] This header file was included by guts.c.
> The guts driver used macro SVR_MAJ/SVR_MIN for calculation.
>
> This header file was for powerpc arch before. And this patch is to made it as
> common header file for both ARM and PPC.
> Sooner or later this is needed.
Let's discuss it once we actually need the header then, ok?
Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH v3 10/10] ARM: dts: da850: add usb device node
From: Axel Haslam @ 2016-11-07 20:39 UTC (permalink / raw)
To: stern, gregkh, nsekhar, khilman, david, robh+dt
Cc: devicetree, linux-usb, linux-kernel, linux-arm-kernel,
Axel Haslam
In-Reply-To: <20161107203948.28324-1-ahaslam@baylibre.com>
This adds the ohci device node for the da850 soc.
It also enables it for the omapl138 hawk board.
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
arch/arm/boot/dts/da850-lcdk.dts | 8 ++++++++
arch/arm/boot/dts/da850.dtsi | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 7b8ab21..aaf533e 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -86,6 +86,14 @@
};
};
+&usb_phy {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
&serial2 {
pinctrl-names = "default";
pinctrl-0 = <&serial2_rxtx_pins>;
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 2534aab..50e86da 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -405,6 +405,14 @@
>;
status = "disabled";
};
+ ohci: usb@0225000 {
+ compatible = "ti,da830-ohci";
+ reg = <0x225000 0x1000>;
+ interrupts = <59>;
+ phys = <&usb_phy 1>;
+ phy-names = "usb-phy";
+ status = "disabled";
+ };
gpio: gpio@226000 {
compatible = "ti,dm6441-gpio";
gpio-controller;
--
2.10.1
^ permalink raw reply related
* [PATCH v3 09/10] USB: ohci: da8xx: Allow probing from DT
From: Axel Haslam @ 2016-11-07 20:39 UTC (permalink / raw)
To: stern, gregkh, nsekhar, khilman, david, robh+dt
Cc: devicetree, linux-usb, linux-kernel, linux-arm-kernel,
Axel Haslam
In-Reply-To: <20161107203948.28324-1-ahaslam@baylibre.com>
This adds the compatible string to the ohci driver
to be able to probe from DT
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
drivers/usb/host/ohci-da8xx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 83b182e..bbfe342 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -321,6 +321,13 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
}
/*-------------------------------------------------------------------------*/
+#ifdef CONFIG_OF
+static const struct of_device_id da8xx_ohci_ids[] = {
+ { .compatible = "ti,da830-ohci" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, da8xx_ohci_ids);
+#endif
static int ohci_da8xx_probe(struct platform_device *pdev)
{
@@ -472,6 +479,7 @@ static struct platform_driver ohci_hcd_da8xx_driver = {
#endif
.driver = {
.name = DRV_NAME,
+ .of_match_table = of_match_ptr(da8xx_ohci_ids),
},
};
--
2.10.1
^ permalink raw reply related
* [PATCH v3 08/10] USB: ohci: da8xx: Add devicetree bindings
From: Axel Haslam @ 2016-11-07 20:39 UTC (permalink / raw)
To: stern, gregkh, nsekhar, khilman, david, robh+dt
Cc: devicetree, linux-usb, linux-kernel, linux-arm-kernel,
Axel Haslam
In-Reply-To: <20161107203948.28324-1-ahaslam@baylibre.com>
This patch documents the device tree bindings required for
the ohci controller found in TI da8xx family of SoC's
Cc: devicetree@vger.kernel.org
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
.../devicetree/bindings/usb/ohci-da8xx.txt | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/ohci-da8xx.txt
diff --git a/Documentation/devicetree/bindings/usb/ohci-da8xx.txt b/Documentation/devicetree/bindings/usb/ohci-da8xx.txt
new file mode 100644
index 0000000..f18e82c
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ohci-da8xx.txt
@@ -0,0 +1,39 @@
+DA8XX USB OHCI controller
+
+Required properties:
+
+ - compatible: Should be "ti,da830-ohci"
+ - reg: Should contain one register range i.e. start and length
+ - interrupts: Description of the interrupt line
+ - phys: Phandle for the PHY device
+ - phy-names: Should be "usb-phy"
+
+Optional properties:
+ - vbus-supply: Regulator that controls vbus power
+
+Example:
+
+reg_usb_ohci: regulator@0 {
+ compatible = "regulator-fixed";
+ gpio = <&gpio 109 0>;
+ over-current-gpios = <&gpio 36 0>;
+ regulator-boot-on;
+ enable-active-high;
+ regulator-name = "usb_ohci_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+};
+
+usb_phy: usb-phy {
+ compatible = "ti,da830-usb-phy";
+ #phy-cells = <1>;
+};
+
+ohci: usb@0225000 {
+ compatible = "ti,da830-ohci";
+ reg = <0x225000 0x1000>;
+ interrupts = <59>;
+ phys = <&usb_phy 1>;
+ phy-names = "usb-phy";
+ vbus-supply = <®_usb_ohci>;
+};
--
2.10.1
^ permalink raw reply related
* [PATCH v3 07/10] USB: ohci: da8xx: use a flag instead of mask for ocic
From: Axel Haslam @ 2016-11-07 20:39 UTC (permalink / raw)
To: stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, nsekhar-l0cyMroinI0,
khilman-DgEjT+Ai2ygdnm+yROfE0A, david-nq/r/kbU++upp/zk7JDF2g,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Axel Haslam
In-Reply-To: <20161107203948.28324-1-ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
Now that the platform callback is removed, we can move the over
current indictor changed flag to the private data structure.
Since the driver only handles a single port, there is no need
for ocic to be a mask, we can use a simple flag instead.
Signed-off-by: Axel Haslam <ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
---
drivers/usb/host/ohci-da8xx.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 3dcbf1f..83b182e 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -43,12 +43,10 @@ struct da8xx_ohci_hcd {
struct regulator *vbus_reg;
struct notifier_block nb;
unsigned int is_powered;
+ unsigned int oc_changed;
};
#define to_da8xx_ohci(hcd) (struct da8xx_ohci_hcd *)(hcd_to_ohci(hcd)->priv)
-/* Over-current indicator change bitmask */
-static volatile u16 ocic_mask;
-
static int ohci_da8xx_enable(struct usb_hcd *hcd)
{
struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
@@ -168,7 +166,7 @@ static int ohci_da8xx_regulator_event(struct notifier_block *nb,
if (event & REGULATOR_EVENT_OVER_CURRENT) {
dev_warn(dev, "over current event\n");
- ocic_mask |= 1;
+ da8xx_ohci->oc_changed = 1;
ohci_da8xx_set_power(da8xx_ohci->hcd, 0);
}
@@ -241,10 +239,11 @@ static int ohci_da8xx_reset(struct usb_hcd *hcd)
*/
static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf)
{
+ struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
int length = orig_ohci_hub_status_data(hcd, buf);
/* See if we have OCIC bit set on port 1 */
- if (ocic_mask & (1 << 1)) {
+ if (da8xx_ohci->oc_changed) {
dev_dbg(hcd->self.controller, "over-current indicator change "
"on port 1\n");
@@ -262,6 +261,7 @@ static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf)
static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
u16 wIndex, char *buf, u16 wLength)
{
+ struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
struct device *dev = hcd->self.controller;
int temp;
@@ -284,7 +284,7 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp |= RH_PS_POCI;
/* The over-current indicator change (OCIC) bit is 0 too */
- if (ocic_mask & (1 << wIndex))
+ if (da8xx_ohci->oc_changed)
temp |= RH_PS_OCIC;
put_unaligned(cpu_to_le32(temp), (__le32 *)buf);
@@ -311,10 +311,7 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
temp ? "Set" : "Clear", wIndex,
"C_OVER_CURRENT");
- if (temp)
- ocic_mask |= 1 << wIndex;
- else
- ocic_mask &= ~(1 << wIndex);
+ da8xx_ohci->oc_changed = temp;
return 0;
}
}
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox