powerpc: Define missing ppc_md.nvram_size for CHRP and PowerMac
Add the nvram_size() function to those PowerPC platforms that don't already have one: CHRP and PowerMac. This means that the ppc_md.nvram_size() function can be called by nvram_get_size(). Since we are addressing CHRP inconsistencies here, rename chrp_nvram_read and chrp_nvram_write, which break the naming convention used across powerpc platforms for NVRAM accessor functions. Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

zatwierdzone przez
Greg Kroah-Hartman

rodzic
7fc0ac05f3
commit
ebcebc7f45
@@ -147,6 +147,11 @@ static ssize_t core99_nvram_size(void)
|
||||
static volatile unsigned char __iomem *nvram_addr;
|
||||
static int nvram_mult;
|
||||
|
||||
static ssize_t ppc32_nvram_size(void)
|
||||
{
|
||||
return NVRAM_SIZE;
|
||||
}
|
||||
|
||||
static unsigned char direct_nvram_read_byte(int addr)
|
||||
{
|
||||
return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
|
||||
@@ -590,21 +595,25 @@ int __init pmac_nvram_init(void)
|
||||
nvram_mult = 1;
|
||||
ppc_md.nvram_read_val = direct_nvram_read_byte;
|
||||
ppc_md.nvram_write_val = direct_nvram_write_byte;
|
||||
ppc_md.nvram_size = ppc32_nvram_size;
|
||||
} else if (nvram_naddrs == 1) {
|
||||
nvram_data = ioremap(r1.start, s1);
|
||||
nvram_mult = (s1 + NVRAM_SIZE - 1) / NVRAM_SIZE;
|
||||
ppc_md.nvram_read_val = direct_nvram_read_byte;
|
||||
ppc_md.nvram_write_val = direct_nvram_write_byte;
|
||||
ppc_md.nvram_size = ppc32_nvram_size;
|
||||
} else if (nvram_naddrs == 2) {
|
||||
nvram_addr = ioremap(r1.start, s1);
|
||||
nvram_data = ioremap(r2.start, s2);
|
||||
ppc_md.nvram_read_val = indirect_nvram_read_byte;
|
||||
ppc_md.nvram_write_val = indirect_nvram_write_byte;
|
||||
ppc_md.nvram_size = ppc32_nvram_size;
|
||||
} else if (nvram_naddrs == 0 && sys_ctrler == SYS_CTRLER_PMU) {
|
||||
#ifdef CONFIG_ADB_PMU
|
||||
nvram_naddrs = -1;
|
||||
ppc_md.nvram_read_val = pmu_nvram_read_byte;
|
||||
ppc_md.nvram_write_val = pmu_nvram_write_byte;
|
||||
ppc_md.nvram_size = ppc32_nvram_size;
|
||||
#endif /* CONFIG_ADB_PMU */
|
||||
} else {
|
||||
printk(KERN_ERR "Incompatible type of NVRAM\n");
|
||||
|
Reference in New Issue
Block a user