summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* i2c_probe: limit slave addresses to [0x04, 0x77]Uwe Kleine-König2019-01-281-4/+6
| | | | | | | | | | | | | | | Adresses below 0x04 and above 0x77 are reserved in the i2c bus specification, so don't probe these addresses unless requested explicitly. Also do more strict boundary checking: - ensure start address is greater or equal to zero; - don't decrease stopaddr after checking it being greater or equal to startaddr. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gen-dtb-s: annotate magic values with their meaningUwe Kleine-König2019-01-281-2/+2
| | | | | | | | | This helps understand how the imd stuff works because now $(git grep IMD_TYPE_OF_COMPATIBLE) also matches the critical code location that creates the imd entry. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: image-sparse: Mark sparse_seek() as staticAndrey Smirnov2019-01-281-1/+1
| | | | | | | Mark sparse_seek() as static to avoid -Wmissing-prototypes warnings Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* unlink_recursive: Drop struct dataAndrey Smirnov2019-01-241-20/+7
| | | | | | | | Drop struct data which doesn't seem to serve any purpose in the code and looks like a leftover. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ls: Adjust amount of space allocated for filesizeAndrey Smirnov2019-01-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maximum file size on 64-bit system is 2^63-1 (9223372036854775807), which takes more that 14 characters of space. In order to keep things properly aligned adjust that spacing to 20 on 64-bit platforms. Before: ls -l /dev/ d--------- 0 . d--------- 0 .. crw------- 16384 dds-eeprom crw------- 256 e1000-invm0 crw------- 16384 eeprom0 cr-------- 0 full crw------- 2048 imx-ocotp crw------- 16384 main-eeprom crw------- 64 mdio0-phy00 crw------- 9223372036854775807 mem c-w------- 0 netconsole-1 c-w------- 0 null crw------- 256060514304 nvme0n1 cr-------- 0 prng crw------- 4294967296 ram0 c-w------- 0 serial0-1 cr-------- 0 zero After: ls -l /dev/ d--------- 0 . d--------- 0 .. crw------- 16384 dds-eeprom crw------- 256 e1000-invm0 crw------- 16384 eeprom0 cr-------- 0 full crw------- 2048 imx-ocotp crw------- 16384 main-eeprom crw------- 64 mdio0-phy00 crw------- 9223372036854775807 mem c-w------- 0 netconsole-1 c-w------- 0 null crw------- 256060514304 nvme0n1 cr-------- 0 prng crw------- 4294967296 ram0 c-w------- 0 serial0-1 cr-------- 0 zero Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Move shared code in get_chunk() out of if statementAndrey Smirnov2019-01-221-3/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Do not write past block device boundary during a flushAndrey Smirnov2019-01-221-9/+13
| | | | | | | | | | | | When calling I/O functions of underlying block device driver we always need to make sure that its size is small enough to not go past device's boundary. Not only in get_chunk() and block_cache(), but in writebuffer_flush() as well. Since the same code is used in three different places, move it into a subroutine and adjust all of the calls to ->write()/->read() accordingly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: prevent null pointer referenceRoland Hieber2019-01-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After flashing a bogus UBI image, e.g. when the UBI is bigger than the available flash size, it can happen that barebox hangs itself with a stacktrace when the board code or the environment does a ubi_attach() on boot: ERROR: ubi0 error: init_volumes: not enough PEBs, required 7478, available 4024 unable to handle NULL pointer dereference at address 0x00000204 pc : [<1fd1eaf2>] lr : [<1fd15aad>] sp : 1feefd30 ip : 0000000a fp : 1fd5d1d7 r10: 00001d34 r9 : 00000000 r8 : 1fd5d540 r7 : 14983148 r6 : 00000006 r5 : ffffffe4 r4 : 14983004 r3 : 1fd82bfc r2 : 021f0000 r1 : 0000000a r0 : 00000000 Flags: nzcv IRQs off FIQs off Mode SVC_32 [<1fd1eaf2>] (ubi_fastmap_destroy_checkmap+0x8/0xa) from [<1fd15aad>] (ubi_read_volume_table+0x4d9/0x71c) [<1fd15aad>] (ubi_read_volume_table+0x4d9/0x71c) from [<1fd1cbf7>] (ubi_attach+0x157/0x1f8) [<1fd1cbf7>] (ubi_attach+0x157/0x1f8) from [<1fd16ec3>] (ubi_attach_mtd_dev+0x4a3/0x954) [...] After this change, barebox at least boots to a prompt where the faulty flash can be repaired: ERROR: ubi0 error: init_volumes: not enough PEBs, required 7478, available 4024 ERROR: ubi0 error: ubi_attach_mtd_dev: failed to attach mtd0, error -28 [...] running /env/bin/init... barebox@boardname:/ Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: netx: delete unused netx-devices.hAlexander Shiyan2019-01-211-73/+0
| | | | | | | This removes the stale netx-devices.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: delete unused mach/sama5d3_matrix.hAlexander Shiyan2019-01-211-15/+0
| | | | | | | This removes the stale mach/sama5d3_matrix.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PPC: delete unused asm/mc146818rtc.hAlexander Shiyan2019-01-211-27/+0
| | | | | | | This removes the stale asm/mc146818rtc.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PPC: delete unused asm/e300.hAlexander Shiyan2019-01-211-130/+0
| | | | | | | This removes the stale asm/e300.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: delete unused mach/dove.hAlexander Shiyan2019-01-211-23/+0
| | | | | | | This removes the stale mach/dove.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: imx: delete unused mach/clock-imx1.hAlexander Shiyan2019-01-211-5/+0
| | | | | | | This removes the stale mach/clock-imx1.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: delete unused mach/am33xx-devices.hAlexander Shiyan2019-01-211-80/+0
| | | | | | | This removes the stale mach/am33xx-devices.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: delete unused mach/kirkwood.hAlexander Shiyan2019-01-211-22/+0
| | | | | | | This removes the stale mach/kirkwood.h include as there is no user of it. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: make it a little bit less verboseVivien Didelot2019-01-211-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current boot code prints too much error messages without much value in them. This patch prints the error string when it makes sense and simplifies the return path of bootscript_boot(). Make use of pr_err() in boot_entry() which is the shared code responsible for calling the boot_entry->boot callback. Remove the unnecessary print statement from bootsource_action() as well. This removes a single print statement ATM, allowing us to go from this: booting 'sd' Cannot set parameter mci0.probe: No such device running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed could not open /mnt/sd/zImage: No such device ERROR: Booting 'sd' failed: No such device booting 'sd' failed: No such device boot: No such device to this: Booting entry 'sd' Cannot set parameter mci0.probe: No such device running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed could not open /mnt/sd/zImage: No such device ERROR: Booting entry 'sd' failed boot: No such device Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv-2: centralize nfs commands for 'net'Vivien Didelot2019-01-211-4/+2
| | | | | | | | | | Setting the nfsroot variable as well as the kernel bootargs for the interface used to reach the server is specific to nfs, which are used only if there's no initramfs to load from tftp. Move these statements within the condition. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv-2: trigger DHCP before booting 'net'Vivien Didelot2019-01-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some variables may be set from DHCP requests, as shown below: barebox@ZII VF610 Development Board, Rev C:/ echo $global.hostname dev-rev-c barebox@ZII VF610 Development Board, Rev C:/ echo $global.net.server 0.0.0.0 barebox@ZII VF610 Development Board, Rev C:/ dhcp eth0: 100Mbps full duplex link detected T T T eth0: DHCP client bound to address 192.168.203.31 barebox@ZII VF610 Development Board, Rev C:/ echo $global.hostname zii-dev-rev-c-1 barebox@ZII VF610 Development Board, Rev C:/ echo $global.net.server 192.168.203.1 barebox@ZII VF610 Development Board, Rev C:/ These variables are used by the boot/net script, so it is necessary to trigger DHCP before we set the TFTP file paths, otherwise booting from net will fail like below and will need to be triggered twice: running /env/bin/init... Hit m for menu or any key to stop autoboot: 1 booting 'net' eth0: 100Mbps full duplex link detected T T T eth0: DHCP client bound to address 192.168.203.31 WARNING: eth1: No MAC address set. Using random address 8a:ee:18:f5:98:e7 T T T T T T T T T T T T T T T T T T T T could not open /mnt/tftp/none-linux-dev-rev-c: No such file or directory ERROR: Booting 'net' failed: No such file or directory boot: No such file or directory type exit to get to the menu barebox@ZII VF610 Development Board, Rev C:/ boot booting 'net' Loading ARM Linux zImage '/mnt/tftp/none-linux-zii-dev-rev-c-1' Loaded initrd unknown '/mnt/tftp/none-initramfs-zii-dev-rev-c-1' initrd is at 0x82509000-0x835593ff Loading devicetree from '/mnt/tftp/none-oftree-zii-dev-rev-c-1' commandline: console=ttyLP0,115200n8 ip=dhcp Ucompressing Linux... done, booting the kernel. To fix this, bring the interfaces up before setting up tftpboot. Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Remove reference to non-existent HAVE_DEFAULT_ENVIRONMENT_NEW symbolAlexander Shiyan2019-01-211-1/+0
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: qemu-virt64: Remove orphan KconfigAlexander Shiyan2019-01-211-8/+0
| | | | | | | | arch/arm/boards/qemu-virt64/Kconfig is not used by build system, so it can be removed. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Remove trailing whitespaces and tabsAlexander Shiyan2019-01-2110-13/+13
| | | | | | | Just a cleanup over barebox tree Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kconfig: remove unused zconf.hash.cMasahiro Yamada2019-01-211-289/+0
| | | | | | | | | | For some reasons, I missed to delete this file in commit 997b70f585ef ("kconfig: sync to Linux 4.20"). Now really synced with Linux 4.20. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: strtox: Use plumbing from kstrtox.cAndrey Smirnov2019-01-211-54/+48
| | | | | | | | | Sync up implemenations of simple_str*() functions with their kernel counterparts in order to convert the code to use plumbing from kstrtox.c Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: i.MX: Kindle 4/5: fix sphinx warningsRoland Hieber2019-01-211-2/+4
| | | | | | | | | | | | | sphinx warns: Documentation/boards/imx/amazon-kindle-4-5.rst:39: WARNING: Enumerated list ends without a blank line; unexpected unindent. Documentation/boards/imx/amazon-kindle-4-5.rst:42: WARNING: Enumerated list ends without a blank line; unexpected unindent. Documentation/boards/imx/amazon-kindle-4-5.rst:45: WARNING: Enumerated list ends without a blank line; unexpected unindent. Solve this by fixing the list enumeration and adding blank lines. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: state: fix closing brace without opening braceRoland Hieber2019-01-211-1/+0
| | | | | | | | | Also fix the resulting sphinx warning: Documentation/user/state.rst:650: WARNING: Explicit markup ends without a blank line; unexpected unindent. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move umode_t typedef from asm/types.h to linux/types.hAntony Pavlov2019-01-1810-22/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: asm/types.h: drop unused stuffAntony Pavlov2019-01-181-29/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Replace debug() with dev_dbg()Andrey Smirnov2019-01-181-5/+6
| | | | | | | | | All of the functions using debug() in that file have enough info to use dev_dbg instead. Convert all of the uses of debug() to dev_dbg() in order to get more informative debug output. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Alias block_op_close() to block_op_flush()Andrey Smirnov2019-01-181-7/+2
| | | | | | | | | The two functions are identical, so there's no need to keep two copies of the same code around. Alias block_op_close() to block_op_flush() and drop standalone definition for the former. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images: check for use of obsolete pblx-*Ahmad Fatoum2019-01-181-0/+4
| | | | | | | | | | | | | | pblx-* has been removed in 5a1a5ed253 ("ARM: images: use piggydata") and using it (e.g. because a patchset was rebased) results in a non-obvious: make[1]: *** No rule to make target 'images/*.pblx.*', \ needed by 'images/barebox-*.img'. Stop. Avoid this by explicitly failing with an error message whenever pblx-y or pblx- has been defined. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images: pblx is now pblbSascha Hauer2019-01-181-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* images: Drop unnecessary fix_sizeSascha Hauer2019-01-162-3/+2
| | | | | | | | Now that we compile the compressed binary into the decompressor we no longer need fix_size but can use the linker to fill in the image size into the binary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: imx8mq: Add back memory controller nodeLucas Stach2019-01-162-2/+3
| | | | | | | | This was lost during conversion to use upstream device tree. Fixes: 29841dfa4b ("ARM: imx8mq: use upstream devicetree") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ultrascale'Sascha Hauer2019-01-1517-0/+194
|\
| * zynqmp: enable macb Ethernet supportThomas Hämmerle2019-01-092-0/+2
| | | | | | | | | | Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: add support for Xilinx ZCU104 boardMichael Tretter2018-12-1014-0/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the Xilinx Zynq Ultrascale+ MPSoC architecture (ZynqMP) and the Xilinx ZCU104 board. Barebox is booted as BL33 in EL-1 and expects that a BL2 (i.e. the FSBL) already took care of initializing the RAM. Also for debug_ll, the UART is expected to be already setup correctly. Thus, you have to add the Barebox binary to a boot image as described in "Chapter 11: Boot and Configuration" of "Zynq Ultrascale+ Device Technical Reference Manual". Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: aarch64: add ENTRY_PROC macro for arm64Michael Tretter2018-12-101-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | arm64 has no __naked__ attribute and the compiler adds a function prologue for saving x29 and x30 to the stack for all C functions. This includes functions defined using the ENTRY_FUNCTION macro. Therefore, the stack needs to be setup before entering a C function, which is not possible if the entry is a C function. Provide a macro to implement the entry in assembly to be able to setup the stack before entering the low level entry function. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: aarch64: compile with general-regs-onlyMichael Tretter2018-12-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this flag, gcc generates code to save the Q/V registers to the stack for handling the va_list in pr_print(). Saving the registers is useless, as the registers are never restored, but accessing the registers to save them hangs the CPU. Follow the Linux arch/arm64/Makefile and use the general-regs-only flag to prevent usage of floating point and Advanced SIMD register. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: lib64: .gitignore barebox.ldsMichael Tretter2018-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e1287b1a8b27 ("arm: rework lib directory to support arm64") restructured the lib directory and added the lib64 directory. It moved the existing .gitignore to the lib32 directory but didn't add a new .gitignore for lib64. Thus building Barebox for arm64 results in stray barebox.lds files. Copy the .gitignore from lib32 to lib64. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/risc-V'Sascha Hauer2019-01-1538-1/+1317
|\ \
| * | Documentation: add RISC-V docsAntony Pavlov2019-01-071-0/+91
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: add erizo_generic_defconfigAntony Pavlov2019-01-071-0/+51
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: erizo: add nmon image creationAntony Pavlov2019-01-072-0/+21
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: erizo: enable nmonAntony Pavlov2019-01-071-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: erizo: add DEBUG_LL supportAntony Pavlov2019-01-072-0/+34
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: add nmon nano-monitorAntony Pavlov2019-01-073-0/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nmon is a tiny (<1024 bytes) monitor program for the RV32I processors. It can operate with NO working RAM at all! It uses only the processor registers and NS16550-compatible UART port for operation, so it can be used for a memory controller setup code debugging. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: add low-level debug macros for ns16550Antony Pavlov2019-01-071-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds macros for ns16550 port initialization and single char output. The macros can be used in MIPS asm pbl code. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: add Erizo SoC supportAntony Pavlov2019-01-077-0/+89
| | | | | | | | | | | | | | | | | | | | | Erizo is an opensource hardware SoC for FPGA. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Add initial RISC-V architecture supportAntony Pavlov2019-01-0728-1/+582
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>