linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support
@ 2021-08-29  3:11 Michael Schmitz
  2021-08-29  3:11 ` [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA Michael Schmitz
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-08-29  3:11 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex

Revisit support for the 100 Mbit APNE PCMCIA card variants, again.

Add a new ISA type for these cards, and switch to that type
from the APNE probe code in case 16 bit IO support is noted
the PCMCIA config table data. A module parameter or kernel
can be used to enable 16 bit IO as a fallback option.
Support for the 16 bit 10/100 Mbit cards is now included by
default.

The first two patches enable the use of core PCMCIA code to
parse config table entries. The remaining two patches add 16
bit IO support to the m68k low-level IO access code, and switch
the APNE driver to use 16 bit IO on cards that support it (the
100 Mbit cards).

I'm in two minds about enabling CONFIG_PCMCIA - the alternative
is to duplicate the cftable parser in amiga/pcmcia.c (which
has been tested and works just as well). Feedback welcome.

Tested by Alex on a 100 Mbit card. Not yet tested on 10 Mbit
cards - if any of those also have the 16 bit IO feature set
in their config table, this patch series would break on those
cards. 

Note that only patch 4 has been sent to netdev. Please CC
linux-m68k when providing comments.

Cheers,

   Michael

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

* [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
@ 2021-08-29  3:11 ` Michael Schmitz
  2021-09-02 12:42   ` Geert Uytterhoeven
  2021-08-29  3:11 ` [PATCH v7 2/4] m68k: amiga/pcmcia - implement 16 bit detection support for apne.c Michael Schmitz
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Michael Schmitz @ 2021-08-29  3:11 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, Michael Schmitz

The 16 bit card support test for the apne.c driver needs a whole
lot of hairy parser code which is already present in the core
PCMCIA code - make use of that instead of duplicating it.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 arch/m68k/Kconfig.bus | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/m68k/Kconfig.bus b/arch/m68k/Kconfig.bus
index a72e0b6..fa3faec 100644
--- a/arch/m68k/Kconfig.bus
+++ b/arch/m68k/Kconfig.bus
@@ -31,6 +31,8 @@ config ZORRO
 config AMIGA_PCMCIA
 	bool "Amiga 1200/600 PCMCIA support"
 	depends on AMIGA
+	select PCCARD
+	select PCMCIA
 	help
 	  Include support in the kernel for pcmcia on Amiga 1200 and Amiga
 	  600. If you intend to use pcmcia cards say Y; otherwise say N.
-- 
2.7.4


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

* [PATCH v7 2/4] m68k: amiga/pcmcia - implement 16 bit detection support for apne.c
  2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  2021-08-29  3:11 ` [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA Michael Schmitz
@ 2021-08-29  3:11 ` Michael Schmitz
  2021-08-29  3:11 ` [PATCH v7 3/4] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-08-29  3:11 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, Michael Schmitz

Implement 16 bit card autoprobing by calling the generic PCMCIA
cftable entry parser through the pcmcia_parse_tuple interface.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 arch/m68k/amiga/pcmcia.c          | 37 +++++++++++++++++++++++++++++++++++++
 arch/m68k/include/asm/amipcmcia.h |  4 ++++
 2 files changed, 41 insertions(+)

diff --git a/arch/m68k/amiga/pcmcia.c b/arch/m68k/amiga/pcmcia.c
index 7106f0c..e7651e6 100644
--- a/arch/m68k/amiga/pcmcia.c
+++ b/arch/m68k/amiga/pcmcia.c
@@ -16,6 +16,7 @@
 #include <linux/jiffies.h>
 #include <linux/timer.h>
 #include <linux/module.h>
+#include <pcmcia/cistpl.h>
 
 #include <asm/amigayle.h>
 #include <asm/amipcmcia.h>
@@ -120,3 +121,39 @@ void pcmcia_write_disable(void)
 }
 EXPORT_SYMBOL(pcmcia_write_disable);
 
+int pcmcia_is_16bit(void)
+{
+	u_char cftuple[258];
+	int cftuple_len;
+	tuple_t cftable_tuple;
+	cistpl_cftable_entry_t cftable_entry;
+
+	cftuple_len = pcmcia_copy_tuple(CISTPL_CFTABLE_ENTRY, cftuple, 256);
+	if (cftuple_len < 3)
+		return 0;
+#ifdef DEBUG
+	else
+		print_hex_dump(KERN_WARNING, "cftable: ", DUMP_PREFIX_NONE, 8,
+				sizeof(char), cftuple, cftuple_len, false);
+#endif
+
+	/* build tuple_t struct and call pcmcia_parse_tuple */
+	cftable_tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
+	cftable_tuple.TupleCode = CISTPL_CFTABLE_ENTRY;
+	cftable_tuple.TupleData = &cftuple[2];
+	cftable_tuple.TupleDataLen = cftuple_len-2;
+	cftable_tuple.TupleDataMax = cftuple_len-2;
+
+	if (pcmcia_parse_tuple(&cftable_tuple, &cftable_entry))
+		return 0;
+
+#ifdef DEBUG
+	pr_info("IO flags: %x\n", cftable_entry.io.flags);
+#endif
+
+	if (cftable_entry.io.flags & CISTPL_IO_16BIT)
+		return 1;
+
+	return 0;
+}
+EXPORT_SYMBOL(pcmcia_is_16bit);
diff --git a/arch/m68k/include/asm/amipcmcia.h b/arch/m68k/include/asm/amipcmcia.h
index 6f1ec18..fac9534 100644
--- a/arch/m68k/include/asm/amipcmcia.h
+++ b/arch/m68k/include/asm/amipcmcia.h
@@ -19,10 +19,12 @@
 
 void pcmcia_reset(void);
 int pcmcia_copy_tuple(unsigned char tuple_id, void *tuple, int max_len);
+int pcmcia_parse_tuple(void *tuple, void *parse);
 void pcmcia_program_voltage(int voltage);
 void pcmcia_access_speed(int speed);
 void pcmcia_write_enable(void);
 void pcmcia_write_disable(void);
+int pcmcia_is_16bit(void);
 
 static inline u_char pcmcia_read_status(void)
 {
@@ -64,6 +66,7 @@ static inline void pcmcia_disable_irq(void)
 #define PCMCIA_SPEED_250NS	250
 #define PCMCIA_SPEED_720NS	720
 
+#ifndef _LINUX_CISTPL_H
 /* PCMCIA Tuple codes */
 
 #define CISTPL_NULL		0x00
@@ -106,5 +109,6 @@ static inline void pcmcia_disable_irq(void)
 #define CISTPL_FUNCID_NETWORK	0x06
 #define CISTPL_FUNCID_AIMS	0x07
 #define CISTPL_FUNCID_SCSI	0x08
+#endif
 
 #endif
-- 
2.7.4


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

* [PATCH v7 3/4] m68k: io_mm.h - add APNE 100 MBit support
  2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  2021-08-29  3:11 ` [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA Michael Schmitz
  2021-08-29  3:11 ` [PATCH v7 2/4] m68k: amiga/pcmcia - implement 16 bit detection support for apne.c Michael Schmitz
@ 2021-08-29  3:11 ` Michael Schmitz
  2021-08-29  3:11 ` [PATCH net v7 4/4] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
  2021-11-02  6:24 ` [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  4 siblings, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-08-29  3:11 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, Michael Schmitz

Add code to support 10 Mbit and 100 Mbit mode for APNE driver.

A new ISA type ISA_TYPE_AG16 dynamically switches the Amiga
ISA inb accessor to word access as required by the 100 Mbit cards.

Patch modified after patch "[PATCH RFC net-next] Amiga PCMCIA
100 MBit card support" submitted to netdev 2018/09/16 by Alex
Kazik <alex@kazik.de>.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

--
Changes from v4:

Geert Uytterhoeven:
- drop CONFIG_APNE100MBIT ifdefs

Changes from v3:

Finn Thain:
- revert isa_inb() define reordering
- omit redundant #ifdef around ISA_TYPE_AG16 case labels

Changes from v1:

Andreas Schwab:
- remove redundant fallthrough annotations

Changes from RFC:

Geert Uytterhoeven:
- rename ISA_TYPE_AG100 to ISA_TYPE_AG16 (16 bit cards)
- move ISA_TYPE_AG16 case inside #ifdef CONFIG_AMIGA_PCMCIA
- change #if defined(CONFIG_APNE_100MBIT) to #ifdef
- fix parentheses in isa_inb() define
- omit comment about compiler optimization

- add ISA_TYPE_AG16 case to isa_delay()
---
 arch/m68k/include/asm/io_mm.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h
index 9c521b0..68922ef 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -65,12 +65,10 @@
 #define AG_ISA_IO_B(ioaddr) ( GAYLE_IO+(ioaddr)+(((ioaddr)&1)*GAYLE_ODD) )
 #define AG_ISA_IO_W(ioaddr) ( GAYLE_IO+(ioaddr) )
 
-#ifndef MULTI_ISA
-#define MULTI_ISA 0
-#else
+#ifdef MULTI_ISA
 #undef MULTI_ISA
-#define MULTI_ISA 1
 #endif
+#define MULTI_ISA 1	/* Need MULTI_ISA for 16 bit PCMCIA card support ! */
 #endif /* AMIGA_PCMCIA */
 
 #ifdef CONFIG_ATARI_ROM_ISA
@@ -101,6 +99,8 @@
 #define ISA_TYPE_Q40  (1)
 #define ISA_TYPE_AG   (2)
 #define ISA_TYPE_ENEC (3)
+#define ISA_TYPE_AG16 (4)	/* for 100 MBit APNE card */
+
 
 #if defined(CONFIG_Q40) && !defined(MULTI_ISA)
 #define ISA_TYPE ISA_TYPE_Q40
@@ -136,6 +136,7 @@ static inline u8 __iomem *isa_itb(unsigned long addr)
     case ISA_TYPE_Q40: return (u8 __iomem *)Q40_ISA_IO_B(addr);
 #endif
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16:
     case ISA_TYPE_AG: return (u8 __iomem *)AG_ISA_IO_B(addr);
 #endif
 #ifdef CONFIG_ATARI_ROM_ISA
@@ -155,6 +156,7 @@ static inline u16 __iomem *isa_itw(unsigned long addr)
     case ISA_TYPE_Q40: return (u16 __iomem *)Q40_ISA_IO_W(addr);
 #endif
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16:
     case ISA_TYPE_AG: return (u16 __iomem *)AG_ISA_IO_W(addr);
 #endif
 #ifdef CONFIG_ATARI_ROM_ISA
@@ -171,6 +173,7 @@ static inline u32 __iomem *isa_itl(unsigned long addr)
   switch(ISA_TYPE)
     {
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16:
     case ISA_TYPE_AG: return (u32 __iomem *)AG_ISA_IO_W(addr);
 #endif
     }
@@ -184,6 +187,7 @@ static inline u8 __iomem *isa_mtb(unsigned long addr)
     case ISA_TYPE_Q40: return (u8 __iomem *)Q40_ISA_MEM_B(addr);
 #endif
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16:
     case ISA_TYPE_AG: return (u8 __iomem *)addr;
 #endif
 #ifdef CONFIG_ATARI_ROM_ISA
@@ -203,6 +207,7 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)
     case ISA_TYPE_Q40: return (u16 __iomem *)Q40_ISA_MEM_W(addr);
 #endif
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16:
     case ISA_TYPE_AG: return (u16 __iomem *)addr;
 #endif
 #ifdef CONFIG_ATARI_ROM_ISA
@@ -216,7 +221,7 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)
 }
 
 
-#define isa_inb(port)      in_8(isa_itb(port))
+#define isa_inb(port)      ((ISA_TYPE == ISA_TYPE_AG16) ? ((port) & 1 ? isa_inw((port) - 1) & 0xff : isa_inw(port) >> 8) : in_8(isa_itb(port)))
 #define isa_inw(port)      (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port)))
 #define isa_inl(port)      (ISA_SEX ? in_be32(isa_itl(port)) : in_le32(isa_itl(port)))
 #define isa_outb(val,port) out_8(isa_itb(port),(val))
@@ -270,6 +275,7 @@ static inline void isa_delay(void)
     case ISA_TYPE_Q40: isa_outb(0,0x80); break;
 #endif
 #ifdef CONFIG_AMIGA_PCMCIA
+    case ISA_TYPE_AG16: break;
     case ISA_TYPE_AG: break;
 #endif
 #ifdef CONFIG_ATARI_ROM_ISA
-- 
2.7.4


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

* [PATCH net v7 4/4] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
                   ` (2 preceding siblings ...)
  2021-08-29  3:11 ` [PATCH v7 3/4] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
@ 2021-08-29  3:11 ` Michael Schmitz
  2021-11-02  6:24 ` [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  4 siblings, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-08-29  3:11 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, Michael Schmitz, netdev

Add module parameter, IO mode autoprobe and PCMCIA reset code
required to support 100 Mbit PCMCIA ethernet cards on Amiga.

10 Mbit and 100 Mbit mode are supported by the same module.
Use the PCMCIA cftable parser to detect 16 bit cards,
and automatically enable 16 bit ISA IO access for those cards
by changing isa_type at runtime.

An optional module parameter switches Amiga ISA IO accessors
to 16 bit access in case autoprobe fails. Code to reset the
PCMCIA hardware required for 16 bit cards is also added to
the driver probe.

Patch modified after patch "[PATCH RFC net-next] Amiga PCMCIA
100 MBit card support" submitted to netdev 2018/09/16 by Alex
Kazik <alex@kazik.de>.

CC: netdev@vger.kernel.org
Link: https://lore.kernel.org/r/1622958877-2026-1-git-send-email-schmitzmic@gmail.com
Tested-by: Alex Kazik <alex@kazik.de>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

--
Changes from v6:

- use 16 bit mode autoprobe based on PCMCIA config table data

Changes from v5:

- move autoprobe code to new patch in this series

Geert Uytterhoeven:
- reword Kconfig help text

Finn Thain:
- style fixes, use msec_to_jiffies in timeout calc

Alex Kazik:
- revert module parameter permission change

Changes from v4:

Geert Uytterhoeven:
- remove APNE100MBIT config option, always include 16 bit support
- change module parameter permissions
- try autoprobing for 16 bit mode early on in device probe

Changes from v3:

- change module parameter name to match Kconfig help

Finn Thain:
- fix coding style in new card reset code block
- allow reset of isa_type by module parameter

Changes from v1:

- fix module parameter name in Kconfig help text

Alex Kazik:
- change module parameter type to bool, fix module parameter
  permission

Changes from RFC:

Geert Uytterhoeven:
- change APNE_100MBIT to depend on APNE
- change '---help---' to 'help' (former no longer supported)
- fix whitespace errors
- fix module_param_named() arg count
- protect all added code by #ifdef CONFIG_APNE_100MBIT
---
 drivers/net/ethernet/8390/Kconfig |  6 ++++++
 drivers/net/ethernet/8390/apne.c  | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
index 9f4b302..270323e 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -143,6 +143,12 @@ config APNE
 	  To compile this driver as a module, choose M here: the module
 	  will be called apne.
 
+	  The driver also supports 10/100Mbit cards (e.g. Netgear FA411,
+	  CNet Singlepoint). To activate 100 Mbit support, use the kernel
+	  option apne.100mbit=1 (builtin) at boot time, or the apne.100mbit
+	  module parameter. The driver will attempt to autoprobe 100 Mbit
+	  mode. so this option may not be necessary.
+
 config PCMCIA_PCNET
 	tristate "NE2000 compatible PCMCIA support"
 	depends on PCMCIA
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index fe6c834..cf93b65 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -38,6 +38,7 @@
 #include <linux/etherdevice.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
+#include <pcmcia/cistpl.h>
 
 #include <asm/io.h>
 #include <asm/setup.h>
@@ -120,6 +121,10 @@ static u32 apne_msg_enable;
 module_param_named(msg_enable, apne_msg_enable, uint, 0444);
 MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)");
 
+static bool apne_100_mbit;
+module_param_named(100_mbit, apne_100_mbit, bool, 0444);
+MODULE_PARM_DESC(100_mbit, "Enable 100 Mbit support");
+
 struct net_device * __init apne_probe(int unit)
 {
 	struct net_device *dev;
@@ -139,6 +144,11 @@ struct net_device * __init apne_probe(int unit)
 	if ( !(AMIGAHW_PRESENT(PCMCIA)) )
 		return ERR_PTR(-ENODEV);
 
+	if (apne_100_mbit)
+		isa_type = ISA_TYPE_AG16;
+	else
+		isa_type = ISA_TYPE_AG;
+
 	pr_info("Looking for PCMCIA ethernet card : ");
 
 	/* check if a card is inserted */
@@ -172,6 +182,12 @@ struct net_device * __init apne_probe(int unit)
 
 	pr_cont("ethernet PCMCIA card inserted\n");
 
+	if (pcmcia_is_16bit()) {
+		pr_info("16-bit PCMCIA card detected!\n");
+		isa_type = ISA_TYPE_AG16;
+		apne_100_mbit = 1;
+	}
+
 	if (!init_pcmcia()) {
 		/* XXX: shouldn't we re-enable irq here? */
 		free_netdev(dev);
@@ -590,6 +606,16 @@ static int init_pcmcia(void)
 #endif
 	u_long offset;
 
+	/* reset card (idea taken from CardReset by Artur Pogoda) */
+	if (isa_type == ISA_TYPE_AG16) {
+		u_char tmp = gayle.intreq;
+
+		gayle.intreq = 0xff;
+		mdelay(1);
+		gayle.intreq = tmp;
+		mdelay(300);
+	}
+
 	pcmcia_reset();
 	pcmcia_program_voltage(PCMCIA_0V);
 	pcmcia_access_speed(PCMCIA_SPEED_250NS);
-- 
2.7.4


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

* Re: [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-08-29  3:11 ` [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA Michael Schmitz
@ 2021-09-02 12:42   ` Geert Uytterhoeven
  2021-09-03  2:51     ` Michael Schmitz
  0 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2021-09-02 12:42 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k, ALeX Kazik

Hi Michael,

On Sun, Aug 29, 2021 at 5:12 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> The 16 bit card support test for the apne.c driver needs a whole
> lot of hairy parser code which is already present in the core
> PCMCIA code - make use of that instead of duplicating it.
>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

Thanks for your patch!

> --- a/arch/m68k/Kconfig.bus
> +++ b/arch/m68k/Kconfig.bus
> @@ -31,6 +31,8 @@ config ZORRO
>  config AMIGA_PCMCIA
>         bool "Amiga 1200/600 PCMCIA support"

Can this become tristate?

>         depends on AMIGA
> +       select PCCARD
> +       select PCMCIA

This is now forcing PCCARD and PCMCIA builtin instead of modular
in an allmodconfig kernel.

>         help
>           Include support in the kernel for pcmcia on Amiga 1200 and Amiga
>           600. If you intend to use pcmcia cards say Y; otherwise say N.

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] 11+ messages in thread

* Re: [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-09-02 12:42   ` Geert Uytterhoeven
@ 2021-09-03  2:51     ` Michael Schmitz
  2021-09-03 14:14       ` Geert Uytterhoeven
  2021-09-05  8:15       ` Michael Schmitz
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-09-03  2:51 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, ALeX Kazik

Hi Geert,

[resending due to bounce]

thanks for your review!

On 03/09/21 00:42, Geert Uytterhoeven wrote:
> Hi Michael,
>
> On Sun, Aug 29, 2021 at 5:12 AM Michael Schmitz<schmitzmic@gmail.com>  wrote:
>> The 16 bit card support test for the apne.c driver needs a whole
>> lot of hairy parser code which is already present in the core
>> PCMCIA code - make use of that instead of duplicating it.
>>
>> Signed-off-by: Michael Schmitz<schmitzmic@gmail.com>
> Thanks for your patch!
>
>> --- a/arch/m68k/Kconfig.bus
>> +++ b/arch/m68k/Kconfig.bus
>> @@ -31,6 +31,8 @@ config ZORRO
>>   config AMIGA_PCMCIA
>>          bool "Amiga 1200/600 PCMCIA support"
> Can this become tristate?
I suspect it can - though I wonder why it hasn't been made tristate 
before. Ah - pcmcia.c needs a little patch to add a MODULE_LICENSE clause.
>>          depends on AMIGA
>> +       select PCCARD
>> +       select PCMCIA
> This is now forcing PCCARD and PCMCIA builtin instead of modular
> in an allmodconfig kernel.
Thanks, that's what I'd been worried about.

How do I make sure CONFIG_PCMCIA gets selected as module as well? I can 
select this when CONFIG_APNE is set, from 
drivers/net/ethernet/8390/Kconfig, but I'd then have to protect the 
cftable parse hook in amiga/pcmcia.c against the case where CONFIG_APNE 
is not selected.

Not to mention we need to rename amiga/pcmcia.c to avoid a module naming 
conflict.

Just including cistpl.o as a module is not an option unfortunately - too 
many dependencies.

And I don't think we need CONFIG_PCMCIA_PROBE=Y?

Cheers,

     Michael

>>          help
>>            Include support in the kernel for pcmcia on Amiga 1200 and Amiga
>>            600. If you intend to use pcmcia cards say Y; otherwise say N.
> Gr{oetje,eeting}s,
>
>                          Geert
>


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

* Re: [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-09-03  2:51     ` Michael Schmitz
@ 2021-09-03 14:14       ` Geert Uytterhoeven
  2021-09-03 21:51         ` Michael Schmitz
  2021-09-05  8:15       ` Michael Schmitz
  1 sibling, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2021-09-03 14:14 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k, ALeX Kazik

Hi Michael,

On Fri, Sep 3, 2021 at 4:52 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> On 03/09/21 00:42, Geert Uytterhoeven wrote:
> > On Sun, Aug 29, 2021 at 5:12 AM Michael Schmitz<schmitzmic@gmail.com>  wrote:
> >> The 16 bit card support test for the apne.c driver needs a whole
> >> lot of hairy parser code which is already present in the core
> >> PCMCIA code - make use of that instead of duplicating it.
> >>
> >> Signed-off-by: Michael Schmitz<schmitzmic@gmail.com>
> > Thanks for your patch!
> >
> >> --- a/arch/m68k/Kconfig.bus
> >> +++ b/arch/m68k/Kconfig.bus
> >> @@ -31,6 +31,8 @@ config ZORRO
> >>   config AMIGA_PCMCIA
> >>          bool "Amiga 1200/600 PCMCIA support"
> > Can this become tristate?
> I suspect it can - though I wonder why it hasn't been made tristate
> before. Ah - pcmcia.c needs a little patch to add a MODULE_LICENSE clause.
> >>          depends on AMIGA
> >> +       select PCCARD
> >> +       select PCMCIA
> > This is now forcing PCCARD and PCMCIA builtin instead of modular
> > in an allmodconfig kernel.
> Thanks, that's what I'd been worried about.
>
> How do I make sure CONFIG_PCMCIA gets selected as module as well? I can
> select this when CONFIG_APNE is set, from
> drivers/net/ethernet/8390/Kconfig, but I'd then have to protect the
> cftable parse hook in amiga/pcmcia.c against the case where CONFIG_APNE
> is not selected.

That will be fixed automatically by making AMIGA_PCMCIA tristate.
Select from a modular symbol will make the target modular, too.

> Not to mention we need to rename amiga/pcmcia.c to avoid a module naming
> conflict.
>
> Just including cistpl.o as a module is not an option unfortunately - too
> many dependencies.
>
> And I don't think we need CONFIG_PCMCIA_PROBE=Y?

No idea if we need that...

-default y if ISA && !ARCH_SA1100 && !PARISC
+default y if ISA && !ARCH_SA1100 && !PARISC && !AMIGA_PCMCIA

(wondering how many platforms that can use PCMCIA are left, and if
 this can be converted into positive logic?)

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] 11+ messages in thread

* Re: [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-09-03 14:14       ` Geert Uytterhoeven
@ 2021-09-03 21:51         ` Michael Schmitz
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-09-03 21:51 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, ALeX Kazik

Hi Geert,

On 04/09/21 02:14, Geert Uytterhoeven wrote:
> Hi Michael,
>> How do I make sure CONFIG_PCMCIA gets selected as module as well? I can
>> select this when CONFIG_APNE is set, from
>> drivers/net/ethernet/8390/Kconfig, but I'd then have to protect the
>> cftable parse hook in amiga/pcmcia.c against the case where CONFIG_APNE
>> is not selected.
>
> That will be fixed automatically by making AMIGA_PCMCIA tristate.
> Select from a modular symbol will make the target modular, too.

Maybe when starting from a new .config - if no one had these set on m68k 
before, we're OK.

>
>> Not to mention we need to rename amiga/pcmcia.c to avoid a module naming
>> conflict.

No objection? Anything in particular to be careful about when renaming a 
file?

>>
>> Just including cistpl.o as a module is not an option unfortunately - too
>> many dependencies.
>>
>> And I don't think we need CONFIG_PCMCIA_PROBE=Y?
>
> No idea if we need that...

It's about IRQ probing, so yechhh .... OTOH, it doesn't hurt as we'll 
never call the IRQ probe hooks, so we can just as well leave it active.

> -default y if ISA && !ARCH_SA1100 && !PARISC
> +default y if ISA && !ARCH_SA1100 && !PARISC && !AMIGA_PCMCIA
>
> (wondering how many platforms that can use PCMCIA are left, and if
>  this can be converted into positive logic?)

You're welcome to open that discussion. Hope it won't backfire...

Cheers,

	Michael

>
> Gr{oetje,eeting}s,
>
>                         Geert
>

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

* Re: [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA
  2021-09-03  2:51     ` Michael Schmitz
  2021-09-03 14:14       ` Geert Uytterhoeven
@ 2021-09-05  8:15       ` Michael Schmitz
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-09-05  8:15 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, ALeX Kazik

Hi Geert,

On 03/09/21 14:51, Michael Schmitz wrote:
> Hi Geert,
>
> [resending due to bounce]
>
> thanks for your review!
>
> On 03/09/21 00:42, Geert Uytterhoeven wrote:
>> Hi Michael,
>>
>> On Sun, Aug 29, 2021 at 5:12 AM Michael Schmitz<schmitzmic@gmail.com>
>> wrote:
>>> The 16 bit card support test for the apne.c driver needs a whole
>>> lot of hairy parser code which is already present in the core
>>> PCMCIA code - make use of that instead of duplicating it.
>>>
>>> Signed-off-by: Michael Schmitz<schmitzmic@gmail.com>
>> Thanks for your patch!
>>
>>> --- a/arch/m68k/Kconfig.bus
>>> +++ b/arch/m68k/Kconfig.bus
>>> @@ -31,6 +31,8 @@ config ZORRO
>>>   config AMIGA_PCMCIA
>>>          bool "Amiga 1200/600 PCMCIA support"
>> Can this become tristate?
> I suspect it can - though I wonder why it hasn't been made tristate
> before. Ah - pcmcia.c needs a little patch to add a MODULE_LICENSE clause.
>>>          depends on AMIGA
>>> +       select PCCARD
>>> +       select PCMCIA
>> This is now forcing PCCARD and PCMCIA builtin instead of modular
>> in an allmodconfig kernel.
> Thanks, that's what I'd been worried about.
>
> How do I make sure CONFIG_PCMCIA gets selected as module as well? I can
> select this when CONFIG_APNE is set, from
> drivers/net/ethernet/8390/Kconfig, but I'd then have to protect the
> cftable parse hook in amiga/pcmcia.c against the case where CONFIG_APNE
> is not selected.
>
> Not to mention we need to rename amiga/pcmcia.c to avoid a module naming
> conflict.

I think I rather leave pcmcia_is_16bit() in apne.c where I had initally 
put it. No other driver uses it, and I avoid mucking around with file 
renames. Core PCMCIA code can still be built as modules, as can the APNE 
driver.

Cheers,

	Michael




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

* Re: [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support
  2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
                   ` (3 preceding siblings ...)
  2021-08-29  3:11 ` [PATCH net v7 4/4] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
@ 2021-11-02  6:24 ` Michael Schmitz
  4 siblings, 0 replies; 11+ messages in thread
From: Michael Schmitz @ 2021-11-02  6:24 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex

Ping?


On 29/08/21 15:11, Michael Schmitz wrote:
> Revisit support for the 100 Mbit APNE PCMCIA card variants, again.
>
> Add a new ISA type for these cards, and switch to that type
> from the APNE probe code in case 16 bit IO support is noted
> the PCMCIA config table data. A module parameter or kernel
> can be used to enable 16 bit IO as a fallback option.
> Support for the 16 bit 10/100 Mbit cards is now included by
> default.
>
> The first two patches enable the use of core PCMCIA code to
> parse config table entries. The remaining two patches add 16
> bit IO support to the m68k low-level IO access code, and switch
> the APNE driver to use 16 bit IO on cards that support it (the
> 100 Mbit cards).
>
> I'm in two minds about enabling CONFIG_PCMCIA - the alternative
> is to duplicate the cftable parser in amiga/pcmcia.c (which
> has been tested and works just as well). Feedback welcome.
>
> Tested by Alex on a 100 Mbit card. Not yet tested on 10 Mbit
> cards - if any of those also have the 16 bit IO feature set
> in their config table, this patch series would break on those
> cards.
>
> Note that only patch 4 has been sent to netdev. Please CC
> linux-m68k when providing comments.
>
> Cheers,
>
>    Michael
>

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

end of thread, other threads:[~2021-11-02  6:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29  3:11 [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support Michael Schmitz
2021-08-29  3:11 ` [PATCH v7 1/4] m68k: Kconfig - select core PCMCIA support module for Amiga PCMCIA Michael Schmitz
2021-09-02 12:42   ` Geert Uytterhoeven
2021-09-03  2:51     ` Michael Schmitz
2021-09-03 14:14       ` Geert Uytterhoeven
2021-09-03 21:51         ` Michael Schmitz
2021-09-05  8:15       ` Michael Schmitz
2021-08-29  3:11 ` [PATCH v7 2/4] m68k: amiga/pcmcia - implement 16 bit detection support for apne.c Michael Schmitz
2021-08-29  3:11 ` [PATCH v7 3/4] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
2021-08-29  3:11 ` [PATCH net v7 4/4] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
2021-11-02  6:24 ` [PATCH v7 0/4] Add APNE PCMCIA 100 Mbit support 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).