summaryrefslogtreecommitdiff
path: root/arch/ppc64/kernel/rtas.c
AgeCommit message (Collapse)Author
2005-10-26powerpc: Merge rtas.c into arch/powerpc/kernelPaul Mackerras
This splits arch/ppc64/kernel/rtas.c into arch/powerpc/kernel/rtas.c, which contains generic RTAS functions useful on any CHRP platform, and arch/powerpc/platforms/pseries/rtas-fw.[ch], which contain some pSeries-specific firmware flashing bits. The parts of rtas.c that are to do with pSeries-specific error logging are protected by a new CONFIG_RTAS_ERROR_LOGGING symbol. The inclusion of rtas.o is controlled by the CONFIG_PPC_RTAS symbol, and the relevant platforms select that. Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-10powerpc: Make some #includes explicit.Paul Mackerras
In preparation for merging processor.h, this adds some explicit but won't be after the merge. Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-06-23[PATCH] correct printing to operator panelMike Strosaker
This patch corrects the printing of progress indicators to the op panel on p/iSeries ppc64 systems. Each discrete reference code should begin with a form feed char to clear the op panel, and the first and second lines should be separated with a CR/LF sequence. Padding with spaces is not necessary. Also, capitalize the hex value printed on the first line, to be consistent with the values printed by firmware, service processor, etc. It turns out that there's an ibm,form-feed property; this patch uses it in the pSeries-specific progress routine. This patch also checks the number of rows and the specific width of each row (the second row on power5 systems can actually hold 80 characters). If the displayed text is too wide for the physical display, it can be viewed in the ASM menus, or by selecting option 14 on the op panel. Signed-off-by: Mike Strosaker <strosake@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-06-23[PATCH] ppc64: pSeries_progress -> rtas_progressArnd Bergmann
The pSeries_progress function is called from some places in the rtas code, which may also be used by non-pSeries platforms. Though pSeries is currently the only platform type that implements display-character, the code is actually generic enough to be part of the rtas subsystem. I hit a bug here because the generic rtas code tried calling ppc_md.progress, which points to an __init function on most platforms. We could also clear the ppc_md.progress pointer when freeing the init memory to make it more explicit that ppc_md.progress must not be called after bootup. Signed-off-by: Arnd Bergmann <arndb@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-03-07[PATCH] ppc64: error code cleanups for rtas wrappersPaul Mackerras
This patch is from John Rose <johnrose@austin.ibm.com> This patch changes the rtas wrapper functions in rtas.c to map RTAS failure codes to conventional error values. The goal is to make failure conditions obvious in the wrapper functions and in the caller code. Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-20[PATCH] Lock initializer cleanup: PPC64Thomas Gleixner
Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-04[PATCH] ppc64: consolidate cache sizing variablesStephen Rothwell
This patch consolidates the variables that define the PPC64 cache sizes into a single structure (the were in the naca and the systemcfg structures). Those that were in the systemcfg structure are left there just because they are exported to user mode through /proc. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-24[PATCH] ppc64: linux,rtas* fixesAnton Blanchard
Move the linux,rtas* properties into the /rtas node and make them 32bit. Use rtas-size and avoid duplicating it in linux,rtas-size. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-15[PATCH] PPC64 call ibm,os-term only if its availablePaul Mackerras
This patch is from Olaf Hering. The rtas property 'ibm,os-term' is not available on JS20, a panic will print: unable to mount root filesystem on /dev/hda Kernel panic - not syncing: Attempted to kill init! <0>ibm,os-term call failed -1 Rebooting in 42 seconds.. Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-15[PATCH] ppc64: ratelimit some rtas errorsAnton Blanchard
Use printk_ratelimit() in rtc code to avoid flooding the kernel log buffer with errors. Also use rtas_get_error_log_max() instead of duplicating it in __fetch_rtas_last_error. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-24ppc64: make G5 setup compile againLinus Torvalds
The stop_self thing is accessed unconditionally from pSeries_setup.c
2004-09-23[PATCH] ppc64: monster cleanupBenjamin Herrenschmidt
This is the third & hopefully final version of the monster cleanup patch. It does significant cleanups of the early boot code of the ppc64 kernel, and begins the long process of cleaning up & splitting properly the platform support. It completely reworks the interface between the early code that is run in the firmware context (prom_init) and the rest of the kernel, in such a way that will make kexec or static device-tree for embedded people possible. The early init code can eventually be moved to a separate link entity, it no longer touches any of the kernel globals, everything is passed via a single blob of data in memory containing a flattened version of the device-tree and a memory reserve map. While doing it, I also cut the ties between pSeries and Powermac. Now, the kernel config provides a choice between legacy iSeries and "multiplatform". The later is a set of various supported platform, each of them beeing a boolean switch, currently defined beeing pSeries and PowerMac. You can enable both or just one of them. CONFIG_PPC_PSERIES is now specifically set for IBM pSeries support, you can build a PowerMac kernel without pSeries support if you which. The main goal here is to simplify addition of new platform types. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-02[PATCH] ppc64 another log buffer length fixPaul Mackerras
This patch uses the firmware-defined error log buffer length for calls to the firmware routine 'check-exception'. It also simplifies code in rtasd.c that is attempting to obtain the error log length. Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] ppc64: Use correct buffer size in RTAS callPaul Mackerras
Firmware expects the size of the buffer that you hand it when you ask it for information about a hardware error to be of a very specific size, but different versions of firmware appearently expect different sizes; using the wrong size results in a painful, hard-to-debug crash in firmware. Benh provided a patch for this some months ago, but appreantly missed this code path. This patch sets up the log buffer size dynamically; it also fixes a bug with the return code not being handled correctly. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] ppc64: rtas_call was calling kmalloc too earlyPaul Mackerras
At present rtas_call() can be called before the kmalloc subsystem is initialized, and if RTAS reports a hardware error, the code tries to do a kmalloc to make a copy of the error report. This patch changes it so that we don't do the kmalloc in that situation. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-22[PATCH] ppc64: add missing EXPORT_SYMBOLS for oprofileAnton Blanchard
Add some missing exports, required for oprofile to be compiled as a module. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-08-01[PATCH] ppc64: fix hotplug irq migration codeAnton Blanchard
In migrate_irqs_away we werent converting a virtual irq to a real one. We ended up passing the wrong irq numbers to the hypervisor and migration of affinitised irqs on cpu hot unplug didnt work. Also clarify the rtas_stop_self printk. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-24ppc64: fix more 0/NULL confusionLinus Torvalds
2004-07-04[PATCH] ppc64: RTAS error log locking fixPaul Mackerras
From: Linas Vepstas <linas@austin.ibm.com> When an RTAS call returns the "hardware error" code, we need to do another RTAS call to find out what went wrong. Previously we weren't doing that inside the lock that serializes RTAS calls, and thus another cpu could get in and do another RTAS call in the meantime. This patch fixes it. This patch also includes some minor whitespace fixes. Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-01[PATCH] ppc64: janitor log_rtas_error() call argumentsPaul Mackerras
This patch from Linas Vepstas (rediffed by me) fixes the confusing argument aliasing of the log_rtas_error() subroutine. This patch makes no functional changes, it just cleans up some strange usage. The rtas_args used to communicate with firmware are always taken from the paca struct, so as to keep the args at a fixed, low-memory location. But the log_rtas_error() routine also took an rtas_args pointer, which it assumed was aliased to the paca struct. This aliasing is both un-neccessary, and confusing; this patch eliminates this confusion. Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-07-01[PATCH] ppc64: remove RTAS arguments from PACADavid Gibson
This patch removes the RTAS arguments structure on ppc64 from the PACA. The args have to be in the RMO, but since we have a global spinlock for RTAS anyway, there's no reason to have a separate copy of the args per-CPU. This patch replaces the PACA field with a single instance in the global rtas structure. The one exception is for the rtas_stop_self() call, which can't take the lock, because it never returns. But it has a fixed set of arguments, so we can use another global instance which is initialized at boot. This lets us remove rtas.h from paca.h, which substantially reduces overall #include hairiness (because paca.h is now, as it wants to be, a nice low-level structure-defining header which relies on very little and can safely be included almost anywhere). Although it does add some noise to the patch, because a bunch of places relied on the indirect inclusion of rtas.h, or even more indirect inclusions (see the hunks applying to eeh.h and current.h!). Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-26[PATCH] ppc64: remove a stale comment in rtas.cAnton Blanchard
rtas.c doesn't call reloc_offset remove comment from rtas.c and extern function declaration Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-23[PATCH] ppc64: clean up prom.c and related filesPaul Mackerras
Somebody back in the mists of time decided that call_prom and rtas_call should return longs even though both of those bits of firmware run in 32-bit mode and produce a 32-bit result. To make life more interesting, the 32-bit result gets zero-extended to 64 bits, which makes checking for a -1 return value more complicated than it should be. This patch changes call_prom and rtas_call to return an int, and makes the corresponding changes to use ints for the variables used to hold those return values. While I was doing this I finally got annoyed enough with the strings of prom_print() and prom_print_hex() calls that we do to write a simple prom_printf. I deliberately didn't use snprintf because the execution environment is weird at this point - we aren't running at the address we are linked at just yet - and I didn't want to inflict that on any code outside this file. I also did a prom_debug() macro, which eliminated a few ifdefs. There are also a bunch of other minor cleanups. This patch makes very few algorithmic changes but does get rid of a lot of casts. :) I have been running with this patch for a couple of weeks, and Anton has tested it too. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-17[PATCH] ppc64: Implement CONFIG_PREEMPTPaul Mackerras
This implements CONFIG_PREEMPT for ppc64. Aside from the entry.S changes to check the _TIF_NEED_RESCHED bit when returning from an exception, there are various changes to make the ppc64-specific code preempt-safe, mostly adding preempt_enable/disable or get_cpu/put_cpu calls where needed. I have been using this on my desktop G5 for the last week without problems. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-05-20[PATCH] ppc64: make enter_rtas() take unsigned long argAndrew Morton
From: Paul Mackerras <paulus@samba.org> We declare enter_rtas with a struct rtas_args * argument, though it is supposed to be a physical address, and then every time we call it we cast the unsigned long result from __pa() to a void *. This patch changes the declaration of enter_rtas to make it take an unsigned long argument, and removes the cast from all the callers. The actual enter_rtas() routine is in assembler and doesn't need to be changed.
2004-05-18[PATCH] ppc64: 4GB firmware flash fixAndrew Morton
From: Anton Blanchard <anton@samba.org> From: Jake Moilanen We want to make sure flash list is above 4 gigs, not 4 megs.
2004-04-18[PATCH] Fix typo in previous patchBenjamin Herrenschmidt
This is my brown paper bag day, I sent you the wrong patch for fixing the deadlock in rtas.c, here's one to apply on top of current bk that fixes build.
2004-04-17[PATCH] ppc64: Fix CPU hot unplug deadlockAndrew Morton
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> My RTAS locking fixes incorrectly added a spinlock around the function used to stop a CPU, that function never returns, thus the lock becomes stale. The correct fix is to disable interrupts instead (the RTAS params beeing per-CPU, this should be safe enough)
2004-04-15[PATCH] ppc64: Fix RTAS races on pSeriesBenjamin Herrenschmidt
The low level kernel interface to RTAS (the firmware runtime services) was plagued with races that could cause from bogus results of RTAS operations to total machine crashes in some circumstances. This patch fix the ones I could identify, hoping I didn't miss any. I also added a WARN_ON (well, it's asm equivalent) to enter_rtas to make sure we never _ever_ try to call that with interrupts enabled.
2004-04-11[PATCH] ppc64: Remove unused rtas functionsAndrew Morton
From: Joel Schopp <jschopp@austin.ibm.com> I was looking at rtas serialization for reasons I won't go into here. While wandering through the code I found that two functions were not properly serialized. phys_call_rtas and phys_call_rtas_display_status are the functions. After looking further they are redundant and not used anywhere at all.
2004-04-11[PATCH] ppc64: Add RTAS os-term call for panic on pSeriesAndrew Morton
From: Michael Strosaker <strosake@us.ibm.com> Add RTAS os-term call for panic on pSeries
2004-04-11[PATCH] ppc64: Add support for hotplug cpusAndrew Morton
From: Joel Schopp <jschopp@austin.ibm.com> Add support for hotplug cpus
2004-03-30[PATCH] ppc64: clean up virtual <-> absolute codeAndrew Morton
From: Anton Blanchard <anton@samba.org> Rusty Russell <rusty@rustcorp.com.au> The iSeries has an arch-specific mapping from physical <-> absolute addresses. Fortunately this is only used in a few places. However, the following arch-specific macros/functions are provided in addition to the standard macros: __a2p() __a2v() __p2a() __p2v() __v2a() __v2p() absolute_to_phys() phys_to_absolute() virt_to_absolute() absolute_to_virt() Reduce them to these, with slightly shorter names, and taking either pointers or unsigned long (as per __va and __pa) rather than making the caller cast: abs_to_phys() phys_to_abs() And helper macros: virt_to_abs() abs_to_virt() As is standard, virtual addresses are returned as void *, physical and absolute as unsigned long. Note that the change the iSeries_setup is a little subtle: ea is set to __va(pa) above, so "phys_to_abs(pa)" is the same as "virt_to_abs(ea)". Also, REALADDR is renamed to ISERIES_HV_ADDR and used in a couple of places where appropriate.
2004-03-22[PATCH] ppc64: Fix log_rtas_errorAndrew Morton
From: Anton Blanchard <anton@samba.org> From: Santiago Leon <santil@us.ibm.com> Fix log_rtas_error bug where the results from the call that resulted in an error where lost due the attempt to log the error.
2004-03-15[PATCH] Cleanup ppc64 procfs codeAndrew Morton
From: Anton Blanchard <anton@samba.org> Cleanup ppc64 procfs code: - Use initcalls everywhere. This allowed us to remove the iseries proc callback interface. - Kill proc_pmc.c. Most of it wasnt used (and we are planning to export the PMCs via sysfs). The few things left were iseries specific so they got moved into iSeries_proc.c. - Kill pmc.c. We dont use those statistics and the ones that are left can be gained via PMCs. - Create /proc/iSeries and /proc/ppc64 very early. This means we no longer have to call proc_ppc64_init in all the drivers, we can assume its there. - Fix some error return cases in rtas-proc.c and rtas-flash - Dont even try some pseries specific drivers on pmac.
2004-03-15[PATCH] Fixed NULL ptr deref in RTAS syscall ppc_rtas()Andrew Morton
From: John Rose <johnrose@austin.ibm.com> Fixed NULL ptr deref in RTAS syscall ppc_rtas()
2004-03-15[PATCH] Added rtas_set_power_level()Andrew Morton
From: John Rose <johnrose@austin.ibm.com> Added rtas_set_power_level()
2004-02-23[PATCH] ppc64: add log_rtas_error()Andrew Morton
From: Nathan Fontenot <nfont@austin.ibm.com> Add log_rtas_error(), to be called in the event that a rtas call returns a hardware error (-1) so we can log additional information about the hardware error.
2004-01-18[PATCH] ppc64: Fixed rtas_extended_busy_delay_time() to calculate correct ↵Andrew Morton
value, from John Rose From: Anton Blanchard <anton@samba.org> Fixed rtas_extended_busy_delay_time() to calculate correct value, from John Rose
2004-01-18[PATCH] ppc64: NVRAM error logging/buffering patch, from Jake MoilanenAndrew Morton
From: Anton Blanchard <anton@samba.org> This is a port of the nvram buffering/error logging code from 2.4 to 2.6. It includes moving /proc/rtas to /proc/ppc64/rtas and making /proc/rtas a symlink to /proc/ppc64/rtas. It also splits up the /dev/nvram device read/write functions from the basic nvram access functions, and adds ppc_md fields for the nvram access functions.
2004-01-18[PATCH] ppc64: add rtas syscall, from John RoseAndrew Morton
From: Anton Blanchard <anton@samba.org> Added RTAS syscall. Reserved lowmem rtas_rmo_buf for userspace use. Created "rmo_buffer" proc file to export bounds of rtas_rmo_buf.
2004-01-18[PATCH] ppc64: Add some rtas calls, from John RoseAndrew Morton
From: Anton Blanchard <anton@samba.org> Added functions for 3 RTAS calls get-power-level get-sensor-state set-indicator
2004-01-18[PATCH] ppc64: extended flash changes, from Mike WolfAndrew Morton
From: Anton Blanchard <anton@samba.org> extended flash changes, from Mike Wolf
2003-09-03ppc64: rtas rtc fixes from Todd InglettAnton Blanchard
2003-05-03ppc64: firmware flash fix from Olof JohanssonAnton Blanchard
2003-03-25Forward port of 2.4 ppc64 /proc/ppc64/systemcfg changesPeter Bergner
2003-02-14ppc64: warning fix, caused by meAnton Blanchard
2003-02-14ppc64: new scanlog interfaceTodd Inglett
2002-09-19ppc64: clean up some 2.4 - 2.5 differencesAnton Blanchard
2002-09-14ppc64: updates from RochesterAnton Blanchard