Cleanup for GCC-4.x

This commit is contained in:
Wolfgang Denk 2005-10-13 16:45:02 +02:00
parent 17a8b276ba
commit 77ddac9480
201 changed files with 606 additions and 587 deletions

View file

@ -2,6 +2,8 @@
Changes for U-Boot 1.1.4:
======================================================================
* Cleanup for GCC-4.x
* Add documentation for Open Firmware Flat Tree and usage.
Patch by Pantelis Antoniou, 13 Oct 2005

View file

@ -169,7 +169,7 @@ int board_early_init_f (void)
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
char *s = getenv ("serial#");
if (!s || strncmp (s, "ELPT860", 7))
printf ("### No HW ID - assuming ELPT860\n");
@ -253,7 +253,7 @@ long int initdram (int board_type)
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL,
(ulong *) SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
udelay (1000);
@ -261,7 +261,7 @@ long int initdram (int board_type)
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL,
(ulong *) SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
SDRAM_BASE1_PRELIM, SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */
size_b0 = size9;

View file

@ -526,7 +526,7 @@ flash_get_size (int portwidth, vu_long * addr, flash_info_t * info)
int flash_erase (flash_info_t * info, int s_first, int s_last)
{
volatile unsigned char *addr = (char *) (info->start[0]);
volatile unsigned char *addr = (uchar *) (info->start[0]);
int flag, prot, sect, l_sect;
ulong start, now, last;
@ -696,7 +696,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
for (sect = s_first; sect <= s_last; sect++) {
int sector_size = info->size / info->sector_count;
addr = (char *) (info->start[sect]);
addr = (uchar *) (info->start[sect]);
memset ((void *) addr, 0, sector_size);
}
return 0;
@ -752,7 +752,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last; sect++) {
if (info->protect[sect] == 0) { /* not protected */
addr = (char *) (info->start[sect]);
addr = (uchar *) (info->start[sect]);
flash_cmd (info->portwidth, addr, 0, 0x30);
l_sect = sect;
}
@ -893,7 +893,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
/* broken for 2x16: TODO */
static int write_word (flash_info_t * info, ulong dest, ulong data)
{
volatile unsigned char *addr = (char *) (info->start[0]);
volatile unsigned char *addr = (uchar *) (info->start[0]);
ulong start;
int flag, i;
ulong mask;
@ -926,7 +926,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
CHIP_CMD_RST);
/* 1st cycle of word/byte program */
/* write 0x40 to the location to program */
flash_cmd (info->portwidth, (char *) dest, 0,
flash_cmd (info->portwidth, (uchar *) dest, 0,
CHIP_CMD_PROG);
/* 2nd cycle of word/byte program */
/* write the data to the destination address */

View file

@ -168,7 +168,7 @@ static uchar i2c_select_device (uchar dev_addr, uchar read, int ten_bit)
static uchar i2c_get_data (uchar * return_data, int len)
{
unsigned int data, status;
unsigned int data, status = 0;
int count = 0;
DP (puts ("i2c_get_data\n"));

View file

@ -610,7 +610,7 @@ unsigned long long pattern[] = {
int mem_test_data (void)
{
unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
unsigned long long temp64;
unsigned long long temp64 = 0;
int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
int i;
unsigned int hi, lo;
@ -717,7 +717,7 @@ int mem_march (volatile unsigned long long *base,
unsigned long long wmask, short read, short write)
{
unsigned int i;
unsigned long long temp;
unsigned long long temp = 0;
unsigned int hitemp, lotemp, himask, lomask;
for (i = 0; i < size; i++) {

View file

@ -267,8 +267,9 @@ void mv6436x_eth_initialize (bd_t * bis)
dev->send = (void *) db64360_eth_transmit;
dev->recv = (void *) db64360_eth_poll;
dev->priv = (void *) ethernet_private =
calloc (sizeof (*ethernet_private), 1);
ethernet_private = calloc (sizeof (*ethernet_private), 1);
dev->priv = (void *) ethernet_private;
if (!ethernet_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,
@ -281,8 +282,8 @@ void mv6436x_eth_initialize (bd_t * bis)
memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
/* set pointer to memory for stats data structure etc... */
ethernet_private->port_private = (void *) port_private =
calloc (sizeof (*ethernet_private), 1);
port_private = calloc (sizeof (*ethernet_private), 1);
ethernet_private->port_private = (void *)port_private;
if (!port_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,

View file

@ -610,7 +610,7 @@ unsigned long long pattern[] = {
int mem_test_data (void)
{
unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
unsigned long long temp64;
unsigned long long temp64 = 0;
int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
int i;
unsigned int hi, lo;
@ -717,7 +717,7 @@ int mem_march (volatile unsigned long long *base,
unsigned long long wmask, short read, short write)
{
unsigned int i;
unsigned long long temp;
unsigned long long temp = 0;
unsigned int hitemp, lotemp, himask, lomask;
for (i = 0; i < size; i++) {

View file

@ -267,8 +267,8 @@ void mv6446x_eth_initialize (bd_t * bis)
dev->send = (void *) db64460_eth_transmit;
dev->recv = (void *) db64460_eth_poll;
dev->priv = (void *) ethernet_private =
calloc (sizeof (*ethernet_private), 1);
ethernet_private = calloc (sizeof (*ethernet_private), 1);
dev->priv = (void *)ethernet_private;
if (!ethernet_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,
@ -281,8 +281,8 @@ void mv6446x_eth_initialize (bd_t * bis)
memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
/* set pointer to memory for stats data structure etc... */
ethernet_private->port_private = (void *) port_private =
calloc (sizeof (*ethernet_private), 1);
port_private = calloc (sizeof (*ethernet_private), 1);
ethernet_private->port_private = (void *)port_private;
if (!port_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,

View file

@ -114,8 +114,8 @@ void board_get_enetaddr (uchar * enet)
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
/* Read 256 bytes in EEPROM */
i2c_read (0x54, 0, 1, buff, 128);
i2c_read (0x54, 128, 1, buff + 128, 128);
i2c_read (0x54, 0, 1, (uchar *)buff, 128);
i2c_read (0x54, 128, 1, (uchar *)buff + 128, 128);
/* Retrieve MAC address in buffer (key EA) */
for (cp = buff;;) {
@ -123,7 +123,7 @@ void board_get_enetaddr (uchar * enet)
cp += 3;
/* Read MAC address */
for (i = 0; i < 6; i++, cp += 2) {
enet[i] = aschex_to_byte (cp);
enet[i] = aschex_to_byte ((unsigned char *)cp);
}
}
/* Scan to the end of the record */
@ -200,7 +200,7 @@ long int initdram (int board_type)
* try 10 column mode
*/
size10 = dram_size (CFG_MAMR_10COL, (ulong *) SDRAM_BASE_PRELIM,
size10 = dram_size (CFG_MAMR_10COL, SDRAM_BASE_PRELIM,
SDRAM_MAX_SIZE);
return (size10);

View file

@ -137,7 +137,7 @@ long int initdram (int board_type)
* try 10 column mode
*/
size10 = dram_size (CFG_MAMR_10COL, (ulong *) SDRAM_BASE_PRELIM,
size10 = dram_size (CFG_MAMR_10COL, SDRAM_BASE_PRELIM,
SDRAM_MAX_SIZE);
return (size10);

View file

@ -142,7 +142,7 @@ long int initdram (int board_type)
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE_PRELIM, SDRAM_MAX_SIZE);
/*
* Final mapping:

View file

@ -93,7 +93,7 @@ const uint sdram_table[] =
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
char *s = getenv ("serial#");
puts ("Board: RRvision ");
@ -157,7 +157,7 @@ long int initdram (int board_type)
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL,
(ulong *)SDRAM_BASE2_PRELIM,
SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -166,7 +166,7 @@ long int initdram (int board_type)
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL,
(ulong *) SDRAM_BASE2_PRELIM,
SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

View file

@ -42,7 +42,7 @@ int board_early_init_f(void)
*/
int checkboard(void)
{
unsigned char *s = getenv("serial#");
char *s = getenv("serial#");
puts("Board: Bubinga - AMCC PPC405EP Evaluation Board");

View file

@ -91,7 +91,7 @@ int board_early_init_f(void)
int checkboard(void)
{
sys_info_t sysinfo;
unsigned char *s = getenv("serial#");
char *s = getenv("serial#");
get_sys_info(&sysinfo);

View file

@ -187,7 +187,7 @@ int board_early_init_f (void)
int checkboard (void)
{
sys_info_t sysinfo;
unsigned char *s = getenv ("serial#");
char *s = getenv ("serial#");
get_sys_info (&sysinfo);

View file

@ -67,7 +67,7 @@ int board_early_init_f(void)
*/
int checkboard(void)
{
unsigned char *s = getenv("serial#");
char *s = getenv("serial#");
uint pvr = get_pvr();
if (pvr == PVR_405GPR_RB) {

View file

@ -181,7 +181,7 @@ void flash_print_info (flash_info_t *info)
int i;
uchar *boottype;
uchar *bootletter;
uchar *fmt;
char *fmt;
uchar botbootletter[] = "B";
uchar topbootletter[] = "T";
uchar botboottype[] = "bottom boot sector";

View file

@ -174,7 +174,7 @@ unsigned update_flash (unsigned char *buf)
switch ((*buf) & 0x3) {
case TRY_WORKING:
printf ("found 3 and converted it to 2\n");
write_flash (buf, (*buf) & 0xFE);
write_flash ((char *)buf, (*buf) & 0xFE);
*((unsigned char *)0xFF800000) = 0xF0;
udelay (100);
printf ("buf [%#010x] %#010x\n", buf, (*buf));

View file

@ -91,7 +91,7 @@ const uint sdram_table[] =
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
unsigned char *s = (unsigned char *)getenv ("serial#");
puts ("Board: TTTech C2MON ");
@ -155,7 +155,7 @@ long int initdram (int board_type)
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL,
(ulong *)SDRAM_BASE2_PRELIM,
SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -164,7 +164,7 @@ long int initdram (int board_type)
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL,
(ulong *) SDRAM_BASE2_PRELIM,
SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

View file

@ -133,7 +133,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
int misc_init_r (void)
{
unsigned char *s, *e;
char *s, *e;
image_header_t *hdr;
time_t timestamp;
struct rtc_time tm;
@ -146,7 +146,7 @@ int misc_init_r (void)
#define FACTORY_SETTINGS 0xFFFC0000
if ((s = getenv ("ethaddr")) == NULL) {
e = (unsigned char *) (FACTORY_SETTINGS);
e = (char *) (FACTORY_SETTINGS);
if (*(e + 0) != '0'
|| *(e + 1) != '0'
|| *(e + 2) != ':'
@ -314,7 +314,7 @@ static u8 *dhcp_env_update (u8 thing, u8 * pop)
{
setenv (Things[thing].envname, Things[thing].dhcpvalue);
}
return (Things[thing].dhcpvalue);
return ((u8 *)(Things[thing].dhcpvalue));
}
/* ------------------------------------------------------------------------- */

View file

@ -185,7 +185,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -58,7 +58,7 @@ unsigned char scsi_sym53c8xx_ccf = 0x13;
int misc_init_r (void)
{
revinfo eerev;
u_char *ptr;
char *ptr;
u_int i, l, initSrom, copyNv;
char buf[256];
char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0,
@ -139,7 +139,7 @@ int misc_init_r (void)
if (strcmp (eerev.magic, "ELTEC") != 0)
{
/* srom is not initialized -> create a default revision info */
for (i = 0, ptr = (u_char *)&eerev; i < sizeof(revinfo); i++)
for (i = 0, ptr = (char *)&eerev; i < sizeof(revinfo); i++)
*ptr++ = 0x00;
strcpy(eerev.magic, "ELTEC");
eerev.revrev[0] = 1;

View file

@ -57,7 +57,7 @@ int eepro100_srom_store (unsigned short *source)
/* get onboard network iobase */
pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
&onboard_dev.iobase);
(unsigned int *)&onboard_dev.iobase);
onboard_dev.iobase &= ~0xf;
source[63] = eepro100_srom_checksum (source);

View file

@ -160,7 +160,7 @@ int misc_init_r (void)
int i;
/* check revision data */
eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo, 32);
eeprom_read (CFG_I2C_EEPROM_ADDR, 480, (uchar *) &mhpcRevInfo, 32);
if (strncmp ((char *) &mhpcRevInfo.board[2], "MHPC", 4) != 0) {
printf ("Enter revision number (0-9): %c ",
@ -228,7 +228,7 @@ int misc_init_r (void)
}
/* setup new revision data */
eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (char *) &mhpcRevInfo,
eeprom_write (CFG_I2C_EEPROM_ADDR, 480, (uchar *) &mhpcRevInfo,
32);
}
@ -422,8 +422,8 @@ void *video_hw_init (void)
immap_t *immr = (immap_t *) CFG_IMMR;
/* enable video only on CLUT value */
if ((penv = getenv ("clut")) != NULL)
clut = (u_int) simple_strtoul (penv, NULL, 10);
if ((penv = (uchar *)getenv ("clut")) != NULL)
clut = (u_int) simple_strtoul ((char *)penv, NULL, 10);
else
return NULL;

View file

@ -165,7 +165,7 @@ void flash_print_info (flash_info_t *info)
int i;
uchar *boottype;
uchar *bootletter;
uchar *fmt;
char *fmt;
uchar botbootletter[] = "B";
uchar topbootletter[] = "T";
uchar botboottype[] = "bottom boot sector";

View file

@ -69,11 +69,11 @@ void read_factory_r (void)
/*printf ("%s\n", buf); */
/* search for our specific entry */
if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
setenv ("ethaddr", buf + 19);
setenv ("ethaddr", (char *)(buf + 19));
} else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
setenv ("serial#", buf + 15);
setenv ("serial#", (char *)(buf + 15));
} else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
setenv ("board_id", buf + 13);
setenv ("board_id", (char *)(buf + 13));
}
}
}

View file

@ -85,8 +85,8 @@ int board_early_init_f (void)
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
unsigned char *e;
char *s = getenv ("serial#");
char *e;
puts ("Board: ");

View file

@ -60,7 +60,7 @@ int board_early_init_f (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
puts ("Board: ");

View file

@ -155,7 +155,7 @@ int checkboard (void)
int index;
int len;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
const unsigned char *fpga;

View file

@ -193,7 +193,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -156,7 +156,7 @@ int checkboard (void)
{
int index;
int len;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
puts ("Board: ");

View file

@ -103,7 +103,7 @@ int au_check_cksum_valid(int i, long nbytes)
/* check the data CRC */
checksum = ntohl(hdr->ih_dcrc);
if (crc32 (0, (char *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
if (crc32 (0, (uchar *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
!= checksum) {
printf ("Image %s bad data checksum\n", au_image[i].name);
return -1;
@ -140,7 +140,7 @@ int au_check_header_valid(int i, long nbytes)
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(*hdr)) != checksum) {
if (crc32 (0, (uchar *)hdr, sizeof(*hdr)) != checksum) {
printf ("Image %s bad header checksum\n", au_image[i].name);
return -1;
}
@ -283,12 +283,12 @@ int au_do_update(int i, long sz)
*/
if (au_image[i].type != AU_NAND) {
debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes);
rc = flash_write(addr, start, nbytes);
rc = flash_write((uchar *)addr, start, nbytes);
} else {
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
debug ("nand_rw(%p, %lx %x)\n", addr, start, nbytes);
rc = nand_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
start, nbytes, &total, addr);
start, nbytes, (size_t *)&total, (uchar *)addr);
debug ("nand_rw: ret=%x total=%d nbytes=%d\n", rc, total, nbytes);
#endif
}
@ -301,12 +301,12 @@ int au_do_update(int i, long sz)
* check the dcrc of the copy
*/
if (au_image[i].type != AU_NAND) {
rc = crc32 (0, (char *)(start + off), ntohl(hdr->ih_size));
rc = crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size));
} else {
#if (CONFIG_COMMANDS & CFG_CMD_NAND)
rc = nand_rw(nand_dev_desc, NANDRW_READ | NANDRW_JFFS2 | NANDRW_JFFS2_SKIP,
start, nbytes, &total, addr);
rc = crc32 (0, (char *)(addr + off), ntohl(hdr->ih_size));
start, nbytes, (size_t *)&total, (uchar *)addr);
rc = crc32 (0, (uchar *)(addr + off), ntohl(hdr->ih_size));
#endif
}
if (rc != ntohl(hdr->ih_dcrc)) {

View file

@ -95,7 +95,7 @@ int misc_init_r (void)
*/
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -440,7 +440,7 @@ int checkboard (void)
int index;
int len;
#endif
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
unsigned short ver;
@ -468,7 +468,7 @@ int checkboard (void)
#endif
if (ctermm2()) {
unsigned char str[4];
char str[4];
/*
* Read board-id and save in env-variable
@ -664,7 +664,7 @@ int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int result;
int i;
unsigned char ow_id[6];
unsigned char str[32];
char str[32];
unsigned char ow_crc;
/*
@ -717,10 +717,10 @@ int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
IPaddr_t ipaddr;
buf = malloc(CFG_ENV_SIZE_2);
if (eeprom_read(CFG_I2C_EEPROM_ADDR_2, 0, buf, CFG_ENV_SIZE_2)) {
if (eeprom_read(CFG_I2C_EEPROM_ADDR_2, 0, (uchar *)buf, CFG_ENV_SIZE_2)) {
puts("\nError reading backplane EEPROM!\n");
} else {
crc = crc32(0, buf+4, CFG_ENV_SIZE_2-4);
crc = crc32(0, (uchar *)(buf+4), CFG_ENV_SIZE_2-4);
if (crc != *(ulong *)buf) {
printf("ERROR: crc mismatch %08lx %08lx\n", crc, *(ulong *)buf);
return -1;
@ -766,7 +766,7 @@ U_BOOT_CMD(
int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
char *buf;
unsigned char str[32];
char str[32];
ulong crc;
if (argc < 2) {
@ -779,10 +779,10 @@ int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
memset(buf, 0, CFG_ENV_SIZE_2);
sprintf(str, "bp_ip=%s", argv[1]);
strcpy(buf+4, str);
crc = crc32(0, buf+4, CFG_ENV_SIZE_2-4);
crc = crc32(0, (uchar *)(buf+4), CFG_ENV_SIZE_2-4);
*(ulong *)buf = crc;
if (eeprom_write(CFG_I2C_EEPROM_ADDR_2, 0, buf, CFG_ENV_SIZE_2)) {
if (eeprom_write(CFG_I2C_EEPROM_ADDR_2, 0, (uchar *)buf, CFG_ENV_SIZE_2)) {
puts("\nError writing backplane EEPROM!\n");
}

View file

@ -105,9 +105,9 @@ long int initdram(int board_type)
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);

View file

@ -555,7 +555,7 @@ unsigned long long pattern[] = {
int mem_test_data (void)
{
unsigned long long *pmem = (unsigned long long *) CFG_MEMTEST_START;
unsigned long long temp64;
unsigned long long temp64 = 0;
int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
int i;
unsigned int hi, lo;
@ -662,7 +662,7 @@ int mem_march (volatile unsigned long long *base,
unsigned long long wmask, short read, short write)
{
unsigned int i;
unsigned long long temp;
unsigned long long temp = 0;
unsigned int hitemp, lotemp, himask, lomask;
for (i = 0; i < size; i++) {

View file

@ -267,8 +267,9 @@ void mv6436x_eth_initialize (bd_t * bis)
dev->send = (void *) db64360_eth_transmit;
dev->recv = (void *) db64360_eth_poll;
dev->priv = (void *) ethernet_private =
ethernet_private =
calloc (sizeof (*ethernet_private), 1);
dev->priv = (void *) ethernet_private;
if (!ethernet_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,
@ -281,8 +282,9 @@ void mv6436x_eth_initialize (bd_t * bis)
memcpy (ethernet_private->port_mac_addr, dev->enetaddr, 6);
/* set pointer to memory for stats data structure etc... */
ethernet_private->port_private = (void *) port_private =
port_private =
calloc (sizeof (*ethernet_private), 1);
ethernet_private->port_private = (void *)port_private;
if (!port_private) {
printf ("%s: %s allocation failure, %s\n",
__FUNCTION__, dev->name,

View file

@ -153,7 +153,7 @@ int checkboard (void)
{
int index;
int len;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
puts ("Board: ");

View file

@ -111,7 +111,7 @@ static void showPci9054 (void)
for (i = 0; i < 4; i++) {
pci_read_config_dword (CFG_PCI9054_DEV_FN,
l * 16 + i * 4,
&val);
(unsigned int *)&val);
printf ("%08x ", val);
}
printf ("\n");

View file

@ -162,7 +162,7 @@ int checkboard (void)
{
int index;
int len;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
int fpga;
unsigned short val;

View file

@ -100,7 +100,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe,
0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf};

View file

@ -162,7 +162,7 @@ int checkboard (void)
{
int index;
int len;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
puts ("Board: ");

View file

@ -210,7 +210,7 @@ int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -74,7 +74,7 @@ int misc_init_f (void)
*/
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof (str));
puts ("Board: ");

View file

@ -91,7 +91,7 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
pci_read_config_dword(PCIDEVID_405GP, i, ptr++);
}
ptr = (unsigned int *)PCI_REGS_ADDR;
*ptr = crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
*ptr = crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
printf("\nStoring PCI Configuration Regs...\n");
} else {
@ -874,7 +874,7 @@ int do_savepci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
pci_read_config_dword(PCIDEVID_405GP, i, ptr++);
}
ptr = (unsigned int *)PCI_REGS_ADDR;
*ptr = crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
*ptr = crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4);
printf("\nStoring PCI Configuration Regs...\n");
@ -896,7 +896,7 @@ int do_restorepci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* Rewrite pci config regs (only after soft-reset with magic set)
*/
ptr = (unsigned int *)PCI_REGS_ADDR;
if (crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
if (crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
puts("Restoring PCI Configurations Regs!\n");
ptr = (unsigned int *)PCI_REGS_ADDR + 1;
for (i=0; i<0x40; i+=4) {

View file

@ -275,7 +275,7 @@ int misc_init_r (void)
* Rewrite pci config regs (only after soft-reset with magic set)
*/
ptr = (unsigned int *)PCI_REGS_ADDR;
if (crc32(0, (char *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
if (crc32(0, (uchar *)PCI_REGS_ADDR+4, PCI_REGS_LEN-4) == *ptr) {
puts("Restoring PCI Configurations Regs!\n");
ptr = (unsigned int *)PCI_REGS_ADDR + 1;
for (i=0; i<0x40; i+=4) {
@ -322,7 +322,7 @@ int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -122,7 +122,7 @@ static flash_info_t *flash_get_info(ulong base) {
void flash_print_info(flash_info_t * info) {
int i;
uchar *fmt;
char *fmt;
if (info->flash_id == FLASH_UNKNOWN) {
printf("missing or unknown FLASH type\n");

View file

@ -105,9 +105,9 @@ long int initdram(int board_type)
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *) CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *) CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);

View file

@ -203,7 +203,7 @@ int misc_init_r (void)
*/
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -107,7 +107,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -268,7 +268,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -193,7 +193,7 @@ int misc_init_r (void)
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -147,8 +147,8 @@ long int initdram (int board_type)
* Check Bank 0 Memory Size for re-configuration
*
*/
size_b0 = get_ram_size ((ulong *) SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
size_b1 = get_ram_size ((ulong *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
size_b0 = get_ram_size ( (long *)SDRAM_BASE2_PRELIM, SDRAM_MAX_SIZE);
size_b1 = get_ram_size ( (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
printf ("\nbank 0 size %lu\nbank 1 size %lu\n", size_b0, size_b1);

View file

@ -92,8 +92,8 @@ int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char *s = getenv ("serial#");
unsigned char *e;
char *s = getenv ("serial#");
char *e;
puts ("Board: ");
@ -186,7 +186,7 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -194,7 +194,7 @@ long int initdram (int board_type)
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */
@ -215,7 +215,7 @@ long int initdram (int board_type)
* but then only half the real size will be used.]
*/
size_b1 =
dram_size (memctl->memc_mamr, (ulong *) SDRAM_BASE3_PRELIM,
dram_size (memctl->memc_mamr, (long *) SDRAM_BASE3_PRELIM,
SDRAM_MAX_SIZE);
/* debug ("SDRAM Bank 1: %ld MB\n", size8 >> 20); */
} else {

View file

@ -182,7 +182,7 @@ gt6426x_eth_receive(struct eth_dev_s *p,unsigned int icr)
*/
/* let the upper layer handle the packet */
NetReceive (eth_data, eth_len);
NetReceive ((uchar *)eth_data, eth_len);
rx->buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
@ -266,7 +266,7 @@ gt6426x_eth_transmit(void *v, volatile char *p, unsigned int s)
#endif
memcpy(dev->eth_tx_buffer, (char *) p, s);
tx->buff_pointer = dev->eth_tx_buffer;
tx->buff_pointer = (uchar *)dev->eth_tx_buffer;
tx->bytecount_reserved = ((__u16)s) << 16;
/* 31 - own
@ -583,7 +583,7 @@ gt6426x_eth_probe(void *v, bd_t *bis)
/* Initialize Rx Side */
for (temp = 0; temp < NR; temp++) {
p->eth_rx_desc[temp].buff_pointer = p->eth_rx_buffer[temp];
p->eth_rx_desc[temp].buff_pointer = (uchar *)p->eth_rx_buffer[temp];
p->eth_rx_desc[temp].buff_size_byte_count = GT6426x_ETH_BUF_SIZE<<16;
/* GT96100 Owner */
@ -719,7 +719,8 @@ gt6426x_eth_initialize(bd_t *bis)
dev->send = (void*)gt6426x_eth_transmit;
dev->recv = (void*)gt6426x_eth_poll;
dev->priv = (void*)p = calloc( sizeof(*p), 1 );
p = calloc( sizeof(*p), 1 );
dev->priv = (void*)p;
if (!p)
{
printf( "%s: %s allocation failure, %s\n",

View file

@ -39,14 +39,14 @@ typedef struct eth0_tx_desc_struct {
volatile struct eth0_tx_desc_struct * next_desc;
/* Note - the following will not work for 64 bit addressing */
volatile unsigned char * buff_pointer;
} eth0_tx_desc_single __attribute__ ((packed));
} __attribute__ ((packed)) eth0_tx_desc_single;
typedef struct eth0_rx_desc_struct {
volatile __u32 buff_size_byte_count;
volatile __u32 command_status;
volatile struct eth0_rx_desc_struct * next_desc;
volatile unsigned char * buff_pointer;
} eth0_rx_desc_single __attribute__ ((packed));
} __attribute__ ((packed)) eth0_rx_desc_single;
#define NT 20 /* Number of Transmit buffers */
#define NR 20 /* Number of Receive buffers */

View file

@ -55,8 +55,9 @@ unsigned int initAddressTable (u32 port, u32 hashMode, u32 hashSizeSelector)
int bytes =
hashLength[hashSizeSelector] * sizeof (addrTblEntry);
tableBase = (unsigned int) realAddrTableBase[port] =
realAddrTableBase[port] =
malloc (bytes + 64);
tableBase = (unsigned int)realAddrTableBase;
if (!tableBase) {
printf ("%s: alloc memory failed \n", __FUNCTION__);

View file

@ -589,7 +589,7 @@ flash_get_size (int portwidth, vu_long *addr, flash_info_t *info)
int
flash_erase (flash_info_t *info, int s_first, int s_last)
{
volatile unsigned char *addr = (char *)(info->start[0]);
volatile unsigned char *addr = (uchar *)(info->start[0]);
int flag, prot, sect, l_sect;
ulong start, now, last;
@ -600,7 +600,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
if((info->flash_id & FLASH_TYPEMASK) == FLASH_RAM) {
for (sect = s_first; sect<=s_last; sect++) {
int sector_size=info->size/info->sector_count;
addr = (char *)(info->start[sect]);
addr = (uchar *)(info->start[sect]);
memset((void *)addr, 0, sector_size);
}
return 0;
@ -658,7 +658,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
if (info->protect[sect] == 0) { /* not protected */
addr = (char *)(info->start[sect]);
addr = (uchar *)(info->start[sect]);
flash_cmd(info->portwidth,addr,0,0x30);
l_sect = sect;
}
@ -794,7 +794,7 @@ write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
static int
write_word (flash_info_t *info, ulong dest, ulong data)
{
volatile unsigned char *addr = (char *)(info->start[0]);
volatile unsigned char *addr = (uchar *)(info->start[0]);
ulong start;
int flag, i;

View file

@ -146,7 +146,7 @@ i2c_select_device(uchar dev_addr, uchar read, int ten_bit)
static uchar
i2c_get_data(uchar* return_data, int len) {
unsigned int data, status;
unsigned int data, status = 0;
int count = 0;
DP(puts("i2c_get_data\n"));

View file

@ -116,7 +116,7 @@ zuma_mbox_dump(void)
static void
zuma_mbox_setenv(void)
{
unsigned char *data, buf[32];
char *data, buf[32];
unsigned char save = 0;
data = getenv("baudrate");

View file

@ -90,7 +90,7 @@ int misc_init_r (void)
*/
int checkboard (void)
{
unsigned char str[64];
char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
puts ("Board: ");

View file

@ -128,8 +128,8 @@ int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char *s;
unsigned char buf[64];
char *s;
char buf[64];
int i;
i = getenv_r ("board_id", buf, sizeof (buf));
@ -266,7 +266,7 @@ int misc_init_r (void)
int last_stage_init (void)
{
#if !defined(CONFIG_SC)
unsigned char buf[256];
char buf[256];
int i;
/*

View file

@ -188,12 +188,11 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
#endif
switch (value)
{
case 0x01:
case AMD_MANUFACT:
case 0x1: /* AMD_MANUFACT */
info->flash_id = FLASH_MAN_AMD;
break;
case FUJ_MANUFACT:
case 0x4: /* FUJ_MANUFACT */
info->flash_id = FLASH_MAN_FUJ;
break;

View file

@ -187,14 +187,14 @@ long int initdram (int board_type)
PrintState ();
#endif
/* printf ("\nChecking bank1..."); */
size8 = dram_size (CFG_MBMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
size8 = dram_size (CFG_MBMR_8COL, (long *) SDRAM_BASE1_PRELIM,
SDRAM_MAX_SIZE);
size_b0 = size8;
/* printf ("\nChecking bank2..."); */
size_b1 =
dram_size (memctl->memc_mbmr, (ulong *) SDRAM_BASE2_PRELIM,
dram_size (memctl->memc_mbmr, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
/*

View file

@ -261,7 +261,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
#if 0
ulong base = (ulong)addr;
#endif
uchar value;
ulong value;
/* Write auto select command: read Manufacturer ID */
#if 0
@ -278,7 +278,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
switch (value)
{
case AMD_MANUFACT:case 0x01:
case AMD_MANUFACT:
info->flash_id = FLASH_MAN_AMD;
break;

View file

@ -589,7 +589,7 @@ int misc_init_r (void)
(Rx[8] != ':') | (Rx[11] != ':') | (Rx[14] != ':')) {
printf ("*** ethernet addr invalid, using default ***\n");
} else {
setenv ("ethaddr", Rx);
setenv ("ethaddr", (char *)Rx);
}
return (0);
}

View file

@ -320,7 +320,7 @@ unsigned long long pattern[] = {
int mem_test_data (void)
{
unsigned long long *pmem = (unsigned long long *) CFG_SDRAM_BASE;
unsigned long long temp64;
unsigned long long temp64 = 0;
int num_patterns = sizeof (pattern) / sizeof (pattern[0]);
int i;
unsigned int hi, lo;
@ -427,7 +427,7 @@ int mem_march (volatile unsigned long long *base,
unsigned long long wmask, short read, short write)
{
unsigned int i;
unsigned long long temp;
unsigned long long temp = 0;
unsigned int hitemp, lotemp, himask, lomask;
for (i = 0; i < size; i++) {

View file

@ -107,8 +107,8 @@ int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char *s = getenv ("serial#");
unsigned char *e;
char *s = getenv ("serial#");
char *e;
puts ("Board: ");
@ -179,7 +179,7 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -187,7 +187,7 @@ long int initdram (int board_type)
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

View file

@ -58,7 +58,7 @@ hymod_eeprom_load (int which, hymod_eeprom_t *ep)
eeprom_read (dev_addr, offset, (uchar *)&crc, sizeof (ulong));
offset += sizeof (ulong);
if (crc32 (crc32 (0, (char *)&hdr, sizeof hdr), data, len) != crc)
if (crc32 (crc32 (0, (uchar *)&hdr, sizeof hdr), data, len) != crc)
return (0);
ep->ver = hdr.ver;
@ -260,7 +260,7 @@ uint_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
char *eval;
ulong lval;
lval = simple_strtol (val, &eval, 10);
lval = simple_strtol ((char *)val, &eval, 10);
if ((uchar *)eval == val || *eval != '\0') {
printf ("%s rec (%s) is not a valid uint\n", rp->name, val);
@ -315,12 +315,12 @@ static uchar *
date_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
{
hymod_date_t date;
uchar *p = val;
char *p = (char *)val;
char *ep;
ulong lval;
lval = simple_strtol (p, &ep, 10);
if ((uchar *)ep == p || *ep++ != '-') {
if (ep == p || *ep++ != '-') {
bad_date:
printf ("%s rec (%s) is not a valid date\n", rp->name, val);
return (NULL);
@ -330,12 +330,12 @@ bad_date:
date.year = lval;
lval = simple_strtol (p = ep, &ep, 10);
if ((uchar *)ep == p || *ep++ != '-' || lval == 0 || lval > 12)
if (ep == p || *ep++ != '-' || lval == 0 || lval > 12)
goto bad_date;
date.month = lval;
lval = simple_strtol (p = ep, &ep, 10);
if ((uchar *)ep == p || *ep != '\0' || lval == 0 || lval > 31)
if (ep == p || *ep != '\0' || lval == 0 || lval > 31)
goto bad_date;
date.day = lval;
@ -359,7 +359,7 @@ string_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
{
uint len;
if ((len = strlen (val)) > rp->maxlen) {
if ((len = strlen ((char *)val)) > rp->maxlen) {
printf ("%s rec (%s) string is too long (%d>%d)\n",
rp->name, val, len, rp->maxlen);
return (NULL);
@ -387,7 +387,7 @@ bytes_handler (eerec_map_t *rp, uchar *val, uchar *dp, uchar *edp)
for (nbytes = 0, p = val; *p != '\0'; p = (uchar *)ep) {
ulong lval;
lval = simple_strtol (p, &ep, 10);
lval = simple_strtol ((char *)p, &ep, 10);
if ((uchar *)ep == p || (*ep != '\0' && *ep != ',') || \
lval >= 256) {
printf ("%s rec (%s) byte array has invalid uint\n",
@ -451,7 +451,7 @@ eerec_callback (uchar *name, uchar *val)
eerec_map_t *rp;
for (rp = eerec_map; rp < &eerec_map[neerecs]; rp++)
if (strcmp (name, rp->name) == 0)
if (strcmp ((char *)name, rp->name) == 0)
break;
if (rp >= &eerec_map[neerecs])

View file

@ -38,7 +38,7 @@ env_callback (uchar *name, uchar *value)
char ov[CFG_CBSIZE], nv[CFG_CBSIZE], *p, *q, *nn, c, *curver, *newver;
int override = 1, append = 0, remove = 0, nnl, ovl, nvl;
nn = name;
nn = (char *)name;
if (*nn == '-') {
override = 0;
@ -68,7 +68,7 @@ env_callback (uchar *name, uchar *value)
return (0);
}
p = value;
p = (char *)value;
q = nv;
while ((c = *p) == ' ' || c == '\t')

View file

@ -139,7 +139,7 @@ void flash_print_info (flash_info_t *info)
int i;
uchar *boottype;
uchar *bootletter;
uchar *fmt;
char *fmt;
uchar botbootletter[] = "B";
uchar topbootletter[] = "T";
uchar botboottype[] = "bottom boot sector";

View file

@ -107,9 +107,9 @@ long int initdram (int board_type)
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);
dramsize = test1;
@ -135,10 +135,10 @@ long int initdram (int board_type)
/* find RAM size using SDRAM CS1 only */
if (!dramsize)
sdram_start(0);
test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
if (!dramsize) {
sdram_start(1);
test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
}
if (test1 > test2) {
sdram_start(0);
@ -207,9 +207,9 @@ long int initdram (int board_type)
/* find RAM size */
sdram_start(0);
test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);
dramsize = test1;

View file

@ -251,7 +251,7 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
value = addr[1]; /* device ID */
switch (value) {
switch ((unsigned long)value) {
case AMD_ID_F040B:
info->flash_id += FLASH_AM040;
info->sector_count = 8;

View file

@ -143,7 +143,7 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE1_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -151,7 +151,7 @@ long int initdram (int board_type)
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE1_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE1_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

View file

@ -114,10 +114,10 @@ int checkboard (void)
puts ("Board: ");
i = getenv_r ("serial#", buf, sizeof (buf));
i = getenv_r ("serial#", (char *)buf, sizeof (buf));
s = (i > 0) ? buf : NULL;
if (!s || strncmp (s, "IP860", 5)) {
if (!s || strncmp ((char *)s, "IP860", 5)) {
puts ("### No HW ID - assuming IP860");
} else {
for (e = s; *e; ++e) {
@ -190,9 +190,9 @@ long int initdram (int board_type)
* Check SDRAM Memory Size
*/
if (ip860_get_dram_size() == 16)
size = dram_size (refresh_val | 0x00804114, (ulong *)SDRAM_BASE, SDRAM_MAX_SIZE);
size = dram_size (refresh_val | 0x00804114, SDRAM_BASE, SDRAM_MAX_SIZE);
else
size = dram_size (refresh_val | 0x00906114, (ulong *)SDRAM_BASE, SDRAM_MAX_SIZE);
size = dram_size (refresh_val | 0x00906114, SDRAM_BASE, SDRAM_MAX_SIZE);
udelay (1000);

View file

@ -342,7 +342,7 @@ int hwc_serial_number (void)
{
int sn = -1;
if (!seeprom_read (0xa0, (char *) &sn, sizeof (sn))) {
if (!seeprom_read (0xa0, (uchar *) &sn, sizeof (sn))) {
sn = cpu_to_le32 (sn);
}
return sn;
@ -351,7 +351,7 @@ int hwc_mac_address (char *str)
{
char mac[6];
if (!seeprom_read (0xb0, mac, sizeof (mac))) {
if (!seeprom_read (0xb0, (uchar *)mac, sizeof (mac))) {
sprintf (str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
} else {

View file

@ -290,7 +290,7 @@ static int hwc_serial_number (void)
{
int sn = -1;
if (!seeprom_read (0xa0, (char *) &sn, sizeof (sn))) {
if (!seeprom_read (0xa0, (uchar *) &sn, sizeof (sn))) {
sn = cpu_to_le32 (sn);
}
return sn;
@ -300,7 +300,7 @@ static int hwc_mac_address (char *str)
{
char mac[6];
if (!seeprom_read (0xb0, mac, sizeof (mac))) {
if (!seeprom_read (0xb0, (uchar *)mac, sizeof (mac))) {
sprintf (str, "%02X:%02X:%02X:%02X:%02X:%02X",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
} else {

View file

@ -251,7 +251,7 @@ long int initdram (int board_type)
* Check Bank 0 Memory Size for re-configuration
*/
size_b0 =
dram_size (CFG_MBMR_8COL, (ulong *) SDRAM_BASE3_PRELIM,
dram_size (CFG_MBMR_8COL, (long *) SDRAM_BASE3_PRELIM,
SDRAM_MAX_SIZE);
memctl->memc_mbmr = CFG_MBMR_8COL | MBMR_PTBE;

View file

@ -54,9 +54,9 @@
void load_sernum_ethaddr (void)
{
unsigned char *hwi;
unsigned char *var;
char *var;
unsigned char hwi_stack[CFG_HWINFO_SIZE];
unsigned char *p;
char *p;
hwi = (unsigned char *) (CFG_FLASH_BASE + CFG_HWINFO_OFFSET);
if (*((unsigned long *) hwi) != (unsigned long) CFG_HWINFO_MAGIC) {
@ -68,11 +68,11 @@ void load_sernum_ethaddr (void)
/*
** ethaddr
*/
var = strstr (hwi_stack, ETHADDR_TOKEN);
var = strstr ((char *)hwi_stack, ETHADDR_TOKEN);
if (var) {
var += sizeof (ETHADDR_TOKEN) - 1;
p = strchr (var, '\r');
if (p < hwi + CFG_HWINFO_SIZE) {
if ((unsigned char *)p < hwi + CFG_HWINFO_SIZE) {
*p = '\0';
setenv ("ethaddr", var);
*p = '\r';
@ -81,11 +81,11 @@ void load_sernum_ethaddr (void)
/*
** lcd
*/
var = strstr (hwi_stack, LCD_TOKEN);
var = strstr ((char *)hwi_stack, LCD_TOKEN);
if (var) {
var += sizeof (LCD_TOKEN) - 1;
p = strchr (var, '\r');
if (p < hwi + CFG_HWINFO_SIZE) {
if ((unsigned char *)p < hwi + CFG_HWINFO_SIZE) {
*p = '\0';
setenv ("lcd", var);
*p = '\r';

View file

@ -327,7 +327,7 @@ void lcd_logo (bd_t * bd)
int r = 8, g = 8, b = 4;
int r1, g1, b1;
int n;
uchar tmp[64]; /* long enough for environment variables */
char tmp[64]; /* long enough for environment variables */
int tft = 0;
immr->im_cpm.cp_pbpar &= ~(PB_LCD_PWM);
@ -453,7 +453,7 @@ void lcd_logo (bd_t * bd)
}
/* copy bitmap */
fb = (char *) (fb_info.VmemAddr);
fb = (uchar *) (fb_info.VmemAddr);
memcpy (fb, (uchar *) CONFIG_KUP4K_LOGO, 320 * 240);
}
#endif /* CONFIG_KUP4K_LOGO */

View file

@ -171,7 +171,7 @@ long int initdram (int board_type)
* Check Bank 0 Memory Size for re-configuration
*/
size_b0 = dram_size (CFG_MAMR_8COL,
(ulong *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
(long *) SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;

View file

@ -266,14 +266,14 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
size8 = dram_size (CFG_MAMR_8COL, (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
udelay (1000);
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
size9 = dram_size (CFG_MAMR_9COL, (long *)SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */
size_b0 = size9;
@ -574,11 +574,11 @@ int misc_init_r (void)
DECLARE_GLOBAL_DATA_PTR;
uchar kbd_data[KEYBD_DATALEN];
uchar keybd_env[2 * KEYBD_DATALEN + 1];
char keybd_env[2 * KEYBD_DATALEN + 1];
uchar kbd_init_status = gd->kbd_status >> 8;
uchar kbd_status = gd->kbd_status;
uchar val;
uchar *str;
char *str;
int i;
if (kbd_init_status) {
@ -617,7 +617,7 @@ int misc_init_r (void)
}
setenv ("keybd", keybd_env);
str = strdup (key_match (kbd_data)); /* decode keys */
str = strdup ((char *)key_match (kbd_data)); /* decode keys */
#ifdef KEYBD_SET_DEBUGMODE
if (kbd_data[0] == KEYBD_SET_DEBUGMODE) { /* set debug mode */
if ((console_assign (stdout, "lcd") < 0) ||
@ -649,11 +649,11 @@ static int compare_magic (uchar *kbd_data, uchar *str)
/* Don't include modifier byte */
memcpy (compare, kbd_data+1, KEYBD_DATALEN-1);
for (; str != NULL; str = (*nxt) ? nxt+1 : nxt) {
for (; str != NULL; str = (*nxt) ? (uchar *)(nxt+1) : (uchar *)nxt) {
uchar c;
int k;
c = (uchar) simple_strtoul (str, (char **) (&nxt), 16);
c = (uchar) simple_strtoul ((char *)str, (char **) (&nxt), 16);
if (str == (uchar *)nxt) { /* invalid character */
break;
@ -719,9 +719,9 @@ V* Verification: dzu@denx.de
***********************************************************************/
static uchar *key_match (uchar *kbd_data)
{
uchar magic[sizeof (kbd_magic_prefix) + 1];
char magic[sizeof (kbd_magic_prefix) + 1];
uchar *suffix;
uchar *kbd_magic_keys;
char *kbd_magic_keys;
/*
* The following string defines the characters that can pe appended
@ -737,13 +737,13 @@ static uchar *key_match (uchar *kbd_data)
/* loop over all magic keys;
* use '\0' suffix in case of empty string
*/
for (suffix=kbd_magic_keys; *suffix || suffix==kbd_magic_keys; ++suffix) {
for (suffix=(uchar *)kbd_magic_keys; *suffix || suffix==(uchar *)kbd_magic_keys; ++suffix) {
sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
#if 0
printf ("### Check magic \"%s\"\n", magic);
#endif
if (compare_magic(kbd_data, getenv(magic)) == 0) {
uchar cmd_name[sizeof (kbd_command_prefix) + 1];
if (compare_magic(kbd_data, (uchar *)getenv(magic)) == 0) {
char cmd_name[sizeof (kbd_command_prefix) + 1];
char *cmd;
sprintf (cmd_name, "%s%c", kbd_command_prefix, *suffix);
@ -754,7 +754,7 @@ static uchar *key_match (uchar *kbd_data)
cmd_name, cmd ? cmd : "<<NULL>>");
#endif
*kbd_data = *suffix;
return (cmd);
return ((uchar *)cmd);
}
}
#if 0
@ -863,7 +863,7 @@ V* Verification: dzu@denx.de
int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
uchar kbd_data[KEYBD_DATALEN];
uchar keybd_env[2 * KEYBD_DATALEN + 1];
char keybd_env[2 * KEYBD_DATALEN + 1];
uchar val;
int i;
@ -1044,7 +1044,7 @@ static int key_pressed(void)
i2c_write (kbd_addr, 0, 0, &val, 1);
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
return (compare_magic(kbd_data, CONFIG_MODEM_KEY_MAGIC) == 0);
return (compare_magic(kbd_data, (uchar *)CONFIG_MODEM_KEY_MAGIC) == 0);
}
#endif /* CONFIG_MODEM_SUPPORT */
@ -1063,6 +1063,6 @@ int post_hotkeys_pressed(void)
i2c_write (kbd_addr, 0, 0, &val, 1);
i2c_read (kbd_addr, 0, 0, kbd_data, KEYBD_DATALEN);
return (compare_magic(kbd_data, CONFIG_POST_KEY_MAGIC) == 0);
return (compare_magic(kbd_data, (uchar *)CONFIG_POST_KEY_MAGIC) == 0);
}
#endif

View file

@ -216,7 +216,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) {
return rc;
}
volatile static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
volatile unsigned long long *addr=(unsigned long long *)dest;
unsigned long long result;

View file

@ -30,8 +30,8 @@ int board_early_init_f (void)
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
unsigned char *e;
char *s = getenv ("serial#");
char *e;
if (!s || strncmp (s, "ML2", 9)) {
printf ("### No HW ID - assuming ML2");

View file

@ -163,7 +163,7 @@ mpl_prg(uchar *src, ulong size)
#endif
printf("flash erased, programming from 0x%lx 0x%lx Bytes\n",
(ulong)src, size);
if ((rc = flash_write (src, start, size)) != 0) {
if ((rc = flash_write ((char *)src, start, size)) != 0) {
puts("ERROR ");
flash_perror(rc);
return (1);
@ -200,14 +200,14 @@ mpl_prg_image(uchar *ld_addr)
len = sizeof(image_header_t);
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)data, len) != checksum) {
if (crc32 (0, (uchar *)data, len) != checksum) {
puts("Bad Header Checksum\n");
return 1;
}
data = ld_addr + sizeof(image_header_t);
len = ntohl(hdr->ih_size);
puts("Verifying Checksum ... ");
if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) {
if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
puts("Bad Data CRC\n");
return 1;
}
@ -376,8 +376,8 @@ void copy_old_env(ulong size)
} while(len > off);
name=&name_buf[0];
value=&value_buf[0];
if(strncmp(name,"baudrate",8)!=0) {
setenv(name,value);
if(strncmp((char *)name,"baudrate",8)!=0) {
setenv((char *)name,(char *)value);
}
}
@ -387,7 +387,7 @@ void copy_old_env(ulong size)
void check_env(void)
{
unsigned char *s;
char *s;
int i=0;
char buf[32];
backup_t back;
@ -592,7 +592,7 @@ void video_get_info_str (int line_number, char *info)
char buf[64];
char tmp[16];
char cpustr[16];
unsigned char *s, *e, bc;
char *s, *e, bc;
switch (line_number)
{
case 2:

View file

@ -155,7 +155,7 @@ void isa_write_table(SIO_LOGDEV_TABLE *ldt,unsigned char ldev)
void isa_sio_loadtable(void)
{
unsigned char *s = getenv("floppy");
char *s = getenv("floppy");
/* setup Floppy device 0*/
isa_write_table((SIO_LOGDEV_TABLE *)&sio_fdc,0);
/* setup parallel port device 3 */

View file

@ -585,15 +585,15 @@ void get_pcbrev_var(unsigned char *pcbrev, unsigned char *var)
int checkboard (void)
{
unsigned char s[50];
char s[50];
unsigned char bc, var;
int i;
backup_t *b = (backup_t *) s;
puts ("Board: ");
get_pcbrev_var(&bc,&var);
i = getenv_r ("serial#", s, 32);
if ((i == 0) || strncmp (s, BOARD_NAME,sizeof(BOARD_NAME))) {
i = getenv_r ("serial#", (char *)s, 32);
if ((i == 0) || strncmp ((char *)s, BOARD_NAME,sizeof(BOARD_NAME))) {
get_backup_values (b);
if (strncmp (b->signature, "MPL\0", 4) != 0) {
puts ("### No HW ID - assuming " BOARD_NAME);
@ -728,7 +728,7 @@ int last_stage_init (void)
{
unsigned long stop;
struct rtc_time newtm;
unsigned char *s;
char *s;
mem_test_reloc();
/* write correct LED configuration */
if (miiphy_write (0x1, 0x14, 0x2402) != 0) {

View file

@ -180,7 +180,7 @@ int board_early_init_f (void)
{
unsigned char dataout[1];
unsigned char datain[128];
unsigned long sdram_size;
unsigned long sdram_size = 0;
SDRAM_SETUP *t = (SDRAM_SETUP *) sdram_setup_table;
unsigned long memclk;
unsigned long tmemclk = 0;
@ -574,15 +574,15 @@ int board_early_init_f (void)
int checkboard (void)
{
unsigned char s[50];
char s[50];
unsigned char bc;
int i;
backup_t *b = (backup_t *) s;
puts ("Board: ");
i = getenv_r ("serial#", s, 32);
if ((i == 0) || strncmp (s, "PIP405", 6)) {
i = getenv_r ("serial#", (char *)s, 32);
if ((i == 0) || strncmp ((char *)s, "PIP405", 6)) {
get_backup_values (b);
if (strncmp (b->signature, "MPL\0", 4) != 0) {
puts ("### No HW ID - assuming PIP405");

View file

@ -197,14 +197,14 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

View file

@ -221,7 +221,7 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE1_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE1_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -229,7 +229,7 @@ long int initdram (int board_type)
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE1_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE1_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */
@ -248,7 +248,7 @@ long int initdram (int board_type)
* [9 column SDRAM may also be used in 8 column mode,
* but then only half the real size will be used.]
*/
size_b1 = dram_size (memctl->memc_mamr, (ulong *) SDRAM_BASE2_PRELIM,
size_b1 = dram_size (memctl->memc_mamr, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
/* debug ("SDRAM Bank 1: %ld MB\n", size8 >> 20); */

View file

@ -154,7 +154,7 @@ void flash_print_info (flash_info_t *info)
int i;
uchar *boottype;
uchar *bootletter;
uchar *fmt;
char *fmt;
uchar botbootletter[] = "B";
uchar topbootletter[] = "T";
uchar botboottype[] = "bottom boot sector";

View file

@ -85,9 +85,9 @@ long int initdram (int board_type)
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);
dramsize = test1;
@ -113,11 +113,11 @@ long int initdram (int board_type)
if (!dramsize)
sdram_start(0);
test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
if (!dramsize) {
sdram_start(1);
test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
}
if (test1 > test2) {

View file

@ -136,7 +136,7 @@ static ulong flash_get_size (ulong addr, flash_info_t *info)
DEBUGF("Device ID @ 0x%08lx: 0x%08x\n", addr+1, value);
switch (value) {
switch ((ulong)value) {
case AMD_ID_F040B:
DEBUGF("Am29F040B\n");
info->flash_id += FLASH_AM040;

View file

@ -107,9 +107,9 @@ long int initdram (int board_type)
/* find RAM size using SDRAM CS0 only */
sdram_start(0);
test1 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
sdram_start(1);
test2 = get_ram_size((ulong *)CFG_SDRAM_BASE, 0x80000000);
test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
if (test1 > test2) {
sdram_start(0);
dramsize = test1;
@ -135,10 +135,10 @@ long int initdram (int board_type)
/* find RAM size using SDRAM CS1 only */
if (!dramsize)
sdram_start(0);
test2 = test1 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
if (!dramsize) {
sdram_start(1);
test2 = get_ram_size((ulong *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x80000000);
}
if (test1 > test2) {
sdram_start(0);

View file

@ -167,7 +167,7 @@ static int get_serial_number (char *string, int size)
if (size < I2155X_VPD_SN_SIZE)
size = I2155X_VPD_SN_SIZE;
for (i = 0; i < (size - 1); i++) {
i2155x_read_vpd (I2155X_VPD_SN_START + i, 1, &c);
i2155x_read_vpd (I2155X_VPD_SN_START + i, 1, (uchar *)&c);
if (c == '\0')
break;
string[i] = c;

View file

@ -285,7 +285,7 @@ int misc_init_r (void)
int res;
if ((ds != 0) && (ds != 0xff)) {
res = getenv_r ("ethaddr", tmp, sizeof (tmp));
res = getenv_r ("ethaddr", (char *)tmp, sizeof (tmp));
if (res > 0) {
ss = ((ds >> 4) & 0x0f);
ss += ss < 0x0a ? '0' : ('a' - 10);
@ -296,7 +296,7 @@ int misc_init_r (void)
tmp[16] = ss;
tmp[17] = '\0';
setenv ("ethaddr", tmp);
setenv ("ethaddr", (char *)tmp);
/* set the led to show the address */
*((unsigned char *) (CFG_LED_BASE + 1)) = ds;
}

View file

@ -87,7 +87,7 @@ const uint sdram_table[] = {
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
char *s = getenv ("serial#");
puts ("Board QUANTUM, Serial No: ");
@ -136,7 +136,7 @@ long int initdram (int board_type)
/* Check Bank 0 Memory Size,
* 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE_PRELIM,
SDRAM_MAX_SIZE);
/*
* Final mapping:
@ -162,7 +162,7 @@ static long int dram_size (long int mamr_value, long int *base,
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
volatile long int *addr;
volatile ulong *addr;
ulong cnt, val, size;
ulong save[32]; /* to make test non-destructive */
unsigned char i = 0;

View file

@ -152,7 +152,7 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE2_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
@ -160,7 +160,7 @@ long int initdram (int board_type)
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE2_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE2_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */
@ -287,21 +287,21 @@ static uchar *key_match (uchar *);
int misc_init_r (void)
{
uchar kbd_data[KEYBD_DATALEN];
uchar keybd_env[2 * KEYBD_DATALEN + 1];
uchar *str;
char kbd_data[KEYBD_DATALEN];
char keybd_env[2 * KEYBD_DATALEN + 1];
char *str;
int i;
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
i2c_read (CFG_I2C_KEY_ADDR, 0, 0, kbd_data, KEYBD_DATALEN);
i2c_read (CFG_I2C_KEY_ADDR, 0, 0, (uchar *)kbd_data, KEYBD_DATALEN);
for (i = 0; i < KEYBD_DATALEN; ++i) {
sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
}
setenv ("keybd", keybd_env);
str = strdup (key_match (keybd_env)); /* decode keys */
str = strdup ((char *)key_match ((uchar *)keybd_env)); /* decode keys */
#ifdef CONFIG_PREBOOT /* automatically configure "preboot" command on key match */
setenv ("preboot", str); /* set or delete definition */
@ -347,36 +347,36 @@ static uchar *key_match (uchar * kbd_str)
* "key_magic" is checked (old behaviour); the string "125" causes
* checks for "key_magic1", "key_magic2" and "key_magic5", etc.
*/
if ((kbd_magic_keys = getenv ("magic_keys")) != NULL) {
if ((kbd_magic_keys = (uchar *)getenv ("magic_keys")) != NULL) {
/* loop over all magic keys;
* use '\0' suffix in case of empty string
*/
for (suffix = kbd_magic_keys;
*suffix || suffix == kbd_magic_keys;
++suffix) {
sprintf (magic, "%s%c", kbd_magic_prefix, *suffix);
sprintf ((char *)magic, "%s%c", kbd_magic_prefix, *suffix);
#if 0
printf ("### Check magic \"%s\"\n", magic);
#endif
if ((str = getenv (magic)) != 0) {
if ((str = (uchar *)getenv ((char *)magic)) != 0) {
#if 0
printf ("### Compare \"%s\" \"%s\"\n",
kbd_str, str);
#endif
if (strcmp (kbd_str, str) == 0) {
sprintf (cmd_name, "%s%c",
if (strcmp ((char *)kbd_str, (char *)str) == 0) {
sprintf ((char *)cmd_name, "%s%c",
kbd_command_prefix,
*suffix);
if ((cmd = getenv (cmd_name)) != 0) {
if ((cmd = getenv ((char *)cmd_name)) != 0) {
#if 0
printf ("### Set PREBOOT to $(%s): \"%s\"\n",
cmd_name, cmd);
#endif
return (cmd);
return ((uchar *)cmd);
}
}
}
@ -404,11 +404,11 @@ int do_kbd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
puts ("Keys:");
for (i = 0; i < KEYBD_DATALEN; ++i) {
sprintf (keybd_env + i + i, "%02X", kbd_data[i]);
sprintf ((char *)(keybd_env + i + i), "%02X", kbd_data[i]);
printf (" %02x", kbd_data[i]);
}
putc ('\n');
setenv ("keybd", keybd_env);
setenv ("keybd", (char *)keybd_env);
return 0;
}

View file

@ -188,12 +188,11 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
#endif
switch (value)
{
case 0x01:
case AMD_MANUFACT:
case 0x01: /*AMD_MANUFACT*/
info->flash_id = FLASH_MAN_AMD;
break;
case FUJ_MANUFACT:
case 0x04: /*FUJ_MANUFACT*/
info->flash_id = FLASH_MAN_FUJ;
break;

View file

@ -127,7 +127,7 @@ const uint static_table[] =
int checkboard (void)
{
unsigned char *s = getenv ("serial#");
char *s = getenv ("serial#");
if (!s || strncmp (s, "TQM8", 4)) {
printf ("### No HW ID - assuming RBC823\n");
@ -193,14 +193,14 @@ long int initdram (int board_type)
*
* try 8 column mode
*/
size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE4_PRELIM,
size8 = dram_size (CFG_MAMR_8COL, (long *) SDRAM_BASE4_PRELIM,
SDRAM_MAX_SIZE);
udelay (1000);
/*
* try 9 column mode
*/
size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE4_PRELIM,
size9 = dram_size (CFG_MAMR_9COL, (long *) SDRAM_BASE4_PRELIM,
SDRAM_MAX_SIZE);
if (size8 < size9) { /* leave configuration at 9 columns */

Some files were not shown because too many files have changed in this diff Show more