public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH v9 0/3] Add APNE PCMCIA 100 Mbit support
@ 2021-11-09  4:02 Michael Schmitz
  2021-11-09  4:02 ` [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h Michael Schmitz
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09  4:02 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, netdev

The first patch enables the use of core PCMCIA code to parse
config table entries in Amiga drivers. The remaining two patches
add 16 bit IO support to the m68k low-level IO access code, and 
add code to the APNE driver to autoprobe for 16 bit IO on cards
that support it (the 100 Mbit cards). The core PCMCIA config
table parser is utilized for this (may be built as a module).

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 3 has been sent to netdev. Please CC
linux-m68k when providing comments.

v9 adds a couple of fixes following review comments by Geert.

Cheers,

   Michael

CC: netdev@vger.kernel.org



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

* [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h
  2021-11-09  4:02 [PATCH v9 0/3] Add APNE PCMCIA 100 Mbit support Michael Schmitz
@ 2021-11-09  4:02 ` Michael Schmitz
  2021-11-09  8:14   ` Geert Uytterhoeven
  2021-11-09  4:02 ` [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
  2021-11-09  4:02 ` [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
  2 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09  4:02 UTC (permalink / raw)
  To: linux-m68k, geert; +Cc: alex, Michael Schmitz

Add the interface definition for 16 bit card autoprobing (using
the generic PCMCIA cftable entry parser) to amipcmcia.h for use
by apne.c. Include necessary cftable definitions from cistpl.h,
remove locally duplicate definitions from amipcmcia.h.

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

--

Changes from v8:

Geert Uytterhoeven:

- just include pcmcia/cistpl.h; declare pcmcia_parse_tuple()
  only if core PCMCIA code is included

Changes from v7:

- add interface definitions only, move actual code to apne.c
---
 arch/m68k/include/asm/amipcmcia.h | 46 +++----------------------------
 1 file changed, 4 insertions(+), 42 deletions(-)

diff --git a/arch/m68k/include/asm/amipcmcia.h b/arch/m68k/include/asm/amipcmcia.h
index 6f1ec1887d82..36a693895b99 100644
--- a/arch/m68k/include/asm/amipcmcia.h
+++ b/arch/m68k/include/asm/amipcmcia.h
@@ -13,6 +13,7 @@
 #ifndef __AMIGA_PCMCIA_H__
 #define __AMIGA_PCMCIA_H__
 
+#include <pcmcia/cistpl.h>
 #include <asm/amigayle.h>
 
 /* prototypes */
@@ -64,47 +65,8 @@ static inline void pcmcia_disable_irq(void)
 #define PCMCIA_SPEED_250NS	250
 #define PCMCIA_SPEED_720NS	720
 
-/* PCMCIA Tuple codes */
-
-#define CISTPL_NULL		0x00
-#define CISTPL_DEVICE		0x01
-#define CISTPL_LONGLINK_CB	0x02
-#define CISTPL_CONFIG_CB	0x04
-#define CISTPL_CFTABLE_ENTRY_CB	0x05
-#define CISTPL_LONGLINK_MFC	0x06
-#define CISTPL_BAR		0x07
-#define CISTPL_CHECKSUM		0x10
-#define CISTPL_LONGLINK_A	0x11
-#define CISTPL_LONGLINK_C	0x12
-#define CISTPL_LINKTARGET	0x13
-#define CISTPL_NO_LINK		0x14
-#define CISTPL_VERS_1		0x15
-#define CISTPL_ALTSTR		0x16
-#define CISTPL_DEVICE_A		0x17
-#define CISTPL_JEDEC_C		0x18
-#define CISTPL_JEDEC_A		0x19
-#define CISTPL_CONFIG		0x1a
-#define CISTPL_CFTABLE_ENTRY	0x1b
-#define CISTPL_DEVICE_OC	0x1c
-#define CISTPL_DEVICE_OA	0x1d
-#define CISTPL_DEVICE_GEO	0x1e
-#define CISTPL_DEVICE_GEO_A	0x1f
-#define CISTPL_MANFID		0x20
-#define CISTPL_FUNCID		0x21
-#define CISTPL_FUNCE		0x22
-#define CISTPL_SWIL		0x23
-#define CISTPL_END		0xff
-
-/* FUNCID */
-
-#define CISTPL_FUNCID_MULTI	0x00
-#define CISTPL_FUNCID_MEMORY	0x01
-#define CISTPL_FUNCID_SERIAL	0x02
-#define CISTPL_FUNCID_PARALLEL	0x03
-#define CISTPL_FUNCID_FIXED	0x04
-#define CISTPL_FUNCID_VIDEO	0x05
-#define CISTPL_FUNCID_NETWORK	0x06
-#define CISTPL_FUNCID_AIMS	0x07
-#define CISTPL_FUNCID_SCSI	0x08
+#if IS_ENABLED(CONFIG_PCMCIA)
+extern int pcmcia_parse_tuple(tuple_t *cftuple, cisparse_t *cfparse);
+#endif
 
 #endif
-- 
2.17.1


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

* [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support
  2021-11-09  4:02 [PATCH v9 0/3] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  2021-11-09  4:02 ` [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h Michael Schmitz
@ 2021-11-09  4:02 ` Michael Schmitz
  2021-11-09  8:15   ` Geert Uytterhoeven
  2021-11-09  4:02 ` [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
  2 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09  4:02 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 d41fa488453b..abb9e5ddb012 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -61,12 +61,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
@@ -97,6 +95,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
@@ -132,6 +132,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
@@ -148,6 +149,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
@@ -161,6 +163,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
     default: return 0; /* avoid warnings, just in case */
@@ -174,6 +177,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
@@ -190,6 +194,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
@@ -200,7 +205,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))
@@ -254,6 +259,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.17.1


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

* [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09  4:02 [PATCH v9 0/3] Add APNE PCMCIA 100 Mbit support Michael Schmitz
  2021-11-09  4:02 ` [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h Michael Schmitz
  2021-11-09  4:02 ` [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
@ 2021-11-09  4:02 ` Michael Schmitz
  2021-11-09  4:09   ` Randy Dunlap
  2 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09  4:02 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.

Select core PCMCIA support modules for use by APNE driver.

10 Mbit and 100 Mbit mode are supported by the same module.
Use the core 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. Code to reset the PCMCIA
hardware required for 16 bit cards is also added to the driver
probe.

An optional module parameter switches Amiga ISA IO accessors
to 8 or 16 bit access in case autoprobe fails.

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 v8:

Geert Uytterhoeven:
- cistpl.h definitions now provided through amipcmcia.h
- really change module parameter to (signed) int

Changes from v7:

- move 'select' for PCCARD and PCMCIA to 8390 Kconfig, so
  Amiga pcmcia.c may remain built-in while core PCMCIA
  code can be built as modules if APNE driver is a module.
- move 16 bit mode autoprobe code from amiga/pcmcia.c to this
  driver, to allow the core PCMCIA code we depend on to be
  built as modules.
- change module parameter type from bool to int to allow for
  tri-state semantics (autoprobe, 8 bit, 16 bit).

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

change module parameter - 0 for 8 bit, 1 for 16 bit, else autoprobe
---
 drivers/net/ethernet/8390/Kconfig |  9 ++++
 drivers/net/ethernet/8390/apne.c  | 68 +++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
index a4130e643342..b22c3cf96560 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -136,6 +136,8 @@ config NE2K_PCI
 config APNE
 	tristate "PCMCIA NE2000 support"
 	depends on AMIGA_PCMCIA
+	select PCCARD
+	select PCMCIA
 	select CRC32
 	help
 	  If you have a PCMCIA NE2000 compatible adapter, say Y.  Otherwise,
@@ -144,6 +146,13 @@ 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. Use apne.100mbit=0
+	  should autoprobe mis-detect a 100 Mbit card.
+
 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 da1ae37a9d73..74dcad8563d4 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -87,6 +87,7 @@ static void apne_block_output(struct net_device *dev, const int count,
 static irqreturn_t apne_interrupt(int irq, void *dev_id);
 
 static int init_pcmcia(void);
+static int pcmcia_is_16bit(void);
 
 /* IO base address used for nic */
 
@@ -119,6 +120,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 int apne_100_mbit = -1;
+module_param_named(100_mbit, apne_100_mbit, int, 0444);
+MODULE_PARM_DESC(100_mbit, "Enable 100 Mbit support");
+
 static struct net_device * __init apne_probe(void)
 {
 	struct net_device *dev;
@@ -140,6 +145,13 @@ static struct net_device * __init apne_probe(void)
 
 	pr_info("Looking for PCMCIA ethernet card : ");
 
+	if (apne_100_mbit == 1)
+		isa_type = ISA_TYPE_AG16;
+	else if (apne_100_mbit == 0)
+		isa_type = ISA_TYPE_AG;
+	else
+		pr_cont(" (autoprobing 16 bit mode) ");
+
 	/* check if a card is inserted */
 	if (!(PCMCIA_INSERTED)) {
 		pr_cont("NO PCMCIA card inserted\n");
@@ -167,6 +179,14 @@ static struct net_device * __init apne_probe(void)
 
 	pr_cont("ethernet PCMCIA card inserted\n");
 
+#if IS_ENABLED(CONFIG_PCMCIA)
+	if (apne_100_mbit < 0 && pcmcia_is_16bit()) {
+		pr_info("16-bit PCMCIA card detected!\n");
+		isa_type = ISA_TYPE_AG16;
+		apne_100_mbit = 1;
+	}
+#endif
+
 	if (!init_pcmcia()) {
 		/* XXX: shouldn't we re-enable irq here? */
 		free_netdev(dev);
@@ -583,6 +603,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);
@@ -616,4 +646,42 @@ static int init_pcmcia(void)
 	return 1;
 }
 
+#if IS_ENABLED(CONFIG_PCMCIA)
+static 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, (cisparse_t *)&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;
+}
+#endif
+
 MODULE_LICENSE("GPL");
-- 
2.17.1


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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09  4:02 ` [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
@ 2021-11-09  4:09   ` Randy Dunlap
  2021-11-09  4:55     ` Michael Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2021-11-09  4:09 UTC (permalink / raw)
  To: Michael Schmitz, linux-m68k, geert; +Cc: alex, netdev

On 11/8/21 8:02 PM, Michael Schmitz wrote:
> diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
> index a4130e643342..b22c3cf96560 100644
> --- a/drivers/net/ethernet/8390/Kconfig
> +++ b/drivers/net/ethernet/8390/Kconfig
> @@ -136,6 +136,8 @@ config NE2K_PCI
>   config APNE
>   	tristate "PCMCIA NE2000 support"
>   	depends on AMIGA_PCMCIA
> +	select PCCARD
> +	select PCMCIA
>   	select CRC32

Hi,

There are no other drivers that "select PCCARD" or
"select PCMCIA" in the entire kernel tree.
I don't see any good justification to allow it here.

-- 
~Randy

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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09  4:09   ` Randy Dunlap
@ 2021-11-09  4:55     ` Michael Schmitz
  2021-11-09  5:44       ` Randy Dunlap
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09  4:55 UTC (permalink / raw)
  To: Randy Dunlap, linux-m68k, geert; +Cc: alex, netdev

Hi Randy,

On 09/11/21 17:09, Randy Dunlap wrote:
> On 11/8/21 8:02 PM, Michael Schmitz wrote:
>> diff --git a/drivers/net/ethernet/8390/Kconfig
>> b/drivers/net/ethernet/8390/Kconfig
>> index a4130e643342..b22c3cf96560 100644
>> --- a/drivers/net/ethernet/8390/Kconfig
>> +++ b/drivers/net/ethernet/8390/Kconfig
>> @@ -136,6 +136,8 @@ config NE2K_PCI
>>   config APNE
>>       tristate "PCMCIA NE2000 support"
>>       depends on AMIGA_PCMCIA
>> +    select PCCARD
>> +    select PCMCIA
>>       select CRC32
>
> Hi,
>
> There are no other drivers that "select PCCARD" or
> "select PCMCIA" in the entire kernel tree.
> I don't see any good justification to allow it here.

Amiga doesn't use anything from the core PCMCIA code, instead providing 
its own basic PCMCIA support code.

I had initially duplicated some of the cis tuple parser code, but 
decided to use what's already there instead.

I can drop these selects, and add instructions to manually select these 
options in the Kconfig help section. Seemed a little error prone to me.

Cheers,

	Michael



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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09  4:55     ` Michael Schmitz
@ 2021-11-09  5:44       ` Randy Dunlap
  2021-11-09 19:19         ` Michael Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2021-11-09  5:44 UTC (permalink / raw)
  To: Michael Schmitz, linux-m68k, geert; +Cc: alex, netdev

On 11/8/21 8:55 PM, Michael Schmitz wrote:
> Hi Randy,
> 
> On 09/11/21 17:09, Randy Dunlap wrote:
>> On 11/8/21 8:02 PM, Michael Schmitz wrote:
>>> diff --git a/drivers/net/ethernet/8390/Kconfig
>>> b/drivers/net/ethernet/8390/Kconfig
>>> index a4130e643342..b22c3cf96560 100644
>>> --- a/drivers/net/ethernet/8390/Kconfig
>>> +++ b/drivers/net/ethernet/8390/Kconfig
>>> @@ -136,6 +136,8 @@ config NE2K_PCI
>>>   config APNE
>>>       tristate "PCMCIA NE2000 support"
>>>       depends on AMIGA_PCMCIA
>>> +    select PCCARD
>>> +    select PCMCIA
>>>       select CRC32
>>
>> Hi,
>>
>> There are no other drivers that "select PCCARD" or
>> "select PCMCIA" in the entire kernel tree.
>> I don't see any good justification to allow it here.
> 
> Amiga doesn't use anything from the core PCMCIA code, instead providing its own basic PCMCIA support code.
> 
> I had initially duplicated some of the cis tuple parser code, but decided to use what's already there instead.
> 
> I can drop these selects, and add instructions to manually select these options in the Kconfig help section. Seemed a little error prone to me.

Just make it the same as other drivers in this respect, please.

-- 
~Randy

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

* Re: [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h
  2021-11-09  4:02 ` [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h Michael Schmitz
@ 2021-11-09  8:14   ` Geert Uytterhoeven
  0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2021-11-09  8:14 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k, ALeX Kazik

Hi Michael,

On Tue, Nov 9, 2021 at 5:03 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> Add the interface definition for 16 bit card autoprobing (using
> the generic PCMCIA cftable entry parser) to amipcmcia.h for use
> by apne.c. Include necessary cftable definitions from cistpl.h,
> remove locally duplicate definitions from amipcmcia.h.
>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>
> --
>
> Changes from v8:
>
> Geert Uytterhoeven:
>
> - just include pcmcia/cistpl.h; declare pcmcia_parse_tuple()
>   only if core PCMCIA code is included

Thanks for the update!

> --- a/arch/m68k/include/asm/amipcmcia.h
> +++ b/arch/m68k/include/asm/amipcmcia.h
> @@ -13,6 +13,7 @@
>  #ifndef __AMIGA_PCMCIA_H__
>  #define __AMIGA_PCMCIA_H__
>
> +#include <pcmcia/cistpl.h>
>  #include <asm/amigayle.h>
>
>  /* prototypes */
> @@ -64,47 +65,8 @@ static inline void pcmcia_disable_irq(void)
>  #define PCMCIA_SPEED_250NS     250
>  #define PCMCIA_SPEED_720NS     720
>
> -/* PCMCIA Tuple codes */
> -
> -#define CISTPL_NULL            0x00
> -#define CISTPL_DEVICE          0x01
> -#define CISTPL_LONGLINK_CB     0x02
> -#define CISTPL_CONFIG_CB       0x04
> -#define CISTPL_CFTABLE_ENTRY_CB        0x05
> -#define CISTPL_LONGLINK_MFC    0x06
> -#define CISTPL_BAR             0x07
> -#define CISTPL_CHECKSUM                0x10
> -#define CISTPL_LONGLINK_A      0x11
> -#define CISTPL_LONGLINK_C      0x12
> -#define CISTPL_LINKTARGET      0x13
> -#define CISTPL_NO_LINK         0x14
> -#define CISTPL_VERS_1          0x15
> -#define CISTPL_ALTSTR          0x16
> -#define CISTPL_DEVICE_A                0x17
> -#define CISTPL_JEDEC_C         0x18
> -#define CISTPL_JEDEC_A         0x19
> -#define CISTPL_CONFIG          0x1a
> -#define CISTPL_CFTABLE_ENTRY   0x1b
> -#define CISTPL_DEVICE_OC       0x1c
> -#define CISTPL_DEVICE_OA       0x1d
> -#define CISTPL_DEVICE_GEO      0x1e
> -#define CISTPL_DEVICE_GEO_A    0x1f
> -#define CISTPL_MANFID          0x20
> -#define CISTPL_FUNCID          0x21
> -#define CISTPL_FUNCE           0x22
> -#define CISTPL_SWIL            0x23
> -#define CISTPL_END             0xff
> -
> -/* FUNCID */
> -
> -#define CISTPL_FUNCID_MULTI    0x00
> -#define CISTPL_FUNCID_MEMORY   0x01
> -#define CISTPL_FUNCID_SERIAL   0x02
> -#define CISTPL_FUNCID_PARALLEL 0x03
> -#define CISTPL_FUNCID_FIXED    0x04
> -#define CISTPL_FUNCID_VIDEO    0x05
> -#define CISTPL_FUNCID_NETWORK  0x06
> -#define CISTPL_FUNCID_AIMS     0x07
> -#define CISTPL_FUNCID_SCSI     0x08
> +#if IS_ENABLED(CONFIG_PCMCIA)
> +extern int pcmcia_parse_tuple(tuple_t *cftuple, cisparse_t *cfparse);
> +#endif

Why the #ifdef? Can't it be defined unconditionally?

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

* Re: [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support
  2021-11-09  4:02 ` [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
@ 2021-11-09  8:15   ` Geert Uytterhoeven
  0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2021-11-09  8:15 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k, ALeX Kazik

On Tue, Nov 9, 2021 at 5:03 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> 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>

You forgot to add my tag ;-)

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09  5:44       ` Randy Dunlap
@ 2021-11-09 19:19         ` Michael Schmitz
  2021-11-09 19:25           ` Randy Dunlap
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09 19:19 UTC (permalink / raw)
  To: Randy Dunlap, linux-m68k, geert; +Cc: alex, netdev

Hi Randy,

On 09/11/21 18:44, Randy Dunlap wrote:
> On 11/8/21 8:55 PM, Michael Schmitz wrote:
>> Hi Randy,
>>
>> On 09/11/21 17:09, Randy Dunlap wrote:
>>> On 11/8/21 8:02 PM, Michael Schmitz wrote:
>>>> diff --git a/drivers/net/ethernet/8390/Kconfig
>>>> b/drivers/net/ethernet/8390/Kconfig
>>>> index a4130e643342..b22c3cf96560 100644
>>>> --- a/drivers/net/ethernet/8390/Kconfig
>>>> +++ b/drivers/net/ethernet/8390/Kconfig
>>>> @@ -136,6 +136,8 @@ config NE2K_PCI
>>>>   config APNE
>>>>       tristate "PCMCIA NE2000 support"
>>>>       depends on AMIGA_PCMCIA
>>>> +    select PCCARD
>>>> +    select PCMCIA
>>>>       select CRC32
>>>
>>> Hi,
>>>
>>> There are no other drivers that "select PCCARD" or
>>> "select PCMCIA" in the entire kernel tree.
>>> I don't see any good justification to allow it here.
>>
>> Amiga doesn't use anything from the core PCMCIA code, instead
>> providing its own basic PCMCIA support code.
>>
>> I had initially duplicated some of the cis tuple parser code, but
>> decided to use what's already there instead.
>>
>> I can drop these selects, and add instructions to manually select
>> these options in the Kconfig help section. Seemed a little error prone
>> to me.
>
> Just make it the same as other drivers in this respect, please.

"depends on PCMCIA" is what I've seen for other drivers. That is not 
really appropriate for the APNE driver (8 bit cards work fine with just 
the support code from arch/m68k/amiga/pcmcia.c).

Please confirm that "depends on PCMCIA" is what you want me to use?

Cheers,

	Michael


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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09 19:19         ` Michael Schmitz
@ 2021-11-09 19:25           ` Randy Dunlap
  2021-11-09 19:39             ` Michael Schmitz
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2021-11-09 19:25 UTC (permalink / raw)
  To: Michael Schmitz, linux-m68k, geert; +Cc: alex, netdev

On 11/9/21 11:19 AM, Michael Schmitz wrote:
> Hi Randy,
> 
> On 09/11/21 18:44, Randy Dunlap wrote:
>> On 11/8/21 8:55 PM, Michael Schmitz wrote:
>>> Hi Randy,
>>>
>>> On 09/11/21 17:09, Randy Dunlap wrote:
>>>> On 11/8/21 8:02 PM, Michael Schmitz wrote:
>>>>> diff --git a/drivers/net/ethernet/8390/Kconfig
>>>>> b/drivers/net/ethernet/8390/Kconfig
>>>>> index a4130e643342..b22c3cf96560 100644
>>>>> --- a/drivers/net/ethernet/8390/Kconfig
>>>>> +++ b/drivers/net/ethernet/8390/Kconfig
>>>>> @@ -136,6 +136,8 @@ config NE2K_PCI
>>>>>   config APNE
>>>>>       tristate "PCMCIA NE2000 support"
>>>>>       depends on AMIGA_PCMCIA
>>>>> +    select PCCARD
>>>>> +    select PCMCIA
>>>>>       select CRC32
>>>>
>>>> Hi,
>>>>
>>>> There are no other drivers that "select PCCARD" or
>>>> "select PCMCIA" in the entire kernel tree.
>>>> I don't see any good justification to allow it here.
>>>
>>> Amiga doesn't use anything from the core PCMCIA code, instead
>>> providing its own basic PCMCIA support code.
>>>
>>> I had initially duplicated some of the cis tuple parser code, but
>>> decided to use what's already there instead.
>>>
>>> I can drop these selects, and add instructions to manually select
>>> these options in the Kconfig help section. Seemed a little error prone
>>> to me.
>>
>> Just make it the same as other drivers in this respect, please.
> 
> "depends on PCMCIA" is what I've seen for other drivers. That is not really appropriate for the APNE driver (8 bit cards work fine with just the support code from arch/m68k/amiga/pcmcia.c).
> 
> Please confirm that "depends on PCMCIA" is what you want me to use?

Hi Michael,

I don't want to see this driver using 'select', so that probably only
leaves "depends on".
But if you or Geert tell me that I am bonkers, so be it. :)

Thanks.
-- 
~Randy

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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09 19:25           ` Randy Dunlap
@ 2021-11-09 19:39             ` Michael Schmitz
  2021-11-10  8:27               ` Geert Uytterhoeven
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Schmitz @ 2021-11-09 19:39 UTC (permalink / raw)
  To: Randy Dunlap, linux-m68k, geert; +Cc: alex, netdev

Geert,

On 10/11/21 08:25, Randy Dunlap wrote:
>>>>> There are no other drivers that "select PCCARD" or
>>>>> "select PCMCIA" in the entire kernel tree.
>>>>> I don't see any good justification to allow it here.
>>>>
>>>> Amiga doesn't use anything from the core PCMCIA code, instead
>>>> providing its own basic PCMCIA support code.
>>>>
>>>> I had initially duplicated some of the cis tuple parser code, but
>>>> decided to use what's already there instead.
>>>>
>>>> I can drop these selects, and add instructions to manually select
>>>> these options in the Kconfig help section. Seemed a little error prone
>>>> to me.
>>>
>>> Just make it the same as other drivers in this respect, please.
>>
>> "depends on PCMCIA" is what I've seen for other drivers. That is not
>> really appropriate for the APNE driver (8 bit cards work fine with
>> just the support code from arch/m68k/amiga/pcmcia.c).
>>
>> Please confirm that "depends on PCMCIA" is what you want me to use?
>
> Hi Michael,
>
> I don't want to see this driver using 'select', so that probably only
> leaves "depends on".
> But if you or Geert tell me that I am bonkers, so be it. :)

Are you OK with adding CONFIG_PCCARD=y and CONFIG_PCMCIA=y to 
amiga_defconfig to allow APNE to still be built when changed to depend 
on PCMCIA?

Cheers,

	Michael

>
> Thanks.

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

* Re: [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver
  2021-11-09 19:39             ` Michael Schmitz
@ 2021-11-10  8:27               ` Geert Uytterhoeven
  0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2021-11-10  8:27 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Randy Dunlap, Linux/m68k, ALeX Kazik, netdev

Hi Michael,

On Tue, Nov 9, 2021 at 8:39 PM Michael Schmitz <schmitzmic@gmail.com> wrote:
> On 10/11/21 08:25, Randy Dunlap wrote:
> >>>>> There are no other drivers that "select PCCARD" or
> >>>>> "select PCMCIA" in the entire kernel tree.
> >>>>> I don't see any good justification to allow it here.
> >>>>
> >>>> Amiga doesn't use anything from the core PCMCIA code, instead
> >>>> providing its own basic PCMCIA support code.
> >>>>
> >>>> I had initially duplicated some of the cis tuple parser code, but
> >>>> decided to use what's already there instead.
> >>>>
> >>>> I can drop these selects, and add instructions to manually select
> >>>> these options in the Kconfig help section. Seemed a little error prone
> >>>> to me.
> >>>
> >>> Just make it the same as other drivers in this respect, please.
> >>
> >> "depends on PCMCIA" is what I've seen for other drivers. That is not
> >> really appropriate for the APNE driver (8 bit cards work fine with
> >> just the support code from arch/m68k/amiga/pcmcia.c).
> >>
> >> Please confirm that "depends on PCMCIA" is what you want me to use?
> >
> > Hi Michael,
> >
> > I don't want to see this driver using 'select', so that probably only
> > leaves "depends on".
> > But if you or Geert tell me that I am bonkers, so be it. :)
>
> Are you OK with adding CONFIG_PCCARD=y and CONFIG_PCMCIA=y to
> amiga_defconfig to allow APNE to still be built when changed to depend
> on PCMCIA?

Sure.  When they become dependencies for APNE, I will update them in
the next defconfig refresh.

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

end of thread, other threads:[~2021-11-10  8:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09  4:02 [PATCH v9 0/3] Add APNE PCMCIA 100 Mbit support Michael Schmitz
2021-11-09  4:02 ` [PATCH v9 1/3] m68k: amiga/pcmcia - add 16 bit detection interface to amipcmcia.h Michael Schmitz
2021-11-09  8:14   ` Geert Uytterhoeven
2021-11-09  4:02 ` [PATCH v9 2/3] m68k: io_mm.h - add APNE 100 MBit support Michael Schmitz
2021-11-09  8:15   ` Geert Uytterhoeven
2021-11-09  4:02 ` [PATCH net v9 3/3] net/8390: apne.c - add 100 Mbit support to apne.c driver Michael Schmitz
2021-11-09  4:09   ` Randy Dunlap
2021-11-09  4:55     ` Michael Schmitz
2021-11-09  5:44       ` Randy Dunlap
2021-11-09 19:19         ` Michael Schmitz
2021-11-09 19:25           ` Randy Dunlap
2021-11-09 19:39             ` Michael Schmitz
2021-11-10  8:27               ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox