mtd: nand: raw: omap_gpmc: Check return value of gpmc_nand_init
If the function is called with no NAND device attached, then this
function can return error value, proceeding further ignoring the same
can cause system crash. This is seen when "mtd list" is run with no NAND
addon cards connected.
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Acked-by: Roger Quadros <rogerq@kernel.org>
Sean Anderson [Fri, 16 Aug 2024 02:38:22 +0000 (22:38 -0400)]
sandbox: Fix pinmux warnings with non-test devicetrees
The sandbox pinmux driver is used in the non-test devicetree as well as
the test one. I didn't realize this when I modified the driver for
tests, and so broke the regular use case (which only resulted in
warnings). First, making the pinmux and the UART group available
pre-relocation to avoid ENODEV errors. Then, convert the pin groups and
functions to the new style, adding onewire group as well.
Fixes: 7f0f1806e3a ("test: pinmux: Add test for pin muxing") Closes: https://source.denx.de/u-boot/u-boot/-/issues/2 Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
A system may have multiple SATA controller. Removing the controller with
the lowest sequence number before probing all SATA controllers makes no
sense.
In sata_rescan we remove all block devices which are children of SATA
controllers. We also have to remove the bootdev devices as they will be
created when scanning for block devices.
After probing all SATA controllers we must scan for block devices otherwise
we end up without any SATA block device.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
pci: mediatek: add support for upstream split PCIe node
Add support for upstream linux split PCIe node.
Upstream linux have an alternative way to declare PCIe nodes that splits
them in dedicated nodes for each line instead of putting them all in one
node.
Detect this by checking if the mediatek,generic-pciecfg node is passed
as it's used to reference the common address for all the PCIe lines.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
remoteproc: uclass: Modify uc_pdata->name to use combination of device name and device's parent name
uc_pdata->name is populated from device tree property "remoteproc-name".
For those devcices that don't set "remoteproc-name", uc_pdata->name
falls back to dev->name.
If two devices have same name, this will result into uc_pdata->name not
being unique and rproc_init() will fail.
Fix this by using combination of dev->name and dev->parent->name instead
of using just the dev->name to populate uc_pdata->name.
Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Andrew Davis <afd@ti.com>
Upstream DTS added explicit ranges to the fss node. It did not include
the 32 bit memory space needed by the R5 to access OSPI. With the
upstream DTS sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, these patches can be removed.
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Simon Glass [Thu, 15 Aug 2024 20:30:22 +0000 (14:30 -0600)]
bootstd: Make bootdev_next_prio() continue after failure
When a device fails to probe, the next device should be tried, until
either we find a suitable device or run out of devices. A device
should never be tried twice.
When we run out of devices of a particular priority, the hunter should
be used to generate devices of the next priority. Only if all attempts
fail should this function return an error.
Update the function to use the latent 'found' boolean to determine
whether another loop iteration is warranted, rather than setting 'dev'
to NULL, which creates confusion, suggesting that no devices have been
scanned and the whole process is starting from the beginning.
Note that the upcoming bootflow_efi() test is used to test this
behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/17
Simon Glass [Thu, 15 Aug 2024 20:30:21 +0000 (14:30 -0600)]
Revert "bootdev: avoid infinite probe loop"
This turns out to be insufficient to fix the problem, since when
bootdev_next_prio() exits, the caller has no idea that this really
is the end. Nor is it, since there may be other devices which should
be checked.
The caller iterates which calls iter_incr() which calls
bootdev_next_prio() again, which finds the same device and the loop
continues.
We never did create a test for this[1], which makes it hard to be
sure which problem was fixed.
The original code had the virtue of staying in the loop looking for a
bootdev, so let's go back to that and try to fix this another way.
A future patch will make bootdev_next_prio() continue after failure
which should provide same effect.
arch: arm: dts: k3-j721e-r5-sk: Add missing fss range
Upstream DTS added explicit ranges to the fss node. It did not include the
32 bit memory space needed by the R5 to access OSPI. With the upstream DTS
sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See 0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
arch: arm: dts: k3-j721e-r5-evm: Add missing fss range
Upstream DTS added explicit ranges to the fss node. It did not include the
32 bit memory space needed by the R5 to access OSPI. With the upstream DTS
sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See 0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
arch: arm: dts: k3-j7200-r5-evm: Add missing fss range
Upstream DTS added explicit ranges to the fss node. It did not include the
32 bit memory space needed by the R5 to access OSPI. With the upstream DTS
sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See f00e626085 (arm64: dts: ti: k3-j7200: Use exact ranges for FSS node)
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com> Reviewed-by: Aniket Limaye <a-limaye@ti.com>
arch: arm: dts: k3-am69-r5-sk: Add missing fss range
Upstream DTS added explicit ranges to the fss node. It did not include the
32 bit memory space needed by the R5 to access OSPI. With the upstream DTS
sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
arch: arm: dts: k3-j784s4-r5-evm: Add missing fss range
Upstream DTS added explicit ranges to the fss node. It did not include the
32 bit memory space needed by the R5 to access OSPI. With the upstream DTS
sync, OSPI boot no longer works.
Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)
Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream") Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com> Reviewed-by: Andrew Davis <afd@ti.com>
Tom Rini [Tue, 27 Aug 2024 00:52:18 +0000 (18:52 -0600)]
Merge patch series "Tidy up console recording in tests"
Simon Glass <sjg@chromium.org> says:
This series started as a small fix for checking for an empty line,
but in the process several other problems were found and fixed:
- fix tests which use console recording but don't set the flag
- drop unnecessary resetting of the console in tests
- drop unnecessary blank line before MMC output
- update the docs a little
- fix buildman test failure on newer Pythons
- a few other minor things
This series also renames the confusing flag names, so that they are
easier to remember - just a UTF_ (unit-test flags) prefix.
Simon Glass [Thu, 22 Aug 2024 13:57:55 +0000 (07:57 -0600)]
test: fdt: Check internal-function return values
Some functions are using asserts but the result of the functions
themselves is not checked. This means that if a test fails, the result
is not noticed until later, which can be confusing to debug.
Simon Glass [Thu, 22 Aug 2024 13:57:52 +0000 (07:57 -0600)]
test: Update NAND test to avoid extra macros
Write out the tests in full to allow the test to be found more easily
when there is a failure. We could use a single test function with a
for() loop but this would stop at the first failure, and some variations
might while other pass.
Simon Glass [Thu, 22 Aug 2024 13:57:49 +0000 (07:57 -0600)]
test: Drop the blank line before test macros
Most tests don't have this. It helps to keep the test declaration
clearly associated with the function it relates to, rather than the next
one in the file. Remove the extra blank line and mention this in the
docs.
Simon Glass [Thu, 22 Aug 2024 13:57:47 +0000 (07:57 -0600)]
test: Fail when an empty line is expected but not present
The existing implementation of ut_assert_nextline_empty() cannot
distinguish between an empty line and no line at all. It can in fact be
called at the end of the recorded output and will happily return
success.
Adjust the logic so that this condition is detected. Show a failure
message in this case.
Fix the one test which falls foul of this fix.
Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 400175b0a7d ("test: Add a way to check each line of console...") Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tom Rini [Mon, 26 Aug 2024 20:06:16 +0000 (14:06 -0600)]
Merge patch series "global_data: Reduce size of struct global_data"
Simon Glass <sjg@chromium.org> says:
The global data structure has grown quite a lot over the years, being
the best place to put an important pointer or something that must be
accessed before and after relocation.
This series attempts to reduce the size a little, by moving some things
out and shrinking and aligning some fields.
Some fields are needed during init but not afterwards. To deal with this
a new 'boardf' structure is created, which sits on the stack and is only
present during board_init_f(). It is possible that more fields could
move to this struct, but for now only 4 are moved.
An assumption is made that an int is 32-bits wide on all architectures,
which seems to be true, but maintainers should be able to confirm.
Mostly the code-size impact is neutral, but the patch
'Use less space for environment fields' does increase U-Boot's size by
about 30 bytes on aarch64.
For firefly-rk3399 (64-bit) the size of global reduces from 456 to 368
bytes. For SPL it reduces from 416 to 272 bytes.
There are other things which could be attempted, for example:
- Using hlist instead of list for some lists
- Checking that only necessary fields are present in SPL
Simon Glass [Wed, 21 Aug 2024 16:19:26 +0000 (10:19 -0600)]
doc: Move generic-board documentation into rst
This information is useful for people looking at how U-Boot has changed
over the years and the design decisions which led to it. Move it into
doc/ in an 'historical' section.
Simon Glass [Fri, 23 Aug 2024 20:27:04 +0000 (14:27 -0600)]
global_data: Reduce size of early-malloc vars
The early malloc region is normally quite small and is certainly less
than 4GB, so use a 32-bit value for the limit and pointer. Update the
comments for clarity while we are here.
Simon Glass [Wed, 21 Aug 2024 16:19:16 +0000 (10:19 -0600)]
global_data: Reduce the size of mon_len
This is the length of the U-Boot binary, which is typically 200-800KB
and certainly not larger than 4GB. Use a 32-bit value to save space in
global_data and move it up to be with fields of the same alignment.
Simon Glass [Wed, 21 Aug 2024 16:19:09 +0000 (10:19 -0600)]
board_f: Add a new struct to hold pre-relocation info
Quite a few of the members of struct global_data are only used before
reloction, or have little meaning afterwards, yet they hang around in
struct global_data for the lifetime of U-Boot. This uses up precious
pre-relocation SRAM on many boards.
To help with this, start a new struct which exists only before
relocation. Move new_fdt into this new struct. Drop the display of it
in the 'bdinfo' command as it is probably not very useful.
Tom Rini [Fri, 16 Aug 2024 03:49:04 +0000 (21:49 -0600)]
test/boot: Make BOOTSTD tests depend on UT_BOOTSTD
While we have a symbol for controlling if we will be testing BOOTSTD or
not, and it depends on SANDBOX, we do not control the building of
test/boot/ content correctly. Guard the current bootstd tests with
a check for UT_BOOTSTD and leave the measurement test available.
Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
Simon Glass [Thu, 22 Aug 2024 13:55:02 +0000 (07:55 -0600)]
spl: Create a function to init spl_load_info
Rather than having every caller set this up individually, create a
common init function. This allows new fields to be added without the
risk of them being left uninited.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Simon Glass [Thu, 22 Aug 2024 13:55:00 +0000 (07:55 -0600)]
spl: mmc: Try to clean up raw-mode options
Make the raw-mode options depend on SPL_SYS_MMCSD_RAW_MODE in a more
direct way. This makes it easier to understand the options with
'make menuconfig'.
There are three different ways of specifying the offset:
- sector offset
- partition number
- partition type
So make these a choice, so it is more obvious what is going on.
Update existing boards to enable SPL_SYS_MMCSD_RAW_MODE where needed.
Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Thu, 22 Aug 2024 13:54:59 +0000 (07:54 -0600)]
spl: mmc: Adjust args of spl_mmc_find_device()
At present spl_mmc_load() is the only caller of this function, passing
it a boot_device, an index into the available MMC devices. Pass the
device number instead, since it is known by the caller and simplifies
the code.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Simon Glass [Thu, 22 Aug 2024 13:54:58 +0000 (07:54 -0600)]
spl: mmc: Handle error codes consistently
Use 'ret' as the return code, since it may not be an error and this is
the common name in U-Boot. Make sure to return the error code when
given, rather than transforming it into -1 (-EPERM).
Simon Glass [Thu, 22 Aug 2024 13:54:56 +0000 (07:54 -0600)]
log: Avoid including function names by default
Unless function names are requested, the logging system should not
compile these into the code. Adjust the macros to handle this.
This means that turning on function names at runtime won't work unless
CONFIG_LOGF_FUNC is enabled. We could perhaps split this into a
separate option if that is a problem.
Enable CONFIG_LOGF_FUNC logging for sandbox since the tests expect the
function names to be included. Fix up the pinmux test which checks a
logging statement.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Simon Glass [Thu, 22 Aug 2024 13:54:51 +0000 (07:54 -0600)]
spl: Correct use of CMD_BOOTI and CMD_BOOTZ
These should have a CONFIG_ prefix. Add it.
Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7a0d88076b9 ("Add in the ability to load and boot an uncompr...") Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
- Add BOOTAUX support for apalis and colibri imx8 boards.
- Cleanup tqma6 board by removing unneeded board code.
- Add support for booting from ecspi3 via bmode command on imx6.
- Add a script to ease updating flash.bin on imx8mm phytec board.
- Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC and
use USB SDPS as fallback option.
- Fix critical temperature on imx9.
- Add Cortex M and bootaux support for phycore-imx8mp.
Marek Vasut [Wed, 21 Aug 2024 21:01:16 +0000 (23:01 +0200)]
ARM: imx: Use USB SDPS as fallback option on Data Modul i.MX8M Plus eDM SBC
The Data Modul i.MX8M Plus eDM SBC does have USB gadget capable port
accessible via USB A-A cable plugged into the bottom USB 3.0 port.
Use USB SDPS as the fallback boot device, so USB SDPS loading can
be performed using e.g. uuu tool.