aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-octeon/ubnt-e200-sdio-underclock.patch
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-02-05 14:11:32 +0000
committerAriadne Conill <ariadne@dereferenced.org>2020-02-05 14:17:35 +0000
commitabd86a4eb9d4fadb430daaa1e19fa5c10abdcf63 (patch)
tree43ac55a6fa5286ed6f134f654f8ae4f3767cbee4 /main/linux-octeon/ubnt-e200-sdio-underclock.patch
parent570efe74c1b275bfb920f1434d2a877123df4fcc (diff)
downloadaports-abd86a4eb9d4fadb430daaa1e19fa5c10abdcf63.tar.bz2
aports-abd86a4eb9d4fadb430daaa1e19fa5c10abdcf63.tar.xz
main/linux-octeon: upgrade to 5.4.17, add UBNT E200 SDIO underclocking workaround
Diffstat (limited to 'main/linux-octeon/ubnt-e200-sdio-underclock.patch')
-rw-r--r--main/linux-octeon/ubnt-e200-sdio-underclock.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/main/linux-octeon/ubnt-e200-sdio-underclock.patch b/main/linux-octeon/ubnt-e200-sdio-underclock.patch
new file mode 100644
index 0000000000..1b6c34e956
--- /dev/null
+++ b/main/linux-octeon/ubnt-e200-sdio-underclock.patch
@@ -0,0 +1,49 @@
+Cleaned up patch which underclocks the SDIO bus on E200 boards,
+derived from UBNT GPL sources (ubnt_prune_device_tree).
+
+Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
+--- linux-5.4.orig/arch/mips/cavium-octeon/octeon-platform.c
++++ linux-5.4/arch/mips/cavium-octeon/octeon-platform.c
+@@ -1128,6 +1128,20 @@
+ }
+ #endif
+
++ /* UBNT underclocks the SDIO bus on E200. We do the same here. */
++ if (octeon_bootinfo->board_type == CVMX_BOARD_TYPE_UBNT_E200 || octeon_bootinfo->board_type == CVMX_BOARD_TYPE_UBNT_E220) {
++ int mmc_slot0;
++ u32 freq = 26000000;
++
++ pr_info("UBNT E200 board detected, underclocking SDIO bus.\n");
++
++ mmc_slot0 = fdt_path_offset(initial_boot_params, "/soc/mmc/mmc-slot@0");
++ if (mmc_slot0 > 0) {
++ fdt_setprop_inplace_cell(initial_boot_params, mmc_slot0,
++ "spi-max-frequency", freq);
++ }
++ }
++
+ return 0;
+ }
+
+--- linux-5.4.orig/arch/mips/include/asm/octeon/cvmx-bootinfo.h
++++ linux-5.4/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+@@ -295,6 +295,9 @@
+ */
+ CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
+ CVMX_BOARD_TYPE_UBNT_E100 = 20002,
++ CVMX_BOARD_TYPE_UBNT_E200 = 20003,
++ CVMX_BOARD_TYPE_UBNT_E120 = 20004,
++ CVMX_BOARD_TYPE_UBNT_E220 = 20005,
+ CVMX_BOARD_TYPE_CUST_DSR1000N = 20006,
+ CVMX_BOARD_TYPE_KONTRON_S1901 = 21901,
+ CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
+@@ -396,6 +399,9 @@
+ /* Customer private range */
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN)
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100)
++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200)
++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E120)
++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220)
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N)
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901)
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)