Commit Graph

70450 Commits

Author SHA1 Message Date
Lokesh Vutla 86aecef857 board: ti: am64x: Make devicetree selection generic
Compare with default device tree for selecting dtb for u-boot.
This will allow to choose right dtb for am64x-evm and am64x-sk.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:26:19 -05:00
Lokesh Vutla 2e75b7a4ea configs: am64x_evm_a53: Enable support for reading eeprom
Enable relevant configs for reading eeprom data and updating env
variables.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:25:31 -05:00
Lokesh Vutla 315220bda0 configs: am64x_evm_a53: Enable configs for printing cpuinfo
Enable all relevant configs for printing CPU info.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:10 -05:00
Lokesh Vutla 8ddd30bfb7 arm: dts: am642-evm: Add I2C nodes
Add I2C nodes for AM64 and enable pinmux for i2c0 for reading eeprom data.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:09 -05:00
Lokesh Vutla 2c91701ba0 arm: dts: k3-am64-evm: Make chip id available before pre-reloc
Chipid will be needed for SoC detection for all stages of U-Boot.
So make it u-boot,dm-spl

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:08 -05:00
Lokesh Vutla 56b98a2318 include: configs: am64x: Avoid overlap of BSS and stack area
Avoid R5 SPL stack writing into ROM index table. Re-use the same space
for storing EEPROM data.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:07 -05:00
Lokesh Vutla 4bf4aec19b board: ti: am64x: Add support for reading eeprom data
I2C EEPROM data contains the board name and its revision.
Add support for:
- Reading EEPROM data and store a copy at end of SRAM
- Updating env variable with relevant board info
- Printing board info during boot.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:06 -05:00
Lokesh Vutla d01fcd1ef0 soc: ti: k3-socinfo: Add entry for AM64X SoC family
Add support for AM64 SoC identification.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:21:04 -05:00
Lokesh Vutla 98b20303fe board: ti: am64x: fix build warning for env
Fix the following build warning:
board/ti/am64x/evm.c:105:6: warning: implicit declaration of
	function ‘env_get’ [-Wimplicit-function-declaration]
  105 |  if (env_get("serial#"))

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:20:53 -05:00
Aswath Govindraju f7b6a9b943 configs: am64x_evm: Enable configs required for USB Mass storage boot
Enable configs required to add support for USB Mass storage boot mode in
AM642-evm.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:13:00 -05:00
Aswath Govindraju e130468298 arm: mach-k3: am642_init: Do USB fixups to facilitate host and device boot modes
U-Boot either supports USB host or device mode for a node at a time in the
device tree nodes. To support both host and dfu bootmodes, dr_mode is set
to "peripheral" by default and then fixed based on the mode selected by
the boot mode config dip switches on the board.

This needs to happen before the cdns3 generic layer binds the usb device
to a host or a device driver. Therefore, use fdtdec_setup_board()
implementation to fixup the device tree property.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:59 -05:00
Aswath Govindraju 05a01e52d2 arm: mach-k3: am642_init: Add support for USB boot mode
Add support for identifying USB host and device boot modes

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:58 -05:00
Aswath Govindraju fa08136b73 configs: am64x-evm: Enable USB and DFU related configs
Enable config options required to add DFU and USB host mode in U-Boot.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:57 -05:00
Aswath Govindraju a11f1add2f arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to peripheral for USB subsystem
Add U-Boot tags and fix the dr_mode as peripheral in U-Boot to support DFU
by default.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:55 -05:00
Aswath Govindraju 2c8ed58fe2 arm: dts: k3-am642-*-evm: Add USB support
AM64 EVM board has a micro USB 2.0 AB connector and the USB0_VBUS is
connected with a resistor divider in between. USB0_DRVVBUS pin is muxed
between USB0_DRVVBUS and GPIO1_79 signals.

Add the corresponding properties and set the pinmux mode for USB subsystem
in the evm dts file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:54 -05:00
Aswath Govindraju 3092efc090 arm: dts: k3-am64-main: Add USB DT nodes
Add DT node for the single USB subsystem in main dtsi file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:12:53 -05:00
Aswath Govindraju 9931b73f65 arm: dts: k3-am642-evm-u-boot: Add no-1-8-v tag in sdhci1 node instead of sdhci0 node
UHS-I modes are not supported in MMCSD1 subsystem. Therefore, remove the
no-1-8-v tag from sdhci0 node and add it in sdhci1 node.

Fixes: 7d941ea047 ("arm: dts: k3-am642: Add r5 specific dt support")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-25 15:57:30 -05:00
Tero Kristo 6520e5e753 board: ti: j72xx: README: update build instructions and image formats
Update build instructions and image formats based on HSM rearch. A new
DM image is added into the build, which gets executed right after R5
SPL finishes its job.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:28:12 -05:00
Dave Gerlach ede583c611 configs: j7200_evm_r5: Enable raw access power management features
Sysfw is not going to provide access to power management features in the
new architecture, so SPL must implement these itself. Enable all the raw
register access based clock + power domain drivers.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 19:28:10 -05:00
Tero Kristo 1bc6c0c613 configs: j721e_evm_r5: Enable raw access power management features
Sysfw is not going to provide access to power management features in the
new architecture, so SPL must implement these itself. Enable all the raw
register access based clock + power domain drivers.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:28:09 -05:00
Tero Kristo e85577ae01 arm: mach-k3: sysfw-loader: pass boardcfg to sciserver
Copy the contents of the board config loaded from sysfw.itb into an
EXTBOOT shared memory buffer that gets passed to sciserver. This only
needs to be done if EXTBOOT area has not been populated by ROM code yet.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:28:07 -05:00
Dave Gerlach 018235f911 arm: mach-k3: common: Drop main r5 start
Only start-up the non-linux remote cores if we are running in legacy
boot mode. HSM rearch is not yet supporting this.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:27:56 -05:00
Tero Kristo 986c800c54 arm: mach-k3: do board config for PM and RM only if supported
If the raw PM support is built in, we are operating in the split
firmware approach mode where RM and PM support is not available. In this
case, skip the board config for these two.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:25:43 -05:00
Tero Kristo f23425b760 arm: mach-k3: add support for detecting firmware images from FIT
Add callback routines for parsing the firmware info from FIT image, and
use the data to boot up ATF and the MCU R5 firmware.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 19:24:24 -05:00
Dave Gerlach e1ec37f5b7 arm: mach-k3: Add platform data for j721e and j7200
Add platform clock and powerdomain data for J721e and J7200. This data
is used by the corresponding drivers to register all the required device
clocks and powerdomains.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 19:23:27 -05:00
Tero Kristo ad49cdb4fe tools: k3_fit_atf: add DM binary to the FIT image
Add DM (device manager) firmware image to the fit image that is loaded by
R5 SPL. This is needed with the HSM rearch where the firmware allocation
has been changed slightly.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:19:07 -05:00
Tero Kristo 17ed964851 cmd: ti: pd: Add debug command for K3 power domains
Add support command for debugging K3 power domains. This is useful with
the HSM rearch setup, where power domains are directly controlled by SPL
instead of going through the TI SCI layer. The debugging support is only
available in the u-boot codebase though, so the raw register access
power domain layer must be enabled on u-boot side for this to work. By
default, u-boot side uses the TI SCI layer, and R5 SPL only uses the
direct access methods.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:19:02 -05:00
Tero Kristo 3f76a8502e power: domain: Introduce driver for raw TI K3 PDs
Normally, power domains are handled via TI-SCI in K3 SoCs. However,
SPL is not going to have access to sysfw resources, so it must control
them directly. Add driver for supporting this.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:58 -05:00
Tero Kristo 3ef966ce4c clk: add support for TI K3 SoC clocks
Add driver to support TI K3 generation SoC clocks. This driver registers
the clocks provided via platform data, and adds support for controlling
the clocks via DT handles.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:53 -05:00
Tero Kristo e8bcd015d3 clk: add support for TI K3 SoC PLL
Add support for TI K3 SoC PLLs. This clock type supports
enabling/disabling/setting and querying the clock rate for the PLL. The
euclidean library routine is used to calculate divider/multiplier rates
for the PLLs.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:49 -05:00
Tero Kristo 886b07be69 clk: fix set_rate to clean up cached rates for the hierarchy
Clock rates are cached within the individual clock nodes, and right now
if one changes a clock rate somewhere in the middle of the tree, none
of its child clocks notice the change. To fix this, clear up all the
cached rates for us and our child clocks.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:44 -05:00
Tero Kristo 153554764b clk: fix assigned-clocks to pass with deferring provider
If a clock provider is not ready for assigning default rates/parents
during its probe, it may return -EPROBE_DEFER directly from xlate.
Handle this special case properly by skipping the entry and adjusting the
return value to pass. The defaults will be handled properly in post probe
phase then.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:40 -05:00
Tero Kristo d27d44072e clk: sci-clk: fix return value of set_rate
Set rate should return the new clock rate on success, and negative error
value on failure. Fix this, as currently set_rate returns 0 on success.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:36 -05:00
Tero Kristo 426b6dae14 clk: add support for setting clk rate from cmdline
Add new clk subcommand "clk setfreq", for setting up a clock rate
directly from u-boot cmdline. This is handy for any debugging purposes
towards clocks.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:31 -05:00
Tero Kristo bd00683f37 clk: do not attempt to fetch clock pointer with null device
Bail out early if device returned for the parent clock is null.
This avoids warning prints like this when doing clk dump:

  dev_get_uclass_priv: null device

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:26 -05:00
Tero Kristo 194897e6b1 clk: fix clock tree dump to properly dump out every registered clock
Some clocks are not associated to a DM node, so just parsing the DM is not
enough. This is especially true for root clocks, which typically don't have
any parents. Instead, fetch every registered UCLASS_CLK instance, and dump
these out.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:22 -05:00
Tero Kristo 5af23dce70 clk: fixed_rate: add API for directly registering fixed rate clocks
Current driver only supports registering fixed rate clocks from DT. Add
new API which makes it possible to register fixed rate clocks directly
from e.g. platform specific clock drivers.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:18 -05:00
Lokesh Vutla 4712c22566 common: fit: Update board_fit_image_post_process() to pass fit and node_offset
board_fit_image_post_process() passes only start and size of the image,
but type of the image is not passed. So pass fit and node_offset, to
derive information about image to be processed.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2021-03-23 17:18:13 -05:00
Tero Kristo a21a5f160e remoteproc: k3-r5: remove sysfw PM calls if not supported
With the sysfw rearch, sysfw PM calls are no longer available from SPL
level. To properly support this, remove the is_on checks and the reset
assertion from the R5 remoteproc driver as these are not supported.
Attempting to access unavailable services will cause the device to hang.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:07 -05:00
Tero Kristo 4670feffb0 arm: mach-k3: introduce new config option for sysfw split
On J7 family of SoCs (J721E and J7200), sysfw is being split to be run
under two cores, TIFS portion on DMSC core, and DM firmware under MCU
R5. As MCU R5 is also used to run one phase of the bootloader, we must
prevent access from here towards sysfw services. To support this, add
new config option which can be used to detect presence of RM/PM sysfw
services.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2021-03-23 17:18:03 -05:00
Tero Kristo 0ce3dcbf61 lib: rational: copy the rational fraction lib routines from Linux
Copy the best rational approximation calculation routines from Linux.
Typical usecase for these routines is to calculate the M/N divider
values for PLLs to reach a specific clock rate.

This is based on linux kernel commit:
"lib/math/rational.c: fix possible incorrect result from rational
fractions helper"
(sha1: 323dd2c3ed0641f49e89b4e420f9eef5d3d5a881)

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2021-03-23 17:17:58 -05:00
Nishanth Menon 456a81bba2 configs: am64x_evm_r5: Enable GPIO regulator
Enable GPIO regulator.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:54 -05:00
Nishanth Menon 55c7eba449 arm: dts: k3-am642-r5-evm: Add GPIO DDR VTT regulator
Add DDR VTT regulator.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:49 -05:00
Nishanth Menon e87eb3cfc4 arm: dts: k3-am64-main: Add GPIO nodes
Add main domain GPIO nodes.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:45 -05:00
Dave Gerlach 37ec1d56bc arm: mach-k3: am642: Add support for triggering ddr init from SPL
In SPL, DDR should be made available by the end of board_init_f()
so that apis in board_init_r() can use ddr. Adding support for
triggering DDR initialization from board_init_f().

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:40 -05:00
Dave Gerlach 3739f2d6a6 arm: dts: k3-am642: Add ddr node
Introduce ddr node for am642 needed for all ddr configurations.

Also, introduce the 1600MTs DDR4 configuration that is supported on the
am642-evm.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:36 -05:00
Lokesh Vutla 51b776e955 drivers: ram: k3-ddrss: Enable vtt regulator if present
Attempt to get and enable a vtt regulator if one is provided from the
dts. If we do not find one, continue as not all platforms have this.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:32 -05:00
Dave Gerlach 89d304ed09 drivers: ram: k3-ddrss: Introduce common driver
Introduce support for the AM64 DDRSS controller through a common driver
for both am64 and j721e. This controller shares much functionality with
the existing J721e support, so this patch refactors the driver such that
the am64 specific comes from "_16bit_" files with headers uner "16bit/"
include path, and j721e support comes from "_32bit_" files with headers
under the "32bit/" include path.

Also add a CONFIG_K3_AM64_DDRSS option to the choice required for use
with CONFIG_K3_DDRSS to allow selecting AM64 support.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:28 -05:00
Dave Gerlach 9f682d3816 drivers: ram: k3-ddrss: Introduce top-level CONFIG_K3_DDRSS
Create a new CONFIG_K3_DDRSS option to select the common parts of the
k3-ddrss driver. Also introduce a choice that depends on the top level
option to select CONFIG_K3_J721E_DDRSS for j721e support, and update
corresponding Kconfig as required.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:20 -05:00
Dave Gerlach be0a67656e ram: k3-j721e: Rename to k3-ddrss
Rename the k3-j721e folder under drivers/ram to k3-ddrss in preparation
of introducing additional support for other platforms to the same
driver.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-23 17:17:16 -05:00