Many of my friends encountered the problem of unable to open an initial console when porting linux to S3C2440 and the S3C2410 Development Board.
Fortunately, we also encountered this problem.
After searching for various solutions on the Internet and making continuous attempts, we finally found a solution.
In order to avoid the same troubles for later users, the solution to this problem is summarized as follows:
1. kernel NAND flash code modification
A) kernel source code ARCH/ARM/plat-s3c24xx/common-smdk.c, smdk_default_nand_part partition and U-boot source code mtdparts_default consistent.
Smdk_default_nand_part may only contain some entries in mtdparts_default.
However, all contained entries must be exactly the same as the size and offset of the corresponding entry in mtdparts_default.
B) Change the chip-> ECC. Mode in drivers/MTD/NAND/S3C2410. C to nand_ecc_none. Note: nand_ecc_none is selected here, and the following NAND Flash Driver configuration is selected,
Be sure not to select NAND hardware ECC.
2 kernel NAND Flash Driver settings
Choose device drivers> memory technology device (MTD) Support> NAND device support.
Selected: <*> NAND Flash Support for S3C2410/S3C2440 SOC
Note: Do not select this option: [] S3C2410 NAND hardware ECC
3. Kernel support for yaffs2
A) First, install the yaffs2 patch for the kernel source code. How to do it? Search for it online. Answers are everywhere.
B) Make menuconfig. Select the support for yaffs2.
4. Create rootfs
A) Two device files are indispensable. Mknod/dev/console C 5 1; mknod/dev/null C 1 3
B) When packaging the root file system, the tool must use the correct version. For example, my tq2440, 256 m NAND Flash, uses mkyaffs2image provided by the manufacturer.
5. Run the prepared root file system on the board.
Finally, I will clarify several common mistakes on the Internet.
1. Because the kernel of the higher version does not support Dev FS, only udev is supported. Therefore, you need to manually modify kconfig and then make menuconfig to select Dev FS, so that the kernel supports Dev FS.
This is a widely spread error. In fact, this operation is completely unnecessary. I did not perform this operation during Linux 2.6.25.8 porting. The root file system of yaffs2 is loaded from NAND Flash, which is no problem at all. The kernel of a higher version has the ability to read the/dev/console and/dev/null directory items.
2. Set the serial port in the root file system/etc/inittab.
Simply set it to the following format. The console does not need to change the special name (mostly from the device name in the kernel driver source code.
Console: askfirst:-/bin/sh