summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/state'Sascha Hauer2015-12-082-37/+162
|\
| * state: backend_raw: add hmac supportMarc Kleine-Budde2015-11-272-8/+137
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds hmac support to the raw backend. With this patch, modifications of the header or data of a state partition can be detected, as the hmac woudln't match anymore. The hmac relies on a shared secret, which is requested from the keystore, with keystore_get_secret() using the name of the state partition as the "name" of the secret. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: prepare raw backend for hmac supportMarc Kleine-Budde2015-11-271-5/+10
| | | | | | | | | | | | | | | | This patch cleans up the raw backend, so that adding hmac support in the next patch is easier. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: disable load commandEnrico Jorns2015-11-271-27/+18
| | | | | | | | | | | | | | | | | | Explicitly loading environment is not required as it will be loaded if available during device probing Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/omap'Sascha Hauer2015-12-081-31/+0
|\ \
| * | common: filetype: do not redetect MBR-type devices as a FAT-typePeter Mamonov2015-11-231-31/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Deleted pieces of code detect MBR-containig device as a FAT-type device, if it's first partition contains a FAT filesystem. This behaviour enabled one to mount the FAT FS which is either directly on the device (disk0) or on the first partition (disk0.0) using the same command: mount /dev/disk0 /fat However, the desired behaviour can be reached with a: mount /dev/disk0 /fat || mount /dev/disk0.0 /fat || echo "Mounting failed" Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-12-083-42/+75
|\ \
| * | environment: support env on at24 eepromAntony Pavlov2015-12-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | unprotect(), erase() and protect() return EOPNOTSUPP errno code for at24 I2C eeproms, so envfs_save() doesn't store data to these eeproms without this patch. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: make type check error verboseJan Remmet2015-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | Wrong type let state probe fail with ENOENT. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: get file type before bootm_open_os_uimageJan Remmet2015-11-201-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a multi uimage stored in nand didn't work. Only one open for the bb file is allowed. The file type detection after bootm_open_os_uimage will fail. bootm_open_initrd_uimage and bootm_open_oftree_uimage already check if they can reuse data->os. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bootm: cleanup bootm_open_oftreeJan Remmet2015-11-201-28/+54
| |/ | | | | | | | | | | | | | | Separate oftree file and uimage oftree handling. Make fie_type checks in bootm_boot Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/console'Sascha Hauer2015-12-081-7/+4
|\ \
| * | console: Set baudrate during registrationSascha Hauer2015-11-171-7/+4
| |/ | | | | | | | | | | | | This makes sure that the cdev->baudrate field is always consistent with the hardware state. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/arm'Sascha Hauer2015-12-081-3/+0
|\ \
| * | ARM: Remove do_execute and thumb2_executeTrent Piepho2015-12-071-3/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 104a6a7ccfb7928ca5dc28c8cbe0ea231ffc45ee support was added for Thumb2. It added do_execute() as a way to provide arch dependent calling veneers for use in "go" and thumb2_execute() as the thumb2 to arm veneer. But thumb2_execute() isn't necessary as gcc generates a proper calling sequence from a standard function pointer call. Thumb2 barebox is compiled with the AAPCS ABI which requires this. It also had a bug and didn't pass the arguments properly, but code execute via "go" rarely uses arguments so this wasn't very noticeable. Since thumb2 was always the only user of do_execute(), go ahead and delete that too. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Revert "memtest: move error handling to end of function"Sascha Hauer2015-12-041-17/+20
|/ | | | | | | | While this simplifies the code as is I got the request to continue on errors in memtest, which can be better implemented when the messages are printed inline and not at the end of the function. This reverts commit 4ff9e28abc2e31dabde6d71503219b3e50d9f4e3.
* Merge branch 'for-next/misc'Sascha Hauer2015-11-063-11/+13
|\
| * filetype: Use cdev_openSascha Hauer2015-10-151-1/+3
| | | | | | | | | | | | | | a cdev has to be opened before usage. Use cdev_open instead of cdev_by_name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common/parser.c: Do not treat zero return code as errorAndrey Smirnov2015-10-151-8/+7
| | | | | | | | | | | | | | | | | | Run_command() would return zero to indicated success so treating it as error case would completely break command repetition logic, so change comparinson operator from "less or equal" to "less then" Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common/parser.c: Do not conflate error reporting disciplinesAndrey Smirnov2015-10-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Run_command() uses 0 to indicate success and negative values to indicate errors, whereas execute_command() uses 0 for success and positive integers to represent error codes. Conflating the two breaks the code that calls run_command and then checks for error code sign to detect problems, so avoid that by doing a very simple transformation on the result of execute_command Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common/command.c: Replace magic number with appropriate constantAndrey Smirnov2015-10-151-1/+1
| | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/memtest'Sascha Hauer2015-11-061-94/+175
|\ \
| * | memtest: By default only test biggest regionSascha Hauer2015-11-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Often enough the biggest free region spans most free RAM, so it doesn't add much value to test the remaining free regions. This patch changes the default behaviour to only test the biggest free region and adds the -t option to test all regions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: move error handling to end of functionSascha Hauer2015-11-041-20/+17
| | | | | | | | | | | | | | | | | | | | | Move error handling out of the test code to make the actual test better visible. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: move ctrlc check / progress showing into separate functionSascha Hauer2015-11-041-16/+24
| | | | | | | | | | | | | | | | | | To make the actual test a bit better visible in the code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: Make comments single line when appropriateSascha Hauer2015-11-031-16/+5
| | | | | | | | | | | | | | | | | | | | | Make the comments single line when they fit into a single line to make the code a bit shorter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: Make output more compactSascha Hauer2015-11-031-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | Especially when called multiple times the output of the memory test is quite verbose. Make it more compact by only describing once what is being done and only use one progress bare instead of three. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: split tests in separate functionsSascha Hauer2015-11-031-35/+1
| | | | | | | | | | | | | | | | | | | | | | | | The memtest does a bus integrity check and a moving inversions test. Split the tests into two separate functions so that the can be called separately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | rework remap_rangeSascha Hauer2015-11-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | memtest: move request/release regions to common/Sascha Hauer2015-10-271-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | Normally code providing a feature should be implemented in common/ which is then called from the command code. Follow this rule and move some more of the memtest code to common/. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | hush: Add missing initialize_context() in some placesSascha Hauer2015-11-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before a context can be used it must be initialized. This was forgotten in several places. Add the missing calls to initialize_context(). This fixes crashes when sourcing empty files Reported-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | login: make some locally used functions staticSergey Koshechkin2015-11-021-6/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | This patch continues cleanup password code from commit 40596b856f61c281fb34f804bf42550c099f26c3 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Thu Aug 27 15:58:50 2015 +0200 login: cleanup password code Signed-off-by: Sergey Koshechkin <tritel59@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / common/Makefile: Add missing dependencySascha Hauer2015-10-161-0/+1
|/ | | | | | imd-barebox.o needs include/generated/compile.h. Add the dependency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2015-10-071-0/+9
|\
| * common: clock: introduce mdelay_non_interruptible()Peter Mamonov2015-10-021-0/+9
| | | | | | | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/omap'Sascha Hauer2015-10-071-0/+37
|\ \
| * | detect_fs: use device instead of fileVicente Bergas2015-10-021-0/+37
| |/ | | | | | | | | | | | | | | detect_fs would usually mount a device on a directory, so, use a device-specific type detection. Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-10-072-4/+4
|\ \
| * | of_fix_tree: warn instead of fail when a fixup failsSascha Hauer2015-09-231-1/+2
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | introduce strerrorpSascha Hauer2015-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | putting an error pointer into strerror can be a bit confusing since strerror takes a positive error code but PTR_ERR returns a negative number, so we have to do strerror(-PTR_ERR(errp)). Some places got this wrong already, so introduce a strerrorp function which directly takes an error pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | console: use int rather than uint in printf() and friendsMasahiro Yamada2015-09-071-3/+3
| |/ | | | | | | | | | | | | | | These functions and vsprintf() return int type. No reason to use uint type. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: check return value of of_property_count_stringsSascha Hauer2015-09-291-0/+4
| | | | | | | | | | | | | | When a enum32 state variable node does not have a "names" property bail out instead of continuing with an error value used as number of strings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | state: write names in enum32 variables to oftree againSascha Hauer2015-09-291-7/+7
| | | | | | | | | | | | | | | | | | Commit 179b75a (state: fixup: only export default value during fixup if set) accidently removed writing the enum32 value names to the device tree. Add it back again Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
* | of_fix_tree: do not fail when fixup failsSascha Hauer2015-09-241-4/+2
| | | | | | | | | | | | | | When a device tree fixup fails it is worth printing a warning, but we should not fail booting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | passwd: avoid NULL ptr usageLucas Stach2015-09-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fixes common/password.c: In function 'check_passwd': common/password.c:292:4: warning: reading through null pointer (argument 3) pr_err("No such digest: %s\n", PASSWD_SUM); if no algo is enabled in which case PASSWD_SUM is defined to NULL. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of_fix_tree: Print error messageSascha Hauer2015-09-081-1/+4
|/ | | | | | | | When a of_fixup handler fails add a meaningful error message so that the user gets a clue what might have gone wrong. Suggested-by: Enrico Joerns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/restart'Sascha Hauer2015-09-014-5/+142
|\
| * reset-source: Add some debugging aidsSascha Hauer2015-08-281-0/+4
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset-source: Allow different prioritiesSascha Hauer2015-08-281-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Different devices may report the reset source with different levels of certainty. For example a SoC may see a power-on reset, but this may only be because an external PMIC has power cycled the SoC. This means the PMIC knows the real reason better and thus the reset reason from the PMIC should be preferred. This patch introduces priorities for the reset_source to handle the above scenario. Also add a of_get_reset_source_priority() function to retrieve the desired priority from the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset-source: Use globalvar_add_simple_enumSascha Hauer2015-08-271-4/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>