* [PATCH 1/2] rename pSeries nvram functions
@ 2007-01-25 0:16 Nathan Lynch
2007-01-25 0:46 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Lynch @ 2007-01-25 0:16 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras
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.
Signed-off-by: Nathan Lynch <ntl@pobox.com>
---
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(-)
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 64163ce..45cce8c 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -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;
}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 042ecae..488828f 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -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)) {
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h
index f3563e1..981fb9e 100644
--- a/include/asm-powerpc/nvram.h
+++ b/include/asm-powerpc/nvram.h
@@ -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__ */
--
1.4.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] rename pSeries nvram functions
2007-01-25 0:16 [PATCH 1/2] rename pSeries nvram functions Nathan Lynch
@ 2007-01-25 0:46 ` Benjamin Herrenschmidt
2007-01-25 0:47 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-25 0:46 UTC (permalink / raw)
To: Nathan Lynch; +Cc: linuxppc-dev, Paul Mackerras
On Wed, 2007-01-24 at 18:16 -0600, Nathan Lynch wrote:
> 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.
>
> Signed-off-by: Nathan Lynch <ntl@pobox.com>
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.
> ---
> 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(-)
>
> diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
> index 64163ce..45cce8c 100644
> --- a/arch/powerpc/platforms/pseries/nvram.c
> +++ b/arch/powerpc/platforms/pseries/nvram.c
> @@ -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;
> }
> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> index 042ecae..488828f 100644
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -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)) {
> diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h
> index f3563e1..981fb9e 100644
> --- a/include/asm-powerpc/nvram.h
> +++ b/include/asm-powerpc/nvram.h
> @@ -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__ */
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] rename pSeries nvram functions
2007-01-25 0:46 ` Benjamin Herrenschmidt
@ 2007-01-25 0:47 ` Benjamin Herrenschmidt
2007-01-25 1:00 ` Nathan Lynch
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-25 0:47 UTC (permalink / raw)
To: Nathan Lynch; +Cc: linuxppc-dev, Paul Mackerras
On Thu, 2007-01-25 at 11:46 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2007-01-24 at 18:16 -0600, Nathan Lynch wrote:
> > 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.
> >
> > Signed-off-by: Nathan Lynch <ntl@pobox.com>
>
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] rename pSeries nvram functions
2007-01-25 0:47 ` Benjamin Herrenschmidt
@ 2007-01-25 1:00 ` Nathan Lynch
2007-01-25 3:41 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Lynch @ 2007-01-25 1:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
Benjamin Herrenschmidt wrote:
> On Thu, 2007-01-25 at 11:46 +1100, Benjamin Herrenschmidt wrote:
> > On Wed, 2007-01-24 at 18:16 -0600, Nathan Lynch wrote:
> > > 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.
> > >
> > > Signed-off-by: Nathan Lynch <ntl@pobox.com>
> >
> > 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] rename pSeries nvram functions
2007-01-25 1:00 ` Nathan Lynch
@ 2007-01-25 3:41 ` Benjamin Herrenschmidt
2007-01-30 20:16 ` Nathan Lynch
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-25 3:41 UTC (permalink / raw)
To: Nathan Lynch; +Cc: linuxppc-dev, Paul Mackerras
On Wed, 2007-01-24 at 19:00 -0600, Nathan Lynch wrote:
> Benjamin Herrenschmidt wrote:
> > On Thu, 2007-01-25 at 11:46 +1100, Benjamin Herrenschmidt wrote:
> > > On Wed, 2007-01-24 at 18:16 -0600, Nathan Lynch wrote:
> > > > 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.
> > > >
> > > > Signed-off-by: Nathan Lynch <ntl@pobox.com>
> > >
> > > 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] rename pSeries nvram functions
2007-01-25 3:41 ` Benjamin Herrenschmidt
@ 2007-01-30 20:16 ` Nathan Lynch
0 siblings, 0 replies; 6+ messages in thread
From: Nathan Lynch @ 2007-01-30 20:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
Benjamin Herrenschmidt wrote:
> On Wed, 2007-01-24 at 19:00 -0600, Nathan Lynch wrote:
> > Benjamin Herrenschmidt wrote:
> > > On Thu, 2007-01-25 at 11:46 +1100, Benjamin Herrenschmidt wrote:
> > > > On Wed, 2007-01-24 at 18:16 -0600, Nathan Lynch wrote:
> > > > > 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.
> > > > >
> > > > > Signed-off-by: Nathan Lynch <ntl@pobox.com>
> > > >
> > > > 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.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-01-30 20:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 0:16 [PATCH 1/2] rename pSeries nvram functions Nathan Lynch
2007-01-25 0:46 ` Benjamin Herrenschmidt
2007-01-25 0:47 ` Benjamin Herrenschmidt
2007-01-25 1:00 ` Nathan Lynch
2007-01-25 3:41 ` Benjamin Herrenschmidt
2007-01-30 20:16 ` Nathan Lynch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).