summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ARM: dts: meson-sm1: add U-Boot specific DT for graphicsNeil Armstrong2019-10-185-3/+10
| | | | | | | | Rename meson-g12a-u-boot.dtsi into meson-g12-common-u-boot.dtsi to match the new DT architecture and add meson-sm1-sei610-u-boot.dtsi to handle the U-Boot specific DT for graphics. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* configs: sei510: enable everything-else power domainNeil Armstrong2019-10-181-1/+1
| | | | | | | The GX VPU Power Domain driver has been replaced by the Everything-Else Power Domain driver for G12A and SM1. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* power: domain: add Amlogic Everything-Else power domain driverNeil Armstrong2019-10-183-0/+438
| | | | | | | | | | Based on the 54ecb8f7028c ("Linux 5.4-rc1") Everything-Else power domain driver for Amlogic SoCs. This driver handles the VPU Power domain and other domains from the Everything-Else part of the SM1 and G12A SoCs. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* ARM: dts: Import SEI610 DT from Linux 5.4-rc2Neil Armstrong2019-10-184-1/+550
| | | | | | | | Import the Amlogic SM1 DT and the SEI610 board DT from [1] [1] da0c9ea146cb ("Linux 5.4-rc2") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* clk: meson-sm1: add compatibleNeil Armstrong2019-10-181-0/+1
| | | | | | | The SM1 clock controller is almost identical to the G12A and so far the differences don't matter. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* mmc: meson-gx: add support for mmc-pwrseq-emmcNeil Armstrong2019-10-181-0/+51
| | | | | | | Add support for mmc-pwrseq-emmc in the meson-gx mmc driver to support enabling the eMMC. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* ARM: meson: add SM1 SoC idNeil Armstrong2019-10-181-0/+2
| | | | | | Add the missing IDs to detect the SM1 S905X3 SoC. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* arm: meson: Recognize A311D SoCAndreas Färber2019-10-181-0/+1
| | | | | | | | | | Values imported from Linux driver, but in correct numeric order. Khadas VIM3 prints: Amlogic Meson G12B (A311D) Revision 29:b (10:2) Cc: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* arm: meson: Tidy SoC information outputAndreas Färber2019-10-181-1/+1
| | | | | | | | Write SoC instead of Soc. The Linux driver is not affected. Fixes: f41d723b9f ("ARM: meson: display Amlogic SoC Information") Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* configs: Add Khadas VIM3 defconfigAndreas Färber2019-10-183-0/+187
| | | | | | | | Derived from odroid-n2_defconfig and README.odroid-n2. Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* arm: dts: Import and update DT for Khadas VIM3Andreas Färber2019-10-1813-2382/+3516
| | | | | | | | | | In Linux meson-g12-common.dtsi was introduced as well as new g12b nodes and headers, as dependencies of new meson-g12b-a311d-khadas-vim3.dts. Copied from da0c9ea146cb ("Linux 5.4-rc2") Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* configs: sei510: enable Video Display supportNeil Armstrong2019-10-182-0/+23
| | | | | | | | | Add the necessary config options to support BMP display over HDMI, and add a preboot command to load the BMP file from a predefined eMMC partition. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* ARM: dts: meson-g12a: add U-Boot specific DT for graphicsNeil Armstrong2019-10-184-0/+50
| | | | | | | | Like the meson-gx support, add the U-Boot specific bits in DT to support graphics on G12A SoCs. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* arm: meson: board-g12a: Setup VPU in fdtNeil Armstrong2019-10-181-0/+5
| | | | | | | | | | | If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer. Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for EFI, and sets up simple-framebuffer nodes if simplefb support is enabled. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* video: meson: add compatible for Amlogic G12ANeil Armstrong2019-10-181-0/+1
| | | | | | | Finally add the Amlogic G12A SoC compatible for the VPU driver. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* video: meson: sync with linux drm-misc treeNeil Armstrong2019-10-187-160/+930
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synchronize the Amlogic Meson Video driver back with the latest DRM misc tree, adding G12A platform support, from the latest commit: 528a25d040bc ("drm: meson: use match data to detect vpu compatibility") The sync includes the following changes from Linux adapted to U-Boot: - Add support for VIC alternate timings - Switch PLL to 5.94GHz base for 297Mhz pixel clock - Add registers for G12A SoC - Add G12A Support for VPP setup - Add G12A Support for VIU setup - Add G12A support for OSD1 Plane - Add G12A support for plane handling in CRTC driver - Add G12A support for CVBS Encoder - Add G12A Video Clock setup - Add G12A support for the DW-HDMI Glue - fix G12A HDMI PLL settings for 4K60 1000/1001 variations - fix primary plane disabling - fix G12A primary plane disabling - mask value when writing bits relaxed - crtc: drv: vpp: viu: venc: use proper macros instead of magic constants - global clean-up - add macro used to enable HDMI PLL - venc: set the correct macrovision max amplitude value Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* video: meson: remove power domain getNeil Armstrong2019-10-181-10/+0
| | | | | | | | Remove getting and enabling the node power domain since it's now handled by the dm core directly. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* clk: meson: g12a: add support for VPU/HDMI clocksNeil Armstrong2019-10-181-17/+603
| | | | | | | | Add necessary clock support to set up clock for the VPU and HDMI support. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* power: domain: meson-gx-pwrc: add G12A supportNeil Armstrong2019-10-181-10/+145
| | | | | | | | Add Amlogic G12A support for the gx-pwrc driver, aligned on the Linux v5.2 driver. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* board: amlogic: document alternative libretech-cc installation methodsDaniel Drake2019-10-181-4/+37
| | | | | | | | | | | | | | | As already documented in this README, several binaries must be glued together in order to boot the device. Extend the documentation to cover the prebuilt binaries (saving you the hassle of installing ancient cross-compilers), and also mention the open source replacements for the encryption tool (which is especially useful if you want to avoid requiring 32-bit x86 binaries in your build system). Signed-off-by: Daniel Drake <drake@endlessm.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* Merge tag 'for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-ubiTom Rini2019-10-1711-10/+135
|\ | | | | | | | | | | | | ubi enhancements for 2020.01 - provide a way for skipping crc checks ported from linux, and add an U-Boot command to set this flag on already installed systems. - fix redundand environment management
| * ubi: env: fix redundand managementPhilippe Reynes2019-10-162-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We check (with a #if defined()) the config ENV_UBI_VOLUME_REDUND to know if there is a redundant env. But this config is a string and is always defined with env is in ubi, so we always consider that a redundand env is used. To fix this issue, I've added a hidden flag ENV_UBI_IS_VOLUME_REDUND that is true when ENV_UBI_VOLUME_REDUND is not "". Then, I check this flag in the code, instead of the string ENV_UBI_VOLUME_REDUND. hs: fixed typo s/condider/consider Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Heiko Schocher <hs@denx.de>
| * ubi: Add "skipcheck" command to set/clear this bit in the UBI volume hdrStefan Roese2019-10-162-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot now supports the "skip_check" flag to optionally skip the CRC check at open time. Currently its only possible to set this bit upon UBI volume creation. But it might be very useful to also set this bit on already installed systems (e.g. field upgrade) to make also use of the boot-time decrease on those systems. This patch now adds a new "ubi" command "ubi skipcheck" to set or clear this bit in the UBI volume header: => ubi skipcheck rootfs0 on Setting skip_check on volume rootfs0 BTW: This saves approx. 10 seconds Linux bootup time on a MT7688 based target with 128MiB of SPI NAND. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Cc: Quentin Schulz <quentin.schulz@bootlin.com> Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Heiko Schocher <hs@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com>
| * ubi: Print skip_check in ubi_dump_vol_info()Stefan Roese2019-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It might be interesting, if "skip_check" is set or not, so lets print this flag in ubi_dump_vol_info() as well. hs: fix typo in commit message Signed-off-by: Stefan Roese <sr@denx.de> Cc: Quentin Schulz <quentin.schulz@bootlin.com> Cc: Boris Brezillon <boris.brezillon@bootlin.com> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
| * ubi: provide a way to skip CRC checksQuentin Schulz2019-10-167-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users of static UBI volumes implement their own integrity check, thus making the volume CRC check done at open time useless. For instance, this is the case when one use the ubiblock + dm-verity + squashfs combination, where dm-verity already checks integrity of the block device but this time at the block granularity instead of verifying the whole volume. Skipping this test drastically improves the boot-time. Adapted to U-Boot by Stefan Roese. Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Cc: Quentin Schulz <quentin.schulz@bootlin.com> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
* | Merge tag 'dm-pull-15oct19' of ↵Tom Rini2019-10-1698-275/+1290
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-dm binman enhancements: - Dropping some test Elf files and building them from source instead - Refactoring of x86 16-bit entries - Support for SPL symbols within sections - Handle the 'notes' sections and hidden symbols in recent binutils - Improved error reporting with a tool fails libfdt and documentation fixes vboot required-key test driver model power-domain controls patman Message-Id enhancement
| * | sandbox: fix build error due to missing struct udevice definitionAKASHI Takahiro2019-10-151-0/+2
| | | | | | | | | | | | | | | | | | | | | Without this patch, compiling may potentially fail. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: Tidy up dump output when there are many devicesPatrick Delaunay2019-10-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the 'Index' column of 'dm tree' assumes there is two digits, this patch increase it to 3 digits. It also aligns output of 'dm uclass', assuming the same 3 digits index. The boards with CONFIG_PINCTRL_FULL activated have one pinconfig by pin configuration, so they can have more than 100 devices pinconfig (for example with stm32mp157c-ev1 board we have 106 pinconfig node). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: pinctrl: introduce PINCONF_RECURSIVE optionPatrick Delaunay2019-10-152-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Linux pinctrl binding, the pin configuration nodes don't need to be direct children of the pin controller device (may be grandchildren for example). This behavior is managed with the pinconfig u-class which recursively bind all the sub-node of the pin controller. But for some binding (when pin configuration is only children of pin controller) that is not necessary. U-Boot can save memory and reduce the number of pinconf instance when this feature is deactivated (for arch stm32mp for example for SPL). This patch allows to control this feature with a new option CONFIG_PINCONF_RECURSIVE when it is possible for each individual pin controller device. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Fixed CONFIG_IF_ENABLED() condition, added __maybe_unused: Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: core: device: switch off power domain after device removalAnatolij Gustschin2019-10-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The power domain associated with a device is enabled when probing, but currently the domain remains enabled when the device is removed. Some boards started to disable power domains for selected devices via custom board_quiesce_devices(), but it doesn't work in many cases, i. e. because devices still can be accessed later in .remove() callback on behalf of dm_remove_devices_flags(). Utilize the DM core to power off the device power domain, but add a device flag to be able to selectively let the power domain enabled after device removal. This might be required for devices that must remain enabled when booting OS, i. e. serial console for debug output, etc. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | power: domain: Introduce dev_power_domain_offLokesh Vutla2019-10-152-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | Add dev_power_domain_off() api to disable all the power-domains corresponding to a device Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | remoteproc: k3_arm64: Enable DM_FLAG_DEFAULT_PD_CTRL_OFFLokesh Vutla2019-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Enable DM_FLAG_DEFAULT_PD_CTRL_OFF for arm64 remote core so that pd can be enabled after loading the image. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: core: Allow for not controlling the power-domain by DM frameworkLokesh Vutla2019-10-152-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some remoteproc cases, enabling the power domain of the core will start running the core. In such cases image should be loaded before enabling the power domain. But the current DM framework enables the power-domain by default during probe. This is causing the remotecore to start and crash as there is no valid image loaded. In order to avoid this introduce a DM flag that doesn't allow for enabling/disabling the power-domain by DM framework. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: device: Fix typo in the non-DEVRES version of devm_kmalloc_array()Jean-Jacques Hiblot2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | When DEVRES is not set, devm_kmalloc_array() is spelled devm_kmaloc_array() (with one 'l' only). Fixing it so that the name is the same with and without DEVRES. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | patman: Use the Change-Id, version, and prefix in the Message-IdDouglas Anderson2019-10-154-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the centithread on ksummit-discuss [1], there are folks who feel that if a Change-Id is present in a developer's local commit that said Change-Id could be interesting to include in upstream posts. Specifically if two commits are posted with the same Change-Id there's a reasonable chance that they are either the same commit or a newer version of the same commit. Specifically this is because that's how gerrit has trained people to work. There is much angst about Change-Id in upstream Linux, but one thing that seems safe and non-controversial is to include the Change-Id as part of the string of crud that makes up a Message-Id. Let's give that a try. In theory (if there is enough adoption) this could help a tool more reliably find various versions of a commit. This actually might work pretty well for U-Boot where (I believe) quite a number of developers use patman, so there could be critical mass (assuming that enough of these people also use a git hook that adds Change-Id to their commits). I was able to find this git hook by searching for "gerrit change id git hook" in my favorite search engine. In theory one could imagine something like this could be integrated into other tools, possibly even git-send-email. Getting it into patman seems like a sane first step, though. NOTE: this patch is being posted using a patman containing this patch, so you should be able to see the Message-Id of this patch and see that it contains my local Change-Id, which ends in 2b9 if you want to check. [1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2019-August/006739.html Signed-off-by: Douglas Anderson <dianders@chromium.org>
| * | cmd: aes: use map_sysmem when accessing memoryPhilippe Reynes2019-10-151-4/+10
| | | | | | | | | | | | | | | | | | | | | The aes command used to segfault when accessing memory in sandbox. The pointer accesses should be mapped. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * | sandbox64: enable command aesPhilippe Reynes2019-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | This commit add the support of command aes. Then, it may be used on pytest. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * | sandbox: enable command aesPhilippe Reynes2019-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | This commit enable the command aes on sandbox. Then, it may be used on pytest. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * | libfdt: fix typo on commentGiulio Benetti2019-10-151-1/+1
| | | | | | | | | | | | Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
| * | rsa: Return immediately if required-key verification failsDaniele Alessandrelli2019-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if image verification with a required key fails, rsa_verify() code tries to find another key to verify the FIT image. This however, is not the intended behavior as the documentation says that required keys "must be verified for the image / configuration to be considered valid". This patch fixes the issue by making rsa_verify() return immediately if the verification of a required key fails. Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
| * | pytest: vboot: add a test for required keyPhilippe Reynes2019-10-152-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | This commit add a test in the vboot test to check that when a required key is asked, only FIT signed with this key is used/accepted by u-boot. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * | dm: pinctrl: Skip not associated gpio phandle and rise a warning messageMichael Trimarchi2019-10-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skip not associated gpio phandle let register the other gpios on a group. We need anyway to send out a warning to the user to fix their uboot-board.dtsi. Thhe handle id can be found inside the decompiled dtb dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | core: device: use dev_power_domain_onPeng Fan2019-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | When multiple power domains attached to a device, need power on them all, so use dev_power_domain_on to do that. Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | power: domain: add dev_power_domain_onPeng Fan2019-10-152-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add this new API to power on multiple domains attached to a device. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Changed to static inline and added a condition into C file: Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: spi: Do not assume first SPI busThomas Fitzsimmons2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed before device_bind_common assigned request numbers sequentially in the absence of aliases. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org>
| * | dm: device: Request next sequence numberThomas Fitzsimmons2019-10-152-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a given device, use the next request number for that type of device. This allows aliases to be used when they're available, while still allowing unaliased devices to be probed. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org>
| * | tpm2: Don't assume active low reset valueKayla Theil2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The reset function sets the pin to 0 then 1 but if the pin is marked ACTIVE_LOW in the DT it gets inverted and leaves the TPM in reset. Let the gpio driver take care of the reset polarity. Signed-off-by: Kayla Theil <kayla.theil@mixed-mode.de>
| * | dm: Fix default address cells return valueMatthias Brugger2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Default address cells value on the livetree access function returns the wrong value. Fix this so that the value returned corresponds to the device tree specification. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
| * | libfdt: Allow #size-cells of 0Matthias Brugger2019-10-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit "libfdt: fdt_address_cells() and fdt_size_cells()" introduced a bug as it consolidated code between the helpers for getting be 0, and is frequently found so in practice for /cpus. IEEE1275 only requires implementations to handle 1..4 for #address-cells, although one could make a case for #address-cells == #size-cells == 0 being used to represent a bridge with a single port. While we're there, it's not totally obvious that the existing implicit cast of a u32 to int will give the correct results according to strict C, although it does work in practice. Straighten that up to cast only after we've made our range checks. This is based on upstream commit: b8d6eca ("libfdt: Allow #size-cells of 0") but misses the test cases,as we don't implement them in U-Boot. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
| * | libfdt: return correct value if #size-cells property is not presentMatthias Brugger2019-10-152-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the device tree specification, the default value for was not present. This patch also makes fdt_address_cells() and fdt_size_cells() conform to the behaviour documented in libfdt.h. The defaults are only returned if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error is returned. This is based on upstream commit: aa7254d ("libfdt: return correct value if #size-cells property is not present") but misses the test case part, as we don't implement them in U-Boot. Signed-off-by: Matthias Brugger <mbrugger@suse.com>