summaryrefslogtreecommitdiff
path: root/sst28sf040.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-03-06 22:26:00 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-03-06 22:26:00 +0000
commit2bbb5b5ee0fb37bec26b7d45c2ba75ec010f5889 (patch)
treea396b47eb0133b6a7543d69216933227a2c26b5c /sst28sf040.c
parentcce721733f7bb644bb9d83f656b22fac072452e8 (diff)
downloadflashrom-2bbb5b5ee0fb37bec26b7d45c2ba75ec010f5889.tar.gz
Original v2 revision: 3984
FreeBSD definitions of (read|write)[bwl] collide with our own. Before we attempt trickery, we can simply rename the accessor functions. Patch created with the help of Coccinelle. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <idwer_v@hotmail.com> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@420 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'sst28sf040.c')
-rw-r--r--sst28sf040.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sst28sf040.c b/sst28sf040.c
index 7adfcfd..282b369 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -34,33 +34,33 @@ static __inline__ void protect_28sf040(volatile uint8_t *bios)
{
uint8_t tmp;
- tmp = readb(bios + 0x1823);
- tmp = readb(bios + 0x1820);
- tmp = readb(bios + 0x1822);
- tmp = readb(bios + 0x0418);
- tmp = readb(bios + 0x041B);
- tmp = readb(bios + 0x0419);
- tmp = readb(bios + 0x040A);
+ tmp = chip_readb(bios + 0x1823);
+ tmp = chip_readb(bios + 0x1820);
+ tmp = chip_readb(bios + 0x1822);
+ tmp = chip_readb(bios + 0x0418);
+ tmp = chip_readb(bios + 0x041B);
+ tmp = chip_readb(bios + 0x0419);
+ tmp = chip_readb(bios + 0x040A);
}
static __inline__ void unprotect_28sf040(volatile uint8_t *bios)
{
uint8_t tmp;
- tmp = readb(bios + 0x1823);
- tmp = readb(bios + 0x1820);
- tmp = readb(bios + 0x1822);
- tmp = readb(bios + 0x0418);
- tmp = readb(bios + 0x041B);
- tmp = readb(bios + 0x0419);
- tmp = readb(bios + 0x041A);
+ tmp = chip_readb(bios + 0x1823);
+ tmp = chip_readb(bios + 0x1820);
+ tmp = chip_readb(bios + 0x1822);
+ tmp = chip_readb(bios + 0x0418);
+ tmp = chip_readb(bios + 0x041B);
+ tmp = chip_readb(bios + 0x0419);
+ tmp = chip_readb(bios + 0x041A);
}
static __inline__ int erase_sector_28sf040(volatile uint8_t *bios,
unsigned long address)
{
- writeb(AUTO_PG_ERASE1, bios);
- writeb(AUTO_PG_ERASE2, bios + address);
+ chip_writeb(AUTO_PG_ERASE1, bios);
+ chip_writeb(AUTO_PG_ERASE2, bios + address);
/* wait for Toggle bit ready */
toggle_ready_jedec(bios);
@@ -83,8 +83,8 @@ static __inline__ int write_sector_28sf040(volatile uint8_t *bios,
continue;
}
/*issue AUTO PROGRAM command */
- writeb(AUTO_PGRM, dst);
- writeb(*src++, dst++);
+ chip_writeb(AUTO_PGRM, dst);
+ chip_writeb(*src++, dst++);
/* wait for Toggle bit ready */
toggle_ready_jedec(bios);
@@ -98,16 +98,16 @@ int probe_28sf040(struct flashchip *flash)
volatile uint8_t *bios = flash->virtual_memory;
uint8_t id1, id2;
- writeb(RESET, bios);
+ chip_writeb(RESET, bios);
myusec_delay(10);
- writeb(READ_ID, bios);
+ chip_writeb(READ_ID, bios);
myusec_delay(10);
- id1 = readb(bios);
+ id1 = chip_readb(bios);
myusec_delay(10);
- id2 = readb(bios + 0x01);
+ id2 = chip_readb(bios + 0x01);
- writeb(RESET, bios);
+ chip_writeb(RESET, bios);
myusec_delay(10);
printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
@@ -122,8 +122,8 @@ int erase_28sf040(struct flashchip *flash)
volatile uint8_t *bios = flash->virtual_memory;
unprotect_28sf040(bios);
- writeb(CHIP_ERASE, bios);
- writeb(CHIP_ERASE, bios);
+ chip_writeb(CHIP_ERASE, bios);
+ chip_writeb(CHIP_ERASE, bios);
protect_28sf040(bios);
myusec_delay(10);