Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21371690ybl; Mon, 6 Jan 2020 03:20:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxMJtdZvyags5TSZRNNPk71qrIxIEqUYY1X4vwIxoB5s25+YS0tdCdG8EJqKNyOP+32d1va X-Received: by 2002:a05:6830:154c:: with SMTP id l12mr115060316otp.275.1578309627725; Mon, 06 Jan 2020 03:20:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578309627; cv=none; d=google.com; s=arc-20160816; b=d53EkUq8wKM6kBjBixnPtl4BTQbVkY6QAAfRCDXNMTWeLvsQG8Dq3IxOIRQtsYLxPT 6a/t+bjK3s13zKHkOggb56WNx59ovvFfBnadrygYHxcN3qR7VvxszIxRh3OxlMp0FGxs sA0dyuf1wko6Ds4SNS2q45KajgAb880VWdATWEBs/bJFnMg8nkYFLQyaKNWxDAdLND+W 3XTzIspME8KehPqc5DRaeD/O7WvoER6U3t0qPyidjpAxJjj56Ziu+vpsQx/c4k0m2I63 BeU4XJJzEHR2DtCP8jRRoZwck2x3FGKB2+lR9jN7SzvEW+hECAP8nKBdOx+MxS439mOl f6aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0FpPhsNBQUbJmNgnoo3ulrDao3YIof68l6WALeG/zl8=; b=poby4rnxI29/ebqfwaDGL5NE3HrXKENS+Em4yIzBjJH6pE/2lBqH6V9WAA7pAWoTlv jjqyROfjCJExUFyjrzblsSLYxXgF4Q63OR8tMPSq8KT4Jdmm/qgW1eCPI+mPXWcdUIgr Bruz0tgc4WOoo75fZmSaibOr/mqh5KytiubR7LDEisgHG4rl9EmnnkkZMcHQirvkU3sa WZPOqU1ArFEzKVj4mS4onAn/5ESAVCgl/OcCigQUZvYHNyUiEXf0ARsRFcKnNZyhZENn 6R8+t1ycj6Nx5M/f7kuXX9DsTs0v90Pva/HUqxlXPTSavWTk4xNIJZWqdQcoSLC46X3z 79kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si34949417otp.147.2020.01.06.03.20.15; Mon, 06 Jan 2020 03:20:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbgAFLTb (ORCPT + 99 others); Mon, 6 Jan 2020 06:19:31 -0500 Received: from mga14.intel.com ([192.55.52.115]:23966 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgAFLTb (ORCPT ); Mon, 6 Jan 2020 06:19:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 03:19:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,402,1571727600"; d="scan'208";a="232798628" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 06 Jan 2020 03:19:31 -0800 Received: from [10.226.38.20] (unknown [10.226.38.20]) by linux.intel.com (Postfix) with ESMTP id 2907E580297; Mon, 6 Jan 2020 03:19:28 -0800 (PST) Subject: Re: [PATCH v6 2/2] spi: cadence-quadpsi: Add support for the Cadence QSPI controller To: Vignesh Raghavendra , broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: robh+dt@kernel.org, dan.carpenter@oracle.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com References: <20191230074102.50982-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20191230074102.50982-3-vadivel.muruganx.ramuthevar@linux.intel.com> From: "Ramuthevar, Vadivel MuruganX" Message-ID: <66b9f427-83c2-f56c-3d38-fa955429118d@linux.intel.com> Date: Mon, 6 Jan 2020 19:19:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thank you for the review comments. On 6/1/2020 6:40 PM, Vignesh Raghavendra wrote: > Hi, > > On 30/12/19 1:11 pm, Ramuthevar,Vadivel MuruganX wrote: > [...] >> +static u32 cqspi_cmd2addr(const unsigned char *addr_buf, u32 addr_width) >> +{ >> + unsigned int addr = 0; >> + int i; >> + >> + /* Invalid address return zero. */ >> + if (addr_width > 4) >> + return 0; >> + >> + for (i = 0; i < addr_width; i++) { >> + addr = addr << 8; >> + addr |= addr_buf[i]; >> + } >> + >> + return addr; >> +} >> + > [...] >> +static int cqspi_apb_read_setup(struct struct_cqspi *cqspi, >> + const struct spi_mem_op *op, >> + const u8 *addrbuf) >> +{ >> + void __iomem *reg_base = cqspi->iobase; >> + size_t addrlen = op->addr.nbytes; >> + size_t dummy_bytes = op->dummy.nbytes; >> + unsigned int addr_value, dummy_clk, reg; >> + >> + if (addrlen) { >> + addr_value = cqspi_cmd2addr(&addrbuf[0], addrlen); >> + writel(addr_value, reg_base + CQSPI_REG_INDIRECTRDSTARTADDR); >> + } >> + > Why do you need to swap the address bytes to SPI bus order? Yes , you are right to align with spi bus order swap is done . > You are > writing to a controller register that accepts 24 bit or 32 bit address. 32bit address. >> + reg = op->cmd.opcode << CQSPI_REG_RD_INSTR_OPCODE_LSB; >> + reg |= (op->data.buswidth & CQSPI_REG_RD_INSTR_TYPE_DATA_MASK) << >> + CQSPI_REG_RD_INSTR_TYPE_DATA_LSB; >> + > This is wrong... op->data.buswidth's range is 1 to 8 whereas > CQSPI_REG_RD_INSTR_TYPE range is 0 to 3. I wonder whether you tested > dual/quad mode with this driver? Yes I have tested with Quad mode since Cadence-IP supports dual/quad on my platform, used to validate before sending the patch that's  standard procedure here. please let me know if you have any further queries. --- Best Regards Vadivel > I am still unable to get this series to work on my platform. Will > continue to debug... >