public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* 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
* Re: linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols
@ 2001-07-03 15:53 Adam J. Richter
  0 siblings, 0 replies; 8+ messages in thread
From: Adam J. Richter @ 2001-07-03 15:53 UTC (permalink / raw)
  To: sjhill; +Cc: dwmw2, linux-mtd

>David has fixed this and it is in the MTD CVS now.
[...]
>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. [...]

	Sounds good.  Thanks.

	By the way, here is a hand editted patch that allows those
parameters to be modified as module or kernel arguments.  I don't
know if it's worthwhile or not.  Feel free to apply or discard as
you see fit.

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

--- linux-2.4.6-pre9/drivers/mtd/nand/spia.c	Tue Jul  3 07:02:32 2001
+++ linux/drivers/mtd/nand/spia.c	Tue Jul  3 08:28:38 2001
@@ -22,6 +22,23 @@
 #include <linux/mtd/partitions.h>
 #include <asm/io.h>
 
+/* Replace these with sensible values if you want defaults that will
+   work without extra kernel arguments. */
+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);
+
 /*
  * MTD structure for SPIA board
  */
@@ -77,11 +112,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
[parent not found: <200107012207.PAA01921@adam.yggdrasil.com>]

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-03 13:10 linux-2.4.6-pre8/drivers/mtd/nand/spia.c: undefined symbols Adam J. Richter
2001-07-03 15:35 ` Steven J. Hill
  -- strict thread matches above, loose matches on Subject: below --
2001-07-03 15:53 Adam J. Richter
     [not found] <200107012207.PAA01921@adam.yggdrasil.com>
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

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