JFFS2 impact when don't have sub page access
Gupta, Pekon
pekon at ti.com
Fri Aug 2 02:25:02 EDT 2013
Hi,
>
> On Friday 02 August 2013 10:27 AM, Gupta, Pekon wrote:
> > Hello,
> >
> >> Hi,
> >>
> >> I' am using an OMAP L138 with a NAND SLC (MT29F4G08)
> >>
> >> I was making some tests with Ubifs but found some errors due to OMAP
> >> don't support sub pages access:
> >>
> > TI OMAP2-NAND supports sub-pages for SLC NAND.
> > http://lists.infradead.org/pipermail/linux-
> mtd/attachments/20130405/a146567f/attachment.obj
> >
> > This patch was accepted in mainline linux-3.10,
> > And tested on AM335x with 2K/64 NAND.
> >
> > You can follow this patch details here..
> > http://lists.infradead.org/pipermail/linux-mtd/2013-March/046285.html
>
> Yes, but Aníbal is talking about OMAP-L138 which is actually a DaVinci
> part and uses drivers/mtd/nand/davinci_nand.c
>
The patch adds support for subpage-write in generic NAND driver,
So it should work directly for davinci_nand.c
> May be you can clarify whether absence of subpage support will lead to
> the kind of errors Aníbal reported?
>
I suspect there is some mis-match in options passed while creating
UBI image for sub-pages. With subpages the LEB size (-e) passed to
mkfs.ubifs has different calculation. It should be '(n-1) * page size'
where 'n' is number of pages in the erase-block.
This is because when using sub-pages both EraseHeader and
VolumeHeader are packed in same page.
I use some personal script to keep that handy, refer [1]
You can also refer to
http://processors.wiki.ti.com/index.php/UBIFS_Support
> Also, the subject talks about JFFS2. There is no known affect of absence
> of subpage support on JFFS2, right?
>
There should not be any problem in using either UBIFS or JFFS2.
[1] create_ubi_image.sh
(this script used fixed folder name 'rootfs' as -r option)
#!/bin/sh
#----------------------------------------------------------------------
# Description: generic script to create UBI image for NAND devices
# with different page sizes.
#
# Author: Pekon Gupta (pekon at ti.com)
# Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> \
# <PARTITION_SIZE>
# History:
# version 1.1 pekon
# added calculation of LEB_SIZE while using subpages
#
#----------------------------------------------------------------------
#-- remove old files --
rm -v ubi.ubifs ubi.img ubinize.cfg
#-- user inputs --
PAGE_SIZE=$1
SUBPAGE_SIZE=$2
PARTITION_SIZE=$3
if test -z $1 || test -z $2 || test -z $3
then
echo "Error: incomplete inputs"
echo "Usage: create_ubi_image.sh <PAGE_SIZE> <SUBPAGE_SIZE> <PARTITION_SIZE>"
exit
fi
#-- calculate UBI parameter --
PEB_SIZE=$(( 64 * $PAGE_SIZE ))
# LEB size = PEB_SIZE - number_of_pages_used_for_UBI_headers * PAGE_SIZE
# number_of_pages_used_for_UBI_header = 1 if using sub-pages
# number_of_pages_used_for_UBI_header = 2 if not using sub-pages
if test $PAGE_SIZE -ne $SUBPAGE_SIZE
then
LEB_SIZE=$(( $PEB_SIZE - ( 1 * $PAGE_SIZE )))
else
LEB_SIZE=$(( $PEB_SIZE - ( 2 * $PAGE_SIZE )))
fi
LEB_COUNT=$(( $PARTITION_SIZE / $LEB_SIZE ))
echo "LOG: PAGE_SIZE = $PAGE_SIZE"
echo "LOG: SUBPAGE_SIZE = $SUBPAGE_SIZE"
echo "LOG: PEB_SIZE = $PEB_SIZE"
echo "LOG: LEB_SIZE = $LEB_SIZE"
echo "LOG: LEB_COUNT = $LEB_COUNT"
#-- generate ubinize.cfg --
echo "[ubifs]" >> ubinize.cfg
echo "mode=ubi" >> ubinize.cfg
echo "image=ubi.ubifs" >> ubinize.cfg
echo "vol_id=0" >> ubinize.cfg
echo "vol_size=$PARTITION_SIZE" >> ubinize.cfg
echo "vol_type=dynamic" >> ubinize.cfg
echo "vol_name=test" >> ubinize.cfg
echo "vol_flags='autoresize'" >> ubinize.cfg
echo "vol_alignment=1" >> ubinize.cfg
#-- generate UBI image --
mkfs.ubifs -o ubi.ubifs -m $PAGE_SIZE -e $LEB_SIZE -c $LEB_COUNT -r rootfs
ubinize -o ubi.img -m $PAGE_SIZE -p $PEB_SIZE -s $SUBPAGE_SIZE -O $SUBPAGE_SIZE -v ubinize.cfg
# ---------------------------------------------
More information about the linux-mtd
mailing list