Compare commits

...
Author SHA1 Message Date
wdenk f4733a0764 Add port initialization for digital I/O on INKA4x0 2005-03-06 01:21:30 +00:00
wdenk b05dcb58fe * Fix get_partition_info() parameter error in all other calls
(common/cmd_ide.c, common/cmd_reiser.c, common/cmd_scsi.c).

* Enable USB and IDE support for INKA4x0 board

* Patch by Andrew Dyer, 28 February 2005:
  fix ext2load passing an incorrect pointer to get_partition_info()
  resulting in load failure for devices other than 0
2005-03-04 11:27:31 +00:00
stroese 47b1e3d77f Update for esd boards dp405 and hub405 2005-03-01 17:26:39 +00:00
wdenk e58cf2a0cf Add support for SRAM and 2 x Quad UARTs on INKA4x0 board 2005-02-27 23:46:58 +00:00
wdenk 1968e615d4 Cleanup USB and partition defines 2005-02-24 23:23:29 +00:00
wdenk 151ab83a93 * Add support for ext2 filesystems and image timestamps to TQM5200 board
* Add reset code for Coral-P on INKA4x0 board

* Patch by Martin Krause, 28 Jun 2004:
  Update for TRAB board.

* Fix some missing "volatile"s in MPC5xxx FEC driver
2005-02-24 22:44:16 +00:00
wdenk b9649854f6 Fix yet another recently introduced bug. 2005-02-08 15:29:01 +00:00
wdenk e799d3755e Fix cirrus voltage detection (for CPC45) 2005-02-07 19:44:17 +00:00
wdenk 2f916943c9 Fix for incomplete byteorder fix in cmd_scsi.c and cmd_usb.c 2005-02-04 21:33:05 +00:00
wdenk f8883cb101 Fix byteorder problem in usbboot and scsiboot commands. 2005-02-04 15:38:08 +00:00
wdenk 20a80418f9 * Patch by Cajus Hahn, 04 Feb 2005:
- don't insist on leading '/' for filename in ext2load
  - set default partition to useful value (1) in ext2load

* Patch by Andrew Dyer, 08 Jan 2005:
  fix wrong return codes in ext2 code
2005-02-04 15:02:06 +00:00
wdenk 1a344f298d * Removed '--no-warn-mismatch' option from Makefile. This option
makes 'ld' to overlook binary objects compatibility.

* Moved $(PLATFORM_LIBS) from the library group (--start-group ...
  --end-group) outside of the group. This will make 'ld' to do
  _multiple_ search in the library group when resolving symbol
  references and do only a _single_ seach in libgcc.a after the group
  search.

* Fix stability problems on CPC45 board again.

* Make image detection for diskboot / usbboot / scsiboot more robust
  (also check header checksum)
2005-02-03 23:00:49 +00:00
29 changed files with 2312 additions and 1961 deletions

No files matched your search

+52
View File
@@ -2,6 +2,58 @@
Changes for U-Boot 1.1.3:
======================================================================
* Add port initialization for digital I/O on INKA4x0
* Patch by Stefan Roese, 01 March 2005:
Update for esd boards dp405 and hub405
* Fix get_partition_info() parameter error in all other calls
(common/cmd_ide.c, common/cmd_reiser.c, common/cmd_scsi.c).
* Enable USB and IDE support for INKA4x0 board
* Patch by Andrew Dyer, 28 February 2005:
fix ext2load passing an incorrect pointer to get_partition_info()
resulting in load failure for devices other than 0
* Add support for SRAM and 2 x Quad UARTs on INKA4x0 board
* Cleanup USB and partition defines
* Add support for ext2 filesystems and image timestamps to TQM5200 board
* Add reset code for Coral-P on INKA4x0 board
* Patch by Martin Krause, 28 Jun 2004:
Update for TRAB board.
* Fix some missing "volatile"s in MPC5xxx FEC driver
* Fix cirrus voltage detection (for CPC45)
* Fix byteorder problem in usbboot and scsiboot commands.
* Patch by Cajus Hahn, 04 Feb 2005:
- don't insist on leading '/' for filename in ext2load
- set default partition to useful value (1) in ext2load
* Patch by Andrew Dyer, 08 Jan 2005:
fix wrong return codes in ext2 code
* Removed '--no-warn-mismatch' option from Makefile. This option
makes 'ld' to overlook binary objects compatibility.
* Moved $(PLATFORM_LIBS) from the library group (--start-group ...
--end-group) outside of the group. This will make 'ld' to do
_multiple_ search in the library group when resolving symbol
references and do only a _single_ seach in libgcc.a after the group
search.
* Fix stability problems on CPC45 board again.
* Make image detection for diskboot / usbboot / scsiboot more robust
(also check header checksum)
* Update CPC45 board configuration.
* Add USB and PCI support for INKA4x0 board
+2 -2
View File
@@ -121,7 +121,7 @@ LIBS += common/libcommon.a
.PHONY : $(LIBS)
# Add GCC lib
PLATFORM_LIBS += --no-warn-mismatch -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
# The "tools" are needed early, so put this first
@@ -161,7 +161,7 @@ u-boot.dis: u-boot
u-boot: depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
--start-group $(LIBS) $(PLATFORM_LIBS) --end-group \
--start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
-Map u-boot.map -o u-boot
$(LIBS):
+1 -1
View File
@@ -1,5 +1,5 @@
#
# (C) Copyright 2000 - 2004
# (C) Copyright 2000 - 2005
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
+1634 -1635
View File
File diff suppressed because it is too large. Load diff
+61 -3
View File
@@ -30,6 +30,47 @@
extern void lxt971_no_sleep(void);
int board_revision(void)
{
unsigned long osrl_reg;
unsigned long isr1l_reg;
unsigned long tcr_reg;
unsigned long value;
/*
* Get version of HUB405 board from GPIO's
*/
/*
* Setup GPIO pin(s) (IRQ6/GPIO23)
*/
osrl_reg = in32(GPIO0_OSRH);
isr1l_reg = in32(GPIO0_ISR1H);
tcr_reg = in32(GPIO0_TCR);
out32(GPIO0_OSRH, osrl_reg & ~0x00030000); /* output select */
out32(GPIO0_ISR1H, isr1l_reg | 0x00030000); /* input select */
out32(GPIO0_TCR, tcr_reg & ~0x00000100); /* select input */
udelay(1000); /* wait some time before reading input */
value = in32(GPIO0_IR) & 0x00000100; /* get config bits */
/*
* Restore GPIO settings
*/
out32(GPIO0_OSRH, osrl_reg); /* output select */
out32(GPIO0_ISR1H, isr1l_reg); /* input select */
out32(GPIO0_TCR, tcr_reg); /* enable output driver for outputs */
if (value & 0x00000100) {
/* Revision 1.1 or 1.2 detected */
return 1;
}
/* Revision 1.0 */
return 0;
}
int board_early_init_f (void)
{
/*
@@ -69,6 +110,8 @@ int misc_init_f (void)
int misc_init_r (void)
{
DECLARE_GLOBAL_DATA_PTR;
volatile unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
volatile unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
volatile unsigned char *duart2_mcr = (unsigned char *)((ulong)DUART2_BA + 4);
@@ -77,6 +120,7 @@ int misc_init_r (void)
unsigned long val;
int delay, flashcnt;
char *str;
char hw_rev[4];
/*
* Enable interrupts in exar duart mcr[3]
@@ -121,14 +165,14 @@ int misc_init_r (void)
*/
str = getenv("bd_type"); /* this is only set on non prototype hardware */
if (str != NULL) {
if ((strcmp(str, "swch405") == 0) || (strcmp(str, "hub405") == 0)) {
if ((strcmp(str, "swch405") == 0) || ((!strcmp(str, "hub405") && (gd->board_type >= 1)))) {
unsigned char led_reg_default = 0;
str = getenv("ap_pwr");
if (!str || (str && (str[0] == '1')))
led_reg_default = 0x04 | 0x02 ; /* U2_LED | AP_PWR */
/*
* Flash LEDs on SWCH405
* Flash LEDs
*/
for (flashcnt = 0; flashcnt < 3; flashcnt++) {
*led_reg = led_reg_default; /* LED_A..D off */
@@ -150,6 +194,11 @@ int misc_init_r (void)
out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_DUART_RST); /* set reset to low */
udelay(1000); /* wait 1ms */
/*
* Store hardware revision in environment for further processing
*/
sprintf(hw_rev, "1.%ld", gd->board_type);
setenv("hw_rev", hw_rev);
return (0);
}
@@ -159,6 +208,8 @@ int misc_init_r (void)
*/
int checkboard (void)
{
DECLARE_GLOBAL_DATA_PTR;
unsigned char str[64];
int i = getenv_r ("serial#", str, sizeof(str));
@@ -170,7 +221,14 @@ int checkboard (void)
puts(str);
}
putc ('\n');
if (getenv_r("bd_type", str, sizeof(str)) != -1) {
printf(" (%s", str);
} else {
puts(" (Missing bd_type!");
}
gd->board_type = board_revision();
printf(", Rev 1.%ld)\n", gd->board_type);
/*
* Disable sleep mode in LXT971
+70 -10
View File
@@ -43,13 +43,11 @@ static void sdram_start (int hi_addr)
long hi_addr_bit = hi_addr ? 0x01000000 : 0;
/* unlock mode register */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 |
hi_addr_bit;
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit;
__asm__ volatile ("sync");
/* precharge all banks */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 |
hi_addr_bit;
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
__asm__ volatile ("sync");
#if SDRAM_DDR
@@ -63,13 +61,11 @@ static void sdram_start (int hi_addr)
#endif
/* precharge all banks */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 |
hi_addr_bit;
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit;
__asm__ volatile ("sync");
/* auto refresh */
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 |
hi_addr_bit;
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit;
__asm__ volatile ("sync");
/* set mode register */
@@ -177,15 +173,79 @@ void flash_preinit(void)
*(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
}
#ifdef CONFIG_PCI
#define GPIO_PSC3_9 0x04000000UL
int misc_init_f (void)
{
/* Initialize GPIO output pins.
*/
/* Configure GPT as GPIO output */
*(vu_long *)MPC5XXX_GPT0_ENABLE =
*(vu_long *)MPC5XXX_GPT1_ENABLE =
*(vu_long *)MPC5XXX_GPT2_ENABLE =
*(vu_long *)MPC5XXX_GPT3_ENABLE =
*(vu_long *)MPC5XXX_GPT4_ENABLE =
*(vu_long *)MPC5XXX_GPT5_ENABLE = 0x24;
/* Configure PSC3_6,7 as GPIO output */
*(vu_long *)MPC5XXX_GPIO_ENABLE |= 0x00003000;
*(vu_long *)MPC5XXX_GPIO_DIR |= 0x00003000;
/* Configure PSC3_8 as GPIO output, no interrupt */
*(vu_long *)MPC5XXX_GPIO_SI_ENABLE |= 0x04000000;
*(vu_long *)MPC5XXX_GPIO_SI_DIR |= 0x04000000;
*(vu_long *)MPC5XXX_GPIO_SI_IEN &= ~0x04000000;
/* Configure PSC3_9 and GPIO_WKUP6,7 as GPIO output */
*(vu_long *)MPC5XXX_WU_GPIO_ENABLE |= 0xc4000000;
*(vu_long *)MPC5XXX_WU_GPIO_DIR |= 0xc4000000;
/*
* Reset Coral-P graphics controller
*/
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC3_9;
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC3_9;
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC3_9;
return 0;
}
#ifdef CONFIG_PCI
static struct pci_controller hose;
extern void pci_mpc5xxx_init(struct pci_controller *);
void pci_init_board(void)
{
pci_mpc5xxx_init(&hose);
pci_mpc5xxx_init(&hose);
}
#endif
#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
#define GPIO_PSC1_4 0x01000000UL
void init_ide_reset (void)
{
debug ("init_ide_reset\n");
/* Configure PSC1_4 as GPIO output for ATA reset */
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
/* Deassert reset */
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
}
void ide_set_reset (int idereset)
{
debug ("ide_reset(%d)\n", idereset);
if (idereset) {
*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
/* Make a delay. MPC5200 spec says 25 usec min */
udelay(500000);
} else {
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
}
}
#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+7
View File
@@ -416,6 +416,13 @@ au_update_eeprom(int idx)
int off;
uint32_t val;
/* special case for prepare.img */
if (idx == IDX_PREPARE) {
/* enable the power switch */
*CPLD_VFD_BK &= ~POWER_OFF;
return 0;
}
hdr = (image_header_t *)LOAD_ADDR;
/* write the time field into EEPROM */
off = auee_off[idx].time;
+54 -2
View File
@@ -26,6 +26,7 @@
#include <common.h>
#include <command.h>
#include <s3c2400.h>
#include <rtc.h>
/*
* TRAB board specific commands. Especially commands for burn-in and function
@@ -117,6 +118,7 @@ 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);
int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
/* helper functions */
static void adc_init (void);
@@ -173,6 +175,7 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
led_init ();
global_vars_init ();
test_function_table_init ();
spi_init ();
if (global_vars_write_to_eeprom () != 0) {
printf ("%s: error writing global_vars to eeprom\n",
@@ -334,7 +337,6 @@ int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
spi_init ();
tsc2000_reg_init ();
contact_temp = tsc2000_contact_temp();
printf ("%d degree C * 100\n", contact_temp) ;
@@ -577,7 +579,6 @@ static int test_contact_temp (void)
{
int contact_temp;
spi_init ();
contact_temp = tsc2000_contact_temp ();
if ((contact_temp < MIN_CONTACT_TEMP)
@@ -840,4 +841,55 @@ static int dummy(void)
return (0);
}
int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
int contact_temp;
int delay = 0;
#if (CONFIG_COMMANDS & CFG_CMD_DATE)
struct rtc_time tm;
#endif
if (argc > 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
}
if (argc > 1) {
delay = simple_strtoul(argv[1], NULL, 10);
}
spi_init ();
while (1) {
#if (CONFIG_COMMANDS & CFG_CMD_DATE)
rtc_get (&tm);
printf ("%4d-%02d-%02d %2d:%02d:%02d - ",
tm.tm_year, tm.tm_mon, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
#endif
contact_temp = tsc2000_contact_temp();
printf ("%d\n", contact_temp) ;
if (delay != 0)
/*
* reset timer to avoid timestamp overflow problem
* after about 68 minutes of udelay() time.
*/
reset_timer_masked ();
sdelay (delay);
}
return 0;
}
U_BOOT_CMD(
tlog, 2, 1, do_temp_log,
"tlog - log contact temperature [1/100 C] to console (endlessly)\n",
"delay\n"
" - contact temperature [1/100 C] is printed endlessly to console\n"
" <delay> specifies the seconds to wait between two measurements\n"
" For each measurment a timestamp is printeted\n"
);
#endif /* CFG_CMD_BSP */
+46 -3
View File
@@ -31,6 +31,16 @@
#include "Pt1000_temp_data.h"
/* helper function */
#define abs(value) (((value) < 0) ? ((value)*-1) : (value))
/*
* Maximal allowed deviation between two immediate meassurments of an analog
* thermo channel. 1 DIGIT = 0.0276 °C. This is used to filter sporadic
* "jumps" in measurment.
*/
#define MAX_DEVIATION 18 /* unit: DIGITs of adc; 18 DIGIT = 0.5 °C */
void spi_init(void)
{
S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
@@ -227,15 +237,48 @@ s32 tsc2000_contact_temp (void)
long adc_pt1000, offset;
long u_pt1000;
long contact_temp;
long temp1, temp2;
tsc2000_reg_init ();
tsc2000_set_range (3);
adc_pt1000 = tsc2000_read_channel (14);
/*
* Because of sporadic "jumps" in the measured adc values every
* channel is read two times. If there is a significant difference
* between the two measurements, then print an error and do a third
* measurement, because it is very unlikely that a successive third
* measurement goes also wrong.
*/
temp1 = tsc2000_read_channel (14);
temp2 = tsc2000_read_channel (14);
if (abs(temp2 - temp1) < MAX_DEVIATION)
adc_pt1000 = temp2;
else {
printf ("%s: read adc value (channel 14) exceeded max allowed "
"deviation: %d * 0.0276 °C\n",
__FUNCTION__, MAX_DEVIATION);
printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
temp1, temp2);
adc_pt1000 = tsc2000_read_channel (14);
printf ("use (third read) adc value: adc_pt1000 = "
"%ld DIGITs\n", adc_pt1000);
}
debug ("read channel 14 (pt1000 adc value): %ld\n", adc_pt1000);
offset = tsc2000_read_channel (15);
temp1 = tsc2000_read_channel (15);
temp2 = tsc2000_read_channel (15);
if (abs(temp2 - temp1) < MAX_DEVIATION)
offset = temp2;
else {
printf ("%s: read adc value (channel 15) exceeded max allowed "
"deviation: %d * 0.0276 °C\n",
__FUNCTION__, MAX_DEVIATION);
printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
temp1, temp2);
offset = tsc2000_read_channel (15);
printf ("use (third read) adc value: offset = %ld DIGITs\n",
offset);
}
debug ("read channel 15 (offset): %ld\n", offset);
/*
+5 -2
View File
@@ -41,6 +41,9 @@
#include <linux/ctype.h>
#include <asm/byteorder.h>
#include <ext2fs.h>
#if ((CONFIG_COMMANDS & CFG_CMD_USB) && defined(CONFIG_USB_STORAGE))
#include <usb.h>
#endif
#ifndef CONFIG_DOS_PARTITION
#error DOS partition support must be selected
@@ -161,7 +164,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
char *filename = NULL;
char *ep;
int dev, part = 0;
int dev, part = 1;
ulong addr = 0, part_length, filelen;
disk_partition_t info;
block_dev_desc_t *dev_desc = NULL;
@@ -223,7 +226,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
PRINTF("Using device %s%d, partition %d\n", argv[1], dev, part);
if (part != 0) {
if (get_partition_info (&dev_desc[dev], part, &info)) {
if (get_partition_info (dev_desc, part, &info)) {
printf ("** Bad partition %d **\n", part);
return(1);
}
+165 -173
View File
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2000-2004
* (C) Copyright 2000-2005
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
@@ -62,17 +62,10 @@ static unsigned long mips_io_port_base = 0;
#ifdef __PPC__
# define EIEIO __asm__ volatile ("eieio")
# define SYNC __asm__ volatile ("sync")
#else
# define EIEIO /* nothing */
#endif
#undef IDE_DEBUG
#ifdef IDE_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define PRINTF(fmt,args...)
# define SYNC /* nothing */
#endif
#if (CONFIG_COMMANDS & CFG_CMD_IDE)
@@ -135,9 +128,9 @@ ulong ide_bus_offset[CFG_IDE_MAXBUS] = {
#define ATA_CURR_BASE(dev) (CFG_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
#ifndef CONFIG_AMIGAONEG3SE
static int ide_bus_ok[CFG_IDE_MAXBUS];
static int ide_bus_ok[CFG_IDE_MAXBUS];
#else
static int ide_bus_ok[CFG_IDE_MAXBUS] = {0,};
static int ide_bus_ok[CFG_IDE_MAXBUS] = {0,};
#endif
block_dev_desc_t ide_dev_desc[CFG_IDE_MAXDEVICE];
@@ -374,8 +367,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *boot_device = NULL;
char *ep;
int dev, part = 0;
ulong cnt;
ulong addr;
ulong addr, cnt, checksum;
disk_partition_t info;
image_header_t *hdr;
int rcode = 0;
@@ -421,7 +413,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
part = simple_strtoul(++ep, NULL, 16);
}
if (get_partition_info (&ide_dev_desc[dev], part, &info)) {
if (get_partition_info (ide_dev_desc, part, &info)) {
SHOW_BOOT_PROGRESS (-1);
return 1;
}
@@ -438,7 +430,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
"Name: %.32s Type: %.32s\n",
dev, part, info.name, info.type);
PRINTF ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
info.start, info.size, info.blksz);
if (ide_dev_desc[dev].block_read (dev, info.start, 1, (ulong *)addr) != 1) {
@@ -449,20 +441,29 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
if (ntohl(hdr->ih_magic) == IH_MAGIC) {
print_image_hdr (hdr);
cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
} else {
if (ntohl(hdr->ih_magic) != IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
SHOW_BOOT_PROGRESS (-1);
return 1;
}
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
puts ("\n** Bad Header Checksum **\n");
SHOW_BOOT_PROGRESS (-2);
return 1;
}
hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
print_image_hdr (hdr);
cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
if (ide_dev_desc[dev].block_read (dev, info.start+1, cnt,
(ulong *)(addr+info.blksz)) != cnt) {
printf ("** Read error on %d:%d\n", dev, part);
@@ -542,19 +543,19 @@ void ide_init (void)
#ifdef CONFIG_IDE_8xx_DIRECT
/* Initialize PIO timing tables */
for (i=0; i <= IDE_MAX_PIO_MODE; ++i) {
pio_config_clk[i].t_setup = PCMCIA_MK_CLKS(pio_config_ns[i].t_setup,
gd->bus_clk);
pio_config_clk[i].t_length = PCMCIA_MK_CLKS(pio_config_ns[i].t_length,
gd->bus_clk);
pio_config_clk[i].t_hold = PCMCIA_MK_CLKS(pio_config_ns[i].t_hold,
gd->bus_clk);
PRINTF ("PIO Mode %d: setup=%2d ns/%d clk"
" len=%3d ns/%d clk"
" hold=%2d ns/%d clk\n",
i,
pio_config_ns[i].t_setup, pio_config_clk[i].t_setup,
pio_config_ns[i].t_length, pio_config_clk[i].t_length,
pio_config_ns[i].t_hold, pio_config_clk[i].t_hold);
pio_config_clk[i].t_setup = PCMCIA_MK_CLKS(pio_config_ns[i].t_setup,
gd->bus_clk);
pio_config_clk[i].t_length = PCMCIA_MK_CLKS(pio_config_ns[i].t_length,
gd->bus_clk);
pio_config_clk[i].t_hold = PCMCIA_MK_CLKS(pio_config_ns[i].t_hold,
gd->bus_clk);
debug ( "PIO Mode %d: setup=%2d ns/%d clk"
" len=%3d ns/%d clk"
" hold=%2d ns/%d clk\n",
i,
pio_config_ns[i].t_setup, pio_config_clk[i].t_setup,
pio_config_ns[i].t_length, pio_config_clk[i].t_length,
pio_config_ns[i].t_hold, pio_config_clk[i].t_hold);
}
#endif /* CONFIG_IDE_8xx_DIRECT */
@@ -583,9 +584,9 @@ void ide_init (void)
#else
s = getenv("ide_maxbus");
if (s)
max_bus_scan = simple_strtol(s, NULL, 10);
max_bus_scan = simple_strtol(s, NULL, 10);
else
max_bus_scan = CFG_IDE_MAXBUS;
max_bus_scan = CFG_IDE_MAXBUS;
for (bus=0; bus<max_bus_scan; ++bus) {
int dev = bus * (CFG_IDE_MAXDEVICE / max_bus_scan);
@@ -628,8 +629,8 @@ void ide_init (void)
#ifdef CONFIG_AMIGAONEG3SE
/* If this is the second bus, the first one was OK */
if (bus != 0) {
ide_bus_ok[bus] = 0;
goto skip_bus;
ide_bus_ok[bus] = 0;
goto skip_bus;
}
#endif
return;
@@ -641,11 +642,11 @@ void ide_init (void)
if (c & (ATA_STAT_BUSY | ATA_STAT_FAULT)) {
puts ("not available ");
PRINTF ("Status = 0x%02X ", c);
debug ("Status = 0x%02X ", c);
#ifndef CONFIG_ATAPI /* ATAPI Devices do not set DRDY */
} else if ((c & ATA_STAT_READY) == 0) {
puts ("not available ");
PRINTF ("Status = 0x%02X ", c);
debug ("Status = 0x%02X ", c);
#endif
} else {
puts ("OK ");
@@ -706,7 +707,7 @@ set_pcmcia_timing (int pmode)
volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
ulong timings;
PRINTF ("Set timing for PIO Mode %d\n", pmode);
debug ("Set timing for PIO Mode %d\n", pmode);
timings = PCMCIA_SHT(pio_config_clk[pmode].t_hold)
| PCMCIA_SST(pio_config_clk[pmode].t_setup)
@@ -721,7 +722,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR0: %08x POR0: %08x\n", pcmp->pcmc_pbr0, pcmp->pcmc_por0);
debug ("PBR0: %08x POR0: %08x\n", pcmp->pcmc_pbr0, pcmp->pcmc_por0);
pcmp->pcmc_pbr1 = CFG_PCMCIA_PBR1;
pcmp->pcmc_por1 = CFG_PCMCIA_POR1
@@ -729,7 +730,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR1: %08x POR1: %08x\n", pcmp->pcmc_pbr1, pcmp->pcmc_por1);
debug ("PBR1: %08x POR1: %08x\n", pcmp->pcmc_pbr1, pcmp->pcmc_por1);
pcmp->pcmc_pbr2 = CFG_PCMCIA_PBR2;
pcmp->pcmc_por2 = CFG_PCMCIA_POR2
@@ -737,7 +738,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR2: %08x POR2: %08x\n", pcmp->pcmc_pbr2, pcmp->pcmc_por2);
debug ("PBR2: %08x POR2: %08x\n", pcmp->pcmc_pbr2, pcmp->pcmc_por2);
pcmp->pcmc_pbr3 = CFG_PCMCIA_PBR3;
pcmp->pcmc_por3 = CFG_PCMCIA_POR3
@@ -745,7 +746,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR3: %08x POR3: %08x\n", pcmp->pcmc_pbr3, pcmp->pcmc_por3);
debug ("PBR3: %08x POR3: %08x\n", pcmp->pcmc_pbr3, pcmp->pcmc_por3);
/* IDE 1
*/
@@ -755,7 +756,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR4: %08x POR4: %08x\n", pcmp->pcmc_pbr4, pcmp->pcmc_por4);
debug ("PBR4: %08x POR4: %08x\n", pcmp->pcmc_pbr4, pcmp->pcmc_por4);
pcmp->pcmc_pbr5 = CFG_PCMCIA_PBR5;
pcmp->pcmc_por5 = CFG_PCMCIA_POR5
@@ -763,7 +764,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR5: %08x POR5: %08x\n", pcmp->pcmc_pbr5, pcmp->pcmc_por5);
debug ("PBR5: %08x POR5: %08x\n", pcmp->pcmc_pbr5, pcmp->pcmc_por5);
pcmp->pcmc_pbr6 = CFG_PCMCIA_PBR6;
pcmp->pcmc_por6 = CFG_PCMCIA_POR6
@@ -771,7 +772,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR6: %08x POR6: %08x\n", pcmp->pcmc_pbr6, pcmp->pcmc_por6);
debug ("PBR6: %08x POR6: %08x\n", pcmp->pcmc_pbr6, pcmp->pcmc_por6);
pcmp->pcmc_pbr7 = CFG_PCMCIA_PBR7;
pcmp->pcmc_por7 = CFG_PCMCIA_POR7
@@ -779,7 +780,7 @@ set_pcmcia_timing (int pmode)
| timings
#endif
;
PRINTF ("PBR7: %08x POR7: %08x\n", pcmp->pcmc_pbr7, pcmp->pcmc_por7);
debug ("PBR7: %08x POR7: %08x\n", pcmp->pcmc_pbr7, pcmp->pcmc_por7);
}
@@ -791,7 +792,7 @@ set_pcmcia_timing (int pmode)
static void __inline__
ide_outb(int dev, int port, unsigned char val)
{
PRINTF ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
dev, port, val, (ATA_CURR_BASE(dev)+port));
/* Ensure I/O operations complete */
@@ -815,7 +816,7 @@ ide_inb(int dev, int port)
/* Ensure I/O operations complete */
EIEIO;
val = *((uchar *)(ATA_CURR_BASE(dev)+port));
PRINTF ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
dev, port, (ATA_CURR_BASE(dev)+port), val);
return (val);
}
@@ -844,7 +845,7 @@ output_data_short(int dev, ulong *sect_buf, int words)
}
if (words&1)
*pbuf = 0;
*pbuf = 0;
}
# endif /* CONFIG_AMIGAONEG3SE */
#endif /* __PPC_ */
@@ -857,17 +858,7 @@ output_data_short(int dev, ulong *sect_buf, int words)
static void
input_swap_data(int dev, ulong *sect_buf, int words)
{
#ifndef CONFIG_HMI10
volatile ushort *pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
ushort *dbuf = (ushort *)sect_buf;
PRINTF("in input swap data base for read is %lx\n", (unsigned long) pbuf);
while (words--) {
*dbuf++ = ld_le16(pbuf);
*dbuf++ = ld_le16(pbuf);
}
#else /* CONFIG_HMI10 */
#if defined(CONFIG_HMI10) || defined(CONFIG_CPC45)
uchar i;
volatile uchar *pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
volatile uchar *pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
@@ -880,7 +871,17 @@ input_swap_data(int dev, ulong *sect_buf, int words)
dbuf+=1;
}
}
#endif /* CONFIG_HMI10 */
#else
volatile ushort *pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
ushort *dbuf = (ushort *)sect_buf;
debug("in input swap data base for read is %lx\n", (unsigned long) pbuf);
while (words--) {
*dbuf++ = ld_le16(pbuf);
*dbuf++ = ld_le16(pbuf);
}
#endif
}
#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */
@@ -889,19 +890,7 @@ input_swap_data(int dev, ulong *sect_buf, int words)
static void
output_data(int dev, ulong *sect_buf, int words)
{
#ifndef CONFIG_HMI10
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
while (words--) {
EIEIO;
*pbuf = *dbuf++;
EIEIO;
*pbuf = *dbuf++;
}
#else /* CONFIG_HMI10 */
#if defined(CONFIG_HMI10) || defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@ -919,7 +908,19 @@ output_data(int dev, ulong *sect_buf, int words)
EIEIO;
*pbuf_odd = *dbuf++;
}
#endif /* CONFIG_HMI10 */
#else
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
while (words--) {
EIEIO;
*pbuf = *dbuf++;
EIEIO;
*pbuf = *dbuf++;
}
#endif
}
#else /* ! __PPC__ */
static void
@@ -933,22 +934,7 @@ output_data(int dev, ulong *sect_buf, int words)
static void
input_data(int dev, ulong *sect_buf, int words)
{
#ifndef CONFIG_HMI10
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
PRINTF("in input data base for read is %lx\n", (unsigned long) pbuf);
while (words--) {
EIEIO;
*dbuf++ = *pbuf;
EIEIO;
*dbuf++ = *pbuf;
}
#else /* CONFIG_HMI10 */
#if defined(CONFIG_HMI10) || defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@ -957,20 +943,35 @@ input_data(int dev, ulong *sect_buf, int words)
pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
dbuf = (uchar *)sect_buf;
while (words--) {
EIEIO;
EIEIO;
*dbuf++ = *pbuf_even;
EIEIO;
EIEIO;
SYNC;
*dbuf++ = *pbuf_odd;
EIEIO;
EIEIO;
SYNC;
*dbuf++ = *pbuf_even;
EIEIO;
EIEIO;
SYNC;
*dbuf++ = *pbuf_odd;
EIEIO;
SYNC;
}
#endif /* CONFIG_HMI10 */
#else
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
debug("in input data base for read is %lx\n", (unsigned long) pbuf);
while (words--) {
EIEIO;
*dbuf++ = *pbuf;
EIEIO;
*dbuf++ = *pbuf;
}
#endif
}
#else /* ! __PPC__ */
static void
@@ -997,8 +998,8 @@ input_data_short(int dev, ulong *sect_buf, int words)
}
if (words&1) {
ushort dummy;
dummy = *pbuf;
ushort dummy;
dummy = *pbuf;
}
}
#endif
@@ -1087,14 +1088,14 @@ static void ide_ident (block_dev_desc_t *dev_desc)
s = getenv("ide_doreset");
if (s && strcmp(s, "on") == 0)
#endif
{
/* Need to soft reset the device in case it's an ATAPI... */
PRINTF("Retrying...\n");
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
udelay(100000);
ide_outb (device, ATA_COMMAND, 0x08);
udelay (500000); /* 500 ms */
}
{
/* Need to soft reset the device in case it's an ATAPI... */
debug ("Retrying...\n");
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
udelay(100000);
ide_outb (device, ATA_COMMAND, 0x08);
udelay (500000); /* 500 ms */
}
/* Select device
*/
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
@@ -1144,16 +1145,16 @@ static void ide_ident (block_dev_desc_t *dev_desc)
printf ("tPIO = 0x%02x = %d\n",mode, mode);
if (mode > 2) { /* 2 is maximum allowed tPIO value */
mode = 2;
PRINTF ("Override tPIO -> 2\n");
debug ("Override tPIO -> 2\n");
}
if (iop->field_valid & 2) { /* drive implements ATA2? */
PRINTF ("Drive implements ATA2\n");
debug ("Drive implements ATA2\n");
if (iop->capability & 8) { /* drive supports use_iordy? */
cycle_time = iop->eide_pio_iordy;
} else {
cycle_time = iop->eide_pio;
}
PRINTF ("cycle time = %d\n", cycle_time);
debug ("cycle time = %d\n", cycle_time);
mode = 4;
if (cycle_time > 120) mode = 3; /* 120 ns for PIO mode 4 */
if (cycle_time > 180) mode = 2; /* 180 ns for PIO mode 3 */
@@ -1208,8 +1209,7 @@ static void ide_ident (block_dev_desc_t *dev_desc)
ide_outb (device, ATA_LBA_LOW, 0);
ide_outb (device, ATA_LBA_MID, 0);
ide_outb (device, ATA_LBA_HIGH, 0);
ide_outb (device, ATA_DEV_HD, ATA_LBA |
ATA_DEVICE(device));
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
ide_outb (device, ATA_COMMAND, 0xe3);
udelay (50);
c = ide_wait (device, IDE_TIME_OUT); /* can't take over 500 ms */
@@ -1232,7 +1232,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer)
lba48 = 1;
}
#endif
PRINTF ("ide_read dev %d start %qX, blocks %lX buffer at %lX\n",
debug ("ide_read dev %d start %qX, blocks %lX buffer at %lX\n",
device, blknr, blkcnt, (ulong)buffer);
ide_led (DEVICE_LED(device), 1); /* LED on */
@@ -1262,7 +1262,7 @@ ulong ide_read (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer)
printf ("No Powersaving mode %X\n", c);
} else {
c = ide_inb(device,ATA_SECT_CNT);
PRINTF("Powersaving %02X\n",c);
debug ("Powersaving %02X\n",c);
if(c==0)
pwrsave=1;
}
@@ -1583,34 +1583,13 @@ static void ide_led (uchar led, uchar status)
* ATAPI Support
*/
#undef ATAPI_DEBUG
#ifdef ATAPI_DEBUG
#define AT_PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define AT_PRINTF(fmt,args...)
#endif
#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA)
/* since ATAPI may use commands with not 4 bytes alligned length
* we have our own transfer functions, 2 bytes alligned */
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
#ifndef CONFIG_HMI10
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
PRINTF("in output data shorts base for read is %lx\n", (unsigned long) pbuf);
while (shorts--) {
EIEIO;
*pbuf = *dbuf++;
}
#else /* CONFIG_HMI10 */
#if defined(CONFIG_HMI10) || defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@ -1623,26 +1602,26 @@ output_data_shorts(int dev, ushort *sect_buf, int shorts)
EIEIO;
*pbuf_odd = *dbuf++;
}
#endif /* CONFIG_HMI10 */
}
static void
input_data_shorts(int dev, ushort *sect_buf, int shorts)
{
#ifndef CONFIG_HMI10
#else
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
PRINTF("in input data shorts base for read is %lx\n", (unsigned long) pbuf);
debug ("in output data shorts base for read is %lx\n", (unsigned long) pbuf);
while (shorts--) {
EIEIO;
*dbuf++ = *pbuf;
*pbuf = *dbuf++;
}
#else /* CONFIG_HMI10 */
#endif
}
static void
input_data_shorts(int dev, ushort *sect_buf, int shorts)
{
#if defined(CONFIG_HMI10) || defined(CONFIG_CPC45)
uchar *dbuf;
volatile uchar *pbuf_even;
volatile uchar *pbuf_odd;
@@ -1655,7 +1634,20 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
EIEIO;
*dbuf++ = *pbuf_odd;
}
#endif /* CONFIG_HMI10 */
#else
ushort *dbuf;
volatile ushort *pbuf;
pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
dbuf = (ushort *)sect_buf;
debug("in input data shorts base for read is %lx\n", (unsigned long) pbuf);
while (shorts--) {
EIEIO;
*dbuf++ = *pbuf;
}
#endif
}
#else /* ! __PPC__ */
@@ -1758,7 +1750,7 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha
if ((c & mask) != res ) {
if (c & ATA_STAT_ERR) {
err=(ide_inb(device,ATA_ERROR_REG))>>4;
AT_PRINTF("atapi_issue 1 returned sense key %X status %02X\n",err,c);
debug ("atapi_issue 1 returned sense key %X status %02X\n",err,c);
} else {
printf ("ATTAPI_ISSUE: (no DRQ) after sending ccb (%x) status 0x%02x\n", ccb[0],c);
err=0xFF;
@@ -1779,18 +1771,18 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha
goto AI_OUT;
}
if(n!=buflen) {
AT_PRINTF("WARNING, transfer bytes %d not equal with requested %d\n",n,buflen);
debug ("WARNING, transfer bytes %d not equal with requested %d\n",n,buflen);
}
if(n!=0) { /* data transfer */
AT_PRINTF("ATAPI_ISSUE: %d Bytes to transfer\n",n);
debug ("ATAPI_ISSUE: %d Bytes to transfer\n",n);
/* we transfer shorts */
n>>=1;
/* ok now decide if it is an in or output */
if ((ide_inb(device, ATA_SECT_CNT)&0x02)==0) {
AT_PRINTF("Write to device\n");
debug ("Write to device\n");
output_data_shorts(device,(unsigned short *)buffer,n);
} else {
AT_PRINTF("Read from device @ %p shorts %d\n",buffer,n);
debug ("Read from device @ %p shorts %d\n",buffer,n);
input_data_shorts(device,(unsigned short *)buffer,n);
}
}
@@ -1800,7 +1792,7 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha
c = atapi_wait_mask(device,ATAPI_TIME_OUT,mask,res);
if ((c & ATA_STAT_ERR) == ATA_STAT_ERR) {
err=(ide_inb(device,ATA_ERROR_REG) >> 4);
AT_PRINTF("atapi_issue 2 returned sense key %X status %X\n",err,c);
debug ("atapi_issue 2 returned sense key %X status %X\n",err,c);
} else {
err = 0;
}
@@ -1848,7 +1840,7 @@ retry:
if (res==0xFF)
return (0xFF); /* error */
AT_PRINTF("(auto_req)atapi_issue returned sense key %X\n",res);
debug ("(auto_req)atapi_issue returned sense key %X\n",res);
memset(sense_ccb,0,sizeof(sense_ccb));
memset(sense_data,0,sizeof(sense_data));
@@ -1860,8 +1852,8 @@ retry:
asc=(sense_data[12]);
ascq=(sense_data[13]);
AT_PRINTF("ATAPI_CMD_REQ_SENSE returned %x\n",res);
AT_PRINTF(" Sense page: %02X key %02X ASC %02X ASCQ %02X\n",
debug ("ATAPI_CMD_REQ_SENSE returned %x\n",res);
debug (" Sense page: %02X key %02X ASC %02X ASCQ %02X\n",
sense_data[0],
key,
asc,
@@ -1887,13 +1879,13 @@ retry:
goto error;
}
if(asc==0x3a) {
AT_PRINTF("Media not present\n");
debug ("Media not present\n");
goto error;
}
#ifdef CONFIG_AMIGAONEG3SE
if ((sense_data[2]&0xF)==0x0B) {
AT_PRINTF("ABORTED COMMAND...retry\n");
debug ("ABORTED COMMAND...retry\n");
if (retrycnt++ < 4)
goto retry;
return (0xFF);
@@ -1902,7 +1894,7 @@ retry:
if ((sense_data[2]&0xf) == 0x02 &&
sense_data[12] == 0x04 &&
sense_data[13] == 0x01 ) {
AT_PRINTF("Waiting for unit to become active\n");
debug ("Waiting for unit to become active\n");
udelay(timeout);
if (retrycnt++ < 4)
goto retry;
@@ -1912,7 +1904,7 @@ retry:
printf ("ERROR: Unknown Sense key %02X ASC %02X ASCQ %02X\n",key,asc,ascq);
error:
AT_PRINTF ("ERROR Sense key %02X ASC %02X ASCQ %02X\n",key,asc,ascq);
debug ("ERROR Sense key %02X ASC %02X ASCQ %02X\n",key,asc,ascq);
return (0xFF);
}
@@ -1935,7 +1927,7 @@ static void atapi_inquiry(block_dev_desc_t * dev_desc)
ccb[4]=40; /* allocation Legnth */
c=atapi_issue_autoreq(device,ccb,12,(unsigned char *)iobuf,40);
AT_PRINTF("ATAPI_CMD_INQUIRY returned %x\n",c);
debug ("ATAPI_CMD_INQUIRY returned %x\n",c);
if (c!=0)
return;
@@ -1961,7 +1953,7 @@ static void atapi_inquiry(block_dev_desc_t * dev_desc)
c=atapi_issue_autoreq(device,ccb,12,(unsigned char *)iobuf,0);
AT_PRINTF("ATAPI_CMD_START_STOP returned %x\n",c);
debug ("ATAPI_CMD_START_STOP returned %x\n",c);
if (c!=0)
return;
@@ -1969,7 +1961,7 @@ static void atapi_inquiry(block_dev_desc_t * dev_desc)
memset(iobuf,0,sizeof(iobuf));
c=atapi_issue_autoreq(device,ccb,12,(unsigned char *)iobuf,0);
AT_PRINTF("ATAPI_CMD_UNIT_TEST_READY returned %x\n",c);
debug ("ATAPI_CMD_UNIT_TEST_READY returned %x\n",c);
if (c!=0)
return;
@@ -1977,11 +1969,11 @@ static void atapi_inquiry(block_dev_desc_t * dev_desc)
memset(iobuf,0,sizeof(iobuf));
ccb[0]=ATAPI_CMD_READ_CAP;
c=atapi_issue_autoreq(device,ccb,12,(unsigned char *)iobuf,8);
AT_PRINTF("ATAPI_CMD_READ_CAP returned %x\n",c);
debug ("ATAPI_CMD_READ_CAP returned %x\n",c);
if (c!=0)
return;
AT_PRINTF("Read Cap: LBA %02X%02X%02X%02X blksize %02X%02X%02X%02X\n",
debug ("Read Cap: LBA %02X%02X%02X%02X blksize %02X%02X%02X%02X\n",
iobuf[0],iobuf[1],iobuf[2],iobuf[3],
iobuf[4],iobuf[5],iobuf[6],iobuf[7]);
@@ -2015,7 +2007,7 @@ ulong atapi_read (int device, lbaint_t blknr, ulong blkcnt, ulong *buffer)
unsigned char ccb[12]; /* Command descriptor block */
ulong cnt;
AT_PRINTF("atapi_read dev %d start %lX, blocks %lX buffer at %lX\n",
debug ("atapi_read dev %d start %lX, blocks %lX buffer at %lX\n",
device, blknr, blkcnt, (ulong)buffer);
do {
+1 -1
View File
@@ -212,7 +212,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
PRINTF("Using device %s%d, partition %d\n", argv[1], dev, part);
if (part != 0) {
if (get_partition_info (&dev_desc[dev], part, &info)) {
if (get_partition_info (dev_desc, part, &info)) {
printf ("** Bad partition %d **\n", part);
return 1;
}
+26 -29
View File
@@ -27,7 +27,6 @@
/*
* SCSI support.
*/
#include <common.h>
#include <command.h>
#include <asm/processor.h>
@@ -35,15 +34,6 @@
#include <image.h>
#include <pci.h>
#undef SCSI_DEBUG
#ifdef SCSI_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define PRINTF(fmt,args...)
#endif
#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
#ifdef CONFIG_SCSI_SYM53C8XX
@@ -120,7 +110,7 @@ void scsi_scan(int mode)
scsi_setup_inquiry(pccb);
if(scsi_exec(pccb)!=TRUE) {
if(pccb->contr_stat==SCSI_SEL_TIME_OUT) {
PRINTF("Selection timeout ID %d\n",pccb->target);
debug ("Selection timeout ID %d\n",pccb->target);
continue; /* selection timeout => assuming no device present */
}
scsi_print_error(pccb);
@@ -211,8 +201,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *boot_device = NULL;
char *ep;
int dev, part = 0;
ulong cnt;
ulong addr;
ulong addr, cnt, checksum;
disk_partition_t info;
image_header_t *hdr;
int rcode = 0;
@@ -254,7 +243,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
part = simple_strtoul(++ep, NULL, 16);
}
if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
if (get_partition_info (scsi_dev_desc, part, &info)) {
printf("error reading partinfo\n");
return 1;
}
@@ -270,7 +259,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
"Name: %.32s Type: %.32s\n",
dev, part, info.name, info.type);
PRINTF ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
info.start, info.size, info.blksz);
if (scsi_read (dev, info.start, 1, (ulong *)addr) != 1) {
@@ -280,18 +269,26 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
if (hdr->ih_magic == IH_MAGIC) {
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
} else {
if (ntohl(hdr->ih_magic) == IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
return 1;
}
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
puts ("\n** Bad Header Checksum **\n");
return 1;
}
hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
print_image_hdr (hdr);
cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
if (scsi_read (dev, info.start+1, cnt,
(ulong *)(addr+info.blksz)) != cnt) {
printf ("** Read error on %d:%d\n", dev, part);
@@ -359,7 +356,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ok++;
if (dev)
printf("\n");
PRINTF("print_part of %x\n",dev);
debug ("print_part of %x\n",dev);
print_part(&scsi_dev_desc[dev]);
}
}
@@ -435,7 +432,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
buf_addr=(unsigned long)buffer;
start=blknr;
blks=blkcnt;
PRINTF("\nscsi_read: dev %d startblk %lx, blccnt %lx buffer %lx\n",device,start,blks,(unsigned long)buffer);
debug ("\nscsi_read: dev %d startblk %lx, blccnt %lx buffer %lx\n",device,start,blks,(unsigned long)buffer);
do {
pccb->pdata=(unsigned char *)buf_addr;
if(blks>SCSI_MAX_READ_BLK) {
@@ -452,7 +449,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
start+=blks;
blks=0;
}
PRINTF("scsi_read_ext: startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
debug ("scsi_read_ext: startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
if(scsi_exec(pccb)!=TRUE) {
scsi_print_error(pccb);
blkcnt-=blks;
@@ -460,7 +457,7 @@ ulong scsi_read(int device, ulong blknr, ulong blkcnt, ulong *buffer)
}
buf_addr+=pccb->datalen;
} while(blks!=0);
PRINTF("scsi_read_ext: end startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
debug ("scsi_read_ext: end startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
return(blkcnt);
}
@@ -551,7 +548,7 @@ void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks)
pccb->cmd[6]=0;
pccb->cmdlen=10;
pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
PRINTF("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
debug ("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
pccb->cmd[0],pccb->cmd[1],
pccb->cmd[2],pccb->cmd[3],pccb->cmd[4],pccb->cmd[5],
pccb->cmd[7],pccb->cmd[8]);
@@ -567,7 +564,7 @@ void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks)
pccb->cmd[5]=0;
pccb->cmdlen=6;
pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
PRINTF("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
debug ("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
pccb->cmd[0],pccb->cmd[1],
pccb->cmd[2],pccb->cmd[3],pccb->cmd[4]);
}
+24 -18
View File
@@ -32,14 +32,9 @@
#include <usb.h>
#undef CMD_USB_DEBUG
#ifdef CMD_USB_DEBUG
#define CMD_USB_PRINTF(fmt,args...) printf (fmt ,##args)
#else
#define CMD_USB_PRINTF(fmt,args...)
#endif
#ifdef CONFIG_USB_STORAGE
static int usb_stor_curr_dev=-1; /* current device */
#endif
/* some display routines (info command) */
char * usb_get_class_desc(unsigned char dclass)
@@ -316,9 +311,8 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
char *boot_device = NULL;
char *ep;
int dev, part=0, rcode;
ulong cnt;
ulong addr;
int dev, part=1, rcode;
ulong addr, cnt, checksum;
disk_partition_t info;
image_header_t *hdr;
block_dev_desc_t *stor_dev;
@@ -385,7 +379,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
"Name: %.32s Type: %.32s\n",
dev, part, info.name, info.type);
printf ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
info.start, info.size, info.blksz);
if (stor_dev->block_read(dev, info.start, 1, (ulong *)addr) != 1) {
@@ -395,17 +389,27 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr = (image_header_t *)addr;
if (hdr->ih_magic == IH_MAGIC) {
print_image_hdr (hdr);
cnt = (hdr->ih_size + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
} else {
if (ntohl(hdr->ih_magic) != IH_MAGIC) {
printf("\n** Bad Magic Number **\n");
return 1;
}
checksum = ntohl(hdr->ih_hcrc);
hdr->ih_hcrc = 0;
if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
puts ("\n** Bad Header Checksum **\n");
return 1;
}
hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
print_image_hdr (hdr);
cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
if (stor_dev->block_read (dev, info.start+1, cnt,
(ulong *)(addr+info.blksz)) != cnt) {
printf ("\n** Read error on %d:%d\n", dev, part);
@@ -439,7 +443,9 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int i;
struct usb_device *dev = NULL;
#ifdef CONFIG_USB_STORAGE
block_dev_desc_t *stor_dev;
#endif
if ((strncmp(argv[1],"reset",5) == 0) ||
(strncmp(argv[1],"start",5) == 0)){
+8 -8
View File
@@ -115,7 +115,7 @@ static void mpc5xxx_fec_tbd_init(mpc5xxx_fec_priv *fec)
}
/********************************************************************/
static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, FEC_RBD * pRbd)
static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, volatile FEC_RBD * pRbd)
{
/*
* Reset buffer descriptor as empty
@@ -141,7 +141,7 @@ static void mpc5xxx_fec_rbd_clean(mpc5xxx_fec_priv *fec, FEC_RBD * pRbd)
/********************************************************************/
static void mpc5xxx_fec_tbd_scrub(mpc5xxx_fec_priv *fec)
{
FEC_TBD *pUsedTbd;
volatile FEC_TBD *pUsedTbd;
#if (DEBUG & 0x1)
printf ("tbd_scrub: fec->cleanTbdNum = %d, fec->usedTbdIndex = %d\n",
@@ -354,10 +354,10 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
/*
* Initialize SmartDMA parameters stored in SRAM
*/
*(int *)FEC_TBD_BASE = (int)fec->tbdBase;
*(int *)FEC_RBD_BASE = (int)fec->rbdBase;
*(int *)FEC_TBD_NEXT = (int)fec->tbdBase;
*(int *)FEC_RBD_NEXT = (int)fec->rbdBase;
*(volatile int *)FEC_TBD_BASE = (int)fec->tbdBase;
*(volatile int *)FEC_RBD_BASE = (int)fec->rbdBase;
*(volatile int *)FEC_TBD_NEXT = (int)fec->tbdBase;
*(volatile int *)FEC_RBD_NEXT = (int)fec->rbdBase;
/*
* Enable FEC-Lite controller
@@ -688,7 +688,7 @@ static int mpc5xxx_fec_send(struct eth_device *dev, volatile void *eth_data,
* 6-byte Ethernet addresses.
*/
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
FEC_TBD *pTbd;
volatile FEC_TBD *pTbd;
#if (DEBUG & 0x20)
printf("tbd status: 0x%04x\n", fec->tbdBase[0].status);
@@ -779,7 +779,7 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
* This command pulls one frame from the card
*/
mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev->priv;
FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
volatile FEC_RBD *pRbd = &fec->rbdBase[fec->rbdIndex];
unsigned long ievent;
int frame_length, len = 0;
NBUF *frame;
+2 -1
View File
@@ -36,7 +36,8 @@
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) || \
(CONFIG_MMC) || (CONFIG_SYSTEMACE) )
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE) )
/* ------------------------------------------------------------------------- */
/*
+5 -1
View File
@@ -26,7 +26,11 @@
#include <ide.h>
#include "part_amiga.h"
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_AMIGA_PARTITION)
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) || \
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_AMIGA_PARTITION)
#undef AMIGA_DEBUG
+2 -1
View File
@@ -38,7 +38,8 @@
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) || \
(CONFIG_SYSTEMACE)) && defined(CONFIG_DOS_PARTITION)
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_DOS_PARTITION)
/* Convert char[4] in little endian format to the host format integer
*/
+6 -2
View File
@@ -25,9 +25,13 @@
#include <command.h>
#include "part_iso.h"
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_ISO_PARTITION)
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) || \
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_ISO_PARTITION)
#undef ISO_PART_DEBUG
/* #define ISO_PART_DEBUG */
#ifdef ISO_PART_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args)
+5 -1
View File
@@ -34,7 +34,11 @@
#include <ide.h>
#include "part_mac.h"
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_MAC_PARTITION)
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) || \
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_MAC_PARTITION)
/* stdlib.h causes some compatibility problems; should fixe these! -- wd */
#ifndef __ldiv_t_defined
+31 -38
View File
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2003-2004
* (C) Copyright 2003-2005
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
@@ -443,31 +443,6 @@ static int cb_set_power (socket_info_t * s, socket_state_t * state)
#ifdef CONFIG_CPC45
if ((state->Vcc == 0) && (state->Vpp == 0)) {
u_char power, vcc, vpp;
power = i365_get (s, I365_POWER);
state->flags |= (power & I365_PWR_AUTO) ? SS_PWR_AUTO : 0;
state->flags |= (power & I365_PWR_OUT) ? SS_OUTPUT_ENA : 0;
vcc = power & I365_VCC_MASK;
vpp = power & I365_VPP1_MASK;
state->Vcc = state->Vpp = 0;
if (i365_get (s, PD67_MISC_CTL_1) & PD67_MC1_VCC_3V) {
if (power & I365_VCC_5V)
state->Vcc = 33;
if (vpp == I365_VPP1_5V)
state->Vpp = 33;
} else {
if (power & I365_VCC_5V)
state->Vcc = 50;
if (vpp == I365_VPP1_5V)
state->Vpp = 50;
}
if (power == I365_VPP1_12V)
state->Vpp = 120;
printf ("POWER Vcc:%d Vpp: %d\n", state->Vcc, state->Vpp);
}
reg = I365_PWR_NORESET;
if (state->flags & SS_PWR_AUTO)
reg |= I365_PWR_AUTO;
@@ -497,8 +472,11 @@ static int cb_set_power (socket_info_t * s, socket_state_t * state)
return -1;
}
}
if (reg != i365_get (s, I365_POWER))
if (reg != i365_get (s, I365_POWER)) {
reg = (I365_PWR_OUT | I365_PWR_NORESET | I365_VCC_5V | I365_VPP1_5V);
i365_set (s, I365_POWER, reg);
}
#else /* ! CONFIG_CPC45 */
@@ -579,6 +557,12 @@ static void set_bridge_opts (socket_info_t * s)
}
/*====================================================================*/
#define PD67_EXT_INDEX 0x2e /* Extension index */
#define PD67_EXT_DATA 0x2f /* Extension data */
#define PD67_EXD_VS1(s) (0x01 << ((s)<<1))
#define pd67_ext_get(s, r) \
(i365_set(s, PD67_EXT_INDEX, r), i365_get(s, PD67_EXT_DATA))
static int i365_get_status (socket_info_t * s, u_int * value)
{
@@ -586,6 +570,7 @@ static int i365_get_status (socket_info_t * s, u_int * value)
#ifdef CONFIG_CPC45
u_char val;
u_char power, vcc, vpp;
u_int powerstate;
#endif
status = i365_get (s, I365_IDENT);
@@ -620,24 +605,32 @@ static int i365_get_status (socket_info_t * s, u_int * value)
return -1;
}
i365_bset (s, I365_POWER, I365_VCC_5V);
power = i365_get (s, I365_POWER);
state.flags |= (power & I365_PWR_AUTO) ? SS_PWR_AUTO : 0;
state.flags |= (power & I365_PWR_OUT) ? SS_OUTPUT_ENA : 0;
vcc = power & I365_VCC_MASK;
vpp = power & I365_VPP1_MASK;
state.Vcc = state.Vpp = 0;
if (i365_get (s, PD67_MISC_CTL_1) & PD67_MC1_VCC_3V) {
if (power & I365_VCC_5V)
state.Vcc = 33;
if (vpp == I365_VPP1_5V)
state.Vpp = 33;
} else {
if (power & I365_VCC_5V)
state.Vcc = 50;
if (vpp == I365_VPP1_5V)
state.Vpp = 50;
if((vcc== 0) || (vpp == 0)) {
/*
* On the Cirrus we get the info which card voltage
* we have in EXTERN DATA and write it to MISC_CTL1
*/
powerstate = pd67_ext_get(s, PD67_EXTERN_DATA);
if (powerstate & PD67_EXD_VS1(0)) {
/* 5V Card */
i365_bclr (s, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
} else {
/* 3.3V Card */
i365_bset (s, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
}
i365_set (s, I365_POWER, (I365_PWR_OUT | I365_PWR_NORESET | I365_VCC_5V | I365_VPP1_5V));
power = i365_get (s, I365_POWER);
}
if (power & I365_VCC_5V) {
state.Vcc = (i365_get(s, PD67_MISC_CTL_1) & PD67_MC1_VCC_3V) ? 33 : 50;
}
if (power == I365_VPP1_12V)
state.Vpp = 120;
+1 -4
View File
@@ -33,7 +33,6 @@
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)
{
ext2fs_block_dev_desc = rbdd;
@@ -74,9 +73,7 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
sector += byte_offset >> SECTOR_BITS;
byte_offset &= SECTOR_SIZE - 1;
#if defined(DEBUG)
printf (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
#endif
debug (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
if (ext2fs_block_dev_desc == NULL) {
printf ("** Invalid Block Device Descriptor (NULL)\n");
+4 -4
View File
@@ -724,7 +724,7 @@ int ext2fs_find_file
symlinknest = 0;
if (!path || path[0] != '/') {
if (!path) {
return (0);
}
@@ -769,7 +769,7 @@ int ext2fs_open (char *filename) {
int len;
if (ext2fs_root == NULL) {
return (0);
return (-1);
}
ext2fs_file = NULL;
status = ext2fs_find_file (filename, &ext2fs_root->diropen, &fdiro,
@@ -788,9 +788,9 @@ int ext2fs_open (char *filename) {
ext2fs_file = fdiro;
return (len);
fail:
fail:
ext2fs_free_node (fdiro, &ext2fs_root->diropen);
return (0);
return (-1);
}
+1 -2
View File
@@ -496,14 +496,13 @@
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
#define CFG_ATA_IDE0_OFFSET 0x0000
#define CONFIG_HMI10
#define CFG_ATA_BASE_ADDR CFG_PCMCIA_MEM_ADDR
#define CFG_ATA_DATA_OFFSET CFG_PCMCIA_MEM_SIZE
/* Offset for normal register accesses */
#define CFG_ATA_REG_OFFSET CFG_PCMCIA_MEM_SIZE
#define CFG_ATA_REG_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x320)
/* Offset for alternate registers */
#define CFG_ATA_ALT_OFFSET (CFG_PCMCIA_MEM_SIZE + 0x400)
+2
View File
@@ -42,6 +42,8 @@
#define CONFIG_SYS_CLK_FREQ 33330000 /* external frequency to pll */
#define CONFIG_BOARD_TYPES 1 /* support board types */
#define CONFIG_BAUDRATE 9600
#define CONFIG_BOOTDELAY 3 /* autoboot after 3 seconds */
+11 -6
View File
@@ -132,7 +132,7 @@
/* IDE */
#if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX)
#define ADD_IDE_CMD CFG_CMD_IDE | CFG_CMD_FAT
#define ADD_IDE_CMD (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2)
#else
#define ADD_IDE_CMD 0
#endif
@@ -141,20 +141,25 @@
* Supported commands
*/
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
CFG_CMD_EEPROM | \
CFG_CMD_I2C | \
ADD_IDE_CMD | \
ADD_PCI_CMD | \
ADD_USB_CMD | \
CFG_CMD_POST_DIAG | \
CFG_CMD_ASKENV | \
CFG_CMD_DATE | \
CFG_CMD_REGINFO | \
CFG_CMD_DHCP | \
CFG_CMD_ECHO | \
CFG_CMD_EEPROM | \
CFG_CMD_I2C | \
CFG_CMD_MII | \
CFG_CMD_PING | \
ADD_IDE_CMD)
CFG_CMD_POST_DIAG | \
CFG_CMD_REGINFO )
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
#define CONFIG_TIMESTAMP /* display image timestamps */
#if (TEXT_BASE == 0xFC000000) /* Boot low */
# define CFG_LOWBOOT 1
#endif
+69 -12
View File
@@ -29,25 +29,27 @@
* (easy to change)
*/
#define CONFIG_MPC5xxx 1 /* This is an MPC5xxx CPU */
#define CONFIG_MPC5200 1 /* (more precisely an MPC5200 CPU) */
#define CONFIG_INKA4X0 1 /* INKA4x0 board */
#define CONFIG_MPC5xxx 1 /* This is an MPC5xxx CPU */
#define CONFIG_MPC5200 1 /* (more precisely an MPC5200 CPU) */
#define CONFIG_INKA4X0 1 /* INKA4x0 board */
#define CFG_MPC5XXX_CLKIN 33000000 /* ... running at 33.000000MHz */
#define CFG_MPC5XXX_CLKIN 33000000 /* ... running at 33.000000MHz */
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
#define BOOTFLAG_WARM 0x02 /* Software reboot */
#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
#define BOOTFLAG_WARM 0x02 /* Software reboot */
#define CFG_CACHELINE_SIZE 32 /* For MPC5xxx CPUs */
#define CONFIG_MISC_INIT_F 1 /* Use misc_init_f() */
#define CFG_CACHELINE_SIZE 32 /* For MPC5xxx CPUs */
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
# define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
# define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
#endif
/*
* Serial console configuration
*/
#define CONFIG_PSC_CONSOLE 1 /* console is on PSC1 */
#define CONFIG_BAUDRATE 115200 /* ... at 115200 bps */
#define CONFIG_PSC_CONSOLE 1 /* console is on PSC1 */
#define CONFIG_BAUDRATE 115200 /* ... at 115200 bps */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
/*
@@ -78,12 +80,17 @@
* Supported commands
*/
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
CFG_CMD_EXT2 | \
CFG_CMD_FAT | \
CFG_CMD_IDE | \
CFG_CMD_PCI | \
CFG_CMD_USB )
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
#define CONFIG_TIMESTAMP 1 /* Print image info with timestamp */
#if (TEXT_BASE == 0xFFE00000) /* Boot low */
# define CFG_LOWBOOT 1
#endif
@@ -257,6 +264,21 @@
#define CFG_CS0_START CFG_FLASH_BASE
#define CFG_CS0_SIZE CFG_FLASH_SIZE
/* 32Mbit SRAM @0x30000000 */
#define CFG_CS1_START 0x30000000
#define CFG_CS1_SIZE 0x00400000
#define CFG_CS1_CFG 0x31800 /* for pci_clk = 33 MHz */
/* 2 quad UART @0x80000000 (MBAR is relocated to 0xF0000000) */
#define CFG_CS2_START 0x80000000
#define CFG_CS2_SIZE 0x0001000
#define CFG_CS2_CFG 0x21800 /* for pci_clk = 33 MHz */
/* GPIO in @0x30400000 */
#define CFG_CS3_START 0x30400000
#define CFG_CS3_SIZE 0x00100000
#define CFG_CS3_CFG 0x31800 /* for pci_clk = 33 MHz */
#define CFG_CS_BURST 0x00000000
#define CFG_CS_DEADCYCLE 0x33333333
@@ -265,7 +287,42 @@
*-----------------------------------------------------------------------
*/
#define CONFIG_USB_OHCI
#define CONFIG_USB_CLOCK 0x00015555
#define CONFIG_USB_CONFIG 0x00001000
#define CONFIG_USB_CLOCK 0x00015555
#define CONFIG_USB_CONFIG 0x00001000
#define CONFIG_USB_STORAGE
/*-----------------------------------------------------------------------
* IDE/ATA stuff Supports IDE harddisk
*-----------------------------------------------------------------------
*/
#undef CONFIG_IDE_8xx_PCCARD /* Use IDE with PC Card Adapter */
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
#undef CONFIG_IDE_LED /* LED for ide not supported */
#define CONFIG_IDE_RESET /* reset for ide supported */
#define CONFIG_IDE_PREINIT
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
#define CFG_IDE_MAXDEVICE 2 /* max. 1 drive per IDE bus */
#define CFG_ATA_IDE0_OFFSET 0x0000
#define CFG_ATA_BASE_ADDR MPC5XXX_ATA
/* Offset for data I/O */
#define CFG_ATA_DATA_OFFSET (0x0060)
/* Offset for normal register accesses */
#define CFG_ATA_REG_OFFSET (CFG_ATA_DATA_OFFSET)
/* Offset for alternate registers */
#define CFG_ATA_ALT_OFFSET (0x005C)
/* Interval between registers */
#define CFG_ATA_STRIDE 4
#define CONFIG_ATAPI 1
#endif /* __CONFIG_H */
+2 -2
View File
@@ -290,10 +290,10 @@
#endif /* CFG_HUSH_PARSER */
#endif /* CONFIG_FLASH_8MB */
#if 0 /* disabled for development */
#if 1 /* feel free to disable for development */
#define CONFIG_AUTOBOOT_KEYED /* Enable password protection */
#define CONFIG_AUTOBOOT_PROMPT "\nEnter password - autoboot in %d sec...\n"
#define CONFIG_AUTOBOOT_DELAY_STR "system" /* 1st password */
#define CONFIG_AUTOBOOT_DELAY_STR "R" /* 1st "password" */
#endif
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+15
View File
@@ -233,6 +233,21 @@
/* General Purpose Timers registers */
#define MPC5XXX_GPT0_ENABLE (MPC5XXX_GPT + 0x0)
#define MPC5XXX_GPT0_COUNTER (MPC5XXX_GPT + 0x4)
#define MPC5XXX_GPT1_ENABLE (MPC5XXX_GPT + 0x10)
#define MPC5XXX_GPT1_COUNTER (MPC5XXX_GPT + 0x14)
#define MPC5XXX_GPT2_ENABLE (MPC5XXX_GPT + 0x20)
#define MPC5XXX_GPT2_COUNTER (MPC5XXX_GPT + 0x24)
#define MPC5XXX_GPT3_ENABLE (MPC5XXX_GPT + 0x30)
#define MPC5XXX_GPT3_COUNTER (MPC5XXX_GPT + 0x34)
#define MPC5XXX_GPT4_ENABLE (MPC5XXX_GPT + 0x40)
#define MPC5XXX_GPT4_COUNTER (MPC5XXX_GPT + 0x44)
#define MPC5XXX_GPT5_ENABLE (MPC5XXX_GPT + 0x50)
#define MPC5XXX_GPT5_COUNTER (MPC5XXX_GPT + 0x54)
#define MPC5XXX_GPT6_ENABLE (MPC5XXX_GPT + 0x60)
#define MPC5XXX_GPT6_COUNTER (MPC5XXX_GPT + 0x64)
#define MPC5XXX_GPT7_ENABLE (MPC5XXX_GPT + 0x70)
#define MPC5XXX_GPT7_COUNTER (MPC5XXX_GPT + 0x74)
/* ATA registers */
#define MPC5XXX_ATA_HOST_CONFIG (MPC5XXX_ATA + 0x0000)