{"id":1894,"date":"2019-07-16T14:38:07","date_gmt":"2019-07-16T05:38:07","guid":{"rendered":"https:\/\/rageworx.info\/?p=1894"},"modified":"2019-07-20T15:10:50","modified_gmt":"2019-07-20T06:10:50","slug":"rock960a-b-c-kernel-patch-for-supporting-some-usb-gbe","status":"publish","type":"post","link":"https:\/\/rageworx.info\/?p=1894","title":{"rendered":"Rock960[A\/B\/C] kernel patch for supporting some USB GbE"},"content":{"rendered":"<p><a href=\"https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1895\" src=\"https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-492x500.png\" alt=\"\" width=\"492\" height=\"500\" srcset=\"https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-492x500.png 492w, https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-768x781.png 768w, https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-500x509.png 500w, https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-624x635.png 624w, https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches-60x60.png 60w, https:\/\/rageworx.info\/wp-content\/uploads\/2019\/07\/rock960abc_kernel_patches.png 814w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p>Here&#8217;s my kernel patch for Rock960[A\/B\/C] board based on git &#8211; &#8220;stable-4.4-rk3399-linux-v2.1x&#8221; branch patch for support or modified for :<\/p>\n<ul>\n<li>Governor for performance.<\/li>\n<li>Supporting latest version of Realtek r8152\/3 USB 3.0 GbE ( merged version of &#8220;9&#8221; )<\/li>\n<li>Supporting latest version of Cypress GX3 USB 3.0 GbE<\/li>\n<li>Supporting latest version of Microchip LAN7800 USB 3.0 GbE ( version 1.0.5.4.4.1.0 )<\/li>\n<\/ul>\n<h2>Preparation<\/h2>\n<p>Refer to base build environments here : <a href=\"https:\/\/rageworx.info\/?p=1610\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/rageworx.info\/?p=1610<\/a><\/p>\n<h2>Kernel<\/h2>\n<h3>Case #1 : Using rockchip linux kernel.<\/h3>\n<p>Move your original kernel directory with <code>mv kernel kernel_origin<\/code>.<br \/>\nThen you can clone a repository from here: <a href=\"https:\/\/github.com\/rockchip-linux\/kernel\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/rockchip-linux\/kernel<\/a><br \/>\nThen switch branch to &#8220;stable-4.4-rk3399-linux-v2.1x&#8221; in kernel directory<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\" title=\"switch branch\">$ cd kernel; git checkout \"stable-4.4-rk3399-linux-v2.1x\"<\/pre>\n<p>-update-<br \/>\nThis kernel branch provides improved functions for MIPI-CSI2, and some stabilities.<\/p>\n<h3>Case #2: Using Rock960 kernel<\/h3>\n<p>Or Just use Rockchip&#8217;s kernel when it back up with <code>cp -rf kernel kernel_backup<\/code>.<\/p>\n<h2>Download a patch<\/h2>\n\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link download-button aligncenter\" title=\"Version 1.0\" href=\"https:\/\/rageworx.info?tmstv=1776037306\" rel=\"nofollow\" id=\"download-link-1901\" data-redirect=\"false\" >\n\tDownload &ldquo;Rock960[A\/B\/C] kernel statble-4.4-rk3399-linux-v2.1x patch #1&rdquo;\t<small>kernel_patch.zip\t\t&ndash; Downloaded 3299 times\t\t&ndash; 82.44 KB<\/small>\n<\/a>\n\n<h2>Modify patch for your condition<\/h2>\n<p>You can changes patch contents what you needed.<\/p>\n<h2>Apply patch<\/h2>\n<p>copy patch file into &#8220;kernel&#8221; directory and, do this in shell.<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true \">$ patch -p &lt; kernel.patch<\/pre>\n<h2>Copy device trees<\/h2>\n<p>Rockchip linux not contains Rock960 board devices tree.<br \/>\nCopy two dts files from my zip file, or your original kernel.<\/p>\n<p>dts may place here: <code>${your kernel}\/arch\/arm64\/boot\/dts\/rockchip<\/code>.<\/p>\n<h2>Copy cyusb3610.* to usb network driver path.<\/h2>\n<p>Copy cyusb3610.h and c file into <code>${your kernel}\/drivers\/net\/usb<\/code>.<\/p>\n<h2>Known issue<\/h2>\n<ul>\n<li>Realtek R8152\/3 USB 3.0 GbE makes network be unexpected status when system board power down or while reboot.<\/li>\n<li>Recommend to unplug RJ45 from adapter or, turn off power supply for USB 3.0 HUB if you got each selective power button or switch.<\/li>\n<li>STILL Rockchip linux kernel has many bug in ISP with MIPI CSI2 cameras &#8211; when it solved Rockchip ?<br \/>\n<del><span style=\"color: #ff0000;\">My testing new camera cannot streaming on with this kernel.<\/span><\/del><br \/>\n&#8211; Update &#8211; Improved kernel provides much better performance and stabilities in ISP.<\/li>\n<\/ul>\n<h2>Performance<\/h2>\n<ul>\n<li>Tested with iperf3 at GbE router, and each performance depends on your network.\n<ul>\n<li>r8152 : around 950~960Mbps.<\/li>\n<li>Cypress GX3 : around 800~850Mbps.<\/li>\n<li>Microchip LAN7800 : around 800~850Mbps.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Build<\/h2>\n<p>Building kernel is same as Rock960&#8217;s method.<br \/>\nUse build\/mk-kernel.sh rock960xx script.<\/p>\n<h2>Replacing flashed kernel<\/h2>\n<p>When kernel compilation completed as well, you can see &#8220;boot.img&#8221; in &#8220;out&#8221; directory.<br \/>\nFlash boot.img with mask-rom mode, or with dd in Rock960 board.<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\" title=\"Method for rkdeveloptool\">$ sudo rkdeveloptool db ${your maskrom bootloader}\r\n$ sudo rkdeveloptool wlx boot out\/boot.img\r\n$ sudo rkdeveloptool rd<\/pre>\n<p>&#8211; or &#8211;<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\" title=\"Method for on-board flashing\">$ sudo dd if=boot.img of=\/dev\/mmcblk1p4 conv=sync status=progress\r\n$ sync; sudo reboot<\/pre>\n<p>You can see new kernel will be loaded with USB-tty debugging log, or dmesg in LXterminal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s my kernel patch for Rock960[A\/B\/C] board based on git &#8211; &#8220;stable-4.4-rk3399-linux-v2.1x&#8221; branch patch for support or modified for : Governor for performance. Supporting latest version of Realtek r8152\/3 USB 3.0 GbE ( merged version of &#8220;9&#8221; ) Supporting latest version of Cypress GX3 USB 3.0 GbE Supporting latest version&#8230; <a href=\"https:\/\/rageworx.info\/?p=1894\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1895,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,573,580,3],"tags":[496,669,10,670,25,437,610,256],"class_list":["post-1894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","category-embedded","category-linux","category-raphs","tag-a","tag-b","tag-c","tag-drivers","tag-kernel","tag-patch","tag-rock960","tag-usb"],"_links":{"self":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/1894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1894"}],"version-history":[{"count":0,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/posts\/1894\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=\/wp\/v2\/media\/1895"}],"wp:attachment":[{"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rageworx.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}