This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: crashing while trying to write to fis area from linux kernel


Hi,

I did some more digging through the driver code. I would mention my
set up and hardware :

Redboot : ver 1.92..
snapgear linux kernel 2.4.25-x
IXDP425 based board .. 
Intel Strata Flash on board ..

Issue: write to fis area from ixp425.c before mtd partitions are mounted.
Function access similar to parse_redboot_partitions function ..

Observation:
Stepping through the driver code  . file cfi_cmdset_0001.c 
function do_write_buffer .. 
fails at line 1294 :

	/* check for lock bit */
	if (status & CMD(0x02)) {

		printk(KERN_ERR "status and cmd loop inside \n");
		
;
;;
 

}

Seems like driver is writting everything, but at the end finding lock
bit to be on .. ??

Any one faced this issue ?
can some one please share how one has been able to write to fis area
from kernel on this or similar enviornemt ..
any issues / workarounds to get this simple thing done .. 

Cheers,
Alfred
---------- Forwarded message ----------
From: alfred hitch <alfred.hitch@gmail.com>
Date: Fri, 25 Feb 2005 01:43:21 -0500
Subject: crashing while trying to write to fis area from linux kernel
To: ecos-discuss@ecos.sourceware.org


Hi,

I am trying to update the fis area after the linux kernel boots up ..
but cannot write to it, kernel's crashing ..

I am able to read successfully fis contents using a pseudo driver I
have written,
but when I try to write to it its crashing.

My code is something like this:

1) First read a page size of data ..

        struct fis_image_desc *buf;
        buf = kmalloc(PAGE_SIZE, GFP_KERNEL);

        /* Read the start of the last erase block */
        ret = master->read(master, master->size - master->erasesize,
                           PAGE_SIZE, &retlen, (void *)buf);

2) Modify buf[i] as needed.

3)      if(!(master->flags & MTD_WRITEABLE))
                printk(" NOT writtable !! \n");
        else
                printk(" writtable \n");

        /* Write the start of the last erase block */
        ret = master->write(master, master->size - master->erasesize,
                           PAGE_SIZE, &retlen, (void *)buf);

Its crashing while I am trying to write in the above function.

I dont have much idea of the mtd driver and  so I am defintely doing
something very simple and stupid ..
but could someone please point the same to me ..

Can someone give me a sample snnipet of code to do something like above ?

Cheers,
Alfred.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]