Message ID | 20230709121311.211720-1-contact@artur-rojek.eu |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4425602vqx; Sun, 9 Jul 2023 05:50:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlG83u0J/aMnDQRsxr5bvCPox95oHT9rLoRmOpbUV9Z9igyt2O2VOog/fplh+hWEhP3Gc6su X-Received: by 2002:a05:6a00:1a88:b0:668:7e84:32e6 with SMTP id e8-20020a056a001a8800b006687e8432e6mr9088351pfv.29.1688907046411; Sun, 09 Jul 2023 05:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688907046; cv=none; d=google.com; s=arc-20160816; b=y/DQM8HoJTlf7I1iPFeY6c0efYIkv+KB7sm9iKWST7cytxdnS67CY8wejBOl/HJBfB c5h5DP8+ACWbJVhE3CNUvIOt1cMYSLi+2LXYXx1fl8ktRaCghSsAJUMM5Hh8q/IewyNt iVFI7hy+bjEGp+cDwVZukpeOKkUhiteCeCLEEIPvWWcxM8VplFBacObdw16pF1bvZcGV g77R7TifHancTaxYt5VFNPADODtObRBe6phmiWA46PU5jlmOtZDsJdcnZgMeY/XrZ5qU CfgCwrnzoPAupW/qhSR6vbz9sOUmSToQ70ha48hnByeTkGaMyIQ+gHrUdVEsxMsh2cff rcJg== 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 :message-id:date:subject:cc:to:from; bh=quiIYvv98ZGn6DrNaEuebTaSDEl9E1nvW0FB5SKZBQw=; fh=CK2X9NDbJ2GbZjj4R6MU//wO8avdZJvKObbH4r0yj/w=; b=hR9nN118NkRHJF06btU4G4Px5lK5wxF08qy/kpHHXVcCQ00rnpxHkNVF9RJDcXqo+i Ybg7y7QFd7XxNKIi4rS1Opjiv8UPlDFGrflDbJuX8Ru/hDIjoVdtAXO+wTzVWmX+PgBB gVu4tIGPPFRdvTbrJJ2zYkV8o9sz9aTNmndd67l+zGKRmtayixS6xgSDGdPgevc3bIwV wEfNRgAM76awD0RXbWer+TOVRRAyAB2XS9fpSABwBr9i/NtIue+p7N+Io9CgGUUQlK1E zPaAXeiPuXSFyWSCcILA22y9qaAdC5v8CfmOg5K6yYttOIa0e2Ef6Rg7Os7Mrd3EFQmJ ST0g== 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 k7-20020a056a00134700b00682cba7571fsi7413240pfu.385.2023.07.09.05.50.27; Sun, 09 Jul 2023 05:50:46 -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 S230155AbjGIMOC (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Sun, 9 Jul 2023 08:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjGIMOB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 9 Jul 2023 08:14:01 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20002D2; Sun, 9 Jul 2023 05:13:50 -0700 (PDT) X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu X-GND-Sasl: contact@artur-rojek.eu Received: by mail.gandi.net (Postfix) with ESMTPSA id 32BDF1BF205; Sun, 9 Jul 2023 12:13:47 +0000 (UTC) From: Artur Rojek <contact@artur-rojek.eu> To: Rich Felker <dalias@libc.org>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, Geert Uytterhoeven <geert+renesas@glider.be>, Sergey Shtylyov <s.shtylyov@omp.ru> Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek <contact@artur-rojek.eu> Subject: [PATCH] sh: hd64461: fix virq offsets Date: Sun, 9 Jul 2023 14:13:11 +0200 Message-ID: <20230709121311.211720-1-contact@artur-rojek.eu> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,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: <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?1770947394861698542?= X-GMAIL-MSGID: =?utf-8?q?1770947394861698542?= |
Series |
sh: hd64461: fix virq offsets
|
|
Commit Message
Artur Rojek
July 9, 2023, 12:13 p.m. UTC
A recent change to start counting SuperH IRQ #s from 16 breaks support
for the Hitachi HD64461 companion chip.
Move the offchip IRQ base and HD64461 IRQ # by 16 in order to
accommodate for the new virq numbering rules.
Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4")
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
---
arch/sh/cchips/Kconfig | 4 ++--
arch/sh/include/asm/hd64461.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
Comments
Hi Artur! On Sun, 2023-07-09 at 14:13 +0200, Artur Rojek wrote: > A recent change to start counting SuperH IRQ #s from 16 breaks support > for the Hitachi HD64461 companion chip. > > Move the offchip IRQ base and HD64461 IRQ # by 16 in order to > accommodate for the new virq numbering rules. > > Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") > Signed-off-by: Artur Rojek <contact@artur-rojek.eu> > --- > arch/sh/cchips/Kconfig | 4 ++-- > arch/sh/include/asm/hd64461.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig > index efde2edb5627..9659a0bc58de 100644 > --- a/arch/sh/cchips/Kconfig > +++ b/arch/sh/cchips/Kconfig > @@ -29,9 +29,9 @@ endchoice > config HD64461_IRQ > int "HD64461 IRQ" > depends on HD64461 > - default "36" > + default "52" > help > - The default setting of the HD64461 IRQ is 36. > + The default setting of the HD64461 IRQ is 52. > > Do not change this unless you know what you are doing. > > diff --git a/arch/sh/include/asm/hd64461.h b/arch/sh/include/asm/hd64461.h > index afb24cb034b1..6d85db6cf54b 100644 > --- a/arch/sh/include/asm/hd64461.h > +++ b/arch/sh/include/asm/hd64461.h > @@ -229,7 +229,7 @@ > #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) > > #define HD64461_IRQBASE OFFCHIP_IRQ_BASE > -#define OFFCHIP_IRQ_BASE 64 > +#define OFFCHIP_IRQ_BASE 80 > #define HD64461_IRQ_NUM 16 > > #define HD64461_IRQ_UART (HD64461_IRQBASE+5) I think it would be better to write this as (64 + 16) for consistency with the other changes made by Sergey. Adrian
On 2023-07-09 14:48, John Paul Adrian Glaubitz wrote: > Hi Artur! > > On Sun, 2023-07-09 at 14:13 +0200, Artur Rojek wrote: >> A recent change to start counting SuperH IRQ #s from 16 breaks support >> for the Hitachi HD64461 companion chip. >> >> Move the offchip IRQ base and HD64461 IRQ # by 16 in order to >> accommodate for the new virq numbering rules. >> >> Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") >> Signed-off-by: Artur Rojek <contact@artur-rojek.eu> >> --- >> arch/sh/cchips/Kconfig | 4 ++-- >> arch/sh/include/asm/hd64461.h | 2 +- >> 2 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig >> index efde2edb5627..9659a0bc58de 100644 >> --- a/arch/sh/cchips/Kconfig >> +++ b/arch/sh/cchips/Kconfig >> @@ -29,9 +29,9 @@ endchoice >> config HD64461_IRQ >> int "HD64461 IRQ" >> depends on HD64461 >> - default "36" >> + default "52" >> help >> - The default setting of the HD64461 IRQ is 36. >> + The default setting of the HD64461 IRQ is 52. >> >> Do not change this unless you know what you are doing. >> >> diff --git a/arch/sh/include/asm/hd64461.h >> b/arch/sh/include/asm/hd64461.h >> index afb24cb034b1..6d85db6cf54b 100644 >> --- a/arch/sh/include/asm/hd64461.h >> +++ b/arch/sh/include/asm/hd64461.h >> @@ -229,7 +229,7 @@ >> #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) >> >> #define HD64461_IRQBASE OFFCHIP_IRQ_BASE >> -#define OFFCHIP_IRQ_BASE 64 >> +#define OFFCHIP_IRQ_BASE 80 >> #define HD64461_IRQ_NUM 16 >> >> #define HD64461_IRQ_UART (HD64461_IRQBASE+5) > > I think it would be better to write this as (64 + 16) for consistency > with the other changes made by Sergey. Sure, I will send v2 with this change, although the same can't be applied to HD64461_IRQ value above, so some inconsistency will exist either way. > > Adrian
Hi! On Sun, 2023-07-09 at 14:56 +0200, Artur Rojek wrote: > On 2023-07-09 14:48, John Paul Adrian Glaubitz wrote: > > Hi Artur! > > > > On Sun, 2023-07-09 at 14:13 +0200, Artur Rojek wrote: > > > A recent change to start counting SuperH IRQ #s from 16 breaks support > > > for the Hitachi HD64461 companion chip. > > > > > > Move the offchip IRQ base and HD64461 IRQ # by 16 in order to > > > accommodate for the new virq numbering rules. > > > > > > Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") > > > Signed-off-by: Artur Rojek <contact@artur-rojek.eu> > > > --- > > > arch/sh/cchips/Kconfig | 4 ++-- > > > arch/sh/include/asm/hd64461.h | 2 +- > > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig > > > index efde2edb5627..9659a0bc58de 100644 > > > --- a/arch/sh/cchips/Kconfig > > > +++ b/arch/sh/cchips/Kconfig > > > @@ -29,9 +29,9 @@ endchoice > > > config HD64461_IRQ > > > int "HD64461 IRQ" > > > depends on HD64461 > > > - default "36" > > > + default "52" > > > help > > > - The default setting of the HD64461 IRQ is 36. > > > + The default setting of the HD64461 IRQ is 52. > > > > > > Do not change this unless you know what you are doing. > > > > > > diff --git a/arch/sh/include/asm/hd64461.h > > > b/arch/sh/include/asm/hd64461.h > > > index afb24cb034b1..6d85db6cf54b 100644 > > > --- a/arch/sh/include/asm/hd64461.h > > > +++ b/arch/sh/include/asm/hd64461.h > > > @@ -229,7 +229,7 @@ > > > #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) > > > > > > #define HD64461_IRQBASE OFFCHIP_IRQ_BASE > > > -#define OFFCHIP_IRQ_BASE 64 > > > +#define OFFCHIP_IRQ_BASE 80 > > > #define HD64461_IRQ_NUM 16 > > > > > > #define HD64461_IRQ_UART (HD64461_IRQBASE+5) > > > > I think it would be better to write this as (64 + 16) for consistency > > with the other changes made by Sergey. > > Sure, I will send v2 with this change, although the same can't be > applied to HD64461_IRQ value above, so some inconsistency will exist > either way. > That's okay, that's the user-facing part ;-). Btw, did you verify that the default assigned IRQ is actually changed from 36 to 52 when the machine boots? Adrian
On Sun, Jul 9, 2023 at 2:59 PM John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote: > On Sun, 2023-07-09 at 14:56 +0200, Artur Rojek wrote: > > On 2023-07-09 14:48, John Paul Adrian Glaubitz wrote: > > > On Sun, 2023-07-09 at 14:13 +0200, Artur Rojek wrote: > > > > A recent change to start counting SuperH IRQ #s from 16 breaks support > > > > for the Hitachi HD64461 companion chip. > > > > > > > > Move the offchip IRQ base and HD64461 IRQ # by 16 in order to > > > > accommodate for the new virq numbering rules. > > > > > > > > Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") > > > > Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > > > > --- a/arch/sh/cchips/Kconfig > > > > +++ b/arch/sh/cchips/Kconfig > > > > @@ -29,9 +29,9 @@ endchoice > > > > config HD64461_IRQ > > > > int "HD64461 IRQ" > > > > depends on HD64461 > > > > - default "36" > > > > + default "52" > > > > help > > > > - The default setting of the HD64461 IRQ is 36. > > > > + The default setting of the HD64461 IRQ is 52. > > > > > > > > Do not change this unless you know what you are doing. > > > > > > > > diff --git a/arch/sh/include/asm/hd64461.h > > > > b/arch/sh/include/asm/hd64461.h > > > > index afb24cb034b1..6d85db6cf54b 100644 > > > > --- a/arch/sh/include/asm/hd64461.h > > > > +++ b/arch/sh/include/asm/hd64461.h > > > > @@ -229,7 +229,7 @@ > > > > #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) > > > > > > > > #define HD64461_IRQBASE OFFCHIP_IRQ_BASE > > > > -#define OFFCHIP_IRQ_BASE 64 > > > > +#define OFFCHIP_IRQ_BASE 80 > > > > #define HD64461_IRQ_NUM 16 > > > > > > > > #define HD64461_IRQ_UART (HD64461_IRQBASE+5) > > > > > > I think it would be better to write this as (64 + 16) for consistency > > > with the other changes made by Sergey. Ideally, we want to have a #define for that... > > Sure, I will send v2 with this change, although the same can't be > > applied to HD64461_IRQ value above, so some inconsistency will exist > > either way. > > That's okay, that's the user-facing part ;-). Do we want to keep this Kconfig option? It is rather fragile, and there is no in-tree config file overriding the default value. Presumably it was introduced to support an out-of-tree board with a different wiring. BTW, there's also this (unused) definition: arch/sh/include/mach-common/mach/hp6xx.h:#define HP680_HD64461_IRQ evt2irq(0x680) /* IRQ4_IRQ */ Gr{oetje,eeting}s, Geert
On 2023-07-09 14:59, John Paul Adrian Glaubitz wrote: > Hi! > > On Sun, 2023-07-09 at 14:56 +0200, Artur Rojek wrote: >> On 2023-07-09 14:48, John Paul Adrian Glaubitz wrote: >> > Hi Artur! >> > >> > On Sun, 2023-07-09 at 14:13 +0200, Artur Rojek wrote: >> > > A recent change to start counting SuperH IRQ #s from 16 breaks support >> > > for the Hitachi HD64461 companion chip. >> > > >> > > Move the offchip IRQ base and HD64461 IRQ # by 16 in order to >> > > accommodate for the new virq numbering rules. >> > > >> > > Fixes: a8ac2961148e ("sh: Avoid using IRQ0 on SH3 and SH4") >> > > Signed-off-by: Artur Rojek <contact@artur-rojek.eu> >> > > --- >> > > arch/sh/cchips/Kconfig | 4 ++-- >> > > arch/sh/include/asm/hd64461.h | 2 +- >> > > 2 files changed, 3 insertions(+), 3 deletions(-) >> > > >> > > diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig >> > > index efde2edb5627..9659a0bc58de 100644 >> > > --- a/arch/sh/cchips/Kconfig >> > > +++ b/arch/sh/cchips/Kconfig >> > > @@ -29,9 +29,9 @@ endchoice >> > > config HD64461_IRQ >> > > int "HD64461 IRQ" >> > > depends on HD64461 >> > > - default "36" >> > > + default "52" >> > > help >> > > - The default setting of the HD64461 IRQ is 36. >> > > + The default setting of the HD64461 IRQ is 52. >> > > >> > > Do not change this unless you know what you are doing. >> > > >> > > diff --git a/arch/sh/include/asm/hd64461.h >> > > b/arch/sh/include/asm/hd64461.h >> > > index afb24cb034b1..6d85db6cf54b 100644 >> > > --- a/arch/sh/include/asm/hd64461.h >> > > +++ b/arch/sh/include/asm/hd64461.h >> > > @@ -229,7 +229,7 @@ >> > > #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) >> > > >> > > #define HD64461_IRQBASE OFFCHIP_IRQ_BASE >> > > -#define OFFCHIP_IRQ_BASE 64 >> > > +#define OFFCHIP_IRQ_BASE 80 >> > > #define HD64461_IRQ_NUM 16 >> > > >> > > #define HD64461_IRQ_UART (HD64461_IRQBASE+5) >> > >> > I think it would be better to write this as (64 + 16) for consistency >> > with the other changes made by Sergey. >> >> Sure, I will send v2 with this change, although the same can't be >> applied to HD64461_IRQ value above, so some inconsistency will exist >> either way. >> > > That's okay, that's the user-facing part ;-). > > Btw, did you verify that the default assigned IRQ is actually changed > from > 36 to 52 when the machine boots? If I understood the question correctly, then yes, the new virq number for HD64461 interrupt is now 52 and the cchip interrupts need this patch to work. Cheers, Artur > > Adrian
diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig index efde2edb5627..9659a0bc58de 100644 --- a/arch/sh/cchips/Kconfig +++ b/arch/sh/cchips/Kconfig @@ -29,9 +29,9 @@ endchoice config HD64461_IRQ int "HD64461 IRQ" depends on HD64461 - default "36" + default "52" help - The default setting of the HD64461 IRQ is 36. + The default setting of the HD64461 IRQ is 52. Do not change this unless you know what you are doing. diff --git a/arch/sh/include/asm/hd64461.h b/arch/sh/include/asm/hd64461.h index afb24cb034b1..6d85db6cf54b 100644 --- a/arch/sh/include/asm/hd64461.h +++ b/arch/sh/include/asm/hd64461.h @@ -229,7 +229,7 @@ #define HD64461_NIMR HD64461_IO_OFFSET(0x5002) #define HD64461_IRQBASE OFFCHIP_IRQ_BASE -#define OFFCHIP_IRQ_BASE 64 +#define OFFCHIP_IRQ_BASE 80 #define HD64461_IRQ_NUM 16 #define HD64461_IRQ_UART (HD64461_IRQBASE+5)