Suspected ##SPAM## -:Re: [PATCH v4] xload: get barebox size from barebox_arm_head

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Sep 5 08:02:24 EDT 2012


On 13:37 Wed 05 Sep     , Jan Weitzel wrote:
> Am Mittwoch, den 05.09.2012, 12:34 +0200 schrieb Jean-Christophe
> PLAGNIOL-VILLARD:
> > On 10:22 Wed 05 Sep     , Jan Weitzel wrote:
> > > Add functions to read the barebox_arm_head, check barebox magicword
> > > and read out the barebox image size.
> > > Create a inital partion of 1Mb to access the barebox image on nand.
> > > 
> > > Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
> > > ---
> > > v2: remove fall back if header read fail 
> > > v3: fix header check, rebase master 
> > > v4: factorize barebox detection
> > > 
> > >  arch/arm/include/asm/barebox-arm-head.h |    9 +++++
> > >  arch/arm/mach-omap/include/mach/xload.h |    2 +-
> > >  arch/arm/mach-omap/xload.c              |   57 ++++++++++++++++++++++++++++--
> > >  common/filetype.c                       |    3 +-
> > this con not work
> > 
> > common/filetype is use accross ARCH
> > 
> > is_barebox_arm_head need to be a inline returning false if not arm
> this is why I use the ugly #include
> "../arch/arm/include/asm/barebox-arm-head.h". By now we can detect
> filetype_arm_barebox even on non arm architectures. Is breaking this OK?
no it's not

> Jan
> > 
> > Best Regards,
> > J.
> > >  4 files changed, 65 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
> > > index 2c250e9..42bd239 100644
> > > --- a/arch/arm/include/asm/barebox-arm-head.h
> > > +++ b/arch/arm/include/asm/barebox-arm-head.h
> > > @@ -1,6 +1,15 @@
> > >  #ifndef __ASM_ARM_HEAD_H
> > >  #define __ASM_ARM_HEAD_H
> > >  
> > > +#define ARM_HEAD_SIZE		0x30
> > > +#define HEAD_MAGICWORD_OFFSET	0x20
> > > +#define HEAD_SIZE_OFFSET	0x2C
> > > +
> > > +static inline int is_barebox_arm_head(const char *head)
> > > +{
> > > +	return !strcmp(head + HEAD_MAGICWORD_OFFSET, "barebox");
> > > +}
put this in flietype.h

Best Regards,
J.



More information about the barebox mailing list