From f90a39213e3a396ad01f67ce381bd826126db97f Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 10 May 2006 15:01:40 +0200 Subject: Fix compile warnings in common/xyzModem.c Patch by Stefan Roese, 10 May 2006 --- common/xyzModem.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/xyzModem.c b/common/xyzModem.c index 4a137bf..9b455a3 100644 --- a/common/xyzModem.c +++ b/common/xyzModem.c @@ -379,13 +379,13 @@ xyzModem_get_hdr(void) } /* Header found, now read the data */ - res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &xyz.blk); + res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.blk); ZM_DEBUG(zm_save(xyz.blk)); if (!res) { ZM_DEBUG(zm_dump(__LINE__)); return xyzModem_timeout; } - res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &xyz.cblk); + res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.cblk); ZM_DEBUG(zm_save(xyz.cblk)); if (!res) { ZM_DEBUG(zm_dump(__LINE__)); @@ -403,14 +403,14 @@ xyzModem_get_hdr(void) return xyzModem_timeout; } } - res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &xyz.crc1); + res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.crc1); ZM_DEBUG(zm_save(xyz.crc1)); if (!res) { ZM_DEBUG(zm_dump(__LINE__)); return xyzModem_timeout; } if (xyz.crc_mode) { - res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &xyz.crc2); + res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.crc2); ZM_DEBUG(zm_save(xyz.crc2)); if (!res) { ZM_DEBUG(zm_dump(__LINE__)); @@ -450,7 +450,10 @@ xyzModem_get_hdr(void) int xyzModem_stream_open(connection_info_t *info, int *err) { - int console_chan, stat=0; +#ifdef REDBOOT + int console_chan; +#endif + int stat = 0; int retries = xyzModem_MAX_RETRIES; int crc_retries = xyzModem_MAX_RETRIES_WITH_CRC; @@ -510,7 +513,7 @@ xyzModem_stream_open(connection_info_t *info, int *err) /* skip filename */ while (*xyz.bufp++); /* get the length */ - parse_num(xyz.bufp, &xyz.file_length, NULL, " "); + parse_num((char *)xyz.bufp, &xyz.file_length, NULL, " "); #endif /* The rest of the file name data block quietly discarded */ xyz.tx_ack = true; -- cgit v1.1 From 8cba090c5824c95f337d44a0465803c882ded6f6 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 12 May 2006 16:15:46 +0200 Subject: Add support for VirtLab2 board (needed because of differences in the PCMCIA hardware). --- common/cmd_pcmcia.c | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index 62446d4..16d9d14 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2000-2004 + * (C) Copyright 2000-2006 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -718,7 +718,8 @@ static int hardware_disable(int slot) /* SC8xx Boards by SinoVee Microsystems */ /* -------------------------------------------------------------------- */ -#if defined(CONFIG_TQM8xxL) || defined(CONFIG_SVM_SC8xx) +#if (defined(CONFIG_TQM8xxL) || defined(CONFIG_SVM_SC8xx)) \ + && !defined(CONFIG_VIRTLAB2) #if defined(CONFIG_TQM8xxL) #define PCMCIA_BOARD_MSG "TQM8xxL" @@ -1021,6 +1022,174 @@ done: #endif /* TQM8xxL */ +/* -------------------------------------------------------------------- */ +/* Virtlab2 Board by TQ Components */ +/* -------------------------------------------------------------------- */ + +#if defined(CONFIG_VIRTLAB2) +#define PCMCIA_BOARD_MSG "Virtlab2" + +static int hardware_enable(int slot) +{ + volatile pcmconf8xx_t *pcmp = + (pcmconf8xx_t *)&(((immap_t *)CFG_IMMR)->im_pcmcia); + volatile unsigned char *powerctl = + (volatile unsigned char *)PCMCIA_CTRL; + unsigned int reg, mask; + + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + + udelay(10000); + + /* clear interrupt state, and disable interrupts */ + pcmp->pcmc_pscr = PCMCIA_MASK(slot); + pcmp->pcmc_per &= ~PCMCIA_MASK(slot); + + /* + * Disable interrupts, DMA, and PCMCIA buffers + * (isolate the interface) and assert RESET signal + */ + debug ("Disable PCMCIA buffers and assert RESET\n"); + reg = __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + + PCMCIA_PGCRX(slot) = reg; + udelay(500); + + /* remove all power */ + *powerctl = 0; + + /* + * Make sure there is a card in the slot, then configure the interface. + */ + udelay(10000); + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, + &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); + + if (pcmp->pcmc_pipr & (0x18000000 >> (slot << 4))) { + printf (" No Card found\n"); + return (1); + } + + /* + * Power On. + */ + mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); + reg = pcmp->pcmc_pipr; + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, + (reg&PCMCIA_VS1(slot))?"n":"ff", + (reg&PCMCIA_VS2(slot))?"n":"ff"); + + if ((reg & mask) == mask) { + *powerctl = 2; /* Enable 5V Vccout */ + puts (" 5.0V card found: "); + } else { + *powerctl = 1; /* Enable 3.3 V Vccout */ + puts (" 3.3V card found: "); + } + + udelay(1000); + debug ("Enable PCMCIA buffers and stop RESET\n"); + reg = PCMCIA_PGCRX(slot); + reg &= ~__MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg &= ~__MY_PCMCIA_GCRX_CXOE; /* active low */ + + PCMCIA_PGCRX(slot) = reg; + + udelay(250000); /* some cards need >150 ms to come up :-( */ + + debug ("# hardware_enable done\n"); + + return (0); +} + +#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) +static int hardware_disable(int slot) +{ + volatile unsigned char *powerctl = + (volatile unsigned char *)PCMCIA_CTRL; + unsigned long reg; + + debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + + /* remove all power */ + *powerctl = 0; + + debug ("Disable PCMCIA buffers and assert RESET\n"); + reg = __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + + PCMCIA_PGCRX(slot) = reg; + + udelay(10000); + + return (0); +} +#endif + +static int voltage_set(int slot, int vcc, int vpp) +{ + volatile pcmconf8xx_t *pcmp = + (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + volatile unsigned char *powerctl = + (volatile unsigned char *)PCMCIA_CTRL; + unsigned long reg; + + debug ("voltage_set: " PCMCIA_BOARD_MSG + " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", + 'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10); + + /* + * Disable PCMCIA buffers (isolate the interface) + * and assert RESET signal + */ + debug ("Disable PCMCIA buffers and assert RESET\n"); + reg = PCMCIA_PGCRX(slot); + reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + + PCMCIA_PGCRX(slot) = reg; + udelay(500); + + /* + * Configure pins for 5 Volts Enable and 3 Volts enable, + * Turn off all power. + */ + debug ("PCMCIA power OFF\n"); + reg = 0; + switch(vcc) { + case 0: break; + case 33: reg = 0x0001; break; + case 50: reg = 0x0002; break; + default: goto done; + } + + /* Checking supported voltages */ + + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, + (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); + + *powerctl = reg; + + if (reg) { + debug ("PCMCIA powered at %sV\n", (reg&0x0004) ? "5.0" : "3.3"); + } else { + debug ("PCMCIA powered down\n"); + } + +done: + debug ("Enable PCMCIA buffers and stop RESET\n"); + reg = PCMCIA_PGCRX(slot); + reg &= ~__MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg &= ~__MY_PCMCIA_GCRX_CXOE; /* active low */ + + PCMCIA_PGCRX(slot) = reg; + udelay(500); + + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); + return (0); +} +#endif /* CONFIG_VIRTLAB2 */ /* -------------------------------------------------------------------- */ /* LWMON Board */ -- cgit v1.1 From 319b9a54670c9adf4bb84a7dacd2b031350f4066 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 12 May 2006 16:32:32 +0200 Subject: Cleanup compile warning. --- common/cmd_pcmcia.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index 16d9d14..46b703d 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -1129,8 +1129,10 @@ static int hardware_disable(int slot) static int voltage_set(int slot, int vcc, int vpp) { +#ifdef DEBUG volatile pcmconf8xx_t *pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); +#endif volatile unsigned char *powerctl = (volatile unsigned char *)PCMCIA_CTRL; unsigned long reg; -- cgit v1.1 From 651652508325cd43a35d724373c51913bf7c11ed Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Mon, 15 May 2006 13:52:51 +0200 Subject: Fix PCMCIA support on virtlab2 --- common/cmd_pcmcia.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common') diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index 46b703d..8e3e84b 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -1035,12 +1035,19 @@ static int hardware_enable(int slot) (pcmconf8xx_t *)&(((immap_t *)CFG_IMMR)->im_pcmcia); volatile unsigned char *powerctl = (volatile unsigned char *)PCMCIA_CTRL; + volatile sysconf8xx_t *sysp = + (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf)); unsigned int reg, mask; debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); udelay(10000); + /* + * Configure SIUMCR to enable PCMCIA port B + */ + sysp->sc_siumcr &= ~SIUMCR_DBGC11; /* set DBGC to 00 */ + /* clear interrupt state, and disable interrupts */ pcmp->pcmc_pscr = PCMCIA_MASK(slot); pcmp->pcmc_per &= ~PCMCIA_MASK(slot); -- cgit v1.1 From ba94a1bba3600d387edba7eb451990d9891e1c2f Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 30 May 2006 15:56:48 +0200 Subject: * Update Intel IXP4xx support - Add IXP4xx NPE ethernet MAC support - Add support for Intel IXDPG425 board - Add support for Prodrive PDNB3 board - Add IRQ support Patch by Stefan Roese, 23 May 2006 [This patch does not include cpu/ixp/npe/IxNpeMicrocode.c which still sufferes from licensing issues. Blame Intel.] --- common/soft_i2c.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common') diff --git a/common/soft_i2c.c b/common/soft_i2c.c index bffcd44..edad51b 100644 --- a/common/soft_i2c.c +++ b/common/soft_i2c.c @@ -33,6 +33,9 @@ #include #include #endif +#ifdef CONFIG_IXP425 /* only valid for IXP425 */ +#include +#endif #include #if defined(CONFIG_SOFT_I2C) -- cgit v1.1