mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 14:42:36 +02:00
Use uintptr_t for chipaddr instead of unsigned long
Corresponding to flashrom svn r1698. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
11990da1d3
commit
c2333751c4
@ -428,26 +428,26 @@ void dummy_unmap(void *virt_addr, size_t len)
|
||||
static void dummy_chip_writeb(const struct flashctx *flash, uint8_t val,
|
||||
chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, val=0x%02x\n", __func__, addr, val);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", val=0x%02x\n", __func__, addr, val);
|
||||
}
|
||||
|
||||
static void dummy_chip_writew(const struct flashctx *flash, uint16_t val,
|
||||
chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, val=0x%04x\n", __func__, addr, val);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", val=0x%04x\n", __func__, addr, val);
|
||||
}
|
||||
|
||||
static void dummy_chip_writel(const struct flashctx *flash, uint32_t val,
|
||||
chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, val=0x%08x\n", __func__, addr, val);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", val=0x%08x\n", __func__, addr, val);
|
||||
}
|
||||
|
||||
static void dummy_chip_writen(const struct flashctx *flash, uint8_t *buf,
|
||||
chipaddr addr, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
msg_pspew("%s: addr=0x%lx, len=0x%08lx, writing data (hex):",
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", len=0x%08lx, writing data (hex):",
|
||||
__func__, addr, (unsigned long)len);
|
||||
for (i = 0; i < len; i++) {
|
||||
if ((i % 16) == 0)
|
||||
@ -459,28 +459,28 @@ static void dummy_chip_writen(const struct flashctx *flash, uint8_t *buf,
|
||||
static uint8_t dummy_chip_readb(const struct flashctx *flash,
|
||||
const chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, returning 0xff\n", __func__, addr);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", returning 0xff\n", __func__, addr);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
static uint16_t dummy_chip_readw(const struct flashctx *flash,
|
||||
const chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, returning 0xffff\n", __func__, addr);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", returning 0xffff\n", __func__, addr);
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
static uint32_t dummy_chip_readl(const struct flashctx *flash,
|
||||
const chipaddr addr)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, returning 0xffffffff\n", __func__, addr);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", returning 0xffffffff\n", __func__, addr);
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
static void dummy_chip_readn(const struct flashctx *flash, uint8_t *buf,
|
||||
const chipaddr addr, size_t len)
|
||||
{
|
||||
msg_pspew("%s: addr=0x%lx, len=0x%lx, returning array of 0xff\n",
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR ", len=0x%lx, returning array of 0xff\n",
|
||||
__func__, addr, (unsigned long)len);
|
||||
memset(buf, 0xff, len);
|
||||
return;
|
||||
|
3
flash.h
3
flash.h
@ -41,7 +41,8 @@
|
||||
#define ERROR_OOM -100
|
||||
#define TIMEOUT_ERROR -101
|
||||
|
||||
typedef unsigned long chipaddr;
|
||||
/* TODO: check using code for correct usage of types */
|
||||
typedef uintptr_t chipaddr;
|
||||
|
||||
int register_shutdown(int (*function) (void *data), void *data);
|
||||
void *programmer_map_flash_region(const char *descr, unsigned long phys_addr,
|
||||
|
5
jedec.c
5
jedec.c
@ -376,7 +376,7 @@ int write_jedec_1(struct flashctx *flash, uint8_t *src, unsigned int start,
|
||||
dst++, src++;
|
||||
}
|
||||
if (failed)
|
||||
msg_cerr(" writing sector at 0x%lx failed!\n", olddst);
|
||||
msg_cerr(" writing sector at 0x%" PRIxPTR " failed!\n", olddst);
|
||||
|
||||
return failed;
|
||||
}
|
||||
@ -417,8 +417,7 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
if (failed) {
|
||||
msg_cerr(" page 0x%lx failed!\n",
|
||||
(d - bios) / page_size);
|
||||
msg_cerr(" page 0x%" PRIxPTR " failed!\n", (d - bios) / page_size);
|
||||
}
|
||||
return failed;
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ static uint8_t serprog_chip_readb(const struct flashctx *flash,
|
||||
sp_flush_stream();
|
||||
if (serialport_read(&c, 1) != 0)
|
||||
sp_die("readb byteread");
|
||||
msg_pspew("%s addr=0x%lx returning 0x%02X\n", __func__, addr, c);
|
||||
msg_pspew("%s addr=0x%" PRIxPTR " returning 0x%02X\n", __func__, addr, c);
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -797,7 +797,7 @@ static uint8_t serprog_chip_readb(const struct flashctx *flash,
|
||||
static void sp_do_read_n(uint8_t * buf, const chipaddr addr, size_t len)
|
||||
{
|
||||
unsigned char sbuf[6];
|
||||
msg_pspew("%s: addr=0x%lx len=%lu\n", __func__, addr, (unsigned long)len);
|
||||
msg_pspew("%s: addr=0x%" PRIxPTR " len=%lu\n", __func__, addr, (unsigned long)len);
|
||||
/* Stream the read-n -- as above. */
|
||||
if ((sp_opbuf_usage) || (sp_max_write_n && sp_write_n_bytes))
|
||||
sp_execute_opbuf_noflush();
|
||||
|
@ -41,7 +41,7 @@ static int write_lockbits_49lfxxxc(struct flashctx *flash, unsigned char bits)
|
||||
unsigned int i, left = flash->chip->total_size * 1024;
|
||||
unsigned long address;
|
||||
|
||||
msg_cdbg("\nbios=0x%08lx\n", registers);
|
||||
msg_cdbg("\nbios=0x%08" PRIxPTR "\n", registers);
|
||||
for (i = 0; left > 65536; i++, left -= 65536) {
|
||||
write_lockbits_block_49lfxxxc(flash, i * 65536, bits);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user