Commit Graph

70368 Commits

Author SHA1 Message Date
Roger Quadros 15afae24ab configs: am64x_[hs_]evm_r5_defconfig: NAND boot
Enable configuration required for NAND support on R5 SPL.

We need CONFIG_SOC_DEVICE_TI_K3 to detect the SoC
and apply SoC specific quirks.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros a98bdcfba9 configs: am64x_evm: provide NAND configuration
Provide NAND device and NAND driver configuration for AM64x EVM.

We are currently using raw NAND partitions for tispl.bin (A53 SPL)
and u-boot.img (A53 u-boot).

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 6b1382e303 arm: dts: k3-am642-sk: Fix chip id at SPL
The current way it is implemented chipid node is overridden
in the k3-am642-sk-u-boot.dtsi, losing compatible and other
properties of the chipid node defined in k3-am64-main.dtsi

We simply need to use a label and add "u-boot,dm-spl" property
in k3-am642-sk-u-boot.dtsi.

Fixes: cf26b081da9d ("arm: dts: am642-sk: Add initial sk dts")

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 0a83358acb arm: dts: k3-am642-evm: Fix chip id at SPL
The current way it is implemented chipid node is overridden
in the k3-am642-evm-u-boot.dtsi, losing compatible and other
properties of the chpid node defined in k3-am64-main.dtsi

We simply need to use a label and add "u-boot,dm-spl" property
in k3-am642-evm-u-boot.dtsi.

Fixes: 2c91701ba0 ("arm: dts: k3-am64-evm: Make chip id available before pre-reloc")

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 62ec935c3f arm: dts: k3-am642-evm: Add NAND support
Add NAND support for A53 SPL, u-boot and R5 SPL.

For A53 SPL & u-boot we use NAND overlay to add NAND support.

For R5 SPL, we include the NAND support in the board DTS file
(k3-am642-r5-evm.dts) as there is no way to use overlay in
BootROM at the moment.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 1c738366e8 board: ti: am64: select NAND overlay if HSE card present
Since we are using overlay for A53 SPL and A53 u-boot the
SPL must select the NAND overlay from the FIT image if
HSE card is present.

For simplicity sake, we only check if a card is present or not in
the HSE (High Speed Expansion) slot to determine if we need to
use NAND overlay.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 03b0a5db9a mtd: rawnand: omap_gpmc: support u-boot driver model
Adds driver model support.

We need to be able to self initialize the NAND controller/chip
at probe and so enable CONFIG_SYS_NAND_SELF_INIT.

Doing so requires nand_register() API which is provided by nand.c
and needs to be enabled during SPL build via CONFIG_SPL_NAND_INIT.
But nand.c also provides nand_init() so we need to get rid of nand_init()
in omap_gpmc driver if CONFIG_SPL_NAND_INIT is set.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 73c1633567 mtd: rawnand: omap_gpmc: Reduce .bss usage
Allocate omap_ecclayout on the heap as we have
limited .bss space on AM64 R5 SPL configuration.

Reduces .bss usage by 2984 bytes.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros b3af6d823a mtd: rawnandt: omap_gpmc: Add SPL loader support
Support NAND SPL loader. We rely on nand_base driver for
detecting the NAND chip, bad block detection and read page.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 621de68615 mtd: rawnand: nand_spl_loaders: Fix cast type build warning
Fixes the below build warning on 64-bit platforms.

drivers/mtd/nand/raw/nand_spl_loaders.c:26:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      dst = (void *)((int)dst - page_offset);

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 5fa461e6f2 mtd: rawnand: nand_base: Allow base driver to be used in SPL without nand_bbt
nand_bbt.c is not being built with the nand_base driver during SPL
build. This results in build failures if we try to access any nand_bbt
related functions.

Don't use any nand_bbt functions for SPL build.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 0561c1bb49 mtd: rawnand: omap: Fix BCH6/16 HW based correction
The BCH detection hardware can generate ECC bytes for multiple
sectors in one go. Use that feature.

correct() only corrects one sector at a time so we need to call it
repeatedly for each sector.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 53b7e499f0 mtd: rawnand: omap: Probe GPMC DM driver if enabled
GPMC is the parent of NAND controller. It needs to be probed
before NAND can work. Use uclass_get_device_by_driver() to
get and activate the GPMC driver.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 7b569aafc9 mtd: rawnand: omap2: Add workaround for 32-bit read limitation
Some SoCs have a limitation where GPMC reads cannot be less than
32-bits. Add workaround for such SoCs.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 5b2e01eeb2 mtd: rawnand: omap_gpmc: Optimize NAND reads
Rename omap_nand_read() to omap_nand_read_buf() to reflect
actual behaviour.

Use FIFO read address instead of raw read address for reads.

The GPMC automatically converts 32-bit/16-bit reads to NAND
device specific reads (8/16 bit). Use the largest possible
read granularity size for more efficient reads.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros a00e14e9ab mtd: rawnand: use force_8bit flag
In certain cases e.g. readid, only lower 8 I/O bits are used.
So for 16-bit devices we need to ensure that the read_buf function
skips the upper 8 I/O bits when returning data.

Provide a 'force_8bit' flag to the read_buf() hook to allow
for that.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros a92af887be mtd: rawnand: Add quirk to avoid 8-bit and 16-bit reads
Some platforms (e.g. TI AM64) have a limitation that 8-bit
and 16-bit reads do not behave correctly. We need to force 32-bit
reads on such platforms.

Try to use read_buf() ops as much as possible as platform driver
can take care of the quirk. For other places where we cannot use
read_buf() use the quirk flag to limit to 32-bit read.

There are still 2 places where read_byte/read_word is still in use
- nand_block_bad()
- nand_status_op()

A more proper fix will be to move to exec_op() like interface in
the kernel. But for now that might be an overkill.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros cb5e0eb151 arm: mach-k3: am642: Add ELM_BASE
The omap_elm driver still uses ELM_BASE macro to know the ELM module's
base address. Define it for am642 platform.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 40a7990781 arm: am33xx/omap3/omap4/omap5: Get rid of GPMC_MAX_CS
GPMC_NUM_CS is doing the same thing and there are no users
of GPMC_MAX_CS any more. Get rid of it.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros a12fe3ed51 mtd: rawnand: omap_gpmc: Get rid of GPMC_MAX_CS
GPMC_CS_NUM is the same thing so use that instead. This will
allow us to get rid of GPMC_MAX_CS from mem.h

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 80db321c47 memory: Add TI GPMC driver
GPMC is a General Purpose Memory Controller module which is
present on many Texas Instruments SoCs.

Use a simple bus class so we can probe its children.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 483bfb88aa scripts: Makefile.spl: Enable memory drivers to be built for SPL
We will need ti-gpmc driver for SPL. Allow memory drivers
do be built for SPL.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros d86b3b82b4 arm: dts: k3-am64-main: Add GPMC and ELM nodes
The GPMC is a unified memory controller dedicated for interfacing
with external memory devices like
- Asynchronous SRAM-like memories and ASICs
- Asynchronous, synchronous, and page mode burst NOR flash
- NAND flash
- Pseudo-SRAM devices

The ELM module is used for GPMC NAND accesses for detecting
and correcting errors during reads due to NAND bitflips errors.

4-, 8-, and 16-bit error-correction levels are supported using
the BCH (Bose-ChaudhurI-Hocquenghem) algorithm.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 77be322324 mtd: rawnand: omap_gpmc: Fix build warning on 64-bit platforms
Pointer size cannot be assumed to be 32-bit, so use
use uintptr_t instead of uint32_t.

Fixes the below build warning on 64-bit builds.

drivers/mtd/nand/raw/omap_gpmc.c:439:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  head = ((uint32_t) buf) % 4;

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros afb06c74c1 arm: mach-k3: am642: Define NAND boot device
AM642 SoC supports booting from GPMC NAND device.
Define boot device for it.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros c462814289 mtd: rawnand: omap_gpmc: Enable build for K2/K3 platforms
The GPMC module is present on some K2 and K3 SoCs.
Enable building GPMC NAND driver for K2/K3 platforms.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Roger Quadros 015cf62d07 configs: am64x_[hs_]evm_a53_defconfig: Drop NAND partitions from mtdparts
Feedback from u-boot maintainer was to pass NAND partitions
via device tree. Get rid of them from mtdparts cmdline argument.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2022-02-02 16:22:01 -06:00
Hari Nagalla ba2e5bd756 configs: am64x_hs_evm_r5_defconfig: Add support for ESM driver
Enable ESM driver for AM64x R5 SPL/u-boot builds.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2022-02-02 15:46:33 -06:00
Hari Nagalla c8f46f918b configs: am64x_evm_r5_defconfig: Add support for ESM driver
Enable ESM driver for AM64x R5 SPL/u-boot builds.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2022-02-02 15:46:33 -06:00
Hari Nagalla 7f67536f37 arch: arm: mach-k3: am642_init: Probe ESM nodes
On AM64x devices, it is possible to route Main ESM0 error events to MCU
ESM. MCU ESM high error output can trigger the reset logic to reset the
device. So, for these devices we expect two ESM device nodes in the
device tree, one for Main ESM and the another MCU ESM in the device tree.
 When these ESM device nodes are properly configired it is possible to
route the Main RTI0 WWDT output to the MCU ESM high ouput through Main
ESM and trigger a device reset when
CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is set to '0'.

On K3 AM64x devices, the R5 SPL u-boot handles the ESM device node
configurations.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2022-02-02 15:46:33 -06:00
Hari Nagalla 6fd935c81e arm: dts: k3-am64: Add support for ESM device nodes
Enable acces to ESM0 configuration space and add Main ESM0 and MCU ESM
nodes to the AM64 device tree.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2022-02-02 15:46:33 -06:00
Hari Nagalla 7cb0ea5b22 misc: k3_esm: Add functionality to set and route error events within K3SoC
Add functionality to enable, set priority to the input events and to
route to MCU ESM. On AM64x/AM62x devices, it is possible to route Main
ESM0 error events to MCU ESM. When these error events are routed to MCU
ESM high output, it can trigger the reset logic to reset the device,
when CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is set to '0'.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
2022-02-02 15:46:33 -06:00
Bryan Brattlof e0f967f836 soc: soc_ti_k3: update j721e revision numbering
There is a 4 bit VARIANT number inside the JTAGID register that TI
increments any time a new variant for a chip is produced. Each
family of TI's SoCs uses a different versioning scheme based off
that VARIANT number.

Signed-off-by: Bryan Brattlof <bb@ti.com>
2022-02-01 20:39:48 -06:00
Aswath Govindraju 10b387cfae include: configs: j721e_evm: Add support to boot ethfw core in j721e
Add configs to enable booting ethfw core in j721e

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju 3a86277c75 arm: dts: k3-j721e: Add support for multilink PCIe + QSGMII
Add support for QSGMII multilink configuration.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju f843955e58 phy: cadence: Sierra: Add support for skipping configuration
In some cases, a single SerDes instance can be shared between two different
processors, each using a separate link. In these cases, the SerDes
configuration is done in an earlier boot stage. Therefore, add support to
skip reconfiguring, if it is was already configured beforehand.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 9ce8270a60 phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration
Add register sequences for PCIe + QSGMII PHY multilink configuration.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 1f7c427879 phy: cadence: Sierra: Add support for PHY multilink configurations
Add support for multilink configuration of Sierra PHY. Currently,
maximum two links are supported.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade d9a0b4865e phy: cadence: Sierra: Update single link PCIe register configuration
Add single link PCIe register configurations for no SSC and internal
SSC. Also, add missing PMA lane registers for external SSC.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade b45f362157 phy: cadence: Sierra: Check PIPE mode PHY status to be ready for operation
PIPE phy status is used to communicate the completion of several PHY
functions. Check if PHY is ready for operation while configured for
PIPE mode during startup.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 91f1c0dbc9 phy: cadence: Sierra: Check cmn_ready assertion during PHY power on
Check if PMA cmn_ready is set indicating the startup process is complete.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 41cd5f1c56 phy: cadence: Sierra: Add PHY PCS common register configurations
Add PHY PCS common register configuration sequences for single link.
Update single link PCIe register sequence accordingly.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade b3428838f4 phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation
No functional change. Rename some regmap variables as mentioned in Sierra
register description documentation.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 7d66c453bb phy: cadence: Sierra: Add support to get SSC type from device tree.
Add support to get SSC type from DT.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade 443c59615b dt-bindings: phy: cadence-sierra: Add binding to specify SSC mode
Add binding to specify Spread Spectrum Clocking mode used

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Swapnil Jakhade f54b80a4df phy: cadence: Sierra: Prepare driver to add support for multilink configurations
Sierra driver currently supports single link configurations only. Prepare
driver to support multilink multiprotocol configurations along with
different SSC modes.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju 629a689abe arm: dts: k3-j721e: Add support for PLL_CMNLC clocks in SerDes0
The PLL_CMNLC clocks are modelled as a child clock device of seirra. In the
function device_probe, the corresponding clocks are probed before calling
the device's probe. The PLL_CMNLC mux clock can only be created after the
device's probe. Therefore, move assigned-clocks and assigned-clock-parents
to the link nodes in U-Boot device tree file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju 07ab0668f7 baord: ti: j721e: evm.c: Add support for probing SerDes0
Add support for probing, initializing and powering, SerDes0 instance.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju 96ca5748e4 phy: ti: phy-j721e-wiz.c: Fix the condition for setting P_ENABLE_FORCE
Fix the condition for setting P_ENABLE_FORCE bit, by syncing with the
driver in kernel.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00
Aswath Govindraju 83439eef02 phy: cadence: Sierra: Model PLL_CMNLC and PLL_CMNLC1 as a clock
Sierra has two PLLs, PLL_CMNLC and PLL_CMNLC1 and each of these PLLs has
two inputs, plllc_refclk (input from pll0_refclk) and refrcv (input from
pll1_refclk). Model PLL_CMNLC and PLL_CMNLC1 as a clock so that it's
possible to select one of these two inputs from device tree.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2022-02-01 19:57:23 -06:00