From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5E56C433ED for ; Fri, 7 May 2021 12:31:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0EAE661041 for ; Fri, 7 May 2021 12:31:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EAE661041 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=baolUSVF/onKSyDKZ9Zr6jYvRH4VNaMuixHbtKQDB1A=; b=Zsuv8B9FH6Y1rfZdEG8D0+hN8 oRmi3ddmQ71Js8qq6U69UFbr9NrQiq76+bk4CsBfpO28kI1RENkOEkTi+4kYBnrmJCrNxf/iSvohX 8y5D8G8pfr0OsKLokbBGt8LSLzeLDvCjrRbdlws37n8ztlGJTCFZAobv9Ci3Ts28gaTmqBFUHDpu9 ORPiKrw2Vv+Nm/V083BP3P/pSBnFuA81T++QNv8eewvl3BQOYJ8/XRsnLKiH3jXJY/bSFkD+mF9O1 0hDOa/A+eDvtuXZWkwHJo5oRuAG6YW3phLtmzcrpnQOhwHi6bTOhT0uP9nBg9UtbqBAnRi3iznxeG K63hS1HrA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lezcH-0073If-Lq; Fri, 07 May 2021 12:30:01 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lezcF-0073Ia-2M for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 12:29:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:CC:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=jII+K+gNDTx+89b4wj12HRtrpKjsgBKJ3myLEsIFnbg=; b=SOwaNulo9VPMw+3Vg1eAtDHMk7 uIs60BXz6LfATBKVP3tlmSxT1+cmuCbiSWaUo9Faubr3JFtT2NScpjQATLCYqoXYUIS1P16VdyBrz DUJAbcJwIqhnby2mMiPBjQJ+YgnVeU9WX0cFWV08Kwp9vHluStoYRGIQWgEIRfBDTNfGaoDAEDDqe yjLPOIAAoj0zqh9WKiTy204pbecCe/kYVrXxc9bzkJWkJBtxQSuyfotXFw3scXc3we7mMhgSG7wtc z0ERCGmj1K87LYdnRsfo5QZjC6W9cbnKf1s3GgpXJD6vs9z2D8FI1EY3xB6xWjbfdQh8+U5gg8d8k KdSYwffg==; Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lezcA-006qnr-N8 for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 12:29:56 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 147CRH1T009277; Fri, 7 May 2021 14:29:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=jII+K+gNDTx+89b4wj12HRtrpKjsgBKJ3myLEsIFnbg=; b=JkLZmEhrSmvkUYlXI4kkl9wE/bqTpzVGvQzo1u2GdrODbjcilgcS6uHa+fFUYvaLy85l NYGYvte9tsZ/C/UcClxjyig+NOtwuJMmLqFBA1KHHEKCxPLecqwO5ZHUmPhGEmq6U8g4 5WYPZjLqhVWt5ZLOgdmEfuzeQ30cLINu5gJaoozKNVDkMz/nCNlxcAdhRcP+ZYh5dfXu myNzx3ny1pbL0dLkoapCaZ4hUD04okH7N8I0kn6BsDQ7YJMLHnNMdAYjqr/dSqukcg28 zrzMGxqcHpBJyhpvKYF0Ghg9LgF74JAUnJ6I9VquT03EiYv4hlYNCysQV1DsaYAQKLmH qg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 38csqbux09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 May 2021 14:29:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D711810002A; Fri, 7 May 2021 14:29:39 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C02C7221050; Fri, 7 May 2021 14:29:39 +0200 (CEST) Received: from lmecxl0573.lme.st.com (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 14:29:38 +0200 Subject: Re: [Linux-stm32] [PATCH v4 4/4] i2c: stm32f4: Fix stmpe811 get xyz data timeout issue To: dillon min , Wolfram Sang , , CC: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Maxime Coquelin , Alexandre TORGUE , , Linux Kernel Mailing List , Philippe Schenker , Rob Herring , , , , Linux ARM , Alexandre Torgue References: <1591709203-12106-1-git-send-email-dillon.minfei@gmail.com> <1591709203-12106-5-git-send-email-dillon.minfei@gmail.com> <20210315130050.GD1182@ninjato> From: Patrice CHOTARD Message-ID: Date: Fri, 7 May 2021 14:29:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-07_04:2021-05-06, 2021-05-07 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_052955_258339_348F929A X-CRM114-Status: GOOD ( 27.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dillon In order to test this patch, it's tricky to make a recent kernel running on stm32f429-disco as this board embeds only 8MB of SDRAM and 2MB of flash. Can you indicates us which kernel version you are using and also the kernel config please ? Thanks Patrice On 5/7/21 4:54 AM, dillon min wrote: > Hi Pierre-Yves, Alain > > Could you help to take a look? > i really appreciate it. > > Thanks, > > Best Regards > Dillon > > On Mon, Mar 15, 2021 at 9:00 PM Wolfram Sang wrote: >> >> On Mon, Mar 15, 2021 at 08:43:54PM +0800, dillon min wrote: >>> Hi All, >>> >>> Just a gentle ping. >> >> Pierre-Yves? >> >>> >>> Regards. >>> >>> On Tue, Jun 9, 2020 at 9:27 PM wrote: >>>> >>>> From: dillon min >>>> >>>> as stm32f429's internal flash is 2Mbytes and compiled kernel >>>> image bigger than 2Mbytes, so we have to load kernel image >>>> to sdram on stm32f429-disco board which has 8Mbytes sdram space. >>>> >>>> based on above context, as you knows kernel running on external >>>> sdram is more slower than internal flash. besides, we need read 4 >>>> bytes to get touch screen xyz(x, y, pressure) coordinate data in >>>> stmpe811 interrupt. >>>> >>>> so, in stm32f4_i2c_handle_rx_done, as i2c read slower than running >>>> in xip mode, have to adjust 'STOP/START bit set position' from last >>>> two bytes to last one bytes. else, will get i2c timeout in reading >>>> touch screen coordinate. >>>> >>>> to not take side effect, introduce IIC_LAST_BYTE_POS to support xip >>>> kernel or has mmu platform. >>>> >>>> Signed-off-by: dillon min >>>> --- >>>> >>>> V4: indroduce 'IIC_LAST_BYTE_POS' to compatible with xipkernel boot >>>> >>>> drivers/i2c/busses/i2c-stm32f4.c | 12 +++++++++--- >>>> 1 file changed, 9 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c >>>> index d6a69dfcac3f..97cf42ae7fa0 100644 >>>> --- a/drivers/i2c/busses/i2c-stm32f4.c >>>> +++ b/drivers/i2c/busses/i2c-stm32f4.c >>>> @@ -93,6 +93,12 @@ >>>> #define STM32F4_I2C_MAX_FREQ 46U >>>> #define HZ_TO_MHZ 1000000 >>>> >>>> +#if !defined(CONFIG_MMU) && !defined(CONFIG_XIP_KERNEL) >>>> +#define IIC_LAST_BYTE_POS 1 >>>> +#else >>>> +#define IIC_LAST_BYTE_POS 2 >>>> +#endif >>>> + >>>> /** >>>> * struct stm32f4_i2c_msg - client specific data >>>> * @addr: 8-bit slave addr, including r/w bit >>>> @@ -439,7 +445,7 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev) >>>> int i; >>>> >>>> switch (msg->count) { >>>> - case 2: >>>> + case IIC_LAST_BYTE_POS: >>>> /* >>>> * In order to correctly send the Stop or Repeated Start >>>> * condition on the I2C bus, the STOP/START bit has to be set >>>> @@ -454,7 +460,7 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev) >>>> else >>>> stm32f4_i2c_set_bits(reg, STM32F4_I2C_CR1_START); >>>> >>>> - for (i = 2; i > 0; i--) >>>> + for (i = IIC_LAST_BYTE_POS; i > 0; i--) >>>> stm32f4_i2c_read_msg(i2c_dev); >>>> >>>> reg = i2c_dev->base + STM32F4_I2C_CR2; >>>> @@ -463,7 +469,7 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev) >>>> >>>> complete(&i2c_dev->complete); >>>> break; >>>> - case 3: >>>> + case (IIC_LAST_BYTE_POS+1): >>>> /* >>>> * In order to correctly generate the NACK pulse after the last >>>> * received data byte, we have to enable NACK before reading N-2 >>>> -- >>>> 2.7.4 >>>> > _______________________________________________ > Linux-stm32 mailing list > Linux-stm32@st-md-mailman.stormreply.com > https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel