summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ARM: qemu: add support for qemu virt platformRouven Czerwinski2020-11-125-1/+43
| | | | | | | | | | Necessary support to boot barebox on ARM qemu virt platforms. No internal device tree, since it is passed by qemu. Therefore it employs the generic 2nd stage image as the low level code and only adds a virt specific board driver. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: vexpress: move Options to ARCH_VEXPRESSRouven Czerwinski2020-11-122-9/+5
| | | | | | | | | In preparation for the qemu virt image, move the KConfig options from MACH_VEXPRESS to ARCH_VEXPRESS. Also remove the choice, since we allow multiple boards to be selected with HAVE_PBL_MULTI_IMAGES. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: vexpress: convert to board driverRouven Czerwinski2020-11-121-29/+40
| | | | | Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: vexpress: remove unused KConfig fileRouven Czerwinski2020-11-121-8/+0
| | | | | Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* amba: add *_amba_driver helper macrosRouven Czerwinski2020-11-124-14/+10
| | | | | | | | | Reuse the flexible register_driver_macro() to add {device,coredevice,console}_amba_driver to get rid of the init boilerplate code used within the amba drivers. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: layerscape: ppa: Fix use after freeSascha Hauer2020-11-111-0/+1
| | | | | | | | | | | | In of_psci_do_fixup() we want to delete the one job-ring device node which is used by the PPA secure firmware. When we have deleted the node we may not continue the for_each_compatible_node_from() loop, because that would derefence the just deleted node. We only want to delete a single node, so we do not need to continue the loop once we've found the node, so we can fix the issue by breaking out of the loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: Fix dependeny on CONFIG_NAND_BBTSascha Hauer2020-11-112-2/+1
| | | | | | | CONFIG_NAND_BBT no longer exists, so remove the remaining occurences. Fixes: b6bcd96de5 ("mtd: nand: Update to Linux-5.9") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox'Sascha Hauer2020-11-102-20/+3
|\
| * Revert "common: ubsan: ignore shifting one into sign bit"Ahmad Fatoum2020-10-191-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | With the previous commit, we now explicitly tell GCC not to optimize constructs like (1 << 31) under assumption that they are undefined anyway. GCC >= 8.0 -fsanitize=undefined should now not warn any longer about (1 << 31) instances, so remove our work around. This reverts commit 55397b9ebe3a21a3aeb6a98131c0991bff0f7123. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: force compiler to assume two's complementAhmad Fatoum2020-10-191-0/+3
| | | | | | | | | | | | | | | | | | The kernel is compiled with this option and kernel code we port assumes that integer types are two's complement, so play it safe and disable optimizations that are possibly buggy in respect to barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd-nand'Sascha Hauer2020-11-1086-6094/+14454
|\ \
| * | nand command: Allow offsets with [kM] suffixesSascha Hauer2020-11-101-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nand command: Print OOB informationSascha Hauer2020-11-103-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | NAND mtd devices carry information how the OOB area is used. So far there is no way to visualize it, so print it along with other NAND informations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: atmel: Fix pmecc ecc settingsSascha Hauer2020-11-101-42/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pmecc has hardcoded steps of 1 and ecc size of the nand chips page size. This is wrong, the ECC engine does 512 or 1024 bytes per step. Adjust ecc size and step size accordingly. Also, fix ecc strength which was hardcoded to 1. With this the correct number of bitflips is reported, which should be the number of bitflips per ecc step, not the one for the whole page. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: atmel: drop dead codeSascha Hauer2020-11-101-22/+0
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: atmel: Return number of bitflipsSascha Hauer2020-11-101-5/+5
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: denali: Update to Linux-5.9Sascha Hauer2020-11-103-1572/+1338
| | | | | | | | | | | | | | | | | | | | | The denali NAND driver is in an hopeless outdated state, it can't even check the ECC data. Throw in the denali driver from Linux-5.9. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Update to Linux-5.9Sascha Hauer2020-11-1070-3674/+12349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the barebox NAND layer and parts of the mtd layer to Linux-5.9. This patch is huge, but the barebox NAND layer is so far away from the Linux NAND layer that a step by step update would have taken ages. Unlike Linux barebox has functions to mark a block as good. This feature has been preserved. Also barebox used to make NAND write support optional, this feature is lost during the update for the sake of better compatibility to the Linux NAND layer. This patch has been tested: - GPMI aka nand_mxs on i.MX6 - nand_imx on i.MX25 - nand_omap_gpmc on AM335x - atmel_nand on Atmel sama5d3 - nand_denali on SoCFPGA Currently untested: - nand_orion - nand_mrvl_nfc - nand_s3c24xx The nand_denali driver is tested with the update of that driver to Linux-5.9 following in the next patch. I could only test the drivers with the NAND chips found on my boards, so there's still enough room for regressions, especially given that the NAND drivers themselves are mostly not updated. With the NAND layer being up-to-date with Linux it should hopefully be easy to update drivers to their Linux counterpart as well if necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: orion: Use nand_to_mtd()Sascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | We have a function for getting from the struct nand_chip * to the struct mtd_info *, so use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: gpmi: Use nand_to_mtd()Sascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | We have a function for getting from the struct nand_chip * to the struct mtd_info *, so use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: marvell: Use nand_to_mtd()Sascha Hauer2020-11-091-8/+18
| | | | | | | | | | | | | | | | | | | | | We have a function for getting from the struct nand_chip * to the struct mtd_info *, so use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: denali: Drop multichip supportSascha Hauer2020-11-091-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | Current multichip support doesn't fir well into the coming update to the NAND layer. Remove it for now, it will be added back when the denali NAND driver is updated to current Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: omap_gpmc: Add missing bch16 stringSascha Hauer2020-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | We support bch16_hw in the OMAP NAND driver, but we cannot show it in the eccmode parameter. Add the missing string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: omap_gpmc: Fix wrong length checkSascha Hauer2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | We may only write more characters when there's actually something left to write. Fix the wrong check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: omap_gpmc: Drop unused variableSascha Hauer2020-11-091-4/+0
| | | | | | | | | | | | | | | | | | nand->controller is set but never used. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: Add ecc_step_sizeSascha Hauer2020-11-092-0/+4
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: move function hooks to struct nand_legacySascha Hauer2020-11-0912-368/+379
| | | | | | | | | | | | | | | | | | | | | Linux had moved the traditional nand function hooks to an extra struct nand_legacy. Do the same in barebox for compatibility. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib: Add match_string()Sascha Hauer2020-11-092-0/+36
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: rename master to parentSascha Hauer2020-11-096-28/+34
| | | | | | | | | | | | | | | | | | | | | In Linux mtd->parent is what in barebox is mtd->master. Rename this to get closer to the Linux mtd layer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: rename class_dev to devSascha Hauer2020-11-0923-71/+71
| | | | | | | | | | | | | | | | | | | | | | | | The mtds own device is named 'dev' in the Kernel whereas it's named 'class_dev' in barebox. Rename it to 'dev' for better compatilibility to the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: Use classdev->parentSascha Hauer2020-11-0918-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of mtd->parent we can use mtd->classdev.parent which points to the same device. With this we can remove the 'parent' member of struct mtd_info. This member exists in the Linux kernel as well, but is of type struct mtd_info, so this is done as preparation to re-add mtd->parent with the same type as in Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: Add underscore prefix to mtd hooksSascha Hauer2020-11-0611-124/+124
| | | | | | | | | | | | | | | | | | | | | In the Kernel the mtd function hooks begin with an underscore. Do the same in barebox to be better comparable to the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Pass struct nand_chip aroundSascha Hauer2020-11-0616-902/+845
| | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally Linux passed a struct mtd_info * around as context between the different functions. This has been changed to a struct nand_chip *. Do the same for barebox as well as another step towards updating the NAND layer to current Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: drop unused errstat hookSascha Hauer2020-11-062-20/+0
| | | | | | | | | | | | | | | | | | chip->errstat is never set by any driver, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: drop unused erase_cmd hookSascha Hauer2020-11-062-5/+1
| | | | | | | | | | | | | | | | | | chip->erase_cmd is never used, so remove this hook. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: remove unused header fileSascha Hauer2020-11-061-32/+0
| | | | | | | | | | | | | | | | | | nand.h is unused, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: Drop asynchronous erase supportSascha Hauer2020-11-0610-70/+9
| | | | | | | | | | | | | | | | | | | | | asynchronous erase support is unused and also dropped from the Kernel, so remove it from barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2020-11-1053-454/+1290
|\ \ \
| * | | of: base: ignore disabled memory nodesRouven Czerwinski2020-11-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qemu with the secure extension enabled will insert a secram node into the device tree: secram@e000000 { secure-status = "okay"; status = "disabled"; reg = <0x0 0xe000000 0x0 0x1000000>; device_type = "memory"; }; Barebox would previously parse this node, add it as a memory bank and than reinsert an enabled node into the fixed up device tree. Fix this by skipping disabled memory nodes. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nfs: check return value of various rpc callsUwe Kleine-König2020-11-091-11/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check more carefully for failing requests. This improves the error message when trying to mount a non-exported nfs directory from: nfs_mount_req: file handle too big: 44831 to ERROR: NFS: Mounting failed: Permission denied . This also fixes an out-of-bounds access as the filehandle size (44831 above) is read from just after the network packet in the error case. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | i2c_probe: Use "read_byte" command for probingAlexander Shiyan2020-11-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some I2C adapters do not allow zero length data transfers, such as the AM335X. To use the i2c_probe command, let's use byte reading for this purpose. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mxs: always build mxsimage and mxsboot toolsRoland Hieber2020-11-092-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both tools are used unconditionally by images/Makefile.mxs. Always build them for ARCH_MXS, and remove their prompt in the host tools section, as they are not really useful as stand-alone tools. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | sandbox: remove MXS tools from hosttools_defconfigRoland Hieber2020-11-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_MXS_HOSTTOOLS currently only builds the tools mxsimage and mxsboot, which are both only needed to create bootable images for the MXS platform, and are not really useful as stand-alone host tools. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | commands: import memtester 4.3.0 from Debian GNU/LinuxPeter Mamonov2020-11-029-0/+906
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memtester is an utility for testing the memory subsystem for faults. For hardware developers, memtester can be told to test memory starting at a particular physical address. This port is based on the sources from Debian GNU/Linux. Debian package meta data is as follows: Package: memtester Version: 4.3.0-5 Homepage: http://pyropus.ca/software/memtester/ APT-Sources: http://ftp.ru.debian.org/debian testing/main amd64 Packages Dissected version of this patch can be found at https://github.com/pmamonov/barebox/commits/memtester Changes since v2: 6fe3d86f9b add prefix to global variables names 81441f8ff8 drop `volatile` for buf/aligned pointers 336d1ddf5f close memfd if mmap() failed 4b52d3990d define rand32() as random32() 9fa593f130 tests: make global vars static ce00f1aadb fix error handling when parsing arguments 5107cc4b19 don't flush the console Changes since v1: 1acbafe7a2 init global vars on start 7664692fd4 use proper return value a10eba5b49 use strtoull_suffix() to parse memory size 001b623c16 add option to set TESTMASK 3acfe07d56 make tests[] static 528360ebd7 fix license Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | arm: imx: Convert mach headers to SPDXUwe Kleine-König2020-11-0219-272/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace license and copyright boilerplate by SPDX identfiers for files identified as GPL-2.0-only or GPL-2.0-or-later by licensecheck. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx: Fix copyright claimUwe Kleine-König2020-11-021-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file was created by me in commit c0fcf4dde3c9 ("ARM: i.MX7: provide DDR register definitions") and obviously I failed to adapt our copyright template. While at it, convert to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-11-028-113/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand-imx: repair reading the oob areaUwe Kleine-König2020-10-231-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After sending the READOOB command the core (in nand_read_oob_std()) uses the read_buf callback to fetch the result. So in the imx driver it is necessary to emit the NFC_OUTPUT command to make the controller actually read the requested data into the internal buffer and then copy the data to the location where read_buf expects it. This fixes reading from /dev/nand0.oob and also (somewhat) reading bad block markers in the absence of a bad block table. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | uimage: disable zero page when loading to SDRAM at address 0x0Michael Tretter2020-10-221-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the SDRAM is mapped to address 0x0 and an image should be loaded to to the SDRAM without offset, Barebox would normally trap the access as a null pointer. However, since Linux kernel commit cfa7ede20f13 ("arm64: set TEXT_OFFSET to 0x0 in preparation for removing it entirely") no offset is the default for arm64. Therefore, copying the image to 0x0 of the SDRAM is necessary. Disable the zero page trap for copying an image to address 0x0. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: mmu64: allow to disable null pointer trap on zero pageMichael Tretter2020-10-224-1/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Barebox uses the zero page to trap NULL pointer dereferences. However, if the SDRAM starts at address 0x0, this makes the first page of the SDRAM inaccessible and makes it impossible to load images to offset 0x0 in the SDRAM. Trapping NULL pointer dereferences on such systems is still desirable. Therefore, add a function to disable the traps if accessing the zero page is necessary and to re-enable the traps after the access is done. The zero_page_memcpy function simplifies copying to the SDRAM, because this is the most common required functionality, but memtest also accesses the zero page and does not use memcpy. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>