From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03CA4C433FE for ; Wed, 2 Nov 2022 11:29:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86D8C850B8; Wed, 2 Nov 2022 12:28:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="at2Uk7SR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C803884E96; Wed, 2 Nov 2022 07:15:31 +0100 (CET) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7B0C884E96 for ; Wed, 2 Nov 2022 07:15:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=liangyanyu13@gmail.com Received: by mail-pj1-x1034.google.com with SMTP id l6so15323164pjj.0 for ; Tue, 01 Nov 2022 23:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=oWg9YeyjrHa1+L2WhRtv7PbITHinZ6dCvB2q1j6sqTQ=; b=at2Uk7SR/U+axnaAg47g1gZb/fZcKTEHrJ1PlAIS0+sYKg7PqE9pPtBNh4RdldNZk6 S7LNt+m1ii3trEur83YCxtDzwuGHFXs3EBh+VnISwZVOhZRSuzW3bRGq7iuHshslYfCs N6m42gV1amD73ceK3rfDu6tTNrFFrgkwOditLnOF86/I8pSvV7L2jUJS8PS9nTEgqHib QM0oNngYM5frOsgRRf3qN8FrNgv+Sy4RlUYE70pWiXmDIphah0tFw8Fzw6mS/L1b+VRv Ba1Lns/bbiQ58yqHPJ13VKONMw2o3ri/g8LHkbM6VZmmH3xb8p8glO5A5upptTDQ3DLU Xrug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oWg9YeyjrHa1+L2WhRtv7PbITHinZ6dCvB2q1j6sqTQ=; b=umCQsganJHPErlSzW3H75DrjMlp5zwL+Qn0PqG23L3CpnwnL2sGLO5pb0ipLbtWb5F oFpR1vDYbMhCzzcLvp6HuaUzkTUMQITC9sGwi/v974YiuNx1mIX2awwyK0in3DiK7Y9y wohudGJJrS9ZIaUZ9HV4lsO3fL+BA4n1T/D04kjOCdNPPhGtKSCRZDUv3lf2XiXQzy8P Vy1lc8iL2rL7zaMkNFoUF8p276gAkD+M8elrpTIx99fUxS/AdJxoDnkeozjvINIrEToC M1luj1QeKyh1QdG6ElGNh2HVtyBFJC77H0C3wypQuc+cUkM5/WBa+ZwFFEAt9h1+cBRx qQ2Q== X-Gm-Message-State: ACrzQf39KG4mNhp0ndxUveJbE4a7WjDSB6J4OdHO9qg9BO6Pa8h9Ib6j XyYm9uDKjlXNO9Ykm3jU0tk= X-Google-Smtp-Source: AMsMyM44QuIzrbb3/lymz4KXv9gylXs3KLAgZ15WouH/hi9C3XOPCg7vmZx1xDzxlt7GADvF4T6lWw== X-Received: by 2002:a17:903:246:b0:179:96b5:1ad2 with SMTP id j6-20020a170903024600b0017996b51ad2mr22734337plh.37.1667369727714; Tue, 01 Nov 2022 23:15:27 -0700 (PDT) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id v128-20020a626186000000b0056328e516f4sm7805882pfb.148.2022.11.01.23.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 23:15:27 -0700 (PDT) From: Leo Yu To: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, miquel.raynal@bootlin.com, u-boot@lists.denx.de Cc: jaimeliao.tw@gmail.com, Leo Yu Subject: [PATCH v2 3/5] cmd: mtd: Add total length of read operation Date: Wed, 2 Nov 2022 14:14:30 +0800 Message-Id: <20221102061432.7113-4-liangyanyu13@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221102061432.7113-1-liangyanyu13@gmail.com> References: <20221102061432.7113-1-liangyanyu13@gmail.com> X-Mailman-Approved-At: Wed, 02 Nov 2022 12:28:41 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This patch bypasses the limitation of length for read operations in MTD test module. Thus, the total length of a read operation can be passed down to the continuous read operation in SPI NAND layer. Signed-off-by: Leo Yu --- cmd/mtd.c | 2 ++ include/linux/mtd/mtd.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/mtd.c b/cmd/mtd.c index ad5cc9827d..0b601e08a3 100644 --- a/cmd/mtd.c +++ b/cmd/mtd.c @@ -335,6 +335,8 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc, io_op.ooblen = woob ? mtd->oobsize : 0; io_op.datbuf = buf; io_op.oobbuf = woob ? &buf[len] : NULL; + /* Total length of this read operation passed by user */ + io_op.totallen = len; /* Search for the first good block after the given offset */ off = start_off; diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index ff635bd716..df8a231c82 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -79,6 +79,7 @@ struct mtd_erase_region_info { * mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW) * @datbuf: data buffer - if NULL only oob data are read/written * @oobbuf: oob data buffer + * @totallen: total number of data bytes to read in one read operation (for continuous read mode) */ struct mtd_oob_ops { unsigned int mode; @@ -89,6 +90,7 @@ struct mtd_oob_ops { uint32_t ooboffs; uint8_t *datbuf; uint8_t *oobbuf; + size_t totallen; }; #ifdef CONFIG_SYS_NAND_MAX_OOBFREE -- 2.17.1