Page 1 of 3

Build Help?

Posted: Tue Feb 14, 2012 10:13 pm
by Statik
Hi all,
I'm looking at trying to get gargoyle running on a wzr-hp-g300nh with the rtl8366rb switch instead of the supported rtl8366s switch.

I downloaded and built the latest experimental build and I still have the same failure. The relevant parts seem to be:

Code: Select all

Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)                         
Mount-cache hash table entries: 512                                             
NET: Registered protocol family 16                                              
MIPS: machine is Buffalo WZR-HP-G300NH                                          
Found an RTL8366RB switch                                                       
bio: create slab <bio-0> at 0                                                   
Switching to clocksource MIPS                                                   
NET: Registered protocol family 2  
and

Code: Select all

Atheros AR71xx SPI Controller driver version 0.2.4                              
Realtek RTL8366S ethernet switch driver version 0.2.2                           
rtl8366s rtl8366s: using GPIO pins 19 (SDA) and 20 (SCK)                        
rtl8366s rtl8366s: unknown chip id (0000)                                       
rtl8366s rtl8366s: chip detection failed, err=-19                               
eth0: Atheros AG71xx at 0xb9000000, irq 4
Now I did some preliminary digging (I'm way over my head. :) ) and I found this section of mach-wzr-hp-g300nh.c

Code: Select all

static void __init wzrhpg300nh_setup(void)
{
	u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
	bool hasrtl8366rb = false;

	ar71xx_set_mac_base(eeprom + WZRHPG300NH_MAC_OFFSET);

	if (rtl8366_smi_detect(&wzrhpg300nh_rtl8366_data) == RTL8366_TYPE_RB)
		hasrtl8366rb = true;

	if (hasrtl8366rb) {
		ar71xx_eth0_pll_data.pll_1000 = 0x1f000000;
		ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366rb_device.dev;
		ar71xx_eth1_pll_data.pll_1000 = 0x100;
		ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366rb_device.dev;
	} else {
		ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
		ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
		ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
		ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
	}

	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth0_data.speed = SPEED_1000;
	ar71xx_eth0_data.duplex = DUPLEX_FULL;

	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
	ar71xx_eth1_data.phy_mask = 0x10;

	ar71xx_add_device_eth(0);
	ar71xx_add_device_eth(1);

	ar71xx_add_device_usb();
	ar913x_add_device_wmac(eeprom, NULL);

	platform_device_register(&wzrhpg300nh_74hc153_device);
	platform_device_register(&wzrhpg300nh_flash_device);
	platform_device_register(&wzrhpg300nh_rtl8366s_device);

	ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio),
				    wzrhpg300nh_leds_gpio);

	ar71xx_add_device_gpio_buttons(-1, WZRHPG300NH_BUTTONS_POLL_INTERVAL,
				       ARRAY_SIZE(wzrhpg300nh_gpio_buttons),
				       wzrhpg300nh_gpio_buttons);

}
It looks to me like the script detects the proper chip, but then ignores the detection and sets the device to rtl8366s. I'm going to try building with an rtl8366rb there instead. . .

Statik

Re: Build Help?

Posted: Tue Feb 14, 2012 11:05 pm
by Statik
Any way to only build the wzr-hp-g300nh bins instead of all the ax71xx together? It takes forever to compile. :)

Statik

Re: Build Help?

Posted: Tue Feb 14, 2012 11:22 pm
by Statik
Success! I just uploaded the image and gargoyle is up and running. Haven't had time to test anything, but I have something to work on now!

If anyone wants the tftp image, just let me know. I'm planning on posting it on my website and I'll link it here.

Thanks again!

Statik

Re: Build Help?

Posted: Wed Feb 15, 2012 12:59 am
by Statik
OK, celebrated too early. Everything seems to work fine except for the recognition of the WAN port. Must be a config setting in there somewhere that IDs the WAN port.

Anyone want to let me know what it is? I can't look for a day or two. :(

Thanks!
Statik

Re: Build Help?

Posted: Wed Feb 15, 2012 4:35 am
by ispyisail
If anyone wants the tftp image, just let me know. I'm planning on posting it on my website and I'll link it here.
I'm interested in how you built against OpenWRT Trunk?

Re: Build Help?

Posted: Wed Feb 15, 2012 8:45 am
by Statik
Not building it against the OpenWRT trunk. I followed the developer instructions (http://www.gargoyle-router.com/wiki/dok ... umentation) to download the latest Gargoyle source. When I was looking through the code, I found the section I mentioned above. It appeared that there was a chipset detection script already in the source which was detecting between the rtl8366s and the rtl8366rb but the results were being ignored. I just set the results to rtl8366rb instead of rtl8366s as they were being set in the script.

Now I have to work with getting the WAN port recognized.

Statik

Re: Build Help?

Posted: Wed Feb 15, 2012 1:32 pm
by ispyisail
I think you will find that you will need to build against Trunk

Re: Build Help?

Posted: Wed Feb 15, 2012 5:29 pm
by Statik
If I knew how, I'd try it. :)

Re: Build Help?

Posted: Sat Feb 18, 2012 8:13 pm
by Statik
OK, I managed to make the appropriate changes and get gargoyle to make with trunk, unfortunately, it errors out. I haven't been able to figure out why. It seems to be above my level. I'd rather look at why backport is failing on WAN.

I took a look at the boot process (over serial) and I noticed this section:

Code: Select all

Atheros AR71xx SPI Controller driver version 0.2.4
Realtek RTL8366RB ethernet switch driver version 0.2.3
rtl8366rb rtl8366rb: using GPIO pins 19 (SDA) and 20 (SCK)
rtl8366rb rtl8366rb: RTL5937 ver. 3 chip found
rtl8366rb: probed                                         
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: could not connect to PHY at rtl8366rb:04
ag71xx: probe of ag71xx.1 failed with error -22
Atheros AR71xx hardware watchdog driver version 0.1.0
So I went searching through the OpenWRT forums and I found the problem described and fixed. I manually applied the patch found here: https://dev.openwrt.org/changeset/26600 , recompiled and did a firmware update right from the gargoyle gui.

Success again! I now have both eth1 and eth0 working. The WAN and the LAN work fine. Wireless is up and running. I still have some feature testing to do, but its looking good!

Statik

Re: Build Help?

Posted: Sun Feb 19, 2012 6:41 am
by pbix
Could you issue a patch that shows all the things you did to get this to work? Just attach it to your next post.

It may be it can be incorporated into Gargoyle at least until someone over at OpenWRT backports this fix into Backfire.