mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
Don't use "byte" as identifier
Some mingw declares a global identifier "byte", causing -Werror -Wshadow to break compilation. This patch renames all identifiers called "byte". Corresponding to flashrom svn r861. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
e7f3209487
commit
4e2fb0ee3e
@ -46,7 +46,7 @@ int spi_chip_write_256(struct flashchip *flash, uint8_t *buf);
|
|||||||
int spi_chip_read(struct flashchip *flash, uint8_t *buf, int start, int len);
|
int spi_chip_read(struct flashchip *flash, uint8_t *buf, int start, int len);
|
||||||
uint8_t spi_read_status_register(void);
|
uint8_t spi_read_status_register(void);
|
||||||
int spi_disable_blockprotect(void);
|
int spi_disable_blockprotect(void);
|
||||||
int spi_byte_program(int addr, uint8_t byte);
|
int spi_byte_program(int addr, uint8_t databyte);
|
||||||
int spi_nbyte_program(int addr, uint8_t *bytes, int len);
|
int spi_nbyte_program(int addr, uint8_t *bytes, int len);
|
||||||
int spi_nbyte_read(int addr, uint8_t *bytes, int len);
|
int spi_nbyte_read(int addr, uint8_t *bytes, int len);
|
||||||
int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);
|
int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);
|
||||||
|
@ -1026,19 +1026,19 @@ static int enable_flash_sb400(struct pci_dev *dev, const char *name)
|
|||||||
|
|
||||||
static int enable_flash_mcp55(struct pci_dev *dev, const char *name)
|
static int enable_flash_mcp55(struct pci_dev *dev, const char *name)
|
||||||
{
|
{
|
||||||
uint8_t old, new, byte;
|
uint8_t old, new, val;
|
||||||
uint16_t word;
|
uint16_t wordval;
|
||||||
|
|
||||||
/* Set the 0-16 MB enable bits. */
|
/* Set the 0-16 MB enable bits. */
|
||||||
byte = pci_read_byte(dev, 0x88);
|
val = pci_read_byte(dev, 0x88);
|
||||||
byte |= 0xff; /* 256K */
|
val |= 0xff; /* 256K */
|
||||||
pci_write_byte(dev, 0x88, byte);
|
pci_write_byte(dev, 0x88, val);
|
||||||
byte = pci_read_byte(dev, 0x8c);
|
val = pci_read_byte(dev, 0x8c);
|
||||||
byte |= 0xff; /* 1M */
|
val |= 0xff; /* 1M */
|
||||||
pci_write_byte(dev, 0x8c, byte);
|
pci_write_byte(dev, 0x8c, val);
|
||||||
word = pci_read_word(dev, 0x90);
|
wordval = pci_read_word(dev, 0x90);
|
||||||
word |= 0x7fff; /* 16M */
|
wordval |= 0x7fff; /* 16M */
|
||||||
pci_write_word(dev, 0x90, word);
|
pci_write_word(dev, 0x90, wordval);
|
||||||
|
|
||||||
old = pci_read_byte(dev, 0x6d);
|
old = pci_read_byte(dev, 0x6d);
|
||||||
new = old | 0x01;
|
new = old | 0x01;
|
||||||
|
4
spi.c
4
spi.c
@ -832,7 +832,7 @@ int spi_write_status_register(int status)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int spi_byte_program(int addr, uint8_t byte)
|
int spi_byte_program(int addr, uint8_t databyte)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
struct spi_command cmds[] = {
|
struct spi_command cmds[] = {
|
||||||
@ -843,7 +843,7 @@ int spi_byte_program(int addr, uint8_t byte)
|
|||||||
.readarr = NULL,
|
.readarr = NULL,
|
||||||
}, {
|
}, {
|
||||||
.writecnt = JEDEC_BYTE_PROGRAM_OUTSIZE,
|
.writecnt = JEDEC_BYTE_PROGRAM_OUTSIZE,
|
||||||
.writearr = (const unsigned char[]){ JEDEC_BYTE_PROGRAM, (addr >> 16) & 0xff, (addr >> 8) & 0xff, (addr & 0xff), byte },
|
.writearr = (const unsigned char[]){ JEDEC_BYTE_PROGRAM, (addr >> 16) & 0xff, (addr >> 8) & 0xff, (addr & 0xff), databyte },
|
||||||
.readcnt = 0,
|
.readcnt = 0,
|
||||||
.readarr = NULL,
|
.readarr = NULL,
|
||||||
}, {
|
}, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user