summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2015-11-02Merge branch '2015.04-toradex-next-fastmap-fixes' into 2015.04-toradex-nextStefan Agner
This fixes have been backported from Linux 4.1 and seem to fix the PEB leak warnings and alleviate fastmap being corrupted or marked invalid by U-Boot. * 2015.04-toradex-next-fastmap-fixes: UBI: Fastmap: Set used_ebs only for static volumes UBI: Fastmap: Fix leb_count unbalance UBI: Fastmap: Switch to ro mode if invalidate_fastmap() fails UBI: Fastmap: Remove eba_orphans logic UBI: Fastmap: Remove bogus ubi_assert() UBI: Fastmap: Fix memory leak while attaching UBI: Fastmap: Don't allocate new ubi_wl_entry objects UBI: Fastmap: Care about the protection queue UBI: Fastmap: Calc fastmap size correctly UBI: add missing kmem_cache_free() in process_pool_aeb error path UBI: fastmap: do not miss bit-flips UBI: fix the volumes tree sorting criteria UBI: fix rb_tree node comparison in add_map
2015-10-12mtd: nand: vf610_nfc: resync with upstream Linux versionStefan Agner
This resyncs the driver changes with the Linux version of the driver. The driver received some feedback in the LKML and got recently acceppted, the latest version can be found here: https://lkml.org/lkml/2015/9/2/678 Notable changes are: - On ECC error, reread OOB and count bit flips in OOB too. If flipped bits are below threshold, also return an empty OOB buffer. - Return the amount of bit flips in vf610_nfc_read_page. - Use endianness aware vf610_nfc_read to read ECC status. - Do not enable IDLE IRQ (since we do not operate with an interrupt service routine). - Use type safe struct for buffer variants (vf610_nfc_alt_buf). - Renamed variables in struct vf610_nfc (column and page_sz) to reflect better what they really representing. The U-Boot version currently does not support RAW NAND write when using the HW ECC engine. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2015-09-01UBI: Fastmap: Set used_ebs only for static volumesRichard Weinberger
If we set it for dynamic ones we might confuse various self checks. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Fix leb_count unbalanceRichard Weinberger
If a LEB is unmapped we have to decrement leb_count as well. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Switch to ro mode if invalidate_fastmap() failsRichard Weinberger
We have to switch to ro mode to guarantee that upon next UBI attach all data is consistent. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Remove eba_orphans logicRichard Weinberger
This logic is in vain as we treat protected PEBs also as used, so this case must not happen. If a PEB is found which is in the EBA table but not known as used has to be issued as fatal error. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Remove bogus ubi_assert()Richard Weinberger
It is legal to have PEBs left in the used list. This can happen if UBI copies a PEB and a powercut happens between writing a new fastmap and adding this PEB into the EBA table. In this case the old PEB will be used. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Fix memory leak while attachingRichard Weinberger
Currently we leak a few ubi_ainf_pebs while attaching. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-09-01UBI: Fastmap: Don't allocate new ubi_wl_entry objectsRichard Weinberger
There is no need to allocate new ones every time, we can reuse the existing ones. This makes the code cleaner and more easy to follow. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org> Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
2015-09-01UBI: Fastmap: Care about the protection queueRichard Weinberger
Fastmap can miss a PEB if it is in the protection queue and not jet in the used tree. Treat every protected PEB as used. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2015-09-01UBI: Fastmap: Calc fastmap size correctlyRichard Weinberger
We need to add fm_sb too. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2015-09-01UBI: add missing kmem_cache_free() in process_pool_aeb error pathRichard Genoud
I ran into this error after a ubiupdatevol, because I forgot to backport e9110361a9a4 UBI: fix the volumes tree sorting criteria. UBI error: process_pool_aeb: orphaned volume in fastmap pool UBI error: ubi_scan_fastmap: Attach by fastmap failed, doing a full scan! kmem_cache_destroy ubi_ainf_peb_slab: Slab cache still has objects CPU: 0 PID: 1 Comm: swapper Not tainted 3.14.18-00053-gf05cac8dbf85 #1 [<c000d298>] (unwind_backtrace) from [<c000baa8>] (show_stack+0x10/0x14) [<c000baa8>] (show_stack) from [<c01b7a68>] (destroy_ai+0x230/0x244) [<c01b7a68>] (destroy_ai) from [<c01b8fd4>] (ubi_attach+0x98/0x1ec) [<c01b8fd4>] (ubi_attach) from [<c01ade90>] (ubi_attach_mtd_dev+0x2b8/0x868) [<c01ade90>] (ubi_attach_mtd_dev) from [<c038b510>] (ubi_init+0x1dc/0x2ac) [<c038b510>] (ubi_init) from [<c0008860>] (do_one_initcall+0x94/0x140) [<c0008860>] (do_one_initcall) from [<c037aadc>] (kernel_init_freeable+0xe8/0x1b0) [<c037aadc>] (kernel_init_freeable) from [<c02730ac>] (kernel_init+0x8/0xe4) [<c02730ac>] (kernel_init) from [<c00093f0>] (ret_from_fork+0x14/0x24) UBI: scanning is finished Freeing the cache in the error path fixes the Slab error. Tested on at91sam9g35 (3.14.18+fastmap backports) Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Cc: stable <stable@vger.kernel.org> # 3.10+
2015-09-01UBI: fastmap: do not miss bit-flipsBrian Norris
The return value from 'ubi_io_read_ec_hdr()' was stored in 'err', not in 'ret'. This fix makes sure Fastmap-enabled UBI does not miss bit-flip while reading EC headers, events and scrubs the affected PEBs. This issue was reported by Coverity Scan. Artem: improved the commit message. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2015-09-01UBI: fix the volumes tree sorting criteriaHeiko Schocher
Commig "604b592 UBI: fix rb_tree node comparison in add_map" broke fastmap backward compatibility and older fastmap images cannot be mounted anymore. The reason is that it changes the volumes RB-tree sorting criteria. This patch fixes the problem. Artem: re-write the commit message Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2015-09-01UBI: fix rb_tree node comparison in add_mapMike Snitzer
The comparisons used in add_vol() shouldn't be identical. Pretty sure the following is correct but it is completely untested. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2015-08-18dm: spi: Correct SPI claim/release_bus() methodsSimon Glass
These methods should be passed a slave device, not a bus. This matches the old SPI interface. It is important to know which device is claiming the bus so passing a bus is not that useful. Reported-by: Haikun Wang <haikun.wang@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Peng Fan <Peng.Fan@freescale.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2015-08-10dm: spi: Convert Freescale DSPI driver to driver modelHaikun.Wang@freescale.com
Move the Freescale DSPI driver over to driver model. Signed-off-by: Haikun Wang <Haikun.Wang@freescale.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2015-07-12tegra: lcd: video: integrate display driver for t30Marcel Ziswiler
On popular request make the display driver from T20 work on T30 as well. Turned out to be quite straight forward. However a few notes about some things encountered during porting: Of course the T30 device tree was completely missing host1x as well as PWM support but it turns out this can simply be copied from T20. The only trouble compiling the Tegra video driver for T30 had to do with some hard-coded PWM pin muxing for T20 which is quite ugly anyway. On T30 this gets handled by a board specific complete pin muxing table. The older Chromium U-Boot 2011.06 which to my knowledge was the only prior attempt at enabling a display driver for T30 for whatever reason got some clocking stuff mixed up. Turns out at least for a single display controller T20 and T30 can be clocked quite similar. Enjoy.
2015-05-13mtd/nand/tegra: alignment workaroundMarcel Ziswiler
Introduce cache alignment bounce buffer to workaround issues as follows: Loading file '/boot/zImage' to addr 0x01000000 with size 4499152 (0x0044a6d0)... ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108 Done Kernel image @ 0x1000000 [ 0x000000 - 0x44a6d0 ] Starting kernel ... undefined instruction pc : [<005ff03c>] lr : [<0000800c>] sp : 0144b6e8 ip : 01000188 fp : 0144a6c8 r10: 00000000 r9 : 411fc090 r8 : 00000100 r7 : 00000cfb r6 : 0144a6d0 r5 : 00000000 r4 : 00008000 r3 : 0000000c r2 : 00000100 r1 : 00000cfb r0 : 00000000 Flags: nZCv IRQs off FIQs off Mode SVC_32 Resetting CPU ...
2015-05-13mtd/nand/ubi: assortment of alignment fixesMarcel Ziswiler
Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer alignment into account which led to failures of the following form: ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108
2015-05-11video: dcu: fixup memory correct even without framebufferStefan Agner
When there is no framebuffer allocated, e.g. no video environment variable or an error during initialization, the framebuffer location ends up to be NULL, in which case the fixup function calculates a bogus memory size. Use the framebuffer size to make sure that memory size is calculated right in any case.
2015-05-04usb: ehci-vf: Add weak function for board specific initialisationSanchayan Maity
Add a weak function board_ehci_hcd_init which can be used by the board file for board specific initialisation. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2015-05-01serial_mxc.c: add option to use in DTE modeMax Krummenacher
The serial_mxc UART can use DTE and DCE mode (i.e End device vs. modem). This adds DTE mode capability to the driver. In order to switch from the default DCE to DTE mode define CONFIG_MXC_UART_DTE.
2015-04-28tegra: nand: 16-bit bch ecc integrationMarcel Ziswiler
Integrate 16-bit BCH ECC handling required e.g. for the latest NAND parts assembled on Colibri T20.
2015-04-28tegra: nand: fix read_byte required for proper onfi detectionMarcel Ziswiler
Fix PIO read_byte() implementation not only used for the legacy READ ID but also the PARAM command now required for proper ONFI detection. This fix is inspired by Lucas Stach's Linux Tegra NAND driver of late. While at it also disable subpage writes.
2015-04-23Merge branch '2015.04-toradex-next-gpio' into 2015.04-toradex-nextStefan Agner
2015-04-23video: dcu: make sure memory size aligns to section sizeStefan Agner
Align the reported memory size to 1MiB, which is the section size in the Linux memory managment system. This avoids triggering an issue which leads to freeze the Linux kernel very early: http://thread.gmane.org/gmane.linux.ports.arm.kernel/408378
2015-04-23video: dcu: add additional modes for DCUStefan Agner
Add common widescreen modes 800x480 and 1024x600.
2015-04-22dm: gpio: vf610: Add GPIO driver supportBhuvanchandra DV
Add GPIO support to Freescale VF610 Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2015-04-22dm: gpio: uclass: Add flag to control sequence numberingBhuvanchandra DV
Like SPI and I2C few GPIO controllers also have multiple chip instances. This patch adds the flag 'DM_UC_FLAG_SEQ_ALIAS' in gpio_uclass driver to control device sequence numbering. By defalut the dev->r_seq for gpio_uclass will alwalys returns -1, which leads the gpio driver probe failure. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
2015-04-22ARM: vf610: add additional modes for DCUStefan Agner
Add common widescreen modes 800x480 and 1024x600.
2015-04-22video: dcu: fix framebuffer to the end of memoryStefan Agner
Fix the framebuffer location to the very end of the available memory. This allows to remove the area from available memory for the kernel, which in turn allows to display the splash screen through the while Linux kernel boot process. Ideas has been taken from the sunxi display driver, e.g. 20779ec3a5 ("sunxi: video: Dynamically reserve framebuffer memory")
2015-04-22video: dcu: enable pixel clock after initializationStefan Agner
When enabling the DCU and pixel clock, the test mode is activated since this is the reset configuration. The test mode immediately shows a red screen on a LCD. A moment later, the DCU gets initialized properly. This patch enables the pixel clock after initialization of the DCU control register. This avoids this initial flicker on LCD screens.
2015-04-21video: dcu: Add DCU support for Vybrid SoCStefan Agner
The Vybrid SoC family has the same display controller unit (DCU) like the LS1021A SoC. This patch adds platform data, pinmux defines and clock control to enable the driver for Vybrid based boards too.
2015-04-15net: asix: fix operation without eepromMarcel Ziswiler
This patch fixes operation of our on-board AX88772B chip without EEPROM but with a ethaddr coming from the regular U-Boot environment. This is a forward port of some remaining parts initially implemented by Antmicro. (cherry picked from commit 67c3a4aee6c0af124ce779aed1be70c7a92d0916)
2015-04-15Revert "dm: tegra: Enable driver model for serial"Marcel Ziswiler
Migrating our BSPs towards mainline U-Boot I noticed it suddenly booting slower. With mainline Linux I noticed about a 1 to 2 second increase while booting downstream L4T takes 10 to 15 seconds longer! This reverts commit 858530a8c0a7ce7e573e513934804a00d6676813. Conflicts: drivers/serial/Makefile (cherry picked from commit 752aae30a791326581efafbb761c0cebaba8d3ea) Conflicts: drivers/serial/serial_tegra.c include/configs/tegra-common.h
2015-04-15e1000: unprogrammed i210 operation hackMarcel Ziswiler
Hack driver to avoid the following error for now. This is required for unprogrammed i210 operation. e1000: e1000#0: ERROR: Hardware Initialization Failed (cherry picked from commit 02bf24ad4a7c882e25771f656b973d5458695cf0) (cherry picked from commit 68cecfdbe342f800a0b1f10a1f8fb019b491f04b)
2015-04-14usb: host: Add ehci-vf USB driver for ARM Vybrid SoC'sSanchayan Maity
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2015-04-14mtd: vf610_nfc: enable ONFI detectionStefan Agner
This changes enable ONFI detection. The Read ID command now allows one address byte which is needed for ONFI detection. To read the ONFI parameter page, the NAND_CMD_PARAM need to be supported. The CMD code enables one command and one address byte along with reading data from flash using R/B#, as specified by ONFI.
2015-04-14mtd: vf610_nfc: add 32-error correction option for HW ECCStefan Agner
Add option to choose between current 24-error correction and 32-error correction through Kconfig. 32-error correction allow to use NAND chips which require up to 8-bit error correction per 512 byte (when using 2K pages).
2015-04-14mtd: vf610_nfc: add Freescale NFC controller configs to KconfigStefan Agner
This commit allows users to enable/disable the Freescale NFC controller found in systems like Vybrid (VF610), MPC5125, MCF54418 or Kinetis K70 via Kconfig with more detailed help docs.
2015-04-14mtd: vf610_nfc: use in-band bad block tableStefan Agner
Use in-band bad block table (NAND_BBT_NO_OOB) which allows to use the full OOB for hardare ECC purposes. Since there is no ECC correction on the OOB it is also safer to use in-band area to store the bad block table marker.
2015-04-14mtd: vf610_nfc: implement OOB only readStefan Agner
Implement read of OOB area only. When using column and sector size properties, only parts of the page can be read. However, this works only when hardware ECC is disabled, otherwise the ECC engine would ruin the data in the buffer. To allow OOB only reads, three points had to be addressed: - Set ECC mode per command. - Handle NAND_CMD_READOOB seperate. Make sure column and sector size is correctly set up, while disabling ECC. - Now, the OOB data end up at the beginning of the buffer. Remove the special handling of OOB (spareonly). Especially bad block scans benefit from this change. On a 512MiB SLC NAND device, the bad block scan took 1.5s less than before.
2015-04-14mtd: vf610_nfc: allow bitflips in an empty pageStefan Agner
Allow bit flips in a empty page up to half of the recoverable bits (strength / 2).
2015-04-14mtd: vf610_nfc: remove read on SEQINStefan Agner
Since we do not support sub-page writes anyway, reading the page back to the controller on SEQIN command is not required. Remove the page read on SEQIN. However, the column/page values relevant to the SEQIN command, hence set the column/row address on SEQIN command.
2015-04-14mtd: vf610_nfc: remove caching of page in bufferStefan Agner
To improve performance we remember the current page in the buffer and avoid reading it twice. This implicit page cache increases complexity while does not increase performance in real world cases. This patch removes that feature. Acked-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
2015-04-10dtt: add ds620 supportAlbert ARIBAUD \(3ADEV\)
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
2015-04-10lpc32xx: add LPC32xx SSP support (SPI mode)Albert ARIBAUD \(3ADEV\)
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
2015-04-10lpc32xx: add GPIO supportAlbert ARIBAUD \(3ADEV\)
This driver only supports Driver Model, not legacy model. Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
2015-04-10lpc32xx: i2c: add LPC32xx I2C interface supportAlbert ARIBAUD \(3ADEV\)
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>