Skip to content

Commit 1c620ac

Browse files
AashvijShenaipraneethbajjuri
authored andcommitted
fix(Linux): Update boot time guide for 11.0 release
- Add the section to profile boot time inside the kernel using GPIO - Fix random whitespaces - Update boot time numbers and other sections for AM62P 11.0 Signed-off-by: Aashvij Shenai <[email protected]> Signed-off-by: Paresh Bhagat <[email protected]>
1 parent 2224c4c commit 1c620ac

File tree

1 file changed

+81
-52
lines changed

1 file changed

+81
-52
lines changed

source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

Lines changed: 81 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This guide uses 10.0 Processor SDK as reference.
3939
- `PROCESSOR-SDK-LINUX-AM62AX <https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM62A>`_
4040

4141
- `MCU+ SDK AM62AX <https://www.ti.com/tool/download/MCU-PLUS-SDK-AM62A>`_
42-
42+
4343
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
4444

4545
- `PROCESSOR-SDK-LINUX-AM62PX <https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM62P>`_
@@ -82,7 +82,7 @@ This section details the Out-Of-Box boot sequence:
8282

8383
**TF-A** (Trusted Firmware - Arm) provides a reference trusted code base for the Armv8 architecture. It implements various ARM interface standards. The binary is typically included in the bootloader binary. It starts in the early stages of U-Boot. Without ATF, the kernel cannot setup the services which need to be executed in the Secure World environment
8484

85-
**OPTEE** (Trusted Execution Environment) is designed as a companion to a non-secure Linux kernel running on Arm; Cortex-A cores using the TrustZone technology.
85+
**OPTEE** (Trusted Execution Environment) is designed as a companion to a non-secure Linux kernel running on Arm; Cortex-A cores using the TrustZone technology.
8686

8787
**U-boot** proper is the second stage bootloader. It offers a flexible way to load and start the Linux Kernel and provides a minimal set of tools to interact with the board’s hardware via a command line interface. It runs from DRAM, initializing additional hardware devices (network, USB, DSI/CSI, etc.). Then, it loads and prepares the device tree (FDT). The main task handled by the U-Boot is the loading and starting of the kernel image itself.
8888

@@ -188,8 +188,8 @@ Secondary Boot Loader (SBL)
188188

189189
- Removing unnecessary prints
190190

191-
The default examples contain a large number of prints that impact boot time and need to be removed.
192-
191+
The default examples contain a large number of prints that impact boot time and need to be removed.
192+
193193
- Navigate to the main.c of your example and remove calls to the following functions
194194
- ``Bootloader_profileAddCore``
195195
- ``Bootloader_profileAddProfilePoint``
@@ -221,22 +221,6 @@ Secondary Boot Loader (SBL)
221221
.. Image:: /images/SBL_enable_dma.png
222222
:align: center
223223

224-
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
225-
226-
- Enable High Capacity(HC) channel DMA
227-
228-
This upgrades the DMA channel's FIFO depth from 128 to 192 and has been shown to have more than 200% increase in DMA transfer performance. In AM62P, the first four channels are high capacity. By default, these channels have been assigned to the A53 core by order of core priority which A53 has the first 18 channels, DM R5 has the next 6 and lastly, MCU R5 has 2.
229-
230-
- :download:`This patch </files/AM62P-Change-DMA-allocation.patch>` removes the DMA allocation of A53 and MCU cores to showcase the use of High capacity channels
231-
232-
.. note::
233-
234-
It is not possible to assign the first 2 channels to DM R5, the next 2 to A53, next 4 again to DM R5 and so on.
235-
236-
- Rebuild the boardcfg : `BOARCFG_GEN <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/latest/exports/docs/api_guide_am62px/TOOLS_SYSFW.html#BOARCFG_GEN>`_
237-
238-
- Flash the binaries
239-
240224
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
241225

242226
- FastXSPI
@@ -252,7 +236,7 @@ Secondary Boot Loader (SBL)
252236
- :download:`OSPI-NOR @166MHz </files/fastxspi_pattern_am62p_166MHz.bin>`
253237

254238
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
255-
239+
256240
- Use DDR in single rank configuration
257241

258242
The number of ranks on any DIMM is the number of independent sets of DRAMs that can be accessed for the full data bit-width of the DIMM. Dual rank gives us access to a bigger memory bank but consumes twice the tuning time. By default, DDR is in dual rank configuration and takes ~35ms that is visible in ``System_init`` in the SBL logs.
@@ -297,13 +281,13 @@ Reducing Linux kernel boot time
297281
298282
- Using a smaller kernel system
299283

300-
- By default, the kernel image contains a lot of drivers and filesystems to enable the functionality supported for the board but are not necessary for early boot. Trim kernel capabilities by using
301-
302-
- `ti_arm64_prune.config` - removes irrelevant platform drivers
284+
- By default, the kernel image contains a lot of drivers and filesystems to enable the functionality supported for the board but are not necessary for early boot. Trim kernel capabilities by using
285+
286+
- `ti_arm64_prune.config` - removes irrelevant platform drivers
303287
- `ti_early_display.config` - converts the majority of functionality into loadable modules
304288

305289
Usage:
306-
290+
307291
.. code-block:: console
308292
309293
kernel$ make ARCH=arm64 CROSS_COMPILE=<path-to-compiler>/aarch64-none-linux-gnu- defconfig ti_arm64_prune.config ti_early_display.config
@@ -334,21 +318,21 @@ In order to package the filesystem as initramfs into the kernel, follow these st
334318
335319
2. Edit the kernel config:
336320

337-
.config:
338-
321+
.config:
322+
339323
.. code-block:: kconfig
340324
341325
CONFIG_INITRAMFS_SOURCE="/path/to/filesystem"
342-
326+
343327
or using :code:`menuconfig`:
344328

345329
.. code-block:: kconfig
346330
347331
kernel$ make ARCH=arm64 CROSS_COMPILE=<path-to-compiler>/aarch64-none-linux-gnu- menuconfig
348332
349-
General setup ->
350-
Initial RAM filesystem and RAM disk (initramfs/initrd) support ->
351-
Initramfs source file(s)
333+
General setup ->
334+
Initial RAM filesystem and RAM disk (initramfs/initrd) support ->
335+
Initramfs source file(s)
352336
/path/to/filesystem
353337
354338
3. Rebuild the kernel
@@ -380,7 +364,7 @@ The time taken to boot filesystem is measured from Process ID 1(PID1) to login p
380364
host$ rm -r <filesystem>/usr/lib/opkg
381365
host$ rm <filesystem>/etc/issue
382366
host$ cd <filesystem>/dev
383-
host$ mknod -m 0600 null c 1 3
367+
host$ mknod -m 0600 null c 1 3
384368
385369
This removes 52ms from the boot up time.
386370

@@ -443,7 +427,7 @@ The following section displays the time taken by each stage to start and end. Fo
443427
444428
445429
| Range 3 (SBL_start to SBL_end):
446-
| This range measures the time the bootloader takes to configure the DDR, load + start the default HSM core, MCU core and Application Core. The GPIO that was set to LOW for SBL_start can be set to HIGH by copying the above code section and using `GPIO_pinWriteHigh`.
430+
| This range measures the time the bootloader takes to configure the DDR, load + start the default HSM core, MCU core and Application Core. The GPIO that was set to LOW for SBL_start can be set to HIGH by copying the above code section and using `GPIO_pinWriteHigh`.
447431
448432
.. ifconfig:: CONFIG_part_variant in ('AM62PX')
449433

@@ -513,6 +497,45 @@ In the `&main_uart0` node, connect the GPIO by adding
513497
514498
test-gpios = <&main_gpio0 39 GPIO_ACTIVE_HIGH>;
515499
500+
Update the :file:`drivers/tty/serial/8250/8250_omap.c` driver. Add the following section before the `omap8250_probe` function:
501+
502+
.. code-block:: C
503+
504+
static struct gpio_desc *gpio;
505+
506+
void test_gpio_on(void)
507+
{
508+
gpiod_direction_output(gpio, 1);
509+
gpiod_set_value(gpio, 1);
510+
}
511+
EXPORT_SYMBOL_GPL(test_gpio_on);
512+
void test_gpio_off(void)
513+
{
514+
gpiod_direction_output(gpio, 0);
515+
gpiod_set_value(gpio, 0);
516+
517+
}
518+
EXPORT_SYMBOL_GPL(test_gpio_off);
519+
520+
and the following in the `omap8250_probe` function:
521+
522+
.. code-block:: C
523+
524+
gpio = devm_gpiod_get(&pdev->dev, "test", GPIOD_OUT_LOW);
525+
if (IS_ERR(gpio)) {
526+
return PTR_ERR(gpio);
527+
}
528+
529+
To measure the instance when the filesystem starts, navigate to :file:`init/main.c` and toggle the GPIO:
530+
531+
.. code-block:: C
532+
533+
/* Declare test_gpio somewhere before the kernel_init function */
534+
void test_gpio_on(void);
535+
536+
/* Inside the kernel_init function and before ramdisk_execute_command, place this*/
537+
test_gpio_on();
538+
516539
.. ifconfig:: CONFIG_part_variant in ('AM62X')
517540

518541
.. Image:: /images/am62x_ospi_boot_analyser.png
@@ -522,7 +545,7 @@ In the `&main_uart0` node, connect the GPIO by adding
522545
523546
[2024-03-29 11:52:40.318] NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
524547
[2024-03-29 11:52:40.318] NOTICE: BL31: Built : 16:09:05, Feb 9 2024
525-
[2024-03-29 11:52:41.098]
548+
[2024-03-29 11:52:41.098]
526549
[2024-03-29 11:52:41.098] am62xx-evm login:
527550
528551
+-------------------+-----------+
@@ -545,15 +568,15 @@ In the `&main_uart0` node, connect the GPIO by adding
545568

546569
.. Image:: /images/am62ax_ospi_boot_analyser.png
547570
:align: center
548-
571+
549572
-622ms includes SBL C7x image load
550573

551574
.. code-block:: console
552575
553576
[2024-03-29 13:02:19.196] NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
554577
[2024-03-29 13:02:19.196] NOTICE: BL31: Built : 16:09:05, Feb 9 2024
555-
[2024-03-29 13:02:19.991]
556-
[2024-03-29 13:02:19.991] am62xx-evm login:
578+
[2024-03-29 13:02:19.991]
579+
[2024-03-29 13:02:19.991] am62xx-evm login:
557580
558581
+--------------------+-----------+
559582
| Stage | Time (ms) |
@@ -578,28 +601,32 @@ In the `&main_uart0` node, connect the GPIO by adding
578601

579602
.. code-block:: console
580603
581-
[2024-03-29 14:31:25.265] NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
582-
[2024-03-29 14:31:25.265] NOTICE: BL31: Built : 16:09:05, Feb 9 2024
583-
[2024-03-29 14:31:26.117]
584-
[2024-03-29 14:31:26.117] am62xx-evm login:
604+
[2025-03-28 18:04:41.581] NOTICE: BL31: v2.12.0(release):11.00.08-1-gb11beb2b6-dirty
605+
[2025-03-28 18:04:41.581] NOTICE: BL31: Built : 12:35:58, Mar 24 2025
606+
[2025-03-28 18:04:42.430]
607+
[2025-03-28 18:04:42.430] am62xx-evm login:
585608
586609
+-----------------+-----------+
587610
| Stage | Time (ms) |
588611
+=================+===========+
589612
| PMIC (TPS65224) | 15 |
590613
+-----------------+-----------+
591-
| ROM | 31 |
614+
| ROM | 30 |
592615
+-----------------+-----------+
593-
| SBL | 185 |
616+
| SBL | 188 |
594617
+-----------------+-----------+
595-
| Linux Kernel | 498 |
618+
| Linux Kernel | 587 |
596619
+-----------------+-----------+
597-
| Tiny FS | 355 |
620+
| Tiny FS | 262 |
598621
+-----------------+-----------+
599-
| Total | 1084 |
622+
| Total | 1082 |
600623
+-----------------+-----------+
601624

602-
Bootloader loads HSM binary (9KB), MCU/DSP image (50KB) and Kernel+FS image (21MB) in the above measurements
625+
Bootloader loads HSM binary (9KB), MCU/DSP image (50KB) and Kernel+FS image (22MB) in the above measurements
626+
627+
.. note::
628+
629+
Filesytem time is measured using minicom time stamp. ( Boot Time via minicom - Kernel time by GPIO = Filesystem Time )
603630

604631
Additional notes
605632
----------------
@@ -608,17 +635,19 @@ Additional notes
608635

609636
.. note::
610637

611-
Ensure that you are not affecting your host computer when making the changes detailed below
638+
Ensure that you are not affecting your host computer when making the changes detailed below.
639+
For early display with OLDI panel, disable bridge-hdmi or sii9022 node in device tree.
640+
Also use fdtoverlay command to modify dtb file (base tree) with dtbo overlay for OLDI panel.
612641

613-
- This statically compiled :download:`modetest </files/modetest>` can be added to the filesystem to test out display at boot on an OLDI panel.
642+
- This statically compiled :download:`modetest </files/modetest>` can be added to the filesystem to test out display at boot on an OLDI panel.
614643

615644
- `init` is a symbolic link to /sbin/init. Remove the file sbin/init
616645

617646
.. code-block:: console
618647
619648
rm <filesystem>/sbin/init
620649
621-
- Create a new sbin/init and add the following.
650+
- Create a new sbin/init and add the following.
622651

623652
.. code-block:: sh
624653
@@ -632,7 +661,7 @@ Additional notes
632661
# 40 - connector ID
633662
# 38 - CRTC ID
634663
# 1920x1200 - resolution of panel
635-
modetest -M tidss -s 40@38:1920x1200 &
664+
(modetest -M tidss -s 40@38:1920x1200 0<&- 2>/tmp/output.log) &
636665
637666
exec /sbin/init.sysvinit $*
638667
@@ -646,7 +675,7 @@ Additional notes
646675
647676
648677
.. ifconfig:: CONFIG_part_variant in ('AM62AX')
649-
678+
650679
- While AM62A ships with OSPI-NAND, it can be replaced with the OSPI-NOR flash with ease. NAND flash support needs to be replaced with NOR flash support
651680

652681
- SPL:

0 commit comments

Comments
 (0)