O:31:"Drupal\Core\Render\HtmlResponse":8:{s:7:"headers";O:50:"Symfony\Component\HttpFoundation\ResponseHeaderBag":5:{s:23:"*computedCacheControl";a:2:{s:7:"max-age";s:3:"300";s:6:"public";b:1;}s:10:"*cookies";a:0:{}s:14:"*headerNames";a:14:{s:12:"content-type";s:12:"Content-Type";s:13:"cache-control";s:13:"Cache-Control";s:4:"date";s:4:"Date";s:22:"x-drupal-dynamic-cache";s:22:"X-Drupal-Dynamic-Cache";s:4:"link";s:4:"Link";s:15:"x-ua-compatible";s:15:"X-UA-Compatible";s:16:"content-language";s:16:"Content-language";s:22:"x-content-type-options";s:22:"X-Content-Type-Options";s:15:"x-frame-options";s:15:"X-Frame-Options";s:7:"expires";s:7:"Expires";s:13:"last-modified";s:13:"Last-Modified";s:4:"etag";s:4:"ETag";s:4:"vary";s:4:"Vary";s:11:"x-generator";s:11:"X-Generator";}s:10:"*headers";a:14:{s:12:"content-type";a:1:{i:0;s:24:"text/html; charset=UTF-8";}s:13:"cache-control";a:1:{i:0;s:19:"max-age=300, public";}s:4:"date";a:1:{i:0;s:29:"Mon, 20 Nov 2017 23:30:09 GMT";}s:22:"x-drupal-dynamic-cache";a:1:{i:0;s:4:"MISS";}s:4:"link";a:6:{i:0;s:39:"</yaffs-porting-guide>; rel="canonical"";i:1;s:28:"</node/369>; rel="shortlink"";i:2;s:38:"</yaffs-porting-guide>; rel="revision"";i:3;s:108:"</sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ozekku>; rel=preload; as=style";i:4;s:108:"</sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ozekku>; rel=preload; as=style";i:5;s:99:"</sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js>; rel=preload; as=script";}s:15:"x-ua-compatible";a:1:{i:0;s:7:"IE=edge";}s:16:"content-language";a:1:{i:0;s:2:"en";}s:22:"x-content-type-options";a:1:{i:0;s:7:"nosniff";}s:15:"x-frame-options";a:1:{i:0;s:10:"SAMEORIGIN";}s:7:"expires";a:1:{i:0;s:29:"Sun, 19 Nov 1978 05:00:00 GMT";}s:13:"last-modified";a:1:{i:0;s:29:"Mon, 20 Nov 2017 23:30:04 GMT";}s:4:"etag";a:1:{i:0;s:12:""1511220604"";}s:4:"vary";a:1:{i:0;s:6:"Cookie";}s:11:"x-generator";a:1:{i:0;s:33:"Drupal 8 (https://www.drupal.org)";}}s:15:"*cacheControl";a:2:{s:7:"max-age";s:3:"300";s:6:"public";b:1;}}s:10:"*content";s:45631:"<!DOCTYPE html>
<html  lang="en" dir="ltr" prefix="content: http://purl.org/rss/1.0/modules/content/  dc: http://purl.org/dc/terms/  foaf: http://xmlns.com/foaf/0.1/  og: http://ogp.me/ns#  rdfs: http://www.w3.org/2000/01/rdf-schema#  schema: http://schema.org/  sioc: http://rdfs.org/sioc/ns#  sioct: http://rdfs.org/sioc/types#  skos: http://www.w3.org/2004/02/skos/core#  xsd: http://www.w3.org/2001/XMLSchema# ">
  <head>
    <meta charset="utf-8" />
<meta name="title" content="Yaffs Porting Guide | Yaffs - A Flash File System for embedded use" />
<meta name="news_keywords" content="Flash File System" />
<meta name="description" content="The purpose of this document is to describe how to bring up Yaffs2 on a board previously unsupported using the Yaffs Direct Interface, with an example using eCos on a Balloon board." />
<meta name="abstract" content="Yaffs (Yet Another Flash File System) is an open-source file system specifically designed to be fast, robust and suitable for embedded use with NAND and NOR Flash. It is widely used with Linux, RTOSs, or no OS at all, in consumer devices and critical infrastructure. It is available under GNU Public License, GPL, or on commercial terms from Aleph One." />
<meta name="keywords" content="flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs" />
<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="stylesheet" href="https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css" media="all" />
<link rel="shortcut icon" href="/sites/default/files/yaffs_favicon.png" type="image/png" />
<link rel="canonical" href="/yaffs-porting-guide" />
<link rel="shortlink" href="/node/369" />
<link rel="revision" href="/yaffs-porting-guide" />

    <title>Yaffs Porting Guide | Yaffs - A Flash File System for embedded use</title>
    <link rel="stylesheet" href="/sites/default/files/css/css_YGKHk3qOgVcGqV_6s_kZUGJkGYQEouHb462Ja18qfRA.css?ozekku" media="all" />
<link rel="stylesheet" href="/sites/default/files/css/css_6qeLA6GBkZNPHWp9GdQIYovV3tYuKU-ts-HicZ-WeQQ.css?ozekku" media="all" />

    
<!--[if lte IE 8]>
<script src="/sites/default/files/js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js"></script>
<![endif]-->

  </head>
  <body class="fontyourface path-node page-node-type-page navbar-is-fixed-top has-glyphicons">
    <a href="#main-content" class="visually-hidden focusable skip-link">
      Skip to main content
    </a>
    <div style="background-color: ; color: " id="environment-indicator">
  
    </div>

              <header class="navbar navbar-default navbar-fixed-top" id="navbar" role="banner">
              <div class="container">
            <div class="navbar-header">
          <div class="region region-navigation">
          <a class="logo navbar-btn pull-left" href="/" title="Home" rel="home">
      <img src="/themes/custom/yaffs/logo.svg" alt="Home" />
    </a>
      
  </div>

                          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
              </div>

                    <div id="navbar-collapse" class="navbar-collapse collapse">
            <div class="region region-navigation-collapsible">
    <nav role="navigation" aria-labelledby="block-mainnavigation-menu" id="block-mainnavigation">
            <h2 class="sr-only" id="block-mainnavigation-menu">Main navigation</h2>

      
              <ul class="menu nav navbar-nav">
                            <li>
        <a href="/" data-drupal-link-system-path="&lt;front&gt;">Home</a>
                  </li>
                        <li>
        <a href="/support" title="Help for Yaffs" data-drupal-link-system-path="node/380">Support</a>
                  </li>
                        <li>
        <a href="/documents" data-drupal-link-system-path="documents">Documents</a>
                  </li>
                        <li>
        <a href="/get-yaffs" data-drupal-link-system-path="node/382">Download</a>
                  </li>
                        <li>
        <a href="/about-us" data-drupal-link-system-path="node/325">About us</a>
                  </li>
                        <li>
        <a href="/contact" data-drupal-link-system-path="node/73">Contact</a>
                  </li>
        </ul>
  


  </nav>
<div class="search-block-form block block-search block-search-form-block" data-drupal-selector="search-block-form" id="block-searchform" role="search">
  
    
      <form action="/search/node" method="get" id="search-block-form" accept-charset="UTF-8">
  <div class="form-item js-form-item form-type-search js-form-type-search form-item-keys js-form-item-keys form-no-label form-group">
      <label for="edit-keys" class="control-label sr-only">Search</label>
  
  
  <div class="input-group"><input title="Enter the terms you wish to search for." data-drupal-selector="edit-keys" class="form-search form-control" placeholder="Search" type="search" id="edit-keys" name="keys" value="" size="15" maxlength="128" data-toggle="tooltip" /><span class="input-group-btn"><button type="submit" value="Search" class="button js-form-submit form-submit btn-primary btn icon-only" name=""><span class="sr-only">Search</span><span class="icon glyphicon glyphicon-search" aria-hidden="true"></span></button></span></div>

  
  
  </div>
<div class="form-actions form-group js-form-wrapper form-wrapper" data-drupal-selector="edit-actions" id="edit-actions"></div>

</form>

  </div>

  </div>

        </div>
                    </div>
          </header>
  
  <div role="main" class="main-container container js-quickedit-main-content">
    <div class="row">

            
            
                  <section class="col-sm-12">

                                      <div class="highlighted">  <div class="region region-highlighted">
      


  </div>
</div>
                  
                
                
                                      
                  
                          <a id="main-content"></a>
            <div class="region region-content">
        <h1 class="page-header"><span property="schema:name">Yaffs Porting Guide</span>
</h1>

  <article role="article" about="/yaffs-porting-guide" typeof="schema:WebPage" class="page full clearfix">

  
      <span property="schema:name" content="Yaffs Porting Guide" class="hidden"></span>


  
  <div class="content">
    
            <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>version 2.0</p>

<p>Last changed: rrw@kynesim.co.uk, 2009-03-20<br />
 </p>

<h3>Purpose</h3>

<p>The purpose of this document is to describe how to bring up Yaffs2 on a board previously unsupported using the Yaffs Direct Interface, with an example using eCos on a Balloon board.</p>

<p>Before we start you probably want to have the data sheet for the NAND chips you are using in front you so that you can refer to it as we go along.</p>

<h3>Background and NAND Flash Properties</h3>

<p>NAND flash is generally arranged in <em>pages</em> and <em>blocks</em>. A page contains a section of data bytes and then a section of out-of-band (<em>OOB</em>) data bytes. Blocks contain a number of pages .<br /><a href="/yaffs-embedded-structure"><img alt="YAFFS porting guide diagram" height="335" src="/sites/yaffs.net/files/images/yaffs_porting_guide_html_2de490f8.png" width="783" /></a></p>

<p>The OOB section of each page is used keep track of various things like file system state, error correction data and bad block marking.</p>

<p>NAND flash is programmed (written to) and read on a largely page basis (though with some level of random access) and is erased on a block basis. That is, to erase a page, you must erase the rest of the containing block along with it.</p>

<p>When programming NAND flash only 1's can be programmed to 0's, so to change a byte containing 0x00 to 0xFF it must be erased, along with the rest of the block. However subsequent programs may still be made without an erase if no 0s are to be changed to 1s, this might be useful in a scenario where subsequent data might regularly have this property.</p>

<p>When manufactured NAND flash contains bad blocks, these are blocks that are not reliable and any data in them will commonly corrupt easily. These must be kept track of and the OOB data section is used to mark a bad block.</p>

<p>NAND in general is prone to bit errors and for that reason the OOB data is also used to write error correction codes (ECC) so that some errors can be corrected.</p>

<h3>Yaffs NAND Model</h3>

<p>It is probably a good thing to detail at this point how Yaffs2 expects the NAND to behave so that you are aware of what you have to provide in the NAND driver to get YAFF running. Yaffs uses some different terminology in that it refers to a page as a <em>chunk</em>.</p>

<p>Yaffs2 uses a fairly abstract model for NAND flash, this allows a lot of flexibility in the way Yaffs can be used. Yaffs is designed for NAND flash and makes the following assumptions and definitions:</p>

<ul><li>NAND flash is arranged in blocks. Each block is the same size and comprises an integer number of chunks. Each block is treated as a single erasable item.</li>
	<li>A page (chunk) equates to the allocation units of flash.</li>
	<li>All accesses (reads and writes) are page (chunk) aligned.</li>
	<li>When programming a NAND flash, only the zero bits in the pattern being programmed are relevant, and one bits are "don't care". For example, if a byte already contains the binary pattern 1010, then programming 1001 will result in the pattern which is the logical AND of these two patterns i.e. 1000. This is different to NOR flash.</li>
</ul><p>Yaffs identifies blocks by their block number and chunks by their chunk Id. Yaffs treats a blank (0xFF filled) block as being free or erased. Thus, the equivalent of formatting for a Yaffs partition is to erase all the blocks that are not bad.</p>

<p>Therefore Yaffs minimally needs access to functions that enable it to erase blocks and to read and write on a page basis. It is also helpful to be able to read only OOB data as reading/writing a full page to only view/update OOB data will cost many serial read cycles over the bus. This is an overhead that can be avoided using the random access read and write features of some nand chips.</p>

<p> </p>

<h2>Writing a Driver for NAND flash Chips</h2>

<h3>Writing a Driver for the Samsung 628 K9F2G08U0M PCB0 on the Balloon Board (v3.01)</h3>

<p>For the Balloon board the NAND chips hang off the CPLD which is in turn hooked up to the system bus. This is quite board specific and in this case reading the VHDL code reveals how to change the values on the pins of the NAND chips. You may look at the code by downloading the balloon source code (Appendix A) and looking at balloon3.vhd and Balloon_nand.vhd in balloon/vhdl/fpga/.</p>

<p>It will be likely that this is significantly different on your platform and you should consult the relevant data sheets and documentation to determine how to access the NAND hardware on your board. I will present an example of the balloon board in order to give an overview of the kind of thing that is required.</p>

<p>On the Balloon the CPLD routes data on the bus with certain address to the logic on the CPLD that actually controls the flash chips. They are as follows:</p>

<p><code>NAND Data Bus : 0x10e00000</code> <code>NAND Control 2: 0x10e00010</code> <code>NAND Control : 0x10e00014</code></p>

<p>Sending data to the 'NAND Data Bus' address will put that data onto the I/O pins of the NAND chips. All of the nand chips are hooked up to the same pins on the CPLD so writing to the 'NAND Data Bus' address will put the value written on the I/O pins for <em>all</em> of the available flash chips. To isolate the chip you want to work with using the chip enable pin on each flash chip.</p>

<p>This is done by writing to the 'NAND Control' (0x10e00014) address. When writing to 'NAND control', the CPLD takes the data value on the bus and routes each bit to a different wire. This bit field is structured as follows:</p>

<p> </p>

<table><colgroup><col /><col /></colgroup><tr><td><em>Pin Attached To</em></td>
			<td><em>Bit in NAND Control value</em></td>
		</tr><tr><td>CLE (Control Latch Enable)</td>
			<td>0</td>
		</tr><tr><td>ALE (Address Latch Enable)</td>
			<td>1</td>
		</tr><tr><td>nCE0 (not Chip Enable for chip 0)</td>
			<td>2</td>
		</tr><tr><td>nCE1 (for chip 1)</td>
			<td>3</td>
		</tr><tr><td>nCE2 (for chip 2)</td>
			<td>4</td>
		</tr><tr><td>nCE3 (for chip 3)</td>
			<td>5</td>
		</tr><tr><td>nSE (not Chip Enable for chip 0)</td>
			<td>6</td>
		</tr><tr><td>nWP (not Write Protect)</td>
			<td>7</td>
		</tr></table><p> </p>

<p>So for example bit 1 on the data lines is put onto the ALE pin on the physical chip. Bits prefixed with 'n' are active low, for example chip 0 is selected when nCE0 is low and nCE1-3 are high.</p>

<p> </p>

<p>So writing to 'NAND Control' we can change the values of the pins on the flash. Again, CLE, ALE, nSE and nWP change the value of the corresponding pin on all the flash chips available, nCE[0-3] will select the chip you are using.</p>

<p>Finally, NAND flash typically comes in couple of flavours, 8 bit wide (x8) and 16 bit wide (x16). This means that x8 chips have 8 I/O pins and x16 have 16. The logic on the CPLD on the Balloon can handle both if you tell it which you are currently dealing with. Writing to 'NAND Control 2' a value of 1 puts the CPLD logic for the NAND chips into x8 mode and 0 into x16 mode. I will assume for the rest of this document that there are only x8 chips connected to the balloon but it should be fairly trivial to extend it to support both.</p>

<h3>Using the Flash Chips</h3>

<p>The flash chips we're using have a number of commands, each triggered by a sequence of one or two command codes. You will want to refer to the data sheets for precise details of these functions, but I will briefly describe some of them in this document. The command set that we have for the particular chip we're using is table 1 on page 7 of the data sheet.</p>

<p>To input a command there is generally one or two command input cycles. For two cycle commands there is generally an initial command followed by some data needed to complete the command then another command cycle to notify that the relevant data has been input and to start execution. For example for read operations the command 0x00 is latched in followed by some address input cycles followed by the command 0x30 to start the operation. With this in mind I will now describe how to input commands, the 'Command Latch Cycle'.</p>

<p>Note that for this section I have assumed that the bus is sufficiently slow that the set-up and hold times are not an issue, if you have a fast bus then you may have to wait for a small amount of time (refer to the data sheet) after changing values on the pins (by writing to the correct address) so that set-up and hold times are not violated.</p>

<h3>Command Latch Cycle</h3>

<p>For the command latch cycle you need to first select a chip by setting the relevant nCE low and then you need to set the CLE bit high, that means writing to the 'NAND Control' address. ALE must also be low and should be set at the same time as CLE. It is then a case of putting the command value onto the I/O pins by writing to the 'NAND Data Bus' address the value of the command you want. This will then latch in the command, afterwards you will need to clear the CLE bit again.</p>

<p>You will also notice from looking at the data sheet that something needs to be done with the nWE (not <strong>w</strong>rite <strong>e</strong>nable) pin (specifically it should be low while latching in the command), but that I have yet to describe a mechanism for changing its value. This is because it is dealt with by the logic in the CPLD and whenever data is sent to the data address the CPLD will toggle nWE appropriately. (This is also true of nRE (not <strong>r</strong>ead <strong>e</strong>nable) when reading). This process is implemented in the nand_chip_select and the send_command functions (flash.c).</p>

<h3>Address Latch Cycle and Addressing</h3>

<p>The process for the Address Latch Cycle is similar to that for command latching (with the sense of ALE and CLE reversed) and can be looked at in the data sheet and is implemented in send_address in flash.c. The addressing is done by row and column. There are 5 address cycles on the flash chips we're looking at. The first cycle contains bits 0-7 of the column address, the second bits 8-11 with the remaining bits of the byte to be sent low. The row address is over 3 more cycles in a similar fashion.</p>

<p>You may wish to chose to address the individual bytes of the chip with the OOB data not directly addressable. This has enabled me to lump several chips into the same address space and select the correct chip based on the address. Addresses then need to be converted to row and column. You should also check that they are page/block aligned in the relevant places if that's what your functions expect. It needn't be done this way any you could use page numbers instead of bytes just as easily.</p>

<p><br /><a href="/yaffs-embedded-structure"><img alt="YAFFS porting guide diagram 2" height="209" src="sites/yaffs.net/files/images/yaffs_porting_guide_html_m11b1f893.png" width="654" /></a></p>

<p> </p>

<p>The 'row' is essentially the page index and the 'column' is the index into to that page, so if you wanted to read from the start of page 213 you would send 0 for the column and 213 for the row. Conversely if you wanted just the OOB bytes from the same page you would send a column value of 2048 (given a page size of 2048+64 bytes).</p>

<p><br /><a href="/yaffs-embedded-structure"><img alt="YAFFS porting guide diagram 3" height="271" src="sites/yaffs.net/files/images/yaffs_porting_guide_html_m4650262f.png" width="347" /></a></p>

<p> </p>

<h3>Finding Chip information</h3>

<p>You will then need to find out which chips are active (e.g. on the balloon there are 4 possible chips, not all of which will exist) and what type of chips they are. For this there is the 'Read ID' operation. This operation is implemented in the read_ids function in flash.c. The result of the operation gives the manufacturer and device code of the chip and information about the chip (page size, block size, oob size etc). To find which chips are available, loop through the possible chips and start a Read ID command on each of them, if the expected data is returned then there is a chip at that location.</p>

<p>The operation is started by sending the command 0x90 and then one address cycle of 0x00. There are then 5 read cycles which give you data about the device. A description of how to unpack this information from the returned bytes is located on page 32 of the data sheet for the chip described here.</p>

<p>This then gives you how many chips you have and what layout the data in them has.</p>

<h3>Bad Block Checking</h3>

<p>Contained within a nand chip are blocks that the manufacturer will not guarantee the reliability of (this is to increase yield in manufacturing) and so bad blocks must be kept track of. The Samsung chips come with the first byte (or word for x16) of the first and second page of each bad block not programmed as 0xFF.</p>

<p>This bad block marking should be maintained and should be added to in the same way when a bad block is is discovered. Yaffs will expect you to provide a function it can call to mark a particular block as bad when yaffs decides it is necessary.</p>

<p>Yaffs keeps track of bad blocks itself so that the driver doesn't need to worry about masking out bad blocks.</p>

<h3>Erasing a Block</h3>

<p>An example of this operation is given in nand_erase_block in flash.c. If you are addressing the nand by bytes then you must first check that the address is aligned to the start of a block and then convert the address into a block number. If there is more than one chip this will involve working out which chip the address refers to and then selecting the correct chip. This can be seen in the select_chip function in flash.c. You must then send the first command cycle for the erase operation before sending 3 cycles of address and then finally the last command cycle.</p>

<p>For the erase operation the 3 address cycles are different than for the read/write operations. Only address bits A18 to A29 is valid (for x8) while A12 to A17 is ignored. In terms of the ordinary 5 cycles address input you only need to deal with the last 3 cycles and of those only the highest 2 bits of the 3rd cycle are used and the full 4th and 5th cycle are used.</p>

<p>Once the operation has been started the program can check the progress of the operation by sending a command of 70h. Each subsequent read will contain the read status. The driver should wait until the read is complete (by the read status operation), the read status operation also contains information about whether the erase failed and this information should be returned from the function doing the erase.</p>

<h3>Reading a Page</h3>

<p>Reading a page is performed by first selecting the correct chip and then converting the address to a row and column number. You can then sending the first command cycle for the read operation followed by 5 address cycles as described in the previous sections. The second command cycle then starts the read operation. The driver must then wait for the data to be retrieved into the data registers on the NAND before they can be read out over the bus. For the example chip this is 25us, consult the data sheet as this may differ. The data can then be read out sequentially byte by byte until all the data needed is obtained.</p>

<h3>Writing a Page</h3>

<p>Page program operations are performed by first selecting the correct chip converting the address to row and column numbers. The page program operation is initiated by the relevant fist command latch cycle (command 0x80) followed by an address latch cycle (as for read), serial data loading and then the second command latch cycle (command 0x10).</p>

<p>The serial data loading is done by serially writing data to the I/O pins. Up to 2112 bytes (x8) can be loaded into the data registers. Once the second command cycle is sent the program is initiated and there is then a programming period where the loaded data is programmed into the appropriate cell. The driver should wait for this to complete by issuing a read status command (0x70) and monitoring the R/nB (ready / not busy) bit. The R/nB flag is on I/O pin 6 and can be checked by repeatedly reading from the 'NAND Data Bus' address. Once the operation is complete the Write Status Bit (I/O 0 ) may be checked to confirm that the operation was successful.</p>

<h2>Yaffs</h2>

<h3>How To Use Yaffs</h3>

<h3>Checking Out From Git</h3>

<p>The first thing to do is to obtain the source code for Yaffs. This can be done from CVS, details of the process can be found at <a href="http://www.yaffs.net/download-yaffs-using-git">http://www.yaffs.net/download-yaffs-using-git</a>.</p>

<p>The following command will checkout the latest Git version using public read-only access, if you are using bash.</p>

<p><code>$ </code>git clone git://www.aleph1.co.uk/yaffs2 </p>

<h3>Making Some Tweaks to the Source Code</h3>

<p>As of the latest version from CVS in January 2009, you will need to make a small number of changes before you can compile the source code without errors and warnings. There is a patch file included with this document.</p>

<p>You will need to provide a definition of loff_t (in yaffs2/direct/ydirectenv.h) this is for holding the file size in bytes, you should make it big enough to hold the largest file size you wish to support. Unsigned long is probably a good place to start. You will need to edit yaffsfs.c to change a #if to a #ifdef. Then if you have the relevant warnings and -Werror switched on you will need to correct a couple of printf format strings to get the type right (changing a few '%d' to '%ld').</p>

<p><code>change yaffs/ydirectenv.h </code></p>

<p><code>+ typedef unsigned long loff_t; </code></p>

<p><code>change yaffs2/direct/yaffsfs.c ~line 1117 </code></p>

<p><code>- #if CONFIG_YAFFS_WINCE </code></p>

<p><code>+ #ifdef CONFIG_YAFFS_WINCE</code></p>

<h3>Relevant Files to the Direct Interface</h3>

<p>There are quite a few files that get checked out, not all of which you will need to get going with the yaffs direct interface. The ones you will actually need are listed bellow, you do not need to compile the rest in.</p>

<p><code><code>direct/yaffsfs.c </code></code></p>

<p><code><code>yaffs_guts.c </code></code></p>

<p><code><code>direct/yaffscfg.c </code></code></p>

<p><code><code>yaffs_nand.c </code></code></p>

<p><code><code>yaffs_tagsvalidity.c </code></code></p>

<p><code><code>yaffs_checkptrw.c </code></code></p>

<p><code><code>yaffs_qsort.c </code></code></p>

<p><code><code>yaffs_tagscompat.c </code></code></p>

<p><code><code>yaffs_ecc.c </code></code></p>

<p><code><code>yaffs_packedtags2.c</code></code></p>

<h3>Some Relevant Preprocessor Flags</h3>

<p>There are many different configuration options for yaffs, here are a few that you should be aware of for using the yaffs direct interface.</p>

<ul><li>CONFIG_YAFFS_DIRECT - Tell yaffs to use the direct interface.</li>
	<li>CONFIG_YAFFS_YAFFS2 - Tell yaffs we want to use yaffs2</li>
	<li>CONFIG_YAFFS_PROVIDE_DEFS - provides some definitions for file types and #includes linux/types.h, linux/fs.h, linux/stat.h (see yaffs2/devextras.h).</li>
	<li>CONFIG_YAFFSFS_PROVIDE_VALUES - This may be used so that you can customise error values and constants like O_RDONLY to match the underlying system values, if itis not defined then it includes errno.h,sys/stat.h and fcntl.h (see yaffs2/direct/yaffsfs.h).</li>
</ul><p>Specify these options when compiling yaffs, i.e. -DCONFIG_YAFFS_DIRECT etc.</p>

<h3>Configuring</h3>

<p>You will then need to provide yaffs with configuration information. This includes details about the nand flash you are using and also tells yaffs which functions to call when when it wants to read/write/erase parts of the flash, these functions will form the bridge between yaffs and the underlying hardware driver. This customisation is done in yaffscfg.h. Within yaffscfg.h you will need to provide a number of operating-system-like functions and a function to initialise yaffs. For example providing functions for malloc and free. Here is a breakdown of those functions that need to be implemented.</p>

<h3>Operating System Functions</h3>

<p><code><code>void yaffsfs_SetError(int err); </code> </code></p>

<p>Report system errors, for example using errno if it exists.</p>

<p><code><code>void *yaffs_malloc(size_t size);</code> <code>void yaffs_free(void *ptr);</code> </code></p>

<p>As for the standard malloc and free functions, if they already exist on your system then you can just shim them.</p>

<p><code><code>void yaffsfs_LocalInitialisation(void);</code> <code>void yaffsfs_Lock(void);</code> <code>void yaffsfs_Unlock(void);</code> </code></p>

<p>Use yaffsfs_LocalInitalisation to initialise "Real Time Operating System" state, if the system is multi-threaded then it should initialise a semaphore/mutex for use by lock and unlock. Lock/unlock should use the semaphore set up in LocalInitialisation to lock yaffs from multi-threaded access.</p>

<p><code><code>__u32 yaffsfs_CurrentTime(void);</code> </code></p>

<p>This can be any time increment of use to the system. If this is not required, then it is fine to just use a function that returns zero.</p>

<h3>Yaffs Startup Function</h3>

<p><code><code>int yaffs_StartUp(void); </code> </code></p>

<p><code><code>Return value: YAFFS_OK or YAFFS_FAIL</code> </code></p>

<p>This functions should be used to provide yaffs with many details about the properties of the underlying nand device. Within this function you will need to set up a 'yaffs_Device' (yaffs_guts.h) and a 'yaffsfs_DeviceConfiguration' (direct/yaffscfg.h). How to set up a yaffs device will follow in the next section. Once you have set up the required yaffs_Device structures you should call yaffs_initialise (yaffs_guts.h) with a pointer to a null terminated array of yaffs_DeviceConfiguration structures. A yaffs_DeviceConfiguration structure contains a pointer to a yaffs_Device and the 'mount point' string (prefix) that that device corresponds to.</p>

<h3>Yaffs Devices</h3>

<p>A yaffs device is a logical device that represents part of or a whole physical device. You might think of it as a 'partition' on the nand. For example, it might cover the whole of the nand device or perhaps only claim half, with another yaffs_Device claiming the other half. It may also be used so that you can use a device other than a flash device (e.g. RAM) for testing purposes.</p>

<p>A yaffs_Device keeps track of the start and end block, so you may have more than one yaffs_Device corresponding to the same physical device by altering the start and end block of the yaffs device.</p>

<p>The fields on the yaffs_Device struct that you need to set up yourself are listed below, all other fields are setup automatically by yaffs.</p>

<p><code><code>int nDataBytesPerChunk</code> </code></p>

<p>As the name suggests this is the number of bytes per chunk, remembering that in yaffs terminology a page is referred to as a chunk, this is then the number of bytes per page. This is the number of data bytes, that is the number of bytes excluding the OOB byte data. E.g. if a page is 2048byte + 64bytes of OOB then set nDataBytesPerChunk to 2048.</p>

<p><code><code>int nChunksPerBlock </code> </code></p>

<p>Straightforwardly the number of chunks (pages on the nand) in each block on the physical nand device. Must be at least 2.</p>

<p><code><code>int spareBytesPerChunk</code></code><br />
This is the size of the spare area, i.e. the number of OOB bytes per chunk (page)<code>. </code></p>

<p><code><code>int startBlock</code> </code></p>

<p>The block number (not the address in bytes) on the chip of the first block of this logical yaffs_Device. Beware, yaffs needs the first block to be free so you should not set this to 0, if it is then yaffs will add on one to it itself and also add on one to the end block which could be an issue if you wanted your device to start at block 0 and finish at the last block which might mean yaffs trying to write to a non-existent block.</p>

<p><code><code>int endBlock</code> </code></p>

<p>The block number on the chip of the last block for this logical yaffs_Device. If startBlock == 0 then yaffs will use endBlock+1. Must be at least startBlock + nReservedBlocks + 2.</p>

<p><code><code>int nReservedBlocks</code> </code></p>

<p>This is then number of erasable blocks that Yaffs must keep in reserve for garbage collection and to cover for block failures. This must be a minimum of 2, but 5 or so is better. If you are using a medium that is not expected to fail (eg. RAM for a RAM disk, or a host file system emulation then 2 is OK).</p>

<p><code><code>int nShortOpCaches</code> </code></p>

<p>This configures the number of entries in the Yaffs cache for this device. A value of zero defeats the cache. A value of 10 to 20 is recommended for most systems. Cannon be any bigger than YAFFS_MAX_SHORT_OP_CACHES.</p>

<p><code><code>int useNANDECC</code> </code></p>

<p>This is a flag that tells yaffs whether it should be doing ECC calculations or if it should be left to the driver.</p>

<p><code><code>void *genericDevice</code> </code></p>

<p>This is a pointer which should point to any data that the underlying nand driver will need to know to write and read from the physical device.</p>

<p><code><code>int isYaffs2</code> </code></p>

<p>Are we using Yaffs2? We only deal with Yaffs2 in this document.</p>

<p><code><code>int inbandTags</code> </code></p>

<p>Is there an OOB section? If not then this should be true. Only relevant to Yaffs2.</p>

<p><code><code>_u32 totalBytesPerChunk</code> </code></p>

<p>Possibly a misleading name, it should be equal to nDataBytesPerChunk not nDataBytesPerChunk + spareBytesPerChunk as the name might suggest. If inbandTags is true then yaffs sets nDataBytesPerChunk such that there is enough space for the data yaffs would normally store in the spare area.</p>

<p><code><code>write/readChunkWithTagsFromNAND, markNANDBlockBad, queryNANDBlock</code> </code></p>

<p>These are all pointers to functions that you shall provide to provide Yaffs with a method of writing/reading etc from the NAND.</p>

<h3>NAND access functions</h3>

<p>If you are using Yaffs2 you need to provide pointers to functions that Yaffs can call to write and read from the nand. Example implementations of these function can be seen in yaffs_mtdif.c, these are the functions written to do the same job for the linux mtd layer and provides the write and read functions. The following functions return YAFFS_OK on success and YAFFS_FAIL on failure.</p>

<p><code><code>int (*writeChunkWithTagsToNAND) (struct yaffs_DeviceStruct * dev,</code> <code>int chunkInNAND, const __u8 * data,</code> <code>const yaffs_ExtendedTags * tags);</code> <code>dev: yaffs_Device to write to.</code> <code>chunkInNAND: Which page to write the chunk to.</code> <code>Data: Pointer to the data to write</code> <code>tags: Unpacked OOB data.</code> <code>Return: YAFFS_OK / YAFFS_FAIL</code> </code></p>

<p>This function is to write pages (chunks) to the nand. In this function you will probably want to first retrive any useful data that you put in dev-&gt;genericDevice (in the yaffs_StartUp function) and use it to call the function you wrote previously to write data to the nand. For yaffs2 data and tags should never be NULL. chunkInNand is the page number of the page to write to, not an address so it will need converting if that's what your underling functions to write to the nand expect.</p>

<p>You will then need to pack the tags into a yaffs_PackedTags2 structure, this takes out the all relevant details from the yaffs_ExtendedTags tags structure and calculates ECC data on it before placing them in the packedtags2 structure. This structure is the OOB data you will want to write out to the nands spare area.</p>

<p>How you write these out to the OOB data depends on your architecture, nand chips and therefore how bad block marking is done. If for example the first byte is used for bad block marking then simply writing the tags out after the first byte is acceptable. The ECC data in packed tags only covers error correction and detection for the tags in the OOB data, if you want ECC on the data then you must do that yourself.</p>

<p>To perform ECC checks to the data bytes you may use the yaffs_ECCCalculate function which calculates ECC data for 256 byte sections of data. This function produces 3 bytes of ECC data per 256 bytes. Therefore for 2048 bytes of data in each page you would need (2048/256) * 3 = 8 * 3 = 24 extra bytes of ECC data. This can be written out after the bad block byte and packed tags data.<br />
 </p>

<p><code><code>int (*readChunkWithTagsFromNAND) (struct yaffs_DeviceStruct * dev,</code> <code>int chunkInNAND, __u8 * data,</code> <code>yaffs_ExtendedTags * tags);</code> <code>dev: The yaffs_Device to read from.</code> <code>chunkInNAND: Which page to read from.</code> <code>Data: Pointer to a buffer to read data to.</code> <code>tags: Pointer to a buffer to unpacked OOB data into.</code> <code>Return: YAFFS_OK / YAFFS_FAIL</code> </code></p>

<p>This function should do the opposite to the previous function. Firstly, read in the data and OOB bytes. Secondly place the data bytes in the area pointed to by data, then unpack the OOB bytes into into the pointer to tags using yaffs_UnpackTags2.</p>

<p>Once the tags have been unpacked you should then recalculate the ECC data on the data bytes you just read back, just as you did for the write operation. Then use the recalculated ECC and the ECC data read out of the OOB bytes with yaffs_ECCCorrect to correct the data.</p>

<p>Depending on the return value from yaffs_ECCCorrect you should set tags-&gt;eccResult to reflect whether anything was corrected or the correction failed. yaffs_UnpackTags2 also sets tags-&gt;eccResult so you should only update it if the result of the data correction is worse than is already there. i.e. if after the tags are unpacked and eccResult is YAFFS_ECC_RESULT_FIXED and ECC correction on the data read back resulted in no errors then you should leave unpackedtags2 and YAFFS_ECC_RESULT_FIXED and not set it to YAFFS_ECC_RESULT_NO_ERROR.</p>

<p><code><code>int (*markNANDBlockBad) (struct yaffs_DeviceStruct * dev, int blockNo);</code> <code>dev: yaffs_Device to write to.</code> <code>blockNo: Which block to mark.</code> <code>Return: YAFFS_OK / YAFFS_FAIL</code></code></p>

<p>This should mark the block bad. This probably means reading the OOB data and changing the relevant byte that marks the bad block, and writing the OOB data back.</p>

<p><code><code>int (*queryNANDBlock) (struct yaffs_DeviceStruct * dev, int blockNo,</code> <code>yaffs_BlockState * state, __u32 *sequenceNumber);</code> <code>dev: The yaffs_Device to write to.</code> <code>blockNo: Which block to mark.</code> <code>state: Upon returning this should be set to the relevant state of this particular block.</code> <code>Sequence number: The Sequence number of this block. 0 if the block is unused.</code> <code>Return: YAFFS_OK / YAFFS_FAIL</code> </code></p>

<p>This should check whether or not the block is valid.</p>

<p>If the bad block marker is set in the OOB then *state should be set to YAFFS_BLOCK_STATE_DEAD *sequenceNumber set to 0, and return YAFFS_FAIL.</p>

<p>If the block is not bad then the tags should be unpacked. After the tags are unpacked, and it is found that chunk is used (see tags.chunkUsed) *sequenceNumber should be set to tags.sequenceNumber and *state to YAFFS_BLOCK_STATE_NEEDS_SCANNING, otherwise if the block is not used then *sequenceNumber should be 0 and *state should be set to YAFFS_BLOCK_STATE_EMPTY.</p>

<h3>Application Interface</h3>

<p>The yaffs provides a number of functions for applications to interface with it. These are mostly the same as the standard clib open/close etc prefixed with yaffs_ eg yaffs_open. These functions are defined in direct/yaffsfs.h.</p>

<p>To initialise yaffs so that reading and writing can be done, you must call yaffs mount for each yaffs device you would like to use, e.g. yaffs_mount("/boot"). This could be done at system boot if there is an operating system present so that the application need to worry about this. You will also need to call yaffs_unmount when you have finished so that yaffs may write any state it needs to to disk.</p>

<p>If there is already an application interface for reading and writing files you may shim the relevant function calls with the related operating system calls.</p>

<p>E.g. simply doing #define open(path, oflag, mode) yaffs_open(path, oflag, mode)</p>

<p>Or having something more complex to provide redirection functions if there is more than one file system present.</p>

<p><code><code>For example: int open(const char *path,...)<br />
{<br />
//Determine which file system is being used </code> <code>if(it_is_a_yaffs_path(path)) {</code> <code> return yaffs_open(...);<br />
} else {<br />
// Do something else<br />
}<br />
}</code></code></p>

<h2>Appendices</h2>

<h3>Appendix A - Accessing the Balloon Source Code</h3>

<p>The latest source code for the balloon board can be checked out from SVN. There is different code for different balloon versions. Details of getting the source and setting up tool chains is decribed in the following page <a href="http://www.balloonboard.org/software.html">http://www.balloonboard.org/software.html</a>. If you just want to take a look at the latest mainline code then the following will give you what you want.</p>

<p>svn checkout svn://balloonboard.org/balloon/trunk/</p>

<p> </p></div>
      
  </div>

</article>


  </div>

              </section>

                </div>
  </div>

      <footer class="footer container" role="contentinfo">
        <div class="primary_footer row">
            <div class="col-sm-3">
                  <div class="region region-footer-col1">
    <section id="block-yaffs-block-6" class="block block-block-content block-block-content6c2d4b45-4dba-4b2d-8b9f-76701bf27533 clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<ul class="fa-ul">
<li><i class="fa-li fa fa-phone"></i>+44 (0)1223 811679</li>
<li><i class="fa-li fa fa-envelope"></i><a href="denied:mailto:info@aleph1.co.uk?Subject=Website contact" target="_top">info@aleph1.co.uk</a></li>
</ul>
</div>
      
  </section>


  </div>

            </div>
            <div class="col-sm-3">
                
            </div>
            <div class="col-sm-3">
                
            </div>
            <div class="col-sm-3">
                  <div class="region region-footer-col4">
    <section id="block-footerlegal" class="block block-block-content block-block-content78ab593d-35b6-4772-a141-30216e7fcbb2 clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<p class="text-align-right">&nbsp;<a href="/legal">Legal &amp; Cookies</a></p>
</div>
      
  </section>

<section id="block-cookieinfo" class="block block-block-content block-block-content4848c58d-90df-4819-81d8-0f9568eeeaac clearfix">
  
    

      
            <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item">
<p class="text-align-justify"><br />
We use <a href="/legal">cookies on this site</a>. By using it, you are giving us consent to set cookies.</p>
</div>
      
  </section>


  </div>

            </div>
        </div>
        <div class = "secondary_footer row">
            <div class="col-sm-12">
                <div class="region region-footer">
    <nav role="navigation" aria-labelledby="block-yaffs-account-menu-menu" id="block-yaffs-account-menu">
            <h2 class="sr-only" id="block-yaffs-account-menu-menu">User account menu</h2>

      
              <ul class="menu nav navbar-nav navbar-right">
                            <li>
        <a href="/user/login" data-drupal-link-system-path="user/login">Log in</a>
                  </li>
        </ul>
  


  </nav>

  </div>

            </div>
        </div>
    </footer>
  
    
    <script type="application/json" data-drupal-selector="drupal-settings-json">{"path":{"baseUrl":"\/","scriptPath":null,"pathPrefix":"","currentPath":"node\/369","currentPathIsAdmin":false,"isFront":false,"currentLanguage":"en","currentQuery":{"User-Agent":"SAMSUNG-SGH-G508E\/G508EZCIG2 SHP\/VPP\/R5 NetFront\/3.4 Qtv5.3 SMM-MMS\/1.2.0 profile\/MIDP-2.0 configuration\/CLDC-1.1\n"}},"pluralDelimiter":"\u0003","bootstrap":{"forms_has_error_value_toggle":1,"modal_animation":1,"modal_backdrop":"true","modal_keyboard":1,"modal_show":1,"modal_size":"","popover_enabled":1,"popover_animation":1,"popover_container":"body","popover_content":"","popover_delay":"0","popover_html":0,"popover_placement":"right","popover_selector":"","popover_title":"","popover_trigger":"click","popover_trigger_autoclose":1,"tooltip_enabled":1,"tooltip_animation":1,"tooltip_container":"body","tooltip_delay":"0","tooltip_html":0,"tooltip_placement":"auto left","tooltip_selector":"","tooltip_trigger":"hover"},"ajaxTrustedUrl":{"\/search\/node":true},"user":{"uid":0,"permissionsHash":"aa7fc4c8fb40c7a8665ccd12fea07926dff0f59b9ee3346bc513c6399bee5b01"}}</script>
<script src="/sites/default/files/js/js_2l0lF4i9o3aztHULbfajMT_RTqGCEN_lVC8JI48SILw.js"></script>

  </body>
</html>
";s:10:"*version";s:3:"1.0";s:13:"*statusCode";i:200;s:13:"*statusText";s:2:"OK";s:10:"*charset";N;s:23:"*cacheabilityMetadata";O:35:"Drupal\Core\Cache\CacheableMetadata":3:{s:16:"*cacheContexts";a:18:{i:0;s:28:"languages:language_interface";i:1;s:5:"route";i:2;s:32:"route.menu_active_trails:account";i:3;s:29:"route.menu_active_trails:main";i:4;s:30:"route.menu_active_trails:tools";i:5;s:5:"theme";i:6;s:8:"timezone";i:7;s:3:"url";i:8;s:8:"url.path";i:9;s:17:"url.path.is_front";i:10;s:15:"url.path.parent";i:11;s:30:"url.query_args:_wrapper_format";i:12;s:4:"user";i:13;s:21:"user.node_grants:view";i:14;s:16:"user.permissions";i:15;s:10:"user.roles";i:16;s:20:"user.roles:anonymous";i:17;s:24:"user.roles:authenticated";}s:12:"*cacheTags";a:51:{i:0;s:16:"block_content:18";i:1;s:16:"block_content:23";i:2;s:15:"block_content:7";i:3;s:18:"block_content_view";i:4;s:10:"block_view";i:5;s:32:"config:block.block.choosingyaffs";i:6;s:29:"config:block.block.cookieinfo";i:7;s:32:"config:block.block.downloadyaffs";i:8;s:30:"config:block.block.footerlegal";i:9;s:39:"config:block.block.frontimagehighlight2";i:10;s:32:"config:block.block.frontpagehero";i:11;s:39:"config:block.block.frontpageprimeryaffs";i:12;s:33:"config:block.block.mainnavigation";i:13;s:35:"config:block.block.mainnavigation_2";i:14;s:29:"config:block.block.searchform";i:15;s:31:"config:block.block.sitebranding";i:16;s:66:"config:block.block.views_block__highlighted_yaffs_features_block_1";i:17;s:66:"config:block.block.views_block__yaffs_admin_recent_content_block_1";i:18;s:66:"config:block.block.views_block__yaffs_documents_highlights_block_1";i:19;s:56:"config:block.block.views_block__yaffs_user_logos_block_1";i:20;s:37:"config:block.block.yaffs_account_menu";i:21;s:33:"config:block.block.yaffs_block_10";i:22;s:32:"config:block.block.yaffs_block_5";i:23;s:32:"config:block.block.yaffs_block_6";i:24;s:32:"config:block.block.yaffs_block_8";i:25;s:32:"config:block.block.yaffs_block_9";i:26;s:36:"config:block.block.yaffs_breadcrumbs";i:27;s:32:"config:block.block.yaffs_content";i:28;s:29:"config:block.block.yaffs_help";i:29;s:36:"config:block.block.yaffs_local_tasks";i:30;s:33:"config:block.block.yaffs_messages";i:31;s:35:"config:block.block.yaffs_page_title";i:32;s:32:"config:block.block.yaffs_user_21";i:33;s:31:"config:block.block.yaffsinspace";i:34;s:17:"config:block_list";i:35;s:24:"config:color.theme.yaffs";i:36;s:31:"config:filter.format.basic_html";i:37;s:30:"config:filter.format.full_html";i:38;s:29:"config:filter.format.raw_html";i:39;s:22:"config:search.settings";i:40;s:26:"config:system.menu.account";i:41;s:23:"config:system.menu.main";i:42;s:24:"config:system.menu.tools";i:43;s:18:"config:system.site";i:44;s:26:"config:user.role.anonymous";i:45;s:13:"http_response";i:46;s:8:"node:369";i:47;s:9:"node_view";i:48;s:8:"rendered";i:49;s:6:"user:0";i:50;s:6:"user:5";}s:14:"*cacheMaxAge";i:-1;}s:14:"*attachments";a:5:{s:7:"library";a:9:{i:0;s:14:"core/html5shiv";i:1;s:11:"system/base";i:2;s:15:"bootstrap/theme";i:3;s:20:"yaffs/global-styling";i:4;s:23:"yaffs/bootstrap-scripts";i:5;s:19:"yaffs/yaffs-helpers";i:6;s:17:"bootstrap/popover";i:7;s:17:"bootstrap/tooltip";i:8;s:50:"environment_indicator/drupal.environment_indicator";}s:9:"html_head";a:22:{i:0;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:5:"title";s:7:"content";s:66:"Yaffs Porting Guide | Yaffs - A Flash File System for embedded use";}}i:1;s:5:"title";}i:1;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:13:"news_keywords";s:7:"content";s:17:"Flash File System";}}i:1;s:13:"news_keywords";}i:2;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:11:"description";s:7:"content";s:181:"The purpose of this document is to describe how to bring up Yaffs2 on a board previously unsupported using the Yaffs Direct Interface, with an example using eCos on a Balloon board.";}}i:1;s:11:"description";}i:3;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"abstract";s:7:"content";s:352:"Yaffs (Yet Another Flash File System) is an open-source file system specifically designed to be fast, robust and suitable for embedded use with NAND and NOR Flash. It is widely used with Linux, RTOSs, or no OS at all, in consumer devices and critical infrastructure. It is available under GNU Public License, GPL, or on commercial terms from Aleph One.";}}i:1;s:8:"abstract";}i:4;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"keywords";s:7:"content";s:82:"flash File System, flash, file System, flash storage, NAND flash, NOR flash, Yaffs";}}i:1;s:8:"keywords";}i:5;a:2:{i:0;a:3:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:1:{s:7:"charset";s:5:"utf-8";}s:7:"#weight";i:-1000;}i:1;s:24:"system_meta_content_type";}i:6;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:9:"Generator";s:7:"content";s:33:"Drupal 8 (https://www.drupal.org)";}}i:1;s:21:"system_meta_generator";}i:7;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:15:"MobileOptimized";s:7:"content";s:5:"width";}}i:1;s:15:"MobileOptimized";}i:8;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:16:"HandheldFriendly";s:7:"content";s:4:"true";}}i:1;s:16:"HandheldFriendly";}i:9;a:2:{i:0;a:2:{s:4:"#tag";s:4:"meta";s:11:"#attributes";a:2:{s:4:"name";s:8:"viewport";s:7:"content";s:37:"width=device-width, initial-scale=1.0";}}i:1;s:8:"viewport";}i:10;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:125:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansRegular-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1151";}i:11;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:124:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1152";}i:12;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:122:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBold-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1153";}i:13;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:123:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBold-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1149";}i:14;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:129:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifBoldItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1150";}i:15;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:125:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1148";}i:16;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:126:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSerifRegular-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1147";}i:17;a:2:{i:0;a:3:{s:5:"#type";s:8:"html_tag";s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:10:"stylesheet";s:4:"href";s:128:"https://yaffs.net/sites/default/files/fontyourface/fontsquirrel/LiberationSansBoldItalic-fontfacekit/fontyourface-stylesheet.css";s:5:"media";s:3:"all";}}i:1;s:21:"fontsquirrel-api-1154";}i:18;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:3:{s:3:"rel";s:13:"shortcut icon";s:4:"href";s:38:"/sites/default/files/yaffs_favicon.png";s:4:"type";s:9:"image/png";}}i:1;s:67:"html_head_link:shortcut icon:/sites/default/files/yaffs_favicon.png";}i:19;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:9:"canonical";s:4:"href";s:20:"/yaffs-porting-guide";}}i:1;s:45:"html_head_link:canonical:/yaffs-porting-guide";}i:20;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:9:"shortlink";s:4:"href";s:9:"/node/369";}}i:1;s:34:"html_head_link:shortlink:/node/369";}i:21;a:2:{i:0;a:2:{s:4:"#tag";s:4:"link";s:11:"#attributes";a:2:{s:3:"rel";s:8:"revision";s:4:"href";s:20:"/yaffs-porting-guide";}}i:1;s:44:"html_head_link:revision:/yaffs-porting-guide";}}s:12:"placeholders";a:0:{}s:14:"drupalSettings";a:5:{s:4:"path";a:8:{s:7:"baseUrl";s:1:"/";s:10:"scriptPath";N;s:10:"pathPrefix";s:0:"";s:11:"currentPath";s:8:"node/369";s:18:"currentPathIsAdmin";b:0;s:7:"isFront";b:0;s:15:"currentLanguage";s:2:"en";s:12:"currentQuery";O:8:"stdClass":1:{s:10:"User-Agent";s:114:"SAMSUNG-SGH-G508E/G508EZCIG2 SHP/VPP/R5 NetFront/3.4 Qtv5.3 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1
";}}s:15:"pluralDelimiter";s:1:"";s:9:"bootstrap";a:25:{s:28:"forms_has_error_value_toggle";i:1;s:15:"modal_animation";i:1;s:14:"modal_backdrop";s:4:"true";s:14:"modal_keyboard";i:1;s:10:"modal_show";i:1;s:10:"modal_size";s:0:"";s:15:"popover_enabled";i:1;s:17:"popover_animation";i:1;s:17:"popover_container";s:4:"body";s:15:"popover_content";s:0:"";s:13:"popover_delay";s:1:"0";s:12:"popover_html";i:0;s:17:"popover_placement";s:5:"right";s:16:"popover_selector";s:0:"";s:13:"popover_title";s:0:"";s:15:"popover_trigger";s:5:"click";s:25:"popover_trigger_autoclose";i:1;s:15:"tooltip_enabled";i:1;s:17:"tooltip_animation";i:1;s:17:"tooltip_container";s:4:"body";s:13:"tooltip_delay";s:1:"0";s:12:"tooltip_html";i:0;s:17:"tooltip_placement";s:9:"auto left";s:16:"tooltip_selector";s:0:"";s:15:"tooltip_trigger";s:5:"hover";}s:14:"ajaxTrustedUrl";a:1:{s:12:"/search/node";b:1;}s:4:"user";a:2:{s:3:"uid";i:0;s:15:"permissionsHash";s:64:"aa7fc4c8fb40c7a8665ccd12fea07926dff0f59b9ee3346bc513c6399bee5b01";}}s:11:"http_header";a:3:{i:0;a:3:{i:0;s:4:"Link";i:1;s:39:"</yaffs-porting-guide>; rel="canonical"";i:2;b:0;}i:1;a:3:{i:0;s:4:"Link";i:1;s:28:"</node/369>; rel="shortlink"";i:2;b:0;}i:2;a:3:{i:0;s:4:"Link";i:1;s:38:"</yaffs-porting-guide>; rel="revision"";i:2;b:0;}}}}