summaryrefslogtreecommitdiffstats
path: root/include/asm-generic
Commit message (Collapse)AuthorAgeFilesLines
* lds: align RO_DATA_SECTION membersLucas Stach2019-12-201-0/+11
| | | | | | | | | | | | When using the RO_DATA_SECTION macro, all the individual components are put into the rodata section. As they now end up in the same section there is no alignment enforced between them anymore. This leads to unaligned start pointers when any of the components have a unaligned size. Enforce some alignment between them. Fixes: c5d38e920101 (lds: Add and use RO_DATA_SECTION macro) Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: zynq: move header generation to zynq_mkimageLucas Stach2019-11-111-2/+1
| | | | | | | | | | Instead of generating a suitable image header with linker magic, move all of this into zynq_mkimage. The configuration file format and parsing is based on imx-image. This gets us one step further on the road to proper multi-image support. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rsa: Allow to directly compile in rsa public keysSascha Hauer2019-10-151-0/+6
| | | | | | | | | | | | | So far we relied on the U-Boot mkimage tool to generate us device tree snippets containing rsa public keys which we then compiled into barebox. Make this easier and allow to directly specify a filename or PKCS#11 URI in Kconfig. With this we no longer need the U-Boot mkimage tool here and no more external steps to prepare device tree snippets. With this rsa public keys can be directly compiled as C structs into barebox which is much more direct than putting it into the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: Add and use RO_DATA_SECTION macroSascha Hauer2019-10-141-0/+11
| | | | | | | | | We have many different pointer arrays which we put into linker sections and each time there's one added we have to adjust all linker scripts. This adds a common RO_DATA_SECTION define and uses it for all architectures. This makes it easier to add a new linker array. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: remove more unnecessary alignmentsSascha Hauer2019-10-141-2/+0
| | | | | | | | The alignment in the DTB and clk_of_table shouldn't be needed. Remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sam Ravnborg <sam@ravnborg.org>
* lds: create and use BAREBOX_PCI_FIXUP macroSascha Hauer2019-10-141-0/+15
| | | | | | | No need to repeat the pci fixup sections in each linker script. Add a define for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: Move start/end address variables into definesSascha Hauer2019-10-141-12/+28
| | | | | | | | | | | For the older section defines we specify the start and end addresses outside the macro which means we have to repeat them in each linker script. Make the start/end addresses part of the define to simplify things. While at it, add a BAREBOX_ prefix to the INITCALLS and EXITCALLS macros for consistency to the other defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sam Ravnborg <sam@ravnborg.org>
* barebox.lds: Remove unnecessary bracesSascha Hauer2019-10-141-2/+2
| | | | | | | The BAREBOX_CLK_TABLE and BAREBOX_DTB macros are defines that do not take a parameter, so we can remove the braces. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sections: fix macro for barebox_pbl_sizeRouven Czerwinski2019-08-071-2/+2
| | | | | | | | | On ARM64 this did not contain the expected barebox_pbl size. Rework this to be a substraction between __piggydata_start and __image_start, which should cover the whole PBL. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Initial OP-TEE supportSascha Hauer2019-06-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This adds initial support for OP-TEE, see https://www.op-tee.org/ barebox starts in secure mode as usual. When booting a kernel the bootm code also loads the optee_os binary. Instead of jumping into the kernel barebox jumps into the optee_os binary and puts the kernel execution address into the lr register. OP-TEE then jumps into the kernel in nonsecure mode. The optee_os binary is passed with the -t option to bootm or with global.bootm.tee. Optionally OP-TEE can be compiled into barebox using the builtin firmware feature. Enable the Kconfig option and place or link your tee binary as optee.bin into the firmware directory. The amount of SDRAM which is kept free for OP-TEE is configurable. This patch was tested on a i.MX6 Nitrogen6x board. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ratp: implement generic command supportAleksander Morgado2018-03-011-0/+2
| | | | | | | | | | | | | | | | | | | The RATP implementation now allows executing generic commands with a binary interface: binary requests are received and binary responses are returned. Each command can define its own RATP request contents (e.g. to specify command-specific options) as well as its own RATP response contents (if any data is to be returned). Each command is associated with a pair of numeric unique request and response IDs, and for easy reference these IDs are maintained in the common ratp_bb header. Modules may override generic implemented commands or include their own new ones (as long as the numeric IDs introduced are unique). Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic: partially sync io.h with linux kernelOleksij Rempel2017-09-081-28/+217
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: start: Fix image size calculationSascha Hauer2017-02-081-1/+2
| | | | | | | | | | In barebox_non_pbl_start() we do not run at the address we are linked at, so we must read linker variables using ld_var(). Since ld_var() current is not available on arm64 we create two zero sized arrays, one at the begin of the image and one at the end. The difference between both is the image size we are looking for. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ubifs'Sascha Hauer2016-04-081-0/+260
|\
| * ARM: Add atomic.h from u-boot v2016.03Alexander Stein2016-04-081-0/+260
| | | | | | | | | | | | | | | | atomic-long.h: * Replace __UBOOT__ with __BAREBOX__ Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: remove unused imx-flash-header.hSascha Hauer2016-04-011-6/+1
|/ | | | | | | All i.MX images are nowadays built with the imx-image tool, so we do not need the header files and Kconfig options anymore. Remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: add RSA supportSascha Hauer2016-01-261-0/+5
| | | | | | | Taken from U-Boot and adopted to barebox with little changes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* gpio: Drop asm-generic/gpio.hSascha Hauer2015-08-201-9/+0
| | | | | | | | | | Since we no longer have custom gpio function prototypes we can drop the prototypes from asm-generic/gpio.h can add them to include/gpio.h instead. While at it add static inline dummy wrappers for !CONFIG_GENERIC_GPIO so that code using gpios can compile without gpio support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* exitcall: Add exitcall infrastructureHerve Codina2015-07-131-0/+9
| | | | | | | | 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>
* clk: of: fix clk_of_table generationSascha Hauer2015-06-111-1/+2
| | | | | | | | | | | | | | We used to collect all sections beginning with __clk_of_table_ in a single section in the linker using KEEP(*(.__clk_of_table_*)). That the sentinel entry ended up as the last entry was pure luck, but not always the case. Instead of putting all entries in different sections we now put all entries in the same section. Only the sentinel entry gets its own section and is collected by the linker separately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Andreas Willig <andreas.willig@rafi.de> Tested-by: Andreas Willig <andreas.willig@rafi.de>
* Merge branch 'for-next/posix_types'Sascha Hauer2015-06-093-23/+91
|\
| * introduce generic posix_types.hSascha Hauer2015-06-031-0/+90
| | | | | | | | | | | | | | | | | | Most types defined in posix_types.h are architecture independent, so instead of repeating this for each architecture add a generic file that can be used by architecture code. To use it an architecture must define BITS_PER_LONG properly in asm/bitsperlong.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drop __BITS_PER_LONGSascha Hauer2015-05-222-23/+1
| | | | | | | | | | | | | | | | | | The kernel has __BITS_PER_LONG and BITS_PER_LONG. The formaer is needed for architectures which support 32bit userspace on a 64bit kernel. This is not relevant for barebox, so drop __BITS_PER_LONG and use BITS_PER_LONG only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | startup: introduce postenvironment_initcallSascha Hauer2015-05-151-1/+3
|/ | | | | | | | To allow init code that depends on the environment being loaded. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* base: Introduce deferred probingSebastian Hesselbarth2015-04-171-0/+1
| | | | | | | | | As expected, we would need deferred probing sooner or later. This is a first approach to allow devices to return -EPROBE_DEFER and get sorted into a list of deferred devices that will be re-probed later. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: hmac: move register to hmacJean-Christophe PLAGNIOL-VILLARD2015-03-271-1/+2
| | | | | | | | | | As we will use the best sha algo at runtime Add a new init level crypto_initcall to ensure that all the sha present before hmac Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic/bug.h: move BUG(), BUG_ON(), WARN(), WARN_ON() macrosMasahiro Yamada2015-01-291-0/+37
| | | | | | | | In Linux, these macros are defined in include/asm-generic/bug.h. To tidy up common.h, move BUG(), BUG_ON(), WARN(), WARN_ON() there. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: move gpio_is_valid to include/gpio.hSascha Hauer2014-11-281-11/+0
| | | | | | | | No architectue implements its own gpio_is_valid() function, so move the only existing implementation to include/gpio.h where it's available for all users. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-08-071-0/+15
|\ | | | | | | | | Conflicts: lib/Makefile
| * include: update bitop functions from kernelSascha Hauer2014-07-171-0/+15
| | | | | | | | | | | | Updates the bitop functions from v3.16-rc4 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add support for metadata in barebox imagesSascha Hauer2014-08-071-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* asm-generic: add IO memory accessorsFranck Jullien2014-05-141-0/+12
| | | | | Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Load PBL into SRAMDavid Vincent2014-02-091-0/+13
| | | | | | | | | | This allows to load all the lowlevel init code, including the uncompressor, inside SRAM and not just the bare init part. This is useful when pbl is used as a first-stage bootloader but is loaded by an external firmware. Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic: add macro for BAREBOX_CLK_TABLESebastian Hesselbarth2013-11-111-1/+8
| | | | | | | | This adds a macro for linker scripts to place DT clock provider table. While at it, also add ALIGN(8) to DTB macro and fix a whitespace issue. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: update to v3.11-rc1Sascha Hauer2013-07-231-1/+3
| | | | | | | | | | | | | | | | | | This updates the NAND stuff to Linux-3.11-rc1. It is synchronized as best as we can get: - locks removed - The splitting in different files we had to better support different features has been dropped. Instead this is now done mostly with the use of __maybe_unused Some barebox adjustments are forward ported, like: - Allow partial page writes - Optionally allow to erase bad blocks - check for all_ff before writing a page Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Add image end sectionSascha Hauer2013-06-261-0/+1
| | | | | | | | | | | In the upcoming multi image build process we will cat images together. To find the concatenated image we need to reliably find the end of the current binary. This adds a dummy section at the end of a pbl binary. Its only purpose is to mark the end of the image. The multi image patches will add something to this section so that it doesn't get discarded by the linker. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: fix typosAntony Pavlov2013-05-121-1/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2013-04-041-1/+2
|\ | | | | | | | | Conflicts: arch/arm/Makefile
| * ARM: zynq: Add new architecture zynqSteffen Trumtrar2013-03-271-1/+2
| | | | | | | | | | | | | | | | | | Add basic support for the Xilinx Zynq-7000 EPP architecture. The Zynq-7000 is an embedded processing platform that combines a Cortex A9 dualcore MPSoC with an Artix-7 FPGA. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Makefile.lib: Add dtc supportSascha Hauer2013-03-121-0/+12
|/ | | | | | | | | Add rules to generate dtb files from dts/dtsi files, optionally run the source files through the preprocessor. Also add a rule to generate object files to include in the barbox binary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* generic memory layout: fix deps for [MALLOC|STACK]_BASESascha Hauer2013-02-041-4/+2
| | | | | | | | Defining STACK_BASE and MALLOC_BASE only makes sense when either CONFIG_MEMORY_LAYOUT_DEFAULT or CONFIG_MEMORY_LAYOUT_FIXED is set, so use separate #ifdefs instead ot #if/#else Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox-data: add barebox-data sectionsAlexander Aring2013-01-181-0/+1
| | | | | | | | Add barebox-data section in arm branch to get complete barebox regions in sdram regions tree. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: move gpio_is_valid to gpio.hJean-Christophe PLAGNIOL-VILLARD2012-10-301-0/+11
| | | | | | | gpio < 0 means invalid too Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: provide generic gpio headerJean-Christophe PLAGNIOL-VILLARD2012-10-051-0/+10
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Add compressed image supportJean-Christophe PLAGNIOL-VILLARD2012-08-031-0/+2
| | | | | | | | | | | | | | | | | | This allows for creating a lzo compressed binary unsing the pbl. Only copy the piggydata if needed. Add CONFIG_PBL_FORCE_PIGGYDATA_COPY option In some case we need to copy the PIGGYDATA as the link address as example we run from SRAM and shutdown the SDRAM/DDR for reconfiguration but most of the time we just need to copy the executable code. based on Sascha Hauer Add compressed image support Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Add pre-bootloader (pbl) image supportJean-Christophe PLAGNIOL-VILLARD2012-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | This allows for creating a pre-bootloader binary for - nand boot - mmc boot - compressed image The pbl will be incharge of the lowlevel init if needed. The barebox will skip it. Import string functions from linux 3.4 (arch/arm/boot/compressed/string.c) and implement a dummy panic. For now on introduce dummy zbarebox* targets and c code that will contain later the decompressor. This only implemeted on ARM. This patch is based on Sascha Hauer <s.hauer@pengutronix.de> Add compressed image support patch Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* ARM ep93xx: Get rid of special handling in linker fileSascha Hauer2012-07-231-1/+2
| | | | | | | | The ep93xx needs a special value at offset 0x1000. Rather than do special handling in the linker file add aa header section as done on i.MX. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: add initial i.MX6 supportSascha Hauer2012-04-241-1/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce barebox_bare_init_size to known the bare_init size and check itJean-Christophe PLAGNIOL-VILLARD2012-01-232-0/+18
| | | | | | | | | | | this allow to check we do not exceed the size of the SRAM as example introduce BAREBOX_MAX_BARE_INIT_SIZE the maximum size of bare_init this will allow your bare_init will fit in SRAM as example ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add magicvar commandSascha Hauer2011-11-291-0/+2
| | | | | | | The magicvar command gives an overview about all environment variables with a special meaning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>