All of lore.kernel.org
 help / color / mirror / Atom feed
* Almost there...
@ 1997-05-12  0:19 Mike Shaver
  1997-05-12  0:23 ` David S. Miller
  1997-05-12 16:23 ` Miguel de Icaza
  0 siblings, 2 replies; 16+ messages in thread
From: Mike Shaver @ 1997-05-12  0:19 UTC (permalink / raw)
  To: linux

(kinda)

Everything compiles now (had to comment out another PRINT() in
arch/mips/lib/watch.S), and I just have to chase down the undefined
refs that the linker is barfing on.  So picky, these binutils are. =)

In case anyone else is working on this (Miguel?  You get your box
yet?), these are the ones that it's complaining about:

__mips_bh_counter (arch/mips/kernel/softirq.c:do_bottom_half, among
about 8 other places)
copy_sigbits32 (kernel/irixelf.c:irix_core_dump)
initialize_kbd (sgi/prom/misc.c:prom_*)
kh (drivers/char/psaux.c:write_aux_{dev,cmd})
local_irq_count (bunch of places)
rs_init (drivers/char/ttyio.c:tty_init)
serial_console (sgi/kernel/setup.c:sgi_setup)

Mail me if you want patches to my current working set...

I'll probably get back on this tomorrow at some point...I have "real
work" to do tonight. =(

Mike

-- 
#> Mike Shaver (shaver@ingenia.com)      Information Warfare Division  
#> Chief Tactical and Strategic Officer         "Saepe fidelis"        
#>                                                                     
#> "I like your game, but we have to change the rules." -- Anon        
#>                                                                     

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

* Re: Almost there...
  1997-05-12  0:19 Mike Shaver
@ 1997-05-12  0:23 ` David S. Miller
  1997-05-12  0:56     ` Mike Shaver
  1997-05-12 16:23 ` Miguel de Icaza
  1 sibling, 1 reply; 16+ messages in thread
From: David S. Miller @ 1997-05-12  0:23 UTC (permalink / raw)
  To: shaver; +Cc: linux

   From: Mike Shaver <shaver@neon.ingenia.ca>
   Date: Sun, 11 May 1997 20:19:58 -0400 (EDT)

   (Miguel?  You get your box yet?)

Nope he didn't, import laws in Mexico got the machine before he did...

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

* Re: Almost there...
  1997-05-12  0:56     ` Mike Shaver
  (?)
@ 1997-05-12  0:46     ` David S. Miller
  -1 siblings, 0 replies; 16+ messages in thread
From: David S. Miller @ 1997-05-12  0:46 UTC (permalink / raw)
  To: shaver; +Cc: linux

   From: Mike Shaver <shaver@neon.ingenia.ca>
   Date: Sun, 11 May 1997 20:56:15 -0400 (EDT)

   Thus spake David S. Miller:
   >    (Miguel?  You get your box yet?)
   > 
   > Nope he didn't, import laws in Mexico got the machine before he did...

   Is that a permanent failure, or just Yet Another Bureaucratic
   Delay(tm)?

Permanent.

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

* Re: Almost there...
@ 1997-05-12  0:56     ` Mike Shaver
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Shaver @ 1997-05-12  0:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux

Thus spake David S. Miller:
>    (Miguel?  You get your box yet?)
> 
> Nope he didn't, import laws in Mexico got the machine before he did...

Is that a permanent failure, or just Yet Another Bureaucratic
Delay(tm)?

Mike
(and I thought our gov't was bad...)

-- 
#> Mike Shaver (shaver@ingenia.com) Ingenia Communications Corporation 
#> Paranoid for money.                            Sarcastic for kicks. 
#>                                                                     
#> "They already *KNOW* I am a whacko, Karen.                          
#>                  That doesn't mean I am *WRONG*." -- mjr@clark.net  

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

* Re: Almost there...
@ 1997-05-12  0:56     ` Mike Shaver
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Shaver @ 1997-05-12  0:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux

Thus spake David S. Miller:
>    (Miguel?  You get your box yet?)
> 
> Nope he didn't, import laws in Mexico got the machine before he did...

Is that a permanent failure, or just Yet Another Bureaucratic
Delay(tm)?

Mike
(and I thought our gov't was bad...)

-- 
#> Mike Shaver (shaver@ingenia.com) Ingenia Communications Corporation 
#> Paranoid for money.                            Sarcastic for kicks. 
#>                                                                     
#> "They already *KNOW* I am a whacko, Karen.                          
#>                  That doesn't mean I am *WRONG*." -- mjr@clark.net  

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

* Re: Almost there...
@ 1997-05-12  3:29 Larry McVoy
  1997-05-12  3:34 ` David S. Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Larry McVoy @ 1997-05-12  3:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: shaver, linux

:    Thus spake David S. Miller:
:    >    (Miguel?  You get your box yet?)
:    > 
:    > Nope he didn't, import laws in Mexico got the machine before he did...
: 
:    Is that a permanent failure, or just Yet Another Bureaucratic
:    Delay(tm)?
: 
: Permanent.

Ariel found a diplomat that is going to schlep it through.  We don't
give up that easy.  And Ralf is getting an Indy as soon as he gets back.
And David & Inglo are getting shitloads of hardware as soon as they
work here.

--lm

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

* Re: Almost there...
  1997-05-12  3:29 Almost there Larry McVoy
@ 1997-05-12  3:34 ` David S. Miller
  1997-05-12 16:33   ` Greg Chesson
  1997-05-12  5:13   ` Mike Shaver
  1997-05-12  6:32 ` Martin Knoblauch
  2 siblings, 1 reply; 16+ messages in thread
From: David S. Miller @ 1997-05-12  3:34 UTC (permalink / raw)
  To: lm; +Cc: shaver, linux

   From: lm@neteng.engr.sgi.com (Larry McVoy)
   Date: Sun, 11 May 1997 20:29:38 -0700

   : Permanent.

   Ariel found a diplomat that is going to schlep it through.  We don't
   give up that easy.  And Ralf is getting an Indy as soon as he gets back.
   And David & Inglo are getting shitloads of hardware as soon as they
   work here.

*Clap clap clap*, I expected nothing less 8-)

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

* Re: Almost there...
@ 1997-05-12  5:13   ` Mike Shaver
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Shaver @ 1997-05-12  5:13 UTC (permalink / raw)
  To: Larry McVoy; +Cc: linux

Thus spake Larry McVoy:
> Ariel found a diplomat that is going to schlep it through.  We don't
> give up that easy.  And Ralf is getting an Indy as soon as he gets back.
> And David & Inglo are getting shitloads of hardware as soon as they
> work here.

Excellent!
I'm going to try and con another loaner out of the guys up here (hi,
Kev! =) ) when they actually reclaim mine.

Currently, I'm trying to get my laptop to talk to the network under
Linux (can't see the docking station's ethernet) so I can get the
xcompiler on here.  Right now, I'm working off of a DX4/100, and it's
kinda slow going.  I've been putting off a full rebuild of glibc for
the Indy until I get a faster setup.  (I was tempted to set up the
Irix-hosted stuff, but I don't have the machine for long enough to
warrant the effort.)

Tomorrow, I'm going to try to build the nettools and apache with the
xcompiler.  I fear I'm at the edge of my abilities with the current
kernel stuff, although I may try and track down some of the undefined
symbols if I get some time.

(David?  Inglo?)

Mike

-- 
#> Mike Shaver (shaver@ingenia.com) Ingenia Communications Corporation 
#>              Commando Developer - Whatever It Takes
#>                                                                     
#> "See, you not only have to be a good coder to create a system like
#>    Linux, you have to be a sneaky bastard too." - Linus Torvalds

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

* Re: Almost there...
@ 1997-05-12  5:13   ` Mike Shaver
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Shaver @ 1997-05-12  5:13 UTC (permalink / raw)
  To: Larry McVoy; +Cc: linux

Thus spake Larry McVoy:
> Ariel found a diplomat that is going to schlep it through.  We don't
> give up that easy.  And Ralf is getting an Indy as soon as he gets back.
> And David & Inglo are getting shitloads of hardware as soon as they
> work here.

Excellent!
I'm going to try and con another loaner out of the guys up here (hi,
Kev! =) ) when they actually reclaim mine.

Currently, I'm trying to get my laptop to talk to the network under
Linux (can't see the docking station's ethernet) so I can get the
xcompiler on here.  Right now, I'm working off of a DX4/100, and it's
kinda slow going.  I've been putting off a full rebuild of glibc for
the Indy until I get a faster setup.  (I was tempted to set up the
Irix-hosted stuff, but I don't have the machine for long enough to
warrant the effort.)

Tomorrow, I'm going to try to build the nettools and apache with the
xcompiler.  I fear I'm at the edge of my abilities with the current
kernel stuff, although I may try and track down some of the undefined
symbols if I get some time.

(David?  Inglo?)

Mike

-- 
#> Mike Shaver (shaver@ingenia.com) Ingenia Communications Corporation 
#>              Commando Developer - Whatever It Takes
#>                                                                     
#> "See, you not only have to be a good coder to create a system like
#>    Linux, you have to be a sneaky bastard too." - Linus Torvalds

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

* Re: Almost there...
  1997-05-12  3:29 Almost there Larry McVoy
  1997-05-12  3:34 ` David S. Miller
  1997-05-12  5:13   ` Mike Shaver
@ 1997-05-12  6:32 ` Martin Knoblauch
  2 siblings, 0 replies; 16+ messages in thread
From: Martin Knoblauch @ 1997-05-12  6:32 UTC (permalink / raw)
  To: Larry McVoy; +Cc: David S. Miller, shaver, linux

Larry McVoy wrote:
> 
> :    Thus spake David S. Miller:
> :    >    (Miguel?  You get your box yet?)
> :    >
> :    > Nope he didn't, import laws in Mexico got the machin
> :    > before he did...
> :
> :    Is that a permanent failure, or just Yet Another Bureaucratic
> :    Delay(tm)?
> :
> : Permanent.
> 
> Ariel found a diplomat that is going to schlep it through.  We
> don't give up that easy.  And Ralf is getting an Indy as soon
> as he gets back. And David & Inglo are getting shitloads of

  Lets be careful. I have to ship the box from Bavaria to Germany.
This might need a diplomat to.

Martin
-- 
+---------------------------------+-----------------------------------+
|Martin Knoblauch                 | Silicon Graphics GmbH             |
|Manager Technical Marketing      | Am Hochacker 3 - Technopark       |
|Silicon Graphics Computer Systems| D-85630 Grasbrunn-Neukeferloh, FRG|
|---------------------------------| Phone: (+int) 89 46108-179 or -0  |
|http://reality.sgi.com/knobi     | Fax:   (+int) 89 46107-179        |
+---------------------------------+-----------------------------------+
|e-mail: <knobi@munich.sgi.com>   | VM: 6-333-8197 | M/S: IDE-3150    |
+---------------------------------------------------------------------+

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

* Re: Almost there...
  1997-05-12  0:19 Mike Shaver
  1997-05-12  0:23 ` David S. Miller
@ 1997-05-12 16:23 ` Miguel de Icaza
  1 sibling, 0 replies; 16+ messages in thread
From: Miguel de Icaza @ 1997-05-12 16:23 UTC (permalink / raw)
  To: shaver; +Cc: linux


> In case anyone else is working on this (Miguel?  You get your box
> yet?), these are the ones that it's complaining about:

the machine is now back on Mountain View, and should have been shipped
to the american embassy office in the US on friday.

Miguel.

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

* Re: Almost there...
  1997-05-12  0:56     ` Mike Shaver
  (?)
  (?)
@ 1997-05-12 16:25     ` Miguel de Icaza
       [not found]       ` <miguel@nuclecu.unam.mx>
  -1 siblings, 1 reply; 16+ messages in thread
From: Miguel de Icaza @ 1997-05-12 16:25 UTC (permalink / raw)
  To: shaver; +Cc: davem, linux


> > Nope he didn't, import laws in Mexico got the machine before he did...
> 
> Is that a permanent failure, or just Yet Another Bureaucratic
> Delay(tm)?

the machine went back to the US after the customs episode.  Now we are
now going to bring the machine trough the embassy (no way the customs
will ever have a chance to touch it), should be here real soon now
:-).

Miguel.

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

* Re: Almost there...
  1997-05-12  3:34 ` David S. Miller
@ 1997-05-12 16:33   ` Greg Chesson
  0 siblings, 0 replies; 16+ messages in thread
From: Greg Chesson @ 1997-05-12 16:33 UTC (permalink / raw)
  To: David S. Miller, lm; +Cc: shaver, linux

restores my faith in the power of the human spirit (over the dark side).

g

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

* Re: Almost there...
       [not found]       ` <miguel@nuclecu.unam.mx>
@ 1997-05-12 16:35         ` richard offer
  0 siblings, 0 replies; 16+ messages in thread
From: richard offer @ 1997-05-12 16:35 UTC (permalink / raw)
  To: linux


* $ from miguel@nuclecu.unam.mx at "12-May:11:25am" | sed "1,$s/^/* /"
*
*
*
* > > Nope he didn't, import laws in Mexico got the machine before he did...
* >
* > Is that a permanent failure, or just Yet Another Bureaucratic
* > Delay(tm)?
*
* the machine went back to the US after the customs episode.  Now we are
* now going to bring the machine trough the embassy (no way the customs
* will ever have a chance to touch it), should be here real soon now
* :-).

I see a whole new story, "SGI smuggles low-end machines to Mexico...."

*
* Miguel.
*


richard.


______________________________________________________________________
    Life isn't fair, it just happens to be fairer than death.
                                William Goldman: "The Princess Bride".

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

* Almost there
@ 2005-09-15 14:22 itche
  2005-09-16  8:01 ` Thomas Gleixner
  0 siblings, 1 reply; 16+ messages in thread
From: itche @ 2005-09-15 14:22 UTC (permalink / raw)
  To: uclinux-dev; +Cc: linux-mtd

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

Hi all,
Claudio thanks for all your previous help.

I still don't have the device fully functional.
I am attaching a txt file containing the terminal output, and the 
modifications i have made to some of the files involved.
At this point after doing erase /dev/mtd2 the system hangs, however still 
pingable, and boa is respondig to requests. i have managed to narrow down to 
a single line of code (in /drivers/mtdchar.c) where the system stop 
responding (just after calling schedule() ). however i don't know why? my 
guess is that it is something related to the feedback from the nand (status 
register).
thanks in advance for any help.
Isack

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Text File --]
[-- Type: text/plain; charset="us-ascii"; name="Text File", Size: 15604 bytes --]

--------------------------------------------------------------------------------------------------------------------------
this is my boot output
uClinux/COLDFIRE(m5272)
COLDFIRE port done by Greg Ungerer, gerg@snapgear.com
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line:
Calibrating delay loop... 43.72 BogoMIPS
Memory available: 2236k/4096k RAM, 0k/0k ROM (732k kernel code, 216k data)
kmem_create: Forcing size word alignment - vm_area_struct
kmem_create: Forcing size word alignment - mm_struct
kmem_create: Forcing size word alignment - filp
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
kmem_create: Forcing size word alignment - inode_cache
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
kmem_create: Forcing size word alignment - bdev_cache
kmem_create: Forcing size word alignment - cdev_cache
kmem_create: Forcing size word alignment - kiobuf
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
kmem_create: Forcing size word alignment - sock
Initializing RT netlink socket
Starting kswapd
kmem_create: Forcing size word alignment - file_lock_cache
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
ColdFire internal UART serial driver version 1.00
ttyS0 at 0x10000100 (irq = 73) is a builtin ColdFire UART
ttyS1 at 0x10000140 (irq = 74) is a builtin ColdFire UART
kmem_create: Forcing size word alignment - blkdev_requests
fec.c: Probe number 0 with 0x0000
eth0: FEC ENET Version 0.2, 90:02:22:25:dd:b2
fec: PHY @ 0x0, ID 0x001378e2 -- LXT971
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
CSLIP: code copyright 1989 Regents of the University of California.
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 7 disk images:
0: 10D15C-1C155B [VIRTUAL 10D15C-1C155B] (RO)
1: FFE00000-FFE3FFFF [VIRTUAL FFE00000-FFE3FFFF] (RW)
2: FFE00000-FFE07FFF [VIRTUAL FFE00000-FFE07FFF] (RW)
3: FFE08000-FFE3FFFF [VIRTUAL FFE08000-FFE3FFFF] (RW)
4: FFE40000-FFFFFFFF [VIRTUAL FFE40000-FFFFFFFF] (RW)
5: FFF00000-FFFFFFFF [VIRTUAL FFF00000-FFFFFFFF] (RW)
6: FFE00000-FFFFFFFF [VIRTUAL FFE00000-FFFFFFFF] (RW)
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
PPP generic driver version 2.4.2
AMD 8MB OS FLASH: 800000 at ff000000
 Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
Creating 2 MTD partitions on "OS Flash - AMD 8MB":
0x00000000-0x00500000 : "OperatingSystem (5MB)"
mtd: Giving out device 0 to OperatingSystem (5MB)
0x00500000-0x00800000 : "FileSystem (3MB)"
mtd: Giving out device 1 to FileSystem (3MB)
NAND device: Manufacture ID: 0xec, Chip ID: 0x75 (Samsung K9F5608UOC)
Creating 3 MTD partitions on "Samsung K9F5608UOC":
0x00000000-0x00100000 : "test1"
mtd: Giving out device 2 to test1
0x00100000-0x00a00000 : "test2"
mtd: Giving out device 3 to test2
0x01000000-0x02000000 : "PBX Voice"
mtd: Giving out device 4 to PBX Voice
init_mtdchar: allocated major number 90.
init_mtdblock: allocated major number 31.
Linux telephony interface: v1.00
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
kmem_create: Forcing size word alignment - ip_dst_cache
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (romfs filesystem) readonly.
Freeing unused kernel memory: 24k freed (0xf4000 - 0xf9000)
Shell invoked to run file: /etc/rc
Command: hostname DigiTalks_PBX
Command: /bin/expand /etc/ramfs.img /dev/ram1
Command: mount -t jffs2 /dev/mtdblock1 /mnt
mtdblock_open
ok
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: ifconfeZ\x16b127.0.0.1
Command:t�add -net 127.0.0.0hrѵͭ255.0.0.0 lo
ro0]W\x02\x12command or file :+5
                                Command: dhcpcd -p  KX*ѡ�&
config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
[16]
Command: cat /etc/motd



                Welcome to  DigiTalks ClodFire based



        **************       *************       *****           *****
        *              *     *             *      *   *         *   *
        *   ********    *    *  ********    *      *   *       *   *
        *   *      *     *   *  *      *     *      *   *     *   *
        *   *      *     *   *  *      *    *        *   *   *   *
        *   ********    *    *  ********   *          *   * *   *
        *              *     *             *           *        *
        *   ***********      *  ********   *          *   * *   *
        *   *                *  *      *     *       *   *   *   *
        *   *                *  *      *      *     *   *     *   *
        *   *                *  ********     *     *   *       *   *
        *   *                *             *      *   *         *   *
        ****                 *************       *****           *****



Running

          ____ _  _
         /  __| ||_|
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|


PBX Port done by Isack Waserman - DigiTalks (6/2005)

For further information check:
http://www.digitalks.com

Execution Finished, Exiting

Sash command shell (version 1.1.1)
/>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------
this is after running the erase command

/> erase /dev/mtd2
MTD_open
MTD_ioctl - itche
MTD_ioctl - itche
 in non region erase
Erase UnMZ\x17�
                 0x4000,

PerT�Flash Erase of leD�5
                                  16384
at offset _�
 sector is unlocked iKJэ
octl - itche
in case MEMERASE
We are going to NAND.C here
nand_erase: start = 0x00000000, len = 16384
 flash is ready, going into erase state
 WP status check,nand status is:0xc0
 going into while loop for: 0x4000
 IN THE while loop for: 0x4000
 checking nand status,nand status is:0xc0
 block eras  is good - in NAND.C
 in erase status
 out of while loop
 end of function nand erase
We are returning from NAND.C here
ret= 0x00

before if statment

---------------------------------------------------------------------------------------------------------------------------------------------------------------------



-------------------------------------------------------------------------------------------------------------------------
this is in /drivers/mtd/nand/nand.c

static unsigned char NAND_CTRL_MIROR;
/*
 * Macros for low-level register control
 */
#define NAND_CTRL (*(volatile unsigned char *) \
			((struct nand_chip *) mtd->priv)->CTRL_ADDR)

#define nand_select()	NAND_CTRL_MIROR &= ~this->NCE; \
			NAND_CTRL = NAND_CTRL_MIROR; \
			nand_command(mtd, NAND_CMD_RESET, -1, -1); \
			udelay (10);
#define nand_deselect() NAND_CTRL_MIROR |= this->NCE; \
			NAND_CTRL = NAND_CTRL_MIROR;


/*
 * NAND erase a block
 */
static int nand_erase (struct mtd_info *mtd, struct erase_info *instr)
{
	int i, page, len, status, pages_per_block;
	struct nand_chip *this = mtd->priv;
	DECLARE_WAITQUEUE(wait, current);

	DEBUG (MTD_DEBUG_LEVEL3,
		"nand_erase: start = 0x%08x, len = %i\n",
		(unsigned int) instr->addr, (unsigned int) instr->len);

	/* Start address must align on block boundary */
	if (instr->addr & (mtd->erasesize - 1)) {
		DEBUG (MTD_DEBUG_LEVEL0,
			"nand_erase: Unaligned address\n");
		return -EINVAL;
	}

	/* Length must align on block boundary */
	if (instr->len & (mtd->erasesize - 1)) {
		DEBUG (MTD_DEBUG_LEVEL0,
			"nand_erase: Length not block aligned\n");
		return -EINVAL;
	}

	/* Do not allow erase past end of device */
	if ((instr->len + instr->addr) > mtd->size) {
		DEBUG (MTD_DEBUG_LEVEL0, 
			"nand_erase: Erase past end of device\n");
		return -EINVAL;
	}

retry:
	/* Grab the lock and see if the device is available */
	spin_lock_bh (&this->chip_lock);

	switch (this->state) {
	case FL_READY:
		DEBUG (MTD_DEBUG_LEVEL3," flash is ready, going into erase state\n");//itche
		this->state = FL_ERASING;
		break;
		
	default:
		set_current_state (TASK_UNINTERRUPTIBLE);
		add_wait_queue (&this->wq, &wait);
		spin_unlock_bh (&this->chip_lock);
		schedule();

		remove_wait_queue (&this->wq, &wait);
		goto retry;
	};

	/* Shift to get first page */
	page = (int) (instr->addr >> this->page_shift);

	/* Calculate pages in each block */
	pages_per_block = mtd->erasesize / mtd->oobblock;
	
	/* Select the NAND device */
	nand_select ();

	/* Check the WP bit */
	nand_command (mtd, NAND_CMD_STATUS, -1, -1);
	DEBUG (MTD_DEBUG_LEVEL3," WP status check,nand status is:0x%02x\n",(readb (this->IO_ADDR)));//itche
	if (!(readb (this->IO_ADDR) & 0x80)) {
		DEBUG (MTD_DEBUG_LEVEL0,
			"nand_erase: Device is write protected!!!\n");
		nand_deselect ();
		this->state = FL_READY;
		spin_unlock_bh (&this->chip_lock);
		return -EIO;
	}

	/* Loop through the pages */
	len = instr->len;
	DEBUG (MTD_DEBUG_LEVEL3," going into while loop for: 0x%02x\n" ,instr->len);
	while (len) {
		/* Send commands to erase a page */
		nand_command(mtd, NAND_CMD_ERASE1, -1, page);
		nand_command(mtd, NAND_CMD_ERASE2, -1, -1);
		DEBUG (MTD_DEBUG_LEVEL3," IN THE while loop for: 0x%02x\n" ,len);
		/*
		 * Wait for program operation to complete. This could
		 * take up to 4000us (4ms) on some devices, so we try
		 * and exit as quickly as possible.
		 */
		status = 0;
		for (i=0 ; i<32 ; i++) {
			/* Delay for 125us */
			udelay (125);

			/* Check the status */
			nand_command (mtd, NAND_CMD_STATUS, -1, -1);
			status = (int) readb (this->IO_ADDR);
			DEBUG (MTD_DEBUG_LEVEL3," checking nand status,nand status is:0x%02x\n",status);//itche
			if (status & 0x40)
				break;
		}

		/* See if block erase succeeded */
		if (status & 0x01) {
			DEBUG (MTD_DEBUG_LEVEL0,
				"nand_erase: " \
				"Failed erase, page 0x%08x\n", page);
			nand_deselect ();
			this->state = FL_READY;
			spin_unlock_bh (&this->chip_lock);
			return -EIO;
		}
		else DEBUG (MTD_DEBUG_LEVEL3," block eras  is good - in NAND.C\n");//itche

		/* Increment page address and decrement length */
		len -= mtd->erasesize;
		page += pages_per_block;

		/* Release the spin lock */
		spin_unlock_bh (&this->chip_lock);

erase_retry:
		/* Check the state and sleep if it changed */
		spin_lock_bh (&this->chip_lock);
		if (this->state == FL_ERASING) {
			DEBUG (MTD_DEBUG_LEVEL3," in erase status \n");//itche
			continue;
		}
		else {
			set_current_state (TASK_UNINTERRUPTIBLE);
			add_wait_queue (&this->wq, &wait);
			spin_unlock_bh (&this->chip_lock);
			schedule();
			remove_wait_queue (&this->wq, &wait);
			DEBUG (MTD_DEBUG_LEVEL3," go back to erase_retry \n");//itche
			goto erase_retry;
		}
	}
	DEBUG (MTD_DEBUG_LEVEL3," out of while loop \n");//itche
	
	spin_unlock_bh (&this->chip_lock);

	/* De-select the NAND device */
	nand_deselect ();
	
	/* Do call back function */
	if (instr->callback)
		instr->callback (instr);

	/* The device is ready */
	spin_lock_bh (&this->chip_lock);
	this->state = FL_READY;
	spin_unlock_bh (&this->chip_lock);
	
	
	DEBUG (MTD_DEBUG_LEVEL3," end of function nand erase \n");
	
	
	/* Return happy */
	return 0;
	
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------


-------------------------------------------------------------------------------------------------
this is in /user/mtd-utils/erase.c

int non_region_erase(int Fd, int start, int count, int unlock)
{
	mtd_info_t meminfo;

	if (ioctl(Fd,MEMGETINFO,&meminfo) == 0)
	{
		erase_info_t erase;

		erase.start = start;
		printf (" in non region erase \n" );// itche

		erase.length = meminfo.erasesize;
		printf("Erase Unit Size\n 0x%lx, \n", meminfo.erasesize);

		for (; count > 0; count--) {
			printf("\nPerforming Flash Erase of length\n %lu \nat offset 0x%lx\n",erase.length, erase.start);
			fflush(stdout); 
			if(unlock != 0)
			{
				//Unlock the sector first.
				printf("\n\rPerforming Flash unlock at offset 0x%lx",erase.start);
				if(ioctl(Fd, MEMUNLOCK, &erase) != 0)
				{
					perror("\nMTD Unlock failure");
					close(Fd);
					return 8;
				}
			}
			else printf(" sector is unlocked - itche \n");//itche
			
			if (ioctl(Fd,MEMERASE,&erase) != 0)
			{      
				perror("\nMTD Erase failure");
				close(Fd);
				return 8;
			}
			else printf(" eraes is good\n");//itche
			
			erase.start += meminfo.erasesize;
			
		}
		printf(" done\n");
	}
	return 0;
}
---------------------------------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------------

/*
 * $Id: mtdchar.c,v 1.44 2001/10/02 15:05:11 dwmw2 Exp $
 *
 * Character-device access to raw MTD devices.
 * Pure 2.4 version - compatibility cruft removed to mtdchar-compat.c
 *
 */
 
 This is in ioctl section
 case MEMERASE:
	DEBUG(MTD_DEBUG_LEVEL0, "in case MEMERASE\n");//itche
	{
		struct erase_info *erase=kmalloc(sizeof(struct erase_info),GFP_KERNEL);
		if (!erase)
			ret = -ENOMEM;
		else {
			wait_queue_head_t waitq;
			DECLARE_WAITQUEUE(wait, current);

			init_waitqueue_head(&waitq);

			memset (erase,0,sizeof(struct erase_info));
			if (copy_from_user(&erase->addr, (u_long *)arg,
					   2 * sizeof(u_long))) {
				kfree(erase);
				return -EFAULT;
			}
			erase->mtd = mtd;
			erase->callback = mtd_erase_callback;
			erase->priv = (unsigned long)&waitq;
			
			/*
			  FIXME: Allow INTERRUPTIBLE. Which means
			  not having the wait_queue head on the stack.
			  
			  If the wq_head is on the stack, and we
			  leave because we got interrupted, then the
			  wq_head is no longer there when the
			  callback routine tries to wake us up.
			*/
			DEBUG(MTD_DEBUG_LEVEL0, "We are going to NAND.C here\n");//itche
			ret = mtd->erase(mtd, erase);
			DEBUG(MTD_DEBUG_LEVEL0, "We are returning from NAND.C here\n");//itche
			DEBUG(MTD_DEBUG_LEVEL0, "ret= 0x%02x \n\n",ret);//itche
			if (!ret) {
				set_current_state(TASK_UNINTERRUPTIBLE);
				add_wait_queue(&waitq, &wait);
				DEBUG(MTD_DEBUG_LEVEL0, "before if statment\n");//itche
				if (erase->state != MTD_ERASE_DONE &&
				    erase->state != MTD_ERASE_FAILED)
					schedule();
					
				DEBUG(MTD_DEBUG_LEVEL0, "after if statment\n");//itche	
				DEBUG(MTD_DEBUG_LEVEL0, "erase->state = 0x%02x\n", erase->state);//itche
				remove_wait_queue(&waitq, &wait);
				set_current_state(TASK_RUNNING);

				ret = (erase->state == MTD_ERASE_FAILED)?-EIO:0;
			}
			kfree(erase);
		}
		break;
	} 
-----------------------------------------------------------------------------------------------------------------

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

* Re: Almost there
  2005-09-15 14:22 itche
@ 2005-09-16  8:01 ` Thomas Gleixner
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Gleixner @ 2005-09-16  8:01 UTC (permalink / raw)
  To: itche; +Cc: linux-mtd, uclinux-dev

On Thu, 2005-09-15 at 10:22 -0400, itche wrote:
> I still don't have the device fully functional.
> I am attaching a txt file containing the terminal output, and the 
> modifications i have made to some of the files involved.

Uuurg. The nand code you are obviously trying to get working is
stoneaged and broken. Same applies to your kernel (< 2.4.21 - right ?)

Full working NAND support is available in 2.6 kernels and some people
managed a backport to 2.4 (>2.4.27).

Sorry, 

tglx

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

end of thread, other threads:[~2005-09-16  8:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-12  3:29 Almost there Larry McVoy
1997-05-12  3:34 ` David S. Miller
1997-05-12 16:33   ` Greg Chesson
1997-05-12  5:13 ` Mike Shaver
1997-05-12  5:13   ` Mike Shaver
1997-05-12  6:32 ` Martin Knoblauch
  -- strict thread matches above, loose matches on Subject: below --
2005-09-15 14:22 itche
2005-09-16  8:01 ` Thomas Gleixner
1997-05-12  0:19 Mike Shaver
1997-05-12  0:23 ` David S. Miller
1997-05-12  0:56   ` Mike Shaver
1997-05-12  0:56     ` Mike Shaver
1997-05-12  0:46     ` David S. Miller
1997-05-12 16:25     ` Miguel de Icaza
     [not found]       ` <miguel@nuclecu.unam.mx>
1997-05-12 16:35         ` richard offer
1997-05-12 16:23 ` Miguel de Icaza

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.