Build original u-boot for Netgear WNDR3800

Hello everyone, I'm trying to build the original u-boot for Netgear WNDR3800.

I've checked every GPL archives from Netgear.
There is only two directories in u-boot/board/ar7100: common and hw29763654p16p128 since 1.0.0.24, so I assumed that hw29763654p16p128 is the build target.

After some fixes:

u-boot/board/ar7100/hw29763654p16p128/hw29763654p16p128_pci.c

 static int  ar7100_local_read_config(int where, int size, uint32_t *value);
 static int  ar7100_local_write_config(int where, int size, uint32_t value);
+static int  ar7100_pci_read_config(struct pci_controller *hose, pci_dev_t dev, int offset, u32* value);
+static int  ar7100_pci_write_config(struct pci_controller *hose, pci_dev_t dev, int offset, u32 value);

u-boot/mips_config.mk

-PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
+PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ -fPIC

I'm able to build it using the OpenWrt SDK [OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2]:

export BUILD_TOPDIR=`pwd`
export STAGING_DIR=$BUILD_TOPDIR/tmp
make hw29763654p16p128_config
make CROSS_COMPILE=mips-openwrt-linux-

The uboot.bin is generated.
To make sure that it won't brick my device, I have checked the code.
There is something really strange to me in u-boot/include/configs/hw29763654p16p128.h:

81: #define CONFIG_BOOTARGS_FL     "console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ar7100-nor0:256k(uboot),128k(env),6144k(rootfs),64k(caldata),1024k(uImage)"
82:
83: #define MTDPARTS_DEFAULT    "mtdparts=ar7100-nor0:256k(u-boot),128k(env),6144k(rootfs),64k(caldata),1024k(uImage)"
84: #define MTDIDS_DEFAULT      "nor0=ar7100-nor0"

As far as I know, for WNDR3800 the u-boot size should be 320k:

cat /proc/cmdline

board=WNDR3700 mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd

What's wrong? Or I can safely ignore it? Any help appreciated.

Regards,
Jiawei

(Last edited by Jiawei on 23 Mar 2017, 07:25)