Linux-2.6.14 ported to S3C2440

Publisher:SparklingMelodyLatest update time:2016-03-02 Source: eefocusKeywords:linux-2.6.14 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The 2.6.14 kernel is rarely used now, but due to project needs, the 2.6.14 kernel was recently ported to S3C2440, and the CS8900 network card driver was ported (for network card driver porting, refer to http://blog.csdn.net/ce123/article/details/8424399 ). The reason for porting the network card driver is that the yaffs2 format file system has not been successfully mounted, and the error message after startup is as follows:
Mounted devfs on /dev
Freeing init memory: 92K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
I can only put this question aside for now, and finally successfully mounted nfs. I will study the problem of yaffs2 format file system in depth later. I will sort out what I have done recently, for fear of forgetting it.

view plain copy
 
 print?

  1. ARCH        ?= arm  
  2. CROSS_COMPILE   ?= arm-linux-  
For the use of cross compiler, please refer to http://blog.csdn.net/ce123/article/details/8333421

view plain copy
 
 print?

  1. static void __init smdk2440_map_io(void)  
  2. {  
  3.     s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));  
  4.     s3c24xx_init_clocks(12000000);//12M  
  5.     s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));  
  6.     s3c24xx_set_board(&smdk2440_board);  
  7. }  

view plain copy
 
 print?
  1. #include   
  2. #include   
  3. #include   
  4.   
  5. /* NAND parity */  
  6.   
  7. static struct mtd_partition smdk_default_nand_part[] = {  
  8.     [0]= {  
  9.               .name      = "Board_uboot",  
  10.               .offset     = 0x00000000,  
  11.               .size = 0x00080000,  
  12.        },  
  13.     [1]= {  
  14.               .name      = "Board_kernel",  
  15.               .offset= 0x00240000,  
  16.               .size = 0x00200000,  
  17.        },  
  18.     [2]= {  
  19.              .name      = "Board_yaffs2",  
  20.              .offset= 0x00440000,  
  21.              .size =  0x0FB40000,  
  22.        }  
  23. };  
name: represents the partition name
size: represents the size of the flash partition (unit: bytes)
offset: represents the starting address of the flash partition (offset relative to 0x0)
is divided into 3 areas, storing uboot, kernel and file system respectively.

view plain copy
 
 print?

  1. static struct s3c2410_nand_set smdk_nand_sets[] = {  
  2.     [0] = {  
  3.         .name       = "NAND",  
  4.         .nr_chips = 1,  
  5.         .nr_partitions  = ARRAY_SIZE(smdk_default_nand_part),  
  6.         .partitions = smdk_default_nand_part,  
  7.     },  
  8. };  
nr_partitions: Indicates the number of partitions defined in partition_info
partitions: partition information table

view plain copy
 
 print?

  1. static struct s3c2410_platform_nand smdk_nand_info = {  
  2.     .tacls      = 20,  
  3.     .twrph0 = 60,  
  4.     .twrph1 = 20,  
  5.     .nr_sets    = ARRAY_SIZE(smdk_nand_sets),  
  6.     .sets       = smdk_nand_sets,  
  7. };  
The meanings of tacls, twrph0, and twrph1 can be found in the S3C2440 data sheet. These three values ​​will eventually be set to NFCONF.
sets: supported partition sets
nr_set: number of partition sets

view plain copy
 
 print?
  1. struct platform_device s3c_device_nand = {  
  2.     .name         = "s3c2410-nand",  
  3.     .id       = -1,  
  4.     .num_resources    = ARRAY_SIZE(s3c_nand_resource),  
  5.     .resource     = s3c_nand_resource,  
  6.     .dev = {  
  7.         .platform_data = &smdk_nand_info  
  8.     }  
  9. };  
name: device name
id: valid device number, if there is only one device, it is -1, if there are multiple devices, it starts counting from 0.
num_resource: how many register areas
resource: the first address of the register area array
dev: supported Nand Flash devices

view plain copy
 
 print?
  1. static struct platform_device *smdk2440_devices[] __initdata = {  
  2.     &s3c_device_usb,  
  3.     &s3c_device_lcd,  
  4.     &s3c_device_wdt,  
  5.     &s3c_device_i2c,  
  6.     &s3c_device_iis,  
  7.     &s3c_device_nand, //Add  
  8. };  

view plain copy
 
 print?
  1. chip->eccmode = NAND_ECC_NONE;  

view plain copy
 
 print?
  1. config DEVFS_FS  
  2.     bool "/dev file system support (OBSOLETE)"  
  3.     depends on EXPERIMENTAL  
  4.     help  
  5.       This is support for devfs, a virtual file system (like /proc) which  
  6.       provides the file system interface to device drivers, normally found  
  7.       in /dev. Devfs does not depend on major and minor number  
  8.       allocations. Device drivers register entries in /dev which then  
  9.       appear automatically, which means that the system administrator does  
  10.       not have to create character and block special device files in the  
  11.       /dev directory using the mknod command (or MAKEDEV script) anymore.  
  12.   
  13.       This is work in progress. If you want to use this, you *must* read  
  14.       the material in , especially  
  15.       the file README there.  
  16.   
  17.       Note that devfs no longer manages /dev/pts!  If you are using UNIX98  
  18.       ptys, you will also need to mount the /dev/pts filesystem (devpts).  
  19.   
  20.       Note that devfs has been obsoleted by udev,  
  21.       .  
  22.       It has been stripped down to a bare minimum and is only provided for  
  23.       legacy installations that use its naming scheme which is  
  24.       unfortunately different from the names normal Linux installations  
  25.       use.  
  26.   
  27.       If unsure, say N.  
  28.   
  29. config DEVFS_MOUNT  
  30.     bool "Automatically mount at boot"  
  31.     depends on DEVFS_FS  
  32.     help  
  33.       This option appears if you have CONFIG_DEVFS_FS enabled. Setting  
  34.       this to 'Y' will make the kernel automatically mount devfs onto /dev  
  35.       when the system is booted, before the init thread is started.  
  36.       You can override this with the "devfs=nomount" boot option.  
  37.   
  38.       If unsure, say N.  
  39.   
  40. config DEVFS_DEBUG  
  41.     bool "Debug devfs"  
  42.     depends on DEVFS_FS  
  43.     help  
  44.       If you say Y here, then the /dev file system code will generate  
  45.       debugging messages. See the file  
  46.        for more  
  47.       details.  
  48.   
  49.       If unsure, say N.  
  50.   
  51. config DEVPTS_FS_XATTR  
  52.     bool "/dev/pts Extended Attributes"  
  53.     depends on UNIX98_PTYS  
  54.     help  
  55.       Extended attributes are name:value pairs associated with inodes by  
  56.       the kernel or by users (see the attr(5) manual page, or visit  
  57.        for details).  
  58.   
  59.       If unsure, say N.  
  60.   
  61. config DEVPTS_FS_SECURITY  
  62.     bool "/dev/pts Security Labels"  
  63.     depends on DEVPTS_FS_XATTR  
  64.     help  
  65.       Security labels support alternative access control models  
  66.       implemented by security modules like SELinux.  This option  
  67.       enables an extended attribute handler for file security  
  68.       labels in the /dev/pts filesystem.  
  69.   
  70.       If you are not using a security module that requires using  
  71.       extended attributes for file security labels, say N.  
  72.   
  73. config TMPFS  
  74.     bool "Virtual memory file system support (former shm fs)"  
  75.     help  
  76.       Tmpfs is a file system which keeps all files in virtual memory.  
  77.   
  78.       Everything in tmpfs is temporary in the sense that no files will be  
  79.       created on your hard drive. The files live in memory and swap  
  80.       space. If you unmount a tmpfs instance, everything stored therein is  
  81.       lost.  
  82.   
  83.       See  for details.  

http://blog.csdn.net/ce123/article/details/6581248 ), and the basic process is very similar. You can usually port a kernel by following this process, but understanding the process behind it is the best way.
Keywords:linux-2.6.14 Reference address:Linux-2.6.14 ported to S3C2440

Previous article:fastcall and asmlinkage macros in linux kernel
Next article:__read_mostly variable in linux kernel

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号