summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/zynqmp'HEADmasterSascha Hauer6 days10-13/+545
|\
| * firmware-zynqmp: add device parameters for ggs/pggsAhmad Fatoum6 days1-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZynqMP features eight 32-bit global storage registers that are available for general use. Four of them have their values preserved after software reboots and four are cleared on software reboots. In Linux they are accessed as: /sys/firmware/zynqmp/ggs[0-4] /sys/firmware/zynqmp/pggs[0-4] Allow reading and writing these parameters from barebox shell as well via device parameters: echo ${firmware:zynqmp-firmware.of.ggs0} firmware:zynqmp-firmware.of.pggs0=4 Because the name is a bit unwieldy, use the recently added device alias support to make the variables more compact: echo ${zynqmp_fw.ggs0} zynqmp_fw.pggs0=4 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913132456.2211919-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware-zynqmp: export functions for setting GGS/PGGSAhmad Fatoum6 days2-3/+96
| | | | | | | | | | | | | | | | | | | | | | | | The ZynqMP features eight 32-bit global storage registers that are available for general use. Four of them have their values preserved after software reboots and four are cleared on software reboots. Import the Linux API used to read and write these registers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913132456.2211919-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: add support for device aliasesAhmad Fatoum6 days3-8/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device names can get quite long, which makes them cumbersome to use on the shell, e.g. firmware:zynqmp-firmware:clock-controller.of. In addition, the names are prone to change when the device tree nodes are renamed. One way we work around this is using aliases, but that is partially at odds with upstream binding. This commit adds an alternative way of allowing drivers and board code to set an alias that affects only device_param_complete. This provides an easy way of defining device names that should be stable for use in shell scripts. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913132456.2211919-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * watchdog: add Cadence watchdog support for Xilinx SoCsAhmad Fatoum2023-09-143-0/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Cadence watchdog IP available in Zynq-7000 and ZynqMP SoCs. The driver has been ported from Linux v6.4 and tested on the ZynqMP. Keep in mind that changes to the XSA may be necessary for the watchdog to actually be able to reset the system. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913120807.1869600-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: implement clk_get_enabled helperAhmad Fatoum2023-09-141-0/+31
| | | | | | | | | | | | | | | | | | | | Kernel code increasingly uses devm_clk_get_enabled to make driver code more compact. Port a devres-less version to barebox to make porting such Linux code easier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913120807.1869600-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: Zynqmp: define cdns_serial_putc for use with pbl_set_putcAhmad Fatoum2023-09-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Unlike other debug_ll headers, such as i.MX's or AT91, the ZynqMP header only defined PUTC_LL, but no function suitable for use with pbl_set_putc. Remedy that, so PBL entry points can benefit from CONFIG_PBL_CONSOLE. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913120157.1859226-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer6 days7-2/+2526
|\ \
| * | ARM: stm32mp: phycore: register barebox update handlersAhmad Fatoum2023-09-041-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have barebox update handlers for updating barebox on SD (ssbl GPT partition) and on eMMC boot partition (with or without TF-A). Let's put them to use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230825120736.1508084-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Add driver for NAND controller on STM32MP SoCsAlexander Shiyan2023-09-043-0/+1367
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for NAND controller on STM32MP SoCs. The original source is taken from linux-6.4. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20230830104747.43193-2-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memory: Add driver for FMC2 External Bus Interface on STM32MP SoCsAlexander Shiyan2023-09-043-0/+1148
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for FMC2 External Bus Interface on STM32MP SoCs. The original source is taken from linux-6.4. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20230830104747.43193-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/regulator'Sascha Hauer6 days4-160/+254
|\ \ \
| * | | regulator: replace _internal suffix by _rdevSascha Hauer11 days1-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename functions to better align with the Linux Kernel. Link: https://lore.barebox.org/20230920121708.2818143-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: print regulator treeSascha Hauer11 days1-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regulators have a tree structure, so print them as a tree to show the users their dependencies. Link: https://lore.barebox.org/20230920103316.2758383-12-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: drop struct regulator_dev::supply_nameSascha Hauer11 days3-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The supply name can be set in struct regulator_desc, no need to have it in struct regulator_dev also, so drop it there. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-11-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: Set initial voltageSascha Hauer11 days1-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When voltage constraints are given in the device tree then we should set the regulator to a valid voltage before enabling it. Without it we can end up with invalid voltages. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-10-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: register regulator as last step in of_regulator_register()Sascha Hauer11 days1-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In of_regulator_register() call __regulator_register as last step after all fields have been initialized. This was not possible before as __regulator_register() returned the struct regulator_internal * which contained the remaining fields. Now that struct regulator_internal is gone we can restore the natural initialization order. Link: https://lore.barebox.org/20230920103316.2758383-9-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: stpmic1: add .supply_nameSascha Hauer11 days1-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add .supply_name to the regulator descriptors, otherwise the supplies are never enabled. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: stpmic1: add .get_voltage_selSascha Hauer11 days1-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get the current voltage from the regulators the .get_voltage_sel callback is needed. Initialize it to the correct function. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-7-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: Add missing cases in regulator_map_voltage()Sascha Hauer11 days1-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regulator_map_voltage() misses to handle some cases, sync this with the kernel. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: add regulator_get_voltage_internal()Sascha Hauer11 days1-25/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regulator_get_voltage() works on struct regulator * which may not always be available internally, so add a regulator_get_voltage_internal() and use it from regulator_get_voltage(). Link: https://lore.barebox.org/20230920103316.2758383-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: introduce regulator logging functions.Sascha Hauer11 days2-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_* functions only print the struct device * as context, but often a single struct device * implements multiple regulators. Add rdev_* logging functions which allow to to print one specific regulator as context. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: merge struct regulator_internal fields into struct regulator_devSascha Hauer11 days2-117/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each struct regulator_dev instance has a struct regulator_internal associated with it. The idea was that core internal fields are seen by the core only. In the end this is more confusing than helpful. We have a ri->rdev link, but no rdev->ri link so that we can't get a rdev from a ri pointer. We could add that link, but instead make the whole stuff a bit easier by just merging everything from struct regulator_internal to struct regulator_dev. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: rename variable rd to rdevSascha Hauer11 days1-16/+16
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | the struct regulator_dev * variable is mostly named 'rdev', but sometimes 'rd' is used. Rename to 'rdev' consistently. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920103316.2758383-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer6 days69-424/+1138
|\ \ \
| * | | digest: add digest_algo helperAhmad Fatoum9 days1-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code handling different digest types may want easy access to the digest algorithm currently in use. Add a simple inline helper for this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102446.1109545-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lib: rename json_strcpy to json_strdupAhmad Fatoum9 days3-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jsmn_strcpy is an unfortunate name for a function that allocates memory. Rename it to jsmn_strdup instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102426.1109289-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lib: jsmn: add case-insensitive comparisonAhmad Fatoum9 days2-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users may want to do a case-insensitive comparison of tokens. Add simple helpers for that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102426.1109289-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lib: jsmn: add helper for allocating tokensAhmad Fatoum9 days3-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jsmn_parse can be called with a NULL buffer to determine the needed allocation size beforehand. Most users will go on to dynamically allocate that buffer, so add a helper that does just that and start using it to simplify the json selftest. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102426.1109289-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lib: jsmn: add and use new jsmn_token_size helperAhmad Fatoum9 days2-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make code a bit more terse, add a simple helper to get a token's size and start using it in some of the existing jsmn helpers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102426.1109289-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | rsatoc: support generating standalone keys unreferenced by FIT keyringAhmad Fatoum9 days2-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, all keys generated by rsatoc and included into barebox, whether as C code or device tree snippets are added to the single key ring that's used for FIT image verification. Users may want to add other keys by the same means, but not have them available to FIT image verification. Support this use case by adding a -s option that generates standalone keys. These are unreferenced by the key ring and automatic DT parsing and expect the user to manually reference them, either via global variable with a symbol name equal __key_${hint} or by looking into /signature-standalone/key-${hint}. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102310.1108543-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | rsa: fix typos and missing type definitionsAhmad Fatoum9 days1-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Including <rsa.h> as first header shows some that some includes are missing and looking into the file, the kerneldoc comment is out of date. Fix both. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102310.1108543-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | rsatoc: support extracting RSA public key from X.509 SPKI formatAhmad Fatoum9 days1-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to PKCS#11 URIs, rsatoc supports extracting RSA public keys out of x.509 PEM certificats, which is a base64-encoded format that begins with the header `-----BEGIN CERTIFICATE-----'. Another popular format for RSA public keys is the X.509 SPKI format, which starts with the header `-----BEGIN PUBLIC KEY-----'. As public keys are the only thing rsatoc is interested in, add support for the latter as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102310.1108543-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | scripts: allow user to build rsatoc if COMPILE_HOST_TOOLSAhmad Fatoum9 days3-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rsatoc is automatically built if CONFIG_CRYPTO_RSA_BUILTIN_KEYS=y. For testing, it can be useful to build the tool standalone, so add an option to do just that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921102310.1108543-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: add linux/atomic.h headerAhmad Fatoum9 days1-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux code usually uses <linux/atomic.h>, so let's have the same in barebox, which just includes asm-generic/atomic.h. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921094354.265824-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: asm-generic/atomic.h: always define atomic/atomic_64Ahmad Fatoum9 days1-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64-bit accesses are always atomic in barebox, because we have nothing that would interrupt them. Thus define them unconditionally in the asm-generic header. This shows that an include for the s64 time is missing, so add that as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921094354.265824-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include: linux/spinlock: add stubs for Linux _bh variantsAhmad Fatoum9 days1-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For symmetry with existing empty spin_lock/unlock stubs, add _bh suffixed versions as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921094425.270359-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | console: implement of_console_by_stdout_path helperAhmad Fatoum9 days2-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Board code may want to get a handle on the standard console to disable or enable some of its stream. Add a helper function for that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921092539.4142293-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | startup: don't skip countdown if consoles were runtime enabledAhmad Fatoum9 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Systems with verified boot will disable at least console input by default, but when presented with an unlock token, they may elect to enable the console. Currently, the user needs to be really quick with ctrl+c to abort the boot on the active console, so let's make the system have a normal count down if a console has been activated by board code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230921092539.4142293-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: import Linux eth_addr_inc/dec/add helpersAhmad Fatoum9 days1-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux has a number of helpers to do arithmetic on Ethernet addresses, which are useful for generating sequential MAC addresses. Import them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230911155927.3786335-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: phy: dp83867: Sync with LinuxSascha Hauer10 days1-151/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the dp83867 phy driver to current Linux-6.5 for easier future updates. Link: https://lore.barebox.org/20230920112252.2782897-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: phy: Add phy_(set|clear)_bits_mmd()Sascha Hauer10 days1-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide phy_set_bits_mmd() and phy_clear_bits() for easier code adoption from the kernel. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230920112252.2782897-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | kbuild: support generating stripped ELF files for PBLAhmad Fatoum10 days2-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For testing remoteproc and ELF loading mechanisms, it can be useful to have the consumed ELF files result from the barebox build itself. The *.pblb intermediate artifacts can be used for this purpose, but they are at least 64K larger than need be, because of generous alignment in addition to debug and symbol information. Let's add a separate %.elf target, that behaves like %.pblb with the difference that the result is stripped and alignment of sections on-disk is disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913125715.2142524-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: add support for booting ELF executablesAhmad Fatoum10 days4-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike MIPS and kvx, where ELF is used as kernel image format, Linux ARM support defines its own flattened format. Other kernels may be distributed as ELF images though, so it makes sense to enable booting of ELF images on ARM as well. This has been tested booting FreeRTOS ELF executables on the ZynqMP. Note that this will refuse to boot kernel ELF images as those have type dyn, while the common ELF code in barebox will only boot type exec. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913125715.2142524-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | common: elf: support loading to address 0Ahmad Fatoum10 days1-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many platforms have DRAM starting at address 0, which clashes with barebox placing kernel images there, as barebox does that before shutting down and turning off the MMU. The <zero_page.h> header allows temporarily disabling the faulting zero page and is already used for boot other types of kernel images, so use it for ELF images as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913125715.2142524-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: zynqmp: defconfig: enable zcu106Ahmad Fatoum10 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multi_v8_defconfig already enabled all zcu boards, but zynqmp_defconfig didn't. Fix that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913130356.2160665-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: ZynqMP: Add ZCU102 supportAhmad Fatoum10 days12-2/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZCU102 is a potentially interesting platform, because there's Qemu support for it. It's not very straight forward to use, because the ZynqMP support in barebox and Linux relies heavily on firmware services, which are lacking when naively using Qemu. Still, let's add support now and worry about running it as part of the test suite later. Board support was not tested on actual hardware, but on Qemu with changes on top of barebox to skip the firmware communication. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913130150.2159921-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: stm32mp: don't generate .img symlinks for .stm32 binariesAhmad Fatoum10 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .img extension for stm32mp1 images has been unfortunate. The format was deprecated and finally removed in TF-A v2.8 in favor of the FIP format. We won't remove support in barebox soon, but we shouldn't call these images *.img. Since commit 3536e3904152 ("ARM: stm32mp: change stm32image extension to .stm32") introduced with v2022.04.0, the .img files have been symlinks to regular files with a stm32 extension and this commit now finishes the job and deletes the .img symlinks. Users still using older TF-A versions should change their build system to use the same barebox image file, but with .stm32 extension. Users with new TF-A versions, should use the barebox-stm32mp-generic-bl33.img as non-trusted firmware in the FIP in addition to a matching device tree generated during the same barebox build. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230915130353.2217982-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: have clk_get always return -ENOENT on missing clockAhmad Fatoum10 days1-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, clk_get(dev, NULL) returns -ENOENT on missing clock, but clk_get(dev, "missing-named-clock") returns -EINVAL. This went by unnoticed so far as most consumers either require a clock or don't, but with the addition of clk_get_optional, it's important that clk_get() return value is uniform. Therefore align clk_get with Linux and always fall through to clk_get_sys() if getting clock over DT is not possible. Failing clk_get_sys() returns -ENOENT always, ensuring we can't end up with -EINVAL as before while keeping of_clk_get_by_name return value as it is under Linux. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230918170458.121957-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | test: self: add some test cases for test commandAhmad Fatoum2023-09-143-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the rework to how arithmetic comparisons are conducted in the test command, some tests are in order. Prior to the rework, following test cases failed: test_test_command:42: [ -1 -le 1 ]: assertion failure, ret=1 test_test_command:45: [ -9223372036854775808 -lt 9223372036854775807 ]: assertion failure, ret=1 test_test_command:46: [ -9223372036854775808 -gt 9223372036854775807 ]: assertion failure, ret=0 But now they all succeed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230913115958.1858470-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>