aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2022-03-21 18:32:41 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2022-10-22 19:44:45 +0200
commitc783073894a89f52e8c53c8ff600fa84ebe7bbf0 (patch)
tree6076ea8873b36a7f521918391155b9b58fbf6e51 /target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch
parent350593307381c3021b6990efa6ff16550a5e59a8 (diff)
downloadupstream-c783073894a89f52e8c53c8ff600fa84ebe7bbf0.tar.gz
upstream-c783073894a89f52e8c53c8ff600fa84ebe7bbf0.tar.bz2
upstream-c783073894a89f52e8c53c8ff600fa84ebe7bbf0.zip
lantiq: copy Linux 5.10 files in preparation for Linux 5.15 support
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Diffstat (limited to 'target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch')
-rw-r--r--target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch b/target/linux/lantiq/patches-5.15/0051-MIPS-lantiq-improve-USB-initialization.patch
new file mode 100644
index 0000000000..9d62892b56
--- /dev/null
+++ b/target/linux/lantiq/patches-5.15/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
+@@ -248,6 +248,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)
+ {
+@@ -585,4 +604,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();
+ }