summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | warp7: Fix the pmic_get() parameter in the DM caseJoris Offouga2020-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address, so fix it accordingly Signed-off-by: Joris Offouga <offougajoris@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | | arm: xea: dts: Add 'fec-3v3' regulator properties to prevent accidental ↵Lukasz Majewski2020-02-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disablement The 'enable-active-high' DTS property configures GPIO so it is active with HIGH state (by default it is low). The 'regulator-boot-on' property indicates that the regulator was enabled in the 'earlier' stage - i.e. bootloader/firmware. In the XEA case the 'fec-3v3' was configured (as a "wrapper" on GPIO0_0) in very early SPL code, so it shouldn't be modified at latter stages. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * | | arm: xea: spl: Add GPIO0_0 setup on spl_board_initLukasz Majewski2020-02-091-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly configure GPIO0_0 in SPL, which controlls 3V3 voltage on the XEA board (it also supplies TIVAs). This code would enable TIVAs power supply early (also when board uses the falcon boot). Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * | | arm: xea: config: Enable support for XEA board specific device tree tweaksLukasz Majewski2020-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * | | arm: xea: Provide function to set L2 switch 'local-mac-address' propertyLukasz Majewski2020-02-091-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * | | arm: xea: defconfig: Define space for redundant envs in SPI-NOR flashLukasz Majewski2020-02-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Redundant envs help with assuring better reliability for the system as they prevent from the situation when envs are stored only in a single place. Signed-off-by: Lukasz Majewski <lukma@denx.de>
| * | | mx7ulp_com: Remove unneeded SoC definitionsFabio Estevam2020-02-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 9c27310ac23c ("mx7ulp: Move SoC base address to a common file") we no longer need to have these SoC definitions in the board file, so remove them. Signed-off-by: Fabio Estevam <festevam@gmail.com> Acked-by: Peng Fan <peng.fan@nxp.com>
| * | | cmd: mdc/mwc: normalize disjoint MX_CYCLIC usageJoel Johnson2020-02-0932-41/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both CMD_MX_CYCLIC and MX_CYCLIC are in use and defined in Kconfig, but only the non-CMD version currently does anything. This changes all usages to prefer the CMD_MX_CYCLIC option (since it's only affecting addition of the commands), and switches defconfigs using the non-CMD version to use the CMD version. Signed-off-by: Joel Johnson <mrjoel@lixil.net> Reviewed-by: Tom Rini <trini@konsulko.com>
| * | | tools: imx8m_image: fix warning messageSébastien Szymanski2020-02-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a firmware file is missing the warning message doesn't indicate the firmware file name because '$tmp' var doesn't exist. Fix the warning message and while at it reduce the if/else statement. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
| * | | mx6sxsabresd: Keep only one targetFabio Estevam2020-02-093-306/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there are two targets for the i.MX6SX SabreSD board: mx6sxsabresd_defconfig and mx6sxsabresd_spl_defconfig. This brings additional maintainance effort without a clear advantage. Keep only the mx6sxsabresd_defconfig one and remove mx6sxsabresd_spl_defconfig to keep it simpler. Also remove the SPL related code from the board file. Signed-off-by: Fabio Estevam <festevam@gmail.com> Acked-by: Peng Fan <peng.fan@nxp.com>
| * | | mx6ul_14x14_evk: Move CONFIG_DM_74X164 to defconfigFabio Estevam2020-02-092-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CONFIG_DM_74X164 symbols should be moved to the defconfig file, as indicated in the comments. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * | | gpio: Let DM_74X164 be built without CONFIG_SPL_GPIOFabio Estevam2020-02-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bcee8d6764f9 ("dm: gpio: Allow control of GPIO uclass in SPL") CONFIG_DM_74X164 is no longer built for mx7dsabresd_defconfig, as this target does not use CONFIG_SPL_GPIO. Remove such dependency and let the the 74X164 GPIO driver be built again. This restores Ethernet functionality on the imx7-sdb board as the Ethernet reset PHY comes from a GPIO driven by a 74LV595PW I/O expander. Fixes: bcee8d6764f9 ("dm: gpio: Allow control of GPIO uclass in SPL") Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Alifer Moraes <alifer.wsdm@gmail.com>
| * | | imx: imx8mm_evk: spelling in readme fileMarcel Ziswiler2020-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor spelling fix in README file. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | board: toradex: verdin-imx8mm: add MAINTAINERSIgor Opaniuk2020-02-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assign Igor Opaniuk as a board maintainer. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | board: toradex: verdin-imx8mm: add READMEIgor Opaniuk2020-02-091-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add README with build steps for U-boot and TF-A for Verdin iMX8M Mini SoM. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | board: toradex: Add Verdin iMX8M Mini supportIgor Opaniuk2020-02-0912-0/+3504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds initial minimal support for the Toradex Verdin iMX8M Mini Quad 2GB WB IT V1.0A module. They are now strapped to boot from eFuses which are factory fused to properly boot from their on-module eMMC. U-Boot supports booting from the on-module eMMC only, SDP support is disabled for now due to missing i.MX 8M Mini USB support. Functionality wise the following is known to be working: - eMMC, 8-bit and 4-bit MMC/SD card slots - Ethernet - GPIOs - I2C Boot sequence is: SPL ---> ATF (TF-A) ---> U-boot proper ATF, U-boot proper and u-boot.dtb images are packed into a FIT image, loaded by SPL. Boot: U-Boot SPL 2020.01-00187-gd411d164e5 (Jan 26 2020 - 04:47:26 +0100) Normal Boot Trying to boot from MMC1 NOTICE: Configuring TZASC380 NOTICE: RDC off NOTICE: BL31: v2.0(release):rel_imx_4.14.98_2.3.0-0-g09c5cc994-dirty NOTICE: BL31: Built : 01:11:41, Jan 25 2020 NOTICE: sip svc init U-Boot 2020.01-00187-gd411d164e5 (Jan 26 2020 - 04:47:26 +0100) CPU: Freescale i.MX8MMQ rev1.0 at 0 MHz Reset cause: POR DRAM: 2 GiB MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2 Loading Environment from MMC... OK In: serial Out: serial Err: serial Model: Toradex Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT V1.0A, Serial# 06535149 Net: eth0: ethernet@30be0000 Hit any key to stop autoboot: 0 Verdin iMX8MM # Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | toradex: tdx-cfg-block: add Verdin iMX8M Mini/Nano supportMarcel Ziswiler2020-02-092-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for storing configuration for Verdin iMX8M Mini and Nano SoMs in Toradex config block. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | toradex: tdx-cfg-block: add Apalis iMX8X supportMarcel Ziswiler2020-02-092-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for storing configuration for Apalis iMX8X SoM in Toradex config block. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
| * | | arm: dts: imx8mm-pinfunc: sync latest linux-next pin func headerMarcel Ziswiler2020-02-091-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Synchronise with latest linux-next kernel pin func header file. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
* | | | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini2020-02-106-186/+219
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | - Fix ax25-ae350.rst document. - Refine RISC-V linker script and start.S. - Add option to print more information on exception.
| * | | riscv: Remove unnecessary instructionSean Anderson2020-02-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The add instruction on risc-v can have any three sources and targets, so there is no need for an intermediate mov. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * | | doc: fix opensbi build steps for AX25-AE350Jagan Teki2020-02-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSBI build steps are marked as normal text in AX25-AE350 documentation. Move them into code-block so-that it can show it as build steps. Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | | doc: fix AX25-AE350 RISC-V documentationHeinrich Schuchardt2020-02-101-167/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 04883bf7acca ("doc: update AX25-AE350 RISC-V documentation") `make htmldocs` produces a log of warnings like doc/board/AndesTech/ax25-ae350.rst:373: WARNING: Block quote ends without a blank line; unexpected unindent. doc/board/AndesTech/ax25-ae350.rst:0: WARNING: Undefined substitution referenced: "_ __ ___ _ __ | (___ | |_) |". Reformat the problematic passages. Fixes: 04883bf7acca ("doc: update AX25-AE350 RISC-V documentation") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Rick Chen <rick@andestech.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | | riscv: Add option to print registers on exceptionSean Anderson2020-02-103-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging, it can be helpful to see more information about an unhandled exception. This patch adds an option to view the registers at the time of the trap, similar to the linux output on a kernel panic. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | | riscv: Fix breakage caused by linker relaxationSean Anderson2020-02-101-1/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the two-instruction sequence needed to access arbitrary memory locations, the RISC-V linker aggressively optimises memory accesses and jumps at link-time. This is called "linker relaxation," and is discussed in this SiFive article <https://www.sifive.com/blog/all-aboard-part-3-linker-relaxation-in-riscv-toolchain>. One of the optimizations in place is to assume that the __global_pointer symbol is placed in the gp register. To quote the article: "...The magic __global_pointer$ symbol is defined to point 0x800 bytes past the start of the .sdata section. The 0x800 magic number allows signed 12-bit offsets from __global_pointer$ to address symbols at the start of the .sdata section. The linker assumes that if this symbol is defined, then the gp register contains that value, which it can then use to relax accesses to global symbols within that 12-bit range. The compiler treats the gp register as a constant so it doesn't need to be saved or restored, which means it is generally only written by _start, the ELF entry point." However, U-Boot instead keeps the global data pointer in gp. This causes memory accesses and jumps optimized to use the gp pointer to fail. To fix this problem, we undefine the __global_pointer symbol. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
* | | Merge branch '2020-02-07-master-imports'Tom Rini2020-02-0734-28/+1059
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | - 2 FAT fixes. - MediaTek ethernet support improvement. - Initial Cortina Access CAxxxx family support. - Correct return value of do_gpio() and so gpio shell command.
| * | | board: presidio-asic: Add basic G3 engr. development board supportAlex Nemirovsky2020-02-0711-0/+438
| | | | | | | | | | | | | | | | | | | | | | | | Add basic Presidio G3 engineering board support Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | serial: serial_cortina: add UART DM driver for CAxxxx SoCsJason Li2020-02-073-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add serial UART driver support for all Cortina Access CAxxxx family of SoCs. Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Jason Li <jason.li@cortina-access.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | watchdog: cortina_wdt: add support for HW WDT on CAxxxx SoCsJason Li2020-02-073-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for hardware watchdog timer on all Cortina Access CAxxxx family of SoCs. Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Jason Li <jason.li@cortina-access.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | gpio: cortina_gpio: add DM_GPIO driver for CAxxxx SoCsJason Li2020-02-073-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM_GPIO based GPIO controller driver for CAxxxx SoCs. This driver support multiple CPU architectures and Cortina Access SoC platforms. Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Jason Li <jason.li@cortina-access.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | gpio: do not include <asm/arch/gpio.h> for Cortina CAxxxx SoCsJason Li2020-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Cortina CAxxxx GPIO driver maintains DM_GPIO support across different CPU ISA in the CAxxxx Soc Family; Not just ARM. Therefore, it is not desirable to split out and maintain separete gpio header file for each CPU architecture. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jason Li <jason.li@cortina-access.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | MAINTAINERS, git-mailrc: cortina: add Custodian for Cortina Access Inc.Alex Nemirovsky2020-02-073-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assign Alex Nemirovsky as custodian for all Cortina Access (CA) for ARM and MIPS based SoCs. Currently Cortina Access CAxxxx family of SoCs support both ARM and MIPS ISA. Drivers have cross platform support for both architectures. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
| * | | mpc8xx: Expose show_regs()Tom Rini2020-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To match the other PowerPC platforms the function show_regs() must not be marked static but instead be an exposed global function. Cc: Christophe Leroy <christophe.leroy@c-s.fr> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Christophe Leroy <christophe.leroy@c-s.fr>
| * | | cmd/elf.c: Add SPDX tagTom Rini2020-02-071-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on reading the text of the license comment this appears to be the BSD-2-Clause license but with an imperfect word match as BSD-2-Clause was not (as far as I recall) a common license choice at the time the code was written. Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
| * | | configs: mediatek: enable mt7622 ethernet supportMarkLee2020-02-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This patch enable mt7622 ethernet support in its defconfig Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
| * | | eth: mtk-eth: aarch64: fix build warnings on ethernet-driverFrank Wunderlich2020-02-071-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | building mtk ethernet driver for aarch64 (mt7622) results in warnings/errors "error: cast from pointer to integer of different size" Fixes: 23f17164d9 ("ethernet: MediaTek: add ethernet driver for MediaTek ARM-based SoCs") Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
| * | | arm: dts: mediatek: add ethernet and sgmii dts node for mt7622MarkLee2020-02-072-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | This patch add eth and sgmii dts node for mt7622 to support ethernet Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
| * | | eth: mtk-eth: add mt7622 support in mediatek eth driverMarkLee2020-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch add mt7622 support in mediatek eth driver Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
| * | | eth: mtk-eth: add sgmii mode support in mediatek eth driverMarkLee2020-02-072-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add sgmii init part for the mediatek SoC that support sgmii mode. It is a must for mt7622. Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
| * | | fat: write: adjust data written in each partial writeMarek Szyprowski2020-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for handing file overwrite incorrectly calculated the amount of data to write when writing to the last non-cluster aligned chunk. Fix this by ensuring that no more data than the 'filesize' is written to disk. While touching min()-based calculations, change it to type-safe min_t() function. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> This patch finally fixes the issue revealed by the test script from the previous patch. The correctness of the change has been also verified by the following additional test scripts: --->8-fat_test2.sh--- #!/bin/bash make sandbox_defconfig make dd if=/dev/zero of=/tmp/10M.img bs=1024 count=10k mkfs.vfat -v /tmp/10M.img cat >/tmp/cmds <<EOF x host bind 0 /tmp/10M.img fatls host 0 mw 0x1000000 0x0a434241 0x1000 # "ABC\n" mw 0x1100000 0x0a464544 0x8000 # "DEF\n" fatwrite host 0 0x1000000 file0001.raw 0x1000 fatwrite host 0 0x1000000 file0002.raw 0x1000 fatwrite host 0 0x1000000 file0003.raw 0x1000 fatwrite host 0 0x1000000 file0004.raw 0x1000 fatwrite host 0 0x1000000 file0005.raw 0x1000 fatrm host 0 file0002.raw fatrm host 0 file0004.raw fatls host 0 fatwrite host 0 0x1100000 file0007.raw 0x2000 fatwrite host 0 0x1100000 file0007.raw 0x1f00 reset EOF ./u-boot </tmp/cmds #verify rm -r /tmp/result /tmp/model mkdir /tmp/result mkdir /tmp/model yes ABC | head -c 4096 >/tmp/model/file0001.raw yes ABC | head -c 4096 >/tmp/model/file0003.raw yes ABC | head -c 4096 >/tmp/model/file0005.raw yes DEF | head -c 7936 >/tmp/model/file0007.raw mcopy -n -i /tmp/10M.img ::file0001.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0003.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0005.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0007.raw /tmp/result hd /tmp/10M.img if diff -urq /tmp/model /tmp/result then echo Test okay else echo Test fail fi --->8-fat_test3.sh--- #!/bin/bash make sandbox_defconfig make dd if=/dev/zero of=/tmp/10M.img bs=1024 count=10k mkfs.vfat -v /tmp/10M.img cat >/tmp/cmds <<EOF x host bind 0 /tmp/10M.img fatls host 0 mw 0x1000000 0x0a434241 0x1000 # "ABC\n" mw 0x1100000 0x0a464544 0x8000 # "DEF\n" fatwrite host 0 0x1000000 file0001.raw 0x1000 fatwrite host 0 0x1000000 file0002.raw 0x1000 fatwrite host 0 0x1000000 file0003.raw 0x1000 fatwrite host 0 0x1000000 file0004.raw 0x1000 fatwrite host 0 0x1000000 file0005.raw 0x1000 fatrm host 0 file0002.raw fatrm host 0 file0004.raw fatls host 0 fatwrite host 0 0x1100000 file0007.raw 0x2000 fatwrite host 0 0x1100000 file0007.raw 0x2100 reset EOF ./u-boot </tmp/cmds #verify rm -r /tmp/result /tmp/model mkdir /tmp/result mkdir /tmp/model yes ABC | head -c 4096 >/tmp/model/file0001.raw yes ABC | head -c 4096 >/tmp/model/file0003.raw yes ABC | head -c 4096 >/tmp/model/file0005.raw yes DEF | head -c 8448 >/tmp/model/file0007.raw mcopy -n -i /tmp/10M.img ::file0001.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0003.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0005.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0007.raw /tmp/result hd /tmp/10M.img if diff -urq /tmp/model /tmp/result then echo Test okay else echo Test fail fi --->8-fat_test4.sh--- #!/bin/bash make sandbox_defconfig make dd if=/dev/zero of=/tmp/10M.img bs=1024 count=10k mkfs.vfat -v /tmp/10M.img cat >/tmp/cmds <<EOF x host bind 0 /tmp/10M.img fatls host 0 mw 0x1000000 0x0a434241 0x1000 # "ABC\n" mw 0x1100000 0x0a464544 0x8000 # "DEF\n" mw 0x1200000 0x0a494847 0x8000 # "GHI\n" fatwrite host 0 0x1000000 file0001.raw 0x1000 fatwrite host 0 0x1000000 file0002.raw 0x1000 fatwrite host 0 0x1000000 file0003.raw 0x1000 fatwrite host 0 0x1000000 file0004.raw 0x1000 fatwrite host 0 0x1000000 file0005.raw 0x1000 fatrm host 0 file0002.raw fatrm host 0 file0004.raw fatls host 0 fatwrite host 0 0x1100000 file0007.raw 0x900 fatwrite host 0 0x1200000 file0007.raw 0x900 0x900 fatwrite host 0 0x1100000 file0007.raw 0x900 0x1200 fatwrite host 0 0x1200000 file0007.raw 0x900 0x1b00 reset EOF ./u-boot </tmp/cmds #verify rm -r /tmp/result /tmp/model mkdir /tmp/result mkdir /tmp/model yes ABC | head -c 4096 >/tmp/model/file0001.raw yes ABC | head -c 4096 >/tmp/model/file0003.raw yes ABC | head -c 4096 >/tmp/model/file0005.raw yes DEF | head -c 2304 >/tmp/model/file0007.raw yes GHI | head -c 2304 >>/tmp/model/file0007.raw yes DEF | head -c 2304 >>/tmp/model/file0007.raw yes GHI | head -c 2304 >>/tmp/model/file0007.raw mcopy -n -i /tmp/10M.img ::file0001.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0003.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0005.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0007.raw /tmp/result hd /tmp/10M.img if diff -urq /tmp/model /tmp/result then echo Test okay else echo Test fail fi --->8--- Feel free to prepare a proper sandbox/py_test based tests based on the provided test scripts.
| * | | fat: write: fix broken write to fragmented filesMarek Szyprowski2020-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for handing file overwrite incorrectly assumed that the file on disk is always contiguous. This resulted in corrupting disk structure every time when write to existing fragmented file happened. Fix this by adding proper check for cluster discontinuity and adjust chunk size on each partial write. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> This patch partially fixes the issue revealed by the following test script: --->8-fat_test1.sh--- #!/bin/bash make sandbox_defconfig make dd if=/dev/zero of=/tmp/10M.img bs=1024 count=10k mkfs.vfat -v /tmp/10M.img cat >/tmp/cmds <<EOF x host bind 0 /tmp/10M.img fatls host 0 mw 0x1000000 0x0a434241 0x1000 # "ABC\n" mw 0x1100000 0x0a464544 0x8000 # "DEF\n" fatwrite host 0 0x1000000 file0001.raw 0x1000 fatwrite host 0 0x1000000 file0002.raw 0x1000 fatwrite host 0 0x1000000 file0003.raw 0x1000 fatwrite host 0 0x1000000 file0004.raw 0x1000 fatwrite host 0 0x1000000 file0005.raw 0x1000 fatrm host 0 file0002.raw fatrm host 0 file0004.raw fatls host 0 fatwrite host 0 0x1100000 file0007.raw 0x4000 fatwrite host 0 0x1100000 file0007.raw 0x4000 reset EOF ./u-boot </tmp/cmds #verify rm -r /tmp/result /tmp/model mkdir /tmp/result mkdir /tmp/model yes ABC | head -c 4096 >/tmp/model/file0001.raw yes ABC | head -c 4096 >/tmp/model/file0003.raw yes ABC | head -c 4096 >/tmp/model/file0005.raw yes DEF | head -c 16384 >/tmp/model/file0007.raw mcopy -n -i /tmp/10M.img ::file0001.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0003.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0005.raw /tmp/result mcopy -n -i /tmp/10M.img ::file0007.raw /tmp/result hd /tmp/10M.img if diff -urq /tmp/model /tmp/result then echo Test okay else echo Test fail fi --->8--- Overwritting a discontiguous test file (file0007.raw) no longer causes corruption to file0003.raw, which's data lies between the chunks of the test file. The amount of data written to disk is still incorrect, what causes damage to the file (file0005.raw), which's data lies next to the test file. This will be fixed by the next patch. Feel free to prepare a proper sandbox/py_test based tests based on the provided test scripts.
| * | | cmd: gpio: Correct do_gpio() return valueLuka Kovacic2020-02-072-7/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct return value in function do_gpio() and update commands documentation with the return values from command_ret_t enum. CMD_RET_SUCCESS is returned on command success and CMD_RET_FAILURE is returned on command failure. The command was returning the pin value, which caused confusion when debugging (#define DEBUG). Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Tested-by: Robert Marko <robert.marko@sartura.hr>
* | | azure/gitlab: Update to Docker to have SDL2 availableWIP/update-dockerTom Rini2020-02-072-2/+2
| | | | | | | | | | | | | | | | | | | | | Update to a newer Docker image that contains SDL2 libraries as required by recent Sandbox changes. Signed-off-by: Tom Rini <trini@konsulko.com>
* | | azure: Use our own GRUB binariesTom Rini2020-02-071-5/+4
| | | | | | | | | | | | | | | | | | | | | Use the same logic from 24df1b14f3ab to use our own GRUB binaries in Azure pipelines as well. Signed-off-by: Tom Rini <trini@konsulko.com>
* | | gitlab: use our own GRUBHeinrich Schuchardt2020-02-071-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now we have been relying on openSUSE repositories for GRUB on arm and arm64 though we have included GRUB in our Docker image. Use the GRUB included in our Docker image. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | Merge tag 'efi-2020-04-rc2' of ↵WIP/06Feb2020Tom Rini2020-02-062-212/+226
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-04-rc2 Fix pylint issues in Python based tests.
| * | | test: efi_selftest: fix pylint warningsHeinrich Schuchardt2020-02-051-174/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix pylint warnings: * add missing module and function documentation * correct indentation Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * | | test: test_efi_fit: fix pylint warningsHeinrich Schuchardt2020-02-051-38/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings issued by pylint: * naming of variables * usage of commas and semicolons * indentation * placement of module description Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | | Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini2020-02-0617-108/+398
|\ \ \ \ | |_|_|/ |/| | | | | | | - Gen 5 and Watchdog fixes
| * | | ddr: altera: Add DDR2 support to Gen5 driverMarek Vasut2020-02-056-70/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DDR2 support to Gen5 DRAM driver. As the DDR2 macro names generated by Quartus are named differently than the DDR3 ones, use anon unions to store them in the same structures, without growing their size. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Ley Foon Tan <ley.foon.tan@intel.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>