aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-octeon/ubnt-e200-sdio-underclock.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/linux-octeon/ubnt-e200-sdio-underclock.patch')
-rw-r--r--main/linux-octeon/ubnt-e200-sdio-underclock.patch47
1 files changed, 38 insertions, 9 deletions
diff --git a/main/linux-octeon/ubnt-e200-sdio-underclock.patch b/main/linux-octeon/ubnt-e200-sdio-underclock.patch
index 1b6c34e956..423917ac52 100644
--- a/main/linux-octeon/ubnt-e200-sdio-underclock.patch
+++ b/main/linux-octeon/ubnt-e200-sdio-underclock.patch
@@ -1,13 +1,19 @@
-Cleaned up patch which underclocks the SDIO bus on E200 boards,
-derived from UBNT GPL sources (ubnt_prune_device_tree).
+Underclock the SDIO bus on E200 devices.
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 @@
+Upstream-status: Not yet submitted
+
+--- a/arch/mips/cavium-octeon/octeon-platform.c
++++ b/arch/mips/cavium-octeon/octeon-platform.c
+@@ -760,6 +760,28 @@
}
- #endif
+ }
++int __init alpine_prune_device_tree(void)
++{
++ if (fdt_check_header(initial_boot_params))
++ panic("Corrupt Device Tree.");
++
+ /* 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;
@@ -22,11 +28,34 @@ Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
+ }
+ }
+
- return 0;
++ return 0;
++}
++
+ int __init octeon_prune_device_tree(void)
+ {
+ int i, max_port, uart_mask;
+--- a/arch/mips/cavium-octeon/setup.c
++++ b/arch/mips/cavium-octeon/setup.c
+@@ -1184,6 +1184,7 @@
}
---- linux-5.4.orig/arch/mips/include/asm/octeon/cvmx-bootinfo.h
-+++ linux-5.4/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+ void __init octeon_fill_mac_addresses(void);
++int alpine_prune_device_tree(void);
+
+ void __init device_tree_init(void)
+ {
+@@ -1219,6 +1220,9 @@
+ octeon_prune_device_tree();
+ pr_info("Using internal Device Tree.\n");
+ }
++
++ alpine_prune_device_tree();
++
+ if (fill_mac)
+ octeon_fill_mac_addresses();
+ unflatten_and_copy_device_tree();
+--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
++++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -295,6 +295,9 @@
*/
CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,