]> git.sur5r.net Git - u-boot/log
u-boot
12 years agonet: Quietly ignore DHCP Option 28 (Broadcast Address)
Brian Rzycki [Tue, 11 Sep 2012 09:22:53 +0000 (09:22 +0000)]
net: Quietly ignore DHCP Option 28 (Broadcast Address)

Some DHCP servers (notably dnsmasq) always transmit DHCP Option 28,
Broadcast Address as specified in RFC 2132. Without this patch u-boot
displays the warning:
  *** Unhandled DHCP Option in OFFER/ACK: 28

The patch suppresses the warning and ignores DHCP Option 28. There is
no environment variable to set the broadcast address into and if for
some reason u-boot needs the broadcast it can be calculated from
ipaddr and netmask.

Signed-off-by: Brian Rzycki <bmr@freescale.com>
12 years agoPXE: FDT: Add support for fdt in PXE
Chander Kashyap [Thu, 6 Sep 2012 19:36:31 +0000 (19:36 +0000)]
PXE: FDT: Add support for fdt in PXE

Now DT support is becoming common for all new SoC's. Hence it is better
to have option for getting specific FDT from the remote server.

This patch adds support for new label i.e. 'fdt'. This will allow to
retrieve 'fdt blob' from the remote server. This patch take care for
the following scenarios.

The usage of fdt is optional.
The 'fdt blob' can be retrieved from tftp or can be available locally
or can be absent.

If 'fdt_addr_r' environment variable is set and 'fdt' label is defined
retrieve 'fdt blob' from tftp. 'fdt_addr_r' is then passed along bootm
command.

If 'fdt_addr' is set and 'fdt blob' is not retrieved from the tftp pass
'fdt_addr' to bootm command. In this case 'fdt blob' will be available
at 'fdt_addr'.

If 'fdt_addr' is not set and 'fdt blob' is not retrieve from tftp pass
NULL to boot command. In this case 'fdt blob' is not required and absent.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
12 years agoFEC: Replace magic contants
Marek Vasut [Wed, 29 Aug 2012 03:49:51 +0000 (03:49 +0000)]
FEC: Replace magic contants

Replace the magic contant 1 << 24 with properly defined bits.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
12 years agoFEC: Rework the TX wait mechanism
Marek Vasut [Wed, 29 Aug 2012 03:49:50 +0000 (03:49 +0000)]
FEC: Rework the TX wait mechanism

The mechanism waiting for transmission to finish in fec_send() now
relies on the E-bit being cleared in the TX buffer descriptor. In
case of data cache being on, this means invalidation of data cache
above this TX buffer descriptor on each test for the E-bit being
cleared.

Apparently, there is another way to check if the transmission did
complete. This is by checking the TDAR bit in the X_DES_ACTIVE
register. Reading a register does not need any data cache invalidation,
which is beneficial.

Rework the sequence that wait for completion of the transmission so that
the TDAR bit is tested first and afterwards check the E-bit being clear.
This cuts down the number of cache invalidation calls to one.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
12 years agoFEC: Remove endless loop in the FEC driver
Marek Vasut [Wed, 29 Aug 2012 03:49:49 +0000 (03:49 +0000)]
FEC: Remove endless loop in the FEC driver

The FEC hardware sometimes errors out on data transfer and hangs in
the tightloop adjusted by this patch. So add timeout into the tightloop
to make such a hang recoverable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
12 years agoFEC: Properly align address over the buffers for cache ops
Marek Vasut [Sun, 26 Aug 2012 10:19:21 +0000 (10:19 +0000)]
FEC: Properly align address over the buffers for cache ops

Align the address that's to be invalidated/flushed properly.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benoit Thebaudeau <benoit.thebaudeau@advans>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
12 years agoFEC: Do not pass unaligned buffer to network stack
Marek Vasut [Sun, 26 Aug 2012 10:19:20 +0000 (10:19 +0000)]
FEC: Do not pass unaligned buffer to network stack

Do not pass unaligned RX buffer to the upper layers. The upper layer,
especially in the ARP case, recycles the buffer and passes it back into
the FEC, into it's TX path. With caches enabled, the FEC hangs on this
from time to time.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benoit Thebaudeau <benoit.thebaudeau@advans>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
12 years agonet: Add Vitesse VSC8662 PHY support
Priyanka Jain [Fri, 17 Aug 2012 08:28:56 +0000 (08:28 +0000)]
net: Add Vitesse VSC8662 PHY support

-VSC8662 is Dual Port 10/100/1000Base-T Phy,
 100Base-FX/1000/Base-X Gigabit Ethernt Transceiver Phy.

-Its register set and features are similar to
 other Vitesse Phys

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
12 years agonet/phy: support the mv88e6352 switch
Valentin Longchamp [Thu, 16 Aug 2012 01:17:26 +0000 (01:17 +0000)]
net/phy: support the mv88e6352 switch

This patch add support for the configuration of an external switch from
the 88E6xxx series from Marvell trough an MDIO link using indirect
adressing. This can be used if we do not want to use an EEPROM for the
configuration.

This driver is not generic and was not tested on other switches than the
88e6352. This is proposed as a first implementation that is somewhat
limited but works and that can be used as a basis for further
developments for this switch family.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Joe Hershberger <joe.hershberger@gmail.com>

12 years agonet: eth_write_hwaddr: Return error for invalid MACs
Benoît Thébaudeau [Fri, 10 Aug 2012 07:56:21 +0000 (07:56 +0000)]
net: eth_write_hwaddr: Return error for invalid MACs

If dev->enetaddr was supposed to be set with dev->write_hwaddr() but the MAC
address was not valid, return an error.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Add driver for Zynq Gem IP
Michal Simek [Thu, 13 Sep 2012 20:23:34 +0000 (20:23 +0000)]
net: Add driver for Zynq Gem IP

Device driver for Zynq Gem IP.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
CC: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
12 years agonet: asix: add AX88772B support
Lucas Stach [Wed, 22 Aug 2012 11:05:01 +0000 (11:05 +0000)]
net: asix: add AX88772B support

Add AX88772B ID together with two fixes needed to make this work.

1. The packet length check has to be adjusted, as all ASIX chips
only use 11 bits to indicate the length. AX88772B uses the other
bits to indicate unrelated things, which cause the check to fail.
This fix is based on a fix for the Linux kernel by Marek Vasut.
Linux upstream commit: bca0beb9363f8487ac902931a50eb00180a2d14a

2. AX88772B provides several bulk endpoints. Only the first
IN/OUT endpoints work in the default configuration. So stop
enumeration after we found them to avoid overwriting the
endpoint config with a non-working one.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: asix: add read_mac function
Lucas Stach [Wed, 22 Aug 2012 11:05:00 +0000 (11:05 +0000)]
net: asix: add read_mac function

Initial device MAC should be read while getting info about the
device, so it's wrong to only read it in asix_init().

Add a dedicated function to read the initial MAC, which is also
able to handle devices that have their initial MAC stored in
EEPROM. Call this function inasix_eth_get_info().

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: asix: add write_hwaddr function
Lucas Stach [Wed, 22 Aug 2012 11:04:59 +0000 (11:04 +0000)]
net: asix: add write_hwaddr function

All ASIX chipsets aside from AX88172 are able to set the MAC
address on the hardware level. Add a function to expose this
ability.

To differentiate between chip types we now carry flags as driver
private data. Also while touching the asix_dongles array
constify this.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: asix: split out basic reset function
Lucas Stach [Wed, 22 Aug 2012 11:04:58 +0000 (11:04 +0000)]
net: asix: split out basic reset function

The basic device reset ensures that the device is ready to
service commands and does not need to get redone before each
network operation.

Split out the basic reset from asix_init() and instead call it
from asix_eth_get_info(), so that it only gets called once.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: introduce transparent driver private in ueth_data
Lucas Stach [Wed, 22 Aug 2012 11:04:57 +0000 (11:04 +0000)]
net: introduce transparent driver private in ueth_data

Avoid clutter in ueth_data. Individual drivers should not mess
with structures belonging to the core like this.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Filter incoming netconsole packets by IP
Joe Hershberger [Tue, 18 Sep 2012 10:01:32 +0000 (10:01 +0000)]
net: Filter incoming netconsole packets by IP

Check the incoming packets' source IP address... if ncip isn't set to a
broadcast address, only listen to the client at ncip.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Allow netconsole settings to change after nc_start
Joe Hershberger [Tue, 18 Sep 2012 10:01:31 +0000 (10:01 +0000)]
net: Allow netconsole settings to change after nc_start

Refresh the netconsole settings from the env before each packet instead
of only on netconsole init.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Improve the speed of netconsole
Joe Hershberger [Fri, 3 Aug 2012 10:59:08 +0000 (10:59 +0000)]
net: Improve the speed of netconsole

Previously u-boot would initialize the network interface for every
network operation and then shut it down again.  This makes sense for
most operations where the network in not known to be needed soon after
the operation is complete.  In the case of netconsole, it will use the
network for every interaction with the shell or every printf.  This
means that the network is being reinitialized very often.  On many
devices, this intialization is very slow.

This patch checks for consecutive netconsole actions and leaves the
ethernet hardware initialized between them.  It will still behave the
same old way for all other network operations and any time another
network operation happens between netconsole operations.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Stefano Babic <sbabic@denx.de>
Acked-by: Stefano Babic <sbabic@denx.de>
12 years agonet: Make the netconsole buffer size configurable
Joe Hershberger [Tue, 31 Jul 2012 06:09:17 +0000 (06:09 +0000)]
net: Make the netconsole buffer size configurable

Allow a board to configure a larger buffer for netconsole, but leave
the default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: sh_eth: Add support R8A7740 of rmobile (arm core)
Nobuhiro Iwamatsu [Thu, 2 Aug 2012 22:08:40 +0000 (22:08 +0000)]
net: sh_eth: Add support R8A7740 of rmobile (arm core)

R8A7740 of rmobile has ethernet device, and this is same IP of
sh-ether. This support R8A7740 of rmobile.

Signed-off-by: Hideyuki Sano <hideyuki.sano.dn@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
12 years agodm: net: Fixup the armada100 FEC driver
Marek Vasut [Fri, 27 Jul 2012 09:50:07 +0000 (09:50 +0000)]
dm: net: Fixup the armada100 FEC driver

Apply the following questionable adjustment to silence GCC.

armada100_fec.c: In function ‘armdfec_send’:
armada100_fec.c:589:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
12 years agonet: emaclite: Support OF initialization
Michal Simek [Thu, 28 Jun 2012 21:37:57 +0000 (21:37 +0000)]
net: emaclite: Support OF initialization

Support new CONFIG_OF_CONTROL option where device
probing is done based on device tree description.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodm: net: Move IXP NPE to drivers/net/
Marek Vasut [Sat, 21 Jul 2012 05:02:26 +0000 (05:02 +0000)]
dm: net: Move IXP NPE to drivers/net/

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bryan Hundven <bryanhundven@gmail.com>
Cc: Michael Schwingen <rincewind@discworld.dascon.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: U-Boot DM <u-boot-dm@lists.denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
Tetsuyuki Kobayashi [Mon, 25 Jun 2012 02:37:27 +0000 (02:37 +0000)]
net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000

NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
12 years agoapi: net: fix length check in eth_receive()
Michael Walle [Fri, 22 Jun 2012 11:24:28 +0000 (11:24 +0000)]
api: net: fix length check in eth_receive()

If the requested length is too small to hold the received packet,
eth_receive() will return -1 and will leave the packet in the receive
buffers. Instead of returning an error in this case, we return the first
portion of the received packet and remove it from the receive buffers.

This fixes FreeBSD's ubldr. Without this patch it will just stop receiving
packets if the NIC receives more than PKTBUFSRX too large packets.

Signed-off-by: Michael Walle <michael@walle.cc>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Rafal Jaworowski <raj@semihalf.com>
Cc: Piotr Kruszynski <ppk@semihalf.com>
12 years agonet: Make netconsole src and dest ports configurable
Joe Hershberger [Tue, 31 Jul 2012 06:06:41 +0000 (06:06 +0000)]
net: Make netconsole src and dest ports configurable

It is desirable to use different port numbers for sending and receiving
packets with netconsole in the case where you have more than one device
on the local subnet with netconsole enabled for broadcast.  When they
use the same port for both, any output from one will look like input to
the other.  This is typlically not desirable.

This patch allows the input and output ports to be specified separately
in the environment.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agoPrepare v2012.10-rc1 v2012.10-rc1
Tom Rini [Sat, 22 Sep 2012 00:18:28 +0000 (17:18 -0700)]
Prepare v2012.10-rc1

Signed-off-by: Tom Rini <trini@ti.com>
12 years agoMerge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
Tom Rini [Fri, 21 Sep 2012 23:22:18 +0000 (16:22 -0700)]
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging

12 years agopci: fix some warnings related to assumptions about
Kumar Gala [Wed, 19 Sep 2012 04:47:36 +0000 (04:47 +0000)]
pci: fix some warnings related to assumptions about

The following commit introduced some warnings associated with using
pci_addr_t instead of a proper 32-bit data type.

commit af778c6d9e2b945ee03cbc53bb976238a3374f33
Author: Andrew Sharp <andywyse6@gmail.com>
Date:   Wed Aug 1 12:27:16 2012 +0000

    pci: fix errant data types and corresponding access functions

On some platforms pci_addr_t is defined as a 64-bit data type so its not
proper to use with pci_{read,write}_config_dword.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-arm
Tom Rini [Fri, 21 Sep 2012 21:53:13 +0000 (14:53 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-arm

12 years agofdt: Add header guard to fdtdec.h
Simon Glass [Thu, 12 Jul 2012 05:25:02 +0000 (05:25 +0000)]
fdt: Add header guard to fdtdec.h

This makes it easier to include this header from other headers.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agofdt: Tidy debugging, add to fdtdec_get_int/addr()
Simon Glass [Thu, 12 Jul 2012 05:25:01 +0000 (05:25 +0000)]
fdt: Tidy debugging, add to fdtdec_get_int/addr()

The new debugging shows the value of integers and addresses read
from the device tree and tidy up GPIO output.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 years agoAdd gpio_request() to asm-generic header
Simon Glass [Wed, 13 Jun 2012 06:19:37 +0000 (06:19 +0000)]
Add gpio_request() to asm-generic header

This function should also be part of the GPIO API, so add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Fri, 21 Sep 2012 16:29:38 +0000 (09:29 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

12 years agoRevert "memsize: Fix for bug in memory sizing code"
Tom Rini [Fri, 21 Sep 2012 15:14:05 +0000 (08:14 -0700)]
Revert "memsize: Fix for bug in memory sizing code"

After further investigation this change is not correct and results in
get_ram_size returning incorrectly large values.  Reported first by
Gerlando Falauto.

This reverts commit b8496cced856ff411f1eb2e4eff20f5abe7080b0.

Signed-off-by: Tom Rini <trini@ti.com>
12 years agoMerge remote-tracking branch 'u-boot-imx/master'
Albert ARIBAUD [Thu, 20 Sep 2012 22:26:19 +0000 (00:26 +0200)]
Merge remote-tracking branch 'u-boot-imx/master'

12 years agousb: do explicit unaligned accesses
Lucas Stach [Thu, 6 Sep 2012 06:00:13 +0000 (08:00 +0200)]
usb: do explicit unaligned accesses

usb_hub_descriptor has to be packed as it's used for
communication with the device. Member wHubCharacteristics
violates the natural alignment rules.

Use explicit unaligned access functions for this member.
Fixes ARMv7 traping while using USB.

v2: fix typo found by Thomas Langer

v3: rebased on top of u-boot-usb/master

Signed-off-by: Lucas Stach <dev@lynxeye.de>
12 years agodfu:usb:fix: Read the "filesize" environment variable only when file read
Łukasz Majewski [Thu, 23 Aug 2012 23:33:56 +0000 (23:33 +0000)]
dfu:usb:fix: Read the "filesize" environment variable only when file read

The "filesize" environment variable shall be read only when relevant
file is read.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agodfu:usb: Support for ext4
Łukasz Majewski [Thu, 23 Aug 2012 23:33:55 +0000 (23:33 +0000)]
dfu:usb: Support for ext4

Support for ext4 file system handling at DFU.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoMerge branch 'ext4'
Tom Rini [Thu, 20 Sep 2012 18:27:35 +0000 (11:27 -0700)]
Merge branch 'ext4'

Update Makefile change for LIBS -> LIBS-y change.

Conflicts:
Makefile

Signed-off-by: Tom Rini <trini@ti.com>
12 years agoext4: cache-align buffers so the invalidation works
Stephen Warren [Tue, 18 Sep 2012 08:05:28 +0000 (08:05 +0000)]
ext4: cache-align buffers so the invalidation works

DMA buffer cache invalidation requires that buffers have cache-aligned
buffer locations and sizes. Use memalign() and ALLOC_CACHE_ALIGN_BUFFER()
to ensure this.

On Tegra at least, without this fix, the following fail commands fail in
u-boot-master/ext4, but succeeded at the branch's branch point in
u-boot/master. With this fix, the commands work again:

ext2ls mmc 0:1 /
ext2load mmc 0:1 /boot/zImage

Cc: Uma Shankar <uma.shankar@samsung.com>
Cc: Manjunatha C Achar <a.manjunatha@samsung.com>
Cc: Iqbal Shareef <iqbal.ams@samsung.com>
Cc: Hakgoo Lee <goodguy.lee@samsung.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
12 years agoFlex bus definition update for Coldfire 5253.
Jason Jin [Thu, 20 Sep 2012 06:17:46 +0000 (14:17 +0800)]
Flex bus definition update for Coldfire 5253.

originally work by Jate Sujjavanich <jsujjavanich@syntech-fuelmaster.com>
----
The defines in arch/m68k/include/coldfire/flexbus.h are not compatible with
the 5235 processor. The registers in struct fbcs are different sizes from
those in the 5235. Also, the defines are a little different.

This is what I have so far. Comments?
----

Reformat the patch manually by Jason Jin

Signed-off-by: Jate Sujjavanich <jsujjavanich@syntech-fuelmaster.com>
Signed-off-by: Jason Jin <Jason.jin@freescale.com>
12 years agoColdFire: Queued SPI driver
Richard Retanubun [Thu, 24 Mar 2011 08:58:11 +0000 (08:58 +0000)]
ColdFire: Queued SPI driver

This patch adds a driver for Freescale Colfire Queued SPI bus.
Coded to work with 8 bits per transfer to use with SPI flash.
CPOL, CPHA, and CS_ACTIVE_HIGH can be configured.

Tested with MCF5270 which have 4 chip selects.

Activate by #define CONFIG_CF_QSPI in board config.

Signed-off-by: Richard Retanubun <richardretanubun@ruggedcom.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF54451 and MCF54455
Alison Wang [Mon, 26 Mar 2012 21:49:08 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF54451 and MCF54455

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF547x and MCF548x
Alison Wang [Mon, 26 Mar 2012 21:49:07 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF547x and MCF548x

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF523x
Alison Wang [Mon, 26 Mar 2012 21:49:06 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF523x

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF532x/MCF537x/MCF5301x
Alison Wang [Mon, 26 Mar 2012 21:49:05 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF532x/MCF537x/MCF5301x

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF52x2
Alison Wang [Mon, 26 Mar 2012 21:49:04 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF52x2

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Clean up checkpatch warnings for MCF5227x
Alison Wang [Mon, 26 Mar 2012 21:49:03 +0000 (21:49 +0000)]
ColdFire: Clean up checkpatch warnings for MCF5227x

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Add clear and set bits macros for ColdFire platform
Alison Wang [Mon, 26 Mar 2012 21:49:02 +0000 (21:49 +0000)]
ColdFire: Add clear and set bits macros for ColdFire platform

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Update the bitops for ColdFire platform
Alison Wang [Sun, 25 Mar 2012 19:18:49 +0000 (19:18 +0000)]
ColdFire: Update the bitops for ColdFire platform

This patch uses the general ffs definition to replace the
platform ffs definition.

This patch also fixes the build error by adding hweightN
definition for m5329evb and m5373evb.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoColdFire: Rename NANDFLASH_SIZE into CONFIG_NANDFLASH_SIZE for MCF537x
Alison Wang [Sun, 25 Mar 2012 19:18:14 +0000 (19:18 +0000)]
ColdFire: Rename NANDFLASH_SIZE into CONFIG_NANDFLASH_SIZE for MCF537x

This patch fixes the build error for MCF537x. As the NANDFLASH_SIZE is
redefined in boards.cfg, it is needed to rename NANDFLASH_SIZE into
CONFIG_NANDFLASH_SIZE in include/configs/M5373EVB.h.

Signed-off-by: Alison Wang <b18965@freescale.com>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-mpc83xx
Tom Rini [Tue, 18 Sep 2012 21:56:31 +0000 (14:56 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx

12 years agompc8308rdb: add support for eSDHC MMC controller
Ira W. Snyder [Wed, 12 Sep 2012 21:17:35 +0000 (14:17 -0700)]
mpc8308rdb: add support for eSDHC MMC controller

Add support for the onboard eSDHC MMC controller. The hardware on the
MPC8308RDB has the following errata:

- ESDHC111: manual asynchronous CMD12 is broken
- DMA is broken (PIO works)

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
[added include fsl_esdhc header to prevent implicit declarations of
fsl_esdhc_mmc_init() and fdt_fixup_esdhc()]

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agompc8308rdb: add support for FIT images
Ira W. Snyder [Wed, 12 Sep 2012 21:17:34 +0000 (14:17 -0700)]
mpc8308rdb: add support for FIT images

This is very useful on a modern system.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agompc8308rdb: add support for Spansion SPI flash on header J8
Ira W. Snyder [Wed, 12 Sep 2012 21:17:32 +0000 (14:17 -0700)]
mpc8308rdb: add support for Spansion SPI flash on header J8

The SPI pins are routed to header J8 for testing SPI functionality. A
Spansion flash has been wired up and tested on this header.

This patch breaks support for the second TSEC interface, since the GPIO
pin used as a chip select is pinmuxed with some of the TSEC pins.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agompc8xxx_spi: fix SPI support on MPC8308RDB
Ira W. Snyder [Wed, 12 Sep 2012 21:17:31 +0000 (14:17 -0700)]
mpc8xxx_spi: fix SPI support on MPC8308RDB

The MPC8308RDB Reference Manual states that no bits in the SPMODE
register are allowed to change while the enable (EN) bit is set.

This driver changes the character length bits (LEN) while the enable
(EN) bit is set. Clearing the EN bit while changing the LEN bits makes
the driver work correctly on MPC8308RDB.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agoFAT: Fix file contents listed as directory
Benoît Thébaudeau [Fri, 20 Jul 2012 03:20:29 +0000 (03:20 +0000)]
FAT: Fix file contents listed as directory

With:
fatls mmc 0 /dir/file
dir: regular directory
file: regular file

The previous code read the contents of file as if it were directory entries to
list. This patch refuses to list file contents as if it were a folder.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
12 years agoenv: delete selected vars not present in imported env
Gerlando Falauto [Sun, 26 Aug 2012 21:53:00 +0000 (21:53 +0000)]
env: delete selected vars not present in imported env

When variables explicitly specified on the command line are not present
in the imported env, delete them from the running env.
If the variable is also missing from the running env, issue a warning.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoenv: make "env default" selective, check and apply
Gerlando Falauto [Fri, 24 Aug 2012 00:11:41 +0000 (00:11 +0000)]
env: make "env default" selective, check and apply

Change the syntax (user API) for "env default":
  -f: override write-once variables
  var... : accept individual variable(s)
  -a: all (resetting the whole env is NOT the default behavior)

Enable variable checking and make changes effective by
enabling do_apply argument to himport_r().

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
12 years agoenv: check and apply changes on delete/destroy
Gerlando Falauto [Fri, 24 Aug 2012 00:11:40 +0000 (00:11 +0000)]
env: check and apply changes on delete/destroy

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoenv: add check/apply logic to himport_r()
Gerlando Falauto [Fri, 24 Aug 2012 00:11:39 +0000 (00:11 +0000)]
env: add check/apply logic to himport_r()

Change hashtable so that a callback function will decide whether a
variable can be overwritten, and possibly apply the changes.

So add a new field to struct hsearch_data:

 o "apply" callback function to check whether a variable can be
    overwritten, and possibly immediately apply the changes;
    when NULL, no check is performed.

And a new argument to himport_r():
 o "do_apply": whether to call the apply callback function

NOTE: This patch does not change the current behavior.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoenv: make himport_r() selective on variables
Gerlando Falauto [Fri, 24 Aug 2012 00:11:38 +0000 (00:11 +0000)]
env: make himport_r() selective on variables

Add 2 new arguments to himport_r():

 o "nvars", "vars": number and list of variables to take into account
   (0 means ALL)

NOTE: This patch does not change the current behaviour.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoenv: unify logic to check and apply changes
Gerlando Falauto [Fri, 24 Aug 2012 00:11:37 +0000 (00:11 +0000)]
env: unify logic to check and apply changes

The logic of checking special parameters (e.g. baudrate, stdin, stdout,
for a valid value and/or whether can be overwritten) and applying the
new value to the running system is now all within a single function
env_check_apply() which can be called whenever changes are made
to the environment, no matter if by set, default or import.

With this patch env_check_apply() is only called by "env set",
retaining previous behavior.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agoenv: cosmetic: drop assignment i = iomux_doenv()
Gerlando Falauto [Fri, 24 Aug 2012 00:11:36 +0000 (00:11 +0000)]
env: cosmetic: drop assignment i = iomux_doenv()

iomux_doenv() can only return 0 or 1.
So there is no need to save its return value in variable i, as checking
its truth value within an if statement is enough.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Reviewed-by: Marek Vasut <marex@denx.de>
12 years agofw_env: Add env vars describing U-Boot target board
Benoît Thébaudeau [Fri, 10 Aug 2012 07:45:15 +0000 (07:45 +0000)]
fw_env: Add env vars describing U-Boot target board

Commit 5e724ca did the same thing for env_common and env_embedded, but forgot
fw_env.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
12 years agoenv_common: Add missing ethprime
Benoît Thébaudeau [Fri, 10 Aug 2012 07:45:31 +0000 (07:45 +0000)]
env_common: Add missing ethprime

The ethprime env var was missing from env_common.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
12 years agoenv import/export: Remove from help if disabled
Benoît Thébaudeau [Fri, 10 Aug 2012 07:45:44 +0000 (07:45 +0000)]
env import/export: Remove from help if disabled

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agomemsize: Fix for bug in memory sizing code
Iwo Mergler [Sun, 9 Sep 2012 20:16:58 +0000 (20:16 +0000)]
memsize: Fix for bug in memory sizing code

The original memory sizing code in get_ram_size clobbers the word
at the base address, but forgets to restore it.

Signed-off-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com>
12 years agoenv_nand: fix incorrect size parameter to ALLOC_CACHE_ALIGN_BUFFER
Stephen Warren [Fri, 7 Sep 2012 09:15:33 +0000 (09:15 +0000)]
env_nand: fix incorrect size parameter to ALLOC_CACHE_ALIGN_BUFFER

The third parameter to ALLOC_CACHE_ALIGN_BUFFER is not size (as named),
but rather count (number of elements of the type to allocate). The
current code ends up allocating one copy of env_t for each byte in its
size, which quite possibly ends up overflowing RAM.

This fixes a bug in commit 3801a15 "env_nand: align NAND buffers".

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reported-by: Prabhakar Lad <prabhakar.lad@ti.com>
12 years agoARM: Remove apollon board
Marek Vasut [Wed, 5 Sep 2012 17:16:55 +0000 (17:16 +0000)]
ARM: Remove apollon board

This board is the only board that still sticks to OneNAND IPL.
Remove this board, since we have SPL around for a while and
OneNAND is well supported in the SPL framework. The board can
be revived if necessary.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tom Rini <trini@ti.com>
12 years agoIPL: Remove remains of OneNAND IPL
Marek Vasut [Wed, 5 Sep 2012 17:09:08 +0000 (17:09 +0000)]
IPL: Remove remains of OneNAND IPL

After removing the Apollon board, remove the OneNAND IPL too.
There are no users for it any more.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Minkyu Kang <promsoft@gmail.com>
Cc: Tom Rini <trini@ti.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
12 years agospl: remove forced linking of commands into SPL
Tyler Olmstead [Wed, 8 Aug 2012 16:24:13 +0000 (16:24 +0000)]
spl: remove forced linking of commands into SPL

Remove linker command line options from the SPL makefile
that force the inclusion of unreferenced command code from
linked object files. As commands are not used in the SPL,
these options resulted in an unnecessary increase in the
image size, in addition to introducing the possibility of
tricky link errors in the case where the command code
contained symbols that were not resolved by linking in the
limited objects compiled in the SPL build.

Signed-off-by: Tyler Olmstead <tyler.j.olmstead@gmail.com>
Acked-by: Tom Rini <trini@ti.com>
12 years agodm: sparc: Fixup the compile warnings in sparc code
Marek Vasut [Fri, 27 Jul 2012 08:04:34 +0000 (08:04 +0000)]
dm: sparc: Fixup the compile warnings in sparc code

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: u-boot-dm@lists.denx.de
12 years agodm: sparc: common: Fixup cmd_bdinfo warnings
Marek Vasut [Fri, 27 Jul 2012 08:04:33 +0000 (08:04 +0000)]
dm: sparc: common: Fixup cmd_bdinfo warnings

cmd_bdinfo.c: In function ‘do_bdinfo’:
cmd_bdinfo.c:220:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:222:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:224:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:226:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:228:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: u-boot-dm@lists.denx.de
12 years agodm: sparc: net: Fixup greth compile warnings
Marek Vasut [Fri, 27 Jul 2012 08:04:32 +0000 (08:04 +0000)]
dm: sparc: net: Fixup greth compile warnings

greth.c: In function ‘greth_recv’:
greth.c:507:3: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat]
greth.c:507:3: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat]
greth.c:541:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
greth.c: In function ‘greth_initialize’:
greth.c:623:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘struct greth_regs *’ [-Wformat]
greth.c:655:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘struct greth_regs *’ [-Wformat]
greth.c:684:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘struct greth_regs *’ [-Wformat]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: u-boot-dm@lists.denx.de
12 years agomxc nand: Fix warning on !MXC_NFC_V2_1
Tom Rini [Tue, 18 Sep 2012 16:24:22 +0000 (09:24 -0700)]
mxc nand: Fix warning on !MXC_NFC_V2_1

In board_nand_init() we only need the 'tmp' variable if MXC_NFC_V2_1 is
defined.

Signed-off-by: Tom Rini <trini@ti.com>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-nand-flash
Tom Rini [Tue, 18 Sep 2012 14:55:07 +0000 (07:55 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-nand-flash

12 years agomxc nand: Homogenize IP revisions with Linux
Benoît Thébaudeau [Mon, 13 Aug 2012 20:50:53 +0000 (22:50 +0200)]
mxc nand: Homogenize IP revisions with Linux

Use the same IP revisions as in Linux in order to make the comparison more
clear.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomxc nand: Let driver detect IP revision
Benoît Thébaudeau [Mon, 13 Aug 2012 20:50:42 +0000 (22:50 +0200)]
mxc nand: Let driver detect IP revision

There is no reason to have board configs to select the NFC IP revision. Just let
the driver detect it. BTW, remove broken NFC IP revision configs from board
config files.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomtd mxc nand: Merge init functions
Benoît Thébaudeau [Mon, 13 Aug 2012 20:50:30 +0000 (22:50 +0200)]
mtd mxc nand: Merge init functions

Merge mxc_setup_config1() into board_nand_init() in order to ease the addition
of i.MX5 support in the following patches.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomtd mxc nand: Fix ECC state after read_page_raw_syndrome()
Benoît Thébaudeau [Mon, 13 Aug 2012 20:50:19 +0000 (22:50 +0200)]
mtd mxc nand: Fix ECC state after read_page_raw_syndrome()

mxc_nand_read_page_raw_syndrome() should reenable ECC upon exit. This fixes ECC
errors left uncorrected after a call to this function.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomtd mxc nand: Use _mxc_nand_enable_hwecc()
Benoît Thébaudeau [Mon, 13 Aug 2012 20:50:07 +0000 (22:50 +0200)]
mtd mxc nand: Use _mxc_nand_enable_hwecc()

Use _mxc_nand_enable_hwecc() instead of duplicating its code.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agospl mxc nand: Fix broken boot for correctable ECC errors
Benoît Thébaudeau [Mon, 13 Aug 2012 20:49:53 +0000 (22:49 +0200)]
spl mxc nand: Fix broken boot for correctable ECC errors

Do not stop boot as soon as an ECC error is detected. Only stop boot for
uncorrectable ECC errors.

This fixes boards no longer booting after some time because a NAND Flash bit has
flipped.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomxc nand: Access all ecc_status_result fields
Benoît Thébaudeau [Mon, 13 Aug 2012 20:49:42 +0000 (22:49 +0200)]
mxc nand: Access all ecc_status_result fields

On the NFC IP 1.1, the 32-bit ecc_status_result value comes from 2
consecutive 16-bit registers. This patch reads all the fields of this value,
which makes a difference for 4-kiB NF pages.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agospl mxc nand: Set symmetric mode
Benoît Thébaudeau [Mon, 13 Aug 2012 20:49:31 +0000 (22:49 +0200)]
spl mxc nand: Set symmetric mode

Set the spl mxc nand driver for IP 1.1 in symmetric mode, like the mtd driver.
In this way, for both drivers, one input clock period of the NFC IP will produce
one R/W cycle.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agospl mxc nand: Remove duplicated code
Benoît Thébaudeau [Mon, 13 Aug 2012 20:49:15 +0000 (22:49 +0200)]
spl mxc nand: Remove duplicated code

The ECC_EN and INT_MSK bits of CONFIG1 are not volatile, so it is sufficient to
set them once in nfc_nand_init().

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agospl mxc nand: Merge duplicated code
Benoît Thébaudeau [Mon, 13 Aug 2012 20:48:56 +0000 (22:48 +0200)]
spl mxc nand: Merge duplicated code

Merge duplicated code into functions, which is better for SPL size too.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomxc nand: cosmectic: Light cleanup
Benoît Thébaudeau [Mon, 13 Aug 2012 20:48:26 +0000 (22:48 +0200)]
mxc nand: cosmectic: Light cleanup

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomxc nand: Merge mtd and spl register definitions
Benoît Thébaudeau [Mon, 13 Aug 2012 20:48:12 +0000 (22:48 +0200)]
mxc nand: Merge mtd and spl register definitions

This patches fixes the TODO to use same register definitions in mtd mxc_nand and
nand_spl fsl nfc drivers.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver
Marek Vasut [Thu, 30 Aug 2012 13:39:38 +0000 (13:39 +0000)]
mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

This is based on Linux kernel -next:

commit 14f44abf1dafc20ba42ce8616a8fc8fbd1b3712b
Author: Brian Norris <computersforpeace@gmail.com>
Date:   Fri Jul 13 09:28:24 2012 -0700

    mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

    The NAND_CHIPOPTIONS_MSK has limited utility and is causing real bugs. It
    silently masks off at least one flag that might be set by the driver
    (NAND_NO_SUBPAGE_WRITE). This breaks the GPMI NAND driver and possibly
    others.

    Really, as long as driver writers exercise a small amount of care with
    NAND_* options, this mask is not necessary at all; it was only here to
    prevent certain options from accidentally being set by the driver. But the
    original thought turns out to be a bad idea occasionally. Thus, kill it.

    Note, this patch fixes some major gpmi-nand breakage.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agonand: Make NAND lock status compatible with Micron
Joe Hershberger [Wed, 22 Aug 2012 21:49:45 +0000 (16:49 -0500)]
nand: Make NAND lock status compatible with Micron

Micron NAND flash (e.g. MT29F4G08ABADAH4) BLOCK LOCK READ STATUS is not
the same as others.  Instead of bit 1 being lock, it is #lock_tight.
To make the driver support either format, ignore bit 1 and use only
bit 0 and bit 2.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agonand: consolidate duplicated constants
Joe Hershberger [Wed, 22 Aug 2012 21:49:44 +0000 (16:49 -0500)]
nand: consolidate duplicated constants

NAND_CMD_ constants for lock/unlock should be in the header

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agonand: Change ulong to loff_t and size_t
Joe Hershberger [Wed, 22 Aug 2012 21:49:43 +0000 (16:49 -0500)]
nand: Change ulong to loff_t and size_t

Missed in previous cleanup.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agonand: Add support for unlock.invert
Joe Hershberger [Wed, 22 Aug 2012 21:49:42 +0000 (16:49 -0500)]
nand: Add support for unlock.invert

NAND unlock command allows an invert bit to be set to unlock all but
the selected page range.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
[scottwood@freescale.com: updated docs and added comment about invert bit]
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agomtd: support ONFI multi lun NAND
Matthieu CASTET [Mon, 19 Mar 2012 14:35:25 +0000 (15:35 +0100)]
mtd: support ONFI multi lun NAND

With onfi a flash is organized into one or more logical units (LUNs).
A logical unit (LUN) is the minimum unit that can independently execute
commands and report status.

Mtd does not exploit LUN, so make it see a big single flash where size is
lun_size * number_of_lun.

Without this patch MT29F8G08ADBDAH4 size is 512MiB instead of 1GiB.

Artem: split long line on 2 shorter ones.

This is commit 637957551c0ac80de8dfc7650d320c5a98c2c0c0 from Linux

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
Acked-by: Florian Fainelli <ffainelli@freebox.fr>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
[scottwood@freescale.com: picked from Linux into U-Boot]
Reported-by: Rafael Beims <rafael.beims@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Mon, 17 Sep 2012 18:39:03 +0000 (11:39 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

12 years agoMerge branch 'master' of git://git.denx.de/u-boot-fdt
Tom Rini [Mon, 17 Sep 2012 18:34:08 +0000 (11:34 -0700)]
Merge branch 'master' of git://git.denx.de/u-boot-fdt

12 years agomx35pdk: README: Remove NAND references
Fabio Estevam [Fri, 14 Sep 2012 12:14:54 +0000 (12:14 +0000)]
mx35pdk: README: Remove NAND references

Booting from NAND is currently not supported, so remove its references.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>