Build Help?

Discuss the technical details of Gargoyle and ongoing development

Moderator: Moderators

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Build Help?

Post 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

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post by Statik »

Any way to only build the wzr-hp-g300nh bins instead of all the ax71xx together? It takes forever to compile. :)

Statik

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post 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

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post 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

ispyisail
Moderator
Posts: 5180
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Build Help?

Post 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?

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post 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

ispyisail
Moderator
Posts: 5180
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Build Help?

Post by ispyisail »

I think you will find that you will need to build against Trunk

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post by Statik »

If I knew how, I'd try it. :)

Statik
Posts: 118
Joined: Mon Sep 28, 2009 9:38 am

Re: Build Help?

Post 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

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Build Help?

Post 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.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Post Reply