summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge branch 'for-next/randconfig-1'Sascha Hauer2014-12-081-1/+1
|\
| * Kconfig: make BROKEN invisibleSascha Hauer2014-11-281-1/+0
| | | | | | | | | | | | | | | | BROKEN is a developer option to keep things in the tree we know are broken. Make this option invisible so that randconfig builds do not enable it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: Let MMU depend on !CPU_ARM946ESascha Hauer2014-11-281-0/+1
| | | | | | | | | | | | | | CPU_ARM946E is selected by boards, so letting it depend on !MMU leads to broken dependencies. Let MMU depend on !CPU_ARM946E instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/persistent-vars'Sascha Hauer2014-12-084-78/+360
|\ \ | | | | | | | | | | | | Conflicts: arch/arm/boards/efika-mx-smartbook/defaultenv-efikasb/config
| * | defaultenv-2: Make use of nonvolatile variablesSascha Hauer2014-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the variable assignments previously done in /env/config-board to non volatile variables in /env/nv/. This makes the settings adjustable by the user without editing a file. Most of the changes are simple conversions which for many boards makes /env/config-board unnecessary. Some boards had some logic to assign global.boot.default based on the current bootsource. This has been moved to /env/init/bootsource. An additional check is added to not overwrite a nv.boot.default should it exist. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | globalvar: Add support for printing all global variablesSascha Hauer2014-11-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This could previously only be done with 'devinfo global'. While this is still possible this adds a more direct access via the globalvar command. This variant also adds a '*' in front of the variable if the corresponding non volatile variable exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Add support for non volatile variablesSascha Hauer2014-11-063-0/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds (back) support for non volatile variables. Non volatile variables are variables which are stored in the environment over reboot. They are used in the same way as the global variables, but with a 'nv' command and device. The variables are stored under /env/nv/, one variable per file. Adding a nv variable automatically adds a global variable with the same name. Changing a nv variable also changes the same global variable, but not the other way round. This allows for example to configure the username as: nv user=sha; saveenv Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | environment: Only save changes to the defaultenvSascha Hauer2014-11-062-14/+108
| | | | | | | | | | | | | | | | | | | | | Instead of storing the complete files with a 'saveenv' command only store the files that have changes to the default environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | environment: refactor saveenvSascha Hauer2014-11-061-68/+75
| | | | | | | | | | | | | | | | | | | | | | | | Collect all files in a list first and iterate over the list when creating the actual environment image. Makes the next patches easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | environment: remove unused variableSascha Hauer2014-11-051-1/+0
| | | | | | | | | | | | | | | | | | fd is unused, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | environment: drop unnecessary castsSascha Hauer2014-11-051-6/+6
| | | | | | | | | | | | | | | | | | No Need to cast void pointers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2014-12-081-1/+1
|\ \ \ | |_|/ |/| |
| * | partitions/efi: Fix off-by-one error in 'last_lba'Andrey Smirnov2014-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | LBAs are numbered starting from zero so the last LBA # would be equal to total number of blocks minus one. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | blspec: depend on, not select flexible bootargsLucas Stach2014-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blspec is a consumer of the flexible bootargs mechanism, so it should depend on it rather than select it. Fixes: warning: (BLSPEC && DEFAULT_ENVIRONMENT_GENERIC_NEW) selects FLEXIBLE_BOOTARGS which has unmet direct dependencies (COMMAND_SUPPORT && CMD_GLOBAL) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | common: menu needs PROCESS_ESCAPE_SEQUENCELucas Stach2014-11-241-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | common: firmware: include libfileLucas Stach2014-11-241-0/+1
|/ / | | | | | | | | | | | | | | | | | | Fixes common/firmware.c:206:2: error: implicit declaration of function 'copy_file' in a number of configuration where this file isn't pulled in through other headers. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / blspec: fix incompatible pointer type warningLucas Stach2014-11-071-1/+1
|/ | | | | | | | | The warning is correct in that we pass in size_t instead of int. As we are not interested in the size of the property at this point, just remove the assignment. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/xz'Sascha Hauer2014-11-052-0/+9
|\
| * Add xz decompression supportSascha Hauer2014-11-041-0/+5
| | | | | | | | | | | | | | | | This adds xz decompression support from the kernel. Both compressing the barebox binary with xz and decompressing xz files on the commandline is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * filetype: Add XZ filetype supportSascha Hauer2014-10-241-0/+4
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/tegra'Sascha Hauer2014-11-051-0/+1
|\ \
| * | reset_source: add thermal resetLucas Stach2014-11-041-0/+1
| |/ | | | | | | | | | | | | | | Some SoCs are able to detect if they got reset in response to an overtemperature event. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: fix mbr filetype detectionZahari Doychev2014-11-052-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes mbr is erroneously recocognised as FAT partion. Due to this the mbr partition parser is not being called and the partitions on the media are not detected. This patch should fix the problem. The checking is done as in the linux kernel. I have seen the problem using usb sticks. Although partitioning and formatting them under linux. The file system type field in the mbr remains there which causes the wrong detections as FAT32 type and not as mbr. Signed-off-by: Zahari Doychev <zahari.doychev@linux.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | param: let dev_add_param return the newly created paramSascha Hauer2014-10-081-1/+6
| | | | | | | | | | | | | | | | dev_add_param creates a new parameter so it makes more sense to return it than to return an error code. Since the return value is hardly ever checked this is only a small patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clock.c: fix whitespacesAntony Pavlov2014-10-081-47/+47
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-022-7/+15
|\
| * resource: Let request_ioport_region return an error pointerSascha Hauer2014-09-161-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * resource: Let request_iomem_region return an error pointerSascha Hauer2014-09-162-9/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * resource: Let __request_region return an error pointerSascha Hauer2014-09-162-6/+20
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/firmware'Sascha Hauer2014-10-023-0/+215
|\ \
| * | Add a Firmware programming frameworkJuergen Beisert2014-09-093-0/+215
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This framework handles a list of registered Firmware programming handlers to unify a firmware programming interface by hiding the details how to program a specific Firmware in its handler. This is created with FPGAs in mind but should be usable for other devices aswell. A user has two possibilities to load a firmware. A device file is create under /dev/ which can be used to copy a firmware to. Additionally a firmwareload command is introduced which can list the registered firmware handlers and also to upload a firmware. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Introduce message logging supportSascha Hauer2014-09-302-3/+129
| | | | | | | | | | | | | | | | | | | | This adds a buffer for log messages and a 'dmesg' command to print the messages. The log buffer is implemented as log objects rather than a string buffer. This makes it easy to implement limiting the messages, cleaning the buffer and timestamping the messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | startup: Don't print multiple lines with pr_infoSascha Hauer2014-09-301-1/+3
| | | | | | | | | | | | | | | | Print the banner with pr_info, but the empty lines before and after it with printf. This makes the banner show up in the log show up properly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clock: make get_time_ns() safe to be called without clocksourceSascha Hauer2014-09-301-0/+3
| | | | | | | | | | | | | | | | make it possible to call get_time_ns() before the clocksource has been registered. Just return 0 in this case which is still better than crashing the system. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clock: Add a variable with the first timestamp after startupSascha Hauer2014-09-301-0/+8
|/ | | | | | | For measuring the startup time it's useful to save the first timestamp after the clocksource has been registered. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-gadget'Sascha Hauer2014-08-074-0/+121
|\ | | | | | | | | | | | | | | Conflicts: commands/Makefile common/Kconfig common/Makefile drivers/usb/gadget/dfu.c
| * Add release stringSascha Hauer2014-07-221-0/+4
| | | | | | | | | | | | | | | | | | Currently we only have version_string which contains information about the date the binary was compiled and by whom it has been compiled. This adds a release_string which only contains the plain release version. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Add function to parse a string in dfu formatSascha Hauer2014-07-223-0/+117
| | | | | | | | | | | | | | | | | | The dfu command parses a string which contains a list of devices and flags. This format is useful for other users aswell, so add common helper functions to parse it and let the dfu command use this format. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'for-next/console' into for-next/usb-gadgetSascha Hauer2014-07-221-2/+8
| |\
| * \ Merge branch 'for-next/misc' into for-next/usb-gadgetSascha Hauer2014-07-223-170/+3
| |\ \
* | \ \ Merge branch 'for-next/misc'Sascha Hauer2014-08-074-171/+21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: lib/Makefile
| * | | | Revert "common: resource: print conflicts as warning"Sascha Hauer2014-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On several i.MX boards we register SDRAM with the values from the SDRAM controller and also with values from the device tree. This now issues a warning each time the board is started. Revert the commit for now. A better solution might be to check if the same SDRAM region already exists before trying to register it again. This reverts commit c9e2e08edcdce4205821226817686e62dc349eab. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: allow "make ARCH=sandbox allyesconfig"Holger Schurig2014-07-221-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiling the tree with allyesconfig is helpful because different compilers (gcc, clang) or static checkers (e.g. clang's scan-build) can then process and check more code. This patch introduces two new configuration symbols that Kconfig files can depend on. That way, code that is only working where a cache or DMA implementation exists can be opted out. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | sandbox: disable bareboxcrc32 in sandbox modeHolger Schurig2014-07-221-0/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | It won't compile currently anyway. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | introduce verbose debugSascha Hauer2014-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During debugging it sometimes helps to me even more verbose. This adds an additional debug level for this. Also we remove an already existing pr_vdebug definition in the USB gadget u_serial driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | dlmalloc: remove unused functionsSascha Hauer2014-07-091-169/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove unused function declarations and definitions: - vallocc is #if 0 in source code - pvalloc is defined but not used - cfree is defined but not used - malloc_usable_size is unused - mallopt is not defined - mallinfo is not defined Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hush: Fix error code returned valueHerve Codina2014-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just returns error code instead of 0 or 1. With this fix, $? is set to child exit code in all cases. Without this fix, /child $PATH;echo $? displays 1 even if child script calls exit with a specific non zero error code. Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/metadata'Sascha Hauer2014-08-079-0/+361
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/arm/dts/Makefile common/Makefile lib/Makefile
| * | | | Add support for metadata in barebox imagesSascha Hauer2014-08-074-1/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often useful to get some information about a barebox image before starting or flashing it. This patch introduces barebox Image MetaData (IMD). When enabled a barebox image will contain a list of tags containing the desired information. We have tags for: - the barebox release (2014.07.0-00160-g035de50-dirty) - the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014) - the board model the image is intended for - the device tree toplevel compatible property Also there is an additional generic key-value store which stores parameters for which no dedicated tag exists. In this patch it is used for the memory size an image supports. Since there is no fixed offset in a barebox image which can be used for storing the information, the metadata is stored somewhere in the image and found by iterating over the image. This works for most image types, but obviously not for SoC images which are encoded or encrypted in some way. There is a 'imd' tool compiled from the same sources for barebox, for the compile host and for the target, so the metadata information is available whereever needed. For device tree boards the model and of_compatible tags are automatically generated. Example output of the imd tool for a Phytec phyFLEX image: build: #889 Wed Jul 30 16:08:54 CEST 2014 release: 2014.07.0-00167-g6b2070d-dirty parameter: memsize=1024 of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>