summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Release v2018.01.0v2018.01.0Sascha Hauer2018-01-221-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/Kconfig: Fix tpyoUwe Kleine-König2018-01-221-1/+1
| | | | | | | s/Pring/Print/ Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Documentation: Fix typoSascha Hauer2018-01-221-2/+2
| | | | | | underlaying -> underlying Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: Documentation: fix typoUlrich Ölmann2018-01-221-1/+1
| | | | | Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: Bootchooser: fix typoBastian Stender2018-01-221-1/+1
| | | | | Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: fix crash when trying to boot from loop mountsPhilipp Zabel2018-01-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to boot from a loop mount path, the blspec code passes a NULL pointer to dev_name, because cdev->dev is not set for loop mounts: unable to handle NULL pointer dereference at address 0x00000020 pc : [<4fe09e28>] lr : [<4fe02305>] sp : 4ffef7c0 ip : 31b75c78 fp : 31b6a388 r10: 31b6a368 r9 : 315a4cac r8 : 00000001 r7 : 00000001 r6 : 311b8540 r5 : ffffffea r4 : 31b6a3f8 r3 : 00000000 r2 : 10000000 r1 : 00000001 r0 : 00000000 Flags: nzcv IRQs off FIQs off Mode SVC_32 [<4fe09e28>] (dev_id+0xc/0x38) from [<4fe02305>] (blspec_scan_directory+0x3e1/0x484) [<4fe02305>] (blspec_scan_directory+0x3e1/0x484) from [<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c) [<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c) from [<4fe0984b>] (bootentry_create_from_name+0x23/0xdc) [<4fe0984b>] (bootentry_create_from_name+0x23/0xdc) from [<4fe246f9>] (do_boot+0x95/0x160) [<4fe246f9>] (do_boot+0x95/0x160) from [<4fe032e9>] (execute_command+0x21/0x48) [<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634) [<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe08249>] (parse_stream_outer+0xd9/0x164) [<4fe08249>] (parse_stream_outer+0xd9/0x164) from [<4fe08b6d>] (run_shell+0x31/0x60) [<4fe08b6d>] (run_shell+0x31/0x60) from [<4fe032e9>] (execute_command+0x21/0x48) [<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634) [<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe085fd>] (run_list_real+0x285/0x634) [<4fe444b9>] (unwind_backtrace+0x1/0x58) from [<4fe00b7d>] (panic+0x1d/0x34) [<4fe00b7d>] (panic+0x1d/0x34) from [<4fe42a75>] (do_exception+0xd/0x10) [<4fe42a75>] (do_exception+0xd/0x10) from [<4fe42ad5>] (do_data_abort+0x21/0x2c) [<4fe42ad5>] (do_data_abort+0x21/0x2c) from [<4fe42394>] (do_abort_6+0x48/0x54) Fix this by checking cdev->dev as well as cdev before calling dev_name. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* FIT: Fix error pathSascha Hauer2018-01-171-3/+5
| | | | | | | | In case of error of_unflatten_dtb() returns an ERR_PTR. Make sure that handle->root contains NULL in this case so that we do not call of_delete_node on the error pointer in the exit path. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/e1000: fix driver probing in the presence of two e1000 devicesUwe Kleine-König2018-01-171-0/+1
| | | | | | | | | | | | | | | | The .id member of the struct device for the invm device is not initialized and so implicitly zero. This yields: register_device: already registered invm0 for the second i210 during probe. So use the parent's id to initialize the id for invm, too, as is already done for the corresponding e1000-nor device. Fixes: a74b97f009c6 ("e1000: Expose i210's iNVM as a cdev") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make struct bootp __packed to prevent unaligned store on MIPSAntony Pavlov2018-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How to repropduce the unaligned store problem qemu-system-mips -nodefaults -M malta -m 256 \ -nographic -serial stdio -monitor null \ -bios barebox-flash-image \ -net user -net nic,model=rtl8139 ... barebox:/ dhcp Ooops, address error on store! $ 0 : 00000000 00000000 01010600 697f2a2e $ 4 : a0850000 00000000 0000001c a040c1b8 $ 8 : 00000000 00000002 00000002 00000000 $12 : 00000000 00000040 00000100 00000001 $16 : a040bba0 a0850000 a0850000 a0850000 $20 : 00000000 00000075 00000076 a040ba20 $24 : 00000002 a080f210 $28 : 00000000 a03ffce0 fffffffd a0833b8c Hi : 000154f8 Lo : 20000000 epc : a0833b84 ra : a0833b8c Status: 00000002 Cause : 80000414 Config: 80008482 ### ERROR ### Please RESET the board ### The unaligned store instruction is located in the bootp_request() from net/dhcp.c: a0833b50 <bootp_request>: .. a0833b7c: 3c020101 lui v0,0x101 a0833b80: 24420600 addiu v0,v0,1536 /* 0x1010600 -> v0 */ a0833b84: 0c20024a jal a0800928 <get_time_ns> a0833b88: ae02002a sw v0,42(s0) /* store 0x1010600 to addr s0 + 42 */ This assembler code is generated by mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 from this: bp = (struct bootp *)payload; bp->bp_op = OP_BOOTREQUEST; /* 0x01 */ bp->bp_htype = HWT_ETHER; /* 0x01 */ bp->bp_hlen = HWL_ETHER; /* 0x06 */ bp->bp_hops = 0; Compiler replaces four 'store byte' instruction by one 'store 32-bit word' instruction. Alas sometimes this leads to unaligned store situation. Making struct bootp __packed prevents this optimization and fixes the problem. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Tested-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: boards: phytec-som-am335x: Revert unified MLO for 1GBDaniel Schultz2018-01-052-0/+7
| | | | | | | | | | | There is a problem in the data path between 1GB RAM devices and the core, which leads to wrong read operations after DDR initialization in soft resets. This needs more investigation, but until we didn't found the problem, we will return to the origin MLO for 1GB RAM devices with static RAM timings and without memory access. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/wd'Sascha Hauer2018-01-056-0/+162
|\
| * MIPS: ar9331: add watchdog supportOleksij Rempel2018-01-051-0/+6
| | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dts: tl_wdr4300: enable watchdog nodeOleksij Rempel2018-01-051-0/+4
| | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dts: ar9344: add watchdog nodeOleksij Rempel2018-01-051-0/+7
| | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * watchdog: add ar9344-wdt driverOleksij Rempel2018-01-053-0/+145
| | | | | | | | | | | | | | | | | | This driver was developed and tested on QCA AR9344 WiSoC but it may work on most known Atheros/QCA WiSoCs. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2018-01-0533-778/+884
|\ \
| * | defaultenv-2: set bootargs correctly for network bootSascha Hauer2017-12-152-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The defaultenv-2 network boot script uses bootargs-ip which hardcodes eth0 as network device. To make this work with other nwetork devices use the "ip_route_get" command to determine the network device used to reach the server. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: Add ip_route_add commandSascha Hauer2017-12-153-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ip_route_get command is used to retrieve the network device used to reach a given IP address. This is useful for informational purposes and also for the network boot which wants to get the linux.bootargs parameter of the network device used for nfsroot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: Add linuxdevname propertySascha Hauer2017-12-153-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | defaultenv: Add README for new network configSascha Hauer2017-12-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Network configuration has changed. In case somebody looks to the old /env/network/ directoy place a README there to add a pointer how the new configuration is done. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: environment: update automountsSascha Hauer2017-12-157-44/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using "ifup ethx" use "ifup -a" which works with all network interfaces. Also replace "$ethx.serverip" with "$global.net.server". This makes the automount independent of the actual network interface. Remove all board specific /env/init/automount files which were only there to use eth1 instead of the previously hardcoded eth0. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: environment: remove ethx setup filesSascha Hauer2017-12-144-72/+0
| | | | | | | | | | | | | | | | | | | | | Network configuration is now done with nvvars, so /env/network/eth* files are no longer needed. Remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: update network docsSascha Hauer2017-12-142-36/+105
| | | | | | | | | | | | | | | | | | | | | The network configuration has changed in the previous patches. Update the documentation accordingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: Provide new way to configure network devicesSascha Hauer2017-12-143-88/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ifup: Use dhcp C API rather than running commandSascha Hauer2017-12-141-4/+2
| | | | | | | | | | | | | | | | | | DHCP has a C API, so use it instead of running as command. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: ifup: Factor out a eth_discover functionSascha Hauer2017-12-141-12/+26
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: remove "current" network deviceSascha Hauer2017-12-145-88/+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-142-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-144-336/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Coding style fixesSascha Hauer2017-12-141-7/+6
| | | | | | | | | | | | | | | | | | | | | Fix some spaces-before-function-opening-brackets and duplicate empty lines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dhcp: avoid unnecessary castsSascha Hauer2017-12-141-10/+8
| | | | | | | | | | | | | | | | | | Drop explicit casts to/from void pointers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dhcp: Allow to specify network deviceSascha Hauer2017-12-147-24/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-012-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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-014-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-014-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-014-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-013-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Make domainname and nameserver globalvarsSascha Hauer2017-12-013-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Register domainname and nameserver as globalvars rather than attaching them to a dedicated net device. the global device already exists and already contains much of the barebox configuration, so no need to add an extra device for network config. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: Add and use IP_BROADCASTSascha Hauer2017-12-013-4/+6
| | | | | | | | | | | | | | | | | | | | | 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>
| * | net: use pr_* functions for messagesSascha Hauer2017-12-011-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | Use pr_* functions in the networking code rather than printf() and debug(). Also Add a "net: " prefix to messages to give them some more context. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvvar: when setting a nvvar to NULL just free the contentSascha Hauer2017-12-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a nvvar is about to be removed then it is set to NULL by barebox. This means for the variable to free it's memory. In this case also do not pass the value to the corresponding globalvar, since that would set the globalvar to NULL aswell, but we want to keep its current value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | driver: Add device_detect_all() functionSascha Hauer2017-12-013-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | detect command: Drop -e optionSascha Hauer2017-12-011-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -e option is not that useful. Normally, when a device cannot be detected, then there should be no reason to not try to detect other devices. When a user is interested in a particular detect result, detect can still be called with that (and only that) device. We could also argue that the user should not care about the result of the detect call, but instead check if the desired device is present afterwards. Drop handling of the -e option, but still ignore it for compatibility reasons. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2018-01-059-25/+101
|\ \ \
| * | | Documentation: state: mention SD/eMMC devicesSascha Hauer2017-12-111-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The state framework also has support for SD/eMMC devices, so mention them in the documentation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: spi-nor: mx25l3205d/mx25l6405d: append SECT_4KUlrich Ölmann2017-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of Linux kernel commit | commit 0501f2e5ff28a02295e42fc9e7164a20ef4c30d5 | Author: Andreas Fenkart <afenkart@gmail.com> | Date: Thu Nov 5 10:04:23 2015 +0100 | | mtd: spi-nor: mx25l3205d/mx25l6405d: append SECT_4K | | according datasheet both chips can erase 4kByte sectors individually | | Signed-off-by: Andreas Fenkart <andreas.fenkart@dev.digitalstrom.org> | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Documentation: devicetree: m25p80: fix referenced filenameUlrich Ölmann2017-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux changed the filename in commit 8947e396a829 ("Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor"") and barebox imported this change in commit 8ed978b79062 ("dts: update to v4.1-rc4"). Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nvvar: Initialze from underlying device parameterSascha Hauer2017-11-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a nvvar is added with a NULL parameter then it's initialized with the value of the underlying global variable. Do this aswell when the nvvar is a device parameter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | nv: add device parameter overwrites to completion listSascha Hauer2017-11-234-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | globalvar: When a globalvar is created with a NULL value, use empty stringSascha Hauer2017-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As a convenience for users of globalvar_add_simple_string() create an empty value for the variable when passed a NULL pointer as value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>