Re: [PATCH 3/3] drivers: mtd: nand: omap: Return stat value

2018-02-23 Thread Daniel Schultz


On 02/16/2018 08:56 AM, Sascha Hauer wrote:

On Thu, Feb 15, 2018 at 01:51:26PM +0100, Daniel Schultz wrote:

Hi Sascha,


On 01/30/2018 08:11 AM, Sascha Hauer wrote:

On Mon, Jan 29, 2018 at 02:04:11PM +0100, Daniel Schultz wrote:

The read page function should return the total count of flipped bits,
otherwise the caller always thinks no bitflip occured.

Signed-off-by: Daniel Schultz 
---
   drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c 
b/drivers/mtd/nand/nand_omap_gpmc.c
index e18ce63..38f4960 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -712,7 +712,7 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info 
*mtd,
else
mtd->ecc_stats.corrected += stat;
-   return 0;
+   return stat;
   }

I'm afraid this is not enough. read_page should return the maximum
number of bitflips in any ECC step. You first have to change
omap_correct_bch() so that it returns this number.

ahh, we worked on this problem a half year ago and it seems like three
patches are missing upstream:

http://lists.infradead.org/pipermail/barebox/2017-June/030385.html
http://lists.infradead.org/pipermail/barebox/2017-June/030384.html
http://lists.infradead.org/pipermail/barebox/2017-June/030355.html

Oh, I see. It seems I have either forgotten to merge them or I have
waited for feedback. Could you create a series for all missing patches
including your new patch and resend it, provided it works as expected of
course?

Yes, I will do this as soon as I have time for it.


--
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz



___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: linux.bootargs: export mtdparts from DTS

2018-02-23 Thread Yegor Yefremov
On Fri, Feb 23, 2018 at 9:04 AM, Sascha Hauer  wrote:
> On Fri, Feb 23, 2018 at 08:52:35AM +0100, Yegor Yefremov wrote:
>> On Fri, Feb 23, 2018 at 8:39 AM, Yegor Yefremov
>>  wrote:
>> > On Fri, Feb 23, 2018 at 8:33 AM, Sascha Hauer  
>> > wrote:
>> >> Hi Yegor,
>> >>
>> >> On Fri, Feb 23, 2018 at 08:26:56AM +0100, Yegor Yefremov wrote:
>> >>> My board will be configured via DTS file, that contains an MTD
>> >>> partition table [1]. How can it be automatically exported to
>> >>> global.inux.bootargs.mtdparts?
>> >>>
>> >>> [1] 
>> >>> https://git.pengutronix.de/cgit/barebox/tree/arch/arm/dts/am335x-baltos-minimal.dts#n217
>> >>
>> >> Why would you want to do that? You are not going to start an ancient
>> >> kernel with ATAG support, are you?
>> >
>> > So far I'm using ancient LTS 3.18.x kernel with this DTS [1] and
>> > packaging it via FIT.
>> >
>> > [1] 
>> > https://github.com/visionsystemsgmbh/onrisc_br_bsp/blob/master/board/vscom/dts/3.15/onrisc-baltos-ir-5221.dts
>>
>> I've installed dtc and dumped my loaded DTB in Linux:
>>
>>  nand@0,0 {
>> reg = <0x0 0x0 0x4>;
>> gpmc,we-off-ns = <0x28>;
>> gpmc,oe-on-ns = <0x0>;
>> gpmc,device-nand = "true";
>> gpmc,cycle2cycle-delay-ns = <0x0>;
>> gpmc,wr-access-ns = <0x28>;
>> gpmc,wr-data-mux-bus-ns = <0x0>;
>> gpmc,adv-rd-off-ns = <0x22>;
>> gpmc,oe-off-ns = <0x36>;
>> gpmc,clk-activation-ns = <0x0>;
>> gpmc,wait-on-write = "true";
>> elm_id = <0x42>;
>> ti,nand-ecc-opt = "bch8";
>> gpmc,adv-on-ns = <0x6>;
>> gpmc,adv-wr-off-ns = <0x2c>;
>> ti,nand-xfer-type = "prefetch-polled";
>> gpmc,wait-monitoring-ns = <0x0>;
>> nand-bus-width = <0x8>;
>> gpmc,device-width = <0x1>;
>> gpmc,cs-rd-off-ns = <0x2c>;
>> gpmc,rd-cycle-ns = <0x52>;
>> #address-cells = <0x1>;
>> gpmc,bus-turnaround-ns = <0x0>;
>> gpmc,cs-on-ns = <0x0>;
>> gpmc,we-on-ns = <0x0>;
>> #size-cells = <0x1>;
>> gpmc,wait-on-read = "true";
>> gpmc,wr-cycle-ns = <0x52>;
>> gpmc,access-ns = <0x40>;
>> gpmc,sync-clk-ps = <0x0>;
>> gpmc,cs-wr-off-ns = <0x2c>;
>>
>> partitions {
>> compatible = "fixed-partitions";
>> #addres-cells = <0x1>;
>> #size-cells = <0x1>;
>>
>> partition@26 {
>> reg = <0x26 0xfda>;
>> label = "UBI";
>> };
>>
>> partition@0 {
>> reg = <0x0 0x2>;
>> label = "SPL";
>> };
>>
>> partition@2 {
>> reg = <0x2 0x2>;
>> label = "SPL.backup1";
>> };
>>
>> partition@4 {
>> reg = <0x4 0x2>;
>> label = "SPL.backup2";
>> };
>>
>> partition@6 {
>> reg = <0x6 0x2>;
>> label = "SPL.backup3";
>> };
>>
>> partition@8 {
>> reg = <0x8 0x1e>;
>> label = "u-boot";
>> };
>> };
>> };
>>
>> Somehow UBI partition is now the first partition 

Re: linux.bootargs: export mtdparts from DTS

2018-02-23 Thread Sascha Hauer
On Fri, Feb 23, 2018 at 08:52:35AM +0100, Yegor Yefremov wrote:
> On Fri, Feb 23, 2018 at 8:39 AM, Yegor Yefremov
>  wrote:
> > On Fri, Feb 23, 2018 at 8:33 AM, Sascha Hauer  
> > wrote:
> >> Hi Yegor,
> >>
> >> On Fri, Feb 23, 2018 at 08:26:56AM +0100, Yegor Yefremov wrote:
> >>> My board will be configured via DTS file, that contains an MTD
> >>> partition table [1]. How can it be automatically exported to
> >>> global.inux.bootargs.mtdparts?
> >>>
> >>> [1] 
> >>> https://git.pengutronix.de/cgit/barebox/tree/arch/arm/dts/am335x-baltos-minimal.dts#n217
> >>
> >> Why would you want to do that? You are not going to start an ancient
> >> kernel with ATAG support, are you?
> >
> > So far I'm using ancient LTS 3.18.x kernel with this DTS [1] and
> > packaging it via FIT.
> >
> > [1] 
> > https://github.com/visionsystemsgmbh/onrisc_br_bsp/blob/master/board/vscom/dts/3.15/onrisc-baltos-ir-5221.dts
> 
> I've installed dtc and dumped my loaded DTB in Linux:
> 
>  nand@0,0 {
> reg = <0x0 0x0 0x4>;
> gpmc,we-off-ns = <0x28>;
> gpmc,oe-on-ns = <0x0>;
> gpmc,device-nand = "true";
> gpmc,cycle2cycle-delay-ns = <0x0>;
> gpmc,wr-access-ns = <0x28>;
> gpmc,wr-data-mux-bus-ns = <0x0>;
> gpmc,adv-rd-off-ns = <0x22>;
> gpmc,oe-off-ns = <0x36>;
> gpmc,clk-activation-ns = <0x0>;
> gpmc,wait-on-write = "true";
> elm_id = <0x42>;
> ti,nand-ecc-opt = "bch8";
> gpmc,adv-on-ns = <0x6>;
> gpmc,adv-wr-off-ns = <0x2c>;
> ti,nand-xfer-type = "prefetch-polled";
> gpmc,wait-monitoring-ns = <0x0>;
> nand-bus-width = <0x8>;
> gpmc,device-width = <0x1>;
> gpmc,cs-rd-off-ns = <0x2c>;
> gpmc,rd-cycle-ns = <0x52>;
> #address-cells = <0x1>;
> gpmc,bus-turnaround-ns = <0x0>;
> gpmc,cs-on-ns = <0x0>;
> gpmc,we-on-ns = <0x0>;
> #size-cells = <0x1>;
> gpmc,wait-on-read = "true";
> gpmc,wr-cycle-ns = <0x52>;
> gpmc,access-ns = <0x40>;
> gpmc,sync-clk-ps = <0x0>;
> gpmc,cs-wr-off-ns = <0x2c>;
> 
> partitions {
> compatible = "fixed-partitions";
> #addres-cells = <0x1>;
> #size-cells = <0x1>;
> 
> partition@26 {
> reg = <0x26 0xfda>;
> label = "UBI";
> };
> 
> partition@0 {
> reg = <0x0 0x2>;
> label = "SPL";
> };
> 
> partition@2 {
> reg = <0x2 0x2>;
> label = "SPL.backup1";
> };
> 
> partition@4 {
> reg = <0x4 0x2>;
> label = "SPL.backup2";
> };
> 
> partition@6 {
> reg = <0x6 0x2>;
> label = "SPL.backup3";
> };
> 
> partition@8 {
> reg = <0x8 0x1e>;
> label = "u-boot";
> };
> };
> };
> 
> Somehow UBI partition is now the first partition and thus other
> partitions were not parsed. Cat /proc/mtd says nothing and I have only
> /dev/mtd0.

The partition ordering is strange, but not your problem. You only