{"id":1674,"date":"2016-03-19T17:46:12","date_gmt":"2016-03-19T17:46:12","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=1674"},"modified":"2016-03-19T17:46:12","modified_gmt":"2016-03-19T17:46:12","slug":"arm-rock2-fix-for-sdcard-boot-and-ethernet","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=1674","title":{"rendered":"ARM &#8211; Rock2 &#8211; Fix for SDCard Boot, and Ethernet.."},"content":{"rendered":"<p>Kernel 4.5-rc7 had booted successfully on the Radxa Rock2, but 4.5 Final failed, as the SDcard was &#8216;loaded&#8217; just too late:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">dwmmc_rockchip ff0f0000.dwmmc: 1 slots initialized<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">...........................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">VFS: Cannot open root device \"mmcblk1p1\" or unknown-block(0,0): error -6<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">..............................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)<\/span><\/strong><\/pre>\n<p>The solution to this was simple &#8211; just add &#8216;<strong><span style=\"font-family: courier new,courier;\">rootdelay=2<\/span><\/strong>&#8216; to the kernel command line parameter in the U-Boot commands:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">setenv bootargs \"console=ttyS2,115200n8 root=\/dev\/mmcblk1p1 rootdelay=2 earlyprintk ignore_loglevel\"<\/span><\/strong><\/pre>\n<p>Th device then booted OK, but the Ethernet driver failed:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">[ 11.822938] eth0: device MAC address 86:d7:74:ee:31:69<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 11.828080] libphy: PHY stmmac-0:ffffffff not found<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 11.832956] eth0: Could not attach to PHY<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 11.836963] stmmac_open: Cannot attach to PHY (error: -19)<\/span><\/strong><\/pre>\n<p>This is caused by a patch applied &#8211; between -rc7 and Final &#8211; to <strong><span style=\"font-family: courier new,courier;\">~\/drivers\/net\/ethernet\/stmicro\/stmmac\/stmmac_platform.c<\/span><\/strong> and <strong><span style=\"font-family: courier new,courier;\">~\/drivers\/net\/ethernet\/stmicro\/stmmac\/stmmac_mdio.c<\/span><\/strong><\/p>\n<p>This affects other devices &#8211; including the Banana Pi, and more details are at: <a href=\"http:\/\/www.spinics.net\/lists\/netdev\/msg368231.html\" target=\"_blank\">http:\/\/www.spinics.net\/lists\/netdev\/msg368231.html<\/a><\/p>\n<p>The simple fix is to copy the 4.5-rc7 version of these two source files to replace the ones in the 4.5 Final tree, and recompile..<\/p>\n<p>Then, the Rock2 boots, and loads the Ethernet driver:<\/p>\n<pre><strong><span style=\"font-family: courier new,courier;\">[ 1.653101] rk_gmac-dwmac ff290000.ethernet eth0: No MDIO subnode found<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 1.704156] mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 1.713406] libphy: stmmac: probed<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 1.713409] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 1.713410] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">.............................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[18.900162] rk_gmac-dwmac ff290000.ethernet eth0: Link is Up - 1Gbps\/Full - flow control rx\/tx<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">[ 18.908788] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">................................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Fedora 23 (Twenty Three)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Kernel 4.5.0 on an armv7l (ttyS2)<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">.................<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\"># uname -a<\/span><\/strong>\r\n<strong><span style=\"font-family: courier new,courier;\">Linux rgrock2 4.5.0 #2 SMP Sat Mar 19 01:38:49 EDT 2016 armv7l armv7l armv7l GNU\/Linux<\/span><\/strong><\/pre>\n<p><em>Robert Gadsdon.\u00a0\u00a0\u00a0 March 19, 2016.<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kernel 4.5-rc7 had booted successfully on the Radxa Rock2, but 4.5 Final failed, as the SDcard was &#8216;loaded&#8217; just too late: mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0) dwmmc_rockchip ff0f0000.dwmmc: 1 slots initialized &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; VFS: Cannot open root device &#8220;mmcblk1p1&#8221; or unknown-block(0,0): error -6 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; Kernel panic &#8211; <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=1674\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[91,1275,1280,5,1238,11,14,16,1276,1274,937],"tags":[102,1295,161,1281,1282,1294,1296,1297,1175],"class_list":["post-1674","post","type-post","status-publish","format-standard","hentry","category-arm","category-armv7","category-boot","category-compilation","category-fix","category-hacks","category-kernel","category-linux-arm","category-radxa","category-rock2","category-u-boot-2","tag-boot-fail","tag-ethernet-driver-fix","tag-fix","tag-radxa","tag-rock2","tag-rootdelay","tag-stmicro","tag-stmmac","tag-success"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1674"}],"version-history":[{"count":1,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1674\/revisions"}],"predecessor-version":[{"id":1675,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/1674\/revisions\/1675"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}