linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
@ 2001-07-01 22:07 Adam J. Richter
  2001-07-02 12:38 ` Steven J. Hill
  2001-07-02 12:53 ` David Woodhouse
  0 siblings, 2 replies; 8+ messages in thread
From: Adam J. Richter @ 2001-07-01 22:07 UTC (permalink / raw)
  To: dwmw2, linux-kernel, sjhill


	linux-2.4.6-pre8/drivers/mtd/nand/spia.c references four
undefined symbols, presumably intended to be #define constants,
although I am not sure what their values are supposed to be:

	IO_BASE
	FIO_BASE
	PEDR
	PEDDR

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-01 22:07 linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols Adam J. Richter
@ 2001-07-02 12:38 ` Steven J. Hill
  2001-07-02 12:52   ` Alan Cox
  2001-07-02 12:53 ` David Woodhouse
  1 sibling, 1 reply; 8+ messages in thread
From: Steven J. Hill @ 2001-07-02 12:38 UTC (permalink / raw)
  To: Adam J. Richter; +Cc: dwmw2, linux-kernel, linux-mtd

"Adam J. Richter" wrote:
> 
>         linux-2.4.6-pre8/drivers/mtd/nand/spia.c references four
> undefined symbols, presumably intended to be #define constants,
> although I am not sure what their values are supposed to be:
> 
>         IO_BASE
>         FIO_BASE
>         PEDR
>         PEDDR
> 
The way that I architected the raw NAND flash device driver was to
break it into 2 parts. 'nand.c' contains the actual driver code and
is considered to be device independent. 'spia.c' is the device
dependent part. You should write your own version of 'spia.c' and
"simply" fill in the addresses for the IO address and control
register address depending on your specific hardware. The above
symbols are only defined for my specific hardware. They should be
changed to values used on your hardware platform. Let me know if
you need further assistance.

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-02 12:38 ` Steven J. Hill
@ 2001-07-02 12:52   ` Alan Cox
  2001-07-02 13:14     ` David Woodhouse
  2001-07-03 17:57     ` Steven J. Hill
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Cox @ 2001-07-02 12:52 UTC (permalink / raw)
  To: sjhill; +Cc: Adam J. Richter, dwmw2, linux-kernel, linux-mtd

> The way that I architected the raw NAND flash device driver was to
> break it into 2 parts. 'nand.c' contains the actual driver code and
> is considered to be device independent. 'spia.c' is the device
> dependent part. You should write your own version of 'spia.c' and

So the Config.in is wrong since I can select spia on x86


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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-01 22:07 linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols Adam J. Richter
  2001-07-02 12:38 ` Steven J. Hill
@ 2001-07-02 12:53 ` David Woodhouse
  1 sibling, 0 replies; 8+ messages in thread
From: David Woodhouse @ 2001-07-02 12:53 UTC (permalink / raw)
  To: sjhill; +Cc: Adam J. Richter, linux-kernel, linux-mtd


sjhill@cotw.com said:
>  'spia.c' is the device dependent part. You should write your own
> version of 'spia.c' and "simply" fill in the addresses for the IO
> address and control register address depending on your specific
> hardware. The above symbols are only defined for my specific hardware.

Where are those four variables defined? In platform-dependent code for your 
board? If so, we should probably make the config option dependent on that 
platform. 

That'll make ESR whinge at me if support for your platform isn't (yet) in 
Linus' tree - but I don't care too much about that.

--
dwmw2



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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-02 12:52   ` Alan Cox
@ 2001-07-02 13:14     ` David Woodhouse
  2001-07-03 17:57     ` Steven J. Hill
  1 sibling, 0 replies; 8+ messages in thread
From: David Woodhouse @ 2001-07-02 13:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: sjhill, Adam J. Richter, linux-kernel, linux-mtd


alan@lxorguk.ukuu.org.uk said:
>  So the Config.in is wrong since I can select spia on x86 

Yep. I've added a few more dependencies like that to the map drivers too. I
heard rumours that someone else had done similar changes, but nobody sent me
a patch so those rumours can't be true.

I'll wait for Steven to fix this up and then send all those changes to
Linus.

Assuming, that is, that nobody else takes it upon themselves to keep
resending small bits of the pending changes, gratuitously making it harder
to me to keep in sync.

--
dwmw2



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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-02 12:52   ` Alan Cox
  2001-07-02 13:14     ` David Woodhouse
@ 2001-07-03 17:57     ` Steven J. Hill
  1 sibling, 0 replies; 8+ messages in thread
From: Steven J. Hill @ 2001-07-03 17:57 UTC (permalink / raw)
  To: Alan Cox; +Cc: Adam J. Richter, dwmw2, linux-kernel, linux-mtd, torvalds

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

Alan Cox wrote:
> 
> > The way that I architected the raw NAND flash device driver was to
> > break it into 2 parts. 'nand.c' contains the actual driver code and
> > is considered to be device independent. 'spia.c' is the device
> > dependent part. You should write your own version of 'spia.c' and
> 
> So the Config.in is wrong since I can select spia on x86
> 
Indeed. That should be fixed now with this patch. Now onto the stuff
for ESR.

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

[-- Attachment #2: spia.diff --]
[-- Type: application/octet-stream, Size: 3194 bytes --]

diff -urN linux-2.4.6-pre9/drivers/mtd/nand/Config.in linux-2.4.6-pre9-patched/drivers/mtd/nand/Config.in
--- linux-2.4.6-pre9/drivers/mtd/nand/Config.in	Tue Jul  3 11:29:01 2001
+++ linux-2.4.6-pre9-patched/drivers/mtd/nand/Config.in	Tue Jul  3 12:51:19 2001
@@ -1,6 +1,6 @@
 # drivers/mtd/nand/Config.in
 
-# $Id: Config.in,v 1.1 2001/04/20 15:27:38 dwmw2 Exp $
+# $Id: Config.in,v 1.3 2001/07/03 17:50:56 sjhill Exp $
 
 mainmenu_option next_comment
 
@@ -11,6 +11,8 @@
    bool '    Enable ECC correction algorithm'  CONFIG_MTD_NAND_ECC y
    bool '    Verify NAND page writes' CONFIG_MTD_NAND_VERIFY_WRITE y
 fi
-dep_tristate '  NAND Flash device on SPIA board' CONFIG_MTD_NAND_SPIA $CONFIG_MTD_NAND
+if [ "$CONFIG_ARM" = "y" -a "$CONFIG_ARCH_P720T" = "y" ]; then
+   dep_tristate '  NAND Flash device on SPIA board' CONFIG_MTD_NAND_SPIA $CONFIG_MTD_NAND
+fi
 
 endmenu
diff -urN linux-2.4.6-pre9/drivers/mtd/nand/spia.c linux-2.4.6-pre9-patched/drivers/mtd/nand/spia.c
--- linux-2.4.6-pre9/drivers/mtd/nand/spia.c	Tue Jul  3 11:29:01 2001
+++ linux-2.4.6-pre9-patched/drivers/mtd/nand/spia.c	Tue Jul  3 12:51:14 2001
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2000 Steven J. Hill (sjhill@cotw.com)
  *
- * $Id: spia.c,v 1.9 2001/06/02 14:47:16 dwmw2 Exp $
+ * $Id: spia.c,v 1.11 2001/07/03 17:50:56 sjhill Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -28,6 +28,22 @@
 static struct mtd_info *spia_mtd = NULL;
 
 /*
+ * Values specific to the SPIA board (used with EP7212 processor)
+ */
+#define SPIA_IO_ADDR	= 0xd0000000	/* Start of EP7212 IO address space */
+#define SPIA_FIO_ADDR	= 0xf0000000	/* Address where flash is mapped */
+#define SPIA_PEDR	= 0x0080	/*
+					 * IO offset to Port E data register
+					 * where the CLE, ALE and NCE pins
+					 * are wired to.
+					 */
+#define SPIA_PEDDR	= 0x00c0	/*
+					 * IO offset to Port E data direction
+					 * register so we can control the IO
+					 * lines.
+					 */
+
+/*
  * Module stuff
  */
 #if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
@@ -35,6 +51,21 @@
   #define spia_cleanup cleanup_module
 #endif
 
+static int spia_io_base = SPIA_IO_BASE;
+static int spia_fio_base = SPIA_FIO_BASE;
+static int spia_pedr = SPIA_PEDR;
+static int spia_peddr = SPIA_PEDDR;
+
+MODULE_PARM(spia_io_base, "i");
+MODULE_PARM(spia_fio_base, "i");
+MODULE_PARM(spia_pedr, "i");
+MODULE_PARM(spia_peddr, "i");
+
+__setup("spia_io_base=",spia_io_base);
+__setup("spia_fio_base=",spia_fio_base);
+__setup("spia_pedr=",spia_pedr);
+__setup("spia_peddr=",spia_peddr);
+
 /*
  * Define partitions for flash device
  */
@@ -77,11 +108,11 @@
 	 * Set GPIO Port E control register so that the pins are configured
 	 * to be outputs for controlling the NAND flash.
 	 */
-	(*(volatile unsigned char *) (IO_BASE + PEDDR)) = 0x07;
+	(*(volatile unsigned char *) (spia_io_base + spia_peddr)) = 0x07;
 
 	/* Set address of NAND IO lines */
-	this->IO_ADDR = FIO_BASE;
-	this->CTRL_ADDR = IO_BASE + PEDR;
+	this->IO_ADDR = spia_fio_base;
+	this->CTRL_ADDR = spia_io_base + spia_pedr;
 	this->CLE = 0x01;
 	this->ALE = 0x02;
 	this->NCE = 0x04;

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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
  2001-07-03 13:10 Adam J. Richter
@ 2001-07-03 15:35 ` Steven J. Hill
  0 siblings, 0 replies; 8+ messages in thread
From: Steven J. Hill @ 2001-07-03 15:35 UTC (permalink / raw)
  To: Adam J. Richter; +Cc: dwmw2, linux-kernel, linux-mtd

"Adam J. Richter" wrote:
> 
>         If there is no architecture on which
> linux-2.4.6-pre8/drivers/mtd/nand/spia.c will compile in its
> "pristine" form, then the CONFIG_MTD_NAND_SPIA should be commented
> out from drivers/mtd/nand/Config.in to avoid wasting the time of
> users and automated build processes alike that just want to build
> all available modules by default.  (At the moment, this code is
> not even bracketed by CONFIG_EXPERIMENTAL, although changing that
> would not be a sufficient fix.)
> 
David has fixed this and it is in the MTD CVS now.

>         Alternatively, if you will send me a one line description
> of each of those four #define parameters, I will be happy to do the grunt
> work of submiting a patch to you or whoever is appropriate to replace
> those values with module and setup parameters that default to those
> values if there are #defined and otherwise will abort initialization
> if they are not #defined and no values were provided at run time.
> (Or, better, yet, you can do this work!)
> 
I have filled in the #define values and placed the new 'spia.c' into
the MTD CVS. I added comments for how those various values should be
defined. Shame on me for forgetting to comment those months ago. Sorry.
I believe that fixes things now?

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

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

* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
@ 2001-07-03 13:10 Adam J. Richter
  2001-07-03 15:35 ` Steven J. Hill
  0 siblings, 1 reply; 8+ messages in thread
From: Adam J. Richter @ 2001-07-03 13:10 UTC (permalink / raw)
  To: sjhill; +Cc: dwmw2, linux-kernel, linux-mtd

>>         linux-2.4.6-pre8/drivers/mtd/nand/spia.c references four
>> undefined symbols, presumably intended to be #define constants,
>> although I am not sure what their values are supposed to be:
>> 
>>         IO_BASE
>>         FIO_BASE
>>         PEDR
>>         PEDDR
>> 
>The way that I architected the raw NAND flash device driver was to
>break it into 2 parts. 'nand.c' contains the actual driver code and
>is considered to be device independent. 'spia.c' is the device
>dependent part. You should write your own version of 'spia.c' and
>"simply" fill in the addresses for the IO address and control
>register address depending on your specific hardware. The above
>symbols are only defined for my specific hardware. They should be
>changed to values used on your hardware platform. Let me know if
>you need further assistance.

>-Steve

>-- 
> Steven J. Hill - Embedded SW Engineer

	If there is no architecture on which
linux-2.4.6-pre8/drivers/mtd/nand/spia.c will compile in its
"pristine" form, then the CONFIG_MTD_NAND_SPIA should be commented
out from drivers/mtd/nand/Config.in to avoid wasting the time of
users and automated build processes alike that just want to build
all available modules by default.  (At the moment, this code is
not even bracketed by CONFIG_EXPERIMENTAL, although changing that
would not be a sufficient fix.)

	Alternatively, if you will send me a one line description
of each of those four #define parameters, I will be happy to do the grunt
work of submiting a patch to you or whoever is appropriate to replace
those values with module and setup parameters that default to those
values if there are #defined and otherwise will abort initialization
if they are not #defined and no values were provided at run time.
(Or, better, yet, you can do this work!)

	Please let me know how you want to proceed.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."



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

end of thread, other threads:[~2001-07-03 18:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-01 22:07 linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols Adam J. Richter
2001-07-02 12:38 ` Steven J. Hill
2001-07-02 12:52   ` Alan Cox
2001-07-02 13:14     ` David Woodhouse
2001-07-03 17:57     ` Steven J. Hill
2001-07-02 12:53 ` David Woodhouse
2001-07-03 13:10 Adam J. Richter
2001-07-03 15:35 ` Steven J. Hill

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).