aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2020-03-01 08:09:19 +0100
committerMathias Kresin <dev@kresin.me>2020-03-16 22:28:16 +0100
commit005dedd3480f47ff1049e132ec8d83bc0e24fbef (patch)
tree56fdc5bdf6c715d63fc5acb963eab4e747747920 /target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch
parent0dbe8b9029df1c1b254101bacbc20c3418eb956f (diff)
downloadupstream-005dedd3480f47ff1049e132ec8d83bc0e24fbef.tar.gz
upstream-005dedd3480f47ff1049e132ec8d83bc0e24fbef.tar.bz2
upstream-005dedd3480f47ff1049e132ec8d83bc0e24fbef.zip
lantiq: copy target to kernel 5.4
Duplicate kernel 4.19 config and patches for kernel 5.4. Duplicate the devicetree source files as well, they need kernel 5.4 specific adjustments. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch')
-rw-r--r--target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch b/target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch
new file mode 100644
index 0000000000..a7bdafd704
--- /dev/null
+++ b/target/linux/lantiq/patches-5.4/0051-MIPS-lantiq-improve-USB-initialization.patch
@@ -0,0 +1,49 @@
+From 14909c4e4e836925668e74fc6e0e85ba0283cbf9 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Fri, 6 Jan 2017 17:40:12 +0100
+Subject: [PATCH 2/2] MIPS: lantiq: improve USB initialization
+
+This adds code to initialize the USB controller and PHY also on Danube,
+Amazon SE and AR10. This code is based on the Vendor driver from
+different UGW versions and compared to the hardware documentation.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ arch/mips/lantiq/xway/sysctrl.c | 20 +++++++
+ 2 files changed, 110 insertions(+), 30 deletions(-)
+
+
+--- a/arch/mips/lantiq/xway/sysctrl.c
++++ b/arch/mips/lantiq/xway/sysctrl.c
+@@ -246,6 +246,25 @@ static void pmu_disable(struct clk *clk)
+ pr_warn("deactivating PMU module failed!");
+ }
+
++static void usb_set_clock(void)
++{
++ unsigned int val = ltq_cgu_r32(ifccr);
++
++ if (of_machine_is_compatible("lantiq,ar10") ||
++ of_machine_is_compatible("lantiq,grx390")) {
++ val &= ~0x03; /* XTAL divided by 3 */
++ } else if (of_machine_is_compatible("lantiq,ar9") ||
++ of_machine_is_compatible("lantiq,vr9")) {
++ /* TODO: this depends on the XTAL frequency */
++ val |= 0x03; /* XTAL divided by 3 */
++ } else if (of_machine_is_compatible("lantiq,ase")) {
++ val |= 0x20; /* from XTAL */
++ } else if (of_machine_is_compatible("lantiq,danube")) {
++ val |= 0x30; /* 12 MHz, generated from 36 MHz */
++ }
++ ltq_cgu_w32(val, ifccr);
++}
++
+ /* the pci enable helper */
+ static int pci_enable(struct clk *clk)
+ {
+@@ -567,4 +586,5 @@ void __init ltq_soc_init(void)
+ clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);
+ clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0);
+ }
++ usb_set_clock();
+ }