mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-29 12:31:35 +01:00
79 lines
2.3 KiB
Diff
79 lines
2.3 KiB
Diff
Underclock the SDIO bus on E200 devices.
|
|
|
|
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
|
|
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 @@
|
|
}
|
|
}
|
|
|
|
+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;
|
|
+ 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;
|
|
+}
|
|
+
|
|
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 @@
|
|
}
|
|
|
|
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,
|
|
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)
|