[RFC 12/24] char/nvram: Add "devname:nvram" module alias

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-05-31 11:01:11.0 +1000 +++ linux/drivers/char

[RFC 13/24] powerpc: Cleanup nvram includes

2015-05-30 Thread Finn Thain
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h duplicate those in linux/nvram.h. Get rid of the former to prepare for adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for general use). Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h

[RFC 05/24] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-05-30 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This makes them distict from nvram_ops members. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 194

[RFC 04/24] m68k/atari: Replace nvram_{read, write}_byte with arch_nvram_ops

2015-05-30 Thread Finn Thain
. Replace this validate-checksum-and-read-byte sequence with the equivalent rtc_nvram_ops.read() call and remove the now unused functions. Signed-off-by: Finn Thain --- The advantage of the new ops struct over the old global nvram_* functions is that the misc device module can be shared by different

[RFC 22/24] m68k/mac: Adopt nvram module

2015-05-30 Thread Finn Thain
on Macs. Signed-off-by: Finn Thain --- The arch_nvram_ops struct can only be defined once, of course, so the Mac and Atari ops structs are mutually exclusive. The final patch will allow the two implementations to co-exist in a multi-platform kernel binary. --- arch/m68k/Kconfig|2

[RFC 23/24] m68k/mac: Fix PRAM accessors

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- Tested on a PowerBook 520 and Quadra 650. --- arch/m68k/mac/misc.c | 35 +-- include/uapi/linux/pmu.h |2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) Index: linux/arch/m68k/mac/misc.c

[RFC 14/24] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-05-30 Thread Finn Thain
d and chrp_nvram_write, which break the naming convention used across PowerPC platforms for NVRAM accessor functions. Signed-off-by: Finn Thain --- arch/powerpc/platforms/chrp/nvram.c | 14 ++ arch/powerpc/platforms/powermac/nvram.c |9 + 2 files changed, 19 insertions(+), 4 dele

[RFC 01/24] macintosh/nvram: Remove as unused

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/macintosh/nvram.c | 130 -- 1 file changed, 130 deletions(-) Index: linux/drivers/macintosh/nvram.c === --- linux.orig/drivers/macintosh/nvram.c

[RFC 15/24] powerpc: Implement arch_nvram_ops.get_size() and remove old nvram_* exports

2015-05-30 Thread Finn Thain
Implement arch_nvram_ops for PPC32 and make use of it in the generic_nvram misc device module so that the nvram_* function exports can be removed. Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10 +++--- drivers/char

[RFC 06/24] char/nvram: Adopt arch_nvram_ops

2015-05-30 Thread Finn Thain
platforms and architectures. Signed-off-by: Finn Thain --- The #ifdefs here restrict the procfs and checksumming code to those architectures with PC-style RTC NVRAM. There may be a better place for that code but it's an open question. See https://lkml.org/lkml/2015/2/3/22 The procfs code her

[RFC 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-05-30 Thread Finn Thain
A multi-platform kernel binary needs to decide at run-time how to dispatch the arch_nvram_ops calls. Add platform-independent arch_nvram_ops, for use when multiple platform-specific NVRAM ops implementations are needed. Signed-off-by: Finn Thain --- arch/m68k/Kconfig |2

[RFC 18/24] nvram: Drop nvram_* symbol exports and prototypes

2015-05-30 Thread Finn Thain
Drivers now use the arch_nvram_ops calls so remove the function exports and prototypes. nvram_check_checksum() is unused so remove it. Signed-off-by: Finn Thain --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +-- include/linux/nvram.h |8

[RFC 17/24] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-05-30 Thread Finn Thain
Make use of arch_nvram_ops in device drivers so that the nvram_* function exports can be removed. Since they are no longer global symbols, rename the PPC32 nvram_* functions appropriately. Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure. Signed-off-by: Finn Thain

[RFC 07/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-05-30 Thread Finn Thain
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the nvram_* function exports can be removed. This patch series was tested on a ThinkPad T43. Signed-off-by: Finn Thain --- drivers/platform/x86/thinkpad_acpi.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[RFC 08/24] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-05-30 Thread Finn Thain
so that a multi-platform kernel binary can do the right thing when running on hardware without suitable NVRAM. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 61 -- include/linux/nvram.h |2 + 2 files changed, 37 insertions(+), 26

[RFC 11/24] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-05-30 Thread Finn Thain
Atari RTC NVRAM has a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Signed-off-by: Finn Thain --- This re-enables the nvram module for Atari. --- arch/m68k/Kconfig |3 +++ arch/m68k/atari

[RFC 10/24] char/nvram: Use generic fixed_size_llseek()

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-05-31 11:01

[RFC 00/24] Re-use nvram module

2015-05-30 Thread Finn Thain
The generic NVRAM module, drivers/char/generic_nvram, implements a /dev/nvram misc device. It is used only by 32-bit PowerPC platforms and isn't generic enough to be more widely used. The RTC NVRAM module, drivers/char/nvram, also implements a /dev/nvram misc device. It is used by x86, ARM and m6

[RFC 20/24] char/generic_nvram: Remove as unused

2015-05-30 Thread Finn Thain
And thus eliminate some twisted CONFIG_GENERIC_NVRAM logic. Signed-off-by: Finn Thain --- drivers/char/Makefile|6 - drivers/char/generic_nvram.c | 176 --- 2 files changed, 1 insertion(+), 181 deletions(-) Index: linux/drivers/char

[RFC 16/24] powerpc: Implement nvram sync ioctl

2015-05-30 Thread Finn Thain
Add the powerpc-specific sync() method to struct nvram_ops and implement the corresponding ioctl in the nvram module. This allows the nvram module to replace the generic_nvram module. Signed-off-by: Finn Thain --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those

[RFC 21/24] powerpc: Adopt nvram module for PPC64

2015-05-30 Thread Finn Thain
d PPC64 when the requested PowerMac NVRAM partition is not found. This is a userspace-visible change, in the non-existent partition case, which would be in an error path for an IOC_NVRAM_GET_OFFSET ioctl syscall. Signed-off-by: Finn Thain --- BTW, the IOC_NVRAM_SYNC ioctl call returns -EINVAL on P

[RFC 19/24] powerpc: Remove CONFIG_GENERIC_NVRAM and adopt CONFIG_HAVE_ARCH_NVRAM_OPS

2015-05-30 Thread Finn Thain
m module, unimplemented ioctls return -ENOTTY. Whereas, for the superseded generic_nvram module they would return -EINVAL. Signed-off-by: Finn Thain --- This ioctl change is visible to userspace code but only in an error path. I didn't find any userspace code that uses the IOC_NVRAM_GET_OFFSE

[RFC 09/24] char/nvram: Implement NVRAM read/write methods

2015-05-30 Thread Finn Thain
e former but will fall back on the latter. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 162 +++ 1 file changed, 114 insertions(+), 48 deletions(-) Index: linux/drivers/char/nvram.c

[RFC 02/24] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-05-30 Thread Finn Thain
the valkyriefb driver with powerpc, and since that driver uses NVRAM, it is affected by CONFIG_ATARI_SCSI, because of the use of "select NVRAM". Adopt the powerpc convention on m68k to avoid surprises. Signed-off-by: Finn Thain --- This patch temporarily disables CONFIG_NVRAM on Atari,

[RFC 03/24] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-05-30 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Change the vmode calculation from logical OR to bitwise OR, since it is obviously wrong. Signed-off-by: Finn Thain --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas atari_scsi says 14. Whic

Re: [RFC 07/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-05-30 Thread Finn Thain
On Sun, 31 May 2015, Henrique de Moraes Holschuh wrote: > On Sun, 31 May 2015, Finn Thain wrote: > > Make use of arch_nvram_ops in the thinkpad_acpi driver so that the > > nvram_* function exports can be removed. > > > > This patch series was tested on a ThinkPad T43

Re: [RFC 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-06-02 Thread Finn Thain
On Mon, 1 Jun 2015, Geert Uytterhoeven wrote: > > Index: linux/arch/m68k/atari/nvram.c > > === > > --- linux.orig/arch/m68k/atari/nvram.c 2015-05-31 11:01:21.0 > > +1000 > > +++ linux/arch/m68k/atari/nvram.c 2015-05-31

Re: [RFC 07/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-03 Thread Finn Thain
On Tue, 2 Jun 2015, Darren Hart wrote: > On Tue, Jun 02, 2015 at 07:09:28AM -0300, Henrique de Moraes Holschuh > wrote: > > Test results were sent to me privately, and they are correct, so... > > > > Finn, unless there is some compelling reason not to - like they are MBs > worth of data, plea

[RFC v2 01/24] macintosh/nvram: Remove as unused

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain Acked-by: Geert Uytterhoeven --- drivers/macintosh/nvram.c | 130 -- 1 file changed, 130 deletions(-) Index: linux/drivers/macintosh/nvram.c

[RFC v2 02/24] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-06-14 Thread Finn Thain
the valkyriefb driver with powerpc, and since that driver uses NVRAM, it is affected by CONFIG_ATARI_SCSI, because of the use of "select NVRAM". Adopt the powerpc convention on m68k to avoid surprises. Signed-off-by: Finn Thain --- This patch temporarily disables CONFIG_NVRAM on Atari,

[RFC v2 00/24] Re-use nvram module

2015-06-14 Thread Finn Thain
The generic NVRAM module, drivers/char/generic_nvram, implements a /dev/nvram misc device. It is used only by 32-bit PowerPC platforms and isn't generic enough to be more widely used. The RTC NVRAM module, drivers/char/nvram, also implements a /dev/nvram misc device. It is used by x86, ARM and m6

[RFC v2 03/24] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-06-14 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Change the vmode calculation from logical OR to bitwise OR, since it is obviously wrong. Signed-off-by: Finn Thain --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas atari_scsi says 14. Whic

[RFC v2 04/24] m68k/atari: Replace nvram_{read, write}_byte with arch_nvram_ops

2015-06-14 Thread Finn Thain
. Replace this validate-checksum-and-read-byte sequence with the equivalent rtc_nvram_ops.read() call and remove the now unused functions. Signed-off-by: Finn Thain --- The advantage of the new ops struct over the old global nvram_* functions is that the misc device module can be shared by different

[RFC v2 06/24] char/nvram: Adopt arch_nvram_ops

2015-06-14 Thread Finn Thain
platforms and architectures. Signed-off-by: Finn Thain --- The #ifdefs here restrict the procfs and checksumming code to those architectures with PC-style RTC NVRAM. There may be a better place for that code but it's an open question. See https://lkml.org/lkml/2015/2/3/22 The procfs code her

[RFC v2 12/24] char/nvram: Add "devname:nvram" module alias

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-06-14 17:45:46.0 +1000 +++ linux/drivers/char

[RFC v2 08/24] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-06-14 Thread Finn Thain
so that a multi-platform kernel binary can do the right thing when running on hardware without suitable NVRAM. Signed-off-by: Finn Thain --- Changed since v1: - Don't bother acquiring the mutex for unimplemented ioctls. --- drivers/char/

[RFC v2 13/24] powerpc: Cleanup nvram includes

2015-06-14 Thread Finn Thain
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h duplicate those in linux/nvram.h. Get rid of the former to prepare for adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for general use). Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h

[RFC v2 10/24] char/nvram: Use generic fixed_size_llseek()

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-06-14 17:45

[RFC v2 05/24] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-06-14 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This makes them distict from nvram_ops members. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 194

[RFC v2 11/24] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-14 Thread Finn Thain
Atari RTC NVRAM has a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Signed-off-by: Finn Thain --- This re-enables the nvram module for Atari. --- arch/m68k/Kconfig |3 +++ arch/m68k/atari

[RFC v2 07/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-14 Thread Finn Thain
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the nvram_* function exports can be removed. This patch series was tested on a ThinkPad T43. Signed-off-by: Finn Thain Acked-by: Henrique de Moraes Holschuh Reviewed-by: Darren Hart --- drivers/platform/x86/thinkpad_acpi.c

[RFC v2 09/24] char/nvram: Implement NVRAM read/write methods

2015-06-14 Thread Finn Thain
e former but will fall back on the latter. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 162 +++ 1 file changed, 114 insertions(+), 48 deletions(-) Index: linux/drivers/char/nvram.c

[RFC v2 14/24] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-06-14 Thread Finn Thain
d and chrp_nvram_write, which break the naming convention used across PowerPC platforms for NVRAM accessor functions. Signed-off-by: Finn Thain --- arch/powerpc/platforms/chrp/nvram.c | 14 ++ arch/powerpc/platforms/powermac/nvram.c |9 + 2 files changed, 19 insertions(+), 4 dele

[RFC v2 15/24] powerpc: Implement arch_nvram_ops.get_size() and remove old nvram_* exports

2015-06-14 Thread Finn Thain
Implement arch_nvram_ops for PPC32 and make use of it in the generic_nvram misc device module so that the nvram_* function exports can be removed. Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10 +++--- drivers/char

[RFC v2 19/24] powerpc: Remove CONFIG_GENERIC_NVRAM and adopt CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-14 Thread Finn Thain
m module, unimplemented ioctls return -ENOTTY. Whereas, for the superseded generic_nvram module they would return -EINVAL. Signed-off-by: Finn Thain --- This ioctl change is visible to userspace code but only in an error path. I didn't find any userspace code that uses the IOC_NVRAM_GET_OFFSE

[RFC v2 17/24] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-14 Thread Finn Thain
Make use of arch_nvram_ops in device drivers so that the nvram_* function exports can be removed. Since they are no longer global symbols, rename the PPC32 nvram_* functions appropriately. Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure. Signed-off-by: Finn Thain

[RFC v2 22/24] m68k/mac: Adopt naming and calling conventions for PRAM routines

2015-06-14 Thread Finn Thain
Adopt the existing *_read_byte and *_write_byte naming convention. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion. Adjust calling conventions of mac_pram_* functions to match the arch_nvram_ops struct methods. Signed-off-by: Finn Thain --- Changes since v1: - Don&#

[RFC v2 21/24] powerpc: Adopt nvram module for PPC64

2015-06-14 Thread Finn Thain
d PPC64 when the requested PowerMac NVRAM partition is not found. This is a userspace-visible change, in the non-existent partition case, which would be in an error path for an IOC_NVRAM_GET_OFFSET ioctl syscall. Signed-off-by: Finn Thain --- BTW, the IOC_NVRAM_SYNC ioctl call returns -EINVAL on P

[RFC v2 16/24] powerpc: Implement nvram sync ioctl

2015-06-14 Thread Finn Thain
Add the powerpc-specific sync() method to struct nvram_ops and implement the corresponding ioctl in the nvram module. This allows the nvram module to replace the generic_nvram module. Signed-off-by: Finn Thain --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those

[RFC v2 18/24] nvram: Drop nvram_* symbol exports and prototypes

2015-06-14 Thread Finn Thain
Drivers now use the arch_nvram_ops calls so remove the function exports and prototypes. nvram_check_checksum() is unused so remove it. Signed-off-by: Finn Thain --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +-- include/linux/nvram.h |8

[RFC v2 20/24] char/generic_nvram: Remove as unused

2015-06-14 Thread Finn Thain
And thus eliminate some twisted CONFIG_GENERIC_NVRAM logic. Signed-off-by: Finn Thain --- drivers/char/Makefile|6 - drivers/char/generic_nvram.c | 176 --- 2 files changed, 1 insertion(+), 181 deletions(-) Index: linux/drivers/char

[RFC v2 23/24] m68k/mac: Fix PRAM accessors

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain --- Tested on a PowerBook 520 and Quadra 650. --- arch/m68k/mac/misc.c | 35 +-- include/uapi/linux/pmu.h |2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) Index: linux/arch/m68k/mac/misc.c

[RFC v2 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-06-14 Thread Finn Thain
A multi-platform kernel binary needs to decide at run-time how to dispatch the arch_nvram_ops calls. Add platform-independent arch_nvram_ops, for use when multiple platform-specific NVRAM ops implementations are needed. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Signed-off-by: Finn Thain

Re: [RFC v2 23/24] m68k/mac: Fix PRAM accessors

2015-06-15 Thread Finn Thain
On Mon, 15 Jun 2015, Geert Uytterhoeven wrote: > Hi Finn, > > On Sun, Jun 14, 2015 at 9:46 AM, Finn Thain > wrote: > > --- linux.orig/arch/m68k/mac/misc.c 2015-06-14 17:46:02.0 +1000 > > +++ linux/arch/m68k/mac/misc.c 2015-06-14 17:46:03.0 +100

Re: [RFC v2 23/24] m68k/mac: Fix PRAM accessors

2015-06-17 Thread Finn Thain
Hi Geert, Further to my previous email, On Tue, 16 Jun 2015, in which I wrote: > > On Mon, 15 Jun 2015, Geert Uytterhoeven wrote: > > > > > More magic values... > > [...] The only useful RTC documentation I've ever come across is this: > http://mac.linux-m68k.org/devel/plushw.php This doc

[RFC v3 03/24] m68k/atari: Replace nvram_{read, write}_byte with arch_nvram_ops

2015-06-27 Thread Finn Thain
. Replace this validate-checksum-and-read-byte sequence with the equivalent rtc_nvram_ops.read() call and remove the now unused functions. Signed-off-by: Finn Thain --- The advantage of the new ops struct over the old global nvram_* functions is that the misc device module can be shared by different

[RFC v3 04/24] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-06-27 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This makes them distict from nvram_ops members. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 194

[RFC v3 00/24] Re-use nvram module

2015-06-27 Thread Finn Thain
The generic NVRAM module, drivers/char/generic_nvram, implements a /dev/nvram misc device. It is used only by 32-bit PowerPC platforms and isn't generic enough to be more widely used. The RTC NVRAM module, drivers/char/nvram, also implements a /dev/nvram misc device. It is used by x86, ARM and m6

[RFC v3 01/24] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-06-27 Thread Finn Thain
the valkyriefb driver with powerpc, and since that driver uses NVRAM, it is affected by CONFIG_ATARI_SCSI, because of the use of "select NVRAM". Adopt the powerpc convention on m68k to avoid surprises. Signed-off-by: Finn Thain --- This patch temporarily disables CONFIG_NVRAM on Atari,

[RFC v3 02/24] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-06-27 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Change the vmode calculation from logical OR to bitwise OR, since it is obviously wrong. Signed-off-by: Finn Thain --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas atari_scsi says 14. Whic

[RFC v3 12/24] powerpc: Cleanup nvram includes

2015-06-27 Thread Finn Thain
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h duplicate those in linux/nvram.h. Get rid of the former to prepare for adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for general use). Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h

[RFC v3 07/24] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-06-27 Thread Finn Thain
so that a multi-platform kernel binary can do the right thing when running on hardware without suitable NVRAM. Signed-off-by: Finn Thain --- Changed since v1: - Don't bother acquiring the mutex for unimplemented ioctls. --- drivers/char/

[RFC v3 10/24] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-27 Thread Finn Thain
Atari RTC NVRAM has a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Signed-off-by: Finn Thain --- This re-enables the nvram module for Atari. --- arch/m68k/Kconfig |3 +++ arch/m68k/atari

[RFC v3 11/24] char/nvram: Add "devname:nvram" module alias

2015-06-27 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-06-28 11:41:38.0 +1000 +++ linux/drivers/char

[RFC v3 14/24] powerpc: Implement arch_nvram_ops.get_size() and remove old nvram_* exports

2015-06-27 Thread Finn Thain
Implement arch_nvram_ops for PPC32 and make use of it in the generic_nvram misc device module so that the nvram_* function exports can be removed. Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10 +++--- drivers/char

[RFC v3 06/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-27 Thread Finn Thain
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the nvram_* function exports can be removed. This patch series was tested on a ThinkPad T43. Signed-off-by: Finn Thain Acked-by: Henrique de Moraes Holschuh Reviewed-by: Darren Hart --- drivers/platform/x86/thinkpad_acpi.c

[RFC v3 08/24] char/nvram: Implement NVRAM read/write methods

2015-06-27 Thread Finn Thain
e former but will fall back on the latter. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 162 +++ 1 file changed, 114 insertions(+), 48 deletions(-) Index: linux/drivers/char/nvram.c

[RFC v3 09/24] char/nvram: Use generic fixed_size_llseek()

2015-06-27 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-06-28 11:41

[RFC v3 13/24] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-06-27 Thread Finn Thain
d and chrp_nvram_write, which break the naming convention used across PowerPC platforms for NVRAM accessor functions. Signed-off-by: Finn Thain --- arch/powerpc/platforms/chrp/nvram.c | 14 ++ arch/powerpc/platforms/powermac/nvram.c |9 + 2 files changed, 19 insertions(+), 4 dele

[RFC v3 05/24] char/nvram: Adopt arch_nvram_ops

2015-06-27 Thread Finn Thain
platforms and architectures. Signed-off-by: Finn Thain --- The #ifdefs here restrict the procfs and checksumming code to those architectures with PC-style RTC NVRAM. There may be a better place for that code but it's an open question. See https://lkml.org/lkml/2015/2/3/22 The procfs code her

[RFC v3 18/24] powerpc: Remove CONFIG_GENERIC_NVRAM and adopt CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-27 Thread Finn Thain
m module, unimplemented ioctls return -ENOTTY. Whereas, for the superseded generic_nvram module they would return -EINVAL. Signed-off-by: Finn Thain --- This ioctl change is visible to userspace code but only in an error path. I didn't find any userspace code that uses the IOC_NVRAM_GET_OFFSE

[RFC v3 15/24] powerpc: Implement nvram sync ioctl

2015-06-27 Thread Finn Thain
Add the powerpc-specific sync() method to struct nvram_ops and implement the corresponding ioctl in the nvram module. This allows the nvram module to replace the generic_nvram module. Signed-off-by: Finn Thain --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those

[RFC v3 19/24] char/generic_nvram: Remove as unused

2015-06-27 Thread Finn Thain
And thus eliminate some twisted CONFIG_GENERIC_NVRAM logic. Signed-off-by: Finn Thain --- drivers/char/Makefile|6 - drivers/char/generic_nvram.c | 176 --- 2 files changed, 1 insertion(+), 181 deletions(-) Index: linux/drivers/char

[RFC v3 20/24] powerpc: Adopt nvram module for PPC64

2015-06-27 Thread Finn Thain
d PPC64 when the requested PowerMac NVRAM partition is not found. This is a userspace-visible change, in the non-existent partition case, which would be in an error path for an IOC_NVRAM_GET_OFFSET ioctl syscall. Signed-off-by: Finn Thain --- BTW, the IOC_NVRAM_SYNC ioctl call returns -EINVAL on P

[RFC v3 22/24] m68k/mac: Use macros for RTC accesses not magic numbers

2015-06-27 Thread Finn Thain
Signed-off-by: Finn Thain --- This is intended to improve code style and not affect code behaviour. I've tested this on a Quadra 650. I don't know the meanings of the 4 undocumented write protect register bits 0x55, so I decided against defining 4 macros for those bits. --- arc

[RFC v3 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-06-27 Thread Finn Thain
A multi-platform kernel binary needs to decide at run-time how to dispatch the arch_nvram_ops calls. Add platform-independent arch_nvram_ops, for use when multiple platform-specific NVRAM ops implementations are needed. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Signed-off-by: Finn Thain

[RFC v3 23/24] m68k/mac: Fix PRAM accessors

2015-06-27 Thread Finn Thain
Signed-off-by: Finn Thain --- Tested on a PowerBook 520 and Quadra 650. Changes since v2: - Make use of the RTC_* macros from the previous patch and add a few more besides. --- arch/m68k/mac/misc.c | 39 +-- include/uapi/linux/pmu.h |2 ++ 2

[RFC v3 21/24] m68k/mac: Adopt naming and calling conventions for PRAM routines

2015-06-27 Thread Finn Thain
Adopt the existing *_read_byte and *_write_byte naming convention. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion. Adjust calling conventions of mac_pram_* functions to match the arch_nvram_ops struct methods. Signed-off-by: Finn Thain --- Changes since v1: - Don&#

[RFC v3 16/24] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-27 Thread Finn Thain
Make use of arch_nvram_ops in device drivers so that the nvram_* function exports can be removed. Since they are no longer global symbols, rename the PPC32 nvram_* functions appropriately. Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure. Signed-off-by: Finn Thain

[RFC v3 17/24] nvram: Drop nvram_* symbol exports and prototypes

2015-06-27 Thread Finn Thain
Drivers now use the arch_nvram_ops calls so remove the function exports and prototypes. nvram_check_checksum() is unused so remove it. Signed-off-by: Finn Thain --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +-- include/linux/nvram.h |8

Re: [RFC v3 02/24] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-07-01 Thread Finn Thain
On Mon, 29 Jun 2015, Geert Uytterhoeven wrote: > Hi Finn, > > On Sun, Jun 28, 2015 at 3:42 AM, Finn Thain > wrote: > > Change the vmode calculation from logical OR to bitwise OR, since it > > is obviously wrong. > > Ideally, that should be a separate patch we

Re: [RFC v3 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-07-01 Thread Finn Thain
On Mon, 29 Jun 2015, Geert Uytterhoeven wrote: > On Sun, Jun 28, 2015 at 3:42 AM, Finn Thain > wrote: > > --- linux.orig/arch/m68k/kernel/setup_mm.c 2015-06-28 > > 11:41:27.0 +1000 > > +++ linux/arch/m68k/kernel/setup_mm.c 2015-06-28 11:41:56.

[RFC v4 00/25] Re-use nvram module

2015-07-12 Thread Finn Thain
The generic NVRAM module, drivers/char/generic_nvram, implements a /dev/nvram misc device. It is used only by 32-bit PowerPC platforms and isn't generic enough to be more widely used. The RTC NVRAM module, drivers/char/nvram, also implements a /dev/nvram misc device. It is used by x86, ARM and m6

[RFC v4 01/25] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-07-12 Thread Finn Thain
the valkyriefb driver with powerpc, and since that driver uses NVRAM, it is affected by CONFIG_ATARI_SCSI, because of the use of "select NVRAM". Adopt the powerpc convention on m68k to avoid surprises. Signed-off-by: Finn Thain --- This patch temporarily disables CONFIG_NVRAM on Atari,

[RFC v4 04/25] m68k/atari: Replace nvram_{read, write}_byte with arch_nvram_ops

2015-07-12 Thread Finn Thain
. Replace this validate-checksum-and-read-byte sequence with the equivalent rtc_nvram_ops.read() call and remove the now unused functions. Signed-off-by: Finn Thain --- The advantage of the new ops struct over the old global nvram_* functions is that the misc device module can be shared by different

[RFC v4 02/25] char/nvram: Use bitwise OR to obtain Atari video mode data

2015-07-12 Thread Finn Thain
Signed-off-by: Finn Thain Acked-by: Geert Uytterhoeven --- drivers/char/nvram.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-07-12 20

[RFC v4 03/25] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-07-12 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Signed-off-by: Finn Thain --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas atari_scsi says 14. Which one is correct? Changes since v3: - Move the vmode fix to a separate patch as request

[RFC v4 06/25] char/nvram: Adopt arch_nvram_ops

2015-07-12 Thread Finn Thain
platforms and architectures. Signed-off-by: Finn Thain --- The #ifdefs here restrict the procfs and checksumming code to those architectures with PC-style RTC NVRAM. There may be a better place for that code but it's an open question. See https://lkml.org/lkml/2015/2/3/22 The procfs code here, u

[RFC v4 10/25] char/nvram: Use generic fixed_size_llseek()

2015-07-12 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-07-12 20:25

[RFC v4 11/25] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-07-12 Thread Finn Thain
Atari RTC NVRAM has a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Signed-off-by: Finn Thain --- This re-enables the nvram module for Atari. Changes since v3: - Use bool (and select) instead of

[RFC v4 12/25] char/nvram: Add "devname:nvram" module alias

2015-07-12 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-07-12 20:25:05.0 +1000 +++ linux/drivers/char

[RFC v4 07/25] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-07-12 Thread Finn Thain
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the nvram_* function exports can be removed. This patch series was tested on a ThinkPad T43. Signed-off-by: Finn Thain Acked-by: Henrique de Moraes Holschuh Reviewed-by: Darren Hart --- drivers/platform/x86/thinkpad_acpi.c

[RFC v4 08/25] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-07-12 Thread Finn Thain
so that a multi-platform kernel binary can do the right thing when running on hardware without suitable NVRAM. Signed-off-by: Finn Thain --- Changed since v1: - Don't bother acquiring the mutex for unimplemented ioctls. --- drivers/char/

[RFC v4 13/25] powerpc: Cleanup nvram includes

2015-07-12 Thread Finn Thain
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h duplicate those in linux/nvram.h. Get rid of the former to prepare for adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for general use). Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h

[RFC v4 14/25] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-07-12 Thread Finn Thain
d and chrp_nvram_write, which break the naming convention used across PowerPC platforms for NVRAM accessor functions. Signed-off-by: Finn Thain --- arch/powerpc/platforms/chrp/nvram.c | 14 ++ arch/powerpc/platforms/powermac/nvram.c |9 + 2 files changed, 19 insertions(+), 4 dele

[RFC v4 09/25] char/nvram: Implement NVRAM read/write methods

2015-07-12 Thread Finn Thain
e former but will fall back on the latter. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 162 +++ 1 file changed, 114 insertions(+), 48 deletions(-) Index: linux/drivers/char/nvram.c

[RFC v4 05/25] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-07-12 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This makes them distict from nvram_ops members. Signed-off-by: Finn Thain --- drivers/char/nvram.c | 194

[RFC v4 15/25] powerpc: Implement arch_nvram_ops.get_size() and remove old nvram_* exports

2015-07-12 Thread Finn Thain
Implement arch_nvram_ops for PPC32 and make use of it in the generic_nvram misc device module so that the nvram_* function exports can be removed. Signed-off-by: Finn Thain --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10 +++--- drivers/char

[RFC v4 17/25] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-07-12 Thread Finn Thain
Make use of arch_nvram_ops in device drivers so that the nvram_* function exports can be removed. Since they are no longer global symbols, rename the PPC32 nvram_* functions appropriately. Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure. Signed-off-by: Finn Thain

[RFC v4 18/25] nvram: Drop nvram_* symbol exports and prototypes

2015-07-12 Thread Finn Thain
Drivers now use the arch_nvram_ops calls so remove the function exports and prototypes. nvram_check_checksum() is unused so remove it. Signed-off-by: Finn Thain --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +-- include/linux/nvram.h |8

  1   2   3   4   5   6   >