I am trying to get OpenWRT to run on the Mikrotik Routerboard 951, however I have hit a few roadblocks
1.) Wireless ( ath9k does not initialize )
[ 8.210000] ath: phy0: both bands are disabled
[ 8.210000] ath: phy0: Unable to initialize hardware; initialization status: -22
[ 8.210000] ath9k ar933x_wmac: failed to initialize device
[ 8.210000] ath9k: probe of ar933x_wmac failed with error -22
( I'm assuming this has to do with Mikrotik's RLE encryption that was used on the Routerboard 751? )
2.) NAND Flash ( Does not find it )
I'm not sure where to start with the NAND Flash, as you can see in my patchset I had to leave the rb750 AR72XX definitions in there. I realize the AR72XX definitions will not work, as the rb951 has a AR9331 processor. However I am not sure how to figure out which GPIO's are tied to NAND. I'm assuming you can modify the RB750's "enable / disable" pins functions and replace the GPIO's with the AR9331's and it should work?
Any insight on how to get that to work would be very helpful!
3.) Serial UART
For some reason the OpenWRT bootconsole is enabled, and shortly disabled.
"turn off boot console early0"
I am assuming all I need to do is change my kernel command line, is it best to do that in make kernel_menuconfig or somewhere else?
I'm new to this, and i'm simply trying to get the RB951 working on OpenWRT
My progress so far:
Davey-Hutchisons-MacBook-Pro-2:~ idahorazor$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
=== IMPORTANT ============================
Use 'passwd' to set your login password
this will disable telnet and enable SSH
------------------------------------------
BusyBox v1.19.4 (2013-01-29 15:32:39 GMT) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, unknown)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:/# dmesg
[ 0.000000] Linux version 3.7.4 (bluemesh.net) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #7 Tue Jan 29 23:04:27 GMT 2013
[ 0.000000] MyLoader: sysp=0d6376f2, boardp=068213b2, parts=ae01804c
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[ 0.000000] SoC: Atheros AR9330 rev 1
[ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:40.000MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] User-defined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] free_area_init_node: node 0, pgdat 803118c0, node_mem_map 81000000
[ 0.000000] Normal zone: 64 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 8128 pages, LIFO batch:0
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: GPIO_RESET=yes no-uart boot_part_size=4194304 gpio=554690439 HZ=200000000 mem=32M kmac=D4:CA:6D:50:36:56 board=751UL boot=0 mlc=2 console=ttyS0,115200 rootfstype=yaffs noinitrd
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] __ex_table already sorted, skipping sort
[ 0.000000] Writing ErrCtl register=00070001
[ 0.000000] Readback ErrCtl register=00070001
[ 0.000000] Memory: 27508k/32768k available (2156k kernel code, 5260k reserved, 603k data, 1592k init, 0k highmem)
[ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.080000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[ 0.080000] pid_max: default: 32768 minimum: 301
[ 0.080000] Mount-cache hash table entries: 512
[ 0.090000] NET: Registered protocol family 16
[ 0.100000] MIPS: machine is Mikrotik Routerboard 951
[ 0.130000] ar71xx: using random MAC address for eth0
[ 0.360000] bio: create slab <bio-0> at 0
[ 0.360000] Switching to clocksource MIPS
[ 0.370000] NET: Registered protocol family 2
[ 0.370000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.380000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.390000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.390000] TCP: reno registered
[ 0.390000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.400000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.410000] NET: Registered protocol family 1
[ 0.410000] PCI: CLS 0 bytes, default 32
[ 3.210000] yaffs built Jan 29 2013 17:21:54 Installing.
[ 3.210000]
[ 3.210000]
[ 3.210000]
[ 3.210000]
[ 3.210000] YAFFS-WARNING CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED selected.
[ 3.210000]
[ 3.210000]
[ 3.210000]
[ 3.210000] msgmni has been set to 53
[ 3.210000] io scheduler noop registered
[ 3.210000] io scheduler deadline registered (default)
[ 3.220000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 3.230000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[ 3.240000] NAND flash driver for the RouterBOARD 750 version 0.1.0
[ 3.240000] No NAND device found
[ 3.270000] libphy: ag71xx_mdio: probed
[ 3.270000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 3.820000] ag71xx ag71xx.0 eth0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[ 3.830000] TCP: cubic registered
[ 3.830000] NET: Registered protocol family 17
[ 3.840000] 8021q: 802.1Q VLAN Support v1.8
[ 3.840000] turn off boot console early0
[ 3.850000] Please be patient, while OpenWrt loads ...
[ 3.860000] Freeing unused kernel memory: 1592k freed
[ 6.820000] eth0: link up (100Mbps/Full duplex)
[ 7.710000] eth0: link down
[ 7.970000] Compat-drivers backport release: compat-drivers-2013-01-08-3
[ 7.970000] Backport based on wireless-testing.git master-2013-01-07
[ 7.970000] compat.git: wireless-testing.git
[ 8.000000] cfg80211: Calling CRDA to update world regulatory domain
[ 8.000000] cfg80211: World regulatory domain updated:
[ 8.000000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 8.000000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 8.000000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 8.000000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 8.000000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 8.000000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 8.100000] usbcore: registered new interface driver usbfs
[ 8.100000] usbcore: registered new interface driver hub
[ 8.100000] usbcore: registered new device driver usb
[ 8.210000] ath: phy0: both bands are disabled
[ 8.210000] ath: phy0: Unable to initialize hardware; initialization status: -22
[ 8.210000] ath9k ar933x_wmac: failed to initialize device
[ 8.210000] ath9k: probe of ar933x_wmac failed with error -22
[ 8.250000] PPP generic driver version 2.4.2
[ 8.300000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 8.410000] NET: Registered protocol family 24
[ 8.420000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 8.420000] ehci-platform ehci-platform: Generic Platform EHCI Controller
[ 8.420000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 8.450000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[ 8.470000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 8.470000] hub 1-0:1.0: USB hub found
[ 8.470000] hub 1-0:1.0: 1 port detected
[ 8.490000] nf_conntrack version 0.5.0 (454 buckets, 1816 max)
[ 8.720000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 11.820000] device eth0 entered promiscuous mode
[ 12.820000] eth0: link up (100Mbps/Full duplex)
[ 12.820000] br-lan: port 1(eth0) entered forwarding state
[ 12.820000] br-lan: port 1(eth0) entered forwarding state
[ 14.820000] br-lan: port 1(eth0) entered forwarding state
[ 76.820000] eth0: link down
[ 76.820000] br-lan: port 1(eth0) entered disabled state
[ 90.820000] eth0: link up (100Mbps/Full duplex)
[ 90.820000] br-lan: port 1(eth0) entered forwarding state
[ 90.820000] br-lan: port 1(eth0) entered forwarding state
[ 92.820000] br-lan: port 1(eth0) entered forwarding state
root@OpenWrt:/#
My Changes:
+++ linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/mach-rb951.c
@@ -0,0 +1,125 @@
+#include <linux/export.h>
+#include <linux/pci.h>
+#include <linux/ath9k_platform.h>
+#include <linux/platform_device.h>
+#include <linux/phy.h>
+#include <linux/ar8216_platform.h>
+#include <linux/rle.h>
+#include <linux/routerboot.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/irq.h>
+#include <asm/mach-ath79/mach-rb750.h>
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-usb.h"
+#include "dev-eth.h"
+#include "machtypes.h"
+#include "routerboot.h"
+
+#include "dev-wmac.h"
+
+static struct rb7xx_nand_platform_data rb750_nand_data;
+static struct platform_device rb750_nand_device = {
+ .name = "rb750-nand",
+ .id = -1,
+ .dev = {
+ .platform_data = &rb750_nand_data,
+ }
+};
+
+static void rb750_latch_change(u32 mask_clr, u32 mask_set)
+{
+ static DEFINE_SPINLOCK(lock);
+ static u32 latch_set = RB750_LED_BITS | RB750_LVC573_LE;
+ static u32 latch_oe;
+ static u32 latch_clr;
+ unsigned long flags;
+ u32 t;
+
+ spin_lock_irqsave(&lock, flags);
+
+ if ((mask_clr & BIT(31)) != 0 &&
+ (latch_set & RB750_LVC573_LE) == 0) {
+ goto unlock;
+ }
+
+ latch_set = (latch_set | mask_set) & ~mask_clr;
+ latch_clr = (latch_clr | mask_clr) & ~mask_set;
+
+ if (latch_oe == 0)
+ latch_oe = __raw_readl(ath79_gpio_base + AR71XX_GPIO_REG_OE);
+
+ if (likely(latch_set & RB750_LVC573_LE)) {
+ void __iomem *base = ath79_gpio_base;
+
+ t = __raw_readl(base + AR71XX_GPIO_REG_OE);
+ t |= mask_clr | latch_oe | mask_set;
+
+ __raw_writel(t, base + AR71XX_GPIO_REG_OE);
+ __raw_writel(latch_clr, base + AR71XX_GPIO_REG_CLEAR);
+ __raw_writel(latch_set, base + AR71XX_GPIO_REG_SET);
+ } else if (mask_clr & RB750_LVC573_LE) {
+ void __iomem *base = ath79_gpio_base;
+
+ latch_oe = __raw_readl(base + AR71XX_GPIO_REG_OE);
+ __raw_writel(RB750_LVC573_LE, base + AR71XX_GPIO_REG_CLEAR);
+ /* flush write */
+ __raw_readl(base + AR71XX_GPIO_REG_CLEAR);
+ }
+
+unlock:
+ spin_unlock_irqrestore(&lock, flags);
+}
+
+static void rb750_nand_enable_pins(void)
+{
+ rb750_latch_change(RB750_LVC573_LE, 0);
+ ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE,
+ AR724X_GPIO_FUNC_SPI_EN);
+}
+
+static void rb750_nand_disable_pins(void)
+{
+ ath79_gpio_function_setup(AR724X_GPIO_FUNC_SPI_EN,
+ AR724X_GPIO_FUNC_JTAG_DISABLE);
+ rb750_latch_change(0, RB750_LVC573_LE);
+}
+
+static void __init rb951_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ /* disable PHY_SWAP and PHY_ADDR_SWAP bits */
+ ath79_setup_ar933x_phy4_switch(false, false);
+
+ ath79_register_usb();
+
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+
+ ath79_register_mdio(0, 0x0);
+ ath79_register_eth(0);
+ ath79_register_wmac(ee, mac);
+
+ 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);
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_951, "751UL", "Mikrotik Routerboard 951",
+ rb951_setup);
--- /linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/machtypes.h
+++ /linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/machtypes.h
@@ -67,6 +67,7 @@
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_951, /* Mikrotik RouterBOARD 951 */
ATH79_MACH_RB_2011G, /* Mikrotik RouterBOARD 2011UAS-2HnD */
ATH79_MACH_RB_2011L, /* Mikrotik RouterBOARD 2011L */
ATH79_MACH_RW2458N, /* Redwave RW2458N */
--- linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/Kconfig
+++ linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/Kconfig
@@ -337,6 +337,16 @@
select ATH79_ROUTERBOOT
select RLE_DECOMPRESS
+config ATH79_MACH_RB951
+ bool "MikroTik RouterBOARD 951 support"
+ select SOC_AR933X
+ select ATH79_DEV_ETH
+ select ATH79_DEV_GPIO_BUTTONS
+ select ATH79_DEV_LEDS_GPIO
+ select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
+ select ATH79_ROUTERBOOT
+
config ATH79_MACH_RB2011
bool "MikroTik RouterBOARD 2011 support"
select SOC_AR934x
--- linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/Makefile
+++ linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/Makefile
@@ -69,6 +69,7 @@
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_RB951) += mach-rb951.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
--- linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/prom.c
+++ linux-ar71xx_nand/linux-3.7.4/arch/mips/ath79/prom.c
@@ -181,7 +181,9 @@
}
}
- if (strstr(arcs_cmdline, "board=750Gr3") ||
+ if (strstr(arcs_cmdline, "board=751UL") ||
+ strstr(arcs_cmdline, "board=750Gr3") ||
strstr(arcs_cmdline, "board=2011L"))
ath79_prom_append_cmdline("console", "ttyS0,115200");
}
(Last edited by idahorazor on 30 Jan 2013, 21:36)