summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/bootm.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/metadata'Sascha Hauer2014-08-071-0/+1
|\ | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/arm'Sascha Hauer2014-08-071-2/+16
|\ \ | |/ |/|
| * ARM: Android image boot: automatically assign space for kernelSascha Hauer2014-07-211-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | The Android image format makes the same mistake as the U-Boot uImage format: It makes the load address mandatory. In a way it is even worse since the 'fastboot' host tool thinks that 0x10000000 is a good default when no address has been specified on the command line. Instead of only relying on the Kernel load address in the image try to automatically find a good base address when requesting the addresses from the image failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | arch/arm/lib/bootm: fix length check of kernel imagebasti@linux-source.de2014-07-221-1/+1
|/ | | | | Signed-off-by: Sebastian Block <basti@linux-source.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* misc: upper-case some abbreviationsHolger Schurig2014-06-021-2/+2
| | | | | Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Drop devicetree merge supportSascha Hauer2014-05-221-1/+1
| | | | | | | | | | | | I assume I am the only person knowing that barebox is able to merge devicetrees. This feature seems broken for a while now since trying to merge devicetress results in: unflatten: too many end nodes Remove this feature to save the complexity. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: fix default uImage placementLucas Stach2014-05-051-7/+10
| | | | | | | | | | | | | For small systems we would put the zImage at 32KiB after the start of memory, and put the DT a bit after the uImage. The kernel will always try to relocate itself and overwrite the DT. Try to be more clever at uImage placement to avoid triggering the kernel relocation. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: be more clever while deciding where to put zImageLucas Stach2014-05-051-28/+29
| | | | | | | | | | | | | | For small systems we would put the zImage at 8MiB after the start of memory, and put the DT a bit after the zImage. When we encounter an image which is bigger than 8MiB uncompressed, the kernel would try to relocate itself and overwrite the DT. Try to be more clever at zImage placement to avoid triggering the kernel relocation. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: pass free memory to __do_bootm_linuxSascha Hauer2014-01-221-17/+41
| | | | | | | | | | | | | This improves the initrd/devicetree placement in the bootm code. We used to put the initrd at the start of the kernel + 8MiB. This of course fails once the kernel gets bigger than 8MiB. Also the place for the devicetree was allocated using malloc(). This can lead to the problem that the devicetree is outside of the kernels lowmem and thus not reachable for the kernel. With this patch __do_bootm_linux gets a pointer to free space where the devicetree and the initrd can be safely put. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: locate zImage higher into RAMSascha Hauer2014-01-221-8/+64
| | | | | | | | | | The zImage should be placed where it won't be overwritten by the uncompressed image, otherwise the kernel decompressing code has to relocate the zImage before decompression. As Kernels tend to become bigger put it into 32MiB into RAM if we have enough RAM available. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: introduce bootm_load_initrd helperSascha Hauer2014-01-141-11/+5
| | | | | | | Make the bootm handlers simpler by factoring out an initrd load function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: move os loading to do_bootm_linuxSascha Hauer2014-01-101-18/+19
| | | | | | | | | | __do_bootm_linux is called from the uImage, zImage and raw handlers. In case of the zImage handler the kernel will already be loaded and the kernel load code in __do_bootm_linux will do nothing. Move the loading code to do_bootm_linux so that __do_bootm_linux will always be called with the kernel already loaded. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: introduce bootm_load_os helperSascha Hauer2014-01-101-17/+7
| | | | | | | | | | The common bootm code used to load uImage contents to SDRAM before calling into the handlers if possible. This makes the handlers complicated since they have to handle many cases. Instead, introduce a helper to load the os after the handlers have figured out a good load address. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: boot barebox with kernel calling conventionSascha Hauer2014-01-061-3/+16
| | | | | | | | | Start a 2nd stage barebox with the Linux Kernel calling convention. Right now barebox does not interpret ATAGs or devicetree passed to it, but it doesn't hurt to pass parameters so that future bareboxes can use them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Print Kernel commandline unconditionallySascha Hauer2013-07-271-2/+1
| | | | | | | | The Kernel commandline is an important debugging aid when people ask why their Kernel won't start, so print it unconditionally. This is done in !dt mode anyway, so also do it with dt. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2013-06-021-0/+4
|\
| * bootm: print Kernel commandline in verbose modeSascha Hauer2013-05-311-0/+2
| | | | | | | | | | | | | | Without devicetree support we print the Kernel commandline in verbose mode. Do the same with devicetree boot aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bootm: make sure to print fixed oftreeSascha Hauer2013-05-311-0/+2
| | | | | | | | | | | | | | | | when doing bootm -v -v we dumped the original tree to the console. Make sure to print the fixed tree instead so that the fixups can be examined. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: Using unsigned specifiers for unsigned arguments for printfAlexander Shiyan2013-05-311-1/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: remove unused libfdtSascha Hauer2013-03-061-1/+0
| | | | | | | Now that we are completely independent of libfdt remove the unused code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM bootm: Switch initrd support to unflattened treeSascha Hauer2013-03-061-1/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Pass unflattened devicetree to handlersSascha Hauer2013-03-061-6/+2
| | | | | | | | | This makes it possible to modify the tree in the handlers. This is necessary because the initrd addresses are only known inside the handlers, but not to the generic bootm code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: rework concatenated oftreeSascha Hauer2013-03-061-20/+16
| | | | | | | | | | | Without compiled in devicetree support we used to copy the concatenated devicetree directly behind the zImage. This is unnecessary, even if we do not have devicetree support we can copy the devicetree whereever we like and pass the kernel a pointer to it. This makes the code a bit easier. While at it, add the missing free calls in the error case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Pass barebox internal format devicetree to of_get_fixed_treeSascha Hauer2013-03-061-1/+9
| | | | | | | With this every devicetree is first converted to the barebox internal format before it's converted back to dtb again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM bootm: Use of_get_fixed_treeSascha Hauer2013-03-061-7/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM bootm: only use concatenated oftree when no other is availableSascha Hauer2013-01-191-0/+3
| | | | | | | | When an oftree is already specified use it. This lets the user boot a kernel with an oftree he provided himself rather than hardcoding the concatenated one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM android image: remove double of_fix_treeSascha Hauer2013-01-111-6/+0
| | | | | | | | With bootm of_fix_tree() will already be called from the generic bootm code, so do not do this again in the Android image handler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* filetype: Pass bufsizeSascha Hauer2012-12-031-1/+1
| | | | | | | | | | Pass the buffer size to the file detection code. This makes sure we do not read past the buffer. This is especially useful for ext filesystem detection as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE define which is set to the minimum bufsize the detection code needs to detect all known filetypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: close open filesVicente2012-10-101-1/+3
| | | | | Signed-off-by: Vicente <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm/bootm: fix initrd_start initJean-Christophe PLAGNIOL-VILLARD2012-08-131-1/+3
| | | | | | | initrd_start need to be init to data->initrd_address and updated only if the addr is invalid. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* bootm: Fix undefined reference to of_fix_treeSascha Hauer2012-07-251-1/+1
| | | | | | It's only available when oftree support is enabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: store 'end' instead of 'size' in struct resourceSascha Hauer2012-07-011-4/+4
| | | | | | | | | | Storing the size instead of the resource end in struct resource was a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously leads to problems. 'end' on the other hand will never exceed UINT[32|64]_MAX. Also this way we can express a iomem region covering the whole address space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* booting: more flexible Linux bootargs generationSascha Hauer2012-05-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | We currently use the environment variable 'bootargs' to get the Linux bootargs. This patch allows for a more flexible bootargs generation using global variables. With it the Linux bootargs are concatenated from multiple variables. This allows to replace parts of the bootargs string without having to reconstruct it completely. With this bootargs can be constructed like: global linux.bootargs.base="console=ttyS0,115200" global linux.bootargs.ip="ip=dhcp" global linux.mtdparts="physmap-flash.0:512K(nor0.barebox),-(root)" This will then automatically be combined into a kernel bootargs string during boot. If the 'linux.bootargs.' variables are all empty the old standard 'bootargs' way will be used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'binfmt' of git://git.jcrosoft.org/barebox into nextSascha Hauer2012-04-181-1/+21
|\
| * arm: bootm: add barebox, zImage and aImage binfmt supportJean-Christophe PLAGNIOL-VILLARD2012-04-181-1/+21
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | arm: bootm: zImage: add error message when can not request the memoryJean-Christophe PLAGNIOL-VILLARD2012-04-181-0/+2
|/ | | | | | | This will allow to understand what happened. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: fix zImage support when a oftree is concatenatedJean-Christophe PLAGNIOL-VILLARD2012-04-131-0/+69
| | | | | | | | When a oftree is concatenated,the zImage is bigger than the size specified in the zImage header. Detect it and copy it too. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: add Android boot image supportJean-Christophe PLAGNIOL-VILLARD2012-04-131-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | The Android Image contains 3 components and params - kernel - initrd - second stage (optional) - tags addr - bootargs In fast boot the initrd is mandatory, in barebox we are less restrictive use the initrd only if present add to env params: aimage_noverwrite_bootargs Disable overwrite of the bootargs with the one present in aimage aimage_noverwrite_tags Disable overwrite of the tags addr with the one present in aimage Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM zImage: fix missing setting of load_addressSascha Hauer2011-12-211-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: use new uimage codeSascha Hauer2011-12-151-15/+207
| | | | | | | | | | | | | | This switches the bootm code to the new uimage code. Also bootm can now handle other types of images than uImages. Currently the only architecture making use of this is arm which allows to boot zImages, raw images and barebox images. I intended to make a more bisectable series from this but I failed becuase there are many dependencies and no matter how I tried the patches grew bigger and and bigger. So I decided to put this all in a single patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: call start_linux directly with initrd start/size and oftreeSascha Hauer2011-12-151-1/+2
| | | | | | | whoever calls this function is not necessarily aware of a struct image_data, so remove the dependency from the function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm bootm: remove unnecessary includeSascha Hauer2011-11-291-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: push relocate_image up to the generic commandSascha Hauer2011-11-291-7/+0
| | | | | | | | | All handlers used to just relocate the image without any checks, so we are doomed if we write outside of SDRAM or will overwrite ourselves. Move the relocation up to the generic part where we have a chance of catching these issues. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM bootm: remove now obsolete argsSascha Hauer2011-11-291-29/+0
| | | | | | | | Now that the arch_number and system_rev variables can be set from the environment we don't need the old bootm command line switch mechanism anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm/bootm: enable multi uimage supportJean-Christophe PLAGNIOL-VILLARD2011-10-091-5/+0
| | | | | | | | | | | | | | | tested on imx53 loco board with a Multi uImage file generate like this mkimage -A arm -O linux -T multi -C none -a 0x70008000 -e 0x70008000 -n Linux-2.6.35.3-00745-gce4c61a-dirty -d zImage:rootfs.cpio.lzma uImage.Multi and boot via bootm bootm -r @1 -L 0x72000000 /dev/ram0.kernel Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused global_data.hSascha Hauer2011-08-011-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move bootm code to its own fileSascha Hauer2011-04-041-0/+92
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>