Analysis of nandflash driver under Linux (2) - Based on s3c6410 platform

Publisher:喜茶我要七分糖Latest update time:2022-06-16 Source: eefocusKeywords:linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

if(chip->ecc.steps * chip->ecc.size != mtd->writesize) {

printk(KERN_WARNING "Invalid ecc parametersn");

BUG();

}

chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;



/*

* Allow subpage writes up to ecc.steps. Not possible for MLC

* FLASH.

*/

if (!(chip->options & NAND_NO_SUBPAGE_WRITE) &&

   !(chip->cellinfo & NAND_CI_CELLTYPE_MSK)) {

switch(chip->ecc.steps) {

case 2:

mtd->subpage_sft = 1;

break;

case 4:

case 8:

mtd->subpage_sft = 2;

break;

}

}

chip->subpagesize = mtd->writesize >> mtd->subpage_sft;



/* Initialize state */

chip->state = FL_READY;



/* De-select the device */

chip->select_chip(mtd, -1);



/* Invalidate the pagebuffer reference */

chip->pagebuf = -1;



/* Fill in remaining MTD driver data */

mtd->type = MTD_NANDFLASH;

mtd->flags = MTD_CAP_NANDFLASH;

mtd->erase = nand_erase;

mtd->point = NULL;

mtd->unpoint = NULL;

mtd->read = nand_read;

mtd->write = nand_write;

mtd->read_oob = nand_read_oob;

mtd->write_oob = nand_write_oob;

mtd->sync = nand_sync;

mtd->lock = NULL;

mtd->unlock = NULL;

mtd->suspend = nand_suspend;

mtd->resume = nand_resume;

mtd->block_isbad = nand_block_isbad;

mtd->block_markbad = nand_block_markbad;



    Assign values ​​to the rest of the struct mtd_info structure


/* propagate ecc.layout to mtd_info */

mtd->ecclayout = chip->ecc.layout;



/* Check, if we should skip the bad block table scan */

if (chip->options & NAND_SKIP_BBTSCAN)

return 0;



/* Build bad block table */ Build bad block table

return chip->scan_bbt(mtd);

}


[1] [2]
Keywords:linux Reference address:Analysis of nandflash driver under Linux (2) - Based on s3c6410 platform

Previous article:ARM11 S3C6410 Series Tutorial 2: Serial Port
Next article:S3C6410 Development (1) - Getting Started

Recommended ReadingLatest update time:2024-11-16 13:57

About the installation of arm-linux-gcc4.4.3 under ubuntu11.10
After reading countless documents, I finally found this useful article. I spent several hours last night installing version 4.3.2 but failed. Today, I accidentally saw this article on the forum and tried it. It still took two or three hours. It was really tiring, but it succeeded. Listen to comfort. The following in
[Microcontroller]
Linux-2.6.38 to tiny6410 porting manual (serial 1) __nand flash
There are many Linux porting manuals for 2440, but why are there none for 6410? Since the source code is provided, why not write out the transplantation steps so that everyone can learn? Today, I am determined to port linux-2.6.38 by myself. I refer to the source code provided by Youshan. I think since the source co
[Microcontroller]
ARM Linux kernel layout in memory
Kernel Memory Layout on ARM Linux Russell King rmk@arm.linux.org.uk      November 17, 2005 (2.6.15) This document describes the virtual memory layout which the Linux kernel uses for ARM processors.  It indicates which regions are free for platforms to use, and which are used by generic code. The ARM CPU is c
[Microcontroller]
11-S3C2440 driver learning (V) Embedded Linux-Network device driver (II) Transplanting DM9000C network card driver
We have implemented a virtual network card driver. Now we are writing and porting the DM9000C network card driver for the real network card chip DM9000C. 1. Transplantation Analysis For protocol drivers, our main job is often to match existing drivers with our hardware. Protocol functions are often already formed an
[Microcontroller]
11-S3C2440 driver learning (V) Embedded Linux-Network device driver (II) Transplanting DM9000C network card driver
ARM Linux.2.6.34 kernel porting
ARM-LINUX-GCC version 4.3.2. Installed in /usr/local/arm/4.3.2. Step 1: Modify the linux-2.6.34/Makefile file, find the following two pieces of information in the makefile and modify them ARCH? = arm   CROSS_COMPILE? =/usr/local/arm/4.3.2/bin/arm-linux- Step 2: Modify the platform input clock Modify the platform clo
[Microcontroller]
ARM-Linux boot method
       ARM-Linux uses ARM chips, which have high execution efficiency, powerful functions, and relatively rich peripherals. It is a powerful computer system and needs to run an operating system, so its startup method is quite different from that of a single-chip microcomputer, but it is basically the same as the start
[Microcontroller]
ARM big.LITTLE architecture multi-core scheduling algorithm under Linux and Android kernel
In 2013, the big.LITTLE family was expanded with new SoC implementations, including the ARM reference test chip TC2 with 2 Cortex-A15 + 3 Cortex-A7 cores, and the Samsung-LSI 'Octa-core' chip with 4 Cortex-A15 cores + 4 Cortex-A7 cores used in the Samsung Galaxy S4. Linaro has made many performance optimizations (inclu
[Microcontroller]
Design of home intelligent control terminal based on ARM-Linux and GPRS technology
1 Introduction With the continuous development of network technology and communication technology, people hope to be able to understand and control the situation at home in a timely manner even when they are at work or away. At the same time, with the popularization of digital homes, remote control of smart home
[Microcontroller]
Design of home intelligent control terminal based on ARM-Linux and GPRS technology
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号