mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
eeprom: Make eeprom_write_enable() weak
Make this function weak and implement it's weak implementation so that the boards can just reimplement it. This zaps the horrid CONFIG_SYS_EEPROM_WREN macro. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
02c321cf88
commit
52cd47c9a5
1 changed files with 9 additions and 9 deletions
|
|
@ -44,9 +44,10 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_EEPROM_WREN)
|
__weak int eeprom_write_enable(unsigned dev_addr, int state)
|
||||||
extern int eeprom_write_enable (unsigned dev_addr, int state);
|
{
|
||||||
#endif
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void eeprom_init(void)
|
void eeprom_init(void)
|
||||||
{
|
{
|
||||||
|
|
@ -163,9 +164,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
|
||||||
int rcode = 0;
|
int rcode = 0;
|
||||||
uchar addr[3];
|
uchar addr[3];
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_EEPROM_WREN)
|
eeprom_write_enable(dev_addr, 1);
|
||||||
eeprom_write_enable (dev_addr,1);
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* Write data until done or would cross a write page boundary.
|
* Write data until done or would cross a write page boundary.
|
||||||
* We must write the address again when changing pages
|
* We must write the address again when changing pages
|
||||||
|
|
@ -215,9 +215,9 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
|
||||||
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(CONFIG_SYS_EEPROM_WREN)
|
|
||||||
eeprom_write_enable (dev_addr,0);
|
eeprom_write_enable(dev_addr, 0);
|
||||||
#endif
|
|
||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue