Message ID | 20221116205308.2996556-15-msp@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp59013wrr; Wed, 16 Nov 2022 13:01:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VaLiuD+3rd3eo1qwk5w8hpN4EHeunN5pw0NmWBE5D3yZ5nn9049QLFg9hFjMxnvwELxTb X-Received: by 2002:a17:906:c284:b0:7a1:6786:444f with SMTP id r4-20020a170906c28400b007a16786444fmr19058261ejz.409.1668632486734; Wed, 16 Nov 2022 13:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668632486; cv=none; d=google.com; s=arc-20160816; b=07Eo7hGCQ5WqVsVarB9K+xNjFPhfz/sVJRNRTdFktYbYDJVooo96+10qFUdIx6bNvP LuZAwnGGtjg5G1OmrwrDyZeFdLrcZmuCIiSsCg8eMrKsSMPWhy2lmI6iaIWfLuJWp0SU DH3fclunRd1J2jrw3sPRROAklmoFu8sih91c/l5tWGJKhr7WY5g8sNSF4yGIJEzIAyT/ zDVBl005sDZSX9MnIm3cS5LTQNlGtoH8s1fcW1BIWHvulUcw/qzaETUZZ99homZwAQfT 8hfGrI0sD1ls/a01VxGTz2xp0aDkt2m3Nns3YfI/6avFsXvTbZ8klARxdyyLo3xagvIa vqQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YM61plGO68WaURjQUGMFYN3EyOhHGwttCZUHVzMzSmk=; b=iOiPHEAZ9v1FtKQAzwoMO164GcdgH+MBkity/L1k6eGxVh4qlb6y4HocRE/eCwKrli ABqIjLUjwmyYFuPrBc5tT9rjCZMNN3df+36roJe40CJa9sfWl5IFM4CJ2SXuvdKHDdKe NkX4d+bkqOZ41qTpZldkTqWANfgn5WFRyAo27xU3ih/Y3nKQNp8EUz/YetfNN6PrFTWt RkTfUdIwPNqiSR8Fp67kVPMzSHkWnZnlmwp8Kp8wxRt53T4eig0JySyr3c6GinRa/v0l RedaWMzGrYvMnbf8vC4vDIoxH4Kos5/zwT4KAZriy6dwENxDgIYWVTNbVu3Pyf2U50S4 KqSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=Ai+PNsCF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a170906840400b00779e6c93108si12659260ejx.598.2022.11.16.13.01.02; Wed, 16 Nov 2022 13:01:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=Ai+PNsCF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234019AbiKPU5V (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 15:57:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238685AbiKPUyB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 15:54:01 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E809FE5 for <linux-kernel@vger.kernel.org>; Wed, 16 Nov 2022 12:53:35 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id ft34so47069415ejc.12 for <linux-kernel@vger.kernel.org>; Wed, 16 Nov 2022 12:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YM61plGO68WaURjQUGMFYN3EyOhHGwttCZUHVzMzSmk=; b=Ai+PNsCF8RUwtUbnUOAUElOEHQCIBtfvFr4FFEPhc4TBV1LylFALavmdFCQF1QzYq/ qDLB9z/9yjs+tm0zJDPFsIHbvWfXxkuKo96Mw4ScW7PN57/EQlnKCQF3ks2yEEWGQS4M fOkPJMw5pzIgSHSJxAAN/m0vsKCwGMVMEeXP40tQCc2n8qnsGB+hhZa1DA4jL5zut82i 7bC2rKxw1gYmVP6CvdtAOEt2IjHSFaOJPPC4uXz5zk7Yf+apbdDgU6asT4dd1JJgsrsU hgu+opVs9duZiov5egbrN5iBHXVuLoqZhPNnLyLFx6oOgUWVE2t7GU+wFAKEtKmsFXq3 kPfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YM61plGO68WaURjQUGMFYN3EyOhHGwttCZUHVzMzSmk=; b=O1NKRm/zLJR1/GfQXrZFcyjwONuOCBJI80uRiM1kZkIs5guxIA3W1ukZJZ/E/UPxv9 TNXBDhA6MnWXGmUOKwfs3BKokPwwvvPxT/+gQAi8FX2WtwNygNeQx9GBd441myCvxQHy YUkLzUfS9dj+sSZMCp931OgUq3isw1wNiAjSxChXMdQNcqLXLh/B+/t4Qo/PG3kKRa5P A7Q0+iOlw3VpLlISvo9QllRalrAoBUWBz6o6NLOzStTUBr84L5oS9/yOol00E9ZQF0Vb 6Uj9jX5nu2jTUsMHRwb19x4ySwUUd0GOEylfwSPuk91/eHSf5514GK89sebT9GsfGNji yfCA== X-Gm-Message-State: ANoB5pkhlhp88yIYSAEZAQMghLyjp84sDKcukrW0VdA6C0aH2SuKx41m hai4ObDyhhCrEeWdyb8OO+UKo3uqHrN58A== X-Received: by 2002:a17:907:c78d:b0:7af:113a:7416 with SMTP id tz13-20020a170907c78d00b007af113a7416mr10052021ejc.16.1668632015148; Wed, 16 Nov 2022 12:53:35 -0800 (PST) Received: from blmsp.fritz.box ([2001:4090:a244:804b:353b:565:addf:3aa7]) by smtp.gmail.com with ESMTPSA id kv17-20020a17090778d100b007aece68483csm6782828ejc.193.2022.11.16.12.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 12:53:34 -0800 (PST) From: Markus Schneider-Pargmann <msp@baylibre.com> To: Chandrasekar Ramakrishnan <rcsekar@samsung.com>, Marc Kleine-Budde <mkl@pengutronix.de>, Wolfgang Grandegger <wg@grandegger.com> Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann <msp@baylibre.com> Subject: [PATCH 14/15] can: tcan4x5x: Fix register range of first block Date: Wed, 16 Nov 2022 21:53:07 +0100 Message-Id: <20221116205308.2996556-15-msp@baylibre.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116205308.2996556-1-msp@baylibre.com> References: <20221116205308.2996556-1-msp@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749687978243452344?= X-GMAIL-MSGID: =?utf-8?q?1749687978243452344?= |
Series |
can: m_can: Optimizations for tcan and peripheral chips
|
|
Commit Message
Markus Schneider-Pargmann
Nov. 16, 2022, 8:53 p.m. UTC
According to the datasheet 0x1c is the last register in the first block,
not register 0x2c.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
drivers/net/can/m_can/tcan4x5x-regmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 16.11.2022 21:53:07, Markus Schneider-Pargmann wrote: > According to the datasheet 0x1c is the last register in the first block, > not register 0x2c. The datasheet "SLLSF91A – DECEMBER 2018 – REVISED JANUARY 2020" says: | 8.6.1 Device ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to | 16'h002F While the last described register is at 0xc. Marc
Hi Marc, On Fri, Dec 02, 2022 at 03:28:10PM +0100, Marc Kleine-Budde wrote: > On 16.11.2022 21:53:07, Markus Schneider-Pargmann wrote: > > According to the datasheet 0x1c is the last register in the first block, > > not register 0x2c. > > The datasheet "SLLSF91A – DECEMBER 2018 – REVISED JANUARY 2020" says: > > | 8.6.1 Device ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to > | 16'h002F > > While the last described register is at 0xc. Sorry, not sure what I looked up here. The last described register is 0x10 SPI Error status mask in my datasheet: 'SLLSEZ5D – JANUARY 2018 – REVISED JUNE 2022' I would prefer using the actual registers if that is ok with you, so 0x10 here because I assume the remaining registers have internal use or maybe don't exist at all?! If there is an undocumented register that needs to be used at some point we can still modify the ranges. Also it seems the existing ranges are following the same logic and don't list the whole range, just the documented registers. The second range is wrong as well. The last register is 0x830, will fix. Best, Markus
On 05.12.2022 10:30:13, Markus Schneider-Pargmann wrote: > Hi Marc, > > On Fri, Dec 02, 2022 at 03:28:10PM +0100, Marc Kleine-Budde wrote: > > On 16.11.2022 21:53:07, Markus Schneider-Pargmann wrote: > > > According to the datasheet 0x1c is the last register in the first block, > > > not register 0x2c. > > > > The datasheet "SLLSF91A – DECEMBER 2018 – REVISED JANUARY 2020" says: > > > > | 8.6.1 Device ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to > > | 16'h002F > > > > While the last described register is at 0xc. > > Sorry, not sure what I looked up here. The last described register is > 0x10 SPI Error status mask in my datasheet: > 'SLLSEZ5D – JANUARY 2018 – REVISED JUNE 2022' The TCAN4550-Q1 variant has the 0x10 register documented, while the TCAN4550 (w/o -Q1) doesn't have. > I would prefer using the actual registers if that is ok with you, so > 0x10 here because I assume the remaining registers have internal use or > maybe don't exist at all?! If there is an undocumented register that > needs to be used at some point we can still modify the ranges. I'm fine with using 0x10 as the last register. > Also it seems the existing ranges are following the same logic and don't > list the whole range, just the documented registers. > > The second range is wrong as well. The last register is 0x830, will > fix. IIRC I used the register ranges from the section titles ("8.6.1 Device ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to 16'h002F") when I added the {wr,rd}_table. Marc
On Mon, Dec 05, 2022 at 10:44:58AM +0100, Marc Kleine-Budde wrote: > On 05.12.2022 10:30:13, Markus Schneider-Pargmann wrote: > > Hi Marc, > > > > On Fri, Dec 02, 2022 at 03:28:10PM +0100, Marc Kleine-Budde wrote: > > > On 16.11.2022 21:53:07, Markus Schneider-Pargmann wrote: > > > > According to the datasheet 0x1c is the last register in the first block, > > > > not register 0x2c. > > > > > > The datasheet "SLLSF91A – DECEMBER 2018 – REVISED JANUARY 2020" says: > > > > > > | 8.6.1 Device ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to > > > | 16'h002F > > > > > > While the last described register is at 0xc. > > > > Sorry, not sure what I looked up here. The last described register is > > 0x10 SPI Error status mask in my datasheet: > > 'SLLSEZ5D – JANUARY 2018 – REVISED JUNE 2022' > > The TCAN4550-Q1 variant has the 0x10 register documented, while the > TCAN4550 (w/o -Q1) doesn't have. Ah haven't noticed, thank you. > > > I would prefer using the actual registers if that is ok with you, so > > 0x10 here because I assume the remaining registers have internal use or > > maybe don't exist at all?! If there is an undocumented register that > > needs to be used at some point we can still modify the ranges. > > I'm fine with using 0x10 as the last register. > > > Also it seems the existing ranges are following the same logic and don't > > list the whole range, just the documented registers. > > > > The second range is wrong as well. The last register is 0x830, will > > fix. > > IIRC I used the register ranges from the section titles ("8.6.1 Device > ID and Interrupt/Diagnostic Flag Registers: 16'h0000 to 16'h002F") when > I added the {wr,rd}_table. The second range in the driver was specified as 0x800-0x83c in the driver. The last documented register is 0x830 in both normal and Q1 versions while the range in the title is 0x800-0x8ff. That's why I thought it was using the last register, just because it is closer. Anyways not really important. I can put in whatever you feel comfortable with or keep as it is. Thanks, Markus
diff --git a/drivers/net/can/m_can/tcan4x5x-regmap.c b/drivers/net/can/m_can/tcan4x5x-regmap.c index 26e212b8ca7a..d4b79d2d4598 100644 --- a/drivers/net/can/m_can/tcan4x5x-regmap.c +++ b/drivers/net/can/m_can/tcan4x5x-regmap.c @@ -91,7 +91,7 @@ static int tcan4x5x_regmap_read(void *context, } static const struct regmap_range tcan4x5x_reg_table_yes_range[] = { - regmap_reg_range(0x0000, 0x002c), /* Device ID and SPI Registers */ + regmap_reg_range(0x0000, 0x001c), /* Device ID and SPI Registers */ regmap_reg_range(0x0800, 0x083c), /* Device configuration registers and Interrupt Flags*/ regmap_reg_range(0x1000, 0x10fc), /* M_CAN */ regmap_reg_range(0x8000, 0x87fc), /* MRAM */