Added config parameters for u-boot client IP address as well as TFTP server IP address.
authorHamish Guthrie <hcg@openwrt.org>
Thu, 14 Jun 2007 13:46:24 +0000 (13:46 +0000)
committerHamish Guthrie <hcg@openwrt.org>
Thu, 14 Jun 2007 13:46:24 +0000 (13:46 +0000)
SVN-Revision: 7632

target/linux/at91-2.6/image/Config.in
target/linux/at91-2.6/image/u-boot/Makefile
target/linux/at91-2.6/image/u-boot/patches/013-params-in-config.patch [new file with mode: 0644]
target/linux/at91-2.6/image/u-boot/ubclient/Makefile
target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c

index 38ce0acb55ee5ad4de89d3237419264952cad058..6607f6c3259ecb3250e9d7fc3b7b287974460eef 100644 (file)
@@ -1,8 +1,3 @@
-config AT91_ROMBOOT
-       bool "Build romboot loader"
-       depends LINUX_2_6_AT91
-       default y
-
 config AT91_DFBOOT
        bool "Build dataflashboot loader"
        depends LINUX_2_6_AT91
@@ -16,9 +11,25 @@ config AT91_UBOOT
 config UBOOT_TARGET
        string "U-Boot Board Configuration"
        depends LINUX_2_6_AT91
+       depends AT91_UBOOT
        default "vlink"
        help
-         For all supported boards there are reqdy-to-use default
+         For all supported boards there are ready-to-use default
                configurations available; just type "<board_name>".
 
+config UBOOT_IPADDR
+       string "IP Address for U-Boot"
+       depends LINUX_2_6_AT91
+       depends AT91_UBOOT
+       default "192.168.0.178"
+       help
+         IP address of device to be used in U-Boot
+
+config UBOOT_SERVERIP
+       string "IP Address of TFTP server"
+       depends LINUX_2_6_AT91
+       depends AT91_UBOOT
+       default "192.168.0.232"
+       help
+         IP address of TFTP server for U-Boot
 
index 35b1e9bff10bb3196822851104201a6a24a07b59..6fd667de125ce2ce8aca1fea8ca6061e11805aa6 100644 (file)
@@ -22,13 +22,19 @@ PKG_CAT:=bzcat
 include $(INCLUDE_DIR)/package.mk
 
 UBOOT_CONFIG=$(strip $(subst ",, $(CONFIG_UBOOT_TARGET)))
+LAN_IP=$(strip $(CONFIG_UBOOT_IPADDR))
+LAN_SERVERIP=$(strip $(subst ",, $(CONFIG_UBOOT_SERVERIP)))
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIG)_config
        export CROSS_COMPILE=$(TARGET_CROSS); \
+       export LAN_IP=$(LAN_IP); \
+       export LAN_SERVERIP=$(LAN_SERVERIP); \
        $(MAKE) -C $(PKG_BUILD_DIR)
        mkdir -p $(PKG_BUILD_DIR)/ubclient
        $(CP) ./ubclient/* $(PKG_BUILD_DIR)/ubclient
+       export LAN_IP=$(LAN_IP); \
+       export LAN_SERVERIP=$(LAN_SERVERIP); \
        $(MAKE) -C $(PKG_BUILD_DIR)/ubclient \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS) -Dtarget_$(BOARD)=1"
diff --git a/target/linux/at91-2.6/image/u-boot/patches/013-params-in-config.patch b/target/linux/at91-2.6/image/u-boot/patches/013-params-in-config.patch
new file mode 100644 (file)
index 0000000..11ff2a3
--- /dev/null
@@ -0,0 +1,24 @@
+--- u-boot-1.1.4.old/tools/Makefile    2007-06-13 13:35:59.000000000 +0200
++++ u-boot-1.1.4/tools/Makefile        2007-06-14 15:33:04.000000000 +0200
+@@ -153,7 +153,7 @@
+               $(STRIP) $@
+ ubparams.o: ubparams.c
+-              $(CC) -g $(CFLAGS) -c $<
++              $(CC) -g $(CFLAGS) -DLAN_IP=$(LAN_IP) -DLAN_SERVERIP=$(LAN_SERVERIP) -c $<
+ envcrc.o:     envcrc.c
+               $(CC) -g $(CFLAGS) -c $<
+--- u-boot-1.1.4.old/tools/ubparams.c  2007-06-13 13:35:59.000000000 +0200
++++ u-boot-1.1.4/tools/ubparams.c      2007-06-14 15:31:55.000000000 +0200
+@@ -44,8 +44,8 @@
+       "bootargs=setenv bootargs root=/dev/mtdblock3 ro init=/etc/preinit console=/dev/ttyS0,115200,mem=32M\0"
+       "bootcmd=bootm 0xc0042000\0"
+       "ethaddr=00:30:49:00:00:01\0"
+-      "ipaddr=10.0.1.73\0"
+-      "serverip=10.0.1.210\0"
++      "ipaddr=" MK_STR(LAN_IP) "\0"
++      "serverip=" MK_STR(LAN_SERVERIP) "\0"
+       "serial#=MX070205484\0"
+       "\0"
+       };
index c79260e45068796d5a1e329b6738999f2311f3ed..f8ff67cd1874501478aa01540b164d35d8961531 100644 (file)
@@ -6,7 +6,7 @@ crc32.c:
        ln -s ../lib_generic/crc32.c ./
 
 %.o: %.c
-       $(CC) -I ../include $(CFLAGS) $(EXTRA_FLAGS) -c -o $@ $^
+       $(CC) -I ../include $(CFLAGS) $(EXTRA_FLAGS) -DLAN_IP=$(LAN_IP) -DLAN_SERVERIP=$(LAN_SERVERIP) -c -o $@ $^
 
 ubpar: ubpar.o crc32.o
        $(CC) -o $@ $^
index 228a578a6145706c3eeed49dd7061261b94a3591..3f6c0700175e97ee6d8db91fc08f7664b16c8c22 100644 (file)
@@ -29,6 +29,17 @@ extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
 #define ENV_CRC ~0
 #endif
 
+#ifdef LAN_IP
+       #warning LAN_IP
+#else
+       #warning LAN_IP NOT DEFINED
+#endif
+#ifdef LAN_SERVERIP
+       #warning LAN_SERVERIP
+#else
+       #warning LAN_SERVERIP NOT DEFINED
+#endif
+
 static char *environment[] = {
        "bootdelay=3\0"
        "baudrate=115200\0"
@@ -41,8 +52,8 @@ static char *environment[] = {
        "flash=run fbargs; bootm 0xc0042000\0"
        "bootargs=setenv bootargs root=/dev/mtdblock3 ro init=/etc/preinit console=/dev/ttyS0,115200,mem=32M\0"
        "bootcmd=bootm 0xc0042000\0"
-       "ipaddr=10.0.1.73\0"
-       "serverip=10.0.1.210\0"
+       "ipaddr=" MK_STR(LAN_IP) "\0"
+       "serverip=" MK_STR(LAN_SERVERIP) "\0"
        "\0"
        };