mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
core/linux-aarch64-rc to 4.13.rc5-2
This commit is contained in:
parent
711465d80c
commit
acd7c70f6a
9 changed files with 248 additions and 209 deletions
|
@ -1,4 +1,4 @@
|
||||||
From 1b63f6ad09d1ec870572aeeb8ca25a6f3be5bd28 Mon Sep 17 00:00:00 2001
|
From 76f60642e4f22da47facac674cbc512d128943f6 Mon Sep 17 00:00:00 2001
|
||||||
From: popcornmix <popcornmix@gmail.com>
|
From: popcornmix <popcornmix@gmail.com>
|
||||||
Date: Tue, 18 Feb 2014 01:43:50 -0300
|
Date: Tue, 18 Feb 2014 01:43:50 -0300
|
||||||
Subject: [PATCH 1/5] net/smsc95xx: Allow mac address to be set as a parameter
|
Subject: [PATCH 1/5] net/smsc95xx: Allow mac address to be set as a parameter
|
||||||
|
@ -91,5 +91,5 @@ index 340c13484e5c..ae49ded12f6c 100644
|
||||||
|
|
||||||
/* maybe the boot loader passed the MAC address in devicetree */
|
/* maybe the boot loader passed the MAC address in devicetree */
|
||||||
--
|
--
|
||||||
2.13.3
|
2.14.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 035007e2a13b6ea74f6c43556ae72aeeb0d0df7a Mon Sep 17 00:00:00 2001
|
From f86dc9ddcbf867db72cc7607e6201e144e2cd09b Mon Sep 17 00:00:00 2001
|
||||||
From: Shawn Lin <shawn.lin@rock-chips.com>
|
From: Shawn Lin <shawn.lin@rock-chips.com>
|
||||||
Date: Fri, 21 Jul 2017 16:30:59 +0800
|
Date: Fri, 21 Jul 2017 16:30:59 +0800
|
||||||
Subject: [PATCH 2/5] arm64: dts: rockchip: enable sdmmc controller on
|
Subject: [PATCH 2/5] arm64: dts: rockchip: enable sdmmc controller on
|
||||||
|
@ -38,5 +38,5 @@ index ba1d9810ad1e..e01ef8a77f5e 100644
|
||||||
bus-width = <8>;
|
bus-width = <8>;
|
||||||
keep-power-in-suspend;
|
keep-power-in-suspend;
|
||||||
--
|
--
|
||||||
2.13.3
|
2.14.1
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
From 44bb885638224454b907d448d1202640408b235c Mon Sep 17 00:00:00 2001
|
From d3f9e9266209e505adeeafe1fc1f803e5e9b5cf9 Mon Sep 17 00:00:00 2001
|
||||||
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||||
Date: Mon, 7 Aug 2017 19:34:57 -0600
|
Date: Mon, 7 Aug 2017 19:34:57 -0600
|
||||||
Subject: [PATCH 3/5] arm64: dts: rockchip: disable pwm0 on rk3399-firefly
|
Subject: [PATCH 3/5] arm64: dts: rockchip: disable pwm0 on rk3399-firefly
|
||||||
|
@ -22,5 +22,5 @@ index e01ef8a77f5e..1fd4e87c61d5 100644
|
||||||
|
|
||||||
&pwm2 {
|
&pwm2 {
|
||||||
--
|
--
|
||||||
2.13.3
|
2.14.1
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
From 31a499290ebf638e4ff502d3117fc3cf6e020b76 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||||
|
Date: Thu, 17 Aug 2017 21:18:11 -0600
|
||||||
|
Subject: [PATCH 4/5] Revert "arm64: dts: qcom: Collapse usb support into one
|
||||||
|
node"
|
||||||
|
|
||||||
|
This reverts commit ed75d6a969056cc8f5dd2df3af6c75b792b9116b.
|
||||||
|
---
|
||||||
|
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 34 ++++++++---------
|
||||||
|
arch/arm64/boot/dts/qcom/msm8916.dtsi | 62 ++++++++++++++++---------------
|
||||||
|
2 files changed, 49 insertions(+), 47 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
||||||
|
index bd310ac1967a..f326f4fb4d72 100644
|
||||||
|
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
||||||
|
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
||||||
|
@@ -215,16 +215,22 @@
|
||||||
|
usb@78d9000 {
|
||||||
|
extcon = <&usb_id>, <&usb_id>;
|
||||||
|
status = "okay";
|
||||||
|
- adp-disable;
|
||||||
|
- hnp-disable;
|
||||||
|
- srp-disable;
|
||||||
|
- ulpi {
|
||||||
|
- phy {
|
||||||
|
- v1p8-supply = <&pm8916_l7>;
|
||||||
|
- v3p3-supply = <&pm8916_l13>;
|
||||||
|
- extcon = <&usb_id>;
|
||||||
|
- };
|
||||||
|
- };
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ ehci@78d9000 {
|
||||||
|
+ status = "okay";
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ phy@78d9000 {
|
||||||
|
+ v1p8-supply = <&pm8916_l7>;
|
||||||
|
+ v3p3-supply = <&pm8916_l13>;
|
||||||
|
+ vddcx-supply = <&pm8916_s1>;
|
||||||
|
+ extcon = <&usb_id>, <&usb_id>;
|
||||||
|
+ dr_mode = "otg";
|
||||||
|
+ status = "okay";
|
||||||
|
+ switch-gpio = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
|
||||||
|
+ pinctrl-names = "default";
|
||||||
|
+ pinctrl-0 = <&usb_sw_sel_pm>;
|
||||||
|
};
|
||||||
|
|
||||||
|
lpass@07708000 {
|
||||||
|
@@ -342,14 +348,6 @@
|
||||||
|
pinctrl-0 = <&usb_id_default>;
|
||||||
|
};
|
||||||
|
|
||||||
|
- usb-switch {
|
||||||
|
- compatible = "toshiba,tc7usb40mu";
|
||||||
|
- switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
|
||||||
|
- extcon = <&usb_id>;
|
||||||
|
- pinctrl-names = "default";
|
||||||
|
- pinctrl-0 = <&usb_sw_sel_pm>;
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
hdmi-out {
|
||||||
|
compatible = "hdmi-connector";
|
||||||
|
type = "a";
|
||||||
|
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
||||||
|
index 039991f80831..17691abea608 100644
|
||||||
|
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
||||||
|
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
|
||||||
|
@@ -546,40 +546,44 @@
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
|
- otg: usb@78d9000 {
|
||||||
|
+ usb_dev: usb@78d9000 {
|
||||||
|
compatible = "qcom,ci-hdrc";
|
||||||
|
- reg = <0x78d9000 0x200>,
|
||||||
|
- <0x78d9200 0x200>;
|
||||||
|
+ reg = <0x78d9000 0x400>;
|
||||||
|
+ dr_mode = "peripheral";
|
||||||
|
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ usb-phy = <&usb_otg>;
|
||||||
|
+ status = "disabled";
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ usb_host: ehci@78d9000 {
|
||||||
|
+ compatible = "qcom,ehci-host";
|
||||||
|
+ reg = <0x78d9000 0x400>;
|
||||||
|
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ usb-phy = <&usb_otg>;
|
||||||
|
+ status = "disabled";
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ usb_otg: phy@78d9000 {
|
||||||
|
+ compatible = "qcom,usb-otg-snps";
|
||||||
|
+ reg = <0x78d9000 0x400>;
|
||||||
|
interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
|
||||||
|
<GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+
|
||||||
|
+ qcom,vdd-levels = <500000 1000000 1320000>;
|
||||||
|
+ qcom,phy-init-sequence = <0x44 0x6B 0x24 0x13>;
|
||||||
|
+ dr_mode = "peripheral";
|
||||||
|
+ qcom,otg-control = <2>; // PMIC
|
||||||
|
+ qcom,manual-pullup;
|
||||||
|
+
|
||||||
|
clocks = <&gcc GCC_USB_HS_AHB_CLK>,
|
||||||
|
- <&gcc GCC_USB_HS_SYSTEM_CLK>;
|
||||||
|
- clock-names = "iface", "core";
|
||||||
|
- assigned-clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>;
|
||||||
|
- assigned-clock-rates = <80000000>;
|
||||||
|
- resets = <&gcc GCC_USB_HS_BCR>;
|
||||||
|
- reset-names = "core";
|
||||||
|
- phy_type = "ulpi";
|
||||||
|
- dr_mode = "otg";
|
||||||
|
- ahb-burst-config = <0>;
|
||||||
|
- phy-names = "usb-phy";
|
||||||
|
- phys = <&usb_hs_phy>;
|
||||||
|
- status = "disabled";
|
||||||
|
- #reset-cells = <1>;
|
||||||
|
+ <&gcc GCC_USB_HS_SYSTEM_CLK>,
|
||||||
|
+ <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
|
||||||
|
+ clock-names = "iface", "core", "sleep";
|
||||||
|
|
||||||
|
- ulpi {
|
||||||
|
- usb_hs_phy: phy {
|
||||||
|
- compatible = "qcom,usb-hs-phy-msm8916",
|
||||||
|
- "qcom,usb-hs-phy";
|
||||||
|
- #phy-cells = <0>;
|
||||||
|
- clocks = <&xo_board>, <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
|
||||||
|
- clock-names = "ref", "sleep";
|
||||||
|
- resets = <&gcc GCC_USB2A_PHY_BCR>, <&otg 0>;
|
||||||
|
- reset-names = "phy", "por";
|
||||||
|
- qcom,init-seq = /bits/ 8 <0x0 0x44
|
||||||
|
- 0x1 0x6b 0x2 0x24 0x3 0x13>;
|
||||||
|
- };
|
||||||
|
- };
|
||||||
|
+ resets = <&gcc GCC_USB2A_PHY_BCR>,
|
||||||
|
+ <&gcc GCC_USB_HS_BCR>;
|
||||||
|
+ reset-names = "phy", "link";
|
||||||
|
+ status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
|
intc: interrupt-controller@b000000 {
|
||||||
|
--
|
||||||
|
2.14.1
|
||||||
|
|
|
@ -1,76 +0,0 @@
|
||||||
From 883eeb697555d1d9b7e4c43657a335fe34156f13 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stephen Boyd <sboyd@codeaurora.org>
|
|
||||||
Date: Thu, 13 Jul 2017 19:20:42 -0700
|
|
||||||
Subject: [PATCH 4/5] arm64: dts: qcom: Force host mode for USB on apq8016-sbc
|
|
||||||
|
|
||||||
Commit ed75d6a96905 ("arm64: dts: qcom: Collapse usb support into
|
|
||||||
one node") breaks host mode support on apq8016-sbc boards. This
|
|
||||||
is because the mux driver (tc7usb40mu) hasn't been merged.
|
|
||||||
Without that driver, we can't toggle the GPIO going to the mux to
|
|
||||||
route out the D+/D- lines to the USB hub that's on the board.
|
|
||||||
|
|
||||||
One solution would be to totally revert this change, but that
|
|
||||||
opens us up to other problems when two USB drivers are operating
|
|
||||||
the same hardware block at the same time. Let's modify the DT so
|
|
||||||
that the USB controller is always in host mode and connected to
|
|
||||||
the hub so that things like USB keyboards and mouses work. This
|
|
||||||
is the mode that most people prefer anyway with these devices. We
|
|
||||||
also delete the usb-switch node because the binding was never
|
|
||||||
accepted upstream.
|
|
||||||
|
|
||||||
In the future, we can add muxing support and then update the DT
|
|
||||||
to support both modes at runtime. Patches to support this are
|
|
||||||
already on the mailing list.
|
|
||||||
|
|
||||||
Fixes: ed75d6a96905 ("arm64: dts: qcom: Collapse usb support into one node")
|
|
||||||
Reported-by: Rob Clark <robdclark@gmail.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
|
||||||
Signed-off-by: Andy Gross <andy.gross@linaro.org>
|
|
||||||
---
|
|
||||||
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 15 +++++----------
|
|
||||||
1 file changed, 5 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
|
||||||
index bd310ac1967a..efd53ed82a58 100644
|
|
||||||
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
|
||||||
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
|
|
||||||
@@ -213,11 +213,14 @@
|
|
||||||
};
|
|
||||||
|
|
||||||
usb@78d9000 {
|
|
||||||
- extcon = <&usb_id>, <&usb_id>;
|
|
||||||
+ extcon = <&usb_id>;
|
|
||||||
status = "okay";
|
|
||||||
adp-disable;
|
|
||||||
hnp-disable;
|
|
||||||
srp-disable;
|
|
||||||
+ dr_mode = "host";
|
|
||||||
+ pinctrl-names = "default";
|
|
||||||
+ pinctrl-0 = <&usb_sw_sel_pm>;
|
|
||||||
ulpi {
|
|
||||||
phy {
|
|
||||||
v1p8-supply = <&pm8916_l7>;
|
|
||||||
@@ -337,19 +340,11 @@
|
|
||||||
|
|
||||||
usb_id: usb-id {
|
|
||||||
compatible = "linux,extcon-usb-gpio";
|
|
||||||
- id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>;
|
|
||||||
+ vbus-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>;
|
|
||||||
pinctrl-names = "default";
|
|
||||||
pinctrl-0 = <&usb_id_default>;
|
|
||||||
};
|
|
||||||
|
|
||||||
- usb-switch {
|
|
||||||
- compatible = "toshiba,tc7usb40mu";
|
|
||||||
- switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
|
|
||||||
- extcon = <&usb_id>;
|
|
||||||
- pinctrl-names = "default";
|
|
||||||
- pinctrl-0 = <&usb_sw_sel_pm>;
|
|
||||||
- };
|
|
||||||
-
|
|
||||||
hdmi-out {
|
|
||||||
compatible = "hdmi-connector";
|
|
||||||
type = "a";
|
|
||||||
--
|
|
||||||
2.13.3
|
|
||||||
|
|
|
@ -1,104 +0,0 @@
|
||||||
From 768ee4a456e28285d5f683ea70147ef595eb54d8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Johan Hovold <johan@kernel.org>
|
|
||||||
Date: Thu, 3 Aug 2017 17:52:08 +0200
|
|
||||||
Subject: [PATCH 5/5] dma-mapping: skip USB devices when configuring DMA during
|
|
||||||
probe
|
|
||||||
|
|
||||||
USB devices use the DMA mask and offset of the controller, which have
|
|
||||||
already been setup when a device is probed. Note that modifying the
|
|
||||||
DMA mask of a USB device would change the mask for the controller (and
|
|
||||||
all devices on the bus) as the mask is literally shared.
|
|
||||||
|
|
||||||
Since commit 2bf698671205 ("USB: of: fix root-hub device-tree node
|
|
||||||
handling"), of_dma_configure() would be called also for root hubs, which
|
|
||||||
use the device node of the controller. A separate, long-standing bug
|
|
||||||
that makes of_dma_configure() generate a 30-bit DMA mask from the RPI3's
|
|
||||||
"dma-ranges" would thus set a broken mask also for the controller. This
|
|
||||||
in turn prevents USB devices from enumerating when control transfers
|
|
||||||
fail:
|
|
||||||
|
|
||||||
dwc2 3f980000.usb: Cannot do DMA to address 0x000000003a166a00
|
|
||||||
|
|
||||||
Note that the aforementioned DMA-mask bug was benign for the HCD itself
|
|
||||||
as the dwc2 driver overwrites the mask previously set by
|
|
||||||
of_dma_configure() for the platform device in its probe callback. The
|
|
||||||
mask would only later get corrupted when the root-hub child device was
|
|
||||||
probed.
|
|
||||||
|
|
||||||
Fix this, and similar future problems, by adding a flag to struct device
|
|
||||||
which prevents driver core from calling dma_configure() during probe and
|
|
||||||
making sure it is set for USB devices.
|
|
||||||
|
|
||||||
Fixes: 09515ef5ddad ("of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices")
|
|
||||||
Cc: stable <stable@vger.kernel.org> # 4.12
|
|
||||||
Cc: Robin Murphy <robin.murphy@arm.com>
|
|
||||||
Cc: Sricharan R <sricharan@codeaurora.org>
|
|
||||||
Cc: Stefan Wahren <stefan.wahren@i2se.com>
|
|
||||||
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
||||||
Signed-off-by: Johan Hovold <johan@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/base/dma-mapping.c | 6 ++++++
|
|
||||||
drivers/usb/core/usb.c | 1 +
|
|
||||||
include/linux/device.h | 3 +++
|
|
||||||
3 files changed, 10 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c
|
|
||||||
index b555ff9dd8fc..f9f703be0ad1 100644
|
|
||||||
--- a/drivers/base/dma-mapping.c
|
|
||||||
+++ b/drivers/base/dma-mapping.c
|
|
||||||
@@ -345,6 +345,9 @@ int dma_configure(struct device *dev)
|
|
||||||
enum dev_dma_attr attr;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
+ if (dev->skip_dma_configure)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
if (dev_is_pci(dev)) {
|
|
||||||
bridge = pci_get_host_bridge_device(to_pci_dev(dev));
|
|
||||||
dma_dev = bridge;
|
|
||||||
@@ -369,6 +372,9 @@ int dma_configure(struct device *dev)
|
|
||||||
|
|
||||||
void dma_deconfigure(struct device *dev)
|
|
||||||
{
|
|
||||||
+ if (dev->skip_dma_configure)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
of_dma_deconfigure(dev);
|
|
||||||
acpi_dma_deconfigure(dev);
|
|
||||||
}
|
|
||||||
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
|
|
||||||
index 17681d5638ac..2a85d905b539 100644
|
|
||||||
--- a/drivers/usb/core/usb.c
|
|
||||||
+++ b/drivers/usb/core/usb.c
|
|
||||||
@@ -588,6 +588,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
|
|
||||||
* Note: calling dma_set_mask() on a USB device would set the
|
|
||||||
* mask for the entire HCD, so don't do that.
|
|
||||||
*/
|
|
||||||
+ dev->dev.skip_dma_configure = true;
|
|
||||||
dev->dev.dma_mask = bus->sysdev->dma_mask;
|
|
||||||
dev->dev.dma_pfn_offset = bus->sysdev->dma_pfn_offset;
|
|
||||||
set_dev_node(&dev->dev, dev_to_node(bus->sysdev));
|
|
||||||
diff --git a/include/linux/device.h b/include/linux/device.h
|
|
||||||
index 723cd54b94da..022cf258068b 100644
|
|
||||||
--- a/include/linux/device.h
|
|
||||||
+++ b/include/linux/device.h
|
|
||||||
@@ -877,6 +877,8 @@ struct dev_links_info {
|
|
||||||
* @offline: Set after successful invocation of bus type's .offline().
|
|
||||||
* @of_node_reused: Set if the device-tree node is shared with an ancestor
|
|
||||||
* device.
|
|
||||||
+ * @skip_dma_configure: Set if driver core should not configure DMA for this
|
|
||||||
+ * device during probe.
|
|
||||||
*
|
|
||||||
* At the lowest level, every device in a Linux system is represented by an
|
|
||||||
* instance of struct device. The device structure contains the information
|
|
||||||
@@ -965,6 +967,7 @@ struct device {
|
|
||||||
bool offline_disabled:1;
|
|
||||||
bool offline:1;
|
|
||||||
bool of_node_reused:1;
|
|
||||||
+ bool skip_dma_configure:1;
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline struct device *kobj_to_dev(struct kobject *kobj)
|
|
||||||
--
|
|
||||||
2.13.3
|
|
||||||
|
|
74
core/linux-aarch64-rc/0005-of-Fix-DMA-mask-generation.patch
Normal file
74
core/linux-aarch64-rc/0005-of-Fix-DMA-mask-generation.patch
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
From cdd0029a79eefc562e85b6f47074044f637d679c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Robin Murphy <robin.murphy@arm.com>
|
||||||
|
Date: Fri, 11 Aug 2017 17:29:56 +0100
|
||||||
|
Subject: [PATCH 5/5] of: Fix DMA mask generation
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Historically, DMA masks have suffered some ambiguity between whether
|
||||||
|
they represent the range of physical memory a device can access, or the
|
||||||
|
address bits a device is capable of driving, particularly since on many
|
||||||
|
platforms the two are equivalent. Whilst there are some stragglers left
|
||||||
|
(dma_max_pfn(), I'm looking at you...), the majority of DMA code has
|
||||||
|
been cleaned up to follow the latter definition, not least since it is
|
||||||
|
the only one which makes sense once IOMMUs are involved.
|
||||||
|
|
||||||
|
In this respect, of_dma_configure() has always done the wrong thing in
|
||||||
|
how it generates initial masks based on "dma-ranges". Although rounding
|
||||||
|
down did not affect the TI Keystone platform where dma_addr + size is
|
||||||
|
already a power of two, in any other case it results in a mask which is
|
||||||
|
at best unnecessarily constrained and at worst unusable.
|
||||||
|
|
||||||
|
BCM2837 illustrates the problem nicely, where we have a DMA base of 3GB
|
||||||
|
and a size of 1GB - 16MB, giving dma_addr + size = 0xff000000 and a
|
||||||
|
resultant mask of 0x7fffffff, which is then insufficient to even cover
|
||||||
|
the necessary offset, effectively making all DMA addresses out-of-range.
|
||||||
|
This has been hidden until now (mostly because we don't yet prevent
|
||||||
|
drivers from simply overwriting this initial mask later upon probe), but
|
||||||
|
due to recent changes elsewhere now shows up as USB being broken on
|
||||||
|
Raspberry Pi 3.
|
||||||
|
|
||||||
|
Make it right by rounding up instead of down, such that the mask
|
||||||
|
correctly correctly describes all possisble bits the device needs to
|
||||||
|
emit.
|
||||||
|
|
||||||
|
Fixes: 9a6d7298b083 ("of: Calculate device DMA masks based on DT dma-range size")
|
||||||
|
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||||
|
Reported-by: Andreas Färber <afaerber@suse.de>
|
||||||
|
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
|
||||||
|
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
|
||||||
|
Acked-by: Rob Herring <robh@kernel.org>
|
||||||
|
---
|
||||||
|
drivers/of/device.c | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/of/device.c b/drivers/of/device.c
|
||||||
|
index 28c38c756f92..e0a28ea341fe 100644
|
||||||
|
--- a/drivers/of/device.c
|
||||||
|
+++ b/drivers/of/device.c
|
||||||
|
@@ -89,6 +89,7 @@ int of_dma_configure(struct device *dev, struct device_node *np)
|
||||||
|
bool coherent;
|
||||||
|
unsigned long offset;
|
||||||
|
const struct iommu_ops *iommu;
|
||||||
|
+ u64 mask;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set default coherent_dma_mask to 32 bit. Drivers are expected to
|
||||||
|
@@ -134,10 +135,9 @@ int of_dma_configure(struct device *dev, struct device_node *np)
|
||||||
|
* Limit coherent and dma mask based on size and default mask
|
||||||
|
* set by the driver.
|
||||||
|
*/
|
||||||
|
- dev->coherent_dma_mask = min(dev->coherent_dma_mask,
|
||||||
|
- DMA_BIT_MASK(ilog2(dma_addr + size)));
|
||||||
|
- *dev->dma_mask = min((*dev->dma_mask),
|
||||||
|
- DMA_BIT_MASK(ilog2(dma_addr + size)));
|
||||||
|
+ mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
|
||||||
|
+ dev->coherent_dma_mask &= mask;
|
||||||
|
+ *dev->dma_mask &= mask;
|
||||||
|
|
||||||
|
coherent = of_dma_is_coherent(np);
|
||||||
|
dev_dbg(dev, "device is%sdma coherent\n",
|
||||||
|
--
|
||||||
|
2.14.1
|
||||||
|
|
|
@ -7,11 +7,11 @@ _rcver=4.13
|
||||||
_rcrel=5
|
_rcrel=5
|
||||||
|
|
||||||
pkgbase=linux-aarch64-rc
|
pkgbase=linux-aarch64-rc
|
||||||
_srcname=linux-v${_rcver}-rc${_rcrel}
|
_srcname=linux-${_rcver}-rc${_rcrel}
|
||||||
_kernelname=${pkgbase#linux}
|
_kernelname=${pkgbase#linux}
|
||||||
_desc="AArch64 multi-platform (release candidate)"
|
_desc="AArch64 multi-platform (release candidate)"
|
||||||
pkgver=${_rcver}.rc${_rcrel}
|
pkgver=${_rcver}.rc${_rcrel}
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
arch=('aarch64')
|
arch=('aarch64')
|
||||||
url="http://www.kernel.org/"
|
url="http://www.kernel.org/"
|
||||||
license=('GPL2')
|
license=('GPL2')
|
||||||
|
@ -21,18 +21,18 @@ source=("https://git.kernel.org/torvalds/t/${_srcname}.tar.gz"
|
||||||
'0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch'
|
'0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch'
|
||||||
'0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch'
|
'0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch'
|
||||||
'0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch'
|
'0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch'
|
||||||
'0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch'
|
'0004-Revert-arm64-dts-qcom-Collapse-usb-support-into-one-.patch'
|
||||||
'0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch'
|
'0005-of-Fix-DMA-mask-generation.patch'
|
||||||
'config'
|
'config'
|
||||||
'linux.preset'
|
'linux.preset'
|
||||||
'99-linux.hook')
|
'99-linux.hook')
|
||||||
md5sums=('be06b4d76cfb534b89f2bd04df1310a4'
|
md5sums=('a694a893f7750c0c1dad9231210f2212'
|
||||||
'6fef5d95707f770b8433b04b1252bcde'
|
'd4d9e69e2c6f17333cbe8fca8e54f842'
|
||||||
'8ca287bebebf19aa62833afac4cdd2b9'
|
'7a8ae6a56f63e8d3485ce5ef3ae934f1'
|
||||||
'f69116bf273340e5d10a6f26a7be3ce0'
|
'33d0c547f73e7ec3336a361fafff923b'
|
||||||
'7b45c94c588ad6373b2b384e42982e2a'
|
'100ef048b8ec475e14442a81b388a203'
|
||||||
'4a4cf8641ad1e6ffe93c7a5180768212'
|
'ce0d7d63d17c330fd81ff9f801fb7777'
|
||||||
'57630c71acfcf94c9891a80563920f6a'
|
'621f6e80ad6846cd34a4f0d1f76ecabb'
|
||||||
'25d8f6983c9a616946848c0e075a949c'
|
'25d8f6983c9a616946848c0e075a949c'
|
||||||
'1d4477026533efaa0358a40855d50a83')
|
'1d4477026533efaa0358a40855d50a83')
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ prepare() {
|
||||||
git apply ../0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch
|
git apply ../0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch
|
||||||
git apply ../0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch
|
git apply ../0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch
|
||||||
git apply ../0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch
|
git apply ../0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch
|
||||||
git apply ../0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch
|
git apply ../0004-Revert-arm64-dts-qcom-Collapse-usb-support-into-one-.patch
|
||||||
git apply ../0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch
|
git apply ../0005-of-Fix-DMA-mask-generation.patch
|
||||||
|
|
||||||
cat "${srcdir}/config" > ./.config
|
cat "${srcdir}/config" > ./.config
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#
|
#
|
||||||
# Automatically generated file; DO NOT EDIT.
|
# Automatically generated file; DO NOT EDIT.
|
||||||
# Linux/arm64 4.13.0-rc4-2 Kernel Configuration
|
# Linux/arm64 4.13.0-rc5-2 Kernel Configuration
|
||||||
#
|
#
|
||||||
CONFIG_ARM64=y
|
CONFIG_ARM64=y
|
||||||
CONFIG_64BIT=y
|
CONFIG_64BIT=y
|
||||||
|
@ -3266,7 +3266,7 @@ CONFIG_ACPI_I2C_OPREGION=y
|
||||||
CONFIG_I2C_BOARDINFO=y
|
CONFIG_I2C_BOARDINFO=y
|
||||||
CONFIG_I2C_COMPAT=y
|
CONFIG_I2C_COMPAT=y
|
||||||
CONFIG_I2C_CHARDEV=m
|
CONFIG_I2C_CHARDEV=m
|
||||||
CONFIG_I2C_MUX=m
|
CONFIG_I2C_MUX=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Multiplexer I2C Chip support
|
# Multiplexer I2C Chip support
|
||||||
|
@ -3276,7 +3276,7 @@ CONFIG_I2C_MUX_GPIO=m
|
||||||
CONFIG_I2C_MUX_GPMUX=m
|
CONFIG_I2C_MUX_GPMUX=m
|
||||||
# CONFIG_I2C_MUX_LTC4306 is not set
|
# CONFIG_I2C_MUX_LTC4306 is not set
|
||||||
CONFIG_I2C_MUX_PCA9541=m
|
CONFIG_I2C_MUX_PCA9541=m
|
||||||
CONFIG_I2C_MUX_PCA954x=m
|
CONFIG_I2C_MUX_PCA954x=y
|
||||||
CONFIG_I2C_MUX_PINCTRL=m
|
CONFIG_I2C_MUX_PINCTRL=m
|
||||||
CONFIG_I2C_MUX_REG=m
|
CONFIG_I2C_MUX_REG=m
|
||||||
CONFIG_I2C_DEMUX_PINCTRL=m
|
CONFIG_I2C_DEMUX_PINCTRL=m
|
||||||
|
@ -5444,7 +5444,7 @@ CONFIG_USB_DEFAULT_PERSIST=y
|
||||||
CONFIG_USB_OTG=y
|
CONFIG_USB_OTG=y
|
||||||
# CONFIG_USB_OTG_WHITELIST is not set
|
# CONFIG_USB_OTG_WHITELIST is not set
|
||||||
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
|
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
|
||||||
CONFIG_USB_OTG_FSM=y
|
# CONFIG_USB_OTG_FSM is not set
|
||||||
# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set
|
# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set
|
||||||
CONFIG_USB_MON=y
|
CONFIG_USB_MON=y
|
||||||
CONFIG_USB_WUSB=m
|
CONFIG_USB_WUSB=m
|
||||||
|
@ -5574,7 +5574,7 @@ CONFIG_USB_CHIPIDEA_OF=y
|
||||||
CONFIG_USB_CHIPIDEA_PCI=y
|
CONFIG_USB_CHIPIDEA_PCI=y
|
||||||
CONFIG_USB_CHIPIDEA_UDC=y
|
CONFIG_USB_CHIPIDEA_UDC=y
|
||||||
CONFIG_USB_CHIPIDEA_HOST=y
|
CONFIG_USB_CHIPIDEA_HOST=y
|
||||||
# CONFIG_USB_CHIPIDEA_ULPI is not set
|
CONFIG_USB_CHIPIDEA_ULPI=y
|
||||||
CONFIG_USB_ISP1760=y
|
CONFIG_USB_ISP1760=y
|
||||||
CONFIG_USB_ISP1760_HCD=y
|
CONFIG_USB_ISP1760_HCD=y
|
||||||
CONFIG_USB_ISP1761_UDC=y
|
CONFIG_USB_ISP1761_UDC=y
|
||||||
|
@ -6606,9 +6606,9 @@ CONFIG_MCP3422=m
|
||||||
CONFIG_MEDIATEK_MT6577_AUXADC=m
|
CONFIG_MEDIATEK_MT6577_AUXADC=m
|
||||||
CONFIG_MESON_SARADC=y
|
CONFIG_MESON_SARADC=y
|
||||||
CONFIG_NAU7802=m
|
CONFIG_NAU7802=m
|
||||||
CONFIG_QCOM_VADC_COMMON=m
|
CONFIG_QCOM_VADC_COMMON=y
|
||||||
CONFIG_QCOM_SPMI_IADC=m
|
CONFIG_QCOM_SPMI_IADC=m
|
||||||
CONFIG_QCOM_SPMI_VADC=m
|
CONFIG_QCOM_SPMI_VADC=y
|
||||||
CONFIG_ROCKCHIP_SARADC=m
|
CONFIG_ROCKCHIP_SARADC=m
|
||||||
CONFIG_TI_ADC081C=m
|
CONFIG_TI_ADC081C=m
|
||||||
CONFIG_TI_ADC0832=m
|
CONFIG_TI_ADC0832=m
|
||||||
|
@ -6831,7 +6831,7 @@ CONFIG_SENSORS_HMC5843_SPI=m
|
||||||
#
|
#
|
||||||
# Multiplexers
|
# Multiplexers
|
||||||
#
|
#
|
||||||
CONFIG_IIO_MUX=m
|
CONFIG_IIO_MUX=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Inclinometer sensors
|
# Inclinometer sensors
|
||||||
|
@ -7038,13 +7038,13 @@ CONFIG_MESON_EFUSE=m
|
||||||
#
|
#
|
||||||
# CONFIG_FSI is not set
|
# CONFIG_FSI is not set
|
||||||
# CONFIG_TEE is not set
|
# CONFIG_TEE is not set
|
||||||
CONFIG_MULTIPLEXER=m
|
CONFIG_MULTIPLEXER=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Multiplexer drivers
|
# Multiplexer drivers
|
||||||
#
|
#
|
||||||
# CONFIG_MUX_ADG792A is not set
|
# CONFIG_MUX_ADG792A is not set
|
||||||
CONFIG_MUX_GPIO=m
|
CONFIG_MUX_GPIO=y
|
||||||
# CONFIG_MUX_MMIO is not set
|
# CONFIG_MUX_MMIO is not set
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue