aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-09-09 14:05:22 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-09-09 14:05:22 +0000
commit6ae5ec16e0f030649e759e340f791df388d6e38d (patch)
tree7124a08e0e5468787df4389c531e67a956f95fb7 /target
parent94bac7366c2ad13a479c5476659658aeece43ca5 (diff)
downloadupstream-6ae5ec16e0f030649e759e340f791df388d6e38d.tar.gz
upstream-6ae5ec16e0f030649e759e340f791df388d6e38d.tar.bz2
upstream-6ae5ec16e0f030649e759e340f791df388d6e38d.zip
ar71xx: add preliminary support for Mikrotik RB2011L
This patch adds preliminary support for the Mikrotik RB2011L. The NAND flash is not yet supported, so only the initramfs kernel can be used for now. [juhosg: remove unnecessary PCI/USB related stuff, the board does not use that, update commit message] Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> SVN-Revision: 33344
Diffstat (limited to 'target')
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/network3
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh3
-rw-r--r--target/linux/ar71xx/config-3.31
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c97
-rw-r--r--target/linux/ar71xx/patches-3.3/613-RB2011-support.patch50
5 files changed, 153 insertions, 1 deletions
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
index ce52d0e096..f4fa7a2500 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
@@ -21,7 +21,8 @@ ja76pf2)
ucidef_set_interface_lan "eth0 eth1"
;;
-db120)
+db120 |\
+rb-2011l)
ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index a1979a67e0..a007c4f531 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -291,6 +291,9 @@ ar71xx_board_detect() {
*"RouterBOARD 751G")
name="rb-751g"
;;
+ *"RouterBOARD 2011L")
+ name="rb-2011l"
+ ;;
*"Rocket M")
name="rocket-m"
;;
diff --git a/target/linux/ar71xx/config-3.3 b/target/linux/ar71xx/config-3.3
index 117e847b07..a13fded6e3 100644
--- a/target/linux/ar71xx/config-3.3
+++ b/target/linux/ar71xx/config-3.3
@@ -45,6 +45,7 @@ CONFIG_ATH79_MACH_OM2P=y
CONFIG_ATH79_MACH_PB42=y
CONFIG_ATH79_MACH_PB44=y
CONFIG_ATH79_MACH_PB92=y
+CONFIG_ATH79_MACH_RB2011=y
CONFIG_ATH79_MACH_RB4XX=y
CONFIG_ATH79_MACH_RB750=y
CONFIG_ATH79_MACH_RW2458N=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
new file mode 100644
index 0000000000..4f44ef4a3b
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
@@ -0,0 +1,97 @@
+/*
+ * MikroTik RouterBOARD 2011 support
+ *
+ * Copyright (C) 2012 Stijn Tintel <stijn@linux-ipv6.be>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/phy.h>
+#include <linux/platform_device.h>
+#include <linux/ar8216_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-m25p80.h"
+#include "machtypes.h"
+
+static struct ar8327_pad_cfg rb2011_ar8327_pad0_cfg = {
+ .mode = AR8327_PAD_MAC_RGMII,
+ .txclk_delay_en = true,
+ .rxclk_delay_en = true,
+ .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
+ .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
+};
+
+static struct ar8327_platform_data rb2011_ar8327_data = {
+ .pad0_cfg = &rb2011_ar8327_pad0_cfg,
+ .cpuport_cfg = {
+ .force_link = 1,
+ .speed = AR8327_PORT_SPEED_1000,
+ .duplex = 1,
+ .txpause = 1,
+ .rxpause = 1,
+ }
+};
+
+static struct mdio_board_info rb2011_mdio0_info[] = {
+ {
+ .bus_id = "ag71xx-mdio.0",
+ .phy_addr = 0,
+ .platform_data = &rb2011_ar8327_data,
+ },
+};
+
+static void __init rb2011_gmac_setup(void)
+{
+ void __iomem *base;
+ u32 t;
+
+ base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE);
+
+ t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG);
+ t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 |
+ AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE);
+ t |= AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE;
+
+ __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG);
+
+ iounmap(base);
+}
+
+static void __init rb2011_setup(void)
+{
+ ath79_register_m25p80(NULL);
+
+ rb2011_gmac_setup();
+
+ ath79_register_mdio(1, 0x0);
+ ath79_register_mdio(0, 0x0);
+
+ mdiobus_register_board_info(rb2011_mdio0_info,
+ ARRAY_SIZE(rb2011_mdio0_info));
+
+ /* GMAC0 is connected to an ar8327 switch */
+ 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_data.mii_bus_dev = &ath79_mdio0_device.dev;
+ ath79_eth0_pll_data.pll_1000 = 0x06000000;
+
+ ath79_register_eth(0);
+
+ /* GMAC1 is connected to the internal switch */
+ ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 5);
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_eth1_data.speed = SPEED_1000;
+ ath79_eth1_data.duplex = DUPLEX_FULL;
+
+ ath79_register_eth(1);
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_2011L, "2011L", "MikroTik RouterBOARD 2011L",
+ rb2011_setup);
diff --git a/target/linux/ar71xx/patches-3.3/613-RB2011-support.patch b/target/linux/ar71xx/patches-3.3/613-RB2011-support.patch
new file mode 100644
index 0000000000..ee16710306
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.3/613-RB2011-support.patch
@@ -0,0 +1,50 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -333,6 +333,11 @@ config ATH79_MACH_RB750
+ select ATH79_DEV_AP9X_PCI if PCI
+ select ATH79_DEV_USB
+
++config ATH79_MACH_RB2011
++ bool "MikroTik RouterBOARD 2011 support"
++ select SOC_AR934x
++ select ATH79_DEV_ETH
++
+ config ATH79_MACH_WNDR3700
+ bool "NETGEAR WNDR3700 board support"
+ select SOC_AR71XX
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -61,6 +61,7 @@ enum ath79_mach_type {
+ ATH79_MACH_RB_750G_R3, /* MikroTik RouterBOARD 750GL */
+ ATH79_MACH_RB_751, /* MikroTik RouterBOARD 751 */
+ ATH79_MACH_RB_751G, /* Mikrotik RouterBOARD 751G */
++ ATH79_MACH_RB_2011L, /* Mikrotik RouterBOARD 2011L */
+ ATH79_MACH_RW2458N, /* Redwave RW2458N */
+ ATH79_MACH_TEW_632BRP, /* TRENDnet TEW-632BRP */
+ ATH79_MACH_TEW_673GRU, /* TRENDnet TEW-673GRU */
+Index: linux-3.3.8/arch/mips/ath79/Makefile
+===================================================================
+--- linux-3.3.8.orig/arch/mips/ath79/Makefile
++++ linux-3.3.8/arch/mips/ath79/Makefile
+@@ -65,6 +65,7 @@ obj-$(CONFIG_ATH79_MACH_PB44) += mach-p
+ obj-$(CONFIG_ATH79_MACH_PB92) += mach-pb92.o
+ obj-$(CONFIG_ATH79_MACH_RB4XX) += mach-rb4xx.o
+ obj-$(CONFIG_ATH79_MACH_RB750) += mach-rb750.o
++obj-$(CONFIG_ATH79_MACH_RB2011) += mach-rb2011.o
+ obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o
+ obj-$(CONFIG_ATH79_MACH_TEW_632BRP) += mach-tew-632brp.o
+ obj-$(CONFIG_ATH79_MACH_TEW_673GRU) += mach-tew-673gru.o
+Index: linux-3.3.8/arch/mips/ath79/prom.c
+===================================================================
+--- linux-3.3.8.orig/arch/mips/ath79/prom.c
++++ linux-3.3.8/arch/mips/ath79/prom.c
+@@ -181,7 +181,8 @@ void __init prom_init(void)
+ }
+ }
+
+- if (strstr(arcs_cmdline, "board=750Gr3"))
++ if (strstr(arcs_cmdline, "board=750Gr3") ||
++ strstr(arcs_cmdline, "board=2011L"))
+ ath79_prom_append_cmdline("console", "ttyS0,115200");
+ }
+