public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Redboot JFFS2 Support
@ 2005-07-12  4:02 Benny Chen
  2005-07-12  6:56 ` Andrew Lunn
  0 siblings, 1 reply; 13+ messages in thread
From: Benny Chen @ 2005-07-12  4:02 UTC (permalink / raw)
  To: ecos-discuss

Hi there,
Our system runs Cirrus Linux and uses Redboot as the bootloader.  I
would like to access my JFFS2 partition from redboot but could not find
enough information to get this going.  It seems from reading the list
that this has been done countless of times but yet I am not able to work
it out.  

Please bear with me as I have not gotten enough information about this
topic hence, ask very random and basic questions.

I am using redboot from ecosV2_0.

1. I used ecosconfig add jffs2 and followed by ecosconfig check and
there is no conflict.

Target: edb9301
Template: redboot
Added:
 CYGPKG_IO_FLASH
 CYGPKG_IO_ETH_DRIVERS
 CYGPKG_IO_FILEIO
 CYGPKG_COMPRESS_ZLIB
 CYGPKG_MEMALLOC
 CYGPKG_ERROR
 CYGPKG_LINUX_COMPAT
 CYGPKG_IO
 CYGPKG_FS_JFFS2
No conflicts

2. I have make clean and make the redboot.bin image and makes completes
successfully.  I manage to download the redboot.bin to target and it
boots up the redboot> prompt ok.  However, when I tried to type the
'mount' command it is not even found.  I am missing something here. What
I have in mind is that I would get a list of commands like 'mount',
'unmount', 'ls', that can be executed in the redboot cmd prompt.

3. I have a JFFS2 partition that is already in flash and our application
can mount and read and write to it ok (after the Liunx kernel is
booted).  All I want to do is to be able to read a file in this
partition in Redboot. How can I do this?

4. I came across a message in the list saying that there is a
doco/information on how to get JFFS2 support in Redboot, but will have
to search the list for it.  I have been through the list but could not
find it.  I must have miss out some how.  Could anyone tell me where can
I get information on getting JFFS2 support for Redboot?

Please feel free to ask for any more information.  Thank you for your
attention.

Regards,
Benny


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-12  4:02 [ECOS] Redboot JFFS2 Support Benny Chen
@ 2005-07-12  6:56 ` Andrew Lunn
  2005-07-12 23:47   ` Benny Chen
  2005-07-31 22:27   ` Benny Chen
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew Lunn @ 2005-07-12  6:56 UTC (permalink / raw)
  To: Benny Chen; +Cc: ecos-discuss

On Tue, Jul 12, 2005 at 02:01:55PM +1000, Benny Chen wrote:
> Hi there,
> Our system runs Cirrus Linux and uses Redboot as the bootloader.  I
> would like to access my JFFS2 partition from redboot but could not find
> enough information to get this going.  It seems from reading the list
> that this has been done countless of times but yet I am not able to work
> it out.  
> 
> Please bear with me as I have not gotten enough information about this
> topic hence, ask very random and basic questions.
> 
> I am using redboot from ecosV2_0.

Very old. There has been a lot of changes to the JFFS2 support since
then. So your millage may vary.

> 
> 1. I used ecosconfig add jffs2 and followed by ecosconfig check and
> there is no conflict.
> 
> Target: edb9301
> Template: redboot
> Added:
>  CYGPKG_IO_FLASH
>  CYGPKG_IO_ETH_DRIVERS
>  CYGPKG_IO_FILEIO
>  CYGPKG_COMPRESS_ZLIB
>  CYGPKG_MEMALLOC
>  CYGPKG_ERROR
>  CYGPKG_LINUX_COMPAT
>  CYGPKG_IO
>  CYGPKG_FS_JFFS2
> No conflicts
> 
> 2. I have make clean and make the redboot.bin image and makes completes
> successfully.  I manage to download the redboot.bin to target and it
> boots up the redboot> prompt ok.  However, when I tried to type the
> 'mount' command it is not even found.  I am missing something here. What
> I have in mind is that I would get a list of commands like 'mount',
> 'unmount', 'ls', that can be executed in the redboot cmd prompt.

Support for this was added 2003/12/02 14:40:19. eCos 2.0 was released
sometime around 2003/02/14. So this is obviously not going to work.
Put your eCos sources in a museum and try again with something more
uptodate.

        Andrew

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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-12  6:56 ` Andrew Lunn
@ 2005-07-12 23:47   ` Benny Chen
  2005-07-13  6:45     ` Andrew Lunn
  2005-07-31 22:27   ` Benny Chen
  1 sibling, 1 reply; 13+ messages in thread
From: Benny Chen @ 2005-07-12 23:47 UTC (permalink / raw)
  To: ecos-discuss; +Cc: andrew

Hi Andrew,
Haha you are right, I had a look at the ChangeLog after checking out the
latest version of ecos via cvs.  It feels like I am in the ice age
working with what I have got.  

Seriously, thanks for your info. I will get the latest installed. 
However, I have another question for now.  Cirrus has a patch that needs
to be applied to the ecos tree.  This patch is for the ecos v2.0, I know
that someone (most likely me) will need to go through and make sure that
the patch does not break the system.  But can I post the final patch on
the list so that you can have a look at it?

Cheers,
Benny

On Tue, 2005-07-12 at 16:55, Andrew Lunn wrote:
> On Tue, Jul 12, 2005 at 02:01:55PM +1000, Benny Chen wrote:
> > Hi there,
> > Our system runs Cirrus Linux and uses Redboot as the bootloader.  I
> > would like to access my JFFS2 partition from redboot but could not find
> > enough information to get this going.  It seems from reading the list
> > that this has been done countless of times but yet I am not able to work
> > it out.  
> > 
> > Please bear with me as I have not gotten enough information about this
> > topic hence, ask very random and basic questions.
> > 
> > I am using redboot from ecosV2_0.
> 
> Very old. There has been a lot of changes to the JFFS2 support since
> then. So your millage may vary.
> 
> > 
> > 1. I used ecosconfig add jffs2 and followed by ecosconfig check and
> > there is no conflict.
> > 
> > Target: edb9301
> > Template: redboot
> > Added:
> >  CYGPKG_IO_FLASH
> >  CYGPKG_IO_ETH_DRIVERS
> >  CYGPKG_IO_FILEIO
> >  CYGPKG_COMPRESS_ZLIB
> >  CYGPKG_MEMALLOC
> >  CYGPKG_ERROR
> >  CYGPKG_LINUX_COMPAT
> >  CYGPKG_IO
> >  CYGPKG_FS_JFFS2
> > No conflicts
> > 
> > 2. I have make clean and make the redboot.bin image and makes completes
> > successfully.  I manage to download the redboot.bin to target and it
> > boots up the redboot> prompt ok.  However, when I tried to type the
> > 'mount' command it is not even found.  I am missing something here. What
> > I have in mind is that I would get a list of commands like 'mount',
> > 'unmount', 'ls', that can be executed in the redboot cmd prompt.
> 
> Support for this was added 2003/12/02 14:40:19. eCos 2.0 was released
> sometime around 2003/02/14. So this is obviously not going to work.
> Put your eCos sources in a museum and try again with something more
> uptodate.
> 
>         Andrew


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-12 23:47   ` Benny Chen
@ 2005-07-13  6:45     ` Andrew Lunn
  2005-07-13 15:55       ` Frank Pagliughi
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2005-07-13  6:45 UTC (permalink / raw)
  To: Benny Chen; +Cc: ecos-discuss, andrew

> Seriously, thanks for your info. I will get the latest installed. 
> However, I have another question for now.  Cirrus has a patch that needs
> to be applied to the ecos tree.  This patch is for the ecos v2.0, I know
> that someone (most likely me) will need to go through and make sure that
> the patch does not break the system.  But can I post the final patch on
> the list so that you can have a look at it?

Sure.

Could you give me a reference to the original patch straight from
Cirrus. Is it on there website?

        Thanks
                Andrew

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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-13  6:45     ` Andrew Lunn
@ 2005-07-13 15:55       ` Frank Pagliughi
  2005-07-13 16:47         ` Andrew Lunn
  2005-07-13 23:49         ` Benny Chen
  0 siblings, 2 replies; 13+ messages in thread
From: Frank Pagliughi @ 2005-07-13 15:55 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Benny Chen, ecos-discuss

Andrew Lunn wrote:

>>Seriously, thanks for your info. I will get the latest installed. 
>>However, I have another question for now.  Cirrus has a patch that needs
>>to be applied to the ecos tree.  This patch is for the ecos v2.0, I know
>>that someone (most likely me) will need to go through and make sure that
>>the patch does not break the system.  But can I post the final patch on
>>the list so that you can have a look at it?
>>    
>>
>
>Sure.
>
>Could you give me a reference to the original patch straight from
>Cirrus. Is it on there website?
>
>        Thanks
>                Andrew
>
>  
>
The original EDB9301 patch that Cirrus released was just enough to get 
RedBoot running, but not enough for a full-blown eCos, multithreaded 
app. Cirrus later released (in the fall of 2004, I believe) a more 
complete implementation, though still somewhat lacking. Both had 
modifications to JFFS2. Be sure to get the latest patch from Cirrus.

 I added some code and device drivers to their implementation. If you 
guys can get the Cirrus code into the eCos CVS, I'll gladly submit my 
additions.

I just looked at their site, and believe that they've now hidden the 
patches behind a registration/login for their eval boards. I was working 
with a 3rd party board and don't have access. What to do?

Frank Pagliughi



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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-13 15:55       ` Frank Pagliughi
@ 2005-07-13 16:47         ` Andrew Lunn
  2005-07-13 23:43           ` Benny Chen
  2005-07-28  5:59           ` Benny Chen
  2005-07-13 23:49         ` Benny Chen
  1 sibling, 2 replies; 13+ messages in thread
From: Andrew Lunn @ 2005-07-13 16:47 UTC (permalink / raw)
  To: Frank Pagliughi; +Cc: Benny Chen, ecos-discuss

> I just looked at their site, and believe that they've now hidden the 
> patches behind a registration/login for their eval boards. I was working 
> with a 3rd party board and don't have access. What to do?

Before we could get it into CVS Cirrus would have to sign the usual
copyright assignment. I wanted to know what licensing restrictions
that had and if there was a contact point.

        Andrew

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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-13 16:47         ` Andrew Lunn
@ 2005-07-13 23:43           ` Benny Chen
  2005-07-28  5:59           ` Benny Chen
  1 sibling, 0 replies; 13+ messages in thread
From: Benny Chen @ 2005-07-13 23:43 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Frank Pagliughi, ecos-discuss

Yeah, I have just managed to get in touch with the Cirrus guys and will
inform you once I get a reply.

Cheers,
Benny.
On Thu, 2005-07-14 at 02:47, Andrew Lunn wrote:
> > I just looked at their site, and believe that they've now hidden the 
> > patches behind a registration/login for their eval boards. I was working 
> > with a 3rd party board and don't have access. What to do?
> 
> Before we could get it into CVS Cirrus would have to sign the usual
> copyright assignment. I wanted to know what licensing restrictions
> that had and if there was a contact point.
> 
>         Andrew


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-13 15:55       ` Frank Pagliughi
  2005-07-13 16:47         ` Andrew Lunn
@ 2005-07-13 23:49         ` Benny Chen
  1 sibling, 0 replies; 13+ messages in thread
From: Benny Chen @ 2005-07-13 23:49 UTC (permalink / raw)
  To: Frank Pagliughi; +Cc: Andrew Lunn, ecos-discuss

Hi Frank,
I have the login for Cirrus website and are currently running their
latest tree cirrus-arm-linux-1.4.3.  

With this tree they are using the ecos2.0 release version.  Hence, do
not include any of the Redboot JFFS2 changes.

Cheers,
Benny  

On Thu, 2005-07-14 at 01:54, Frank Pagliughi wrote:
> Andrew Lunn wrote:
> 
> >>Seriously, thanks for your info. I will get the latest installed. 
> >>However, I have another question for now.  Cirrus has a patch that needs
> >>to be applied to the ecos tree.  This patch is for the ecos v2.0, I know
> >>that someone (most likely me) will need to go through and make sure that
> >>the patch does not break the system.  But can I post the final patch on
> >>the list so that you can have a look at it?
> >>    
> >>
> >
> >Sure.
> >
> >Could you give me a reference to the original patch straight from
> >Cirrus. Is it on there website?
> >
> >        Thanks
> >                Andrew
> >
> >  
> >
> The original EDB9301 patch that Cirrus released was just enough to get 
> RedBoot running, but not enough for a full-blown eCos, multithreaded 
> app. Cirrus later released (in the fall of 2004, I believe) a more 
> complete implementation, though still somewhat lacking. Both had 
> modifications to JFFS2. Be sure to get the latest patch from Cirrus.
> 
>  I added some code and device drivers to their implementation. If you 
> guys can get the Cirrus code into the eCos CVS, I'll gladly submit my 
> additions.
> 
> I just looked at their site, and believe that they've now hidden the 
> patches behind a registration/login for their eval boards. I was working 
> with a 3rd party board and don't have access. What to do?
> 
> Frank Pagliughi
> 
> 


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-13 16:47         ` Andrew Lunn
  2005-07-13 23:43           ` Benny Chen
@ 2005-07-28  5:59           ` Benny Chen
  2005-07-28  7:06             ` Andrew Lunn
  1 sibling, 1 reply; 13+ messages in thread
From: Benny Chen @ 2005-07-28  5:59 UTC (permalink / raw)
  To: ecos-discuss

Hi there,
Cirrus has not get back to me on my intention of releasing their patch
on this list. Hence, I have ported their patch over to work on the
latest ECOS tree from cvs.  I have tested this out on my target and it
seems to work fine.  

Back to my initial problem of getting JFFS2 support for Redboot.  
I have managed to mount the jffs2 directory and read my config file in
RedBoot. But everytime after my application has updated the
configuration file (after the system has booted up) and redboot do a
read on the same file.  I get the below error.

What I saw on the list was that this issue has been fixed. I am using
the latest Redboot from cvs.  Could anyone help?


Thank you very much.

Regards,
Benny 

#----------------------
RedBoot> rtunet_config
rtunet_config:Starting...
rtunet_config:In Verbose Mode
Mount Successful
chdir Successful
Read Open successful
<4>JFFS2 compression type 0x06 not available.
<4>Error: jffs2_decompress returned -5
Read failed -1
Refuse to unmount.
Ino #1 has use count 2
Ino #6 has use count 1
umount failed -1
#----------------------



#----------------------
RedBoot> version
                                                                                
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version UNKNOWN - built 15:18:04, Jul 28 2005
                                                                                
Platform: Cirrus Logic EDB9301 Board (ARM920T) Rev A
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
                                                                                
RAM: 0x00000000-0x02000000, [0x00057ce0-0x01fdd000] available
FLASH: 0x60000000 - 0x61000000, 128 blocks of 0x00020000 bytes each.
#----------------------
 





On Thu, 2005-07-14 at 02:47, Andrew Lunn wrote:
> > I just looked at their site, and believe that they've now hidden the 
> > patches behind a registration/login for their eval boards. I was working 
> > with a 3rd party board and don't have access. What to do?
> 
> Before we could get it into CVS Cirrus would have to sign the usual
> copyright assignment. I wanted to know what licensing restrictions
> that had and if there was a contact point.
> 
>         Andrew


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-28  5:59           ` Benny Chen
@ 2005-07-28  7:06             ` Andrew Lunn
  2005-07-29  5:24               ` Benny Chen
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2005-07-28  7:06 UTC (permalink / raw)
  To: Benny Chen; +Cc: ecos-discuss

On Thu, Jul 28, 2005 at 03:59:04PM +1000, Benny Chen wrote:
> Hi there,
> Cirrus has not get back to me on my intention of releasing their patch
> on this list. Hence, I have ported their patch over to work on the
> latest ECOS tree from cvs.  I have tested this out on my target and it
> seems to work fine.  
> 
> Back to my initial problem of getting JFFS2 support for Redboot.  
> I have managed to mount the jffs2 directory and read my config file in
> RedBoot. But everytime after my application has updated the
> configuration file (after the system has booted up) and redboot do a
> read on the same file.  I get the below error.
> 
> What I saw on the list was that this issue has been fixed. I am using
> the latest Redboot from cvs.  Could anyone help?

Do you have CYGPKG_COMPRESS_ZLIB enabled? 

It looks like you have a compressed file in your filesystem and
without ZLIB jffs2 cannot decompress it.

        Andrew

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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-28  7:06             ` Andrew Lunn
@ 2005-07-29  5:24               ` Benny Chen
  0 siblings, 0 replies; 13+ messages in thread
From: Benny Chen @ 2005-07-29  5:24 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Hi Andrew,
Right on, that was my problem. Now it is working consistently.  

However, every time I try to unlink() the config file from Redboot, I
keep getting the infamous 'No space left on device' error as per below.

My JFFS2 partition has heaps of space and my application has no problem
reading, writing and unlinking the config files in there (refer to
listing below).  

From the sample test code, it seems quite straight forward.  But it is
not working for me.  

I have also included my simple getconfig function below.  Hopefully,
someone can help.

Thanks guys.

Regards,
Benny


# ----------- FIS LIST -----------------
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x60000000  0x60000000  0x00060000  0x00000000
jffs2             0x60060000  0x01200000  0x004E0000  0x01200000
ramdisk           0x60540000  0x00800000  0x00340000  0x00800000
zImage            0x60880000  0x00080000  0x000C0000  0x00080000
FIS directory     0x60FE0000  0x60FE0000  0x0001F000  0x00000000
RedBoot config    0x60FFF000  0x60FFF000  0x00001000  0x00000000


RedBoot> rtunet_config
rtunet_config:Starting...
unlink failed -1: No space left on device


# ----------- JFFS2 Directory DF Listing --------------------
/mnt/jffs2_fs # df .
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2            4992       644      4348  13% /mnt/jffs2_fs
/mnt/jffs2_fs #


# ----------- JFFS2 Directory Listing --------------------
/mnt/jffs2_fs # ls -l
-rw-rw-rw-    1 root     root          203 Jan  1 00:24 rbconfig
-rw-r--r--    1 root     root          203 Jan  1 00:18 rbconfig.bak
/mnt/jffs2_fs #



# ----------- Redboot Unlink SRC CODE --------------------
static int get_config(unsigned char *rd_buf)
{
    int err, i;
                                                                                
    err = mount(CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2");
    if (err) {
        diag_printf("Mount failed %d\n", err);
        return err;
    }
    if (verbose) {
        diag_printf("Mount Successful\n");
    }
                                                                                
    err = chdir( "/" );
    if (err) {
        diag_printf("chdir failed %d\n", err);
        goto umnt;
    }
    if (verbose) {
        diag_printf("chdir Successful\n");
    }
                                                                        
    checkcwd("/");
    err = readfile("/rbconfig", rd_buf, 256);
    if (err == 0) {
        //Replace \n with ' '
        for (i = 0; i < strlen(rd_buf);i++)
        {
            if (rd_buf[i] == '\n')
            {
                rd_buf[i] = ' ';
            }
        }
    }
                                                                                
    err = unlink("/rbconfig");
    if (err) {
        diag_printf("unlink failed %d: %s\n",err,
                                strerror(errno));
    }
                                                                                
umnt:
    err = umount("/");
    if (err) {
        diag_printf("umount failed %d\n", err);
    } else {
        if (verbose) {
            diag_printf("umount Successful\n");
        }
    }
                                                                                
    return err;
}





On Thu, 2005-07-28 at 17:05, Andrew Lunn wrote:
> On Thu, Jul 28, 2005 at 03:59:04PM +1000, Benny Chen wrote:
> > Hi there,
> > Cirrus has not get back to me on my intention of releasing their patch
> > on this list. Hence, I have ported their patch over to work on the
> > latest ECOS tree from cvs.  I have tested this out on my target and it
> > seems to work fine.  
> > 
> > Back to my initial problem of getting JFFS2 support for Redboot.  
> > I have managed to mount the jffs2 directory and read my config file in
> > RedBoot. But everytime after my application has updated the
> > configuration file (after the system has booted up) and redboot do a
> > read on the same file.  I get the below error.
> > 
> > What I saw on the list was that this issue has been fixed. I am using
> > the latest Redboot from cvs.  Could anyone help?
> 
> Do you have CYGPKG_COMPRESS_ZLIB enabled? 
> 
> It looks like you have a compressed file in your filesystem and
> without ZLIB jffs2 cannot decompress it.
> 
>         Andrew


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-12  6:56 ` Andrew Lunn
  2005-07-12 23:47   ` Benny Chen
@ 2005-07-31 22:27   ` Benny Chen
  2005-08-01  9:47     ` Andrew Lunn
  1 sibling, 1 reply; 13+ messages in thread
From: Benny Chen @ 2005-07-31 22:27 UTC (permalink / raw)
  To: ecos-discuss

Hi there,
I should be sending this to the list.

Right on, that was my problem. Now it is working consistently.  

However, every time I try to unlink() the config file from Redboot, I
keep getting the infamous 'No space left on device' error as per below.

My JFFS2 partition has heaps of space and my application has no problem
reading, writing and unlinking the config files in there (refer to
listing below).  

From the sample test code, it seems quite straight forward.  But it is
not working for me.  It may be a configuration issue.  

I have also included my savefile and simple getconfig function below. 
Hopefully, someone can help.

Thanks guys.

Regards,
Benny

# ----------- ecosmy.ecm -----------------
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command cdl_configuration { description hardware template
package };
cdl_savefile_command cdl_package { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_component { value_source user_value
wizard_value inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_interface { value_source user_value
wizard_value inferred_value };
                                                                                
cdl_configuration eCos {
    description "" ;
    template    redboot ;
    package -hardware CYGPKG_HAL_ARM current  ;
    package -hardware CYGPKG_HAL_ARM_ARM9 current  ;
    package -hardware CYGPKG_HAL_ARM_ARM9_EP93XX current  ;
    package -hardware CYGPKG_DEVS_FLASH_STRATA current  ;
    package -hardware CYGPKG_DEVS_ETH_ARM_EP93XX current  ;
    package -template CYGPKG_HAL current  ;
    package -template CYGPKG_INFRA current  ;
    package -template CYGPKG_REDBOOT current  ;
    package -template CYGPKG_ISOINFRA current  ;
    package -template CYGPKG_LIBC_STRING current  ;
    package CYGPKG_IO_FLASH current  ;
    package CYGPKG_IO_ETH_DRIVERS current  ;
    package CYGPKG_FS_JFFS2 current ;
    package CYGPKG_ERROR current ;
    package CYGPKG_IO_FILEIO current ;
    package CYGPKG_MEMALLOC current ;
    package CYGPKG_LINUX_COMPAT current ;
    package CYGPKG_IO current ;
    package CYGPKG_COMPRESS_ZLIB current ;
};
cdl_option CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP {
          user_value 1
};
cdl_option CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP {
          user_value 1
};
                                                                                
cdl_option CYGBLD_BUILD_REDBOOT_WITH_EXEC {
    user_value 1
};
                                                                                
cdl_option CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS {
    user_value 0x00000100
};
                                                                                
cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
    user_value 6144
};
                                                                                
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
    user_value 0
};
cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM {
    inferred_value 0
};
                                                                                
cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS {
    inferred_value 1
};
                                                                                
cdl_option CYGSEM_HAL_ROM_MONITOR {
    inferred_value 1
};
                                                                                
cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
    inferred_value 0 0
};
                                                                                
cdl_option CYGPKG_HAL_ARM_ARM9_ARM920T {
    inferred_value 1
};
                                                                                
cdl_component CYG_HAL_STARTUP {
    user_value ROMRAM
};
                                                                                
cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
    user_value 0x60000
};
cdl_component CYGBLD_BUILD_REDBOOT {
    user_value 1
};
                                                                                
cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS {
    user_value 1
};
                                                                                
cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};
                                                                                
cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};
                                                                                
cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};
                                                                                
cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};
cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1 {
    user_value 0
};
                                                                                
cdl_component CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1 {
    user_value "\"jffs2\""
};
                                                                                
# BLOCK Device Access
cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_1 {
    user_value 1
};
                                                                                
cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
    user_value 0x00060000
};
                                                                                
cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_1 {
    user_value 0x00020000
};
                                                                                
cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 {
    user_value "\"/dev/flash1\""
};
cdl_component CYGBLD_BUILD_REDBOOT_WITH_ZLIB {
    user_value 1
};
                                                                                
cdl_option CYGNUM_REDBOOT_LOAD_ZLIB_BUFFER {
    user_value 64
};
                                                                                
cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
    user_value 1
};
                                                                                
cdl_option CYGOPT_FS_JFFS2_WRITE {
    user_value 1
};
                                                                              

# ----------- FIS LIST -----------------
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x60000000  0x60000000  0x00060000  0x00000000
jffs2             0x60060000  0x01200000  0x004E0000  0x01200000
ramdisk           0x60540000  0x00800000  0x00340000  0x00800000
zImage            0x60880000  0x00080000  0x000C0000  0x00080000
FIS directory     0x60FE0000  0x60FE0000  0x0001F000  0x00000000
RedBoot config    0x60FFF000  0x60FFF000  0x00001000  0x00000000


RedBoot> rtunet_config
rtunet_config:Starting...
unlink failed -1: No space left on device


# ----------- JFFS2 Directory DF Listing --------------------
/mnt/jffs2_fs # df .
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2            4992       644      4348  13% /mnt/jffs2_fs
/mnt/jffs2_fs #


# ----------- JFFS2 Directory Listing --------------------
/mnt/jffs2_fs # ls -l
-rw-rw-rw-    1 root     root          203 Jan  1 00:24 rbconfig
-rw-r--r--    1 root     root          203 Jan  1 00:18 rbconfig.bak
/mnt/jffs2_fs #



# ----------- Redboot Unlink SRC CODE --------------------
static int get_config(unsigned char *rd_buf)
{
    int err, i;
                                                                                
    err = mount(CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1, "/", "jffs2");
    if (err) {
        diag_printf("Mount failed %d\n", err);
        return err;
    }
    if (verbose) {
        diag_printf("Mount Successful\n");
    }
                                                                                
    err = chdir( "/" );
    if (err) {
        diag_printf("chdir failed %d\n", err);
        goto umnt;
    }
    if (verbose) {
        diag_printf("chdir Successful\n");
    }
                                                                        
    checkcwd("/");
    err = readfile("/rbconfig", rd_buf, 256);
    if (err == 0) {
        //Replace \n with ' '
        for (i = 0; i < strlen(rd_buf);i++)
        {
            if (rd_buf[i] == '\n')
            {
                rd_buf[i] = ' ';
            }
        }
    }
                                                                                
    err = unlink("/rbconfig");
    if (err) {
        diag_printf("unlink failed %d: %s\n",err,
                                strerror(errno));
    }
                                                                                
umnt:
    err = umount("/");
    if (err) {
        diag_printf("umount failed %d\n", err);
    } else {
        if (verbose) {
            diag_printf("umount Successful\n");
        }
    }
                                                                                
    return err;
}
On Tue, 2005-07-12 at 16:55, Andrew Lunn wrote:
> On Tue, Jul 12, 2005 at 02:01:55PM +1000, Benny Chen wrote:
> > Hi there,
> > Our system runs Cirrus Linux and uses Redboot as the bootloader.  I
> > would like to access my JFFS2 partition from redboot but could not find
> > enough information to get this going.  It seems from reading the list
> > that this has been done countless of times but yet I am not able to work
> > it out.  
> > 
> > Please bear with me as I have not gotten enough information about this
> > topic hence, ask very random and basic questions.
> > 
> > I am using redboot from ecosV2_0.
> 
> Very old. There has been a lot of changes to the JFFS2 support since
> then. So your millage may vary.
> 
> > 
> > 1. I used ecosconfig add jffs2 and followed by ecosconfig check and
> > there is no conflict.
> > 
> > Target: edb9301
> > Template: redboot
> > Added:
> >  CYGPKG_IO_FLASH
> >  CYGPKG_IO_ETH_DRIVERS
> >  CYGPKG_IO_FILEIO
> >  CYGPKG_COMPRESS_ZLIB
> >  CYGPKG_MEMALLOC
> >  CYGPKG_ERROR
> >  CYGPKG_LINUX_COMPAT
> >  CYGPKG_IO
> >  CYGPKG_FS_JFFS2
> > No conflicts
> > 
> > 2. I have make clean and make the redboot.bin image and makes completes
> > successfully.  I manage to download the redboot.bin to target and it
> > boots up the redboot> prompt ok.  However, when I tried to type the
> > 'mount' command it is not even found.  I am missing something here. What
> > I have in mind is that I would get a list of commands like 'mount',
> > 'unmount', 'ls', that can be executed in the redboot cmd prompt.
> 
> Support for this was added 2003/12/02 14:40:19. eCos 2.0 was released
> sometime around 2003/02/14. So this is obviously not going to work.
> Put your eCos sources in a museum and try again with something more
> uptodate.
> 
>         Andrew


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

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

* Re: [ECOS] Redboot JFFS2 Support
  2005-07-31 22:27   ` Benny Chen
@ 2005-08-01  9:47     ` Andrew Lunn
  0 siblings, 0 replies; 13+ messages in thread
From: Andrew Lunn @ 2005-08-01  9:47 UTC (permalink / raw)
  To: Benny Chen; +Cc: ecos-discuss

> cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
>     user_value 0x00060000
> };
>                                                                                 
> cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_1 {
>     user_value 0x00020000
> };
>                                                                                 
> RedBoot> fis list
> Name              FLASH addr  Mem addr    Length      Entry point
> RedBoot           0x60000000  0x60000000  0x00060000  0x00000000
> jffs2             0x60060000  0x01200000  0x004E0000  0x01200000
> ramdisk           0x60540000  0x00800000  0x00340000  0x00800000
> zImage            0x60880000  0x00080000  0x000C0000  0x00080000
> FIS directory     0x60FE0000  0x60FE0000  0x0001F000  0x00000000
> RedBoot config    0x60FFF000  0x60FFF000  0x00001000  0x00000000

The CYGNUM_IO_FLASH_BLOCK_LENGTH_1 is not consistent with the Length
entry in the FIS table.

        Andrew

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

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

end of thread, other threads:[~2005-08-01  9:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-12  4:02 [ECOS] Redboot JFFS2 Support Benny Chen
2005-07-12  6:56 ` Andrew Lunn
2005-07-12 23:47   ` Benny Chen
2005-07-13  6:45     ` Andrew Lunn
2005-07-13 15:55       ` Frank Pagliughi
2005-07-13 16:47         ` Andrew Lunn
2005-07-13 23:43           ` Benny Chen
2005-07-28  5:59           ` Benny Chen
2005-07-28  7:06             ` Andrew Lunn
2005-07-29  5:24               ` Benny Chen
2005-07-13 23:49         ` Benny Chen
2005-07-31 22:27   ` Benny Chen
2005-08-01  9:47     ` Andrew Lunn

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 read-only IMAP folder(s) and NNTP newsgroup(s).