summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * arm: mach-imx: Allow to build mac.c for EQoS driverYe Li2021-10-211-0/+1
| | | | | | | | | | | | | | i.MX8MP has one DWC EQoS controller, so allow to build mac.c when only this driver is enabled. Signed-off-by: Ye Li <ye.li@nxp.com>
| * arm: mach-imx: Update MAC fuse for i.MX8MPYe Li2021-10-211-1/+1
| | | | | | | | | | | | | | | | i.MX8MP has two ENET controllers, have to update the function to enable loading two MAC addresses. Signed-off-by: Ye Li <ye.li@nxp.com> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * Merge branch 'master' of git://git.denx.de/u-bootStefano Babic2021-10-21631-5818/+10850
| |\ | | | | | | | | | Signed-off-by: Stefano Babic <sbabic@denx.de>
| * | doc: imx: psb: Add documentation for MX8MM behavior with Fast Boot fuse blownMarek Vasut2021-10-201-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On iMX8MM with Fast Boot fuse blown, the SIT and A-copy image are placed at different offset than on iMX8MM with Fast Boot fuse NOT blown. List both options and both offsets to avoid confusion. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Ye Li <ye.li@nxp.com> Cc: uboot-imx <uboot-imx@nxp.com> Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | doc: imx: psb: Fix PERSIST_SECONDARY_BOOT bit location in GPR10Marek Vasut2021-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PERSIST_SECONDARY_BOOT is in GPR10 address 0x30390098, adjust the text which currently says it is in GPR0 while using the correct address of GPR10. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Ye Li <ye.li@nxp.com> Cc: uboot-imx <uboot-imx@nxp.com> Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | colibri-imx6ull: add emmc variantMax Krummenacher2021-10-2010-48/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to build the eMMC variant of the Colibri iMX6ULL, i.e. the 'Colibri iMX6ULL 1GB' which has a eMMC instead of the raw NAND used on other SKUs. Related-to: ELB-4056, ELB-4057 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | colibri-imx6ull: imximage.cfg: integrate new 1GiB RAM variantPhilippe Schenker2021-10-202-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrate new Toradex SKU 0062 Colibri iMX6ULL 1GB IT. This commit basically adjusts three parameters of the RAM settings: Increase density from 4Gb to 8Gb Increase ROW address from 15 to 16 Increase tRFC (refresh command time) from 260 to 350 This timing is valid for all Toradex Colibri iMX6ULL SKUs Related-to: ELB-4055, ELB-4057 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | toradex: tdx-cfg-block: add new i.mx 6ull and 8m plus skusMarcel Ziswiler2021-10-202-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new i.MX 6ULL and 8M Plus SKUs to ConfigBlock handling: 0062: Colibri iMX6ULL 1GB IT (eMMC) 0063: Verdin iMX8M Plus Quad 4GB IT 0064: Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT 0065: Verdin iMX8M Plus QuadLite 1GB IT 0066: Verdin iMX8M Plus Quad 8GB Wi-Fi / BT Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | toradex: configblock: fix interactive mode it handlingDenys Drozdov2021-10-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore "Is the module an IT version? [y/N]" for "cfgblock create" interactive mode command, which was leading to invalid detection of 0051 Colibri iMX8DX 1GB WB module; Fixes: a5b5ad4d859b ("toradex: tdx-cfg-clock: add new i.mx 8m mini/plus skus") Related-to: ELB-3482 Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | toradex: take over maintainershipMarcel Ziswiler2021-10-209-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Also take over maintainership of remaining Toradex SoMs as Oleksandr has left our company. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> CC: Oleksandr Suvorov <cryosay@gmail.com>
| * | imx8mm-evk: Generate a single bootable flash.bin againFabio Estevam2021-10-203-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the conversion to binman in commit 8996e6b7c6a1 ("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed. Such new requirement breaks existing distro mechanisms to generate the final binary because the extra u-boot.itb is now required. Generate a final flash.bin that can be used again as a single bootable binary to keep the original behavior. After this change the SPL binary is called spl.bin, which is a more descriptive name for its purpose, and can still be used standalone (for example, for secure boot purposes). Also update imx8mm_evk.rst to remove the u-boot.itb copy step. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>
| * | colibri-imx6ull: fix setup of nand gpmi clockPhilippe Schenker2021-10-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NXP used to setup the gpmi clock root from gpmi_clk in early versions in their downstream BSP. [1] However on mainline the gpmi clock root was always setup from enfc since the beginning of the i.MX 6 series SoCs, which is still the same today. [2] NXP followed the mainline approach at some point and changed setup_gpmi_io_clk to setup gpmi clock root from enfc which left faulty code behind in our board file. [3] This commit follows the change of NXP as it improves the performance of the NAND from ~1.2 MiB/s to ~12 MiB/s. [3] This change was verified to work in recovery-mode and u-boot loaded from NAND on all four Colibri iMX6ULL SKUs from Toradex. The frequency used to read the NAND, measured on RE# (Read Enable): before this patch: 1.4 MHz after this patch: 22 MHz in Linux Kernel: 50 MHz [1] https://source.codeaurora.org/external/imx/uboot-imx/tree/arch/arm/cpu/armv7/mx6/clock.c?h=nxp/imx_v2016.03_4.1.15_2.0.0_ga#n62 [2] commit 23608e23fd65 ("i.mx: add the initial support for freescale i.MX6Q processor") [3] https://source.codeaurora.org/external/imx/uboot-imx/commit/?id=7a82a19ceabfb04bbc1591a67c99751748781c7d Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
| * | board: phytec: imx8mm-phycore: Switch to binmanTeresa Remmet2021-10-205-2/+134
| | | | | | | | | | | | | | | | | | Use binman for image creation. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | configs: phycore-imx8mm_defconfig: Enable clk commandTeresa Remmet2021-10-201-0/+1
| | | | | | | | | | | | | | | | | | Enable clk command to dump clock tree. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | board: phytec: phycore-imx8mm: Add SPI-NOR flash supportTeresa Remmet2021-10-202-0/+47
| | | | | | | | | | | | | | | | | | Adds SPI-NOR flash support to erase, read and write in bootloader. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | arm: dts: phycore-imx8mm: Fix propertyTeresa Remmet2021-10-201-1/+1
| | | | | | | | | | | | | | | | | | Fix misspelled property "stdout-path". Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | arm: dts: phycore-imx8mm-u-boot: Add wdog pinctrl entryTeresa Remmet2021-10-201-0/+4
| | | | | | | | | | | | | | | | | | Add missing pinctrl entry in spl. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | include: configs: phycore-imx8mm: Do not use macro for addressTeresa Remmet2021-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | Do not use size macros for addesses. So convert PHYS_SDRAM to address. No functional change. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | include: configs: phycore-imx8mm: Remove not needed definesTeresa Remmet2021-10-201-10/+1
| | | | | | | | | | | | | | | | | | Remove obsolet defines in phycore_imx8mm.h. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | include: configs: phycore_imx8mm: Remove hard coded network settingsTeresa Remmet2021-10-201-4/+1
| | | | | | | | | | | | | | | | | | | | | Remove ip address and server ip from board config as they should not be added hardcoded. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | board: phytec: phycore_imx8mm: Clean up splTeresa Remmet2021-10-201-18/+1
| | | | | | | | | | | | | | | | | | Remove not needed code in the spl board code. Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
| * | verdin-imx8mm: fix watchdog pinctrl issueMarcel Ziswiler2021-10-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finally, found the root cause of the issue already once mentioned back here [2] which caused the following error message during boot: imx_wdt watchdog@30280000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19 Turns out while the watchdog node itself was already u-boot,dm-spl its pinctrl node was not which caused it to be unavailable at that early stage. Note that any and all other boards I checked also seem to be missing this. However, I can't judge whether or not they might indeed need a similar fix or not. [2] https://marc.info/?l=u-boot&m=161786572422973 Fixes: commit d304e7ace3a6 ("ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin") Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | verdin-imx8mm: use preboot for fdtfile evaluationIgor Opaniuk2021-10-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable and set preboot var with fdtfile evaluation. It will be checked and run immediately before starting the CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp. entering interactive mode. This provides possibility to use different boot cmds in interactive mode without manual setting fdtfile value, as it it's already evaluated before entering interactive mode. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | include/configs: apalis-imx8/verdin-imx8mm: rename kernel image variableOleksandr Suvorov2021-10-202-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variable "kernel_image" is used in boot.scr script only, that sets its own default value to the constant string @@KERNEL_IMAGETYPE@@ in case "kernel_image" is not set. The default name of the kernel image shipped with BSP 5.x is "Image.gz". Setting kernel_image="Image" as a pre-defined u-boot variable breaks booting systems with modern versions of boot.scr, whereas renaming it fixes booting with modern scripts and does not break working of earlier versions of boot.scr. While at it also update the copyright period, rather than hard-coding fdtfile default fdt_board to dev for the Verdin iMX8M Mini and fix its closing #endif comment. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | verdin-imx8mm: drop support for v1.0 hardwareMax Krummenacher2021-10-201-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We drop support for Verdin iMX8M Mini V1.0B. Related-to: ELB-3551 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | verdin-imx8mm: clean-up include orderMarcel Ziswiler2021-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | Alphabetically order includes. While at it also update copyright year resp. period. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | verdin-imx8mm: enable sleep_moci outputMax Krummenacher2021-10-202-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | This powers some peripherals on the carrier board e.g. the USB hub. Related-to: ELB-3206 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | verdin-imx8mm: switch to use binman to pack imagesMarcel Ziswiler2021-10-205-34/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use binman to pack images. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de>
| * | arm64: dts: imx8mm-verdin-u-boot.dtsi: alphabetically re-orderMarcel Ziswiler2021-10-201-9/+9
| | | | | | | | | | | | | | | | | | Alphabetically re-order nodes and properties. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
| * | ARM: dts: imx8mm-verdin: prepare for dek blob encapsulationMarcel Ziswiler2021-10-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare for DEK blob encapsulation support through "dek_blob" command. On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob for encrypted boot. The DEK blob is encapsulated by OP-TEE through a trusted application call. U-boot sends and receives the DEK and the DEK blob binaries through OP-TEE dynamic shared memory. To enable the DEK blob encapsulation, add to the defconfig: CONFIG_SECURE_BOOT=y CONFIG_FAT_WRITE=y CONFIG_CMD_DEKBLOB=y Taken from NXP's commit 56d2050f4028 ("imx8m: Add DEK blob encapsulation for imx8m"). Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | verdin-imx8mm: fix ethernetMarcel Ziswiler2021-10-201-64/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out Microship (formerly Micrel) meanwhile integrated proper support for the DLL setup on their KSZ9131. Unfortunately, this conflicts with our previous board code doing that. Fix this by getting rid of our board code and just relying on the generic implementation relying on rgmii-id being used as phy-mode. Fixes: commit c6df0e2ffdc4 ("net: phy: micrel: add support for DLL setup on ksz9131") Fixes: commit af2d3c91d877 ("ARM: dts: imx8mm-verdin: Set PHY mode to RGMII-ID") Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
| * | imx8m: clean-up kconfig indentationMarcel Ziswiler2021-10-201-10/+10
| | | | | | | | | | | | | | | | | | | | | Replace spurious spaces with proper tabs. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
* | | Merge https://source.denx.de/u-boot/custodians/u-boot-spiTom Rini2021-10-2319-108/+159
|\ \ \ | | | | | | | | | | | | | | | | - Fix mtd erase with mtdpart (Marek Behún) - NXP fspi driver fixes (Kuldeep Singh)
| * | | spi: nxp_fspi: Implement errata workaround for LS1028AKuldeep Singh2021-10-231-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Errata ERR050568 description says that "Flash access by FlexSPI AHB command may not work with platform frequency equal to 300 MHz" on LS1028A. By default, smaller length reads(equal to RX FIFO size) are done by IP bus and larger length reads using AHB bus. For adding errata workaround, use IP bus to read entire flash contents and disable AHB path when platform frequency is 300Mhz. Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * | | spi: nxp-fspi: Add support for IP read onlyKuldeep Singh2021-10-231-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for disabling AHB bus and read entire flash contents via IP bus only. Please note, this enables IP bus read using a quirk which can be enabled directly in device-type data or in existence of an errata where AHB bus may need to be disabled. Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
| * | | mtd: spi-nor-ids: Add SECT_4K to mt25qu512aKris Chaplin2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mt25qu512a supports 4K or 64K sectors, so adding SECT_4K to enable 4K sector usage. Tested on Intel n5x hardware with QSPI carrier card Signed-off-by: Kris Chaplin <kris.chaplin@linux.intel.com> Acked-by: Pratyush Yadav <p.yadav@ti.com> [jagan: droped Tested-by of patch author and datasheet link] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * | | mtd: spi-nor-ids: Add is25lp512 and is25wp512 devicesKris Chaplin2021-10-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add is25lp512 and is25wp512 devices to spi-nor id table Tested on Intel n5x hardware with QSPI carrier card Signed-off-by: Kris Chaplin <kris.chaplin@linux.intel.com> [jagan: droped Tested-by of patch author] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * | | mtd: Remove mtd_erase_callback() entirelyMarek Behún2021-10-2315-91/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original purpose of mtd_erase_callback() in Linux at the time it was imported to U-Boot, was to inform the caller that erasing is done (since it was an asynchronous operation). All supplied callback methods in U-Boot do nothing, but the mtd_erase_callback() function was (until previous patch) grossly abused in U-Boot's mtdpart implementation for completely different purpose. Since we got rid of the abusement, remove the mtd_erase_callback() function and the .callback member from struct erase_info entirely, in order to avoid such problems in the future. Signed-off-by: Marek Behún <marek.behun@nic.cz>
| * | | mtd: mtdpart: Make mtdpart's _erase method saneMarek Behún2021-10-231-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _erase() method of the mtdpart driver, part_erase(), currently implements offset shifting (for given mtdpart partition) in a weird way: 1. part_erase() adds partition offset to block address 2. parent driver's _erase() method is called 3. parent driver's _erase() method calls mtd_erase_callback() 4. mtd_erase_callback() subtracts partition offset from block address so that the callback function is given correct address The problem here is that if the parent's driver does not call mtd_erase_callback() in some scenario (this was recently a case for spi_nor_erase(), which did not call mtd_erase_callback() at all), the offset is not shifted back. Moreover the code would be more readable if part_erase() not only added partition offset before calling parent's _erase(), but also subtracted it back afterwards. Currently the mtd_erase_callback() is expected to do this subtracting since it does have to do it anyway. Add the more steps to this procedure: 5. mtd_erase_callback() adds partition offset to block address so that it returns the the erase_info structure members as it received them 6. part_erase() subtracts partition offset from block address This makes the code more logical and also prevents errors in case parent's driver does not call mtd_erase_callback() for some reason. (BTW, the purpose of mtd_erase_callback() in Linux is to inform the caller that it is done, since in Linux erasing is done asynchronously. We are abusing the purpose of mtd_erase_callback() in U-Boot for completely different purpose. The callback function itself has empty implementation in all cases in U-Boot.) Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase()Marek Behún2021-10-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | May it possible to interrupt the spi_nor_erase() function. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Call mtd_erase_callback() from spi_nor_erase()Marek Behún2021-10-231-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spi_nor_erase() function does not call mtd_erase_callback() as it should. The mtdpart code currently implements the subtraction of partition offset in mtd_erase_callback(). This results in partition offset being added prior calling spi_nor_erase(), but not subtracted back on return. The result is that the `mtd erase` command does not erase the whole partition, only some of it's blocks: => mtd erase "Rescue system" Erasing 0x00000000 ... 0x006fffff (1792 eraseblock(s)) jedec_spi_nor spi-nor@0: at 0x100000, len 4096 jedec_spi_nor spi-nor@0: at 0x201000, len 4096 jedec_spi_nor spi-nor@0: at 0x302000, len 4096 jedec_spi_nor spi-nor@0: at 0x403000, len 4096 jedec_spi_nor spi-nor@0: at 0x504000, len 4096 jedec_spi_nor spi-nor@0: at 0x605000, len 4096 jedec_spi_nor spi-nor@0: at 0x706000, len 4096 This is obviously wrong. Add proper calling of mtd_erase_callback() into the spi_nor_erase() function. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reported-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Don't check for zero length in spi_nor_write() / ↵Marek Behún2021-10-231-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spi_nor_erase() This check is already done in all callers: mtdcore's mtd_write() / mtd_erase(), legacy spi_nor_write() / spi_flash_erase(). No reason to do this here as well. Signed-off-by: Marek Behún <marek.behun@nic.cz>
| * | | mtd: spi-flash: Check for zero length in legacy spi_flash_*()Marek Behún2021-10-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for zero length in the legacy spi_flash_read() / spi_flash_write() / spi_flash_erase() functions. On zero length, return 0 immediately, don't call the underlying method. Rationale: - these legacy functions call the _read(), _write() and _erase() methods of struct mtd - the DM callers of these methods already check for zero length - making all callers of these methods check for zero length makes it possible to remove the check from implementations of these _read(), _write() and _erase() methods Signed-off-by: Marek Behún <marek.behun@nic.cz>
| * | | mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase()Marek Behún2021-10-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup code of spi_nor_erase() function calls write_disable(), but does not return it's return value even in case of failure. Fix this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Don't overwrite return value if it is non-zeroMarek Behún2021-10-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup code of the spi_nor_erase() function overwrites the ret variable with return value of clean_bar(), even if the ret variable is already set. Fix this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Check return value of write_enable() in spi_nor_erase()Marek Behún2021-10-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spi_nor_erase() function does not check return value of the write_enable() call. Fix this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor-core: Try cleaning up in case writing BAR failedMarek Behún2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the cleanup codepath of spi_nor_erase() also in the event of failure of writing the BAR register. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
| * | | mtd: spi-nor: Add support for Spansion S25FL256LTakahiro Kuwano2021-10-232-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The S25FL256L is a part of the S25FL-L family and has the same feature set as S25FL128L except the density. The datasheet can be found in the following link. https://www.cypress.com/file/316171/download The S25FL256L is 32MB NOR Flash that does not support Bank Address Register. This fixup is activated if CONFIG_SPI_FLASH_BAR is enabled and returns ENOTSUPP in setup() hook to avoid further ops. Tested on Xilinx Zynq-7000 FPGA board. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
| * | | mtd: spi-nor-ids: Add GD25LQ256D ChipYanhong Wang2021-10-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Gigadevice GD25LQ256D SPI NOR chip. https://www.gigadevice.com/datasheet/gd25lq256d/ Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [jagan: updated commit message] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * | | mtd: spi-nor-ids: Reinstate Micron MT25QL02GMarek Vasut2021-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ID disappeared in 5b66fdb29dc ("mtd: spi: Remove unused files"), add the ID back, since the chip is used on devices supported by U-Boot. Fixes: 5b66fdb29dc ("mtd: spi: Remove unused files") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Horatiu Vultur <horatiu.vultur@microchip.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Vignesh R <vigneshr@ti.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>