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 9859FC4332F for ; Wed, 14 Dec 2022 06:42:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7583F84FBE; Wed, 14 Dec 2022 07:42:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.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=ti.com header.i=@ti.com header.b="Qd+gmmqv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4690684FBF; Wed, 14 Dec 2022 07:42:52 +0100 (CET) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 76D0984F6B for ; Wed, 14 Dec 2022 07:42:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=d-gole@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2BE6gh8Z087360; Wed, 14 Dec 2022 00:42:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1671000163; bh=n5RMvnEZUH8MBVC/oU54ElSbWEkzsA4CFrq7/sXdd40=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Qd+gmmqvnrctom9C0hT5w5MrwWSwg1ezErMYBGNf9bQxu3HtBDeFsIsYqVSxAaqvY l2hYQQu7/A4DA52dguCgqGQhuwYra/KmzKrHC2SHTRVwNDAvy45LZlnLiZERY2CzfX gz78wKiHxRyXpEkze8x+anyHmHjEPcAkbLmAOPRg= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2BE6ghL3082623 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Dec 2022 00:42:43 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 14 Dec 2022 00:42:42 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Wed, 14 Dec 2022 00:42:42 -0600 Received: from [10.24.69.26] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2BE6gepi062677; Wed, 14 Dec 2022 00:42:41 -0600 Message-ID: <461b6db1-72ca-f48d-e4fe-5bd3acbaf934@ti.com> Date: Wed, 14 Dec 2022 12:12:40 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH V3 2/2] spi: cadence_qspi: use STIG mode for small reads Content-Language: en-US To: Pratyush Yadav CC: Tom Rini , Vignesh , , References: <20221125055932.398322-1-d-gole@ti.com> <20221125055932.398322-3-d-gole@ti.com> <20221212233517.wiymfyzvmf2wss5v@yadavpratyush.com> From: Dhruva Gole In-Reply-To: <20221212233517.wiymfyzvmf2wss5v@yadavpratyush.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 Hey Pratyush, Thanks for reviewing. On 13/12/22 05:05, Pratyush Yadav wrote: > On 25/11/22 11:29AM, Dhruva Gole wrote: >> Fix the issue where some flash chips like cypress S25HS256T return the >> value of the same register over and over in DAC mode. >> >> For example in the TI K3-AM62x Processors refer [0] Technical Reference > > I know where to find the useful information in this 12 thousand page > long document since I used to work at TI. But other people might not > find it so easy. It would be good to point to specific section numbers I will try to be more specific about section numbers in future, however since this fix applies across any SoC's out there I thought not to go into too much detail just for AM625. I feared it may send a wrong message that this fix is ONLY and ONLY relevant to AM62x which might not necessarily be the case. Also, I have mentioned further below about it being "part of the Flash Subsystem (FSS)". Hence in my humble opinion should be enough to point which section to look into, but if someone really wanted to deep dive and see for themselves they still could go through the FSS part of the TRM. > here to make this easier to understand and review. Also, this document > does not contain the register map for the CQSPI controller. You should > link that too. I believe that it does have the reg map for OSPI. Kindly refer to FSS_OSPI_0_config_reg and onwards, (Addresses 0FC4 0000h onwards) It's under 12.4.6 Memory Interfaces Registers: FSS_OSPI_0 Registers I am on revision: SPRUIV7A – MAY 2022 – REVISED NOVEMBER 2022 > >> Manual there is a layer of digital logic in front of the QSPI/OSPI >> Drive when used in DAC mode. This is part of the Flash Subsystem (FSS) >> which provides access to external Flash devices. This operates by >> default in a 32 bit mode causing it to always align all data to 4 bytes > > Is this new in AM62x? I do not remember seeing this on J7 class devices. > I remember being able to read all registers from Cypress S28 flash > without having to do anything special. Taking a look at FSS0_0_SYSCONFIG Register (Offset = 4h) [reset = 0h ] The Table 12-2293. SYSCONFIG Register Field Descriptions tells us, OSPI_32B_DISABLE_MODE: Reset value = 0 and this means, 0: OSPI 32bit mode enabled by default, So rather than complicating things to enable/ disable 32 bit mode all around, this fix should avoid major restructuring. > [...] >> + if (!op->addr.nbytes || >> + op->data.nbytes < CQSPI_STIG_DATA_LEN_MAX) > > <= instead? This would be fine too, just wanted to ensure we enter this condition for small reads only. Registers are generally only 32 bit long (4Bytes) and CQSPI_STIG_DATA_LEN_MAX is 8Bytes so it's anyway more than a register read would really need. > >> mode = CQSPI_STIG_READ; >> else >> mode = CQSPI_READ; >> -- >> 2.25.1 >> > -- Thanks and Regards, Dhruva Gole