This message will disappear after all relevant tasks have been resolved.
Semantic MediaWiki
There are 1 incomplete or pending task to finish installation of Semantic MediaWiki. An administrator or user with sufficient rights can complete it. This should be done before adding new data to avoid inconsistencies.Registered User mNo edit summary |
Registered User |
||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
{{SoftwareLicenseAgreement | distribution=OpenSTLinux | chapter=Kernel partitions:}} | {{SoftwareLicenseAgreement | distribution=OpenSTLinux | chapter=Kernel partitions:}} | ||
======For {{EcosystemRelease | revision=2.1.0}}====== | |||
* Download the [{{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel package | request=url}}/{{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel package | request=name}} STM32MP15-Ecosystem-v2.1.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package''' | |||
* Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments | |||
{{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package | |||
{{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel package | request=name}} | |||
<div class="mw-collapsible mw-collapsed"> | |||
======For {{EcosystemRelease | revision=2.0.0}}====== | ======For {{EcosystemRelease | revision=2.0.0}}====== | ||
<div class="mw-collapsible-content"> | |||
* Download the [{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=url}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} STM32MP15-Ecosystem-v2.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package''' | * Download the [{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=url}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} STM32MP15-Ecosystem-v2.0.0 Developer Package Sources] to the following directory:<br> '''$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package''' | ||
* Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments | * Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments | ||
{{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package | {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package | ||
{{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} | {{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=name}} | ||
</div> | |||
==Prepare the Linux® kernel source code== | ==Prepare the Linux® kernel source code== | ||
* Extract the Linux® kernel source | * Extract the Linux® kernel source | ||
For {{EcosystemRelease | revision=2.0.0}} | For {{EcosystemRelease | revision=2.1.0}} | ||
{{PC$}} cd {{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel package | request=path}} | |||
{{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel source | request=name}} | |||
For {{EcosystemRelease | revision=2.0.0}}<span class="mw-collapsible mw-collapsed"> | |||
{{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}} | {{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}} | ||
{{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=name}} | {{PC$}} tar xvf {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=name}} | ||
</span> | |||
* Apply the ST patches | * Apply the ST patches | ||
{{PC$}} cd {{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel source | request=path}} /* '''For {{EcosystemRelease | revision=2.1.0 }} '''*/ | |||
{{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} /* '''For {{EcosystemRelease | revision=2.0.0 }} '''*/ | {{PC$}} cd {{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} /* '''For {{EcosystemRelease | revision=2.0.0 }} '''*/ | ||
{{PC$}} for p in `ls -1 ../*.patch`; do patch -p1 < $p; done | {{PC$}} for p in `ls -1 ../*.patch`; do patch -p1 < $p; done | ||
Line 46: | Line 60: | ||
===Push the kernel modules into the board=== | ===Push the kernel modules into the board=== | ||
* Remove the link created inside the '''install_artifact/lib/modules/<kernel version>''' directory | * Remove the link created inside the '''install_artifact/lib/modules/<kernel version>''' directory | ||
For {{EcosystemRelease | revision=2.1.0}}: | |||
{{PC$}} rm install_artifact/lib/modules/5.4.56/build install_artifact/lib/modules/5.4.56/source | |||
For {{EcosystemRelease | revision=2.0.0}}: | For {{EcosystemRelease | revision=2.0.0}}: | ||
{{PC$}} rm install_artifact/lib/modules/5.4.31/build install_artifact/lib/modules/5.4.31/source | {{PC$}} rm install_artifact/lib/modules/5.4.31/build install_artifact/lib/modules/5.4.31/source | ||
Line 70: | Line 86: | ||
* Go to the Linux® kernel source directory | * Go to the Linux® kernel source directory | ||
For {{EcosystemRelease | revision=2.0.0}}: | For {{EcosystemRelease | revision=2.1.0}}: | ||
{{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package/{{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel package | request=path}}/{{EcosystemRelease/Package | revision=2.1.0 | package=Linux kernel source | request=path}} | |||
For {{EcosystemRelease | revision=2.0.0}}:<span class="mw-collapsible mw-collapsed"> | |||
{{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} | {{PC$}} cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel package | request=path}}/{{EcosystemRelease/Package | revision=2.0.0 | package=Linux kernel source | request=path}} | ||
</span> | |||
* Edit the ''./drivers/gpu/drm/stm/drv.c'' source file | * Edit the ''./drivers/gpu/drm/stm/drv.c'' source file | ||
* Add a log information in the ''stm_drm_platform_probe'' function as follow | * Add a log information in the ''stm_drm_platform_probe'' function as follow |
Latest revision as of 12:57, 13 November 2020
1. Overview[edit source]
This stage explains how modify, rebuild and reload the Linux® kernel.
You will first be guided to install the Linux® kernel source code in the Developer Package directory. Then step by step you will execute procedures to modify, rebuild and reload the Linux® kernel.
2. Download the the Linux® kernel source code[edit source]
The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA). The detailed content licenses can be found here.
![]() |
To download a package, it is recommended to be logged in to your "myst" account [1]. If, trying to download, you encounter a “403 error”, you could try to empty your browser cache to workaround the problem. We are working on the resolution of this problem. We apologize for this inconvenience |
2.1. For ecosystem release unknown revision 2.1.0
[edit source]
- Download the [unknown revision/unknown revision STM32MP15-Ecosystem-v2.1.0 Developer Package Sources] to the following directory:
$HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package - Uncompress the tarball file to get the Linux® kernel tarball, the ST patches and the ST configuration fragments
unknown revisionPC $> cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package PC $> tar xvf
Expand
For ecosystem release v2.0.0
For ecosystem release v2.0.0
[edit source]
3. Prepare the Linux® kernel source code[edit source]
- Extract the Linux® kernel source
unknown revision 2.1.0For ecosystem releasePC $> cd unknown revision PC $> tar xvf unknown revision For ecosystem release v2.0.0
Expand
- Apply the ST patches
unknown revision /* For ecosystem release unknown revision 2.1.0PC $> cd*/ PC $> cd linux-5.4.31 /* For ecosystem release v2.0.0
*/ PC $> for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
- Apply fragments
PC $> make ARCH=arm multi_v7_defconfig "fragment*.config"
PC $> for f in `ls -1 ../fragment*.config`; do scripts/kconfig/merge_config.sh -m -r .config $f; done
PC $> yes '' | make ARCH=arm oldconfig
4. Build the Linux® kernel source code for the first time[edit source]
![]() |
The first time the kernel is build it could take several minutes. |
- Build kernel images (uImage and vmlinux) and device tree (dtbs)
PC $> make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040
- Build kernel module
PC $> make ARCH=arm modules
- Generate output build artifacts
PC $> mkdir -p $PWD/install_artifact/
PC $> make ARCH=arm INSTALL_MOD_PATH="$PWD/install_artifact" modules_install
5. Deploy the Linux® kernel on the board[edit source]
5.1. Push the Linux® kernel into the board[edit source]
PC $> scp arch/arm/boot/uImage root@<board ip address>:/boot
5.2. Push the devicetree into the board[edit source]
PC $> scp arch/arm/boot/dts/stm32mp157*.dtb root@<board ip address>:/boot
5.3. Push the kernel modules into the board[edit source]
- Remove the link created inside the install_artifact/lib/modules/<kernel version> directory
unknown revision 2.1.0For ecosystem release: PC $> rm install_artifact/lib/modules/5.4.56/build install_artifact/lib/modules/5.4.56/source For ecosystem release v2.0.0
: PC $> rm install_artifact/lib/modules/5.4.31/build install_artifact/lib/modules/5.4.31/source
- Optionally, strip kernel modules (to reduce the size of each kernel modules)
PC $> find install_artifact/ -name "*.ko" | xargs $STRIP --strip-debug --remove-section=.comment --remove-section=.note --preserve-dates
- Copy Kernel modules
PC $> scp -r install_artifact/lib/modules/* root@<ip of board>:/lib/modules
- Using the Linux console, re-generate the list of module dependencies (modules.dep) and the list of symbols provided by modules (modules.symbols)
Board $> /sbin/depmod -a
- Synchronize data on disk with memory
Board $> sync
5.4. Reboot the board[edit source]
Board $> reboot
6. Modifying a built-in Linux kernel device driver[edit source]
This simple example adds unconditional log information when the display driver is probed.
- Using the Linux console, check that there is no log information when the display driver is probed
Board $> dmesg | grep -i stm_drm_platform_probe
Board $>
- Go to the Linux® kernel source directory
unknown revision 2.1.0For ecosystem release: PC $> cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package/unknown revision/unknown revision For ecosystem release v2.0.0
:Expand
- Edit the ./drivers/gpu/drm/stm/drv.c source file
- Add a log information in the stm_drm_platform_probe function as follow
DRM_INFO("Simple example - %s\n", __func__); return 0; [...] }static int stm_drm_platform_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct drm_device *ddev; int ret; [...]
- Save the file
- Rebuitd the Linux® kernel
PC $> make uImage LOADADDR=0xC2000040
- Update the Linux kernel image into board
PC $> scp arch/arm/boot/uImage root@<board ip address>:/boot
- Reboot the board
Board $> reboot
- Check that there is now log information when the display driver is probed
Board $> dmesg | grep -i stm_drm_platform_probe
[ 2.764080] [drm] Simple example - stm_drm_platform_probe