summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* efi: write volatile EFI variables used by systemdMichael Olbrich2015-07-271-0/+1
| | | | | | | | | | LoaderTimeInitUSec and LoaderTimeExecUSec are used e.g. in systemd-analyze to calculate the time spent in the firmare and barebox. LoaderDevicePartUUID is used to mount the EFI partition to /boot. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add helper to get the GPT partition UUID for a deviceMichael Olbrich2015-07-271-0/+30
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drop <stddef.h> includesSascha Hauer2015-07-231-1/+0
| | | | | | | The compilers stddef.h should not be included. We declare all types ourselves. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/blspec'Sascha Hauer2015-07-064-1/+34
|\
| * blspec: Automatically append rootargSascha Hauer2015-06-181-1/+28
| | | | | | | | | | | | | | | | | | | | | | This patch makes it possible to automatically add a suitable root= option for booting Linux from the same filesystem on which the bootspec entry has been found. This adds an additional 'linux-appendroot' option to bootspec which if set to 'true' will cause barebox to automatically add a root= option. This currently works for NFS, UBIFS and regular block devices like ATA, SD/MMC using the root=PARTUUID= mechanism. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * cdev: Add partuuid string to struct cdevSascha Hauer2015-06-183-0/+6
| | | | | | | | | | | | | | | | This adds the partuuid string to struct cdev in order to have this available for constructing a suitable Linux root=PARTUUID= option for booting Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/state'Sascha Hauer2015-07-031-14/+190
|\ \
| * | state: fixup: only export default value during fixup if setMarc Kleine-Budde2015-06-261-8/+19
| | | | | | | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: add support for fixed length stringsMarc Kleine-Budde2015-06-261-0/+152
| | | | | | | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: struct variable_type::import: remove const from node argumentMarc Kleine-Budde2015-06-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the const qualifier of the node argument from struct variable_type::import. This is a preparation patch to support fixed strings in state. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: uint8: add range check for uint8Marc Kleine-Budde2015-06-171-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Bail out, if the user tries to set a value > 255. Cc: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: uint8: use %u as format stringMarc Kleine-Budde2015-06-171-1/+1
| |/ | | | | | | | | | | Cc: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2015-07-031-8/+1
|\ \ | | | | | | | | | | | | Conflicts: drivers/mtd/core.c
| * | blspec: Use device_detect_by_nameSascha Hauer2015-06-261-8/+1
| |/ | | | | | | | | | | | | device_detect_by_name will automatically separate by colons now, we no longer have to do this in the blspec code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-07-034-3/+10
|\ \
| * | treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-023-3/+0
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | images: Add file size check for PBLX filesWadim Egorov2015-06-261-0/+10
| |/ | | | | | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx-bbu-nand-fcb'Sascha Hauer2015-07-034-0/+649
|\ \ | | | | | | | | | | | | Conflicts: common/Kconfig
| * | imx-bbu-nand-fcb: Split space for firmware in two equal regionsSascha Hauer2015-06-121-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to write the second firmware right after the first firmware. However, splitting the available space into two equal regions has advantages: When we update barebox the next time the generated FCB/DBBT blocks will be the same as with the last update, so in case of power failure it is more likely that we have valid data in one of the FCB/DBBT areas. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Erase whole partitionSascha Hauer2015-06-121-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now that we use a partition for the bootloader instead of the whole NAND device we can erase it completely instead of hardcoded 2MB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Let DBBT start at page 1Sascha Hauer2015-06-121-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to put the FCB in the first two NAND blocks and the DBBT in the third and fourth block. It's much more space efficient to put the FCB and DBBT together into the same eraseblock in different pages. This way we can store four FCBs and four DBBTs instead of two only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: make available for i.MX28 aswellSascha Hauer2015-06-122-23/+152
| | | | | | | | | | | | | | | | | | | | | | | | The code can be used with slight modifications on i.MX28 aswell. Add a i.MX28 registration function and move the differences to function callbacks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Use barebox partition instead of whole deviceSascha Hauer2015-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to use nand0 device for storing barebox and made the assumption that there is enough space at the beginning of the first device. Instead, use the barebox partition directly. This requires that the partition where barebox should be stored is named 'barebox', that is the case for all boards currently. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Fix debug messagesSascha Hauer2015-06-121-2/+2
| | | | | | | | | | | | | | | | | | We should print the block number before increasing it, not afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX6: bbu nand: Move to common placeSascha Hauer2015-06-123-0/+500
| | | | | | | | | | | | | | | | | | The code can be used on i.MX28 aswell, so move it to a common place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | filetype: Add filetype for MXS bootstreamSascha Hauer2015-06-121-0/+3
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/blspec'Sascha Hauer2015-07-031-5/+45
|\ \ \
| * | | blspec: Automatically attach UBI devicesSascha Hauer2015-06-171-5/+45
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | When blspec_scan_cdev finds an UBI device then attach it. This allows us to boot blspec entries found on the UBIFS images inside UBI volumes by pointing to the corresponding mtd partition. With this we can do 'boot nand0.root' or even 'boot=nand0' on the commandline. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / | bbu: Add a standard file-to-device-copy handlerSascha Hauer2015-07-011-0/+113
|/ / | | | | | | | | | | | | | | The most standard update handler will simply copy a file to a device. This can be shared across several users, so add a standard handler for this operation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | 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>