summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/cfi_flash.c2
-rw-r--r--drivers/mtd/cfi_mtd.c9
-rw-r--r--drivers/spi/bfin_spi.c2
3 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 175d82a..d0732f5 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2098,7 +2098,7 @@ unsigned long flash_init (void)
#ifdef CONFIG_ENV_ADDR_REDUND
flash_protect (FLAG_PROTECT_SET,
CONFIG_ENV_ADDR_REDUND,
- CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SIZE_REDUND - 1,
+ CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
flash_get_info(CONFIG_ENV_ADDR_REDUND));
#endif
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index f03e4fb..4a76917 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -43,11 +43,16 @@ static int cfi_mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
int s_last = -1;
int error, sect;
- for (sect = 0; sect < fi->sector_count - 1; sect++) {
+ for (sect = 0; sect < fi->sector_count; sect++) {
if (a_start == fi->start[sect])
s_first = sect;
- if (a_end == fi->start[sect + 1]) {
+ if (sect < fi->sector_count - 1) {
+ if (a_end == fi->start[sect + 1]) {
+ s_last = sect;
+ break;
+ }
+ } else {
s_last = sect;
break;
}
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index bc255cc..2a72f99 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -156,7 +156,7 @@ static void spi_portmux(struct spi_slave *slave)
case 1: SET_MUX(f, 2, 1); f_fer |= PF7; break;
case 2: /* see G above */ g_fer |= PG15; break;
case 3: SET_MUX(h, 1, 3); f_fer |= PH4; break;
- case 4: /* no muxing */ break;
+ case 4: /* no muxing */ h_fer |= PH8; break;
case 5: SET_MUX(g, 1, 3); h_fer |= PG3; break;
case 6: /* no muxing */ break;
case 7: /* no muxing */ break;