Commit Graph

70450 Commits

Author SHA1 Message Date
Vignesh Raghavendra e7a32faf38 net: ti: am65-cpsw: Add support for multi port independent MAC mode
commit 38922b1f4a upstream.

On certain TI SoC, like AM64x there is a CPSW3G which supports 2
external independent MAC ports for single CPSW instance.
It is not possible for Ethernet driver to register more than one port
for given instance.

This patch modifies top level CPSW NUSS as UCLASS_MISC and binds
UCLASS_ETH to individual ports so as to support bring up more than one
Ethernet interface in U-Boot.

Note that there is no isolation in the since, CPSW NUSS is in promisc
mode and forwards all packets to host.

Since top level driver is now UCLASS_MISC, board files would need to
instantiate this driver explicitly.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28 11:48:04 -06:00
Vignesh Raghavendra 67f8b9b58c mach-k3: common: Instantiate AM65 CPSW NUSS wrapper
commit e58d928485 upstream.

Probe toplevel AM65 CPSW NUSS driver from misc_init_r() when driver
is enabled. Since driver is modeled as UCLASS_MISC, we need to
explicitly probe the driver. Use common misc_init_r() that entire
K3 family of SoCs.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28 11:48:04 -06:00
Vignesh Raghavendra 9e4d6708b1 dma: ti: k3-udma: Fix rflow reservation for PKTDMA
commit 4af5e5f6fd upstream.

Driver has a bug in that it uses rflow_in_use bitmap when setting up free rflow range
from TISCI but use rflow_map for reservation in __udma_reserve_rflow()

Fix this by dropping rflow_in_use bitmap array and use rflow_map for
PKTDMA. BCDMA does not need rflow_in_use either.

This fixes CPSW3g not able to get DMA channels at R5 SPL on AM64x

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28 11:48:04 -06:00
Vignesh Raghavendra 32786b1575 ARM: dts: k3-am64-main: Drop hardcoded MAC
This was never supposed to hardcoded given addresses are picked up from
EFUSE or EEPROM.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28 11:48:04 -06:00
Matwey V. Kornilov 9ac9b4bc5c tiny-printf: Handle %pM format when CONFIG_SPL_NET_SUPPORT is enabled
commit c091f65234 upstream.

%pM format string is used to print MAC-address and this is required while SPL
network boot.

This patch fixes the SPL boot issues like the following:

    Trying to boot from USB eth
    ## Error: flags type check failure for "ethaddr" <= "40309614M" (type: m)
    ## Error inserting "ethaddr" variable, errno=1
    eth0: eth_cpsw## Error: flags type check failure for "eth1addr" <=
    "81f01114M" (type: m)
    ## Error inserting "eth1addr" variable, errno=1
    , eth1: usb_ether
    eth_cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
    Problem booting with BOOTP
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28 11:48:04 -06:00
Amjad Ouled-Ameur a911d605c5 env: ti: boot: split-up and refactor Android env variables
Android env variables are getting longer in size and some of them has
already exceeded 1 KiB which is the current limit of u-boot buffer size
allocated for env variables.

This mainly refactors emmc_android_boot and findfdt variables that are too
long.

Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
2022-01-19 19:43:28 -06:00
Aswath Govindraju de08bbab91 arm: dts: k3-j721s2: Remove unused serial aliases
Remove aliases for unused serial devices and change the alias for
main_uart8 to serial2. Also move the aliases to board dts files.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-01-14 17:15:38 -06:00
Suman Anna a63ade175d arm: mach-k3: common: Add a release_resources_for_core_shutdown() stub
commit d86a089d29 upstream.

Add a weak release_resources_for_core_shutdown() stub implementation
that can be overridden by actual implementation if a SoC supports that
function.

Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
[praneeth@ti.com: cherry-pick commit 'd86a089d2946' from v2021.10-rc5]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2022-01-04 18:20:51 -06:00
Suman Anna 74f85260c9 firmware: ti_sci: Include linux/err.h in ti_sci_protocol.h
commit 0466275500 upstream.

The common TI SCI header file uses some macros from err.h and these
get exercised when CONFIG_TI_SCI_PROTOCOL is not defined. Include
the linux/err.h header file in this header file directly rather
than relying on source files to include it to eliminate any
potential build errors.

While at this, reorder the existing header file include to the
beginning of the file.

Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
[praneeth@ti.com: cherry-pick commit '04662755000c' from v2021.10-rc5]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2022-01-04 18:17:45 -06:00
Nishanth Menon 4cfd609f8d spl: fit: Skip attempting to load 0 length image
commit 6d99f86695 upstream.

When, for various reasons, a bad FIT image is used where a loadable
image is marked as 0 length, attempt is made for a 0 length allocation and
read of 0 byte read operation.

Instead provide warning in log and skip attempting to do such a load.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
[praneeth@ti.com: forward port commit '6d99f866952b' from upstream u-boot/next]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2022-01-04 14:41:34 -06:00
Nishanth Menon 816bdfe256 arm: mach-k3: common: Make sure firmware sections are loaded prior to armv8 startup
commit ee91d46557 upstream.

With Device Manager firmware in an elf file form, we cannot load the FIT
image to the exact same address as any of the executable sections of the
elf file itself is located.

However, the device tree descriptions for the ARMV8 bootloader/OS
includes DDR regions only the final sections in DDR where the Device
Manager firmware is actually executing out of.

As the R5 uC is usually operating at a slower rate than an ARMv8 MPU,
by starting the Armv8 ahead of parsing the elf and copying the correct
sections to the required memories creates a race condition where the
ARMv8 could overwrite the elf image loaded from the FIT image prior to
the R5 completing parsing and putting the correct sections of elf in
the required memory locations. OR create rather obscure debug conditions
where data in the section is being modified by ARMV8 OS while the elf
copy is in progress.

To prevent all these conditions, lets make sure that the elf parse and
copy operations are completed ahead of ARMv8 being released to execute.

We will pay a penalty of elf copy time, but that is a valid tradeoff in
comparison to debug of alternate scenarios.

Signed-off-by: Nishanth Menon <nm@ti.com>
[praneeth@ti.com: cherry-pick commit 'ee91d4655736' from upstream u-boot/next]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2022-01-04 14:40:50 -06:00
Aswath Govindraju b9979bc450 arm64: dts: k3-j721s2: Add support for OSPI Flashes
J721S2 has an OSPI NOR flash on its SOM connected the OSPI0 instance and a
QSPI NOR flash on the common processor board connected to the OSPI1
instance. Add support for the same

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju db8b91a3c7 arm: dts: k3-j721s2-common-proc-board: Enable PCIe
x1 lane PCIe slot in the common processor board is enabled and connected to
J721S2 SOM. Add PCIe DT node in common processor board to reflect the
same.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju cb8803248a arm: dts: k3-j721s2-*-common-proc-board: Add USB support
The board uses lane 1 of SERDES for USB. Set the mux
accordingly.

The USB controller and EVM supports super-speed for USB0
on the Type-C port. However, the SERDES has a limitation
that upto 2 protocols can be used at a time. The SERDES is
wired for PCIe, eDP and USB super-speed. It has been
chosen to use PCIe and eDP as default. So restrict
USB0 to high-speed mode.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 7b366ddfae arm: dts: k3-j721s2-common-proc-board: Enable SERDES0
Configure first lane to PCIe, the second lane to USB and the last two lanes
to eDP. Also, add sub-nodes to SERDES0 DT node to represent SERDES0 is
connected to PCIe.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju fc60dea8d6 arm: dts: k3-j721s2-mcu-wakeup: Add support of OSPI
Add support for two instance of OSPI in J721S2 SoC.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 8145aa9cdb arm: dts: k3-j721s2-main: Add PCIe device tree node
Add PCIe device tree node (both RC and EP) for the single PCIe
instance present in j721s2.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju d2e5f580d5 arm: dts: k3-j721s2-main: Add SERDES and WIZ device tree node
Add dt node for the single instance of WIZ (SERDES wrapper) and
SERDES module shared by PCIe, eDP and USB.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 46f09ed2c3 arm: dts: k3-j721s2-main: Add support for USB
Add support for single instance of USB 3.0 controller in J721S2 SoC.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang 637845e3c7 configs: j721s2_evm_a72_defconfig: Add A72 specific defconfig
Enable A72 specific configs for J721S2

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2021-12-15 21:47:21 -06:00
David Huang c67317c7a9 configs: j721s2_evm_r5_defconfig: Add R5 SPL specific defconfig
Enable R5 SPL specific configs for J721S2.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 5f2dc23d0a arm: dts: k3-j721s2-ddr: Add DDR support
J721S2 can support two instances for DDR. Therefore, add the device support
for the same and use 4266MT/s as DDR frequency.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 88ab3ee9c7 arm: dts: k3-j721s2: Add r5 specific dt support
Add initial support for device tree that runs on R5.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju feb75587ad arm: dts: Add support for A72 specific J721S2 Common Processor Board
The EVM architecture for J721S2 is similar to that of J721E and J7200. It
is as follows,

+------------------------------------------------------+
|   +-------------------------------------------+      |
|   |                                           |      |
|   |        Add-on Card 1 Options              |      |
|   |                                           |      |
|   +-------------------------------------------+      |
|                                                      |
|                                                      |
|                     +-------------------+            |
|                     |                   |            |
|                     |   SOM             |            |
|  +--------------+   |                   |            |
|  |              |   |                   |            |
|  |  Add-on      |   +-------------------+            |
|  |  Card 2      |                                    |    Power Supply
|  |  Options     |                                    |    |
|  |              |                                    |    |
|  +--------------+                                    | <---
+------------------------------------------------------+
                                 Common Processor Board

Common Processor board is the baseboard that contains most of the actual
connectors, power supply etc. The System on Module (SoM) is plugged on to
the common processor baord. Therefore, add support for peripherals brought
out in the common processor board.

Link to Common Processor Board: https://www.ti.com/lit/zip/sprr439

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 2b6147e167 arm: dts: Add initial support for J721S2 System on Module
A System on Module (SoM) contains the SoC, PMIC, DDR and basic high speed
components necessary for functionality. Therefore, add support for the
components present on the SoM.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 1def5dfa26 arm: dts: Add initial support for J721S2 SoC
The J721S2 SoC belongs to the K3 Multicore SoC architecture platform,
providing advanced system integration in automotive ADAS applications and
industrial applications requiring AI at the network edge. This SoC extends
the Jacinto 7 family of SoCs with focus on lowering system costs and power
while providing interfaces, memory architecture and compute performance for
single and multi-sensor applications.

Some highlights of this SoC are:

* Dual Cortex-A72s in a single cluster, three clusters of lockstep capable
dual Cortex-R5F MCUs, Deep-learning Matrix Multiply Accelerator(MMA), C7x
floating point Vector DSP.
* 3D GPU: Automotive grade IMG BXS-4-64
* Vision Processing Accelerator (VPAC) with image signal processor and
Depth and Motion Processing Accelerator (DMPAC)
* Two CSI2.0 4L RX plus one eDP/DP, two DSI Tx, and one DPI interface.
* Two Ethernet ports with RGMII support.
* Single 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role device subsystems,
* Up to 20 MCANs, 5 McASP, eMMC and SD, OSPI/HyperBus memory controller,
QSPI, I3C and I2C, eCAP/eQEP, eHRPWM, MLB among other peripherals.
* Hardware accelerator blocks containing AES/DES/SHA/MD5 called SA2UL
management.

See J721S2 Technical Reference Manual (SPRUJ28 – NOVEMBER 2021)
for further details: http://www.ti.com/lit/pdf/spruj28

Introduce basic support for the J721S2 SoC.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju a21dabc4cd dt-bindings: pinctrl: k3: Introduce pinmux definitions for J721S2
Add pinctrl macros for J721S2 SoC. These macro definitions are
similar to that of J721E, but adding new definitions to avoid
any naming confusions in the soc dts files.

checkpatch insists the following error exists:
ERROR: Macros with complex values should be enclosed in parentheses

However, we do not need parentheses enclosing the values for this
macro as we do intend it to generate two separate values as has been
done for other similar platforms.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 50b7d6a31c dt-bindings: ti-serdes-mux: Add defines for J721S2 SoC
There are 4 lanes in the single instance of J721S2 SERDES. Each SERDES
lane mux can select upto 4 different IPs. Define all the possible
functions.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang fa4ba37044 board: ti: j721s2: Add board support for J721S2
Add board support for J721S2 SoC

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang 96de110175 soc: ti: k3-socinfo: Add entry for J721S2 SoC
Add support for J721S2 SoC identification.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang ff3ac3f5fc ram: k3-ddrss: Add support for J721S2 SoC
Add support for DDR subsystem in J721S2 SoC.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang e4f1c40e50 power: domain: ti: Add support for J721S2 SoC
Add support for J721S2 SoC.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang 4b4ebb59e5 clk: clk-k3: Add support for J721S2 SoC
Add support J721S2 SoC.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang b949b9f649 drivers: dma: Add support for J721S2
Add support for DMA in J721S2 SoC.

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
David Huang 56140cdab8 arm: K3: Add basic support for J721S2 SoC definition
Add basic support for J721S2 SoC definition

Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju c702715935 ram: k3-ddrss: Add support for configuring MSMC subsystem in case of Multiple DDR subsystems
In Multi DDR subystems with interleaving support, the following needs to
configured,

- interleaving granular size and region
- EMIFs to be enabled
- EMIFs with ecc to be enabled
- EMIF separated or interleaved
- number of cycles of unsuccessful EMIF arbitration to wait before
  arbitrating for a different EMIF port, by default set to 3

Add support for configuring all the above by using a MSMC device

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju 9aa404eff1 ram: k3-ddrss: Add support for multiple instances of DDR subsystems
The current driver only supports single instance of DRR subsystem. Add
support for probing multiple instances of DDR subsystem.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Aswath Govindraju c985cef439 ram: k3-ddrss: lpddr4_structs_if.h: Add a pointer to ddr instance
Add a pointer to ddr instance int the lpddr4_privatedata_s structure for
supporting mutliple instances of DDR in the drivers.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2021-12-15 21:47:21 -06:00
Nishanth Menon 76f7558d33 remoteproc: k3_system_controller: Support optional boot_notification channel
If there is an optional boot notification channel that an SoC uses
separate from the rx path, use the same.

Signed-off-by: Nishanth Menon <nm@ti.com>
2021-12-15 21:47:21 -06:00
Yogesh Siraswar 15769936a5 configs: am64x: Add FIT ARGS for HS images
Add FIT ARGS required for loading FIT kernel images.

Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
[praneeth@ti.com: fix checkpatch warning on indentation]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2021-12-06 15:28:58 -06:00
Yogesh Siraswar 2a5e83ab89 defconfig: am64x_hs: Add SPL FIT post process
Add SPL FIT post process to authenticate signed images

Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
2021-12-06 15:24:26 -06:00
Sinthu Raja d3d039198f arm: dts: k3-j721e-sk: Update MAIN R5FSS cluster mode to Split-mode
The default U-Boot environment variables and design are all set up for
both the MAIN R5FSS clusters to be in Split-mode.

The mode for both the R5 clusters is defaulted to cluster mode. This
throws the following failure messages when early-booting the cores using
default env variables.

Error log:
k3_r5f_rproc r5f@5d00000: Invalid op: Trying to start secondary core 7 in lockstep mode
Load Remote Processor 3 with data@addr=0x82000000 322476 bytes: Failed!

Fix this by updating both the clusters to Split-mode in the u-boot specific
dtsi, to avoid this sync overrides in the future.

Reported-by: Shyam Jagannathan <shyam.jagannathan@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2021-12-02 17:51:22 -06:00
Amjad Ouled-Ameur d79399bcd7 env: ti: boot: define "boot" variable
AM57XX EVM cannot currently boot because "uuid" of root partition is
undefined. This makes the kernel panic and fail to boot successfully.

This issue 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>
2021-11-18 12:05:49 -06:00
Yogesh Siraswar 081b693cf7 k3_gen_x509_cert: Make SWRV configurable for anti-rollback protection
The x509 certificate SWRV is currently hard-coded to 0. This need to be
updated to 1 for j721e 1.1, j7200 and am64x. It is don't care for other
k3 devices.

Added new config K3_X509_SWRV to k3. Default is set to 1.

Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
Reviewed-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-17 18:40:27 -06:00
Pratyush Yadav 4198f8b93b configs: j721e_{hs_}evm_a72: Fix MTDPARTS_DEFAULT
Commit 34c9540d1c ("configs: j721e_evm_a72: Align OSPI partitions
on erase block boundary")

changed the partition scheme to use the same partition scheme for both
J721E EVM and SK. The partition scheme was supposed to be useable for
both Micron MT35 and Cypress S28 flashes by using a 256k partition
alignment so it would align with both MT35's 128k and S28's 256k
sector sizes.

However a calculation mistake was made in that commit which make the
ospi.rootfs partition too large, leaving no space for the
ospi.phypattern partition. As a result, Linux ignores the
ospi.phypattern partition at boot time and PHY calibration does not
happen. Resize the partitions so all of them get populated correctly.

Also sync up J721E HS defconfig so both have the same partition layout.

Fixes: 34c9540d1c ("configs: j721e_evm_a72: Align OSPI partitions on erase block boundary")
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
2021-11-17 14:18:37 -06:00
Suman Anna 1bc8841af3 clk: ti: k3: Update driver to account for divider flags
The K3 SoCs have some PLL output clocks (POSTDIV clocks) which in
turn serve as inputs to other HSDIV output clocks. These clocks use
the actual value to compute the divider clock rate, and need to be
registered with the CLK_DIVIDER_ONE_BASED flags. The current k3-clk
driver and data lacks the infrastructure to pass in divider flags.
Update the driver and data to account for these divider flags.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-11 18:56:23 -06:00
Dave Gerlach ebdcdf1161 clk: ti: k3-pll: Change DIV_CTRL programming to read-modify-write
There are three different divider values in the DIV_CTRL register
controlled by the k3-pll driver. Currently the ti_pll_clk_set_rate
function writes the entire register when programming plld, even though
plld only resides in the lower 6 bits.

Change the plld programming to read-modify-write to only affect the
relevant bits for plld and to preserve the other two divider values
present in the upper 16 bits, otherwise they will always get set to zero
when programming plld.

Fixes: 0aa2930ca1 ("clk: add support for TI K3 SoC PLL")
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-11 18:37:39 -06:00
Dave Gerlach f9ac2d1de8 arm: mach-k3: Add note to auto-generated files
Add a note to the automatically generated clk-data and dev-data files
for j721e and j7200 to indicate that they are in fact auto-generated and
should not be hand edited.

Also adjust TI URL to use https instead of http and also add an empty
line before first header inclusion.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-11 18:37:39 -06:00
Suman Anna e0b4d6faa2 arm: mach-k3: j7200: Fix clk-data parenting for postdiv PLL clocks
The TI K3 Fractional PLLs use two programmable POSTDIV1 and POSTDIV2
divisors to generate the final FOUTPOSTDIV clock. These are in sequence
with POSTDIV2 following the POSTDIV1 clock. The current J7200 clock data
has the POSTDIV2 clock as the parent for the POSTDIV1 clock, which is
opposite of the actual implementation. Fix the data by simply adjusting
the register bit-shifts.

The Main PLL1 POSTDIV clocks were also defined incorrectly using Main PLL0
register values, fix these as well.

Fixes: 277729eaf3 ("arm: mach-k3: Add platform data for j721e and j7200")
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-11 18:37:38 -06:00
Suman Anna 707dc06876 arm: mach-k3: j721e: Fix clk-data parenting for postdiv PLL clocks
The TI K3 Fractional PLLs use two programmable POSTDIV1 and POSTDIV2
divisors to generate the final FOUTPOSTDIV clock. These are in sequence
with POSTDIV2 following the POSTDIV1 clock. The current J721E clock data
has the POSTDIV2 clock as the parent for the POSTDIV1 clock, which is
opposite of the actual implementation. Fix the data by simply adjusting
the register bit-shifts.

The Main PLL1 POSTDIV clocks were also defined incorrectly using Main PLL0
register values, fix these as well.

Fixes: 277729eaf3 ("arm: mach-k3: Add platform data for j721e and j7200")
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2021-11-11 18:37:38 -06:00