From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756883AbbLWMdk (ORCPT ); Wed, 23 Dec 2015 07:33:40 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:22111 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbbLWMdh (ORCPT ); Wed, 23 Dec 2015 07:33:37 -0500 Date: Wed, 23 Dec 2015 20:29:52 +0800 From: Jisheng Zhang To: Mark Brown CC: , Subject: Re: [RFC] spi: dw: support setting tmode dynamically Message-ID: <20151223202952.28be5bab@xhacker> In-Reply-To: <20151223121512.GV16023@sirena.org.uk> References: <20151223192338.128e95a4@xhacker> <20151223121512.GV16023@sirena.org.uk> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-23_10:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310008 definitions=main-1512230193 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mark, On Wed, 23 Dec 2015 12:15:12 +0000 Mark Brown wrote: > On Wed, Dec 23, 2015 at 07:23:38PM +0800, Jisheng Zhang wrote: > > > Currently the spi-dw tmode is fixed to SPI_TMOD_TR if cs_control is NULL, but we > > need to set it as SPI_TMOD_EPROMREAD to read nor flash, my solution is to add and > > export one functions to set the tmode, then the nor flash driver call it > > before reading and set back to SPI_TMOD_TR after done. > > What does this mean - what is TMOD and why do we need to set it to read > NOR flash? I've no information on this controller... TMOD is one field of DW_SPI_CTRL0. Its available value could be: 0: Transmit and Receive 1: Transmit only 2: Receive only 3: EEPROM Read If the one spi nor flash is connected to the SPI host, so far I can only succeed to read the nor flash content after setting the TMOD field as 3. Thanks, Jisheng