1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 4. Basic board driver</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="MTD NAND Driver Programming Interface"><link rel="up" href="index.html" title="MTD NAND Driver Programming Interface"><link rel="prev" href="Struct_member_identifiers_XXX.html" title="Struct member identifiers [XXX]"><link rel="next" href="Partition_defines.html" title="Partition defines"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Basic board driver</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Struct_member_identifiers_XXX.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="Partition_defines.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="basicboarddriver"></a>Chapter 4. Basic board driver</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="basicboarddriver.html#Basic_defines">Basic defines</a></span></dt><dt><span class="sect1"><a href="Partition_defines.html">Partition defines</a></span></dt><dt><span class="sect1"><a href="Hardware_control_functions.html">Hardware control function</a></span></dt><dt><span class="sect1"><a href="Device_ready_function.html">Device ready function</a></span></dt><dt><span class="sect1"><a href="Init_function.html">Init function</a></span></dt><dt><span class="sect1"><a href="Exit_function.html">Exit function</a></span></dt></dl></div><p> 2 For most boards it will be sufficient to provide just the 3 basic functions and fill out some really board dependent 4 members in the nand chip description structure. 5 </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Basic_defines"></a>Basic defines</h2></div></div></div><p> 6 At least you have to provide a mtd structure and 7 a storage for the ioremap'ed chip address. 8 You can allocate the mtd structure using kmalloc 9 or you can allocate it statically. 10 In case of static allocation you have to allocate 11 a nand_chip structure too. 12 </p><p> 13 Kmalloc based example 14 </p><pre class="programlisting"> 15static struct mtd_info *board_mtd; 16static void __iomem *baseaddr; 17 </pre><p> 18 Static example 19 </p><pre class="programlisting"> 20static struct mtd_info board_mtd; 21static struct nand_chip board_chip; 22static void __iomem *baseaddr; 23 </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Struct_member_identifiers_XXX.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="Partition_defines.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Struct member identifiers [XXX] </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Partition defines</td></tr></table></div></body></html> 24