Add support for the PowerNV platform While there correct the detection for IBM pSeries. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
warnings: Add explict casts to silence many compiler warnings about sign comparisions. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Save arguments as well as image name for CAS reboot We were saving the image name that the user had typed (or had been selected by default) in the "boot-last-label" property, but we were losing any extra arguments that the user had typed after the image name. On a pSeries machine, if the firmware decides to do a reboot at the client-architecture-support call, we were then rebooting to the right image but without any extra arguments that the user typed. This fixes the problem by saving the arguments in boot-last-label, separated from the image name by a space. When we use the value of boot-last-label, we now call word_split to separate it into the image name and arguments again. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Allocate malloc region with prom_claim_chunk_top We want the kernel and initrd to be as low as possible in the address space. Allocate the temporary malloc region at the top of the address space. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
print available ranges under control of linux, yaboot-debug property Debugging yaboot failures is difficult because we often have to retest with a yaboot built with debug enabled. As a first step to fixing this, look for a linux,yaboot-debug property and dump the available ranges when it is non zero. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Use ino_size if available If ino_size is available and returns > 0, then use it to allocate the initrd. This allows us to claim it in one chunk and avoid all the issues around requiring back to back claims to be contiguous. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove second zero of BSS We zero the BSS in two places: once in _start() and then again in yaboot_start(). The second time we actually get it wrong and zero 1/4 of the BSS (since we subtract two pointers). Since this second zeroing is superfluous and buggy, remove it. While here, fix the comments in _start. It claims we aren't clearing the BSS when we are. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Use prom_claim_chunk to allocate malloc area prom_claim_chunk does the same thing as this loop, so we can use it instead. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Fix incorrect comparision in get_params We were comparing the first character of manualinitrd with a string. Not sure how this ever worked. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove MAX_HEADERS check The comparison against MAX_HEADERS doesn't match the error message and we are dynamically allocating memory for the program headers, so there should not be a limit. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove magic numbers in print_message_file Create a define instead of using a magic number in print_message_file. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove some DEBUG code. The test_bss and test_data debug printfs are of little use, so remove them. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove quik bootloader code Has booting yaboot out of quik ever worked? The fact we do nothing with quik_fip makes me suspect it hasn't. Remove the code. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Remove sysmap support We have had in kernel kallsyms for years, and the less code that has to deal with our fragile memory map the better. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Merge branch 'netboot'
Remove Bootinfo (BIRECS). The are not used and can scribble on kernel memory. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Enhance the parseing of IPv4 information. Pull information out of the bootp-reply (or similar) property. This successfully netboots in a wider variety of OF "boot" lines. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Fix netboot fucntionality to use the parameters specified. Currently, yaboot works properly when there is a tftp boot server serving the broadcast requests sent in the network. If the user specifies siaddr, ciaddr, and other arguments in the command line, it is not handled appropriately. This patch changes that behavior and make yaboot work properly in both cases. The semantics specified in section 4.1 of http://playground.sun.com/1275/practice/obp-tftp/tftp1_0.pdf is followed. ([bootp,]siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries) Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> ---
Allow yaboot to load relocatable kernel PPC64 relocatable kernels (built with CONFIG_RELOCATABLE=y) have the type of ET_DYN. But yaboot code won't load the kernel if the ELF type is not ET_EXEC. Attached patch adds support to yaboot to load relocatable kernels also (ie load ET_DYN type also) Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Pegasos and partition numbering The whole bplan partition numbering thing is a clusterfuck, but it shouldn't be as crappy as it is. We can _cope_ with the fact that firmware is broken and has an off-by-one in its partition numbering. All we need to do in yaboot is add 1 to the partition numbers we infer from in /chosen/boot-device, if we detect that we're on an afflicted machine. That's all we need to do, and all we ever _should_ have done. And is already in yaboot. Yaboot does its own block device handling, including partitions, and doesn't ever care about the firmware's problems (in that respect, at least). It doesn't affect the installer at _all_, because the installer can't set up the firmware's boot-device anyway and it has to be done by hand. All it affects is the release notes telling the user how to make it bootable. Unfortunately, we didn't make it that simple when we first supported the Pegasos. For reasons which aren't entirely clear to me, we ended up with Amiga partition table support in yaboot with the _same_ off-by-one error, to match the firmware. And thus we have hacks in the installer to use amiga partitions for Pegasos, and to cope with the off-by-one crap. It's only after avoiding all this crap purely by accident on Efika, by using DOS partition tables, that I realise how stupid I was to blindly copy the crap that other people were doing, and to believe that Pegasos would only work with Amiga partition tables. I'd like to get rid of the off-by-one bug in yaboot's Amiga partition handling. At the moment, our simple 'if bplan, partition++' in yaboot_main() is wrong when we have Amiga partitions, although it's fine for other partition types. Actually, I'd also like to make that same increment conditional on !conf_given, so that if someone specifies 'conf=hd:1,/yaboot.conf' on the command line, that partition number _isn't_ incremented. So any time you see a proper path specified as 'dev:part,/path/name' you know it's a real one with proper partition numbers. Remember, the bplan firmware doesn't allow that form, and takes a space between the 'dev:part' bit and the filename: boot hd:0 /yaboot/yaboot conf=hd:1,/yaboot/yaboot.conf Fixing the off-by-one bug in the Amiga partition handling means that upgrades might break. I suppose we could have a 'noamigaoffbyone' configuration option which all newly-written yaboot.conf files would have, which controls this behaviour. But to be honest I just don't think it's worth it.