summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
Commit message (Collapse)AuthorAgeFilesLines
* arm/lib: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2020-12-071-14/+3
| | | | | | | | | Converts the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove references to CREDITSUwe Kleine-König2020-04-271-3/+0
| | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: pbl: keep __image_end sectionLucas Stach2019-11-041-1/+1
| | | | | | | | | | Not all architectures are referencing the image_end section from code, in which case the linker is free to drop the section, which then messes up the calculation of the _barebox_image_size linker variable. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images: always build sha256sum into pblRouven Czerwinski2019-08-071-0/+7
| | | | | | | | | Create a sha256sum of the compressed barebox image and always add it to the PBL. We also add a custom linker section for ARM, to retrieve the sha256sum for piggydata verification. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: lib: add CSF section between PBL and piggyRouven Czerwinski2019-08-071-0/+10
| | | | | | | | | | Signing on i.MX8MQ is done by signing only the PBL, since the DRAM is not available on early start and the SRAM is not big enough to contain the whole image. Reserve a CSF area between PBL and the piggydata, to ensure that the CSF area can be loaded into SRAM. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pbl multiimage: Allow to check image sizesSascha Hauer2019-03-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PBL images are often constrained in size by limitations exposed by the SoCs SRAM size or partition sizes on the boot device. So far we tried to configure these limits in Kconfig, but with PBL multi images and thus different limitations for the different supported images this no longer works. This patch has another approach for it: During build time make variables containing the relevant sizes for each image are created. These are: PBL_CODE_SIZE_$(symbol) PBL_MEMORY_SIZE_$(symbol) PBL_IMAGE_SIZE_$(symbol) PBL_CODE_SIZE_$(symbol) contains the pure code size of the PBL, it should be smaller than the available SRAM during boot. Normally the PBL's bss segment also needs to be in the initial SRAM, for this case PBL_MEMORY_SIZE_$(symbol) is the relevant variable. PBL_IMAGE_SIZE_$(symbol) contains the full size of the PBL image including the compressed payload (but without any image headers created later by SoC specific image tools). $(symbol) is a placeholder for the start symbol used for this PBL image, thus for the i.MX53 QSB with entry start_imx53_loco PBL_CODE_SIZE_start_imx53_loco will be created. The images/Makefile.* can use these variables directly to check sizes or specify the same variables with a "MAX_" prefix. So when images/Makefile.imx specifies MAX_PBL_CODE_SIZE_start_imx53_loco = 0x10000 then the build system will make sure that the PBL code for the QSB will not get bigger than 64KiB. Also included in this patch are the size restrictions for the i.MX8MQ images as an example how to use this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "images: Drop unnecessary fix_size"Sascha Hauer2019-02-131-1/+1
| | | | | | | | | | | | | This reverts commit 5c0e16591d9471a345b77a41fde76de34f301f6b. The fix_size scripts is not necessary for newer ARM toolchains, it is however necessary for the older ARM toolchains (gcc-5 and older). The original reason to drop fix_size was that it doesn't work on MIPS. With this patch we add the -i flag so that we ignore unknown images and can succesfully build MIPS images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images: Drop unnecessary fix_sizeSascha Hauer2019-01-161-1/+1
| | | | | | | | Now that we compile the compressed binary into the decompressor we no longer need fix_size but can use the linker to fill in the image size into the binary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: images: use piggydataSascha Hauer2018-12-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The way we assemble the multi images on ARM is rather complicated and error prone. We currently cat the compressed barebox image behind the PBL executable and need some magic to obtain the size of the payload and also have to do tricks to reliably get a pointer to the compressed image. This patch switches over to compile the compressed payload into the PBL image itself which has proven to work for the single PBL case and for the ARM Linux Kernel aswell. The goal is to unify the single PBL and the multi PBL cases together in the future to get an easier startup path for ARM. This patch has been tested on the i.MX53 QSB, i.MX53 Vincell, Beaglebone black (both MLO and 2nd stage) and a Phytec phyFLEX i.MX6 board. SoCFPGA Arria10 has also be changed slightly with this patch. We used to generate a single image (barebox-socfpga-achilles.img) which was used as xload image and full image. We now instead generate two images: barebox-socfpga-achilles-xload.img and barebox-socfpga-achilles.img, the former loaded by the ROM and the latter loaded by the xload image. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Multi PBL: Fix image calculation for certain toolchainsSascha Hauer2018-09-171-1/+1
| | | | | | | | | | | | | The current way to calculate the compressed image position works with the OSELAS toolchains, but not with the Debian/Ubuntu toolchains. For these toolchains &image_end_marker already returns the correct address, adding global_variable_offset() to it is wrong. The solution seems to be to put the image_end_marker into a different object file so that the compiler cannot play any tricks to resolve the address internally in the object file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Add code to support SMCCC on AArch64Andrey Smirnov2018-08-081-1/+6
| | | | | | | | | | | | | | Port SMCCC code from Linux kernel. To accomodate that: - Introduce CONFIG_ARM_SMCCC, to allow enabling the code independent of CONFIG_ARM_SECURE_MONITOR - Bring <linux/arm-smccc.h> in - Add necessary constants to arch/arm/asm-offsets.c Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: aarch64: disable 32bit boot commandsSascha Hauer2018-04-042-664/+0
| | | | | | | | The 32bit boot support is full of legacy cruft. While it should be possible to merge the aarch64 support there, a fresh start looks more promising. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: aarch64: fix pbl linker script for aarch64Sascha Hauer2018-03-231-0/+9
| | | | | | | Fix output format for aarch64. Also, relocation fixup symbols are in rela section rather than rel section. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Fix wrong format specifierSascha Hauer2018-03-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: android image: Fix compiler warning on aarch64Sascha Hauer2018-03-211-1/+1
| | | | | | | | | | The android image format has a u32 value which tells the loader where to put the ATAG list. Casting this value to a pointer directly causes a warning on aarch64. Silence it by casting it to unsigned long first. The code is of no use on aarch64, so no need to fix anything really. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move away from ld_varSascha Hauer2018-03-211-13/+9
| | | | | | | | | | | | | | The ld_var solves the issue that when compiled with -pie the linker provided variables are all 0x0. This mechanism however refuses to compile with aarch64 support. This patch replaces the ld_var mechanism with a nice little trick learned from U-Boot: Instead of using linker provided variables directly with "__bss_start = ." we put a zero size array into a separate section and use the address of that array instead of the linker variable. This properly works before relocation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: scroll past image end without ld_varSascha Hauer2018-03-211-3/+2
| | | | | | | | | ld_var is going to be removed, cope without it. In the PBL image we want to get the location after the binary to the place where the compressed image is located. To do this Put a variable at the very end of the binary, get it's location and add an offset. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: bootm: don't fall over if image is padded with less than 40 bytesLucas Stach2017-10-231-1/+3
| | | | | | | | | | | If the zImage has a padding, which is less than 40 bytes (sizeof struct fdt_header) the amount of read bytes would be propagated as an error code. Fix this by only propagating real errors and treating failure to read less than the expected amount as no concatenated DT being present. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Add PSCI supportSascha Hauer2017-02-132-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains the barebox implementation for the ARM "Power State Coordination Interface" (PSCI). The interface is aimed at the generalization of code in the following power management scenarios: * Core idle management. * Dynamic addition and removal of cores, and secondary core boot. * big.LITTLE migration. * System shutdown and reset. In practice, all that's currently implemented is a way to enable the secondary core one some SoCs. With PSCI the Kernel is either started in nonsecure or in Hypervisor mode and PSCI is used to apply power to the secondary cores. The start mode is passed in the global.bootm.secure_state variable. This enum can contain "secure" (Kernel is started in secure mode, means no PSCI), "nonsecure" (Kernel is started in nonsecure mode, PSCI available) or "hyp" (Kernel is started in hyp mode, meaning it can support virtualization). We currently only support putting the secure monitor code into SDRAM, which means we always steal some amount of memory from the Kernel. To keep things simple for now we simply keep the whole barebox binary in memory The PSCI support has been tested on i.MX7 only so far. The only supported operations are CPU_ON and CPU_OFF. The PSCI and secure monitor code is based on the corresponding U-Boot code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Fix appended device tree when CONFIG_OFTREE is enabledSascha Hauer2016-11-081-2/+10
| | | | | | | | | When CONFIG_OFTREE is enabled the appended device tree is unflattened and put into data->of_root_node, but there it is never used again. To actually use the appended device tree put it into data->oftree instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Fix free_mem calculation when initrd is givenSascha Hauer2016-10-181-1/+1
| | | | | | | | | | | | | | When a initrd is given we calculate the next free memory position as: free_mem = PAGE_ALIGN(initrd_end); This is wrong when initrd_end exactly falls on a page boundary. In this case PAGE_ALIGN() does nothing and free_mem becomes initrd_end and the following bootm_load_devicetree() and thus booting fails with -ENOMEM. Fix this by correctly advancing to the next free memory position. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_unflatten_dtb(): Check return value with IS_ERRAndrey Smirnov2016-09-051-1/+1
| | | | | | | | Of_unflatten_dtb returns a ERR_PTR value so checking it against NULL is incorrect. Fix it in all of the places where this was happening. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-0/+1
| | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: rework lib directory to support arm64Raphael Poggi2016-07-0626-3162/+0
| | | | | | | | | | | This commit create a common directory, lib/, for arm and arm64 common code. It also create lib32/ and lib64/ for 32bit and 64bit code respectively. Signed-off-by: Raphael Poggi <poggi.raph@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Fix compiler warningSascha Hauer2016-07-051-1/+1
| | | | | | | | fixes: arch/arm/lib/bootm.c:92:137: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: recalculate decompression spaceStefan Müller-Klieser2016-07-041-3/+15
| | | | | | | | | | | | | | | | According to the kernel documentation it is recommended to place the compressed image between 32 MiB and 128 MiB. The DTB and initrd should be placed above 128 MiB. We will follow the recommendation as long as we have enough RAM. If this is not the case, we fall back to the scheme. This change is required because of the ARM default kernel config changes regarding RODATA layout, which lead to an increased compression factor of the kernel image. This should be regarded as an intermediate solution until there is a mechanism for the kernel image to report the decompressed layout requirements to the bootloader. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Move bootm options to common/KconfigSascha Hauer2016-05-101-2/+2
| | | | | | | | | | | | bootm has a C API, so the bootm options have to depend on the option providing the bootm code (CONFIG_BOOTM), not on the option providing the command (CONFIG_CMD_BOOTM). Fixing the dependencies makes it possible to fully use bootm from C without enabling the bootm command support. This also removes the CMD_ prefix from the options which means we have to update the defconfigs aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Bootm: FIT image handler depends on CONFIG_FITIMAGESascha Hauer2016-04-251-1/+1
| | | | | | | | CONFIG_FITIMAGE is the variable to depend on, not CONFIG_CMD_BOOTM_FITIMAGE which is only a wrapper option to let CONFIG_FITIMAGE select from the bootm Kconfig menu. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Move mem_free calculation into get_kernel_addresses()Sascha Hauer2016-04-201-11/+10
| | | | | | | | | The callers of get_kernel_addresses() are not interested in the spacing after the kernel image, they are interested in the place where they can put device tree and initrd, so pass a pointer to mem_free to get_kernel_addresses(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Let get_kernel_addresses() determine SDRAM region itselfSascha Hauer2016-04-201-14/+20
| | | | | | | Move the call to sdram_start_and_size() into get_kernel_addresses() and remove the now unnecessary parameter mem_start. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Rework vector table setupSascha Hauer2016-04-011-0/+1
| | | | | | | | | | | | | | | | | | | The current vector table setup has some shortcomings. First of all currently the case when the high vectors are inside SDRAM (that is, SDRAM reaches the end of the address space) is not supported. In this case we create a secondary page table for the section containing the vectors which gets overwritten by the general SDRAM secondary page table entries creation afterwards. On ARMv7 and later the exception table setup can be improved: Here the vector table address is configurable in the VBAR register. We can use this register to skip remapping the vector table. With this patch we first try to use the VBAR register before doing something else. Also, when we have to use the high vectors we first try a request_sdram_region to test if the vector table memory is already mapped. While at it sprinkle some comments into the code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: bootm: be more clever about kernel spacingLucas Stach2016-03-011-0/+8
| | | | | | | | | | When the kernel load address is chosen by the user/image we need to check if the kernel needs to relocate itself before decompression. If that's the case the spacing behind the kernel must allow for this relocation without overwriting anything placed behind the kernel. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: bootm: unify kernel load address calculationLucas Stach2016-03-011-37/+37
| | | | | | | | | Instead of having the same logic for uImage and zImage types duplicated in the code, split it out into a separate function. This does not change the behavior of the calculation. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: add initial FIT supportJan Luebbe2016-01-261-0/+8
| | | | | | | | | | | | | | | This implementation is inspired by U-Boot's FIT support. Instead of using libfdt (which does not exist in barebox), configuration signatures are verified by using a simplified DT parser based on barebox's own code. Currently, only signed configurations with hashed images are supported, as the other variants are less useful for verified boot. Compatible FIT images can be created using U-Boot's mkimage tool. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: move initrd code togetherSascha Hauer2016-01-261-3/+5
| | | | | | | The initrd code is distributed in several places in the bootm code. Move it all together in bootm_load_initrd(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Push dryrun to handlersSascha Hauer2016-01-261-0/+3
| | | | | | | We can make the dryrun option more useful by calling into the handlers. With this we can detect more cases that can go wrong during boot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: bootm: Use kernel handler to start barebox imageSascha Hauer2016-01-221-29/+1
| | | | | | | | barebox can be called with the kernel calling convention, so we can reuse the handler instead of creating a barebox specific handler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: introduce bootm_get_os_sizeSascha Hauer2016-01-221-1/+1
| | | | | | | | ARM do_bootm_linux is not only called with uImages but also with raw images, so we can't use uimage_get_size() here. Introduce bootm_get_os_size() which handles the different image types. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: zImage: add missing free() in appended device tree codeSascha Hauer2016-01-221-0/+1
| | | | | | oftree must be freed when the tree is successfully unflattened. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Remove kernel booting call for thumb2 modeTrent Piepho2015-12-041-12/+0
| | | | | | | | | | | | | | | | | | | | | | | The asm code to do the actual call into the kernel (or another barebox) when compiled in thumb2 mode isn't necessary. gcc generates a perfectly good calling sequence from a normal function pointer call. If it didn't, the code in bootstrap_boot() that uses a function pointer to jump to the 2nd stage barebox from an xloader wouldn't work. It appears to be allowed that the call to kernel() could return, as neither start_linux() nor kernel() are marked noreturn, and there is code after calls to start_linux(). The asm code has a bug in this case, as it uses bx and not blx, and thus doesn't set the link register. Since it's a tail call, this would be okay, but only if the LR value from the start of start_linux() (and the callee-saved registers) are restored beforehand, which isn't done. The gcc generated call sequence will do this. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: don't let the unwinder depend on exception handlingUwe Kleine-König2015-11-091-0/+5
| | | | | | | | | | To be able to use dump_stack() without support exception handling the definition of dump_stack has to move to a file that is actually compiled without ARM_EXCEPTIONS. Fixes: d332597c7c16 ("ARM: make exception handling optional") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Add support for semihostingAndrey Smirnov2015-10-303-0/+256
| | | | | | | | | | Add semihosting API implementation and implement a filesystem driver to access debugging host filesystem using it. Tested on Freescale SabreSD board (i.MX6Q) using OpenOCD Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* exitcall: Add exitcall infrastructureHerve Codina2015-07-131-0/+4
| | | | | | | | exitcall infrastructure is based on initcall infrastructure. It allows to have and use exit call hooks on barebox shutdown. Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-01-093-3/+3
|\
| * sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: move asm-offsets.h rule to ./KbuildMasahiro Yamada2015-01-081-0/+16
|/ | | | | | | | | | | | | | | Currently, MIPS is the only architecture that needs include/generated/asm-offsets.h, but we have got ./Kbuild file now. It is a good reason to move asm-offsets.h rule from arch/mips/Makefile to ./Kbuild and add dummy asm-offsets.c for the other architectures. asm-offsets.h would be useful for all the architectures. This commit does not implement include/generated/bounds.h, but if necessary, it is easy to implement it. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/metadata'Sascha Hauer2014-08-073-0/+5
|\ | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * Add support for metadata in barebox imagesSascha Hauer2014-08-072-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often useful to get some information about a barebox image before starting or flashing it. This patch introduces barebox Image MetaData (IMD). When enabled a barebox image will contain a list of tags containing the desired information. We have tags for: - the barebox release (2014.07.0-00160-g035de50-dirty) - the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014) - the board model the image is intended for - the device tree toplevel compatible property Also there is an additional generic key-value store which stores parameters for which no dedicated tag exists. In this patch it is used for the memory size an image supports. Since there is no fixed offset in a barebox image which can be used for storing the information, the metadata is stored somewhere in the image and found by iterating over the image. This works for most image types, but obviously not for SoC images which are encoded or encrypted in some way. There is a 'imd' tool compiled from the same sources for barebox, for the compile host and for the target, so the metadata information is available whereever needed. For device tree boards the model and of_compatible tags are automatically generated. Example output of the imd tool for a Phytec phyFLEX image: build: #889 Wed Jul 30 16:08:54 CEST 2014 release: 2014.07.0-00167-g6b2070d-dirty parameter: memsize=1024 of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * 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>