summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* dts: update to v5.10-rc5Sascha Hauer2020-12-0145-85/+73
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dts: update to v5.10-rc4Sascha Hauer2020-12-013-8/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: retire CONFIG_LINUX symbol in favor of CONFIG_SANDBOXAhmad Fatoum2020-11-275-10/+6
| | | | | | | | | | | | | 5211e428cbab ("image: Convert the IH_... values to enums") removed the IH_ARCH_LINUX enumeration value leading to breakage of sandbox configurations that enable bootm. Instead of reinstating IH_ARCH_LINUX, just use IH_ARCH_SANDBOX and remove mention of CONFIG_LINUX altogether, it's always true anyway when CONFIG_SANDBOX is true. Fixes: 5211e428cbab ("image: Convert the IH_... values to enums") Cc: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usbgadget: autostart: don't print error on repeated nv.usbgadget.autostart=1Ahmad Fatoum2020-11-241-2/+8
| | | | | | | | | | | | | | | | | | | | | | nvvar_add results in two calls to dev_set_param: - once when the existing global variable is found and set - once more when setting the nv variable This results in an annoying but ultimately harmless message on startup: ERROR: USB multi gadget already registered ERROR: failed to create nv variable usbgadget.autostart: Device or resource busy Avoid this by ignoring usbgadget.autostart=1 after it succeeded once. This issue should only affect $global.usbgadget.autostart, because all other global variables are "simple" meaning that they have no setters triggered. Fixes: 5a5c5178e7dc ("usbgadget: autostart: support delayed usbgadget.autostart=1") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: bcm283x: fix mix up regarding SoC on raspberry pi zeroAhmad Fatoum2020-11-231-2/+2
| | | | | | | | The Raspberry Pi Zero has the same ARMv6 SoC as the very first Raspberry Pi 1, not an ARMv8. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: fastboot: fix no longer accurate help textAhmad Fatoum2020-11-231-1/+1
| | | | | | | | Since 38d7ba55da26 ("fastboot: rename usbgadget.fastboot_* variables to fastboot.*"), the variables are named differently. Amend the help text. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: state: clarify how to access state device parametersAhmad Fatoum2020-11-131-3/+3
| | | | | | | | | | | | Users may be inclined to use hyphens in state variable names as this is customary for device tree nodes. Such variables can't be read with $state.example-variable or written with state.example-variable=, because it's incompatible with Hush. Adjust the documentation to nudge users into the correct direction (${state.example-variabe} and setenv) Suggested-by: Matthias Fend <Matthias.Fend@wolfvision.net> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: add note about characters like hyphens in variable namesAhmad Fatoum2020-11-131-1/+8
| | | | | | | | | | | | | | The mismatch between the allowed characters in shell variables and device parameters is a common pitfall, especially because device tree node names often have hyphens in them, which is disallowed by hush. While such variables can be read by the ${variable-example}, setting them is only possible with the setenv command. Reflect this in the documentation. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/Makefile: Fix dependencySascha Hauer2020-11-131-1/+1
| | | | | | | | | pbl object files have been renamed from pbl-*.o to *.pbl.o. Fix another place which hasn't been renamed. Fixes: ff047395b9 ("kbuild: rename pbl object pbl-*.o to *.pbl.o") Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand-imx: fix passing pointer of wrong type on NAND_CMD_READOOBAhmad Fatoum2020-11-131-1/+1
| | | | | | | | | | | | copy_spare used to take a mtd_info, but since 5f605dc6168c ("mtd: nand: Pass struct nand_chip around") it now takes a nand_chip. 3588d40c5385 ("mtd: nand-imx: repair reading the oob area") was drafted in parallel and still passes a mtd_info. Their merge did not adjust this, triggering a compiler warning and undefined behavior. Fix this. Fixes: 7b1d8b4b3561 ("Merge branch 'for-next/mtd-nand'") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nv: fix use-after-free when clearing from shellAhmad Fatoum2020-11-131-8/+4
| | | | | | | | | | | | | | | | | When we use hush to set the same nv.var twice to the empty string: $ nv.user= $ nv.user= nv_set is called twice with a NULL val argument leading to a double free and accompanied memory corruption. Reorder the code, so p->value is freed just once. Fixes: fa4c41ba60af ("nvvar: when setting a nvvar to NULL just free the content") Cc: Holger Assmann <has@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX: esdctl: Add missing compatibleSascha Hauer2020-11-131-0/+3
| | | | | | | The i.MX8mm has "fsl,imx8mm-ddrc" as compatible, add it to the list of matching nodes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: nxp i.MX8MP evk: make locally used data staticSascha Hauer2020-11-131-9/+9
| | | | | | | Make locally used data static so that it doesn't conflict with other data with the same name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvmem: ocotp: fix fusing on fsl,imx6q-ocotp compatible boardsRobin van der Gracht2020-11-121-0/+2
| | | | | | | | | | The imx6q_ocotp_data struct is incomplete resulting in a crash when trying to read/blow fuses. Fixes: 17cba91885d9 ("nvmem: ocotp: read/write i.MX7 support") Signed-off-by: Robin van der Gracht <robin@protonic.nl> Reviewed-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>