linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] amiga: turn off all incoming interrupts from the Warp1260
@ 2024-05-29 16:31 Paolo Pisati
  2024-05-29 16:31 ` [PATCH 1/1] m68k: amiga: config: upon boot, " Paolo Pisati
  2024-05-29 19:26 ` [PATCH 0/1] amiga: " Michael Schmitz
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Pisati @ 2024-05-29 16:31 UTC (permalink / raw)
  To: linux-m68k

The CS-Lab people told me where to find the interrupt ctrl register (and its
layout), so here is a patch that turn off all incoming interrupts during
config.c::amiga_parse_bootinfo().

With this patch applied, Linux finally boots on my Amiga 1200 + Warp 1260 board.

Paolo Pisati (1):
  m68k: amiga: config: upon boot, turn off all incoming interrupts from
    the Warp1260

 arch/m68k/amiga/config.c       | 9 +++++++++
 include/uapi/linux/zorro_ids.h | 3 +++
 2 files changed, 12 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] m68k: amiga: config: upon boot, turn off all incoming interrupts from the Warp1260
  2024-05-29 16:31 [PATCH 0/1] amiga: turn off all incoming interrupts from the Warp1260 Paolo Pisati
@ 2024-05-29 16:31 ` Paolo Pisati
  2024-05-30  7:30   ` Geert Uytterhoeven
  2024-05-29 19:26 ` [PATCH 0/1] amiga: " Michael Schmitz
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Pisati @ 2024-05-29 16:31 UTC (permalink / raw)
  To: linux-m68k

Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
---
 arch/m68k/amiga/config.c       | 9 +++++++++
 include/uapi/linux/zorro_ids.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 3137b45750df..8bbf7372a5fe 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -180,6 +180,15 @@ int __init amiga_parse_bootinfo(const struct bi_record *record)
 			dev->slotsize = be16_to_cpu(cd->cd_SlotSize);
 			dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr);
 			dev->boardsize = be32_to_cpu(cd->cd_BoardSize);
+
+			/* CS-LAB Warp 1260 workaround */
+			if (be16_to_cpu(dev->rom.er_Manufacturer) == ZORRO_MANUF(ZORRO_PROD_CSLAB_WARP_1260) &&
+			    dev->rom.er_Product == ZORRO_PROD(ZORRO_PROD_CSLAB_WARP_1260)) {
+
+				/* turn off all interrupts */
+				uint32_t *int_reg = (uint32_t *)(dev->boardaddr + 0x1000);
+				*int_reg = 0x0FFF;
+			}
 		} else
 			pr_warn("amiga_parse_bootinfo: too many AutoConfig devices\n");
 #endif /* CONFIG_ZORRO */
diff --git a/include/uapi/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h
index 6e574d7b7d79..393f2ee9c042 100644
--- a/include/uapi/linux/zorro_ids.h
+++ b/include/uapi/linux/zorro_ids.h
@@ -449,6 +449,9 @@
 #define  ZORRO_PROD_VMC_ISDN_BLASTER_Z2				ZORRO_ID(VMC, 0x01, 0)
 #define  ZORRO_PROD_VMC_HYPERCOM_4				ZORRO_ID(VMC, 0x02, 0)
 
+#define ZORRO_MANUF_CSLAB					0x1400
+#define  ZORRO_PROD_CSLAB_WARP_1260				ZORRO_ID(CSLAB, 0x65, 0)
+
 #define ZORRO_MANUF_INFORMATION					0x157C
 #define  ZORRO_PROD_INFORMATION_ISDN_ENGINE_I			ZORRO_ID(INFORMATION, 0x64, 0)
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] amiga: turn off all incoming interrupts from the Warp1260
  2024-05-29 16:31 [PATCH 0/1] amiga: turn off all incoming interrupts from the Warp1260 Paolo Pisati
  2024-05-29 16:31 ` [PATCH 1/1] m68k: amiga: config: upon boot, " Paolo Pisati
@ 2024-05-29 19:26 ` Michael Schmitz
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Schmitz @ 2024-05-29 19:26 UTC (permalink / raw)
  To: Paolo Pisati, linux-m68k

Paolo,

just a style comment: For a single patch, --compose is  not necessary. 
Please place the below patch description in the commit message of your 
patch.

You left the commit message itself empty (aside from your 
Signed-off-by:). As a result, your patch would go in without any message 
(unless there's something in b4 that treats single patch submissions 
with introductory message special).

The commit message usually contains a description of the bug you are 
fixing. In your case that would be:

Amiga 1200 boot crashes in local_irq_enable() (or auto_irq_enable()) 
with an interrupt storm. The Warp1260 board interrupts appear to still 
be active at boot time.

Then a description of what your patch does (which you have below).

You also want a

Link: https://lore.kernel.org/r/ZkjwzVwYeQtyAPrL@amaterasu.local

and

Cc: stable<stable@kernel.org>

above your Signed-off-by: tag

Cheers,

     Michael


On 30/05/24 04:31, Paolo Pisati wrote:
> The CS-Lab people told me where to find the interrupt ctrl register (and its
> layout), so here is a patch that turn off all incoming interrupts during
> config.c::amiga_parse_bootinfo().
>
> With this patch applied, Linux finally boots on my Amiga 1200 + Warp 1260 board.
>
> Paolo Pisati (1):
>    m68k: amiga: config: upon boot, turn off all incoming interrupts from
>      the Warp1260
>
>   arch/m68k/amiga/config.c       | 9 +++++++++
>   include/uapi/linux/zorro_ids.h | 3 +++
>   2 files changed, 12 insertions(+)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] m68k: amiga: config: upon boot, turn off all incoming interrupts from the Warp1260
  2024-05-29 16:31 ` [PATCH 1/1] m68k: amiga: config: upon boot, " Paolo Pisati
@ 2024-05-30  7:30   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2024-05-30  7:30 UTC (permalink / raw)
  To: Paolo Pisati; +Cc: linux-m68k, John Paul Adrian Glaubitz

Hi Paolo,

On Wed, May 29, 2024 at 6:39 PM Paolo Pisati <p.pisati@gmail.com> wrote:
> Signed-off-by: Paolo Pisati <p.pisati@gmail.com>

Thanks for your patch!

> --- a/arch/m68k/amiga/config.c
> +++ b/arch/m68k/amiga/config.c
> @@ -180,6 +180,15 @@ int __init amiga_parse_bootinfo(const struct bi_record *record)
>                         dev->slotsize = be16_to_cpu(cd->cd_SlotSize);
>                         dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr);
>                         dev->boardsize = be32_to_cpu(cd->cd_BoardSize);
> +
> +                       /* CS-LAB Warp 1260 workaround */
> +                       if (be16_to_cpu(dev->rom.er_Manufacturer) == ZORRO_MANUF(ZORRO_PROD_CSLAB_WARP_1260) &&
> +                           dev->rom.er_Product == ZORRO_PROD(ZORRO_PROD_CSLAB_WARP_1260)) {

Probably we want a pr_info() here, so we know the workaround is applied.
This also helps debugging if the workaround ever causes an issue.

> +
> +                               /* turn off all interrupts */
> +                               uint32_t *int_reg = (uint32_t *)(dev->boardaddr + 0x1000);
> +                               *int_reg = 0x0FFF;

This can be combined:

    *(uint32_t *)(dev->boardaddr + 0x1000) = 0x0FFF;

> +                       }
>                 } else
>                         pr_warn("amiga_parse_bootinfo: too many AutoConfig devices\n");
>  #endif /* CONFIG_ZORRO */
> diff --git a/include/uapi/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h
> index 6e574d7b7d79..393f2ee9c042 100644
> --- a/include/uapi/linux/zorro_ids.h
> +++ b/include/uapi/linux/zorro_ids.h
> @@ -449,6 +449,9 @@
>  #define  ZORRO_PROD_VMC_ISDN_BLASTER_Z2                                ZORRO_ID(VMC, 0x01, 0)
>  #define  ZORRO_PROD_VMC_HYPERCOM_4                             ZORRO_ID(VMC, 0x02, 0)
>
> +#define ZORRO_MANUF_CSLAB                                      0x1400
> +#define  ZORRO_PROD_CSLAB_WARP_1260                            ZORRO_ID(CSLAB, 0x65, 0)
> +
>  #define ZORRO_MANUF_INFORMATION                                        0x157C
>  #define  ZORRO_PROD_INFORMATION_ISDN_ENGINE_I                  ZORRO_ID(INFORMATION, 0x64, 0)

This board does not seem to be in zorro.ids yet.

Adrian: Which repo is the official one?
    https://github.com/glaubitz/zorroutils
    https://github.com/glaubitz/zorroutils-debian

Looks like Debian no longer has a zorroutils package...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-30  7:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 16:31 [PATCH 0/1] amiga: turn off all incoming interrupts from the Warp1260 Paolo Pisati
2024-05-29 16:31 ` [PATCH 1/1] m68k: amiga: config: upon boot, " Paolo Pisati
2024-05-30  7:30   ` Geert Uytterhoeven
2024-05-29 19:26 ` [PATCH 0/1] amiga: " Michael Schmitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).