Update to using newer kernel, added patches

Added patch for usb regression introduced in kernel 4.17
Changed to build using kernel 4.17.8
This commit is contained in:
SolidHal 2018-07-21 13:22:45 -05:00
parent 5a35da895e
commit a498fcc45e
3 changed files with 51 additions and 7 deletions

View File

@ -3,7 +3,7 @@
#Build kenerl, wifi firmware
KVER=4.17.5
KVER=4.17.8
# build Linux-libre, with ath9k_htc, dwc2 from Chrome OS and without many useless drivers
[ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
@ -12,10 +12,11 @@ cd linux-$KVER
make clean
make mrproper
#Apply the usb patch
#git apply ../chromeos-dwc2-glue.patch
git apply ../chromeos-dwc2-glue.patch
git apply ../rockchip-dwc2-usb-partial-power-down.patch
#Apply all of the rockMyy patches that make sense
# git apply ../patches/kernel/*
# git apply ../patches/DTS/*
git apply ../patches/kernel/*
git apply ../patches/DTS/*
# reset the minor version number, so out-of-tree drivers continue to work after
# a kernel upgrade
sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile

View File

@ -128,15 +128,15 @@ diff -rup linux-4.17.2-orig/include/linux/device.h linux-4.17.2/include/linux/de
diff -rup linux-4.17.2-orig/include/linux/of.h linux-4.17.2/include/linux/of.h
--- linux-4.17.2-orig/include/linux/of.h 2018-04-20 09:21:08.000000000 +0300
+++ linux-4.17.2/include/linux/of.h 2018-04-21 18:03:18.492034069 +0300
@@ -521,6 +521,8 @@ const char *of_prop_next_string(struct p
@@ -543,6 +543,8 @@ const char *of_prop_next_string(struct p
bool of_console_check(struct device_node *dn, char *name, int index);
+enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
+
#else /* CONFIG_OF */
extern int of_cpu_node_to_id(struct device_node *np);
static inline void of_core_init(void)
#else /* CONFIG_OF */
diff -rup linux-4.17.2-orig/include/linux/usb/hcd.h linux-4.17.2/include/linux/usb/hcd.h
--- linux-4.17.2-orig/include/linux/usb/hcd.h 2018-04-20 09:21:08.000000000 +0300
+++ linux-4.17.2/include/linux/usb/hcd.h 2018-04-21 18:02:33.620033003 +0300

View File

@ -0,0 +1,43 @@
From 04fbf78e4e569bf872f1ffcb0a6f9b89569dc913 Mon Sep 17 00:00:00 2001
From: Hal Emmerich <hal@halemmerich.com>
Date: Thu, 19 Jul 2018 21:48:08 -0500
Subject: [PATCH] usb: dwc2: disable power_down on rockchip devices
The bug would let the usb controller enter partial power down,
which was formally known as hibernate, upon boot if nothing was plugged
in to the port. Partial power down couldn't be exited properly, so any
usb devices plugged in after boot would not be usable.
Before the name change, params.hibernation was false by default, so
_dwc2_hcd_suspend() would skip entering hibernation. With the
rename, _dwc2_hcd_suspend() was changed to use params.power_down
to decide whether or not to enter partial power down.
Since params.power_down is non-zero by default, it needs to be set
to 0 for rockchip devices to restore functionality.
This bug was reported in the linux-usb thread:
REGRESSION: usb: dwc2: USB device not seen after boot
The commit that caused this regression is:
6d23ee9caa6790aea047f9aca7f3c03cb8d96eb6
Signed-off-by: Hal Emmerich <hal@halemmerich.com>
---
drivers/usb/dwc2/params.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index f03e41879224..492607adc506 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -82,6 +82,7 @@ static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)
p->host_perio_tx_fifo_size = 256;
p->ahbcfg = GAHBCFG_HBSTLEN_INCR16 <<
GAHBCFG_HBSTLEN_SHIFT;
+ p->power_down = 0;
}
static void dwc2_set_ltq_params(struct dwc2_hsotg *hsotg)
--
2.11.0