Compare commits

...

10 Commits

11 changed files with 212 additions and 47 deletions

View File

@@ -2,6 +2,19 @@
Changes for U-Boot 1.0.0:
======================================================================
* 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 +98,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 +138,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 +184,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 +193,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

View File

@@ -470,6 +470,11 @@ 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
#########################################################################

View File

@@ -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;
@@ -485,41 +485,45 @@ 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;
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;
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;
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;
/* make sure that we see CTRL-C and save the old state */
old_ctrlc = disable_ctrlc(0);
@@ -585,6 +589,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 */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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",

View File

@@ -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

View File

@@ -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(&regs->mfdr, speed, 0);
mpc_reg_out(&regs->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;

View File

@@ -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.

View File

@@ -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

View File

@@ -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