summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2009-06-24 11:31:38 +0800
committerFred Fan <r01011@freescale.com>2009-09-10 17:02:19 +0800
commit23b6527003ca6a12d7872e9e552160041d8b6285 (patch)
tree9abe3d5483436632fceb0cfcc51c64c9b443dc67 /drivers
parentc6e205a9fde82e69608850c24686cc972cf258f1 (diff)
downloadu-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.zip
u-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.tar.gz
u-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.tar.bz2
ENGR00113611: Add FEC support for BBG2.
Add FEC support for BBG2. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/fsl_mmc.c2
-rw-r--r--drivers/net/mxc_fec.c13
-rw-r--r--drivers/spi/imx_spi_pmic.c14
3 files changed, 18 insertions, 11 deletions
diff --git a/drivers/mmc/fsl_mmc.c b/drivers/mmc/fsl_mmc.c
index 2fbf4d6..85829d0 100644
--- a/drivers/mmc/fsl_mmc.c
+++ b/drivers/mmc/fsl_mmc.c
@@ -38,6 +38,8 @@
#define RETRY_TIMEOUT (10)
+extern int sdhc_init();
+
extern int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
static block_dev_desc_t mmc_dev;
diff --git a/drivers/net/mxc_fec.c b/drivers/net/mxc_fec.c
index 218c432..91d248b 100644
--- a/drivers/net/mxc_fec.c
+++ b/drivers/net/mxc_fec.c
@@ -121,7 +121,7 @@ static inline void fec_localhw_setup(volatile fec_t *fecp)
fecp->fec_miigsk_enr = FEC_MIIGSK_ENR_EN;
}
#else
-static inline void fec_localhw_setup(struct fec_t *fecp)
+static inline void fec_localhw_setup(fec_t *fecp)
{
}
#endif
@@ -271,7 +271,7 @@ static inline u16 getFecPhyStatus(volatile fec_t *fecp, unsigned char addr)
return val;
}
-static void setFecDuplexSpeed(volatile fec_t *fecp, unsigned char addr,
+static void setFecDuplexSpeed(volatile fec_t *fecp, unsigned char addr,
int dup_spd)
{
unsigned short val;
@@ -386,7 +386,7 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
j++;
}
if (j >= FEC_MAX_TIMEOUT)
- printf("TX timeout packet at %x\n", packet);
+ printf("TX timeout packet at %p\n", packet);
#ifdef ET_DEBUG
printf("%s[%d] %s: cycles: %d status: %x retry cnt: %d\n",
@@ -612,7 +612,7 @@ int fec_init(struct eth_device *dev, bd_t *bd)
fec_reset(dev);
- fec_localhw_setup(fecp);
+ fec_localhw_setup((fec_t *)fecp);
#if defined (CONFIG_CMD_MII) || defined (CONFIG_MII) || \
defined (CONFIG_DISCOVER_PHY)
@@ -622,10 +622,11 @@ int fec_init(struct eth_device *dev, bd_t *bd)
if (info->phy_addr < 0 || info->phy_addr > 0x1F)
info->phy_addr = mxc_fec_mii_discover_phy(dev);
#endif
- setFecDuplexSpeed(fecp, bd, info->dup_spd);
+ setFecDuplexSpeed(fecp, (unsigned char)bd, info->dup_spd);
#else
#ifndef CONFIG_DISCOVER_PHY
- setFecDuplexSpeed(fecp, bd, (FECDUPLEX << 16) | FECSPEED);
+ setFecDuplexSpeed(fecp, (unsigned char)bd,
+ (FECDUPLEX << 16) | FECSPEED);
#endif /* ifndef CONFIG_SYS_DISCOVER_PHY */
#endif /* CONFIG_CMD_MII || CONFIG_MII */
diff --git a/drivers/spi/imx_spi_pmic.c b/drivers/spi/imx_spi_pmic.c
index bce42c2..79d798d 100644
--- a/drivers/spi/imx_spi_pmic.c
+++ b/drivers/spi/imx_spi_pmic.c
@@ -53,13 +53,17 @@ u32 pmic_reg(struct spi_slave *slave, u32 reg, u32 val, u32 write)
pmic_tx = (write << 31) | (reg << 25) | (val & 0x00FFFFFF);
printf("reg=0x%x, val=0x%08x\n", reg, pmic_tx);
- spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx,
- (u8 *)&pmic_rx, 0);
+ if (spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx, (u8 *)&pmic_rx,
+ SPI_XFER_BEGIN | SPI_XFER_END)) {
+ return -1;
+ }
if (write) {
pmic_tx &= ~(1 << 31);
- spi_xfer(slave, 4 << 3,
- (u8 *)&pmic_tx, (u8 *)&pmic_rx, 0);
+ if (spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx, (u8 *)&pmic_rx,
+ SPI_XFER_BEGIN | SPI_XFER_END)) {
+ return -1;
+ }
}
return pmic_rx;
@@ -73,7 +77,7 @@ void show_pmic_info(struct spi_slave *slave)
return;
rev_id = pmic_reg(slave, 7, 0, 0);
- printf("PMIC ID: 0x%08x [Rev: ", rev_id);
+ debug("PMIC ID: 0x%08x [Rev: ", rev_id);
switch (rev_id & 0x1F) {
case 0x1:
printf("1.0");