Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU
device found in those models was never supported by this driver.
Attempting to load the driver usually causes a boot hang.
Cc: Geert Uytterhoeven
Signed-off-by: Finn Thain
Reviewed-by: Michael Schmitz
---
arch/m68k/mac
The shift register interrupt flag gets cleared in via_pmu_interrupt()
and once again in pmu_sr_intr(). Fix this theoretical race condition.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
Reviewed-by: Geert Uytterhoeven
---
drivers/macintosh/via-pmu.c | 1 -
1 file changed, 1 deletion
Replace an open-coded ffs() with the function call.
Simplify an if-else cascade using a switch statement.
Correct a typo and an indentation issue.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
Reviewed-by: Geert Uytterhoeven
---
drivers/macintosh/via-pmu.c | 39
Now that the PowerMac via-pmu driver supports m68k PowerBooks,
switch over to that driver and remove the via-pmu68k driver.
Cc: Geert Uytterhoeven
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
arch/m68k/configs/mac_defconfig | 2 +-
arch/m68k/configs/multi_defconfig | 2 +-
arch
/powerpc RTC code stabilizes.
Finn Thain (11):
macintosh/via-pmu: Fix section mismatch warning
macintosh/via-pmu: Add missing mmio accessors
macintosh/via-pmu: Don't clear shift register interrupt flag twice
macintosh/via-pmu: Enhance state machine with new 'uninitialized'
state
: warning: dereference of noderef expression
drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
Reviewed-by: Geert Uytterhoeven
---
drivers/macintosh/via-pmu.c | 9 +
1 file changed, 5 insertions(+), 4 deletions
this. For the
CONFIG_PPC_PMAC case, set via1 = via2 so there is no change.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
drivers/macintosh/via-pmu.c | 142 +---
1 file changed, 69 insertions(+), 73 deletions(-)
diff --git a/drivers/macintosh/via-pmu.c b/drivers
interrupts is by necessity
visible in userland. However, packages which interact with the PMU
(that is, pbbuttonsd, pmac-utils and pmud) don't open this file.
AFAIK, user software has no need to poll these counters.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
The file now looks like
. Remove it to fix the warning, consistent with
the other ADB drivers.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
Reviewed-by: Geert Uytterhoeven
---
drivers/macintosh/via-pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/via-pmu.c b/drivers
At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets
relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with
implicit deps on PPC_PMAC will need explicit deps. Add them now.
No functional change.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
drivers
On Mon, 2 Jul 2018, Mathieu Malaterre wrote:
> On Mon, Jul 2, 2018 at 10:25 AM Finn Thain
> wrote:
> >
> > The pmu_init() function has the __init qualifier, but the ops struct
> > that holds a pointer to it does not. This causes a build warning. The
> > driver
ed-off-by: Finn Thain <fth...@telegraphics.com.au>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/m68k/include/asm/mac_iop.h | 1 +
arch/m68k/mac/iop.c | 9 +
drivers/macintosh/adb-iop.c | 4 +---
3 files changed, 1
...
arch_initcall
via_pmu_start
Bring via-pmu68k.c into line with via-pmu.c to fix this issue.
Cc: Geert Uytterhoeven <ge...@linux-m68k.org>
Tested-by: Stan Johnson <user...@yahoo.com>
Signed-off-by: Finn Thain <fth...@telegraphics.com.au>
---
arch/m68k/mac/config.c
On Tue, 19 Jun 2018, Arnd Bergmann wrote:
> The real-time clock on m68k (and powerpc) mac systems uses an unsigned
> 32-bit value starting in 1904, which overflows in 2040, about two years
> later than everyone else, but this gets wrapped around in the Linux code
> in 2038 already because of
On Thu, 2 Aug 2018, Geert Uytterhoeven wrote:
> Hi Stephen,
>
> On Thu, Aug 2, 2018 at 1:42 AM Stephen Rothwell wrote:
> > [forgot the conflict resolution ...]
> >
> > On Thu, 2 Aug 2018 09:27:20 +1000 Stephen Rothwell
> > wrote:
> > >
> > > Today's linux-next merge of the powerpc tree got a
On Wed, 18 Jul 2018, I wrote:
> On Wed, 18 Jul 2018, Arnd Bergmann wrote:
>
> > I'd suggest we do it like below to make it consistent with the rest
> > again, using the 1904..2040 range of dates and no warning for invalid
> > dates.
> >
> > If you agree, I'll send that as a proper patch.
> >
On Wed, 18 Jul 2018, Geert Uytterhoeven wrote:
>
> Thanks for your patch!
>
> Applied and queued for v4.19, with the WARN_ON() dropped.
>
The patch you've committed to your for-v4.19 branch has this hunk:
@@ -269,8 +275,12 @@ static long via_read_time(void)
On Wed, 18 Jul 2018, Arnd Bergmann wrote:
> Hmm, apparently I forgot to update via_read_time(), that one
> is indeed bogus and now inconsistent with the other functions.
>
> The change in via_write_time() seems at least consistent wtih what we do
> elsewhere, and using __u32 makes this code
On Fri, 31 Aug 2018, Mac User wrote:
> On 8/30/18 10:49 PM, Benjamin Herrenschmidt wrote:
>
> > On Fri, 2018-08-31 at 14:35 +1000, Benjamin Herrenschmidt wrote:
> >
> > ...
> > Assuming you are using BootX (or miBoot), can you try this patch ?
>
> Yes, I'm using BootX.
>
> Thanks to Finn for
Hi Frank,
Linux v4.17 and later will no longer boot on a G3 PowerMac. The boot hangs
very early, before any video driver loads.
Stan and I were able to bisect the regression between v4.16 and v4.17 and
arrived at commit 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of
On Mon, 9 Jul 2018, Arnd Bergmann wrote:
>
> The most likely explanation I have here is that the RTC was indeed set
> to an incorrect date, either because of a depleted battery (not unlikely
> for a ~15 year old box) or because it was previously stored incorrectly.
The PowerMac stores the GMT
On Sun, 8 Jul 2018, Geert Uytterhoeven wrote:
> On Fri, Jun 22, 2018 at 10:55 AM Arnd Bergmann wrote:
> > I don't think anyone so far had a strong preference here, so I went
> > with what Mathieu suggested and kept the original Mac behavior, but
> > added the WARN_ON().
>
> So, is this safe
Once the 68k Mac port adopts the via-pmu driver, it must access
the PMU RTC using the appropriate command format. The same code can
then be used for both m68k and powerpc.
Replace the RTC code that's duplicated in arch/powerpc and arch/m68k
with common RTC accessors for Cuda and PMU devices.
This series has some minor fixes and cleanups under drivers/macintosh,
including a patch to rework recent printk changes in adb-hid.c.
There's also a re-based RTC code de-duplication patch.
Finn Thain (7):
macintosh: Use common code to access RTC
macintosh/adb: Rework printk output again
werpc/powermac: Fix rtc read/write functions").
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
Cc: Geert Uytterhoeven
Cc: Arnd Bergmann
---
This patch has been regression tested on the following Mac models.
Centris 660av (m68k, Cuda)
PowerBook 190 (m68k, PMU)
Beige G
Add missing severity level to log messages.
Signed-off-by: Finn Thain
---
drivers/macintosh/adb-iop.c | 2 +-
drivers/macintosh/via-macii.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index ca623e6446e4
with a WARN_ON and an array bounds check.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
drivers/macintosh/via-macii.c | 49 +++
1 file changed, 7 insertions(+), 42 deletions(-)
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via
hat commit also changed printk(KERN_DEBUG ...) to pr_debug(...), which
hinders work on low-level ADB driver bugs. Revert that change.
Cc: Andreas Schwab
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
drivers/macintosh/adb.c| 8 ---
d
[The Cc list got pruned so I'm forwarding Stan's reply for the benefit of
the list archives and any other interested parties.]
On Mon, 10 Sep 2018, Stan Johnson wrote:
> On 9/10/18 6:53 AM, Rob Herring wrote:
>
> > ...
> > Can you try this patch (w/o Ben's patch). I think the problem is if
>
-off-by: Finn Thain
---
drivers/macintosh/via-macii.c | 26 ++
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index 7e0e32fa7eb2..6ed9ac91aca1 100644
--- a/drivers/macintosh/via-macii.c
+++ b
Make the reset operation synchronous, like the other ADB drivers.
The reset request is static data but callers may not know that.
This way the struct is not in use when the reset method returns.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
drivers/macintosh/via-macii.c | 3 ++-
1 file
Signed-off-by: Finn Thain
---
drivers/macintosh/adb-iop.c | 48 ---
drivers/macintosh/via-macii.c | 286 +-
2 files changed, 174 insertions(+), 160 deletions(-)
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index
Hopefully this will make it easier for the next reader who needs
to check these pointers. No change to object files.
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Signed-off-by: Finn Thain <fth...@telegraphics.com.au>
---
drivers/macintosh/adb-iop.c| 14 +++
viv...@redhat.com>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Jens Axboe <ax...@kernel.dk>
Cc: sta...@vger.kernel.org # v4.14+
Tested-by: Stan Johnson <user...@yahoo.com>
Signed-off-by: Finn Thain <fth...@telegraphics.com.au>
viv...@redhat.com>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Jens Axboe <ax...@kernel.dk>
Tested-by: Stan Johnson <user...@yahoo.com>
Signed-off-by: Finn Thain <fth...@telegraphics.com.au>
---
drivers/block/swim.c | 8 -
No change to object files.
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Signed-off-by: Finn Thain <fth...@telegraphics.com.au>
---
drivers/macintosh/adb-iop.c| 14 +++---
drivers/macintosh/macio-adb.c | 15 +++
drivers/macintosh/via-m
On Wed, 13 Jun 2018, I wrote:
> Finn Thain (12):
> macintosh/via-pmu: Fix section mismatch warning
> macintosh/via-pmu: Add missing mmio accessors
> macintosh/via-pmu: Don't clear shift register interrupt flag twice
> macintosh/via-pmu: Enhance state machine with new
On Mon, 31 Dec 2018, Arnd Bergmann wrote:
> On Sun, Dec 30, 2018 at 12:43 AM Finn Thain
> wrote:
>
> >
> > Is there some benefit, or is that just personal taste?
> >
> > Avoiding changes to call sites avoids code review, but I think 1) the
> > thinkpad_
On Sun, 30 Dec 2018, I wrote:
>
> The rationale for the ops struct was that it offers introspection.
>
> [...] those platforms which need checksum validation always set
> byte-at-a-time methods to NULL.
>
> [...] The NULL methods in the ops struct allow the nvram.c misc device
> to avoid
On Mon, 31 Dec 2018, Arnd Bergmann wrote:
> On Sun, Dec 30, 2018 at 8:25 AM Finn Thain wrote:
> >
> > On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> >
> > > > --- a/drivers/char/nvram.c
> > > > +++ b/drivers/char/nvram.c
> > > >
On Mon, 31 Dec 2018, Arnd Bergmann wrote:
> On Sun, Dec 30, 2018 at 4:29 AM Finn Thain wrote:
> >
> > On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> >
> > > On Wed, Dec 26, 2018 at 1:43 AM Finn Thain
> > > wrote:
> > >
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote:
>
> > +
> > +static ssize_t m68k_nvram_get_size(void)
> > +{
> > + if (MACH_IS_ATARI)
> > + return atari_nvram_get_size
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> > --- a/drivers/char/nvram.c
> > +++ b/drivers/char/nvram.c
> > @@ -48,6 +48,10 @@
> > #include
> > #include
> >
> > +#ifdef CONFIG_PPC
> > +#include
> > +#include
> > +#endif
> >
> > static DEFINE_MUTEX(nvram_mutex);
> > static
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote:
>
> > +static ssize_t ppc_nvram_get_size(void)
> > +{
> > + if (ppc_md.nvram_size)
> > + return ppc_md.nvram_size();
> > + return
On Sat, 29 Dec 2018, LEROY Christophe wrote:
> Finn Thain a ?crit?:
>
> > 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
>
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> I had a look at the complete series now, and I think this is a great
> cleanup. I replied with a couple of minor comments that you may or may
> not want to address first.
>
Thanks for reviewing this.
> The one thing I would like to see resolved (I
On Tue, 1 Jan 2019, I wrote:
>
> There are no [nvram] ioctls common to all architectures. So your example
> becomes,
>
> static long nvram_misc_ioctl(struct file *file, unsigned int cmd,
> unsigned long arg)
> {
> if (ops->ioctl)
> return
On Sat, 29 Dec 2018, I wrote:
> On Fri, 28 Dec 2018, LEROY Christophe wrote:
>
> > > --- a/drivers/char/nvram.c
> > > +++ b/drivers/char/nvram.c
> > > @@ -21,13 +21,6 @@
> > > * ioctl(NVRAM_SETCKS) (doesn't change contents, just makes checksum
> > > valid
> > > * again; use with care!)
> >
On Sun, 30 Dec 2018, I wrote:
> On Sat, 29 Dec 2018, LEROY Christophe wrote:
>
> > Finn Thain a ?crit?:
> >
> > > Make use of arch_nvram_ops in device drivers so that the nvram_* function
> > > exports can be removed.
> > >
> > > Sin
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 prevents name collisions with nvram.h helper functions
and improves readability.
Signed-off-by: Finn Thain
---
drivers/char/nvram.c
-implemented in subsequent patches.
Replace the sole validate-checksum-and-read-byte sequence with a call to
nvram_read() which will gain the same semantics in subsequent patches.
Remove unused exports.
Acked-by: Geert Uytterhoeven
Signed-off-by: Finn Thain
---
arch/m68k/atari/nvram.c | 39
By implementing an arch_nvram_ops struct, a platform can re-use the
drivers/char/nvram.c module without needing any arch-specific code
in that module. Atari does so here.
Acked-by: Geert Uytterhoeven
Signed-off-by: Finn Thain
---
Changed since v8:
- Added static inline wrapper functions
Remove the nvram_read_byte() and nvram_write_byte() declarations in
powerpc/include/asm/nvram.h and use the cross-platform static functions
in linux/nvram.h instead.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
Changed since v8:
- Added nvram_read_byte() and nvram_write_byte
-by: Finn Thain
---
Changed since v7:
- Removed some gratuitous function pointers.
---
arch/m68k/mac/misc.c | 61 +---
1 file changed, 23 insertions(+), 38 deletions(-)
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 71c4735a31ee..78c807025436
r
codes so that a multi-platform kernel binary can do the right thing when
running on hardware without a suitable NVRAM.
Signed-off-by: Finn Thain
---
Changed since v8:
- Renamed nvram_* functions to avoid name collisions.
---
drivers/char/nvram.c | 70 ---
inc
Certain Cuda transfers have to be ended by the driver. According
to Apple's open source Cuda driver, as found in mkLinux and XNU, this
applies to any "open ended request such as PRAM read". This fixes an
infinite polling loop in cuda_pram_read_byte().
Tested-by: Stan Johnson
Signed-of
form.
In this patch and the subsequent fbdev driver patch, the convention is
adopted across all relevant platforms whereby NVRAM functionality gets
enabled in a given device driver when the nvram misc device is built-in
or when both drivers are modules.
Acked-by: Michael Schmitz
Signed-off-by: Finn T
the common wrapper functions, the nvram module and other drivers can
make use of the available NVRAM functionality in a portable way.
Signed-off-by: Finn Thain
---
It might be nice if the NVRAM Kconfig symbol depended only on
HAVE_ARCH_NVRAM_OPS and all the x86 code here were moved to arch/x86
Switch PPC32 kernels from the generic_nvram module to the nvram module.
Also fix a theoretical bug where CHRP omits the chrp_nvram_init() call
when CONFIG_NVRAM_MODULE=m.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
The change in the name of the module is visible to userspace
Signed-off-by: Finn Thain
---
drivers/char/Makefile| 6 +-
drivers/char/generic_nvram.c | 160 ---
2 files changed, 1 insertion(+), 165 deletions(-)
delete mode 100644 drivers/char/generic_nvram.c
diff --git a/drivers/char/Makefile b/drivers/char
Add the powerpc-specific ioctls to the nvram module. This allows the nvram
module to replace the generic_nvram module.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those
platforms that don't implement ppc_md.nvram_sync
d be in
an error path for an IOC_NVRAM_GET_OFFSET ioctl syscall.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
BTW, the IOC_NVRAM_SYNC ioctl call returns an error on PPC64. This patch
retains this behaviour though it might be better to actually perform a sync
since both PPC64 and PP
Move the m68k-specific code out of the driver to make the driver generic.
I've used 'SPDX-License-Identifier: GPL-2.0+' for the new file because the
old file is covered by MODULE_LICENSE("GPL").
Acked-by: Geert Uytterhoeven
Signed-off-by: Finn Thain
---
Changed since v8:
- Fixed
but may be
unavailable so fall back on the latter methods when necessary.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
Changed since v8:
- Renamed nvram_* functions to avoid name collisions.
- Added nvram_read_bytes() and nvram_write_bytes() helpers for use by
those platforms wh
PMU-based m68k Macs pre-date PowerMac-style NVRAM. Use the appropriate
PMU commands. Also implement the missing XPRAM accessors for VIA-based
Macs.
Acked-by: Geert Uytterhoeven
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
Changed since v7:
- Revised PMU response decoding due to via
Signed-off-by: Finn Thain
---
drivers/char/nvram.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index adcc213c331e..c9e295d73dc5 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -503,3 +503,4 @@ module_exit(nvram_module_exit
anged the CONFIG_NVRAM default to better approximate the present code.
In particular, the CONFIG_GENERIC_NVRAM default and use of "select NVRAM".
- Added more tested-by tags.
For older change logs, please refer to,
https://lore.kernel.org/lkml/20151101104202.301856...@telegraphics.com.au/
Atari RTC NVRAM uses a checksum so implement the remaining arch_nvram_ops
methods for the set_checksum and initialize ioctls. Enable
CONFIG_HAVE_ARCH_NVRAM_OPS.
Acked-by: Geert Uytterhoeven
Signed-off-by: Finn Thain
---
Changed since v8:
- Moved the HAVE_ARCH_NVRAM_OPS symbol to common code
This is intended to improve code style and not affect code behaviour.
Acked-by: Geert Uytterhoeven
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
arch/m68k/mac/misc.c | 59 ++--
1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/arch
Signed-off-by: Finn Thain
---
Changed since v8:
- Adopted nvram_read_bytes() and nvram_write_bytes() where possible.
---
arch/m68k/Kconfig.machine | 1 +
arch/m68k/atari/nvram.c | 21 ++--
arch/m68k/include/asm/atarihw.h | 6 +++
arch/m68k/include/asm/macintosh.h | 4
the naming convention used across
powerpc platforms for NVRAM accessor functions.
Tested-by: Stan Johnson
Signed-off-by: Finn Thain
---
Changed since v8:
- Renamed functions to correspond with ppc_md member names.
---
arch/powerpc/platforms/chrp/nvram.c | 14 ++
arch/powerpc
GetPreferredConfiguration and SavePreferredConfiguration in
"Designing PCI Cards and Drivers for Power Macintosh Computers".
** See SetDefaultMode and GetDefaultMode in "Designing Cards and Drivers
for the Macintosh Family".
Signed-off-by: Finn Thain
---
Changed since v8:
On Tue, 22 Jan 2019, Greg Kroah-Hartman wrote:
> On Tue, Jan 15, 2019 at 03:18:56PM +1100, Finn Thain wrote:
> > The "generic" NVRAM module, drivers/char/generic_nvram.c, implements a
> > /dev/nvram misc device. This module is used only by 32-bit PowerPC
> > pl
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
Acked-by: Geert Uytterhoeven
Tested
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 helps to distinguish them from struct nvram_ops methods.
Signed-off-by: Finn Thain
---
drivers/char/nvram.c | 167
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
Acked-by: Geert Uytterhoeven
---
arch/m68k/atari/nvram.c | 6 +++---
drivers/char/nvram.c| 27
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the
nvram_* function exports can be removed.
Signed-off-by: Finn Thain
Acked-by: Henrique de Moraes Holschuh
Reviewed-by: Darren Hart
---
I've tested this on a ThinkPad T43.
---
drivers/platform/x86/thinkpad_acpi.c | 20
ntosh Computers".
** See SetDefaultMode and GetDefaultMode in "Designing Cards and Drivers
for the Macintosh Family".
Signed-off-by: Finn Thain
---
drivers/video/fbdev/Kconfig| 2 +-
drivers/video/fbdev/imsttfb.c | 12 +---
drivers/video/fbdev/ma
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
Acked-by: Geert Uytterhoeven
---
Changed since v7:
- Changed the default for CONFIG_NVRAM, because "s
Thereby eliminating some twisted CONFIG_NVRAM logic.
Signed-off-by: Finn Thain
---
drivers/char/Makefile| 6 +-
drivers/char/generic_nvram.c | 160 ---
2 files changed, 1 insertion(+), 165 deletions(-)
delete mode 100644 drivers/char/generic_nvram.c
Signed-off-by: Finn Thain
---
drivers/char/nvram.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 889123ddace4..b77c27d68762 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -554,3 +554,4 @@ module_exit(nvram_module_exit
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.
Signed-off-by: Finn Thain
---
arch/powerpc/kernel/setup_32.c | 8
drivers/char
A multi-platform kernel binary has to decide at run-time how to dispatch
the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops
struct for this, to replace the atari-specific one.
Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs.
Signed-off-by: Finn Thain
Tested-by: Christian T. Steigies
and architectures.
Signed-off-by: Finn Thain
---
The procfs code here could be moved to arch/x86 (like the earlier patch
did for m68k code that was here). The nvram_ops struct could be
implemented and exported by the rtc-cmos driver instead, to eliminate
the remaining #ifdefs.
---
drivers/char
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
Tested-by: Stan Johnson
---
arch
r
codes 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 | 70 ---
include/linux/nvram.h | 2 ++
2 files changed, 42 insertions(+), 30 deletions(-)
Switch PPC32 kernels from the generic_nvram module to the nvram module.
Also fix a theoretical bug where CHRP omits the chrp_nvram_init()
call when CONFIG_NVRAM_MODULE=m.
Signed-off-by: Finn Thain
Tested-by: Laurent Vivier
Tested-by: Stan Johnson
---
The change in the name of the module
l. 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
Tested-by: Christian T. Steigies
Acked-by: Geert Uytterhoeven
---
The advantage of the new ops struct over the old global nvram_*
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
Tested-by: Stan Johnson
---
On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0
iver prefers to use the
former but will fall back on the latter.
Signed-off-by: Finn Thain
---
Changed since v7:
- Use memdup_user(), like arch/powerpc/kernel/nvram_64.c.
---
drivers/char/nvram.c | 149 ++-
1 file changed, 104 insertions(+), 45 deletions(-)
dif
syscall.
Signed-off-by: Finn Thain
Tested-by: Laurent Vivier
Tested-by: Stan Johnson
---
BTW, the IOC_NVRAM_SYNC ioctl call returns -EINVAL on PPC64. This patch
retains this behaviour though it might be better to actually perform a sync.
Both PPC64 and PPC32 kernels implement ppc_md.nvram_s
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
Tested-by: Stan Johnson
---
arch/powerpc/include/asm/nvram.h | 3 ---
arch/powerpc/kernel/setup_32.c | 10
().
pmac_xpram_read() becomes unused as pmac_time_init() is converted to the
arch_nvram_ops API. pmac_xpram_write() was already unused.
As a bonus, drivers/char/nvram.c benefits from the API conversion by the
removal of an #ifdef.
Signed-off-by: Finn Thain
Tested-by: Stan Johnson
---
arch/powerpc/include
Move the m68k-specific code out of the driver to make the driver generic.
I've used 'SPDX-License-Identifier: GPL-2.0+' for the new file because the
old file is covered by MODULE_LICENSE("GPL").
Signed-off-by: Finn Thain
Tested-by: Christian T. Steigies
Acked-by: Geert Uy
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
Tested-by: Christian T. Steigies
---
This patch temporaril
kernel.org/lkml/20151101104202.301856...@telegraphics.com.au/
Finn Thain (25):
scsi/atari_scsi: Don't select CONFIG_NVRAM
m68k/atari: Move Atari-specific code out of drivers/char/nvram.c
m68k/atari: Replace nvram_{read,write}_byte with arch_nvram_ops
char/nvram: Re-order functions to rem
and chrp_nvram_write, which break the naming convention used across
PowerPC platforms for NVRAM accessor functions.
Signed-off-by: Finn Thain
Tested-by: Stan Johnson
---
arch/powerpc/platforms/chrp/nvram.c | 14 ++
arch/powerpc/platforms/powermac/nvram.c | 9 +
2 files changed, 19
This is intended to improve code style and not affect code behaviour.
Signed-off-by: Finn Thain
Acked-by: Geert Uytterhoeven
Tested-by: Stan Johnson
---
arch/m68k/mac/misc.c | 59 ++--
1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/arch
PMU-based m68k Macs pre-date PowerMac-style NVRAM. Use the appropriate
PMU commands. Also implement the missing XPRAM accessors for VIA-based
Macs.
Signed-off-by: Finn Thain
Acked-by: Geert Uytterhoeven
Tested-by: Stan Johnson
---
Changed since v7:
- Updated PMU response decoding due to via
On Tue, 8 Jan 2019, Michael Ellerman wrote:
> > The reason why that doesn't work boils down to introspection. (This
> > was mentioned elsewhere in this email thread.) For example, we
> > presently have code like this,
> >
> > ssize_t nvram_get_size(void)
> > {
> >if (ppc_md.nvram_size)
301 - 400 of 522 matches
Mail list logo