summaryrefslogtreecommitdiff
path: root/arch/powerpc/boot
AgeCommit message (Collapse)Author
2007-04-13[POWERPC] bootwrapper: Decompress less, check moreMilton Miller
Our kernels put everything in the first load segment, and we read that. Instead of decompressing to the end of the gzip stream or supplied image and hoping we get it all, decompress the expected size and complain if it is not available. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] bootwrapper: no-gzip fixesMilton Miller
Commit a9903811bf8d130a26004f9cb27b66513a267908 missed two uses of the the .gz suffix in the wrapper script and didn't clean the additonal possibly cached files. Signed-off-by: Milton Miller <miltonm@bga.com> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] bootwrapper: missing relocation in crt0.SMilton Miller
crt0.S had provisions to provide run address relocaton to got2 and cache flush, but not on the bss clear or stack pointer load. Apply the same fixup for them. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Routine to find the devtree node of a linux,phandleMark A. Greer
Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Move bootwrapper ELF parsing routines to a fileMark A. Greer
The ELF parsing routines local to arch/powerpc/boot/main.c are useful to other callers therefore move them to their own file. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] bootwrapper: Add dt_xlate_reg(), and use it to find serial registers.Scott Wood
dt_xlate_reg() uses the ranges properties of a node's parentage to find the absolute physical address of the node's registers. The ns16550 driver uses this when no virtual-reg property is found. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Clean up zImage handling of the command lineDavid Gibson
This cleans up how the zImage code manipulates the kernel command line. Notable improvements from the old handling: - Command line manipulation is consolidated into a new prep_cmdline() function, rather than being scattered across start() and some helper functions - Less stack space use: we use just a single global command line buffer, which can be initialized by an external tool as before, we no longer need another command line sized buffer on the stack. - Easier to support platforms whose firmware passes a commandline, but not a device tree. Platform code can now point new loader_info fields to the firmware's command line, rather than having to do early manipulation of the /chosen bootargs property which may then be rewritten again by the core. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-13[POWERPC] Add device tree utility functions to zImageDavid Gibson
This patch adds a library of useful device tree manipulation functions to the zImage library, for use by platform code. These functions are based on the hooks already in dt_ops, so they're not dependent on a particular device tree implementation. This patch also slightly streamlines the code in main.c using these new functions. This is a consolidation of my work in this area with Scott Wood's patches to a very similar end. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-29[POWERPC] 85xx: Add initial MPC8544 DS platform files.Jon Loeliger
This patch provides the basic MPC8544 DS platform code and config. Follow-up patches will add peripherals such as PCI and SATA. Signed-off-by: Xianghua Xiao <x.xiao@freescale.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-03-29[POWERPC] 83xx: Add MPC832x RDB board support.Michael Barkowski
Add support for the MPC8323E Reference Development Board (RDB). The board is a mini-ITX reference board with 64M DDR2, 16M flash, USB, PCI, 10/100 ethernet, serial, and phone ports. Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-03-26[POWERPC] 86xx: Added 2nd PCI-Ex controller support for MPC8641 HPCN to DTS.Zhang Wei
Signed-off-by: Zhang Wei <wei.zhang@freescale.com> Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-03-26[POWERPC] New reg.h for the zImageDavid Gibson
This patch adds a reg.h to the zImage code, with common definitions for accessing system registers. For now, this includes functions for retrieving the PVR and the stack pointer. This patch then uses the new reg.h to let start() display the running stack address without having to explicitly pass the stack as a parameter from the asm code. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] Add gcc format warnings to zImage printf()David Gibson
This patch adds the correct attributes to the zImage's versions of printf to make gcc generate format string mismatch warnings. It also corrects several minor problems with format strings in the zImage thus discovered. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] boot: Use a common zImage ruleMilton Miller
Before the plethora of platforms gets any worse, establish a common rule to invoke the wrapper for any platform. Add arguments to the rule for initrd, dts, dtb, etc. Show example usage with initrd. Create default rules for zImage, and zImage.initrd. initrd targets depend on the ramdisk file. Don't consider targets for zImage.initrd that are targets for zImage. This means uImage is no longer considered a target for zImage.initrd. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] boot: clean rule fixesMilton Miller
Now that obj-boot is in targets, we can remove (twice) it from clean-files. zImage.initrd was missing, move zImage nearer where its used, and place zImage.initrd next to it. Remove non-ported zImage.sandpoint, and add auto-generation of unconfigured zImage.initrd* like image-. Signed-off-by: Milton Miller <miltonm@bga.com> -- Testing: did a few builds and cleans Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] boot: Use FORCEMilton Miller
Kbuild if_changed and if_changed_dep require the use of the dummy FORCE to get the dependencies right. Also add to targets to get correct behavior. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] bootwrapper: Allow platforms to call library zImage_startMilton Miller
Some platforms might need to run some code before the zImage start, but could otherwise use the bss clear and relocation code. Export the start address strongly as zImage_start_lib. Signed-off-by: Milton Miller <miltonm@bga.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-26[POWERPC] bootwrapper: Add a fatal error helperMilton Miller
Add a macro fatal that calls printf then exit. User must include stdio.h. Typically replaces 3 lines with 1, although I added back some whitespace. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-21[POWERPC] boot: export flush_cacheMilton Miller
Move the declaration of flush_cache to ops.h for use by platform code. Signed-off-by: Milton Miller <miltonm@bga.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-21[POWERPC] boot: rebuild when wrapper changesMilton Miller
Since there is magic defined per platform in the wrapper script, the zImage targets should depend on it. Signed-off-by: Milton Miller <miltonm@bga.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-21[POWERPC] bootwrapper: Make setprop accept a const buffer.Scott Wood
Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-21[POWERPC] bootwrapper: Make compression of the kernel image optional.Scott Wood
The --no-gzip option can be passed to the wrapper so that the kernel image is included uncompressed into the zImage. This is intended for bootloaders where the zImage itself can be compressed, or where boot time is considered more important than kernel image size. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-21[POWERPC] bootwrapper: Add dt_ops methods.Scott Wood
Add get_parent, create_node, and find_node_by_prop_value to dt_ops. Currently only implemented by flatdevtree_misc. Also, add a _str convenience wrapper for setprop. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] Add documentation for the zImage's gunzip convenience functionsDavid Gibson
This patch adds documenting comments to the gunzip convenience functions added in commit ad9d2716cfc1cda5a7e0d7bc0db45e3af8a4adbb. It also removes a stray newline, and an unused global variable. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] bootwrapper: Make ft_create_node() pay attention to the parent ↵Scott Wood
parameter. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] bootwrapper: Add ft_find_node_by_prop_value().Scott Wood
ft_find_node_by_prop_value() finds nodes with the specified property/value pair. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] bootwrapper: Make ft_get_parent() return a phandle, and NULL if ↵Scott Wood
already top-level. Most of ft_get_parent() is factored out into __ft_get_parent(), which deals only in internal node pointers. The ft_get_parent() wrapper handles phandle conversion in both directions (previously, ft_get_parent() did not convert its return value). It also now returns NULL as the parent of the toplevel node, rather than just returning the toplevel node again (which made it rather useless in loops). Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] bootwrapper: Refactor ft_get_prop() into internal and external ↵Scott Wood
functions. The property searching part of ft_get_prop is factored out into an internal __ft_get_prop() which does not deal with phandles and does not copy the property data. ft_get_prop() is then a wrapper that does the phandle translation and copying. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-16[POWERPC] bootwrapper: Add ft_find_device_rel().Scott Wood
Add a function to look up a relative, rather than absolute, path name. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Use map_string() instead of lookup_string() in ft_prop().Scott Wood
When adding a property, the property name should be added to the string table if it doesn't already exist. map_string() does that; lookup_string() will fail instead. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Modify *pp, not *p, in ft_shuffle().Scott Wood
Move the caller's pointer back to match the change in the region's start, rather than alter a byte of the device tree's content. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Preserve the pp pointer in ft_make_space() when ↵Scott Wood
calling ft_reorder(). The ft_reorder() function may change the start of the region of interest, so the pointer provided by the caller into that region must be fixed up to still point to the same datum. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Make ft_get_phandle() accept and return NULL.Scott Wood
Currently, if ft_get_phandle() is passed NULL it will allocate an entry for it and return a non-NULL phandle. This patch makes it simply pass the NULL through. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Rename ft_node_add() to ft_get_phandle().Scott Wood
This name better reflects what the function does, which is to look up the phandle for an internal node pointer, and add it to the internal pointer to phandle table if not found. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Add ft_root_node().Scott Wood
Clean up some of the open-coded data structure references by providing a function to return a pointer to the tree's root node. This is only used in high-level functions trying to access the root of the tree, not in low-level code that is actually manipulating the data structure. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] bootwrapper: Add stddef.h to ops.hScott Wood
ops.h references NULL, so include stddef.h, so files including ops.h don't have to. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Mark A. Greer <mgreer@mvista.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] zImage: Cleanup and improve zImage entry pointDavid Gibson
This patch re-organises the way the zImage wrapper code is entered, to allow more flexibility on platforms with unusual entry conditions. After this patch, a platform .o file has two options: 1) It can define a _zimage_start, in which case the platform code gets control from the very beginning of execution. In this case the platform code is responsible for relocating the zImage if necessary, clearing the BSS, performing any platform specific initialization, and finally calling start() to load and enter the kernel. 2) It can define platform_init(). In this case the generic crt0.S handles initial entry, and calls platform_init() before calling start(). The signature of platform_init() is changed, however, to take up to 5 parameters (in r3..r7) as they come from the platform's initial loader, instead of a fixed set of parameters based on OF's usage. When using the generic crt0.S, the platform .o can optionally supply a custom stack to use, using the BSS_STACK() macro. If this is not supplied, the crt0.S will assume that the loader has supplied a usable stack. In either case, the platform code communicates information to the generic code (specifically, a PROM pointer for OF systems, and/or an initrd image address supplied by the bootloader) via a global structure "loader_info". In addition the wrapper script is rearranged to ensure that the platform .o is always linked first. This means that platforms where the zImage entry point is at a fixed address or offset, rather than being encoded in the binary header can be supported using option (1). Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] zImage: Cleanup and improve prep_kernel()David Gibson
This patch rewrites prep_kernel() in the zImage wrapper code to be clearer and more flexible. Notable changes: - Handling of the initrd image from prep_kernel() has moved into a new prep_initrd() function. - The address of the initrd image is now added as device tree properties, as the kernel expects. - We only copy a packaged initrd image to a new location if it is in danger of being clobbered when the kernel moves to its final location, instead of always. - By default we decompress the kernel directly to address 0, instead of requiring it to relocate itself. Platforms (such as OF) where doing this could clobber still-live firmware data structures can override the vmlinux_alloc hook to provide an alternate place to decompress the kernel. - We no longer pass lots of information between functions in global variables. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-13[POWERPC] zImage: Add more flexible gunzip convenience functionsDavid Gibson
At present, arch/powerpc/boot/main.c includes a gunzip() function which is a convenient wrapper around zlib. However, it doesn't conveniently allow decompressing part of an image to one location, then the remainder to a different address. This patch adds a new set of more flexible convenience wrappers around zlib, moving them to their own file, gunzip_util.c, in the process. These wrappers allow decompressing sections of the compressed image to different locations. In addition, they transparently handle uncompressed data, avoiding special case code to handle uncompressed vmlinux images. The patch also converts main.c to use the new wrappers, using the new flexibility to avoid decompressing the vmlinux's ELF header twice as we did previously. That in turn means we avoid extending our allocations for the vmlinux to allow space for the extra copy of the ELF header. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-09[POWERPC] Remove unused, undocumented #cpus property from cpus nodeStuart Yoder
The #cpus property is unused and undocumented and is therefore being removed. Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-02-18Merge branch '86xx' into for_paulusKumar Gala
2007-02-18[POWERPC] 86xx: Cleaned up platform dts filesKumar Gala
* Removed explicit linux,phandle usage. Use references and labels now * Removed interrupts property from openpic node * Removed interrupt-parent property from openpic node that pointed to itself Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Jon Loeliger <jdl@freescale.com>
2007-02-17Merge branch '85xx' into for_paulusKumar Gala
2007-02-17[POWERPC] 85xx: Cleaned up platform dts filesKumar Gala
* Fixed up top level compatible property for all boards * Removed explicit linux,phandle usage. Use references and labels now * Fixed phy-phandles for TSEC3/4 in mpc8548cds.dts Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-02-17[POWERPC] 83xx: Renamed MPC8323 MDS dts and defconfig to match other boardsKumar Gala
Renamed the MPC8323 MDS and defconfig to match the naming convention followed by other MDS boards. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-02-17[POWERPC] 83xx: Updated and renamed MPC8360PB to MPC836x MDSKumar Gala
The MPC836x PB board is really just one part of the MPC836x MDS. We currently name all other PB boards as MDS. Removed all references to PB and replaced with MDS. Additionally renamed the .dts to match the defconfig (mpc836x_mds*). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-02-16[POWERPC] 83xx: Cleaned up 83xx platform dts filesKumar Gala
* Fixed up top level compatible property for all boards * Removed explicit linux,phandle usage. Use references and labels now * Fixed interrupt sense attribute, some interrupts were marked edge, that are level Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-02-16[POWERPC] Delete boot-cpu property from all DTS filesTimur Tabi
The 'linux,boot-cpu' property is obsolete, so remove it from all of the DTS files and from booting-without-of.txt. The boot CPU is actually defined in the device tree header, and U-Boot sets that field. The device tree compiler also complains if the property exists. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com> Acked-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-02-13Merge branch '83xx' into for_paulusKumar Gala
2007-02-13[POWERPC] 83xx: Add support for MPC8349E-mITX-GPTimur Tabi
This patch adds a defconfig and a DTS for the MPC8349E-mITX-GP, a variant of the MPC8349E-mITX. USB is disabled because the only USB port is not setup properly by firmware/kernel Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>