Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp1269747rba; Fri, 22 Mar 2024 08:57:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVK7vC8tcP8HnLWSAxE/ak5n0aG+ugPjGyXFOJnYMu0UvuL+P9IebNTZT9Q9em4QXlmHSuz7WVLab19qAZbcG8YOQYVBjy9VfRrz//kgg== X-Google-Smtp-Source: AGHT+IFSVNcIsJxYs5PtqcJN8clAH572C3CY3lC7tZ9FwqjwuPNWtzGVEksGQ2LjBR4+5UbcgfcG X-Received: by 2002:a05:6a21:7884:b0:1a3:6c9e:1e2b with SMTP id bf4-20020a056a21788400b001a36c9e1e2bmr2853pzc.14.1711123055602; Fri, 22 Mar 2024 08:57:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711123055; cv=pass; d=google.com; s=arc-20160816; b=wmKqX0GxmflfZZue4widGhDbbEfaA15NUujjMsIEgoYwuwGaEJkLoWTcNZmh+5caRx BqKE+VE4bj/XcSHh+PuiK6Ely41qyxDHHfg7WDsR5Kf9+2VX4uFGxWkOGFJltQtLdc7q bPJ2mAM2kDsSuswAbvS+T6pGbKtkV0uQzljg/zrgCWQ0wbILbuUyBt+ZgXc/pSte6yTO MI/EW4m45H6MuDXPuTyAJkyabzNOfN7zwcgm626ZlJ5SA3Zi9vs6cj5IA04lJnI/GFgt BKyNACZWadsZmWPacLwgLmcrxR1L+EBetoIo6aakzqDeqKTLC6908VRZFDdlP6FAADYX fYag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=W1g1tAJQw2VzfoFaf+vskbAjLNJ5d5TWXlYbG1jr4y0=; fh=xJLVBDiURuPhnWnp6Uvey6hucCHv9CAaTYTSFiHPP6M=; b=vXN13zEkfXEIg6u63UHSqw/cIqO9ElRR0rSEKt/O/7AHWfkyTahFnuhL+4wH9LDX+m XyVL0aHhMO6121tSB7dWNbDYxIHwGqAHORX5GqMqIx7rlZCO61bCH/XOyv7dwvrG2v0A 7NnnpKji1VryXVLvHDZvPRZ2jOf9qSu6ke4rFFturVdn6ORPUUv6jXgM/gO+Xz7r9TOd lcnaiSQJmBq86FyKyM7SBtGLyuP6koVb8YSR6hwaSzFmAbwKctWEM+zb4WIwF1ldYgxN XL7xQ5KQsfHvOnc72dra9YL5MWGYlmOD+Rmw3NvbDiSuXjIYYn9RFj/vToXuS4d9uvVs Gm9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111734-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fr3-20020a17090ae2c300b0029e0780076bsi2223349pjb.151.2024.03.22.08.57.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111734-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 223DFB22485 for ; Fri, 22 Mar 2024 15:57:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E7215674C; Fri, 22 Mar 2024 15:57:24 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B315653811; Fri, 22 Mar 2024 15:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711123043; cv=none; b=GNA6/b6N0QDxYP3wK0TmtvHbes+CzJ7D5nyR3QJCzvzjwLVaIZsfsuyjNHnrXrrDQ6uWKCa2sXYKvLrj9aFLs3+5wjV3UWwvYlZEaYeynUZvuIT58icTRzaDdCLPjNdBC3n+Tn3kgWAnUnbNHP4E5SjkM5rrcNi9/TG6HOifgGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711123043; c=relaxed/simple; bh=g8t//AI7C/xXEKlaVarUSs1GgQOPycd3Pj2sIFog6vI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kXISWou+/Z2fGTLQrWvzD9YUjVGi284eGUQ9FmKAHV2i++cFfmxjQbzV/POJKBivw2OzahYwFk4DuhQBB3CRZf9wZLNIDa5vPGkEwf1tRMZyD600KtYoflTN5BiRmMrfHUrhnvRsGHuN3QE5Jd6Z9MFLxGP7gOPwCdVBa/qtTkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rnhGL-000542-0p; Fri, 22 Mar 2024 15:56:57 +0000 Date: Fri, 22 Mar 2024 15:56:49 +0000 From: Daniel Golle To: Richard Weinberger Cc: Miquel Raynal , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-mtd , devicetree , linux-kernel , david oberhollenzer Subject: Re: [PATCH v7 7/7] mtd: ubi: provide NVMEM layer over UBI volumes Message-ID: References: <82ceb13954f7e701bf47c112333e7b15a57fc360.1702952891.git.daniel@makrotopia.org> <20240219120156.383a1427@xps-13> <1209094181.98490.1708899174329.JavaMail.zimbra@nod.at> <1754825522.38834.1710105437883.JavaMail.zimbra@nod.at> <1196553263.78350.1710887478387.JavaMail.zimbra@nod.at> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1196553263.78350.1710887478387.JavaMail.zimbra@nod.at> On Tue, Mar 19, 2024 at 11:31:18PM +0100, Richard Weinberger wrote: > ----- Urspr?ngliche Mail ----- > > Von: "Daniel Golle" > >> BTW: Is there a nice way to test this with nandsim in qemu? > >> I'd love being able to test all ubi attach code paths on my test setup. > > > > From what I can tell 'nandsim' doesn't have a way to be defined in > > Device Tree, making it unsuitable to test the attachment of UBI in > > this way. > > > > However, QEMU does support emulating TI OMAP's OneNAND controller, eg. > > as part of the Nokia N810 hardware supported by qemu-system-arm, see > > > > https://www.qemu.org/docs/master/system/arm/nseries.html > > > > So we could use that and modify the device tree in Linux to have a MTD > > partition for UBI and 'compatible = "linux,ubi";' set therein: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi#n84 > > > > If you like I can prepare such a test setup. > > This would be great! > > > Is there a repository for MTD/UBI tests to be run on QEMU which I should > > contribute this to? > > UBI tests reside in the mtd-utils repository. > http://git.infradead.org/?p=mtd-utils.git;a=tree;f=tests/ubi-tests;h=20fd6a043eeb96a81736dd07885f74e4e0bb0cc0;hb=HEAD > > Maybe you can provide a small shell script which configures qemu? > It doesn't have to be fancy, just something David or I can use as staring point. I'm working on it but it turns out to be a bit more difficult than I thought it would be, because * the only devices with NAND flash emulated in QEMU or Nokia N800 and N810 as well as some even more ancient Intel PXA270 based PDA like the Sharp 'spitz'. * QEMU support for the N800 and N810 has apparently been bitrotting and is broken at least since 2019, nobody seems to care much. * The spitz predates device tree and hence is unsuitable for testing attachment of UBI via DT. But it at least boots because Guenter Roeck makes sure it does[1]. I was about to create a spitz-like imaginary board with DT, but also that doesn't seem to be completely trivial. So: hold my beer, I'll be back shortly ;) If anyone has better ideas on how to utilize support for raw NAND or the OneNAND controller in QEMU in a device-tree environment which actually works, that'd be great. Obviously I don't care about other peripherals like Bluetooth and all the complicated stuff of the N80x... [1]: https://github.com/groeck/linux-build-test/blob/master/rootfs/arm/run-qemu-arm.sh#L64