<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: kobs-ng with 4.4+ kernels on imx6 processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566931#M87347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply. I will ask our expert team.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jun 2016 01:59:40 GMT</pubDate>
    <dc:creator>jimmychan</dc:creator>
    <dc:date>2016-06-29T01:59:40Z</dc:date>
    <item>
      <title>kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566928#M87344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a difficult time getting kobs-ng (5.4, latest version or any version before) to work with a 4.4 mainline kernel. At first, I was seeing the following:&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;# Before kobs-ng (good)&lt;/P&gt;&lt;P&gt;00000000&amp;nbsp; 00 00 92 fb ff ff 46 43&amp;nbsp; 42 20 00 00 00 01 50 3c&amp;nbsp; |......FCB ....P&amp;lt;|&lt;/P&gt;&lt;P&gt;00000010&amp;nbsp; 19 06 00 00 00 00 00 08&amp;nbsp; 00 00 40 08 00 00 40 00&amp;nbsp; |..........@...@.|&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;# After kobs-ng (bad)&lt;/P&gt;&lt;P&gt;00000000&amp;nbsp; 00 00 00 00 00 00 00 00&amp;nbsp; 00 00 00 00 92 fb ff ff&amp;nbsp; |................|&lt;/P&gt;&lt;P&gt;00000010&amp;nbsp; 46 43 42 20 00 00 00 01&amp;nbsp; 50 3c 19 06 00 00 00 00&amp;nbsp; |FCB ....P&amp;lt;......|&lt;/P&gt;&lt;P&gt;00000020&amp;nbsp; 00 08 00 00 40 08 00 00&amp;nbsp; 40 00 00 00 00 00 00 00&amp;nbsp; |....@...@.......|&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As you can see, there is a 10 byte padding that was added which causes no serial on boot (or boot to even occur). I then looked into the source code of kobs-ng and saw two separate modes that mtd could use to access nand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default, kobs-ng was using "legacy raw access mode". I forced kobs-ng to then use the "new bch layout raw access mode", which seemed to improve things, but still cause failures (can't boot). Please see below:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# Before kobs-ng (good)&lt;/P&gt;&lt;P&gt;00000000&amp;nbsp; 00 00 92 fb ff ff 46 43&amp;nbsp; 42 20 00 00 00 01 50 3c&amp;nbsp; |......FCB ....P&amp;lt;|&lt;/P&gt;&lt;P&gt;00000010&amp;nbsp; 19 06 00 00 00 00 00 08&amp;nbsp; 00 00 40 08 00 00 40 00&amp;nbsp; |..........@...@.|&lt;/P&gt;&lt;P&gt;00000020&amp;nbsp; 00 00 00 00 00 00 00 00&amp;nbsp; 00 00 00 00 00 00 04 00&amp;nbsp; |................|&lt;/P&gt;&lt;P&gt;00000030&amp;nbsp; 00 00 00 02 00 00 00 02&amp;nbsp; 00 00 04 00 00 00 0a 00&amp;nbsp; |................|&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;# After kobs-ng (bad)&lt;/P&gt;&lt;P&gt;00000000&amp;nbsp; 00 00 94 fb ff ff 46 43&amp;nbsp; 42 20 00 00 00 01 50 3c&amp;nbsp; |......FCB ....P&amp;lt;|&lt;/P&gt;&lt;P&gt;00000010&amp;nbsp; 19 06 00 00 00 00 00 08&amp;nbsp; 00 00 40 08 00 00 40 00&amp;nbsp; |..........@...@.|&lt;/P&gt;&lt;P&gt;00000020&amp;nbsp; 00 00 00 00 00 00 00 00&amp;nbsp; 00 00 00 00 00 00 04 00&amp;nbsp; |................|&lt;/P&gt;&lt;P&gt;00000030&amp;nbsp; 00 00 00 00 00 00 00 02&amp;nbsp; 00 00 04 00 00 00 0a 00&amp;nbsp; |................|&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;On close inspection of the two, you can see that there are very slight byte differences, namely the third byte (92 to 94 shown). This also causes boot failures in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: will kobs-ng be updated for mainline kernel support? I do not want to replace the gpmi-nand driver to the 3.14 version as I've seen other forum postings say to do as a workaround nor do I want to use a older kernel than this. Is there a patch I can apply to kobs-ng to fix this behavior? Thanks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/KevinWong"&gt;KevinWong&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/andychen_ca"&gt;andychen_ca&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 17:58:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566928#M87344</guid>
      <dc:creator>psidhu</dc:creator>
      <dc:date>2016-06-23T17:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566929#M87345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you tell me which board and bsp are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 01:38:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566929#M87345</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2016-06-28T01:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566930#M87346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jimmy Chan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Board is a custom board, but what's important is the nand flash. This board has the MT29F2G08 (specifically, the MT29F2G08ABAEAH4 flash part) on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BSP also doesn't matter since I'm talking about a mainline 4.4 kernel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 16:20:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566930#M87346</guid>
      <dc:creator>psidhu</dc:creator>
      <dc:date>2016-06-28T16:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566931#M87347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply. I will ask our expert team.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 01:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566931#M87347</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2016-06-29T01:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566932#M87348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got the reply from the expert:&lt;/P&gt;&lt;P&gt;=======================&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;will kobs-ng be updated for mainline kernel support? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;NXP does not support kernel mainline. Only our BSP versions are guarantee to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I do not want to replace the gpmi-nand driver to the 3.14 version as I've seen other forum postings say to do as a workaround nor do I want to use a older kernel than this. Is there a patch I can apply to kobs-ng to fix this behavior?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;There are a couple of hints i think will be useful in this for the client thought.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) Please ask the client if he is using kobs-ng 5.4. We have had issues in the past with kobs-ng 5.1 and 5.3 where the &lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;FCB wasn't being written correctly in the flash.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&lt;SPAN style="font-family: arial,helvetica,'helvetica neue',verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) &lt;/SPAN&gt;Looking through the kobs-ng commit messages I can see that the BCH algorithm was changed a number of times in order to support newer i.MX SoCs and a broader range of NAND parts. Thus version alignment of those three components is critical for NAND. A side effect you should be aware of is that in some instances a kernel/U-Boot update could possibly invalidate the contents of NAND from a previous kernel. An in-field update &lt;EM style="font-weight: inherit; font-family: inherit;"&gt;might&lt;/EM&gt; require replacing the entire raw contents of flash rather than just rewriting individual NAND partitions from a recovery or firmware update partition. Hopefully the new algorithm introduced in 0d7fc23, "MMT-89: support reading bch geometry setting from debugfs," will prove general enough to prevent such an upgrade problem in the future. This same algorithm is used in the 4.1.15 BSPs. Stiill besides the implementation of this new algorithm it might be the case that a condition was not taken in consideration and as it happened in the past it might be required to introduce changes to the kobs-ng source code when moving past 4.1.15 which is the latest version of the kernel we officially support.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==================================&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 02:35:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566932#M87348</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2016-06-30T02:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: kobs-ng with 4.4+ kernels on imx6 processors</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566933#M87349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did some debugging and was able to get to the bottom of this. Here are the details if anyone else is running into this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAW nand access was added to the nand-gpmi driver in the 3.19 mainline linux kernel and a recent version of kobs-ng is needed to support that. However, I found that kobs-ng-5.4 relies on some features that the Freescale downstream vendor kernel has that are not in mainline Linux:&lt;/P&gt;&lt;P&gt;- &lt;A href="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mtd/nand/gpmi-nand/gpmi-lib.c?h=imx_4.1.15_1.0.0_ga&amp;amp;id=57b1be6777378c91d983be4eb1de58dfe6028510"&gt;MLK-12395: mtd: gpmi: add debugfs flag to indicate NAND driver use new raw access mode&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;- &lt;A href="http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mtd/nand/gpmi-nand/gpmi-lib.c?h=imx_4.1.15_1.0.0_ga&amp;amp;id=46892357d5de471345e359bba0d2b7e4c31c67c4"&gt;MLK-11719-2: mtd: gpmi: save the bch layout setting in debugfs&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first patch is how kobs-ng determines if raw nand access should be used and the 2nd is how it determines the BCH flash geometry with the ECC details. As these do not exist in mainline some patches are necessary to kobs-ng in order to it to work on mainline kernels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I chose to use the uname() system call to determine the kernel version and check for version &amp;gt; 3.18 as the 3.19 kernel added raw access mode (see &lt;A href="https://github.com/Gateworks/openwrt/blob/16.02/package/boot/kobs-ng/patches/003-raw-mode.patch"&gt;003-raw-mode.patch&lt;/A&gt;). If the bch_geometry debugfs node does not exist, the geometry will be determined automatically. While this used to work in prior versions of kobs-ng at some point support was added for NAND chips that had different ECC on the first block vs the other blocks and I believe this created a bug in the code if the fallback was needed to calculate the geometry. I addressed this with another patch (see &lt;A href="https://github.com/Gateworks/openwrt/blob/16.02/package/boot/kobs-ng/patches/004-fix-cal_nfc_geometry.patch"&gt;004-fix-cal_nfc_geometry.patch&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting kobs-ng works fine for us on a Linux 4.4 kernel. If interested you can see our OpenWrt recipe for building kobs-ng-5.4 with gcc-5.2 &lt;A href="https://github.com/Gateworks/openwrt/tree/16.02/package/boot/kobs-ng"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 21:10:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/kobs-ng-with-4-4-kernels-on-imx6-processors/m-p/566933#M87349</guid>
      <dc:creator>timharvey</dc:creator>
      <dc:date>2016-06-30T21:10:14Z</dc:date>
    </item>
  </channel>
</rss>

