[U-Boot-Users] [PATCH] TQM5200B: update MTD partition layout

Martin Krause Martin.Krause at tqs.de
Thu Nov 8 16:43:17 CET 2007


wd at denx.de wrote on Wednesday, November 07, 2007 8:43 PM:
> In message <20071107141109.6486.18579.stgit at tq-sewsrv-4.tq-net.de>
> you wrote: 
> > - insert partition for dtb blob to TQM5200B MTD layout
> > - fix MTD layout for highboot configuration
> > - set env variables dependent on the configured board   (TQM5200 or
> > TQM5200B) 
> > 
> > Signed-off-by: Martin Krause <martin.krause at tqs.de>
> 
> I'm afraid I have to NAK this patch.
> 
> >  #  else	/* highboot */
> > -#   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:2560k(kernel),"	\
> > +#   define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:256k(dtb);"		\
> > +						"768k(environment),"	\ +						"1536k(kernel),"	\
> 
> First, it is a realy ugly design to have the environment right in the
> middle of your flash. Please locate it adjacent to the  U-Boot  code.
> Ditto for the DTB.

Yes, it seems ugly to have the environment in the middle of the flash. 
This comes from the design goal behind the highboot option. The 
intention was to have two u-boot images in parallel in flash. One 
"normal" lowboot image and one highboot emergency image. If the lowboot
image does not boot anymore (after a faulty update for example), the
highboot image could be used to boot the board and to restore the
normal lowboot image. A Jumper on the STK52xx board is used to select
between high- and lowboot. Highboot and lowboot U-Boot share the
same environment in flash. It was never intended to use a highboot
U-Boot without a lowboot U-Boot. So the envrironment does not
really lay in the middle of the flash.

Hm, thinking about this, the whole MTDPARTS_DEFAULT definition for 
the highboot configuration should be removed. The current definition
only fits on boards with >=32 MiB flash. On boards with smaller
flash memory the 'firmware' partition lays outside the physical
available memory:

#  else /* highboot */
#   define MTDPARTS_DEFAULT     "mtdparts=TQM5200-0:2560k(kernel),"     \
                                                "3584k(small-fs),"      \
                                                "2m(initrd),"           \
                                                "8m(misc),"             \
                                                "15m(big-fs),"          \
                                                "1m(firmware)"
#  endif /* CFG_LOWBOOT */

So I propose to use the MTDPARTS_DEFAULT of the normal lowboot
configuration also for the higboot configuration. This configuration
will not fit to 100% also, but it is as good as the current
highboot configuration.

> Second, and major reason for my NAK: 1.5 MB is  much  too  small  for
> current  2.6  Linux  kernels,  assuming  you  have  to  enable  a few
> additional drivers. There was a good reason why I changed  this  size
> recently.

OK, I see the point. I then propose to change the partitions to the 
following:

TQM5200_B:

Offset	Size(Partition)
0		1m(firmware)
		256k(dtb)
		2818k(kernel)
4M		4m(samll-fs)
...
8M		8m(misc)
...
16M		16m(big-fs)
...
32M

TQM5200:

0		640k(firmware)
		128k(dtb)
		3328k(kernel)
4M		4m(samll-fs)
...
8M		8m(misc)
...
16M		16m(big-fs)
...
32M

TQM5200_B highboot -> same as TQM5200_B

This partitioning should work for boards with 4 MiB, 8 MiB, 16 MiB 
and 32 MiB flash memory.

If this is OK, I'll submit a patch.

Best Regards,
Martin Krause




More information about the U-Boot mailing list