Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21339274ybl; Mon, 6 Jan 2020 02:41:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyFOs4fr50HkXXFS1Tj992138i7uohV2FoapFcvBzDHbXQYcBL+nF0WXxleHaJFOAQ1laCS X-Received: by 2002:a9d:65cf:: with SMTP id z15mr118681252oth.238.1578307284912; Mon, 06 Jan 2020 02:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578307284; cv=none; d=google.com; s=arc-20160816; b=qJMPBpdsdvpET0d2rfIMmsgshhXuQDWCwft5/f4vWYC1zhE907B8igFAwZdzBPY14m Zyfn3tE2u3Jzmxwk+W0XJeiEQnXP+V0PghRvq/ubPMs3MR2cHJam+y8JmlE2FyIib+2f hW5i8aEtd9HrKBnZAMQB5/qsS4mzPoYiExBz6JwxUnXyliCS53MeRl8rYVJS7V6M8uZd nnmiaMi1XfTOTx6nJQvFf5KlUljQ8wqk9PD9XnW+W0xiNzJz9cr2aMKHfQlgw8WLDv9k kCAhdIC0MWAYbT1uhqQrtE4r8mPoO4mYLyPpIMhXX4kMSStnL6OJWxujv3GM2z3xAWfc 51rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=8c6+nL0sjGE+mUP74dPaw6GeeVNGbaLFurAs3499j/I=; b=cf8MbrrRCUIo2f2T8+kIkEuqwkwMT89NUVcX7Mle3upRczRDrvXrshzqYb6YUO/RF0 D3xf5RpPkADUd5rD+/Fwh0W/AN0HVBDq4A9P+1sJD6ediy4DGVEsBpm5BNt0TfA9XgqU 1kLd9c0Cmal8uO22RlGa5wHrh7ISyZbpwljXbd502SEsD99/Bkdlv3/p0juNzmrmSFL2 P1RRNzr4RPgCNNDZf6dRuPZD+y2hThx2lHe0xIxg5zerHbFc/kpOf7eRNAOcgphaDYWx /xX5ZuA6jaacViwQD/Xsh8zXnAyr3SnRsftm9hjkOHV/xgp+G6poU0dKL0r+xQYpFWDC pJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BfyEGs4v; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f190si33059921oig.229.2020.01.06.02.41.12; Mon, 06 Jan 2020 02:41:24 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BfyEGs4v; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726358AbgAFKkR (ORCPT + 99 others); Mon, 6 Jan 2020 05:40:17 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:57190 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbgAFKkR (ORCPT ); Mon, 6 Jan 2020 05:40:17 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 006Ae926063647; Mon, 6 Jan 2020 04:40:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1578307209; bh=8c6+nL0sjGE+mUP74dPaw6GeeVNGbaLFurAs3499j/I=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=BfyEGs4vO6I/tb+2dG0m5Y826jIxvx1JS/nESh2b2osjlfLZJ1Xo49deXS31sPS9P xx8h47hhrfyNUqPl11uLdDpfmf2fnUJ/JTrM5kq52sXQJ72fLDoFPkN1VNWnCgZlv2 bruqcfsapbOaVO2zZWxSuSUBm8GGQzx0BQNO1vE4= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 006Ae9mZ031981 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 6 Jan 2020 04:40:09 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 6 Jan 2020 04:40:09 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 6 Jan 2020 04:40:09 -0600 Received: from [172.24.145.136] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 006Ae6DC025983; Mon, 6 Jan 2020 04:40:06 -0600 Subject: Re: [PATCH v6 2/2] spi: cadence-quadpsi: Add support for the Cadence QSPI controller To: "Ramuthevar,Vadivel MuruganX" , , , CC: , , , References: <20191230074102.50982-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20191230074102.50982-3-vadivel.muruganx.ramuthevar@linux.intel.com> From: Vignesh Raghavendra X-Enigmail-Draft-Status: N11100 Message-ID: Date: Mon, 6 Jan 2020 16:10:39 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191230074102.50982-3-vadivel.muruganx.ramuthevar@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? You are writing to a controller register that accepts 24 bit or 32 bit 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? I am still unable to get this series to work on my platform. Will continue to debug... -- Regards Vignesh