Commit graph

236 commits

Author SHA1 Message Date
Wadim Egorov
a687070664 board: phytec: common: k3: Apply SoM-specific overlays to OS device tree
Our SoMs are available in multiple configurations, managed via device
tree overlays. To determine the specific variant in use, we read the
EEPROM and apply the appropriate overlays during boot to the device tree
used by the OS.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Neha Malcom Francis <n-francis@ti.com>
2024-11-14 10:46:22 -06:00
Simon Glass
dac3ce976a board: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Ye Li
7872a986e5 imx9: clock: Update clock init function and sequence
Since we use SPEED GRADE fuse to set A55 frequency, remove the
set_arm_core_low_drive_clk function which has hard coded frequency.
And adjust clock_init called sequence and split it to early and late
functions.
Set the authen register in early function, because CCF driver checks
NS bit.
Set bus and core clock in late function, because the fuse read and
SoC type/rev depend on ELE.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-09-19 00:12:41 -03:00
Tom Rini
78d898eec0 Merge patch series "phycore-am62/4: Add more boot sources"
Daniel Schultz <d.schultz@phytec.de> says:

This patch stack extends the phyCORE-AM62x/AM64x U-Boot by following boot
sources:

  - Load U-Boot with USB DFU
  - Load a Linux and initramfs from OSPI/QSPI NOR flash
  - Load a Linux and rootfs from Network

Moreover, it adds required changes to the environment to boot an A/B
system with RAUC and includes some minor fixes.
2024-09-10 14:56:12 -06:00
Daniel Schultz
11b8fa0095 board: phytec: phycore_am64x: Add Network/SPI Boot
Include the boot logic to boot via Network or from a OSPI/QSPI
NOR flash. Moreover, set all required variables to both boot
methods to the environment.

Note: The phyBOARD-Electra AM64x is not able to load the U-Boot
via Network. However, it's still possible to load the kernel.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-09-10 13:16:01 -06:00
Daniel Schultz
a48cbaeecb board: phytec: phycore_am62x: Add Network/SPI Boot
Include the boot logic to boot via Network or from a OSPI/QSPI
NOR flash. Moreover, set all required variables to both boot
methods to the environment.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-09-10 13:16:01 -06:00
Benjamin Hahn
8412acec95 board: phytec: phycore_imx8mp: Add mtd spi partitions
Depending on if a SPI-NOR flash is populated add the mtd partition
table to the device tree. For this we have to also probe the
flash before booting.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
2024-08-30 15:50:36 -03:00
Yashwanth Varakala
f0f5ab50c2 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>
2024-08-23 14:53:07 -03:00
Daniel Schultz
f1296bfff7 board: phytec: phycore_am64x: Use k3_mmc.env logic
Use our common environment file to implement MMC boot.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-22 13:47:57 -06:00
Daniel Schultz
ed9a91fd51 board: phytec: phycore_am62x: Use k3_mmc.env logic
Use our common environment file to implement MMC boot.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-22 13:47:57 -06:00
Benjamin Hahn
1189bf61cf board: phytec: renaming of variables according to bootstd doc
Rename existing environment variables according to the bootstd doc.
Renamed variables are fdto_addr, bootenv_addr, fdt_addr and
fdt_file.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-22 13:47:57 -06:00
Benjamin Hahn
95ab7372f1 phycore_imx93: include common overlays.env
Include the common overlays env file for phycore_imx93.
The common overlays env file supports disabling loading overlays by
setting the no_overlays variable.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-22 13:47:57 -06:00
Benjamin Hahn
0ff9141fb8 phycore-imx8mp: Add overlay and bootenv.txt support
Add support for loading bootenv.txt as well as loading and applying
overlays during boot from mmc and net.

${no_bootenv}: Prevent loading external bootenv.txt environment. Use
	       ${overlays} variable directly from u-boot environment.
${no_overlay}: Do not load overlays defined in ${overlays} variable.
	       Overlays loaded over the extension command are still
	       being applied.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-22 13:47:57 -06:00
Tom Rini
61fac5dffa Merge patch series "configs: phycore_am62x_a53: Add more commands" 2024-07-16 12:56:46 -06:00
Daniel Schultz
65a4fa7316 board: phytec: phycore_am64x: Move earlycon into own variable
By moving the earlycon definition into a dedicated variable, it's
easier to change these values in case the kernel should print on
a different serial interface.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-07-16 12:56:36 -06:00
Daniel Schultz
7081b388a7 board: phytec: phycore_am62x: Move earlycon into own variable
By moving the earlycon definition into a dedicated variable, it's
easier to change these values in case the kernel should print on
a different serial interface.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-07-16 12:56:36 -06:00
Dominik Haller
9945a30e2e board: phytec: k3: k3_ddrss_patch: Add ddr phy reg count
Add and use the correct number of ddr phy registers to update the
corresponding settings.

Fixes: cbf5c99ef3 ("board: phytec: common: Introduce a method to inject DDR timings deltas")
Signed-off-by: Dominik Haller <d.haller@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2024-07-10 13:36:22 -06:00
Wadim Egorov
680fcbcf55 board: phytec: phycore-am62x: Use memory nodes in higher boot stages
There is no need to reread the EEPROM multiple times in different stages
to detect the RAM size. We can do this once at an early stage and let
higher stages decode memory nodes using fdtdec.
Make sure to pass fixup memory nodes before passing to u-boot stage.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
2024-06-18 10:29:00 -06:00
Wadim Egorov
623c337c34 board: phytec: phycore-am62x: Pull in k3_dfu.env
Pull in ti/k3_dfu.env for dfu_alt_info_ram in SPL stage.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
2024-06-18 10:29:00 -06:00
Wadim Egorov
aca776e6dc board: phytec: phycore-am62x: Fix CONFIG_SPL_BOARD_INIT
Make sure spl_board_init() gets compiled by enabling missing
CONFIG_SPL_BOARD_INIT and including hardware.h.

Fixes: 085cd6459d ("board: phytec: am62x: Add PHYTEC phyCORE-AM62x SoM")

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
2024-06-18 10:28:59 -06:00
Wadim Egorov
e9c4448f80 board: phytec: common: k3: Copy fixed partitions to OS device tree
Copy fixed-partitions nodes from U-Boot device tree to OS device tree.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
2024-06-18 10:28:59 -06:00
Tom Rini
0329779bfb Merge patch series "*** phyCORE-AM62x: DDR detection / Inject DDR timing deltas ***"
Wadim Egorov <w.egorov@phytec.de> says:

Changes in v2:
  - Reabse to current next
  - Add Tested-by: John Ma <jma@phytec.com>
  - Add Kconfig option to select RAM size statically
  - Make board/phytec/common/k3 always compile for CONFIG_ARCH_K3

v1: https://lists.denx.de/pipermail/u-boot/2024-May/553057.html
2024-06-07 14:03:36 -06:00
Wadim Egorov
0be402375d board: phytec: am62x: Add support for 1 & 4 GB RAM variants
Use content of EEPROM to detect the actual RAM size and adjust
DDR timings, size and banks accordingly.
Also enable the SoM detection per default in the defconfigs.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
2024-06-07 14:02:26 -06:00
Wadim Egorov
cbf5c99ef3 board: phytec: common: Introduce a method to inject DDR timings deltas
Introduce fdt_apply_ddrss_timings_patch() to allow board code to
override DDR settings in the device tree prior to DDRSS driver probing.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
2024-06-07 14:02:26 -06:00
Wadim Egorov
161acbdfb0 board: phytec: Fix function definitions in AM6x SOM detection
Functions are declared as phytec_am6* and not phytec_am62*.
Update the definitions to match the declarations.

Fixes: 9d152c2327 ("board: phytec: Add SOM detection for AM6x")

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
2024-06-07 14:02:26 -06:00
Wadim Egorov
12f09c19b7 board: phytec: Make AM6 SoM detection depend on I2C
SoM detection is using I2C driver model functions.
Let's depend on I2C.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
2024-06-07 14:02:26 -06:00
Tom Rini
9fa98591d7 Merge patch series "PHYTEC SOM Detection API v3"
Daniel Schultz <d.schultz@phytec.de> says:

This patch series adds support for the EEPROM v3 API.

V3 is backwards compatible to V2 and therefore, the V2 image still
exists at the beginning. Only the API version changed from 2 to 3.

V3 is a block-based memory layout organized as singled-linked list
with different types of blocks. This is a more flexible approach and
allows us to extend it by more block types in the future.

The V3 data starts with a 8-byte large header which defines the
block count (u8), V3 subversion (u8) and data payload length (u16).
Additionally the header contains a CRC8 checksum a 3 reserved bytes.

Each block starts with a 4-byte large header which defined the
block type (u8), the absolute address of the next block (u16) and a
CRC8 checksum. The content itself is defined via the block type and
we currently have 2 different types:

1) MAC: Contains the Ethernet interface number (u8), MAC address
        (6 x u8) and a CRC8 checksum.
2024-06-07 14:02:02 -06:00
Daniel Schultz
946ae83246 board: phytec: common: k3: Set MAC
Read the EEPROM API v3 content and set all available
MAC-Addresses to the environment.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2024-06-07 14:01:53 -06:00
Daniel Schultz
b100c2458a board: phytec: common: Add API v3
This API is based on a block structure with a 8 Byte large
API v3 header and various of different blocks following. It extends
our current API v2, which is always 32 Byte large, and is located
directly after v2.

Add the MAC block as first block type. It contains the physical
Ehternet interface number, a MAC address and a CRC checksum over the
MAC payload.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2024-06-07 14:01:53 -06:00
Daniel Schultz
2c3afb76d7 board: phytec: common: Move API v2 init to new function
Move the entire initialization code for API v2 into a dedicated
function. This rework will allow to easily integrate the API v3
as next step during init.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2024-06-07 14:01:53 -06:00
Daniel Schultz
38b96407f6 board: phytec: common: Define PHYTEC_API2_DATA_LEN
The EEPROM image length for API v2 is fixed to 32 bytes. No need
to use sizeof while this value won't change. This value is
also be required for API v3 to know where the API v3 header starts.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2024-06-07 14:01:53 -06:00
Daniel Schultz
0329547377 board: phytec: common: Move eeprom read to new function
We need to read multiple times from different offsets in API v3.
Move the EEPROM read logic into a dedicated function to make it
usable multiple times.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
2024-06-07 14:01:53 -06:00
Benjamin Hahn
95cf918f16 board: phycore_imx8mp: enable setting 2GHz timings without RAM size
make it possible to set the RAM timing frequency statically independent
from the RAM size. Fixed RAM timing frequency can be used while the
RAM size is still determined by the EEPROM image.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:14:00 -03:00
Teresa Remmet
8869c2324d board: phytec: phycore_imx8mp: Make RAM size configuration fix
We might not be able to always rely on the EEPROM introspection data.
So add a config option alternative which configures the RAM size
to a fix value.

We still try to read the EEPROM introspection data at this point.
So we can print the SoM information if available.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:14:00 -03:00
Teresa Remmet
cff451e03f board: phytec: phycore_imx8mp: Add support for different RAM sizes
Add support for different RAM sizes and speed grades on the
phyCORE-i.MX8MP.
Add support for 1GB 1.5GHz, 1GB 2GHz, 4GB 1.5GHz,
4GB 2GHz and 8GB 2GHz RAM.
The RAM size and speed grade is detected by the information
stored in the EEPROM on the SoM.

Co-developed-by: Benjamin Hahn <B.Hahn@phytec.de>
Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
Co-developed-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Yannic Moog <y.moog@phytec.de>
Co-developed-by: Yashwanth Varakala <y.varakala@phytec.de>
Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:14:00 -03:00
Teresa Remmet
7d1895bd4b board: phytec: phycore-imx8mp: spl: Fix syle issue
Use tabs instead of spaces.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:14:00 -03:00
Yannic Moog
518c40dfa0 arm: imx8mp-phycore: move to OF_UPSTREAM
The PHYCORE_IMX8MP is used by the phyBOARD-Pollux. Migrate board to
OF_UPSTREAM. Linux kernel device tree for the board can be used as is,
corresponding U-Boot device tree files are removed. U-Boot tweaks are
kept unchanged.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:13:41 -03:00
Yannic Moog
c16aa668fd arm: imx8mm-phycore: move to OF_UPSTREAM
The PHYCORE_IMX8MM is used by the phyBOARD-Polis and the
phyGATE-Tauri-L. Migrate both boards to OF_UPSTREAM. Linux kernel device
trees for both boards can be used as is, corresponding U-Boot device
tree files are removed. U-Boot tweaks are kept unchanged.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
2024-06-03 12:13:41 -03:00
Tom Rini
03de305ec4 Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
As part of bringing the master branch back in to next, we need to allow
for all of these changes to exist here.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-20 13:35:03 -06:00
Tom Rini
d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d, reversing
changes made to 2ee6f3a5f7.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00
Tom Rini
f842a7a2c0 Merge patch series "*** Commonize board code for K3 based SoMs ***"
Wadim Egorov <w.egorov@phytec.de> says:

Factor out code that we can reuse across all our K3 based SoMs.
2nd patch of this series require patch [1] to be applied first.

[1] https://lists.denx.de/pipermail/u-boot/2024-April/552021.html
2024-05-10 11:33:00 -06:00
Wadim Egorov
0b30b28ba3 board: phytec: Commonize board code for K3 based SoMs
Environment handling code can be reused across all our K3 based SoMs.
Instead of adding the same code for every new SoM, move it to a common
board.c file.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2024-05-10 10:42:22 -06:00
Tom Rini
9ac776b27c board: phytec: Remove <common.h> and add needed includes
Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07 08:00:25 -06:00
Tom Rini
0fc85aa34d global: Audit usage of <eeprom.h>
The file include/eeprom.h is used only in some legacy non-DM I2C EEPROM
access cases. Remove most inclusions of this file as they are not
needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06 15:07:48 -06:00
Tom Rini
ff0de1f055 Merge patch series "Update PHYTEC SOM Detection"
Daniel Schultz <d.schultz@phytec.de> says:

This patch series extends PHYTEC's SOM detection by minor
fixes, a generic helper function and a new valid flag.

Moreover, it adds a module to provide access to the SOM
detection for our TI AM6 products.
2024-04-29 10:56:05 -06:00
Daniel Schultz
9d152c2327 board: phytec: Add SOM detection for AM6x
Add all functions to read each SOM option from the EEPROM
image and detect whether it's the correct product for this
image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
2024-04-29 10:55:58 -06:00
Daniel Schultz
e8fc2effda board: phytec: common: Fix eepom is empty check
The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
2024-04-29 10:55:58 -06:00
Yannic Moog
1e5de690f3 board: phytec: check eeprom_data validity
For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
2024-04-29 10:55:57 -06:00
Yannic Moog
8fe6e9a00f board: phytec: introduce eeprom struct member 'valid'
Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
2024-04-29 10:55:57 -06:00
Daniel Schultz
f1c6f5797f board: phytec: common: Generic "add extension" function
Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
2024-04-29 10:55:57 -06:00