Merge branch 'topic/4.19/dra7-late-attach' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y Pull in the dedicated remoteproc dra7-late-attach topic branch that limits the "late-attach" mode to only IPU1. This change is done as the default IPU2 firmware file for MultiMedia use-cases is incompatible with the 'no-map' carveouts needed by the late-attach functionality. * 'topic/4.19/dra7-late-attach' of ssh://bitbucket.itg.ti.com/rpmsg/remoteproc: TEMP: ARM: dts: dra7-ipu-common: Limit IPU early boot to only IPU1 Signed-off-by: Suman Anna <s-anna@ti.com>
TEMP: ARM: dts: dra7-ipu-common: Limit IPU early boot to only IPU1 The dra7-ipu-common-early-boot.dtsi file has the necessary changes to configure both the IPU1 and IPU2 remote processors for 'late attach' mode. Remove the changes for IPU2 for the moment to limit the 'late attach' mode for IPU1 only. This is being done due to the limitations with some of the current IPU2 firmware files. Signed-off-by: Suman Anna <s-anna@ti.com>
Merge branch 'topic/4.19/dra7-late-attach' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y Add required DT support for early-booted IPU on am57x and dra7xx platforms and revert previous hack for using CMA pools. * 'topic/4.19/dra7-late-attach' of git://git.ti.com/rpmsg/remoteproc: Revert "HACK: ARM: dts: dra7-ipu-common: Revert to CMA pools for IPU early boots" ARM: dts: am571x-idk: Provide support for early-booted IPU1 & IPU2 ARM: dts: am572x-idk-common: Provide support for early-booted IPU1 & IPU2 ARM: dts: beagle-x15-common: Provide support for early-booted IPU1 & IPU2 ARM: dts: dra71-evm: Provide support for early-booted IPU1 & IPU2 ARM: dts: dra72-evms: Provide support for early-booted IPU1 & IPU2 ARM: dts: dra76-evm: Provide support for early-booted IPU1 & IPU2 ARM: dts: dra7-evm: Provide support for early-booted IPU1 & IPU2 Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Revert "HACK: ARM: dts: dra7-ipu-common: Revert to CMA pools for IPU early boots" This reverts commit ed2d95b1520770319b74c58d69d0e5116f9dccdc. This patch must be reverted to enable IPU early boot when configured as default in SPL config. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Merge branch 'topic/4.19/am65x' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y Pull in the dedicated AM65x remoteproc topic branch that increases the IPC DDR carveout region used by the MCU domain R5F cores on AM65x platforms to match the current usage on the PDK IPC LLD firmwares. * 'topic/4.19/am65x' of git://git.ti.com/rpmsg/remoteproc: TEMP: arm64: dts: ti: k3-am654-base-board: Increase reserve memory for RTOS IPC Signed-off-by: Suman Anna <s-anna@ti.com>
TEMP: arm64: dts: ti: k3-am654-base-board: Increase reserve memory for RTOS IPC A 1 MB of carveout memory at 0xa2000000 is reserved currently for achieving IPC between the two MCU R5F cores when running in split-mode. The PDK IPC RTOS code though is currently accessing some memory beyond this 1 MB, used to also achieve IPC with the A53 cores running RTOS (Linux uses a separate 1 MB region per core as part of the overall 16 MB region). Reserve an additional 1 MB of memory temporarily until the RTOS code logic is fixed up to avoid memory corruptions with the linux kernel. Signed-off-by: Suman Anna <s-anna@ti.com>
Merge branch 'topic/4.19/dra7-late-attach' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y Pull in a dedicated remoteproc topic branch that adds the infrastructure support to allow "late-attach" of the IPU1 and IPU2 remote processors on DRA7xx/AM57xx SoCs. The late-attach feature is the kernel counterpart to the early-boot of these processors from U-Boot/SPL to achieve key system response time goals. The support is provided through temporary HACKs or workarounds to various subsystems that includes the DMA API layers, remoteproc core, OMAP IOMMU, OMAP DMTimer and OMAP remoteproc drivers. The early-booted remoteproc devices need couple of DT modifications, and these are provided through a common dtsi file. This common dtsi file needs to be included in the desired target DRA7/AM57xx board dts files (not merged but available on the above topic branch). The following are the main HACKs and needs further rework: - Introduce new non-zeroing DMA API to allow the remoteproc core to still process the RSC_CARVEOUTs but not zero them (This will need to be replaced with static carveout support) - The new "late_attach" field added to remoteproc core needs to be replaced with equivalent fields already present that supports the K3 IPC-only mode and Keystone 2 Multi Proc Manager (MPM) stack. - The .device_is_enabled() logic is only temporary and applicable only with hwmod layers, this will need to be replaced with logic around reset status from OMAP PRM reset driver (next LTS). - The reserved memory regions used should actually be carveouts (DMA pools), and this needs some resource table RSC_CARVEOUT entries split on all the existing firmwares. - The addition of the DT modifications needs to be evaluated if it can be moved into U-Boot itself. The current logic requires that both U-Boot and kernel configs are matched, without which kernel crashes are seen. * 'topic/4.19/dra7-late-attach' of git://git.ti.com/rpmsg/remoteproc: HACK: ARM: dts: dra7-ipu-common: Revert to CMA pools for IPU early boots TEMP: ARM: dts: dra7-ipu-common: Add a common file for IPU early boots TEMP: remoteproc/omap: add "late attach" support TEMP: iommu/omap: add support for performing a "late attach" ARM: OMAP2+: pdata-quirks: Add device_is_enabled ops for IOMMUs and rprocs clocksource: timer-ti-dm: Add support to handle late attach of rproc timers TEMP: remoteproc: call the non-zeroing allocation function TEMP: remoteproc: add "late attach" support HACK: dma-mapping: add non-zeroing coherent alloc function HACK: ARM: dma-mapping: create non-zeroing dma_map_ops Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: am571x-idk: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on the AM571x IDK board. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: am572x-idk-common: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors in the am572x-idk-common.dtsi file that applies to both the AM572x and AM574x IDK boards. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: beagle-x15-common: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on all the AM57xx BeagleBoard-X15 boards. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: dra71-evm: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on the DRA71 EVM board. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: dra72-evms: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on both the DRA72 EVM and DRA72 rev.C EVM boards. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: dra76-evm: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on the DRA76 EVM board. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: dra7-evm: Provide support for early-booted IPU1 & IPU2 Add support to enable the remoteproc late attach functionality of the IPU1 and IPU2 remote processors on the DRA7 EVM board. These processors should have been booted earlier by either the U-Boot or SPL. All the necessary node changes are applied by including the common dra7-ipu-common-early-boot.dtsi file. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
HACK: ARM: dts: dra7-ipu-common: Revert to CMA pools for IPU early boots The patch d1a42fca5944 ("TEMP: ARM: dts: dra7-ipu-common: Add a common file for IPU early boots") converts the default CMA pools used in regular remoteproc mode to carveouts/DMA pools for early-boot usage scenarios using the "no-map" property to avoid the kernel from corrupting the remoteproc firmware image sections. The allocation scheme with DMA pools though is different than with CMA pools, and this may cause some of the existing firmwares used in the regular remoteproc mode with CMA to fail. The DMA pools may require a number of changes in general: - Split the firmware RSC_CARVEOUT sections into better aligned memory regions conducive to the DMA pool allocation scheme. - Increase the vmalloc size, as the DMA pools are no longer mapped by default in kernel linear memory (for DDR < 2 GB) and needs to be mapped into vmalloc space to be accessed. This may depend on system configuration, number of remote cores using a DMA pool, and the sizes of the DMA pools. - Increase the size of the carveouts (last resort) Revert back to CMA pools temporarily to make the current firmware images be functional. A short-term fix would be to update the firmwares and the long-term fix would be to eliminate the allocation logic altogether and rely on fixed memory carveout support. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com>
TEMP: ARM: dts: dra7-ipu-common: Add a common file for IPU early boots The remoteproc 'late attach' functionality has the remote processors configured, programmed and booted early even before the kernel is booted. This includes loading the necessary firmware into memory, programming the IOMMU, configuring the required timers, and programming the corresponding device's clocks and resets. The omap hwmod init sequence includes resetting all the hwmods and idling them to put the devices in sane states to make them independent of bootloader and corresponding drivers. The "ti,no-idle-on-init" and "ti,no-reset-on-init" attributes are added to specific omap_hwmod's associated with the IPU1 & IPU2 processor subsystems to support the 'late attach' feature on these devices, and change the omap hwmod init behavior. The corresponding memory regions are also removed from the default kernel memory map (DMA pools instead of CMA pools) so that the kernel doesn't access anything in these regions until the remoteprocs are booted. The "ti,no-reset-on-init" attribute is needed to allow the omap_hwmod layer to not perform a reset (and thereby reset the programming done prior to kernel boot). The "ti,no-idle-on-init" is needed to leave the modules/device in enabled state (and thereby avoid any disabling of the clocks/modules). These attributes are added in a new common dtsi file that should be included into the corresponding TI DRA7xx and AM57xx boards that have actually early-booted the IPU processors. This file _must_ be included _only_ when both the IPU1 and IPU2 processors have been booted by SPL/U-boot. TODO: Evaluate the approach where U-Boot can directly add/modify these required properties using code. Such an approach would eliminate the need for maintaining one or more dtsi files/overlays and make the support self-contained within the bootloader. Signed-off-by: Amarinder Bindra <a-bindra@ti.com> Signed-off-by: Robert Tivy <rtivy@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: Venkateswara Rao Mandela <venkat.mandela@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: OMAP2+: pdata-quirks: Add device_is_enabled ops for IOMMUs and rprocs Add a new .device_is_enabled() platform data callback ops to both the OMAP IOMMU and remoteproc devices to check if the corresponding omap_device/hwmod is already enabled. This helps the OMAP IOMMU and remoteproc drivers to figure out if the corresponding processors have already been loaded and booted by bootloaders. Signed-off-by: Keerthy <j-keerthy@ti.com> [s-anna@ti.com: minor cleanups] Signed-off-by: Suman Anna <s-anna@ti.com>
HACK: ARM: dma-mapping: create non-zeroing dma_map_ops A new dma_ops, 'arm_dma_m_ops', is created from a copy of the standard 'arm_dma_ops' but with a new non-zeroing .alloc method. These ops are added mainly to support a 'late attach' feature in the OMAP remoteproc driver. When remoteproc does a 'late attach' to a remote processor, it does not load any firmware contents into memory, but it still needs to allocate the processor's CMA memory to mark the memory as reserved/used from the kernel. The standard 'arm_dma_ops' contains an .alloc method that zeroes out the memory, thereby overwriting the firmware code/data in the memory that was pre-loaded before the Linux kernel has booted. This scenario is handled by adding a new non-zeroing allocation function and using it as the .alloc method in a copy of the 'arm_dma_ops'. The so created 'arm_dma_m_ops' will be assigned as the rproc device's dma_ops when supporting the 'late attach' functionality. Signed-off-by: Martin Ambrose <martin@ti.com> Signed-off-by: Robert Tivy <rtivy@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Amarinder Bindra <a-bindra@ti.com> Signed-off-by: Venkateswara Rao Mandela <venkat.mandela@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com>
Merge branch 'rproc-linux-4.19.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y Pull in the updated remoteproc feature branch that renames the node names and labels for the reserved memory regions on DRA76 and DRA72 rev.C EVM boards to not use the CMA terminology. * 'rproc-linux-4.19.y' of git://git.ti.com/rpmsg/remoteproc: ARM: dts: dra76-evm: Fix rproc reserved-memory labels and node names ARM: dts: dra72-evm-revc: Fix rproc reserved-memory labels and node names Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: dts: dra76-evm: Fix rproc reserved-memory labels and node names The commit 1cc71af030c6 ("ARM: dts: dra76-evm: Add CMA pools and enable IPU & DSP rprocs") erroneously used the old CMA terminology in the DSP and IPU rproc reserved memory node names and labels. Fix these and align with the node names and labels used in all the other TI DRA7xx/AM57xx board dts files. Fixes: 1cc71af030c6 ("ARM: dts: dra76-evm: Add CMA pools and enable IPU & DSP rprocs") Signed-off-by: Suman Anna <s-anna@ti.com>