Template:Glsdk late attach

= Using the Late attach functionality =

To satisfy the startup time requirements of specific use cases, one may need the boot loader to boot a remote core before booting the A15 with the linux kernel. The kernel then attaches to the already booted remote core for further communication. We refer to this feature as the &quot;Early Boot - Late Attach&quot; functionality. The &quot;Early Boot&quot; functionality is provided by the boot loader. The &quot;Late Attach&quot; functionality is a feature of the Linux Kernel. This functionality was added to GLSDK from v6.04. It has been reworked to support migration to the 3.14 kernel in GLSDK v7.0.

Below are the steps required to test early boot late attach functionality.

Configuring U-Boot
Please define the macro  in the file. Change the lines


 * 1) undef CONFIG_LATE_ATTACH

to
 * 1) ifdef CONFIG_LATE_ATTACH


 * 1) define CONFIG_LATE_ATTACH

and rebuilt u-boot using the configuration.
 * 1) ifdef CONFIG_LATE_ATTACH

Building the Linux kernel device tree
Linux kernel contains the &quot;Late Attach&quot; feature builtin. The feature is enabled or disabled on a per remote core basis at boot time through device tree node attributes. To enable &quot;Late Attach&quot; for a remote core, 3 attributes need to be set on the remote core and each of the timer, mmu nodes used by the remotecore. These three attributes are



These three attributes together signal to the kernel that


 * 1) Late attach feature is in use for the remote core.
 * 2) The remotecore and other nodes have been configured and are in use before the kernel boot. These should not be reset or idled during kernel boot.

The Linux kernel tree delivered with Processor SDK Linux Automotive includes a dts file that shows how to enable late attach feature for IPU2 on a DRA7xx evm with 7&quot; LCD. This file was built in the following manner. The timers used by IPU2 are found from

&amp;ipu2 { status = &quot;okay&quot;; memory-region = &lt;&amp;ipu2_cma_pool&gt;; mboxes = &lt;&amp;mailbox6 &amp;mbox_ipu2_legacy&gt;; timers = &lt;&amp;timer3&gt;; watchdog-timers = &lt;&amp;timer4&gt;, &lt;&amp;timer9&gt;; }; The MMU used by IPU2 can be found from.

ipu2: ipu@55020000 { compatible = &quot;ti,dra7-rproc-ipu&quot;; reg = &lt;0x55020000 0x10000&gt;; reg-names = &quot;l2ram&quot;; ti,hwmods = &quot;ipu2&quot;; iommus = &lt;&amp;mmu_ipu2&gt;; ti,rproc-standby-info = &lt;0x4a008920&gt;; status = &quot;disabled&quot;; }; IPU2 uses  to supply the OS tick and   and   as watchdog timers. IPU2 also uses an MMU referred to as  in the device tree. All of these nodes including the IPU2 node need to have the three attributes described above set.

The file  has the full example. This file is structured such that it includes an existing configuration first

and sets only the atrributes required for enabling late attach functionality.
 * 1) include &quot;dra7-evm-lcd7.dts&quot;

Late attach can be enabled for other remotecores by setting the late attach atributes on the corresponding device tree nodes. Late attach can be enabled for other hardware configurations by choosing a different base  file. e.g. If the EVM has a 10&quot; lcd instead of 7&quot; LCD, you can change the include to &quot;dra7-evm-lcd10.dts&quot; instead of &quot;dra7-evm-lcd7.dts&quot;.

Build the  file and use it for linux boot instead of the regular dtb file.

Boot setup

 * 1) Configure the EVM for boot from SD card.
 * 2) Use the MLO and u-boot.img built above with the early boot functionality enabled.
 * 3) Use the dtb file built with the late attach functionality enabled.
 * 4) Copy the IPU2 binary into the boot partition of the SD card. The IPU2 binary can be found in   on the target filesystem.

Boot the board and test the IPU2 functionality as you would normally do. You will not notice any difference in the functionality except that the IPU2 was already loaded and running before the Linux Kernel was booted.

Confirming Late attach functionality
There is no default indication of whether late attach feature is in use or not. This is by design as use of late attach should be invisible to the user. For debug purposes, enable the  flag on   during kernel compilation. If late attach functionality is in use, additional traces will now show up in the dmesg logs.

root@dra7xx-evm:~# dmesg | grep late-attach [ 2.609644] omap-rproc 55020000.ipu: device will be late-attached.

Customizing Early Boot for a Usecase
The Early boot code in U-Boot does the necessary configuration to bring up a remotecore. This includes the timers and the MMUs. It does not configure any other peripherals by default. Some usecases may require additional peripheral configuration before running the remotecore. U-Boot includes placeholder functions that can be populated for this purpose. These can be found in the file.

/* * If the remotecore binary expects any peripherals to be setup before it has * booted, configure them here. * * These functions are left empty by default as their operation is usecase * specific. */

u32 ipu1_config_peripherals(u32 core_id, struct rproc *cfg) {   return 0; }

u32 ipu2_config_peripherals(u32 core_id, struct rproc *cfg) {   return 0; }

u32 dsp1_config_peripherals(u32 core_id, struct rproc *cfg) {   return 0; }

u32 dsp2_config_peripherals(u32 core_id, struct rproc *cfg) {   return 0; }

Validation and Limitations
Late attach functionality has been validated for all the remotecores IPU2,IPU1,DSP1 and DSP2. However there is the following limitation.


 * 1) U-Boot has only been updated to load remotecore binaries from the boot partition of the SD card or eMMC.

Debug guide
A more detailed user guide of Early Boot and Late Attach functionality can be found at Early Boot and Late Attach in Linux

= Using the Early video decode example =

Early Video decode is not supported in the GLSDK 7.0 EA release.