mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
powerpc/nvram: Enable use Generic NVRAM driver for different size chips
Remove the reliance on a staticly defined NVRAM size, allowing platforms to support NVRAMs with sizes differing from the standard. A fall back value is provided for platforms not supporting this extension. Signed-off-by: Martyn Welch <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
This commit is contained in:
parent
1d6ed32226
commit
d331d8305c
3 changed files with 31 additions and 7 deletions
|
|
@ -107,6 +107,9 @@ extern void pmac_xpram_write(int xpaddr, u8 data);
|
|||
/* Synchronize NVRAM */
|
||||
extern void nvram_sync(void);
|
||||
|
||||
/* Determine NVRAM size */
|
||||
extern ssize_t nvram_get_size(void);
|
||||
|
||||
/* Normal access to NVRAM */
|
||||
extern unsigned char nvram_read_byte(int i);
|
||||
extern void nvram_write_byte(unsigned char c, int i);
|
||||
|
|
|
|||
|
|
@ -210,6 +210,14 @@ void nvram_write_byte(unsigned char val, int addr)
|
|||
}
|
||||
EXPORT_SYMBOL(nvram_write_byte);
|
||||
|
||||
ssize_t nvram_get_size(void)
|
||||
{
|
||||
if (ppc_md.nvram_size)
|
||||
return ppc_md.nvram_size();
|
||||
return -1;
|
||||
}
|
||||
EXPORT_SYMBOL(nvram_get_size);
|
||||
|
||||
void nvram_sync(void)
|
||||
{
|
||||
if (ppc_md.nvram_sync)
|
||||
|
|
|
|||
Loading…
Reference in a new issue