summaryrefslogtreecommitdiffstats
path: root/cpu
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-12-27 00:46:08 +0100
committerWolfgang Denk <wd@denx.de>2007-12-27 00:46:08 +0100
commitf77ac3d657e9b1d40012153e872a2118cca10a3d (patch)
tree91b2a4cb4cbe233de260e30e63a383c5a502f2d6 /cpu
parentbd878eb024bf9cb351c9ce66db63558de2d0e395 (diff)
parentdf9c25ea04b38a0e05d4f8c73c5cc144cdafa7db (diff)
downloadu-boot-f77ac3d657e9b1d40012153e872a2118cca10a3d.tar.gz
u-boot-f77ac3d657e9b1d40012153e872a2118cca10a3d.tar.xz
u-boot-f77ac3d657e9b1d40012153e872a2118cca10a3d.zip
Merge branch 'master' of git://www.denx.de/git/u-boot-avr32
Diffstat (limited to 'cpu')
-rw-r--r--cpu/at32ap/at32ap700x/Makefile (renamed from cpu/at32ap/at32ap7000/Makefile)0
-rw-r--r--cpu/at32ap/at32ap700x/gpio.c (renamed from cpu/at32ap/at32ap7000/gpio.c)9
-rw-r--r--cpu/at32ap/atmel_mci.c13
3 files changed, 15 insertions, 7 deletions
diff --git a/cpu/at32ap/at32ap7000/Makefile b/cpu/at32ap/at32ap700x/Makefile
index d276712118..d276712118 100644
--- a/cpu/at32ap/at32ap7000/Makefile
+++ b/cpu/at32ap/at32ap700x/Makefile
diff --git a/cpu/at32ap/at32ap7000/gpio.c b/cpu/at32ap/at32ap700x/gpio.c
index 52f5372a60..859124a91f 100644
--- a/cpu/at32ap/at32ap7000/gpio.c
+++ b/cpu/at32ap/at32ap700x/gpio.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
+#include <asm/arch/chip-features.h>
#include <asm/arch/gpio.h>
/*
@@ -52,6 +53,7 @@ void gpio_enable_ebi(void)
#endif
}
+#ifdef AT32AP700x_CHIP_HAS_USART
void gpio_enable_usart0(void)
{
gpio_select_periph_B(GPIO_PIN_PA8, 0);
@@ -72,10 +74,12 @@ void gpio_enable_usart2(void)
void gpio_enable_usart3(void)
{
+ gpio_select_periph_B(GPIO_PIN_PB17, 0);
gpio_select_periph_B(GPIO_PIN_PB18, 0);
- gpio_select_periph_B(GPIO_PIN_PB19, 0);
}
+#endif
+#ifdef AT32AP700x_CHIP_HAS_MACB
void gpio_enable_macb0(void)
{
gpio_select_periph_A(GPIO_PIN_PC3, 0); /* TXD0 */
@@ -125,7 +129,9 @@ void gpio_enable_macb1(void)
gpio_select_periph_B(GPIO_PIN_PD15, 0); /* SPD */
#endif
}
+#endif
+#ifdef AT32AP700x_CHIP_HAS_MMCI
void gpio_enable_mmci(void)
{
gpio_select_periph_A(GPIO_PIN_PA10, 0); /* CLK */
@@ -135,3 +141,4 @@ void gpio_enable_mmci(void)
gpio_select_periph_A(GPIO_PIN_PA14, 0); /* DATA2 */
gpio_select_periph_A(GPIO_PIN_PA15, 0); /* DATA3 */
}
+#endif
diff --git a/cpu/at32ap/atmel_mci.c b/cpu/at32ap/atmel_mci.c
index cf48be10ba..f59dfb5995 100644
--- a/cpu/at32ap/atmel_mci.c
+++ b/cpu/at32ap/atmel_mci.c
@@ -198,11 +198,11 @@ mmc_bread(int dev, unsigned long start, lbaint_t blkcnt,
/* Put the device into Transfer state */
ret = mmc_cmd(MMC_CMD_SELECT_CARD, mmc_rca << 16, resp, R1 | NCR);
- if (ret) goto fail;
+ if (ret) goto out;
/* Set block length */
ret = mmc_cmd(MMC_CMD_SET_BLOCKLEN, mmc_blkdev.blksz, resp, R1 | NCR);
- if (ret) goto fail;
+ if (ret) goto out;
pr_debug("MCI_DTOR = %08lx\n", mmci_readl(DTOR));
@@ -211,7 +211,7 @@ mmc_bread(int dev, unsigned long start, lbaint_t blkcnt,
start * mmc_blkdev.blksz, resp,
(R1 | NCR | TRCMD_START | TRDIR_READ
| TRTYP_BLOCK));
- if (ret) goto fail;
+ if (ret) goto out;
ret = -EIO;
wordcount = 0;
@@ -219,7 +219,7 @@ mmc_bread(int dev, unsigned long start, lbaint_t blkcnt,
do {
status = mmci_readl(SR);
if (status & (ERROR_FLAGS | MMCI_BIT(OVRE)))
- goto fail;
+ goto read_error;
} while (!(status & MMCI_BIT(RXRDY)));
if (status & MMCI_BIT(RXRDY)) {
@@ -244,9 +244,10 @@ out:
mmc_cmd(MMC_CMD_SELECT_CARD, 0, resp, NCR);
return i;
-fail:
+read_error:
mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR);
- printf("mmc: bread failed, card status = %08x\n", card_status);
+ printf("mmc: bread failed, status = %08x, card status = %08x\n",
+ status, card_status);
goto out;
}