From patchwork Sat May 6 14:17:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 90761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1085149vqo; Sat, 6 May 2023 07:25:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HhqlKrcJ160rHXBIZ7eFV8OdJAzHpaekKTFchKxN2uZtf3bzl+ZqJUx8UKYeLn4Ub4PQg X-Received: by 2002:a17:902:7402:b0:1a9:7a7c:2086 with SMTP id g2-20020a170902740200b001a97a7c2086mr4563704pll.27.1683383100620; Sat, 06 May 2023 07:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683383100; cv=none; d=google.com; s=arc-20160816; b=X+51xl1HLWYVqtPgsCcHSYBAJ5pfTP1mdOjNRhbvRj7HAmwscdf5z7CWobVZHlNVPl DlA8wAwr0GLOVsfa0TqU7lbGa0Xqd+z7HM4pyUICdNq4jbYC6fFPsAS6jmj8O7nTiJyg dHA1xOBip8PN+aYcVpew8t7P7yR6Y0ufXLGBYOOcQ3UsO3amwGPzl5XHE8xKDmyWAAQt PbrPKoqHCM9B9tUa7WaRBA302L4pb5rG9OKSd+iG9bpKb0vaADOP4RzgzIdEEDG54cPt 2DEVYzDUaa+gxblxnRxxJJOUVbaTiPiIKUOY6JoGAYAIIOx+YCYzVr8kwlOfPf03+f5R PYng== 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; bh=VchaOpwfjpkU/eTq/AyqsvTzN+pJ9XHTrtq1yMhUouA=; b=dOwYNawoKFb/WBEJBsYHr1uaHgzHV41sDbN7AnX9PxBBx8nRktxI8d8VypuggrXfP0 h1Ou2qUjdxirTs5EImX0aFmkLl7GLTaOcUrCUnPOHm0fUVmpNLGN0lD9nAmMjnLhnb+D +aAAptBbCdRvvrVnWE55YLs2KqOLFxnKjkQT4rsrFqFdjGm0SVuFDAexJIXKU84TDxg1 ESg6aa5xULRS0ocVxxjYf/E7B46nQIwIeuwrKbB6IUURMCi0QG0Vs845Dz/LpLriOgAo wfD9zTuHG5C/+3tUvLtuzbY9KWy5i5iJ0QVhCT6VvQ1DM7jvWYWs67PGtvyHRV5/fdyF IB3w== ARC-Authentication-Results: i=1; mx.google.com; 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 iw19-20020a170903045300b001a9b4bda723si3758388plb.421.2023.05.06.07.24.45; Sat, 06 May 2023 07:25:00 -0700 (PDT) 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; 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 S232860AbjEFORx (ORCPT + 99 others); Sat, 6 May 2023 10:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbjEFORt (ORCPT ); Sat, 6 May 2023 10:17:49 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020E319D47; Sat, 6 May 2023 07:17:39 -0700 (PDT) Received: (Authenticated sender: contact@artur-rojek.eu) by mail.gandi.net (Postfix) with ESMTPSA id 07AB420002; Sat, 6 May 2023 14:17:36 +0000 (UTC) From: Artur Rojek To: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz Cc: Rafael Ignacio Zurita , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek Subject: [PATCH 1/2] sh: dma: fix `dmaor_read_reg`/`dmaor_write_reg` macros Date: Sat, 6 May 2023 16:17:02 +0200 Message-Id: <20230506141703.65605-2-contact@artur-rojek.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230506141703.65605-1-contact@artur-rojek.eu> References: <20230506141703.65605-1-contact@artur-rojek.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765155118385429686?= X-GMAIL-MSGID: =?utf-8?q?1765155118385429686?= Squash two bugs introduced into said macros in 7f47c7189b3e, preventing them from proper operation: 1) Add DMAOR register offset into the address of the hw reg access, 2) Correct a nasty typo in the DMAOR base calculation for `dmaor_write_reg`. Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz --- arch/sh/drivers/dma/dma-sh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c index 96c626c2cd0a..14c18ebda400 100644 --- a/arch/sh/drivers/dma/dma-sh.c +++ b/arch/sh/drivers/dma/dma-sh.c @@ -254,8 +254,11 @@ static int sh_dmac_get_dma_residue(struct dma_channel *chan) * DMAOR bases are broken out amongst channel groups. DMAOR0 manages * channels 0 - 5, DMAOR1 6 - 11 (optional). */ -#define dmaor_read_reg(n) __raw_readw(dma_find_base((n)*6)) -#define dmaor_write_reg(n, data) __raw_writew(data, dma_find_base(n)*6) +#define dmaor_read_reg(n) __raw_readw(dma_find_base((n) * 6) + \ + DMAOR) +#define dmaor_write_reg(n, data) __raw_writew(data, \ + dma_find_base((n) * 6) + \ + DMAOR) static inline int dmaor_reset(int no) { From patchwork Sat May 6 14:17:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 90762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1085621vqo; Sat, 6 May 2023 07:26:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69SVDWTj4wso0Y8nfR4elynrBd/x92vGtPJYsMUWb/vHKFEB+/63UZ9WywZPTqC3vHgDSv X-Received: by 2002:a17:90b:2250:b0:24d:e123:1eb2 with SMTP id hk16-20020a17090b225000b0024de1231eb2mr4956515pjb.37.1683383167191; Sat, 06 May 2023 07:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683383167; cv=none; d=google.com; s=arc-20160816; b=XM0xon1PYTKtic1ESv06f8VY0wCBKqQbSNj8+jzFjUAuQiyr4sor4sIgrpgQzjzQff bYG97cFslo1Sfo7UcZ3e1R33FJyRQDXIrZWurL3Fqmz2zp4dAH4IoiqZ6ReIzcMHhGjZ tEbZUecOvRniBiVfWQHGtoPrIYOe/SPEBZD5LQ7d3u/WdErFDCrl9YyM6QntRk0tsqky ppOlAWfmP7ismUAby60deqOsZZpT5nGxj1ENYFQJhWmPYpI2qF0brFtlW1bVhhq6BMJq 7yjOV8TQbfTpQiqxoaXH5iHsUfuGvoZLNgueTRd0s4+qmp6AifbO69Ovj6j6Mdxa8WNO by/g== 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; bh=Ida1H1/yaY4FQ3KL72lqodoP37ojI1xVC2hdHBOnU/w=; b=oj+HGGF9vVH33O0PvOkQapYp7E1Zr2orNF3VA1WfFjtZllM++VEZ8IQCtT+QCFncTL vdqwnFP/247MtDmaMkIRRX8LxvsCrEKflW3WmQJBZsUT4CrFgFezWA7GVfTdBuzNq6hM aK7mMvVo2utALPI9+D2Rd9K9ZJxirBWklDlJM978t1gHrxYmahyo2cJV5BLwDrADCEmi mzmniuRFwaozK3sWzogDGJSzM/Lqgsd38gCOtQou7uOtZ/0Q2AiGgPmi9bCy/1tdPuJm 7jLZrCf8yCYD/aWRnAIggB+izQNxS2/x60ZOM3omdFzshJNJC/VULbCHZA3r7JSFUZvx oTMg== ARC-Authentication-Results: i=1; mx.google.com; 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 mu10-20020a17090b388a00b00246ba1acf0dsi22010886pjb.14.2023.05.06.07.25.53; Sat, 06 May 2023 07:26:07 -0700 (PDT) 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; 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 S232893AbjEFOR4 (ORCPT + 99 others); Sat, 6 May 2023 10:17:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbjEFORt (ORCPT ); Sat, 6 May 2023 10:17:49 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91A619D42; Sat, 6 May 2023 07:17:41 -0700 (PDT) Received: (Authenticated sender: contact@artur-rojek.eu) by mail.gandi.net (Postfix) with ESMTPSA id D7D8420008; Sat, 6 May 2023 14:17:38 +0000 (UTC) From: Artur Rojek To: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz Cc: Rafael Ignacio Zurita , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek Subject: [PATCH 2/2] sh: dma: Correct the number of DMA channels in SH7709 Date: Sat, 6 May 2023 16:17:03 +0200 Message-Id: <20230506141703.65605-3-contact@artur-rojek.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230506141703.65605-1-contact@artur-rojek.eu> References: <20230506141703.65605-1-contact@artur-rojek.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765155187731018566?= X-GMAIL-MSGID: =?utf-8?q?1765155187731018566?= According to the PM, the DMAC found in SH7709 features only 4 channels. Signed-off-by: Artur Rojek Reviewed-by: John Paul Adrian Glaubitz Reviewed-by: Geert Uytterhoeven --- arch/sh/drivers/dma/Kconfig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig index 7d54f284ce10..4494d09597e9 100644 --- a/arch/sh/drivers/dma/Kconfig +++ b/arch/sh/drivers/dma/Kconfig @@ -28,8 +28,9 @@ config SH_DMA_API config NR_ONCHIP_DMA_CHANNELS int depends on SH_DMA - default "4" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7751 || \ - CPU_SUBTYPE_SH7750S || CPU_SUBTYPE_SH7091 + default "4" if CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7750 || \ + CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7750S || \ + CPU_SUBTYPE_SH7091 default "8" if CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R || \ CPU_SUBTYPE_SH7760 default "12" if CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7780 || \ @@ -37,8 +38,9 @@ config NR_ONCHIP_DMA_CHANNELS default "6" help This allows you to specify the number of channels that the on-chip - DMAC supports. This will be 4 for SH7750/SH7751/Sh7750S/SH7091 and 8 for the - SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, default is 6. + DMAC supports. This will be 4 for SH7709/SH7750/SH7751/Sh7750S/SH7091 + and 8 for the SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, + default is 6. config SH_DMABRG bool "SH7760 DMABRG support"