From patchwork Thu Apr 27 06:53:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 1774341 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-weidmueller-onmicrosoft-com header.b=anuk6OTr; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q6RLL6m3sz23v8 for ; Thu, 27 Apr 2023 16:54:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C268286385; Thu, 27 Apr 2023 08:54:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.b="anuk6OTr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2223F86382; Thu, 27 Apr 2023 08:54:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20613.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::613]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8BB418636B for ; Thu, 27 Apr 2023 08:54:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=stefan.herbrechtsmeier-oss@weidmueller.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gVYgYdN8gzQotyyS6LHGiCp5dS/o0+O5Zs2gy0j8mK/mCblrMkoShZXfiUpRxUOUyazizRhNaxsMsecInU7FLe21NQJVcYLPwIOqIV1rrfEw4XuJqGeq2uZXfSHis1g6WtdUJywCSifoWyXasfpd+H7/HUjtHUi/T3ngPYQIVTeVT3QyU7G38/J7+C0+2Xd6v+Tr6YkSAz/pC5cXwVBUOWSC9ojQzsUnEl8dUsfmdnaOnpYzs6I9g5xPSWlXfKJNlDGZ2L8GhUlqIxcUYXlx3vJ52lCHRQEBAEjsBDfmkUuzVEUsaepgfuFLdLxBfNkEsd26PSIIY59nUVecvD3VaA== 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=27W5SK2S1SMUpX1lq1rKSi/g2ComhZHeJGEclp7vyrI=; b=gN0AXzvG9y3ClwmurE2b7tyAUEx/qDabZrxAMQnz51G7CZVtTPUNA2SOBKwtpve68QreYy9p3xZfTmZXaICu3pM+HkBMtJj8zuSNQ2V9PDbRFQ9SvzXNcEmFLJx2VoXf8WcGMq6UtVxaUj+XtCX8fsE4uP+fhXeMl9ij2DBk/nimO9vB3lV2GG3mzLlzfCuvl1tXomWIEowFhPUlhHyB6oiz0Xg/jq90Bye4H/RU07bYc4BkC+ALaoDHT/3WCjjUlzSTh57flj8ix7F3gZaBF1H/ZHOYWqVpUDOsLXgFZBspVpQKvp5XgYfoNob7HlcswhwNAoxx2S6dtSmuRP3h9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.onmicrosoft.com; s=selector1-weidmueller-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=27W5SK2S1SMUpX1lq1rKSi/g2ComhZHeJGEclp7vyrI=; b=anuk6OTrBt4zYiyq3bTYxl5/qGmnlg49fZc36J/5t19XGM/RhzQ9RY2QFlzZ3UCQzj1I2wLOew80SlFmaSPrYuUAu5Ras/d/enfPakkfc87t3f4pRTQXzhSN97ObBVf/gg3ioRee0HpXriZNJnfOi9QSqIvcu2WoUckGzd4yTP4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by AS8PR08MB8707.eurprd08.prod.outlook.com (2603:10a6:20b:563::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.21; Thu, 27 Apr 2023 06:54:15 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::5979:132b:6e3:cfb2]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::5979:132b:6e3:cfb2%7]) with mapi id 15.20.6340.021; Thu, 27 Apr 2023 06:54:14 +0000 From: Stefan Herbrechtsmeier To: u-boot@lists.denx.de Cc: Stefan Herbrechtsmeier , Ashok Reddy Soma , Jagan Teki , Michal Simek Subject: [RESEND PATCH] Revert "spi: zynq_qspi: Use dummy buswidth in dummy byte calculation" Date: Thu, 27 Apr 2023 08:53:54 +0200 Message-Id: <20230427065355.7413-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: FR3P281CA0124.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:94::15) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR08MB6969:EE_|AS8PR08MB8707:EE_ X-MS-Office365-Filtering-Correlation-Id: 4112af17-d5b1-42cc-52ca-08db46ec367c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5a1GhGZer6xeTBODSwjB95KXnnf6Cv8EjQXN+TyyCAxvqKZU/Cq6x9A7jfJaTwA3CjC/HVpHFchwGGMylg3QmNQTj1eWWKKX/dH8cvveOmh51nuGqodI5+azLifsV2159JlMZ2OsCwNjYMuoS0g0L+09j7ays2DZLsBVGdHstgn9MdJ6YecZX2C24TeWk4ygKPYLa20oaM8SnlOV83O0B+VuJlGLVfLwtAFBmNSeLU7Hu+jvVgi3XAyOlg0uGBDMTqoDIvjuCNsaklUcHlJHlhxSgD5Cei0bsPv3NjKrrip4+cWZHXdNhepLI9Ny0OhAnu3ErNPnCSgIqX5CJ17IdWZmLRJ2fmm/bqTyBQ04afUwtg9nGyvPS/lUrviqb0TyNoALj8k9RwtXPlcnKvJ3TCX8/G+KScWCI9FBV9X7vPaz7ax7XqKC5YduTiFsAD57D5iaoxtApUAP/h+OVjqRdKJDmuxSlb4C5gQ3FOruBDixuov1VZDEdUhYmbDHhnQwpZU5qZNUOgEvAxR1XxHEcnkbZJJYlb4oA+sSVLt/F8ve7OG/JWIkDG6JTErP58oxOqvtlo+UoqIUb4AWbPJ3jMzZ/viflFX7357HV1deeDAL3WthsXrrboWjRJa1bZxw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB6969.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(86362001)(54906003)(6666004)(83380400001)(478600001)(36756003)(6512007)(26005)(1076003)(38100700002)(2616005)(6506007)(186003)(38350700002)(52116002)(6486002)(316002)(66946007)(41300700001)(6916009)(66556008)(4326008)(5660300002)(66476007)(2906002)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A7/fnjetiCt1pTeDr4w6bOF20eBS8ilhxuDbbR6JLZ37rAimsRjno2UEC37PqfpsF7eqFg0574ZPZq4g56juCzBrbQe4/KneLw0wfg40MgpBRW4kbAf1jJ+OLT8HXhTEhq834j4fYvDW552Sqqvj3yPEqKw7iNdbcFTq6FmH2RWB1m4VjqQ2RNZSAxnhSXLNVv7KSwwztKFKBL+xgQRVujlCTqsh79ESbMFHS9FeopnDm9Ru8rX0RhoxOA0q/yEAZv4D4r6WIPHJZ7sUSCqwkPQ7sc9gJvQtHBnaY8I/uW4cbaUiz1OfpwESGq1m8e/SrkHipEHQIg+aTgKOsYZnIj8UMZrKXsvKIQke8mOH27z8rIkmZPMZMYCNNgenX18wrKjLR9jSM8lYIQCwK99d8RCr9sFQJrFlszXlLfD4UfX8taNRwgvAniWMLWb9o6DeXGAoZDPyClCs4erWihd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PBUQyd7VyyEYRMx67GLyW3OX0hUR7ccwn0MaNbBcCpyK04gdJ9JebA79TlcLJKXBaFwclA== X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4112af17-d5b1-42cc-52ca-08db46ec367c X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2023 06:54:14.8106 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wpWSS460SVyGxpFhWvrvjfozXbYa5mnvMylB1/XxJ83pdMrIu4yQKa1qAkAr6J3wQeycsxwzRpZUsjusv9HInQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8707 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.8 at phobos.denx.de X-Virus-Status: Clean From: Stefan Herbrechtsmeier This reverts commit e09784728689de7949d4cdd559a9590e0bfcc702. The commit wrongly divides the dummy bytes by dummy bus width to calculate the dummy bytes. The framework already converts the dummy cycles to the number of bytes and the controller use the SPI flash command to determine the dummy cycles via the address width. Signed-off-by: Stefan Herbrechtsmeier Acked-by: Ashok Reddy Soma --- drivers/spi/zynq_qspi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c index 00e3ffcd1d..d1d4048966 100644 --- a/drivers/spi/zynq_qspi.c +++ b/drivers/spi/zynq_qspi.c @@ -676,7 +676,6 @@ static int zynq_qspi_exec_op(struct spi_slave *slave, const struct spi_mem_op *op) { int op_len, pos = 0, ret, i; - u32 dummy_bytes = 0; unsigned int flag = 0; const u8 *tx_buf = NULL; u8 *rx_buf = NULL; @@ -689,11 +688,6 @@ static int zynq_qspi_exec_op(struct spi_slave *slave, } op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes; - if (op->dummy.nbytes) { - op_len = op->cmd.nbytes + op->addr.nbytes + - op->dummy.nbytes / op->dummy.buswidth; - dummy_bytes = op->dummy.nbytes / op->dummy.buswidth; - } u8 op_buf[op_len]; @@ -707,8 +701,8 @@ static int zynq_qspi_exec_op(struct spi_slave *slave, pos += op->addr.nbytes; } - if (dummy_bytes) - memset(op_buf + pos, 0xff, dummy_bytes); + if (op->dummy.nbytes) + memset(op_buf + pos, 0xff, op->dummy.nbytes); /* 1st transfer: opcode + address + dummy cycles */ /* Make sure to set END bit if no tx or rx data messages follow */