diff --git a/core/linux-aarch64-rc/0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch b/core/linux-aarch64-rc/0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch index aea938878..9c37612dc 100644 --- a/core/linux-aarch64-rc/0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch +++ b/core/linux-aarch64-rc/0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch @@ -1,7 +1,7 @@ -From 763e9641f8e3c3e48ff37b33f4bc5a6e452dfbd6 Mon Sep 17 00:00:00 2001 +From 1b63f6ad09d1ec870572aeeb8ca25a6f3be5bd28 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 18 Feb 2014 01:43:50 -0300 -Subject: [PATCH 1/2] 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 --- drivers/net/usb/smsc95xx.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/core/linux-aarch64-rc/0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch b/core/linux-aarch64-rc/0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch index e35daa8af..af653972f 100644 --- a/core/linux-aarch64-rc/0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch +++ b/core/linux-aarch64-rc/0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch @@ -1,7 +1,7 @@ -From a22772e6359cfa5abeaf73a93ea09cae4ec67efa Mon Sep 17 00:00:00 2001 +From 035007e2a13b6ea74f6c43556ae72aeeb0d0df7a Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Fri, 21 Jul 2017 16:30:59 +0800 -Subject: [PATCH 2/2] arm64: dts: rockchip: enable sdmmc controller on +Subject: [PATCH 2/5] arm64: dts: rockchip: enable sdmmc controller on rk3399-firefly This allows basic support for SD highspeed cards but no UHS-I mode diff --git a/core/linux-aarch64-rc/0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch b/core/linux-aarch64-rc/0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch new file mode 100644 index 000000000..cbb0b8e1d --- /dev/null +++ b/core/linux-aarch64-rc/0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch @@ -0,0 +1,26 @@ +From 44bb885638224454b907d448d1202640408b235c Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Mon, 7 Aug 2017 19:34:57 -0600 +Subject: [PATCH 3/5] arm64: dts: rockchip: disable pwm0 on rk3399-firefly + +Workaround for intermittent boot hangs due to pwm0 probe disabling the PWM clock. +--- + arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +index e01ef8a77f5e..1fd4e87c61d5 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +@@ -618,7 +618,7 @@ + }; + + &pwm0 { +- status = "okay"; ++ status = "disabled"; + }; + + &pwm2 { +-- +2.13.3 + diff --git a/core/linux-aarch64-rc/0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch b/core/linux-aarch64-rc/0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch new file mode 100644 index 000000000..e0c06e669 --- /dev/null +++ b/core/linux-aarch64-rc/0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch @@ -0,0 +1,76 @@ +From 883eeb697555d1d9b7e4c43657a335fe34156f13 Mon Sep 17 00:00:00 2001 +From: Stephen Boyd +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 +Signed-off-by: Stephen Boyd +Signed-off-by: Andy Gross +--- + 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 + diff --git a/core/linux-aarch64-rc/0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch b/core/linux-aarch64-rc/0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch new file mode 100644 index 000000000..4118cc446 --- /dev/null +++ b/core/linux-aarch64-rc/0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch @@ -0,0 +1,104 @@ +From 768ee4a456e28285d5f683ea70147ef595eb54d8 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +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 # 4.12 +Cc: Robin Murphy +Cc: Sricharan R +Cc: Stefan Wahren +Reported-by: Hans Verkuil +Signed-off-by: Johan Hovold +--- + 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 + diff --git a/core/linux-aarch64-rc/PKGBUILD b/core/linux-aarch64-rc/PKGBUILD index 0f474e95d..a04a288ac 100644 --- a/core/linux-aarch64-rc/PKGBUILD +++ b/core/linux-aarch64-rc/PKGBUILD @@ -11,7 +11,7 @@ _srcname=linux-${_rcver}-rc${_rcrel} _kernelname=${pkgbase#linux} _desc="AArch64 multi-platform (release candidate)" pkgver=${_rcver}.rc${_rcrel} -pkgrel=1 +pkgrel=2 arch=('aarch64') url="http://www.kernel.org/" license=('GPL2') @@ -20,13 +20,19 @@ options=('!strip') source=("https://git.kernel.org/torvalds/t/${_srcname}.tar.gz" '0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch' '0002-arm64-dts-rockchip-enable-sdmmc-controller-on-rk3399.patch' + '0003-arm64-dts-rockchip-disable-pwm0-on-rk3399-firefly.patch' + '0004-arm64-dts-qcom-Force-host-mode-for-USB-on-apq8016-sb.patch' + '0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch' 'config' 'linux.preset' '99-linux.hook') md5sums=('0b451973dbd2581db9f44f5ddfbc593d' - 'dc03222110a2c4c5755a1d8b3e3ec744' - '8079a35ed2df242046e142c8c2dd036d' - '1cc8a078a4637c31c780b4d08aa278a0' + '6fef5d95707f770b8433b04b1252bcde' + '8ca287bebebf19aa62833afac4cdd2b9' + 'f69116bf273340e5d10a6f26a7be3ce0' + '7b45c94c588ad6373b2b384e42982e2a' + '4a4cf8641ad1e6ffe93c7a5180768212' + '57630c71acfcf94c9891a80563920f6a' '25d8f6983c9a616946848c0e075a949c' '1d4477026533efaa0358a40855d50a83') @@ -36,6 +42,9 @@ prepare() { # ALARM patches 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 ../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 ../0005-dma-mapping-skip-USB-devices-when-configuring-DMA-du.patch cat "${srcdir}/config" > ./.config diff --git a/core/linux-aarch64-rc/config b/core/linux-aarch64-rc/config index 4ee7a41b0..13febb4ea 100644 --- a/core/linux-aarch64-rc/config +++ b/core/linux-aarch64-rc/config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 4.13.0-rc4-1 Kernel Configuration +# Linux/arm64 4.13.0-rc4-2 Kernel Configuration # CONFIG_ARM64=y CONFIG_64BIT=y @@ -466,7 +466,7 @@ CONFIG_PCI_XGENE=y CONFIG_PCI_XGENE_MSI=y # CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set -# CONFIG_PCIE_ROCKCHIP is not set +CONFIG_PCIE_ROCKCHIP=y # # PCI Endpoint @@ -6989,7 +6989,7 @@ CONFIG_PHY_QCOM_USB_HSIC=y CONFIG_PHY_ROCKCHIP_DP=y CONFIG_PHY_ROCKCHIP_EMMC=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y -# CONFIG_PHY_ROCKCHIP_PCIE is not set +CONFIG_PHY_ROCKCHIP_PCIE=y CONFIG_PHY_ROCKCHIP_TYPEC=y # CONFIG_PHY_ROCKCHIP_USB is not set # CONFIG_PHY_SAMSUNG_USB2 is not set @@ -7519,7 +7519,7 @@ CONFIG_HAVE_ARCH_KASAN=y # CONFIG_KASAN is not set CONFIG_ARCH_HAS_KCOV=y # CONFIG_KCOV is not set -CONFIG_DEBUG_SHIRQ=y +# CONFIG_DEBUG_SHIRQ is not set # # Debug Lockups and Hangs