summaryrefslogtreecommitdiff
path: root/target/linux/at91-2.6/image/u-boot
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/at91-2.6/image/u-boot')
-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
4 files changed, 44 insertions, 3 deletions
diff --git a/target/linux/at91-2.6/image/u-boot/Makefile b/target/linux/at91-2.6/image/u-boot/Makefile
index 35b1e9bff1..6fd667de12 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 0000000000..11ff2a39cb
--- /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 c79260e450..f8ff67cd18 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 228a578a61..3f6c070017 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"
};