Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8948079rwb; Thu, 24 Nov 2022 06:17:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf43fjidlk17rdzLxw4/5HXf1/Uic9bN8oZCkl7BueUHQOZZibOQhTSUCSvvbPGbKmA+MX7u X-Received: by 2002:aa7:8115:0:b0:571:f667:4d85 with SMTP id b21-20020aa78115000000b00571f6674d85mr18081600pfi.70.1669299437830; Thu, 24 Nov 2022 06:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669299437; cv=none; d=google.com; s=arc-20160816; b=bTLJXDl3wwmHU4haY58wNGuICoUPIDHADCLluanf4yvjGNA4C0EtwAY/sBmRi5J6YH 6wQRO+8BZQbQrPjvVEKbymJjFBxf3tWtDPUe5GViNFGVHMjrQNkFGVgwWbPUaiau7Gvh eDrgJ5ez7pkE/X3DLMV5RERMno/qNS0lNhweDpdcVs8wmd//Y3cte4t+qSEKfXoxtxf/ 23tjpHCQ5sK4Ayc7J/S3bOBojfZnwM3BZmXAlwk/Ewk8nnY5CORogkqP+SipQ9g6OrUl 53acOes/eShzfDWmRXVRDVaQovRkz+c//8w3b/rFDt2OWNYz+u6Xp3M80qTMRT5NeRF0 XGcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Vs9L6vGU7gC9jaDFCTKoT90tKFWWGxX97DU2d9lHvF4=; b=YIvLOWgNm23Zs3R+/A3/vudqsifhPbZUrlrDUzkBlp7Q4JTqnzM/G/1Y7klh2A5ZKM eB/A5Rb91DKUDndPl7Tgug0VYbKiJqh9rwtYqJdCaPN5+WAZSI/+8LSq77gFGTLDkUUv E2E0qHkAUEX0c0N3bLR3AqCEIiMdR/kRwlHaRdpB7U5I26XdXWgEe/GoR51FbwRccoKb LhlD08vDLuIUt1Kpc7MXfOY+EV4oNq6ZGrVVMgSyZHLagMArQIq0cuIKmfZBLvfOo1sM PPKuvIJwuaQ+DcGBjMixdf/rtW+a97MBeeDxLxLNovGAmDqs5+wVyY3T+kAOhG2JKNKS uiEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d19D0fF+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638b49000000b0046b3ba2c806si549385pge.145.2022.11.24.06.17.06; Thu, 24 Nov 2022 06:17:17 -0800 (PST) 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=@linaro.org header.s=google header.b=d19D0fF+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbiKXNgx (ORCPT + 86 others); Thu, 24 Nov 2022 08:36:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiKXNgw (ORCPT ); Thu, 24 Nov 2022 08:36:52 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057F96E552 for ; Thu, 24 Nov 2022 05:36:51 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id x21so1996144ljg.10 for ; Thu, 24 Nov 2022 05:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Vs9L6vGU7gC9jaDFCTKoT90tKFWWGxX97DU2d9lHvF4=; b=d19D0fF+coPGhp8VVzw2altAjkhl/3oiBDfric6mOBmWmj87Pr9zJM3PGTekhD4sVt wFuj7kgQTet2qXYdXMRmPesUdIEJ0JsEVgcD+XCMFp0f8OXbShyiex8jAJ0a2igFi5fu TPQRHCg4eMdv5tXuoljajuukZ2/cQ2Jff4PonTZMrviDZ7fs65BOMKvaHrMcJp9Iq0tP v8UXM9n7u42WRUN4C4+C0Wx9cvefTWZ3wyVnYQeMEninGQId9i1yf9XD/FTwTbfeXSuh ow9tIMUjgfDMqWvtu6JLLqZbXmhNEjCeA4JbVVbExpxpU1NM64DdPMTV/7AlgXhXeN5h Wi5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Vs9L6vGU7gC9jaDFCTKoT90tKFWWGxX97DU2d9lHvF4=; b=zSZcMN31yPTO8yoDsMJKwpl0JUyykTr4e+P47FdnNAJidD26caRMb8Ax0I0YZP9PNW glgCIVKTB3A6AOSKJ90v14tLwgLTK6Lh5sypzhzRLRfqt/DNNw5UEBCtBuA5fkBXWGzp YYkci93qUzKpgeyNJHqwk/kOxf9R6mGzv2YXRHnQ7k5TC9DcCqXAua4GH3luozn+6lDo E9Qm0skRV6Ola2UYYJ1pQHkb+ijprVd7ETGoOgkkjIjdo7+pgk0hlMoXkdAMP/rENLgK IylsUD5a6ISwfnP0Tz+odCYJMGByC+/TrgXIdZsJiSz68x8gvneEEudYbF0lY2mNhEGk dC+Q== X-Gm-Message-State: ANoB5pm83ebAO/evG/t5GVSxC73dadIF9iz66Ebc1QmJb9Vq8wrY1szu Y56qYbdf6gDVe+Oz8vync0txjQ== X-Received: by 2002:a2e:a988:0:b0:276:de0b:ce2d with SMTP id x8-20020a2ea988000000b00276de0bce2dmr4270430ljq.212.1669297009323; Thu, 24 Nov 2022 05:36:49 -0800 (PST) Received: from [192.168.0.20] (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id q21-20020a0565123a9500b0049936272173sm123058lfu.204.2022.11.24.05.36.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Nov 2022 05:36:48 -0800 (PST) Message-ID: <93cc4e4b-4135-8a1f-c7b4-62c5da87bd8b@linaro.org> Date: Thu, 24 Nov 2022 14:36:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v1 2/2] memory: renesas-rpc-if: Add Octal DTR mode support Content-Language: en-US To: JaimeLiao , broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jaimeliao@mxic.com.tw References: <20221124073957.22471-1-jaimeliao.tw@gmail.com> <20221124073957.22471-3-jaimeliao.tw@gmail.com> From: Krzysztof Kozlowski In-Reply-To: <20221124073957.22471-3-jaimeliao.tw@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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 24/11/2022 08:39, JaimeLiao wrote: > 1. Support Octal DTR manual mode (Program & Erase & register) > 2. Support diramap read (enable external address space read mode) If these are two separate features, you need two separate commits. > > Signed-off-by: JaimeLiao > --- > drivers/memory/renesas-rpc-if.c | 56 +++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > > diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c > index bdf0a7f68ff2..db5019a7190e 100644 > --- a/drivers/memory/renesas-rpc-if.c > +++ b/drivers/memory/renesas-rpc-if.c > @@ -462,6 +462,43 @@ void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs, > > rpc->enable |= RPCIF_SMENR_SPIDB(rpcif_bit_size(op->data.buswidth)); > } > + /* Fixup in Octal DTR mode */ > + if (op->cmd.buswidth == 8 && op->cmd.ddr) { > + rpc->bus_size = 2; > + > + regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, > + RPCIF_PHYCNT_OCTA(0x2) | RPCIF_PHYCNT_OCT | > + RPCIF_PHYCNT_PHYMEM(0x1) , > + RPCIF_PHYCNT_OCTA(0x2) | RPCIF_PHYCNT_OCT | > + RPCIF_PHYCNT_PHYMEM(0x1)); > + regmap_update_bits(rpc->regmap, RPCIF_CMNCR, RPCIF_CMNCR_BSZ(1), > + RPCIF_CMNCR_BSZ(1)); > + > + regmap_update_bits(rpc->regmap, RPCIF_PHYOFFSET1, > + RPCIF_PHYOFFSET1_DDRTMG(3), > + RPCIF_PHYOFFSET1_DDRTMG(2)); > + regmap_update_bits(rpc->regmap, RPCIF_PHYOFFSET2, > + RPCIF_PHYOFFSET2_OCTTMG(7), > + RPCIF_PHYOFFSET2_OCTTMG(3)); > + > + if (op->ocmd.buswidth == 8 && RPCIF_SMENR_OCDE) > + rpc->enable &= ~RPCIF_SMENR_OCDE; > + > + if (op->addr.ddr) > + rpc->enable &= ~RPCIF_SMENR_ADE(0xF) | > + RPCIF_SMENR_ADE(0xc); > + > + if (op->dummy.buswidth == 8) > + rpc->dummy = > + RPCIF_SMDMCR_DMCYC(op->dummy.ncycles / 2); > + > + if (op->data.dir == RPCIF_DATA_IN) > + /* Set Extenal Address space Read mode */ > + if (op->data.buswidth == 8 && op->data.ddr) { > + regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, > + RPCIF_PHYCNT_EXDS, RPCIF_PHYCNT_EXDS); > + } Wrap it in {}. It's quite error-prone in such syntax. Best regards, Krzysztof