summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
| * linux/kernel.h: move ALIGN_DOWN() to include/linux/kernel.hMasahiro Yamada2018-01-052-2/+1
| | | | | | | | | | | | | | | | | | | | Linux commit ed067d4a859f ("linux/kernel.h: Add ALIGN_DOWN macro") moved ALIGN_DOWN to include/linux/kernel.h. Let's do likewise. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * string.h: Implement strndupUwe Kleine-König2018-01-051-0/+3
| | | | | | | | | | | | | | | | | | I implemented this while trying to import mmc-utils into barebox. While I didn't finish this import this function might still be useful for someone?! Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | file_list: Add ubi flagSascha Hauer2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | This flag is added to better support flashing UBI image with Android sparse images. Android fastboot splits images which are bigger than the free memory into multiple images which are then transferred in multiple fastboot sessions. In a session which is not the first one we can no longer detect if an image is a UBI image or not, so we need a flag to make this explicit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | filetype: Add fastboot sparse format detectionSascha Hauer2018-01-171-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add support for fastboot sparse imagesSascha Hauer2018-01-171-0/+67
| | | | | | | | | | | | | | | | This adds support for reading Android fastboot sparse images. This code is based on the corresponding U-Boot code, but has been heavily modified to provide a read-like API which better fits into barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ubiformat: Add ubiformat write functionSascha Hauer2018-01-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The ubiformat C API expects an image file as argument. With upcoming Android fastboot sparse image support we can no longer provide a complete image anymore. With this patch we can write an image in multiple chunks after we've formatted a MTD device with ubiformat. ubiformat_write will skip the EC header in both the MTD device we write to and also the image we read from, so we can flash an image on a MTD device containing EC headers already. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: implement ftruncateSascha Hauer2018-01-101-0/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2018-01-053-8/+48
|\
| * net: Add linuxdevname propertySascha Hauer2017-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have a static network environment but more than one network device on your machine it is necessary to provide the <device> parameter to the ip parameter at kernel cmd line. The device name assigned by Linux cannot in general be predicted as it depends on driver bind order. This patch introduces a new property linux.devname to eth devices. The value is added to bootargs per interface and can be changed in env/network/INTF Based on patch by Gavin Schenk <g.schenk@eckelmann.de>. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Provide new way to configure network devicesSascha Hauer2017-12-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a new way to configure network interfaces based on nvvars. A network interface can now be configured with variables in the nv.dev.<ethname>.* namespace. There is a new network device parameter "mode" which specifies the mode used to obtain IP settings. The mode can be "dhcp", "static" or "disabled": nv.dev.eth0.mode=dhcp (ipaddr, netmask are ignored in this setting) nv.dev.eth0.mode=static nv.dev.eth0.ipaddr=192.168.0.17 nv.dev.eth0.netmask=255.255.0.0 nv.dev.eth0.mode=disabled Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: remove "current" network deviceSascha Hauer2017-12-141-2/+0
| | | | | | | | | | | | | | Now that we can do routing we no longer need a "current" network device. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Pick network device based on IP settingsSascha Hauer2017-12-141-0/+1
| | | | | | | | | | | | | | | | | | The IP/netmask/gateway settings contain all informations needed to pick the correct network device. This patch adds support for that and makes specifying the "current" network interface using the ethact command unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dhcp: reworkSascha Hauer2017-12-141-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DHCP code is a mess. It is not clear which options are sent to the server and which options are returned from the server. Also environment variables are read from and written to all over the place. This patch cleans this up. There now is struct dhcp_req_param which is used for options sent to the server and struct dhcp_result which contains the values sent from the server. The values from the server are written to the barebox variables in a single place. Also it's now possible to call the dhcp code without modifying barebox variables at all, storing the result only in the dhcp result struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dhcp: Allow to specify network deviceSascha Hauer2017-12-142-4/+6
| | | | | | | | | | | | | | | | | | Instead of allowing to DHCP only on the "current" network device, allow to specify the desired network device. This is a first step to get rid of the concept of a "current" network device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: allow udp connections on specified network deviceSascha Hauer2017-12-011-0/+4
| | | | | | | | | | | | | | | | This allows the DHCP code to configure specific network devices so that DHCP no longer depends on any "current" network device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Use a single gatewaySascha Hauer2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is not much point in having a network device specific gateway. If barebox really is part of such a complicated network in which it needs multiple gateways, then we probably need a real routing table. Until this happens, a single gateway should be enough. This introduces global.net.gateway which holds the gateway ip. The previously used device specific <ethx>.gateway variables still exist, but are only aliases for the single gateway. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: dhcp: Do not overwrite serverip if it is validSascha Hauer2017-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Some DHCP servers provide the wrong serverip in which case it is desired to specify it manually and won't let the dhcp command overwrite it. This has previously been done by setting the serverip again to the desired value after dhcp has been executed. With this patch we do not overwrite it in the first place if it is valid already. This is necessary when the serverip is not set via /env/network/eth* but via nv.net.server. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: introduce global.net.serverSascha Hauer2017-12-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | The server to use is independent of the network device, there is not much point to make the server specific to a network device. This introduces global.net.server as the serverip which is used as standard NFS/tftp server. The previously used eth device specific parameters still exist, but are only aliases for the global single variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Add functions to get/set nameserver and domainnameSascha Hauer2017-12-011-0/+4
| | | | | | | | | | | | | | | | | | It's more convenient to have getter/setter functions for variables rather than using the detour around global vars which use string matching and all kinds of overhead in the background. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: Add and use IP_BROADCASTSascha Hauer2017-12-011-0/+2
| | | | | | | | | | | | | | Rather than using the hardcoded value 0xffffffff in several places add a define for the broadcast IP. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: Add device_detect_all() functionSascha Hauer2017-12-011-0/+1
| | | | | | | | | | | | | | | | Add a device_detect_all function to detect all devices and use it in the detect command. This makes the functionality reusable in other code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-01-051-1/+2
|\ \
| * | nv: add device parameter overwrites to completion listSascha Hauer2017-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | nv variables in the form dev.<devname>.* can be used to make device parameters persistent. Add these to the completion list to make setting these variables more convenient. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | fs: Introduce devpath_to_name()Andrey Smirnov2017-12-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add a simple function to simplify the task of accepting both full path in "/dev" and just device name as a parameter. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: mdio-mux: Avoid probing multiplexed bussesAndrey Smirnov2017-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling mdiobus_detect() for a bus that serves as a parent for a MDIO bus multiplexer would result in parent bus being populated with devices that are present on downstream bus that multiplexer happens to be "pointing" at that moment. To avoid that introduce 'is_multiplexed' flag to struct mii_bus and change mdiobus_detect to ignore busses for which that flag is set. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | net: phy: Port MDIO bus miltiplexer framework from Linux kernelAndrey Smirnov2017-12-061-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | Port mdio-mux.c from Linux kernel to Barebox, to support adding dirvers that rely on that infrastructure/API. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | mdio_bus: Port of_mdio_find_bus() from Linux kernelAndrey Smirnov2017-12-061-0/+2
|/ / | | | | | | | | | | | | | | Port of_mdio_find_bus() from Linux kernel. This function is used in MDIO multiplexor infrastructure added in following commit. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: Fix can_lseek_backward()Andrey Smirnov2017-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To quote corresponding man page: "... Upon successful completion, lseek() returns the resulting offset location as measured in bytes from the beginning of the file." Which for lseek(fd, 0, SEEK_SET) would be 0, so returning 'ret' as final step of the function would mean it'd never return anything but 0 as well. Change the code to explicitly return '1' to fix the problem. Fixes: 7c3f8d366 ("uimage: fix: add can_lseek_backward and use in uimage_open") Cc: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/omap'Sascha Hauer2017-11-132-0/+16
|\ \
| * | common: oftree: Add autoenable functionalityDaniel Schultz2017-11-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an API to automatically enable either hardware components with existing device drivers or i2c clients. All functions take a device tree path to find the hardware and will fix up the node status in the kernel device tree, if it's accessible. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: state: Add function to read state MACDaniel Schultz2017-11-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This API function allows to receive a copy of a MAC address from variables in a state. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/efi'Sascha Hauer2017-11-131-0/+3
|\ \ \ | |_|/ |/| |
| * | efi-gui: add USB IO Protocol GUID definitionJean-Christophe PLAGNIOL-VILLARD2017-10-271-0/+3
| |/ | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / uimage: fix: add can_lseek_backward and use in uimage_openMichael Grzeschik2017-11-101-0/+20
|/ | | | | | | | | | Since commit ce0cc7fe we support forward seek on tftpfs. This feature breaks the condition to check rather we open an uimage over tftp. Since backward seeking is the problem here, we add the function can_lseek_backward and check for it instead of the simple lseek. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usbgadget'Sascha Hauer2017-10-193-0/+14
|\
| * usbgadget: fastboot: Allow to automatically export the bbu handlersSascha Hauer2017-09-271-0/+7
| | | | | | | | | | | | | | | | | | | | We have a list of registered handlers which take a barebox update. Do the next step and allow to automatically export them via fastboot so that barebox can be updated via fastboot without manually exporting the partition. Since this may not be desirable in all cases this behaviour is configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bbu: Add function to iterate over registered handlersSascha Hauer2017-09-271-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * file_list: Add function to get entry by its nameSascha Hauer2017-09-271-0/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * file_list: Add function to add an entry to the listSascha Hauer2017-09-271-0/+3
| | | | | | | | | | | | | | | | Add file_list_add_entry() to add a single entry to a file_list. Then use it in file_list_parse_one() instead of open coding adding a new entry. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2017-10-193-2/+4
|\ \
| * | regmap: port regmap_update_bits from linuxSteffen Trumtrar2017-10-161-1/+2
| | | | | | | | | | | | | | | | | | | | | Port the regmap_update_bits function from linux v4.14-rc1 to barebox. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | elf.h: Use EI_NIDENT instead of numeric valueAntony Pavlov2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an adoption of the linux kernel commit | commit eb6900fbfa43cb50391b80b38608e25280705693 | Author: Cyrill Gorcunov <gorcunov@gmail.com> | Date: Tue Apr 29 01:01:17 2008 -0700 | | ELF: Use EI_NIDENT instead of numeric value | | Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mmc: allow skipping SD card initializationPhilipp Zabel2017-09-261-0/+1
| |/ | | | | | | | | | | | | | | | | This patch allows to skip SD card initialization for eMMCs by setting the "no-sd" property in the host controller device tree node. Avoiding two SD command timeouts speeds up detection time by well over 200 ms. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / of: base: add function to copy a device tree nodeMichael Olbrich2017-10-171-0/+2
|/ | | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2017-09-081-0/+3
|\
| * mtd: nand: Only call ONFI get/set features on supported chipsSascha Hauer2017-09-061-0/+3
| | | | | | | | | | | | | | Older versions of the ONFI spec do not support get/set features, so do not call these commands when they are not available. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2017-09-082-28/+223
|\ \
| * | asm-generic: partially sync io.h with linux kernelOleksij Rempel2017-09-081-28/+217
| | | | | | | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: base: port of_device_is_big_endian from linuxOleksij Rempel2017-09-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |commit 37786c7fee40771d13901de129af7e084ed48b55 |Author: Kevin Cernekee <cernekee@gmail.com> |Date: Thu Apr 9 13:05:14 2015 -0700 | | of: Add helper function to check MMIO register endianness | | SoC peripherals can come in several different flavors: | | - little-endian: registers always need to be accessed in LE mode (so the | kernel should perform a swap if the CPU is running BE) | | - big-endian: registers always need to be accessed in BE mode (so the | kernel should perform a swap if the CPU is running LE) | | - native-endian: the bus will automatically swap accesses, so the kernel | should never swap | | Introduce a function that checks an OF device node to see whether it | contains a "big-endian" or "native-endian" property. For the former case, | always return true. For the latter case, return true iff the kernel was | built for BE (implying that the BE MMIO accessors do not perform a swap). | Otherwise return false, assuming LE registers. | | LE registers are assumed by default because most existing drivers (libahci, | serial8250, usb) always use readl/writel in the absence of instructions | to the contrary, so that will be our fallback. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mips'Sascha Hauer2017-09-081-1/+1
|\| |