summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-07-24cmd: bcb: Use strcmp() instead of strncmp() for string literalsEugeniu Rosca
Quote from https://patchwork.ozlabs.org/patch/1104244/#2210814: ----------8<----------- strncmp() is chosen for the sake of paranoid/defensive programming. Indeed, strncmp() is not really needed when comparing a variable with a string literal. We expect strcmp() to behave safely even if the string variable is not NUL-terminated. In the same scenario, Linux v5.2-rc7 uses both strcmp() and strncmp(), but the frequency of strcmp() is higher: $ git --version git version 2.22.0 $ (Linux 5.2-rc7) git grep -En 'strncmp\([^"]*"[[:alnum:]]+"' | wc -l 1066 $ (Linux 5.2-rc7) git grep -En 'strcmp\([^"]*"[[:alnum:]]+"' | wc -l 1968 A quick "strcmp vs strncmp" object size test shows that strcmp() generates smaller memory footprint (gcc-8, x86_64): $ (U-Boot) size cmd/bcb-strncmp.o cmd/bcb-strcmp.o text data bss dec hex filename 3373 400 2048 5821 16bd cmd/bcb-strncmp.o 3314 400 2048 5762 1682 cmd/bcb-strcmp.o So, overall, I agree to use strcmp() whenever variables are compared with string literals. ----------8<----------- Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields") Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2019-07-24cmd: bcb: Fix duplicated handling in two case-branchesEugeniu Rosca
Fix warning V1037 reported by PVS-Studio Static Analyzer: Two or more case-branches perform the same actions. Check lines: 49, 53 Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-07-24treewide: Fix stale references of Android docsEugeniu Rosca
Commit 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB overview") left some obsolete references of Android documents/paths. This has been pointed out by Sam (thanks!) in: https://patchwork.ozlabs.org/patch/1104245/#2208134 Fixes: 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB overview") Reported-by: Sam Protsenko <semen.protsenko@linaro.org> Suggested-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-07-24image: android: allow to wrap uImage into the Android boot imageRoman Stratiienko
This allows to use any available compression format with Android boot image Since not all available compression formats have a magic number we should explicitly specify type of compression. For this purpose using uImage format becomes very useful, as this format is well-known by the community and mkimage tool is already available. Usage example: mkimage -A ARM64 -T kernel -C lzma -d Image.lzma out/kernel At this moment only -C option is handled, but specifying -A and -T options are recommended for compatibility reasons in the future. Kernel that compressed with LZ4 can be already used without wrapping into the uImage, but I recommend wrapping it into the uImage in order to avoid situations when by some mistake legacy LZ4 is used, that is interpreted as raw Image and causes CPU to enter Exception Handler without providing any meaningful explanation to the user. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-07-24menu: don't bother going interactive with just one menu itemLeon Yu
If there is only one menu item available, prompting user to enter choice makes little sense and just causes unnecessary boot delay. This change makes menu_get_choice return the only one item when there is no other choices. Signed-off-by: Leon Yu <leoyu@nvidia.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Thierry Reding <treding@nvidia.com>
2019-07-24cmd: part: Add 'number' sub-commandRuslan Trofymenko
This sub-command serves for getting the partition index from partition name. Also it can be used to test the existence of specified partition. Use case: For example, in most CI environments this U-Boot command for automatic testing of Linux rootfs is used: => setenv bootpart 1:f where 0xf is "userdata" partition. But the number of "userdata" partition can be changed any time, when partition table is changed. So it would be nice to get rid of that 0xf magic number and use partition name instead, like this: => part number mmc 1 userdata part_num => setenv bootpart 1:${part_num} Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Alistair Strachan <astrachan@google.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-07-24Merge branch '2019-07-24-doc-html-cleanup'Tom Rini
- Convert our docs to Sphinx
2019-07-24doc: Remove README.blackfinBin Meng
U-Boot no longer supports blackfin architecture. Remove the doc. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.xtensa to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.sandbox to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.sh to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.m68k to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.ARC to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.nios2 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.NDS32 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. This also merges README.N1213 contents into the new nds32.rst file. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.arm64 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: arch: Convert README.x86 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.zynq to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.b4860qds to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.at91 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.sh7753evb to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.sh7752evb to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.sifive-fu540 to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.ag101p to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add AndesTech ax25-ae350 board docBin Meng
This converts README.AX25 and README.ae350 plain text documentation to reST format, merges them into one ax25-ae350 doc, and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.qemu-mips to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.qemu-riscv to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Convert README.qemu-arm to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add QEMU x86 board docBin Meng
This extracts QEMU x86 board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add coreboot board docBin Meng
This extracts coreboot board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Google Chromebook Samus board docBin Meng
This extracts Google Chromebook Samus board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Google Chromebook Link board docBin Meng
This extracts Google Chromebook Link board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Intel Galileo board docBin Meng
This extracts Intel Galileo board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Intel Edison board docBin Meng
This extracts Intel Edison board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
2019-07-24doc: board: Add Intel Cougar Canyon 2 board docBin Meng
This extracts Intel Cougar Canyon 2 board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Intel Cherry Hill board docBin Meng
This extracts Intel Cherry Hill board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Intel Bay Trail based board docsBin Meng
This extracts Intel Bay Trail based board specific information from README.x86, converts plain text documentation to reST format and adds them to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: board: Add Intel Crown Bay board docBin Meng
This extracts Intel Crown Bay board specific information from README.x86, converts plain text documentation to reST format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: Add board specific info to Sphinx TOC treeBin Meng
Add index.rst for board. More docs will be added later. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-24doc: arch: Convert README.mips to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-24doc: Add architecture specific info to Sphinx TOC treeBin Meng
Add index.rst for architecture specific info. More docs will be added later. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-24doc: driver-model: Convert usb-info.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert spi-howto.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert serial-howto.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert remoteproc-framework.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert pmic-framework.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert pci-info.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert of-plat.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert livetree.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24doc: driver-model: Convert i2c-howto.txt to reSTBin Meng
Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>