1 --- u-boot-1.1.4.old/tools/Makefile 2007-03-22 18:17:25.000000000 +0100
2 +++ u-boot-1.1.4/tools/Makefile 2007-03-22 17:08:46.000000000 +0100
7 -BINS = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
8 +BINS = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX) ubparams$(SFX)
10 -OBJS = environment.o img2srec.o mkimage.o crc32.o envcrc.o gen_eth_addr.o bmp_logo.o
11 +OBJS = environment.o img2srec.o mkimage.o crc32.o envcrc.o gen_eth_addr.o bmp_logo.o ubparams.o
14 BINS += inca-swap-bytes$(SFX)
17 all: .depend $(BINS) $(LOGO_H) subdirs
19 +ubparams$(SFX): ubparams.o crc32.o
20 + $(CC) $(CFLAGS) -o $@ $^
22 envcrc$(SFX): envcrc.o crc32.o environment.o
23 $(CC) $(CFLAGS) -o $@ $^
26 $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
29 +ubparams.o: ubparams.c
30 + $(CC) -g $(CFLAGS) -c $<
33 $(CC) -g $(CFLAGS) -c $<
35 --- u-boot-1.1.4.old/tools/ubparams.c 1970-01-01 01:00:00.000000000 +0100
36 +++ u-boot-1.1.4/tools/ubparams.c 2007-03-22 18:09:52.000000000 +0100
41 + * Generate a u-boot parameter block with correct crc
43 + * (C) 1007 Guthrie Consulting
55 +#define __ASM_STUB_PROCESSOR_H__
58 +#include "environment.h"
60 +#define XMK_STR(x) #x
61 +#define MK_STR(x) XMK_STR(x)
63 +extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
65 +#if !defined(ENV_CRC)
69 +unsigned int env_size = 0x8400;
70 +env_t environment = {
77 + "partitions=mtdparts=AT45DB642.spi0:132k(bootloader),33k(ubparams),99k(spare),1056k(linux),2112k(rootfs),33k(nvram),-(rootfs_data)\0"
78 + "fbargs=setenv bootargs mtdparts=AT45DB642.spi0:132k(bootloader),33k(ubparams),99k(spare),1056k(linux),2112k(rootfs),33k(nvram),-(rootfs_data) root=/dev/mtdblock4 ro init=/etc/preinit console=/dev/ttyS0,115200,mem=32M\0"
79 + "rdba=setenv bootargs mtdparts=AT45DB642.spi0:132k(bootloader),33k(ubparams),99k(spare),1056k(linux),2112k(rootfs),33k(nvram),-(rootfs_data) root=/dev/ram rw initrd=0x21200000,6000000 ramdisk_size=20000 init=/etc/preinit console=/dev/ttyS0,115200,mem=32M\0"
80 + "rdram=run rdba; tftp 21000000 vImage; tftp 21200000 root.squashfs; bootm 21000000\0"
81 + "flash=run fbargs; bootm 0xc0042000\0"
82 + "bootargs=setenv bootargs mtdparts=AT45DB642.spi0:132k(bootloader),33k(ubparams),99k(spare),1056k(linux),2112k(rootfs),33k(nvram),-(rootfs_data) root=/dev/mtdblock4 ro init=/etc/preinit console=/dev/ttyS0,115200,mem=32M\0"
83 + "bootcmd=bootm 0xc0042000\0"
84 + "ethaddr=00:30:49:00:00:01\0"
85 + "ipaddr=10.0.1.73\0"
86 + "serverip=10.0.1.210\0"
87 + "serial#=MX070205484\0"
92 + env_t *envptr, *source;
93 + unsigned char *dataptr;
96 + source = &environment;
97 + envptr = (env_t *)malloc(CFG_ENV_SIZE);
98 + dataptr = (unsigned char *)envptr + ENV_HEADER_SIZE;
100 + printf("Make u-boot params\n");
101 + printf("Params size is %d\n", CFG_ENV_SIZE);
103 + memset(envptr, 0, CFG_ENV_SIZE);
104 + memcpy(envptr, source, sizeof(environment));
106 + envptr->crc = crc32(0, envptr->data, ENV_SIZE);
108 + params = fopen("params", "w");
109 + fwrite(envptr, CFG_ENV_SIZE, 1, params);