summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* setenv: Be more informative when device parameter setting failsSascha Hauer2015-05-041-5/+7
| | | | | | | | | When setting a device parameter fails not only the error code is of interest, but also what the parameter name is, what the device name is and whether a device was found for this name. Add this information to the error message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* timeout: factor out wait-for-key-press loop into separate fileMarc Kleine-Budde2015-04-232-0/+68
| | | | | | | | This patch factors out the wait-for-key-press loop from the shell command "timeout" into a sparate file, so that it can be used from C, too. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-04-133-0/+1206
|\
| * state: add framework for persistent state handlingSascha Hauer2015-03-123-0/+1206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a framework to describe, access, store and restore a set of variables. A state variable set can be fully described in a devicetree node. This node could be part of the regular devicetree blob or it could be an extra devicetree solely for the state. The state variable set contains variables of different types and a place to store the variable set. For more information see: Documentation/devicetree/bindings/barebox/barebox,state.rst Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/crypto'Sascha Hauer2015-04-135-205/+79
|\ \
| * | password: add pbkdf2 supportJean-Christophe PLAGNIOL-VILLARD2015-03-202-30/+70
| | | | | | | | | | | | | | | | | | | | | | | | We will use random 32 bytes salt and 10000 round to generate a 32 bytes key. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | command: allow runtime usageJean-Christophe PLAGNIOL-VILLARD2015-03-191-0/+2
| | | | | | | | | | | | | | | | | | | | | This will allow as example to list the currently supported digest. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | password: add support for sha512Jean-Christophe PLAGNIOL-VILLARD2015-03-122-0/+6
| | | | | | | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | digest: make it multi-instanceJean-Christophe PLAGNIOL-VILLARD2015-03-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now you need to call digest_alloc and when you finish to use it digest_free. We need this for upcomming aes encryption support and secure boot as we will need multiple instance of the same digest. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | digest: introduce digest_{init/update/final/length}Jean-Christophe PLAGNIOL-VILLARD2015-03-121-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | This will allow to move from a one at a time digest to a multi-instance with too much impact on the code using it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | digest: move digest.c to cryptoJean-Christophe PLAGNIOL-VILLARD2015-03-122-175/+0
| |/ | | | | | | | | | | | | with not the rest of the implementation Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / make PBL_CONSOLE depend on PBL_IMAGEAntony Pavlov2015-04-131-0/+1
|/ | | | | | | | | | | | | | | | | | | PBL_CONSOLE option is used only for building PBL. See this output: barebox$ git grep PBL_CONSOLE arch/arm/configs/tx28stk5_defconfig:CONFIG_PBL_CONSOLE=y common/Kconfig:config PBL_CONSOLE common/Makefile:pbl-$(CONFIG_PBL_CONSOLE) += memory_display.o include/printk.h: (defined(__PBL__) && defined(CONFIG_PBL_CONSOLE)) include/stdio.h: (defined(__PBL__) && defined(CONFIG_PBL_CONSOLE)) lib/Makefile:pbl-$(CONFIG_PBL_CONSOLE) += vsprintf.o pbl/Makefile:pbl-$(CONFIG_PBL_CONSOLE) += console.o PBL_CONSOLE looks confusing in PBL-less configuration so it's better to enable it only if PBL is enabled. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pbl: let pbl-console depend on !CONSOLE_NONELucas Stach2015-03-111-0/+1
| | | | | | | | | | | | | | | It doesn't make much sense to have a console in the pbl but not in the main barebox binary. Fixes: pbl/console.c:34:5: error: redefinition of 'ctrlc' include/stdio.h:60:19: note: previous definition of 'ctrlc' was here pbl/console.c:39:6: error: redefinition of 'console_putc' include/stdio.h:49:20: note: previous definition of 'console_putc' was here Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2015-03-091-1/+3
|\
| * bbu: make bbu confirm a bit more verboseLucas Stach2015-03-041-1/+3
| | | | | | | | | | | | | | It is a lot more user friendly if we give a bit more feedback. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-03-096-14/+66
|\ \
| * | environment: envfs_{load, save}: add possibility to call with filename and ↵Marc Kleine-Budde2015-03-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | dirname == NULL This patch moves fallback to default into the envfs_{load,save} functions. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Make locally used function staticSascha Hauer2015-03-041-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | menu: depend on !CONFIG_SHELL_NONELucas Stach2015-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make much sense to have the menuframework but no shell. Fixes: In function `menu_action_command': undefined reference to `run_command' Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM/mem: handle data aborts gracefully for mdJan Luebbe2015-02-271-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes memory ranges contain inaccessible registers which trigger a data abort when accessed. To handle this gracefully, we extend the data abort exception handler to ignore the exception when configured to do so. This allows detecting inaccessible memory from the md command. It will show XX for unreadable bytes instead. The previous behaviour: barebox@TI AM335x BeagleBone:/ md 0x50000000 unable to handle paging request at address 0x500000ac pc : [<8fe2e0dc>] lr : [<8fe2e0b9>] sp : 8ffff898 ip : 00000024 fp : 00000000 r10: 8bfa0204 r9 : 00000000 r8 : 8bfa0204 r7 : 00000100 r6 : 50000000 r5 : 8bfa0204 r4 : 00000004 r3 : 00000f00 r2 : 000000ac r1 : 00000004 r0 : 00000014 Flags: nZCv IRQs off FIQs on Mode SVC_32 [<8fe2e0dc>] (memcpy_sz+0x40/0x48) from [<8fe2f337>] (mem_read+0x3b/0x48) [<8fe2f337>] (mem_read+0x3b/0x48) from [<8fe2bb13>] (cdev_read+0x25/0x2e) [<8fe2bb13>] (cdev_read+0x25/0x2e) from [<8fe2c15b>] (devfs_read+0x1b/0x1e) [<8fe2c15b>] (devfs_read+0x1b/0x1e) from [<8fe2df5b>] (__read+0x43/0x5c) [<8fe2df5b>] (__read+0x43/0x5c) from [<8fe2e61f>] (read+0x2b/0x48) [<8fe2e61f>] (read+0x2b/0x48) from [<8fe1e4a5>] (do_mem_md+0xc1/0x144) [<8fe1e4a5>] (do_mem_md+0xc1/0x144) from [<8fe02889>] (execute_command+0x21/0x48) [<8fe02889>] (execute_command+0x21/0x48) from [<8fe061c1>] (run_list_real+0x549/0x634) [<8fe061c1>] (run_list_real+0x549/0x634) from [<8fe05b43>] (parse_stream_outer+0xdb/0x174) [<8fe05b43>] (parse_stream_outer+0xdb/0x174) from [<8fe06435>] (run_shell+0x29/0x54) [<8fe06435>] (run_shell+0x29/0x54) from [<8fe02889>] (execute_command+0x21/0x48) [<8fe02889>] (execute_command+0x21/0x48) from [<8fe061c1>] (run_list_real+0x549/0x634) [<8fe061c1>] (run_list_real+0x549/0x634) from [<8fe05efb>] (run_list_real+0x283/0x634) [<8fe31e1d>] (unwind_backtrace+0x1/0x64) from [<8fe24e61>] (panic+0x1d/0x34) [<8fe24e61>] (panic+0x1d/0x34) from [<8fe322c1>] (do_exception+0xd/0x10) [<8fe322c1>] (do_exception+0xd/0x10) from [<8fe32329>] (do_data_abort+0x21/0x2c) [<8fe32329>] (do_data_abort+0x21/0x2c) from [<8fe31fe8>] (data_abort+0x48/0x60) The new behaviour: barebox@TI AM335x BeagleBone:/ md 0x50000000 50000000: 00000060 00000000 00000000 00000000 `............... 50000010: 00000000 00000001 00000000 00000000 ................ 50000020: 00000000 00000000 00000000 00000000 ................ 50000030: 00000000 00000000 00000000 00000000 ................ 50000040: 00001ff0 400000ac 00000211 00000000 .......@........ 50000050: 00000a00 00000001 00000000 00000000 ................ 50000060: 00000000 00101001 22060514 10057016 ...........".p.. 50000070: 010f1111 8f070000 00000f40 00000000 ........@....... 50000080: 00000000 00000000 00000000 00000000 ................ 50000090: 00001000 00101001 22060514 10057016 ...........".p.. 500000a0: 010f1111 8f070000 00000f00 XXXXXXXX ................ 500000b0: XXXXXXXX XXXXXXXX 00000000 00000000 ................ 500000c0: 00001000 00101001 22060514 10057016 ...........".p.. 500000d0: 010f1111 8f070000 00000f00 XXXXXXXX ................ 500000e0: XXXXXXXX XXXXXXXX 00000000 00000000 ................ 500000f0: 00001000 00101001 22060514 10057016 ...........".p.. The current implementation breaks everything except ARM and takes several shortcuts which need to be implemented more cleanly. Suggestions are very welcome! Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common/bootargs: add blkdevparts variablesHubert Feurstein2015-02-171-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel command line option blkdevparts works like mtdparts, but for all block devices. So it can be used for eMMC devices without the need of a traditional partition table. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imd: provide dummy imd_command_setenvLucas Stach2015-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If CONFIG_CMD_IMD is not set there is no imd_command_setenv in the barebox binary that can be linked to. Although the whole imd infrastructure will be removed by the linker later in the build process as soon as it figures out that nothing inside barebox is using it, we still have to provide a dummy function to keep the build going. Fixes: In function `imd_command': undefined reference to `imd_command_setenv' Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/arm'Sascha Hauer2015-03-091-0/+15
|\ \ \
| * | | ARM: Rockchip: Add DEBUG_LL based on mach-socfpgaAndrey Panov2015-02-131-0/+15
| |/ / | | | | | | | | | | | | Signed-off-by: Andrey Panov <rockford@yandex.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/am335x'Sascha Hauer2015-03-061-2/+3
|\ \ \ | |_|/ |/| |
| * | reset_source: Add external resetWadim Egorov2015-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | | Some SoCs have special device pins for external reset signals. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | reset_source: make safe to call earlierSascha Hauer2015-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | reset_source_init used to set the reset source to unknown in a coredevice_initcall. This means if reset_source_set() has been called earlier the value would have been overwritten. Fix this by calling globalvar_add_simple() each time reset_source_set() is called. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | environment: Do not remove base env directorySascha Hauer2015-02-191-0/+3
| |/ |/| | | | | | | | | | | When removing empty directories do not remove the base directory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | blspec: put blspec bootargs into a .dyn bootargs variableSascha Hauer2015-02-101-1/+1
|/ | | | | | So that they get deleted later when something else is booted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2015-02-041-0/+1
|\
| * pbl: Add support for memory_displaySascha Hauer2015-01-281-0/+1
| | | | | | | | | | | | | | The PBL has console support now, so add memory_display support aswell which can be a good debugging aid. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-02-041-1/+1
|\ \
| * | console: allow to specify the device idJean-Christophe PLAGNIOL-VILLARD2015-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Fix spelling: pathes -> pathsWadim Egorov2015-01-282-4/+4
| |/ |/| | | | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: console_console: put functions under correct ifdefLucas Stach2015-01-191-35/+35
|/ | | | | | | | | | So they aren't build when no console support is selected. Fixes: In function `console_get_by_dev': undefined reference to `console_list' Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/netconsole'Sascha Hauer2015-01-091-0/+7
|\
| * console: Add set_active callbackSascha Hauer2014-12-171-0/+7
| | | | | | | | | | | | | | | | The netconsole needs to be able to deny activation when the network has not been enabled. Add an optional callback to the console for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mxs'Sascha Hauer2015-01-094-1/+42
|\ \
| * | console: Make sure xzalloc is only used when it's availableSascha Hauer2015-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | To make it possible to call the pr_* functions very early before malloc is initialized test if malloc is available before using it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | malloc: Add a function to detect if malloc pool is already initializedSascha Hauer2015-01-051-0/+8
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Add PBL console supportSascha Hauer2015-01-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds simple console support to the PBL which makes it possible to print more complex messages in the PBL than just strings or hex numbers. For now puts_ll is used to print the messages, so it depends on CONFIG_DEBUG_LL which makes it more a debugging option. However, this could be extended later to get regular output from the PBL if desired. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | printf: move panic() to common/misc.cSascha Hauer2015-01-051-0/+22
| |/ | | | | | | | | | | | | | | panic() is not really a printf like function, so move it to common/misc.c. This is done because we want to have printf support in the PBL, but PBL has it's own panic() implementation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-01-092-3/+19
|\ \
| * | sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clock: incorporate dummy clocksource into core clock codeAntony Pavlov2014-12-171-2/+18
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2015-01-092-0/+21
|\ \ | |/ |/|
| * efi: mount efivarfs by default if enabledLucas Stach2014-12-091-0/+6
| | | | | | | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * efi: add function to determine type of device pathLucas Stach2014-12-091-0/+15
| | | | | | | | | | | | | | | | | | Thanks to the wonders of UEFI we have to walk down the device path all the way until we arrive at the device we got this path from... Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | blspec: print error when devicetree not foundSascha Hauer2014-12-161-0/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig-1'Sascha Hauer2014-12-081-1/+1
|\