All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: PARISC list <parisc-linux@lists.parisc-linux.org>
Cc: parisc-linux-cvs@lists.parisc-linux.org
Subject: [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 jejb
Date: 03 Sep 2003 12:56:00 -0400	[thread overview]
Message-ID: <1062608161.2251.27.camel@mulgrave> (raw)
In-Reply-To: <20030903165113.138BF494064@palinux.hppa>

On Wed, 2003-09-03 at 12:51, James Bottomley wrote:
> CVSROOT:	/var/cvs
> Module name:	linux-2.6
> Changes by:	jejb	03/09/03 10:51:13
> 
> Modified files:
> 	.              : Makefile 
> 	drivers/net/tulip: eeprom.c tulip.h tulip_core.c 
> 	drivers/parisc : dino.c 
> 
> Log message:
> Fix card mode dino support and make HSC FX (tulip) card work

Patch is in two parts:  dino bit just corrects some thinkos in the card
mode dino code and adds the actual dino device to the prints (useful for
debugging if you have more than one dino).

The tulip fix simply adds the card to the tulip card table and makes it
all work.

I've tested this on my C360...however, I had to hack the ccio window to
get that to work...I need more time to make this code better.

James

===== drivers/net/tulip/eeprom.c 1.9 vs edited =====
--- 1.9/drivers/net/tulip/eeprom.c	Mon Oct 28 23:14:42 2002
+++ edited/drivers/net/tulip/eeprom.c	Wed Sep  3 11:41:24 2003
@@ -93,8 +93,13 @@
 #ifdef __hppa__
 	unsigned char *ee_data = tp->eeprom;
 
-	if (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
-		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10) {
+	/* NOTE: The 3x5 FF cards the ee_data is trying to recognise
+	 * need to be brought properly under the tulip initialisation
+	 * structure */
+
+	if ((tp->flags & NEEDS_FAKE_MEDIA_TABLE) 
+	    || (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
+		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10)) {
 
 		static unsigned char leafdata[] =
 			{ 0x01,       /* phy number */
===== drivers/net/tulip/tulip.h 1.15 vs edited =====
--- 1.15/drivers/net/tulip/tulip.h	Sun May 25 22:14:37 2003
+++ edited/drivers/net/tulip/tulip.h	Wed Sep  3 11:27:00 2003
@@ -64,6 +64,8 @@
 	COMET_MAC_ADDR		= 0x0800,
 	HAS_PCI_MWI		= 0x1000,
 	HAS_PHY_IRQ		= 0x2000,
+	HAS_SWAPPED_SEEPROM	= 0x4000,
+	NEEDS_FAKE_MEDIA_TABLE	= 0x8000,
 };
 

@@ -86,6 +88,7 @@
 	I21145,
 	DM910X,
 	CONEXANT,
+	HP_D21140,
 };
 

===== drivers/net/tulip/tulip_core.c 1.48 vs edited =====
--- 1.48/drivers/net/tulip/tulip_core.c	Tue Aug 19 22:53:17 2003
+++ edited/drivers/net/tulip/tulip_core.c	Wed Sep  3 11:42:48 2003
@@ -191,10 +191,17 @@
   /* RS7112 */
   { "Conexant LANfinity", 256, 0x0001ebef,
 	HAS_MII | HAS_ACPI, tulip_timer },
+
+  /* HP_D21140 */
+  { "HSC 100BaseTX Workstation single port (Digital DS21140 Tulip)", 128,
+    0x0001ebef,	HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI 
+    | HAS_SWAPPED_SEEPROM | NEEDS_FAKE_MEDIA_TABLE, tulip_timer },
+
 };
 

 static struct pci_device_id tulip_pci_tbl[] = {
+	{ 0x1011, 0x0009, 0x103c, 0x1062, 0, 0, HP_D21140 },
 	{ 0x1011, 0x0009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 },
 	{ 0x1011, 0x0019, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21143 },
 	{ 0x11AD, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, LC82C168 },
@@ -1459,9 +1466,10 @@
 		int sa_offset = 0;
 		int ee_addr_size = tulip_read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
 
-		for (i = 0; i < sizeof(tp->eeprom)/2; i++)
-			((u16 *)ee_data)[i] =
-				le16_to_cpu(tulip_read_eeprom(ioaddr, i, ee_addr_size));
+		for (i = 0; i < sizeof(tp->eeprom)/2; i++) {
+			u16 data = tulip_read_eeprom(ioaddr, i, ee_addr_size);
+			((u16 *)ee_data)[i] = (tp->flags & HAS_SWAPPED_SEEPROM) ? data : le16_to_cpu(data);
+		}
 
 		/* DEC now has a specification (see Notes) but early board makers
 		   just put the address in the first EEPROM locations. */
===== drivers/parisc/dino.c 1.10 vs edited =====
--- 1.10/drivers/parisc/dino.c	Sun Aug 24 06:50:06 2003
+++ edited/drivers/parisc/dino.c	Wed Sep  3 11:48:51 2003
@@ -401,23 +401,7 @@
 	{
 		int irq;
 
-		/*
-		 * Perform a binary search on set bits.
-		 * `Less than Fatal' and PS2 interrupts aren't supported.
-		 */
-		if (mask & 0xf) {
-			if (mask & 0x3) {
-				irq = (mask & 0x1) ? 0 : 1; /* PCI INT A, B */
-			} else {
-				irq = (mask & 0x4) ? 2 : 3; /* PCI INT C, D */
-			}
-		} else {
-			if (mask & 0x30) {
-				irq = (mask & 0x10) ? 4 : 5; /* PCI INT E, F */
-			} else {
-				irq = (mask & 0x40) ? 6 : 10; /* GSC, RS232 */
-			}
-		}
+		irq = __ffs(mask);
 
 		mask &= ~(1<<irq);
 
@@ -479,9 +463,18 @@
 	int i;
 	struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->dev));
 	struct resource *res;
+	char name[128];
+	int size;
 
 	res = &dino_dev->hba.lmmio_space;
 	res->flags = IORESOURCE_MEM;
+	size = snprintf(name, sizeof(name), "Dino LMMIO (%s)", bus->dev->bus_id);
+	res->name = kmalloc(size+1, GFP_KERNEL);
+	if(res->name)
+		strcpy((char *)res->name, name);
+	else
+		res->name = dino_dev->hba.lmmio_space.name;
+	
 
 	if (ccio_allocate_resource(dino_dev->hba.dev, res, _8MB,
 				(unsigned long) 0xfffffffff0000000UL | _8MB,
@@ -521,7 +514,7 @@
 	** Set Latency Timer to 0xff (not a shared bus)
 	** Set CACHELINE_SIZE.
 	*/
-	dino_cfg_write(dev->bus, dev->devfn, PCI_CACHE_LINE_SIZE, 16, 0xff00 | L1_CACHE_BYTES/4); 
+	dino_cfg_write(dev->bus, dev->devfn, PCI_CACHE_LINE_SIZE, 2, 0xff00 | L1_CACHE_BYTES/4); 
 
 	/*
 	** Program INT_LINE for card-mode devices.
@@ -532,13 +525,14 @@
 	** "-1" converts INTA-D (1-4) to PCIINTA-D (0-3) range.
 	** The additional "-1" adjusts for skewing the IRQ<->slot.
 	*/
-	dino_cfg_read(dev->bus, dev->devfn, PCI_INTERRUPT_PIN, 8, &irq_pin); 
+	dino_cfg_read(dev->bus, dev->devfn, PCI_INTERRUPT_PIN, 1, &irq_pin); 
+	printk("DINO CONFIG READ GIVES irq_pin %d\n", irq_pin);
 	dev->irq = (irq_pin + PCI_SLOT(dev->devfn) - 1) % 4 ;
 
 	/* Shouldn't really need to do this but it's in case someone tries
 	** to bypass PCI services and look at the card themselves.
 	*/
-	dino_cfg_write(dev->bus, dev->devfn, PCI_INTERRUPT_LINE, 8, dev->irq); 
+	dino_cfg_write(dev->bus, dev->devfn, PCI_INTERRUPT_LINE, 1, dev->irq); 
 }
 

@@ -818,8 +812,15 @@
 {
 	struct dino_device *dino_dev;	// Dino specific control struct
 	const char *version = "unknown";
-	const char *name = "Dino";
+	const int name_len = 32;
+	char *name;
 	int is_cujo = 0;
+
+	name = kmalloc(name_len, GFP_KERNEL);
+	if(name)
+		snprintf(name, name_len, "Dino %s", dev->dev.bus_id);
+	else
+		name = "Dino";
 
 	if (is_card_dino(&dev->id)) {
 		version = "3.x (card mode)";

       reply	other threads:[~2003-09-03 16:56 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030903165113.138BF494064@palinux.hppa>
2003-09-03 16:56 ` James Bottomley [this message]
     [not found] <20030903200300.8B7B7494064@palinux.hppa>
2003-09-03 20:07 ` [parisc-linux] Re: [parisc-linux-cvs] linux-2.6 jejb James Bottomley
     [not found] <20030919010356.148684940A4@palinux.hppa>
2003-09-19  1:06 ` James Bottomley
2003-09-19 11:24   ` Randolph Chung
2003-09-19 14:02     ` James Bottomley
2003-09-19 18:24       ` Jim Hull
     [not found] <20030924175431.D51BC49408B@palinux.hppa>
2003-09-24 18:01 ` James Bottomley
     [not found] <20040113155603.CBCC249425A@palinux.hppa>
2004-01-13 15:58 ` James Bottomley
     [not found] <20040204182455.1CC11494191@palinux.hppa>
2004-02-05  9:20 ` Randolph Chung
2004-02-05 15:19   ` James Bottomley
2004-02-05 15:29 ` [parisc-linux] " Joel Soete
2004-02-05 20:31   ` Randolph Chung
2004-02-05 18:49     ` Joel Soete
2004-02-06  7:31 Joel Soete
2004-02-06 17:50 ` Grant Grundler
2004-02-06 18:06   ` bame
2004-02-06 19:16 ` Randolph Chung
2004-02-06 17:08   ` Joel Soete
2004-02-07  6:40     ` Randolph Chung
2004-02-09  7:26       ` Joel Soete
     [not found] <20040228212407.DB126494190@palinux.hppa>
2004-02-28 22:21 ` [parisc-linux] " Joel Soete
2004-02-28 22:42   ` James Bottomley
2004-02-29  9:39     ` Joel Soete
2004-03-04 16:39       ` Joel Soete
     [not found] <20040320210116.7A727494553@palinux.hppa>
2004-03-20 21:04 ` James Bottomley
2004-03-20 21:10   ` Helge Deller
2004-03-20 21:13     ` Helge Deller
     [not found] <20040405024740.9330F494194@palinux.hppa>
2004-04-05  2:49 ` James Bottomley
2004-04-05  2:54   ` James Bottomley
     [not found] <20040405174131.84BF1494194@palinux.hppa>
2004-04-06 13:21 ` Carlos O'Donell
2004-04-06 14:18   ` James Bottomley
2004-04-06 15:40     ` Randolph Chung
     [not found] <20040406213446.CB675494194@palinux.hppa>
2004-04-06 21:37 ` James Bottomley
     [not found] <20040407004901.031D3494194@palinux.hppa>
2004-04-07  0:54 ` James Bottomley
2004-04-08  6:15   ` Joel Soete
2004-04-08 12:36     ` James Bottomley
     [not found] <20040412154800.D31F6494194@palinux.hppa>
2004-04-12 15:55 ` James Bottomley
     [not found] <20040414174535.81173494194@palinux.hppa>
2004-04-14 17:53 ` James Bottomley
     [not found] <20040425145051.10F5C4942B8@palinux.hppa>
2004-04-25 14:55 ` James Bottomley
     [not found] <20040427171140.706074945BD@palinux.hppa>
2004-04-27 17:15 ` James Bottomley
     [not found] <20040430162037.9D2B94945CD@palinux.hppa>
2004-04-30 16:25 ` James Bottomley
     [not found] <20040501160556.D07DC4945CA@palinux.hppa>
2004-05-01 16:13 ` James Bottomley
     [not found] <20040501200312.40BB74945E1@palinux.hppa>
2004-05-01 20:09 ` James Bottomley
2004-05-03  8:57   ` Joel Soete
     [not found] <20040502161601.DC7C24945C7@palinux.hppa>
2004-05-03 20:51 ` James Bottomley
     [not found] <20040505204811.27F0C4945E4@palinux.hppa>
2004-05-05 20:50 ` James Bottomley
2004-05-06  5:05   ` Randolph Chung
2004-05-06  5:22     ` Randolph Chung
2004-05-06  9:33     ` M. Grabert
2004-05-06 13:25     ` Kyle McMartin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1062608161.2251.27.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=parisc-linux-cvs@lists.parisc-linux.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.