summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* documentation: document eMMC boot{0,1}-partitions bindingAhmad Fatoum2018-12-061-0/+18
| | | | | | | | The described binding was implemented in commit 6e9a87b39 ("mci: Allow to partition eMMC boot partitions"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* phytec-som-imx6: ksz8081_phy_fixup: Don't override B-CAST_OFF strap-inJan Remmet2018-12-051-1/+10
| | | | | | | | | | | | As PHY address 0 is not used on PHYTEC i.MX 6 and i.MX 6UL SOMs we do not have to override the B-CAST_OFF strap-in which disables broadcast on PHY address 0. Also add some comments about the magic values. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/parser.c: s/%d/%zu/ when printing size_tAhmad Fatoum2018-12-051-2/+2
| | | | | Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: bootstrap: fix instance of possibly mismatched pointer sizesAhmad Fatoum2018-12-051-1/+1
| | | | | | | | len was int but &len is passed to read_file(..., size_t *size), Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv-2: add bnet script to second stage barebox over netOleksij Rempel2018-12-041-0/+7
| | | | | | | | | | Doing cycling barebox boot over the net is a good testing practice. It is possible to detect at least some bugs before flushing it to the system. Suddenly it looks like, it is done not oft enough. So, let's add this option mainline. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kconfig: include common Kconfig files from top-level KconfigAntony Pavlov2018-12-039-64/+8
| | | | | | | | | | | | | Based on this linux kernel commit: > commit 1572497cb0e6d2016078bc9d5a95786bb878389f > Author: Christoph Hellwig <hch@lst.de> > Date: Tue Jul 31 13:39:30 2018 +0200 > > kconfig: include common Kconfig files from top-level Kconfig Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add pr_memory_displaySascha Hauer2018-12-032-5/+40
| | | | | | | | | pr_memory_display is a memory_display variant that takes a MSG_* loglevel priority with which the hexdump is printed. Like the normal pr_* function this is optimized out when the priority is below the compile time priority. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory_display: move prototype to include/printk.hSascha Hauer2018-12-032-10/+11
| | | | | | | It's where the kernel has the print_hex_dump prototypes aswell, it's a better match for these. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory_display: Print whole line at onceSascha Hauer2018-12-031-17/+18
| | | | | | | | Instead of using many printf assemble a printed line first and print it at once. This has the purpose of being able to pick different output functions in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: Add dw_apb_timer driverJules Maselbas2018-11-303-0/+154
| | | | | | | Adapt linux kernel dw_apb_timer driver to barebox. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: Add clocksource menuJules Maselbas2018-11-291-0/+4
| | | | | Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imd: fix missing error messageThorsten K. Scherer2018-11-291-1/+1
| | | | | | | | imd -t just returns 'imd: error 61', if there is not tag for <type> reference: common/imd.c:357 if (!imd) { ... Signed-off-by: Thorsten K. Scherer <t.scherer@eckelmann.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* getopt: Add pr_fmtSascha Hauer2018-11-271-0/+1
| | | | | | To give the debug output more context. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: Add extra define for hush debuggingSascha Hauer2018-11-271-25/+30
| | | | | | | | | | I've seen people increasing the compile loglevel to get more debugging output from barebox. This is generally a good idea, but the tons of hush debugging printed makes barebox quite unusable. This patch puts hush debugging behind an extra HUSH_DEBUG define so increasing the compile loglevel no longer results in hush debugging. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: Add pr_fmt defineSascha Hauer2018-11-271-0/+3
| | | | | | To give the hush debug output more context. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add Raspberry Pi Zero W BoardChris Fiege2018-11-212-0/+3
| | | | | | | | | | | | The Raspberry Pi Zero W is basically a Raspberry Pi 1 B+ but on a smaller PCB and with Bluetooth and WiFi. See: https://elinux.org/RPi_Hardware This patch adds support for Raspberry Pi Zero W to barebox. Signed-off-by: Chris Fiege <chris@tinyhost.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory_display: add padding to simplify countingRoland Hieber2018-11-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to count single bytes (e.g. when adding an offset) in 'word' or 'byte' output mode is not easy in the current formatting, and (at least for me) has a high chance of miscounting or losing track of groups: barebox@boardname:/ md -b 0x149983f0+32 149983f0: 18 00 00 00 00 00 0d 86 00 00 00 00 00 00 00 00 ................ 14998400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ barebox@boardname:/ md -w 0x149983f0+32 149983f0: 0018 0000 0000 860d 0000 0000 0000 0000 ................ 14998400: 0000 0000 0000 0000 0000 0000 0000 0000 ................ With an additional space after 8 bytes, counting becomes easier: barebox@boardname:/ md -b 0x149983f0+32 149983f0: 18 00 00 00 00 00 0d 86 00 00 00 00 00 00 00 00 ................ 14998400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ barebox@boardname:/ md -w 0x149983f0+32 149983f0: 0018 0000 0000 860d 0000 0000 0000 0000 ................ 14998400: 0000 0000 0000 0000 0000 0000 0000 0000 ................ The 'quad' and 'long' output modes stay the same and are already much more easier to count because they build bigger and therefore less groups of bytes per line. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* printk: make line continuation not result in stray emergency errorsRoland Hieber2018-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The levels of pr_emerg() and pr_cont() are both set to 0. When pr_cont() is used to continue a previous line, and colored console output is enabled, this can result in garbled log messages being printed, e.g.: ERROR: HABv4: -------- HAB warning Event 0 -------- ERROR: HABv4: event data: ERROR: HABv4: dbEMERG: 00EMERG: 24EMERG: 42EMERG: 69EMERG: 30EMERG: e1EMERG: 1d ERROR: HABv4: 00EMERG: 04EMERG: 00EMERG: 02EMERG: 40EMERG: 00EMERG: 36EMERG: 06 ERROR: HABv4: 55EMERG: 55EMERG: 00EMERG: 03EMERG: 00EMERG: 00EMERG: 00EMERG: 00 ERROR: HABv4: 00EMERG: 00EMERG: 00EMERG: 00EMERG: 00EMERG: 00EMERG: 00EMERG: 00 ERROR: HABv4: 00EMERG: 00EMERG: 00EMERG: 01EMERG: ERROR: HABv4: Status: Operation completed with warning (0x69) Note the additional "EMERG: " in front of each continuation, which is inserted by pr_cont(buf) being expanded to pr_printk(0, buf). These additional strings show up in deep red on the console (which is not supported in Git commit messages…). One might argue that this is the same color as the "ERROR: " prefix, but when pr_cont() is used with pr_notice() and pr_warning(), which are printed in blue and yellow respectively, at least then the change in color would lead to additional confusion. The log level argument to pr_printk is defined as int, so we can solve this by defining the level for pr_cont() to -1, which is not used for any loglevel: ERROR: HABv4: -------- HAB warning Event 0 -------- ERROR: HABv4: event data: ERROR: HABv4: db 00 24 42 69 30 e1 1d ERROR: HABv4: 00 04 00 02 40 00 36 06 ERROR: HABv4: 55 55 00 03 00 00 00 00 ERROR: HABv4: 00 00 00 00 00 00 00 00 ERROR: HABv4: 00 00 00 01 ERROR: HABv4: Status: Operation completed with warning (0x69) Fixes: 0fcefdd9369050f35a88b41dcd42cc5a3c6c6b33 ("printk: Add pr_cont") Fixes: ea0e077ed65a003e4d7a1e023aee38cbe2d14898 ("printk: Fix pr_cont") Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: lodepng: remove useless testOleksij Rempel2018-11-211-7/+1
| | | | | | | | | | | | | | Either the condition 'code_ll==(unsigned int)(-1)' is redundant or the array 'LENGTHBASE[29]' is accessed at index 4294967038, which is out of bounds. On other hand this condition is tested within other scope: "if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX)" with is already limited to (code_ll >= 257 && code_ll <= 285), so it can't be -1 any way. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: musb: fix possible out of bounds accessOleksij Rempel2018-11-211-1/+6
| | | | | | | | Either the condition 'epnum>=((u8)16)' is redundant or the array 'musb->endpoints[16]' is accessed at index 16, which is out of bounds. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: atmel_nand: remove erroneous caseOleksij Rempel2018-11-211-1/+0
| | | | | | | | If mm would be 15, then we will corrupt the stack, since p[15]. And as input for this function, mm has only two variants 13 and 14. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: at91_udc: remove useless NULL checkOleksij Rempel2018-11-211-2/+1
| | | | | | | | if _ep or ep is NULL, we would get at least in two places before this test a NULL pointer dereference. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: da9063: fix wrong NULL pointer testOleksij Rempel2018-11-211-1/+1
| | | | | | | | checking for priv == NULL and using in this case priv->dev makes no sense. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fix possible null pointer dereference of base.Oleksij Rempel2018-11-211-1/+2
| | | | | | | we use base before checking if it is NULL Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: closedir: remove uninitialized variable retOleksij Rempel2018-11-211-3/+1
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pinctrl: tegra30: fix "Possible null pointer dereference: group" warningOleksij Rempel2018-11-211-2/+2
| | | | | | | | The code is correct but it takes more seconds for me to understand. And static code analyzer do not understand it at all. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: e1000: fix "Uninitialized variable: phy_data" warningOleksij Rempel2018-11-211-1/+1
| | | | | | | | After carefully reading the code, this situation should never happen. This patch is to reduce warning noise. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: boards: phytec-som-am335x: Fix mac overwrite from stateTeresa Remmet2018-11-211-2/+2
| | | | | | | | state_read_mac() returns 0 on success so mac never was overwritten. Fix this and add check for valid mac address. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: imx: cpu: avoid use after free on errorOleksij Rempel2018-11-191-1/+3
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/ssd1307fb: fix potential memory leak on errorOleksij Rempel2018-11-191-2/+5
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: set ret for error casesOleksij Rempel2018-11-191-2/+2
| | | | | | | looks like it was forgotten. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ddr_spd: remove unused arrayOleksij Rempel2018-11-191-2/+0
| | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rtc: ds1307: Set DS1341_BIT_DOSF in the right registerAndrey Smirnov2018-11-191-2/+2
| | | | | | | | | | DS1341_BIT_DOSF is located in DS1337_REG_STATUS, not DS1337_REG_CONTROL. Fix the code to reflect that. Also fix "additionale" -> "additional" typo while at it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: print messages after checking a block is not badSascha Hauer2018-11-141-6/+6
| | | | | | | | | ubiformat prints its "flashing eraseblock x" and "formatting eraseblock x" messages before having checked that a block is actually good. This is misleading, so first check if a block is good and only if it is print a message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Print message with pr_errSascha Hauer2018-11-141-1/+1
| | | | | | | print "already registered" message with pr_err() rather than printf() to make sure it also appears in the logs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: stack unwind: Print messages with pr_warningSascha Hauer2018-11-141-2/+2
| | | | | | | print stack traces with pr_err() rather than printf() to make sure they appear in the logs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* e1000/flash: Increased erase timeoutMichael Schuhmacher2018-11-121-1/+1
| | | | | | | | Serial flash Adesto AT25DF321A specifies the maximal chip erase time as 40 seconds. Extend timeout accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2018-11-0919-162/+275
|\
| * usbgadget: autostart: add DFU supportLadislav Michl2018-10-299-89/+95
| | | | | | | | | | | | | | | | | | | | | | Use global variable dfu_function to autostart DFU. As similar code is used to start multifunction gadget using command, move common code to common/usbgadget.c and consolidate it. It turned out that '-s' option of usbgadget command does nothing, so remove its help text and make it function as '-a'. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Documentation: USB gadget: document usbgadget.fastboot_bbu variableLadislav Michl2018-10-291-0/+2
| | | | | | | | | | Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: set maxpacket_limitLadislav Michl2018-10-293-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gadget update to 3.15 imported Linux patch e117e742d310 ("usb: gadget: add "maxpacket_limit" field to struct usb_ep"): This patch adds "maxpacket_limit" to struct usb_ep. This field contains maximum value of maxpacket supported by driver, and is set in driver probe. This value should be used by autoconfig() function, because value of field "maxpacket" is set to value from endpoint descriptor when endpoint becomes enabled. So when autoconfig() function will be called again for this endpoint, "maxpacket" value will contain wMaxPacketSize from descriptior instead of maximum packet size for this endpoint. For this reason this patch adds new field "maxpacket_limit" which contains value of maximum packet size (which defines maximum endpoint capabilities). This value is used in ep_matches() function used by autoconfig(). Value of "maxpacket_limit" should be set in UDC driver probe function, using usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function set choosen value to both "maxpacket_limit" and "maxpacket" fields. However said update didn't bring in all driver changes. Do it now. Fixes: 2776d53d7ac8 ("USB: gadget: Update to 3.15") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fsl_udc: pass controller instance to unregisterSascha Hauer2018-10-293-15/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | ci_udc_unregister() used to unregister "the controller". Since we may register multiple chipidea devices we called ci_udc_unregister() for each of them. This led to messages like: ERROR: imx-usb 53f80000.usb: gadget not registered. Fix this by returning the registered controller. This allows us to call ci_udc_unregister() only when we actually registered one before. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: imx: unregister ehci controller on device removalSascha Hauer2018-10-291-0/+5
| | | | | | | | | | | | | | | | ehci does DMA and hence must be properly quiesced before we leave barebox. Call ehci_unregister() on device removal when we previously registered a ehci controller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci-atmel: unregister host on device removeSascha Hauer2018-10-291-1/+5
| | | | | | | | | | | | | | The ehci code does DMA and really must be properly stopped when we leave barebox, so call ehci_unregister on device removal. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: do not use dev->privSascha Hauer2018-10-294-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An ehci can be registered with ehci_register which is passed a struct device_d *. In that case the priv pointer may already be used by the caller, so we must not use it in the ehci code. At least for the Atmel ehci driver this fixes a bug, here dev->priv is set two times to different values. Since we need dev->priv in the ehci code to get the controller in ehci_detect() we can no longer implement that without the help of the caller, hence we eport ehci_detect() and epect it to be called by the code which registers a ehci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: add ehci_unregister()Sascha Hauer2018-10-294-11/+47
| | | | | | | | | | | | | | | | | | ehci_register() allocates data and registers a ehci host. Add ehci_unregister() to properly halt the controller and to free the memory again.. To do so, change ehci_register() to return the ehci host rather than an error code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: Add usb_unregister_host()Sascha Hauer2018-10-262-0/+6
| | | | | | | | | | | | | | | | We have usb_register_host() which puts a new host on the list of hosts we should also have the opposite which removes the host from the list again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: host: ehci: rename ehci_priv to ehci_hostSascha Hauer2018-10-261-21/+21
| | | | | | | | | | | | | | As we are going to export the structure as a cookie to others rename it to ehci_host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fsl_udc: Drop using global variableSascha Hauer2018-10-261-17/+22
| | | | | | | | | | | | | | No need to use the global udc_controller variable when we are provided an usb_gadget. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/state'Sascha Hauer2018-11-094-25/+74
|\ \