Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292491
b: refs/heads/master
c: 2d4b971
h: refs/heads/master
i:
  292489: 3f64897
  292487: 01caa7f
v: v3
  • Loading branch information
Akinobu Mita authored and Benjamin Herrenschmidt committed Mar 7, 2012
1 parent 1a9c898 commit ae618ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad5b7f1350c263eef0c99c20f8659d0ed363cb32
refs/heads/master: 2d4b971287cbce16585acda4b76308faa8da0950
42 changes: 19 additions & 23 deletions trunk/arch/powerpc/platforms/powermac/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static u32 core99_check(u8* datas)

static int sm_erase_bank(int bank)
{
int stat, i;
int stat;
unsigned long timeout;

u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
Expand All @@ -301,11 +301,10 @@ static int sm_erase_bank(int bank)
out_8(base, SM_FLASH_CMD_CLEAR_STATUS);
out_8(base, SM_FLASH_CMD_RESET);

for (i=0; i<NVRAM_SIZE; i++)
if (base[i] != 0xff) {
printk(KERN_ERR "nvram: Sharp/Micron flash erase failed !\n");
return -ENXIO;
}
if (memchr_inv(base, 0xff, NVRAM_SIZE)) {
printk(KERN_ERR "nvram: Sharp/Micron flash erase failed !\n");
return -ENXIO;
}
return 0;
}

Expand Down Expand Up @@ -336,17 +335,16 @@ static int sm_write_bank(int bank, u8* datas)
}
out_8(base, SM_FLASH_CMD_CLEAR_STATUS);
out_8(base, SM_FLASH_CMD_RESET);
for (i=0; i<NVRAM_SIZE; i++)
if (base[i] != datas[i]) {
printk(KERN_ERR "nvram: Sharp/Micron flash write failed !\n");
return -ENXIO;
}
if (memcmp(base, datas, NVRAM_SIZE)) {
printk(KERN_ERR "nvram: Sharp/Micron flash write failed !\n");
return -ENXIO;
}
return 0;
}

static int amd_erase_bank(int bank)
{
int i, stat = 0;
int stat = 0;
unsigned long timeout;

u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
Expand Down Expand Up @@ -382,12 +380,11 @@ static int amd_erase_bank(int bank)
/* Reset */
out_8(base, 0xf0);
udelay(1);

for (i=0; i<NVRAM_SIZE; i++)
if (base[i] != 0xff) {
printk(KERN_ERR "nvram: AMD flash erase failed !\n");
return -ENXIO;
}

if (memchr_inv(base, 0xff, NVRAM_SIZE)) {
printk(KERN_ERR "nvram: AMD flash erase failed !\n");
return -ENXIO;
}
return 0;
}

Expand Down Expand Up @@ -429,11 +426,10 @@ static int amd_write_bank(int bank, u8* datas)
out_8(base, 0xf0);
udelay(1);

for (i=0; i<NVRAM_SIZE; i++)
if (base[i] != datas[i]) {
printk(KERN_ERR "nvram: AMD flash write failed !\n");
return -ENXIO;
}
if (memcmp(base, datas, NVRAM_SIZE)) {
printk(KERN_ERR "nvram: AMD flash write failed !\n");
return -ENXIO;
}
return 0;
}

Expand Down

0 comments on commit ae618ac

Please sign in to comment.