📄 using_cf_flash_card_disk_with_uboot_and_linux_kernel.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#introduction" class="toc">Introduction</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#using_a_ms-dos_partition_table" class="toc">Using a MS-DOS Partition Table</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#enable_the_ide_driver_in_the_blackfin_uclinux_kernel" class="toc">Enable the IDE driver in the blackfin uClinux kernel</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#enable_the_cf_card_support_in_the_uboot" class="toc">Enable the CF card support in the Uboot</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#booting_blackfin_uclinux_kernel_from_the_u-boot" class="toc">Booting Blackfin uClinux kernel from the U-Boot</a></span></div></li></ul></li></ul></div></div><h2><a name="introduction" id="introduction">Introduction</a></h2><div class="level2"><p>U-Boot provides only basic functionality to access CF Card based “disks”: you can print the partition table and read and write blocks (addressed by absolute block number), but there is no support to create new partitions or to read files from any type of filesystem. U-Boot support three partition type: CONFIG_MAC_PARTITION and/or CONFIG_DOS_PARTITION and/or CONFIG_<acronym title="International Organization for Standardization">ISO</acronym>_PARTITION. Before you use CF flash card with Blackfin uboot and linux kernel, you need to do the partition of the CF flash card on your linux host.</p></div><!-- SECTION [1-545] --><h2><a name="using_a_ms-dos_partition_table" id="using_a_ms-dos_partition_table">Using a MS-DOS Partition Table</a></h2><div class="level2"><p>The <acronym title="Microsoft">MS</acronym>-DOS partition table is especially common on PC type computers, which these days means nearly everywhere. You will prefer this format if you want to exchange your “disk” media with any PC type host system.</p><p>The fdisk command is used to create <acronym title="Microsoft">MS</acronym>-DOS type partition tables; to create the same partitioning scheme as above you would use the following commands: </p><pre class="code">linux:~ # fdisk /dev/sddCommand (m for help): mCommand action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)Command (m for help): pDisk /dev/sdd: 512 MB, 512483328 bytes16 heads, 63 sectors/track, 993 cylindersUnits = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id SystemCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 2First cylinder (21-993, default 21):Using default value 21Last cylinder or +size or +sizeM or +sizeK (21-993, default 993): +10MCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 3First cylinder (41-993, default 41):Using default value 41Last cylinder or +size or +sizeM or +sizeK (41-993, default 993): +400MCommand (m for help): nCommand action e extended p primary partition (1-4)pSelected partition 4First cylinder (817-993, default 817):Using default value 817Last cylinder or +size or +sizeM or +sizeK (817-993, default 993):Using default value 993Command (m for help): pDisk /dev/sdd: 512 MB, 512483328 bytes16 heads, 63 sectors/track, 993 cylindersUnits = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System/dev/sdd1 1 20 10048+ 83 Linux/dev/sdd2 21 40 10080 83 Linux/dev/sdd3 41 816 391104 83 Linux/dev/sdd4 817 993 89208 83 LinuxCommand (m for help): tPartition number (1-4): 4Hex code (type L to list codes): 82Changed system type of partition 4 to 82 (Linux swap / Solaris)Command (m for help): pDisk /dev/sdd: 512 MB, 512483328 bytes16 heads, 63 sectors/track, 993 cylindersUnits = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System/dev/sdd1 1 20 10048+ 83 Linux/dev/sdd2 21 40 10080 83 Linux/dev/sdd3 41 816 391104 83 Linux/dev/sdd4 817 993 89208 82 Linux swap / SolarisCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.linux:~ # mkswap /dev/sdd4Setting up swapspace version 1, size = 91344 kBlinux:~ # mke2fs /dev/sdd3mke2fs 1.36 (05-Feb-2005)Filesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)97920 inodes, 391104 blocks19555 blocks (5.00%) reserved for the super userFirst data block=148 block groups8192 blocks per group, 8192 fragments per group2040 inodes per groupSuperblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185Writing inode tables: doneWriting superblocks and filesystem accounting information: done</pre></div><!-- SECTION [546-4354] --><h2><a name="enable_the_ide_driver_in_the_blackfin_uclinux_kernel" id="enable_the_ide_driver_in_the_blackfin_uclinux_kernel">Enable the IDE driver in the blackfin uClinux kernel</a></h2><div class="level2"><p>The CF card is working in the TRUE IDE mode. Follow the instruction to enable the driver in the kernel:</p><p> <a href="compactflash_ide_ata_nand_flash_-_interface_card.html" class="wikilink1" title="compactflash_ide_ata_nand_flash_-_interface_card.html">compactflash_ide_ata_nand_flash_-_interface_card</a></p></div><!-- SECTION [4355-4579] --><h2><a name="enable_the_cf_card_support_in_the_uboot" id="enable_the_cf_card_support_in_the_uboot">Enable the CF card support in the Uboot</a></h2><div class="level2"><p>Add one line to the configuration header file of the BF537 STAMP board </p><p> #define CONFIG_BF537_CF 1 </p></div><!-- SECTION [4580-4752] --><h2><a name="booting_blackfin_uclinux_kernel_from_the_u-boot" id="booting_blackfin_uclinux_kernel_from_the_u-boot">Booting Blackfin uClinux kernel from the U-Boot</a></h2><div class="level2"><pre class="code">U-Boot-1.1.3-ADI-2005R4 (Jan 26 2006 - 11:44:43)CPU: ADSP BF537 Rev.: 0.2Board: ADI BF537 stamp board Support: http://blackfin.uclinux.org/Clock: VCO: 500 MHz, Core: 500 MHz, System: 62 MHzSDRAM: 64 MB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -