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.
- Migrate Atmel usb gadget to DM_USB_GADGET
- More small cleanups/improvements on the atmel UDC driver
- Change udc uclass name from "usb" -> "usb_gadget"
Tom Rini [Mon, 19 Aug 2024 22:15:47 +0000 (16:15 -0600)]
Merge patch series "clk: mediatek: mt7622: clk migration for OF_UPSTREAM"
Christian Marangi <ansuelsmth@gmail.com> says:
These are all the required patches to migrate clk and correctly support
OF_UPSTREAM. This will align the clk index to upstream to support the same
clk implementation with downstream and upstream DTS.
clk: mediatek: mt7622: add missing A1/2SYS clock ID
Add missing A1/2SYS clock ID just as a reference for OF_UPSTREAM
support. These clocks are not defined and are not usable as current
clock topckgen OPs doesn't support gates.
These special node won't ever be used by uboot hence just add them for
reference.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Tested-by: Frank Wunderlich <frank-w@public-files.de>
Add missing PERIBUS_SEL clock to match upstream linux clk ID order. Also
convert pericfg to mux + gate implementation as now we have also mux on
top of gates.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add missing clock PERI_UART4_PD for peri clock gates. This is needed to
match upstream linux clk ID in preparation for OF_UPSTREAM.
Also convert infracfg to mux + gate implementation as now we have mux on
top of gates.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tom Rini [Mon, 19 Aug 2024 22:15:13 +0000 (16:15 -0600)]
Merge patch series "clk: mediatek: mt7986: clk migration for OF_UPSTREAM"
Christian Marangi <ansuelsmth@gmail.com> says:
These are all the required patches to migrate clk and correctly support
OF_UPSTREAM. This will align the clk index to upstream to support the same
clk implementation with downstream and upstream DTS.
clk: mediatek: mt7986: comment out CK_TOP_A_TUNER as not used
Comment out CK_TOP_A_TUNER as not used and not defined in upstream
kernel linux. This is to permit support of OF_UPSTREAM and have a 1:1
match with upstream linux clock ID.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: drop 1/1 spurious factor for topckgen
Now that we can have advanced parent handling for mux, we can drop
spurious topckgen 1/1 factor. This is in preparation to make the clk
ID match the ID in upstream include for mt7986.
Drop the factor entry from mt7986-clk.h and reference to them in
mt7981.dtsi. Muxes and gates are updated to reference the apmixed clk
following how it's done in upstream kernel linux. Add relevant clk type
flag in clk_tree for apmixed.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reorder TOPCKGEN factor ID to put TOP_FACTOR first and then PLL. This is
to match how it's done in upstream kernel linux and in preparation for
OF_UPSTREAM support.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: rename TOPCKGEN factor clock to upstream naming
Rename TOPCKGEN factor clock to upstream neaming.
Upstream kernel linux reference the factor clock for apmixedpll with the
"pll" suffix. Align the naming to the upstream naming format in
preparation for OF_UPSTREAM support.
Also rename rtc clock to drop the CB_ as upstream doesn't have that.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: drop 1/1 infracfg spurious factor
Now that we can have advanced parent handling for mux, we can drop
spurious infracfg 1/1 factor. This is in preparation to make the clk
ID match the ID in upstream include for mt7986.
Drop the factor entry from mt7986-clk.h and reference to them in
mt7981.dtsi. Muxes and gates are updated to reference the topckgen clk
following how it's done in upstream kernel linux. Add relevant clk type
flag in clk_tree for infracfg and topckgen.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: fix wrong parent for INFRA_ADC_26M_CK
Fix wrong parent for INFRA_ADC_26M_CK as should be INFRA_ADC_FRC_CK
instead of INFRA_CK_F26M. This is to match implementation on upstream
kernel linux.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: rename 66M_MCK to SYSAXI_D2
Upstream kernel linux clock include use SYSAXI_D2 instead of 66M_MCK.
Rename this clock to the upstream kernel in preparation for support of
OF_UPSTREAM.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
clk: mediatek: mt7986: rename CB_CKSQ_40M to TOP_XTAL
Upstream kernel linux clock include use TOP_XTAL instead of CB_CKSQ_40M.
Rename this clock to the upstream kernel in preparation for support of
OF_UPSTREAM.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tom Rini [Mon, 19 Aug 2024 22:14:29 +0000 (16:14 -0600)]
Merge patch series "clk: mediatek: mt7988: clk migration for OF_UPSTREAM"
Christian Marangi <ansuelsmth@gmail.com> says:
These are all the required patches to migrate clk and correctly support
OF_UPSTREAM. This will align the clk index to upstream to support the same
clk implementation with downstream and upstream DTS.