Commit Graph

70450 Commits

Author SHA1 Message Date
Vignesh Raghavendra 2de57d278b arm: dts: k3-am625-sk: Add sysreset controller node
Add a sysreset controller node as a child of the DMSC node to enable
the "reset" command from U-Boot prompt for the AM625 SK.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-05-13 12:42:05 -05:00
Vignesh Raghavendra a381786ac3 arm: dts: k3-am62-main: Add Enable BCDMA for R5 SPL
Since commit 75acccd29c ("soc: ti: k3-navss-ringacc: Initialize base
address of ring cfg registers") and commit 8dc8661ec1 ("dma: ti: k3-udma:
Add support for native configuration of chan/flow")' additional register
ranges are required for UDMA and ring drivers. This adds additional register
ranges and TIFS phandle to re enable BCDMA to probe in order for enable
OSPI mem to mem DMA

Without this OSPI boot is broken.

Fixes: 75acccd29c ("soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers")
Fixes: 8dc8661ec1 ("dma: ti: k3-udma: Add support for native configuration of chan/flow")'
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-05-13 11:25:09 -05:00
Vignesh Raghavendra f9cc42ee4b firmware: ti_sci_static_data: Make defines board agnostic
These reserved ranges can be reused across boards hence switch to SOC
specific configs instead of board/EVM specific ones.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-05-12 12:22:34 -05:00
Vignesh Raghavendra 99b91e76b2 firmware: ti_sci_static_data: Add BCDMA channel ranges for R5
Add BCDMA reserved channel ranges for R5 to enable DMA on OSPI

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-05-12 12:22:34 -05:00
Guillaume La Roque 0bc8bdbc4e include: configs: am62x_evm: add android bootflow support
Add android boot flow support for AM62X board based on misc partition
to detect reboot reason and boot.img version 2 from android build
system.

Move on distrocmd and keep both boot (linux and android).
To move on android boot flow just launch 'set_android_boot' command

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
Guillaume La Roque 55e731982a configs: am62x_evm_a53: remove bootcmd from defconfig
remove bootcmd from defconfig to use distrocmd from config file

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
David Anderson a6a7bd8883 common: android_ab: do not attempt to round-robin bootable slots.
This feature does not quite fit within the A/B flow.

The intent of A/B is to provide an automatic rollback option for broken
OTAs. Once an OTA has been applied, the slot may not boot for a number
of reasons (power loss, broken package, etc), and it is important to
make consistent attempts to boot to the new slot rather than find *a*
bootable slot (otherwise, the update may not take).

Note that once a slot has been marked bootable, encryption keys are
upgraded, and old slots will not work. Trying to rotate between slots
is not likely to succeed.

Note that Android ensures that the active slot always has the
highest priority. In the current u-boot implementation, this affords no
possibility of rollback.

To match the expected A/B flow, this patch makes the following changes:
 - When initializing the BCB, set the "_a" slot to have the highest
   priority.
 - Pick the highest priority slot that has been marked successful OR has
   boot tries remaining.
 - If no such slot exists, the system is not bootable.

Link: https://android-review.googlesource.com/c/platform/external/u-boot/+/1446442
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
David Anderson b7ab6e41f8 cmd: ab_select: Don't count boot-to-recovery as a boot attempt.
The slot rollback system is intended for normal boot failures after an
OTA, and therefore, we should not attempt to change slots based on a
failure to boot to recovery (or any other non-normal boot sequence).

Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Link: https://android-review.googlesource.com/c/platform/external/u-boot/+/1446441
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
Guillaume La Roque 71d043d5a8 include: configs: am62x_evm: fix android boot image loading
Increase SYS_BOOTM_LEN to 64MB for fixing error when we use boot
image Aandroid.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
Nicolas Frayer 0951e915e1 configs: am62x_evm_a53: add android support
enable Android commands and fastboot support

Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-05-12 11:49:16 -05:00
Aswath Govindraju 70c33dd821 configs: am62x_evm_a53_defconfig: Enable configs required to add support for UHS modes
Enable the configs required to add support for UHS modes in U-Boot and A53
SPL. Also, reorder the configs using savedefconfig.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-05-05 14:09:34 -05:00
Aswath Govindraju 22247f725f arm: dts: k3-am625-sk-u-boot: Add u-boot tag to dt nodes for enabling UHS speed modes in SPL
For enabling UHS speed modes in SPL, the following devices are required to
be enabled

-> voltage regulators
-> main_i2c1 and gpio expander connected to it
-> main_gpio0

Therefore, add u-boot,dm-spl tags in all the above mentioned dt nodes.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-05-05 14:09:34 -05:00
Aswath Govindraju b68bb3e911 configs: am62x_evm_r5: Fix the SPL_SIZE_LIMIT check configs
CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD, CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK and
CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC reserve memory from the
CONFIG_SPL_SIZE_LIMIT assuming that all of them are placed together in the
same SRAM. However, in case of AM62; stack, global data and malloc are
placed in the PSRAM and and not HSM SRAM. Therefore, remove the
corresponding configs.

Also, update the CONFIG_SPL_SIZE_LIMIT to match the maximum image size that
can be loaded by ROM, as it now only indicates the size of SPL image.

Given below is the Layout of the SRAMs in R5 SPL stage before relocation to
DDR.

          HSM SRAM (256KB)   PSRAM (64KB)
0x43c00000┌───────────────┐ ┌──────────────┐0x70000000
          │               │ │       ▲      │
          │               │ │ Stack │      │
          │  SPL IMAGE    │ │              │
          │  MAX 204KB    │ ├──────────────┤0x70006f1f
          │(excluding BSS)│ │Global Data   │
          │               │ ├──────────────┤0x70006fff
          │               │ │ Heap (36KB)  │
0x43c33000├───────────────┤ └──────────────┘0x7000ffff
          │ EMPTY (18KB)  │
0x43c37800├───────────────┤
          │               │
          │ BSS (20KB max)│
0x43c3c800├───────────────┤
          │               │
          │ DM data(1.5KB)│
0x43c3cd82├───────────────┤
          │               │
          │ EMPTY (9KB)   │
0x43c3f290├───────────────┤
          │ ROM extended  │
          │  boot info    │
          │   (3.5KB)     │
0x43c3ffff└───────────────┘

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-05-04 18:07:50 -05:00
Vignesh Raghavendra c1f8de7b2b soc: ti: k3-navss-ringacc: Fix reset ring API
Expectation of k3_ringacc_ring_reset_raw() is to reset the ring to
requested size and not to 0. Fix this.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I e39e533dd6 configs: am62: Add configs for enabling ETHBOOT in R5SPL
Add configs for enabling ETHBOOT in R5SPL. Adding a separate config
to minimize the risk of going past the R5-SPL size limit for any
future config additions.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I ee4ace0ce5 configs: am62x_evm_a53_defconfig: Enable configs required for Ethboot
Enable config options needed to support Ethernet boot on AM62x SK.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I f64b1fcc28 arm: dts: k3-am625-sk: Enable CPSW port 1 in SPL stage
Enable CPSW port 1 in SPL stage to ethboot working in AM62.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I d17041a090 ARM: dts: k3-am625-r5-sk: Add DM firmware node
Add DM firmware node which will provide DM services during R5 SPL stage.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I 421cffb6b2 arm: dts: k3-am62-main: Add base addresses for "cfg", "tchan", "rchan", "rflow"
Add base addresses for "cfg", "tchan", "rchan", "rflow" in
main_pktdma required for native configuration in the absence of
DM services.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I 4af0357500 mach-k3: am62_spl: Alias Ethernet RGMII boot to CPGMAC
Alias Ethernet RGMII boot to CPGMAC. This is required to enables
spl_net boot on AM62x.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I 0f6d223312 board: ti: am62x: Init DRAM size in R5/A53 SPL
Call dram_init_banksize() from spl_board_init() otherwise TFTP download
fails with error "TFTP error: trying to overwrite reserved memory..."
due to lmb_get_free_size() not able to find unreserved region due
to lack of DRAM size info. Required to support Ethernet boot on AM62x.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:31 -05:00
Kishon Vijay Abraham I 8dc8661ec1 dma: ti: k3-udma: Add support for native configuration of chan/flow
In absence of Device Manager (DM) services such as at R5 SPL stage,
driver will have to natively setup TCHAN/RCHAN/RFLOW cfg registers.
Existing UDMA driver performed the above mentioned configuration
for UDMA. Add similar configuration for PKTDMA here.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:30 -05:00
Kishon Vijay Abraham I 75acccd29c soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers
Initialize base address of ring config registers required to natively
setup ring cfg registers in the absence of Device Manager (DM) services
at R5 SPL stage.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:30 -05:00
Kishon Vijay Abraham I 07557018ce firmware: ti_sci: Add No-OP for "RX_FL_CFG"
RX_FL_CFG message should not be forwarded to TIFS
and should be handled within R5 SPL (when DM services
are not available). Add a no-op function to not handle
RX_FL_CFG messages.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:30 -05:00
Kishon Vijay Abraham I 690ebf9f73 arm: mach-k3: am625_init: Probe AM65 CPSW NUSS for R5/A53 SPL
In order to support Ethernet boot on AM62x, probe AM65 CPSW NUSS driver
in board_init_f().

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2022-05-04 17:57:30 -05:00
Nishanth Menon edbebb6447 arm: mach-k3: am625_init: Add Erratum WA for RTC startup
Add erratum i2327 work around for initialization for RTC
interrupt where interrupt is stuck for ever at startup. Unfortunately,
this workaround needs to be applied under 1 second of boot.

Signed-off-by: Nishanth Menon <nm@ti.com>
2022-04-27 14:14:44 -05:00
Bryan Brattlof e3e91c9d3a configs: am64x: j721e: enable saving env settings
Currently we cannot save environment settings between resets, forcing us
to stop autoboot and override the same settings every boot

Disable the CONFIG_ENV_IS_NOWHERE option, allowing us to use the
'env save' command to save environment settings between resets

CC: Andrew Davis <afd@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
2022-04-27 14:12:05 -05:00
Bryan Brattlof 8c44dbf165 configs: am64x: j721e: savedefconfig resync
There are many configuration settings defined in the am64's and j721e's
defconfig files that are the same as their default values

Use the 'make savedefconfg' command to remove these duplicate
configuration settings

CC: Andrew Davis <afd@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
2022-04-27 14:12:05 -05:00
Aswath Govindraju 4d694e802d include: configs: am62x_evm: Fix the typos in the USB MSC environment settings
The Marcos used for USB MSC environemnt setting have AM642 instead of
AM625. Therefore, fix them.

Fixes: 842c6777d0 ("include: configs: am62x_evm: Add env variables for booting to kernel using USB MSC device")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-27 14:07:58 -05:00
Vignesh Raghavendra f481ba4782 configs: am62x_evm_a53_defconfig: Ease up application of overlays
With this one can setting name_overlays at u-boot is sufficient to apply
required overlays at U-Boot prompt.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-04-27 14:07:02 -05:00
Aswath Govindraju f424b3ed72 board: ti: am62x: evm.c: Set the USB PHY core voltage to 0.85V
Set the USB PHY core voltage to 0.85V for both the instances. Also, enable
the SPL_BOARD_INIT config.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-25 22:18:40 -05:00
Nishanth Menon bb17d4ec54 board: ti: am62x: Enable the 32k crystal
We have a 32k crystal, lets enable it and set up the mux to point to the
32k clock source path.

Signed-off-by: Nishanth Menon <nm@ti.com>
2022-04-25 22:18:37 -05:00
Pratyush Yadav 6355ef8b17 configs: am62x_evm*: Enable configs needed for OSPI boot
Enable DMA and OSPI related configs in R5 defconfig. Also enable SFDP in
A53 SPL and disable tiny SPI NOR.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
2022-04-21 09:11:47 -05:00
Pratyush Yadav 9604e0f29a arm: dts: k3-am62*: Add nodes for OSPI boot
Add nodes for OSPI support and enable them in SPL.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
2022-04-21 09:11:47 -05:00
Pratyush Yadav 2743c767ff spi: cadence-qspi: allow parsing both "new" and "legacy" partitions
In the "legacy" way, partitions are listed directly under the flash
node. In the "new" way, there is a partitions node under the flash node,
and the partitions are listed under that node. Allow parsing both styles
of partitions for finding the PHY pattern location.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
2022-04-21 09:11:47 -05:00
Aswath Govindraju 842c6777d0 include: configs: am62x_evm: Add env variables for booting to kernel using USB MSC device
Add env variables for booting to kernel from USB MSC device. The second
partition in the USB MSC device needs to formatted as ext4 file system with
kernel and dtb images, present in the /boot folder.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:27:22 -05:00
Aswath Govindraju 34ea5fbb7e configs: am62x_evm: Add support for USB DFU Boot mode
Due size limitations on the R5 SPL image sizes, all the support for various
boot modes can not be added using a single defconfig file. Therefore,
create a new defconfig for USB DFU boot mode.

Also enable configs in A53 defconfig to add support for USB DFU in A53 SPL.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:27:22 -05:00
Aswath Govindraju 1d1fb9b2be arm: mach-k3: am625: Add boot device for USB
AM62x SoC supports booting from USB DFU and MSC. Therefore, add boot
devices for the same.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:27:22 -05:00
Aswath Govindraju f9e49507b3 usb: dwc3: dwc3-am62: Fix the config name for adding USB host mode support
CONFIG_SPL_USB_HOST_SUPPORT is used to enable host mode support in SPL.
Therefore, fix the error in the config's name in #ifdef's condition.

Fixes: fbbcbfbb87 ("drivers: usb: dwc3: Add support for AM62 USB wrapper driver")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:27:22 -05:00
Aswath Govindraju 04df7017c2 include: configs: am62x_evm.h: Increase the maximum size for A53 SPL image
Currently, the maximum size for both A53 and R5 SPL is limited to
CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE, this is set based in the maximum
size of image that ROM will be able to load. Therefore, this condition is
not true in case of A53 SPL, since R5 SPL should be able load images of any
size given the memory is allocated for it.

Also, on enabling support for additional boot media, all the required
support can no longer be accomodated in the same R5 SPL image given the size
restrictions on it and separate deconfigs will be defined for each boot
media. However, this need not be the case for A53 SPL as maximum size can
be increased.

Therefore, increase the maximum size for A53 SPL to 1MB.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:27:22 -05:00
Aswath Govindraju c8f6e13d36 include: configs: am**x/j721e/j721s2_evm.h: Move the stack pointer init address in arm64
Currently, in case of arm64 bootloader and U-Boot the stack pointer is
initialized at an offset of NON_SECURE_MSRAM_SIZE from arm64 SPL's text
base address. After jumping to arm64, execution is done out of DDR.
Therefore, having an offset corresponding to the size of MSRAM does not
have any significance. Stack overflow issues were observed in case of AM62
which has the smallest MSRAM of all the K3 SoCs, when additional configs
are enabled.

Instead, initialize the stack pointer after an offset of 4MB from the SPL
text base address. This helps in allocating larger memory for stack.

  ┌────────────────────┐0x80080000
  │                    │
  │   arm64 SPL        │
  ├────────────────────┤
  │        ▲           │
  │        │           │
  │      STACK         │
  ├────────────────────┤0x80480000
  │ Memory for Load    │
  │ Buffer Allocation  │
  ├────────────────────┤0x80800000
  │                    │
  │    U-Boot Image    │
  │                    │
  └────────────────────┘

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-19 17:24:26 -05:00
Vignesh Raghavendra 5e9503bcfb ARM: dts: am625-sk: Sync DT to kernel
Sync DT to that of kernel in order to fix MMC pinmux and I2C GPIO
Expander line names

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-04-18 19:00:41 -05:00
Aswath Govindraju 33781ede62 configs: am62x_evm_a53_defconfig: Disable configs for UHS modes
Issues are seen while enabling UHS speed modes in U-Boot and this is
breaking MMC boot to kernel. Therefore, disable its corresponding
configs for now.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Tested-by: Bryan Brattlof <bb@ti.com>
2022-04-08 19:23:32 -05:00
Aswath Govindraju 01113f7b7a configs: am62: Add configs for enabling USB in U-Boot
Add configs for enabling USB host MSC and USB DFU in U-Boot.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-06 15:20:18 -05:00
Aswath Govindraju 316c827f74 arm: dts: k3-am625-sk: Add support for USB instances brought out on the board
The two instance of USB IP in AM62 SoC are brought out on the SK board. The
zeroth instance is brought out through a USB TYPE C port and the first
instance through a USB TYPE A port. As role switching is supported in
U-Boot and dfu support is required, fix the role of zeroth instance to
peripheral in the U-Boot dts file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-06 15:20:18 -05:00
Aswath Govindraju 6505d5bee3 arm: dts: k3-am62-main: Add support for USB
AM62 SoC has two instances of USB IP in it. Therefore, add support for the
same.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-06 15:20:18 -05:00
Aswath Govindraju fbbcbfbb87 drivers: usb: dwc3: Add support for AM62 USB wrapper driver
Add support for AM62 USB wrapper for DWC3 Controller in AM62 SoC.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-04-06 15:20:18 -05:00
Dave Gerlach 9b6c1d7607 arm: dts: k3-am64-evm: EMIF tool update to v0.08.40 for 1600MT/s DDR4
Move to latest DDR4 1600MT/s for k3-am64-evm based on EMIF tool
v0.08.40.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2022-04-06 15:12:43 -05:00
Dave Gerlach bf4a13782c arm: dts: k3-am64-sk: EMIF tool update to v0.08.40 and move to 1600MT/s LPDDR4
Move k3-am64-sk to use 1600MT/s LPDDR4 configuration and update to latest EMIF
tool v0.08.40.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2022-04-06 15:12:43 -05:00
Roger Quadros 1a84f06f9f configs: am64x_evm: Fix MMC boot regression caused by NAND support
The environment bootpart is used for MMC boot so we need to use
something different for NAND boot, else we break MMC boot.

Fixes: commit 7d0227061f ("configs: am64x_evm: Support u-boot environment in NAND")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Dave Gerlach <d-gerlach@ti.com>
2022-04-06 15:12:09 -05:00