Re: [U-Boot] [PATCH] omap1510inn: arm925t: remove support

2013-09-15 Thread Wolfgang Denk
Dear Albert,

In message <1379224355-20157-1-git-send-email-albert.u.b...@aribaud.net> you 
wrote:
> omap1510inn is orphan and has been for years now.
> Reove it and, as it was the only arm925t target,
> also remove arm925t support.
> Update doc/README.scrapyard accordingly.
> 
> Signed-off-by: Albert ARIBAUD 

Acked-by: Wolfgang Denk 


BTW: it would be nice if you could mark the patch version in the
Subject: line, like "[PATCH v3]".

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
To get something done, a committee should consist  of  no  more  than
three men, two of them absent.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] omap1510inn: arm925t: remove support

2013-09-15 Thread Albert ARIBAUD
Hi Wolfgang,

On Sun, 15 Sep 2013 10:56:30 +0200, Wolfgang Denk  wrote:

> Dear Albert,
> 
> In message <1379224355-20157-1-git-send-email-albert.u.b...@aribaud.net> you 
> wrote:
> > omap1510inn is orphan and has been for years now.
> > Reove it and, as it was the only arm925t target,
> > also remove arm925t support.
> > Update doc/README.scrapyard accordingly.
> > 
> > Signed-off-by: Albert ARIBAUD 
> 
> Acked-by: Wolfgang Denk 
> 
> 
> BTW: it would be nice if you could mark the patch version in the
> Subject: line, like "[PATCH v3]".

Oops -- apologies.

> Thanks.
> 
> Best regards,
> 
> Wolfgang Denk

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] most efficient way to submit patches that are typo/grammar fixes?

2013-09-15 Thread Albert ARIBAUD
Hi Wolfgang,

On Sun, 15 Sep 2013 01:28:12 +0200, Wolfgang Denk  wrote:

> Dear "Robert P. J. Day",
> 
> In message  you wrote:
> > 
> >   given my pedantic nature, i've run across the occasional spelling
> > mistake or grammar glitch and want to know the best way to submit a
> > patch (or patches) for that. naturally, this stuff is scattered across
> > the u-boot tree, so is it better to try to submit a separate patch per
> > subsystem, or just one big one?
> > 
> >   most of this stuff is in comments so it doesn't represent any
> > functional change and therefore shouldn't hurt anything ... stuff like
> > spellings of "environent" or "volitle", stuff like that.
> > 
> >   best way to do this? thanks.
> 
> It's usually a good idea not to combine too many unrelated changes
> into a huge single patch.  But then, there is also no need to split
> spelling fixes across sub-systems.  I recommend to use common sense.
> 
> It's probably a good idea to add a flag like "[COSMETIC]" to the patch
> subject, so we know immediately that this does not contain any
> functional changes.

Maybe rather a "cosmetic:" tag so that the patch is also seen as such
inside Git, where the "[...]" flag won't show up.

> Best regards,
> 
> Wolfgang Denk
> 


Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] most efficient way to submit patches that are typo/grammar fixes?

2013-09-15 Thread Robert P. J. Day
On Sun, 15 Sep 2013, Albert ARIBAUD wrote:

> Hi Wolfgang,
>
> On Sun, 15 Sep 2013 01:28:12 +0200, Wolfgang Denk  wrote:
>
> > Dear "Robert P. J. Day",
> >
> > In message  you wrote:
> > >
> > >   given my pedantic nature, i've run across the occasional spelling
> > > mistake or grammar glitch and want to know the best way to submit a
> > > patch (or patches) for that. naturally, this stuff is scattered across
> > > the u-boot tree, so is it better to try to submit a separate patch per
> > > subsystem, or just one big one?
> > >
> > >   most of this stuff is in comments so it doesn't represent any
> > > functional change and therefore shouldn't hurt anything ... stuff like
> > > spellings of "environent" or "volitle", stuff like that.
> > >
> > >   best way to do this? thanks.
> >
> > It's usually a good idea not to combine too many unrelated changes
> > into a huge single patch.  But then, there is also no need to split
> > spelling fixes across sub-systems.  I recommend to use common sense.
> >
> > It's probably a good idea to add a flag like "[COSMETIC]" to the patch
> > subject, so we know immediately that this does not contain any
> > functional changes.
>
> Maybe rather a "cosmetic:" tag so that the patch is also seen as such
> inside Git, where the "[...]" flag won't show up.

  ok, i can go with that, thanks.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxs: Add instruction to install 'libssl-dev'

2013-09-15 Thread Marek Vasut
Dear Fabio Estevam,

> On Sat, Sep 14, 2013 at 7:21 PM, Fabio Estevam  wrote:
> > From: Fabio Estevam 
> > 
> > Building the mx28evk target on a host PC without the 'libssl-dev'
> > package, results in the following build error:
> > 
> > mxsimage.c:18:25: fatal error: openssl/evp.h: No such file or directory
> > 
> > Add an entry about the need of installing this package.
> > 
> > Also, remove the 'elftosb' text, since now we have the new 'mxsimage'
> > method.
> 
> Ops, looks like we cannot remove elftosb yet.
> 
> When I try "make u-boot.sb":
> 
> make[1]: Entering directory
> `/home/fabio/denx/u-boot/arch/arm/cpu/arm926ejs/mxs' sed
> "s@OBJTREE@/home/fabio/denx/u-boot@g"
> /home/fabio/denx/u-boot/arch/arm/cpu/arm926ejs/mxs/u-boot-imx28.bd >
> /home/fabio/denx/u-boot/u-boot.bd
> elftosb -zf imx28 -c /home/fabio/denx/u-boot/u-boot.bd -o
> /home/fabio/denx/u-boot/u-boot.sb
> make[1]: elftosb: Command not found

mxsimage is not enabled by default yet, I would like to postpone that for next 
release. But (!) it would be nice if you did start testing it so when enabled, 
it is working well.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] gpmi-nand driver and jffs2 support

2013-09-15 Thread Marek Vasut
Dear Hector Palacios,

> Dear Marek,
> 
> On 09/04/2013 04:38 PM, Marek Vasut wrote:
> > Dear Huang Shijie,
> > 
> >> On Wed, Sep 04, 2013 at 04:00:36PM +0200, Marek Vasut wrote:
> >>> Dear Huang Shijie,
> >>> How come hector was then able to write his JFFS2 partition ?
> >> 
> >> If he uses the gpmi, he should not write the JFFS2, since the gpmi
> >> does not support the jffs2. He will get the failure in the end.
> > 
> > Hector, can you comment on this?
> 
> I don't think I'm following these comments. The facts are:
> 1) A JFFS2 filesystem image written with nandwrite (mtd-utils v1.5.0)
>   a) does not mount on kernel v3.10
>   b) mounts OK on linux-next kernel (v3.12) with the patchset [1] from 
Huang
>   (actually I didn't use linux-next but instead a v3.10 where I merged all
> the commits done to MTD in linux-next, which are a lot).
> 
> 2) A JFFS2 filesystem image written with U-Boot v2013.01
>   a) mounts OK on old FSL kernel 2.6.35
>   b) does not mount on kernel v3.10 (neither on v3.8, I believe).
>   c) does not mount on linux-next with the patchset [1]
> 
> [1] http://lists.infradead.org/pipermail/linux-mtd/2013-August/048360.html
> 
> Marek, could you please confirm 2b on your side, just in case I'm doing
> anything wrong in my custom U-Boot?

Sorry for the late reply. I cannot test it, since I don't have such a setup.

I still believe it'd be worth figuring out what the heck is going on in here. 
There is obviously a bug which breaks compatibility and that must not happen.

[...]

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] gpmi-nand driver and jffs2 support

2013-09-15 Thread Marek Vasut
Dear Huang Shijie,

> 于 2013年09月04日 23:46, Hector Palacios 写道:
> > Dear Marek,
> > 
> > On 09/04/2013 04:38 PM, Marek Vasut wrote:
> >> Dear Huang Shijie,
> >> 
> >>> On Wed, Sep 04, 2013 at 04:00:36PM +0200, Marek Vasut wrote:
>  Dear Huang Shijie,
>  How come hector was then able to write his JFFS2 partition ?
> >>> 
> >>> If he uses the gpmi, he should not write the JFFS2, since the gpmi
> >>> does not support the jffs2. He will get the failure in the end.
> >> 
> >> Hector, can you comment on this?
> > 
> > I don't think I'm following these comments. The facts are:
> > 1) A JFFS2 filesystem image written with nandwrite (mtd-utils v1.5.0)
> > a) does not mount on kernel v3.10
> > b) mounts OK on linux-next kernel (v3.12) with the patchset [1] from
> > Huang
> > (actually I didn't use linux-next but instead a v3.10 where I merged
> > all the commits done to MTD in linux-next, which are a lot).
> > 
> > 2) A JFFS2 filesystem image written with U-Boot v2013.01
> > a) mounts OK on old FSL kernel 2.6.35
> > b) does not mount on kernel v3.10 (neither on v3.8, I believe).
> > c) does not mount on linux-next with the patchset [1]
> 
> The gpmi driver in FSL kernel 2.6.35 is different from the linux-next or
> linux v3.10.
> 
> We have abandoned the old gpmi driver, and we use the same gpmi code in
> current FSL kernel.
> 
> Since we swtich to the upstream gpmi code, and it could not support the
> jffs2,
> 
> and that's why you mount always failed.

With the patchset, mounting the jffs should work again, no? If mounting the 
jffs 
works with the patchset AND it only works with jffs written using the new 
driver, you will need to introduce soem compatibility option or something along 
that.

> > [1]
> > http://lists.infradead.org/pipermail/linux-mtd/2013-August/048360.html
> > 
> > Marek, could you please confirm 2b on your side, just in case I'm
> > doing anything wrong in my custom U-Boot?
> > 
> > So the jffs2 support is compatiable all the time.
>  
>  Is the old Freescale 2.6.35 GPMI NAND format compatible with the one
>  after applying this patchset?
> >>> 
> >>> Not compatible.
> >>> 
> >>> This patch set is still underreview.
> >> 
> >> So this patch breaks compatiblity with FSL kernel release? This needs
> >> fixing,
> >> otherwise it's impossible to do a drop-in replacement for the ancient
> >> FSL
> >> kernel.
> >> 
> >> that I could mount with Linux 3.7 and earlier?
> > 
> > I think the mount can be succeeded.
>  
>  Ok, does that mean that we need this patchset in U-Boot in order to
>  properly write JFFS2 onto GPMI NAND there? Is that the message you
>  wanted to relay to us?
> >>> 
> >>> Besides this patchset, the u-boot needs more patches to sync with the
> >>> kernel mtd code. Such as the full-id features.
> >> 
> >> Can you elaborate on this more? This is very vague, I would like to
> >> know what
> >> exactly is missing.
> 
> 92a2645 mtd: add 4 Toshiba nand chips for the full-id case
> ec6e87e mtd: add the support to parse out the full-id nand type

Do these really have any impact?

> f22d5f6 mtd: add new fields to nand_flash_dev{}
> 2febcdf mtd: gpmi: set the BCH's geometry with the ecc info
> d1048aa mtd: add the ecc info for some full-id nand chips
> 5721934 mtd: parse out the ECC info for the full-id nand chips
> 2dc0bdd mtd: add ECC info for nand_flash_dev{}
> e2985fc mtd: replace the hardcode with the onfi_feature()
> 6dcbe0c mtd: get the ECC info from the Extended Parameter Page
> 5b40db6 mtd: add a helper to get the supported features for ONFI nand
> 5138a98 mtd: add data structures for Extended Parameter Page
> 10c86ba mtd: get the ECC info from the parameter page for ONFI nand
> 4cfeca2 mtd: add datasheet's ECC information to nand_chip{}

Hector, can you inspect those patches ?

> > Yes, please, we need more details. This seems to be related with how
> > the MTD drivers (in Linux and in U-Boot) access the OOB area to store
> > the JFFS2 cleanmarkers, right?
> > 
> > The error I'm receiving from the kernel is at fs/jffs2/wbuf.c
> > 
> > if (!oinfo || oinfo->oobavail == 0) {
> > pr_err("inconsistent device description\n");
> > return -EINVAL;
> > }
> 
> Before apply the patches above, the gpmi will use all the oob, so
> "oinfo->oobavail == 0" becomes true.
> 
> After apply the patches, the gpmi will not use all the oob for the ONFI
> SLC nand or the full-id nand,
> and it can supports the jffs2 when you apply the other SLC/MLC patchset.

So the patches you listed above are not enough?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] usb: new board-specific USB init interface

2013-09-15 Thread Marek Vasut
Dear Mateusz Zalega,

> On 09/06/13 13:40, Marek Vasut wrote:
> >>> Moreover, the 'int index' should likely be unsigned int and the
> >>> special value to init all controllers at once should probably then
> >>> be 0x
> >> 
> >> Despite our greatest ambitions, I don't think we're likely to use
> >> more than 2^31-1 USB controllers at a time. Besides, negative
> >> values look better both in code and debugger session.
> > 
> > Thinking of it further, instead of using negative value here, like I
> > mentioned above, why not make the "board_usb_init_type" into a field
> > of flags , then add flag to init all controllers at once ?
>  
>  That's unnecessary. It wouldn't lead to any practical advantage over
>  existing interface.
> >>> 
> >>> The advantage would be you won't be mixing two things (value AND value
> >>> with special meaning) into the "index" parameter.
> >> 
> >> Alright, provide a use-case. The only 'special' value we have now
> >> doesn't interfere with controller index. Why write code or interfaces
> >> that won't ever be used?
> > 
> > Look, abusing the index field with a special value is moronic, especially
> > if you
> 
> I wouldn't call a de-facto standard abusive or moronic.
> On the other hand, contributing to unnecessary code bloat would be.
> 
> > _do_ have another field that can very well be turned into a block of
> > flags
> 
> Have you provided another use-case for that, as I asked?
> 
> > instead of enum right next to it.
> > 
> > function(int foo , enum bar)
> > 
> > | ^
> > 
> > `-'
> > 
> >  flags go
> >  
> >here
> > 
> > Then int foo can be turned into unsigned int foo _and_ be used for it's
> > one singular purpose. Likewise, enum bar will now be "unsigned int
> > flags" . Do you see the separation now ?
> 
> Read your mail carefully - at this point I don't have any problems
> understanding what you wish to do, but I see your API changes as
> unjustified. Can you justify them without appealing to your authority
> and maybe inserting a couple of ad-hominems here and there?

I suppose this thread can be concluded by droping the INIT_ALL stuff entirely. 
Afterall, we do not want to init _ALL_ ports at once, but we want to init them 
selectively.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] dfu ram support

2013-09-15 Thread Marek Vasut
Dear Afzal Mohammed,

> Hi,
> 
> DFU spec mentions it as a method to upgrade firmware (software stored
> in writable non-volatile memory). It also says other potential uses of
> DFU is beyond scope of the spec.
> 
> Here such a beyond the scope use is being attempted - directly pumping
> binary images from host via USB to RAM. This facility is a developer
> centric one in that it gives advantage over upgrading non-volatile
> memory for testing new images every time during development and/or
> testing.
> 
> Directly putting image onto RAM would speed up upgrade process. This and
> convenience was the initial thoughts that led to doing this, speed
> improvement over MMC was only 1 second though - 6 sec on RAM as opposed
> to 7 sec on MMC in beagle bone, perhaps enabling cache and/or optimizing
> DFU framework to avoid multiple copy for ram (if worth) may help, and
> on other platforms and other boot media like NAND maybe improvement
> would be higher.
> 
> And for a platform that doesn't yet have proper DFU suppport for
> non-volatile media's, DFU to RAM can be used.
> 
> Another minor advantage would be to increase life of mmc/nand as it
> would be less used during development/testing.
> 
> usage:  ram  
> eg. kernel ram 0x8100 0x100
> 
> Downloading images to RAM using DFU is not something new, this is
> acheived in openmoko also.
> 
> DFU on RAM can be used for extracting RAM contents to host using dfu
> upload. Perhaps this can be extended to io for squeezing out register
> dump through usb, if it is worth.
> 
> In addition to ram support, a minor unification of dfu read/write enum's
> currently duplicated in mmc/nand is done, helping ram support too.
> 
> Also dfu ram support is added for am335x SoC based boards.
> 
> Based on: usb master branch
> 
> Regards
> Afzal

Will wait for Heiko's ACK and then apply for -next.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxs: Add instruction to install 'libssl-dev'

2013-09-15 Thread Fabio Estevam
Hi Marek,

On Sun, Sep 15, 2013 at 11:03 AM, Marek Vasut  wrote:

> mxsimage is not enabled by default yet, I would like to postpone that for next
> release. But (!) it would be nice if you did start testing it so when enabled,
> it is working well.

Ok, so the issue was that I was using the mkimage provided by Ubuntu
instead of the one provided by U-boot.

There is also a typo in the directory path (arch/arm/boot/ does not exist):

With the changes below I can build u-boot.sb via mkimage method:

--- a/doc/README.mxsimage
+++ b/doc/README.mxsimage
@@ -9,12 +9,12 @@ Usage -- producing image:
 The mxsimage tool is targeted to be a simple replacement for the elftosb2 .
 To generate an image, write an image configuration file and run:

- mkimage -A arm -O u-boot -T mxsimage -n  \
+ ./tools/mkimage -A arm -O u-boot -T mxsimage -n  \
  

 The output bootstream file is usually using the .sb file extension. Note
 that the example configuration files for producing bootable BootStream with
-the U-Boot bootloader can be found under arch/arm/boot/cpu/arm926ejs/mxs/
+the U-Boot bootloader can be found under arch/arm/cpu/arm926ejs/mxs/
 directory. See the following files:

  mxsimage.mx23.cfg -- This is an example configuration for i.MX23
@@ -158,7 +158,7 @@ Usage -- verifying image:
 The mxsimage can also verify and dump contents of an image. Use the following
 syntax to verify and dump contents of an image:

- mkimage -l 
+ ./tools/mkimage -l 

 This will output all the information from the SB image header and all the
 instructions contained in the SB image. It will also check if the various

If you agree with this change, I can send a patch.

Regards,

Fabio Estevam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RESEND] gpio: spear_gpio: Fix gpio_set_value() implementation

2013-09-15 Thread Albert ARIBAUD
Hi Michael,

On Sat, 14 Sep 2013 11:38:02 +0200, Michael Trimarchi
 wrote:

> Hi Axel
> 
> On Sat, Sep 14, 2013 at 11:34 AM, Axel Lin  wrote:
> > 2013/9/14 Albert ARIBAUD :
> >> Hi Axel,
> >>
> >> On Fri, 06 Sep 2013 14:22:40 +0800, Axel Lin 
> >> wrote:
> >>
> >>> In current gpio_set_value() implementation, it always sets the gpio 
> >>> control bit
> >>> no matter the value argument is 0 or 1. Thus the GPIOs never set to low.
> >>> This patch fixes this bug.
> >>>
> >>> Signed-off-by: Axel Lin 
> >>> Acked-by: Stefan Roese 
> >>> Reviewed-by: Vipin Kumar 
> >>> ---
> >>> This patch was sent on 
> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156861.html
> >>>
> >>> Has Stefan's Ack:
> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156864.html
> >>>
> >>> Vipin says the code is fine, so I add Vipin's review-by.
> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156966.html
> >>>
> >>> Michael confirms it works:
> >>> http://lists.denx.de/pipermail/u-boot/2013-August/160652.html
> >>>
> >>> No body picks up this patch, so here is a resend.
> >>> Although I think this is a bug fix, but I'll let maintainers to 
> >>> determinate
> >>> if this is the material for v2013.10.
> >>> Anyway, can someone at least let me know if this patch is ok for apply at 
> >>> some
> >>> point? I have no idea who is maintaining this file.
> >>>
> >>> Regards,
> >>> Axel
> >>>
> >>>  drivers/gpio/spear_gpio.c | 5 -
> >>>  1 file changed, 4 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/gpio/spear_gpio.c b/drivers/gpio/spear_gpio.c
> >>> index 367b670..6fb4117 100644
> >>> --- a/drivers/gpio/spear_gpio.c
> >>> +++ b/drivers/gpio/spear_gpio.c
> >>> @@ -36,7 +36,10 @@ int gpio_set_value(unsigned gpio, int value)
> >>>  {
> >>>   struct gpio_regs *regs = (struct gpio_regs *)CONFIG_GPIO_BASE;
> >>>
> >>> - writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
> >>> + if (value)
> >>> + writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
> >>> + else
> >>> + writel(0, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
> >>>
> >>>   return 0;
> >>>  }
> >>
> >> Despite discussions in the previous thread and the confirmations that
> >> this code is functionally equivalent to the Linux code, I still believe
> >> this code is incorrect for both writing and reading.
> >>
> >> From the doc, writing to GPIODATA will obviously copy each of bits 7
> >> to 0 of the written value into the actuals GPIO mapped to bits 7 to
> >> 0 of this register (assuming they are configured as outputs, of course).
> >> Based on this, the code above:
> >>
> >> - when setting a single GPIO, sets *but clears up to seven other GPIOs*;
> >> - when clearing a single GPIO, clears it *and up to seven other GPIOs*.
> >>
> >> This code may have been tested only for a single active GPIO at a time,
> >> for which this code would behave correctly; but as soon as two GPIOs
> >> from the same bank must be set at the same time, it fails.
> >>
> >> Please fix this code so that setting or clearing a GPIO does not set or
> >> clear any other GPIO, and perform an actual test to confirm this works
> >> before submitting V2.
> >
> > No.
> > Some people (Marek, and *Michael*) asked this question in original
> > discussion thread.
> > The datasheet says each GPIO is controlled by *different* register.
> > (Well, it's unusual.)
> > And that is why we don't need a read-write-update operation.
> > Simply write 0 to the register does work. ( *Michael* replied it works )
> >
> >>
> >> BTW: if (as the previous thread seemed to imply) no one around has the
> >> hardware to test this change, then why exactly is it needed?
> >>
> 
> Yes it's a strange implementation but looking at the documentation seems 
> correct

Ok-- I got the "masking address" trick this time, thanks. It is indeed
unusual, and the code is indeed correct. However, I would like the
patch to include a few lines of comment to explain how and why it
works, for the benefit of its future readers who might find it weird
too.

> Michael

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxs: Add instruction to install 'libssl-dev'

2013-09-15 Thread Marek Vasut
Dear Fabio Estevam,

> Hi Marek,
> 
> On Sun, Sep 15, 2013 at 11:03 AM, Marek Vasut  wrote:
> > mxsimage is not enabled by default yet, I would like to postpone that for
> > next release. But (!) it would be nice if you did start testing it so
> > when enabled, it is working well.
> 
> Ok, so the issue was that I was using the mkimage provided by Ubuntu
> instead of the one provided by U-boot.
> 
> There is also a typo in the directory path (arch/arm/boot/ does not exist):
> 
> With the changes below I can build u-boot.sb via mkimage method:
> 
> --- a/doc/README.mxsimage
> +++ b/doc/README.mxsimage
> @@ -9,12 +9,12 @@ Usage -- producing image:
>  The mxsimage tool is targeted to be a simple replacement for the elftosb2
> . To generate an image, write an image configuration file and run:
> 
> - mkimage -A arm -O u-boot -T mxsimage -n  \
> + ./tools/mkimage -A arm -O u-boot -T mxsimage -n  file> \ 
> 
>  The output bootstream file is usually using the .sb file extension. Note
>  that the example configuration files for producing bootable BootStream
> with -the U-Boot bootloader can be found under
> arch/arm/boot/cpu/arm926ejs/mxs/ +the U-Boot bootloader can be found under
> arch/arm/cpu/arm926ejs/mxs/ directory. See the following files:
> 
>   mxsimage.mx23.cfg -- This is an example configuration for i.MX23
> @@ -158,7 +158,7 @@ Usage -- verifying image:
>  The mxsimage can also verify and dump contents of an image. Use the
> following syntax to verify and dump contents of an image:
> 
> - mkimage -l 
> + ./tools/mkimage -l 
> 
>  This will output all the information from the SB image header and all the
>  instructions contained in the SB image. It will also check if the various
> 
> If you agree with this change, I can send a patch.
> 
> Regards,
> 
> Fabio Estevam

WFM, thanks. You could mention that the mkimage in uboot should be used. Note 
though, that when building out of tree, the location might differ.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] doc: README.mxsimage: Use mkimage provided by U-boot

2013-09-15 Thread Fabio Estevam
From: Fabio Estevam 

Fix the text to make clear that the 'mkimage' provided by U-boot should be used
instead of the one provided by the host PC distribution.

While at it, also fix the directory location of the configuration files.

After these changes, it is possible succesfully generate a u-boot.sb image.

Signed-off-by: Fabio Estevam 
---
 doc/README.mxsimage | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/README.mxsimage b/doc/README.mxsimage
index 88a2caf..79cd06e 100644
--- a/doc/README.mxsimage
+++ b/doc/README.mxsimage
@@ -9,12 +9,12 @@ Usage -- producing image:
 The mxsimage tool is targeted to be a simple replacement for the elftosb2 .
 To generate an image, write an image configuration file and run:
 
- mkimage -A arm -O u-boot -T mxsimage -n  \
+ ./tools/mkimage -A arm -O u-boot -T mxsimage -n  \
  
 
 The output bootstream file is usually using the .sb file extension. Note
 that the example configuration files for producing bootable BootStream with
-the U-Boot bootloader can be found under arch/arm/boot/cpu/arm926ejs/mxs/
+the U-Boot bootloader can be found under arch/arm/cpu/arm926ejs/mxs/
 directory. See the following files:
 
  mxsimage.mx23.cfg -- This is an example configuration for i.MX23
@@ -158,7 +158,7 @@ Usage -- verifying image:
 The mxsimage can also verify and dump contents of an image. Use the following
 syntax to verify and dump contents of an image:
 
- mkimage -l 
+ ./tools/mkimage -l 
 
 This will output all the information from the SB image header and all the
 instructions contained in the SB image. It will also check if the various
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] tools: mxsboot: Mark the FCB pages as valid

2013-09-15 Thread Fabio Estevam
Hi Marek,

On Tue, Sep 10, 2013 at 6:33 PM, Marek Vasut  wrote:
> Dear Stefano Babic,
>
>> On 27/08/2013 23:32, Marek Vasut wrote:
>> > Without this marker, Linux will complain that the NAND pages with
>> > FCB are invalid.
>> >
>> > Signed-off-by: Marek Vasut 
>> > Cc: Fabio Estevam 
>> > Cc: Stefano Babic 
>> > ---
>>
>> Applied to u-boot-imx, thanks !
>
> Fabio, can you confirm this does not break MX28EVK please ?

I am currently without the NAND flash populated on my mx28evk.

Maybe Hector could help testing it?

Regards,

Fabio Estevam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] usb: new board-specific USB init interface

2013-09-15 Thread Marek Vasut
Dear Mateusz Zalega,

> This commit unifies board-specific USB initialization implementations
> under one symbol (usb_board_init), declaration of which is available in
> usb.h.
> 
> New API allows selective initialization of USB controllers whenever needed.
> 
> Signed-off-by: Mateusz Zalega 
> Signed-off-by: Kyungmin Park 
> Reviewed-by: Lukasz Majewski 
> Cc: Marek Vasut 
> Cc: Lukasz Majewski 
> Change-Id: Ia78a1378f30a55dd14598c9a1a1b4b8a762e2cd8
> ---
> Changes since RFC (v1):
> - NVIDIA Tegra doesn't postpone its USB init anymore
> - board_usb_init()'s sole argument name was shortened
> - networking code comment style (/* blurb...) dropped
> - squashed RFC changes so that patch won't break bisect
> 
> v2 changes:
> - commit message fixup
> 
> v3 changes:
> - added 'index' argument to perform selective port initialization
> 
> v4 changes:
> - board_usb_init_fail() renamed to board_usb_cleanup()
> - board_usb_cleanup() accepts controller index and init type
> - DFU and UMS commands don't init all USB controllers anymore
> - minor related fixes & refactorization
> ---

Looks pretty much OK. Did you test it on a few platforms? I'd like to apply 
this 
for -next anyway, since the MW is long closed.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] tools: mxsboot: Mark the FCB pages as valid

2013-09-15 Thread Marek Vasut
Dear Fabio Estevam,

> Hi Marek,
> 
> On Tue, Sep 10, 2013 at 6:33 PM, Marek Vasut  wrote:
> > Dear Stefano Babic,
> > 
> >> On 27/08/2013 23:32, Marek Vasut wrote:
> >> > Without this marker, Linux will complain that the NAND pages with
> >> > FCB are invalid.
> >> > 
> >> > Signed-off-by: Marek Vasut 
> >> > Cc: Fabio Estevam 
> >> > Cc: Stefano Babic 
> >> > ---
> >> 
> >> Applied to u-boot-imx, thanks !
> > 
> > Fabio, can you confirm this does not break MX28EVK please ?
> 
> I am currently without the NAND flash populated on my mx28evk.
> 
> Maybe Hector could help testing it?

Either way WFM, but I am still not fully confident in this patchset (yet).

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxsimage: Use mkimage provided by U-boot

2013-09-15 Thread Marek Vasut
Dear Fabio Estevam,

> From: Fabio Estevam 
> 
> Fix the text to make clear that the 'mkimage' provided by U-boot should be
> used instead of the one provided by the host PC distribution.
> 
> While at it, also fix the directory location of the configuration files.
> 
> After these changes, it is possible succesfully generate a u-boot.sb image.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  doc/README.mxsimage | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/README.mxsimage b/doc/README.mxsimage
> index 88a2caf..79cd06e 100644
> --- a/doc/README.mxsimage
> +++ b/doc/README.mxsimage
> @@ -9,12 +9,12 @@ Usage -- producing image:
>  The mxsimage tool is targeted to be a simple replacement for the elftosb2
> . To generate an image, write an image configuration file and run:
> 
> - mkimage -A arm -O u-boot -T mxsimage -n  \
> + ./tools/mkimage -A arm -O u-boot -T mxsimage -n  file> \ 
> 
>  The output bootstream file is usually using the .sb file extension. Note
>  that the example configuration files for producing bootable BootStream
> with -the U-Boot bootloader can be found under
> arch/arm/boot/cpu/arm926ejs/mxs/ +the U-Boot bootloader can be found under
> arch/arm/cpu/arm926ejs/mxs/ directory. See the following files:
> 
>   mxsimage.mx23.cfg -- This is an example configuration for i.MX23
> @@ -158,7 +158,7 @@ Usage -- verifying image:
>  The mxsimage can also verify and dump contents of an image. Use the
> following syntax to verify and dump contents of an image:
> 
> - mkimage -l 
> + ./tools/mkimage -l 
> 
>  This will output all the information from the SB image header and all the
>  instructions contained in the SB image. It will also check if the various

Tom, are you OK with such a hack (invoking the in-tree mkimage) in the 
documentation?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxsimage: Use mkimage provided by U-boot

2013-09-15 Thread Fabio Estevam
Hi Marek,

On Sun, Sep 15, 2013 at 1:45 PM, Marek Vasut  wrote:

> Tom, are you OK with such a hack (invoking the in-tree mkimage) in the
> documentation?

This seems to be a common practice in the U-boot doc directory:

doc/README.imximage:./tools/mkimage -l 
doc/README.imximage:./tools/mkimage -T imximage \
doc/README.imximage:./tools/mkimage -n ./board/freescale/mx51evk/imximage.cfg \
doc/README.kwbimage:./tools/mkimage -l 
doc/README.kwbimage:./tools/mkimage -n  \
doc/README.kwbimage:./tools/mkimage -n ./board/Marvell/openrd_base/kwbimage.cfg
doc/README.mxsimage: ./tools/mkimage -A arm -O u-boot -T mxsimage -n 
doc/README.qemu-mips:# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x800
doc/README.ublimage:./tools/mkimage -l 
doc/README.ublimage:./tools/mkimage -T ublimage \
doc/README.ublimage:./tools/mkimage -n ./board/davinci/dm365evm/ublimage.cfg \
doc/SPL/README.am335x-network:$ ./tools/mkimage -A arm -O U-Boot -C none -T scri

Regards,

Fabio Estevam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH RESEND] gpio: spear_gpio: Fix gpio_set_value() implementation

2013-09-15 Thread Michael Trimarchi
Hi

On Sun, Sep 15, 2013 at 5:20 PM, Albert ARIBAUD
 wrote:
> Hi Michael,
>
> On Sat, 14 Sep 2013 11:38:02 +0200, Michael Trimarchi
>  wrote:
>
>> Hi Axel
>>
>> On Sat, Sep 14, 2013 at 11:34 AM, Axel Lin  wrote:
>> > 2013/9/14 Albert ARIBAUD :
>> >> Hi Axel,
>> >>
>> >> On Fri, 06 Sep 2013 14:22:40 +0800, Axel Lin 
>> >> wrote:
>> >>
>> >>> In current gpio_set_value() implementation, it always sets the gpio 
>> >>> control bit
>> >>> no matter the value argument is 0 or 1. Thus the GPIOs never set to low.
>> >>> This patch fixes this bug.
>> >>>
>> >>> Signed-off-by: Axel Lin 
>> >>> Acked-by: Stefan Roese 
>> >>> Reviewed-by: Vipin Kumar 
>> >>> ---
>> >>> This patch was sent on 
>> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156861.html
>> >>>
>> >>> Has Stefan's Ack:
>> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156864.html
>> >>>
>> >>> Vipin says the code is fine, so I add Vipin's review-by.
>> >>> http://lists.denx.de/pipermail/u-boot/2013-June/156966.html
>> >>>
>> >>> Michael confirms it works:
>> >>> http://lists.denx.de/pipermail/u-boot/2013-August/160652.html
>> >>>
>> >>> No body picks up this patch, so here is a resend.
>> >>> Although I think this is a bug fix, but I'll let maintainers to 
>> >>> determinate
>> >>> if this is the material for v2013.10.
>> >>> Anyway, can someone at least let me know if this patch is ok for apply 
>> >>> at some
>> >>> point? I have no idea who is maintaining this file.
>> >>>
>> >>> Regards,
>> >>> Axel
>> >>>
>> >>>  drivers/gpio/spear_gpio.c | 5 -
>> >>>  1 file changed, 4 insertions(+), 1 deletion(-)
>> >>>
>> >>> diff --git a/drivers/gpio/spear_gpio.c b/drivers/gpio/spear_gpio.c
>> >>> index 367b670..6fb4117 100644
>> >>> --- a/drivers/gpio/spear_gpio.c
>> >>> +++ b/drivers/gpio/spear_gpio.c
>> >>> @@ -36,7 +36,10 @@ int gpio_set_value(unsigned gpio, int value)
>> >>>  {
>> >>>   struct gpio_regs *regs = (struct gpio_regs *)CONFIG_GPIO_BASE;
>> >>>
>> >>> - writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
>> >>> + if (value)
>> >>> + writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
>> >>> + else
>> >>> + writel(0, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
>> >>>
>> >>>   return 0;
>> >>>  }
>> >>
>> >> Despite discussions in the previous thread and the confirmations that
>> >> this code is functionally equivalent to the Linux code, I still believe
>> >> this code is incorrect for both writing and reading.
>> >>
>> >> From the doc, writing to GPIODATA will obviously copy each of bits 7
>> >> to 0 of the written value into the actuals GPIO mapped to bits 7 to
>> >> 0 of this register (assuming they are configured as outputs, of course).
>> >> Based on this, the code above:
>> >>
>> >> - when setting a single GPIO, sets *but clears up to seven other GPIOs*;
>> >> - when clearing a single GPIO, clears it *and up to seven other GPIOs*.
>> >>
>> >> This code may have been tested only for a single active GPIO at a time,
>> >> for which this code would behave correctly; but as soon as two GPIOs
>> >> from the same bank must be set at the same time, it fails.
>> >>
>> >> Please fix this code so that setting or clearing a GPIO does not set or
>> >> clear any other GPIO, and perform an actual test to confirm this works
>> >> before submitting V2.
>> >
>> > No.
>> > Some people (Marek, and *Michael*) asked this question in original
>> > discussion thread.
>> > The datasheet says each GPIO is controlled by *different* register.
>> > (Well, it's unusual.)
>> > And that is why we don't need a read-write-update operation.
>> > Simply write 0 to the register does work. ( *Michael* replied it works )
>> >
>> >>
>> >> BTW: if (as the previous thread seemed to imply) no one around has the
>> >> hardware to test this change, then why exactly is it needed?
>> >>
>>
>> Yes it's a strange implementation but looking at the documentation seems 
>> correct
>
> Ok-- I got the "masking address" trick this time, thanks. It is indeed
> unusual, and the code is indeed correct. However, I would like the
> patch to include a few lines of comment to explain how and why it
> works, for the benefit of its future readers who might find it weird
> too.
>

I think that patch need to have a better description

Michael

>> Michael
>
> Amicalement,
> --
> Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: u-boot-spi/master

2013-09-15 Thread Jagannadha Sutradharudu Teki
Hi Tom,

Small pull request, planning to send next bunch of request for
next pull.

Thanks,
Jagan.

The following changes since commit 2b26201a2aef0b310b7c04702b0dba5dea493f77:

  env_nand.c: support falling back to redundant env when writing (2013-08-22 
17:49:47 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-spi.git master

for you to fetch changes up to b95f958d7d06b3cd117647b29b288cf168aa2ee9:

  cmd_sf: let "sf update" preserve the final part of the last sector 
(2013-08-27 19:39:39 +0530)


Gerlando Falauto (1):
  cmd_sf: let "sf update" preserve the final part of the last sector

Marek Vasut (1):
  spi: mxs_spi: Configure chipselect after block reset

 common/cmd_sf.c   | 13 -
 drivers/spi/mxs_spi.c | 12 +++-
 2 files changed, 15 insertions(+), 10 deletions(-)


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-09-15 Thread Oliver Metz
Dear Fabio,

>Hi Robert and Hector, 
>
>On Fri, Sep 13, 2013 at 2:46 PM, Wolfgang Denk <[hidden email]> wrote: 
>
>> That's ALLOC_CACHE_ALIGN_BUFFER.   Thanks. 
>
>Could you please let us know wthether the change below fix the problem? 
>
>Thanks, 
>
>Fabio Estevam 
>
>--- a/drivers/net/fec_mxc.c 
>+++ b/drivers/net/fec_mxc.c 
>@@ -794,7 +794,7 @@ static int fec_recv(struct eth_device *dev) 
>uint16_t bd_status; 
>uint32_t addr, size, end; 
>int i; 
>-   uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN); 
>+   ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE); 
>
>/* 
> * Check if any critical events have happened 

I can confirm that this patch fixes the issue for me on the mx28 board. Before 
the patch transmitting a linux kernel archive failed many times. With the patch 
applied the file was transfered successfully with the first try.

Used gcc version:
gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08)

Regards
Oliver
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 12/28] sf: probe: Add support for SST_WP

2013-09-15 Thread Jagannadha Sutradharudu Teki
Most of the SST flashes needs to write up using SST_WP, AAI
Word Program, so added a flag param on spi_flash_params table.

SST flashes, which supports SST_WP need to use a WP write
sst_write_wp instead of common flash write.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_internal.h |   5 ++
 drivers/mtd/spi/spi_flash_ops.c  |  93 
 drivers/mtd/spi/spi_flash_probe.c| 160 ++-
 include/spi_flash.h  |   7 ++
 4 files changed, 188 insertions(+), 77 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index af1afa9..ce34ce0 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -75,6 +75,11 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 
*cmd, size_t cmd_len,
 int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset,
size_t len, const void *buf);
 
+#ifdef CONFIG_SPI_FLASH_SST
+int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
+   const void *buf);
+#endif
+
 /*
  * Enable writing on the SPI flash.
  */
diff --git a/drivers/mtd/spi/spi_flash_ops.c b/drivers/mtd/spi/spi_flash_ops.c
index 6133363..79381b1 100644
--- a/drivers/mtd/spi/spi_flash_ops.c
+++ b/drivers/mtd/spi/spi_flash_ops.c
@@ -312,3 +312,96 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 
offset,
 
return ret;
 }
+
+#ifdef CONFIG_SPI_FLASH_SST
+static int sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
+{
+   int ret;
+   u8 cmd[4] = {
+   CMD_SST_BP,
+   offset >> 16,
+   offset >> 8,
+   offset,
+   };
+
+   debug("BP[%02x]: 0x%p => cmd = { 0x%02x 0x%06x }\n",
+ spi_w8r8(flash->spi, CMD_READ_STATUS), buf, cmd[0], offset);
+
+   ret = spi_flash_cmd_write_enable(flash);
+   if (ret)
+   return ret;
+
+   ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd), buf, 1);
+   if (ret)
+   return ret;
+
+   return spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+}
+
+int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
+   const void *buf)
+{
+   size_t actual, cmd_len;
+   int ret;
+   u8 cmd[4];
+
+   ret = spi_claim_bus(flash->spi);
+   if (ret) {
+   debug("SF: Unable to claim SPI bus\n");
+   return ret;
+   }
+
+   /* If the data is not word aligned, write out leading single byte */
+   actual = offset % 2;
+   if (actual) {
+   ret = sst_byte_write(flash, offset, buf);
+   if (ret)
+   goto done;
+   }
+   offset += actual;
+
+   ret = spi_flash_cmd_write_enable(flash);
+   if (ret)
+   goto done;
+
+   cmd_len = 4;
+   cmd[0] = CMD_SST_AAI_WP;
+   cmd[1] = offset >> 16;
+   cmd[2] = offset >> 8;
+   cmd[3] = offset;
+
+   for (; actual < len - 1; actual += 2) {
+   debug("WP[%02x]: 0x%p => cmd = { 0x%02x 0x%06x }\n",
+ spi_w8r8(flash->spi, CMD_READ_STATUS), buf + actual,
+ cmd[0], offset);
+
+   ret = spi_flash_cmd_write(flash->spi, cmd, cmd_len,
+   buf + actual, 2);
+   if (ret) {
+   debug("SF: sst word program failed\n");
+   break;
+   }
+
+   ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+   if (ret)
+   break;
+
+   cmd_len = 1;
+   offset += 2;
+   }
+
+   if (!ret)
+   ret = spi_flash_cmd_write_disable(flash);
+
+   /* If there is a single trailing byte, write it out */
+   if (!ret && actual != len)
+   ret = sst_byte_write(flash, offset, buf + actual);
+
+ done:
+   debug("SF: sst: program %s %zu bytes @ 0x%zx\n",
+ ret ? "failure" : "success", len, offset - actual);
+
+   spi_release_bus(flash->spi);
+   return ret;
+}
+#endif
diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index d43caff..f97097a 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -26,6 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * @ext_jedec: Device ext_jedec ID
  * @sector_size:   Sector size of this device
  * @nr_sectors:No.of sectors on this device
+ * @flags: Importent param, for flash specific behaviour
  */
 struct spi_flash_params {
const char *name;
@@ -33,101 +34,102 @@ struct spi_flash_params {
u16 ext_jedec;
u32 sector_size;
u32 nr_sectors;
+   u16 flags;
 };
 
 static const struct spi_flash_params spi_flash_params_table[] = {
 #ifdef CONFIG_SPI

[U-Boot] [PATCH v3 00/28] sf: Add common probe support

2013-09-15 Thread Jagannadha Sutradharudu Teki
Hi All,

This is a v3 series for "sf: Add common probe support"

I am u-boot/spi custodian, I removed all flash drivers files(except ramtron, 
handled in a separate driver) and implemented a common probe support.

Tested SST, STMICR, SPANSION, WINBOND from my side, REQUEST FOR ALL SPI CODE
FLASH_UESRS/CONTRIBUTORS/REST_USER, PLEASE TEST THESE CHANGES W.R.T YOUR HW IF 
POSSIBLE.

Please use the below branch for testing:
http://git.denx.de/?p=u-boot/u-boot-spi.git;a=shortlog;h=refs/heads/master-test-new
$ git clone git://git.denx.de/u-boot-spi.git
$ cd u-boot-spi
$ git checkout -b master-test-new origin/master-test-new

Please let me know for any issues/concerns/questions.

--
Thanks,
Jagan.

Jagannadha Sutradharudu Teki (28):
  sf: Divide spi_flash into multiple parts
  sf: probe: Add new spi_flash_probe support
  sf: probe: Add support for M25P* flash parts
  sf: probe: Add support for EN25Q* flash parts
  sf: probe: Add support for GD25* flash parts
  sf: probe: Add support for MX25L* flash parts
  sf: probe: Add support for W25* flash parts
  sf: probe: Add support for S25FL* flash parts
  sf: probe: Add support for SST25* flash parts
  sf: probe: Add support for AT45DB* flash parts
  sf: probe: Give proper spacing on flash table params
  sf: probe: Add support for SST_WP
  sf: probe: Add support to clear flash BP# bits
  sf: probe: Add support for erase sector selection flag
  sf: probe: Add support for flag status polling
  sf: probe: Move BAR config to spi_flash_validate_ids
  sf: Add proper comment style on spi_flash structure
  sf: ramtron: Add support for separate flash driver
  sf: Remove unneeded flash drivers files
  sf: probe: Add support for EN25Q64
  sf: probe: Add support for S25FL256S_256K
  sf: probe: Add support for S25FL512S_256K
  sf: probe: Use print_size arg as page_size
  sf: probe: Print erase_size while printing flash details
  sf: probe: Simply the BAR configuration logic
  sf: ops: Add static qualifier to spi_flash_cmd_bankaddr_write
  sf: probe: Add support for MX25L25635F
  sf: probe: Add support for MX25L51235F

 drivers/mtd/spi/.nfs02e4f8b67c0e | Bin 0 -> 16384 bytes
 drivers/mtd/spi/Makefile |  13 +-
 drivers/mtd/spi/atmel.c  | 544 -
 drivers/mtd/spi/eon.c|  60 ---
 drivers/mtd/spi/gigadevice.c |  65 ---
 drivers/mtd/spi/macronix.c   |  98 -
 drivers/mtd/spi/ramtron.c| 123 +-
 drivers/mtd/spi/spansion.c   | 141 ---
 drivers/mtd/spi/spi_flash.c  | 571 +--
 drivers/mtd/spi/spi_flash_internal.h |  29 +-
 drivers/mtd/spi/spi_flash_ops.c  | 403 +++
 drivers/mtd/spi/spi_flash_probe.c| 357 +
 drivers/mtd/spi/sst.c| 238 ---
 drivers/mtd/spi/stmicro.c| 202 --
 drivers/mtd/spi/winbond.c| 141 ---
 include/configs/top9000.h|   1 -
 include/spi_flash.h  |  76 ++--
 17 files changed, 947 insertions(+), 2115 deletions(-)
 create mode 100644 drivers/mtd/spi/.nfs02e4f8b67c0e
 delete mode 100644 drivers/mtd/spi/atmel.c
 delete mode 100644 drivers/mtd/spi/eon.c
 delete mode 100644 drivers/mtd/spi/gigadevice.c
 delete mode 100644 drivers/mtd/spi/macronix.c
 delete mode 100644 drivers/mtd/spi/spansion.c
 create mode 100644 drivers/mtd/spi/spi_flash_ops.c
 create mode 100644 drivers/mtd/spi/spi_flash_probe.c
 delete mode 100644 drivers/mtd/spi/sst.c
 delete mode 100644 drivers/mtd/spi/stmicro.c
 delete mode 100644 drivers/mtd/spi/winbond.c

-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 03/28] sf: probe: Add support for M25P* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added M25P* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 620e41b..08a3ab2 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -37,6 +37,14 @@ struct spi_flash_params {
 
 static const struct spi_flash_params spi_flash_params_table[] = {
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
+   {"M25P10",  0x202011, 0x0, 32 * 1024,  4},
+   {"M25P20",  0x202012, 0x0, 64 * 1024,  4},
+   {"M25P40",  0x202013, 0x0, 64 * 1024,  8},
+   {"M25P80",  0x202014, 0x0, 64 * 1024, 16},
+   {"M25P16",  0x202015, 0x0, 64 * 1024, 32},
+   {"M25P32",  0x202016, 0x0, 64 * 1024, 64},
+   {"M25P64",  0x202017, 0x0, 64 * 1024,128},
+   {"M25P128", 0x202018, 0x0,256 * 1024, 64},
{"N25Q32",  0x20ba16, 0x0, 64 * 1024, 64},
{"N25Q32A", 0x20bb16, 0x0, 64 * 1024, 64},
{"N25Q64",  0x20ba17, 0x0, 64 * 1024,128},
@@ -59,7 +67,6 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
 * RAMTRON
 * SPANSION
 * SST
-* STMICRO (M25*)
 * WINBOND
 */
 };
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 25/28] sf: probe: Simply the BAR configuration logic

2013-09-15 Thread Jagannadha Sutradharudu Teki
Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_internal.h |  3 --
 drivers/mtd/spi/spi_flash_probe.c| 56 +++-
 include/spi_flash.h  |  3 --
 3 files changed, 16 insertions(+), 46 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 286082a..86966f6 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -97,9 +97,6 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 
sr);
 #ifdef CONFIG_SPI_FLASH_BAR
 /* Program the bank address register */
 int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel);
-
-/* Configure the BAR - discover the bank cmds */
-int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0);
 #endif
 
 /*
diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 3bf336d..b6b4cb2 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -220,56 +220,32 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
 
 #ifdef CONFIG_SPI_FLASH_BAR
/* Configure the BAR - discover bank cmds and read current bank  */
-   if (spi_flash_bank_config(flash, idcode[0]) < 0)
-   return NULL;
-#endif
-
-   /* Flash powers up read-only, so clear BP# bits */
-   if (((params->jedec >> 16) == SPI_FLASH_CFI_MFR_ATMEL) ||
-   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_MACRONIX) ||
-   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_SST))
-   spi_flash_cmd_write_status(flash, 0);
-
-   return flash;
-}
-
-#ifdef CONFIG_SPI_FLASH_BAR
-int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0)
-{
-   u8 cmd;
u8 curr_bank = 0;
-
-   /* discover bank cmds */
-   switch (idcode0) {
-   case SPI_FLASH_CFI_MFR_SPANSION:
-   flash->bank_read_cmd = CMD_BANKADDR_BRRD;
-   flash->bank_write_cmd = CMD_BANKADDR_BRWR;
-   break;
-   case SPI_FLASH_CFI_MFR_STMICRO:
-   case SPI_FLASH_CFI_MFR_WINBOND:
-   flash->bank_read_cmd = CMD_EXTNADDR_RDEAR;
-   flash->bank_write_cmd = CMD_EXTNADDR_WREAR;
-   break;
-   default:
-   printf("SF: Unsupported bank commands %02x\n", idcode0);
-   return -1;
-   }
-
-   /* read the bank reg - on which bank the flash is in currently */
-   cmd = flash->bank_read_cmd;
if (flash->size > SPI_FLASH_16MB_BOUN) {
-   if (spi_flash_read_common(flash, &cmd, 1, &curr_bank, 1)) {
+   flash->bank_read_cmd = (idcode[0] == 0x01) ?
+   CMD_BANKADDR_BRRD : CMD_EXTNADDR_RDEAR;
+   flash->bank_write_cmd = (idcode[0] == 0x01) ?
+   CMD_BANKADDR_BRWR : CMD_EXTNADDR_WREAR;
+
+   if (spi_flash_read_common(flash, &flash->bank_read_cmd, 1,
+ &curr_bank, 1)) {
debug("SF: fail to read bank addr register\n");
-   return -1;
+   return NULL;
}
flash->bank_curr = curr_bank;
} else {
flash->bank_curr = curr_bank;
}
+#endif
 
-   return 0;
+   /* Flash powers up read-only, so clear BP# bits */
+   if (((params->jedec >> 16) == SPI_FLASH_CFI_MFR_ATMEL) ||
+   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_MACRONIX) ||
+   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_SST))
+   spi_flash_cmd_write_status(flash, 0);
+
+   return flash;
 }
-#endif
 
 #ifdef CONFIG_OF_CONTROL
 int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 34a167b..939da05 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -20,10 +20,7 @@
 /* SPI flash CFI Manufacture ID's */
 #define SPI_FLASH_CFI_MFR_ATMEL0x1f
 #define SPI_FLASH_CFI_MFR_MACRONIX 0xc2
-#define SPI_FLASH_CFI_MFR_SPANSION 0x01
 #define SPI_FLASH_CFI_MFR_SST  0xbf
-#define SPI_FLASH_CFI_MFR_STMICRO  0x20
-#define SPI_FLASH_CFI_MFR_WINBOND  0xef
 
 /* SECT flags */
 #define SECT_4K(1 << 0)
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 20/28] sf: probe: Add support for EN25Q64

2013-09-15 Thread Jagannadha Sutradharudu Teki
Add support for EON EN25Q64 SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index cc6d7ac..f49fc12 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -49,6 +49,7 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
 #endif
 #ifdef CONFIG_SPI_FLASH_EON/* EON */
{"EN25Q32B",   0x1c3016, 0x0,   64 * 1024,64,   
 0},
+   {"EN25Q64",0x1c3017, 0x0,   64 * 1024,   128,  
SECT_4K},
{"EN25Q128B",  0x1c3018, 0x0,   64 * 1024,   256,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 04/28] sf: probe: Add support for EN25Q* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added EN25Q* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_EON

 drivers/mtd/spi/spi_flash_probe.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 08a3ab2..12baf41 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -36,6 +36,10 @@ struct spi_flash_params {
 };
 
 static const struct spi_flash_params spi_flash_params_table[] = {
+#ifdef CONFIG_SPI_FLASH_EON/* EON */
+   {"EN25Q32B",0x1c3016, 0x0, 64 * 1024, 64},
+   {"EN25Q128B",   0x1c3018, 0x0, 64 * 1024,256},
+#endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
{"M25P10",  0x202011, 0x0, 32 * 1024,  4},
{"M25P20",  0x202012, 0x0, 64 * 1024,  4},
@@ -61,7 +65,6 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
/*
 * TODO:
 * ATMEL
-* EON
 * GIGADEVICE
 * MACRONIX
 * RAMTRON
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 22/28] sf: probe: Add support for S25FL512S_256K

2013-09-15 Thread Jagannadha Sutradharudu Teki
Add support for Spansion S25FL512S_256K SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 45ca4c0..61ffe50 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -77,6 +77,7 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
{"S25FL128S_64K",  0x012018, 0x4d01,64 * 1024,   256,   
 0},
{"S25FL256S_256K", 0x010219, 0x4d00,64 * 1024,   512,   
 0},
{"S25FL256S_64K",  0x010219, 0x4d01,64 * 1024,   512,   
 0},
+   {"S25FL512S_256K", 0x010220, 0x4d00,64 * 1024,  1024,   
 0},
{"S25FL512S_64K",  0x010220, 0x4d01,64 * 1024,  1024,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 14/28] sf: probe: Add support for erase sector selection flag

2013-09-15 Thread Jagannadha Sutradharudu Teki
SECT_4K, SECT_32K and SECT_64K opeartions are performed to
to specific flash by adding a SECT* flag on respective
spi_flash_params.flag param.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_ops.c   |   8 +-
 drivers/mtd/spi/spi_flash_probe.c | 166 --
 include/spi_flash.h   |  10 ++-
 3 files changed, 100 insertions(+), 84 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_ops.c b/drivers/mtd/spi/spi_flash_ops.c
index 79381b1..c408e27 100644
--- a/drivers/mtd/spi/spi_flash_ops.c
+++ b/drivers/mtd/spi/spi_flash_ops.c
@@ -153,17 +153,13 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
u8 cmd[4];
int ret = -1;
 
-   erase_size = flash->sector_size;
+   erase_size = flash->erase_size;
if (offset % erase_size || len % erase_size) {
debug("SF: Erase offset/length not multiple of erase size\n");
return -1;
}
 
-   if (erase_size == 4096)
-   cmd[0] = CMD_ERASE_4K;
-   else
-   cmd[0] = CMD_ERASE_64K;
-
+   cmd[0] = flash->erase_cmd;
while (len) {
 #ifdef CONFIG_SPI_FLASH_BAR
u8 bank_sel;
diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 839ece5..9d29a59 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -39,97 +39,97 @@ struct spi_flash_params {
 
 static const struct spi_flash_params spi_flash_params_table[] = {
 #ifdef CONFIG_SPI_FLASH_ATMEL  /* ATMEL */
-   {"AT45DB011D", 0x1f2200, 0x0,   64 * 1024, 4,0},
-   {"AT45DB021D", 0x1f2300, 0x0,   64 * 1024, 8,0},
-   {"AT45DB041D", 0x1f2400, 0x0,   64 * 1024, 8,0},
-   {"AT45DB081D", 0x1f2500, 0x0,   64 * 1024,16,0},
-   {"AT45DB161D", 0x1f2600, 0x0,   64 * 1024,32,0},
-   {"AT45DB321D", 0x1f2700, 0x0,   64 * 1024,64,0},
-   {"AT45DB641D", 0x1f2800, 0x0,   64 * 1024,   128,0},
+   {"AT45DB011D", 0x1f2200, 0x0,   64 * 1024, 4,  
SECT_4K},
+   {"AT45DB021D", 0x1f2300, 0x0,   64 * 1024, 8,  
SECT_4K},
+   {"AT45DB041D", 0x1f2400, 0x0,   64 * 1024, 8,  
SECT_4K},
+   {"AT45DB081D", 0x1f2500, 0x0,   64 * 1024,16,  
SECT_4K},
+   {"AT45DB161D", 0x1f2600, 0x0,   64 * 1024,32,  
SECT_4K},
+   {"AT45DB321D", 0x1f2700, 0x0,   64 * 1024,64,  
SECT_4K},
+   {"AT45DB641D", 0x1f2800, 0x0,   64 * 1024,   128,  
SECT_4K},
 #endif
 #ifdef CONFIG_SPI_FLASH_EON/* EON */
-   {"EN25Q32B",   0x1c3016, 0x0,   64 * 1024,64,0},
-   {"EN25Q128B",  0x1c3018, 0x0,   64 * 1024,   256,0},
+   {"EN25Q32B",   0x1c3016, 0x0,   64 * 1024,64,   
 0},
+   {"EN25Q128B",  0x1c3018, 0x0,   64 * 1024,   256,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */
-   {"GD25Q64B",   0xc84017, 0x0,   64 * 1024,   128,0},
-   {"GD25LQ32",   0xc86016, 0x0,   64 * 1024,64,0},
+   {"GD25Q64B",   0xc84017, 0x0,   64 * 1024,   128,  
SECT_4K},
+   {"GD25LQ32",   0xc86016, 0x0,   64 * 1024,64,  
SECT_4K},
 #endif
 #ifdef CONFIG_SPI_FLASH_MACRONIX   /* MACRONIX */
-   {"MX25L4005",  0xc22013, 0x0,   64 * 1024, 8,0},
-   {"MX25L8005",  0xc22014, 0x0,   64 * 1024,16,0},
-   {"MX25L1605D", 0xc22015, 0x0,   64 * 1024,32,0},
-   {"MX25L3205D", 0xc22016, 0x0,   64 * 1024,64,0},
-   {"MX25L6405D", 0xc22017, 0x0,   64 * 1024,   128,0},
-   {"MX25L12805", 0xc22018, 0x0,   64 * 1024,   256,0},
-   {"MX25L12855E",0xc22618, 0x0,   64 * 1024,   256,0},
+   {"MX25L4005",  0xc22013, 0x0,   64 * 1024, 8,   
 0},
+   {"MX25L8005",  0xc22014, 0x0,   64 * 1024,16,   
 0},
+   {"MX25L1605D", 0xc22015, 0x0,   64 * 1024,32,   
 0},
+   {"MX25L3205D", 0xc22016, 0x0,   64 * 1024,64,   
 0},
+   {"MX25L6405D", 0xc22017, 0x0,   64 * 1024,   128,   
 0},
+   {"MX25L12805", 0xc22018, 0x0,   64 * 1024,   256,   
 0},
+   {"MX25L12855E",0xc22618, 0x0,   64 * 1024,   256,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_SPANSION   /* SPANSION */
-   {"S25

[U-Boot] [PATCH v3 06/28] sf: probe: Add support for MX25L* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added MX25L* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_MACRONIX

 drivers/mtd/spi/spi_flash_probe.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index dcb6929..af38da1 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -44,6 +44,15 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"GD25Q64B",0xc84017, 0x0, 64 * 1024,128},
{"GD25LQ32",0xc86016, 0x0, 64 * 1024, 64},
 #endif
+#ifdef CONFIG_SPI_FLASH_MACRONIX   /* MACRONIX */
+   {"MX25L4005",   0xc22013, 0x0, 64 * 1024,  8},
+   {"MX25L8005",   0xc22014, 0x0, 64 * 1024, 16},
+   {"MX25L1605D",  0xc22015, 0x0, 64 * 1024, 32},
+   {"MX25L3205D",  0xc22016, 0x0, 64 * 1024, 64},
+   {"MX25L6405D",  0xc22017, 0x0, 64 * 1024,128},
+   {"MX25L12805",  0xc22018, 0x0, 64 * 1024,256},
+   {"MX25L12855E", 0xc22618, 0x0, 64 * 1024,256},
+#endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
{"M25P10",  0x202011, 0x0, 32 * 1024,  4},
{"M25P20",  0x202012, 0x0, 64 * 1024,  4},
@@ -69,7 +78,6 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
/*
 * TODO:
 * ATMEL
-* MACRONIX
 * RAMTRON
 * SPANSION
 * SST
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 21/28] sf: probe: Add support for S25FL256S_256K

2013-09-15 Thread Jagannadha Sutradharudu Teki
Add support for Spansion S25FL256S_256K SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index f49fc12..45ca4c0 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -75,6 +75,7 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
{"S25FL032P",  0x010215, 0x4d00,64 * 1024,64,   
 0},
{"S25FL064P",  0x010216, 0x4d00,64 * 1024,   128,   
 0},
{"S25FL128S_64K",  0x012018, 0x4d01,64 * 1024,   256,   
 0},
+   {"S25FL256S_256K", 0x010219, 0x4d00,64 * 1024,   512,   
 0},
{"S25FL256S_64K",  0x010219, 0x4d01,64 * 1024,   512,   
 0},
{"S25FL512S_64K",  0x010220, 0x4d01,64 * 1024,  1024,   
 0},
 #endif
@@ -195,7 +196,7 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
flash->read = spi_flash_cmd_read_fast;
 
/* Compute the flash size */
-   flash->page_size = 256;
+   flash->page_size = (ext_jedec == 0x4d00) ? 512 : 256;
flash->sector_size = params->sector_size;
flash->size = flash->sector_size * params->nr_sectors;
 
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 15/28] sf: probe: Add support for flag status polling

2013-09-15 Thread Jagannadha Sutradharudu Teki
>From Micron, 512MB onwards, flash requires to poll flag status
instead of read status- hence added E_FSR flag on spectific
flash parts.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 14 +-
 include/spi_flash.h   |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 9d29a59..842b03a 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -94,10 +94,10 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"N25Q128A",   0x20bb18, 0x0,   64 * 1024,   256,  
SECT_4K},
{"N25Q256",0x20ba19, 0x0,   64 * 1024,   512,  
SECT_4K},
{"N25Q256A",   0x20bb19, 0x0,   64 * 1024,   512,  
SECT_4K},
-   {"N25Q512",0x20ba20, 0x0,   64 * 1024,  1024,  
SECT_4K},
-   {"N25Q512A",   0x20bb20, 0x0,   64 * 1024,  1024,  
SECT_4K},
-   {"N25Q1024",   0x20ba21, 0x0,   64 * 1024,  2048,  
SECT_4K},
-   {"N25Q1024A",  0x20bb21, 0x0,   64 * 1024,  2048,  
SECT_4K},
+   {"N25Q512",0x20ba20, 0x0,   64 * 1024,  1024,  E_FSR | 
SECT_4K},
+   {"N25Q512A",   0x20bb20, 0x0,   64 * 1024,  1024,  E_FSR | 
SECT_4K},
+   {"N25Q1024",   0x20ba21, 0x0,   64 * 1024,  2048,  E_FSR | 
SECT_4K},
+   {"N25Q1024A",  0x20bb21, 0x0,   64 * 1024,  2048,  E_FSR | 
SECT_4K},
 #endif
 #ifdef CONFIG_SPI_FLASH_SST/* SST */
{"SST25VF040B",0xbf258d, 0x0,   64 * 1024, 8, SECT_4K | 
SST_WP},
@@ -187,7 +187,6 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
 
flash->spi = spi;
flash->name = params->name;
-   flash->poll_cmd = CMD_READ_STATUS;
 
/* Assign spi_flash ops */
flash->write = spi_flash_cmd_write_multi;
@@ -215,6 +214,11 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
flash->erase_size = flash->sector_size;
}
 
+   /* Poll cmd seclection */
+   flash->poll_cmd = CMD_READ_STATUS;
+   if (params->flags & E_FSR)
+   flash->poll_cmd = CMD_FLAG_STATUS;
+
/* Flash powers up read-only, so clear BP# bits */
if (((params->jedec >> 16) == SPI_FLASH_CFI_MFR_ATMEL) ||
((params->jedec >> 16) == SPI_FLASH_CFI_MFR_MACRONIX) ||
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 387af86..3e60fdc 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -25,6 +25,7 @@
 /* SECT flags */
 #define SECT_4K(1 << 0)
 #define SECT_32K   (1 << 1)
+#define E_FSR  (1 << 2)
 
 /* SST specific macros */
 #ifdef CONFIG_SPI_FLASH_SST
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 16/28] sf: probe: Move BAR config to spi_flash_validate_ids

2013-09-15 Thread Jagannadha Sutradharudu Teki
Moved BAR config to spi_flash_validate_ids, so its
better to have all flash initalization at once.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_internal.h |  5 -
 drivers/mtd/spi/spi_flash_probe.c| 24 +++-
 include/spi_flash.h  |  3 +++
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index ce34ce0..6227d2e 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -31,11 +31,6 @@
 
 #define SPI_FLASH_16MB_BOUN0x100
 
-/* Manufacture ID's */
-#define SPI_FLASH_SPANSION_IDCODE0 0x01
-#define SPI_FLASH_STMICRO_IDCODE0  0x20
-#define SPI_FLASH_WINBOND_IDCODE0  0xef
-
 #ifdef CONFIG_SPI_FLASH_BAR
 /* Bank addr access commands */
 # define CMD_BANKADDR_BRWR 0x17
diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 842b03a..69b41a0 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -219,6 +219,12 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
if (params->flags & E_FSR)
flash->poll_cmd = CMD_FLAG_STATUS;
 
+#ifdef CONFIG_SPI_FLASH_BAR
+   /* Configure the BAR - discover bank cmds and read current bank  */
+   if (spi_flash_bank_config(flash, idcode[0]) < 0)
+   return NULL;
+#endif
+
/* Flash powers up read-only, so clear BP# bits */
if (((params->jedec >> 16) == SPI_FLASH_CFI_MFR_ATMEL) ||
((params->jedec >> 16) == SPI_FLASH_CFI_MFR_MACRONIX) ||
@@ -236,12 +242,12 @@ int spi_flash_bank_config(struct spi_flash *flash, u8 
idcode0)
 
/* discover bank cmds */
switch (idcode0) {
-   case SPI_FLASH_SPANSION_IDCODE0:
+   case SPI_FLASH_CFI_MFR_SPANSION:
flash->bank_read_cmd = CMD_BANKADDR_BRRD;
flash->bank_write_cmd = CMD_BANKADDR_BRWR;
break;
-   case SPI_FLASH_STMICRO_IDCODE0:
-   case SPI_FLASH_WINBOND_IDCODE0:
+   case SPI_FLASH_CFI_MFR_STMICRO:
+   case SPI_FLASH_CFI_MFR_WINBOND:
flash->bank_read_cmd = CMD_EXTNADDR_RDEAR;
flash->bank_write_cmd = CMD_EXTNADDR_WREAR;
break;
@@ -299,7 +305,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 {
struct spi_slave *spi;
struct spi_flash *flash = NULL;
-   u8 idcode[5], *idp;
+   u8 idcode[5];
int ret;
 
/* Setup spi_slave */
@@ -329,18 +335,10 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 #endif
 
/* Validate ID's from flash dev table */
-   idp = idcode;
-   flash = spi_flash_validate_ids(spi, idp);
+   flash = spi_flash_validate_ids(spi, idcode);
if (!flash)
goto err_read_id;
 
-#ifdef CONFIG_SPI_FLASH_BAR
-   /* Configure the BAR - discover bank cmds and read current bank  */
-   ret = spi_flash_bank_config(flash, *idp);
-   if (ret < 0)
-   goto err_read_id;
-#endif
-
 #ifdef CONFIG_OF_CONTROL
if (spi_flash_decode_fdt(gd->fdt_blob, flash)) {
debug("SF: FDT decode error\n");
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 3e60fdc..14e4ae2 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -20,7 +20,10 @@
 /* SPI flash CFI Manufacture ID's */
 #define SPI_FLASH_CFI_MFR_ATMEL0x1f
 #define SPI_FLASH_CFI_MFR_MACRONIX 0xc2
+#define SPI_FLASH_CFI_MFR_SPANSION 0x01
 #define SPI_FLASH_CFI_MFR_SST  0xbf
+#define SPI_FLASH_CFI_MFR_STMICRO  0x20
+#define SPI_FLASH_CFI_MFR_WINBOND  0xef
 
 /* SECT flags */
 #define SECT_4K(1 << 0)
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 08/28] sf: probe: Add support for S25FL* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added S25FL* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_SPANSION

 drivers/mtd/spi/spi_flash_probe.c | 29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 1ff3b60..6f0dd84 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -53,6 +53,19 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"MX25L12805",  0xc22018, 0x0, 64 * 1024,256},
{"MX25L12855E", 0xc22618, 0x0, 64 * 1024,256},
 #endif
+#ifdef CONFIG_SPI_FLASH_SPANSION   /* SPANSION */
+   {"S25FL008A",   0x010213, 0x0, 64 * 1024, 16},
+   {"S25FL016A",   0x010214, 0x0, 64 * 1024, 32},
+   {"S25FL032A",   0x010215, 0x0, 64 * 1024, 64},
+   {"S25FL064A",   0x010216, 0x0, 64 * 1024,128},
+   {"S25FL128P_256K",  0x012018, 0x0300, 256 * 1024, 64},
+   {"S25FL128P_64K",   0x012018, 0x0301,  64 * 1024,256},
+   {"S25FL032P",   0x010215, 0x4d00,  64 * 1024, 64},
+   {"S25FL064P",   0x010216, 0x4d00,  64 * 1024,128},
+   {"S25FL128S_64K",   0x012018, 0x4d01,  64 * 1024,256},
+   {"S25FL256S_64K",   0x010219, 0x4d01,  64 * 1024,512},
+   {"S25FL512S_64K",   0x010220, 0x4d01,  64 * 1024,   1024},
+#endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
{"M25P10",  0x202011, 0x0, 32 * 1024,  4},
{"M25P20",  0x202012, 0x0, 64 * 1024,  4},
@@ -98,6 +111,7 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
/*
 * Note:
 * Below paired flash devices has similar spi_flash_params params.
+* (S25FL129P_64K, S25FL128S_64K)
 * (W25Q80BL, W25Q80BV)
 * (W25Q16CL, W25Q16DV)
 * (W25Q32BV, W25Q32FV_SPI)
@@ -111,7 +125,6 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
 * TODO:
 * ATMEL
 * RAMTRON
-* SPANSION
 * SST
 */
 };
@@ -122,19 +135,25 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
struct spi_flash *flash;
int i;
u16 jedec = idcode[1] << 8 | idcode[2];
+   u16 ext_jedec = idcode[3] << 8 | idcode[4];
 
-   /* Get the flash id (jedec = manuf_id + dev_id) */
+   /* Get the flash id (jedec = manuf_id + dev_id, ext_jedec) */
for (i = 0; i < ARRAY_SIZE(spi_flash_params_table); i++) {
params = &spi_flash_params_table[i];
if ((params->jedec >> 16) == idcode[0]) {
-   if ((params->jedec & 0x) == jedec)
+   if ((params->jedec & 0x) == jedec) {
+   if ((params->ext_jedec != 0) &&
+   (params->ext_jedec == ext_jedec))
+   continue;
break;
+   }
}
}
 
if (i == ARRAY_SIZE(spi_flash_params_table)) {
-   printf("SF: Unsupported flash ID: manuf %02x, jedec %04x\n",
-  idcode[0], jedec);
+   printf("SF: Unsupported flash IDs: ");
+   printf("manuf %02x, jedec %04x, ext_jedec %04x\n",
+  idcode[0], jedec, ext_jedec);
return NULL;
}
 
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 23/28] sf: probe: Use print_size arg as page_size

2013-09-15 Thread Jagannadha Sutradharudu Teki
Use flash->page_size arg in print_size() instead of
flash->sector_size while printing detected flas part details.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 61ffe50..4cd9992 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -346,7 +346,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 #endif
 #ifndef CONFIG_SPL_BUILD
printf("SF: Detected %s with page size ", flash->name);
-   print_size(flash->sector_size, ", total ");
+   print_size(flash->page_size, ", total ");
print_size(flash->size, "");
if (flash->memory_map)
printf(", mapped at %p", flash->memory_map);
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 02/28] sf: probe: Add new spi_flash_probe support

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added new spi_flash_probe support, currently added N25Q*
flash part attributes support.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Defined CONFIG_SPI_FLASH_LEGACY for old probing style
which is available on spi_flash_probe_legacy.c, this will
removed soon once all flashes are supported in new spi_flash_probe.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- Fix warning issue.
Changes for v2:
- Removed CONFIG_SPI_FLASH_NEW, add CONFIG_SPI_FLASH_LEGACY
- Enable CONFIG_SPI_FLASH_STMICRO in spi_flash_params table
- Updated few structure members

 drivers/mtd/spi/Makefile |   1 +
 drivers/mtd/spi/spi_flash_probe.c| 229 -
 drivers/mtd/spi/spi_flash_probe_legacy.c | 276 +++
 3 files changed, 385 insertions(+), 121 deletions(-)
 create mode 100644 drivers/mtd/spi/spi_flash_probe_legacy.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 193cb5d..dde2691 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -14,6 +14,7 @@ COBJS-$(CONFIG_SPL_SPI_LOAD)  += spi_spl_load.o
 COBJS-$(CONFIG_SPL_SPI_BOOT)   += fsl_espi_spl.o
 endif
 
+COBJS-$(CONFIG_SPI_FLASH_LEGACY) += spi_flash_probe_legacy.o spi_flash_ops.o 
spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash_probe.o spi_flash_ops.o spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 32ec578..620e41b 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -18,6 +18,98 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * struct spi_flash_params - SPI/QSPI flash device params structure
+ *
+ * @name:  Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO])
+ * @jedec: Device jedec ID (0x[1byte_manuf_id][2byte_dev_id])
+ * @ext_jedec: Device ext_jedec ID
+ * @sector_size:   Sector size of this device
+ * @nr_sectors:No.of sectors on this device
+ */
+struct spi_flash_params {
+   const char *name;
+   u32 jedec;
+   u16 ext_jedec;
+   u32 sector_size;
+   u32 nr_sectors;
+};
+
+static const struct spi_flash_params spi_flash_params_table[] = {
+#ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
+   {"N25Q32",  0x20ba16, 0x0, 64 * 1024, 64},
+   {"N25Q32A", 0x20bb16, 0x0, 64 * 1024, 64},
+   {"N25Q64",  0x20ba17, 0x0, 64 * 1024,128},
+   {"N25Q64A", 0x20bb17, 0x0, 64 * 1024,128},
+   {"N25Q128", 0x20ba18, 0x0, 64 * 1024,256},
+   {"N25Q128A",0x20bb18, 0x0, 64 * 1024,256},
+   {"N25Q256", 0x20ba19, 0x0, 64 * 1024,512},
+   {"N25Q256A",0x20bb19, 0x0, 64 * 1024,512},
+   {"N25Q512", 0x20ba20, 0x0, 64 * 1024,   1024},
+   {"N25Q512A",0x20bb20, 0x0, 64 * 1024,   1024},
+   {"N25Q1024",0x20ba21, 0x0, 64 * 1024,   2048},
+   {"N25Q1024A",   0x20bb21, 0x0, 64 * 1024,   2048},
+#endif
+   /*
+* TODO:
+* ATMEL
+* EON
+* GIGADEVICE
+* MACRONIX
+* RAMTRON
+* SPANSION
+* SST
+* STMICRO (M25*)
+* WINBOND
+*/
+};
+
+struct spi_flash *spi_flash_validate_ids(struct spi_slave *spi, u8 *idcode)
+{
+   const struct spi_flash_params *params;
+   struct spi_flash *flash;
+   int i;
+   u16 jedec = idcode[1] << 8 | idcode[2];
+
+   /* Get the flash id (jedec = manuf_id + dev_id) */
+   for (i = 0; i < ARRAY_SIZE(spi_flash_params_table); i++) {
+   params = &spi_flash_params_table[i];
+   if ((params->jedec >> 16) == idcode[0]) {
+   if ((params->jedec & 0x) == jedec)
+   break;
+   }
+   }
+
+   if (i == ARRAY_SIZE(spi_flash_params_table)) {
+   printf("SF: Unsupported flash ID: manuf %02x, jedec %04x\n",
+  idcode[0], jedec);
+   return NULL;
+   }
+
+   flash = malloc(sizeof(*flash));
+   if (!flash) {
+   debug("SF: Failed to allocate spi_flash\n");
+   return NULL;
+   }
+   memset(flash, '\0', sizeof(*flash));
+
+   flash->spi = spi;
+   flash->name = params->name;
+   flash->poll_cmd = CMD_READ_STATUS;
+
+   /* Assign spi_flash ops */
+   flash->write = spi_flash_cmd_write_multi;
+   flash->erase = spi_flash_cmd_erase;
+   flash->read = spi_flash_cmd_read_fast;
+
+   /* Compute the flash size */
+   flash->page_size = 256;
+   flash->sector_size = params->sector_size;
+   flash->size = flash->

[U-Boot] [PATCH v3 01/28] sf: Divide spi_flash into multiple parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Divided the spi_flash framework into mutiple parts for
- spi_flash.c:
spi flash core file, interaction for spi/qspi driver to
spi_flash framework.
- spi_flash_ops.c
spi flash preffered operations, erase,write and read.
- spi_flash_probe.c
spi flash probing, easy to extend probing functionality.

This change will support to extend the functionality in a
proper manner.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/Makefile  |   2 +-
 drivers/mtd/spi/spi_flash.c   | 571 +-
 drivers/mtd/spi/spi_flash_ops.c   | 314 +
 drivers/mtd/spi/spi_flash_probe.c | 276 ++
 4 files changed, 596 insertions(+), 567 deletions(-)
 create mode 100644 drivers/mtd/spi/spi_flash_ops.c
 create mode 100644 drivers/mtd/spi/spi_flash_probe.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 191138a..193cb5d 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -14,7 +14,7 @@ COBJS-$(CONFIG_SPL_SPI_LOAD)  += spi_spl_load.o
 COBJS-$(CONFIG_SPL_SPI_BOOT)   += fsl_espi_spl.o
 endif
 
-COBJS-$(CONFIG_SPI_FLASH)  += spi_flash.o
+COBJS-$(CONFIG_SPI_FLASH)  += spi_flash_probe.o spi_flash_ops.o spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
 COBJS-$(CONFIG_SPI_FLASH_GIGADEVICE)   += gigadevice.o
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 5d5055f..ddbdda0 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -8,23 +8,7 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-
-#include "spi_flash_internal.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void spi_flash_addr(u32 addr, u8 *cmd)
-{
-   /* cmd[0] is actual command */
-   cmd[1] = addr >> 16;
-   cmd[2] = addr >> 8;
-   cmd[3] = addr >> 0;
-}
 
 static int spi_flash_read_write(struct spi_slave *spi,
const u8 *cmd, size_t cmd_len,
@@ -52,564 +36,19 @@ static int spi_flash_read_write(struct spi_slave *spi,
return ret;
 }
 
-int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len)
-{
-   return spi_flash_cmd_read(spi, &cmd, 1, response, len);
-}
-
 int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
size_t cmd_len, void *data, size_t data_len)
 {
return spi_flash_read_write(spi, cmd, cmd_len, NULL, data, data_len);
 }
 
-int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
-   const void *data, size_t data_len)
-{
-   return spi_flash_read_write(spi, cmd, cmd_len, data, NULL, data_len);
-}
-
-int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-   struct spi_slave *spi = flash->spi;
-   unsigned long timebase;
-   int ret;
-   u8 status;
-   u8 check_status = 0x0;
-   u8 poll_bit = STATUS_WIP;
-   u8 cmd = flash->poll_cmd;
-
-   if (cmd == CMD_FLAG_STATUS) {
-   poll_bit = STATUS_PEC;
-   check_status = poll_bit;
-   }
-
-   ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
-   if (ret) {
-   debug("SF: fail to read %s status register\n",
- cmd == CMD_READ_STATUS ? "read" : "flag");
-   return ret;
-   }
-
-   timebase = get_timer(0);
-   do {
-   WATCHDOG_RESET();
-
-   ret = spi_xfer(spi, 8, NULL, &status, 0);
-   if (ret)
-   return -1;
-
-   if ((status & poll_bit) == check_status)
-   break;
-
-   } while (get_timer(timebase) < timeout);
-
-   spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
-
-   if ((status & poll_bit) == check_status)
-   return 0;
-
-   /* Timed out */
-   debug("SF: time out!\n");
-   return -1;
-}
-
-int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd,
-   size_t cmd_len, const void *buf, size_t buf_len)
-{
-   struct spi_slave *spi = flash->spi;
-   unsigned long timeout = SPI_FLASH_PROG_TIMEOUT;
-   int ret;
-
-   if (buf == NULL)
-   timeout = SPI_FLASH_PAGE_ERASE_TIMEOUT;
-
-   ret = spi_claim_bus(flash->spi);
-   if (ret) {
-   debug("SF: unable to claim SPI bus\n");
-   return ret;
-   }
-
-   ret = spi_flash_cmd_write_enable(flash);
-   if (ret < 0) {
-   debug("SF: enabling write failed\n");
-   return ret;
-   }
-
-   ret = spi_flash_cmd_write(spi, cmd, cmd_len, buf, buf_len);
-   if (ret < 0) {
-   debug("SF: write cmd failed\n");
-   return ret;
-   }
-
-   ret = spi_flash_cmd_wait_ready(flash, timeout);
-   if (ret < 0) {
-   debug("SF: write %s timed out\n",
- ti

[U-Boot] [PATCH v3 27/28] sf: probe: Add support for MX25L25635F

2013-09-15 Thread Jagannadha Sutradharudu Teki
Add support for Macronix MX25L25635F SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index b6b4cb2..afe8068 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -63,6 +63,7 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
{"MX25L3205D", 0xc22016, 0x0,   64 * 1024,64,   
 0},
{"MX25L6405D", 0xc22017, 0x0,   64 * 1024,   128,   
 0},
{"MX25L12805", 0xc22018, 0x0,   64 * 1024,   256,   
 0},
+   {"MX25L25635F",0xc22019, 0x0,   64 * 1024,   512,   
 0},
{"MX25L12855E",0xc22618, 0x0,   64 * 1024,   256,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_SPANSION   /* SPANSION */
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 19/28] sf: Remove unneeded flash drivers files

2013-09-15 Thread Jagannadha Sutradharudu Teki
Now the common probing is handled in spi_flash_probe.c
hence removed the unneeded flash drivers.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/Makefile |   8 -
 drivers/mtd/spi/atmel.c  | 544 ---
 drivers/mtd/spi/eon.c|  60 
 drivers/mtd/spi/gigadevice.c |  65 -
 drivers/mtd/spi/macronix.c   |  98 ---
 drivers/mtd/spi/spansion.c   | 141 -
 drivers/mtd/spi/spi_flash_internal.h |  11 -
 drivers/mtd/spi/sst.c| 238 ---
 drivers/mtd/spi/stmicro.c| 202 -
 drivers/mtd/spi/winbond.c| 141 -
 10 files changed, 1508 deletions(-)
 delete mode 100644 drivers/mtd/spi/atmel.c
 delete mode 100644 drivers/mtd/spi/eon.c
 delete mode 100644 drivers/mtd/spi/gigadevice.c
 delete mode 100644 drivers/mtd/spi/macronix.c
 delete mode 100644 drivers/mtd/spi/spansion.c
 delete mode 100644 drivers/mtd/spi/sst.c
 delete mode 100644 drivers/mtd/spi/stmicro.c
 delete mode 100644 drivers/mtd/spi/winbond.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 2605e57..5678134 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -18,14 +18,6 @@ ifdef CONFIG_CMD_SF
 COBJS-y+= spi_flash.o
 endif
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash_probe.o spi_flash_ops.o
-COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
-COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
-COBJS-$(CONFIG_SPI_FLASH_GIGADEVICE)   += gigadevice.o
-COBJS-$(CONFIG_SPI_FLASH_MACRONIX) += macronix.o
-COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
-COBJS-$(CONFIG_SPI_FLASH_SST)  += sst.o
-COBJS-$(CONFIG_SPI_FLASH_STMICRO)  += stmicro.o
-COBJS-$(CONFIG_SPI_FLASH_WINBOND)  += winbond.o
 COBJS-$(CONFIG_SPI_FRAM_RAMTRON)   += ramtron.o
 COBJS-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
 
diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
deleted file mode 100644
index f34df43..000
--- a/drivers/mtd/spi/atmel.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Atmel SPI DataFlash support
- *
- * Copyright (C) 2008 Atmel Corporation
- * Licensed under the GPL-2 or later.
- */
-
-#include 
-#include 
-#include 
-
-#include "spi_flash_internal.h"
-
-/* AT45-specific commands */
-#define CMD_AT45_READ_STATUS   0xd7
-#define CMD_AT45_ERASE_PAGE0x81
-#define CMD_AT45_LOAD_PROG_BUF10x82
-#define CMD_AT45_LOAD_BUF1 0x84
-#define CMD_AT45_LOAD_PROG_BUF20x85
-#define CMD_AT45_LOAD_BUF2 0x87
-#define CMD_AT45_PROG_BUF1 0x88
-#define CMD_AT45_PROG_BUF2 0x89
-
-/* AT45 status register bits */
-#define AT45_STATUS_P2_PAGE_SIZE   (1 << 0)
-#define AT45_STATUS_READY  (1 << 7)
-
-/* DataFlash family IDs, as obtained from the second idcode byte */
-#define DF_FAMILY_AT26F0
-#define DF_FAMILY_AT45 1
-#define DF_FAMILY_AT26DF   2   /* AT25DF and AT26DF */
-
-struct atmel_spi_flash_params {
-   u8  idcode1;
-   /* Log2 of page size in power-of-two mode */
-   u8  l2_page_size;
-   u8  pages_per_block;
-   u8  blocks_per_sector;
-   u8  nr_sectors;
-   const char  *name;
-};
-
-/* spi_flash needs to be first so upper layers can free() it */
-struct atmel_spi_flash {
-   struct spi_flash flash;
-   const struct atmel_spi_flash_params *params;
-};
-
-static inline struct atmel_spi_flash *
-to_atmel_spi_flash(struct spi_flash *flash)
-{
-   return container_of(flash, struct atmel_spi_flash, flash);
-}
-
-static const struct atmel_spi_flash_params atmel_spi_flash_table[] = {
-   {
-   .idcode1= 0x22,
-   .l2_page_size   = 8,
-   .pages_per_block= 8,
-   .blocks_per_sector  = 16,
-   .nr_sectors = 4,
-   .name   = "AT45DB011D",
-   },
-   {
-   .idcode1= 0x23,
-   .l2_page_size   = 8,
-   .pages_per_block= 8,
-   .blocks_per_sector  = 16,
-   .nr_sectors = 8,
-   .name   = "AT45DB021D",
-   },
-   {
-   .idcode1= 0x24,
-   .l2_page_size   = 8,
-   .pages_per_block= 8,
-   .blocks_per_sector  = 32,
-   .nr_sectors = 8,
-   .name   = "AT45DB041D",
-   },
-   {
-   .idcode1= 0x25,
-   .l2_page_size   = 8,
-   .pages_per_block= 8,
-   .blocks_per_sector  = 32,
-   .nr_sectors = 16,

[U-Boot] [PATCH v3 28/28] sf: probe: Add support for MX25L51235F

2013-09-15 Thread Jagannadha Sutradharudu Teki
Add support for Macronix MX25L51235F SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index afe8068..ed2890b 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -64,6 +64,7 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
{"MX25L6405D", 0xc22017, 0x0,   64 * 1024,   128,   
 0},
{"MX25L12805", 0xc22018, 0x0,   64 * 1024,   256,   
 0},
{"MX25L25635F",0xc22019, 0x0,   64 * 1024,   512,   
 0},
+   {"MX25L51235F",0xc2201A, 0x0,   64 * 1024,  1024,   
 0},
{"MX25L12855E",0xc22618, 0x0,   64 * 1024,   256,   
 0},
 #endif
 #ifdef CONFIG_SPI_FLASH_SPANSION   /* SPANSION */
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 26/28] sf: ops: Add static qualifier to spi_flash_cmd_bankaddr_write

2013-09-15 Thread Jagannadha Sutradharudu Teki
Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_internal.h | 5 -
 drivers/mtd/spi/spi_flash_ops.c  | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 86966f6..1f9f170 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -94,11 +94,6 @@ static inline int spi_flash_cmd_write_disable(struct 
spi_flash *flash)
 /* Program the status register. */
 int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr);
 
-#ifdef CONFIG_SPI_FLASH_BAR
-/* Program the bank address register */
-int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel);
-#endif
-
 /*
  * Same as spi_flash_cmd_read() except it also claims/releases the SPI
  * bus. Used as common part of the ->read() operation.
diff --git a/drivers/mtd/spi/spi_flash_ops.c b/drivers/mtd/spi/spi_flash_ops.c
index c408e27..b4e1c40 100644
--- a/drivers/mtd/spi/spi_flash_ops.c
+++ b/drivers/mtd/spi/spi_flash_ops.c
@@ -39,7 +39,7 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr)
 }
 
 #ifdef CONFIG_SPI_FLASH_BAR
-int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel)
+static int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel)
 {
u8 cmd;
int ret;
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-09-15 Thread Fabio Estevam
Hi Oliver,

On Sun, Sep 15, 2013 at 3:12 PM, Oliver Metz  wrote:

> I can confirm that this patch fixes the issue for me on the mx28 board. 
> Before the patch transmitting a linux kernel archive failed many times. With 
> the patch applied the file was transfered successfully with the first try.
>
> Used gcc version:
> gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08)

Thanks for testing.

Will submit it as a patch and will add your Tested-by tag.

Thanks,

Fabio Estevam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 11/28] sf: probe: Give proper spacing on flash table params

2013-09-15 Thread Jagannadha Sutradharudu Teki
Given proper spacing between flash table params.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 154 +++---
 1 file changed, 77 insertions(+), 77 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 9f8b829..d43caff 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -37,97 +37,97 @@ struct spi_flash_params {
 
 static const struct spi_flash_params spi_flash_params_table[] = {
 #ifdef CONFIG_SPI_FLASH_ATMEL  /* ATMEL */
-   {"AT45DB011D",  0x1f2200, 0x0, 64 * 1024,  4},
-   {"AT45DB021D",  0x1f2300, 0x0, 64 * 1024,  8},
-   {"AT45DB041D",  0x1f2400, 0x0, 64 * 1024,  8},
-   {"AT45DB081D",  0x1f2500, 0x0, 64 * 1024, 16},
-   {"AT45DB161D",  0x1f2600, 0x0, 64 * 1024, 32},
-   {"AT45DB321D",  0x1f2700, 0x0, 64 * 1024, 64},
-   {"AT45DB641D",  0x1f2800, 0x0, 64 * 1024,128},
+   {"AT45DB011D", 0x1f2200, 0x0,   64 * 1024, 4},
+   {"AT45DB021D", 0x1f2300, 0x0,   64 * 1024, 8},
+   {"AT45DB041D", 0x1f2400, 0x0,   64 * 1024, 8},
+   {"AT45DB081D", 0x1f2500, 0x0,   64 * 1024,16},
+   {"AT45DB161D", 0x1f2600, 0x0,   64 * 1024,32},
+   {"AT45DB321D", 0x1f2700, 0x0,   64 * 1024,64},
+   {"AT45DB641D", 0x1f2800, 0x0,   64 * 1024,   128},
 #endif
 #ifdef CONFIG_SPI_FLASH_EON/* EON */
-   {"EN25Q32B",0x1c3016, 0x0, 64 * 1024, 64},
-   {"EN25Q128B",   0x1c3018, 0x0, 64 * 1024,256},
+   {"EN25Q32B",   0x1c3016, 0x0,   64 * 1024,64},
+   {"EN25Q128B",  0x1c3018, 0x0,   64 * 1024,   256},
 #endif
 #ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */
-   {"GD25Q64B",0xc84017, 0x0, 64 * 1024,128},
-   {"GD25LQ32",0xc86016, 0x0, 64 * 1024, 64},
+   {"GD25Q64B",   0xc84017, 0x0,   64 * 1024,   128},
+   {"GD25LQ32",   0xc86016, 0x0,   64 * 1024,64},
 #endif
 #ifdef CONFIG_SPI_FLASH_MACRONIX   /* MACRONIX */
-   {"MX25L4005",   0xc22013, 0x0, 64 * 1024,  8},
-   {"MX25L8005",   0xc22014, 0x0, 64 * 1024, 16},
-   {"MX25L1605D",  0xc22015, 0x0, 64 * 1024, 32},
-   {"MX25L3205D",  0xc22016, 0x0, 64 * 1024, 64},
-   {"MX25L6405D",  0xc22017, 0x0, 64 * 1024,128},
-   {"MX25L12805",  0xc22018, 0x0, 64 * 1024,256},
-   {"MX25L12855E", 0xc22618, 0x0, 64 * 1024,256},
+   {"MX25L4005",  0xc22013, 0x0,   64 * 1024, 8},
+   {"MX25L8005",  0xc22014, 0x0,   64 * 1024,16},
+   {"MX25L1605D", 0xc22015, 0x0,   64 * 1024,32},
+   {"MX25L3205D", 0xc22016, 0x0,   64 * 1024,64},
+   {"MX25L6405D", 0xc22017, 0x0,   64 * 1024,   128},
+   {"MX25L12805", 0xc22018, 0x0,   64 * 1024,   256},
+   {"MX25L12855E",0xc22618, 0x0,   64 * 1024,   256},
 #endif
 #ifdef CONFIG_SPI_FLASH_SPANSION   /* SPANSION */
-   {"S25FL008A",   0x010213, 0x0, 64 * 1024, 16},
-   {"S25FL016A",   0x010214, 0x0, 64 * 1024, 32},
-   {"S25FL032A",   0x010215, 0x0, 64 * 1024, 64},
-   {"S25FL064A",   0x010216, 0x0, 64 * 1024,128},
-   {"S25FL128P_256K",  0x012018, 0x0300, 256 * 1024, 64},
-   {"S25FL128P_64K",   0x012018, 0x0301,  64 * 1024,256},
-   {"S25FL032P",   0x010215, 0x4d00,  64 * 1024, 64},
-   {"S25FL064P",   0x010216, 0x4d00,  64 * 1024,128},
-   {"S25FL128S_64K",   0x012018, 0x4d01,  64 * 1024,256},
-   {"S25FL256S_64K",   0x010219, 0x4d01,  64 * 1024,512},
-   {"S25FL512S_64K",   0x010220, 0x4d01,  64 * 1024,   1024},
+   {"S25FL008A",  0x010213, 0x0,   64 * 1024,16},
+   {"S25FL016A",  0x010214, 0x0,   64 * 1024,32},
+   {"S25FL032A",  0x010215, 0x0,   64 * 1024,64},
+   {"S25FL064A",  0x010216, 0x0,   64 * 1024,   128},
+   {"S25FL128P_256K", 0x012018, 0x0300,   256 * 1024,64},
+   {"S25FL128P_64K",  0x012018, 0x0301,64 * 1024,   256},
+   {"S25FL032P",  0x010215, 0x4d00,64 * 1024,64},
+   {"S25FL064P",  0x010216, 0x4d00,64 * 1024,   128},
+   {"S25FL128S_64K",  0x012018, 0x4d01,64 * 1024,   256},
+   {"S25FL256S_64K",  0x010219, 0x4d01,64 * 1024,   512},
+   {"S25FL512S_64K",  0x010220, 0x4d01,64 * 1024,  1024},
 #endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
-   {"M25P10", 

[U-Boot] [PATCH v3 24/28] sf: probe: Print erase_size while printing flash details

2013-09-15 Thread Jagannadha Sutradharudu Teki
Included erase_size while printing probed flash details.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 4cd9992..3bf336d 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -346,7 +346,8 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 #endif
 #ifndef CONFIG_SPL_BUILD
printf("SF: Detected %s with page size ", flash->name);
-   print_size(flash->page_size, ", total ");
+   print_size(flash->page_size, ", erase size ");
+   print_size(flash->erase_size, ", total ");
print_size(flash->size, "");
if (flash->memory_map)
printf(", mapped at %p", flash->memory_map);
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 10/28] sf: probe: Add support for AT45DB* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added AT45DB* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_ATMEL

 drivers/mtd/spi/spi_flash_probe.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 62c9d0a..9f8b829 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -36,6 +36,15 @@ struct spi_flash_params {
 };
 
 static const struct spi_flash_params spi_flash_params_table[] = {
+#ifdef CONFIG_SPI_FLASH_ATMEL  /* ATMEL */
+   {"AT45DB011D",  0x1f2200, 0x0, 64 * 1024,  4},
+   {"AT45DB021D",  0x1f2300, 0x0, 64 * 1024,  8},
+   {"AT45DB041D",  0x1f2400, 0x0, 64 * 1024,  8},
+   {"AT45DB081D",  0x1f2500, 0x0, 64 * 1024, 16},
+   {"AT45DB161D",  0x1f2600, 0x0, 64 * 1024, 32},
+   {"AT45DB321D",  0x1f2700, 0x0, 64 * 1024, 64},
+   {"AT45DB641D",  0x1f2800, 0x0, 64 * 1024,128},
+#endif
 #ifdef CONFIG_SPI_FLASH_EON/* EON */
{"EN25Q32B",0x1c3016, 0x0, 64 * 1024, 64},
{"EN25Q128B",   0x1c3018, 0x0, 64 * 1024,256},
@@ -135,7 +144,6 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
 */
/*
 * TODO:
-* ATMEL
 * RAMTRON
 */
 };
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 13/28] sf: probe: Add support to clear flash BP# bits

2013-09-15 Thread Jagannadha Sutradharudu Teki
Few of the flashes(Atmel, Macronix and SST) require to
clear BP# bits in flash power ups.

So clear these BP# bits at probe time, so-that the flash
is ready for user operations.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash_probe.c | 6 ++
 include/spi_flash.h   | 5 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index f97097a..839ece5 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -203,6 +203,12 @@ struct spi_flash *spi_flash_validate_ids(struct spi_slave 
*spi, u8 *idcode)
flash->sector_size = params->sector_size;
flash->size = flash->sector_size * params->nr_sectors;
 
+   /* Flash powers up read-only, so clear BP# bits */
+   if (((params->jedec >> 16) == SPI_FLASH_CFI_MFR_ATMEL) ||
+   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_MACRONIX) ||
+   ((params->jedec >> 16) == SPI_FLASH_CFI_MFR_SST))
+   spi_flash_cmd_write_status(flash, 0);
+
return flash;
 }
 
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 4f35c30..8de4e8d 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -17,6 +17,11 @@
 #include 
 #include 
 
+/* SPI flash CFI Manufacture ID's */
+#define SPI_FLASH_CFI_MFR_ATMEL0x1f
+#define SPI_FLASH_CFI_MFR_MACRONIX 0xc2
+#define SPI_FLASH_CFI_MFR_SST  0xbf
+
 /* SST specific macros */
 #ifdef CONFIG_SPI_FLASH_SST
 # define SST_WP0x01/* Supports AAI word program */
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 17/28] sf: Add proper comment style on spi_flash structure

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added proper comment style on spi_flash structure to make
more readable.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 include/spi_flash.h | 63 +
 1 file changed, 35 insertions(+), 28 deletions(-)

diff --git a/include/spi_flash.h b/include/spi_flash.h
index 14e4ae2..34a167b 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -37,39 +37,46 @@
 # define CMD_SST_AAI_WP0xAD/* Auto Address Incr Word 
Program */
 #endif
 
+/**
+ * struct spi_flash - SPI flash structure
+ *
+ * @spi:   SPI slave
+ * @name:  Name of SPI flash
+ * @size:  Total flash size
+ * @page_size: Write (page) size
+ * @sector_size:   Sector size
+ * @erase_size:Erase size
+ * @bank_read_cmd: Bank read cmd
+ * @bank_write_cmd:Bank write cmd
+ * @bank_curr: Current flash bank
+ * @poll_cmd:  Poll cmd - for flash erase/program
+ * @erase_cmd: Erase cmd 4K, 32K, 64K
+ * @memory_map:Address of read-only SPI flash access
+ * @read:  Flash read ops
+ * @write: Flash write ops
+ * @erase: Flash erase ops
+ */
 struct spi_flash {
struct spi_slave *spi;
+   const char *name;
 
-   const char  *name;
-
-   /* Total flash size */
-   u32 size;
-   /* Write (page) size */
-   u32 page_size;
-   /* Sector size */
-   u32 sector_size;
-   /* Erase size */
-   u32 erase_size;
+   u32 size;
+   u32 page_size;
+   u32 sector_size;
+   u32 erase_size;
 #ifdef CONFIG_SPI_FLASH_BAR
-   /* Bank read cmd */
-   u8  bank_read_cmd;
-   /* Bank write cmd */
-   u8  bank_write_cmd;
-   /* Current flash bank */
-   u8  bank_curr;
+   u8 bank_read_cmd;
+   u8 bank_write_cmd;
+   u8 bank_curr;
 #endif
-   /* Poll cmd - for flash erase/program */
-   u8  poll_cmd;
-   /* Erase cmd 4K, 32K, 64K */
-   u8  erase_cmd;
-
-   void *memory_map;   /* Address of read-only SPI flash access */
-   int (*read)(struct spi_flash *flash, u32 offset,
-   size_t len, void *buf);
-   int (*write)(struct spi_flash *flash, u32 offset,
-   size_t len, const void *buf);
-   int (*erase)(struct spi_flash *flash, u32 offset,
-   size_t len);
+   u8 poll_cmd;
+   u8 erase_cmd;
+
+   void *memory_map;
+   int (*read)(struct spi_flash *flash, u32 offset, size_t len, void *buf);
+   int (*write)(struct spi_flash *flash, u32 offset, size_t len,
+   const void *buf);
+   int (*erase)(struct spi_flash *flash, u32 offset, size_t len);
 };
 
 /**
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 09/28] sf: probe: Add support for SST25* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added SST25* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_SST

 drivers/mtd/spi/spi_flash_probe.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 6f0dd84..62c9d0a 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -88,6 +88,18 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"N25Q1024",0x20ba21, 0x0, 64 * 1024,   2048},
{"N25Q1024A",   0x20bb21, 0x0, 64 * 1024,   2048},
 #endif
+#ifdef CONFIG_SPI_FLASH_SST/* SST */
+   {"SST25VF040B", 0xbf258d, 0x0, 64 * 1024,  8},
+   {"SST25VF080B", 0xbf258e, 0x0, 64 * 1024, 16},
+   {"SST25VF016B", 0xbf2541, 0x0, 64 * 1024, 32},
+   {"SST25VF032B", 0xbf254a, 0x0, 64 * 1024, 64},
+   {"SST25VF064C", 0xbf254b, 0x0, 64 * 1024,128},
+   {"SST25WF512",  0xbf2501, 0x0, 64 * 1024,  1},
+   {"SST25WF010",  0xbf2502, 0x0, 64 * 1024,  2},
+   {"SST25WF020",  0xbf2503, 0x0, 64 * 1024,  4},
+   {"SST25WF040",  0xbf2504, 0x0, 64 * 1024,  8},
+   {"SST25WF080",  0xbf2505, 0x0, 64 * 1024, 16},
+#endif
 #ifdef CONFIG_SPI_FLASH_WINBOND/* WINBOND */
{"W25P80",  0xef2014, 0x0, 64 * 1024, 16},
{"W25P16",  0xef2015, 0x0, 64 * 1024, 32},
@@ -125,7 +137,6 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
 * TODO:
 * ATMEL
 * RAMTRON
-* SST
 */
 };
 
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 05/28] sf: probe: Add support for GD25* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added GD25* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_GIGADEVICE

 drivers/mtd/spi/spi_flash_probe.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index 12baf41..dcb6929 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -40,6 +40,10 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"EN25Q32B",0x1c3016, 0x0, 64 * 1024, 64},
{"EN25Q128B",   0x1c3018, 0x0, 64 * 1024,256},
 #endif
+#ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */
+   {"GD25Q64B",0xc84017, 0x0, 64 * 1024,128},
+   {"GD25LQ32",0xc86016, 0x0, 64 * 1024, 64},
+#endif
 #ifdef CONFIG_SPI_FLASH_STMICRO/* STMICRO */
{"M25P10",  0x202011, 0x0, 32 * 1024,  4},
{"M25P20",  0x202012, 0x0, 64 * 1024,  4},
@@ -65,7 +69,6 @@ static const struct spi_flash_params spi_flash_params_table[] 
= {
/*
 * TODO:
 * ATMEL
-* GIGADEVICE
 * MACRONIX
 * RAMTRON
 * SPANSION
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 18/28] sf: ramtron: Add support for separate flash driver

2013-09-15 Thread Jagannadha Sutradharudu Teki
Compared to other spi flashes, ramtron has a different
probing and implementation on flash ops, hence moved
ramtron probe code into ramtron driver.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/Makefile |   6 +-
 drivers/mtd/spi/ramtron.c| 123 +-
 drivers/mtd/spi/spi_flash_probe.c|   4 -
 drivers/mtd/spi/spi_flash_probe_legacy.c | 276 ---
 include/configs/top9000.h|   1 -
 5 files changed, 125 insertions(+), 285 deletions(-)
 delete mode 100644 drivers/mtd/spi/spi_flash_probe_legacy.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index dde2691..2605e57 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -14,8 +14,10 @@ COBJS-$(CONFIG_SPL_SPI_LOAD) += spi_spl_load.o
 COBJS-$(CONFIG_SPL_SPI_BOOT)   += fsl_espi_spl.o
 endif
 
-COBJS-$(CONFIG_SPI_FLASH_LEGACY) += spi_flash_probe_legacy.o spi_flash_ops.o 
spi_flash.o
-COBJS-$(CONFIG_SPI_FLASH)  += spi_flash_probe.o spi_flash_ops.o spi_flash.o
+ifdef CONFIG_CMD_SF
+COBJS-y+= spi_flash.o
+endif
+COBJS-$(CONFIG_SPI_FLASH)  += spi_flash_probe.o spi_flash_ops.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
 COBJS-$(CONFIG_SPI_FLASH_GIGADEVICE)   += gigadevice.o
diff --git a/drivers/mtd/spi/ramtron.c b/drivers/mtd/spi/ramtron.c
index 38f9d69..c9701d0 100644
--- a/drivers/mtd/spi/ramtron.c
+++ b/drivers/mtd/spi/ramtron.c
@@ -214,7 +214,8 @@ static int ramtron_erase(struct spi_flash *flash, u32 
offset, size_t len)
  * nore: we are called here with idcode pointing to the first non-0x7f byte
  * already!
  */
-struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode)
+static struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi,
+   u8 *idcode)
 {
const struct ramtron_spi_fram_params *params;
struct ramtron_spi_fram *sn;
@@ -270,7 +271,7 @@ struct spi_flash *spi_fram_probe_ramtron(struct spi_slave 
*spi, u8 *idcode)
return NULL;
 
 found:
-   sn = spi_flash_alloc(struct ramtron_spi_fram, spi, params->name);
+   sn = malloc(sizeof(*sn));
if (!sn) {
debug("SF: Failed to allocate memory\n");
return NULL;
@@ -285,3 +286,121 @@ found:
 
return &sn->flash;
 }
+
+/*
+ * The following table holds all device probe functions
+ * (All flashes are removed and implemented a common probe at
+ *  spi_flash_probe.c)
+ *
+ * shift:  number of continuation bytes before the ID
+ * idcode: the expected IDCODE or 0xff for non JEDEC devices
+ * probe:  the function to call
+ *
+ * Non JEDEC devices should be ordered in the table such that
+ * the probe functions with best detection algorithms come first.
+ *
+ * Several matching entries are permitted, they will be tried
+ * in sequence until a probe function returns non NULL.
+ *
+ * IDCODE_CONT_LEN may be redefined if a device needs to declare a
+ * larger "shift" value.  IDCODE_PART_LEN generally shouldn't be
+ * changed.  This is the max number of bytes probe functions may
+ * examine when looking up part-specific identification info.
+ *
+ * Probe functions will be given the idcode buffer starting at their
+ * manu id byte (the "idcode" in the table below).  In other words,
+ * all of the continuation bytes will be skipped (the "shift" below).
+ */
+#define IDCODE_CONT_LEN 0
+#define IDCODE_PART_LEN 5
+static const struct {
+   const u8 shift;
+   const u8 idcode;
+   struct spi_flash *(*probe) (struct spi_slave *spi, u8 *idcode);
+} flashes[] = {
+   /* Keep it sorted by define name */
+#ifdef CONFIG_SPI_FRAM_RAMTRON
+   { 6, 0xc2, spi_fram_probe_ramtron, },
+# undef IDCODE_CONT_LEN
+# define IDCODE_CONT_LEN 6
+#endif
+#ifdef CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC
+   { 0, 0xff, spi_fram_probe_ramtron, },
+#endif
+};
+#define IDCODE_LEN (IDCODE_CONT_LEN + IDCODE_PART_LEN)
+
+struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
+   unsigned int max_hz, unsigned int spi_mode)
+{
+   struct spi_slave *spi;
+   struct spi_flash *flash = NULL;
+   int ret, i, shift;
+   u8 idcode[IDCODE_LEN], *idp;
+
+   spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
+   if (!spi) {
+   printf("SF: Failed to set up slave\n");
+   return NULL;
+   }
+
+   ret = spi_claim_bus(spi);
+   if (ret) {
+   debug("SF: Failed to claim SPI bus: %d\n", ret);
+   goto err_claim_bus;
+   }
+
+   /* Read the ID codes */
+   ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
+   if (ret)
+   goto err_read_id;
+
+#ifdef DEBUG
+   printf("SF: Got idcodes\n");
+   print_buffer(0, idcode, 1, sizeof(idcode), 0);
+#endif
+
+   /* count the number of continuation bytes */
+   for (shift = 0, idp = idc

[U-Boot] [PATCH v3 07/28] sf: probe: Add support for W25* flash parts

2013-09-15 Thread Jagannadha Sutradharudu Teki
Added W25* parts are which are avilable in spi_flash_probe_legacy.c.

Updated the sector_size attributes as per the flash parts.
Looks fine for with this sector_size for computing the size
of flash.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v3:
- none
Changes for v2:
- Enable CONFIG_SPI_FLASH_WINBOND

 drivers/mtd/spi/spi_flash_probe.c | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash_probe.c 
b/drivers/mtd/spi/spi_flash_probe.c
index af38da1..1ff3b60 100644
--- a/drivers/mtd/spi/spi_flash_probe.c
+++ b/drivers/mtd/spi/spi_flash_probe.c
@@ -75,13 +75,44 @@ static const struct spi_flash_params 
spi_flash_params_table[] = {
{"N25Q1024",0x20ba21, 0x0, 64 * 1024,   2048},
{"N25Q1024A",   0x20bb21, 0x0, 64 * 1024,   2048},
 #endif
+#ifdef CONFIG_SPI_FLASH_WINBOND/* WINBOND */
+   {"W25P80",  0xef2014, 0x0, 64 * 1024, 16},
+   {"W25P16",  0xef2015, 0x0, 64 * 1024, 32},
+   {"W25P32",  0xef2016, 0x0, 64 * 1024, 64},
+   {"W25X40",  0xef3013, 0x0, 64 * 1024,  8},
+   {"W25X16",  0xef3015, 0x0, 64 * 1024, 32},
+   {"W25X32",  0xef3016, 0x0, 64 * 1024, 64},
+   {"W25X64",  0xef3017, 0x0, 64 * 1024,128},
+   {"W25Q80BL",0xef4014, 0x0, 64 * 1024, 16},
+   {"W25Q16CL",0xef4015, 0x0, 64 * 1024, 32},
+   {"W25Q32BV",0xef4016, 0x0, 64 * 1024, 64},
+   {"W25Q64CV",0xef4017, 0x0, 64 * 1024,128},
+   {"W25Q128BV",   0xef4018, 0x0, 64 * 1024,256},
+   {"W25Q256", 0xef4019, 0x0, 64 * 1024,512},
+   {"W25Q80BW",0xef5014, 0x0, 64 * 1024, 16},
+   {"W25Q16DW",0xef6015, 0x0, 64 * 1024, 32},
+   {"W25Q32DW",0xef6016, 0x0, 64 * 1024, 64},
+   {"W25Q64DW",0xef6017, 0x0, 64 * 1024,128},
+   {"W25Q128FW",   0xef6018, 0x0, 64 * 1024,256},
+#endif
+   /*
+* Note:
+* Below paired flash devices has similar spi_flash_params params.
+* (W25Q80BL, W25Q80BV)
+* (W25Q16CL, W25Q16DV)
+* (W25Q32BV, W25Q32FV_SPI)
+* (W25Q64CV, W25Q64FV_SPI)
+* (W25Q128BV, W25Q128FV_SPI)
+* (W25Q32DW, W25Q32FV_QPI)
+* (W25Q64DW, W25Q64FV_QPI)
+* (W25Q128FW, W25Q128FV_QPI)
+*/
/*
 * TODO:
 * ATMEL
 * RAMTRON
 * SPANSION
 * SST
-* WINBOND
 */
 };
 
-- 
1.8.3


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/2] i2c: port i2c driver to new subsystem

2013-09-15 Thread Philippe Reynes
This serie is composed of two patches:
- one to port the i2c mxc driver to new subsystem
- one to update all configurations with i2c mxc driver

This serie was tested with success on armadeus apf27.

Philippe Reynes (2):
  i2c: move to new subsystem
  i2c: update config using mxc driver to new subsystem

 README|3 +
 arch/arm/cpu/armv7/mx5/clock.c|2 +-
 arch/arm/cpu/armv7/mx6/clock.c|2 +-
 arch/arm/imx-common/Makefile  |2 +-
 drivers/i2c/Makefile  |2 +-
 drivers/i2c/mxc_i2c.c |  109 +
 include/configs/apf27.h   |5 +-
 include/configs/flea3.h   |6 +-
 include/configs/imx31_phycore.h   |6 +-
 include/configs/m53evk.h  |6 +-
 include/configs/mx25pdk.h |6 +-
 include/configs/mx35pdk.h |6 +-
 include/configs/mx53ard.h |6 +-
 include/configs/mx53evk.h |6 +-
 include/configs/mx53loco.h|6 +-
 include/configs/mx53smd.h |6 +-
 include/configs/mx6qsabreauto.h   |3 +-
 include/configs/nitrogen6x.h  |3 +-
 include/configs/titanium.h|3 +-
 include/configs/vf610twr.h|6 +-
 include/configs/woodburn_common.h |6 +-
 21 files changed, 98 insertions(+), 102 deletions(-)

-- 
1.7.4.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] i2c: update config using mxc driver to new subsystem

2013-09-15 Thread Philippe Reynes

Signed-off-by: Philippe Reynes 
---
 include/configs/apf27.h   |5 ++---
 include/configs/flea3.h   |6 +++---
 include/configs/imx31_phycore.h   |6 +++---
 include/configs/m53evk.h  |6 +++---
 include/configs/mx25pdk.h |6 +++---
 include/configs/mx35pdk.h |6 +++---
 include/configs/mx53ard.h |6 +++---
 include/configs/mx53evk.h |6 +++---
 include/configs/mx53loco.h|6 +++---
 include/configs/mx53smd.h |6 +++---
 include/configs/mx6qsabreauto.h   |3 ++-
 include/configs/nitrogen6x.h  |3 ++-
 include/configs/titanium.h|3 ++-
 include/configs/vf610twr.h|6 +++---
 include/configs/woodburn_common.h |6 +++---
 15 files changed, 41 insertions(+), 39 deletions(-)

diff --git a/include/configs/apf27.h b/include/configs/apf27.h
index e7e258f..7e0a8a8 100644
--- a/include/configs/apf27.h
+++ b/include/configs/apf27.h
@@ -321,9 +321,8 @@
  */
 
 #ifdef CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEIMX_I2C1_BASE
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED   10  /* 100 kHz */
 #define CONFIG_SYS_I2C_SLAVE   0x7F
 #define CONFIG_SYS_I2C_NOPROBES{ }
diff --git a/include/configs/flea3.h b/include/configs/flea3.h
index cfcaf1b..d91fdab 100644
--- a/include/configs/flea3.h
+++ b/include/configs/flea3.h
@@ -50,9 +50,9 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C3_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 2
 #define CONFIG_SYS_I2C_SPEED   10
 #define CONFIG_SYS_I2C_SLAVE   0xfe
 #define CONFIG_MXC_SPI
diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
index 720e1bf..bf1a2cb 100644
--- a/include/configs/imx31_phycore.h
+++ b/include/configs/imx31_phycore.h
@@ -35,9 +35,9 @@
  * Hardware drivers
  */
 
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C2_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 1
 #define CONFIG_SYS_I2C_CLK_OFFSET  I2C2_CLK_OFFSET
 #define CONFIG_SYS_I2C_SPEED   10
 
diff --git a/include/configs/m53evk.h b/include/configs/m53evk.h
index ccb07e3..4e06537 100644
--- a/include/configs/m53evk.h
+++ b/include/configs/m53evk.h
@@ -161,9 +161,9 @@
  * I2C
  */
 #ifdef CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C2_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 1
 #define CONFIG_SYS_I2C_SPEED   10
 #endif
 
diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
index 543c415..22fb31b 100644
--- a/include/configs/mx25pdk.h
+++ b/include/configs/mx25pdk.h
@@ -111,9 +111,9 @@
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEIMX_I2C_BASE
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 0
 #define CONFIG_SYS_I2C_SPEED   10
 
 /* RTC */
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index 68b225a..f9387a3 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -41,9 +41,9 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C1_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 0
 #define CONFIG_SYS_I2C_SPEED   10
 #define CONFIG_MXC_SPI
 #define CONFIG_MXC_GPIO
diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index 122ffd0..e74fc5a 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -44,9 +44,9 @@
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C2_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 1
 #define CONFIG_SYS_I2C_SPEED10
 
 /* MMC Configs */
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index d39ce7b..c7582f9 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -37,9 +37,9 @@
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
-#define CONFIG_HARD_I2C
-#define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_BASEI2C2_BASE_ADDR
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_SPD_BUS_NUM 1
 #define CONFIG_SYS_I2C_SPEED10
 
 /* PMIC Configs */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 7237da5..acac6e8 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -71,9 +71,9 @

[U-Boot] [PATCH 1/2] i2c: move to new subsystem

2013-09-15 Thread Philippe Reynes

Signed-off-by: Philippe Reynes 
---
 README |3 +
 arch/arm/cpu/armv7/mx5/clock.c |2 +-
 arch/arm/cpu/armv7/mx6/clock.c |2 +-
 arch/arm/imx-common/Makefile   |2 +-
 drivers/i2c/Makefile   |2 +-
 drivers/i2c/mxc_i2c.c  |  109 ++-
 6 files changed, 57 insertions(+), 63 deletions(-)

diff --git a/README b/README
index 63706be..7c734ba 100644
--- a/README
+++ b/README
@@ -1995,6 +1995,9 @@ CBFS (Coreboot Filesystem) support
  - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0
  - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1
 
+   - drivers/i2c/i2c_mxc.c
+- activate this driver with CONFIG_SYS_I2C_MXC
+
additional defines:
 
CONFIG_SYS_NUM_I2C_BUSES
diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index 6bef254..fb3b128 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -94,7 +94,7 @@ void enable_usboh3_clk(bool enable)
MXC_CCM_CCGR2_USBOH3_60M(cg));
 }
 
-#ifdef CONFIG_I2C_MXC
+#ifdef CONFIG_SYS_I2C_MXC
 /* i2c_num can be from 0, to 1 for i.MX51 and 2 for i.MX53 */
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
 {
diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 7efb0d2..8130827 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -48,7 +48,7 @@ void enable_usboh3_clk(unsigned char enable)
 
 }
 
-#ifdef CONFIG_I2C_MXC
+#ifdef CONFIG_SYS_I2C_MXC
 /* i2c_num can be from 0 - 2 */
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
 {
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 727a052..6c78dd9 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -16,7 +16,7 @@ COBJS-y   = iomux-v3.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
 COBJS-y+= timer.o cpu.o speed.o
-COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o
+COBJS-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
 COBJS-y+= misc.o
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 37ccbd1..f9fcebe 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -14,7 +14,7 @@ COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_DW_I2C) += designware_i2c.o
 COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
 COBJS-$(CONFIG_I2C_MV) += mv_i2c.o
-COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
+COBJS-$(CONFIG_SYS_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 06ba4e3..3ac1865 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -153,21 +153,6 @@ static int bus_i2c_set_bus_speed(void *base, int speed)
return 0;
 }
 
-/*
- * Get I2C Speed
- */
-static unsigned int bus_i2c_get_bus_speed(void *base)
-{
-   struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)base;
-   u8 clk_idx = readb(&i2c_regs->ifdr);
-   u8 clk_div;
-
-   for (clk_div = 0; i2c_clk_div[clk_div][1] != clk_idx; clk_div++)
-   ;
-
-   return mxc_get_clock(MXC_I2C_CLK) / i2c_clk_div[clk_div][0];
-}
-
 #define ST_BUS_IDLE (0 | (I2SR_IBB << 8))
 #define ST_BUS_BUSY (I2SR_IBB | (I2SR_IBB << 8))
 #define ST_IIF (I2SR_IIF | (I2SR_IIF << 8))
@@ -410,20 +395,30 @@ struct sram_data {
  */
 static struct sram_data __attribute__((section(".data"))) srdata;
 
-void *get_base(void)
-{
-#ifdef CONFIG_SYS_I2C_BASE
-#ifdef CONFIG_I2C_MULTI_BUS
-   void *ret = srdata.i2c_data[srdata.curr_i2c_bus].base;
-   if (ret)
-   return ret;
-#endif
-   return (void *)CONFIG_SYS_I2C_BASE;
-#elif defined(CONFIG_I2C_MULTI_BUS)
-   return srdata.i2c_data[srdata.curr_i2c_bus].base;
+static void * const i2c_bases[] = {
+#if defined(CONFIG_MX25)
+   (void *)IMX_I2C_BASE,
+   (void *)IMX_I2C2_BASE,
+   (void *)IMX_I2C3_BASE
+#elif defined(CONFIG_MX27)
+   (void *)IMX_I2C1_BASE,
+   (void *)IMX_I2C2_BASE
+#elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \
+   defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
+   defined(CONFIG_MX6)
+   (void *)I2C1_BASE_ADDR,
+   (void *)I2C2_BASE_ADDR,
+   (void *)I2C3_BASE_ADDR
+#elif defined(CONFIG_VF610)
+   (void *)I2C0_BASE_ADDR
 #else
-   return srdata.i2c_data[0].base;
+#error "architecture not supported"
 #endif
+};
+
+void *i2c_get_base(struct i2c_adapter *adap)
+{
+   return i2c_bases[adap->hwadapnr];
 }
 
 static struct i2c_parms *i2c_get_parms(void *base)
@@ -448,39 +443,26 @@ static int i2c_idle_bus(void *base)
return 0;
 }
 
-#ifdef CONFIG_I2C_MULTI_BUS
-unsigned int i2c_get_bus_num(void)
+int mxc_i2c_read(struct i2c_adapter *adap, uint8_t chip,
+   uint addr,

Re: [U-Boot] [PATCH 1/2] i2c: move to new subsystem

2013-09-15 Thread Albert ARIBAUD
Hi Philippe,

On Sun, 15 Sep 2013 21:09:41 +0200, Philippe Reynes 
wrote:

> 
> Signed-off-by: Philippe Reynes 
> ---
>  README |3 +
>  arch/arm/cpu/armv7/mx5/clock.c |2 +-
>  arch/arm/cpu/armv7/mx6/clock.c |2 +-
>  arch/arm/imx-common/Makefile   |2 +-
>  drivers/i2c/Makefile   |2 +-
>  drivers/i2c/mxc_i2c.c  |  109 ++-
>  6 files changed, 57 insertions(+), 63 deletions(-)
> 
> diff --git a/README b/README
> index 63706be..7c734ba 100644
> --- a/README
> +++ b/README
> @@ -1995,6 +1995,9 @@ CBFS (Coreboot Filesystem) support
> - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0
> - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1
>  
> + - drivers/i2c/i2c_mxc.c
> +  - activate this driver with CONFIG_SYS_I2C_MXC
> +
>   additional defines:
>  
>   CONFIG_SYS_NUM_I2C_BUSES
> diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
> index 6bef254..fb3b128 100644
> --- a/arch/arm/cpu/armv7/mx5/clock.c
> +++ b/arch/arm/cpu/armv7/mx5/clock.c
> @@ -94,7 +94,7 @@ void enable_usboh3_clk(bool enable)
>   MXC_CCM_CCGR2_USBOH3_60M(cg));
>  }
>  
> -#ifdef CONFIG_I2C_MXC
> +#ifdef CONFIG_SYS_I2C_MXC
>  /* i2c_num can be from 0, to 1 for i.MX51 and 2 for i.MX53 */
>  int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
>  {
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index 7efb0d2..8130827 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -48,7 +48,7 @@ void enable_usboh3_clk(unsigned char enable)
>  
>  }
>  
> -#ifdef CONFIG_I2C_MXC
> +#ifdef CONFIG_SYS_I2C_MXC
>  /* i2c_num can be from 0 - 2 */
>  int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
>  {
> diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
> index 727a052..6c78dd9 100644
> --- a/arch/arm/imx-common/Makefile
> +++ b/arch/arm/imx-common/Makefile
> @@ -16,7 +16,7 @@ COBJS-y = iomux-v3.o
>  endif
>  ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
>  COBJS-y  += timer.o cpu.o speed.o
> -COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o
> +COBJS-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
>  endif
>  ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
>  COBJS-y  += misc.o
> diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
> index 37ccbd1..f9fcebe 100644
> --- a/drivers/i2c/Makefile
> +++ b/drivers/i2c/Makefile
> @@ -14,7 +14,7 @@ COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
>  COBJS-$(CONFIG_DW_I2C) += designware_i2c.o
>  COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o
>  COBJS-$(CONFIG_I2C_MV) += mv_i2c.o
> -COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
> +COBJS-$(CONFIG_SYS_I2C_MXC) += mxc_i2c.o
>  COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o
>  COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
>  COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index 06ba4e3..3ac1865 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -153,21 +153,6 @@ static int bus_i2c_set_bus_speed(void *base, int speed)
>   return 0;
>  }
>  
> -/*
> - * Get I2C Speed
> - */
> -static unsigned int bus_i2c_get_bus_speed(void *base)
> -{
> - struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)base;
> - u8 clk_idx = readb(&i2c_regs->ifdr);
> - u8 clk_div;
> -
> - for (clk_div = 0; i2c_clk_div[clk_div][1] != clk_idx; clk_div++)
> - ;
> -
> - return mxc_get_clock(MXC_I2C_CLK) / i2c_clk_div[clk_div][0];
> -}
> -
>  #define ST_BUS_IDLE (0 | (I2SR_IBB << 8))
>  #define ST_BUS_BUSY (I2SR_IBB | (I2SR_IBB << 8))
>  #define ST_IIF (I2SR_IIF | (I2SR_IIF << 8))
> @@ -410,20 +395,30 @@ struct sram_data {
>   */
>  static struct sram_data __attribute__((section(".data"))) srdata;
>  
> -void *get_base(void)
> -{
> -#ifdef CONFIG_SYS_I2C_BASE
> -#ifdef CONFIG_I2C_MULTI_BUS
> - void *ret = srdata.i2c_data[srdata.curr_i2c_bus].base;
> - if (ret)
> - return ret;
> -#endif
> - return (void *)CONFIG_SYS_I2C_BASE;
> -#elif defined(CONFIG_I2C_MULTI_BUS)
> - return srdata.i2c_data[srdata.curr_i2c_bus].base;
> +static void * const i2c_bases[] = {
> +#if defined(CONFIG_MX25)
> + (void *)IMX_I2C_BASE,
> + (void *)IMX_I2C2_BASE,
> + (void *)IMX_I2C3_BASE
> +#elif defined(CONFIG_MX27)
> + (void *)IMX_I2C1_BASE,
> + (void *)IMX_I2C2_BASE
> +#elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \
> + defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
> + defined(CONFIG_MX6)
> + (void *)I2C1_BASE_ADDR,
> + (void *)I2C2_BASE_ADDR,
> + (void *)I2C3_BASE_ADDR
> +#elif defined(CONFIG_VF610)
> + (void *)I2C0_BASE_ADDR
>  #else
> - return srdata.i2c_data[0].base;
> +#error "architecture not supported"
>  #endif
> +};
> +
> +void *i2c_get_base(struct i2c_adapter *adap)
> +{
> + return i2c_bases[adap->hwadapnr];
>  }
>  
>  

[U-Boot] [PATCH] Cosmetic: Fix a number of typoes, no functional changes.

2013-09-15 Thread Robert P. J. Day

Fix various misspellings of things like "environment", "kernel",
"default" and "volatile", and throw in a couple grammar fixes.

Signed-off-by: Robert P. J. Day 

---

diff --git a/Makefile b/Makefile
index 1365db6..f55f8c0 100644
--- a/Makefile
+++ b/Makefile
@@ -45,13 +45,13 @@ endif

 #
 #
-# U-boot build supports producing a object files to the separate external
+# U-boot build supports generating object files in a separate external
 # directory. Two use cases are supported:
 #
 # 1) Add O= to the make command line
 # 'make O=/tmp/build all'
 #
-# 2) Set environement variable BUILD_DIR to point to the desired location
+# 2) Set environment variable BUILD_DIR to point to the desired location
 # 'export BUILD_DIR=/tmp/build'
 # 'make'
 #
@@ -59,7 +59,7 @@ endif
 # 'export BUILD_DIR=/tmp/build'
 # './MAKEALL'
 #
-# Command line 'O=' setting overrides BUILD_DIR environent variable.
+# Command line 'O=' setting overrides BUILD_DIR environment variable.
 #
 # When none of the above methods is used the local build is performed and
 # the object files are placed in the source directory.
diff --git a/README b/README
index ccd47fa..13e3ac0 100644
--- a/README
+++ b/README
@@ -3360,7 +3360,7 @@ Configuration Settings:
the Linux kernel; all data that must be processed by
the Linux kernel (bd_info, boot arguments, FDT blob if
used) must be put below this limit, unless "bootm_low"
-   enviroment variable is defined and non-zero. In such case
+   environment variable is defined and non-zero. In such case
all data for the Linux kernel must be between "bootm_low"
and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.  The environment
variable "bootm_mapsize" will override the value of
@@ -3473,7 +3473,7 @@ Configuration Settings:

 - CONFIG_ENV_FLAGS_LIST_DEFAULT
 - CONFIG_ENV_FLAGS_LIST_STATIC
-   Enable validation of the values given to enviroment variables when
+   Enable validation of the values given to environment variables when
calling env set.  Variables can be restricted to only decimal,
hexadecimal, or boolean.  If CONFIG_CMD_NET is also defined,
the variables can also be restricted to IP address or MAC address.
diff --git a/arch/arm/cpu/arm926ejs/at91/eflash.c 
b/arch/arm/cpu/arm926ejs/at91/eflash.c
index 3e21cdb..3f39264 100644
--- a/arch/arm/cpu/arm926ejs/at91/eflash.c
+++ b/arch/arm/cpu/arm926ejs/at91/eflash.c
@@ -28,7 +28,7 @@
  * by u-Boot commands.
  *
  * Note: Redundant environment will not work in this flash since
- * it does use partial page writes. Make sure the environent spans
+ * it does use partial page writes. Make sure the environment spans
  * whole pages!
  */

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c 
b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
index cde3172..d4711c0 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
@@ -302,7 +302,7 @@ int arch_cpu_init(void)
/*
 * Configures the I/O voltage of the pads connected to Egigabit
 * Ethernet interface to 1.8V
-* By defult it is set to 3.3V
+* By default it is set to 3.3V
 */
reg = readl(KW_REG_MPP_OUT_DRV_REG);
reg |= (1 << 7);
diff --git a/board/RPXlite_dw/README b/board/RPXlite_dw/README
index 14296b2..9e2d0f4 100644
--- a/board/RPXlite_dw/README
+++ b/board/RPXlite_dw/README
@@ -87,9 +87,9 @@ u-boot>

 
~~

-A word on the U-Boot enviroment variable setting and usage :
+A word on the U-Boot environment variable setting and usage :

-In the beginning, you could just need very simple defult environment variable 
setting,
+In the beginning, you could just need very simple default environment variable 
setting,
 like[include/configs/RPXlite.h] :

 #define CONFIG_BOOTCOMMAND 
 \
diff --git a/board/freescale/mx28evk/README b/board/freescale/mx28evk/README
index 524f3fc..0389a1d 100644
--- a/board/freescale/mx28evk/README
+++ b/board/freescale/mx28evk/README
@@ -29,11 +29,11 @@ Environment Storage

 There are two targets for mx28evk:

-"make mx28evk_config"  - store enviroment variables into MMC
+"make mx28evk_config"  - store environment variables into MMC

 or

-"make mx28evk_nand_config" - store enviroment variables into NAND flash
+"make mx28evk_nand_config" - store environment variables into NAND flash

 Choose the target accordingly.

diff --git a/board/sbc8349/README b/board/sbc8349/README
index 2c35919..e2d60cc 100644
--- a/board/sbc8349/README
+++ b/board/sbc8349/README
@@ -50,7 +50,7 @@ is a summary of that information:
 trying to preserve your old environment settings and user flash).
   - Set the start address of the erase/flash process to FF80_
   

[U-Boot] [PATCH] Cosmetic: Update some info in the README "arch" section.

2013-09-15 Thread Robert P. J. Day

Tidy up, reorder, and add newer info to the arch/ directory subsection
of the README file.

Signed-off-by: Robert P. J. Day 

---

  if anyone wants to adjust any of that differently, help yourself.

diff --git a/README b/README
index ccd47fa..be5336f 100644
--- a/README
+++ b/README
@@ -153,9 +153,6 @@ Directory Hierarchy:
   /blackfinFiles generic to Analog Devices Blackfin architecture
 /cpu   CPU specific files
 /lib   Architecture specific library files
-  /x86 Files generic to x86 architecture
-/cpu   CPU specific files
-/lib   Architecture specific library files
   /m68kFiles generic to m68k architecture
 /cpu   CPU specific files
   /mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs
@@ -179,6 +176,9 @@ Directory Hierarchy:
   /nios2   Files generic to Altera NIOS2 architecture
 /cpu   CPU specific files
 /lib   Architecture specific library files
+  /openriscFiles generic to OpenRISC architecture
+/cpu   CPU specific files
+/lib   Architecture specific library files
   /powerpc Files generic to PowerPC architecture
 /cpu   CPU specific files
   /74xx_7xxFiles specific to Freescale MPC74xx and 7xx CPUs
@@ -201,12 +201,16 @@ Directory Hierarchy:
   /leon2   Files specific to Gaisler LEON2 SPARC CPU
   /leon3   Files specific to Gaisler LEON3 SPARC CPU
 /lib   Architecture specific library files
+  /x86 Files generic to x86 architecture
+/cpu   CPU specific files
+/lib   Architecture specific library files
 /api   Machine/arch independent API for external apps
 /board Board dependent files
 /commonMisc architecture independent functions
 /disk  Code for disk drive partition handling
 /doc   Documentation (don't expect too much)
 /drivers   Commonly used device drivers
+/dts   Contains Makefile for building internal U-Boot fdt.
 /examples  Example code for standalone applications, etc.
 /fsFilesystem code (cramfs, ext2, jffs2, etc.)
 /include   Header Files
@@ -216,7 +220,7 @@ Directory Hierarchy:
   /lzo Library files to support LZO decompression
 /net   Networking code
 /post  Power On Self Test
-/rtc   Real Time Clock drivers
+/spl   Secondary Program Loader framework
 /tools Tools to build S-Record or U-Boot images, etc.

 Software Configuration:

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Cosmetic: Fix a number of typoes, no functional changes.

2013-09-15 Thread Fabio Estevam
On Sun, Sep 15, 2013 at 7:10 PM, Robert P. J. Day  wrote:
>
> Fix various misspellings of things like "environment", "kernel",
> "default" and "volatile", and throw in a couple grammar fixes.

Isn't there a typo in the subject itself ("typoes") ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Cosmetic: Fix a number of typoes, no functional changes.

2013-09-15 Thread Robert P. J. Day
On Sun, 15 Sep 2013, Fabio Estevam wrote:

> On Sun, Sep 15, 2013 at 7:10 PM, Robert P. J. Day  
> wrote:
> >
> > Fix various misspellings of things like "environment", "kernel",
> > "default" and "volatile", and throw in a couple grammar fixes.
>
> Isn't there a typo in the subject itself ("typoes") ?

  i believe it's one of those matters of personal taste whether you
spell it "typos" or "typoes". but i can resubmit if that's the
standard here.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: README.mxsimage: Use mkimage provided by U-boot

2013-09-15 Thread Otavio Salvador
On Sun, Sep 15, 2013 at 1:50 PM, Fabio Estevam  wrote:
> Hi Marek,
>
> On Sun, Sep 15, 2013 at 1:45 PM, Marek Vasut  wrote:
>
>> Tom, are you OK with such a hack (invoking the in-tree mkimage) in the
>> documentation?
>
> This seems to be a common practice in the U-boot doc directory:
>
> doc/README.imximage:./tools/mkimage -l 
> doc/README.imximage:./tools/mkimage -T imximage \
> doc/README.imximage:./tools/mkimage -n ./board/freescale/mx51evk/imximage.cfg 
> \
> doc/README.kwbimage:./tools/mkimage -l 
> doc/README.kwbimage:./tools/mkimage -n  \
> doc/README.kwbimage:./tools/mkimage -n 
> ./board/Marvell/openrd_base/kwbimage.cfg
> doc/README.mxsimage: ./tools/mkimage -A arm -O u-boot -T mxsimage -n  co
> doc/README.mxsimage: ./tools/mkimage -l 
> doc/README.qemu-mips:# tools/mkimage -A mips -O linux -T kernel -C gzip -a 
> 0x800
> doc/README.ublimage:./tools/mkimage -l 
> doc/README.ublimage:./tools/mkimage -T ublimage \
> doc/README.ublimage:./tools/mkimage -n ./board/davinci/dm365evm/ublimage.cfg \
> doc/SPL/README.am335x-network:$ ./tools/mkimage -A arm -O U-Boot -C none -T 
> scri

Acked-by: Otavio Salvador 

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] gpio: spear_gpio: Fix gpio_set_value() implementation

2013-09-15 Thread Axel Lin
In current gpio_set_value() implementation, it always sets the gpio control bit
no matter the value argument is 0 or 1. Thus the GPIOs never set to low.
This patch fixes this bug.

The address bus is used as a mask on read/write operations, so that independent
software drivers can set their GPIO bits without affecting any other pins in a
single write operation. Thus we don't need a read-modify-write to update the
register.

Signed-off-by: Axel Lin 
Acked-by: Stefan Roese 
Reviewed-by: Vipin Kumar 
Reviewed-by: Michael Trimarchi 
---
v2: Update commit log to explain why a read-modify-write is not necessary
for clearing specific GPIO bit.
Also added Michael Trimarchi's reviewed-by tag since he does review the
patch and said the patch is fine.

 drivers/gpio/spear_gpio.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/spear_gpio.c b/drivers/gpio/spear_gpio.c
index 367b670..6fb4117 100644
--- a/drivers/gpio/spear_gpio.c
+++ b/drivers/gpio/spear_gpio.c
@@ -36,7 +36,10 @@ int gpio_set_value(unsigned gpio, int value)
 {
struct gpio_regs *regs = (struct gpio_regs *)CONFIG_GPIO_BASE;
 
-   writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
+   if (value)
+   writel(1 << gpio, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
+   else
+   writel(0, ®s->gpiodata[DATA_REG_ADDR(gpio)]);
 
return 0;
 }
-- 
1.8.1.2



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Cosmetic: Fix a number of typoes, no functional changes.

2013-09-15 Thread Fabio Estevam
On Sun, Sep 15, 2013 at 7:49 PM, Robert P. J. Day  wrote:
> On Sun, 15 Sep 2013, Fabio Estevam wrote:
>
>> On Sun, Sep 15, 2013 at 7:10 PM, Robert P. J. Day  
>> wrote:
>> >
>> > Fix various misspellings of things like "environment", "kernel",
>> > "default" and "volatile", and throw in a couple grammar fixes.
>>
>> Isn't there a typo in the subject itself ("typoes") ?
>
>   i believe it's one of those matters of personal taste whether you
> spell it "typos" or "typoes". but i can resubmit if that's the
> standard here.

Ok, thanks for the clarification. I wasn't aware of the 'typoes' variant.

As you are a native English speaker, I trust you word :-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] net: fec_mxc: Fix timeouts during tftp transfer

2013-09-15 Thread Fabio Estevam
From: Fabio Estevam 

Performing tftp transfers on mx28 results in random timeouts.

Hector Palacios and Robert Hodaszi analyzed the root cause being related to the 
alignment of the 'buff' buffer inside fec_recv().

GCC versions such as 4.4/4.5 are more likely to exhibit such problem.

Use ALLOC_CACHE_ALIGN_BUFFER() for making the proper alignment of buffer.

Reported-by: Hector Palacios 
Tested-by: Oliver Metz  
Signed-off-by: Fabio Estevam 
---
 drivers/net/fec_mxc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 690e572..b423ff6 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -794,7 +794,7 @@ static int fec_recv(struct eth_device *dev)
uint16_t bd_status;
uint32_t addr, size, end;
int i;
-   uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
+   ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE);
 
/*
 * Check if any critical events have happened
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] doc: README.mxs: Add instruction to install 'libssl-dev'

2013-09-15 Thread Fabio Estevam
From: Fabio Estevam 

Since commit bce883707 (ARM: mxs: tools: Add mkimage support for MXS bootstream)
the following build error is seen when doing a MAKEALL build:

$ ./MAKEALL mx28evk
Configuring for mx28evk - Board: mx28evk, Options: ENV_IS_IN_MMC
mxsimage.c:18:25: fatal error: openssl/evp.h: No such file or directory

Add an entry about the need of installing the 'libssl-dev' package.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Do not remove the 'elftosb' text.

 doc/README.mxs | 5 +
 1 file changed, 5 insertions(+)

diff --git a/doc/README.mxs b/doc/README.mxs
index 5d9e72f..1e5bc5c 100644
--- a/doc/README.mxs
+++ b/doc/README.mxs
@@ -63,6 +63,11 @@ copy the binary by hand:
 Make sure the "elftosb" binary can be found in your $PATH, in this case this
 means "/usr/local/bin/" has to be in your $PATH.
 
+Install the 'libssl-dev' package as well. On a Ubuntu-based distribution, this
+package can be installed as follows:
+
+   $ sudo apt-get install libssl-dev
+
 2) Compiling U-Boot for a MXS based board
 ---
 
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Merge and reformat boards.cfg and MAINTAINERS

2013-09-15 Thread Meier, Roger
Hi Albert

> Could you send thoses two fixes as as a proper, standalone git patch
> rather than a reply to another patch, so that they can be properly
> attributed to you?

I received this message from mailing list robot:
"Message rejected. No base64 encoded MIME text parts allowed."
... I will try the setup another mail client soon.

So I did a resend here: http://patchwork.ozlabs.org/patch/274695/

Regards
Roger

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot