summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/state'Sascha Hauer2015-06-092-97/+324
|\
| * state: add support for uint8 variablesJan Luebbe2015-06-031-0/+33
| | | | | | | | | | Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: add some more error messagesJan Luebbe2015-06-031-5/+14
| | | | | | | | | | | | | | This helps with finding out why the state cannot be loaded correctly. Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: update documentation of struct state_backend_raw membersMarc Kleine-Budde2015-05-261-2/+2
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: add sanity check of data_len during loadMarc Kleine-Budde2015-05-261-0/+11
| | | | | | | | | | | | | | | | The length of the data must fit into the remaining available space until the next copy of the data. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: rename backend_raw_write_one() -> backend_raw_save_one()Marc Kleine-Budde2015-05-261-5/+5
| | | | | | | | | | | | | | | | Use a consistent naming scheme: backend_raw_save_one() is called from backend_raw_save(). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: factor out state_backend_raw_file_get_size() into ↵Marc Kleine-Budde2015-05-261-9/+64
| | | | | | | | | | | | | | | | | | | | separate function This patch factors out the state_backend_raw_file_get_size() into a separate function and adds some ifdefs to make this code work under Linux aswell. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: properly align write and erase sizeMarc Kleine-Budde2015-05-261-7/+7
| | | | | | | | | | | | | | | | | | | | This patch makes it easier to share the code with linux, on Linux the ease and write size have to be aligned. Use stride (which is already aligned to erase block size) during erase, align size_full to writesize and use it while writing. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: rename struct state_backend_raw::step -> strideMarc Kleine-Budde2015-05-261-8/+8
| | | | | | | | | | | | | | | | This patch renames the member "step" of the struct state_backend_raw to "stride" and tries to clarifies its meaning. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend_raw: remove hard coded limit of two copiesMarc Kleine-Budde2015-05-261-5/+12
| | | | | | | | | | | | | | | | | | Although there is the define RAW_BACKEND_COPIES, the state_backend_raw_save() function silently assumes exactly two copies. This patch removes that assumtion by looping over all copies, but saving the one we're read from at the end. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: mtd_get_meminfo: make usage of mtd's meminfo compatible to linuxMarc Kleine-Budde2015-05-261-2/+2
| | | | | | | | | | | | | | This patch makes it possible to share the code with linux. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: mtd_get_meminfo: open path readonly instead of readwriteMarc Kleine-Budde2015-05-261-1/+1
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: add fixup to copy state from barebox to kernel device treeMarc Kleine-Budde2015-05-261-7/+100
| | | | | | | | | | | | | | | | This patch registers a DT fixup, that copies the state nodes from the active to the kernel DT. The backend reference will be a phandles. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: add a function to remove an of_fixupUwe Kleine-König2015-05-181-0/+19
| | | | | | | | | | | | | | | | | | This function is needed when a device that already registered a fixup in the probe routine fails later to probe completely. Without unregistering the fixup the function might later be called with invalid data. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: backend: support phandle and of_path referencesMarc Kleine-Budde2015-05-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | This patch improves the backend property, it can be either a phandle or a of_path. During probe() of the state driver the backend property is dereferenced and the resulting of_path is saved in the state context. In a later patch it will be used to generate a phandle reference to the backend during DT fixup. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: add functionality to export state descriptionMarc Kleine-Budde2015-05-151-23/+38
| | | | | | | | | | | | | | | | | | | | This patch adds the functionality to export the description of the state, but not the contents of the variables to a DT node. This will be used in a later patch to "copy" the state description to the kernel device tree during DT fixup. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: make state_release() non staticMarc Kleine-Budde2015-05-151-1/+1
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: print proper error message, if reg property is not foundMarc Kleine-Budde2015-05-151-1/+4
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: print name of property of size mismatch is detectedMarc Kleine-Budde2015-05-151-2/+2
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: state_new_from_fdt(): remove unused functionMarc Kleine-Budde2015-05-151-21/+0
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: state_uint32_create: use %u to print unsigned variableMarc Kleine-Budde2015-05-151-1/+1
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/posix_types'Sascha Hauer2015-06-091-0/+3
|\ \
| * | dma: Use generic place for dma_addr_t typedefSascha Hauer2015-05-221-0/+3
| |/ | | | | | | | | | | | | | | | | Instead of letting all architectures define their own dma_addr_t use a common place in include/linux/types.h and use a Kconfig symbol that architectures can select to define the width of dma_addr_t. The same is done in the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-06-093-14/+34
|\ \
| * | tlsf malloc: enable 64bit support on 64bit architecturesSascha Hauer2015-05-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 64bit architectures TLSF_64BIT should be defined. Decide that depending on the CONFIG_64BIT symbol. When 64bit support is enabled all allocations will be aligned to 8 byte boundaries which is necessary for architectures that do not support unaligned accesses or have a performance penalty for unaligned accesses. Also changes the undefined tlsf_decl to 'static'. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: use regular malloc for log messagesSascha Hauer2015-05-151-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | Using xfunctions to allocate log messages is not a good idea. Should we be out of memory the xfunctions will panic which will cause another allocation, so we deadlock the system with no message going out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | startup: introduce postenvironment_initcallSascha Hauer2015-05-151-10/+18
| |/ | | | | | | | | | | | | | | To allow init code that depends on the environment being loaded. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/memtest'Sascha Hauer2015-06-091-64/+112
|\ \
| * | common/memtest.c: Distil common error reporting codeAndrey Smirnov2015-05-151-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move all of the common code for error message output into a new function mem_test_report_failure() and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common/memtest.c: Refactor mem_test() into three surbroutinesAndrey Smirnov2015-05-151-37/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original mem_test() was rather long an contained code to perform two distinct operations. This patch moves that code into two separate subroutines and converts mem_test into a high level interface that calls the subroutines. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common/memtest.c: Do not omit offset of 0 from testsAndrey Smirnov2015-05-151-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ommiting offset 0 from address line tests allows certain corner cases of faults to be undetected. For the "stuck high" case, consider scenario in which all of the tested address lines are stuck high. In original code first data filling loop would execute writing data to a single cell multiple times and second loop would just read data from that cell over and over again. Adding a write to start[0] should prevent this since it would cause the second loop to read incorrect data on its first iteration. For the "stuck low" case, having any of the tested bits of the address shorted would effectively "remap" that memory cell to start[0] in this case excluding start[0] during the verification phase would result in a false positive result. Note that both of the changes are present in Michael Barr's code here: http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/software-based-memory-testing.html and the code in barebox is based on that code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common/memtest.c: Fix incorrect array boundary checkAndrey Smirnov2015-05-151-2/+1
| |/ | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mem64'Sascha Hauer2015-06-091-14/+28
|\ \
| * | memory_display: Add 64bit supportSascha Hauer2015-05-281-1/+15
| | | | | | | | | | | | | | | | | | Add support for showing hexdumps in 64bit width. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memory_display: Use consistent typesSascha Hauer2015-05-281-13/+13
| |/ | | | | | | | | | | | | | | memory_display uses three different types for 32bit variables, three types for 16bit variables and three types for 8bit variables. Clean up this mess and use one type per variable width. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/console'Sascha Hauer2015-06-092-40/+99
|\ \
| * | console: When switching baudrate print console nameSascha Hauer2015-06-091-2/+2
| | | | | | | | | | | | | | | | | | | | | Since there may be multiple consoles print the name of the console whose baudrate shall be switched. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Add console_get_by_nameSascha Hauer2015-06-091-0/+13
| | | | | | | | | | | | | | | | | | | | | Commands like loadx/loady wish to find a console device by its name. Add a function for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Add functions to get/set baudrateSascha Hauer2015-06-091-5/+32
| | | | | | | | | | | | | | | | | | So C code can call a function rather than fiddling with device parameters. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: Add functions to get/set active state of consoleSascha Hauer2015-06-091-34/+53
| |/ | | | | | | | | | | | | | | Currently code needs to fiddle with the active parameter of a console device directly to enable/disable consoles. Add console_set_active() to set the status and console_get_active() to get the current status. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / bootsource: Add NET bootsourceWadim Egorov2015-05-271-0/+1
|/ | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>