add rb711 support (not tested) ozonet-21.02
authorAlexandros C. Couloumbis <alex@ozo.com>
Sun, 18 Dec 2022 06:26:05 +0000 (08:26 +0200)
committerAlexandros Couloumbis <alex@ozo.com>
Sun, 18 Dec 2022 10:52:28 +0000 (12:52 +0200)
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-rb750.c
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
target/linux/ar71xx/mikrotik/config-default
target/linux/ar71xx/patches-4.14/703-MIPS-ath79-add-rb711-detection.patch [new file with mode: 0644]

index 14b661cfd7606589aa90640cd5ea6eb25ace5d6a..35a8aaa9d738e849eeb14008b466b91c6ce1802e 100755 (executable)
@@ -451,6 +451,14 @@ mikrotik_board_detect() {
        *"493G")
                name="rb-493g"
                ;;
+       *"711"|\
+       *"711HnD"|\
+       *"711GHnD"|\
+       *"711G"|\
+       *"711GT"|\
+       *"711Gr100")
+               name="rb-711"
+               ;;
        *"750")
                name="rb-750"
                ;;
index f44cdb061f749ce9a4066fdcf6429670af1b8214..4d51955c2ad5e027678fe53bd4e2e71c0bf2921a 100755 (executable)
@@ -548,6 +548,8 @@ platform_check_image() {
        rb-450g|\
        rb-493|\
        rb-493g|\
+       rb-711-5hnd|\
+       rb-711g-5hnd|\
        rb-750|\
        rb-750gl|\
        rb-751|\
@@ -868,6 +870,8 @@ platform_do_upgrade() {
        rb-450g|\
        rb-493|\
        rb-493g|\
+       rb-711-5hnd|\
+       rb-711g-5hnd|\
        rb-750|\
        rb-750gl|\
        rb-751|\
index 0ec94a80e32c471a74be9038f43e3cf24ee60c49..75f27ca8f15b6da12c7396238df5fbc5141b0005 100644 (file)
@@ -347,3 +347,178 @@ static void __init rb751g_setup(void)
 
 MIPS_MACHINE(ATH79_MACH_RB_751G, "751g", "MikroTik RouterBOARD 751G",
             rb751g_setup);
+
+static void __init rb711_setup(void)
+{
+       ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+
+       ath79_register_mdio(0, 0x0);
+
+       ath79_register_eth(0);
+
+       ath79_register_usb();
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711, "711", "MikroTik RouterBOARD 711",
+           rb711_setup);
+
+static void __init rb711hnd_setup(void)
+{
+       ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+       ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
+
+       ath79_register_mdio(0, 0x0);
+
+       ath79_register_eth(1);
+       ath79_register_eth(0);
+
+       rb750_leds_data.num_leds = ARRAY_SIZE(rb750gr3_leds);
+       rb750_leds_data.leds = rb750gr3_leds;
+       rb750_leds_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_leds_device);
+
+       rb750_nand_data.nce_line = RB750_NAND_NCE;
+       rb750_nand_data.enable_pins = rb750_nand_enable_pins;
+       rb750_nand_data.disable_pins = rb750_nand_disable_pins;
+       rb750_nand_data.latch_change = rb750_latch_change;
+       platform_device_register(&rb750_nand_device);
+
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711HnD, "711HnD", "MikroTik RouterBOARD 711 5HnD",
+           rb711hnd_setup);
+
+static void __init rb711ghnd_setup(void)
+{
+       ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+       ath79_register_mdio(0, 0x0);
+       mdiobus_register_board_info(rb750g3_mdio_info,
+                                  ARRAY_SIZE(rb750g3_mdio_info));
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+       ath79_eth0_data.phy_mask = BIT(0);
+       ath79_eth0_pll_data.pll_1000 = 0x16000000;
+
+       ath79_register_eth(0);
+
+       rb750_leds_data.num_leds = ARRAY_SIZE(rb750gr3_leds);
+       rb750_leds_data.leds = rb750gr3_leds;
+       rb750_leds_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_leds_device);
+
+       rb750_nand_data.nce_line = RB750_NAND_NCE;
+       rb750_nand_data.enable_pins = rb750_nand_enable_pins;
+       rb750_nand_data.disable_pins = rb750_nand_disable_pins;
+       rb750_nand_data.latch_change = rb750_latch_change;
+       platform_device_register(&rb750_nand_device);
+
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711GHnD, "711GHnD", "MikroTik RouterBOARD 711G 5HnD",
+           rb711ghnd_setup);
+
+static void __init rb711r3_setup(void)
+{
+       ath79_register_mdio(0, 0x0);
+       mdiobus_register_board_info(rb750g3_mdio_info,
+                                  ARRAY_SIZE(rb750g3_mdio_info));
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+
+       ath79_register_mdio(0, 0x0);
+
+       ath79_register_eth(0);
+
+       rb750_leds_data.num_leds = ARRAY_SIZE(rb750gr3_leds);
+       rb750_leds_data.leds = rb750gr3_leds;
+       rb750_leds_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_leds_device);
+
+       rb750_nand_data.nce_line = RB7XX_NAND_NCE;
+       rb750_nand_data.enable_pins = rb750gr3_nand_enable_pins;
+       rb750_nand_data.disable_pins = rb750gr3_nand_disable_pins;
+       rb750_nand_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_nand_device);
+
+       ath79_register_usb();
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711_R3, "711r3", "MikroTik RouterBOARD 711",
+           rb711r3_setup);
+
+static void __init rb711g_setup(void)
+{
+       ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                   AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+
+       ath79_register_mdio(0, 0x0);
+
+       ath79_register_eth(0);
+
+       ath79_register_usb();
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711G, "711G", "MikroTik RouterBOARD 711G",
+           rb711g_setup);
+
+MIPS_MACHINE(ATH79_MACH_RB_711GT, "711GT", "MikroTik RouterBOARD 711GT",
+           rb711g_setup);
+
+static void __init rb711gr100_setup(void)
+{
+       ath79_register_mdio(0, 0x0);
+       mdiobus_register_board_info(rb750g3_mdio_info,
+                                  ARRAY_SIZE(rb750g3_mdio_info));
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+       ath79_eth0_data.phy_mask = BIT(0);
+
+       ath79_register_eth(0);
+
+       rb750_leds_data.num_leds = ARRAY_SIZE(rb750gr3_leds);
+       rb750_leds_data.leds = rb750gr3_leds;
+       rb750_leds_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_leds_device);
+
+       rb750_nand_data.nce_line = RB7XX_NAND_NCE;
+       rb750_nand_data.enable_pins = rb750gr3_nand_enable_pins;
+       rb750_nand_data.disable_pins = rb750gr3_nand_disable_pins;
+       rb750_nand_data.latch_change = rb750gr3_latch_change;
+       platform_device_register(&rb750_nand_device);
+
+       ath79_register_usb();
+       rb751_wlan_setup();
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_711GR100, "711Gr100", "MikroTik RouterBOARD 711Gr100",
+           rb711gr100_setup);
index 900b4ec87b1b8a3bf6def552974ce930df750acd..3baf9c86bd1feaf32a999ce1b059029e747baabe 100644 (file)
@@ -211,6 +211,12 @@ enum ath79_mach_type {
        ATH79_MACH_RB_493,                      /* Mikrotik RouterBOARD 493/493AH */
        ATH79_MACH_RB_493G,                     /* Mikrotik RouterBOARD 493G */
        ATH79_MACH_RB_711GR100,                 /* Mikrotik RouterBOARD 911/912 boards */
+       ATH79_MACH_RB_711,                      /* MikroTik RouterBOARD 711 */
+       ATH79_MACH_RB_711_R3,                   /* MikroTik RouterBOARD 711 */
+       ATH79_MACH_RB_711G,                     /* MikroTik RouterBOARD 711G */
+       ATH79_MACH_RB_711GT,                    /* MikroTik RouterBOARD 711GT */
+       ATH79_MACH_RB_711HnD,                   /* MikroTik RouterBOARD 711 HnD */
+       ATH79_MACH_RB_711GHnD,                  /* MikroTik RouterBOARD 711G HnD */
        ATH79_MACH_RB_750,                      /* MikroTik RouterBOARD 750 */
        ATH79_MACH_RB_750G_R3,                  /* MikroTik RouterBOARD 750GL */
        ATH79_MACH_RB_750UPR2,                  /* MikroTik RouterBOARD 750UP r2 */
index eb2f362034624e99f208c0b5cc9fd341d38ebbee..9f1605486fb358244f64177f64eee9670978beb6 100644 (file)
@@ -77,3 +77,5 @@ CONFIG_UBIFS_FS_ADVANCED_COMPR=y
 CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
+# CONFIG_CMDLINE="console=ttyS0,115200 GPIO_RESET=yes gpio=790341 HZ=400000000 mem=32M board=711GHnD noinitrd"
+# CONFIG_CMDLINE_OVERRIDE=y
diff --git a/target/linux/ar71xx/patches-4.14/703-MIPS-ath79-add-rb711-detection.patch b/target/linux/ar71xx/patches-4.14/703-MIPS-ath79-add-rb711-detection.patch
new file mode 100644 (file)
index 0000000..963a3b3
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/arch/mips/ath79/prom.c
++++ b/arch/mips/ath79/prom.c
+@@ -155,6 +155,7 @@ void __init prom_init(void)
+           strstr(arcs_cmdline, "board=435") ||
+           strstr(arcs_cmdline, "board=450") ||
+           strstr(arcs_cmdline, "board=493") ||
++          strstr(arcs_cmdline, "board=711") ||
+           strstr(arcs_cmdline, "board=951G") ||
+           strstr(arcs_cmdline, "board=H951L") ||
+           strstr(arcs_cmdline, "board=952-hb") ||