]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 months agolmb: do away with arch_lmb_reserve()
Sughosh Ganu [Mon, 26 Aug 2024 11:59:30 +0000 (17:29 +0530)]
lmb: do away with arch_lmb_reserve()

All of the current definitions of arch_lmb_reserve() are doing the
same thing -- reserve the region of memory occupied by U-Boot,
starting from the current stack address to the ram_top. Introduce a
function lmb_reserve_uboot_region() which does this, and do away with
the arch_lmb_reserve() function.

Instead of using the current value of stack pointer for starting the
reserved region, have a fixed value, considering the stack size config
value.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agoppc: lmb: move arch specific lmb reservations to arch_misc_init()
Sughosh Ganu [Mon, 26 Aug 2024 11:59:29 +0000 (17:29 +0530)]
ppc: lmb: move arch specific lmb reservations to arch_misc_init()

All the current function definitions of arch_lmb_reserve() are doing
the same thing -- reserve the U-Boot memory region. The powerpc(ppc)
architecture, in addition, is making some LMB reservations for the
bootm related image loading. Move these ppc specific reservations to
the arch_misc_init() function. This allows to move the U-Boot memory
region reservation to a different function, and remove
arch_lmb_reserve() in a subsequent commit.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agolmb: init: initialise the lmb data structures during board init
Sughosh Ganu [Mon, 26 Aug 2024 11:59:28 +0000 (17:29 +0530)]
lmb: init: initialise the lmb data structures during board init

The memory map maintained by the LMB module is now persistent and
global. This memory map is being maintained through the alloced list
structure which can be extended at runtime -- there is one list for
the available memory, and one for the used memory. Allocate and
initialise these lists during the board init.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: bootm: remove superfluous lmb stub functions
Sughosh Ganu [Mon, 26 Aug 2024 11:59:27 +0000 (17:29 +0530)]
lmb: bootm: remove superfluous lmb stub functions

Remove a couple of superfluous LMB stub functions, and instead put a
check for calling the lmb_reserve() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: remove lmb_init_and_reserve_range() function
Sughosh Ganu [Mon, 26 Aug 2024 11:59:26 +0000 (17:29 +0530)]
lmb: remove lmb_init_and_reserve_range() function

With the move to make the LMB allocations persistent and the common
memory regions being reserved during board init, there is no need for
an explicit reservation of a memory range. Remove the
lmb_init_and_reserve_range() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agolmb: remove the lmb_init_and_reserve() function
Sughosh Ganu [Mon, 26 Aug 2024 11:59:25 +0000 (17:29 +0530)]
lmb: remove the lmb_init_and_reserve() function

With the changes to make the LMB reservations persistent, the common
memory regions are being added during board init. Remove the
now superfluous lmb_init_and_reserve() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: reserve common areas during board init
Sughosh Ganu [Mon, 26 Aug 2024 11:59:24 +0000 (17:29 +0530)]
lmb: reserve common areas during board init

The LMB module provides API's for allocating and reserving chunks of
memory which is then typically used for things like loading images for
booting. Reserve the portion of memory that is occupied by the U-Boot
image itself, and other parts of memory that might have been marked as
reserved in the board's DTB. When executing in SPL, reserve the
sections that get relocated to the ram memory, the stack and
the global data structure and also the bss.

Mark these regions of memory with the LMB_NOOVERWRITE flag to indicate
that these regions cannot be re-requested or overwritten.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agolmb: introduce a function to add memory to the lmb memory map
Sughosh Ganu [Mon, 26 Aug 2024 11:59:23 +0000 (17:29 +0530)]
lmb: introduce a function to add memory to the lmb memory map

Introduce a function lmb_add_memory() to add available memory to the
LMB memory map. Call this function during board init once the LMB data
structures have been initialised.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agolmb: allow lmb module to be used in SPL
Sughosh Ganu [Mon, 26 Aug 2024 11:59:22 +0000 (17:29 +0530)]
lmb: allow lmb module to be used in SPL

With the introduction of separate config symbols for the SPL phase of
U-Boot, the condition checks need to be tweaked so that platforms that
enable the LMB module in SPL are also able to call the LMB API's. Use
the appropriate condition checks to achieve this.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: config: add lmb config symbols for SPL
Sughosh Ganu [Mon, 26 Aug 2024 11:59:21 +0000 (17:29 +0530)]
lmb: config: add lmb config symbols for SPL

Add separate config symbols for enabling the LMB module for the SPL
phase. The LMB module implementation now relies on alloced list data
structure which requires heap area to be present. Add specific config
symbol for the SPL phase of U-Boot so that this can be enabled on
platforms which support a heap in SPL.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: remove config symbols used for lmb region count
Sughosh Ganu [Mon, 26 Aug 2024 11:59:20 +0000 (17:29 +0530)]
lmb: remove config symbols used for lmb region count

The LMB memory maps are now being maintained through a couple of
alloced lists, one for the available(added) memory, and one for the
used memory. These lists are not static arrays but can be extended at
runtime. Remove the config symbols which were being used to define the
size of these lists with the earlier implementation of static arrays.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: allow for resizing lmb regions
Sughosh Ganu [Mon, 26 Aug 2024 11:59:19 +0000 (17:29 +0530)]
lmb: allow for resizing lmb regions

Allow for resizing of LMB regions if the region attributes match. The
current code returns a failure status on detecting an overlapping
address. This worked up until now since the LMB calls were not
persistent and global -- the LMB memory map was specific and private
to a given caller of the LMB API's.

With the change in the LMB code to make the LMB reservations
persistent, there needs to be a check on whether the memory region can
be resized, and then do it if so. To distinguish between memory that
cannot be resized, add a new flag, LMB_NOOVERWRITE. Reserving a region
of memory with this attribute would indicate that the region cannot be
resized.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
3 months agolmb: make LMB memory map persistent and global
Sughosh Ganu [Mon, 26 Aug 2024 11:59:18 +0000 (17:29 +0530)]
lmb: make LMB memory map persistent and global

The current LMB API's for allocating and reserving memory use a
per-caller based memory view. Memory allocated by a caller can then be
overwritten by another caller. Make these allocations and reservations
persistent using the alloced list data structure.

Two alloced lists are declared -- one for the available(free) memory,
and one for the used memory. Once full, the list can then be extended
at runtime.

[sjg: Use a stack to store pointer of lmb struct when running lmb tests]

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
[sjg: Optimise the logic to add a region in lmb_add_region_flags()]

3 months agolmb: use the BIT macro for lmb flags
Sughosh Ganu [Mon, 26 Aug 2024 11:59:17 +0000 (17:29 +0530)]
lmb: use the BIT macro for lmb flags

Use the BIT macro for assigning values to the LMB flags instead of
assigning random values to them.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolmb: staticize __lmb_alloc_base()
Sughosh Ganu [Mon, 26 Aug 2024 11:59:16 +0000 (17:29 +0530)]
lmb: staticize __lmb_alloc_base()

The __lmb_alloc_base() function is only called from within the lmb
module. Moreover, the lmb_alloc() and lmb_alloc_base() API's are good
enough for the allocation API calls. Make the __lmb_alloc_base()
function static.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agolmb: remove the unused lmb_is_reserved() function
Sughosh Ganu [Mon, 26 Aug 2024 11:59:15 +0000 (17:29 +0530)]
lmb: remove the unused lmb_is_reserved() function

The lmb_is_reserved() API is not used. There is another API,
lmb_is_reserved_flags() which can be used to check if a particular
memory region is reserved. Remove the unused API.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agoalist: add a helper to check if the list is full
Sughosh Ganu [Mon, 26 Aug 2024 11:59:14 +0000 (17:29 +0530)]
alist: add a helper to check if the list is full

Add a helper function to check if the alist is full. This can then be
used to extend the alist.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agoglobal_data: Drop fb_base
Simon Glass [Wed, 21 Aug 2024 16:19:03 +0000 (10:19 -0600)]
global_data: Drop fb_base

This value mirrors information recorded by driver model video drivers,
so can be removed to save space. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agovideo: Avoid setting global_data fb_base in video setup
Simon Glass [Wed, 21 Aug 2024 16:19:02 +0000 (10:19 -0600)]
video: Avoid setting global_data fb_base in video setup

This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agovideo: Avoid setting global_data fb_base from SPL handoff
Simon Glass [Wed, 21 Aug 2024 16:19:01 +0000 (10:19 -0600)]
video: Avoid setting global_data fb_base from SPL handoff

This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agozynqmp: Avoid setting the framebuffer address
Simon Glass [Wed, 21 Aug 2024 16:19:00 +0000 (10:19 -0600)]
zynqmp: Avoid setting the framebuffer address

This is handled by driver model so this driver should not be setting the
framebuffer address. Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoarm: ronetix: Avoid accessing global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:59 +0000 (10:18 -0600)]
arm: ronetix: Avoid accessing global_data fb_base

Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoarm: friendlyarm: Avoid accessing global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:58 +0000 (10:18 -0600)]
arm: friendlyarm: Avoid accessing global_data fb_base

Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agovideo: mxs: Avoid setting global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:57 +0000 (10:18 -0600)]
video: mxs: Avoid setting global_data fb_base

This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agovideo: mxc: Avoid setting global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:56 +0000 (10:18 -0600)]
video: mxc: Avoid setting global_data fb_base

This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agovideo: Add a function to obtain the framebuffer address
Simon Glass [Wed, 21 Aug 2024 16:18:55 +0000 (10:18 -0600)]
video: Add a function to obtain the framebuffer address

Add a new function which returns the framebuffer address of the first
video device. This will allow the global_data field top be dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agox86: Drop use of global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:54 +0000 (10:18 -0600)]
x86: Drop use of global_data fb_base

This value is set by not used on x86 so there is no point in setting it.
Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoglobal_data: Move pci_clk to m68k and powerpc
Simon Glass [Wed, 21 Aug 2024 16:18:53 +0000 (10:18 -0600)]
global_data: Move pci_clk to m68k and powerpc

Only m68k and powerpc use this field, so move it to the arch-specific
info, to reduce the size for other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoMerge patch series "test/overlay: Make this depend on SANDBOX"
Tom Rini [Fri, 23 Aug 2024 21:59:44 +0000 (15:59 -0600)]
Merge patch series "test/overlay: Make this depend on SANDBOX"

Tom Rini <trini@konsulko.com> says:

Update a few things so that CONFIG_UNIT_TEST will compile for more
hardware platforms.

3 months agotest/cmd: Move wget test to under a sandbox guard
Tom Rini [Fri, 16 Aug 2024 03:49:05 +0000 (21:49 -0600)]
test/cmd: Move wget test to under a sandbox guard

This test is sandbox-centric, so guard it so.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agotest/boot: Make BOOTSTD tests depend on UT_BOOTSTD
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>
3 months agotest/overlay: Make this depend on SANDBOX
Tom Rini [Fri, 16 Aug 2024 03:49:03 +0000 (21:49 -0600)]
test/overlay: Make this depend on SANDBOX

As the overlays are sandbox specific, mark the whole test as depending
on sandbox.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoMerge patch series "spl: mmc: Some tweaks for SPL, particularly with MMC"
Tom Rini [Fri, 23 Aug 2024 21:59:03 +0000 (15:59 -0600)]
Merge patch series "spl: mmc: Some tweaks for SPL, particularly with MMC"

Simon Glass <sjg@chromium.org> says:

This series includes various minor fixes and tweaks found when trying
to reduce the size of MMC code in SPL.

3 months agoblk: Correct comment for blk_get_devnum_by_uclass_idname()
Simon Glass [Thu, 22 Aug 2024 13:55:03 +0000 (07:55 -0600)]
blk: Correct comment for blk_get_devnum_by_uclass_idname()

Update the comment to match the function. Fix the indentation while we
are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agospl: Create a function to init spl_load_info
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>
3 months agospl: Use unified inline functions for spl_load_info
Simon Glass [Thu, 22 Aug 2024 13:55:01 +0000 (07:55 -0600)]
spl: Use unified inline functions for spl_load_info

Rather than declaring completely separate functions, put the code for
each case into the same function. This makes it easier to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agospl: mmc: Try to clean up raw-mode options
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>
3 months agospl: mmc: Adjust args of spl_mmc_find_device()
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>
3 months agospl: mmc: Handle error codes consistently
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).

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agospl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT
Simon Glass [Thu, 22 Aug 2024 13:54:57 +0000 (07:54 -0600)]
spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT

This check is not needed now, since printf() resolved to nothing if not
available. Drop the #ifdefs

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agolog: Avoid including function names by default
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>
3 months agommc: Use logging instead of pr_err()
Simon Glass [Thu, 22 Aug 2024 13:54:55 +0000 (07:54 -0600)]
mmc: Use logging instead of pr_err()

Use the log subsystem instead of dev, to avoid including function names
in the code.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Update 'enhanced size' to use hex since this is the U-Boot default and
more natural for the large numbers involved.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agommc: Use logging instead of printf()
Simon Glass [Thu, 22 Aug 2024 13:54:54 +0000 (07:54 -0600)]
mmc: Use logging instead of printf()

The code makes quite a few uses of __func__ which puts the function
name into the resulting SPL image. Use the log subsystem instead, to
reduce size.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Use lower-case hex for the status output in sdhci_transfer_data(), to
match sdhci_send_command()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agospl: Remove remaining #ifdef in spl_parse_image_header()
Simon Glass [Thu, 22 Aug 2024 13:54:53 +0000 (07:54 -0600)]
spl: Remove remaining #ifdef in spl_parse_image_header()

Define spl_set_header_raw_uboot() always so we can drop the last #ifdef
in this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agospl: Remove some #ifdefs in spl_parse_image_header()
Simon Glass [Thu, 22 Aug 2024 13:54:52 +0000 (07:54 -0600)]
spl: Remove some #ifdefs in spl_parse_image_header()

This function has a number of unnecessary #ifdefs so remove them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agospl: Correct use of CMD_BOOTI and CMD_BOOTZ
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>
3 months agorockchip: Move the default timer init to a common file
Simon Glass [Thu, 22 Aug 2024 13:54:50 +0000 (07:54 -0600)]
rockchip: Move the default timer init to a common file

Rather than repeating the same code in two files (SPL and TPL), move it
to a shared filed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agoMerge tag 'u-boot-imx-next-20240823' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 23 Aug 2024 21:00:29 +0000 (15:00 -0600)]
Merge tag 'u-boot-imx-next-20240823' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22098

- 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.

3 months agoARM: imx: Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Wed, 21 Aug 2024 21:03:33 +0000 (23:03 +0200)]
ARM: imx: Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC

Enable 'cat' command to print file from filesystem to stdout.
Enable 'xxd' command to hexdump file from filesystem to stdout.

Signed-off-by: Marek Vasut <marex@denx.de>
3 months agoARM: imx: Use USB SDPS as fallback option on Data Modul i.MX8M Plus eDM SBC
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.

Signed-off-by: Marek Vasut <marex@denx.de>
3 months agoconfigs: phycore-imx8mp_defconfig: Enabled bootaux command
Yashwanth Varakala [Tue, 20 Aug 2024 15:46:30 +0000 (17:46 +0200)]
configs: phycore-imx8mp_defconfig: Enabled bootaux command

To start the mcore binary from u-boot, bootaux command is
needed.

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
3 months agoboard: phytec: phycore_imx8mp: Add mcore support
Yashwanth Varakala [Tue, 20 Aug 2024 15:46:29 +0000 (17:46 +0200)]
board: phytec: phycore_imx8mp: Add mcore support

Added m7 core support in uboot for imx8mp by adding
the boot variable prepare_mcore.

Based on commit 0ed32cc8568a ("LF-6555 imx8m[m/n/p/q]_evk: add
bootargs to support mcore")

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
3 months agomx6: Expand bmode to support ecspi3 boot
Fabio Estevam [Sat, 17 Aug 2024 19:13:13 +0000 (16:13 -0300)]
mx6: Expand bmode to support ecspi3 boot

Currently, the bmode command only supports booting from ecspi1.

Expand it to also support booting from ecspi3.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 months agogw_ventana: Remove unneeded comments
Fabio Estevam [Fri, 16 Aug 2024 03:22:17 +0000 (00:22 -0300)]
gw_ventana: Remove unneeded comments

Remove several comments that do not apply anymore to
the current file content.

While at it, write 'PMIC' into a single line for consistency.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 months agotqma6_mba6: Remove UART board code
Fabio Estevam [Wed, 14 Aug 2024 18:28:45 +0000 (15:28 -0300)]
tqma6_mba6: Remove UART board code

With DM_SERIAL in place, there is no need to setup the UART pins
in the board code.

The UART pins are setup via devicetree, thanks to DM.

Remove the unneeded code.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 months agotqma6_mba6: Remove unused defines
Fabio Estevam [Wed, 14 Aug 2024 18:28:44 +0000 (15:28 -0300)]
tqma6_mba6: Remove unused defines

The PAD_CTRL definitions are not used anywhere.

Remove them to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 months agotqma6: Remove non-DM board code
Fabio Estevam [Wed, 14 Aug 2024 18:28:43 +0000 (15:28 -0300)]
tqma6: Remove non-DM board code

CONFIG_DM_MMC and CONFIG_DM_SPI are alway selected so the mmc
and spi board code can be safely removed.

Remove it to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 months agoimx: imx9: Set correct critical temperature
Primoz Fiser [Tue, 13 Aug 2024 12:12:17 +0000 (14:12 +0200)]
imx: imx9: Set correct critical temperature

Commit 3233349fa6e2 ("imx: imx9: fixup thermal trips from fuses")
wrongly set critical temperature to (maxc - 5) instead of maxc.

Fixes: 3233349fa6e2 ("imx: imx9: fixup thermal trips from fuses")
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
3 months agoconfig: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm
Lukasz Majewski [Fri, 9 Aug 2024 16:53:32 +0000 (18:53 +0200)]
config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

This command allows easy update on SD card or eMMC of the flash.bin
generated (with binman) during u-boot build.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Benjamin Hahn <B.Hahn@phytec.de>
Tested-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 months agocolibri-imx8x: enable i.MX specific SNVS configuration
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:20 +0000 (16:16 +0200)]
colibri-imx8x: enable i.MX specific SNVS configuration

commit 242d1cd69b9f ("imx8: Configure SNVS")
implemented IMX_SNVS_SEC_SC. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 months agocolibri-imx8x: enable i.MX specific BOOTAUX
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:19 +0000 (16:16 +0200)]
colibri-imx8x: enable i.MX specific BOOTAUX

commit e8cd1f60d964 ("imx: imx8: bootaux: Add i.MX8 M4 boot support")
implemented IMX_BOOTAUX. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 months agoapalis-imx8: enable i.MX specific BOOTAUX
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:18 +0000 (16:16 +0200)]
apalis-imx8: enable i.MX specific BOOTAUX

commit e8cd1f60d964 ("imx: imx8: bootaux: Add i.MX8 M4 boot support")
implemented IMX_BOOTAUX. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 months agoboard: apalis-imx8: add reset code
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:17 +0000 (16:16 +0200)]
board: apalis-imx8: add reset code

With commit 922d4504bcab ("imx: scu_api: update to version 1.16 and
add more APIs") added the reboot API.

Add the board code to use that.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
4 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsung...
Tom Rini [Thu, 22 Aug 2024 14:15:04 +0000 (08:15 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsung into next

4 months agoMerge tag 'u-boot-dfu-next-20240820' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 20 Aug 2024 14:08:52 +0000 (08:08 -0600)]
Merge tag 'u-boot-dfu-next-20240820' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-next-20240820

- 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"

4 months agousb: gadget: udc: Fix duplicate uclass name
Zixun LI [Fri, 2 Aug 2024 09:28:11 +0000 (11:28 +0200)]
usb: gadget: udc: Fix duplicate uclass name

Currently both USB host uclass and USB gadget uclass are using the same
name "usb" which break uclass functions like uclass_get_by_name().

Rename the uclass to "usb_gadget" to fix, also makes bind/unbind by class
index (or sequence) working.

This breaks the capacity of using "usb" as DT alias sequence numbering
which needs a fix afterwards.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/all/20240802092820.917450-1-admin@hifiphile.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoMerge tag 'v2024.10-rc3' into next
Tom Rini [Tue, 20 Aug 2024 00:24:58 +0000 (18:24 -0600)]
Merge tag 'v2024.10-rc3' into next

Prepare v2024.10-rc3

4 months agoPrepare v2024.10-rc3
Tom Rini [Mon, 19 Aug 2024 23:15:10 +0000 (17:15 -0600)]
Prepare v2024.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "clk: mediatek: mt7622: clk migration for OF_UPSTREAM"
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.

4 months agoclk: mediatek: mt7622: add missing A1/2SYS clock ID
Christian Marangi [Sat, 3 Aug 2024 08:43:26 +0000 (10:43 +0200)]
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>
4 months agoclk: mediatek: mt7622: add missing clock PERIBUS_SEL clock
Christian Marangi [Sat, 3 Aug 2024 08:43:25 +0000 (10:43 +0200)]
clk: mediatek: mt7622: add missing clock PERIBUS_SEL clock

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>
4 months agoclk: mediatek: mt7622: add missing clock PERI_UART4_PD
Christian Marangi [Sat, 3 Aug 2024 08:43:24 +0000 (10:43 +0200)]
clk: mediatek: mt7622: add missing clock PERI_UART4_PD

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>
4 months agoclk: mediatek: mt7622: add missing clock MUX1_SEL
Christian Marangi [Sat, 3 Aug 2024 08:43:23 +0000 (10:43 +0200)]
clk: mediatek: mt7622: add missing clock MUX1_SEL

Add missing infra clock MUX1_SEL needed for CPU clock. This is needed to
match the upstream clk ID order in preparation for OF_UPSTREAM.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7622: add missing clock define for MAIN_CORE_EN
Christian Marangi [Sat, 3 Aug 2024 08:43:22 +0000 (10:43 +0200)]
clk: mediatek: mt7622: add missing clock define for MAIN_CORE_EN

Add missing clock for MAIN_CORE_EN. This is a special clock as it's a
gate for the APMIXED clocks required as a parent for CPU clocks.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7622: move INFRA_TRNG to the bottom
Christian Marangi [Sat, 3 Aug 2024 08:43:21 +0000 (10:43 +0200)]
clk: mediatek: mt7622: move INFRA_TRNG to the bottom

Move INFRA_TRNG clock to the bottom of the clk ID to match upstream
linux order. This is in preparation of OF_UPSTREAM.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7622: rename AUDIO_AWB3 to AUDIO_AWB2
Christian Marangi [Sat, 3 Aug 2024 08:43:20 +0000 (10:43 +0200)]
clk: mediatek: mt7622: rename AUDIO_AWB3 to AUDIO_AWB2

Rename AUDIO_AWB3 to AUDIO_AWB2 to match upstream linux naming in
preparation for OF_UPSTREAM support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7622: fix broken peri_cgs clk with XTAL parents
Christian Marangi [Sat, 3 Aug 2024 08:43:19 +0000 (10:43 +0200)]
clk: mediatek: mt7622: fix broken peri_cgs clk with XTAL parents

Fix broken peri_cgs clock with XTAL parents as they have wrong
definition of the parent type.

Correctly fix them and use CLK_PARENT_XTAL for them.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoMerge patch series "clk: mediatek: mt7986: clk migration for OF_UPSTREAM"
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.

4 months agoclk: mediatek: mt7986: rename CK to CLK
Christian Marangi [Sat, 3 Aug 2024 08:40:48 +0000 (10:40 +0200)]
clk: mediatek: mt7986: rename CK to CLK

Rename each entry from CK to CLK to match the include in upstream kernel
linux.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
4 months agoclk: mediatek: mt7986: convert to unified infracfg gates + muxes
Christian Marangi [Sat, 3 Aug 2024 08:40:47 +0000 (10:40 +0200)]
clk: mediatek: mt7986: convert to unified infracfg gates + muxes

Convert to infracfg gates + muxes implementation now that it's
supported.

Drop infracfg-ao nodes and rename all infracfg-ao clocks to infracfg.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7986: replace infracfg ID with upstream linux
Christian Marangi [Sat, 3 Aug 2024 08:40:46 +0000 (10:40 +0200)]
clk: mediatek: mt7986: replace infracfg ID with upstream linux

Replace infracfg clk ID with upstream linux version.

The same format is used here with the factor first, then mux and then
gates.

To correctly reference the gates in clk_gate function, define the
gates_offs value in clk_tree now that they are at an offset from mux and
factor.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7986: move INFRA_TRNG_CK to the bottom of the list
Christian Marangi [Sat, 3 Aug 2024 08:40:45 +0000 (10:40 +0200)]
clk: mediatek: mt7986: move INFRA_TRNG_CK to the bottom of the list

Move INFRA_TRNG_CK to the bottom of the list to have a 1:1 match with
upstream linux clock ID.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7986: comment out CK_TOP_A_TUNER as not used
Christian Marangi [Sat, 3 Aug 2024 08:40:44 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: drop 1/1 spurious factor for topckgen
Christian Marangi [Sat, 3 Aug 2024 08:40:43 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: reorder TOPCKGEN factor ID
Christian Marangi [Sat, 3 Aug 2024 08:40:42 +0000 (10:40 +0200)]
clk: mediatek: mt7986: reorder TOPCKGEN factor ID

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>
4 months agoclk: mediatek: mt7986: rename TOPCKGEN factor clock to upstream naming
Christian Marangi [Sat, 3 Aug 2024 08:40:41 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: fix typo for infra_i2c0_ck
Christian Marangi [Sat, 3 Aug 2024 08:40:40 +0000 (10:40 +0200)]
clk: mediatek: mt7986: fix typo for infra_i2c0_ck

Fix a typo for infra_i2c0_ck where 0 was misspelled as O.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7986: add missing entry for IPCIE_PIPE_CK infra gate
Christian Marangi [Sat, 3 Aug 2024 08:40:39 +0000 (10:40 +0200)]
clk: mediatek: mt7986: add missing entry for IPCIE_PIPE_CK infra gate

Add missing entry for IPCIE_PIPE_CK infra gate clock. Renumber the clock
order to match the expected offset in the gate array.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7986: drop 1/1 infracfg spurious factor
Christian Marangi [Sat, 3 Aug 2024 08:40:38 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: fix wrong parent for INFRA_ADC_26M_CK
Christian Marangi [Sat, 3 Aug 2024 08:40:37 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: rename 66M_MCK to SYSAXI_D2
Christian Marangi [Sat, 3 Aug 2024 08:40:36 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: rename CB_CKSQ_40M to TOP_XTAL
Christian Marangi [Sat, 3 Aug 2024 08:40:35 +0000 (10:40 +0200)]
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>
4 months agoclk: mediatek: mt7986: fix wrong shift for PCIe clocks
Christian Marangi [Sat, 3 Aug 2024 08:40:34 +0000 (10:40 +0200)]
clk: mediatek: mt7986: fix wrong shift for PCIe clocks

Fix wrong shift for PCIe clocks. This cause the PCIe port to malfunction
as the gate clocks weren't correctly enabled.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoMerge patch series "clk: mediatek: mt7988: clk migration for OF_UPSTREAM"
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.

4 months agoclk: mediatek: mt7988: rename CK to CLK
Christian Marangi [Sat, 3 Aug 2024 08:33:02 +0000 (10:33 +0200)]
clk: mediatek: mt7988: rename CK to CLK

Rename each entry from CK to CLK to match the include in upstream kernel
linux.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
4 months agoclk: mediatek: mt7988: convert to unified infracfg gates + muxes
Christian Marangi [Sat, 3 Aug 2024 08:33:01 +0000 (10:33 +0200)]
clk: mediatek: mt7988: convert to unified infracfg gates + muxes

Convert to infracfg gates + muxes implementation now that it's
supported.

Drop infracfg-ao nodes and rename all infracfg-ao clocks to infracfg.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7988: replace clock ID with upstream linux
Christian Marangi [Sat, 3 Aug 2024 08:33:00 +0000 (10:33 +0200)]
clk: mediatek: mt7988: replace clock ID with upstream linux

Replace infracfg clk ID with upstream linux version.

The same format is used here with the factor first, then mux and then
gates.

To correctly reference the gates in clk_gate function, define the
gates_offs value in clk_tree now that they are at an offset from mux and
factor.

Drop any comment that reference the clock ID as we now have a 1:1 match
with upstream kernel linux.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7988: comment out infracfg clk not defined
Christian Marangi [Sat, 3 Aug 2024 08:32:59 +0000 (10:32 +0200)]
clk: mediatek: mt7988: comment out infracfg clk not defined

Comment out infracfg clk not defined in upstream kernel linux clock ID
include. These clock are not used and can be safely commented. Keep them
just to have a reference of their existence.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7988: drop 1/1 spurious factor for topckgen
Christian Marangi [Sat, 3 Aug 2024 08:32:58 +0000 (10:32 +0200)]
clk: mediatek: mt7988: 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 mt7988.

Drop the factor entry from mt7988-clk.h and reference to them in
mt7988.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 and topckgen.

Also move TOP_XTAL to the fixed clock table following how it's done in
upstream linux kernel.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: mt7988: reorder TOPCKGEN factor ID
Christian Marangi [Sat, 3 Aug 2024 08:32:57 +0000 (10:32 +0200)]
clk: mediatek: mt7988: reorder TOPCKGEN factor ID

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>