* [PATCH v3 4/9] dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP configs
From: Peter Ujfalusi @ 2016-09-21 12:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921124135.11849-1-peter.ujfalusi@ti.com>
The DMAengine driver for omap-dma use three function calls from the
plat-omap legacy driver. When the DMAengine driver is built when ARCH_OMAP
is not set, the compilation will fail due to missing symbols.
Add empty inline functions to allow the DMAengine driver to be compiled
with COMPILE_TEST.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
include/linux/omap-dma.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 1d99b61adc65..290081620b3e 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -297,6 +297,7 @@ struct omap_system_dma_plat_info {
#define dma_omap15xx() __dma_omap15xx(d)
#define dma_omap16xx() __dma_omap16xx(d)
+#if defined(CONFIG_ARCH_OMAP)
extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
extern void omap_set_dma_priority(int lch, int dst_port, int priority);
@@ -355,4 +356,22 @@ static inline int omap_lcd_dma_running(void)
}
#endif
+#else /* CONFIG_ARCH_OMAP */
+
+static inline struct omap_system_dma_plat_info *omap_get_plat_info(void)
+{
+ return NULL;
+}
+
+static inline int omap_request_dma(int dev_id, const char *dev_name,
+ void (*callback)(int lch, u16 ch_status, void *data),
+ void *data, int *dma_ch)
+{
+ return -ENODEV;
+}
+
+static inline void omap_free_dma(int ch) { }
+
+#endif /* CONFIG_ARCH_OMAP */
+
#endif /* __LINUX_OMAP_DMA_H */
--
2.10.0
^ permalink raw reply related
* [PATCH v3 3/9] dmaengine: edma: Use correct type for of_find_property() third parameter
From: Peter Ujfalusi @ 2016-09-21 12:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921124135.11849-1-peter.ujfalusi@ti.com>
The correct type is int and not for the third parameter of
of_find_property().
Fixes compilation for 64bit architectures (x86_64, aarch64).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 87c58710ae31..0241f39ba64c 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -2026,8 +2026,7 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
{
struct edma_soc_info *info;
struct property *prop;
- size_t sz;
- int ret;
+ int sz, ret;
info = devm_kzalloc(dev, sizeof(struct edma_soc_info), GFP_KERNEL);
if (!info)
--
2.10.0
^ permalink raw reply related
* [PATCH v3 2/9] dmaengine: edma: Fix of_device_id data parameter usage (legacy vs TPCC)
From: Peter Ujfalusi @ 2016-09-21 12:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921124135.11849-1-peter.ujfalusi@ti.com>
Use pointers to static constant variables for eDMA binding
type (legacy vs TPCC).
Fixes the following warning when compiling the driver for 64bit
architectures (x86_64 for example):
drivers/dma/edma.c:2185:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
if (match && (u32)match->data == EDMA_BINDING_TPCC)
^
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index c2098a4b4dcf..87c58710ae31 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
#define EDMA_BINDING_LEGACY 0
#define EDMA_BINDING_TPCC 1
+static const u32 edma_binding_type[] = {
+ [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
+ [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
+};
+
static const struct of_device_id edma_of_ids[] = {
{
.compatible = "ti,edma3",
- .data = (void *)EDMA_BINDING_LEGACY,
+ .data = &edma_binding_type[EDMA_BINDING_LEGACY],
},
{
.compatible = "ti,edma3-tpcc",
- .data = (void *)EDMA_BINDING_TPCC,
+ .data = &edma_binding_type[EDMA_BINDING_TPCC],
},
{}
};
@@ -2184,7 +2189,7 @@ static int edma_probe(struct platform_device *pdev)
const struct of_device_id *match;
match = of_match_node(edma_of_ids, node);
- if (match && (u32)match->data == EDMA_BINDING_TPCC)
+ if (match && (*(u32*)match->data) == EDMA_BINDING_TPCC)
legacy_mode = false;
info = edma_setup_info_from_dt(dev, legacy_mode);
--
2.10.0
^ permalink raw reply related
* [PATCH v3 1/9] dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id structs
From: Peter Ujfalusi @ 2016-09-21 12:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921124135.11849-1-peter.ujfalusi@ti.com>
The MODULE_DEVICE_TABLE() were missing from the driver for the of_device_id
structures.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 3d277fa76c1a..c2098a4b4dcf 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -274,11 +274,13 @@ static const struct of_device_id edma_of_ids[] = {
},
{}
};
+MODULE_DEVICE_TABLE(of, edma_of_ids);
static const struct of_device_id edma_tptc_of_ids[] = {
{ .compatible = "ti,edma3-tptc", },
{}
};
+MODULE_DEVICE_TABLE(of, edma_tptc_of_ids);
static inline unsigned int edma_read(struct edma_cc *ecc, int offset)
{
--
2.10.0
^ permalink raw reply related
* [PATCH v3 0/9] dmaengine: ti drivers: enable COMPILE_TESTing
From: Peter Ujfalusi @ 2016-09-21 12:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Changes since v2:
- Instead of converting to use enum for the of_device_id data parameter the two
patch for edma and ti-dma-crossbar is using pointers to u32 variables to make
sure that the code compile (and in theory work) on all architectures.
- fixed issue in the ti-dma-crossbar driver I have made with the enum change to
not handle the DMA offset parameters correctly.
Changes since v1:
- added the compiler warning message to ti-dma-crossbar enum type patch
- moved the Kconfig patches at the end of the seris
The following series will enable unconditional COMPILE_TEST coverage for the
following drivers: omap-dma, edma and ti-dma-crossbar
The series includes fixes noticed when compiling the drivers for x86_64 and
aarch64.
Replaces the patch Vinod sent to enable partial compile testing for omap-dma:
http://www.spinics.net/lists/dmaengine/msg11025.html
Regards,
Peter
---
Peter Ujfalusi (9):
dmaengine: edma: Add missing MODULE_DEVICE_TABLE() for of_device_id
structs
dmaengine: edma: Fix of_device_id data parameter usage (legacy vs
TPCC)
dmaengine: edma: Use correct type for of_find_property() third
parameter
dmaengine/ARM: omap-dma: Fix the DMAengine compile test on non OMAP
configs
dmaengine: ti-dma-crossbar: Correct type for of_find_property() third
parameter
dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage
dmaengine: edma: enable COMPILE_TEST
dmaengine: omap-dma: enable COMPILE_TEST
dmaengine: ti-dma-crossbar: enable COMPILE_TEST
drivers/dma/Kconfig | 8 ++++----
drivers/dma/edma.c | 16 +++++++++++-----
drivers/dma/ti-dma-crossbar.c | 30 +++++++++++++++++++-----------
include/linux/omap-dma.h | 19 +++++++++++++++++++
4 files changed, 53 insertions(+), 20 deletions(-)
--
2.10.0
^ permalink raw reply
* [PATCH v9 17/19] drm/virtio: kconfig: Fix recursive dependency issue.
From: Emil Velikov @ 2016-09-21 12:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160920083251.GB26093@griffinp-ThinkPad-X1-Carbon-2nd>
On 20 September 2016 at 09:32, Peter Griffin <peter.griffin@linaro.org> wrote:
> Hi Emil,
>
> On Tue, 20 Sep 2016, Emil Velikov wrote:
>
>> On 5 September 2016 at 14:16, Peter Griffin <peter.griffin@linaro.org> wrote:
>> > ST_SLIM_REMOTEPROC must select REMOTEPROC, which exposes the following
>> > recursive dependency.
>
>
>> >
>> From a humble skim through remoteproc, drm and a few other subsystems
>> I think the above is wrong. All the drivers (outside of remoteproc),
>> that I've seen, depend on the core component, they don't select it.
>
> I will let Bjorn comment on the remoteproc subsystem Kconfig design, and
> why it is like it is.
>
> For this particular SLIM_RPROC I have added it to Kconfig in keeping with all
> the other drivers in the remoteproc subsystem which has exposed this recursive
> dependency issue.
>
> For this particular kconfig symbol a quick grep reveals more drivers in
> the kernel using 'select', than 'depend on'
>
> git grep "select VIRTIO" | wc -l
> 14
>
> git grep "depends on VIRTIO" | wc -l
> 10
>
Might be worth taking a closer look into these at some point.
>
>> Furthermore most places explicitly hide the drivers from the menu if
>> the core component isn't enabled.
>
> Remoteproc subsystem takes a different approach, the core code is only enabled
> if a driver which relies on it is enabled. This IMHO makes sense, as
> remoteproc is not widely used (only a few particular ARM SoC's).
>
> It is true that for subsystems which rely on the core component being
> explicitly enabled, they often tend to hide drivers which depend on it
> from the menu unless it is. This also makes sense.
>
>>
>> Is there something that requires such a different/unusual behaviour in
>> remoteproc ?
>>
>
> I'm not sure it is that unusual...looking at config USB, it selects USB_COMMON in
> mfd subsystem, client drivers select MFD_CORE.
>
On the USB case I'm not sure what the reasoning behind the USB vs
USB_COMMON split. In seems that one could just fold them, but that's
another topic. On the MFD side... it follows the select {,mis,ab}use.
With one (the only one?) MFD driver not using/selecting MFD_CORE doing
it's own version of mfd_add_devices... which could be reworked,
possibly.
> I've added Arnd to this thread, as I've seen lots of Kconfig patches from him
> recently, maybe he has some thoughts on whether this is the correct fix or not?
>
Ack. Fwiw, I believe that the reasoning put by Jani is perfeclty
reasonable, but it'll be great to hear others as well.
Thanks
Emil
^ permalink raw reply
* [PATCH] usb: dwc3: host: inherit dma configuration from parent dev
From: Sriram Dash @ 2016-09-21 11:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <3596831.dckG5peiyF@wuerfel>
>From: Arnd Bergmann [mailto:arnd at arndb.de]
>On Wednesday, September 21, 2016 11:06:47 AM CEST Sriram Dash wrote:
>>
>> Hello Arnd,
>>
>> We tried this patch on NXP platforms (ls2085 and ls1043) which use
>> dwc3 controller without any glue layer. On first go, this did not
>> work. But after minimal reworks mention snippet below, we are able to
>> verify that the USB was working OK.
>>
>> drivers/usb/host/xhci-mem.c | 12 ++++++------
>> drivers/usb/host/xhci.c | 20 ++++++++++----------
>>
>> - struct device *dev = xhci_to_hcd(xhci)->self.controller;
>> + struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
>>
>> We believe the patch needs little modification to work or there might
>> be chances we may have missed something. Any idea?
>
>
>I had not tried the patch, it was just sent for clarification what I meant, so I'm glad
>you got it working with just minimal changes.
>
>Unfortunately, I can't tell from your lines above what exactly you changed, can you
>send that again as a proper patch?
>
Sure.
==============================================================
>From 8b0dea1513e9e73a11dcfa802ddc71cca11d66f8 Mon Sep 17 00:00:00 2001
From: Sriram Dash <sriram.dash@nxp.com>
Date: Wed, 21 Sep 2016 11:39:30 +0530
Subject: [PATCH] usb: xhci: Fix the patch inherit dma configuration from
parent dev
Fixes the patch https://patchwork.kernel.org/patch/9319527/
("usb: dwc3: host: inherit dma configuration from parent dev").
Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
---
drivers/usb/host/xhci-mem.c | 12 ++++++------
drivers/usb/host/xhci.c | 20 ++++++++++----------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 6afe323..79608df 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -586,7 +586,7 @@ static void xhci_free_stream_ctx(struct xhci_hcd *xhci,
unsigned int num_stream_ctxs,
struct xhci_stream_ctx *stream_ctx, dma_addr_t dma)
{
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
if (size > MEDIUM_STREAM_ARRAY_SIZE)
@@ -614,7 +614,7 @@ static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci,
unsigned int num_stream_ctxs, dma_addr_t *dma,
gfp_t mem_flags)
{
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
size_t size = sizeof(struct xhci_stream_ctx) * num_stream_ctxs;
if (size > MEDIUM_STREAM_ARRAY_SIZE)
@@ -1644,7 +1644,7 @@ void xhci_slot_copy(struct xhci_hcd *xhci,
static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
{
int i;
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
@@ -1716,7 +1716,7 @@ static void scratchpad_free(struct xhci_hcd *xhci)
{
int num_sp;
int i;
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
if (!xhci->scratchpad)
return;
@@ -1792,7 +1792,7 @@ void xhci_free_command(struct xhci_hcd *xhci,
void xhci_mem_cleanup(struct xhci_hcd *xhci)
{
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
int size;
int i, j, num_ports;
@@ -2334,7 +2334,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
{
dma_addr_t dma;
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
unsigned int val, val2;
u64 val_64;
struct xhci_segment *seg;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 01d96c9..9a1ff09 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -231,7 +231,7 @@ static int xhci_free_msi(struct xhci_hcd *xhci)
static int xhci_setup_msi(struct xhci_hcd *xhci)
{
int ret;
- struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
ret = pci_enable_msi(pdev);
if (ret) {
@@ -257,7 +257,7 @@ static int xhci_setup_msi(struct xhci_hcd *xhci)
*/
static void xhci_free_irq(struct xhci_hcd *xhci)
{
- struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
int ret;
/* return if using legacy interrupt */
@@ -280,7 +280,7 @@ static int xhci_setup_msix(struct xhci_hcd *xhci)
{
int i, ret = 0;
struct usb_hcd *hcd = xhci_to_hcd(xhci);
- struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+ struct pci_dev *pdev = to_pci_dev(hcd->self.sysdev);
/*
* calculate number of msi-x vectors supported.
@@ -337,7 +337,7 @@ free_entries:
static void xhci_cleanup_msix(struct xhci_hcd *xhci)
{
struct usb_hcd *hcd = xhci_to_hcd(xhci);
- struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+ struct pci_dev *pdev = to_pci_dev(hcd->self.sysdev);
if (xhci->quirks & XHCI_PLAT)
return;
@@ -376,7 +376,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
if (xhci->quirks & XHCI_PLAT)
return 0;
- pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
+ pdev = to_pci_dev(xhci_to_hcd(xhci)->self.sysdev);
/*
* Some Fresco Logic host controllers advertise MSI, but fail to
* generate interrupts. Don't even try to enable MSI.
@@ -745,7 +745,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
- usb_disable_xhci_ports(to_pci_dev(hcd->self.controller));
+ usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
spin_lock_irq(&xhci->lock);
xhci_halt(xhci);
@@ -762,7 +762,7 @@ void xhci_shutdown(struct usb_hcd *hcd)
/* Yet another workaround for spurious wakeups at shutdown with HSW */
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
- pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot);
+ pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot);
}
#ifdef CONFIG_PM
@@ -3605,7 +3605,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
* if no devices remain.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_put_noidle(hcd->self.controller);
+ pm_runtime_put_noidle(hcd->self.sysdev);
#endif
ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);
@@ -3745,7 +3745,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
* suspend if there is a device attached.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_get_noresume(hcd->self.controller);
+ pm_runtime_get_noresume(hcd->self.sysdev);
#endif
@@ -4834,7 +4834,7 @@ int xhci_get_frame(struct usb_hcd *hcd)
int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
{
struct xhci_hcd *xhci;
- struct device *dev = hcd->self.controller;
+ struct device *dev = hcd->self.sysdev;
int retval;
/* Accept arbitrarily long scatter-gather lists */
--
2.1.0
==============================================================
>I think I also had some minimal changes that I did myself in order to fix a build
>regression I introduced.
>
> Arnd
^ permalink raw reply related
* [PATCH v2 2/9] dmaengine: edma: Use enum for eDMA binding type (legacy vs TPCC)
From: Arnd Bergmann @ 2016-09-21 11:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <bbd248d1-223c-00a9-3d2a-33df085c4f68@ti.com>
On Wednesday, September 21, 2016 2:07:22 PM CEST Peter Ujfalusi wrote:
> >
> > I tend to use 'uintptr_t' for the cast instead.
>
> What about keeping the defines and:
>
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 3e9606b08340..493fdf30e8b8 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
>
> #define EDMA_BINDING_LEGACY 0
> #define EDMA_BINDING_TPCC 1
> +static const u32 edma_binding_type[] = {
> + [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
> + [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
> +};
> +
> static const struct of_device_id edma_of_ids[] = {
> {
> .compatible = "ti,edma3",
> - .data = (void *)EDMA_BINDING_LEGACY,
> + .data = (void *)&edma_binding_type[EDMA_BINDING_LEGACY],
> },
> {
> .compatible = "ti,edma3-tpcc",
> - .data = (void *)EDMA_BINDING_TPCC,
> + .data = (void *)&edma_binding_type[EDMA_BINDING_TPCC],
> },
> {}
You can drop the cast to (void *) here, otherwise looks good.
Arnd
^ permalink raw reply
* [PATCH] usb: dwc3: host: inherit dma configuration from parent dev
From: Arnd Bergmann @ 2016-09-21 11:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <DB5PR0401MB19259C5DBD40BEEC70F0B7CEF5F60@DB5PR0401MB1925.eurprd04.prod.outlook.com>
On Wednesday, September 21, 2016 11:06:47 AM CEST Sriram Dash wrote:
>
> Hello Arnd,
>
> We tried this patch on NXP platforms (ls2085 and ls1043) which use dwc3
> controller without any glue layer. On first go, this did not work. But after
> minimal reworks mention snippet below, we are able to verify that the USB
> was working OK.
>
> drivers/usb/host/xhci-mem.c | 12 ++++++------
> drivers/usb/host/xhci.c | 20 ++++++++++----------
>
> - struct device *dev = xhci_to_hcd(xhci)->self.controller;
> + struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
>
> We believe the patch needs little modification to work or there might be chances
> we may have missed something. Any idea?
I had not tried the patch, it was just sent for clarification what I
meant, so I'm glad you got it working with just minimal changes.
Unfortunately, I can't tell from your lines above what exactly you
changed, can you send that again as a proper patch?
I think I also had some minimal changes that I did myself in order
to fix a build regression I introduced.
Arnd
^ permalink raw reply
* [PATCH] ARM: dts: imx6: Add support for Toradex Colibri iMX6 module
From: Sanchayan Maity @ 2016-09-21 11:24 UTC (permalink / raw)
To: linux-arm-kernel
Add support for Toradex Colibri iMX6 module.
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts | 253 ++++++++
arch/arm/boot/dts/imx6qdl-colibri.dtsi | 890 +++++++++++++++++++++++++++
3 files changed, 1144 insertions(+)
create mode 100644 arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
create mode 100644 arch/arm/boot/dts/imx6qdl-colibri.dtsi
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f79cac2..44ff380 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -323,6 +323,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-aristainetos_7.dtb \
imx6dl-aristainetos2_4.dtb \
imx6dl-aristainetos2_7.dtb \
+ imx6dl-colibri-eval-v3.dtb \
imx6dl-cubox-i.dtb \
imx6dl-dfi-fs700-m60.dtb \
imx6dl-gw51xx.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
new file mode 100644
index 0000000..e0c2172
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2014-2016 Toradex AG
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "imx6dl.dtsi"
+#include "imx6qdl-colibri.dtsi"
+
+/ {
+ model = "Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3";
+ compatible = "toradex,colibri_imx6dl-eval-v3", "toradex,colibri_imx6dl",
+ "fsl,imx6dl";
+
+ aliases {
+ i2c0 = &i2c2;
+ i2c1 = &i2c3;
+ };
+
+ aliases {
+ rtc0 = &rtc_i2c;
+ rtc1 = &snvs_rtc;
+ };
+
+ clocks {
+ /* Fixed crystal dedicated to mcp251x */
+ clk16m: clk at 1 {
+ compatible = "fixed-clock";
+ reg = <1>;
+ #clock-cells = <0>;
+ clock-frequency = <16000000>;
+ clock-output-names = "clk16m";
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_gpio_keys>;
+
+ wakeup {
+ label = "Wake-Up";
+ gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>; /* SODIMM 45 */
+ linux,code = <KEY_WAKEUP>;
+ debounce-interval = <10>;
+ wakeup-source;
+ };
+ };
+
+ lcd_display: display at di0 {
+ compatible = "fsl,imx-parallel-display";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interface-pix-fmt = "bgr666";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ipu1_lcdif>;
+ status = "okay";
+
+ port at 0 {
+ reg = <0>;
+
+ lcd_display_in: endpoint {
+ remote-endpoint = <&ipu1_di0_disp0>;
+ };
+ };
+
+ port at 1 {
+ reg = <1>;
+
+ lcd_display_out: endpoint {
+ remote-endpoint = <&lcd_panel_in>;
+ };
+ };
+ };
+
+ panel: panel {
+ /*
+ * edt,et057090dhu: EDT 5.7" LCD TFT
+ * edt,et070080dh6: EDT 7.0" LCD TFT
+ */
+ compatible = "edt,et057090dhu";
+ backlight = <&backlight>;
+
+ port {
+ lcd_panel_in: endpoint {
+ remote-endpoint = <&lcd_display_out>;
+ };
+ };
+ };
+};
+
+&backlight {
+ brightness-levels = <0 127 191 223 239 247 251 255>;
+ default-brightness-level = <1>;
+ status = "okay";
+};
+
+/* Colibri SSP */
+&ecspi4 {
+ status = "okay";
+
+ mcp251x0: mcp251x at 1 {
+ compatible = "microchip,mcp2515";
+ reg = <0>;
+ clocks = <&clk16m>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <27 0x2>;
+ spi-max-frequency = <10000000>;
+ status = "okay";
+ };
+};
+
+&hdmi {
+ status = "okay";
+};
+
+/*
+ * Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 (e.g. RTC on carrier board)
+ */
+&i2c3 {
+ status = "okay";
+
+ /* M41T0M6 real time clock on carrier board */
+ rtc_i2c: rtc at 68 {
+ compatible = "st,m41t00";
+ reg = <0x68>;
+ };
+};
+
+&ipu1_di0_disp0 {
+ remote-endpoint = <&lcd_display_in>;
+};
+
+&pwm1 {
+ status = "okay";
+};
+
+&pwm2 {
+ status = "okay";
+};
+
+&pwm3 {
+ status = "okay";
+};
+
+&pwm4 {
+ status = "okay";
+};
+
+®_usb_host_vbus {
+ status = "okay";
+};
+
+&uart1 {
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+&uart3 {
+ status = "okay";
+};
+
+&usbh1 {
+ vbus-supply = <®_usb_host_vbus>;
+ status = "okay";
+};
+
+&usbotg {
+ status = "okay";
+};
+
+/* Colibri MMC */
+&usdhc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_mmc_cd>;
+ cd-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; /* MMCD */
+ status = "okay";
+};
+
+&weim {
+ status = "okay";
+
+ /* weim memory map: 32MB on CS0, 32MB on CS1, 32MB on CS2 */
+ ranges = <0 0 0x08000000 0x02000000
+ 1 0 0x0a000000 0x02000000
+ 2 0 0x0c000000 0x02000000>;
+
+ /* SRAM on Colibri nEXT_CS0 */
+ sram at 0,0 {
+ compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
+ reg = <0 0 0x00010000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ bank-width = <2>;
+ fsl,weim-cs-timing = <0x00010081 0x00000000 0x04000000
+ 0x00000000 0x04000040 0x00000000>;
+ };
+
+ /* SRAM on Colibri nEXT_CS1 */
+ sram at 1,0 {
+ compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
+ reg = <1 0 0x00010000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ bank-width = <2>;
+ fsl,weim-cs-timing = <0x00010081 0x00000000 0x04000000
+ 0x00000000 0x04000040 0x00000000>;
+ };
+};
diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
new file mode 100644
index 0000000..e6faa65
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -0,0 +1,890 @@
+/*
+ * Copyright 2014-2016 Toradex AG
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "Toradex Colibri iMX6DL/S Module";
+ compatible = "toradex,colibri_imx6dl", "fsl,imx6dl";
+
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_gpio_bl_on>;
+ pwms = <&pwm3 0 5000000>;
+ enable-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* Colibri BL_ON */
+ status = "disabled";
+ };
+
+ reg_1p8v: regulator-1p8v {
+ compatible = "regulator-fixed";
+ regulator-name = "1P8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ reg_2p5v: regulator-2p5v {
+ compatible = "regulator-fixed";
+ regulator-name = "2P5V";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-always-on;
+ };
+
+ reg_3p3v: regulator-3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "3P3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ reg_usb_host_vbus: regulator-usb-host-vbus {
+ compatible = "regulator-fixed";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_regulator_usbh_pwr>;
+ regulator-name = "usb_host_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>; /* USBH_PEN */
+ status = "disabled";
+ };
+
+ sound {
+ compatible = "fsl,imx-audio-sgtl5000";
+ model = "imx6dl-colibri-sgtl5000";
+ ssi-controller = <&ssi1>;
+ audio-codec = <&codec>;
+ audio-routing =
+ "Headphone Jack", "HP_OUT",
+ "LINE_IN", "Line In Jack",
+ "MIC_IN", "Mic Jack",
+ "Mic Jack", "Mic Bias";
+ mux-int-port = <1>;
+ mux-ext-port = <5>;
+ };
+
+ /* Optional S/PDIF in on SODIMM 88 and out on SODIMM 90, 137 or 168 */
+ sound_spdif: sound-spdif {
+ compatible = "fsl,imx-audio-spdif";
+ model = "imx-spdif";
+ spdif-controller = <&spdif>;
+ spdif-in;
+ spdif-out;
+ status = "disabled";
+ };
+};
+
+&audmux {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_audmux &pinctrl_mic_gnd>;
+ status = "okay";
+};
+
+/* Optional on SODIMM 55/63 */
+&can1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_flexcan1>;
+ status = "disabled";
+};
+
+/* Optional on SODIMM 178/188 */
+&can2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_flexcan2>;
+ status = "disabled";
+};
+
+/* Colibri SSP */
+&ecspi4 {
+ fsl,spi-num-chipselects = <1>;
+ cs-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ecspi4>;
+ status = "disabled";
+};
+
+&fec {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_enet>;
+ phy-mode = "rmii";
+ status = "okay";
+};
+
+&hdmi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hdmi_ddc>;
+ status = "disabled";
+};
+
+/*
+ * PWR_I2C: power I2C to audio codec, PMIC, temperature sensor and
+ * touch screen controller
+ */
+&i2c2 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2>;
+ status = "okay";
+
+ pmic: pfuze100 at 08 {
+ compatible = "fsl,pfuze100";
+ reg = <0x08>;
+
+ regulators {
+ sw1a_reg: sw1ab {
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1875000>;
+ regulator-boot-on;
+ regulator-always-on;
+ regulator-ramp-delay = <6250>;
+ };
+
+ sw1c_reg: sw1c {
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <1875000>;
+ regulator-boot-on;
+ regulator-always-on;
+ regulator-ramp-delay = <6250>;
+ };
+
+ sw3a_reg: sw3a {
+ regulator-min-microvolt = <400000>;
+ regulator-max-microvolt = <1975000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ swbst_reg: swbst {
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5150000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ snvs_reg: vsnvs {
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vref_reg: vrefddr {
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ /* vgen1: unused */
+
+ vgen2_reg: vgen2 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1550000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ /* vgen3: unused */
+
+ vgen4_reg: vgen4 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vgen5_reg: vgen5 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vgen6_reg: vgen6 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+ };
+ };
+
+ codec: sgtl5000 at 0a {
+ compatible = "fsl,sgtl5000";
+ reg = <0x0a>;
+ clocks = <&clks IMX6QDL_CLK_CKO>;
+ VDDA-supply = <®_2p5v>;
+ VDDIO-supply = <®_3p3v>;
+ };
+
+ /* STMPE811 touch screen controller */
+ stmpe811 at 41 {
+ compatible = "st,stmpe811";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_touch_int>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x41>;
+ interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-parent = <&gpio6>;
+ interrupt-controller;
+ id = <0>;
+ blocks = <0x5>;
+ irq-trigger = <0x1>;
+
+ stmpe_touchscreen {
+ compatible = "st,stmpe-ts";
+ reg = <0>;
+ /* 3.25 MHz ADC clock speed */
+ st,adc-freq = <1>;
+ /* 8 sample average control */
+ st,ave-ctrl = <3>;
+ /* 7 length fractional part in z */
+ st,fraction-z = <7>;
+ /*
+ * 50 mA typical 80 mA max touchscreen drivers
+ * current limit value
+ */
+ st,i-drive = <1>;
+ /* 12-bit ADC */
+ st,mod-12b = <1>;
+ /* internal ADC reference */
+ st,ref-sel = <0>;
+ /* ADC converstion time: 80 clocks */
+ st,sample-time = <4>;
+ /* 1 ms panel driver settling time */
+ st,settling = <3>;
+ /* 5 ms touch detect interrupt delay */
+ st,touch-det-delay = <5>;
+ };
+ };
+};
+
+/*
+ * I2C3_SDA/SCL on SODIMM 194/196 (e.g. RTC on carrier board)
+ */
+&i2c3 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default", "recovery";
+ pinctrl-0 = <&pinctrl_i2c3>;
+ pinctrl-1 = <&pinctrl_i2c3_recovery>;
+ scl-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
+ sda-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
+ status = "disabled";
+};
+
+/* Colibri PWM<B> */
+&pwm1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm1>;
+ status = "disabled";
+};
+
+/* Colibri PWM<D> */
+&pwm2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm2>;
+ status = "disabled";
+};
+
+/* Colibri PWM<A> */
+&pwm3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm3>;
+ status = "disabled";
+};
+
+/* Colibri PWM<C> */
+&pwm4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm4>;
+ status = "disabled";
+};
+
+/* Optional S/PDIF out on SODIMM 137 */
+&spdif {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_spdif>;
+ status = "disabled";
+};
+
+&ssi1 {
+ status = "okay";
+};
+
+/* Colibri UART_A */
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart1_dte &pinctrl_uart1_ctrl>;
+ fsl,dte-mode;
+ uart-has-rtscts;
+ status = "disabled";
+};
+
+/* Colibri UART_B */
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart2_dte>;
+ fsl,dte-mode;
+ uart-has-rtscts;
+ status = "disabled";
+};
+
+/* Colibri UART_C */
+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart3_dte>;
+ fsl,dte-mode;
+ status = "disabled";
+};
+
+&usbotg {
+ pinctrl-names = "default";
+ disable-over-current;
+ dr_mode = "peripheral";
+ status = "disabled";
+};
+
+/* Colibri MMC */
+&usdhc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usdhc1>;
+ vqmmc-supply = <®_3p3v>;
+ bus-width = <4>;
+ voltage-ranges = <3300 3300>;
+ status = "disabled";
+};
+
+/* eMMC */
+&usdhc3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usdhc3>;
+ vqmmc-supply = <®_3p3v>;
+ bus-width = <8>;
+ voltage-ranges = <3300 3300>;
+ non-removable;
+ status = "okay";
+};
+
+&weim {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_weim_sram &pinctrl_weim_cs0
+ &pinctrl_weim_cs1 &pinctrl_weim_cs2
+ &pinctrl_weim_rdnwr &pinctrl_weim_npwe>;
+ #address-cells = <2>;
+ #size-cells = <1>;
+ status = "disabled";
+};
+
+&iomuxc {
+ pinctrl_audmux: audmuxgrp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_COL0__AUD5_TXC 0x130b0
+ MX6QDL_PAD_KEY_ROW0__AUD5_TXD 0x130b0
+ MX6QDL_PAD_KEY_COL1__AUD5_TXFS 0x130b0
+ MX6QDL_PAD_KEY_ROW1__AUD5_RXD 0x130b0
+ /* SGTL5000 sys_mclk */
+ MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000b0
+ >;
+ };
+
+ pinctrl_cam_mclk: cammclkgrp {
+ fsl,pins = <
+ /* Parallel Camera CAM sys_mclk */
+ MX6QDL_PAD_NANDF_CS2__CCM_CLKO2 0x00b0
+ >;
+ };
+
+ pinctrl_ecspi4: ecspi4grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D22__ECSPI4_MISO 0x100b1
+ MX6QDL_PAD_EIM_D28__ECSPI4_MOSI 0x100b1
+ MX6QDL_PAD_EIM_D21__ECSPI4_SCLK 0x100b1
+ /* SPI CS */
+ MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x000b1
+ >;
+ };
+
+ pinctrl_enet: enetgrp {
+ fsl,pins = <
+ MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
+ MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
+ MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
+ MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b0b0
+ MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER 0x1b0b0
+ MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0
+ MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b0b0
+ MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b0b0
+ MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN 0x1b0b0
+ MX6QDL_PAD_GPIO_16__ENET_REF_CLK ((1<<30) | 0x1b0b0)
+ >;
+ };
+
+ pinctrl_flexcan1: flexcan1grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x1b0b0
+ MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x1b0b0
+ >;
+ };
+
+ pinctrl_flexcan2: flexcan2grp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX 0x1b0b0
+ MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX 0x1b0b0
+ >;
+ };
+
+ pinctrl_gpio_bl_on: gpioblon {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D26__GPIO3_IO26 0x1b0b0
+ >;
+ };
+
+ pinctrl_gpio_keys: gpiokeys {
+ fsl,pins = <
+ /* Power button */
+ MX6QDL_PAD_EIM_A16__GPIO2_IO22 0x1b0b0
+ >;
+ };
+
+ pinctrl_hdmi_ddc: hdmiddcgrp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_COL3__HDMI_TX_DDC_SCL 0x4001b8b1
+ MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c2: i2c2grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c3: i2c3grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
+ MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c3_recovery: i2c3recoverygrp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_3__GPIO1_IO03 0x4001b8b1
+ MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x4001b8b1
+ >;
+ };
+
+ pinctrl_ipu1_csi0: ipu1csi0grp { /* Parallel Camera */
+ fsl,pins = <
+ MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12 0xb0b1
+ MX6QDL_PAD_EIM_A18__IPU1_CSI1_DATA13 0xb0b1
+ MX6QDL_PAD_EIM_A19__IPU1_CSI1_DATA14 0xb0b1
+ MX6QDL_PAD_EIM_A20__IPU1_CSI1_DATA15 0xb0b1
+ MX6QDL_PAD_EIM_A21__IPU1_CSI1_DATA16 0xb0b1
+ MX6QDL_PAD_EIM_A22__IPU1_CSI1_DATA17 0xb0b1
+ MX6QDL_PAD_EIM_A23__IPU1_CSI1_DATA18 0xb0b1
+ MX6QDL_PAD_EIM_A24__IPU1_CSI1_DATA19 0xb0b1
+ MX6QDL_PAD_EIM_D17__IPU1_CSI1_PIXCLK 0xb0b1
+ MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC 0xb0b1
+ MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC 0xb0b1
+ /* Disable PWM pins on camera interface */
+ MX6QDL_PAD_SD4_DAT1__GPIO2_IO09 0x40
+ MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x40
+ >;
+ };
+
+ pinctrl_ipu1_lcdif: ipu1lcdifgrp {
+ fsl,pins = <
+ MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0xa1
+ MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15 0xa1
+ MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02 0xa1
+ MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03 0xa1
+ MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00 0xa1
+ MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01 0xa1
+ MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02 0xa1
+ MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03 0xa1
+ MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04 0xa1
+ MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05 0xa1
+ MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06 0xa1
+ MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07 0xa1
+ MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08 0xa1
+ MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09 0xa1
+ MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10 0xa1
+ MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11 0xa1
+ MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12 0xa1
+ MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13 0xa1
+ MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14 0xa1
+ MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15 0xa1
+ MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16 0xa1
+ MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17 0xa1
+ >;
+ };
+
+ pinctrl_mic_gnd: gpiomicgnd {
+ fsl,pins = <
+ /* Controls Mic GND, PU or '1' pull Mic GND to GND */
+ MX6QDL_PAD_RGMII_TD1__GPIO6_IO21 0x1b0b0
+ >;
+ };
+
+ pinctrl_mmc_cd: gpiommccd {
+ fsl,pins = <
+ MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x80000000
+ >;
+ };
+
+ pinctrl_pwm1: pwm1grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_9__PWM1_OUT 0x1b0b1
+ >;
+ };
+
+ pinctrl_pwm2: pwm2grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_1__PWM2_OUT 0x1b0b1
+ MX6QDL_PAD_EIM_A21__GPIO2_IO17 0x00040
+ >;
+ };
+
+ pinctrl_pwm3: pwm3grp {
+ fsl,pins = <
+ MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
+ MX6QDL_PAD_EIM_A22__GPIO2_IO16 0x00040
+ >;
+ };
+
+ pinctrl_pwm4: pwm4grp {
+ fsl,pins = <
+ MX6QDL_PAD_SD4_DAT2__PWM4_OUT 0x1b0b1
+ >;
+ };
+
+ pinctrl_regulator_usbh_pwr: gpioregusbhpwrgrp {
+ fsl,pins = <
+ /* USBH_EN */
+ MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x0f058
+ >;
+ };
+
+ pinctrl_spdif: spdifgrp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0
+ >;
+ };
+
+ pinctrl_touch_int: gpiotouchintgrp {
+ fsl,pins = <
+ /* STMPE811 interrupt */
+ MX6QDL_PAD_RGMII_TD0__GPIO6_IO20 0x1b0b0
+ >;
+ };
+
+ pinctrl_uart1_dce: uart1dcegrp {
+ fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
+ >;
+ };
+
+ /* DTE mode */
+ pinctrl_uart1_dte: uart1dtegrp {
+ fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT10__UART1_RX_DATA 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT11__UART1_TX_DATA 0x1b0b1
+ MX6QDL_PAD_EIM_D19__UART1_RTS_B 0x1b0b1
+ MX6QDL_PAD_EIM_D20__UART1_CTS_B 0x1b0b1
+ >;
+ };
+
+ /* Additional DTR, DSR, DCD */
+ pinctrl_uart1_ctrl: uart1ctrlgrp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D23__UART1_DCD_B 0x1b0b0
+ MX6QDL_PAD_EIM_D24__UART1_DTR_B 0x1b0b0
+ MX6QDL_PAD_EIM_D25__UART1_DSR_B 0x1b0b0
+ >;
+ };
+
+ pinctrl_uart2_dte: uart2dtegrp {
+ fsl,pins = <
+ MX6QDL_PAD_SD4_DAT4__UART2_TX_DATA 0x1b0b1
+ MX6QDL_PAD_SD4_DAT7__UART2_RX_DATA 0x1b0b1
+ MX6QDL_PAD_SD4_DAT6__UART2_RTS_B 0x1b0b1
+ MX6QDL_PAD_SD4_DAT5__UART2_CTS_B 0x1b0b1
+ >;
+ };
+
+ pinctrl_uart3_dte: uart3dtegrp {
+ fsl,pins = <
+ MX6QDL_PAD_SD4_CLK__UART3_TX_DATA 0x1b0b1
+ MX6QDL_PAD_SD4_CMD__UART3_RX_DATA 0x1b0b1
+ >;
+ };
+
+ pinctrl_usbc_det: usbcdetgrp {
+ fsl,pins = <
+ /* USBC_DET */
+ MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x1b0b0
+ /* USBC_DET_EN */
+ MX6QDL_PAD_RGMII_TX_CTL__GPIO6_IO26 0x0f058
+ /* USBC_DET_OVERWRITE */
+ MX6QDL_PAD_RGMII_RXC__GPIO6_IO30 0x0f058
+ >;
+ };
+
+ pinctrl_usdhc1: usdhc1grp {
+ fsl,pins = <
+ MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17071
+ MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10071
+ MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17071
+ MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17071
+ MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17071
+ MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17071
+ >;
+ };
+
+ pinctrl_usdhc3: usdhc3grp {
+ fsl,pins = <
+ MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
+ MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
+ MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
+ MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
+ MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
+ MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
+ MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059
+ MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059
+ MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059
+ MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059
+ /* eMMC reset */
+ MX6QDL_PAD_SD3_RST__SD3_RESET 0x17059
+ >;
+ };
+
+ pinctrl_usdhc3_100mhz: usdhc3100mhzgrp {
+ fsl,pins = <
+ MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170b9
+ MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100b9
+ MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
+ MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
+ MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
+ MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
+ MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170b9
+ MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170b9
+ MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170b9
+ MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170b9
+ /* eMMC reset */
+ MX6QDL_PAD_SD3_RST__SD3_RESET 0x170b9
+ >;
+ };
+
+ pinctrl_usdhc3_200mhz: usdhc3200mhzgrp {
+ fsl,pins = <
+ MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170f9
+ MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100f9
+ MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
+ MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
+ MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
+ MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
+ MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170f9
+ MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170f9
+ MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170f9
+ MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170f9
+ /* eMMC reset */
+ MX6QDL_PAD_SD3_RST__SD3_RESET 0x170f9
+ >;
+ };
+
+ pinctrl_weim_cs0: weimcs0grp {
+ fsl,pins = <
+ /* nEXT_CS0 */
+ MX6QDL_PAD_EIM_CS0__EIM_CS0_B 0xb0b1
+ >;
+ };
+
+ pinctrl_weim_cs1: weimcs1grp {
+ fsl,pins = <
+ /* nEXT_CS1 */
+ MX6QDL_PAD_EIM_CS1__EIM_CS1_B 0xb0b1
+ >;
+ };
+
+ pinctrl_weim_cs2: weimcs2grp {
+ fsl,pins = <
+ /* nEXT_CS2 */
+ MX6QDL_PAD_SD2_DAT1__EIM_CS2_B 0xb0b1
+ >;
+ };
+
+ pinctrl_weim_sram: weimsramgrp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_OE__EIM_OE_B 0xb0b1
+ MX6QDL_PAD_EIM_RW__EIM_RW 0xb0b1
+ /* Data */
+ MX6QDL_PAD_CSI0_DATA_EN__EIM_DATA00 0x1b0b0
+ MX6QDL_PAD_CSI0_VSYNC__EIM_DATA01 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT4__EIM_DATA02 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT5__EIM_DATA03 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT6__EIM_DATA04 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT7__EIM_DATA05 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT8__EIM_DATA06 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT9__EIM_DATA07 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT12__EIM_DATA08 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT13__EIM_DATA09 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT14__EIM_DATA10 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT15__EIM_DATA11 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT16__EIM_DATA12 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT17__EIM_DATA13 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT18__EIM_DATA14 0x1b0b0
+ MX6QDL_PAD_CSI0_DAT19__EIM_DATA15 0x1b0b0
+ /* Address */
+ MX6QDL_PAD_EIM_DA15__EIM_AD15 0xb0b1
+ MX6QDL_PAD_EIM_DA14__EIM_AD14 0xb0b1
+ MX6QDL_PAD_EIM_DA13__EIM_AD13 0xb0b1
+ MX6QDL_PAD_EIM_DA12__EIM_AD12 0xb0b1
+ MX6QDL_PAD_EIM_DA11__EIM_AD11 0xb0b1
+ MX6QDL_PAD_EIM_DA10__EIM_AD10 0xb0b1
+ MX6QDL_PAD_EIM_DA9__EIM_AD09 0xb0b1
+ MX6QDL_PAD_EIM_DA8__EIM_AD08 0xb0b1
+ MX6QDL_PAD_EIM_DA7__EIM_AD07 0xb0b1
+ MX6QDL_PAD_EIM_DA6__EIM_AD06 0xb0b1
+ MX6QDL_PAD_EIM_DA5__EIM_AD05 0xb0b1
+ MX6QDL_PAD_EIM_DA4__EIM_AD04 0xb0b1
+ MX6QDL_PAD_EIM_DA3__EIM_AD03 0xb0b1
+ MX6QDL_PAD_EIM_DA2__EIM_AD02 0xb0b1
+ MX6QDL_PAD_EIM_DA1__EIM_AD01 0xb0b1
+ MX6QDL_PAD_EIM_DA0__EIM_AD00 0xb0b1
+ >;
+ };
+
+ pinctrl_weim_rdnwr: weimrdnwr {
+ fsl,pins = <
+ MX6QDL_PAD_SD2_CLK__GPIO1_IO10 0x0040
+ MX6QDL_PAD_RGMII_TD3__GPIO6_IO23 0x130b0
+ >;
+ };
+
+ pinctrl_weim_npwe: weimnpwe {
+ fsl,pins = <
+ MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 0x0040
+ MX6QDL_PAD_RGMII_TD2__GPIO6_IO22 0x130b0
+ >;
+ };
+
+ /* ADDRESS[16:18] [25] used as GPIO */
+ pinctrl_weim_gpio_1: weimgpio-1 {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x1b0b0
+ MX6QDL_PAD_KEY_ROW2__GPIO4_IO11 0x1b0b0
+ MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x1b0b0
+ MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
+ >;
+ };
+
+ /* ADDRESS[19:24] used as GPIO */
+ pinctrl_weim_gpio_2: weimgpio-2 {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_ROW2__GPIO4_IO11 0x1b0b0
+ MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13 0x1b0b0
+ MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x1b0b0
+ MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
+ >;
+ };
+
+ /* DATA[16:31] used as GPIO */
+ pinctrl_weim_gpio_3: weimgpio-3 {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_LBA__GPIO2_IO27 0x1b0b0
+ MX6QDL_PAD_EIM_BCLK__GPIO6_IO31 0x1b0b0
+ MX6QDL_PAD_NANDF_CS3__GPIO6_IO16 0x1b0b0
+ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x1b0b0
+ MX6QDL_PAD_NANDF_RB0__GPIO6_IO10 0x1b0b0
+ MX6QDL_PAD_NANDF_ALE__GPIO6_IO08 0x1b0b0
+ MX6QDL_PAD_NANDF_WP_B__GPIO6_IO09 0x1b0b0
+ MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x1b0b0
+ MX6QDL_PAD_NANDF_CLE__GPIO6_IO07 0x1b0b0
+ MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0
+ MX6QDL_PAD_CSI0_MCLK__GPIO5_IO19 0x1b0b0
+ MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18 0x1b0b0
+ MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x1b0b0
+ MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x1b0b0
+ MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x1b0b0
+ >;
+ };
+
+ /* DQM[0:3] used as GPIO */
+ pinctrl_weim_gpio_4: weimgpio-4 {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_EB0__GPIO2_IO28 0x1b0b0
+ MX6QDL_PAD_EIM_EB1__GPIO2_IO29 0x1b0b0
+ MX6QDL_PAD_SD2_DAT2__GPIO1_IO13 0x1b0b0
+ MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x1b0b0
+ >;
+ };
+
+ /* RDY used as GPIO */
+ pinctrl_weim_gpio_5: weimgpio-5 {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_WAIT__GPIO5_IO00 0x1b0b0
+ >;
+ };
+
+ /* ADDRESS[16] DATA[30] used as GPIO */
+ pinctrl_weim_gpio_6: weimgpio-6 {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x1b0b0
+ MX6QDL_PAD_KEY_COL4__GPIO4_IO14 0x1b0b0
+ >;
+ };
+};
--
2.10.0
^ permalink raw reply related
* [PATCH v2 2/9] dmaengine: edma: Use enum for eDMA binding type (legacy vs TPCC)
From: Peter Ujfalusi @ 2016-09-21 11:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <7753810.Z3F41qkFaI@wuerfel>
On 09/21/16 13:31, Arnd Bergmann wrote:
> On Wednesday, September 21, 2016 1:26:30 PM CEST Peter Ujfalusi wrote:
>> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
>> index c2098a4b4dcf..4c8818278fcc 100644
>> --- a/drivers/dma/edma.c
>> +++ b/drivers/dma/edma.c
>> @@ -261,8 +261,11 @@ static const struct edmacc_param dummy_paramset = {
>> .ccnt = 1,
>> };
>>
>> -#define EDMA_BINDING_LEGACY 0
>> -#define EDMA_BINDING_TPCC 1
>> +enum edma_binding_type {
>> + EDMA_BINDING_LEGACY = 0,
>> + EDMA_BINDING_TPCC,
>> +};
>> +
>> static const struct of_device_id edma_of_ids[] = {
>> {
>> .compatible = "ti,edma3",
>> @@ -2184,7 +2187,8 @@ static int edma_probe(struct platform_device *pdev)
>> const struct of_device_id *match;
>>
>> match = of_match_node(edma_of_ids, node);
>> - if (match && (u32)match->data == EDMA_BINDING_TPCC)
>> + if (match &&
>> + (enum edma_binding_type)match->data == EDMA_BINDING_TPCC)
>> legacy_mode = false;
>>
>> info = edma_setup_info_from_dt(dev, legacy_mode);
>> --
>> 2.10.0
>>
>
> Are you sure this works on all architectures? IIRC the size of an enum
> is implementation defined, so this could still fail sometimes.
True, some arch have HW type for enum or something similar.
>
> I tend to use 'uintptr_t' for the cast instead.
What about keeping the defines and:
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 3e9606b08340..493fdf30e8b8 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -263,14 +263,19 @@ static const struct edmacc_param dummy_paramset = {
#define EDMA_BINDING_LEGACY 0
#define EDMA_BINDING_TPCC 1
+static const u32 edma_binding_type[] = {
+ [EDMA_BINDING_LEGACY] = EDMA_BINDING_LEGACY,
+ [EDMA_BINDING_TPCC] = EDMA_BINDING_TPCC,
+};
+
static const struct of_device_id edma_of_ids[] = {
{
.compatible = "ti,edma3",
- .data = (void *)EDMA_BINDING_LEGACY,
+ .data = (void *)&edma_binding_type[EDMA_BINDING_LEGACY],
},
{
.compatible = "ti,edma3-tpcc",
- .data = (void *)EDMA_BINDING_TPCC,
+ .data = (void *)&edma_binding_type[EDMA_BINDING_TPCC],
},
{}
};
@@ -2183,7 +2188,7 @@ static int edma_probe(struct platform_device *pdev)
const struct of_device_id *match;
match = of_match_node(edma_of_ids, node);
- if (match && (u32)match->data == EDMA_BINDING_TPCC)
+ if (match && (*(u32*)match->data) == EDMA_BINDING_TPCC)
legacy_mode = false;
info = edma_setup_info_from_dt(dev, legacy_mode);
same for the ti-dma-crossbar.
--
P?ter
^ permalink raw reply related
* [PATCH] usb: dwc3: host: inherit dma configuration from parent dev
From: Sriram Dash @ 2016-09-21 11:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <3189648.KnWLgq0lTY@wuerfel>
From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner at vger.kernel.org]
>On Wednesday, September 7, 2016 1:24:07 PM CEST Felipe Balbi wrote:
>>
>> Hi,
>>
>> Arnd Bergmann <arnd@arndb.de> writes:
>>
>> [...]
>>
>> > Regarding the DMA configuration that you mention in
>> > ci_hdrc_add_device(), I think we should replace
>> >
>> > pdev->dev.dma_mask = dev->dma_mask;
>> > pdev->dev.dma_parms = dev->dma_parms;
>> > dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask);
>> >
>> > with of_dma_configure(), which has the chance to configure more than
>> > just those three, as the dma API might look into different aspects:
>> >
>> > - iommu specific configuration
>> > - cache coherency information
>> > - bus type
>> > - dma offset
>> > - dma_map_ops pointer
>> >
>> > We try to handle everything in of_dma_configure() at configuration
>> > time, and that would be the place to add anything else that we might
>> > need in the future.
>>
>> There are a couple problems with this:
>>
>> 1) won't work for PCI-based systems.
>>
>> DWC3 is used in production PCI-based HW and also in Synopsys HAPS DX
>> platform (FPGA that appears like a PCI card to host PC)
>
>Right, I was specifically talking about the code in chipidea here, which I think is
>never used on the PCI bus, and how the current code is broken. We can probably do
>better than of_dma_configure() (see below), but it would be an improvement.
>
>> 2) not very robust solution
>>
>> of_dma_configure() will hardcode 32-bit DMA dmask for xhci-plat
>> because that's not created by DT. The only reason why this works at
>> all is because of the default 32-bit dma mask thing :-) So, how is it
>> any different than copying 32-bit dma mask from parent?
>
>The idea here is that you pass in the parent of_node along with the child device
>pointer, so it would behave exactly like the parent already does.
>The difference is that it also handles all the other attributes besides the mask.
>
>However, to summarize the discussion so far, I agree that
>of_dma_configure() is not the solution to these problems, and I think we can do
>much better:
>
>Splitting the usb_bus->controller field into the Linux-internal device (used for the
>sysfs hierarchy, for printks and for power management) and a new pointer (used for
>DMA, DT enumeration and phy lookup) probably covers all that we really need.
>
>I've prototyped it below, with the dwc3, xhci and chipidea changes together with
>the core changes. I've surely made mistakes there and don't expect it to work out
>of the box, but this should give an idea of how I think this can all be solved in the
>least invasive way.
>
Hello Arnd,
We tried this patch on NXP platforms (ls2085 and ls1043) which use dwc3
controller without any glue layer. On first go, this did not work. But after
minimal reworks mention snippet below, we are able to verify that the USB
was working OK.
drivers/usb/host/xhci-mem.c | 12 ++++++------
drivers/usb/host/xhci.c | 20 ++++++++++----------
- struct device *dev = xhci_to_hcd(xhci)->self.controller;
+ struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
We believe the patch needs little modification to work or there might be chances
we may have missed something. Any idea?
Regards,
Sriram
>I noticed that the gadget interface already has a way to handle the DMA allocation
>by device, so I added that in as well.
>
>Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> drivers/usb/chipidea/core.c | 4 ----
> drivers/usb/chipidea/host.c | 3 ++-
> drivers/usb/chipidea/udc.c | 8 ++++----
> drivers/usb/core/buffer.c | 12 ++++++------
> drivers/usb/core/hcd.c | 48 +++++++++++++++++++++++++++++------------------
>-
> drivers/usb/core/usb.c | 16 ++++++++--------
> drivers/usb/dwc3/core.c | 28 +++++++++++++++-------------
> drivers/usb/dwc3/core.h | 1 +
> drivers/usb/dwc3/dwc3-exynos.c | 10 ----------
> drivers/usb/dwc3/dwc3-st.c | 1 -
> drivers/usb/dwc3/ep0.c | 8 ++++----
> drivers/usb/dwc3/gadget.c | 34 +++++++++++++++++-----------------
> drivers/usb/dwc3/host.c | 13 ++++---------
> drivers/usb/host/ehci-fsl.c | 4 ++--
> drivers/usb/host/xhci-plat.c | 32 +++++++++++++++++++++++++-------
> include/linux/usb.h | 1 +
> include/linux/usb/hcd.h | 3 +++
>
>diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index
>69426e644d17..dff69837b349 100644
>--- a/drivers/usb/chipidea/core.c
>+++ b/drivers/usb/chipidea/core.c
>@@ -833,10 +833,6 @@ struct platform_device *ci_hdrc_add_device(struct device
>*dev,
> }
>
> pdev->dev.parent = dev;
>- pdev->dev.dma_mask = dev->dma_mask;
>- pdev->dev.dma_parms = dev->dma_parms;
>- dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask);
>-
> ret = platform_device_add_resources(pdev, res, nres);
> if (ret)
> goto err;
>diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index
>053bac9d983c..40d29c4d7772 100644
>--- a/drivers/usb/chipidea/host.c
>+++ b/drivers/usb/chipidea/host.c
>@@ -113,7 +113,8 @@ static int host_start(struct ci_hdrc *ci)
> if (usb_disabled())
> return -ENODEV;
>
>- hcd = usb_create_hcd(&ci_ehci_hc_driver, ci->dev, dev_name(ci->dev));
>+ hcd = __usb_create_hcd(&ci_ehci_hc_driver, ci->dev->parent,
>+ ci->dev, dev_name(ci->dev), NULL);
> if (!hcd)
> return -ENOMEM;
>
>diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index
>0f692fcda638..4cbfff7934c6 100644
>--- a/drivers/usb/chipidea/udc.c
>+++ b/drivers/usb/chipidea/udc.c
>@@ -424,7 +424,7 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep,
>struct ci_hw_req *hwreq)
>
> hwreq->req.status = -EALREADY;
>
>- ret = usb_gadget_map_request(&ci->gadget, &hwreq->req, hwep->dir);
>+ ret = usb_gadget_map_request_by_dev(&ci->dev->parent, &hwreq->req,
>+hwep->dir);
> if (ret)
> return ret;
>
>@@ -604,7 +604,7 @@ static int _hardware_dequeue(struct ci_hw_ep *hwep,
>struct ci_hw_req *hwreq)
> list_del_init(&node->td);
> }
>
>- usb_gadget_unmap_request(&hwep->ci->gadget, &hwreq->req, hwep-
>>dir);
>+ usb_gadget_unmap_request_by_dev(&hwep->ci->dev->parent, &hwreq-
>>req,
>+hwep->dir);
>
> hwreq->req.actual += actual;
>
>@@ -1898,13 +1898,13 @@ static int udc_start(struct ci_hdrc *ci)
> INIT_LIST_HEAD(&ci->gadget.ep_list);
>
> /* alloc resources */
>- ci->qh_pool = dma_pool_create("ci_hw_qh", dev,
>+ ci->qh_pool = dma_pool_create("ci_hw_qh", dev->parent,
> sizeof(struct ci_hw_qh),
> 64, CI_HDRC_PAGE_SIZE);
> if (ci->qh_pool == NULL)
> return -ENOMEM;
>
>- ci->td_pool = dma_pool_create("ci_hw_td", dev,
>+ ci->td_pool = dma_pool_create("ci_hw_td", dev->parent,
> sizeof(struct ci_hw_td),
> 64, CI_HDRC_PAGE_SIZE);
> if (ci->td_pool == NULL) {
>diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index
>98e39f91723a..1e41ef7f3c1f 100644
>--- a/drivers/usb/core/buffer.c
>+++ b/drivers/usb/core/buffer.c
>@@ -63,7 +63,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
> int i, size;
>
> if (!IS_ENABLED(CONFIG_HAS_DMA) ||
>- (!hcd->self.controller->dma_mask &&
>+ (!hcd->self.sysdev->dma_mask &&
> !(hcd->driver->flags & HCD_LOCAL_MEM)))
> return 0;
>
>@@ -72,7 +72,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
> if (!size)
> continue;
> snprintf(name, sizeof(name), "buffer-%d", size);
>- hcd->pool[i] = dma_pool_create(name, hcd->self.controller,
>+ hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev,
> size, size, 0);
> if (!hcd->pool[i]) {
> hcd_buffer_destroy(hcd);
>@@ -127,7 +127,7 @@ void *hcd_buffer_alloc(
>
> /* some USB hosts just use PIO */
> if (!IS_ENABLED(CONFIG_HAS_DMA) ||
>- (!bus->controller->dma_mask &&
>+ (!bus->sysdev->dma_mask &&
> !(hcd->driver->flags & HCD_LOCAL_MEM))) {
> *dma = ~(dma_addr_t) 0;
> return kmalloc(size, mem_flags);
>@@ -137,7 +137,7 @@ void *hcd_buffer_alloc(
> if (size <= pool_max[i])
> return dma_pool_alloc(hcd->pool[i], mem_flags, dma);
> }
>- return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
>+ return dma_alloc_coherent(hcd->self.sysdev, size, dma, mem_flags);
> }
>
> void hcd_buffer_free(
>@@ -154,7 +154,7 @@ void hcd_buffer_free(
> return;
>
> if (!IS_ENABLED(CONFIG_HAS_DMA) ||
>- (!bus->controller->dma_mask &&
>+ (!bus->sysdev->dma_mask &&
> !(hcd->driver->flags & HCD_LOCAL_MEM))) {
> kfree(addr);
> return;
>@@ -166,5 +166,5 @@ void hcd_buffer_free(
> return;
> }
> }
>- dma_free_coherent(hcd->self.controller, size, addr, dma);
>+ dma_free_coherent(hcd->self.sysdev, size, addr, dma);
> }
>diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index
>746c47d86cf5..70d48941f8f4 100644
>--- a/drivers/usb/core/hcd.c
>+++ b/drivers/usb/core/hcd.c
>@@ -1072,6 +1072,7 @@ static void usb_deregister_bus (struct usb_bus *bus)
>static int register_root_hub(struct usb_hcd *hcd) {
> struct device *parent_dev = hcd->self.controller;
>+ struct device *sysdev = hcd->self.sysdev;
> struct usb_device *usb_dev = hcd->self.root_hub;
> const int devnum = 1;
> int retval;
>@@ -1118,7 +1119,7 @@ static int register_root_hub(struct usb_hcd *hcd)
> /* Did the HC die before the root hub was registered? */
> if (HCD_DEAD(hcd))
> usb_hc_died (hcd); /* This time clean up */
>- usb_dev->dev.of_node = parent_dev->of_node;
>+ usb_dev->dev.of_node = sysdev->of_node;
> }
> mutex_unlock(&usb_bus_idr_lock);
>
>@@ -1464,19 +1465,19 @@ void usb_hcd_unmap_urb_for_dma(struct usb_hcd
>*hcd, struct urb *urb)
> dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
> if (IS_ENABLED(CONFIG_HAS_DMA) &&
> (urb->transfer_flags & URB_DMA_MAP_SG))
>- dma_unmap_sg(hcd->self.controller,
>+ dma_unmap_sg(hcd->self.sysdev,
> urb->sg,
> urb->num_sgs,
> dir);
> else if (IS_ENABLED(CONFIG_HAS_DMA) &&
> (urb->transfer_flags & URB_DMA_MAP_PAGE))
>- dma_unmap_page(hcd->self.controller,
>+ dma_unmap_page(hcd->self.sysdev,
> urb->transfer_dma,
> urb->transfer_buffer_length,
> dir);
> else if (IS_ENABLED(CONFIG_HAS_DMA) &&
> (urb->transfer_flags & URB_DMA_MAP_SINGLE))
>- dma_unmap_single(hcd->self.controller,
>+ dma_unmap_single(hcd->self.sysdev,
> urb->transfer_dma,
> urb->transfer_buffer_length,
> dir);
>@@ -1519,11 +1520,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd,
>struct urb *urb,
> return ret;
> if (IS_ENABLED(CONFIG_HAS_DMA) && hcd->self.uses_dma) {
> urb->setup_dma = dma_map_single(
>- hcd->self.controller,
>+ hcd->self.sysdev,
> urb->setup_packet,
> sizeof(struct usb_ctrlrequest),
> DMA_TO_DEVICE);
>- if (dma_mapping_error(hcd->self.controller,
>+ if (dma_mapping_error(hcd->self.sysdev,
> urb->setup_dma))
> return -EAGAIN;
> urb->transfer_flags |= URB_SETUP_MAP_SINGLE; @@ -
>1554,7 +1555,7 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb
>*urb,
> }
>
> n = dma_map_sg(
>- hcd->self.controller,
>+ hcd->self.sysdev,
> urb->sg,
> urb->num_sgs,
> dir);
>@@ -1569,12 +1570,12 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd,
>struct urb *urb,
> } else if (urb->sg) {
> struct scatterlist *sg = urb->sg;
> urb->transfer_dma = dma_map_page(
>- hcd->self.controller,
>+ hcd->self.sysdev,
> sg_page(sg),
> sg->offset,
> urb->transfer_buffer_length,
> dir);
>- if (dma_mapping_error(hcd->self.controller,
>+ if (dma_mapping_error(hcd->self.sysdev,
> urb->transfer_dma))
> ret = -EAGAIN;
> else
>@@ -1584,11 +1585,11 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd,
>struct urb *urb,
> ret = -EAGAIN;
> } else {
> urb->transfer_dma = dma_map_single(
>- hcd->self.controller,
>+ hcd->self.sysdev,
> urb->transfer_buffer,
> urb->transfer_buffer_length,
> dir);
>- if (dma_mapping_error(hcd->self.controller,
>+ if (dma_mapping_error(hcd->self.sysdev,
> urb->transfer_dma))
> ret = -EAGAIN;
> else
>@@ -2510,8 +2511,8 @@ static void init_giveback_urb_bh(struct giveback_urb_bh
>*bh)
> * Return: On success, a pointer to the created and initialized HCD structure.
> * On failure (e.g. if memory is unavailable), %NULL.
> */
>-struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
>- struct device *dev, const char *bus_name,
>+struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
>+ struct device *sysdev, struct device *dev, const char *bus_name,
> struct usb_hcd *primary_hcd)
> {
> struct usb_hcd *hcd;
>@@ -2552,8 +2553,9 @@ struct usb_hcd *usb_create_shared_hcd(const struct
>hc_driver *driver,
>
> usb_bus_init(&hcd->self);
> hcd->self.controller = dev;
>+ hcd->self.sysdev = sysdev;
> hcd->self.bus_name = bus_name;
>- hcd->self.uses_dma = (dev->dma_mask != NULL);
>+ hcd->self.uses_dma = (sysdev->dma_mask != NULL);
>
> init_timer(&hcd->rh_timer);
> hcd->rh_timer.function = rh_timer_func; @@ -2568,6 +2570,14 @@ struct
>usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
> "USB Host Controller";
> return hcd;
> }
>+EXPORT_SYMBOL_GPL(__usb_create_hcd);
>+
>+struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
>+ struct device *dev, const char *bus_name,
>+ struct usb_hcd *primary_hcd)
>+{
>+ return __usb_create_hcd(driver, dev, dev, bus_name, primary_hcd); }
> EXPORT_SYMBOL_GPL(usb_create_shared_hcd);
>
> /**
>@@ -2587,7 +2597,7 @@ EXPORT_SYMBOL_GPL(usb_create_shared_hcd);
> struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
> struct device *dev, const char *bus_name) {
>- return usb_create_shared_hcd(driver, dev, bus_name, NULL);
>+ return __usb_create_hcd(driver, dev, dev, bus_name, NULL);
> }
> EXPORT_SYMBOL_GPL(usb_create_hcd);
>
>@@ -2714,7 +2724,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> struct usb_device *rhdev;
>
> if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->usb_phy) {
>- struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0);
>+ struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
>
> if (IS_ERR(phy)) {
> retval = PTR_ERR(phy);
>@@ -2732,7 +2742,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> }
>
> if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
>- struct phy *phy = phy_get(hcd->self.controller, "usb");
>+ struct phy *phy = phy_get(hcd->self.sysdev, "usb");
>
> if (IS_ERR(phy)) {
> retval = PTR_ERR(phy);
>@@ -2780,7 +2790,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> */
> retval = hcd_buffer_create(hcd);
> if (retval != 0) {
>- dev_dbg(hcd->self.controller, "pool alloc failed\n");
>+ dev_dbg(hcd->self.sysdev, "pool alloc failed\n");
> goto err_create_buf;
> }
>
>@@ -2790,7 +2800,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
>
> rhdev = usb_alloc_dev(NULL, &hcd->self, 0);
> if (rhdev == NULL) {
>- dev_err(hcd->self.controller, "unable to allocate root hub\n");
>+ dev_err(hcd->self.sysdev, "unable to allocate root hub\n");
> retval = -ENOMEM;
> goto err_allocate_root_hub;
> }
>diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index
>5e80697ef952..199f67ae8857 100644
>--- a/drivers/usb/core/usb.c
>+++ b/drivers/usb/core/usb.c
>@@ -440,8 +440,8 @@ struct usb_device *usb_alloc_dev(struct usb_device
>*parent,
> dev->dev.bus = &usb_bus_type;
> dev->dev.type = &usb_device_type;
> dev->dev.groups = usb_device_groups;
>- dev->dev.dma_mask = bus->controller->dma_mask;
>- set_dev_node(&dev->dev, dev_to_node(bus->controller));
>+ dev->dev.dma_mask = bus->sysdev->dma_mask;
>+ set_dev_node(&dev->dev, dev_to_node(bus->sysdev));
> dev->state = USB_STATE_ATTACHED;
> dev->lpm_disable_count = 1;
> atomic_set(&dev->urbnum, 0);
>@@ -789,7 +789,7 @@ struct urb *usb_buffer_map(struct urb *urb)
> if (!urb
> || !urb->dev
> || !(bus = urb->dev->bus)
>- || !(controller = bus->controller))
>+ || !(controller = bus->sysdev))
> return NULL;
>
> if (controller->dma_mask) {
>@@ -827,7 +827,7 @@ void usb_buffer_dmasync(struct urb *urb)
> || !(urb->transfer_flags &
>URB_NO_TRANSFER_DMA_MAP)
> || !urb->dev
> || !(bus = urb->dev->bus)
>- || !(controller = bus->controller))
>+ || !(controller = bus->sysdev))
> return;
>
> if (controller->dma_mask) {
>@@ -861,7 +861,7 @@ void usb_buffer_unmap(struct urb *urb)
> || !(urb->transfer_flags &
>URB_NO_TRANSFER_DMA_MAP)
> || !urb->dev
> || !(bus = urb->dev->bus)
>- || !(controller = bus->controller))
>+ || !(controller = bus->sysdev))
> return;
>
> if (controller->dma_mask) {
>@@ -911,7 +911,7 @@ int usb_buffer_map_sg(const struct usb_device *dev, int
>is_in,
>
> if (!dev
> || !(bus = dev->bus)
>- || !(controller = bus->controller)
>+ || !(controller = bus->sysdev)
> || !controller->dma_mask)
> return -EINVAL;
>
>@@ -947,7 +947,7 @@ void usb_buffer_dmasync_sg(const struct usb_device *dev,
>int is_in,
>
> if (!dev
> || !(bus = dev->bus)
>- || !(controller = bus->controller)
>+ || !(controller = bus->sysdev)
> || !controller->dma_mask)
> return;
>
>@@ -975,7 +975,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev,
>int is_in,
>
> if (!dev
> || !(bus = dev->bus)
>- || !(controller = bus->controller)
>+ || !(controller = bus->sysdev)
> || !controller->dma_mask)
> return;
>
>diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
>35d092456bec..08db66c64c66 100644
>--- a/drivers/usb/dwc3/core.c
>+++ b/drivers/usb/dwc3/core.c
>@@ -25,6 +25,7 @@
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/platform_device.h>
>+#include <linux/pci.h>
> #include <linux/pm_runtime.h>
> #include <linux/interrupt.h>
> #include <linux/ioport.h>
>@@ -178,7 +179,7 @@ static void dwc3_frame_length_adjustment(struct dwc3
>*dwc) static void dwc3_free_one_event_buffer(struct dwc3 *dwc,
> struct dwc3_event_buffer *evt)
> {
>- dma_free_coherent(dwc->dev, evt->length, evt->buf, evt->dma);
>+ dma_free_coherent(dwc->sysdev, evt->length, evt->buf, evt->dma);
> }
>
> /**
>@@ -200,7 +201,7 @@ static struct dwc3_event_buffer
>*dwc3_alloc_one_event_buffer(struct dwc3 *dwc,
>
> evt->dwc = dwc;
> evt->length = length;
>- evt->buf = dma_alloc_coherent(dwc->dev, length,
>+ evt->buf = dma_alloc_coherent(dwc->sysdev, length,
> &evt->dma, GFP_KERNEL);
> if (!evt->buf)
> return ERR_PTR(-ENOMEM);
>@@ -319,11 +320,11 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc)
> if (!WARN_ON(dwc->scratchbuf))
> return 0;
>
>- scratch_addr = dma_map_single(dwc->dev, dwc->scratchbuf,
>+ scratch_addr = dma_map_single(dwc->sysdev, dwc->scratchbuf,
> dwc->nr_scratch * DWC3_SCRATCHBUF_SIZE,
> DMA_BIDIRECTIONAL);
>- if (dma_mapping_error(dwc->dev, scratch_addr)) {
>- dev_err(dwc->dev, "failed to map scratch buffer\n");
>+ if (dma_mapping_error(dwc->sysdev, scratch_addr)) {
>+ dev_err(dwc->sysdev, "failed to map scratch buffer\n");
> ret = -EFAULT;
> goto err0;
> }
>@@ -347,7 +348,7 @@ static int dwc3_setup_scratch_buffers(struct dwc3 *dwc)
> return 0;
>
> err1:
>- dma_unmap_single(dwc->dev, dwc->scratch_addr, dwc->nr_scratch *
>+ dma_unmap_single(dwc->sysdev, dwc->scratch_addr, dwc->nr_scratch *
> DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
>
> err0:
>@@ -366,7 +367,7 @@ static void dwc3_free_scratch_buffers(struct dwc3 *dwc)
> if (!WARN_ON(dwc->scratchbuf))
> return;
>
>- dma_unmap_single(dwc->dev, dwc->scratch_addr, dwc->nr_scratch *
>+ dma_unmap_single(dwc->sysdev, dwc->scratch_addr, dwc->nr_scratch *
> DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
> kfree(dwc->scratchbuf);
> }
>@@ -846,6 +847,13 @@ static int dwc3_probe(struct platform_device *pdev)
> dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
> dwc->mem = mem;
> dwc->dev = dev;
>+#ifdef CONFIG_PCI
>+ /* TODO: or some other way of detecting this? */
>+ if (dwc->dev->parent && dwc->dev->parent->bus == &pci_bus_type)
>+ dwc->sysdev = dwc->dev->parent;
>+ else
>+#endif
>+ dwc->sysdev = dwc->dev;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res) {
>@@ -949,12 +957,6 @@ static int dwc3_probe(struct platform_device *pdev)
>
> spin_lock_init(&dwc->lock);
>
>- if (!dev->dma_mask) {
>- dev->dma_mask = dev->parent->dma_mask;
>- dev->dma_parms = dev->parent->dma_parms;
>- dma_set_coherent_mask(dev, dev->parent-
>>coherent_dma_mask);
>- }
>-
> pm_runtime_set_active(dev);
> pm_runtime_use_autosuspend(dev);
> pm_runtime_set_autosuspend_delay(dev,
>DWC3_DEFAULT_AUTOSUSPEND_DELAY); diff --git a/drivers/usb/dwc3/core.h
>b/drivers/usb/dwc3/core.h index 45d6de5107c7..2fbc92143ab9 100644
>--- a/drivers/usb/dwc3/core.h
>+++ b/drivers/usb/dwc3/core.h
>@@ -823,6 +823,7 @@ struct dwc3 {
> spinlock_t lock;
>
> struct device *dev;
>+ struct device *sysdev;
>
> struct platform_device *xhci;
> struct resource xhci_resources[DWC3_XHCI_RESOURCES_NUM];
>diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
>index 2f1fb7e7aa54..e27899bb5706 100644
>--- a/drivers/usb/dwc3/dwc3-exynos.c
>+++ b/drivers/usb/dwc3/dwc3-exynos.c
>@@ -20,7 +20,6 @@
> #include <linux/kernel.h>
> #include <linux/slab.h>
> #include <linux/platform_device.h>
>-#include <linux/dma-mapping.h>
> #include <linux/clk.h>
> #include <linux/usb/otg.h>
> #include <linux/usb/usb_phy_generic.h>
>@@ -117,15 +116,6 @@ static int dwc3_exynos_probe(struct platform_device
>*pdev)
> if (!exynos)
> return -ENOMEM;
>
>- /*
>- * Right now device-tree probed devices don't get dma_mask set.
>- * Since shared usb code relies on it, set it here for now.
>- * Once we move to full device tree support this will vanish off.
>- */
>- ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
>- if (ret)
>- return ret;
>-
> platform_set_drvdata(pdev, exynos);
>
> exynos->dev = dev;
>diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index
>89a2f712fdfe..4d7439cb8cd8 100644
>--- a/drivers/usb/dwc3/dwc3-st.c
>+++ b/drivers/usb/dwc3/dwc3-st.c
>@@ -218,7 +218,6 @@ static int st_dwc3_probe(struct platform_device *pdev)
> if (IS_ERR(regmap))
> return PTR_ERR(regmap);
>
>- dma_set_coherent_mask(dev, dev->coherent_dma_mask);
> dwc3_data->dev = dev;
> dwc3_data->regmap = regmap;
>
>diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index
>ae4c5e89c134..9cda9ee91b9d 100644
>--- a/drivers/usb/dwc3/ep0.c
>+++ b/drivers/usb/dwc3/ep0.c
>@@ -974,8 +974,8 @@ static void __dwc3_ep0_do_control_data(struct dwc3
>*dwc,
> u32 transfer_size = 0;
> u32 maxpacket;
>
>- ret = usb_gadget_map_request(&dwc->gadget, &req->request,
>- dep->number);
>+ ret = usb_gadget_map_request_by_dev(dwc->sysdev,
>+ &req->request, dep->number);
> if (ret) {
> dwc3_trace(trace_dwc3_ep0, "failed to map request");
> return;
>@@ -1002,8 +1002,8 @@ static void __dwc3_ep0_do_control_data(struct dwc3
>*dwc,
> dwc->ep0_bounce_addr, transfer_size,
> DWC3_TRBCTL_CONTROL_DATA, false);
> } else {
>- ret = usb_gadget_map_request(&dwc->gadget, &req->request,
>- dep->number);
>+ ret = usb_gadget_map_request_by_dev(dwc->sysdev,
>+ &req->request, dep->number);
> if (ret) {
> dwc3_trace(trace_dwc3_ep0, "failed to map request");
> return;
>diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index
>122e64df2f4d..77d62ce4547f 100644
>--- a/drivers/usb/dwc3/gadget.c
>+++ b/drivers/usb/dwc3/gadget.c
>@@ -192,8 +192,8 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct
>dwc3_request *req,
> if (dwc->ep0_bounced && dep->number == 0)
> dwc->ep0_bounced = false;
> else
>- usb_gadget_unmap_request(&dwc->gadget, &req->request,
>- req->direction);
>+ usb_gadget_unmap_request_by_dev(dwc->sysdev,
>+ &req->request, req->direction);
>
> trace_dwc3_gadget_giveback(req);
>
>@@ -371,7 +371,7 @@ static int dwc3_alloc_trb_pool(struct dwc3_ep *dep)
> if (dep->trb_pool)
> return 0;
>
>- dep->trb_pool = dma_alloc_coherent(dwc->dev,
>+ dep->trb_pool = dma_alloc_coherent(dwc->sysdev,
> sizeof(struct dwc3_trb) * DWC3_TRB_NUM,
> &dep->trb_pool_dma, GFP_KERNEL);
> if (!dep->trb_pool) {
>@@ -387,7 +387,7 @@ static void dwc3_free_trb_pool(struct dwc3_ep *dep) {
> struct dwc3 *dwc = dep->dwc;
>
>- dma_free_coherent(dwc->dev, sizeof(struct dwc3_trb) *
>DWC3_TRB_NUM,
>+ dma_free_coherent(dwc->sysdev, sizeof(struct dwc3_trb) *
>DWC3_TRB_NUM,
> dep->trb_pool, dep->trb_pool_dma);
>
> dep->trb_pool = NULL;
>@@ -1027,8 +1027,8 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep
>*dep, u16 cmd_param)
> * here and stop, unmap, free and del each of the linked
> * requests instead of what we do now.
> */
>- usb_gadget_unmap_request(&dwc->gadget, &req->request,
>- req->direction);
>+ usb_gadget_unmap_request_by_dev(dwc->sysdev,
>+ &req->request, req->direction);
> list_del(&req->list);
> return ret;
> }
>@@ -1113,8 +1113,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep
>*dep, struct dwc3_request *req)
> * This will also avoid Host cancelling URBs due to too
> * many NAKs.
> */
>- ret = usb_gadget_map_request(&dwc->gadget, &req->request,
>- dep->direction);
>+ ret = usb_gadget_map_request_by_dev(dwc->sysdev,
>+ &req->request, dep->direction);
> if (ret)
> return ret;
>
>@@ -2953,7 +2953,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
>
> dwc->irq_gadget = irq;
>
>- dwc->ctrl_req = dma_alloc_coherent(dwc->dev, sizeof(*dwc->ctrl_req),
>+ dwc->ctrl_req = dma_alloc_coherent(dwc->sysdev,
>+sizeof(*dwc->ctrl_req),
> &dwc->ctrl_req_addr, GFP_KERNEL);
> if (!dwc->ctrl_req) {
> dev_err(dwc->dev, "failed to allocate ctrl request\n"); @@ -2961,7
>+2961,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
> goto err0;
> }
>
>- dwc->ep0_trb = dma_alloc_coherent(dwc->dev, sizeof(*dwc->ep0_trb) * 2,
>+ dwc->ep0_trb = dma_alloc_coherent(dwc->sysdev, sizeof(*dwc->ep0_trb)
>*
>+2,
> &dwc->ep0_trb_addr, GFP_KERNEL);
> if (!dwc->ep0_trb) {
> dev_err(dwc->dev, "failed to allocate ep0 trb\n"); @@ -2975,7
>+2975,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
> goto err2;
> }
>
>- dwc->ep0_bounce = dma_alloc_coherent(dwc->dev,
>+ dwc->ep0_bounce = dma_alloc_coherent(dwc->sysdev,
> DWC3_EP0_BOUNCE_SIZE, &dwc->ep0_bounce_addr,
> GFP_KERNEL);
> if (!dwc->ep0_bounce) {
>@@ -3047,18 +3047,18 @@ err5:
>
> err4:
> dwc3_gadget_free_endpoints(dwc);
>- dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
>+ dma_free_coherent(dwc->sysdev, DWC3_EP0_BOUNCE_SIZE,
> dwc->ep0_bounce, dwc->ep0_bounce_addr);
>
> err3:
> kfree(dwc->setup_buf);
>
> err2:
>- dma_free_coherent(dwc->dev, sizeof(*dwc->ep0_trb),
>+ dma_free_coherent(dwc->sysdev, sizeof(*dwc->ep0_trb),
> dwc->ep0_trb, dwc->ep0_trb_addr);
>
> err1:
>- dma_free_coherent(dwc->dev, sizeof(*dwc->ctrl_req),
>+ dma_free_coherent(dwc->sysdev, sizeof(*dwc->ctrl_req),
> dwc->ctrl_req, dwc->ctrl_req_addr);
>
> err0:
>@@ -3073,16 +3073,16 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
>
> dwc3_gadget_free_endpoints(dwc);
>
>- dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
>+ dma_free_coherent(dwc->sysdev, DWC3_EP0_BOUNCE_SIZE,
> dwc->ep0_bounce, dwc->ep0_bounce_addr);
>
> kfree(dwc->setup_buf);
> kfree(dwc->zlp_buf);
>
>- dma_free_coherent(dwc->dev, sizeof(*dwc->ep0_trb),
>+ dma_free_coherent(dwc->sysdev, sizeof(*dwc->ep0_trb),
> dwc->ep0_trb, dwc->ep0_trb_addr);
>
>- dma_free_coherent(dwc->dev, sizeof(*dwc->ctrl_req),
>+ dma_free_coherent(dwc->sysdev, sizeof(*dwc->ctrl_req),
> dwc->ctrl_req, dwc->ctrl_req_addr);
> }
>
>diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index
>f6533c68fed1..3c078e85fa98 100644
>--- a/drivers/usb/dwc3/host.c
>+++ b/drivers/usb/dwc3/host.c
>@@ -72,12 +72,7 @@ int dwc3_host_init(struct dwc3 *dwc)
> return -ENOMEM;
> }
>
>- dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
>-
> xhci->dev.parent = dwc->dev;
>- xhci->dev.dma_mask = dwc->dev->dma_mask;
>- xhci->dev.dma_parms = dwc->dev->dma_parms;
>-
> dwc->xhci = xhci;
>
> ret = platform_device_add_resources(xhci, dwc->xhci_resources, @@ -
>112,9 +107,9 @@ int dwc3_host_init(struct dwc3 *dwc)
> return 0;
> err2:
> phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
>- dev_name(&xhci->dev));
>+ dev_name(dwc->dev));
> phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
>- dev_name(&xhci->dev));
>+ dev_name(dwc->dev));
> err1:
> platform_device_put(xhci);
> return ret;
>@@ -123,8 +118,8 @@ err1:
> void dwc3_host_exit(struct dwc3 *dwc)
> {
> phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
>- dev_name(&dwc->xhci->dev));
>+ dev_name(dwc->dev));
> phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
>- dev_name(&dwc->xhci->dev));
>+ dev_name(dwc->dev));
> platform_device_unregister(dwc->xhci);
> }
>diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index
>9f5ffb629973..b2419950221f 100644
>--- a/drivers/usb/host/ehci-fsl.c
>+++ b/drivers/usb/host/ehci-fsl.c
>@@ -96,8 +96,8 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
> }
> irq = res->start;
>
>- hcd = usb_create_hcd(&fsl_ehci_hc_driver, &pdev->dev,
>- dev_name(&pdev->dev));
>+ hcd = __usb_create_hcd(&fsl_ehci_hc_driver, &pdev->dev.parent,
>+ &pdev->dev, dev_name(&pdev->dev), NULL);
> if (!hcd) {
> retval = -ENOMEM;
> goto err1;
>diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index
>ed56bf9ed885..c1d69e14432d 100644
>--- a/drivers/usb/host/xhci-plat.c
>+++ b/drivers/usb/host/xhci-plat.c
>@@ -14,6 +14,7 @@
> #include <linux/clk.h>
> #include <linux/dma-mapping.h>
> #include <linux/module.h>
>+#include <linux/pci.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> #include <linux/usb/phy.h>
>@@ -139,6 +140,7 @@ static int xhci_plat_probe(struct platform_device *pdev) {
> const struct of_device_id *match;
> const struct hc_driver *driver;
>+ struct device *sysdev;
> struct xhci_hcd *xhci;
> struct resource *res;
> struct usb_hcd *hcd;
>@@ -155,22 +157,38 @@ static int xhci_plat_probe(struct platform_device *pdev)
> if (irq < 0)
> return -ENODEV;
>
>+ /*
>+ * sysdev must point to a device that is known to the system firmware
>+ * or PCI hardware. We handle these three cases here:
>+ * 1. xhci_plat comes from firmware
>+ * 2. xhci_plat is child of a device from firmware (dwc3-plat)
>+ * 3. xhci_plat is grandchild of a pci device (dwc3-pci)
>+ */
>+ sysdev = &pdev->dev;
>+ if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node)
>+ sysdev = sysdev->parent;
>+#ifdef CONFIG_PCI
>+ else if (sysdev->parent && sysdev->parent->parent &&
>+ sysdev->parent->parent->bus == &pci_bus_type)
>+ sysdev = sysdev->parent->parent;
>+#endif
>+
> /* Try to set 64-bit DMA first */
>- if (WARN_ON(!pdev->dev.dma_mask))
>+ if (WARN_ON(!sysdev->dma_mask))
> /* Platform did not initialize dma_mask */
>- ret = dma_coerce_mask_and_coherent(&pdev->dev,
>+ ret = dma_coerce_mask_and_coherent(sysdev,
> DMA_BIT_MASK(64));
> else
>- ret = dma_set_mask_and_coherent(&pdev->dev,
>DMA_BIT_MASK(64));
>+ ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
>
> /* If seting 64-bit DMA mask fails, fall back to 32-bit DMA mask */
> if (ret) {
>- ret = dma_set_mask_and_coherent(&pdev->dev,
>DMA_BIT_MASK(32));
>+ ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(32));
> if (ret)
> return ret;
> }
>
>- hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
>+ hcd = __usb_create_hcd(driver, sysdev, &pdev->dev,
>+dev_name(&pdev->dev), NULL);
> if (!hcd)
> return -ENOMEM;
>
>@@ -220,13 +238,13 @@ static int xhci_plat_probe(struct platform_device *pdev)
> goto disable_clk;
> }
>
>- if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable"))
>+ if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
> xhci->quirks |= XHCI_LPM_SUPPORT;
>
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
>- hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy",
>0);
>+ hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
> if (IS_ERR(hcd->usb_phy)) {
> ret = PTR_ERR(hcd->usb_phy);
> if (ret == -EPROBE_DEFER)
>diff --git a/include/linux/usb.h b/include/linux/usb.h index
>eba1f10e8cfd..f3f5d8a396e4 100644
>--- a/include/linux/usb.h
>+++ b/include/linux/usb.h
>@@ -354,6 +354,7 @@ struct usb_devmap {
> */
> struct usb_bus {
> struct device *controller; /* host/master side hardware */
>+ struct device *sysdev; /* as seen from firmware or bus */
> int busnum; /* Bus number (in order of reg) */
> const char *bus_name; /* stable id (PCI slot_name etc) */
> u8 uses_dma; /* Does the host controller use DMA? */
>diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index
>66fc13705ab7..3860560a61bb 100644
>--- a/include/linux/usb/hcd.h
>+++ b/include/linux/usb/hcd.h
>@@ -437,6 +437,9 @@ extern int usb_hcd_alloc_bandwidth(struct usb_device
>*udev,
> struct usb_host_interface *new_alt);
> extern int usb_hcd_get_frame_number(struct usb_device *udev);
>
>+struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
>+ struct device *sysdev, struct device *dev, const char *bus_name,
>+ struct usb_hcd *primary_hcd);
> extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
> struct device *dev, const char *bus_name); extern struct usb_hcd
>*usb_create_shared_hcd(const struct hc_driver *driver,
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a
>message to majordomo at vger.kernel.org More majordomo info at
>http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 2/4] ARM: tegra: nyan: Use external control for bq24735 charger
From: Paul Kocialkowski @ 2016-09-21 11:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <baca958f-1db6-b9f2-ce94-c523f21d6769@nvidia.com>
Le mercredi 21 septembre 2016 ? 11:10 +0100, Jon Hunter a ?crit?:
> On 21/09/16 08:56, Paul Kocialkowski wrote:
>
> ...
>
> > Sure, this is exported at: /sys/class/power_supply/bq24735 at 5-0009
> > Also, note that the power-supply next branch[2] has some more fixes for the
> > bq24735 driver.
>
> I tested the bq24735 on next-20160919 without any of your changes and?
> when connecting or disconnecting the charger I see the following panic.
> Do you see this?
I have not encountered that, but have been basing my work off the latest rc, not
linux-next.
> / # [???30.120384] Unable to handle kernel NULL pointer dereference at virtual
> address 00000004
> [???30.128489] pgd = c0004000
> [???30.131187] [00000004] *pgd=00000000
> [???30.134759] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
> [???30.140141] Modules linked in:
> [???30.143192] CPU: 1 PID: 71 Comm: kworker/1:1 Not tainted 4.8.0-rc6-next-
> 20160919-00002-gbc9771827865-dirty #574
> [???30.153254] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
> [???30.159509] Workqueue: events power_supply_changed_work
> [???30.164723] task: ee19f880 task.stack: ee1a0000
> [???30.169239] PC is at sbs_external_power_changed+0x50/0x5c
> [???30.174624] LR is at mod_timer+0x194/0x270
> [???30.178705] pc : [<c05b0c58>]????lr : [<c017cda0>]????psr: 60000113
> [???30.178705] sp : ee1a1eb8??ip : 80000000??fp : ee8e3680
> [???30.190155] r10: eef98580??r9 : 00000000??r8 : 00000000
> [???30.195363] r7 : ee303000??r6 : c05afef8??r5 : ee3e03f8??r4 : ee3e03d0
> [???30.201872] r3 : 00000000??r2 : 00000000??r1 : 40000193??r0 : 00000001
> [???30.208382] Flags: nZCv??IRQs on??FIQs on??Mode SVC_32??ISA ARM??Segment
> none
> [???30.215497] Control: 10c5387d??Table: adcf006a??DAC: 00000051
> [???30.221226] Process kworker/1:1 (pid: 71, stack limit = 0xee1a0210)
> [???30.227474] Stack: (0xee1a1eb8 to 0xee1a2000)
> [???30.231816]
> 1ea0:???????????????????????????????????????????????????????edc0bc00 ee303000
> [???30.239973] 1ec0: c05afef8 c05aff2c edc0bc20 c045ec1c eef95c80 eef95c80
> 00000001 eea82d5c
> [???30.248136] 1ee0: edc0bd98 00000000 ee3031c0 ee303218 c0eab740 c05afcc4
> ee8e3680 ee3031c0
> [???30.256296] 1f00: eef9b800 00000000 eef98580 c0135824 eef98598 c0e02100
> eef98580 ee8e3698
> [???30.264453] 1f20: 00000008 eef98598 c0e02100 ee1a0000 eef98580 c0135a74
> ee840f80 ee8e3680
> [???30.272610] 1f40: c0135a3c 00000000 ee840f80 ee8e3680 c0135a3c 00000000
> 00000000 00000000
> [???30.280766] 1f60: 00000000 c013af18 00000000 00000000 00000000 ee8e3680
> 00000000 00000000
> [???30.288922] 1f80: ee1a1f80 ee1a1f80 00000000 00000000 ee1a1f90 ee1a1f90
> ee1a1fac ee840f80
> [???30.297078] 1fa0: c013ae3c 00000000 00000000 c01078b8 00000000 00000000
> 00000000 00000000
> [???30.305234] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> [???30.313389] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> 00000000 00000000
> [???30.321555] [<c05b0c58>] (sbs_external_power_changed) from [<c05aff2c>]
> (__power_supply_changed_work+0x34/0x3c)
> [???30.331623] [<c05aff2c>] (__power_supply_changed_work) from [<c045ec1c>]
> (class_for_each_device+0x4c/0xb4)
> [???30.341254] [<c045ec1c>] (class_for_each_device) from [<c05afcc4>]
> (power_supply_changed_work+0x5c/0xb0)
> [???30.350713] [<c05afcc4>] (power_supply_changed_work) from [<c0135824>]
> (process_one_work+0x124/0x33c)
> [???30.359912] [<c0135824>] (process_one_work) from [<c0135a74>]
> (worker_thread+0x38/0x4d4)
> [???30.367983] [<c0135a74>] (worker_thread) from [<c013af18>]
> (kthread+0xdc/0xf4)
> [???30.375187] [<c013af18>] (kthread) from [<c01078b8>]
> (ret_from_fork+0x14/0x3c)
> [???30.382391] Code: e5911000 e3a00004 ebee0b88 e5943008 (e5933004)?
> [???30.388504] ---[ end trace 083d55597e9a2254 ]---
> [???30.393140] Unable to handle kernel paging request at virtual address
> ffffffec
> [???30.400342] pgd = c0004000
> [???30.403038] [ffffffec] *pgd=afffd861, *pte=00000000, *ppte=00000000
> [???30.409309] Internal error: Oops: 37 [#2] PREEMPT SMP ARM
> [???30.414690] Modules linked in:
> [???30.417738] CPU: 1 PID: 71 Comm: kworker/1:1 Tainted:
> G??????D?????????4.8.0-rc6-next-20160919-00002-gbc9771827865-dirty #574
> [???30.429013] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
> [???30.435265] task: ee19f880 task.stack: ee1a0000
> [???30.439782] PC is at kthread_data+0x4/0xc
> [???30.443779] LR is at wq_worker_sleeping+0x8/0xc8
> [???30.448381] pc : [<c013b8a8>]????lr : [<c01366e0>]????psr: 20000193
> [???30.448381] sp : ee1a1c58??ip : eef98f28??fp : ee1a1cb4
> [???30.459836] r10: eef98a00??r9 : c0e5f000??r8 : c0d9ea00
> [???30.465048] r7 : ee19fcc8??r6 : c0e02e08??r5 : ee19f880??r4 : eef98a00
> [???30.471556] r3 : 00000000??r2 : 00000020??r1 : 00000000??r0 : ee19f880
> [???30.478066] Flags: nzCv??IRQs off??FIQs on??Mode SVC_32??ISA ARM??Segment
> none
> [???30.485268] Control: 10c5387d??Table: adcf006a??DAC: 00000051
> [???30.490998] Process kworker/1:1 (pid: 71, stack limit = 0xee1a0210)
> [???30.497247] Stack: (0xee1a1c58 to 0xee1a2000)
> [???30.501590]
> 1c40:???????????????????????????????????????????????????????eef98a00 c0833a68
> [???30.509747] 1c60: 00000001 ee117a44 c0d99280 a0000193 00000000 c0833d4c
> 00000001 ee117a44
> [???30.517904] 1c80: 00000000 ee117540 ee19f880 c01faf3c 00000000 ee1a0000
> ee1a18ec 00000001
> [???30.526060] 1ca0: ee1a1cc8 ee19fc40 c05b0c5c 00000001 ee1a1cc4 c0833d4c
> ee19f880 ee1a18ec
> [???30.534217] 1cc0: ee85d3c0 c012277c ee1a1cc8 ee1a1cc8 00000000 c0e5e2c4
> c0e07638 ee1a1e68
> [???30.542374] 1ce0: 60000113 0000000b c05b0c5c 00000001 c05b0c5a c010b6f8
> ee1a0210 0000000b
> [???30.550530] 1d00: c0e07638 ee1a0000 bf000000 00000008 65000000 31313935
> 20303030 30613365
> [???30.558687] 1d20: 34303030 65626520 38623065 35652038 30333439 28203830
> 33393565 34303033
> [???30.566843] 1d40: 00002029 c01b63c4 c0004000 00000004 ee1a1e68 00000017
> 00000000 00000017
> [???30.575000] 1d60: 00000004 eef98580 ee8e3680 c011a424 00000004 c0115c20
> ee19f880 00000000
> [???30.583156] 1d80: ee19f900 ee2ecd80 ee19f880 c014a55c c014a460 ee19f880
> eef98a00 00000000
> [???30.591312] 1da0: a0000193 c0e07efc 00000017 c0115888 00000004 ee1a1e68
> ee1a0000 eef98580
> [???30.599469] 1dc0: ee8e3680 c01012ac 1514622a 00000000 ee19f900 c0149578
> eef98a00 ee19f900
> [???30.607626] 1de0: 00000001 00000000 eef98a38 00000000 000043e1 c014e11c
> ee2ecd00 ee19f900
> [???30.615781] 1e00: 00000010 00000000 00000006 00000000 00000000 edc45440
> c0d992c4 00000000
> [???30.623938] 1e20: 00000001 00000000 00000000 00000001 00004b4e 00000000
> 00000001 c0e5f000
> [???30.632095] 1e40: 00000000 00000000 ee19f900 ee19f900 c05b0c58 60000113
> ffffffff ee1a1e9c
> [???30.640251] 1e60: 00000000 c010bd78 00000001 40000193 00000000 00000000
> ee3e03d0 ee3e03f8
> [???30.648408] 1e80: c05afef8 ee303000 00000000 00000000 eef98580 ee8e3680
> 80000000 ee1a1eb8
> [???30.656566] 1ea0: c017cda0 c05b0c58 60000113 ffffffff 00000051 00000000
> edc0bc00 ee303000
> [???30.664722] 1ec0: c05afef8 c05aff2c edc0bc20 c045ec1c eef95c80 eef95c80
> 00000001 eea82d5c
> [???30.672886] 1ee0: edc0bd98 00000000 ee3031c0 ee303218 c0eab740 c05afcc4
> ee8e3680 ee3031c0
> [???30.681045] 1f00: eef9b800 00000000 eef98580 c0135824 eef98598 c0e02100
> eef98580 ee8e3698
> [???30.689202] 1f20: 00000008 eef98598 c0e02100 ee1a0000 eef98580 c0135a74
> ee840f80 ee8e3680
> [???30.697358] 1f40: c0135a3c 00000000 ee840f80 ee8e3680 c0135a3c 00000000
> 00000000 00000000
> [???30.705515] 1f60: 00000000 c013af18 00000000 00000000 00000000 ee8e3680
> 00000000 00000000
> [???30.713672] 1f80: ee1a1f80 ee1a1f80 00000001 00010001 ee1a1f90 ee1a1f90
> ee1a1fac ee840f80
> [???30.721827] 1fa0: c013ae3c 00000000 00000000 c01078b8 00000000 00000000
> 00000000 00000000
> [???30.729983] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> [???30.738140] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> 00000000 00000000
> [???30.746304] [<c013b8a8>] (kthread_data) from [<c01366e0>]
> (wq_worker_sleeping+0x8/0xc8)
> [???30.754292] [<c01366e0>] (wq_worker_sleeping) from [<c0833a68>]
> (__schedule+0x45c/0x6f0)
> [???30.762364] [<c0833a68>] (__schedule) from [<c0833d4c>]
> (schedule+0x50/0xb4)
> [???30.769394] [<c0833d4c>] (schedule) from [<c012277c>] (do_exit+0x6e8/0xa90)
> [???30.776340] [<c012277c>] (do_exit) from [<c010b6f8>] (die+0x470/0x488)
> [???30.782853] [<c010b6f8>] (die) from [<c011a424>]
> (__do_kernel_fault.part.0+0x64/0x1e4)
> [???30.790751] [<c011a424>] (__do_kernel_fault.part.0) from [<c0115c20>]
> (do_page_fault+0x398/0x3a4)
> [???30.799601] [<c0115c20>] (do_page_fault) from [<c01012ac>]
> (do_DataAbort+0x38/0xb8)
> [???30.807238] [<c01012ac>] (do_DataAbort) from [<c010bd78>]
> (__dabt_svc+0x58/0x80)
> [???30.814613] Exception stack(0xee1a1e68 to 0xee1a1eb0)
> [???30.819650] 1e60:???????????????????00000001 40000193 00000000 00000000
> ee3e03d0 ee3e03f8
> [???30.827807] 1e80: c05afef8 ee303000 00000000 00000000 eef98580 ee8e3680
> 80000000 ee1a1eb8
> [???30.835962] 1ea0: c017cda0 c05b0c58 60000113 ffffffff
> [???30.841002] [<c010bd78>] (__dabt_svc) from [<c05b0c58>]
> (sbs_external_power_changed+0x50/0x5c)
> [???30.849593] [<c05b0c58>] (sbs_external_power_changed) from [<c05aff2c>]
> (__power_supply_changed_work+0x34/0x3c)
> [???30.859660] [<c05aff2c>] (__power_supply_changed_work) from [<c045ec1c>]
> (class_for_each_device+0x4c/0xb4)
> [???30.869291] [<c045ec1c>] (class_for_each_device) from [<c05afcc4>]
> (power_supply_changed_work+0x5c/0xb0)
> [???30.878762] [<c05afcc4>] (power_supply_changed_work) from [<c0135824>]
> (process_one_work+0x124/0x33c)
> [???30.887963] [<c0135824>] (process_one_work) from [<c0135a74>]
> (worker_thread+0x38/0x4d4)
> [???30.896034] [<c0135a74>] (worker_thread) from [<c013af18>]
> (kthread+0xdc/0xf4)
> [???30.903240] [<c013af18>] (kthread) from [<c01078b8>]
> (ret_from_fork+0x14/0x3c)
> [???30.910443] Code: e34c00a4 ebff90d2 eafffff2 e5903418 (e5130014)?
> [???30.916520] ---[ end trace 083d55597e9a2255 ]---
> [???30.921122] Fixing recursive fault but reboot is needed!
>
>
--
Paul Kocialkowski, developer of low-level free software for embedded devices
Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160921/e1152088/attachment.sig>
^ permalink raw reply
* [PATCH 5/5] arm64: Add uprobe support
From: Pratyush Anand @ 2016-09-21 11:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160920165946.GA19353@e104818-lin.cambridge.arm.com>
Hi Catalin,
Thanks for your review.
On 20/09/2016:05:59:46 PM, Catalin Marinas wrote:
> Hi Pratyush,
>
> On Tue, Aug 02, 2016 at 11:00:09AM +0530, Pratyush Anand wrote:
> > --- a/arch/arm64/include/asm/debug-monitors.h
> > +++ b/arch/arm64/include/asm/debug-monitors.h
> > @@ -70,6 +70,9 @@
> > #define BRK64_ESR_MASK 0xFFFF
> > #define BRK64_ESR_KPROBES 0x0004
> > #define BRK64_OPCODE_KPROBES (AARCH64_BREAK_MON | (BRK64_ESR_KPROBES << 5))
> > +/* uprobes BRK opcodes with ESR encoding */
> > +#define BRK64_ESR_UPROBES 0x0008
> > +#define BRK64_OPCODE_UPROBES (AARCH64_BREAK_MON | (BRK64_ESR_UPROBES << 5))
>
> You can use 0x0005 as immediate, we don't need individual bits here.
OK. will define BRK64_ESR_UPROBES as 0x0005
>
> > --- a/arch/arm64/include/asm/probes.h
> > +++ b/arch/arm64/include/asm/probes.h
> > @@ -35,4 +35,8 @@ struct arch_specific_insn {
> > };
> > #endif
> >
> > +#ifdef CONFIG_UPROBES
> > +typedef u32 uprobe_opcode_t;
> > +#endif
>
> We don't need #ifdef around this typedef. Also, all the other
> architectures seem to have this typedef in asm/uprobes.h.
kprobe_opcode_t was defined here, so I defined it here as well. But yes, it
would be good to move it to asm/uprobes.h to keep in sync with other arch.
>
> > --- a/arch/arm64/include/asm/ptrace.h
> > +++ b/arch/arm64/include/asm/ptrace.h
> > @@ -217,6 +217,14 @@ int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task);
> >
> > #include <asm-generic/ptrace.h>
> >
> > +#define procedure_link_pointer(regs) ((regs)->regs[30])
> > +
> > +static inline void procedure_link_pointer_set(struct pt_regs *regs,
> > + unsigned long val)
> > +{
> > + procedure_link_pointer(regs) = val;
> > +}
>
> Do you need these macro and function here? It seems that they are only
> used in arch_uretprobe_hijack_return_addr(), so you can just expand them
> in there, no need for additional definitions.
I introduced it to keep sync with other register usage like
instruction_pointer_set().
I have used it in uprobe code only, but I think, we can have a patch to modify
following code, which can use them as well.
arch/arm64/kernel/probes/kprobes.c: ri->ret_addr = (kprobe_opcode_t *)regs->regs[30];
arch/arm64/kernel/probes/kprobes.c: regs->regs[30] = (long)&kretprobe_trampoline;
arch/arm64/kernel/process.c: lr = regs->regs[30];
arch/arm64/kernel/signal.c: __put_user_error(regs->regs[30], &sf->lr, err);
arch/arm64/kernel/signal.c: regs->regs[30] = (unsigned long)sigtramp;
>
> > --- a/arch/arm64/include/asm/thread_info.h
> > +++ b/arch/arm64/include/asm/thread_info.h
> > @@ -109,6 +109,7 @@ static inline struct thread_info *current_thread_info(void)
> > #define TIF_NEED_RESCHED 1
> > #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
> > #define TIF_FOREIGN_FPSTATE 3 /* CPU's FP state is not current's */
> > +#define TIF_UPROBE 5 /* uprobe breakpoint or singlestep */
>
> Nitpick: you can just use 4 until we cover this gap.
Hummm..as stated in commit log, Shi Yang suggested to define TIF_UPROBE as 5 in
stead of 4, since 4 has already been used in -rt kernel. May be, I can put a
comment in code as well.
Or, keep it 4 and -rt kernel will change their definitions. I am OK with both.
let me know.
>
> > --- /dev/null
> > +++ b/arch/arm64/include/asm/uprobes.h
> > @@ -0,0 +1,37 @@
> > +/*
> > + * Copyright (C) 2014-2015 Pratyush Anand <panand@redhat.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#ifndef _ASM_UPROBES_H
> > +#define _ASM_UPROBES_H
> > +
> > +#include <asm/debug-monitors.h>
> > +#include <asm/insn.h>
> > +#include <asm/probes.h>
> > +
> > +#define MAX_UINSN_BYTES AARCH64_INSN_SIZE
> > +
> > +#define UPROBE_SWBP_INSN BRK64_OPCODE_UPROBES
> > +#define UPROBE_SWBP_INSN_SIZE 4
>
> Nitpick: for consistency, just use AARCH64_INSN_SIZE.
OK
>
> > +#define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
> > +
> > +struct arch_uprobe_task {
> > + unsigned long saved_fault_code;
> > +};
> > +
> > +struct arch_uprobe {
> > + union {
> > + u8 insn[MAX_UINSN_BYTES];
> > + u8 ixol[MAX_UINSN_BYTES];
> > + };
> > + struct arch_probe_insn api;
> > + bool simulate;
> > +};
> > +
> > +extern void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
> > + void *kaddr, unsigned long len);
>
> I don't think we need this. It doesn't seem to be used anywhere other
> than the arm64 uprobes.c file. So I would rather expose
> sync_icache_aliases(), similarly to __sync_icache_dcache().
OK.
>
> > --- a/arch/arm64/kernel/entry.S
> > +++ b/arch/arm64/kernel/entry.S
> > @@ -688,7 +688,8 @@ ret_fast_syscall:
> > ldr x1, [tsk, #TI_FLAGS] // re-check for syscall tracing
> > and x2, x1, #_TIF_SYSCALL_WORK
> > cbnz x2, ret_fast_syscall_trace
> > - and x2, x1, #_TIF_WORK_MASK
> > + mov x2, #_TIF_WORK_MASK
> > + and x2, x1, x2
>
> Is this needed because _TIF_WORK_MASK cannot work as an immediate value
> to 'and'? We could reorder the TIF bits, they are not exposed to user to
> have ABI implications.
_TIF_WORK_MASK is defined as follows:
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
_TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \
_TIF_UPROBE)
Re-ordering will not help, because 0-3 have already been used by previous
definitions. Only way to use immediate value could be if, TIF_UPROBE is defined
as 4.
>
> > cbnz x2, work_pending
> > enable_step_tsk x1, x2
> > kernel_exit 0
> > @@ -718,7 +719,8 @@ work_resched:
> > ret_to_user:
> > disable_irq // disable interrupts
> > ldr x1, [tsk, #TI_FLAGS]
> > - and x2, x1, #_TIF_WORK_MASK
> > + mov x2, #_TIF_WORK_MASK
> > + and x2, x1, x2
> > cbnz x2, work_pending
> > enable_step_tsk x1, x2
> > kernel_exit 0
>
> Same here.
>
> > --- /dev/null
> > +++ b/arch/arm64/kernel/probes/uprobes.c
> > @@ -0,0 +1,227 @@
> > +/*
> > + * Copyright (C) 2014-2015 Pratyush Anand <panand@redhat.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +#include <linux/highmem.h>
> > +#include <linux/ptrace.h>
> > +#include <linux/uprobes.h>
> > +
> > +#include "decode-insn.h"
> > +
> > +#define UPROBE_INV_FAULT_CODE UINT_MAX
> > +
> > +void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
> > + void *src, unsigned long len)
> > +{
> > + void *xol_page_kaddr = kmap_atomic(page);
> > + void *dst = xol_page_kaddr + (vaddr & ~PAGE_MASK);
> > +
> > + preempt_disable();
>
> kmap_atomic() already disabled preemption.
Yes..will remove.
>
> > +
> > + /* Initialize the slot */
> > + memcpy(dst, src, len);
> > +
> > + /* flush caches (dcache/icache) */
> > + flush_uprobe_xol_access(page, vaddr, dst, len);
>
> Just use sync_icache_aliases() here (once exposed in an arm64 header).
OK.
>
> > +
> > + preempt_enable();
> > +
> > + kunmap_atomic(xol_page_kaddr);
> > +}
> > +
> > +unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
> > +{
> > + return instruction_pointer(regs);
> > +}
> > +
> > +int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
> > + unsigned long addr)
> > +{
> > + probe_opcode_t insn;
> > +
> > + /* TODO: Currently we do not support AARCH32 instruction probing */
>
> Is there a way to check (not necessarily in this file) that we don't
> probe 32-bit tasks?
- Well, I do not have complete idea about it that, how it can be done. I think
we can not check that just by looking a single bit in an instruction.
My understanding is that, we can only know about it when we are executing the
instruction, by reading pstate, but that would not be useful for uprobe
instruction analysis.
I hope, instruction encoding for aarch32 and aarch64 are different, and by
analyzing for all types of aarch32 instructions, we will be able to decide
that whether instruction is 32 bit trace-able or not. Accordingly, we can use
either BRK or BKPT instruction for breakpoint generation.
>
> > + if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
> > + return -EINVAL;
> > +
> > + insn = *(probe_opcode_t *)(&auprobe->insn[0]);
> > +
> > + switch (arm_probe_decode_insn(insn, &auprobe->api)) {
> > + case INSN_REJECTED:
> > + return -EINVAL;
> > +
> > + case INSN_GOOD_NO_SLOT:
> > + auprobe->simulate = true;
> > + break;
> > +
> > + case INSN_GOOD:
> > + default:
> > + break;
>
> Nitpick, we don't need case INSN_GOOD as well since default would cover
> it (that's unless you want to change default to BUG()).
we will not have other than these 3, so need to introduce BUG(). I will remove
INSN_GOOD.
>
> > + }
> > +
> > + return 0;
> > +}
> > +
> > +int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> > +{
> > + struct uprobe_task *utask = current->utask;
> > +
> > + /* saved fault code is restored in post_xol */
> > + utask->autask.saved_fault_code = current->thread.fault_code;
>
> Does the current->thread.fault_code has any meaning here? We use it in
> the arm64 code when delivering a signal to user but I don't think that's
> the case here, we are handling a breakpoint instruction and there isn't
> anything that set the fault_code.
Correct, they will just having garbage values. will remove.
>
> > +
> > + /* An invalid fault code between pre/post xol event */
> > + current->thread.fault_code = UPROBE_INV_FAULT_CODE;
> > +
> > + /* Instruction point to execute ol */
> > + instruction_pointer_set(regs, utask->xol_vaddr);
> > +
> > + user_enable_single_step(current);
> > +
> > + return 0;
> > +}
> > +
> > +int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> > +{
> > + struct uprobe_task *utask = current->utask;
> > +
> > + WARN_ON_ONCE(current->thread.fault_code != UPROBE_INV_FAULT_CODE);
> > +
> > + /* restore fault code */
> > + current->thread.fault_code = utask->autask.saved_fault_code;
>
> Same here, I don't think this needs restoring if it wasn't meaningful in
> the first place.
OK.
~Pratyush
^ permalink raw reply
* [PATCH] tty/serial: atmel: fix fractional baud rate computation
From: Nicolas Ferre @ 2016-09-21 10:44 UTC (permalink / raw)
To: linux-arm-kernel
From: Alexey Starikovskiy <aystarik@gmail.com>
The problem with previous code was it rounded values in wrong
place and produced wrong baud rate in some cases.
Signed-off-by: Alexey Starikovskiy <aystarik@gmail.com>
[nicolas.ferre at atmel.com: port to newer kernel and add commit log]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/tty/serial/atmel_serial.c | 10 ++++++----
include/linux/atmel_serial.h | 1 +
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 5f550d9feed9..fd8aa1f4ba78 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2170,13 +2170,15 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
* accurately. This feature is enabled only when using normal mode.
* baudrate = selected clock / (8 * (2 - OVER) * (CD + FP / 8))
* Currently, OVER is always set to 0 so we get
- * baudrate = selected clock (16 * (CD + FP / 8))
+ * baudrate = selected clock / (16 * (CD + FP / 8))
+ * then
+ * 8 CD + FP = selected clock / (2 * baudrate)
*/
if (atmel_port->has_frac_baudrate &&
(mode & ATMEL_US_USMODE) == ATMEL_US_USMODE_NORMAL) {
- div = DIV_ROUND_CLOSEST(port->uartclk, baud);
- cd = div / 16;
- fp = DIV_ROUND_CLOSEST(div % 16, 2);
+ div = DIV_ROUND_CLOSEST(port->uartclk, baud * 2);
+ cd = div >> 3;
+ fp = div & ATMEL_US_FP_MASK;
} else {
cd = uart_get_divisor(port, baud);
}
diff --git a/include/linux/atmel_serial.h b/include/linux/atmel_serial.h
index f8e452aa48d7..bd2560502f3c 100644
--- a/include/linux/atmel_serial.h
+++ b/include/linux/atmel_serial.h
@@ -119,6 +119,7 @@
#define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */
#define ATMEL_US_CD GENMASK(15, 0) /* Clock Divider */
#define ATMEL_US_FP_OFFSET 16 /* Fractional Part */
+#define ATMEL_US_FP_MASK 0x7
#define ATMEL_US_RTOR 0x24 /* Receiver Time-out Register for USART */
#define ATMEL_UA_RTOR 0x28 /* Receiver Time-out Register for UART */
--
2.9.0
^ permalink raw reply related
* [PATCH v10 0/4] ACPI: parse the SPCR table
From: Greg Kroah-Hartman @ 2016-09-21 10:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <25d32778-e708-6763-7cb2-4ddbeebc844b@linaro.org>
On Wed, Sep 21, 2016 at 01:27:30PM +0300, Aleksey Makarov wrote:
>
>
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> > Redirection Table) [2] as a mandatory ACPI table that specifies the
> > configuration of serial console.
> >
> > Move "earlycon" early_param handling to earlycon.c to parse this option once
> >
> > Parse SPCR table, setup earlycon and register specified console.
> >
> > Enable parsing this table on ARM64. Earlycon should be set up as early as
> > possible. ACPI boot tables are mapped in
> > arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> > that's where we parse spcr. So it has to be opted-in per-arch. When
> > ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> > DT/ACPI decision is done.
> >
> > Implement console_match() for pl011.
>
> Hi Greg,
>
> Can you consider picking this series for 4.9 please?
I thought you asked Rafael to take them, they are not in my queue
anymore because of that. Don't try to shop-around for maintainers
please, that's kind of rude...
greg k-h
^ permalink raw reply
* [PATCH] iommu/io-pgtable-arm: Using for_each_set_bit to simplify the code
From: Robin Murphy @ 2016-09-21 10:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1474436491-26220-1-git-send-email-wangkefeng.wang@huawei.com>
On 21/09/16 06:41, Kefeng Wang wrote:
> Using for_each_set_bit() to simplify the code.
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> drivers/iommu/io-pgtable-arm-v7s.c | 5 +----
> drivers/iommu/io-pgtable-arm.c | 5 +----
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c
> index def8ca1..f23821b 100644
> --- a/drivers/iommu/io-pgtable-arm-v7s.c
> +++ b/drivers/iommu/io-pgtable-arm-v7s.c
> @@ -789,8 +789,7 @@ static int __init arm_v7s_do_selftests(void)
> * Distinct mappings of different granule sizes.
> */
> iova = 0;
> - i = find_first_bit(&cfg.pgsize_bitmap, BITS_PER_LONG);
> - while (i != BITS_PER_LONG) {
> + for_each_set_bit(i, &cfg.pgsize_bitmap, BITS_PER_LONG) {
> size = 1UL << i;
> if (ops->map(ops, iova, iova, size, IOMMU_READ |
> IOMMU_WRITE |
> @@ -807,8 +806,6 @@ static int __init arm_v7s_do_selftests(void)
> return __FAIL(ops);
>
> iova += SZ_16M;
> - i++;
> - i = find_next_bit(&cfg.pgsize_bitmap, BITS_PER_LONG, i);
> loopnr++;
> }
>
> diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
> index f5c90e1..8c3dfb7 100644
> --- a/drivers/iommu/io-pgtable-arm.c
> +++ b/drivers/iommu/io-pgtable-arm.c
> @@ -980,8 +980,7 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
> * Distinct mappings of different granule sizes.
> */
> iova = 0;
> - j = find_first_bit(&cfg->pgsize_bitmap, BITS_PER_LONG);
> - while (j != BITS_PER_LONG) {
> + for_each_set_bit(j, &cfg->pgsize_bitmap, BITS_PER_LONG) {
> size = 1UL << j;
>
> if (ops->map(ops, iova, iova, size, IOMMU_READ |
> @@ -999,8 +998,6 @@ static int __init arm_lpae_run_tests(struct io_pgtable_cfg *cfg)
> return __FAIL(ops, i);
>
> iova += SZ_1G;
> - j++;
> - j = find_next_bit(&cfg->pgsize_bitmap, BITS_PER_LONG, j);
> }
>
> /* Partial unmap */
>
^ permalink raw reply
* [PATCH v2 2/9] dmaengine: edma: Use enum for eDMA binding type (legacy vs TPCC)
From: Arnd Bergmann @ 2016-09-21 10:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921102637.24845-3-peter.ujfalusi@ti.com>
On Wednesday, September 21, 2016 1:26:30 PM CEST Peter Ujfalusi wrote:
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index c2098a4b4dcf..4c8818278fcc 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -261,8 +261,11 @@ static const struct edmacc_param dummy_paramset = {
> .ccnt = 1,
> };
>
> -#define EDMA_BINDING_LEGACY 0
> -#define EDMA_BINDING_TPCC 1
> +enum edma_binding_type {
> + EDMA_BINDING_LEGACY = 0,
> + EDMA_BINDING_TPCC,
> +};
> +
> static const struct of_device_id edma_of_ids[] = {
> {
> .compatible = "ti,edma3",
> @@ -2184,7 +2187,8 @@ static int edma_probe(struct platform_device *pdev)
> const struct of_device_id *match;
>
> match = of_match_node(edma_of_ids, node);
> - if (match && (u32)match->data == EDMA_BINDING_TPCC)
> + if (match &&
> + (enum edma_binding_type)match->data == EDMA_BINDING_TPCC)
> legacy_mode = false;
>
> info = edma_setup_info_from_dt(dev, legacy_mode);
> --
> 2.10.0
>
Are you sure this works on all architectures? IIRC the size of an enum
is implementation defined, so this could still fail sometimes.
I tend to use 'uintptr_t' for the cast instead.
Arnd
^ permalink raw reply
* [RFC PATCH 0/8] arm64: move thread_info off of the task stack
From: Mark Rutland @ 2016-09-21 10:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <f954c330-fb58-5f8f-1d66-5bbcd0d9dadb@redhat.com>
On Tue, Sep 20, 2016 at 06:26:54PM -0700, Laura Abbott wrote:
> On 09/15/2016 06:49 AM, Mark Rutland wrote:
> >Building atop of Andy's work on x86 and generic code, these patches move
> >arm64's thread_info off of the stack and into task_struct. This protects
> >thread_info from corruption in the face of stack overflow, and serves as
> >a step towards fully robust stack overflow handling will be addressed by
> >subsequent patches.
> >
> >In contrast to x86, we can't place some critical data such as
> >preempt_count in percpu variables, and we must store these in some
> >per-task location. This, compounded with the way headers are organised
> >conspires to require us to still define our own thread_info. I
> >understand that the longer term plan is to kill off thread_info
> >entirely, hence I'm sending this as an RFC so we can figure out if/how
> >we can achieve that.
> >
> >These patches are based on Andy's x86/vmap_stack branch [1,2], and I've
> >pushed a copy to me arm64/ti-stack-split branch [3,4]. The result of
> >these patches boots happily on platforms within reach of my desk, but
> >has not seen much stressing so far.
>
> FWIW, I used your ti-stack-split branch while running some kernel builds
> and it seems to work well enough. You can take that as a Tested-by or I
> can re-test with a non-RFC version.
Thanks for testing, and many thanks for the offer!
Based on Andy's feedback some core bits are changing, and I'm hoping to
have a non-RFC version out soon once I've fixed up the remaining
fallout. I'll make sure you're Cc'd!
Thanks,
Mark.
^ permalink raw reply
* [RFC PATCH 2/8] thread_info: allow custom in-task thread_info
From: Mark Rutland @ 2016-09-21 10:28 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CALCETrUDWiDmLbMqw9sQYEzvDuSVfmT_UscxQXfmf8YYyTOC=Q@mail.gmail.com>
Hi Andy,
On Fri, Sep 16, 2016 at 08:11:14AM -0700, Andy Lutomirski wrote:
> > On Thu, Sep 15, 2016 at 11:37:47AM -0700, Andy Lutomirski wrote:
> > Just to check, what do you mean to happen with the flags field? Should
> > that always be in the generic thread_info? e.g.
> >
> > struct thread_info {
> > u32 flags;
> > #ifdef arch_thread_info
> > struct arch_thread_info arch_ti;
> > #endif
> > };
>
> Exactly. Possibly with a comment that using thread_struct should be
> preferred and that arch_thread_info should be used only if some header
> file requires access via current_thread_info() or task_thread_info().
While fixing up these patches, I realised that I'm somewhat concerned by
flags becoming a u32 (where it was previously an unsigned long for
arm64).
The generic {test,set,*}_ti_thread_flag() helpers use the usual bitops,
which perform accesses of sizeof(unsigned long) at a time, and for arm64
these need to be naturally-aligned.
We happen to get that alignment from subsequent fields in task_struct
and/or thread_info, and for arm64 we don't seem to have a problem with
tearing, but it feels somewhat fragile, and leaves me uneasy.
Looking at the git log, it seems that x86 also use unsigned long until
commit affa219b60a11b32 ("x86: change thread_info's flag field back to
32 bits"), where if I'm reading correctly, this was done to get rid of
unnecessary padding. With THREAD_INFO_IN_STACK, thread_info::flags is
immediately followed by a long on x86, so we save no padding.
Given all that, can we make the generic thread_info::flags an unsigned
long, matching what the thread flag helpers implicitly assume?
Thanks,
Mark.
^ permalink raw reply
* [PATCH v10 0/4] ACPI: parse the SPCR table
From: Aleksey Makarov @ 2016-09-21 10:27 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160905123617.18775-1-aleksey.makarov@linaro.org>
On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.
>
> Move "earlycon" early_param handling to earlycon.c to parse this option once
>
> Parse SPCR table, setup earlycon and register specified console.
>
> Enable parsing this table on ARM64. Earlycon should be set up as early as
> possible. ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr. So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
>
> Implement console_match() for pl011.
Hi Greg,
Can you consider picking this series for 4.9 please?
Thank you
Aleksey Makarov
> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
>
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
>
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
> (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
>
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov at linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
>
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov at linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
> as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
> Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function". The patch by
> Christopher Covington [4] specifies that SBSA uart does 32-bit access to
> registers and this breaks the match function. In this series the function
> was changed to match when SPCR specifies both mmio32 and mmio access.
> I removed Acked-by: Greg from this patch because of these changes.
>
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov at linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
> to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
> (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
>
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov at linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
> to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
> (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
> equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley). This means that
> SPCR earlycon will not work on the kernels before 4.6
>
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
> it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
> the GDB2 series
>
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
> ACPI developers work on a new API and asked not to do that.
> Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
> and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
>
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov at linaro.org
>
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
>
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
> Instead introduce a custom acpi_table_parse_spcr() in spcr.c
>
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console. If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
>
> The restrictions of this approach are:
>
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
> (SPCR can specify devices by PCI id/PCI address)
>
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov at linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
> Instead, obtain SPCR with acpi_get_table(). That works after
> call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
> accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
> consoles
>
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov at linaro.org
>
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm at linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov at codeaurora.org
>
> Aleksey Makarov (3):
> ACPI: parse SPCR and enable matching console
> ARM64: ACPI: enable ACPI_SPCR_TABLE
> serial: pl011: add console matching function
>
> Leif Lindholm (1):
> of/serial: move earlycon early_param handling to serial
>
> arch/arm64/Kconfig | 1 +
> arch/arm64/kernel/acpi.c | 11 +++-
> drivers/acpi/Kconfig | 3 ++
> drivers/acpi/Makefile | 1 +
> drivers/acpi/spcr.c | 111 ++++++++++++++++++++++++++++++++++++++++
> drivers/of/fdt.c | 11 +---
> drivers/tty/serial/amba-pl011.c | 55 ++++++++++++++++++++
> drivers/tty/serial/earlycon.c | 19 ++++++-
> include/linux/acpi.h | 6 +++
> include/linux/of_fdt.h | 3 ++
> include/linux/serial_core.h | 9 +++-
> 11 files changed, 216 insertions(+), 14 deletions(-)
> create mode 100644 drivers/acpi/spcr.c
>
^ permalink raw reply
* [PATCH v2 9/9] dmaengine: ti-dma-crossbar: enable COMPILE_TEST
From: Peter Ujfalusi @ 2016-09-21 10:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921102637.24845-1-peter.ujfalusi@ti.com>
To get more coverage, enable COMPILE_TEST for this driver.
When compile testing eDMA or omap-dma, select also the ti-dma-crossbar so
it is also covered by the compile testing.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 84647d6cb2f4..1c11628062ad 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -133,7 +133,7 @@ config DMA_OMAP
depends on ARCH_OMAP || COMPILE_TEST
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
- select TI_DMA_CROSSBAR if SOC_DRA7XX
+ select TI_DMA_CROSSBAR if (SOC_DRA7XX || COMPILE_TEST)
config DMA_SA11X0
tristate "SA-11x0 DMA support"
@@ -518,7 +518,7 @@ config TI_EDMA
depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE || COMPILE_TEST
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
- select TI_DMA_CROSSBAR if ARCH_OMAP
+ select TI_DMA_CROSSBAR if (ARCH_OMAP || COMPILE_TEST)
default n
help
Enable support for the TI EDMA controller. This DMA
--
2.10.0
^ permalink raw reply related
* [PATCH v2 8/9] dmaengine: omap-dma: enable COMPILE_TEST
From: Peter Ujfalusi @ 2016-09-21 10:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921102637.24845-1-peter.ujfalusi@ti.com>
To get more coverage, enable COMPILE_TEST for this driver.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 4348249b943a..84647d6cb2f4 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -130,7 +130,7 @@ config DMA_JZ4780
config DMA_OMAP
tristate "OMAP DMA support"
- depends on ARCH_OMAP
+ depends on ARCH_OMAP || COMPILE_TEST
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
select TI_DMA_CROSSBAR if SOC_DRA7XX
--
2.10.0
^ permalink raw reply related
* [PATCH v2 7/9] dmaengine: edma: enable COMPILE_TEST
From: Peter Ujfalusi @ 2016-09-21 10:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921102637.24845-1-peter.ujfalusi@ti.com>
To get more coverage, enable COMPILE_TEST for this driver.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index fe2dbb811e19..4348249b943a 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -515,7 +515,7 @@ config TI_DMA_CROSSBAR
config TI_EDMA
bool "TI EDMA support"
- depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE
+ depends on ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE || COMPILE_TEST
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
select TI_DMA_CROSSBAR if ARCH_OMAP
--
2.10.0
^ permalink raw reply related
* [PATCH v2 6/9] dmaengine: ti-dma-crossbar: Use enum for crossbar type
From: Peter Ujfalusi @ 2016-09-21 10:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160921102637.24845-1-peter.ujfalusi@ti.com>
Fixes compiler warnings on 64bit architectures:
drivers/dma/ti-dma-crossbar.c: In function ?ti_dra7_xbar_probe?:
drivers/dma/ti-dma-crossbar.c:398:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
xbar->dma_offset = (u32)match->data;
^
drivers/dma/ti-dma-crossbar.c: In function ?ti_dma_xbar_probe?:
drivers/dma/ti-dma-crossbar.c:431:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
switch ((u32)match->data) {
^
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/ti-dma-crossbar.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c
index e4f3bd1ae264..876e4ccaf033 100644
--- a/drivers/dma/ti-dma-crossbar.c
+++ b/drivers/dma/ti-dma-crossbar.c
@@ -16,8 +16,10 @@
#include <linux/of_device.h>
#include <linux/of_dma.h>
-#define TI_XBAR_DRA7 0
-#define TI_XBAR_AM335X 1
+enum ti_xbar_type {
+ TI_XBAR_DRA7 = 0,
+ TI_XBAR_AM335X,
+};
static const struct of_device_id ti_dma_xbar_match[] = {
{
@@ -395,7 +397,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
xbar->dmarouter.dev = &pdev->dev;
xbar->dmarouter.route_free = ti_dra7_xbar_free;
- xbar->dma_offset = (u32)match->data;
+ xbar->dma_offset = (enum ti_xbar_type)match->data;
mutex_init(&xbar->mutex);
platform_set_drvdata(pdev, xbar);
@@ -428,7 +430,7 @@ static int ti_dma_xbar_probe(struct platform_device *pdev)
if (unlikely(!match))
return -EINVAL;
- switch ((u32)match->data) {
+ switch ((enum ti_xbar_type)match->data) {
case TI_XBAR_DRA7:
ret = ti_dra7_xbar_probe(pdev);
break;
--
2.10.0
^ 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