Modifications for 1.1.6:
======================================================================
+* Patch by Miguel Bello, 20 Feb 2002
+ Add support for Prime View V16C6448AC LCD
+
* Add support for TTTech board (TQM823E + Sharp LQ104V7DS01 Display)
* Patch by Stefan Roese, 11 Mar 2002
return 0;
}
+
+/*
+ * The SDRAM command is separately configured because many
+ * (most?) embedded boards don't use SDRAM DIMMs.
+ */
+#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
+
/*
* Syntax:
* sdram {i2c_chip}
return 0;
}
+#endif /* CFG_CMD_SDRAM */
#endif /* CFG_CMD_I2C */
*/
int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
{
+#ifdef CFG_I2C_EEPROM_ADDR_OVERFLOW
+ /*
+ * EEPROM chips that implement "address overflow" are ones
+ * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
+ * address and the extra bits end up in the "chip address"
+ * bit slots. This makes a 24WC08 (1Kbyte) chip look like
+ * four 256 byte chips.
+ *
+ * Note that we consider the length of the address field to
+ * still be one byte because the extra address bits are
+ * hidden in the chip address.
+ */
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+#endif
+
/*
* Do the addressing portion of a write cycle to set the
* chip's address pointer. If the address length is zero,
DBGFLAGS= -g #-DDEBUG
OPTFLAGS= -Os -fomit-frame-pointer
#LDSCRIPT := board/$(BOARDDIR)/ppcboot.lds.debug
-LDSCRIPT := board/$(BOARDDIR)/ppcboot.lds
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/ppcboot.lds
OBJCFLAGS := --gap-fill=0xff
CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
int i2c_probe (uchar chip)
{
- return 0;
-}
-
-#if 0
-int i2c_receive (unsigned char address,
- unsigned char secondary_address,
- unsigned short size_to_expect, unsigned char *datain)
-{
- return I2C_do_transaction (0, I2C_MASTER_RCV, address,
- secondary_address, size_to_expect,
- datain, I2C_STOP, 1, I2C_NO_RESTART);
-}
+ int tmp;
-int i2c_send (unsigned char address,
- unsigned char secondary_address,
- unsigned short size_to_send, unsigned char *dataout)
-{
- return I2C_do_transaction (0, I2C_MASTER_XMIT, address,
- secondary_address, size_to_send,
- dataout, I2C_STOP, 1, I2C_NO_RESTART);
+ /*
+ * Try to read the first location of the chip. The underlying
+ * driver doesn't appear to support sending just the chip address
+ * and looking for an <ACK> back.
+ */
+ return i2c_read (chip, 0, 1, &tmp, 0);
}
-#endif
int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
{
PRINTD(("[I2C] i2c_doio\n"));
+ timeout = TOUT_LOOP * 256; /* arbitrarily long */
+
if (state->tx_idx <= 0 && state->rx_idx <= 0) {
PRINTD(("[I2C] No I/O is queued\n"));
return I2CERR_QUEUE_EMPTY;
/* Loop until transmit & receive completed */
+ txbd = ((I2C_BD*)state->txbd) - 1;
+ j = 0;
if (state->tx_idx > 0) {
- txbd = ((I2C_BD*)state->txbd) - 1;
- j = 0;
timeout = TOUT_LOOP * txbd->length;
PRINTD(("[I2C] Transmitting...(txbd=0x%08lx)\n", (ulong)txbd));
}
}
+ rxbd = ((I2C_BD*)state->rxbd) - 1;
+ j = 0;
if ((state->rx_idx > 0) && (j < timeout)) {
- rxbd = ((I2C_BD*)state->rxbd) - 1;
- j = 0;
timeout = TOUT_LOOP * rxbd->length;
PRINTD(("[I2C] Receiving...(rxbd=0x%08lx)\n", (ulong)rxbd));
udelay(START_DELAY_US); /* give it time to start */
* be one byte because the extra address bits are hidden in the
* chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
i2c_newio(&state);
* be one byte because the extra address bits are hidden in the
* chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
i2c_newio(&state);
* be one byte because the extra address bits are hidden in the
* chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
i2c_newio(&state);
* be one byte because the extra address bits are hidden in the
* chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
i2c_newio(&state);
#endif /* CONFIG_HLD1045 */
/*----------------------------------------------------------------------*/
+#ifdef CONFIG_PRIMEVIEW_V16C6448AC
+/*
+ * Prime View V16C6448AC
+ */
+static vidinfo_t panel_info = {
+ 640, 480, 130, 98, CFG_HIGH, CFG_HIGH, CFG_LOW, CFG_LOW, CFG_HIGH,
+ 3, 0, 0, 1, 1, 144, 2, 0, 35
+ /* wbl, vpw, lcdac, wbf */
+};
+#endif /* CONFIG_PRIMEVIEW_V16C6448AC */
+
+/*----------------------------------------------------------------------*/
+
#ifdef CONFIG_OPTREX_BW
/*
* Optrex CBL50840-2 NF-FW 99 22 M5
* still be one byte because the extra address bits are
* hidden in the chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
if (i2c_send (chip << 1, alen, &xaddr[4 - alen]) != 0)
* still be one byte because the extra address bits are
* hidden in the chip address.
*/
- chip |= ((addr >> alen) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
+ chip |= ((addr >> (alen * 8)) & CFG_I2C_EEPROM_ADDR_OVERFLOW);
#endif
/* write with ack polling */
}
int spd_read( int x ){
- char addr[2];
char data[2];
-
- addr[0]=0x50;
- addr[1]=(char)x;
- if (i2c_read(addr,2,data,1) == 0) return (int)data[0];
+
+ if (i2c_read(0x50,x,1,data,1) == 0) return (int)data[0];
else return 0;
}
#include <i2c.h>
#include <dtt.h>
-/*
- * Handle 4xx differences.
- */
-#if defined(CONFIG_4xx)
-#define I2C_WRITER(addr, addrlen, data, datalen, pgsize) \
- i2c_wr_page(addr, addrlen, data, datalen, pgsize)
-#else
-#define I2C_WRITER(addr, addrlen, data, datalen, pgsize) \
- i2c_write(addr, addrlen, data, datalen)
-#endif
/*
* Device code
int dtt_read(int sensor, int reg)
{
int dlen;
- uchar addr[2];
uchar data[2];
/*
* Calculate sensor address and register.
*/
sensor &= 0x07; /* only allow sensor 0-7 */
- addr[0] = DTT_I2C_DEV_CODE + sensor; /* calculate address of lm75 */
- addr[1] = reg; /* address of reg */
/*
* Prepare to handle 2 byte result.
/*
* Now try to read the register.
*/
- if (i2c_read(addr, 2, data, dlen) != 0)
+ if (i2c_read(DTT_I2C_DEV_CODE + sensor, reg, 1, data, dlen) != 0)
return -1;
/*
int dtt_write(int sensor, int reg, int val)
{
int dlen;
- uchar addr;
uchar data[3];
/*
/*
* Calculate sensor address and register.
- *
*/
sensor &= 0x07; /* only allow sensor 0-7 */
- addr = DTT_I2C_DEV_CODE + (sensor); /* calculate address of lm75 */
- data[0] = reg; /* address of reg */
/*
* Handle 2 byte values.
if ((reg == DTT_READ_TEMP) ||
(reg == DTT_TEMP_HYST) ||
(reg == DTT_TEMP_SET)) {
- dlen = 3;
- data[1] = (char)((val >> 8) & 0xff); /* MSB first */
- data[2] = (char)(val & 0xff);
- } else {
dlen = 2;
+ data[0] = (char)((val >> 8) & 0xff); /* MSB first */
data[1] = (char)(val & 0xff);
+ } else {
+ dlen = 1;
+ data[0] = (char)(val & 0xff);
}
/*
* Write value to register.
*/
- if (I2C_WRITER(&addr, 1, data, dlen, 0) != 0)
+ if (i2c_write(DTT_I2C_DEV_CODE + (sensor), reg, 1, data, dlen) != 0)
return 1;
return 0;
/*
* Configurable monitor commands
*/
-#define CFG_CMD_unused 0x00010000 /* was EEPROM, superceeded by I2C */
#define CFG_CMD_BDI 0x00000001 /* bdinfo */
#define CFG_CMD_LOADS 0x00000002 /* loads */
#define CFG_CMD_LOADB 0x00000004 /* loadb */
#define CFG_CMD_DOC 0x0000000800000000 /* Disk-On-Chip Support */
#define CFG_CMD_JFFS2 0x0000001000000000 /* JFFS2 Support */
#define CFG_CMD_DTT 0x0000002000000000 /* Digital Therm and Thermostat */
+#define CFG_CMD_SDRAM 0x0000004000000000 /* SDRAM DIMM SPD info printout */
#define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFF /* ALL commands */
CFG_CMD_ELF | \
CFG_CMD_FDC | \
CFG_CMD_I2C | \
+ CFG_CMD_SDRAM | \
CFG_CMD_IDE | \
CFG_CMD_IMMAP | \
CFG_CMD_IRQ | \
"chip address[.0, .1, .2] [# of objects]\n" \
" - loop, reading a set of addresses\n" \
),
+#if (CONFIG_COMMANDS & CFG_CMD_SDRAM)
#define CMD_TBL_ISDRAM MK_CMD_TBL_ENTRY( \
"isdram", 6, 2, 1, do_sdram, \
"isdram - print SDRAM configuration information\n", \
"chip\n - print SDRAM configuration information\n" \
" (valid chip values 50..57)\n" \
),
+#else
+#define CMD_TBL_ISDRAM
+#endif
int do_i2c_md(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);
CFG_CMD_ELF | \
CFG_CMD_ASKENV | \
CFG_CMD_ECHO | \
- CFG_CMD_I2C | \
CFG_CMD_REGINFO | \
CFG_CMD_MEMTEST | \
CFG_CMD_MII | \
# MA 02111-1307 USA
#
-BINS = img2srec mkimage envcrc gen_eth_addr bmp_logo
+BINS = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
OBJS = environment.o img2srec.o mkimage.o crc32.o envcrc.o gen_eth_addr.o bmp_logo.o
#if defined(__linux__)
#include <stdint.h>
#else
+#ifdef __CYGWIN__
+#include "elf.h"
+#else
#include <inttypes.h>
#endif
+#endif
#ifdef __CYGWIN__
typedef unsigned short ushort;