commit 7d67334dfe upstream.
The DM binary runs on the MCU R5F Core0 after R5 SPL on J721E and J7200
SoCs. The binary is built alongside the TFA, OPTEE and A72 SPL binaries
and included in the tispl.bin FIT image. The R5 SPL loads the DM binary
at 0xA0000000 address, based on the value used in the FIT image build
script. The DM binary though is an ELF image and not a regular binary
file, and so is processed further to load the actual program segments
using the U-Boot's standard ELF loader library.
The DM binary does leverage a certain portion of DDR for its program
segments, and typically reserves 16 MB of DDR at 0xA0000000 with the
1st MB used for IPC between Linux and the remote processor, and
remaining memory for firmware segments. This can cause an incomplete
loading of the program segments if the DM binary is larger than 1 MB,
due to overlap of the initial loaded binary and the actual program
segments.
Fix this by using the address 0x89000000, which matches the current
"addr_mcur5f0_0load" env variable used by R5 SPL before the DM firmware
inclusion into the tispl.bin.
Fixes: df5363a67f ("tools: k3_fit_atf: add DM binary to the FIT image")
Signed-off-by: Suman Anna <s-anna@ti.com>
Fixes: ad49cdb4fe ("tools: k3_fit_atf: add DM binary to the FIT image")
[s-anna@ti.com: cherry-pick commit '468ec2f3ef8f' from v2021.10-rc4]
Tested-by: Lucas Weaver <l-weaver@ti.com>
It is possible for power domain IDs to be great than 31. If this
happens, the PTCMD and PTSTAT registers must overflow into adjacent
corresponding PTCMD_H and PTSTAT_H registers for each. Update the driver
to account for this.
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
In case of xSPI bootmode OSPI flash is in DDR mode and needs to be accessed
in multiple of 16bit accesses Hence we cannot parse sysfw.itb FIT image
directly on OSPI flash via MMIO window. So, copy the image to internal
on-chip RAM before parsing the image.
Moreover, board cfg data maybe modified by ROM/TIFS in case of HS platform
and thus cannot reside in OSPI/xSPI and needs to be copied over to
internal OCRAM.
This unblocks OSPI/xSPI boot on HS platforms
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Dave Gerlach <d-gerlach@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
AM43XX EVM cannot currently boot because "uuid" of root partition is
undefined. This makes the kernel panic and fail to boot successfully.
This appeared after this commit has been applied:
- commit 04701dce2b ("environment: ti: mmc.h: Make the finduuid generic
for usage across different device types")
To fix this, define "boot" that is used by "finduuid", which corresponds
to the underlying interface (mmc in this case).
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
AM335X EVM cannot currently boot because "uuid" of root partition is
undefined. This makes the kernel panic and fail to boot successfully.
This appeared after these two commits have been applied:
- commit 04701dce2b ("environment: ti: mmc.h: Make the finduuid generic
for usage across different device types")
- commit b6251db8c3 ("Kconfig: Introduce USE_BOOTCOMMAND and migrate
BOOTCOMMAND")
To fix this, run "finduuid" at bootcmd to parse the relevant uuid.
And define "boot" that is used by "finduuid", which corresponds to the
underlying interface (mmc in this case).
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Add am64x High Security EVM defconfig.
These defconfigs are the same as for the non-secure part, except for:
CONFIG_TI_SECURE_DEVICE option set to 'y'
CONFIG_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_SPL_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_BOOTCOMMAND uses FIT images for booting
Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
[praneeth@ti.com: fix am64x_hs_evm_a53_defconfig,MAINTAINERS file and commitmsg]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Add j7200 High Security EVM defconfig.
These defconfigs are the same as for the non-secure part, except for:
CONFIG_TI_SECURE_DEVICE option set to 'y'
CONFIG_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_SPL_FIT_IMAGE_POST_PROCESS option set to 'y'
CONFIG_BOOTCOMMAND uses FIT images for booting
Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
[praneeth@ti.com: fix j7200_hs_evm_r5_defconfig,MAINTAINERS file and commitmsg]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
EMIF tool for AM64 SK is now updated to 0.8.0 that includes
* disabled Write DQ training
* improve CA ODT to 60 ohms
The lpddr4 enabled with periodic WDQ training is causing periodic 26us
stall. This makes the SoC stall without doing anything which leads to
R5 interrupt latency in TCM memory. Due to this periodic training there
are some outstanding CPU transactions waiting for the lpddr4 to complete.
Hence, disable the periodic write DQ training during the
non-initialization stage of lpddr4 which results in an approximate 1us
stall. Also, update the lpddr4 config to improve CA ODT by 60 ohms
The rationales are as follows:
- PI_WDQLVL_EN: 2 Bits register field to support write DQ leveling,
disable bit 1 that supports Write DQ during non-initialization to
avoid ~26us stall during code execution.
- MR11_DATA_F1/F2_x register fields value changed to 0x66 that changes
the CA ODT from 48ohm to 60ohm to improve the eye margin on CA bus by
increasing the signal swing.
Signed-off-by: James Doublesin <doublesin@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
The board name of J7 Edge AI is changed to J721E-SK, hence the following
changes,
* rename all device tree files from eaik to sk.
* replace all occurrences of eaik with sk.
* update the env config to select the SK dtb file.
* remove the EAIK DTB file name from the config list and add SK DTB file
name.
[squashed into one patch to preserve bisectability]
Suggested-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
The board name for J721E Edge AI is changed to Starter Kit[1], so
replace all the occurrences of eaik with sk.
[1] https://www.ti.com/tool/SK-TDA4VM
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Add NAND partitions to mtdparts kernel command line parameters.
Although NAND support is available via expansion card, it is harmless
to pass NAND partitions via cmdline. It is easy for customer
to customize the NAND partition layout via u-boot environment
than using Device Tree.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
The I2C GPIO expander at address 0x38 is used for card detect GPIOs.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
We need the I2C GPIO drivers to detect expansion cards.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
I2C nodes were already present and the below commit added them
again so get rid of the duplicates.
Fixes: 8ddd30bfb7 ("arm: dts: am642-evm: Add I2C nodes")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
A new lpddr4 configuration is introduced for J7 EAIK with 4266 MTs data
rate. Therefore, update the R5 DTS file to point to the new DDR config
file.
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
EMIF tool for J721E EAIK is now updated to 0.6.1 that includes
* Updated write DQ training pattern to enable user pattern and clock
pattern (from 0x7 to 0x6).
* Updated IO drive strength to 40-80-80 Ohms.
J721E EAIK uses the lpddr4 configuration of 4266 MTs data rate which is
the same as J721E EVM but facing random failures. As the tool update is
specific to the EAIK board, add a new lpddr4 config of 4266 MTs.
Signed-off-by: Kevin Scholz <k-scholz@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
The final 128KB in SRAM is reserved by default for DMSC-lite code and
secure proxy communication buffer. The memory region used for DMSC-lite
code can be optionally freed up by secure firmware API[1]. However, the
buffer for secure proxy communication is not configurable. This default
hardware configuration is unique for AM64.
Therefore, indicate the area reserved for DMSC-lite code and secure proxy
communication buffer in the oc_sram device tree node.
[1] - http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/security_handover.html#triggering-security-handover
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Earlier, the region 0x701c0000 to 0x701dffff was firewalled off because of
a bug in SYSFW. In the v2021.05 release of SYSFW this bug has been fixed
and this region can now be used for other allocations.
Therefore, move TF-A's load address to 0x701c0000 and update its location
in the device tree node. Also, increase the size allocated for TF-A to
account for future expansions.
Fixes: 32f0670752 ("arm: dts: k3-am64-main: Update the location of ATF in SRAM and increase its max size")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
J7200 SPL build is failing with below error:
arch/arm/mach-k3/common.c:182: undefined reference to `request_firmware_into_buf'
Since the code is guarded by CONFIG_FS_LOADER, it is still being
included for SPL builds. So use CONFIG_IS_ENABLED to handle SPL as well.
Reported-by: Yogesh Siraswar <yogeshs@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
The am335x-ice-v2 board's Ethernet ports can be configured
in 'MII' or 'RMII' mode to be connected to 'PRUSS' or 'CPSW'
Ethernet subsystems.
This patch sets the environment variable 'ice_mii' to
'mii' or 'rmii' accordingly. Based on that we choose the
appropriate board devicetree i.e. 'am335x-ice-v2.dtb' or
'am335x-ice-v2-prueth.dtb'.
Since there are 2 Ethernet ports with 2 modes, there can be 4
configurations but for now we consider both ports in different modes
to be an invalid configuration and prevent boot in that case.
Signed-off-by: Roger Quadros <rogerq@ti.com>
[Amjad: Fix compile and checkpatch warnings]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Tested-by: Adrien Ricciardi <aricciardi@baylibre.com>
Sync the configs required for enabling checks for size of image and stack
from generic r5 defconfig file.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Fix the path to usb0 instance, used for fixing the dr_mode based on boot
mode switches. Also, fix the argument for providing the length of string
to be replaced with, in the function fdt_find_and_setprop().
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
By default, dr_mode of usb0 instance, should be set to peripheral. The
dr_mode is corrected during runtime to host if the mode is set to host in
the boot mode switches. Therefore, set the dr_mode to peripheral for usb0
instance.
Also. usb1 instance is only supported in U-Boot. Therefore, move the
instance setting the dr_mode to peripheral from r5 specific dts file.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Add u-boot,dm-spl tag in the pinmux device tree node, required for MMCSD1
subsystem.
Fixes: 7d941ea047 ("arm: dts: k3-am642: Add r5 specific dt support")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
As the size of tiboot3.bin has increased, the memory layout of the
bootloaders in eMMC and OSPI have been changed to accommodate this.
Therefore, introduce new dfu environment variables for combined boot images
and accordingly update them for J7200 in the config header file.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
The current size of tiboot3.bin is 516KB and the memory reserved for it
in the OSPI flash is 512KB. This leads to overlap of tiboot3.bin on
tispl.bin region and break in OSPI boot mode.
Therefore, fix this by increasing the memory allocated for tiboot3.bin to
1MB.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
The current size of tiboot3.bin is 516KB and the memory reserved for it in
HyperFlash is 512KB. This leads to overlap of tiboot3.bin over tispl.bin
region and break in HyperFlash boot mode.
Therefore, fix this by increasing the memory allocated for tiboot3.bin to
1MB.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
The current size of tiboot3.bin is 516KB and the memory reserved for it in
eMMC boot partition is 512KB. This leads to overlap of tiboot3.bin over
tispl.bin region and break in eMMC boot mode.
Therefore, fix this by increasing the memory allocated for tiboot3.bin to
1MB.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
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>
Make finduuid generic by making it dependent on the boot variable. For
example, this can now be used for finding the uuid of partitions in usb
device too.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Fix the dr_mode in the U-Boot device tree blob, by reading the mode field
from the USB Boot Configuration fields. The dr_mode will only be fixed when
booting from USB.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
When the device port is in a low power state [U3/L2/Not Connected],
accesses to usb device registers may take a long time. This could lead to
potential core hang when the controller registers are accessed after the
port is disabled by setting DEVDS field. Setting the fast register access
bit ensures that the PHY clock is keeping up in active state.
Therefore, set fast access bit to ensure the accesses to device registers
are quick even in low power states.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
The board file sets the 'idk_lcd' environment variable based on
what LCD panel was detected. We just need to choose the right
DTB based on that.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
This is not really a new board but rather a minimal bootloader solution
for the AM437x GP EVM. In terms of interfaces, it only supports booting
from MMC0 or UART0 and only activates a minimal set of drivers that are
that are necessary to run the device such as DDR, I2C, and PMIC.
The goal is to provide a bare minimum starting point to boot Linux for
basing custom board-ports on. The limited complexity of this solution
should make it easier to achieve a successful boot to U-Boot prompt vs.
trying to pair down the full-featured multi-platform AM437x U-Boot
available through am43xx_evm_defconfig.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
[Amjad: fix compile and checkpatch warnings]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
This is not really a new board but rather a minimal bootloader solution
for the AM335x GP EVM. In terms of interfaces, it only supports booting
from MMC0 or UART0 and only activates a minimal set of drivers that are
that are necessary to run the device such as DDR, I2C, and PMIC.
The goal is to provide a bare minimum starting point to boot Linux for
basing custom board-ports on. The limited complexity of this solution
should make it easier to achieve a successful boot to U-Boot prompt vs.
trying to pair down the full-featured multi-platform AM335x U-Boot
available through am335x_evm_defconfig.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
[Amjad: fix checkpatch and compile warnings]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
The driver enables IPU support. Basically enables the clocks,
timers, watchdog timers and bare minimal MMU and supports
loading the firmware from mmc.
Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix compile warnings]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.
Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Add find_next_zero_area to fetch the next zero area in the map.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
First check the presence of the ipu firmware in the boot partition.
If present enable the ipu and the related clocks & then move
on to load the firmware and eventually start remoteproc IPU1/IPU2.
do_enable_clocks by default puts the clock domains into auto
which does not work well with reset. Hence adding do_enable_ipu_clocks
function.
Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix IPU1_LOAD_ADDR and compile warnings]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Add a reset driver to bring IPs out of reset.
Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: reset_ops structure member "free" has been renamed to "rfree",
use the latter instead]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
The size of u-boot.img is above 1MB and that of tispl.bin is close to 1MB,
in case of j721e. Therefore, increase the sizes allocated for tispl.bin and
u-boot.img to 2 MB and 4 MB respectively, in dfu_alt_info_ram environment
variable.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>