S3C6410 Embedded Application Platform Construction (V) - Linux-3.14.4 Ported to OK6410-(Nand Partition Problem)

Publisher:电子科技爱好者Latest update time:2024-09-12 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the previous article, our Linux was able to boot, but when identifying NAND, it failed to obtain the clock source, resulting in the failure of subsequent partitioning.


We found from the startup log:


[06/08-11:25:41:371]s3c24xx-nand s3c6400-nand: failed to get clock

[06/08-11:25:41:371]s3c24xx-nand: probe of s3c6400-nand failed with error –2



So I traced the code:


nandflash driver——s3c2410.c


/* get the clock source and enable it */


info->clk = devm_clk_get(&pdev->dev, "nand");

if (IS_ERR(info->clk)) {

dev_err(&pdev->dev, "failed to get clockn");

err = -ENOENT;

goto exit_error;

}


We found that when we tried to find the "nand" clock source, we could not get it, so we opened S3c2410.c (driversmtdnand)


Then open Clk-s3c64xx.c (driversclksamsung)


I found that there was no Aliases nand in Aliases, so I tried adding the following code: ALIAS(MEM0_NFCON, "s3c6400-nand", "nand"),


/* Aliases for s3c6410-specific clocks. */

static struct samsung_clock_alias s3c6410_clock_aliases[] = {

ALIAS(PCLK_IIC1, "s3c2440-i2c.1", "i2c"),

ALIAS(PCLK_IIS2, "samsung-i2s.2", "iis"),

ALIAS(SCLK_FIMC, "s3c-camif", "fimc"),

ALIAS(SCLK_AUDIO2, "samsung-i2s.2", "audio-bus"),

ALIAS(MEM0_NFCON, "s3c6400-nand", "nand"),

ALIAS(MEM0_SROM, NULL, "srom"),

};

In this case, there should be no problem when going to clk_get.


This mechanism was added after Linux-3.10, and this problem has stuck me for a long time.


We make uImage and test as follows:



From the above we found the following error information:


[06/08-14:18:34:573]nand: No oob scheme defined for oobsize 218


[06/08-14:18:34:573]------------[ cut here ]------------


[06/08-14:18:34:574]kernel BUG at drivers/mtd/nand/nand_base.c:3732!


It turns out that the oobsize of our nandflash is 218, but nand_base.c does not include the processing of 218. Therefore, refer to the 6410 driver and modify nand_base.c. Add the following:


1. Add nand_oob_218 definition


2. Add case 218 processing


OK, let's make uImage again, download it to the board, and start it as follows:


[06/08-14:28:27:608]U-Boot 2010.03-svn3 (May 06 2014 - 22:13:20) for SMDK6410

[06/08-14:28:27:608]

[06/08-14:28:27:608]*******************************************************

[06/08-14:28:27:619]                Welcome to Embedded System

[06/08-14:28:27:620] Base On S3C6410 Development

[06/08-14:28:27:620]                Date:   2014/4/15 22:00 PM

[06/08-14:28:27:630]*******************************************************

[06/08-14:28:27:631]

[06/08-14:28:27:631]CPU:     S3C6410@533MHz

[06/08-14:28:27:631]         Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)

[06/08-14:28:27:631]Board:   SMDK6410

[06/08-14:28:27:636]DRAM:  256 MB

[06/08-14:28:27:678]Flash:  0 kB

[06/08-14:28:27:679]NAND Flash:  2048 MB

[06/08-14:28:28:799]********************************************************

[06/08-14:28:28:799]Initial LCD controller

[06/08-14:28:28:812]  clk_freq:9 MHz,  div_freq:13 ,rea_freq:9 MHz

[06/08-14:28:28:812]

[06/08-14:28:28:813] HBP = 2 HFP = 2 HSW = 41,Hpixs:480

[06/08-14:28:28:813] VBP = 2 VFP = 2 VSW = 10,Vpixs:272

[06/08-14:28:28:830]FrameBuff:57e7a000

[06/08-14:28:28:830]  LCD initialization Finished.

[06/08-14:28:28:831]********************************************************

[06/08-14:28:28:852]In:    serial

[06/08-14:28:28:852]

[06/08-14:28:28:852]Out:   lcd

[06/08-14:28:28:855]

[06/08-14:28:28:855]Err:   lcd

[06/08-14:28:28:856]

[06/08-14:28:29:206]Net:   DM9000

[06/08-14:28:30:225]Hit any key to stop autoboot:  0

[06/08-14:28:30:225]

[06/08-14:28:30:226]NAND read:

[06/08-14:28:30:226]device 0 offset 0x100000, size 0x500000

[06/08-14:28:30:226]

[06/08-14:28:33:470] 5242880 bytes read: OK

[06/08-14:28:33:470]

[06/08-14:28:33:470]## Booting kernel from Legacy Image at 50008000 ...

[06/08-14:28:33:470]

[06/08-14:28:33:472]   Image Name:   Linux-3.14.4

[06/08-14:28:33:486]

[06/08-14:28:33:487]   Image Type:   ARM Linux Kernel Image (uncompressed)

[06/08-14:28:33:506]

[06/08-14:28:33:508]   Data Size:    1638624 Bytes =  1.6 MB

[06/08-14:28:33:522]

[06/08-14:28:33:523]   Load Address: 50008000

[06/08-14:28:33:540]

[06/08-14:28:33:540]   Entry Point:  50008040

[06/08-14:28:33:555]

[06/08-14:28:33:885]   Verifying Checksum ... OK

[06/08-14:28:33:901]

[06/08-14:28:33:902]   XIP Kernel Image ... OK

[06/08-14:28:33:915]

[06/08-14:28:33:916]OK

[06/08-14:28:33:933]

[06/08-14:28:33:933]

[06/08-14:28:33:933]Starting kernel ...

[06/08-14:28:33:934]

[06/08-14:28:33:945]

[06/08-14:28:33:959]

[06/08-14:28:33:973]

[06/08-14:28:34:265]Uncompressing Linux... done, booting the kernel.

[06/08-14:28:35:062]Booting Linux on physical CPU 0x0

[06/08-14:28:35:072]Linux version 3.14.4 (simiar@Embedded) (gcc version 4.4.3 (ctng-1.6.1) ) #3 Sun Jun 8 14:27:06 CST 2014

[06/08-14:28:35:076]CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d

[06/08-14:28:35:092]CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

[06/08-14:28:35:092]Machine: OK6410

[06/08-14:28:35:093]Ignoring unrecognised tag 0x54410008

[06/08-14:28:35:097]Memory policy: Data cache writeback

[06/08-14:28:35:097]CPU S3C6410 (id 0x36410101)

[06/08-14:28:35:097]CPU: found DTCM0 8k @ 00000000, not enabled

[06/08-14:28:35:098]CPU: moved DTCM0 8k to fffe8000, enabled

[06/08-14:28:35:106]CPU: found DTCM1 8k @ 00000000, not enabled

[06/08-14:28:35:106]CPU: moved DTCM1 8k to fffea000, enabled

[06/08-14:28:35:107]CPU: found ITCM0 8k @ 00000000, not enabled

[06/08-14:28:35:117]CPU: moved ITCM0 8k to fffe0000, enabled

[06/08-14:28:35:118]CPU: found ITCM1 8k @ 00000000, not enabled

[06/08-14:28:35:118]CPU: moved ITCM1 8k to fffe2000, enabled

[06/08-14:28:35:128]Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024

[06/08-14:28:35:138]Kernel command line: root=/dev/nfs nfsroot=192.168.1.100:/home/simiar/share/myproject/ok6410/filesystem/ok6410_fs ip=192.168.1.50:192.168.1.100:192.168.1.1:255.255.255.0::eth0:off console=ttySAC0,115200

[06/08-14:28:35:151]PID hash table entries: 1024 (order: 0, 4096 bytes)

[06/08-14:28:35:161]Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

[06/08-14:28:35:162]Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

[06/08-14:28:35:171]Memory: 256460K/262144K available (2173K kernel code, 178K rwdata, 664K rodata, 118K init, 198K bss, 5684K reserved)

[06/08-14:28:35:173]Virtual kernel memory layout:

[06/08-14:28:35:184]    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[06/08-14:28:35:184]    DTCM    : 0xfffe8000 - 0xfffec000   (  16 kB)

[06/08-14:28:35:185] ITCM : 0xfffe0000 - 0xfffe4000 ( 16 kB)

[06/08-14:28:35:197]    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[06/08-14:28:35:197]    vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)

[06/08-14:28:35:206]    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

[06/08-14:28:35:207]    modules : 0xbf000000 - 0xc0000000   (  16 MB)

[06/08-14:28:35:208]      .text : 0xc0008000 - 0xc02cd674   (2838 kB)

[06/08-14:28:35:217]      .init : 0xc02ce000 - 0xc02eb99c   ( 119 kB)

[06/08-14:28:35:218]      .data : 0xc02ec000 - 0xc0318a00   ( 179 kB)

[06/08-14:28:35:228]       .bss : 0xc0319000 - 0xc034aac8   ( 199 kB)

[06/08-14:28:35:229]SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

[06/08-14:28:35:229]NR_IRQS:246

[06/08-14:28:35:239]S3C6410 clocks: apll = 533000000, mpll = 533000000

[06/08-14:28:35:240]        epll = 24000000, arm_clk = 533000000

[06/08-14:28:35:240]VIC @f6000000: id 0x00041192, vendor 0x41

[06/08-14:28:35:250]VIC @f6010000: id 0x00041192, vendor 0x41

[06/08-14:28:35:251]sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 128929599457ns

[06/08-14:28:35:251]Console: colour dummy device 80x30

[06/08-14:28:35:261]Calibrating delay loop... 531.66 BogoMIPS (lpj=2658304)

[06/08-14:28:35:262]pid_max: default: 32768 minimum: 301

[06/08-14:28:35:273]Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)

[06/08-14:28:35:273]Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)

[06/08-14:28:35:274]CPU: Testing write buffer coherency: ok

[06/08-14:28:35:283]Setting up static identity map for 0x50214fa0 - 0x50214ffc

[06/08-14:28:35:295]VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5

[06/08-14:28:35:296]DMA: preallocated 256 KiB pool for atomic coherent allocations

[06/08-14:28:35:296]OK6410: Option string ok6410=0

[06/08-14:28:35:308]OK6410: selected LCD display is 480x272

[06/08-14:28:35:308]S3C6410: Initialising architecture

[06/08-14:28:35:309]bio: create slab at 0

[06/08-14:28:35:317]pl08xdmac dma-pl080s.0: initialized 8 virtual memcpy channels

[06/08-14:28:35:318]pl08xdmac dma-pl080s.0: initialized 16 virtual slave channels

[06/08-14:28:35:328]pl08xdmac dma-pl080s.0: DMA: PL080s rev1 at 0x75000000 irq 73

[06/08-14:28:35:329]pl08xdmac dma-pl080s.1: initialized 8 virtual memcpy channels

[06/08-14:28:35:340]pl08xdmac dma-pl080s.1: initialized 12 virtual slave channels

[06/08-14:28:35:340]pl08xdmac dma-pl080s.1: DMA: PL080s rev1 at 0x75100000 irq 74

[06/08-14:28:35:341]usbcore: registered new interface driver usbfs

[06/08-14:28:35:350]usbcore: registered new interface driver hub

[06/08-14:28:35:351]usbcore: registered new device driver usb

[06/08-14:28:35:362]Switched to clocksource samsung_clocksource_timer

[06/08-14:28:35:362]futex hash table entries: 256 (order: 0, 7168 bytes)

[06/08-14:28:35:363]ROMFS MTD (C) 2007 Red Hat, Inc.

[06/08-14:28:35:363]io scheduler noop registered

[06/08-14:28:35:373]io scheduler deadline registered

[1] [2]
Reference address:S3C6410 Embedded Application Platform Construction (V) - Linux-3.14.4 Ported to OK6410-(Nand Partition Problem)

Previous article:S3C6410 Embedded Application Platform Construction (VI) - Linux-3.14.4 Ported to OK6410 (Yaffs2 File System Ported)
Next article:S3C6410 Embedded Application Platform Construction (IV) - Linux-3.14.4 Ported to OK6410 (Preliminary Startup)

Recommended ReadingLatest update time:2024-11-15 10:45

ON Semiconductor plans to invest 14 billion yuan to increase SiC chip production
Reuters reported on the 16th that ON Semiconductor executives said on Tuesday that the company was considering investing US$2 billion to increase silicon carbide chip production. The company is considering expansion in the United States, Czech Republic or South Korea, executives said in the report. ON Semiconductor
[Automotive Electronics]
SoftBank wants to reform, and ARM becomes a victim? It spent $32 billion to acquire it 4 years ago!
According to foreign media reports, people familiar with the matter revealed that Japan's SoftBank Group is studying the sale of all or part of the shares of British chip design company ARM, or choosing to list ARM. Four years ago, SoftBank spent $32 billion to acquire ARM. This is SoftBank's largest acquisition ever,
[Embedded]
SoftBank wants to reform, and ARM becomes a victim? It spent $32 billion to acquire it 4 years ago!
SK Hynix's operating profit plummeted by 95% in Q4 2019
South Korean chip supplier SK Hynix said its fourth-quarter operating profit plunged 95%, missing analysts' expectations as oversupply and weak demand hit chip prices.   SK Hynix, the world's second-largest memory chipmaker after Samsung Electronics, said fourth-quarter operating profit was 236 billion won ($202.2
[Embedded]
SK Hynix's operating profit plummeted by 95% in Q4 2019
Apple A14 processor chip spy photos revealed, 5nm process support
There are more and more leaks about Apple iPhone 12 and A14 processor chips. Recently, the whistleblower @laobaiTD also exposed spy photos of Apple A14 processor on Twitter.   It is not clear whether the leaked A14 spy photos are samples from inside the factory.   IT Home previously reported that Apple's A14 chip wi
[Mobile phone portable]
Apple A14 processor chip spy photos revealed, 5nm process support
Apple plans Apple Watch activity challenge for International Dance Day on April 29
      Apple is planning an Apple Watch activity challenge for International Dance Day on Friday, April 29. The activity challenge will appear on the Apple Watch as a notification a few days before the event. To win the International Dance Day award, Apple will require Apple Watch users to do a dance workout for more t
[Mobile phone portable]
Over 1.4 billion and 300,000 pieces, the car company’s SiC project has been officially announced!
Recently, Great Wall Motors and YOFC Advanced have disclosed the progress of their silicon carbide projects: ● Great Wall Saida: Investing approximately 1.47 billion yuan to build a silicon carbide epitaxy project, with an annual production capacity of 300,000 pieces. ● YOFC Advanced: Anhui Wuhu silicon carbide pr
[Automotive Electronics]
Samsung Electronics is reportedly modifying its chip process roadmap to catch up with TSMC and skip 4nm process
According to DigiTimes, Samsung Electronics will skip the 4nm process and jump directly from 5nm to 3nm, unlike its competitor TSMC's process route. TSMC plans to complete its 4nm N4 process in 2023. TSMC has also reportedly received a $20 billion investment for its 3nm chip production facilities, and plans to conduct
[Mobile phone portable]
4 tips for using mobile power to make charging easier
Although in many people's minds, mobile power is a universal large-capacity battery that can charge handheld devices, but in our daily use, we still need to use a few simple tricks to fully play the role of mobile power to provide reliable power support for our mobile phones, MP4, tablets and other devices. Since the
[Power Management]
4 tips for using mobile power to make charging easier
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号