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>
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>
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>
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.
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>
Joe Hershberger [Fri, 17 Aug 2012 20:36:40 +0000 (15:36 -0500)]
cfi: Check for blank before erase
Added an optional check in the CFI driver to evaluate if the sector is
already blank before issuing an erase command. Improves erase time by
over a factor of 10 if already blank.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Stefan Roese <sr@denx.de>
Since commit 50a47d0523e8efebe912bef539a77ffd42116451
(net: punt bd->bi_ip_addr) booting old 2.4.x ppc kernels
is broken due to changed offsets of the fields in struct bd_t.
Offsets of the fields after removed bi_ip_addr are wrong,
causing wrong bus clocks and console baudrate configurations
and various other issues. Re-add the bi_ip_addr field to preserve
backward compatibility with older ppc kernels. Setting bi_ip_addr
in board.c is not really needed, grepping in the 2.4 linux tree
shows that bi_ip_addr is not accessed there. Adding bi_ip_addr
to struct bd_t for other arches isn't needed it seems. bd_t is
not used by other arches in the 2.4 linux tree.
Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Wolfgang Denk <wd@denx.de>
Joe Hershberger [Fri, 17 Aug 2012 10:26:30 +0000 (10:26 +0000)]
hush: Don't parse the contents of a dereferenced var
When a variable which contains a user-supplied value is dereferenced
(e.g. to be echo'ed), make sure that the value is not further parsed
by hush.
Set the hush local variable "HUSH_NO_EVAL=1" to enable this behavior.
Without this patch, a sequence like this occurs:
Panda # env set my_user_string Bob\'s favorite device
Panda # print my_user_string
my_user_string=Bob's favorite device
Panda # echo $my_user_string
syntax error hush.c:3007
With this patch, it looks like this:
Panda # HUSH_NO_EVAL=1
Panda # env set my_user_string Bob\'s favorite device
Panda # print my_user_string
my_user_string=Bob's favorite device
Panda # echo $my_user_string
Bob's favorite device
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger [Fri, 17 Aug 2012 10:26:29 +0000 (10:26 +0000)]
hush: Add default value substitution support
Use standard sh syntax:
${VAR:-default}
Use default value: if VAR is set and non-null, expands to $VAR.
Otherwise, expands to default.
${VAR:=default}
Set default value: if VAR is set and non-null, expands to $VAR.
Otherwise, sets hush VAR to default and expands to default.
${VAR:+default}
If VAR is set and non-null, expands to the empty string.
Otherwise, expands to default.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Marek Vasut [Wed, 8 Aug 2012 01:42:17 +0000 (01:42 +0000)]
dm: Initial import of design documents
This patch contains UDM-design.txt, which is document containing
general description of the driver model. The remaining files contains
descriptions of conversion process of particular subsystems.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Stephan Linz [Thu, 2 Aug 2012 10:49:24 +0000 (10:49 +0000)]
input: key_matrix: fix header inclusion
On Microblaze with device tree support enabled we run into
the error below.
I'm not sure, but I think that all source code should include
at least the common.h and just this fix the problem on
Microblaz architecture.
The error is:
In file included from key_matrix.c:29:
include/malloc.h:364: error: conflicting types for 'memset'
include/linux/string.h:71: error: previous declaration of 'memset' was here
include/malloc.h:365: error: conflicting types for 'memcpy'
include/linux/string.h:74: error: previous declaration of 'memcpy' was here
Signed-off-by: Stephan Linz <linz@li-pro.net> CC: Bernie Thompson <bhthompson@chromium.org> CC: Simon Glass <sjg@chromium.org> CC: Tom Warren <twarren@nvidia.com> CC: Michal Simek <monstr@monstr.eu> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Michal Simek <monstr@monstr.eu>
This driver uses the century bit of this RTC in the opposite way Linux does.
From Linux's rtc-pcf8563.c:
/*
* The meaning of MO_C bit varies by the chip type.
* From PCF8563 datasheet: this bit is toggled when the years
* register overflows from 99 to 00
* 0 indicates the century is 20xx
* 1 indicates the century is 19xx
* From RTC8564 datasheet: this bit indicates change of
* century. When the year digit data overflows from 99 to 00,
* this bit is set. By presetting it to 0 while still in the
* 20th century, it will be set in year 2000, ...
* There seems no reliable way to know how the system use this
* bit. So let's do it heuristically, assuming we are live in
* 1970...2069.
*/
As U-Boot's PCF8563 driver does not say it is supposed to support the RTC8564,
make this driver compatible with Linux's by giving the opposite meaning to the
century bit.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
Add a buffer bouncing mechanism to get_cluster. This can be useful
for misaligned applicative buffers passed through get_contents.
This is required for the following patches in the case of data
aligned differently relatively to buffers and clusters.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
With the previous code, the remaining prefetched sectors were read
again after each sector. With this patch, each sector is read only
once, thus making the prefetch useful.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
wait_ticks() calls get_ticks() without building a back chain which
makes gdb unhappy when doing back trace. This can also cause
improper memory accesses.
Wolfgang Denk [Sun, 2 Sep 2012 14:38:48 +0000 (16:38 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
MUSB driver: Timeout is never detected as the while loop does not end
usb: fix ulpi_set_vbus prototype
pxa25x: Add UDC registers definitions
USB: Fix strict aliasing in ohci-hcd
usb: Optimize USB storage read/write
ehci: Optimize qTD allocations
usb_stor_BBB_transport: Do not delay when not required
usb_storage: Remove EHCI constraints
usb_storage: Restore non-EHCI support
ehci-hcd: Boost transfer speed
ehci: cosmetic: Define used constants
ehci: Fail for multi-transaction interrupt transfers
arm:trats: Enable g_dnl composite USB gadget with embedded DFU function on TRATS
arm:trats: Support for USB UDC driver at TRATS board.
dfu:cmd: Support for DFU u-boot command
dfu: MMC specific routines for DFU operation
dfu: DFU backend implementation
dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
dfu:usb: Support for g_dnl composite download gadget.
ehci: cosmetic: Define the number of qt_buffers
Otavio Salvador [Mon, 13 Aug 2012 10:08:22 +0000 (10:08 +0000)]
patman: Allow for changelog use in first version of a series
When a patchset had a RFC series, a v1 might have a changelog of
changes done since the RFC. The patch changes the range checked for
changelog and allow it to start for version 1.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Simon Glass <sjg@chromium.org>
Ilya Yanok [Mon, 6 Aug 2012 23:46:08 +0000 (23:46 +0000)]
patman: don't mess with signoffs
Currently patman assumes that there should be only one Signoff line
and this is obviously incorrect: we often have to work with patches
containing other people signoffs. Moreover, it's really desirable
to preserve the comments between signoffs.
So until some sophisticated signoff processing will be developed I
suggest just don't mess with signoffs at all and treat them like
plain text lines. The only drawback I've found so far is the case
where you have a patch with someones else signoff but not yours and
also have to patman tags under signoff line. In this case you will
get extra empty line between signoffs.
Ilya Yanok [Mon, 6 Aug 2012 23:46:07 +0000 (23:46 +0000)]
patman: don't mess with changelog
Don't try to sort and uniq changelog entries as this breaks
multiline entries. It will be better to add some real multi-line
support but for now just preserve the entries as is.
Ilya Yanok [Mon, 6 Aug 2012 23:46:05 +0000 (23:46 +0000)]
patman: fix end of changes detection
Changes may end in '---' line or Signoff line (generated by
git format-patch) in case of Series-changes: lines being
the last ones in commit message. So detect it properly.
Andrew Sharp [Wed, 29 Aug 2012 14:16:32 +0000 (14:16 +0000)]
pci: add CONFIG_PCI_ENUM_ONLY for platforms that don't need PCI setup done
Introduce CONFIG_PCI_ENUM_ONLY variable for platforms that just want a
quick enumberation of the PCI devices, but don't need any setup work done.
This is very beneficial on platforms that have u-boot loaded by another
boot loader which does a more sophisticated job of setup of PCI devices
than u-boot. That way, u-boot can just read what's there and get on
with life. This is what SeaBIOS does.
Andrew Sharp [Wed, 29 Aug 2012 14:16:30 +0000 (14:16 +0000)]
pci: minor cleanup of CONFIG_PCI_PNP usage
Refactor the common PCI code just a tiny bit surrounding the PCI_PNP
(pciauto) stuff. Makes the code a tiny bit easier to read, and also
makes it more obvious that almost no platform needs to setup or use the
pci_config_table stuff.
Andrew Sharp [Wed, 29 Aug 2012 14:16:29 +0000 (14:16 +0000)]
pci: clean up some whitespace and formatting
I tried to clean up the white space and formatting offenses and
inconsistencies in the generic PCI code that obviously has been around for
some time. Emphasis on large increases in readability and maintainability
and consistency. I omitted the platform/processor specific files in
the drivers/pci directory because I wanted to leave those file to those
that care more about them.
Andrew Sharp [Wed, 1 Aug 2012 12:27:16 +0000 (12:27 +0000)]
pci: fix errant data types and corresponding access functions
In a couple of places, unsigned int and pci_config_*_dword were being
used when u16 and _word should be used. Unsigned int was also being
used in a couple of places that should be pci_addr_t.
Wolfgang Denk [Sat, 1 Sep 2012 22:44:09 +0000 (00:44 +0200)]
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
* 'agust@denx.de' of git://git.denx.de/u-boot-staging:
tx25: Use generic gpio_* calls
config: Always use GNU ld
tools: add kwboot binary to .gitignore file
fdt: Include arch specific gpio.h instead of asm-generic/gpio.h
serial: CONSOLE macro is not used
AVR32's LD script uses a standard location that is now automatically detected by
the main Makefile, so its definition in AVR32's config.mk is now obsolete and
redundant.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Wu, Josh [Thu, 23 Aug 2012 00:05:36 +0000 (00:05 +0000)]
at91: atmel_nand: Update driver to support Programmable Multibit ECC controller
The Programmable Multibit ECC (PMECC) controller is a programmable binary
BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder. This controller
can be used to support both SLC and MLC NAND Flash devices. It supports to
generate ECC to correct 2, 4, 8, 12 or 24 bits of error per sector of data.
To use PMECC in this driver, the user needs to set the PMECC correction
capability, the sector size and ROM lookup table offsets in board config file.
This driver is ported from Linux kernel atmel_nand PMECC patch. The main difference
is in this version it uses registers structure access hardware instead of using macros.
It is tested in 9x5 serial boards.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
[rebase] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Wu, Josh [Thu, 23 Aug 2012 00:05:34 +0000 (00:05 +0000)]
at91: atmel_nand: extract HWECC initialization code into one function: atmel_hw_nand_init_param().
This patch
1. extract the hwecc initialization code into one function. It is a preparation for adding atmel PMECC support.
2. enable CONFIG_SYS_NAND_SELF_INIT. Which make us can configurate the ecc parameters between nand_scan_ident() and nand_scan_tail().
Signed-off-by: Josh Wu <josh.wu@atmel.com>
[fix empty newline at EOF error and move return value check into ifdef] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Bo Shen [Sun, 19 Aug 2012 20:32:22 +0000 (20:32 +0000)]
spi: atmel: add WDRBT bit to avoid receive overrun
The atmel at91sam9x5 series spi has feature to avoid receive overren
Using the patch to enable it
Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Xu, Hong [Tue, 2 Aug 2011 01:05:04 +0000 (01:05 +0000)]
AT91: Small fix on AT91 USART initialization code
Before reset dbgu transmitter, we just wait TXEMPTY to drain the
transmitter register(Just in case). If not doing this, we may sometimes
see several weird characters from DBGU.
A short delay is also added to make sure the new serial settings are
settled.
Signed-off-by: Hong Xu <hong.xu@atmel.com>
[cherry-picked from u-boot-atmel/old-next] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Matej Frančeškin [Thu, 30 Aug 2012 07:24:39 +0000 (09:24 +0200)]
MUSB driver: Timeout is never detected as the while loop does not end
Timeout variable is decremented once more when while condition is not met.
Following "if" does not detect correctly that timeout has occurred.
Because of this bug the "usb start" command on AM335X-EVM board did not detect correctly that USB device was not attached.
timeout = musb_cfg.timeout;
while (timeout--)
if (readb(&musbr->devctl) & MUSB_DEVCTL_HM)
break;
/* if musb core is not in host mode, then return */
if (!timeout)
return -1;
Signed-off-by: Matej Franceskin <Matej.Franceskin@comtrade.com> CC: Marek Vasut <matex@denx.de>?
usb_stor_BBB_transport: Do not delay when not required
There is a 5-ms delay in usb_stor_BBB_transport, which occurs every 10 kiB of
data for fragmented fatload usb, i.e. roughly 500 ms of delay per MiB. This adds
up to quite a bit of delay if you're loading a large ramdisk.
The purpose of this delay should be to debounce the 5-V/100-mA USB power up.
This patch skips the delay if the device has already been queried as ready.
Signed-off-by: Jim Shimer <mgi2475@motorola.com>
Rework following the review:
- Rebase against the latest u-boot-usb master.
- Replace typedef with #define.
- Use the existing flags struct field instead of adding a new field.
- Remove the setter function.
- Remove the typecasts. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Marek Vasut <marex@denx.de> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Cc: Jim Shimer <mgi2475@motorola.com>
This patch takes advantage of the hardware EHCI qTD queuing mechanism to avoid
software and transfer splitting overhead so as to make transfers as fast as
possible.
The only drawback is a call to memalign. However, this is fast compared to the
transfer timings, and the heap size to allocate is small, e.g. 128 kiB in the
worst case for a transfer length of 65535 packets of 512 bytes.
Tested on i.MX25, i.MX35 and i.MX51. In my test conditions, the speed gain was
very significant (several times faster), which is really appreciable when
accessing large files.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Marek Vasut <marex@denx.de> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
ehci: Fail for multi-transaction interrupt transfers
Interrupt transfers requiring several transactions are not supported by
submit_int_msg() because bInterval is ignored. This patch returns a failure code
and prints an error message in this case.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Marek Vasut <marex@denx.de> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Lukasz Majewski [Mon, 6 Aug 2012 12:41:11 +0000 (14:41 +0200)]
arm:trats: Enable g_dnl composite USB gadget with embedded DFU function on TRATS
Enable the g_dnl composite USB gadget driver with embedded DFU function on it.
It now uses the composite gadget framework to support download specific
USB functions (like enabled DFU or USB Mass Storage).
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Minkyu Kang <mk7.kang@samsung.com>