Commit Graph

70119 Commits

Author SHA1 Message Date
Alan Douglas 87fa9820fd phy: cadence: Add driver for Sierra PHY
Add a Sierra PHY driver with PCIe and USB support.
This driver is a port from the mainline linux driver.

The PHY has multiple lanes, which can be configured into
groups, and a generic PHY device is created for each group.

There are two resets controlling the overall PHY block, one
to enable the APB interface for programming registers, and
another to enable the PHY itself.  Additionally there are
resets for each PHY lane.

The PHY can be configured in hardware to read register
settings from ROM, or they can be written by the driver.

The sequence of operation on startup is to enable the APB
bus, write the PHY registers (if required)  for each lane
group, and then enable the PHY.  Each group of lanes
can then be individually controlled using the power_on()/
power_off() function for that generic PHY

One difference with the linux driver is that the PHY is
always reset after it is powered-on. This is because role
switching is not supported in u-boot and the cable
orientation is handled by the PHY reset.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Alan Douglas <adouglas@cadence.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2021-04-09 11:40:46 -05:00
Aswath Govindraju df385be94f dt-bindings: phy: Add definitions for additional phy types
Add definitions for additional phy types that's used specifically for
Torrent SERDES.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:45 -05:00
Jean-Jacques Hiblot faa2deb119 drivers: reset: Handle gracefully NULL pointers
The reset framework provides devm_reset_control_get_optional()
which can return NULL (not an error case). So all the other reset_ops
should handle NULL gracefully. Prepare the way for a managed reset
API by handling NULL pointers without crashing nor failing.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:44 -05:00
Kishon Vijay Abraham I 8c4435324a dm: test: Add test case to check node name ignoring unit address
Add test to check node name ignoring unit address.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:42 -05:00
Kishon Vijay Abraham I 1a9e769718 dm: core: Add helper to compare node names
Add helper to compare node names.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:42 -05:00
Lokesh Vutla b4916daf24 arm: dts: k3-j7200: Sync Linux v5.11-rc6 dts into U-Boot
commit 6239cc8c4e upstream.

Sync all J7200 related v5.11-rc6 Linux kernel dts into U-Boot.
MCU R5F nodes are not yet added in Linux kernel yet but were added
in U-Boot. In order to avoid regressions, r5f nodes are kept intact.
These will be added in kernel in future.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:40 -05:00
Lokesh Vutla 16c0c84460 arm: dts: k3-j721e: Sync Linux v5.11-rc6 dts into U-Boot
commit 70e167495a upstream.

Sync all J721e related v5.11-rc6 Linux kernel dts into U-Boot.
HBMC nodes are not yet added in Linux kernel yet but were added
in U-Boot. In order to avoid any regressions, hbmc nodes are kept
intact. These will be added in kernel in future.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:39 -05:00
Kishon Vijay Abraham I 5ccb65ca11 Revert "arm: dts: k3-j7200-r5-common: Add pinmux details for wakeup gpio0"
This reverts commit 25d50fd4c2. This will
prevent compilation from breaking after Linux v5.11-rc6 dts is synced into
U-Boot.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2021-04-09 11:40:37 -05:00
Dave Gerlach d5c6aae339 drivers: ram: k3-ddrss: Fix file modes
Many files in this driver were mistakenly added with execute permission
set, so correct mode to 664 for all files to match others in u-boot
source tree.

Reported-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-31 00:06:39 -05:00
Dave Gerlach 4dcac4b369 drivers: ram: k3-ddrss: Add driver root path to include list
Ensure that drivers/ram/k3-ddrss is part of the include path search list
so that headers can be included by all files that are part of the
driver, including those under 16bit/ and 32bit/ paths.

Reported-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-03-30 22:29:22 -05:00
Aswath Govindraju ce73a0713d configs: j7200_evm_r5: Enable configs to support GPIO and FDT parsing in SPL
In HyperFlash boot mode it is required to detect the state of onboard DIP
switch and based on its state, set the status in corresponding DT nodes.

Add support for this by enabling configs of GPIO driver model and FDT
library for parsing in SPL.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:28:38 -05:00
Aswath Govindraju 25d50fd4c2 arm: dts: k3-j7200-r5-common: Add pinmux details for wakeup gpio0
Add pinmux properties for wakeup gpio0 device tree node.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:28:37 -05:00
Aswath Govindraju 79d027134a board: ti: j7200: Add support for probing HyperFlash in A72 SPL
In the boot flow of HyperFlash boot mode, initially the clock rate is set
by ROM and the same is used by R5 and A72 SPLs. By default the status of
HyperFlash DT node is disabled, which implies that w.r.t R5 SPL HyperFlash
is disabled and the clocks assigned to it can now be reassigned.  In
common/spl/spl_nor.c the images are directly loaded into RAM without
setting the clock. In case of R5 SPL, tispl.bin image is first loaded and
then other devices are probed because of which the clock rate set by ROM
for HyperFlash does not change and image loaded is correct. However, by the
time the A72 SPL starts executing, the clock rate assigned to HyperFlash
gets changed. So, if the clock rate is not set again, the reads from
HyperFlash will be corrupted leading to a broken boot.

Fix this by probing the hbmc-am654 driver using
uclass_get_device_by_driver() which sets the default clock rate  before
calling the driver probe, when the state of SW3.1 dip switch on the board
is set to 1. Also, define the function spl_perform_fixups() in case of R5
SPL too, so that status of HyperFlash in tispl.bin image can be set
appropriately for device probe.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:28:36 -05:00
Aswath Govindraju 056a0d7508 configs: j72*_evm: Define the buffer sizes for dfu
On J721e R5 SPL, dfu buffer for loading sysfw.itb image gets allocated
before DRAM gets initialized. So, the buffer gets allocated in MCU L3 RAM.
The current buffer size to be allocated is 256KB  and the available total
heap memory is 0x70000 (448KB). This leads to NOMEM errors during
allocation.

In other cases when constraints such as above are not present fix the size
of buffers to the sector size in OSPI for proper functioning.

Also, if CONFIG_SYS_DFU_DATA_BUF_SIZE is defined and
CONFIG_SYS_DFU_MAX_FILE_SIZE is not defined then the max
file size for dfu transfer is defined as CONFIG_SYS_DFU_DATA_BUF_SIZE.

Fix these by setting appropriate buffer sizes in their respective
defconfig files and defining the max file size as 8 MB which is the default
dfu buffer size.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:28:35 -05:00
Aswath Govindraju 8e2b78ba2b usb: dfu: Migrate CONFIG_SYS_DFU_DATA_BUF_SIZE and CONFIG_SYS_DFU_MAX_FILE_SIZE to Kconfig
Currently the config options CONFIG_SYS_DFU_DATA_BUF_SIZE and
CONFIG_SYS_DFU_MAX_FILE_SIZE are being set in include/configs/<board>.h
files and also in <board_name>_defconfig files without a Kconfig option. It
is easier for users to set these configs in defconfig files than in config
header files as they are a part of the source code.

Add Kconfig symbols, and update the defconfigs by using tools/moveconfig.py
script.

Suggested-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-03-30 22:28:33 -05:00
Lokesh Vutla cf4db6a765 configs: am64x_sk_r5: add r5 specific defconfig
Add R5 specific defconfig

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:26:45 -05:00
Lokesh Vutla f6745df714 configs: am64x_sk_a53: Add a53 specific defconfig
Add a53 specific defconfig

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:26:23 -05:00
Lokesh Vutla da71d185bc arm: dts: am642-r5-sk: Add r5 specific dts
Add R5 specific dts for AM64 SK

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:26:22 -05:00
Lokesh Vutla cf26b081da arm: dts: am642-sk: Add initial sk dts
AM642 StarterKit (SK) board is a low cost, small form factor board
designed for TI’s AM642 SoC. It supports the following interfaces:
* 2 GB LPDDR4 RAM
* x2 Gigabit Ethernet interfaces capable of working in switch and MAC mode
* x1 USB 3.0 Type-A port
* x1 UHS-1 capable µSD card slot
* 2.4/5 GHz WLAN + Bluetooth 4.2 through WL1837
* 512 Mbit OSPI flash
* x2 UART through UART-USB bridge
* XDS110 for onboard JTAG debug using USB
* Temperature sensors, user push buttons and LEDs
* 40-pin Raspberry Pi compatible GPIO header
* 24-pin header for peripherals in MCU island (I2C, UART, SPI, IO)
* 54-pin header for Programmable Realtime Unit (PRU) IO pins
* Interface for remote automation. Includes:
	* power measurement and reset control
	* boot mode change

Add basic support for AM642 SK.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-03-30 22:26:21 -05:00
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