<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/common/cmd_sf.c, branch v2016.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>sf: Add SPI NOR protection mechanism</title>
<updated>2015-11-05T21:47:06+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>fabio.estevam@freescale.com</email>
</author>
<published>2015-11-05T14:43:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c3c016cf75360c2a0d0a065b64b438aaf7720576'/>
<id>c3c016cf75360c2a0d0a065b64b438aaf7720576</id>
<content type='text'>
Many SPI flashes have protection bits (BP2, BP1 and BP0) in the
status register that can protect selected regions of the SPI NOR.

Take these bits into account when performing erase operations,
making sure that the protected areas are skipped.

Tested on a mx6qsabresd:

=&gt; sf probe
SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB
=&gt; sf protect lock  0x3f0000 0x10000
=&gt; sf erase 0x3f0000 0x10000
offset 0x3f0000 is protected and cannot be erased
SF: 65536 bytes @ 0x3f0000 Erased: ERROR
=&gt; sf protect unlock  0x3f0000 0x10000
=&gt; sf erase 0x3f0000 0x10000
SF: 65536 bytes @ 0x3f0000 Erased: OK

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
[re-worked to fit the lock common to dm and non-dm]
Signed-off-by: Jagan Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Many SPI flashes have protection bits (BP2, BP1 and BP0) in the
status register that can protect selected regions of the SPI NOR.

Take these bits into account when performing erase operations,
making sure that the protected areas are skipped.

Tested on a mx6qsabresd:

=&gt; sf probe
SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB
=&gt; sf protect lock  0x3f0000 0x10000
=&gt; sf erase 0x3f0000 0x10000
offset 0x3f0000 is protected and cannot be erased
SF: 65536 bytes @ 0x3f0000 Erased: ERROR
=&gt; sf protect unlock  0x3f0000 0x10000
=&gt; sf erase 0x3f0000 0x10000
SF: 65536 bytes @ 0x3f0000 Erased: OK

Signed-off-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
[re-worked to fit the lock common to dm and non-dm]
Signed-off-by: Jagan Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sf: allocate cache aligned buffers to copy from flash</title>
<updated>2015-08-17T17:59:14+00:00</updated>
<author>
<name>Ravi Babu</name>
<email>ravibabu@ti.com</email>
</author>
<published>2015-08-17T07:59:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=156e96f0382a09e3b67681566319ec945f192eb9'/>
<id>156e96f0382a09e3b67681566319ec945f192eb9</id>
<content type='text'>
Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers.
This is required because, flash drivers may use DMA for read operations
and may have to invalidate the buffer before read.

Signed-off-by: Ravi Babu &lt;ravibabu@ti.com&gt;
Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
Tested-by: Jagan Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use memalign() with ARCH_DMA_MINALIGN to allocate read buffers.
This is required because, flash drivers may use DMA for read operations
and may have to invalidate the buffer before read.

Signed-off-by: Ravi Babu &lt;ravibabu@ti.com&gt;
Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
Tested-by: Jagan Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi: sf: Print the error code on failure</title>
<updated>2015-07-15T00:03:15+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-06-07T14:50:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a7d0711a2486b7420a938831512d859879e613cb'/>
<id>a7d0711a2486b7420a938831512d859879e613cb</id>
<content type='text'>
Rather than just 'ERROR', display the error code, which may be useful, at
least with driver model.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than just 'ERROR', display the error code, which may be useful, at
least with driver model.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Acked-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd, spi: Check if flash pointer is used</title>
<updated>2015-06-29T19:10:11+00:00</updated>
<author>
<name>Heiko Schocher</name>
<email>hs@denx.de</email>
</author>
<published>2015-04-27T05:42:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8ee81b7f9b675cb675119a998b04ca843d24ddcd'/>
<id>8ee81b7f9b675cb675119a998b04ca843d24ddcd</id>
<content type='text'>
If flash pointer is used free it, before probing a new
flash and storing it in flash.

Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If flash pointer is used free it, before probing a new
flash and storing it in flash.

Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>spi, sf: Use offset and size in sf cmd from mtdpartition</title>
<updated>2015-06-29T19:10:11+00:00</updated>
<author>
<name>Heiko Schocher</name>
<email>hs@denx.de</email>
</author>
<published>2015-04-27T05:42:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2ec1a4059cd0421653b19979a046e9fb7296652f'/>
<id>2ec1a4059cd0421653b19979a046e9fb7296652f</id>
<content type='text'>
With this patch, it is possible to get the offset and size information
from the mtdpartiton setting in "mtdparts", similiar to the
"nand" commandos.

=&gt; sf
sf - SPI flash sub-system

Usage:
sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus
                                  and chip select
sf read addr offset|partition len       - read `len' bytes starting at
                                          `offset' to memory at `addr'
sf write addr offset|partition len      - write `len' bytes from memory
                                          at `addr' to flash at `offset'
sf erase offset|partition [+]len        - erase `len' bytes from `offset'
                                          `+len' round up `len' to block size
sf update addr offset|partition len     - erase and write `len' bytes from memory
                                          at `addr' to flash at `offset'
=&gt;
for example "env" is defined in mtdparts:

=&gt; sf read 13000000 env
device 0 offset 0xd0000, size 0x10000
SF: 65536 bytes @ 0xd0000 Read: OK

zynq-uboot&gt; mtdparts add nor0 0x10000@0x0 env
zynq-uboot&gt; sf erase env 0x10000
SF: 65536 bytes @ 0x0 Erased: OK

zynq-uboot&gt; sf write 0x100 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Written: OK

zynq-uboot&gt; sf read 0x40000 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Read: OK

Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this patch, it is possible to get the offset and size information
from the mtdpartiton setting in "mtdparts", similiar to the
"nand" commandos.

=&gt; sf
sf - SPI flash sub-system

Usage:
sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus
                                  and chip select
sf read addr offset|partition len       - read `len' bytes starting at
                                          `offset' to memory at `addr'
sf write addr offset|partition len      - write `len' bytes from memory
                                          at `addr' to flash at `offset'
sf erase offset|partition [+]len        - erase `len' bytes from `offset'
                                          `+len' round up `len' to block size
sf update addr offset|partition len     - erase and write `len' bytes from memory
                                          at `addr' to flash at `offset'
=&gt;
for example "env" is defined in mtdparts:

=&gt; sf read 13000000 env
device 0 offset 0xd0000, size 0x10000
SF: 65536 bytes @ 0xd0000 Read: OK

zynq-uboot&gt; mtdparts add nor0 0x10000@0x0 env
zynq-uboot&gt; sf erase env 0x10000
SF: 65536 bytes @ 0x0 Erased: OK

zynq-uboot&gt; sf write 0x100 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Written: OK

zynq-uboot&gt; sf read 0x40000 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Read: OK

Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd, spi: Add MTD layer driver</title>
<updated>2015-06-29T19:10:11+00:00</updated>
<author>
<name>Daniel Schwierzeck</name>
<email>daniel.schwierzeck@gmail.com</email>
</author>
<published>2015-04-27T05:42:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9fe6d8716e090f3b2dd3f4604acfced124b8a2fc'/>
<id>9fe6d8716e090f3b2dd3f4604acfced124b8a2fc</id>
<content type='text'>
Add MTD layer driver for spi, original patch from:
http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

Changes from Heiko Schocher against this patch:
- Remove compile error if not defining CONFIG_SPI_FLASH_MTD:

  LD      drivers/mtd/spi/built-in.o
drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister':
/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister':
/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1
make: *** [drivers/mtd/spi] Fehler 2

- Add a README entry.
- Add correct writebufsize, to fit with Linux v3.14
  MTD, UBI/UBIFS sync.

Note (From Jagan): For testing raw mtd parition erase/read/write operations
using cmd_sf, sf_mtd should be required to register the spi flash device to
MTD layer but the sf_mtd_info ops were not required until and unless if we
use any flash filesystem layer say for example UBI. Due to this the foot-print
got increased ~290bytes in non-UBI case here that should be acceptible.

Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add MTD layer driver for spi, original patch from:
http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

Changes from Heiko Schocher against this patch:
- Remove compile error if not defining CONFIG_SPI_FLASH_MTD:

  LD      drivers/mtd/spi/built-in.o
drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister':
/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister':
/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister'
drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here
make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1
make: *** [drivers/mtd/spi] Fehler 2

- Add a README entry.
- Add correct writebufsize, to fit with Linux v3.14
  MTD, UBI/UBIFS sync.

Note (From Jagan): For testing raw mtd parition erase/read/write operations
using cmd_sf, sf_mtd should be required to register the spi flash device to
MTD layer but the sf_mtd_info ops were not required until and unless if we
use any flash filesystem layer say for example UBI. Due to this the foot-print
got increased ~290bytes in non-UBI case here that should be acceptible.

Signed-off-by: Daniel Schwierzeck &lt;daniel.schwierzeck@gmail.com&gt;
Signed-off-by: Heiko Schocher &lt;hs@denx.de&gt;
Tested-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
Reviewed-by: Jagannadh Teki &lt;jteki@openedev.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd_sf: Fix problem with "sf update" and unaligned length</title>
<updated>2015-04-22T11:19:51+00:00</updated>
<author>
<name>Stefan Roese</name>
<email>sr@denx.de</email>
</author>
<published>2015-01-09T13:39:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ed62756dcf5544e277d87c461a84c6274f42b765'/>
<id>ed62756dcf5544e277d87c461a84c6274f42b765</id>
<content type='text'>
On SoCFPGA, using "sf update" with an non-4byte aligned length leads
to a hangup (and reboot via watchdog). This is because of the unaligned
access in the cadence QSPI driver which is hard to prevent since the
data is written into a 4-byte wide FIFO. This patch fixes this problem
by changing the behavior of the last sector write (not sector aligned).

The new code is even simpler and copies the source data into the temp
buffer and now uses the temp buffer to write the complete sector. So
only one SPI sector write is used now instead of 2 in the old version.

Signed-off-by: Stefan Roese &lt;sr@denx.de&gt;
Cc: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Cc: Valentin Longchamp &lt;valentin.longchamp@keymile.com&gt;
Cc: Holger Brunck &lt;holger.brunck@keymile.com&gt;
Acked-by: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Reviewed-by: Jagannadha Sutradharudu Teki &lt;jagannadh.teki@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On SoCFPGA, using "sf update" with an non-4byte aligned length leads
to a hangup (and reboot via watchdog). This is because of the unaligned
access in the cadence QSPI driver which is hard to prevent since the
data is written into a 4-byte wide FIFO. This patch fixes this problem
by changing the behavior of the last sector write (not sector aligned).

The new code is even simpler and copies the source data into the temp
buffer and now uses the temp buffer to write the complete sector. So
only one SPI sector write is used now instead of 2 in the old version.

Signed-off-by: Stefan Roese &lt;sr@denx.de&gt;
Cc: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Cc: Valentin Longchamp &lt;valentin.longchamp@keymile.com&gt;
Cc: Holger Brunck &lt;holger.brunck@keymile.com&gt;
Acked-by: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Reviewed-by: Jagannadha Sutradharudu Teki &lt;jagannadh.teki@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>common: Make sure arch-specific map_sysmem() is defined</title>
<updated>2015-04-18T17:11:09+00:00</updated>
<author>
<name>Joe Hershberger</name>
<email>joe.hershberger@ni.com</email>
</author>
<published>2015-03-22T22:08:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0eb25b619699270a8af95c2f76791fd6c4b52972'/>
<id>0eb25b619699270a8af95c2f76791fd6c4b52972</id>
<content type='text'>
In the case where the arch defines a custom map_sysmem(), make sure that
including just mapmem.h is sufficient to have these functions as they
are when the arch does not override it.

Also split the non-arch specific functions out of common.h

Signed-off-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case where the arch defines a custom map_sysmem(), make sure that
including just mapmem.h is sufficient to have these functions as they
are when the arch does not override it.

Also split the non-arch specific functions out of common.h

Signed-off-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>dm: core: Add dev_get_uclass_priv() to access uclass private data</title>
<updated>2015-04-17T01:27:42+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2015-03-05T19:25:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e564f054af002d9e6a1080ed9d4bc2c6052a4435'/>
<id>e564f054af002d9e6a1080ed9d4bc2c6052a4435</id>
<content type='text'>
Add a convenience function to access the private data that a uclass stores
for each of its devices. Convert over most existing uses for consistency
and to provide an example for others.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a convenience function to access the private data that a uclass stores
for each of its devices. Convert over most existing uses for consistency
and to provide an example for others.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>linux/kernel.h: sync min, max, min3, max3 macros with Linux</title>
<updated>2014-11-23T11:48:30+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.m@jp.panasonic.com</email>
</author>
<published>2014-11-06T18:03:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b41411954d4ccf6ddaa581178462017557b82b5d'/>
<id>b41411954d4ccf6ddaa581178462017557b82b5d</id>
<content type='text'>
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada &lt;yamada.m@jp.panasonic.com&gt;
Acked-by: Pavel Machek &lt;pavel@denx.de&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada &lt;yamada.m@jp.panasonic.com&gt;
Acked-by: Pavel Machek &lt;pavel@denx.de&gt;
Acked-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Tested-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini &lt;trini@ti.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
