{"id":433,"date":"2018-03-05T13:07:34","date_gmt":"2018-03-05T05:07:34","guid":{"rendered":"http:\/\/www.freezhongzi.info\/?p=433"},"modified":"2019-09-29T09:55:18","modified_gmt":"2019-09-29T01:55:18","slug":"am335x%e7%a7%bb%e6%a4%8dopenwrt-%e4%b8%80","status":"publish","type":"post","link":"https:\/\/bl4kraven.com\/index.php\/2018\/03\/05\/am335x%e7%a7%bb%e6%a4%8dopenwrt-%e4%b8%80\/","title":{"rendered":"AM335X\u79fb\u690dOpenWRT \u4e00"},"content":{"rendered":"<p>\u6211\u624b\u4e0a\u6709\u4e00\u4e2aforlinx\u7684AM335X\u5f00\u53d1\u677fOK335xD\uff0c\u81ea\u5e26\u7684Linux\u5185\u6838\u662f3.2\u7684\u800c\u4e14\u6211\u6d4b\u8bd5\u53d1\u73b0\u4e00\u65e6\u7f51\u7edc\u4f20\u8f93\u6570\u636e\u7a0d\u5927kernel\u5c31panic\uff0c\u8c03\u8bd5\u4e86\u597d\u4e45\u90fd\u6ca1\u641e\u597d\uff08\u6211\u8bd5\u4e86TI\u5b98\u65b9\u7684SDK\uff0c\u4e5f\u4e00\u6837\uff09\u3002<\/p>\n<p>\u6700\u8fd1\u770b\u5230LEDE\u662f\u652f\u6301<a href=\"http:\/\/downloads.lede-project.org\/snapshots\/targets\/omap\/generic\/\">OMAP<\/a>\u7684\uff0c\u62b1\u7740\u8bd5\u8bd5\u770b\u7684\u7cbe\u795e\u5c31\u4e0b\u4e86\u6700\u65b0\u7684LEDE 17.1.04\u8bd5\u8bd5\u3002\u7f16\u8bd1\u7528\u4e86\u9ed8\u8ba4\u7684AM33xx target profile\uff0cuboot\u968f\u4fbf\u627e\u4e86\u4e2a\u4e4b\u524dAM335x\u7684uboot\uff08\u8fd9\u662f\u4e2a\u5751\uff09\u3002\u7f16\u8bd1\u540ebin\u76ee\u5f55\u91cc\u662f\u5185\u6838\uff0c\u6587\u4ef6\u7cfb\u7edf\u9700\u8981\u5230build_dir\u7684linux_omap\u91cc\u53bb\u627eroot.ext4\uff0c\u6211\u5acc\u9ebb\u70e6\u5c31\u4e0aLEDE\u5b98\u7f51\u4e0b\u4e86\u4e00\u4e2a<a href=\"http:\/\/downloads.lede-project.org\/snapshots\/targets\/omap\/generic\/openwrt-omap-am335x-evm-ext4-sdcard.img.gz\">am335x-evm-ext4-sdcard.img.gz<\/a>\uff08\u522b\u770b\u662f5M\u7684\u538b\u7f29\u6587\u4ef6\uff0c\u89e3\u538b\u540e\u662f256M\u5927\u6587\u4ef6\uff0c\u4f30\u8ba1\u91cc\u9762\u90fd\u662f0XFF\u6216\u8005\u662f0x00\uff0c\u5176\u5b9e\u771f\u6b63\u6587\u4ef6\u7cfb\u7edf\u7528\u523010M\u5de6\u53f3\uff0c\u8fd9\u4e2a\u4ee5\u540e\u53ef\u4ee5\u4f18\u5316\u7f29\u5c0f\u4e00\u4e0b-_-!!!)\u70e7\u5230SD\u5361\u91cc\uff0c\u7136\u540e\u66ff\u6362\u4e00\u4e0buboot\u548ckernel\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u662fdevice tree\u6587\u4ef6\u4e86\uff0c\u8fd9\u4e2a\u5c31\u8981\u82b1\u65f6\u95f4\u8c03\u8bd5\u4e86\u3002\u53c2\u8003TI EVM\u7684am335x-evm.dts\u6587\u4ef6\u590d\u5236\u5230forlinx.dts\uff0c\u4fee\u6539dts\/Makefile\u53ea\u7f16\u8bd1forlinx.dtb\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u70b9\u662f\uff1a<\/p>\n<ol>\n<li>\u6839\u636e\u677f\u5b50\u539f\u7406\u56fe\u7535\u6e90\u7ba1\u7406\u82af\u7247\u662ftps65217\uff0c\u9700\u8981\u6dfb\u52a0tps65217\u7684\u8282\u70b9\uff0c\u800c\u4e14\u8981\u6839\u636e\u539f\u7406\u56fe\u5199\u597d\u5404\u4e2adcdc\u548cLDO\u7684\u8282\u70b9\u3002 TI\u7684evm\u677f\u5b50\u91ccDCDC2\u662fMPU\uff0cDCDC3\u662fcore\uff0c\u800cOK335xD\u53cd\u4e86\u4e00\u4e0b\uff0c\u800c\u4e14DCDC1\u7528\u6765\u63a7\u5236DDR3\u3002\n<pre><code>dcdc1_reg: regulator@0 {\n    \/* DDR3 VDD_CORE voltage limits 0.95V - 1.1V with +\/-4% tolerance *\/\n    regulator-name = \"vdd_ddr3\";\n    regulator-min-microvolt = &lt;925000&gt;;\n    regulator-max-microvolt = &lt;1150000&gt;;\n    regulator-boot-on;\n    regulator-always-on;\n    regulator-always-on;\n};\n\ndcdc2_reg: regulator@1 {\n    \/* VDD_CORE voltage limits 0.95V - 1.1V with +\/-4% tolerance *\/\n    regulator-name = \"vdd_core\";\n    regulator-min-microvolt = &lt;925000&gt;;\n    regulator-max-microvolt = &lt;1150000&gt;;\n    regulator-boot-on;\n    regulator-always-on;\n};\n\ndcdc3_reg: regulator@2 {\n    \/* VDD_MPU voltage limits 0.95V - 1.26V with +\/-4% tolerance *\/\n    regulator-name = \"vdd_mpu\";\n    regulator-min-microvolt = &lt;925000&gt;;\n    regulator-max-microvolt = &lt;1351500&gt;;\n    regulator-boot-on;\n    regulator-always-on;\n};\n<\/code><\/pre>\n<p>\u5177\u4f53\u7535\u538b\u53ef\u4ee5\u6bd4\u5bf9\u5b98\u65b9\u7684datasheet\u7684OPP\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-473 size-full\" src=\"https:\/\/bl4kraven.com\/wp-content\/uploads\/2019\/03\/opp.jpg\" alt=\"\" width=\"686\" height=\"320\" srcset=\"https:\/\/bl4kraven.com\/wp-content\/uploads\/2019\/03\/opp.jpg 686w, https:\/\/bl4kraven.com\/wp-content\/uploads\/2019\/03\/opp-300x140.jpg 300w, https:\/\/bl4kraven.com\/wp-content\/uploads\/2019\/03\/opp-500x233.jpg 500w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/p>\n<p>\u4e0a\u56fe\u80fd\u770b\u5230OPP turbo\u65f6\u80fd\u5230720M\uff0c\u5176\u5b9eAM335x A8\u6700\u9ad8\u80fd\u652f\u6301\u52301G\uff0c\u597d\u50cf\u6700\u65b0LEDE\u4e3b\u5206\u652f\u91cc\u5408\u5e76\u4e864.9\u652f\u63011G\u4e86\uff0c\u6211\u73b0\u5728\u7528\u76844.4.92\u8fd8\u4e0d\u652f\u6301\uff0c\u6700\u9ad8\u53ea\u80fd\u8dd1\u5230720M\uff0c\u7b49\u4e0b\u6b21\u66f4\u65b0\u4e86\u518d\u8bf4\u5427\u3002<\/p>\n<pre><code>root@OpenWrt:~# cat \/sys\/devices\/system\/cpu\/cpufreq\/policy0\/scaling_available_frequencies \n275000 500000 600000 720000 \n<\/code><\/pre>\n<\/li>\n<li>OK335xD\u7528\u7684\u662fNAND\uff08\u6682\u65f6\u4e0d\u7528\uff09\uff0c\u6240\u4ee5\u53ea\u6709\u6dfb\u52a0\u4e00\u4e2aSD\u5361\u542f\u52a8\u7684MMC1\u5c31\u597d\u4e86:\n<pre><code>&amp;mmc1 {\n    bus-width = &lt;4&gt;;\n    vmmc-supply = &lt;&amp;vdd33&gt;;\n    pinctrl-names = \"default\";\n    pinctrl-0 = &lt;&amp;mmc1_pins&gt;;\n    cd-gpios = &lt;&amp;gpio0 6 GPIO_ACTIVE_LOW&gt;;\n    disable-wp;\n    status = \"okay\";\n};\n<\/code><\/pre>\n<\/li>\n<li>AM335X\u652f\u6301\u53cc\u7f51\u53e3\uff08\u53ef\u4ee5\u4f5c\u4e3a\u8def\u7531\u5668\uff09\uff0c\u800cOK335xD\u53ea\u7528\u4e86\u7f51\u53e31\uff0cPHY\u82af\u7247\u7528\u4e86AR8031\uff0c\u800c\u4e14\u652f\u6301\u5343\u5146\u7f51\u53e3\uff08\u7528\u4e86rgmii\u63a5\u53e3\uff09\uff0c\u4e00\u822crgmii\u63a5\u53e3\u4fe1\u53f7\u7ebf\u9700\u8981\u5f15\u5165\u4eba\u4e3a\u7684delay\uff0c<a href=\"http:\/\/ethernetfmc.com\/rgmii-interface-timing-considerations\/\">\u53c2\u8003\u8fd9\u7bc7\u6709\u8bf4\u660e<\/a>\u3002\u6211\u770b\u4e86AR8031\u7684datasheet\u548c\u5185\u6838\u7684\u4ee3\u7801\uff0cAR8031\u662f\u76f4\u63a5\u652f\u6301tx\u548crx delay\u7684\uff0c\u53ea\u8981\u8bbe\u7f6e\u4e00\u4e0bdebug register\u5c31\u884c\u4e86\uff0c\u5185\u6838\u9a71\u52a8at803x.c\u91cc\u4e5f\u662f\u8fd9\u4e48\u5e72\u7684\uff1a\n<pre><code>    if (phydev-&gt;interface == PHY_INTERFACE_MODE_RGMII_TXID) {\n        ret = phy_write(phydev, AT803X_DEBUG_ADDR,\n                AT803X_DEBUG_SYSTEM_MODE_CTRL);\n        if (ret)\n            return ret;\n        ret = phy_write(phydev, AT803X_DEBUG_DATA,\n            AT803X_DEBUG_RGMII_TX_CLK_DLY);\n        if (ret)\n            return ret;\n    }\n<\/code><\/pre>\n<p>\u4f46\u6211\u6ca1\u770b\u5230rgmii-rxid\u548crgmii-id\u7684\u652f\u6301\uff0c\u6240\u4ee5\u81f3\u5c11\u5bf9\u4e8e\u6211\u624b\u4e0a\u76844.4.92\u6765\u8bf4device tree\u53ea\u652f\u6301rgmii-txid:<\/p>\n<pre><code>&amp;mac {\n    pinctrl-names = \"default\", \"sleep\";\n    pinctrl-0 = &lt;&amp;cpsw_default&gt;;\n    pinctrl-1 = &lt;&amp;cpsw_sleep&gt;;\n    slaves = &lt;1&gt;;\n    status = \"okay\";\n};\n\n&amp;davinci_mdio {\n    pinctrl-names = \"default\", \"sleep\";\n    pinctrl-0 = &lt;&amp;davinci_mdio_default&gt;;\n    pinctrl-1 = &lt;&amp;davinci_mdio_sleep&gt;;\n    status = \"okay\";\n};\n\n&amp;cpsw_emac0 {\n    phy_id = &lt;&amp;davinci_mdio&gt;, &lt;0&gt;;\n    phy-mode = \"rgmii-txid\";\n};\n<\/code><\/pre>\n<p>mac\u96c6\u6210\u5728AM335X\u91cc\uff0c\u800c\u4e14\u53ea\u7528\u4e86\u4e00\u4e2a\u7f51\u53e3\uff0c phy-mode\u662frgmii-txid\u3002<\/li>\n<\/ol>\n<p>\u597d\u5427\uff0c\u5148\u5199\u5230\u8fd9\u91cc\u5427\uff0c\u8fd8\u6709\u5f88\u591a\u4e1c\u897f\u6ca1\u5199\uff0c\u5b8c\u6574\u7684dts\u5728<a href=\"https:\/\/bl4kraven.com\/wp-content\/uploads\/forlinx.txtz\">\u8fd9\u91cc<\/a>\u3002\u4e0b\u4e00\u7bc7\u8981\u5199\u5199\u6298\u817e\u4e86\u6211\u5f88\u4e45\u7684\u7f51\u53e3\u95ee\u9898\uff01\uff01\uff01<\/p>\n<h1>\u53c2\u8003<\/h1>\n<p><a href=\"http:\/\/www.eefocus.com\/marianna\/blog\/14-10\/306285_18a90.html\">http:\/\/www.eefocus.com\/marianna\/blog\/14-10\/306285_18a90.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u624b\u4e0a\u6709\u4e00\u4e2aforlinx\u7684AM335X\u5f00\u53d1\u677fOK335xD\uff0c\u81ea\u5e26\u7684Linux\u5185 &hellip; <a href=\"https:\/\/bl4kraven.com\/index.php\/2018\/03\/05\/am335x%e7%a7%bb%e6%a4%8dopenwrt-%e4%b8%80\/\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a> <a href=\"https:\/\/bl4kraven.com\/index.php\/2018\/03\/05\/am335x%e7%a7%bb%e6%a4%8dopenwrt-%e4%b8%80\/\">\u7ee7\u7eed\u9605\u8bfb <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":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-433","post","type-post","status-publish","format-standard","hentry","category-openwrt"],"_links":{"self":[{"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/comments?post=433"}],"version-history":[{"count":5,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/posts\/433\/revisions\/573"}],"wp:attachment":[{"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/media?parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/categories?post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bl4kraven.com\/index.php\/wp-json\/wp\/v2\/tags?post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}