Tech memo of imx27 pdk (1) -- For kernel building on imx27 pdk with ltib
2011-04-08 03:07
423 查看
Suppose i already setup my ltib to this path: /home/hongao_client/ltib, then ltib perl file was under it.
The kernel spec file was over here: /home/hongao_client/ltib/tmp/kernel-2.6.22-pdk27.spec
Log-in your system as an user, say leocdsc, then switch to /home/hongao_client/ltib, running:
./ltib -p kernel -m prep
then the kernel source code will be extracted to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22 and as well the kernel patch for imx27 pdk will be added.
Now we're trying to build kernel with: ./ltib -p kernel -m scbuild. But unfortunately, c compiler complains an error in drivers/video/mxc/mx2fb.c. This is becos CONFIG_FB_MXC_TVOUT is switched on but CONFIG_FB_MXC_FS453 and CONFIG_FB_MXC_CH7024 are both switched off. BTW, chips FS453 and CH7024 are designed for transferring RGB to CVBS out, anyway, i cannot find any of them on imx27 PDK board. So switching off them is the correct behavior. However as they are off, c pre-processor runs to #error "no encoder selected" and then throwing out an error.
To fix it, my suggestion is to write a dummy function for encoder_ioctl, and share this funtion with other kernel modules, e.g. EXPORT_SYMBOL(mx2fb_dummy_ioctl);
Ok, we try to re-compile, and this time, we should succeed! The actual build sequence of ltib is:
1. switch to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22;
2. cp -f /home/hongao_client/ltib/config/platform/imx27pdk/linux-2.6.22-pdk27.config.dev ./.config;
3. make ARCH= arm CROSS_COMPILE= HOSTCC= /usr/bin/gcc -B/usr/bin// oldconfig
4. make ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
After that, we are able to see the following messages:
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 27 modules
Build time for kernel-2.6.22-pdk27: 40 seconds
At last, we install the kernel by: ./ltib -p kernel -m scinstall.
ltib will switch to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22, and copy
vmlinux, System.map, arch/arm/boot/zImage to /home/hongao_client/ltib/tmp/kernel//opt/freescale/rootfs/arm/boot/,
and then make a soft link bootable_kernel to zImage.
Ok, tomorrow let's see if the new zImage can be boot-up or not on imx27 pdk.
Good night!
The kernel spec file was over here: /home/hongao_client/ltib/tmp/kernel-2.6.22-pdk27.spec
Log-in your system as an user, say leocdsc, then switch to /home/hongao_client/ltib, running:
./ltib -p kernel -m prep
then the kernel source code will be extracted to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22 and as well the kernel patch for imx27 pdk will be added.
Now we're trying to build kernel with: ./ltib -p kernel -m scbuild. But unfortunately, c compiler complains an error in drivers/video/mxc/mx2fb.c. This is becos CONFIG_FB_MXC_TVOUT is switched on but CONFIG_FB_MXC_FS453 and CONFIG_FB_MXC_CH7024 are both switched off. BTW, chips FS453 and CH7024 are designed for transferring RGB to CVBS out, anyway, i cannot find any of them on imx27 PDK board. So switching off them is the correct behavior. However as they are off, c pre-processor runs to #error "no encoder selected" and then throwing out an error.
To fix it, my suggestion is to write a dummy function for encoder_ioctl, and share this funtion with other kernel modules, e.g. EXPORT_SYMBOL(mx2fb_dummy_ioctl);
Ok, we try to re-compile, and this time, we should succeed! The actual build sequence of ltib is:
1. switch to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22;
2. cp -f /home/hongao_client/ltib/config/platform/imx27pdk/linux-2.6.22-pdk27.config.dev ./.config;
3. make ARCH= arm CROSS_COMPILE= HOSTCC= /usr/bin/gcc -B/usr/bin// oldconfig
4. make ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
After that, we are able to see the following messages:
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 27 modules
Build time for kernel-2.6.22-pdk27: 40 seconds
At last, we install the kernel by: ./ltib -p kernel -m scinstall.
ltib will switch to /home/hongao_client/ltib/rpm/BUILD/linux-2.6.22, and copy
vmlinux, System.map, arch/arm/boot/zImage to /home/hongao_client/ltib/tmp/kernel//opt/freescale/rootfs/arm/boot/,
and then make a soft link bootable_kernel to zImage.
Ok, tomorrow let's see if the new zImage can be boot-up or not on imx27 pdk.
Good night!
相关文章推荐
- 使用QT实现DREAM:Building on Linux for Android
- Building a RAC Test Environment on VMWare For Free
- PFQ: a Linux kernel module for packet capturing on multi-core architectures
- 修复VirtualBox "This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU"(安装深度Linux的时候就需要)
- Building your own kernel based on CentOS
- Building Apps for Windows 10 on LattePanda–Jump Start
- Building Ice Cream Sandwich (Android v4) for VirtualBox on EC2
- DREAM Building on Linux for Android(错误记录)
- PB编译错误:Mismatched time stamp on .rel file for module nk.exe requesting kernel fixup. Valid .rel file
- 【NDN IoT】Building an On-ramp for the Internet of Things 全文翻译
- Building modules for a precompiled kernel
- 为 Serv-U 编写插件 (Building an Add-on for Serv-U)
- Building AMDGPU Development Linux 4.15 Kernel on Ubuntu 17.04
- Java™ Development on PDAs: Building Applications for PocketPC and Palm Devices
- Building Android Kernel for the Nexus 5 — AOSP(6.0.1)
- Linux kernel tweaking for performance and security on a busy Linux
- Building MySQLdb for Python on Windows
- (OK) Building Ice Cream Sandwich (Android v4) for VirtualBox on EC2
- Building Openwrt for X86 on Compact Flash
- Building Redis for use on Cygwin(转)