Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
f54ebdfa
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f54ebdfa
编写于
9月 17, 2003
作者:
W
wdenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add auto-update code for TRAB board using USB memory sticks
上级
34b3049a
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
486 addition
and
52 deletion
+486
-52
CHANGELOG
CHANGELOG
+2
-0
Makefile
Makefile
+5
-5
board/trab/Makefile
board/trab/Makefile
+1
-1
board/trab/auto_update.c
board/trab/auto_update.c
+414
-0
board/trab/cmd_trab.c
board/trab/cmd_trab.c
+8
-8
board/trab/trab.c
board/trab/trab.c
+6
-0
common/usb_storage.c
common/usb_storage.c
+1
-1
cpu/arm920t/serial.c
cpu/arm920t/serial.c
+1
-1
include/configs/IceCube.h
include/configs/IceCube.h
+1
-0
include/configs/trab.h
include/configs/trab.h
+47
-36
未找到文件。
CHANGELOG
浏览文件 @
f54ebdfa
...
...
@@ -2,6 +2,8 @@
Changes for U-Boot 1.0.0:
======================================================================
* Add auto-update code for TRAB board using USB memory sticks
* disable MPC5200 bus pipelining as workaround for bus contention
* Modify XLB arbiter priorities on MPC5200 so all devices use same
...
...
Makefile
浏览文件 @
f54ebdfa
...
...
@@ -796,7 +796,7 @@ shannon_config : unconfig
## ARM92xT Systems
#########################################################################
xtract_trab
=
$(
subst
_
big_flash
,,
$(
subst
_config,,
$1
))
xtract_trab
=
$(
subst
_
old
,,
$(
subst
_config,,
$1
))
omap1510inn_config
:
unconfig
@
./mkconfig
$
(
@:_config
=)
arm arm925t omap1510inn
...
...
@@ -811,11 +811,11 @@ smdk2410_config : unconfig
@
./mkconfig
$
(
@:_config
=)
arm arm920t smdk2410
trab_config
\
trab_
big_flash
_config
:
unconfig
trab_
old
_config
:
unconfig
@
>
include/config.h
@
[
-z
"
$(
findstring
_
big_flash
,
$@
)
"
]
||
\
{
echo
"#define CONFIG_
BIG_FLASH
"
>>
include/config.h
;
\
echo
"... with
big flash support
"
;
\
@
[
-z
"
$(
findstring
_
old
,
$@
)
"
]
||
\
{
echo
"#define CONFIG_
OLD_VERSION
"
>>
include/config.h
;
\
echo
"... with
small memory configuration
"
;
\
}
@
./mkconfig
-a
$(
call
xtract_trab,
$@
)
arm arm920t trab
...
...
board/trab/Makefile
浏览文件 @
f54ebdfa
...
...
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
LIB
=
lib
$(BOARD)
.a
OBJS
:=
trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o
OBJS
:=
trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o
auto_update.o
SOBJS
:=
memsetup.o
gcclibdir
:=
$(
shell
dirname
`
$(CC)
-print-libgcc-file-name
`
)
...
...
board/trab/auto_update.c
0 → 100644
浏览文件 @
f54ebdfa
/*
* (C) Copyright 2003
* Gary Jennejohn, DENX Software Engineering, gj@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <command.h>
#include <malloc.h>
#include <image.h>
#include <asm/byteorder.h>
#include <usb.h>
#ifdef CFG_HUSH_PARSER
#include <hush.h>
#endif
#ifdef CONFIG_AUTO_UPDATE
#ifndef CONFIG_USB_OHCI
#error "must define CONFIG_USB_OHCI"
#endif
#ifndef CONFIG_USB_STORAGE
#error "must define CONFIG_USB_STORAGE"
#endif
#ifndef CFG_HUSH_PARSER
#error "must define CFG_HUSH_PARSER"
#endif
#if !(CONFIG_COMMANDS & CFG_CMD_FAT)
#error "must define CFG_CMD_FAT"
#endif
/*
* Check whether a USB memory stick is plugged in.
* If one is found:
* 1) try to do an MSDOS ls
* 2) if preinst.img is found and is not 0 length, load it into
* memory and run it (how to check beforehand if it's a
* valid HUSH command file?)
* 3)
* 4)
* 5)
* 6)
* 7)
* 8)
* 9)
* 10)
* 11)
* 12)
*/
#undef AU_DEBUG
#undef debug
#ifdef AU_DEBUG
#define debug(fmt,args...) printf (fmt ,##args)
#else
#define debug(fmt,args...)
#endif
/* AU_DEBUG */
/* possible names of files on the USB stick. */
#define AU_PREPARE "prepare.img"
#define AU_PREINST "preinst.img"
#define AU_FIRMWARE "firmware.img"
#define AU_KERNEL "kernel.img"
#define AU_APP "app.img"
#define AU_DISK "disk.img"
#define AU_POSTINST "postinst.img"
/* layout of the FLASH. ST = start address, ND = end address. */
#ifndef CONFIG_OLD_VERSION
/* 16 MB Flash, 32 MB RAM */
#define AU_FL_FIRMWARE_ST 0x00000000
#define AU_FL_FIRMWARE_ND 0x0009FFFF
#define AU_FL_VFD_ST 0x000A0000
#define AU_FL_VFD_ND 0x000BFFFF
#define AU_FL_KERNEL_ST 0x000C0000
#define AU_FL_KERNEL_ND 0x001BFFFF
#define AU_FL_APP_ST 0x001C0000
#define AU_FL_APP_ND 0x005BFFFF
#define AU_FL_DISK_ST 0x005C0000
#define AU_FL_DISK_ND 0x00FFFFFF
#else
/* 8 MB Flash, 16 MB RAM */
#define AU_FL_FIRMWARE_ST 0x00000000
#define AU_FL_FIRMWARE_ND 0x0003FFFF
#define AU_FL_KERNEL_ST 0x00040000
#define AU_FL_KERNEL_ND 0x0011FFFF
#define AU_FL_APP_ST 0x00120000
#define AU_FL_APP_ND 0x003FFFFF
#define AU_FL_DISK_ST 0x00400000
#define AU_FL_DISK_ND 0x007DFFFF
#define AU_FL_VFD_ST 0x007E0000
#define AU_FL_VFD_ND 0x007FFFFF
#endif
/* CONFIG_OLD_VERSION */
/* a structure with the offsets to values in the EEPROM */
struct
eeprom_layout
{
unsigned
int
time
;
unsigned
int
size
;
unsigned
int
dcrc
;
};
/* layout of the EEPROM - offset from the start. All entries are 32 bit. */
#define AU_EEPROM_TIME_PREINST 64
#define AU_EEPROM_SIZE_PREINST 68
#define AU_EEPROM_DCRC_PREINST 72
#define AU_EEPROM_TIME_FIRMWARE 76
#define AU_EEPROM_SIZE_FIRMWARE 80
#define AU_EEPROM_DCRC_FIRMWARE 84
#define AU_EEPROM_TIME_KERNEL 88
#define AU_EEPROM_SIZE_KERNEL 92
#define AU_EEPROM_DCRC_KERNEL 96
#define AU_EEPROM_TIME_APP 100
#define AU_EEPROM_SIZE_APP 104
#define AU_EEPROM_DCRC_APP 108
#define AU_EEPROM_TIME_DISK 112
#define AU_EEPROM_SIZE_DISK 116
#define AU_EEPROM_DCRC_DISK 120
#define AU_EEPROM_TIME_POSTINST 124
#define AU_EEPROM_SIZE_POSTINST 128
#define AU_EEPROM_DCRC_POSTINST 132
static
int
au_usb_stor_curr_dev
;
/* current device */
/* max. number of files which could interest us */
#define AU_MAXFILES 7
/* pointers to file names */
char
*
aufile
[
AU_MAXFILES
];
/* sizes of flash areas for each file */
long
ausize
[
AU_MAXFILES
];
/* offsets into the EEEPROM */
struct
eeprom_layout
auee_off
[
AU_MAXFILES
]
=
{
\
{
0
},
\
{
AU_EEPROM_TIME_PREINST
,
AU_EEPROM_SIZE_PREINST
,
AU_EEPROM_DCRC_PREINST
,},
\
{
AU_EEPROM_TIME_FIRMWARE
,
AU_EEPROM_SIZE_FIRMWARE
,
AU_EEPROM_DCRC_FIRMWARE
,},
\
{
AU_EEPROM_TIME_KERNEL
,
AU_EEPROM_SIZE_KERNEL
,
AU_EEPROM_DCRC_KERNEL
,},
\
{
AU_EEPROM_TIME_APP
,
AU_EEPROM_SIZE_APP
,
AU_EEPROM_DCRC_APP
,},
\
{
AU_EEPROM_TIME_DISK
,
AU_EEPROM_SIZE_DISK
,
AU_EEPROM_DCRC_DISK
,},
\
{
AU_EEPROM_TIME_POSTINST
,
AU_EEPROM_SIZE_POSTINST
,
AU_EEPROM_DCRC_POSTINST
,}
\
};
/* index of each file in the above array */
#define IDX_PREPARE 0
#define IDX_PREINST 1
#define IDX_FIRMWARE 2
#define IDX_KERNEL 3
#define IDX_APP 4
#define IDX_DISK 5
#define IDX_POSTINST 6
/* where to load files into memory */
#define LOAD_ADDR ((unsigned char *)0x0c100000)
/* the disk is the largest image */
#define MAX_LOADSZ ausize[IDX_DISK]
/* externals */
extern
int
fat_register_device
(
block_dev_desc_t
*
,
int
);
extern
int
file_fat_detectfs
(
void
);
extern
long
file_fat_read
(
const
char
*
,
void
*
,
unsigned
long
);
extern
int
i2c_read
(
unsigned
char
,
unsigned
int
,
int
,
unsigned
char
*
,
int
);
extern
int
i2c_write
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
#ifdef CONFIG_VFD
extern
int
trab_vfd
(
ulong
);
extern
int
transfer_pic
(
unsigned
char
,
unsigned
char
*
,
int
,
int
);
#endif
extern
int
i2c_write_multiple
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
extern
int
i2c_read_multiple
(
uchar
,
uint
,
int
,
uchar
*
,
int
);
int
au_check_valid
(
int
idx
,
long
nbytes
)
{
image_header_t
*
hdr
;
unsigned
long
checksum
;
unsigned
char
buf
[
4
];
hdr
=
(
image_header_t
*
)
LOAD_ADDR
;
/* check the easy ones first */
#ifdef CHECK_VALID_DEBUG
printf
(
"magic %#x %#x "
,
ntohl
(
hdr
->
ih_magic
),
IH_MAGIC
);
printf
(
"arch %#x %#x "
,
hdr
->
ih_arch
,
IH_CPU_ARM
);
printf
(
"size %#x %#lx "
,
ntohl
(
hdr
->
ih_size
),
nbytes
);
printf
(
"type %#x %#x "
,
hdr
->
ih_type
,
IH_TYPE_KERNEL
);
#endif
if
(
ntohl
(
hdr
->
ih_magic
)
!=
IH_MAGIC
||
hdr
->
ih_arch
!=
IH_CPU_ARM
||
nbytes
<
ntohl
(
hdr
->
ih_size
))
{
printf
(
"Image %s Bad MAGIC or ARCH or SIZE
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
/* check the hdr CRC */
checksum
=
ntohl
(
hdr
->
ih_hcrc
);
hdr
->
ih_hcrc
=
0
;
if
(
crc32
(
0
,
(
char
*
)
hdr
,
sizeof
(
*
hdr
))
!=
checksum
)
{
printf
(
"Image %s Bad Header Checksum
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
/* check the data CRC */
checksum
=
ntohl
(
hdr
->
ih_dcrc
);
if
(
crc32
(
0
,
(
char
*
)(
LOAD_ADDR
+
sizeof
(
*
hdr
)),
ntohl
(
hdr
->
ih_size
))
!=
checksum
)
{
printf
(
"Image %s Bad Data Checksum
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
/* check the type - could do this all in one gigantic if() */
if
((
idx
==
IDX_FIRMWARE
)
&&
(
hdr
->
ih_type
!=
IH_TYPE_FIRMWARE
))
{
printf
(
"Image %s Wrong Type
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
if
((
idx
==
IDX_KERNEL
)
&&
(
hdr
->
ih_type
!=
IH_TYPE_KERNEL
))
{
printf
(
"Image %s Wrong Type
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
if
((
idx
==
IDX_DISK
||
idx
==
IDX_APP
)
&&
(
hdr
->
ih_type
!=
IH_TYPE_RAMDISK
))
{
printf
(
"Image %s Wrong Type
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
if
((
idx
==
IDX_PREPARE
||
idx
==
IDX_PREINST
||
idx
==
IDX_POSTINST
)
&&
(
hdr
->
ih_type
!=
IH_TYPE_SCRIPT
))
{
printf
(
"Image %s Wrong Type
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
/* special case for prepare.img */
if
(
idx
==
IDX_PREPARE
)
return
0
;
/* check the size does not exceed space in flash */
if
((
ausize
[
idx
]
!=
0
)
&&
(
ausize
[
idx
]
<
ntohl
(
hdr
->
ih_size
)))
{
printf
(
"Image %s is bigger than FLASH
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
/* check the time stamp from the EEPROM */
/* read it in */
i2c_read_multiple
(
0x54
,
auee_off
[
idx
].
time
,
1
,
buf
,
sizeof
(
buf
));
#ifdef CHECK_VALID_DEBUG
printf
(
"buf[0] %#x buf[1] %#x buf[2] %#x buf[3] %#x as int %#x time %#x
\n
"
,
buf
[
0
],
buf
[
1
],
buf
[
2
],
buf
[
3
],
*
((
unsigned
int
*
)
buf
),
ntohl
(
hdr
->
ih_time
));
#endif
/* check it */
if
(
*
((
unsigned
int
*
)
buf
)
>=
ntohl
(
hdr
->
ih_time
))
{
printf
(
"Image %s is too old
\n
"
,
aufile
[
idx
]);
return
-
1
;
}
return
0
;
}
/* power control defines */
#define CPLD_VFD_BK ((volatile char *)0x04038002)
#define POWER_OFF (1 << 1)
int
au_do_update
(
int
idx
)
{
image_header_t
*
hdr
;
char
*
addr
;
hdr
=
(
image_header_t
*
)
LOAD_ADDR
;
/* disable the power switch */
*
CPLD_VFD_BK
|=
POWER_OFF
;
/* execute a script */
if
(
hdr
->
ih_type
==
IH_TYPE_SCRIPT
)
{
addr
=
(
char
*
)((
char
*
)
hdr
+
sizeof
(
*
hdr
)
+
8
);
parse_string_outer
(
addr
,
FLAG_PARSE_SEMICOLON
|
FLAG_EXIT_FROM_LOOP
);
return
0
;
}
return
0
;
}
int
au_update_eeprom
(
int
idx
)
{
image_header_t
*
hdr
;
hdr
=
(
image_header_t
*
)
LOAD_ADDR
;
/* enable the power switch */
*
CPLD_VFD_BK
&=
~
POWER_OFF
;
return
0
;
}
/*
* this is called from board_init() after the hardware has been set up
* and is usable. That seems like a good time to do this.
* Right now the return value is ignored.
*/
int
do_auto_update
(
void
)
{
block_dev_desc_t
*
stor_dev
;
long
sz
;
int
i
,
res
,
bitmap_first
;
char
*
env
;
#ifdef ERASE_EEPROM
int
arr
[
18
];
memset
(
arr
,
0
,
sizeof
(
arr
));
i2c_write_multiple
(
0x54
,
64
,
1
,
arr
,
sizeof
(
arr
));
#endif
au_usb_stor_curr_dev
=
-
1
;
/* start USB */
if
(
usb_stop
()
<
0
)
{
debug
(
"usb_stop failed
\n
"
);
return
-
1
;
}
if
(
usb_init
()
<
0
)
{
debug
(
"usb_init failed
\n
"
);
return
-
1
;
}
/*
* check whether a storage device is attached (assume that it's
* a USB memory stick, since nothing else should be attached).
*/
au_usb_stor_curr_dev
=
usb_stor_scan
(
1
);
if
(
au_usb_stor_curr_dev
==
-
1
)
{
debug
(
"No device found. Not initialized?
\n
"
);
return
-
1
;
}
/* check whether it has a partition table */
stor_dev
=
usb_stor_get_dev
(
au_usb_stor_curr_dev
);
if
(
stor_dev
->
type
==
DEV_TYPE_UNKNOWN
)
{
debug
(
"uknown device type
\n
"
);
return
-
1
;
}
if
(
fat_register_device
(
stor_dev
,
1
)
!=
0
)
{
debug
(
"Unable to use USB %d:%d for fatls
\n
"
,
au_usb_stor_curr_dev
,
1
);
return
-
1
;
}
if
(
file_fat_detectfs
()
!=
0
)
{
debug
(
"file_fat_detectfs failed
\n
"
);
}
/* initialize the array of file names */
memset
(
aufile
,
0
,
sizeof
(
aufile
));
aufile
[
IDX_PREPARE
]
=
AU_PREPARE
;
aufile
[
IDX_PREINST
]
=
AU_PREINST
;
aufile
[
IDX_FIRMWARE
]
=
AU_FIRMWARE
;
aufile
[
IDX_KERNEL
]
=
AU_KERNEL
;
aufile
[
IDX_APP
]
=
AU_APP
;
aufile
[
IDX_DISK
]
=
AU_DISK
;
aufile
[
IDX_POSTINST
]
=
AU_POSTINST
;
/* initialize the array of flash sizes */
memset
(
ausize
,
0
,
sizeof
(
ausize
));
ausize
[
IDX_FIRMWARE
]
=
(
AU_FL_FIRMWARE_ND
+
1
)
-
AU_FL_FIRMWARE_ST
;
ausize
[
IDX_KERNEL
]
=
(
AU_FL_KERNEL_ND
+
1
)
-
AU_FL_KERNEL_ST
;
ausize
[
IDX_APP
]
=
(
AU_FL_APP_ND
+
1
)
-
AU_FL_APP_ST
;
ausize
[
IDX_DISK
]
=
(
AU_FL_DISK_ND
+
1
)
-
AU_FL_DISK_ST
;
bitmap_first
=
0
;
/* just loop thru all the possible files */
for
(
i
=
0
;
i
<
AU_MAXFILES
;
i
++
)
{
sz
=
file_fat_read
(
aufile
[
i
],
LOAD_ADDR
,
MAX_LOADSZ
);
debug
(
"read %s sz %ld hdr %d
\n
"
,
aufile
[
i
],
sz
,
sizeof
(
image_header_t
));
if
(
sz
<=
0
||
sz
<=
sizeof
(
image_header_t
))
{
debug
(
"%s not found
\n
"
,
aufile
[
i
]);
continue
;
}
if
(
au_check_valid
(
i
,
sz
)
<
0
)
{
debug
(
"%s not valid
\n
"
,
aufile
[
i
]);
continue
;
}
#ifdef CONFIG_VFD
/* now that we have a valid file we can display the */
/* bitmap. */
if
(
bitmap_first
==
0
)
{
env
=
getenv
(
"bitmap2"
);
if
(
env
==
NULL
)
{
trab_vfd
(
0
);
}
else
{
/* not so simple - bitmap2 is supposed to */
/* contain the address of the bitmap */
env
=
(
char
*
)
simple_strtoul
(
env
,
NULL
,
16
);
/* NOTE: these are taken from vfd_logo.h. If that file changes then */
/* these defines MUST also be updated! These may be wrong for bitmap2. */
#define VFD_LOGO_WIDTH 112
#define VFD_LOGO_HEIGHT 72
/* must call transfer_pic directly */
transfer_pic
(
3
,
env
,
VFD_LOGO_HEIGHT
,
VFD_LOGO_WIDTH
);
}
bitmap_first
=
1
;
}
#endif
/* this is really not a good idea, but it's what the */
/* customer wants. */
do
{
res
=
au_do_update
(
i
);
}
while
(
res
<
0
);
au_update_eeprom
(
i
);
}
return
0
;
}
#endif
/* CONFIG_AUTO_UPDATE */
board/trab/cmd_trab.c
浏览文件 @
f54ebdfa
...
...
@@ -111,6 +111,10 @@ int do_vcc5v (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
int
do_burn_in
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[]);
int
do_contact_temp
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[]);
int
do_burn_in_status
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[]);
int
i2c_write_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
);
int
i2c_read_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
);
/* helper functions */
static
void
adc_init
(
void
);
...
...
@@ -123,10 +127,6 @@ static int test_rotary_switch (void);
static
int
test_sram
(
void
);
static
int
test_eeprom
(
void
);
static
int
test_contact_temp
(
void
);
static
int
i2c_write_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
);
static
int
i2c_read_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
);
static
void
led_set
(
unsigned
int
);
static
void
led_blink
(
void
);
static
void
led_init
(
void
);
...
...
@@ -579,7 +579,7 @@ static int test_contact_temp (void)
}
static
int
i2c_write_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
int
i2c_write_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
{
int
i
;
...
...
@@ -608,7 +608,7 @@ static int i2c_write_multiple (uchar chip, uint addr, int alen,
}
static
int
i2c_read_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
int
i2c_read_multiple
(
uchar
chip
,
uint
addr
,
int
alen
,
uchar
*
buffer
,
int
len
)
{
int
i
;
...
...
board/trab/trab.c
浏览文件 @
f54ebdfa
...
...
@@ -169,6 +169,12 @@ int misc_init_r (void)
uchar
*
str
;
int
i
;
#ifdef CONFIG_AUTO_UPDATE
extern
int
do_auto_update
(
void
);
/* this has priority over all else */
do_auto_update
();
#endif
for
(
i
=
0
;
i
<
KEYBD_KEY_NUM
;
++
i
)
{
keybd_env
[
i
]
=
'0'
+
((
kbd_data
>>
i
)
&
1
);
}
...
...
common/usb_storage.c
浏览文件 @
f54ebdfa
...
...
@@ -188,7 +188,7 @@ int usb_stor_scan(int mode)
memset
(
usb_stor_buf
,
0
,
sizeof
(
usb_stor_buf
));
if
(
mode
==
1
)
{
printf
(
"scanning bus for storage devices...
\n
"
);
printf
(
"
scanning bus for storage devices...
\n
"
);
}
usb_disable_asynch
(
1
);
/* asynch transfer not allowed */
...
...
cpu/arm920t/serial.c
浏览文件 @
f54ebdfa
...
...
@@ -30,7 +30,7 @@
#elif CONFIG_SERIAL2
# if defined(CONFIG_TRAB)
#
#
error "TRAB supports only CONFIG_SERIAL1"
# error "TRAB supports only CONFIG_SERIAL1"
# endif
#define UART_NR S3C24X0_UART1
...
...
include/configs/IceCube.h
浏览文件 @
f54ebdfa
...
...
@@ -71,6 +71,7 @@
#define CONFIG_NET_MULTI 1
#define CONFIG_EEPRO100 1
#define CFG_RX_ETH_BUFFER 8
/* use 8 rx buffer on eepro100 */
#define CONFIG_NS8382X 1
#define ADD_PCI_CMD CFG_CMD_PCI
...
...
include/configs/trab.h
浏览文件 @
f54ebdfa
...
...
@@ -42,6 +42,9 @@
#undef CONFIG_TRAB_50MHZ
/* run the CPU at 50 MHz */
#define LITTLEENDIAN 1
/* used by usb_ohci.c */
/* automatic software updates (see board/trab/auto_update.c) */
#define CONFIG_AUTO_UPDATE 1
/* input clock of PLL */
#define CONFIG_SYS_CLK_FREQ 12000000
/* TRAB has 12 MHz input clock */
...
...
@@ -176,7 +179,7 @@
#define CONFIG_SERVERIP 192.168.3.1
#define CONFIG_BOOTCOMMAND "run flash_nfs"
#ifndef CONFIG_
BIG_FLASH
#ifndef CONFIG_
OLD_VERSION
/* current config: 16 MB flash, 32 MB RAM */
#ifdef CFG_HUSH_PARSER
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
...
...
@@ -186,14 +189,15 @@
"add_net=setenv bootargs $bootargs ethaddr=$ethaddr " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off\0" \
"add_misc=setenv bootargs $bootargs console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0-8;era 1:0-8;cp.b 0xc100000 0 $filesize;" \
"setenv filesize;saveenv\0" \
"u-boot=/tftpboot/TRAB/u-boot.bin\0" \
"load=tftp C100000 ${u-boot}\0" \
"update=protect off 0 5FFFF;era 0 5FFFF;" \
"cp.b C100000 0 $filesize\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=c400000\0" \
"net_load=tftpboot $loadaddr $loadfile\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=000
4
0000\0" \
"kernel_addr=000
C
0000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $kernel_addr\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
...
...
@@ -207,20 +211,21 @@
"add_net=setenv bootargs $(bootargs) ethaddr=$(ethaddr) " \
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off\0" \
"add_misc=setenv bootargs $(bootargs) console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0-8;era 1:0-8;cp.b 0xc100000 0 $(filesize);" \
"setenv filesize;saveenv\0" \
"u-boot=/tftpboot/TRAB/u-boot.bin\0" \
"load=tftp C100000 $(u-boot)\0" \
"update=protect off 0 5FFFF;era 0 5FFFF;" \
"cp.b C100000 0 $(filesize)\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=c400000\0" \
"net_load=tftpboot $(loadaddr) $(loadfile)\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=000
4
0000\0" \
"kernel_addr=000
C
0000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $(kernel_addr)\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#endif
/* CFG_HUSH_PARSER */
#else
/* CONFIG_BIG_FLASH
*/
#else
/* CONFIG_OLD_VERSION => 8 MB flash, 16 MB RAM
*/
#ifdef CFG_HUSH_PARSER
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
...
...
@@ -230,13 +235,16 @@
"add_net=setenv bootargs $bootargs ethaddr=$ethaddr " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off\0" \
"add_misc=setenv bootargs $bootargs console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0;era 1:0;cp.b 0xc100000 0 $filesize\0" \
"u-boot=/tftpboot/TRAB/u-boot.bin-old\0" \
"load=tftp C100000 ${u-boot}\0" \
"update=protect off 0 3FFFF;era 0 3FFFF;" \
"cp.b C100000 0 $filesize;" \
"setenv filesize;saveenv\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=
c
400000\0" \
"loadaddr=
C
400000\0" \
"net_load=tftpboot $loadaddr $loadfile\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=000
4
0000\0" \
"kernel_addr=000
C
0000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $kernel_addr\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
...
...
@@ -250,19 +258,22 @@
"add_net=setenv bootargs $(bootargs) ethaddr=$(ethaddr) " \
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off\0" \
"add_misc=setenv bootargs $(bootargs) console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0;era 1:0;cp.b 0xc100000 0 $(filesize)\0" \
"u-boot=/tftpboot/TRAB/u-boot.bin-old\0" \
"load=tftp C100000 $(u-boot)\0" \
"update=protect off 0 3FFFF;era 0 3FFFF;" \
"cp.b C100000 0 $(filesize);" \
"setenv filesize;saveenv\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=
c
400000\0" \
"loadaddr=
C
400000\0" \
"net_load=tftpboot $(loadaddr) $(loadfile)\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=000
4
0000\0" \
"kernel_addr=000
C
0000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $(kernel_addr)\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#endif
/* CFG_HUSH_PARSER */
#endif
/* CONFIG_
BIG_FLASH
*/
#endif
/* CONFIG_
OLD_VERSION
*/
#if 0 /* disabled for development */
#define CONFIG_AUTOBOOT_KEYED /* Enable password protection */
...
...
@@ -290,12 +301,12 @@
#define CFG_MAXARGS 16
/* max number of command args */
#define CFG_BARGSIZE CFG_CBSIZE
/* Boot Argument Buffer Size */
#define CFG_MEMTEST_START 0x0
c
000000
/* memtest works on */
#define CFG_MEMTEST_END 0x0
d
000000
/* 16 MB in DRAM */
#define CFG_MEMTEST_START 0x0
C
000000
/* memtest works on */
#define CFG_MEMTEST_END 0x0
D
000000
/* 16 MB in DRAM */
#undef CFG_CLKS_IN_HZ
/* everything, incl board info, in Hz */
#define CFG_LOAD_ADDR 0x0
cf
00000
/* default load address */
#define CFG_LOAD_ADDR 0x0
CF
00000
/* default load address */
#ifdef CONFIG_TRAB_50MHZ
/* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
...
...
@@ -334,27 +345,27 @@
* Physical Memory Map
*/
#define CONFIG_NR_DRAM_BANKS 1
/* we have 1 bank of DRAM */
#define PHYS_SDRAM_1 0x0c000000
/* SDRAM Bank #1 */
#define PHYS_SDRAM_1 0x0C000000
/* SDRAM Bank #1 */
#ifndef CONFIG_OLD_VERSION
#define PHYS_SDRAM_1_SIZE 0x02000000
/* 32 MB */
#else
#define PHYS_SDRAM_1_SIZE 0x01000000
/* 16 MB */
#endif
#define CFG_FLASH_BASE 0x00000000
/* Flash Bank #1 */
/* The following #defines are needed to get flash environment right */
#define CFG_MONITOR_BASE CFG_FLASH_BASE
#ifndef CONFIG_BIG_FLASH
#define CFG_MONITOR_LEN (256 << 10)
#else
#define CFG_MONITOR_LEN (128 << 10)
#endif
/*-----------------------------------------------------------------------
* FLASH and environment organization
*/
#define CFG_MAX_FLASH_BANKS 1
/* max number of memory banks */
#ifndef CONFIG_BIG_FLASH
#define CFG_MAX_FLASH_SECT 71
/* max number of sectors on one chip */
#else
#ifndef CONFIG_OLD_VERSION
#define CFG_MAX_FLASH_SECT 128
/* max number of sectors on one chip */
#else
#define CFG_MAX_FLASH_SECT 71
/* max number of sectors on one chip */
#endif
/* timeout values are in ticks */
...
...
@@ -364,14 +375,14 @@
#define CFG_ENV_IS_IN_FLASH 1
/* Address and size of Primary Environment Sector */
#ifndef CONFIG_
BIG_FLASH
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x
4
000)
#ifndef CONFIG_
OLD_VERSION
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x
60
000)
#define CFG_ENV_SIZE 0x4000
#define CFG_ENV_SECT_SIZE 0x
4
000
#define CFG_ENV_SECT_SIZE 0x
20
000
#else
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x
20
000)
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x
4
000)
#define CFG_ENV_SIZE 0x4000
#define CFG_ENV_SECT_SIZE 0x
20
000
#define CFG_ENV_SECT_SIZE 0x
4
000
#endif
/* Address and size of Redundant Environment Sector */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录