Port Linux 3.3.0 to one of the cloud6410 Development Boards

Source: Internet
Author: User

Here, only the kernel is successfully transplanted, and the file system can be mounted for running. drivers will be added one after another.

Step 1: download the latest internal core from the inner's official website. The download is linux-3.3-rc3.tar.bz2.

Step 2: unzip the kernel, enter the arch/arm/mach-s3c64xx directory, see a lot of 6410 of the board-level files, we choose mini6410 to start work, copy the mach-mini6410.c file in a directory named: mach-jfj6410.c. Here we will change the mini6410 words in the file to jfj6410. However, please note that JFJ6410 in MACHINE_START (JFJ6410, "JFJ6410") should be written in uppercase. Please wait and explain why. We all know that after a file is added to a directory, you should modify the Kconfig and Makefile files in the current directory. This is the requirements for Linux system compilation. As for how to modify the file, I believe everyone knows the content of the file.

The Kconfig file is the configuration option that appears when you make menuconfig. Here we have added our own board-level file and we must add configuration options. Contents can be copied to MINI6410. As follows:

config MACH_JFJ6410bool "JFJ6410"select CPU_S3C6410select S3C_DEV_HSMMCselect S3C_DEV_HSMMC1select S3C64XX_SETUP_SDHCIselect S3C_DEV_USB_HOSTselect S3C_DEV_NANDselect S3C_DEV_FBselect S3C64XX_SETUP_FB_24BPPselect SAMSUNG_DEV_ADCselect SAMSUNG_DEV_TShelp  Machine support for the JFJKJ JFJ6410

Here you should be able to see why we should use uppercase letters in that place to maintain consistency.

Makefile file is the description of the file to be compiled, as well as the compilation rules, here is obviously to compile our own board-level file mach-jfj6410.c, specific as follows:

obj-$(CONFIG_MACH_JFJ6410)+= mach-jfj6410.o

Step 3: configure the kernel and make menuconfig. Here, I used the kernel's built-in file "s36400_defconfig" to modify it, which is relatively simple. The majority of drivers are removed, leaving the serial and NAND drivers behind.

Step 4: Compile make zImage. In this way, the kernel we need is generated.

Step 5: Burn and test the kernel. Because we are testing the kernel, both U-Boot and root file systems were previously used. Here we didn't transplant yaffs, So I currently use a cramfs file system.

The following error occurs after the Development Board is started:

end_request: I/O error, dev mtdblock2, sector 0FAT: unable to read boot sectorVFS: Cannot open root device "mtdblock2" or unknown-block(31,2)Please append a correct "root=" boot option; here are the available partitions:1f00        192 mtdblock0 (driver?)1f01       1856 mtdblock1 (driver?)1f02      30720 mtdblock2 (driver?)1f03      32768 mtdblock3 (driver?)Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

Later, I checked the Internet for a long time and found that it was a driver problem. U-boot uses the software ECC. When we configure the NAND driver, the system prompts whether to choose to use the NAND hardware ECC. I tried it. This problem occurs no matter whether you choose or not, its Configuration contains three meanings: Select ---> use hardware ECC; do not select ---> Use NAND software ECC (not the same as U-Boot software ECC ); what we need here is not to use the nand ecc, that is, to disable it. Otherwise, it will conflict with the U-Boot and the above error will occur. To disable the ECC of NAND, we need to modify the drivers/mtd/nand/s3c2410. c file, which is located in the second line.

Source code:

chip->ecc.mode = NAND_ECC_SOFT;

To:

chip->ecc.mode= NAND_ECC_NONE;

This means that when we do not select one, we do not use the NAND software ECC, but do not use the nand ecc.

Compile the kernel again and run normally after writing. The printed information is as follows:

Starting kernel ...Uncompressing Linux... done, booting the kernel.Booting Linux on physical CPU 0Linux version 3.3.0-rc3 (chenlong12580@chenlong12580) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #4 Mon Feb 13 14:58:00 CST 2012CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387dCPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cacheMachine: JFJ6410Memory policy: ECC disabled, Data cache writebackCPU S3C6410 (id 0x36410101)S3C24XX Clocks, Copyright 2004 Simtec Electronicscamera: no parent clock specifiedS3C64XX: PLL settings, A=532000000, M=532000000, E=24000000S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000mout_apll: source is fout_apll (1), rate is 532000000mout_epll: source is epll (1), rate is 24000000mout_mpll: source is mpll (1), rate is 532000000usb-bus-host: source is clk_48m (0), rate is 48000000audio-bus: source is mout_epll (0), rate is 24000000audio-bus: source is mout_epll (0), rate is 24000000audio-bus: source is mout_epll (0), rate is 24000000irda-bus: source is mout_epll (0), rate is 24000000camera: no parent clock specifiedCPU: found DTCM0 8k @ 00000000, not enabledCPU: moved DTCM0 8k to fffe8000, enabledCPU: found DTCM1 8k @ 00000000, not enabledCPU: moved DTCM1 8k to fffea000, enabledCPU: found ITCM0 8k @ 00000000, not enabledCPU: moved ITCM0 8k to fffe0000, enabledCPU: found ITCM1 8k @ 00000000, not enabledCPU: moved ITCM1 8k to fffe2000, enabledBuilt 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024Kernel command line: root=/dev/mtdblock2 rootfstype=cramfs console=ttySAC0,115200PID hash table entries: 1024 (order: 0, 4096 bytes)Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)Memory: 256MB = 256MB totalMemory: 257500k/257500k available, 4644k reserved, 0K highmemVirtual kernel memory layout:    vector  : 0xffff0000 - 0xffff1000   (   4 kB)    DTCM    : 0xfffe8000 - 0xfffec000   (  16 kB)    ITCM    : 0xfffe0000 - 0xfffe4000   (  16 kB)    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)    vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)    modules : 0xbf000000 - 0xc0000000   (  16 MB)      .text : 0xc0008000 - 0xc01d90b8   (1861 kB)      .init : 0xc01da000 - 0xc01f5000   ( 108 kB)      .data : 0xc01f6000 - 0xc0216a40   ( 131 kB)       .bss : 0xc0217024 - 0xc0246c58   ( 192 kB)SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1NR_IRQS:246VIC @f6000000: id 0x00041192, vendor 0x41VIC @f6010000: id 0x00041192, vendor 0x41Console: colour dummy device 80x30Calibrating delay loop... 528.79 BogoMIPS (lpj=2643968)pid_max: default: 32768 minimum: 301Mount-cache hash table entries: 512CPU: Testing write buffer coherency: okSetting up static identity map for 0x5015e320 - 0x5015e37cgpiochip_add: registered GPIOs 38 to 53 on device: GPFgpiochip_add: registered GPIOs 74 to 89 on device: GPIgpiochip_add: registered GPIOs 91 to 102 on device: GPJgpiochip_add: registered GPIOs 161 to 176 on device: GPOgpiochip_add: registered GPIOs 178 to 192 on device: GPPgpiochip_add: registered GPIOs 194 to 202 on device: GPQgpiochip_add: registered GPIOs 144 to 159 on device: GPNgpiochip_add: registered GPIOs 0 to 7 on device: GPAgpiochip_add: registered GPIOs 9 to 15 on device: GPBgpiochip_add: registered GPIOs 17 to 24 on device: GPCgpiochip_add: registered GPIOs 26 to 30 on device: GPDgpiochip_add: registered GPIOs 32 to 36 on device: GPEgpiochip_add: registered GPIOs 55 to 61 on device: GPGgpiochip_add: registered GPIOs 137 to 142 on device: GPMgpiochip_add: registered GPIOs 63 to 72 on device: GPHgpiochip_add: registered GPIOs 104 to 119 on device: GPKgpiochip_add: registered GPIOs 121 to 135 on device: GPLjfj6410: Option string jfj6410=0jfj6410: selected LCD display is 480x272S3C6410: Initialising architecturebio: create slab <bio-0> at 0io scheduler noop registeredio scheduler deadline registeredio scheduler cfq registered (default)start plist testend plist testSerial: 8250/16550 driver, 4 ports, IRQ sharing disableds3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10console [ttySAC0] enableds3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10brd: module loadedloop: module loadedS3C24XX NAND Driver, (c) 2004 Simtec Electronicss3c24xx-nand s3c6400-nand: Tacls=4, 30ns Twrph0=8 60ns, Twrph1=6 45nss3c24xx-nand s3c6400-nand: System booted from NANDs3c24xx-nand s3c6400-nand: NAND ECC disabledNAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)NAND_ECC_NONE selected by board driver. This is not recommended!Scanning device for bad blocksBad eraseblock 1050 at 0x000008340000Bad eraseblock 1076 at 0x000008680000Bad eraseblock 1211 at 0x000009760000Bad eraseblock 1949 at 0x00000f3a0000Creating 4 MTD partitions on "nand":0x000000000000-0x000000100000 : "Bootloader"0x000000100000-0x000000600000 : "Kernel"0x000000600000-0x000007e00000 : "User"0x000007e00000-0x000010000000 : "File System"mousedev: PS/2 mouse device common for all miceVFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5VFS: Mounted root (cramfs filesystem) readonly on device 31:2.Freeing init memory: 108Kmount: mounting none on /proc/bus/usb failed: No such file or directoryhwclock: can't open '/dev/misc/rtc': No such file or directorydepmod: chdir(3.3.0-rc3): No such file or directory[01/Jan/1970:00:00:07 +0000] boa.c:173 - unable to create socket: Function not implemented                        open device leds: No such file or directory/usr/sbin/alsactl: load_state:1610: No soundcards found...                        ifconfig: socket: Function not implementedTry to bring eth0 interface up......cat: can't open '/sys/class/net/eth0/address': No such file or directoryifconfig: socket: Function not implementedroute: socket: Function not implemented/etc/init.d/ifconfig-eth0: line 6: can't create /etc/resolv.conf: Read-only file systemDonePlease press Enter to activate this console. [root@JFJ6410 /]# lsbin      etc      lib      mnt      proc     sbin     tmp      vardev      home     linuxrc  opt      root     sys      usr      www[root@JFJ6410 /]# 

Driver addition, please wait ....

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.