⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quickstart.htm

📁 SDIO Linux documentation
💻 HTM
字号:
<html><!-- InstanceBegin template="/Templates/helpnav.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Quick Start</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceParam name="HeaderColor" type="color" value="#0000FF" -->
<!-- InstanceParam name="FooterColor" type="color" value="#0000FF" -->
<!-- InstanceParam name="NavBackgroundColor" type="color" value="#FFFFFF" -->
<!-- InstanceParam name="BodyBackgroundColor" type="color" value="#FFFFFF" -->
<link href="CodeTHelp.css" rel="stylesheet" type="text/css">
</head><a name="TopTopic"></a>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
  <tr> 
    <td width="40%" rowspan="2" bgcolor="#0000FF"><a href="http://www.codetelligence.com"><img src="Images/codetelligence_lrg.gif" name="image" width="252" height="40" border="0"></a></td>
    <td width="60%" height="62" bgcolor="#0000FF">
     <font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif"><strong>Embedded SDIO Driver Kit Help </strong></font></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="10" cellpadding="0">
  <tr>
    <td width="93%"><font face="Arial, Helvetica, sans-serif">
<p class="Topic"><!-- InstanceBeginEditable name="SubTemplate" --> Quick Start<!-- InstanceEndEditable --> </p>
</font></td>
    <td><!-- InstanceBeginEditable name="NavBack" --><a href="ListOfTablesAndFigures.htm"><img src="Images/leftarrow.gif" width="27" height="32" border="0"></a><!-- InstanceEndEditable --></td><td><!-- InstanceBeginEditable name="Nav" --><a href="sdio_peripheral_qs.htm"><img src="Images/rightarrow.gif" width="27" height="32" border="0"></a><!-- InstanceEndEditable --></td>
  </tr>
</table>
<hr>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr><td>
<!-- InstanceBeginEditable name="Help Content" -->
<p class="BODYTEXT">To begin using the embedded SDIO Driver Kit you will need
  to set up the development and target environments. The development environment
  is
  typically a PC/workstation  where the SDIO kit header files, libraries
  and tools are installed. The target's operating system build
  tools
  and
  build environment should also be installed on this system. </p>
<p class="BODYTEXT">The target system contains
    the host controller
    hardware and target operating system hosting the SDIO stack binaries. Make
  sure your target platform meets the requirements of the SDIO stack.</p>
<p class="BODYTEXT">Information on setting up  development and target environment
  can be found in this help for each supported operating system:</p>
<table width="50%" border="0" align="center">
  <tr>
    <td align="center"><div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#Install">Program installation</a></font></div></td>
  </tr>
   <tr>
    <td align="center"><div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#DKernelSrc">Download kernel
          source</a></font></div></td>
  </tr>
  <tr>
    <td align="center"><div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#KernelSrc">Install kernel
          source</a></font></div></td>
  </tr>
  <tr>
    <td align="center"><div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#TestMem">Testing the stack
          using memory cards</a></font></div></td>
  </tr>
  <tr>
    <td align="center"><div align="center"><font face="Arial, Helvetica, sans-serif"><a href="#Build">Building the sample
          driver</a></font></div></td>
  </tr>
</table>
<div align="center"></div>
<p class="BODYTEXT">&nbsp;</p>
<p class="BODYTEXT">Linux : </p>
<p class="BODYTEXT"><strong><a name="Install"></a>-To run the installation program:</strong></p>
<p class="BODYTEXT">#sh ./install.bin</p>
<p class="BODYTEXT"><strong><a name="DKernelSrc"></a>-To download linux kernel
    source code :</strong></p>
<p class="BODYTEXT">You can download the x86-FC3 kernel (kernel-2.6.9-1.667.src.rpm)
  from <a href="http://download.fedora.redhat.com/pub/fedora/linux/core/3/SRPMS" target="_blank">http://download.fedora.redhat.com/pub/fedora/linux/core/3/SRPMS</a></p>
<p class="BODYTEXT"><strong><a name="KernelSrc"></a>-install the kernel source:</strong></p>
<p class="BODYTEXT">#rpm -iv kernel-2.6.9-1.667.src.rpm <br>
  the resulting source
  should be placed into:<br>
  /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9</p>
<p class="BODYTEXT">
  <strong>For linux kernels 2.6 or higher the SDIO bus driver uses
  the PnP subsystem to register device instances. In order to enable
  the PnP subsystem on non-x86 platforms, you must modify the <font face="Courier New, Courier, mono">Kconfig</font> file
  located in <font face="Courier New, Courier, mono">/drivers/pnp</font>.
  Comment
  out the line: &quot;<font face="Courier New, Courier, mono"> depends on ISA</font>&quot;.
  You will then need to run &quot;<font face="Courier New, Courier, mono">make
  menuconfig</font>&quot; and select &quot;<font face="Courier New, Courier, mono">Plug and Play Support</font>&quot;.
  You do not need to enable &quot;<font face="Courier New, Courier, mono">ISA
  Plug and Play</font>&quot; or &quot;<font face="Courier New, Courier, mono">PnP
  Debug Messages</font>&quot;</strong>.
</p>
<p class="BODYTEXT">Perform an RPM Build:<br>
  #<font face="Courier New, Courier, mono">rpmbuild -bp --target=i586 /usr/src/redhat/SPEC/kernel-2.6.spec</font></p>
<p class="BODYTEXT">Now you will need to make the source. From the linux-2.6.9
    directory type <font face="Courier New, Courier, mono">make</font>. The make
    will take some time on your machine.<br>
    <br>
    Note: if you install your Linux source in a different directory, you will
    need to modify the <font face="Courier New, Courier, mono">localmake.linux.inc</font> to
    have the <font face="Courier New, Courier, mono">CT_LINUXPATH</font> point
    to the source directory. This file is located in your product src install
    directory.</p>
<p class="BODYTEXT"><strong><a name="TestMem"></a>-Testing the stack operation using an SD or MMC memory card:</strong></p>
<p class="BODYTEXT">Copy the stack modules from the modules directory to your
  target machine along with the script <font face="Courier New, Courier, mono">loadsdiosample.scr</font>.
  Run the load script (you may need to be root to run this script). The script
  will load the stack modules. You can unload the stack using the command: &quot;<font face="Courier New, Courier, mono">./loadsdiosample.scr
  unloadall</font>&quot;. To test and mount a memory card do the following:</p>
<p class="BODYTEXT">1. Insert the SD or MMC card<br>
  2. look for the major number assigned to the card:<br>
  <font face="Courier New, Courier, mono">#cat /proc/devices</font><br>
  Under the &quot;Block devices&quot; you should see the sdio card listed with
  a number such as 253 or 254. Assume 253 for this example.<br>
  3. Create a device node for the block device:<br>
  <font face="Courier New, Courier, mono">#mknod /dev/sdio0p1
b 253 1</font><br>
(use the assigned block number in place of 253)<br>
4. Create a directory to mount the card to:<br>
#<font face="Courier New, Courier, mono">mkdir /mnt/mmc</font><br>
5. Mounting the card<br>
#<font face="Courier New, Courier, mono">mount -t vfat /dev/sdio0p1 /mnt/mmc</font><br>
6. the card should be available to the system, e.g.:<br>
#<font face="Courier New, Courier, mono">ls /mnt/mmc<br>
</font>7. To remove the card, unmount it:<br>
#<font face="Courier New, Courier, mono">umount /mnt/mmc</font></p>
<p class="BODYTEXT">Note, these operations
    can be automated by updating <font face="Courier New, Courier, mono">/etc/fstab</font>    and
    using <font face="Courier New, Courier, mono">udev</font>.<font face="Courier New, Courier, mono"><br>
        </font></p>
<p class="BODYTEXT"><strong><a name="Build"></a>-Building the sample
    driver:</strong></p>
<p class="BODYTEXT">1. Change to the install <font face="Courier New, Courier, mono">src</font> directory.<br>
  2. Test the build:<br>
  #<font face="Courier New, Courier, mono">./build.scr</font><br>
  The sample driver should build without errors (warnings for library references
  are OK).<br>
  3. Modify the sample driver to match your peripheral device.<br>
  In the file <font face="Courier New, Courier, mono">src/function/sample/linux/sample_os.c</font>, modify the following structure:
<pre>static SD_PNP_INFO Ids[] = {
    {.SDIO_ManufacturerID = 0x100,    /* specific SDIO card */
     .SDIO_ManufacturerCode = 0x303, 
     .SDIO_FunctionNo = 1},
    {}
};
</pre>
<p>Replace the 0x100 and 0x303 with the identification of your card.<br>
  4. 
  Then rebuild
    the sample function driver module and move the resulting <font face="Courier New, Courier, mono">sdio_sample_fd.ko</font>    to target machine.<br>
    5. Load the new sample driver, by first stopping the current and reloading
    the new one:<br>
    #<font face="Courier New, Courier, mono">rmmod sdio_sample_fd</font><br>
    #<font face="Courier New, Courier, mono">insmod sdio_sample_fd.ko</font><br>
    6. Now insert the your peripheral card. Debug messages should be printed
    indicating your card was detected and assigned to the sample driver.<br>
    7. Setting up the test application to communicate with the sdio_sample_fd
    module:<br>
    a)*. Locate the assigned major number:<br>
    #<font face="Courier New, Courier, mono">cat /proc/devices</font>    <br>
    Locate the major number for sdiosam0 under the Character Devices, for example
    253.
    <br>
    b)*. Create a device node for it:<br>
    #<font face="Courier New, Courier, mono">mknod /dev/sdiosam0 c 253 0</font><br>
    (use the actual major number in place of 253)<br>
    c). Copy the test application to the target system from <font face="Courier New, Courier, mono">src/function/sample/linux/testapp/testcmd</font><br>
    d. run the test application,. The application allows you read and write using
    CMD52 and CMD53 to your device, e.g.:<br>
    testcmd -r 0<br>
    Read register offset 0 with a CMD52.</p>
<p>Note: steps a) and b) can be automated using the <font face="Courier New, Courier, mono">makesdiosampledev.scr </font>script.</p>
<p>&nbsp;</p>
<p class="BODYTEXT">&nbsp;</p>
<p><br>
</p>
<!-- InstanceEndEditable -->
&nbsp;<br/></table></td></tr>
<table width="100%" border="0" cellspacing="0" cellpadding="2" >
  <tr> <td><div align="right"><a href="#TopTopic">Back to top</a></div></td></tr>
  <tr bgcolor="#0000FF"> 
    <td> 
      <font color="#FFFFFF"face="Arial, Helvetica, sans-serif"><strong>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -