summaryrefslogtreecommitdiff
path: root/kexec/arch/ppc
AgeCommit message (Collapse)Author
2010-08-20Prevent multiple reservations for cpu-release-addrMatthew McClintock
Currently, we can add a lot of reservations over a small range, this does a simple check to verify the previous entry is not the same as the current one and skips it if so Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-08-20Ramdisk address was not copied correctly on kexec'ed kernelMatthew McClintock
Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Add support for reworking flat device tree supportMatthew McClintock
Currently, the device tree is passed as is. You can optionally update the command line and specifically listed nodes but nothing is updated automatically. This patch updates the memreserve regions, memory node, initrd nodes and attempts to make the device tree look as it should. Some code is borrowed from the u-boot routines which do similiar things Also, now if no flat device tree is passed to kexec it will attempt to rebuild one from the /proc/device-tree file system to use for the kexec'ed kernel for both uImage and elf formats [ horms@verge.net.au: kernel_addr is now outside #ifdef WITH_GAMECUBE ] Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Add support for ramdisk on ppc32 for uImage-ppc and Elf-ppcMatthew McClintock
This fixes --reuseinitrd and --ramdisk option for ppc32 on uImage-ppc and Elf. It works for normal kexec as well as for kdump. When using --reuseinitrd you need to specifify retain_initrd on the command line. Also, if you are doing kdump you need to make sure your initrd lives in the crashdump region otherwise the kdump kernel will not be able to access it. The --ramdisk option should always work. [ horms@verge.net.au: minor up-port ] Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Update Elf-ppc to support crash kernel and misc fixesMatthew McClintock
Use current command line if none given, specifically useful for when arguments are added causing the use of the current cmdline to not occur We also try to load the dtb above the kernel, this is useful for relocatable kernels where they device tree needs to reside just above the kernel base address Set the kernel entry address in the relocatable purgatory code so we jump to the correct start address if not the default. Useful for relocatable kernels [ horms@verge.net.au: moved kernel_addr declaration to outside #ifdef WITH_GAMECUBE ] Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Update uImage to support crash kernel and misc fixesMatthew McClintock
Use current command line if none given, specifically useful for when arguments are added causing the use of the current cmdline to not occur. We also try to load the dtb above the kernel, this is useful for relocatable kernels where they device tree needs to reside just above the kernel base address. Only allocate 1 MiB extra for bss space after kernel as it appears to be more than adequate. Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Fix case where phys_addr_t != unsigned long when reading proc entriesMatthew McClintock
On some actitectures the physical memory can be 64 bits, therefore the code that reads proc entries needs to take into account it could read either a 32 bit or 64bit value for the physical addresses. Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-29Restore kexec uImage-ppc to working stateMatthew McClintock
Booting with uImage-ppc was broken by previous work, this patch should restore it to working order Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-07-13build: Include missing files in tarballSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-19kexec-tools: Fix option/argument parsingMatt Evans
The argument parsing is currently a bit broken as main()'s getopt_long() knows nothing about either the architecture-specific options or, even more specifically, the architecture-and-loader-specific options. This patch introduces new #defines for all architectures, KEXEC_ALL_OPTIONS and KEXEC_ALL_OPT_STR. These contain all possible options for a given build, and the getopt_long() passes in main() and arch_process_options() will now recognise arch- and loader-specific options; these will not be re-ordered in argv[], there is no confusion over which argv[] entry is the kernel filename, and using '--opt=foo' and '--opt foo' both work. All architectures have command line options (and #define OPT_BLAHs) consolidated into their include/arch/option.h files. x86_64 builds parts of i386/ as well, so now both share a single option.h file (with a symlink). Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-19ppc: Fix gamecube buildSimon Horman
This fixes the kexec-build on ppc32 when the --game-cube option is supplied to ./configure. It seems to have bit-rotted a little. Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-13Fix kexec on powerpc32Maxim Uvarov
Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-13kexec-tools: remove unused code from arch_process_options (arm, cris, ia64, ↵Matt Evans
mips, ppc) These architectures don't have any architecture-specific options (note: distinct from loader options, which are more specific), yet their arch_process_options() functions contain getopts_long() calls followed by no argument processing. The code doesn't do anything, so this patch removes it. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-03-31Split Powerpc's uImage codeSebastian Andrzej Siewior
The check and uncompress code could be split and recycled by other arch. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2010-03-07powerpc32: add support for uImageSebastian Andrzej Siewior
On PowerPC the uImage usually contains the compressed "final" kernel and not a tiny wrapper which relocates itself und uncomprosses the final kernel to its final position. Instead we uncompress the gzip image and put it the its final position. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2010-03-07powerpc32: add support to fixup the dtbSebastian Andrzej Siewior
A few device nodes are dynamically determined by the bootloader (MAC address, memory size, ..) and are not part of the device tree. The kernel command line is also read from dtb and usually not part of the device tree. With the libfdt it is now easy to add/replace nodes in the device tree. The user may specify "--reuse-node=/memory/reg" to update the memory/reg node to what ever is now. This requires the kernel to export the device tree via the procfs in /proc/device-tree. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2010-03-07powerpc32: pull in libfdtSebastian Andrzej Siewior
This is v1.2.0 of libfdt from the dtc project which is available at git://www.jdl.com/software/dtc.git The other files - include/page.h - include/types.h - libfdt-wrapper.c - ops.h are part of the glue code which is used the powerpc boot wrapper code is comming from the Linux kernel v2.6.27-rc6 and has been modified a little to fit. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2010-03-07powerpc: dtb and purgatory support for ppc32Sebastian Andrzej Siewior
Some code dtb scanning & filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. Booting a self contained elf image (incl. dtb / without the need for a bd sturct or the like) can be booted. The dtb support is currently optional. That means if the elf image does not contain a dtb file then the user has to supply a complete dtb (including mem size, command line, bus freq., mac addr, ...) Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2010-02-02Use C99 initialisersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Use casts to avoid ambiguity when comparing off_t and size_tSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02ppc: memory_range global is only used in conjunction with WITH_GAMECUBESimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2008-05-21Factor uname-based native architecture detection into a common function.Jamey Sharp
This code was copy-pasted into every architecture and was basically identical. Besides producing a nice net reduction in code, this factors a portability challenge into a single function that can be easily replaced at build-time. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-29Allow building for ppc32 platforms.Tony Breeds
Currently any ppc32 compile will error out with "Please, fix this for your platform". While this is a great way to encourage people to update the code it seesm to be a disinsentive for distros to package kexec-tools for powerpc (incl. 64-bit). Make get_memory_ranges() do the right thing in the GameCube case and fail at runtime for all other ppc32 cases. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-04-24<sys/mman.h> is not needed by any kexec/ sourceSimon Horman
This continues the work that Jamey Sharp did on i386 to cover all other architectures. Cc: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-02-21Only include needed files in distribution tarballSimon Horman
With the recent build changes a number of unneded files crept into tarballs, including .o and .d files. This patch is farily verbose, but hopefully in the long run this system will be obvious enough to be maintainable. Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Use general _SRCS and _OBJS, rather and _C_{SRCS, OBJS} and _S_{SRCS, OBJS}Jeremy Kerr
Since we use the implicit ruls for .c and .S, just colelct all sources in the one variable. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Add gamecube to config.h definesJeremy Kerr
.. instead of messing with CFLAGS. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Consolidate BOOTLOADER definesJeremy Kerr
The BOOTLOADER and BOOTLOADER_VERSION #defines are repeated in multiple files. This change removes the unnecessary definition of these, and keeps the kexec/kexec.h as the main source. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-10-17Allow architectures to specify the location of /proc/iomemSimon Horman
On ia64 XEN it is sometimes neccessary to use an alternate location for the information that is usually provided by /proc/iomem. By having the path returned by a function, which can be overriden on a per-architecture basis, it is possible for ia64 XEN to make use of existing generic code. Hopefully other achitectures can use this infastructure as the need arises. If the machine parameter is zero, then iomem file relating to the currently running kernel should be returned. If the machine parameter is non-zero then iomem file, relating to the underlying hypervisor, should be returned. In the simple case, these will be the same file. Signed-off-by: Simon Horman <horms@verge.net.au> kexec/arch/i386/crashdump-x86.c | 4 ++-- kexec/arch/i386/kexec-x86.c | 2 +- kexec/arch/i386/x86-linux-setup.c | 2 +- kexec/arch/ia64/crashdump-ia64.c | 9 +++++---- kexec/arch/ia64/kexec-elf-ia64.c | 2 +- kexec/arch/ia64/kexec-ia64.c | 5 +++-- kexec/arch/ppc/kexec-ppc.c | 2 +- kexec/arch/s390/kexec-s390.c | 5 +++-- kexec/arch/x86_64/crashdump-x86_64.c | 10 +++++----- kexec/arch/x86_64/kexec-x86_64.c | 2 +- kexec/crashdump-xen.c | 6 ++++-- kexec/kexec-iomem.c | 31 +++++++++++++++++++++++-------- kexec/kexec.h | 6 +++--- 13 files changed, 53 insertions(+), 33 deletions(-) 9079040b40f643cfc9eb3d425dffa0ca8fd573e1
2007-03-16Kdump is not supported on ppc, s390, shMagnus Damm
Kdump is not supported on ppc, s390, sh So let's return that no crash kernel memory is found. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-11-27kexec-tools: Get rid of unused variables on ppcSimon Horman
Get rid of unused variables on ppc Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-13Check for crashkernel memory reservationMohan Kumar M
Check whether memory for crashkernel is reserved by calling arch dependent functions. The patch also creates dummy functions in ppc, ia64 and s390 architectures, so that the build process will not break. The function "is_crashkernel_mem_reserved" needs to be implemented on ppc, ia64 and s390 architectures. Signed-off-by: Mohan Kumar M <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: ppc fix compilation issues due to new parameterVivek Goyal
o Fix ppc compilation issues. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-07-27kexec-tools: i386 sys interface changes compatibilityVivek Goyal
On Wed, Dec 14, 2005 at 02:50:52PM -0600, Milton Miller wrote: [..] > >>(2) why do you stat the files instead of just trying to open them and > >>check for ENOENT? > >> > >>milton > >> > > > >I wanted to differentiate between two cases. One being sysfs not > >mounted > >and other being file not being present (Due to kernel bug or cpu not > >present), hence used stat(). In case of sysfs not being mounted, we > >simply exit after giving an error message. In other case we continue > >to loop through other cpus and ignore cpu, which is not present. > > > > Ok, but try to open the file first. IF you want to do this diagnostic > after the open fails, that is ok. But don't do this check n times (n = > number of cpus) when the file exists. > I have moved the sysfs mounted check in failure condition. > > > > >On Tue, Dec 13, 2005 at 09:36:26AM -0800, Haren Myneni wrote: > >>Vivek, I believe, we should push this func into arch independent code. > >>Otherwise, we have to copy it for every platform. > >> > > > >We have reworked the patch and moved this code to architecture > >independent > >portion. > > > > > Only the x86 code has the fallback the old name, not the genric code. > Only i386 port of kdump was available when crash_notes was exported through /sys/kernel/crash_notes. Rest of the architectures see new arch- independent percpu crash_notes sysfs interface only. Hence thought no point copying backward compatibility code in generic code. > > Also, there are error paths that do not set the address, others that > zero it. > The error paths which do not set address to zero are non return path. They call die() which inturn calls exit(1) after printing appropriate error messasge. > What happens if the base kernel is too old for kexec-panic, where > neiter file will exist? > In that case kexec will fail much earlier. There will be no reserved memory area for loading second kernel (crashkernel=X&Y) hence attempt to load the second kernel will fail and control will not reach this place at all. Modifed patch appended. Thanks Vivek o This patch moves per cpu interface to retrieve crash_notes address to architecture independent section. (As suggested by Haren) o For i386, kernels older than 2.6.15-rc1-mm2 used to export crash_notes through /sys/kernel/crash_notes. This patch also provides backward compatibility with older kernel versions. o Definition of MAX_NOTE_BYTES moved to architecture independent header file as everybody is using same definition. o Definition of MAX_LINE moved to architecture independent header file. Seems to be a better option than defining it in many C files. Signed-off-by: Maneesh Soni <maneesh@in.ibm.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27crashdump backup region handlingVivek Goyal
o This patch adds support for reserving space for backup region. Also adds code in purgatory to copy the first 640K to backup region. o Moved kexec_flags inside kexec_info structure. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27kexec-tools-1.101Eric W. Biederman
- Initial import into git - initial nbi image formage support - ppc32 initial register setting fixes. - gzipped multiboot file support