mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
11 Commits
LABEL_2003
...
LABEL_2003
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbe4b5cbde | ||
|
|
bb65a31267 | ||
|
|
88a1bfa8b8 | ||
|
|
cad07371fc | ||
|
|
ab209d5107 | ||
|
|
87970ebeb5 | ||
|
|
8a42eac744 | ||
|
|
91e940d9bc | ||
|
|
29127b6a23 | ||
|
|
1d70468b03 | ||
|
|
c3d98ed9ca |
32
CHANGELOG
32
CHANGELOG
@@ -2,6 +2,27 @@
|
||||
Changes for U-Boot 1.0.0:
|
||||
======================================================================
|
||||
|
||||
* Make fatload set filesize environment variable
|
||||
|
||||
* enable basic / medium / high-end configurations for PPChameleonEVB
|
||||
board; fix NAND code
|
||||
|
||||
* enable TFTP client code to specify to the server the desired
|
||||
timeout value (see RFC-2349)
|
||||
|
||||
* Improve SDRAM setup for TRAB board
|
||||
|
||||
* Suppress all output with splashscreen configured only if "splashimage"
|
||||
is set
|
||||
|
||||
* Fix problems with I2C support for mpc5200
|
||||
|
||||
* Adapt TRAB configuration and auto_update to new memory layout
|
||||
|
||||
* Add configuration for wtk board
|
||||
|
||||
* Add support for the Sharp LQ065T9DR51U LCD display
|
||||
|
||||
* Patch by Rune Torgersen, 17 Sep 2003:
|
||||
- Fixes for MPC8266 default config
|
||||
- Allow eth_loopback_test() on 8260 to use a subset of the FCC's
|
||||
@@ -85,6 +106,14 @@ Changes for U-Boot 1.0.0:
|
||||
Changes for U-Boot 0.4.8:
|
||||
======================================================================
|
||||
|
||||
<<<<<<< CHANGELOG
|
||||
<<<<<<< CHANGELOG
|
||||
<<<<<<< CHANGELOG
|
||||
* Add I2C and RTC support for RMU board
|
||||
|
||||
=======
|
||||
=======
|
||||
=======
|
||||
* Patches by Denis Peter, 9 Sep 2003:
|
||||
add FAT support for IDE, SCSI and USB
|
||||
|
||||
@@ -117,6 +146,7 @@ Changes for U-Boot 0.4.8:
|
||||
|
||||
* Avoid flicker on TRAB's VFD
|
||||
|
||||
>>>>>>> 1.130
|
||||
* Add support for SK98xx driver
|
||||
|
||||
* Add PCI support for SL8245 board
|
||||
@@ -162,6 +192,7 @@ Changes for U-Boot 0.4.7:
|
||||
* Add GCC library to examples/Makefile so GCC utility functions will
|
||||
be resolved, too
|
||||
|
||||
>>>>>>> 1.118
|
||||
* Add I2C and RTC support for RMU board using software I2C driver
|
||||
(because of better response to iprobe command); fix problem with
|
||||
"reset" command
|
||||
@@ -170,6 +201,7 @@ Changes for U-Boot 0.4.7:
|
||||
Added CONFIG_BOOTP_DNS2 and CONFIG_BOOTP_SEND_HOSTNAME to
|
||||
CONFIG_BOOTP_MAKS (see README).
|
||||
|
||||
>>>>>>> 1.112
|
||||
* Fix ICU862 environment problem
|
||||
|
||||
* Fix RAM size detection for RMU board
|
||||
|
||||
24
Makefile
24
Makefile
@@ -470,9 +470,15 @@ v37_config: unconfig
|
||||
@echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
|
||||
@./mkconfig $(@:_config=) ppc mpc8xx v37
|
||||
|
||||
wtk_config: unconfig
|
||||
@echo "#define CONFIG_LCD" >include/config.h
|
||||
@echo "#define CONFIG_SHARP_LQ065T9DR51U" >>include/config.h
|
||||
@./mkconfig -a TQM823L ppc mpc8xx tqm8xx
|
||||
|
||||
#########################################################################
|
||||
## PPC4xx Systems
|
||||
#########################################################################
|
||||
xtract_4xx = $(subst _MODEL_BA,,$(subst _MODEL_ME,,$(subst _MODEL_HI,,$(subst _config,,$1))))
|
||||
|
||||
ADCIOP_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx adciop esd
|
||||
@@ -552,8 +558,24 @@ PLU405_config: unconfig
|
||||
PMC405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
|
||||
|
||||
PPChameleonEVB_MODEL_BA_config \
|
||||
PPChameleonEVB_MODEL_ME_config \
|
||||
PPChameleonEVB_MODEL_HI_config \
|
||||
PPChameleonEVB_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx PPChameleonEVB dave
|
||||
@ >include/config.h
|
||||
@[ -z "$(findstring _MODEL_BA,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>include/config.h ; \
|
||||
echo "... BASIC model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_ME,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>include/config.h ; \
|
||||
echo "... MEDIUM model" ; \
|
||||
}
|
||||
@[ -z "$(findstring _MODEL_HI,$@)" ] || \
|
||||
{ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>include/config.h ; \
|
||||
echo "... HIGH-END model" ; \
|
||||
}
|
||||
@./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
|
||||
|
||||
VOH405_config: unconfig
|
||||
@./mkconfig $(@:_config=) ppc ppc4xx voh405 esd
|
||||
|
||||
@@ -261,10 +261,13 @@ nand_probe(ulong physadr);
|
||||
void
|
||||
nand_init(void)
|
||||
{
|
||||
ulong totlen;
|
||||
ulong totlen = 0;
|
||||
|
||||
#if (CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_ME) || \
|
||||
(CONFIG_PPCHAMELEON_MODULE_MODEL == CONFIG_PPCHAMELEON_MODULE_HI)
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND0_BASE);
|
||||
totlen = nand_probe (CFG_NAND0_BASE);
|
||||
totlen += nand_probe (CFG_NAND0_BASE);
|
||||
#endif /* CONFIG_PPCHAMELEON_MODULE_ME, CONFIG_PPCHAMELEON_MODULE_HI */
|
||||
|
||||
debug ("Probing at 0x%.8x\n", CFG_NAND1_BASE);
|
||||
totlen += nand_probe (CFG_NAND1_BASE);
|
||||
|
||||
@@ -105,14 +105,14 @@ struct flash_layout
|
||||
#define AU_FL_APP_ND 0x005BFFFF
|
||||
#define AU_FL_DISK_ST 0x005C0000
|
||||
#define AU_FL_DISK_ND 0x00FFFFFF
|
||||
#else /* 8 MB Flash, 16 MB RAM */
|
||||
#else /* 8 MB Flash, 32 MB RAM */
|
||||
#define AU_FL_FIRMWARE_ST 0x00000000
|
||||
#define AU_FL_FIRMWARE_ND 0x0003FFFF
|
||||
#define AU_FL_KERNEL_ST 0x00040000
|
||||
#define AU_FL_KERNEL_ND 0x0011FFFF
|
||||
#define AU_FL_APP_ST 0x00120000
|
||||
#define AU_FL_APP_ND 0x003FFFFF
|
||||
#define AU_FL_DISK_ST 0x00400000
|
||||
#define AU_FL_FIRMWARE_ND 0x0005FFFF
|
||||
#define AU_FL_KERNEL_ST 0x00060000
|
||||
#define AU_FL_KERNEL_ND 0x0013FFFF
|
||||
#define AU_FL_APP_ST 0x00140000
|
||||
#define AU_FL_APP_ND 0x0067FFFF
|
||||
#define AU_FL_DISK_ST 0x00680000
|
||||
#define AU_FL_DISK_ND 0x007DFFFF
|
||||
#define AU_FL_VFD_ST 0x007E0000
|
||||
#define AU_FL_VFD_ND 0x007FFFFF
|
||||
@@ -186,8 +186,8 @@ struct flash_layout aufl_layout[AU_MAXFILES - 3] = { \
|
||||
#define LOAD_ADDR ((unsigned char *)0x0C100100)
|
||||
/* where to build strings in memory - 256 bytes should be enough */
|
||||
#define STRING_ADDR ((char *)0x0C100000)
|
||||
/* the disk is the largest image */
|
||||
#define MAX_LOADSZ ausize[IDX_DISK]
|
||||
/* the app is the largest image */
|
||||
#define MAX_LOADSZ ausize[IDX_APP]
|
||||
|
||||
/* externals */
|
||||
extern int fat_register_device(block_dev_desc_t *, int);
|
||||
@@ -222,7 +222,7 @@ au_check_valid(int idx, long nbytes)
|
||||
#endif
|
||||
if (ntohl(hdr->ih_magic) != IH_MAGIC ||
|
||||
hdr->ih_arch != IH_CPU_ARM ||
|
||||
nbytes < ntohl(hdr->ih_size))
|
||||
nbytes != (sizeof(*hdr) + ntohl(hdr->ih_size)))
|
||||
{
|
||||
printf ("Image %s bad MAGIC or ARCH or SIZE\n", aufile[idx]);
|
||||
return -1;
|
||||
@@ -313,9 +313,12 @@ au_do_update(int idx, long sz, int repeat)
|
||||
|
||||
/* execute a script */
|
||||
if (hdr->ih_type == IH_TYPE_SCRIPT) {
|
||||
addr = (char *)((char *)hdr + sizeof(*hdr) + 8);
|
||||
parse_string_outer(addr,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
|
||||
addr = (char *)((char *)hdr + sizeof(*hdr));
|
||||
/* stick a NULL at the end of the script, otherwise */
|
||||
/* parse_string_outer() runs off the end. */
|
||||
addr[ntohl(hdr->ih_size)] = 0;
|
||||
addr += 8;
|
||||
parse_string_outer(addr, FLAG_PARSE_SEMICOLON);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -333,8 +336,7 @@ au_do_update(int idx, long sz, int repeat)
|
||||
#endif
|
||||
debug ("protect off %lx %lx\n", start, end);
|
||||
sprintf(strbuf, "protect off %lx %lx\n", start, end);
|
||||
parse_string_outer(strbuf,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
|
||||
parse_string_outer(strbuf, FLAG_PARSE_SEMICOLON);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -344,12 +346,11 @@ au_do_update(int idx, long sz, int repeat)
|
||||
if (repeat == 0) {
|
||||
debug ("erase %lx %lx\n", start, end);
|
||||
sprintf(strbuf, "erase %lx %lx\n", start, end);
|
||||
parse_string_outer(strbuf,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
|
||||
parse_string_outer(strbuf, FLAG_PARSE_SEMICOLON);
|
||||
}
|
||||
wait_ms(100);
|
||||
/* strip the header - except for the kernel */
|
||||
if (idx == IDX_FIRMWARE || idx == IDX_DISK || idx == IDX_APP) {
|
||||
/* strip the header - except for the kernel and app */
|
||||
if (idx == IDX_FIRMWARE || idx == IDX_DISK) {
|
||||
addr = (char *)((char *)hdr + sizeof(*hdr));
|
||||
#ifdef AU_UPDATE_TEST
|
||||
/* copy it to where Linux goes */
|
||||
@@ -367,8 +368,7 @@ au_do_update(int idx, long sz, int repeat)
|
||||
/* copy the data from RAM to FLASH */
|
||||
debug ("cp.b %p %lx %x\n", addr, start, nbytes);
|
||||
sprintf(strbuf, "cp.b %p %lx %x\n", addr, start, nbytes);
|
||||
parse_string_outer(strbuf,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
|
||||
parse_string_outer(strbuf, FLAG_PARSE_SEMICOLON);
|
||||
|
||||
/* check the dcrc of the copy */
|
||||
if (crc32 (0, (char *)(start + off), ntohl(hdr->ih_size)) != ntohl(hdr->ih_dcrc)) {
|
||||
@@ -381,8 +381,7 @@ au_do_update(int idx, long sz, int repeat)
|
||||
if (idx == IDX_FIRMWARE) {
|
||||
debug ("protect on %lx %lx\n", start, end);
|
||||
sprintf(strbuf, "protect on %lx %lx\n", start, end);
|
||||
parse_string_outer(strbuf,
|
||||
FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
|
||||
parse_string_outer(strbuf, FLAG_PARSE_SEMICOLON);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -485,42 +484,58 @@ do_auto_update(void)
|
||||
* now check whether start and end are defined using environment
|
||||
* variables.
|
||||
*/
|
||||
start = end = 0;
|
||||
start = -1;
|
||||
end = 0;
|
||||
env = getenv("firmware_st");
|
||||
if (env != NULL)
|
||||
start = simple_strtoul(env, NULL, 16);
|
||||
env = getenv("firmware_nd");
|
||||
if (env != NULL)
|
||||
end = simple_strtoul(env, NULL, 16);
|
||||
if (start && end && end > start)
|
||||
if (start >= 0 && end && end > start) {
|
||||
ausize[IDX_FIRMWARE] = (end + 1) - start;
|
||||
start = end = 0;
|
||||
aufl_layout[0].start = start;
|
||||
aufl_layout[0].end = end;
|
||||
}
|
||||
start = -1;
|
||||
end = 0;
|
||||
env = getenv("kernel_st");
|
||||
if (env != NULL)
|
||||
start = simple_strtoul(env, NULL, 16);
|
||||
env = getenv("kernel_nd");
|
||||
if (env != NULL)
|
||||
end = simple_strtoul(env, NULL, 16);
|
||||
if (start && end && end > start)
|
||||
if (start >= 0 && end && end > start) {
|
||||
ausize[IDX_KERNEL] = (end + 1) - start;
|
||||
start = end = 0;
|
||||
aufl_layout[1].start = start;
|
||||
aufl_layout[1].end = end;
|
||||
}
|
||||
start = -1;
|
||||
end = 0;
|
||||
env = getenv("app_st");
|
||||
if (env != NULL)
|
||||
start = simple_strtoul(env, NULL, 16);
|
||||
env = getenv("app_nd");
|
||||
if (env != NULL)
|
||||
end = simple_strtoul(env, NULL, 16);
|
||||
if (start && end && end > start)
|
||||
if (start >= 0 && end && end > start) {
|
||||
ausize[IDX_APP] = (end + 1) - start;
|
||||
start = end = 0;
|
||||
aufl_layout[2].start = start;
|
||||
aufl_layout[2].end = end;
|
||||
}
|
||||
start = -1;
|
||||
end = 0;
|
||||
env = getenv("disk_st");
|
||||
if (env != NULL)
|
||||
start = simple_strtoul(env, NULL, 16);
|
||||
env = getenv("disk_nd");
|
||||
if (env != NULL)
|
||||
end = simple_strtoul(env, NULL, 16);
|
||||
if (start && end && end > start)
|
||||
if (start >= 0 && end && end > start) {
|
||||
ausize[IDX_DISK] = (end + 1) - start;
|
||||
aufl_layout[3].start = start;
|
||||
aufl_layout[3].end = end;
|
||||
}
|
||||
/* make sure that we see CTRL-C and save the old state */
|
||||
old_ctrlc = disable_ctrlc(0);
|
||||
|
||||
@@ -585,6 +600,9 @@ do_auto_update(void)
|
||||
*/
|
||||
if (got_ctrlc == 0)
|
||||
au_update_eeprom(i);
|
||||
else
|
||||
/* enable the power switch */
|
||||
*CPLD_VFD_BK &= ~POWER_OFF;
|
||||
}
|
||||
usb_stop();
|
||||
/* restore the old state */
|
||||
|
||||
@@ -104,12 +104,12 @@
|
||||
#ifndef CONFIG_RAM_16MB /* 32 MB RAM */
|
||||
/* Bank6 */
|
||||
#define B6_MT 0x3 /* SDRAM */
|
||||
#define B6_Trcd 0x1 /* 3clk */
|
||||
#define B6_Trcd 0x0 /* 2clk */
|
||||
#define B6_SCAN 0x1 /* 9 bit */
|
||||
|
||||
/* Bank7 */
|
||||
#define B7_MT 0x3 /* SDRAM */
|
||||
#define B7_Trcd 0x1 /* 3clk */
|
||||
#define B7_Trcd 0x0 /* 2clk */
|
||||
#define B7_SCAN 0x1 /* 9 bit */
|
||||
#else /* CONFIG_RAM_16MB = 16 MB RAM */
|
||||
/* Bank6 */
|
||||
@@ -178,5 +178,5 @@ SMRDATA:
|
||||
#else /* CONFIG_RAM_16MB = 16 MB RAM */
|
||||
.word 0x17 /* BUSWIDTH=32, SCLK power saving mode, BANKSIZE 16M/16M */
|
||||
#endif /* CONFIG_RAM_16MB */
|
||||
.word 0x30 /* MRSR6, CL=3clk */
|
||||
.word 0x30 /* MRSR7 */
|
||||
.word 0x20 /* MRSR6, CL=2clk */
|
||||
.word 0x20 /* MRSR7 */
|
||||
|
||||
@@ -74,6 +74,7 @@ int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
long size;
|
||||
unsigned long offset;
|
||||
unsigned long count;
|
||||
char buf [12];
|
||||
block_dev_desc_t *dev_desc=NULL;
|
||||
int dev=0;
|
||||
int part=1;
|
||||
@@ -107,11 +108,15 @@ int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
count = 0;
|
||||
size = file_fat_read (argv[4], (unsigned char *) offset, count);
|
||||
|
||||
if(size==-1)
|
||||
if(size==-1) {
|
||||
printf("\n** Unable to read \"%s\" from %s %d:%d **\n",argv[4],argv[1],dev,part);
|
||||
else
|
||||
} else {
|
||||
printf ("\n%ld bytes read\n", size);
|
||||
|
||||
sprintf(buf, "%lX", size);
|
||||
setenv("filesize", buf);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
char *ep;
|
||||
int size;
|
||||
int rcode = 0;
|
||||
char buf [10];
|
||||
char buf [12];
|
||||
int drive = CFG_FDC_DRIVE_NUMBER;
|
||||
|
||||
/* pre-set load_addr */
|
||||
|
||||
@@ -488,8 +488,10 @@ int console_init_r (void)
|
||||
int i, items = ListNumItems (devlist);
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
/* suppress all output if splash screen is enabled */
|
||||
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
|
||||
/* suppress all output if splash screen is enabled and we have
|
||||
a bmp to display */
|
||||
if (getenv("splashimage") != NULL)
|
||||
outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
|
||||
#endif
|
||||
|
||||
/* Scan devices looking for input and output devices */
|
||||
|
||||
@@ -51,8 +51,6 @@
|
||||
#define OHCI_CONTROL_INIT \
|
||||
(OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
|
||||
|
||||
#define OHCI_UNLINK_TIMEOUT (CFG_HZ / 10)
|
||||
|
||||
#define readl(a) (*((vu_long *)(a)))
|
||||
#define writel(a, b) (*((vu_long *)(b)) = ((vu_long)a))
|
||||
|
||||
@@ -85,6 +83,10 @@ struct ohci_hcca *phcca;
|
||||
struct ohci_device ohci_dev;
|
||||
/* urb_priv */
|
||||
urb_priv_t urb_priv;
|
||||
/* RHSC flag */
|
||||
int got_rhsc;
|
||||
/* device which was disconnected */
|
||||
struct usb_device *devgone;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -952,8 +954,29 @@ static unsigned char root_hub_str_index1[] =
|
||||
|
||||
/* request to virtual root hub */
|
||||
|
||||
static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
int transfer_len, struct devrequest *cmd)
|
||||
int rh_check_port_status(ohci_t *controller)
|
||||
{
|
||||
__u32 temp, ndp, i;
|
||||
int res;
|
||||
|
||||
res = -1;
|
||||
temp = roothub_a (controller);
|
||||
ndp = (temp & RH_A_NDP);
|
||||
for (i = 0; i < ndp; i++) {
|
||||
temp = roothub_portstatus (controller, i);
|
||||
/* check for a device disconnect */
|
||||
if (((temp & (RH_PS_PESC | RH_PS_CSC)) ==
|
||||
(RH_PS_PESC | RH_PS_CSC)) &&
|
||||
((temp & RH_PS_CCS) == 0)) {
|
||||
res = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
|
||||
void *buffer, int transfer_len, struct devrequest *cmd)
|
||||
{
|
||||
void * data = buffer;
|
||||
int leni = transfer_len;
|
||||
@@ -1178,6 +1201,12 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
int maxsize = usb_maxpacket(dev, pipe);
|
||||
int timeout;
|
||||
|
||||
/* device pulled? Shortcut the action. */
|
||||
if (devgone == dev) {
|
||||
dev->status = USB_ST_CRC_ERR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
urb_priv.actual_length = 0;
|
||||
pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
|
||||
@@ -1210,7 +1239,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
/* check whether the controller is done */
|
||||
stat = hc_interrupt();
|
||||
if (stat < 0) {
|
||||
stat = 1;
|
||||
stat = USB_ST_CRC_ERR;
|
||||
break;
|
||||
}
|
||||
if (stat >= 0 && stat != 0xff) {
|
||||
@@ -1220,11 +1249,33 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
if (--timeout) {
|
||||
wait_ms(1);
|
||||
} else {
|
||||
err("CTL:TIMEOUT");
|
||||
stat = 1;
|
||||
err("CTL:TIMEOUT ");
|
||||
stat = USB_ST_CRC_ERR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* we got an Root Hub Status Change interrupt */
|
||||
if (got_rhsc) {
|
||||
#ifdef DEBUG
|
||||
ohci_dump_roothub (&gohci, 1);
|
||||
#endif
|
||||
got_rhsc = 0;
|
||||
/* abuse timeout */
|
||||
timeout = rh_check_port_status(&gohci);
|
||||
if (timeout >= 0) {
|
||||
#if 0 /* this does nothing useful, but leave it here in case that changes */
|
||||
/* the called routine adds 1 to the passed value */
|
||||
usb_hub_port_connect_change(gohci.rh.dev, timeout - 1);
|
||||
#endif
|
||||
/*
|
||||
* XXX
|
||||
* This is potentially dangerous because it assumes
|
||||
* that only one device is ever plugged in!
|
||||
*/
|
||||
devgone = dev;
|
||||
}
|
||||
}
|
||||
|
||||
dev->status = stat;
|
||||
dev->act_len = transfer_len;
|
||||
|
||||
@@ -1264,10 +1315,12 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
pipe);
|
||||
return -1;
|
||||
}
|
||||
if (((pipe >> 8) & 0x7f) == gohci.rh.devnum)
|
||||
if (((pipe >> 8) & 0x7f) == gohci.rh.devnum) {
|
||||
gohci.rh.dev = dev;
|
||||
/* root hub - redirect */
|
||||
return ohci_submit_rh_msg(dev, pipe, buffer, transfer_len,
|
||||
setup);
|
||||
}
|
||||
|
||||
return submit_common_msg(dev, pipe, buffer, transfer_len, setup, 0);
|
||||
}
|
||||
@@ -1356,9 +1409,17 @@ static int hc_start (ohci_t * ohci)
|
||||
ohci->disabled = 0;
|
||||
writel (ohci->hc_control, &ohci->regs->control);
|
||||
|
||||
/* Choose the interrupts we care about now, others later on demand */
|
||||
mask = OHCI_INTR_MIE | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
|
||||
/* disable all interrupts */
|
||||
mask = (OHCI_INTR_SO | OHCI_INTR_WDH | OHCI_INTR_SF | OHCI_INTR_RD |
|
||||
OHCI_INTR_UE | OHCI_INTR_FNO | OHCI_INTR_RHSC |
|
||||
OHCI_INTR_OC | OHCI_INTR_MIE);
|
||||
writel (mask, &ohci->regs->intrdisable);
|
||||
/* clear all interrupts */
|
||||
mask &= ~OHCI_INTR_MIE;
|
||||
writel (mask, &ohci->regs->intrstatus);
|
||||
/* Choose the interrupts we care about now - but w/o MIE */
|
||||
mask = OHCI_INTR_RHSC | OHCI_INTR_UE | OHCI_INTR_WDH | OHCI_INTR_SO;
|
||||
writel (mask, &ohci->regs->intrenable);
|
||||
|
||||
#ifdef OHCI_USE_NPS
|
||||
/* required for AMD-756 and some Mac platforms */
|
||||
@@ -1397,6 +1458,10 @@ hc_interrupt (void)
|
||||
|
||||
/* dbg("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no)); */
|
||||
|
||||
if (ints & OHCI_INTR_RHSC) {
|
||||
got_rhsc = 1;
|
||||
}
|
||||
|
||||
if (ints & OHCI_INTR_UE) {
|
||||
ohci->disabled++;
|
||||
err ("OHCI Unrecoverable Error, controller usb-%s disabled",
|
||||
|
||||
@@ -424,7 +424,9 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
|
||||
#endif
|
||||
} while (!(phyStatus & 0x0004)); /* !link up */
|
||||
|
||||
#if (DEBUG & 0x2)
|
||||
printf ("done.\n");
|
||||
#endif
|
||||
} else { /* MII100 */
|
||||
/*
|
||||
* Set the auto-negotiation advertisement register bits
|
||||
|
||||
@@ -28,15 +28,22 @@
|
||||
#include <mpc5xxx.h>
|
||||
#include <i2c.h>
|
||||
|
||||
#ifdef CFG_I2C_MODULE
|
||||
#if (CFG_I2C_MODULE == 2)
|
||||
#define I2C_BASE MPC5XXX_I2C2
|
||||
#else
|
||||
#elif (CFG_I2C_MODULE == 1)
|
||||
#define I2C_BASE MPC5XXX_I2C1
|
||||
#else
|
||||
#error CFG_I2C_MODULE is not properly configured
|
||||
#endif
|
||||
|
||||
#define I2C_TIMEOUT 100
|
||||
#define I2C_RETRIES 3
|
||||
|
||||
struct mpc5xxx_i2c_tap {
|
||||
int scl2tap;
|
||||
int tap2tap;
|
||||
};
|
||||
|
||||
static int mpc_reg_in (volatile u32 *reg);
|
||||
static void mpc_reg_out (volatile u32 *reg, int val, int mask);
|
||||
static int wait_for_bb (void);
|
||||
@@ -44,6 +51,7 @@ static int wait_for_pin (int *status);
|
||||
static int do_address (uchar chip, char rdwr_flag);
|
||||
static int send_bytes (uchar chip, char *buf, int len);
|
||||
static int receive_bytes (uchar chip, char *buf, int len);
|
||||
static int mpc_get_fdr (int);
|
||||
|
||||
static int mpc_reg_in(volatile u32 *reg)
|
||||
{
|
||||
@@ -207,7 +215,7 @@ void i2c_init(int speed, int saddr)
|
||||
|
||||
/* Set clock
|
||||
*/
|
||||
mpc_reg_out(®s->mfdr, speed, 0);
|
||||
mpc_reg_out(®s->mfdr, mpc_get_fdr(speed), 0);
|
||||
|
||||
/* Enable module
|
||||
*/
|
||||
@@ -217,6 +225,50 @@ void i2c_init(int speed, int saddr)
|
||||
return;
|
||||
}
|
||||
|
||||
static int mpc_get_fdr(int speed)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
static int fdr = -1;
|
||||
static int best_speed = 0;
|
||||
|
||||
if (fdr == -1) {
|
||||
ulong ipb, scl;
|
||||
ulong bestmatch = 0xffffffffUL;
|
||||
int best_i = 0, best_j = 0, i, j;
|
||||
int SCL_Tap[] = { 9, 10, 12, 15, 5, 6, 7, 8};
|
||||
struct mpc5xxx_i2c_tap scltap[] = {
|
||||
{4, 1},
|
||||
{4, 2},
|
||||
{6, 4},
|
||||
{6, 8},
|
||||
{14, 16},
|
||||
{30, 32},
|
||||
{62, 64},
|
||||
{126, 128}
|
||||
};
|
||||
|
||||
ipb = gd->ipb_clk;
|
||||
for (i = 7; i >= 0; i--) {
|
||||
for (j = 7; j >= 0; j--) {
|
||||
scl = 2 * (scltap[j].scl2tap +
|
||||
(SCL_Tap[i] - 1) * scltap[j].tap2tap + 2);
|
||||
if (ipb <= speed*scl) {
|
||||
if ((speed*scl - ipb) < bestmatch) {
|
||||
bestmatch = speed*scl - ipb;
|
||||
best_i = i;
|
||||
best_j = j;
|
||||
best_speed = ipb/scl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fdr = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2);
|
||||
printf("%d kHz, ", best_speed / 1000);
|
||||
}
|
||||
|
||||
return fdr;
|
||||
}
|
||||
|
||||
int i2c_probe(uchar chip)
|
||||
{
|
||||
struct mpc5xxx_i2c *regs = (struct mpc5xxx_i2c *)I2C_BASE;
|
||||
|
||||
@@ -224,6 +224,18 @@ static vidinfo_t panel_info = {
|
||||
};
|
||||
#endif /* CONFIG_SHARP_LQ64D341 */
|
||||
|
||||
#ifdef CONFIG_SHARP_LQ065T9DR51U
|
||||
/*
|
||||
* Sharp LQ065T9DR51U display, 400x240. Active, color, single scan.
|
||||
*/
|
||||
static vidinfo_t panel_info = {
|
||||
400, 240, 143, 79, CFG_HIGH, CFG_HIGH, CFG_HIGH, CFG_HIGH, CFG_HIGH,
|
||||
3, 0, 0, 1, 1, 248, 4, 0, 35
|
||||
/* wbl, vpw, lcdac, wbf */
|
||||
};
|
||||
#define LCD_INFO_BELOW_LOGO
|
||||
#endif /* CONFIG_SHARP_LQ065T9DR51U */
|
||||
|
||||
#ifdef CONFIG_SHARP_LQ084V1DG21
|
||||
/*
|
||||
* Sharp LQ084V1DG21 display, 640x480. Active, color, single scan.
|
||||
|
||||
@@ -107,13 +107,9 @@
|
||||
* I2C configuration
|
||||
*/
|
||||
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */
|
||||
#define CFG_I2C_MODULE 1 /* If defined then I2C module #2 is used
|
||||
* otherwise I2C module #1 is used */
|
||||
#ifdef CONFIG_MPC5200
|
||||
#define CFG_I2C_SPEED 0x3D /* 86KHz given 133MHz IPBI */
|
||||
#else
|
||||
#define CFG_I2C_SPEED 0x35 /* 86KHz given 33MHz IPBI */
|
||||
#endif
|
||||
#define CFG_I2C_MODULE 2 /* Select I2C module #1 or #2 */
|
||||
|
||||
#define CFG_I2C_SPEED 100000 /* 100 kHz */
|
||||
#define CFG_I2C_SLAVE 0x7F
|
||||
|
||||
/*
|
||||
@@ -122,7 +118,7 @@
|
||||
#define CFG_I2C_EEPROM_ADDR 0x50 /* 1010000x */
|
||||
#define CFG_I2C_EEPROM_ADDR_LEN 1
|
||||
#define CFG_EEPROM_PAGE_WRITE_BITS 3
|
||||
#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 35
|
||||
#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 70
|
||||
|
||||
/*
|
||||
* Flash configuration
|
||||
@@ -191,7 +187,7 @@
|
||||
/*
|
||||
* GPIO configuration
|
||||
*/
|
||||
#define CFG_GPS_PORT_CONFIG 0x00000004
|
||||
#define CFG_GPS_PORT_CONFIG 0x10000004
|
||||
|
||||
/*
|
||||
* Miscellaneous configurable options
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/*
|
||||
* (C) Copyright 2001-2003
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
* (C) Copyright 2003
|
||||
* DAVE Srl
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
* http://www.dave-tech.it
|
||||
* http://www.wawnet.biz
|
||||
* mailto:info@wawnet.biz
|
||||
*
|
||||
* Credits: Stefan Roese, Wolfgang Denk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@@ -28,6 +31,13 @@
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
#define CONFIG_PPCHAMELEON_MODULE_BA 0 /* Basic Model */
|
||||
#define CONFIG_PPCHAMELEON_MODULE_ME 1 /* Medium Model */
|
||||
#define CONFIG_PPCHAMELEON_MODULE_HI 2 /* High-End Model */
|
||||
#ifndef CONFIG_PPCHAMELEON_MODULE_MODEL
|
||||
#define CONFIG_PPCHAMELEON_MODULE_MODEL CONFIG_PPCHAMELEON_MODULE_BA
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Debug stuff
|
||||
*/
|
||||
@@ -150,6 +160,7 @@
|
||||
|
||||
#define CFG_MAX_NAND_DEVICE 2 /* Max number of NAND devices */
|
||||
#define SECTORSIZE 512
|
||||
#define NAND_NO_RB
|
||||
|
||||
#define ADDR_COLUMN 1
|
||||
#define ADDR_PAGE 2
|
||||
@@ -248,19 +259,15 @@
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#ifdef NAND_NO_RB
|
||||
/* constant delay (see also tR in the datasheet) */
|
||||
#define NAND_WAIT_READY(nand) do { \
|
||||
ulong mask = 0; \
|
||||
switch ((ulong)(((struct nand_chip *)nand)->IO_ADDR)) { \
|
||||
case CFG_NAND0_BASE: \
|
||||
mask = CFG_NAND0_RDY; \
|
||||
break; \
|
||||
case CFG_NAND1_BASE: \
|
||||
mask = CFG_NAND1_RDY; \
|
||||
break; \
|
||||
} \
|
||||
while (!(in32(GPIO0_IR) & mask)) \
|
||||
; \
|
||||
udelay(12); \
|
||||
} while (0)
|
||||
#else
|
||||
/* use the R/B pin */
|
||||
/* TBD */
|
||||
#endif
|
||||
|
||||
#define WRITE_NAND_COMMAND(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)(d); } while(0)
|
||||
#define WRITE_NAND_ADDRESS(d, adr) do{ *(volatile __u8 *)((unsigned long)adr) = (__u8)(d); } while(0)
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
#ifdef CONFIG_OLD_VERSION /* Old configuration: */
|
||||
#define CONFIG_RAM_16MB /* 16 MB SDRAM */
|
||||
#define CONFIG_FLASH_8MB /* 8 MB Flash */
|
||||
#endif
|
||||
#define CONFIG_FLASH_8MB /* 8 MB Flash */
|
||||
|
||||
/*
|
||||
* If we are developing, we might want to start armboot from ram
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
#define IH_TYPE_MULTI 4 /* Multi-File Image */
|
||||
#define IH_TYPE_FIRMWARE 5 /* Firmware Image */
|
||||
#define IH_TYPE_SCRIPT 6 /* Script file */
|
||||
#define IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) */
|
||||
|
||||
/*
|
||||
* Compression Types
|
||||
|
||||
27
net/tftp.c
27
net/tftp.c
@@ -15,7 +15,7 @@
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
||||
|
||||
#define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
|
||||
#define TIMEOUT 2 /* Seconds to timeout for a lost pkt */
|
||||
#define TIMEOUT 5 /* Seconds to timeout for a lost pkt */
|
||||
#ifndef CONFIG_NET_RETRY_COUNT
|
||||
# define TIMEOUT_COUNT 10 /* # of timeouts before giving up */
|
||||
#else
|
||||
@@ -32,6 +32,7 @@
|
||||
#define TFTP_DATA 3
|
||||
#define TFTP_ACK 4
|
||||
#define TFTP_ERROR 5
|
||||
#define TFTP_OACK 6
|
||||
|
||||
|
||||
static int TftpServerPort; /* The UDP port at their end */
|
||||
@@ -44,6 +45,7 @@ static int TftpState;
|
||||
#define STATE_DATA 2
|
||||
#define STATE_TOO_LARGE 3
|
||||
#define STATE_BAD_MAGIC 4
|
||||
#define STATE_OACK 5
|
||||
|
||||
#define DEFAULT_NAME_LEN (8 + 4 + 1)
|
||||
static char default_filename[DEFAULT_NAME_LEN];
|
||||
@@ -113,10 +115,18 @@ TftpSend (void)
|
||||
pkt += strlen(tftp_filename) + 1;
|
||||
strcpy ((char *)pkt, "octet");
|
||||
pkt += 5 /*strlen("octet")*/ + 1;
|
||||
strcpy ((char *)pkt, "timeout");
|
||||
pkt += 7 /*strlen("timeout")*/ + 1;
|
||||
sprintf((char *)pkt, "%d", TIMEOUT);
|
||||
#ifdef ET_DEBUG
|
||||
printf("send option \"timeout %s\"\n", (char *)pkt);
|
||||
#endif
|
||||
pkt += strlen((char *)pkt) + 1;
|
||||
len = pkt - xp;
|
||||
break;
|
||||
|
||||
case STATE_DATA:
|
||||
case STATE_OACK:
|
||||
xp = pkt;
|
||||
*((ushort *)pkt)++ = htons(TFTP_ACK);
|
||||
*((ushort *)pkt)++ = htons(TftpBlock);
|
||||
@@ -173,6 +183,14 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
|
||||
default:
|
||||
break;
|
||||
|
||||
case TFTP_OACK:
|
||||
#ifdef ET_DEBUG
|
||||
printf("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
|
||||
#endif
|
||||
TftpState = STATE_OACK;
|
||||
TftpServerPort = src;
|
||||
TftpSend (); /* Send ACK */
|
||||
break;
|
||||
case TFTP_DATA:
|
||||
if (len < 2)
|
||||
return;
|
||||
@@ -184,7 +202,13 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
|
||||
puts ("\n\t ");
|
||||
}
|
||||
|
||||
#ifdef ET_DEBUG
|
||||
if (TftpState == STATE_RRQ) {
|
||||
printf("Server did not acknowledge timeout option!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
|
||||
TftpState = STATE_DATA;
|
||||
TftpServerPort = src;
|
||||
TftpLastBlock = 0;
|
||||
@@ -305,6 +329,7 @@ TftpStart (void)
|
||||
TftpTimeoutCount = 0;
|
||||
TftpState = STATE_RRQ;
|
||||
TftpOurPort = 1024 + (get_timer(0) % 3072);
|
||||
TftpBlock = 0;
|
||||
|
||||
/* zero out server ether in case the server ip has changed */
|
||||
memset(NetServerEther, 0, 6);
|
||||
|
||||
Reference in New Issue
Block a user