{"id":4694,"date":"2014-07-26T03:07:09","date_gmt":"2014-07-25T19:07:09","guid":{"rendered":"http:\/\/blog.dword1511.info\/?p=4694"},"modified":"2014-07-30T14:58:59","modified_gmt":"2014-07-30T06:58:59","slug":"%e5%a6%82%e4%bd%95%e8%af%bb%e5%8f%96%e6%9f%90%e4%ba%9b%e4%bb%8e-nand-%e5%bc%95%e5%af%bc%e7%9a%84%e8%ae%be%e5%a4%87%e4%b8%8a%e7%9a%84-u-boot-%ef%bc%88%e6%88%96%e8%80%85%e5%85%b6%e4%bb%96-bootloader","status":"publish","type":"post","link":"http:\/\/blog.dword1511.info\/?p=4694","title":{"rendered":"\u5982\u4f55\u8bfb\u53d6\u67d0\u4e9b\u4ece NAND \u5f15\u5bfc\u7684\u8bbe\u5907\u4e0a\u7684 U-boot \uff08\u6216\u8005\u5176\u4ed6 bootloader \uff09"},"content":{"rendered":"<p>\u4ece <a href=\"http:\/\/projects.doozan.com\/uboot\/build_uboot.htm\" target=\"_blank\">http:\/\/projects.doozan.com\/uboot\/build_uboot.htm<\/a> \u4e0a\u770b\u5230\u7684\u3002U-boot \u548c U-boot env \u6240\u5728\u7684 block \u5f80\u5f80\u6ca1\u6709 ECC \uff08\u53cd\u6b63 NAND \u7684\u524d\u51e0\u4e2a boot block \u662f\u4fdd\u8bc1\u65e0\u574f\u5757\u7684\uff0c\u4efb\u4f55 FTL \u63a7\u5236\u5668\u7684\u56fa\u4ef6\u90fd\u5f97\u5199\u5728\u8fd9\u513f\uff0c\u6709 ECC \u4e5f\u662f\u767d\u642d\uff09\uff0c\u76f4\u63a5\u8bfb\u53d6\u4f1a\u8868\u73b0\u5f97\u548c\u574f\u5757\u4e00\u6837\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u6240\u4ee5\uff0c\u6b63\u786e\u7684\u59ff\u52bf\u662f\uff08\u6216\u8005\u53ef\u4ee5\u8bd5\u4e00\u4e0b\uff09\uff1a<\/p>\n<pre class=\"brush: bash; title: \u4ee3\u7801; notranslate\" title=\"\u4ee3\u7801\">\r\nnanddump -nof u-boot.img \/dev\/mtdX\r\n<\/pre>\n<p>\u5f53\u7136 X \u4e00\u822c\u662f 0 \u4e86\u3002-n \u5173\u6389 ECC \u6821\u9a8c\uff0c-o \u5173\u6389 OOB \uff08 Out-of-band \uff0c\u5373 NAND \u6bcf\u5757\u6bd4\u6574\u6570\u5927\u5c0f\u591a\u51fa\u6765\u7684\u7a7a\u95f4\uff09\uff0c-f \u8f93\u51fa\u5230\u6587\u4ef6\u3002<\/p>\n<p>\u9644\u5e26\u4e0d\u7528\u7f16\u7a0b\u5668\u5907\u4efd\u7f16\u7a0b\u5668\u56fa\u4ef6\u5927\u6cd5\uff1a<\/p>\n<pre class=\"brush: bash; title: \u4ee3\u7801; notranslate\" title=\"\u4ee3\u7801\">\r\nssh user@target dd if=\/dev\/mtdblockX conv=sync,noerror &gt; mtdX.img\r\n<\/pre>\n<p>X \u4ece 0 \u5230\u6700\u540e\u4e00\u4e2a part \uff0c\u5b8c\u4e8b\u540e cat \u8d77\u6765\u5373\u53ef\u3002\u5f53\u7136\u5982\u524d\u6240\u8ff0 bootloader \u6709\u53ef\u80fd\u9700\u8981\u5355\u72ec\u5904\u7406\u3002-conv sync,noerror \u9002\u7528\u4e8e NAND \uff0c\u53ef\u4ee5\u8df3\u8fc7\u574f\u5757\u5e76\u586b 0 \u3002\u5f53\u7136\uff0c\u6b64\u9009\u9879\u6709\u7684 busybox \u81ea\u5e26\u7684 dd \u4e0d\u652f\u6301\uff0c\u4e8e\u662f\u5f97\u5148 scp \u4e0a\u53bb\u4e00\u4e2a\u3002scp \u4e0d\u652f\u6301\u76f4\u63a5\u8bfb\u53d6\u5757\u8bbe\u5907\u6216\u8005\u5bb9\u9519\uff0ccp \u5230 tmpfs \u5185\u5b58\u53c8\u53ef\u80fd\u4e0d\u591f\uff0c\u9042\u51fa\u6b64\u7b56\u3002<\/p>\n<p>\u8bdd\u8bf4\u56de\u6765\uff0c\u7531\u4e8e NAND \u5b58\u5728\u4f4d\u7f6e\u4e0d\u786e\u5b9a\u7684\u574f\u5757\uff0c\u6240\u4ee5\u5355\u72ec\u5907\u4efd U-boot \u7684\u610f\u4e49\u6bd4\u8f83\u5927\u3002<\/p>\n<p>\u5982\u679c\u8981\u7aa5\u63a2 NAND \u955c\u50cf\u7684\u5185\u5bb9\uff0c\u4f60\u53ef\u80fd\u9700\u8981 nandsem \u5185\u6838\u6a21\u5757\uff1a<\/p>\n<pre class=\"brush: bash; title: \u4ee3\u7801; notranslate\" title=\"\u4ee3\u7801\">\r\nmodprobe nandsim cache_file=some_image_dupe.img # \u517b\u6210\u5907\u4efd\u597d\u4e60\u60ef\r\n<\/pre>\n<p>\u7136\u540e\u4f60\u7684\u7535\u8111\u4e0a\u5c31\u4f1a\u591a\u51fa\u6765\u4e00\u4e2a\u65b0\u7684 mtd \u8bbe\u5907\uff0c\u8fd9\u6837\u50cf ubifs \u4e4b\u7c7b\u7684\u4e1c\u897f\u5c31\u53ef\u4ee5\u62ff\u51fa\u6765\u7528\u4e86\u3002<\/p>\n<hr \/>\n<p>PS. \u6765\u7f8e\u4e00\u5e74\u91c7\u5751\u9887\u591a\uff0c\u7b49\u6709\u5fc3\u60c5\u4e86\u81ea\u4f1a\u6162\u6162\u5410\u69fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece http:\/\/projects.doozan.com\/uboot\/build_uboot.htm \u4e0a\u770b\u5230\u7684 &hellip; <a href=\"http:\/\/blog.dword1511.info\/?p=4694\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u5982\u4f55\u8bfb\u53d6\u67d0\u4e9b\u4ece NAND \u5f15\u5bfc\u7684\u8bbe\u5907\u4e0a\u7684 U-boot \uff08\u6216\u8005\u5176\u4ed6 bootloader \uff09<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[11],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/posts\/4694"}],"collection":[{"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4694"}],"version-history":[{"count":7,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/posts\/4694\/revisions"}],"predecessor-version":[{"id":4702,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=\/wp\/v2\/posts\/4694\/revisions\/4702"}],"wp:attachment":[{"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4694"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.dword1511.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}