summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| | * | mvsata_ide: adjust port init sequenceAlbert Aribaud2010-10-12-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mvsata_ide_initialize_port(): adjust init sequence (SStatus should be checked only after all writes to SControl) and return success/failure to ide_preinit(). Also, as some tests showed init durations in the hundreds of us, raise the time-out to 01 ms to be on the safe side. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
| * | | ARM: relocation: don't undef CONFIG_SYS_ARM_WITHOUT_RELOCBen Gardiner2010-10-13-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some #undef's of CONFIG_SYS_ARM_WITHOUT_RELOC added to a few board configs as part of the arm relocation series; but these are not needed now as we do not #undef what is not #defined in the first place. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> CC: Heiko Schocher <hs@denx.de>
| * | | ARM: relocation: fix typo in commentHeiko Schocher2010-10-13-5/+5
| | | | | | | | | | | | | | | | Signed-off-by: Heiko Schocher <hs@denx.de>
| * | | Kirkwood: Changes specific to ARM relocation supportPrafulla Wadaskar2010-10-13-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All Kirkwood based boards are supported for this new implementation ref: docs/README.arm-relocation Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
| * | | kirkwood: added common config file mv-common.hPrafulla Wadaskar2010-10-13-533/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is observed that, in most of the board configs the code is being duplicated, also for any common change all board files needs update This issue was under discussion from long on mailing list and we converge on introducing common config file. With this patch- 1. Total Kirkwood specific configuration code is reduced by 210 lines 2. All common configuration can be shared by multiple boards 3. Easy to manage common updates like ARM relocation changes mv-common.h file is added to include/configs/ It contains all common configuration supported for all Kirkwood boards The respective board configs are updated for its usage Build tested for guruplug, mv88f6281gtw_ge, openrd_base, rd6281a and sheevaplug Binary execution tested for sheevaplug Todo: 1. Other custom Kirkwood boards to be synced 2. The support to be extended for Orion5X based boards Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
| * | | Kirkwood: dram_init is moved to dram.cPrafulla Wadaskar2010-10-13-55/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all Kirkwood boards so far dram_init function is duplicated dram_init function is moved to dram.c and relevant code from all board specific files removed If any board needs specific dram init handling than standard one, then, a macro CONFIG_SYS_BOARD_DRAM_INIT should be defined in board config header file and the dram_init function can be put in board specific source file For ex. keymile boards Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
| * | | orion5x: optimize window size computationAlbert Aribaud2010-10-13-11/+21
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Chris Moore <moore@free.fr> Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
| * | | Kirkwood: print_cpuinfo fixed for valid devid revidPrafulla Wadaskar2010-10-13-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier Device Identification register was used to detect the type for SoC, considering 88F6282 support to be added, It is not possible to detect the same using current algorithm. With this patch, device ID is being read using PCIE devid register, also valid chip revision ID will also be read and displayed Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
| * | | mvsata_ide: adjust port init sequenceAlbert Aribaud2010-10-13-9/+33
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mvsata_ide_initialize_port(): adjust init sequence (SStatus should be checked only after all writes to SControl) and return success/failure to ide_preinit(). Also, as some tests showed init durations in the hundreds of us, raise the time-out to 01 ms to be on the safe side. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
| * | orion5x: fix relocation-incompatible codeAlbert Aribaud2010-10-11-31/+54
| | | | | | | | | | | | Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
| * | arm: bugfix: replace ble with blo in start.S filesAlbert Aribaud2010-10-11-68/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generalized misuse of ble within relocation and bss initialization loops caused one iteration too many. Instead of ble ('branch if lower or equal'), use blo ('branch if lower'). While we're at it, fix all 'addreee' typos. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
| * | Merge branch 'at91' of git://git.denx.de/u-boot-atmelWolfgang Denk2010-10-11-74/+90
| |\ \
| | * | at91: Add arch_preboot_os which disables PIT in a faster wayAlexander Stein2010-10-05-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When disabled the PIT runs until it reaches the CPIV value. The Linux PIT driver stops the PIT and waits until it stopped. This can take over 100ms. Simply stopping in u-boot isn't sufficient as the PIT will still be running when Linux is waiting until it stopped. So, we stop it in u-boot by setting the compare value to a value slightly greater than the current running counter to make the PIT stopped in short time. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
| | * | atmel_usart: change register access to C structureAndreas Bießmann2010-10-05-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces C structure definition for register footprint of atmel's usart. Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
| | * | at91_emac.h: fix typo in register definitionAndreas Bießmann2010-10-05-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Jens Scharsig <js_at_ng@scharsoft.de>
| | * | AT91: convert cpu.c to struct SoC accessReinhard Meyer2010-10-05-20/+12
| | | | | | | | | | | | | | | | Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
| | * | at91_emac.c: poll for IDLE when writing PHYAndreas Bießmann2010-10-05-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the unnecessary waiting in at91emac_read() and at91emac_write() by checking the IDLE flag. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| | * | at91_emac.c: fix 'Warning: eth device name has a space!'Andreas Bießmann2010-10-05-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch also removes conditional nameing of at91_emac driver whether it's connection to PHY is RMII or MII. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| * | | Merge branch 'master' of git://git.denx.de/u-boot-imxWolfgang Denk2010-10-11-153/+1510
| |\ \ \ | | | |/ | | |/|
| | * | MX51: Support for TTECH vision2 boardStefano Babic2010-10-07-0/+1212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds support for TTECH vision2 board. The board has 512MB RAM, SDHC slot and 4MB SPI device from StMicron. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MX51: Register definitions cannot be included in board config fileStefano Babic2010-09-30-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to wrong dependencies, it is not possible to include imx_regs.h inside the board configuration file. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MXC: Fix byte-ordering in SPI driver for i.MX31/i.MX51Stefano Babic2010-09-30-41/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual SPI driver for i.MX31 and i.MX51 controller use a wrong byte ordering, because it is supposed to work only with Freescale's devices, as the Power Controllers (PMIC). The driver is not suitable for general purposes, because the buffers passed to spi_xfer must be 32-bit aligned, as it is used mainly to send integer to PMIC devices. The patch drops any kind of limitation and makes the driver useful with devices controlled sending commands composed by single bytes (or by a odd number of bytes), such as spi flash, sensor, etc. Because the byte ordering is changed, any current driver using this controller must be adapted, too. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MXC: Correct SPI_CPOL setting in SPI driverStefano Babic2010-09-30-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handling of the SPI_CPOL bit inside the SPI driver was wrong. As reported by the manual, the meaning of the SSPOL inside the configuration register is the same as reported by SPI specification (0 if low in idle, 1 is high on idle). The driver inverts this logic. Because this patch sets the logic as specified, it is required to clear the CPOL bit in the configuration file to adapt to the correct logic. Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: David Jander <david.jander@protonic.nl>
| | * | MX51: Drop unused header file for mx51evkStefano Babic2010-09-29-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As stated in 272017853339f5b9685f9488bdaf5405812d12a4, the mx51evk has not CPLD and all references must be removed. This patch drop a .h file that still remains in board directory. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MXC: Add watchdog support to serial driverStefano Babic2010-09-29-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls WATCHDOG_RESET() inside serial driver for boards enabling watchdog. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MX51: add structure to access System Reset ControllerStefano Babic2010-09-29-0/+10
| | | | | | | | | | | | | | | | Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | MX51: Added pins definition to set up padsStefano Babic2010-09-29-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pins definitions to set up RAM pads. Pins have only a pad, there is no entry in the multiplexer. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | ARM: Use syslib functions for all CORTEXA8Stefano Babic2010-09-29-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OMAP3 cpu directory contains a syslib file with some utilities that can be shared by all targets using arm cortexa8 processors, not only OMAP. Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * | Use common function to set GPIOs for MX3 and MX5Stefano Babic2010-09-29-67/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds support for setting gpios to the MX51 processor and change name to the corresponding functions for MX31. In this way, it is possible to get rid of nasty #ifdef switches related to the processor type. Signed-off-by: Stefano Babic <sbabic@denx.de>
* | | | Merge branch 'sf' of git://git.denx.de/u-boot-blackfinWolfgang Denk2010-10-13-44/+82
|\ \ \ \
| * | | | sf: turn probe switch into a lookup tableReinhard Meyer2010-10-12-44/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for arbitrarily long manufacturer ids following the JEDEC standard of 0x7f continuation bytes. It also makes adding new entries easier as it's just one element in an array. The downside is that it increases code size a bit, but we're talking ~50 bytes. Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | | | | Merge branch 'master' of git://git.denx.de/u-boot-usbWolfgang Denk2010-10-13-25/+60
|\ \ \ \ \
| * | | | | usb: musb: only write CLRDATATOG when appropriateBryan Wu2010-10-13-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a change similar to what is already in the Linux driver. We should only program the CLRDATATOG bit when the current mode indicates that it is needed. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * | | | | usb: Add support for multiple-LUN mass storage devicesLudovic Courtès2010-10-13-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes `usb_stor_scan' to scan all the LUNs of each mass storage device. It also fixes the various commands to correctly set the LUN field. Notably, it allows each LUN of GuruPlug's microSD card reader to be accessed. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
| * | | | | USB-CDC: Prevent rx_req being enqueued twiceVitaly Kuzmichev2010-10-13-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After gadget reinitializaton (after tftp has been done once) packet_received may become equal to 1 due to nuking OUT_EP while disabling it in eth_reset_config. rx_submit called from usb_eth_init queues rx_req first time. But the first call of usb_eth_recv from NetLoop queues rx_req again due to packet_received = 1. The following flow shows the path of functions calls when this happens: net/net.c:NetLoop | +-net/eth.c:eth_init | ether.c:usb_eth_init | | | +-udc_driver:usb_gadget_handle_interrupts | | udc_driver:... | | ether.c:eth_setup | | ether.c:eth_set_config | | ether.c:eth_reset_config | | udc_driver:usb_ep_disable | | udc_driver:nuke | | ether.c:rx_complete | | ether.c: packet_received = 1; | | | +-ether.c:rx_submit | udc_driver:usb_ep_queue --- The first time when rx_req is queued | +-net/eth.c:eth_rx ether.c:usb_eth_recv | +-udc_driver:usb_gadget_handle_interrupts | udc_driver:... --- no interrupts, returning +-ether.c: if (packet_received) { ... ether.c:rx_submit udc_driver:usb_ep_queue --- The second time! Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
| * | | | | USB-CDC: Fix tx/rx_req memory leaksVitaly Kuzmichev2010-10-13-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove and fix needless and destructive operations with tx/rx_req. 1) 'req' in rx_complete is always not NULL and always equals to rx_req 2) Free allocated tx_req if rx_req allocation has failed 3) Do not zero out tx/rx_req in usb_eth_init, leave this for eth_reset_config which will be called at the next use of usb0 4) Additional check in usb_eth_recv is not required Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
| * | | | | USB: Make non-bulk delay longer in OHCIMarek Vasut2010-10-13-1/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes TIMEOUT with my Kingston 32GB USB3.0 flashdrive, which I experienced on my PXA270 (USB 1.1) Vpac270 board. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* | | | | common/fdt_support.c: fix compile errorMatthew McClintock2010-10-13-10/+10
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build error introduced in beca5a5f5bf0d88125580e5e9c1730469cd50ab8 common/libcommon.a(fdt_support.o): In function `fdt_add_edid': /local/hudson/jobs/mirrors-u-boot.git/workspace/common/fdt_support.c:1205: undefined reference to `fdt_increase_size' make: *** [u-boot] Error 1 Signed-off-by: Matthew McClintock <msm@freescale.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | | | TSI148: Fix argument parsingBrent Darley2010-10-12-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does 2 things: - Fix the argument number assigned to the vdw (VME data width) value. Previously, a nonexistent 7th arument was read as the vdw variable. - Reduce the size of the argument array for the tsi148 command from 8 to 7. The tsi148 command itself is argument index 0, and the maximum number arguments passed to the command is 6, making a total of 7 for the array. Signed-off-by: Brent Darley <bdarley@xes-inc.com> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | powerpc: Remove warm reset entry pointPeter Tyser2010-10-12-137/+25
| | | | | | | | | | | | | | | | | | | | | | | | No boards utilize the warm reset entry point, so remove it. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | ppmc7xx: Use _start as reset entry pointPeter Tyser2010-10-12-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the _warm_start label was used as an entry point. These 2 entry points should be functionally identical after the removal of the BOOTFLAG_WARM define. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | powerpc: Zero out board info struct on bootupPeter Tyser2010-10-12-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This puts the board info struct in a known state and allows the removal of other code which initialized board info fields to 0. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | cp/cmp: Add WATCHDOG_RESET in copy and compare loopStefan Roese2010-10-12-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some boards with a very short watchdog timeout, the "cp" and "cmp" commands may reset the board. This patch adds some watchdog resets inside the loops. Otherwise for example the lwmon5 board will reset while doing something like this: => cp.b fc000000 1000000 100000 Signed-off-by: Stefan Roese <sr@denx.de>
* | | | examples/standalone: Use gcc's -fno-toplevel-reorderPeter Tyser2010-10-12-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using -fno-toplevel-reorder causes gcc to not reorder functions. This ensures that an application's entry point will be the first function in the application's source file. This change, along with commit 620bbba524fbaa26971a5004793010b169824f1b should cause a standalone application's entry point to be at the base of the compiled binary. Previously, the entry point could change depending on gcc version and flags. Note -fno-toplevel-reorder is only available in gcc version 4.2 or greater. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* | | | a4m072: support for SHOW_BOOT_PROGRESS feature using LED displayIlya Yanok2010-10-12-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for displaying boot progress codes on a4m072 board using LED display. As we can display only one symbol at any time on the hardware (two symbols with blinking) we can't display progress codes directly and have to map them to 2-symbol codes. We use the following mapping on the a4m972 board: [1, 8] U [100, 108] -> 5 [-9, -1] U [-101, -100] U [-113, -103] -> -5 [9, 14] U [120, 123] U [125, 129] -> 8 [-13, -10] U [-122, -120] U [-127, -124] U {-129} -> -8 {15} -> 9 [-32, -30] -> -A [-40, -35] U [-51, -42] U [-58, -53] U [-83, -80] U {-64, -130, -140, -150} -> -B Other progress code are ignored. One symbol codes are displayed steady while two-symbol codes are displayed using blinking. Boot progress codes are displayed with decimal got unset (as opposed to 'display' command output). Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* | | | a4m072: led display supportIlya Yanok2010-10-12-2/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for LED display on a4m072 board. Hardware is capable of displaying only one symbol at any time. We support displaying two symbols in software (via blinking). Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* | | | led_display: split led display support into generic and hw-dependent partsIlya Yanok2010-10-12-17/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the display command into generic interface and hardware-specific realization for PDSP188x LED display found on hmi1001 and manroland boards. Simple interface for LED displays is defined in include/led-display.h and described in doc/README.LED_display. Driver-specific implementation was moved into drivers/misc/pdsp188x.c file (enabled with CONFIG_PDSP188x set). Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* | | | A4M072: Added support for the board.Sergei Poselenov2010-10-12-5/+777
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides support for the A4M072 board with the following features: UART NOR flash FEC Ethernet External SRAM I2C EEPROM CompactFlash cards on IDE/ATA port USB Host PCI initialization The 7-segment LED indicator is not yet supported. Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
* | | | VFAT: fix processing of scattered long file name entriesMikhail Zolotaryov2010-10-12-12/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The U-Boot code has the following bugs related to the processing of Long File Name (LFN) entries scattered across several clusters/sectors : 1) get_vfatname() function is designed to gather scattered LFN entries by cluster chain processing - that doesn't work for FAT12/16 root directory. In other words, the function expects the following input data: 1.1) FAT32 directory (which is cluster chain based); OR 1.2) FAT12/16 non-root directory (which is also cluster chain based); OR 1.3) FAT12/16 root directory (allocated as contiguous sectors area), but all necessary information MUST be within the input buffer of filesystem cluster size (thus cluster-chain jump is never initiated). In order to accomplish the last condition, root directory parsing code in do_fat_read() uses the following trick: read-out cluster-size block, process only first sector (512 bytes), then shift 512 forward, read-out cluster-size block and so on. This works great unless cluster size is equal to 512 bytes (in a case you have a small partition), or long file name entries are scattered across three sectors, see 4) for details. 2) Despite of the fact that get_vfatname() supports FAT32 root directory browsing, do_fat_read() function doesn't send current cluster number correctly, so root directory look-up doesn't work correctly. 3) get_vfatname() doesn't gather scattered entries correctly also is the case when all LFN entries are located at the end of the source cluster, but real directory entry (which must be returned) is at the only beginning of the next one. No error detected, the resulting directory entry returned contains a semi-random information (wrong size, wrong start cluster number and so on) i.e. the entry is not accessible. 4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13 UTF-16 code units) to represent a single long file name i.e. up to 520 bytes. U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record may cause buffer overflow / memory corruption. Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16 partition) - get_vfatname() function doesn't support such case as well. The patch attached fixes these problems in the following way: - keep using 256 bytes buffer for a long file name, but safely prevent a possible buffer overflow (skip LFN processing, if it contains 10 or more slots). - explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size. The value used is a double sector size (to store current sector and the next one). This fixes the first problem and increases performance on big FAT12/16 partitions; - send current cluster number (FAT32) to get_vfatname() during root directory processing; - use LFN counter to seek the real directory entry in get_vfatname() - fixes the third problem; - skip deleted entries in the root directory (to prevent bogus buffer overflow detection and LFN counter steps). Note: it's not advised to split up the patch, because a separate part may operate incorrectly. Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
* | | | tools/imls: fix comment in MakefileDaniel Hobi2010-10-12-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d984fed0 (makefiles: fixes for building build tools) changed the variable name FIT_CFLAGS to HOSTCFLAGS_NOPED but forgot to update to corresponding comment. Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch> Cc: Scott Wood <scottwood@freescale.com> Cc: Wolfgang Denk <wd@denx.de>