Code cleanup.

This commit is contained in:
wdenk 2004-12-16 21:44:03 +00:00
parent bea8e84b52
commit efe2a4d5cf
37 changed files with 1850 additions and 1808 deletions

View File

@ -85,12 +85,8 @@
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
#define FLASH_MAN_CFI 0x01000000
typedef union {
unsigned char c;
unsigned short w;
@ -107,13 +103,10 @@ typedef union {
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions
*/
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);

View File

@ -68,4 +68,3 @@ typedef struct /**** BMP file info structure ****/
unsigned int biClrUsed; /* Number of colors used */
unsigned int biClrImportant; /* Number of important colors */
} BITMAPINFOHEADER;

View File

@ -123,4 +123,3 @@ static S1D_REGS regs_13806_1024_768_8bpp[] =
{0x01F4,0x00}, /* CPU-to-Memory Access Watchdog Timer Register */
{0x01FC,0x01}, /* Display Mode Register */
};

View File

@ -123,4 +123,3 @@ static S1D_REGS regs_13806_320_240_4bpp[] =
{0x01F4,0x00}, /* CPU-to-Memory Access Watchdog Timer Register */
{0x01FC,0x01}, /* Display Mode Register */
};

View File

@ -123,4 +123,3 @@ static S1D_REGS regs_13806_640_480_16bpp[] =
{0x01F4,0x00}, /* CPU-to-Memory Access Watchdog Timer Register */
{0x01FC,0x01}, /* Display Mode Register */
};

View File

@ -123,4 +123,3 @@ static S1D_REGS regs_13806_640_320_16bpp[] =
{0x01F4,0x00}, /* CPU-to-Memory Access Watchdog Timer Register */
{0x01FC,0x01}, /* Display Mode Register */
};

View File

@ -32,41 +32,34 @@
extern ulong ide_bus_offset[CFG_IDE_MAXBUS];
int ide_preinit
(
void
)
{
int ide_preinit (void)
{
int status;
pci_dev_t devbusfn;
int l;
status = 1;
for(l=0;l<CFG_IDE_MAXBUS;l++)
{
for (l = 0; l < CFG_IDE_MAXBUS; l++) {
ide_bus_offset[l] = -ATA_STATUS;
}
devbusfn = pci_find_device(0x1103, 0x0004, 0);
if (devbusfn != -1)
{
devbusfn = pci_find_device (0x1103, 0x0004, 0);
if (devbusfn != -1) {
status = 0;
pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, (u32 *)&ide_bus_offset[0]);
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
(u32 *) & ide_bus_offset[0]);
ide_bus_offset[0] &= 0xfffffffe;
ide_bus_offset[0] += CFG_PCI0_IO_SPACE;
pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2, (u32 *)&ide_bus_offset[1]);
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_2,
(u32 *) & ide_bus_offset[1]);
ide_bus_offset[1] &= 0xfffffffe;
ide_bus_offset[1] += CFG_PCI0_IO_SPACE;
}
return(status);
}
return (status);
}
void ide_set_reset
(
int flag
)
{
void ide_set_reset (int flag) {
return;
}
}
#endif /* of CONFIG_CMDS_IDE */

File diff suppressed because it is too large Load Diff

View File

@ -293,7 +293,7 @@ int misc_init_r (void)
*/
#define PCI0_BRDGOPT1 0x4a
pci_write_config_word(PCIDEVID_405GP, PCI0_BRDGOPT1, 0x3f20);
// pci_write_config_word(PCIDEVID_405GP, PCI0_BRDGOPT1, 0x3f60);
/* pci_write_config_word(PCIDEVID_405GP, PCI0_BRDGOPT1, 0x3f60); */
#define plb0_acr 0x87
/*
@ -303,10 +303,10 @@ int misc_init_r (void)
#if 0 /* test-only */
printf("CCR0=%08x\n", mfspr(ccr0)); /* test-only */
// mtspr(ccr0, (mfspr(ccr0) & 0xff8fffff) | 0x00100000);
/* mtspr(ccr0, (mfspr(ccr0) & 0xff8fffff) | 0x00100000); */
mtspr(ccr0, (mfspr(ccr0) & 0xff8fffff) | 0x00000000);
#endif
// printf("CCR0=%08x\n", mfspr(ccr0)); /* test-only */
/* printf("CCR0=%08x\n", mfspr(ccr0)); /* test-only */ */
#endif
free(dst);

View File

@ -75,8 +75,6 @@ start1:
*/
/* subsystem id */
li r4,0x002C
oris r4,r4,0x8000
lis r3,0xEEC0
@ -90,8 +88,6 @@ start1:
blr /* never reached !!!! */
.globl write_with_sync
write_with_sync:
/*
@ -121,8 +117,6 @@ start2:
*/
/* subsystem id */
li r4,0x002C
oris r4,r4,0x8000
lis r3,0xEEC0
@ -138,7 +132,6 @@ start2:
blr /* never reached !!!! */
.globl write_with_less_sync
write_with_less_sync:
/*
@ -168,8 +161,6 @@ start2b:
*/
/* subsystem id */
li r4,0x002C
oris r4,r4,0x8000
lis r3,0xEEC0
@ -185,7 +176,6 @@ start2b:
blr /* never reached !!!! */
.globl write_with_more_sync
write_with_more_sync:
/*
@ -217,8 +207,6 @@ start3:
*/
/* subsystem id (PCIC0_SBSYSVID)*/
li r4,0x002C
oris r4,r4,0x8000
lis r3,0xEEC0

View File

@ -85,12 +85,8 @@
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
#define FLASH_MAN_CFI 0x01000000
typedef union {
unsigned char c;
unsigned short w;
@ -107,13 +103,10 @@ typedef union {
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions
*/
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);

View File

@ -25,7 +25,6 @@
#include <asm/processor.h>
#include <command.h>
#define MEM_MCOPT1_INIT_VAL 0x00800000
#define MEM_RTR_INIT_VAL 0x04070000
#define MEM_PMIT_INIT_VAL 0x07c00000
@ -34,11 +33,8 @@
#define MEM_SDTR1_INIT_VAL 0x00854005
#define SDRAM0_CFG_ENABLE 0x80000000
#define CFG_SDRAM_SIZE 0x04000000 /* 64 MB */
int board_early_init_f (void)
{
#if 0 /* test-only */

View File

@ -85,12 +85,8 @@
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
#define FLASH_MAN_CFI 0x01000000
typedef union {
unsigned char c;
unsigned short w;
@ -107,13 +103,10 @@ typedef union {
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions
*/
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);

View File

@ -176,4 +176,3 @@ void flash_preinit(void)
*/
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
}

View File

@ -34,50 +34,38 @@ static block_dev_desc_t *ext2fs_block_dev_desc;
static disk_partition_t part_info;
#undef DEBUG
int ext2fs_set_blk_dev
(
block_dev_desc_t *rbdd,
int part
)
{
int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int part)
{
ext2fs_block_dev_desc = rbdd;
if (part == 0)
{
if (part == 0) {
/* disk doesn't use partition table */
part_info.start = 0;
part_info.size = rbdd->lba;
part_info.blksz = rbdd->blksz;
}
else
{
if (get_partition_info (ext2fs_block_dev_desc, part, &part_info))
{
} else {
if (get_partition_info
(ext2fs_block_dev_desc, part, &part_info)) {
return 0;
}
}
return (part_info.size);
}
}
int ext2fs_devread
(
int sector,
int byte_offset,
int byte_len,
char *buf
)
{
int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
char sec_buf[SECTOR_SIZE];
unsigned block_len;
/*
* Check partition boundaries
*/
if ((sector < 0) || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >= part_info.size))
{
/* errnum = ERR_OUTSIDE_PART; */
if ((sector < 0)
|| ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
part_info.size)) {
/* errnum = ERR_OUTSIDE_PART; */
printf (" ** ext2fs_devread() read outside partition sector %d\n", sector);
return(0);
return (0);
}
/*
@ -90,53 +78,52 @@ int ext2fs_devread
printf (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
#endif
if (ext2fs_block_dev_desc == NULL)
{
printf("** Invalid Block Device Descriptor (NULL)\n");
return(0);
if (ext2fs_block_dev_desc == NULL) {
printf ("** Invalid Block Device Descriptor (NULL)\n");
return (0);
}
if (byte_offset != 0)
{
/* read first part which isn't aligned with start of sector */
if (ext2fs_block_dev_desc->block_read(ext2fs_block_dev_desc->dev, part_info.start+sector, 1, (unsigned long *)sec_buf) != 1)
{
if (byte_offset != 0) {
/* read first part which isn't aligned with start of sector */
if (ext2fs_block_dev_desc->
block_read (ext2fs_block_dev_desc->dev,
part_info.start + sector, 1,
(unsigned long *) sec_buf) != 1) {
printf (" ** ext2fs_devread() read error **\n");
return(0);
return (0);
}
memcpy(buf, sec_buf+byte_offset, min(SECTOR_SIZE-byte_offset, byte_len));
buf+=min(SECTOR_SIZE-byte_offset, byte_len);
byte_len-=min(SECTOR_SIZE-byte_offset, byte_len);
memcpy (buf, sec_buf + byte_offset,
min (SECTOR_SIZE - byte_offset, byte_len));
buf += min (SECTOR_SIZE - byte_offset, byte_len);
byte_len -= min (SECTOR_SIZE - byte_offset, byte_len);
sector++;
}
/* read sector aligned part */
block_len = byte_len & ~(SECTOR_SIZE-1);
if (ext2fs_block_dev_desc->block_read(ext2fs_block_dev_desc->dev,
part_info.start+sector,
block_len/SECTOR_SIZE,
(unsigned long *)buf) != block_len/SECTOR_SIZE)
{
/* read sector aligned part */
block_len = byte_len & ~(SECTOR_SIZE - 1);
if (ext2fs_block_dev_desc->block_read (ext2fs_block_dev_desc->dev,
part_info.start + sector,
block_len / SECTOR_SIZE,
(unsigned long *) buf) !=
block_len / SECTOR_SIZE) {
printf (" ** ext2fs_devread() read error - block\n");
return(0);
return (0);
}
buf+=block_len;
byte_len-=block_len;
sector+= block_len/SECTOR_SIZE;
buf += block_len;
byte_len -= block_len;
sector += block_len / SECTOR_SIZE;
if (byte_len != 0)
{
/* read rest of data which are not in whole sector */
if (ext2fs_block_dev_desc->block_read(ext2fs_block_dev_desc->dev,
part_info.start+sector,
1,
(unsigned long *)sec_buf) != 1)
{
if (byte_len != 0) {
/* read rest of data which are not in whole sector */
if (ext2fs_block_dev_desc->
block_read (ext2fs_block_dev_desc->dev,
part_info.start + sector, 1,
(unsigned long *) sec_buf) != 1) {
printf (" ** ext2fs_devread() read error - last part\n");
return(0);
return (0);
}
memcpy(buf, sec_buf, byte_len);
}
return(1);
memcpy (buf, sec_buf, byte_len);
}
return (1);
}
#endif /* CFG_CMD_EXT2FS */

File diff suppressed because it is too large Load Diff

View File

@ -143,8 +143,6 @@
#define MCFSIM_PLLCR 0x180 /* PLL Control register */
/*
* Some symbol defines for the above...
*/

View File

@ -392,8 +392,6 @@
#define CFG_PCI0_0_MEM_SPACE (CFG_PCI0_MEM_BASE)
#define CFG_PCI1_0_MEM_SPACE (CFG_PCI1_MEM_BASE)
/* PCI I/O MAP section */
#define CFG_PCI0_IO_BASE 0xfa000000
#define CFG_PCI0_IO_SIZE _16M

View File

@ -23,12 +23,10 @@
#ifndef _universe_h
#define _universe_h
typedef struct _UNIVERSE UNIVERSE;
typedef struct _SLAVE_IMAGE SLAVE_IMAGE;
typedef struct _TDMA_CMD_PACKET TDMA_CMD_PACKET;
struct _SLAVE_IMAGE {
unsigned int ctl; /* Control */
unsigned int bs; /* Base */
@ -148,10 +146,3 @@ struct _TDMA_CMD_PACKET {
#define PCI_MS_Mxx 0x03
#endif