summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHamish Guthrie <hcg@openwrt.org>2007-06-14 13:46:24 +0000
committerHamish Guthrie <hcg@openwrt.org>2007-06-14 13:46:24 +0000
commitff17ac5ec3a0a27a7a4e183788efa37d1090cdef (patch)
tree3167a77db51612b10bb9b72c6d6bac0439a750f2
parent8ed6f003520655bef682a07cb8f56250935233d4 (diff)
downloadmtk-20170518-ff17ac5ec3a0a27a7a4e183788efa37d1090cdef.zip
mtk-20170518-ff17ac5ec3a0a27a7a4e183788efa37d1090cdef.tar.gz
mtk-20170518-ff17ac5ec3a0a27a7a4e183788efa37d1090cdef.tar.bz2
Added config parameters for u-boot client IP address as well as TFTP server IP address.
SVN-Revision: 7632
-rw-r--r--target/linux/at91-2.6/image/Config.in23
-rw-r--r--target/linux/at91-2.6/image/u-boot/Makefile6
-rw-r--r--target/linux/at91-2.6/image/u-boot/patches/013-params-in-config.patch24
-rw-r--r--target/linux/at91-2.6/image/u-boot/ubclient/Makefile2
-rw-r--r--target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c15
5 files changed, 61 insertions, 9 deletions
diff --git a/target/linux/at91-2.6/image/Config.in b/target/linux/at91-2.6/image/Config.in
index 38ce0ac..6607f6c 100644
--- a/target/linux/at91-2.6/image/Config.in
+++ b/target/linux/at91-2.6/image/Config.in
@@ -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
diff --git a/target/linux/at91-2.6/image/u-boot/Makefile b/target/linux/at91-2.6/image/u-boot/Makefile
index 35b1e9b..6fd667d 100644
--- a/target/linux/at91-2.6/image/u-boot/Makefile
+++ b/target/linux/at91-2.6/image/u-boot/Makefile
@@ -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
index 0000000..11ff2a3
--- /dev/null
+++ b/target/linux/at91-2.6/image/u-boot/patches/013-params-in-config.patch
@@ -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"
+ };
diff --git a/target/linux/at91-2.6/image/u-boot/ubclient/Makefile b/target/linux/at91-2.6/image/u-boot/ubclient/Makefile
index c79260e..f8ff67c 100644
--- a/target/linux/at91-2.6/image/u-boot/ubclient/Makefile
+++ b/target/linux/at91-2.6/image/u-boot/ubclient/Makefile
@@ -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 $@ $^
diff --git a/target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c b/target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c
index 228a578..3f6c070 100644
--- a/target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c
+++ b/target/linux/at91-2.6/image/u-boot/ubclient/ubpar.c
@@ -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"
};