The latest Linux kernel 2.6.22.3 is successfully transplanted to S3C2410.

Source: Internet
Author: User
Successfully transplanted the latest 2.6.22.3 linuxkernel to the S3C2410 -- Linux general technology-Linux programming and kernel information. The following is a detailed description. Hardware Platform: diligence Development Board 2410
Development Platform: FC6 + kernel 2.6.22.3 + arm-linux-gcc-3.4.1
Reference: panjet's post "Linux 2.6.10 and later versions support for S3C2410" (I would like to thank panjet and all the friends who have participated in the post)

As kernel 2.6.22.3 has changed the organizational style of the files in s3c2410 and removed the support for devfs, therefore, some issues not mentioned in "Linux 2.6.10 and later versions support for S3C2410" were encountered during the porting process, but the basic ideas were the same.

Step 1: Modify the parameters in the kernel according to the partition of your nand flash:
As kernel 2.6.22.3 on the s3c2410 file organization style has changed, so the file to be modified is no longer arch/arm/mach-s3c2410/devs. c, but arch/arm/plat_s3c24xx/common-smdk.c. Locate the partition Definition
Smdk_default_nand_part [] = {
...
}
Modify the content of the partition based on the partition information (you can view the partition information through bootloader)

Step 2: Modify the parameters of nand flash:
Find
Smdk_nand_info = {
. Tacls = 20,
. Twrph0 = 60,
. Twrph1 = 20,
...
}
Change
Smdk_nand_info = {
. Tacls = 0,
. Twrph0 = 30,
. Twrph1 = 0,
...
}

Step 3: Modify ECC verification:
According to the instructions on the official kernel website, ECC verification has been modified from 2.6.22.3 (this is also an important reason for porting 2.6.22.3 ). However, the experiment shows that neither the software ECC nor the hardware ECC can be used. You have to change it to NAND_ECC_NONE:
Find the s3c2410_nand_init_chip () function in driver/mtd/nand/s3c2410. c
Chip-> ecc. mode = NAND_ECC_SOFT;
Change
Chip-> ecc. mode = NAND_ECC_NONE;

Step 4: Modify the Makefile file:
Modify the target platform and cross compiler as follows:
ARCH? = Arm
CROSS_COMPILE? = Arm-linux-

Step 5: configure the kernel:
Make menuconfig
Note: Select tmpfs; otherwise, the root partition cannot be found in the kernel.

Step 6: Compile the kernel:
Make

The kernel has been transplanted, but because 2.6.22.3 does not contain devfs, you also need to configure the console device in the root filesystem. Otherwise, you will not be able to enter the interactive interface (no prompt will appear #)

Step 7: configure the console device:
In/dev of root filesystem, generate the console device:
Mknod-m 600 console c 5 1

Finally, burn the kernel and root filesystem into the nand flash, and the transplantation of the kernel is complete! Pai_^

Because devfs is replaced by udev in 2.6.22.3, the next step is to port and configure udev.

Successfully transplanted busybox-1.7.0 and loaded mdev (udev Embedded Version)

After 2.6.22.3 is successfully transplanted, the/dev file does not exist because udev is not started. That is to say, all devices are not mounted.
I searched the internet using google. We found that the latest busybox already contains the simplified udev version, namely mdev, which is very easy to use.
So download and Port:

Step 1: Modify Makefile
Modify ARCH and CROSS_COMPILE in Makefile to the arm Series:
ARCH? = Arm
CROSS_COMPILE? = Arm-linux-

Step 2: meke menuconfig
Run make menuconfig and select the required options.
Select here

Mdev

Step 3: Compile and install
# Make
# Make install
In this case, a _ install directory is generated under your compilation directory, which contains all the generated files and directory structures.

Step 4: Find the dependent shared library
# Cd _ install/bin
# Arm-linux-readelf-a./busybox | grep "Shared library"
The above command can be used to find out which shared libraries the current busybox depends on (these shared libraries can be found in the lib of the directory where your cross compiler is located)

Step 5: copy the generated file and shared library to your root filesystem
Copy the directory structure and file in _ install to your root filesystem.
Copy the Shared Library to the lib directory of the root filesystem and create the relevant link file.

Step 6: Prepare the environment for mdev running
Mdev needs to rewrite the/dev and/sys directories. Therefore, ensure that these two directories are writable (sysfs and tmpfs are generally used. So re-compile the kernel ).
Then add it to your startup script file.
/Bin/mdev-s

Finally, just burn the new kernel and the new root filesystem into the nand flash.

Now we have to debug the usb host. The progress is progressing step by step. So happy ......
I remember which of the following heroes mentioned previously solved the issue that cramfs must disable ECC for rootfs on 2.6.21, But I didn't need cramfs for the moment, so I didn't study it.
In addition, I used yaffs/ramfs + yaffs on 2.6.14 and 2.6.18, but kept this NAND_ECC_SOFT, and did not find any problems.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.