From: visakan <visakan@mediasolv.com>
To: uclinux-dev@uclinux.org, jffs-dev@axis.com,
linux-mtd@lists.infradead.org
Subject: mtd-jffs
Date: Sat, 06 Oct 2001 14:59:25 +0600 [thread overview]
Message-ID: <3BBEC7ED.517EF502@mediasolv.com> (raw)
Hello everybody,
I am trying to put jffs filesystem on the ucLinux 2.0.38 ,on the ATMEL
AT49BV1604 flash.
Since It s not cfi-compatible , I try to use cfi-jedec anc the command
set cfi_cmd0002,
I managed to identify the flash and the mtd partitions after hard-coding
the mfr-id and dev-id.
The jffs file system can be mounted when we used romfs as the root
filesystem.
When I tried to write something on the mounted partition I got the
following:
Last[2] is ffff, datum is 3931
Last[2] is ffff, datum is 3931
Last[2] is ffff, datum is 3931
Last[2] is ffff, datum is 3931
after that it hangs ...
Though the flash is comfletely free I could not be able to write.
The atmel flash has two planes , and the os and the fileysstems are on
seperate planes,
and kernel is XIP. I tried the kernel executed on the RAM but I failed,
Then I write a program similar to the (prog.c, amd.c in the armtool)
burning program from armtool
and executed as a user-space prog, so I could manage to write and erase.
my progream is:
#include <stdio.h>
#define FLASH_BASE 0x1000000
void program(long address,unsigned short word);
void sector_erase(unsigned long sector);
unsigned long *p_out;
int main(){
int i;
char opt;
p_out=(unsigned long*) 0x40;
printf("Enter the operation:\n\t(E)rase\n\t(P)rogram\n_>");
opt=getchar();
switch (opt){
case 'P':
for (i=64*1024;i<128*1024; i++){
p_out[1]=i;
program(i,0xabcd);
}
p_out[1]=0x31415;
return 0;
case 'E':
for (i=0; i<7; i++)
sector_erase((64*1024)+(i*64*1024));
return 0;
default:
return 0;
}
}
void program(long address,unsigned short word)
{
int i;
volatile unsigned short *ptr;
ptr = (unsigned short *)FLASH_BASE;
ptr[0x5555] = 0xaa;
ptr[0x2aaa] = 0x55;
ptr[0x5555] = 0xa0;
ptr[address] = word;
i=0;
while(i != 2)
if(ptr[address] !=word)
i=0;
else
i++;
}
void sector_erase(unsigned long sector){
int i;
volatile unsigned short *ptr;
ptr = (unsigned short *)FLASH_BASE;
ptr[0x5555] = 0xaa;
ptr[0x2aaa] = 0x55;
ptr[0x5555] = 0x80;
ptr[0x5555] = 0xaa;
ptr[0x2aaa] = 0x55;
ptr[sector] = 0x30;
i = 0;
while(i != 2)
if (ptr[sector] != 0xffff)
i = 0;
else
i++;
}
Can anybody encountered the same problem?
pls give some idea to get rid off??
Cheers
Viskan.P
reply other threads:[~2001-10-06 8:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3BBEC7ED.517EF502@mediasolv.com \
--to=visakan@mediasolv.com \
--cc=jffs-dev@axis.com \
--cc=linux-mtd@lists.infradead.org \
--cc=uclinux-dev@uclinux.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.