Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp82371rwi; Wed, 2 Nov 2022 09:32:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NajhTgiFB5qT+6LpquUmYkW/+jNlp4h7ap8KKQld7I3BDLtfI9VjGbKycJv0ZqOLyVbv7 X-Received: by 2002:a05:6402:4303:b0:45c:cd3d:f5 with SMTP id m3-20020a056402430300b0045ccd3d00f5mr26003336edc.188.1667406745877; Wed, 02 Nov 2022 09:32:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667406745; cv=pass; d=google.com; s=arc-20160816; b=a8gHJPAAokHaT98r/31PgwqT/BfsQr+GWYykpoKF15b91KVAvf+0DY6QO/8t7l8sGl msvS4Hunv43w1Y10kUcIvqlF+xvZ5Pcpu9SLx4wbMMj0bezkIdtWtQ8tGkKwlH6tvEkO h85UNJs+wg4a448wJC+2yx0xJbf3cqNXNfK9JGZA0Su/TmNz5x/xDiHFyqO8SOEmqtCu v2GwwtyEmf9tY3xR4Tr3f/6Zg9qEIg3TeBDzPK24Ntf52UZdyk5Ih2o3wDMKHRIV8Y/P d5LW9h0sJEsX9VnqqU3MmzvGF3HGg/pI/a4CtHLDQp6eMV6Fiv9fBtLjKkgUlSiU/TSa jEUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=3tegK65dZbB3Y5mL2eHnljm4Wlj6aB4PBC/8FJKZeXQ=; b=afJeRJv3rWJTARxSPrA6VHmE2g0RoJMUBcSJ25g+ZCaMo/k3jqY1s1ZVgJZqTYVaWu i8lv+E1IM9Jwm3cBHeHbeyzVty1PQE/YNeWfNBTKdR1O7DX9dLgziIzqrVgQqjQJmTBB P0w66wYWBODA/TXE1Ud1bwi3w2gTOCe8nWGPeUYfihkCejwktLcpA34Rv7JXn6MlSYSf Wxnqm6bCpkdTCWbeD7Wybdt2zdBS0uDIIJcO1rLKH/3mn01BQ8T97yJ3BqtIgJZd+4c9 BP9P2AgliQ/CXAtQUwL/9sUfjLaG8lXBSzYmX2wzy1XkOYZiIJMPw54WjUU6T3WFx9Ie 3zYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EYlvpF+d; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a50e60d000000b00461dca37cd0si14331532edm.126.2022.11.02.09.31.52; Wed, 02 Nov 2022 09:32:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=EYlvpF+d; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbiKBP2z (ORCPT + 98 others); Wed, 2 Nov 2022 11:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbiKBP2r (ORCPT ); Wed, 2 Nov 2022 11:28:47 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2098.outbound.protection.outlook.com [40.107.93.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56B01DDF9 for ; Wed, 2 Nov 2022 08:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=djqmXNuHBJ3LhQXZGEoXN/lr3y7n4eWzd4OH8ZnUGJE6GSgjj9xoO5Wc+FQnqtstPqEtrFpEyBB6hc96p/wJpjUScWzsb9zhvqU41V7WOm+CL8vd950A0PspZGM5QNka4n1PwrnBzozgMiJAJI8TP0prOSPNhMHAECjRwIqF+Sl0vA6VYwtHSmZItHnmt4X+ALeCK8RjZhcifBQrEBABZlPG/YGtj1XmwQyKAS1I5vHIz2mPzwXF7M6njfI8tzQRR4SmehT7+wurybVmLf9zJO8l3beE/22TGvqdF8Ib6rvYtpTr7PZLutarphOX5TvRYvM8X0rof+j9mDBUi/QD3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3tegK65dZbB3Y5mL2eHnljm4Wlj6aB4PBC/8FJKZeXQ=; b=FTvP9yylAAwGa8mAwqQmgzHNMtAizZX0B7s1VBQMunDhlP7+Q7CYNAnh1JZdT8jqxWtetrlUveUKOXslodMVM7Jl6/j6YBYZehpsPwIlhDrTthg5xw7CpKPEihFViX/wf9Qe0rzGGrnD3KgnOaC+yJjJpxh8Xgno8MaKn8K32FwgD/sMIWAf7XUgXeiHVrdMgYioIafPjAntqg8vCpjVFtjmF2sqLvgtYF3xcMGty/gkXHXZc6P6vAJDLFf4hAc8q7R0H0aAmPXON3TywHtTgnv14Yd0kULkqpJm1l0x3ocukbU4wgjAOot6kKnGF5/D7HGAc4POH+8sBaMpeQyL7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3tegK65dZbB3Y5mL2eHnljm4Wlj6aB4PBC/8FJKZeXQ=; b=EYlvpF+d9zz2I9Mu3RvpHgk8GJzAam39WwUyG8+c08rzHimxJG4xBZSCBtDXvHwj3nEVSqIsb5NJo705kkZ4DYj6L8GdYIcXFFBthnWrd53FDkLX/OkH2qtYgin6Zaw5xthdR9yVWv0g6jHG4cLLX93e2uSsfvMrQTZ6ZjAOQZQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by CY8PR10MB6874.namprd10.prod.outlook.com (2603:10b6:930:85::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Wed, 2 Nov 2022 15:28:38 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::a8ed:4de9:679e:9d36]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::a8ed:4de9:679e:9d36%4]) with mapi id 15.20.5769.021; Wed, 2 Nov 2022 15:28:38 +0000 Date: Wed, 2 Nov 2022 08:28:25 -0700 From: Colin Foster To: Miquel Raynal Cc: Roger Quadros , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Pratyush Yadav , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Krzysztof Kozlowski , Vignesh Raghavendra , Richard Weinberger Subject: Re: Barebox / Kernel Omap ECC inconsistency? Message-ID: References: <20221102141400.31125365@xps-13> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221102141400.31125365@xps-13> X-ClientProxiedBy: SJ0PR05CA0204.namprd05.prod.outlook.com (2603:10b6:a03:330::29) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|CY8PR10MB6874:EE_ X-MS-Office365-Filtering-Correlation-Id: 31c8eea7-43d3-47c2-7822-08dabce6e95c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EDbSPJ/PYIZvfT1uz9OFY3scMP33Ezd5UQSSEXSQsusDiQp6hFsYYCkc7gnYCE+8/0WnfuzP/jDdFSE65YNlvzwscYW3nz+FzxcvelMRADZ0fonmT/DPzACFDpzCo64R45RIyRtIHLOQVkCJGQsm8pkzwm5lxBTX/TMUTbOLpIneeqSfN4jZMBV/ezUeL102IxopvtPfGNhF3+CTy+p6TmyirJVYfdc9G2ob1bojYIPLejjjEMWcsafgmRIl24bCoIN2ZgW6vAMfwjoaEd21schTCRuQL7TSdUQMHHAqkmTzLew9dftSLnowZRV8dM6ZIFjUXfIb7DnWogvUIL/ioJTnazJynz0lkRjqfNDmMjw+N/x4u3zQl3yRi0SuuW6WhufitvyYg+lZ3HG4Z7A35DzQfs89c4KeLwcvUOyMu0gneLHVieB+hz1jHuKdCrNsHDTzeS5IxLVZ0xDE9q5CZ0qY0XVLpnw6MpqcqGGDuqJJNA8ykm4rOHOfz4DKDOhPFrxluUIxIkdQtxp8aCItqXmS3Kb0YN1EoUIA1UbHvNn2MKWO8xvx9gD9StU+x7I6ujIj84BCWf3MsrW/1iU0MeLyqE/jPbQVpa9v1TbkpdD/+70Sc5LE49p/VkRgYZ4zVBcCVbgSB5m3PqW6xn63gCtEzVZnnbfIUhlvk9XF6PpF9E7KLSRRY3uW/JjhcviJIsSQEMB3XLGZMhHCKXFaOofYUxVijqMTv9Mgbk4wrHHFaHBcFbv/Y8Pg68ieFcHyI/BBO20cC0D2Pqto7kngZjliki1rf6XRcZ5RjucWHhY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(376002)(39830400003)(136003)(346002)(366004)(451199015)(966005)(6666004)(478600001)(66946007)(8676002)(53546011)(6916009)(316002)(66556008)(54906003)(86362001)(66476007)(6506007)(9686003)(66574015)(4326008)(41300700001)(26005)(8936002)(6512007)(83380400001)(186003)(2906002)(6486002)(5660300002)(44832011)(38100700002)(67856001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MGMyNnJEdFJ1bTB0ZUExakdqd0g5cnpNSnFtR1lBV0g4WGtXdG01QTIyRFNq?= =?utf-8?B?L0VxNVp0NXgyTHZMejRNUWRna3pCeTI2QlIza2E3RExyY2hES29KS0dqdVNq?= =?utf-8?B?SXVWYmN4b2VLSFgrOVJuNnRMRGRYNDBtNkxMSlJhdkQzTWd4eDE2RVdJeG1O?= =?utf-8?B?anp1S1FYR3FjWWc5NGk0YjlCVzAvTHdsVTJ0UFFYUDRRWi9mVzZLUmtQWTl4?= =?utf-8?B?U3ZycytGbmdSM2ZUTjh5YkpYc25SL3hxWXNtaVRIK2N6OXl0d3pZZFZyVmdH?= =?utf-8?B?Z3hFSStNSmw1RERtVG92Q08zTjdYK00raW5QYkpHa0IySFJhK294N2ZzNXVx?= =?utf-8?B?cHN3T2VGVmU4blQ1TTNDanlKb0k5RTUxcGFBK2RqczQ0VnNYZFV1WU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S-Exchange-CrossTenant-Network-Message-Id: 31c8eea7-43d3-47c2-7822-08dabce6e95c X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2022 15:28:37.9528 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /IQiRSD5JHXcGojF6/fjSvYAl/G4HDokdRvkV+PyfG8ea/HFYo10hxxxysYmZGS5WPnNVcKYsBkaClzIUayi4LVRnNEQWpH4m2HcfiaNUbc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6874 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 02, 2022 at 02:14:00PM +0100, Miquel Raynal wrote: > Hi Colin, > > rogerq@kernel.org wrote on Wed, 2 Nov 2022 09:12:27 +0200: > > > Hi Colin, > > > > On 01/11/2022 21:09, Colin Foster wrote: > > > Hello, > > > > > > I'm trying to revive a product that runs on a Phytec OMAP 4460 SOM. I > > > submitted a .dts RFC a month or so ago, and plan to perform the > > > suggestions and resubmit, but I'm up against one main hurdle that seems > > > to be related to flash OOB/ECC. (get_maintainers on > > > drivers/mtd/nand/raw/omap2.c is how I got this email list) > > > > > > Barebox has "native" support for the Phytec SOM: > > > https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/phytec-phycore-omap4460 > > > > > > It seems like Barebox is writing and expecting ECC bits to start at an > > > offset of 12 bytes, while the kernel (and Barebox comments suggest) the > > > ECC bytes should start at 2. I'm seeing this with > > > `nanddump -n -o -l 0x41000 -f mtdxnanddump /dev/mtdx` > > > > > > Barebox created partition with UBI (mtd3) > > > ... > > > 00000800 ff ff ff ff ff ff ff ff ff ff ff ff 56 49 fd 17 > > > 00000810 b2 25 60 1a 42 1d eb 56 5d ff ff ff ff ff ff ff > > > ... > > > > > > Kernel created partition with UBI (mtd4) > > > ... > > > 00000800 ff ff 07 73 04 ac 57 6b 9b 1f 92 49 ab e0 b9 ff > > > 00000810 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff > > > ... > > > > > > > > > My question: > > > > > > Am I right to assume this is an issue in Barebox? Perhaps this is just a > > > > I'm guessing so. Both u-boot and Linux for OMAP put the ECC bytes right > > after the Bad block marker which is 2 bytes. > > Yep. I checked, this has been like that since at least 2014, I don't > think we changed the layout in U-Boot/Linux "recently"... (I haven't > checked earlier, by laziness). > > > https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/raw/omap2.c#L1729 > > https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/raw/omap2.c#L134 > > > > > bug that has been fairly dormant for 15 years. If that is the case, I > > > assume there's probably no hope in getting this mainlined, and "native" > > > barebox support is just a ruse. > > > > > > If that isn't the case, is there a hidden "shift OOB by 10" config > > > option that I'm missing? Or am I interpreting this data incorrectly? > > > > > > > > > Any suggestions would be greatly appreciated. > > > > You should fix the OMAP NAND driver/config in Barebox to match that > > with Linux OMAP NAND driver if you want them to run on the same system. > > Agreed. Got it. Thanks a lot for the info Roger and Miquel. I think this should be pretty doable, and I'll venture down that path. > > Thanks, > Miquèl