Skip to contentSkip to conversation

rename pSeries nvram functions

PATCH In review Nathan Lynch 2 participants 6 messages Jan 25, 2007 – Jan 30, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rename pSeries nvram functions

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

---
 arch/powerpc/platforms/pseries/nvram.c |   14 +++++++-------
 arch/powerpc/platforms/pseries/setup.c |    2 +-
 include/asm-powerpc/nvram.h            |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)
arch/powerpc/platforms/pseries/nvram.c +7 -7
index 64163ce..45cce8c 100644
@@ -29,7 +29,7 @@ static char nvram_buf[NVRW_CNT];	/* assume this is in the first 4GB */
 static DEFINE_SPINLOCK(nvram_lock);
 
 
-static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
+static ssize_t rtas_nvram_read(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
 	unsigned long len;
@@ -73,7 +73,7 @@ static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
 	return p - buf;
 }
 
-static ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
+static ssize_t rtas_nvram_write(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
 	unsigned long len;
@@ -115,12 +115,12 @@ static ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
 	return p - buf;
 }
 
-static ssize_t pSeries_nvram_get_size(void)
+static ssize_t rtas_nvram_get_size(void)
 {
 	return nvram_size ? nvram_size : -ENODEV;
 }
 
-int __init pSeries_nvram_init(void)
+int __init rtas_nvram_init(void)
 {
 	struct device_node *nvram;
 	const unsigned int *nbytes_p;
@@ -141,9 +141,9 @@ int __init pSeries_nvram_init(void)
 	printk(KERN_INFO "PPC64 nvram contains %d bytes\n", nvram_size);
 	of_node_put(nvram);
 
-	ppc_md.nvram_read	= pSeries_nvram_read;
-	ppc_md.nvram_write	= pSeries_nvram_write;
-	ppc_md.nvram_size	= pSeries_nvram_get_size;
+	ppc_md.nvram_read	= rtas_nvram_read;
+	ppc_md.nvram_write	= rtas_nvram_write;
+	ppc_md.nvram_size	= rtas_nvram_get_size;
 
 	return 0;
 }
arch/powerpc/platforms/pseries/setup.c +1 -1
index 042ecae..488828f 100644
@@ -315,7 +315,7 @@ static void __init pSeries_setup_arch(void)
 	find_and_init_phbs();
 	eeh_init();
 
-	pSeries_nvram_init();
+	rtas_nvram_init();
 
 	/* Choose an idle loop */
 	if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
include/asm-powerpc/nvram.h +1 -1
index f3563e1..981fb9e 100644
@@ -68,7 +68,7 @@ extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type
 extern int nvram_clear_error_log(void);
 extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
 
-extern int pSeries_nvram_init(void);
+extern int rtas_nvram_init(void);
 extern int mmio_nvram_init(void);
 #endif /* __KERNEL__ */
 
Signature · 1 line
1.4.4.3
#1 lore raw
Quoted 8 lines · Nathan Lynch

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

Please, move them out of platform/pseries while at it, so you can also merge with chrp nvram.c which is pretty much the same.

Cheers,
Ben.

Quoted 82 lines
---
 arch/powerpc/platforms/pseries/nvram.c |   14 +++++++-------
 arch/powerpc/platforms/pseries/setup.c |    2 +-
 include/asm-powerpc/nvram.h            |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)
arch/powerpc/platforms/pseries/nvram.c +7 -7
index 64163ce..45cce8c 100644
@@ -29,7 +29,7 @@ static char nvram_buf[NVRW_CNT];	/* assume this is in the first 4GB */
 static DEFINE_SPINLOCK(nvram_lock);
 
 
-static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
+static ssize_t rtas_nvram_read(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
 	unsigned long len;
@@ -73,7 +73,7 @@ static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
 	return p - buf;
 }
 
-static ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
+static ssize_t rtas_nvram_write(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
 	unsigned long len;
@@ -115,12 +115,12 @@ static ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
 	return p - buf;
 }
 
-static ssize_t pSeries_nvram_get_size(void)
+static ssize_t rtas_nvram_get_size(void)
 {
 	return nvram_size ? nvram_size : -ENODEV;
 }
 
-int __init pSeries_nvram_init(void)
+int __init rtas_nvram_init(void)
 {
 	struct device_node *nvram;
 	const unsigned int *nbytes_p;
@@ -141,9 +141,9 @@ int __init pSeries_nvram_init(void)
 	printk(KERN_INFO "PPC64 nvram contains %d bytes\n", nvram_size);
 	of_node_put(nvram);
 
-	ppc_md.nvram_read	= pSeries_nvram_read;
-	ppc_md.nvram_write	= pSeries_nvram_write;
-	ppc_md.nvram_size	= pSeries_nvram_get_size;
+	ppc_md.nvram_read	= rtas_nvram_read;
+	ppc_md.nvram_write	= rtas_nvram_write;
+	ppc_md.nvram_size	= rtas_nvram_get_size;
 
 	return 0;
 }
arch/powerpc/platforms/pseries/setup.c +1 -1
index 042ecae..488828f 100644
@@ -315,7 +315,7 @@ static void __init pSeries_setup_arch(void)
 	find_and_init_phbs();
 	eeh_init();
 
-	pSeries_nvram_init();
+	rtas_nvram_init();
 
 	/* Choose an idle loop */
 	if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
include/asm-powerpc/nvram.h +1 -1
index f3563e1..981fb9e 100644
@@ -68,7 +68,7 @@ extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type
 extern int nvram_clear_error_log(void);
 extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
 
-extern int pSeries_nvram_init(void);
+extern int rtas_nvram_init(void);
 extern int mmio_nvram_init(void);
 #endif /* __KERNEL__ */
 
#2 lore raw
Quoted 5 lines · Benjamin Herrenschmidt
Quoted 4 lines · Nathan Lynch

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Quoted 7 lines
Quoted 4 lines

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

Please, move them out of platform/pseries while at it, so you can also merge with chrp nvram.c which is pretty much the same.

Oh, missed that second patch of yours... good :-) Now we should see if we can fixup chrp too..

Ben.

#3 lore raw
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Nathan Lynch

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Please, move them out of platform/pseries while at it, so you can also merge with chrp nvram.c which is pretty much the same.

Oh, missed that second patch of yours... good :-) Now we should see if we can fixup chrp too..

I'll look into it, though I might be hard-pressed to find a chrp machine with which to test.

#4 lore raw
Quoted 12 lines · Nathan Lynch
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 8 lines · Nathan Lynch

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Please, move them out of platform/pseries while at it, so you can also merge with chrp nvram.c which is pretty much the same.

Oh, missed that second patch of yours... good :-) Now we should see if we can fixup chrp too..

I'll look into it, though I might be hard-pressed to find a chrp machine with which to test.

I haev a couple, If you don't beat me, I'll have a look at doing the chrp bits next week.

Ben.

#5 lore raw
Quoted 16 lines · Benjamin Herrenschmidt
Quoted 15 lines · Nathan Lynch
Quoted 14 lines · Benjamin Herrenschmidt
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 8 lines · Nathan Lynch

The nvram support in the pSeries platform code is not really tied to the pSeries platform. This code is useful on other platforms that have the necessary firmware support.

Change the "pSeries" prefixes on the nvram function names to "rtas" in preparation for moving this code to a platform-neutral location.

Please, move them out of platform/pseries while at it, so you can also merge with chrp nvram.c which is pretty much the same.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Oh, missed that second patch of yours... good :-) Now we should see if we can fixup chrp too..

I'll look into it, though I might be hard-pressed to find a chrp machine with which to test.

I haev a couple, If you don't beat me, I'll have a look at doing the chrp bits next week.

Actually... it turns out we can use the mmio nvram backend on maple (at least on systems with SLOF). It seems to be quite a bit faster than RTAS.

So I think I'll submit a patch enabling MMIO_NVRAM for maple and leave the consolidation of the pseries and chrp nvram code as a separate matter.