mini2440 u-boot linux kernel boot, porting the newer (Linux3.19) kernel to the mini2440 development board (Part 1)

Publisher:tyloo820Latest update time:2022-06-24 Source: eefocusKeywords:mini2440  u-boot  linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

s3c24xx-nand s3c2440-nand: Tacls=1, 9ns Twrph0=3 29ns, Twrph1=2 19ns

s3c24xx-nand s3c2440-nand: NAND soft ECC

nand: device found, Manufacturer ID: 0xec, Chip ID: 0xda

nand: Samsung NAND 256MiB 3,3V 8-bit

nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

Creating 5 MTD partitions on "nand":

0x000000000000-0x000000040000 : "supervivi"

__nand_correct_data: uncorrectable ECC error

0x000000040000-0x000000060000 : "param"

ftl_cs: FTL header not found.

0x000000060000-0x000000560000 : "Kernel"

ftl_cs: FTL header not found.

0x000000560000-0x000040560000 : "root"

mtd: partition "root" extends beyond the end of device "nand" -- size truncated to 0xfaa0000

ftl_cs: FTL header not found.

0x000000000000-0x000040000000 : "nand"

mtd: partition "nand" extends beyond the end of device "nand" -- size truncated to 0x10000000

__nand_correct_data: uncorrectable ECC error

It is found that the development board can already recognize the information of nand flash, but prints the following information:

ftl_cs: FTL header not found.

The solution is as follows: execute make menuconfig in the kernel root directory and enter

Device Drivers ->

Memory Technology Devices (MTD) ->

Remove the following options

<>FTL (Flash Translation Layer) support

<> NFTL (NAND Flash Translation Layer) support

<>INFTL (Inverse NAND Flash Translation Layer) support

Save and recompile.

1.6 has completed the support for nand flash so far, but the kernel still cannot boot normally due to the lack of a root file system. Next we will add support for yaffs2 to the kernel.

Execute #git clone git://www.aleph1.co.uk/yaffs2 in the terminal to obtain the latest yaffs2 source code. After synchronization, enter the yaffs2 directory and execute # ./patch-ker.sh cm kernel source code path to apply the yaffs2 patch to the kernel. Enter the kernel directory and execute make menuconfig

Select File systems --->

[*] Miscellaneous filesystems --->

│ yaffs2 file system support

After saving, exit and recompile. You will encounter several errors at this time. Because the new version of the Linux kernel has modified some functions for file operations, we need to modify them one by one according to the errors. According to the errors:

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':

fs/yaffs2/yaffs_vfs.c:286: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':

fs/yaffs2/yaffs_vfs.c:484: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_release_space':

fs/yaffs2/yaffs_vfs.c:502: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':

fs/yaffs2/yaffs_vfs.c:594: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c:606: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':

fs/yaffs2/yaffs_vfs.c:730: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c:741: error: too few arguments to function 'yaffs_flush_file'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_sync_object':

fs/yaffs2/yaffs_vfs.c:771: error: too few arguments to function 'yaffs_flush_file'

fs/yaffs2/yaffs_vfs.c: At top level:

fs/yaffs2/yaffs_vfs.c:781: error: 'generic_file_aio_read' undeclared here (not in a function)

fs/yaffs2/yaffs_vfs.c:782: error: 'generic_file_aio_write' undeclared here (not in a function)

fs/yaffs2/yaffs_vfs.c:787: error: 'generic_file_splice_write' undeclared here (not in a function)

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_iterate':

fs/yaffs2/yaffs_vfs.c:1719: error: 'struct file' has no member named 'f_dentry'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_flush_inodes':

fs/yaffs2/yaffs_vfs.c:2190: error: too few arguments to function 'yaffs_flush_file'

fs/yaffs2/yaffs_vfs.c: In function 'yaffs_flush_super':

fs/yaffs2/yaffs_vfs.c:2203: error: too few arguments to function 'yaffs_flush_whole_cache'

Open /fs/yaffs2/yaffs_vfs.c, use the replace function to replace all f_dentry in the code with f_path.dentry, replace all yaffs_flush_file(obj, 1, 0); with yaffs_flush_file(obj, 1, 0,1); replace yaffs_flush_file(obj, 1, datasync); with yaffs_flush_file(obj, 1, datasync,1); replace yaffs_flush_file(obj, 1, 0); with yaffs_flush_file(obj, 1, 0,1); replace yaffs_flush_whole_cache(dev); with yaffs_flush_whole_cache(dev,1);

Near 718 lines

-.read = do_sync_read,

-.write = do_sync_write,

+.read = new_sync_read,

+.write = new_sync_write,

-.aio_read = generic_file_aio_read,

-.aio_write = generic_file_aio_write,

+ .read_iter =generic_file_read_iter,

+ .write_iter =generic_file_write_iter,

-.splice_write = generic_file_splice_write,

+.splice_write = iter_file_splice_write,

After saving, recompile, download the kernel to the development board, and burn the file system (for the convenience of testing, this time I first use the friendly file system root_qtopia.img provided by the developer. In future tutorials, we will also make our own file system), restart the development board, and see the following boot information

Starting kernel ...

Booting Linux on physical CPU 0x0

Linux version 3.19.3 (root@ginger-virtual-machine) (gcc version 4.4.3 (ctng-1.6.1) ) #6 Sat Apr 25 13:37:14 CST 2015


Keywords:mini2440  u-boot  linux Reference address:mini2440 u-boot linux kernel boot, porting the newer (Linux3.19) kernel to the mini2440 development board (Part 1)

Previous article:mini2440 u-boot linux kernel boot, u-boot.2012.10——mini2440 (II. Boot process analysis)
Next article:uboot-2012.04.01 ported to mini2440 (I) Preliminary analysis of boot process, memory distribution and relocation

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号