summaryrefslogtreecommitdiff
path: root/drivers/fastboot/fb_getvar.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-07drivers: fastboot: Add logical-block-size in getvar commandXingyu Wu1-0/+18
Add a new parameter to get "logical-block-size" in getvar command. Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
2020-09-01fastboot: getvar: fix partition-size return valueGary Bisson1-2/+2
The size returned by 'getvar partition-size' should be in bytes, not in blocks as fastboot uses that value to generate empty partition when running format [1]. Note that the function was already returning the proper size in bytes for NAND devices (see struct part_info details). [1] https://android.googlesource.com/platform/system/core/+/refs/heads/android10-release/fastboot/fastboot.cpp#1500 Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
2020-05-19common: Drop part.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19part: Drop disk_partition_t typedefSimon Glass1-2/+2
We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_get() to env.hSimon Glass1-0/+1
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-08fastboot: Remove "bootloader-version" variableSam Protsenko1-6/+3
As per [1], there is no such fastboot variable as "bootloader-version". Only "version-bootloader" is supported. Let's reflect this and not confuse users further. [1] https://android.googlesource.com/platform/system/core/+/refs/tags/android-q-preview-4/fastboot/README.md Fixes: 3aab70afc531d1 ("usb/gadget: add the fastboot gadget") Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Eugeniu Rosca <erosca@de.adit-jv.com>
2019-08-08fastboot: getvar: Add "is-userspace" variableSam Protsenko1-0/+9
As per documentation [1], Android-Q requires for bootloader to provide "is-userspace" variable. "no" value should be always returned. This patch implements this fastboot variable. [1] https://android.googlesource.com/platform/system/core/+/refs/tags/android-q-preview-4/fastboot/README.md Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Eugeniu Rosca <erosca@de.adit-jv.com>
2019-08-08fastboot: Remove "slot-suffixes" variableSam Protsenko1-9/+0
"slot-suffixes" variable was dropped in fastboot tool (in [1]). Let's track AOSP/master and drop this variable in U-Boot as well. [1] https://android.googlesource.com/platform/system/core/+/42b18a518bac85c3eea14206f6cbafbd1e98a31f Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> [lukma: Remove getvar_slot_suffixes() declaration] Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-06-14fastboot: Check if partition really exist in getvar_has_slot()Igor Opaniuk1-5/+34
Currently getvar_has_slot() invocation for "boot" and "system" partitions always returns affirmative response regardless the fact of existence of these partitions, which leads to impossibility to flash them on old non-A/B AOSP setups, where _a/_b suffixes aren't used: $ fastboot flash boot boot.img Sending 'boot__a' (11301 KB) OKAY [ 0.451s] Writing 'boot__a' FAILED (remote: 'cannot find partition') fastboot: error: Command failed Although partition layout is: -> part list mmc 0 Partition Map for MMC device 0 -- Partition Type: EFI Part Start LBA End LBA Name Attributes Type GUID Partition GUID 1 0x00000800 0x000107ff "boot" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: ea2e2470-db4a-d646-b828-10167f736d63 2 0x00010800 0x000127ff "environment" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: 10a819d2-6004-3d48-bd87-114e2a796db9 3 0x00012800 0x0001a7ff "recovery" attrs: 0x0000000000000000 type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 guid: 9ea116e4-8a34-0c48-8cf5-2fe9480f56cd 4 0x0001a800 0x0031a7ff "system" attrs: 0x0000000000000000 ...... This patch adds checks of existence for requested partitions on eMMC/NAND. Fixes: f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot") Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-06-14fastboot: getvar: Refactor fastboot_*_get_part_info() usageSam Protsenko1-16/+42
Extract fastboot_*_get_part_info() usage for MMC and NAND into getvar_get_part_info() function, as it will be needed further in other functions. This way we can avoid code duplication and mess with preprocessor directives across all points of usage. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-14fastboot: Fix slot names reported by getvarSam Protsenko1-3/+3
In commit [1] fastboot tool was changed w.r.t. new A/B specification [2], and now we should report slot names in "a" format instead of "_a". Latter is now considered legacy and we shouldn't rely on that anymore. Due to this one can observe next error with recent fastboot tool: $ fastboot flash boot boot.img Sending 'boot__a' (11301 KB) OKAY [ 0.451s] Writing 'boot__a' FAILED (remote: 'cannot find partition') fastboot: error: Command failed Let's use new slot format in order to fix double underscores "__" and to be in sync with AOSP master. [1] https://android.googlesource.com/platform/system/core/+/8091947847d5e5130b09d2ac0a4bdc900f3b77c5 [2] https://source.android.com/devices/tech/ota/ab/ab_implement#partitions Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-04-21fastboot: add support for 'getvar platform'Eugeniu Rosca1-0/+14
Our R-Car3 Android userspace relies on the output of 'fastboot getvar platform' and U-Boot currently is not able to handle it: host $> fastboot getvar platform getvar:platform FAILED (remote: Variable not implemented) finished. total time: 0.001s We either have the option of adding 'fastboot.platform' variable to the default/saved environment as a workaround or add proper 'fastboot getvar platform' support in U-Boot via this patch. In the latter case, other platforms can benefit from it too. Note that R-Car3 already exports 'platform' environment variable via v2019.01 commit 00e4b57e9e71c3 ("ARM: rmobile: Set environment variable containing CPU type"). Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
2019-04-21fastboot: getvar: correct/rename "has_slot" to "has-slot"Eugeniu Rosca1-1/+1
Since its inception in upstream fastboot android-n-preview-1 [1], "has-slot" option has never taken the form of "has_slot". Amongst the users of "getvar has-slot:" is the upstream bootloadertest.py [2]. Current U-Boot "has_slot" version must be a typo. Fix it. [1] https://android.googlesource.com/platform/system/core/+/a797479bd51c ("Fix fastboot variable name") [2] https://android.googlesource.com/platform/system/extras/+/72de393e118e3 ("Bootloader verification for AndroidThings.") Fixes: f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Acked-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-05-30net: fastboot: Merge AOSP UDP fastbootAlex Kiernan1-0/+230
Merge UDP fastboot support from AOSP: https://android.googlesource.com/platform/external/u-boot/+/android-o-mr1-iot-preview-8 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alex Deymo <deymo@google.com> Signed-off-by: Jocelyn Bohr <bohr@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>