summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml228
-rw-r--r--Documentation/efi.rst16
-rw-r--r--Documentation/index.rst122
-rw-r--r--Documentation/linker_lists.rst100
-rw-r--r--Documentation/serial.rst7
-rw-r--r--MAINTAINERS2
-rw-r--r--README11
-rw-r--r--arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi24
-rw-r--r--arch/arm/include/asm/arch-rockchip/f_rockusb.h4
-rw-r--r--arch/arm/mach-snapdragon/Makefile1
-rw-r--r--arch/arm/mach-snapdragon/dram.c98
-rw-r--r--arch/arm/mach-snapdragon/include/mach/dram.h12
-rw-r--r--board/qualcomm/dragonboard410c/dragonboard410c.c3
-rw-r--r--board/sandbox/sandbox.c9
-rw-r--r--board/st/stm32mp1/stm32mp1.c4
-rw-r--r--cmd/elf.c75
-rw-r--r--cmd/sata.c4
-rw-r--r--common/board_r.c3
-rw-r--r--configs/omap3_logic_defconfig3
-rw-r--r--configs/stm32mp15_basic_defconfig2
-rw-r--r--disk/part.c2
-rw-r--r--doc/README.iscsi130
-rw-r--r--doc/README.rockusb11
-rw-r--r--doc/uImage.FIT/source_file_format.txt4
-rw-r--r--drivers/dfu/dfu.c10
-rw-r--r--drivers/led/led-uclass.c30
-rw-r--r--drivers/led/led_gpio.c17
-rw-r--r--drivers/serial/serial.c8
-rw-r--r--drivers/usb/gadget/f_rockusb.c261
-rw-r--r--drivers/usb/gadget/f_thor.c4
-rw-r--r--env/env.c14
-rw-r--r--include/configs/am3517_crane.h2
-rw-r--r--include/configs/am3517_evm.h2
-rw-r--r--include/configs/cm_t35.h2
-rw-r--r--include/configs/cm_t3517.h2
-rw-r--r--include/configs/devkit8000.h3
-rw-r--r--include/configs/mcx.h2
-rw-r--r--include/configs/omap3_logic.h2
-rw-r--r--include/configs/omap3_overo.h2
-rw-r--r--include/configs/omap3_pandora.h2
-rw-r--r--include/configs/omap3_zoom1.h2
-rw-r--r--include/configs/tao3530.h2
-rw-r--r--include/configs/tricorder.h3
-rw-r--r--include/elf.h3
-rw-r--r--include/led.h9
-rw-r--r--lib/smbios.c3
-rw-r--r--scripts/config_whitelist.txt1
-rw-r--r--test/dm/led.c3
48 files changed, 906 insertions, 358 deletions
diff --git a/.travis.yml b/.travis.yml
index d5862066570..4db629d15bd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -146,233 +146,277 @@ matrix:
include:
# we need to build by vendor due to 50min time limit for builds
# each env setting here is a dedicated build
- - env:
+ - name: "buildman arc"
+ env:
- BUILDMAN="arc"
TOOLCHAIN="arc"
- - env:
+ - name: "buildman arm11 arm7 arm920t arm946es"
+ env:
- BUILDMAN="arm11 arm7 arm920t arm946es"
- - env:
+ - name: "buildman arm926ejs (non-mx,siemens,atmel,kirkwood)"
+ env:
- JOB="arm926ejs"
BUILDMAN="arm926ejs -x mx,siemens,atmel,kirkwood"
- - env:
+ - name: "buildman atmel"
+ env:
- BUILDMAN="atmel"
- - env:
- BUILDMAN="boundary engicam toradex"
- - env:
- - JOB="Freescale ARM32"
- BUILDMAN="freescale -x powerpc,m68k,aarch64"
- - env:
- - JOB="Freescale AArch64"
- BUILDMAN="freescale&aarch64"
- - env:
- - JOB="i.MX6 (non-Freescale)"
- BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
- - env:
- - JOB="i.MX (non-Freescale, non-i.MX6)"
- BUILDMAN="mx -x freescale,mx6,toradex"
- - env:
+ - name: "buildman boundary engicam toradex"
+ env:
+ - BUILDMAN="boundary engicam toradex"
+ - name: "buildman Freescale ARM32"
+ env:
+ - BUILDMAN="freescale -x powerpc,m68k,aarch64"
+ - name: "buildman Freescale AArch64"
+ env:
+ - BUILDMAN="freescale&aarch64"
+ - name: "buildman i.MX6 (non-Freescale)"
+ env:
+ - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
+ - name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
+ env:
+ - BUILDMAN="mx -x freescale,mx6,toradex"
+ - name: "buildman k2"
+ env:
- BUILDMAN="k2"
- - env:
+ - name: "buildman samsung socfpga"
+ env:
- BUILDMAN="samsung socfpga"
- - env:
+ - name: "buildman sun4i"
+ env:
- BUILDMAN="sun4i"
- - env:
+ - name: "buildman sun5i"
+ env:
- BUILDMAN="sun5i"
- - env:
+ - name: "buildman sun6i"
+ env:
- BUILDMAN="sun6i"
- - env:
+ - name: "builman sun7i"
+ env:
- BUILDMAN="sun7i"
- - env:
+ - name: "buildman sun8i"
+ env:
- BUILDMAN="sun8i"
- - env:
+ - name: "buildman sun9i"
+ env:
- BUILDMAN="sun9i"
- - env:
+ - name: "buildman sun50i"
+ env:
- BUILDMAN="sun50i"
- - env:
- - JOB="Catch-all ARM"
- BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
- - env:
+ - name: "buildman catch-all ARM"
+ env:
+ - BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
+ - name: "buildman sandbox x86"
+ env:
- BUILDMAN="sandbox x86"
TOOLCHAIN="x86_64"
- - env:
+ - name: "buildman kirkwood (excluding openrd)"
+ env:
- BUILDMAN="kirkwood -x openrd"
- - env:
+ - name: "buildman mvebu"
+ env:
- BUILDMAN="mvebu"
- - env:
- - JOB="PXA"
+ - name: "buildman PXA (non-toradex)"
+ env:
- BUILDMAN="pxa -x toradex"
- - env:
+ - name: "buildman m68k"
+ env:
- BUILDMAN="m68k"
TOOLCHAIN="m68k"
- - env:
+ - name: "buildman microblaze"
+ env:
- BUILDMAN="microblaze"
TOOLCHAIN="microblaze"
- - env:
+ - name: "buildman mips"
+ env:
- BUILDMAN="mips"
TOOLCHAIN="mips"
- - env:
- - JOB="Non-Freescale PowerPC"
- BUILDMAN="powerpc -x freescale"
+ - name: "buildman non-Freescale PowerPC"
+ env:
+ - BUILDMAN="powerpc -x freescale"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman mpc85xx&freescale (excluding many)"
+ env:
- BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman t208xrdb corenet_ds"
+ env:
- BUILDMAN="t208xrdb corenet_ds"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman Freescale PowerPC"
+ env:
- BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman t102*"
+ env:
- BUILDMAN="t102*"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman p1_p2_rdb_pc"
+ env:
- BUILDMAN="p1_p2_rdb_pc"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman p1010rdb bsc91"
+ env:
- BUILDMAN="p1010rdb bsc91"
TOOLCHAIN="powerpc"
- - env:
+ - name: "buildman siemens"
+ env:
- BUILDMAN="siemens"
- - env:
- - JOB="tegra"
- BUILDMAN="tegra -x toradex"
- - env:
- - JOB="am33xx"
- BUILDMAN="am33xx -x siemens"
- - env:
+ - name: "buildman tegra"
+ env:
+ - BUILDMAN="tegra -x toradex"
+ - name: "buildman am33xx (no siemens)"
+ env:
+ - BUILDMAN="am33xx -x siemens"
+ - name: "buildman omap"
+ env:
- BUILDMAN="omap"
- - env:
+ - name: "buildman uniphier"
+ env:
- BUILDMAN="uniphier"
- - env:
- - JOB="Catch-all AArch64"
- BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
- - env:
+ - name: "buildman catch-all AArch64"
+ env:
+ - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
+ - name: "buildman rockchip"
+ env:
- BUILDMAN="rockchip"
- - env:
- - JOB="sh"
- BUILDMAN="sh -x arm"
+ - name: "buildman sh"
+ env:
+ - BUILDMAN="sh -x arm"
TOOLCHAIN="sh"
- - env:
- - JOB="Xilinx (ARM)"
- BUILDMAN="xilinx -x microblaze"
- - env:
+ - name: "buildman Xilinx (ARM)"
+ env:
+ - BUILDMAN="xilinx -x microblaze"
+ - name: "buildman xtensa"
+ env:
- BUILDMAN="xtensa"
TOOLCHAIN="xtensa-dc233c-elf"
- - env:
+ - name: "buildman riscv"
+ env:
- BUILDMAN="riscv"
TOOLCHAIN="riscv"
# QA jobs for code analytics
# static code analysis with cppcheck (we can add --enable=all later)
- - env:
- - JOB="cppcheck"
+ - name: "cppcheck"
script:
- cppcheck --force --quiet --inline-suppr .
# search for TODO within source tree
- - env:
- - JOB="grep TODO"
+ - name: "grep TODO"
script:
- grep -r TODO .
# search for FIXME within source tree
- - env:
- - JOB="grep FIXME HACK"
+ - name: "grep FIXME HACK"
script:
- grep -r FIXME .
# search for HACK within source tree and ignore HACKKIT board
script:
- grep -r HACK . | grep -v HACKKIT
# some statistics about the code base
- - env:
- - JOB="sloccount"
+ - name: "sloccount"
script:
- sloccount .
# test/py
- - env:
+ - name: "test/py sandbox"
+ env:
- TEST_PY_BD="sandbox"
BUILDMAN="^sandbox$"
TOOLCHAIN="x86_64"
- - env:
+ - name: "test/py sandbox_spl"
+ env:
- TEST_PY_BD="sandbox_spl"
TEST_PY_TEST_SPEC="test_ofplatdata"
BUILDMAN="^sandbox$"
TOOLCHAIN="x86_64"
TEST_PY_TOOLS="yes"
- - env:
+ - name: "test/py sandbox_flattree"
+ env:
- TEST_PY_BD="sandbox_flattree"
BUILDMAN="^sandbox_flattree$"
TOOLCHAIN="x86_64"
- - env:
+ - name: "test/py vexpress_ca15_tc2"
+ env:
- TEST_PY_BD="vexpress_ca15_tc2"
TEST_PY_ID="--id qemu"
QEMU_TARGET="arm-softmmu"
BUILDMAN="^vexpress_ca15_tc2$"
- - env:
+ - name: "test/py vexpress_ca9x4"
+ env:
- TEST_PY_BD="vexpress_ca9x4"
TEST_PY_ID="--id qemu"
QEMU_TARGET="arm-softmmu"
BUILDMAN="^vexpress_ca9x4$"
- - env:
+ - name: "test/py integratorcp_cm926ejs"
+ env:
- TEST_PY_BD="integratorcp_cm926ejs"
TEST_PY_TEST_SPEC="not sleep"
TEST_PY_ID="--id qemu"
QEMU_TARGET="arm-softmmu"
BUILDMAN="^integratorcp_cm926ejs$"
- - env:
+ - name: "test/py qemu_arm"
+ env:
- TEST_PY_BD="qemu_arm"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="arm-softmmu"
BUILDMAN="^qemu_arm$"
- - env:
+ - name: "test/py qemu_arm64"
+ env:
- TEST_PY_BD="qemu_arm64"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="aarch64-softmmu"
BUILDMAN="^qemu_arm64$"
- - env:
+ - name: "test/py qemu_mips"
+ env:
- TEST_PY_BD="qemu_mips"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="mips-softmmu"
BUILDMAN="^qemu_mips$"
TOOLCHAIN="mips"
- - env:
+ - name: "test/py qemu_mipsel"
+ env:
- TEST_PY_BD="qemu_mipsel"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="mipsel-softmmu"
BUILDMAN="^qemu_mipsel$"
TOOLCHAIN="mips"
- - env:
+ - name: "test/py qemu_mips64"
+ env:
- TEST_PY_BD="qemu_mips64"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="mips64-softmmu"
BUILDMAN="^qemu_mips64$"
TOOLCHAIN="mips"
- - env:
+ - name: "test/py qemu_mips64el"
+ env:
- TEST_PY_BD="qemu_mips64el"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="mips64el-softmmu"
BUILDMAN="^qemu_mips64el$"
TOOLCHAIN="mips"
- - env:
+ - name: "test/py qemu-ppce500"
+ env:
- TEST_PY_BD="qemu-ppce500"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="ppc-softmmu"
BUILDMAN="^qemu-ppce500$"
TOOLCHAIN="powerpc"
- - env:
+ - name: "test/py qemu-x86"
+ env:
- TEST_PY_BD="qemu-x86"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="i386-softmmu"
BUILDMAN="^qemu-x86$"
TOOLCHAIN="x86_64"
BUILD_ROM="yes"
- - env:
+ - name: "test/py zynq_zc702"
+ env:
- TEST_PY_BD="zynq_zc702"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="arm-softmmu"
TEST_PY_ID="--id qemu"
BUILDMAN="^zynq_zc702$"
- - env:
+ - name: "test/py xtfpga"
+ env:
- TEST_PY_BD="xtfpga"
TEST_PY_TEST_SPEC="not sleep"
QEMU_TARGET="xtensa-softmmu"
diff --git a/Documentation/efi.rst b/Documentation/efi.rst
new file mode 100644
index 00000000000..51c1de24f84
--- /dev/null
+++ b/Documentation/efi.rst
@@ -0,0 +1,16 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+EFI subsystem
+=============
+
+Boot services
+-------------
+
+.. kernel-doc:: lib/efi_loader/efi_boottime.c
+ :internal:
+
+Runtime services
+----------------
+
+.. kernel-doc:: lib/efi_loader/efi_runtime.c
+ :internal:
diff --git a/Documentation/index.rst b/Documentation/index.rst
index a7b0ee4e87d..0353c10a4b0 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -1,117 +1,11 @@
-====================
-U-Boot Hacker Manual
-====================
+.. SPDX-License-Identifier: GPL-2.0+
-Linker-Generated Arrays
-=======================
+#######################
+U-Boot Developer Manual
+#######################
-A linker list is constructed by grouping together linker input
-sections, each containing one entry of the list. Each input section
-contains a constant initialized variable which holds the entry's
-content. Linker list input sections are constructed from the list
-and entry names, plus a prefix which allows grouping all lists
-together. Assuming _list and _entry are the list and entry names,
-then the corresponding input section name is
+.. toctree::
-::
-
- .u_boot_list_ + 2_ + @_list + _2_ + @_entry
-
-and the C variable name is
-
-::
-
- _u_boot_list + _2_ + @_list + _2_ + @_entry
-
-This ensures uniqueness for both input section and C variable name.
-
-Note that the names differ only in the first character, "." for the
-section and "_" for the variable, so that the linker cannot confuse
-section and symbol names. From now on, both names will be referred
-to as
-
-::
-
- %u_boot_list_ + 2_ + @_list + _2_ + @_entry
-
-Entry variables need never be referred to directly.
-
-The naming scheme for input sections allows grouping all linker lists
-into a single linker output section and grouping all entries for a
-single list.
-
-Note the two '_2_' constant components in the names: their presence
-allows putting a start and end symbols around a list, by mapping
-these symbols to sections names with components "1" (before) and
-"3" (after) instead of "2" (within).
-Start and end symbols for a list can generally be defined as
-
-::
-
- %u_boot_list_2_ + @_list + _1_...
- %u_boot_list_2_ + @_list + _3_...
-
-Start and end symbols for the whole of the linker lists area can be
-defined as
-
-::
-
- %u_boot_list_1_...
- %u_boot_list_3_...
-
-Here is an example of the sorted sections which result from a list
-"array" made up of three entries : "first", "second" and "third",
-iterated at least once.
-
-::
-
- .u_boot_list_2_array_1
- .u_boot_list_2_array_2_first
- .u_boot_list_2_array_2_second
- .u_boot_list_2_array_2_third
- .u_boot_list_2_array_3
-
-If lists must be divided into sublists (e.g. for iterating only on
-part of a list), one can simply give the list a name of the form
-'outer_2_inner', where 'outer' is the global list name and 'inner'
-is the sub-list name. Iterators for the whole list should use the
-global list name ("outer"); iterators for only a sub-list should use
-the full sub-list name ("outer_2_inner").
-
-Here is an example of the sections generated from a global list
-named "drivers", two sub-lists named "i2c" and "pci", and iterators
-defined for the whole list and each sub-list:
-
-::
-
- %u_boot_list_2_drivers_1
- %u_boot_list_2_drivers_2_i2c_1
- %u_boot_list_2_drivers_2_i2c_2_first
- %u_boot_list_2_drivers_2_i2c_2_first
- %u_boot_list_2_drivers_2_i2c_2_second
- %u_boot_list_2_drivers_2_i2c_2_third
- %u_boot_list_2_drivers_2_i2c_3
- %u_boot_list_2_drivers_2_pci_1
- %u_boot_list_2_drivers_2_pci_2_first
- %u_boot_list_2_drivers_2_pci_2_second
- %u_boot_list_2_drivers_2_pci_2_third
- %u_boot_list_2_drivers_2_pci_3
- %u_boot_list_2_drivers_3
-
-.. kernel-doc:: include/linker_lists.h
- :internal:
-
-Serial system
-=============
-
-.. kernel-doc:: drivers/serial/serial.c
- :internal:
-
-The U-Boot EFI subsystem
-========================
-
-Boot services
--------------
-
-.. kernel-doc:: lib/efi_loader/efi_boottime.c
- :internal:
+ efi
+ linker_lists
+ serial
diff --git a/Documentation/linker_lists.rst b/Documentation/linker_lists.rst
new file mode 100644
index 00000000000..72f514e0ac0
--- /dev/null
+++ b/Documentation/linker_lists.rst
@@ -0,0 +1,100 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Linker-Generated Arrays
+=======================
+
+A linker list is constructed by grouping together linker input
+sections, each containing one entry of the list. Each input section
+contains a constant initialized variable which holds the entry's
+content. Linker list input sections are constructed from the list
+and entry names, plus a prefix which allows grouping all lists
+together. Assuming _list and _entry are the list and entry names,
+then the corresponding input section name is
+
+::
+
+ .u_boot_list_ + 2_ + @_list + _2_ + @_entry
+
+and the C variable name is
+
+::
+
+ _u_boot_list + _2_ + @_list + _2_ + @_entry
+
+This ensures uniqueness for both input section and C variable name.
+
+Note that the names differ only in the first character, "." for the
+section and "_" for the variable, so that the linker cannot confuse
+section and symbol names. From now on, both names will be referred
+to as
+
+::
+
+ %u_boot_list_ + 2_ + @_list + _2_ + @_entry
+
+Entry variables need never be referred to directly.
+
+The naming scheme for input sections allows grouping all linker lists
+into a single linker output section and grouping all entries for a
+single list.
+
+Note the two '_2_' constant components in the names: their presence
+allows putting a start and end symbols around a list, by mapping
+these symbols to sections names with components "1" (before) and
+"3" (after) instead of "2" (within).
+Start and end symbols for a list can generally be defined as
+
+::
+
+ %u_boot_list_2_ + @_list + _1_...
+ %u_boot_list_2_ + @_list + _3_...
+
+Start and end symbols for the whole of the linker lists area can be
+defined as
+
+::
+
+ %u_boot_list_1_...
+ %u_boot_list_3_...
+
+Here is an example of the sorted sections which result from a list
+"array" made up of three entries : "first", "second" and "third",
+iterated at least once.
+
+::
+
+ .u_boot_list_2_array_1
+ .u_boot_list_2_array_2_first
+ .u_boot_list_2_array_2_second
+ .u_boot_list_2_array_2_third
+ .u_boot_list_2_array_3
+
+If lists must be divided into sublists (e.g. for iterating only on
+part of a list), one can simply give the list a name of the form
+'outer_2_inner', where 'outer' is the global list name and 'inner'
+is the sub-list name. Iterators for the whole list should use the
+global list name ("outer"); iterators for only a sub-list should use
+the full sub-list name ("outer_2_inner").
+
+Here is an example of the sections generated from a global list
+named "drivers", two sub-lists named "i2c" and "pci", and iterators
+defined for the whole list and each sub-list:
+
+::
+
+ %u_boot_list_2_drivers_1
+ %u_boot_list_2_drivers_2_i2c_1
+ %u_boot_list_2_drivers_2_i2c_2_first
+ %u_boot_list_2_drivers_2_i2c_2_first
+ %u_boot_list_2_drivers_2_i2c_2_second
+ %u_boot_list_2_drivers_2_i2c_2_third
+ %u_boot_list_2_drivers_2_i2c_3
+ %u_boot_list_2_drivers_2_pci_1
+ %u_boot_list_2_drivers_2_pci_2_first
+ %u_boot_list_2_drivers_2_pci_2_second
+ %u_boot_list_2_drivers_2_pci_2_third
+ %u_boot_list_2_drivers_2_pci_3
+ %u_boot_list_2_drivers_3
+
+.. kernel-doc:: include/linker_lists.h
+ :internal:
diff --git a/Documentation/serial.rst b/Documentation/serial.rst
new file mode 100644
index 00000000000..ed34e592a44
--- /dev/null
+++ b/Documentation/serial.rst
@@ -0,0 +1,7 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Serial system
+=============
+
+.. kernel-doc:: drivers/serial/serial.c
+ :internal:
diff --git a/MAINTAINERS b/MAINTAINERS
index 58b61ac0588..8a2f0a730c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -364,9 +364,9 @@ EFI PAYLOAD
M: Alexander Graf <agraf@suse.de>
S: Maintained
T: git git://github.com/agraf/u-boot.git
-F: doc/DocBook/efi.tmpl
F: doc/README.uefi
F: doc/README.iscsi
+F: Documentation/efi.rst
F: include/efi*
F: include/pe.h
F: include/asm-generic/pe.h
diff --git a/README b/README
index aee0f7371c4..a91af2a1894 100644
--- a/README
+++ b/README
@@ -3943,6 +3943,17 @@ If CONFIG_REGEX is defined, the variable_name above is evaluated as a
regular expression. This allows multiple variables to be connected to
the same callback without explicitly listing them all out.
+The signature of the callback functions is:
+
+ int callback(const char *name, const char *value, enum env_op op, int flags)
+
+* name - changed environment variable
+* value - new value of the environment variable
+* op - operation (create, overwrite, or delete)
+* flags - attributes of the environment variable change, see flags H_* in
+ include/search.h
+
+The return value is 0 if the variable change is accepted and 1 otherwise.
Command Line Parsing:
=====================
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
index 39a0ebce907..4898483e1d1 100644
--- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
@@ -13,6 +13,30 @@
mmc1 = &sdmmc2;
i2c3 = &i2c4;
};
+
+ led {
+ compatible = "gpio-leds";
+
+ red {
+ label = "stm32mp:red:status";
+ gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+ green {
+ label = "stm32mp:green:user";
+ gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+ orange {
+ label = "stm32mp:orange:status";
+ gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+ blue {
+ label = "stm32mp:blue:user";
+ gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
+ };
+ };
};
&uart4_pins_a {
diff --git a/arch/arm/include/asm/arch-rockchip/f_rockusb.h b/arch/arm/include/asm/arch-rockchip/f_rockusb.h
index 0b62771c211..9772321023b 100644
--- a/arch/arm/include/asm/arch-rockchip/f_rockusb.h
+++ b/arch/arm/include/asm/arch-rockchip/f_rockusb.h
@@ -27,6 +27,7 @@
*/
#define RKUSB_BUF_SIZE EP_BUFFER_SIZE * 2
+#define RKBLOCK_BUF_SIZE 4096
#define RKUSB_STATUS_IDLE 0
#define RKUSB_STATUS_CMD 1
@@ -62,6 +63,7 @@ K_FW_LOW_FORMAT = 0x1C,
K_FW_SET_RESET_FLAG = 0x1E,
K_FW_SPI_READ_10 = 0x21,
K_FW_SPI_WRITE_10 = 0x22,
+K_FW_LBA_ERASE_10 = 0x25,
K_FW_SESSION = 0X30,
K_FW_RESET = 0xff,
@@ -120,6 +122,8 @@ struct f_rockusb {
unsigned int lba;
unsigned int dl_size;
unsigned int dl_bytes;
+ unsigned int ul_size;
+ unsigned int ul_bytes;
struct blk_desc *desc;
int reboot_flag;
void *buf;
diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile
index 1d35fea9126..f375d07d03d 100644
--- a/arch/arm/mach-snapdragon/Makefile
+++ b/arch/arm/mach-snapdragon/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_TARGET_DRAGONBOARD410C) += sysmap-apq8016.o
obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-apq8016.o
obj-$(CONFIG_TARGET_DRAGONBOARD410C) += pinctrl-snapdragon.o
obj-y += clock-snapdragon.o
+obj-y += dram.o
diff --git a/arch/arm/mach-snapdragon/dram.c b/arch/arm/mach-snapdragon/dram.c
new file mode 100644
index 00000000000..79eb19992d0
--- /dev/null
+++ b/arch/arm/mach-snapdragon/dram.c
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Onboard memory detection for Snapdragon boards
+ *
+ * (C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
+ *
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <smem.h>
+#include <fdt_support.h>
+#include <asm/arch/dram.h>
+
+#define SMEM_USABLE_RAM_PARTITION_TABLE 402
+#define RAM_PART_NAME_LENGTH 16
+#define RAM_NUM_PART_ENTRIES 32
+#define CATEGORY_SDRAM 0x0E
+#define TYPE_SYSMEM 0x01
+
+struct smem_ram_ptable_hdr {
+ u32 magic[2];
+ u32 version;
+ u32 reserved;
+ u32 len;
+} __attribute__ ((__packed__));
+
+struct smem_ram_ptn {
+ char name[RAM_PART_NAME_LENGTH];
+ u64 start;
+ u64 size;
+ u32 attr;
+ u32 category;
+ u32 domain;
+ u32 type;
+ u32 num_partitions;
+ u32 reserved[3];
+} __attribute__ ((__packed__));
+
+struct smem_ram_ptable {
+ struct smem_ram_ptable_hdr hdr;
+ u32 reserved; /* Added for 8 bytes alignment of header */
+ struct smem_ram_ptn parts[RAM_NUM_PART_ENTRIES];
+} __attribute__ ((__packed__));
+
+#ifndef MEMORY_BANKS_MAX
+#define MEMORY_BANKS_MAX 4
+#endif
+
+int msm_fixup_memory(void *blob)
+{
+ u64 bank_start[MEMORY_BANKS_MAX];
+ u64 bank_size[MEMORY_BANKS_MAX];
+ size_t size;
+ int i;
+ int count = 0;
+ struct udevice *smem;
+ int ret;
+ struct smem_ram_ptable *ram_ptable;
+ struct smem_ram_ptn *p;
+
+ ret = uclass_get_device_by_name(UCLASS_SMEM, "smem", &smem);
+ if (ret < 0) {
+ printf("Failed to find SMEM node. Check device tree\n");
+ return 0;
+ }
+
+ ram_ptable = smem_get(smem, -1, SMEM_USABLE_RAM_PARTITION_TABLE, &size);
+
+ if (!ram_ptable) {
+ printf("Failed to find SMEM partition.\n");
+ return -ENODEV;
+ }
+
+ /* Check validy of RAM */
+ for (i = 0; i < RAM_NUM_PART_ENTRIES; i++) {
+ p = &ram_ptable->parts[i];
+ if (p->category == CATEGORY_SDRAM && p->type == TYPE_SYSMEM) {
+ bank_start[count] = p->start;
+ bank_size[count] = p->size;
+ debug("Detected memory bank %u: start: 0x%llx size: 0x%llx\n",
+ count, p->start, p->size);
+ count++;
+ }
+ }
+
+ if (!count) {
+ printf("Failed to detect any memory bank\n");
+ return -ENODEV;
+ }
+
+ ret = fdt_fixup_memory_banks(blob, bank_start, bank_size, count);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
diff --git a/arch/arm/mach-snapdragon/include/mach/dram.h b/arch/arm/mach-snapdragon/include/mach/dram.h
new file mode 100644
index 00000000000..0a9eedda414
--- /dev/null
+++ b/arch/arm/mach-snapdragon/include/mach/dram.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Snapdragon DRAM
+ * Copyright (C) 2018 Ramon Fried <ramon.fried@gmail.com>
+ */
+
+#ifndef DRAM_H
+#define DRAM_H
+
+int msm_fixup_memory(void *blob);
+
+#endif
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index e7ead57f0da..4f0b999e508 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -10,6 +10,7 @@
#include <usb.h>
#include <asm/gpio.h>
#include <fdt_support.h>
+#include <asm/arch/dram.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -180,6 +181,8 @@ int ft_board_setup(void *blob, bd_t *bd)
fix[i].property, mac, ARP_HLEN, 1);
}
+ msm_fixup_memory(blob);
+
return 0;
}
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 195f620834b..0e87674826a 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <cros_ec.h>
#include <dm.h>
+#include <led.h>
#include <os.h>
#include <asm/test.h>
#include <asm/u-boot-sandbox.h>
@@ -47,6 +48,14 @@ int dram_init(void)
return 0;
}
+int board_init(void)
+{
+ if (IS_ENABLED(CONFIG_LED))
+ led_default_state();
+
+ return 0;
+}
+
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
{
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index cc39fa6df9c..bfc8ab64d37 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -4,6 +4,7 @@
*/
#include <config.h>
#include <common.h>
+#include <led.h>
#include <asm/arch/stm32.h>
/*
@@ -22,5 +23,8 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
+ if (IS_ENABLED(CONFIG_LED))
+ led_default_state();
+
return 0;
}
diff --git a/cmd/elf.c b/cmd/elf.c
index eafea38aed1..22cba58c68c 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -57,6 +57,79 @@ static unsigned long load_elf64_image_phdr(unsigned long addr)
++phdr;
}
+ if (ehdr->e_machine == EM_PPC64 && (ehdr->e_flags &
+ EF_PPC64_ELFV1_ABI)) {
+ /*
+ * For the 64-bit PowerPC ELF V1 ABI, e_entry is a function
+ * descriptor pointer with the first double word being the
+ * address of the entry point of the function.
+ */
+ uintptr_t addr = ehdr->e_entry;
+
+ return *(Elf64_Addr *)addr;
+ }
+
+ return ehdr->e_entry;
+}
+
+static unsigned long load_elf64_image_shdr(unsigned long addr)
+{
+ Elf64_Ehdr *ehdr; /* Elf header structure pointer */
+ Elf64_Shdr *shdr; /* Section header structure pointer */
+ unsigned char *strtab = 0; /* String table pointer */
+ unsigned char *image; /* Binary image pointer */
+ int i; /* Loop counter */
+
+ ehdr = (Elf64_Ehdr *)addr;
+
+ /* Find the section header string table for output info */
+ shdr = (Elf64_Shdr *)(addr + (ulong)ehdr->e_shoff +
+ (ehdr->e_shstrndx * sizeof(Elf64_Shdr)));
+
+ if (shdr->sh_type == SHT_STRTAB)
+ strtab = (unsigned char *)(addr + (ulong)shdr->sh_offset);
+
+ /* Load each appropriate section */
+ for (i = 0; i < ehdr->e_shnum; ++i) {
+ shdr = (Elf64_Shdr *)(addr + (ulong)ehdr->e_shoff +
+ (i * sizeof(Elf64_Shdr)));
+
+ if (!(shdr->sh_flags & SHF_ALLOC) ||
+ shdr->sh_addr == 0 || shdr->sh_size == 0) {
+ continue;
+ }
+
+ if (strtab) {
+ debug("%sing %s @ 0x%08lx (%ld bytes)\n",
+ (shdr->sh_type == SHT_NOBITS) ? "Clear" : "Load",
+ &strtab[shdr->sh_name],
+ (unsigned long)shdr->sh_addr,
+ (long)shdr->sh_size);
+ }
+
+ if (shdr->sh_type == SHT_NOBITS) {
+ memset((void *)(uintptr_t)shdr->sh_addr, 0,
+ shdr->sh_size);
+ } else {
+ image = (unsigned char *)addr + (ulong)shdr->sh_offset;
+ memcpy((void *)(uintptr_t)shdr->sh_addr,
+ (const void *)image, shdr->sh_size);
+ }
+ flush_cache((ulong)shdr->sh_addr, shdr->sh_size);
+ }
+
+ if (ehdr->e_machine == EM_PPC64 && (ehdr->e_flags &
+ EF_PPC64_ELFV1_ABI)) {
+ /*
+ * For the 64-bit PowerPC ELF V1 ABI, e_entry is a function
+ * descriptor pointer with the first double word being the
+ * address of the entry point of the function.
+ */
+ uintptr_t addr = ehdr->e_entry;
+
+ return *(Elf64_Addr *)addr;
+ }
+
return ehdr->e_entry;
}
@@ -107,6 +180,8 @@ static unsigned long load_elf_image_shdr(unsigned long addr)
int i; /* Loop counter */
ehdr = (Elf32_Ehdr *)addr;
+ if (ehdr->e_ident[EI_CLASS] == ELFCLASS64)
+ return load_elf64_image_shdr(addr);
/* Find the section header string table for output info */
shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
diff --git a/cmd/sata.c b/cmd/sata.c
index cc12afb07e6..4f0c6e01371 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -107,8 +107,8 @@ static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* If the user has not yet run `sata init`, do it now */
if (sata_curr_device == -1) {
rc = sata_probe(0);
- if (rc < 0)
- return CMD_RET_FAILURE;
+ if (rc)
+ return rc;
sata_curr_device = 0;
}
diff --git a/common/board_r.c b/common/board_r.c
index 64f257409c9..9402c0ef219 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -690,7 +690,8 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_DM
initr_dm,
#endif
-#if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV)
+#if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
+ defined(CONFIG_SANDBOX)
board_init, /* Setup chipselects */
#endif
/*
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index df1b42f3c28..964e9b9a1d7 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_OMAP2PLUS=y
CONFIG_TI_COMMON_CMD_OPTIONS=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_TARGET_OMAP3_LOGIC=y
+# CONFIG_SPL_OMAP3_ID_NAND is not set
CONFIG_SPL=y
CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-37xx-devkit"
CONFIG_DISTRO_DEFAULTS=y
@@ -45,7 +46,7 @@ CONFIG_NETDEVICES=y
CONFIG_SMC911X=y
CONFIG_SMC911X_BASE=0x08000000
CONFIG_SMC911X_32_BIT=y
-CONFIG_CONS_INDEX=3
+CONFIG_CONS_INDEX=1
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index ad21bdbab4f..5b7fa5b3a2e 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -31,6 +31,8 @@ CONFIG_CMD_EXT4_WRITE=y
CONFIG_STM32_ADC=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_STM32F7=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
CONFIG_DM_MMC=y
CONFIG_STM32_SDMMC2=y
# CONFIG_PINCTRL_FULL is not set
diff --git a/disk/part.c b/disk/part.c
index 9266a09ec3f..9e457a6e72e 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -400,7 +400,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
*dev_desc = get_dev_hwpart(ifname, dev, hwpart);
if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
- printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
+ debug("** Bad device %s %s **\n", ifname, dev_hwpart_str);
dev = -ENOENT;
goto cleanup;
}
diff --git a/doc/README.iscsi b/doc/README.iscsi
index cb71c6e7446..faee6362642 100644
--- a/doc/README.iscsi
+++ b/doc/README.iscsi
@@ -1,6 +1,8 @@
-# iSCSI booting with U-Boot and iPXE
+iSCSI booting with U-Boot and iPXE
+==================================
-## Motivation
+Motivation
+----------
U-Boot has only a reduced set of supported network protocols. The focus for
network booting has been on UDP based protocols. A TCP stack and HTTP support
@@ -32,14 +34,15 @@ via HTTPS and to download any other files needed for booting via iSCSI from the
same target where the operating system is installed.
An alternative to implementing these protocols in U-Boot is to use an existing
-software that can run on top of U-Boot. iPXE is the "swiss army knife" of
+software that can run on top of U-Boot. iPXE[1] is the "swiss army knife" of
network booting. It supports both HTTPS and iSCSI. It has a scripting engine for
fine grained control of the boot process and can provide a command shell.
iPXE can be built as an EFI application (named snp.efi) which can be loaded and
run by U-Boot.
-## Boot sequence
+Boot sequence
+-------------
U-Boot loads the EFI application iPXE snp.efi using the bootefi command. This
application has network access via the simple network protocol offered by
@@ -56,67 +59,68 @@ For a selected iSCSI target iPXE sets up a handle with the block IO protocol. It
uses the ConnectController boot service of U-Boot to request U-Boot to connect a
file system driver. U-Boot reads from the iSCSI drive via the block IO protocol
offered by iPXE. It creates the partition handles and installs the simple file
-protocol. Now iPXE can call the simple file protocol to load Grub. U-Boot uses
-the block IO protocol offered by iPXE to fulfill the request.
-
-Once Grub is started it uses the same block IO protocol to load Linux. Via
-the EFI stub Linux is called as an EFI application.
-
-```
- +--------+ +--------+
- | | Runs | |
- | U-Boot |=========>| iPXE |
- | EFI | | snp.efi|
-+--------+ | | DHCP | |
-| |<====|********|<=========| |
-| DHCP | | | Get IP | |
-| Server | | | Address | |
-| |====>|********|=========>| |
-+--------+ | | Response | |
- | | | |
- | | | |
-+--------+ | | HTTPS | |
-| |<====|********|<=========| |
-| HTTPS | | | Load | |
-| Server | | | Script | |
-| |====>|********|=========>| |
-+--------+ | | | |
- | | | |
- | | | |
-+--------+ | | iSCSI | |
-| |<====|********|<=========| |
-| iSCSI | | | Auth | |
-| Server |====>|********|=========>| |
-| | | | | |
-| | | | Loads | |
-| |<====|********|<=========| | +--------+
-| | | | Grub | | Runs | |
-| |====>|********|=========>| |=======>| Grub |
-| | | | | | | |
-| | | | | | | |
-| | | | | | Loads | |
-| |<====|********|<=========|********|<=======| | +--------+
-| | | | | | Linux | | Runs | |
-| |====>|********|=========>|********|=======>| |=====>| Linux |
-| | | | | | | | | |
-+--------+ +--------+ +--------+ +--------+ | |
- | |
- | |
- | ~ ~ ~ ~|
-```
-
-## Security
+protocol. Now iPXE can call the simple file protocol to load GRUB[2]. U-Boot
+uses the block IO protocol offered by iPXE to fulfill the request.
+
+Once GRUB is started it uses the same block IO protocol to load Linux. Via
+the EFI stub Linux is called as an EFI application::
+
+ +--------+ +--------+
+ | | Runs | |
+ | U-Boot |========>| iPXE |
+ | EFI | | snp.efi|
+ +--------+ | | DHCP | |
+ | |<===|********|<========| |
+ | DHCP | | | Get IP | |
+ | Server | | | Address | |
+ | |===>|********|========>| |
+ +--------+ | | Response| |
+ | | | |
+ | | | |
+ +--------+ | | HTTPS | |
+ | |<===|********|<========| |
+ | HTTPS | | | Load | |
+ | Server | | | Script | |
+ | |===>|********|========>| |
+ +--------+ | | | |
+ | | | |
+ | | | |
+ +--------+ | | iSCSI | |
+ | |<===|********|<========| |
+ | iSCSI | | | Auth | |
+ | Server |===>|********|========>| |
+ | | | | | |
+ | | | | Loads | |
+ | |<===|********|<========| | +--------+
+ | | | | GRUB | | Runs | |
+ | |===>|********|========>| |======>| GRUB |
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | Loads | |
+ | |<===|********|<========|********|<======| | +--------+
+ | | | | | | Linux | | Runs | |
+ | |===>|********|========>|********|======>| |=====>| Linux |
+ | | | | | | | | | |
+ +--------+ +--------+ +--------+ +--------+ | |
+ | |
+ | |
+ | ~ ~ ~ ~|
+
+Security
+--------
The iSCSI protocol is not encrypted. The traffic could be secured using IPsec
but neither U-Boot nor iPXE does support this. So we should at least separate
the iSCSI traffic from all other network traffic. This can be achieved using a
virtual local area network (VLAN).
-## Configuration
+Configuration
+-------------
-### iPXE
+iPXE
+^^^^
-For running iPXE on arm64 the bin-arm64-efi/snp.efi build target is needed.
+For running iPXE on arm64 the bin-arm64-efi/snp.efi build target is needed::
git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
@@ -132,7 +136,7 @@ http://ipxe.org/cfg
iPXE by default will put the CPU to rest when waiting for input. U-Boot does
not wake it up due to missing interrupt support. To avoid this behavior create
-file src/config/local/nap.h.
+file src/config/local/nap.h::
/* nap.h */
#undef NAP_EFIX86
@@ -140,7 +144,7 @@ file src/config/local/nap.h.
#define NAP_NULL
The supported commands in iPXE are controlled by an include, too. Putting the
-following into src/config/local/general.h is sufficient for most use cases.
+following into src/config/local/general.h is sufficient for most use cases::
/* general.h */
#define NSLOOKUP_CMD /* Name resolution command */
@@ -153,7 +157,9 @@ following into src/config/local/general.h is sufficient for most use cases.
#define DOWNLOAD_PROTO_NFS /* Network File System Protocol */
#define DOWNLOAD_PROTO_FILE /* Local file system access */
-## Links
+Links
+-----
-* https://ipxe.org - iPXE open source boot firmware
-* https://www.gnu.org/software/grub/ - GNU Grub (Grand Unified Bootloader)
+* [1](https://ipxe.org) https://ipxe.org - iPXE open source boot firmware
+* [2](https://www.gnu.org/software/grub/) https://www.gnu.org/software/grub/ -
+ GNU GRUB (Grand Unified Bootloader)
diff --git a/doc/README.rockusb b/doc/README.rockusb
index 5405dc48c11..66437e17e46 100644
--- a/doc/README.rockusb
+++ b/doc/README.rockusb
@@ -42,9 +42,14 @@ see doc/README.rockchip for more detail about how to get U-Boot binary.
sudo rkdeveloptool wl 64 <U-Boot binary>
-There are plenty of Rockusb command. but wl(write lba) and
-rd(reboot) command. These two command can let people flash
-image to device.
+Current set of rkdeveloptool commands supported:
+- rci: Read Chip Info
+- rfi: Read Flash Id
+- rd : Reset Device
+- td : Test Device Ready
+- rl : Read blocks using LBA
+- wl : Write blocks using LBA
+- wlx: Write partition
To do
-----
diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt
index d2793a195dc..d701b9bb760 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -164,7 +164,9 @@ the '/images' node should have the following layout:
- data : Path to the external file which contains this node's binary data.
- compression : Compression used by included data. Supported compressions
are "gzip" and "bzip2". If no compression is used compression property
- should be set to "none".
+ should be set to "none". If the data is compressed but it should not be
+ uncompressed by U-Boot (e.g. compressed ramdisk), this should also be set
+ to "none".
Conditionally mandatory property:
- os : OS name, mandatory for types "kernel" and "ramdisk". Valid OS names
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index e7c91193b98..318949529b3 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -56,7 +56,7 @@ int dfu_init_env_entities(char *interface, char *devstr)
{
const char *str_env;
char *env_bkp;
- int ret;
+ int ret = 0;
#ifdef CONFIG_SET_DFU_ALT_INFO
set_dfu_alt_info(interface, devstr);
@@ -71,11 +71,13 @@ int dfu_init_env_entities(char *interface, char *devstr)
ret = dfu_config_entities(env_bkp, interface, devstr);
if (ret) {
pr_err("DFU entities configuration failed!\n");
- return ret;
+ pr_err("(partition table does not match dfu_alt_info?)\n");
+ goto done;
}
+done:
free(env_bkp);
- return 0;
+ return ret;
}
static unsigned char *dfu_buf;
@@ -462,7 +464,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
ret = dfu_fill_entity(&dfu[i], s, alt_num_cnt, interface,
devstr);
if (ret) {
- free(dfu);
+ /* We will free "dfu" in dfu_free_entities() */
return -1;
}
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c
index 2f4d69eeddd..2859475a6b8 100644
--- a/drivers/led/led-uclass.c
+++ b/drivers/led/led-uclass.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <errno.h>
#include <led.h>
+#include <dm/device-internal.h>
#include <dm/root.h>
#include <dm/uclass-internal.h>
@@ -63,6 +64,35 @@ int led_set_period(struct udevice *dev, int period_ms)
}
#endif
+int led_default_state(void)
+{
+ struct udevice *dev;
+ struct uclass *uc;
+ const char *default_state;
+ int ret;
+
+ ret = uclass_get(UCLASS_LED, &uc);
+ if (ret)
+ return ret;
+ for (uclass_find_first_device(UCLASS_LED, &dev);
+ dev;
+ uclass_find_next_device(&dev)) {
+ default_state = dev_read_string(dev, "default-state");
+ if (!default_state)
+ continue;
+ ret = device_probe(dev);
+ if (ret)
+ return ret;
+ if (!strncmp(default_state, "on", 2))
+ led_set_state(dev, LEDST_ON);
+ else if (!strncmp(default_state, "off", 3))
+ led_set_state(dev, LEDST_OFF);
+ /* default-state = "keep" : device is only probed */
+ }
+
+ return ret;
+}
+
UCLASS_DRIVER(led) = {
.id = UCLASS_LED,
.name = "led",
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index a36942b9348..93f6b913c64 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -10,7 +10,6 @@
#include <led.h>
#include <asm/gpio.h>
#include <dm/lists.h>
-#include <dm/uclass-internal.h>
struct led_gpio_priv {
struct gpio_desc gpio;
@@ -58,7 +57,6 @@ static int led_gpio_probe(struct udevice *dev)
{
struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
struct led_gpio_priv *priv = dev_get_priv(dev);
- const char *default_state;
int ret;
/* Ignore the top-level LED node */
@@ -69,13 +67,6 @@ static int led_gpio_probe(struct udevice *dev)
if (ret)
return ret;
- default_state = dev_read_string(dev, "default-state");
- if (default_state) {
- if (!strncmp(default_state, "on", 2))
- gpio_led_set_state(dev, LEDST_ON);
- else if (!strncmp(default_state, "off", 3))
- gpio_led_set_state(dev, LEDST_OFF);
- }
return 0;
}
@@ -118,14 +109,6 @@ static int led_gpio_bind(struct udevice *parent)
return ret;
uc_plat = dev_get_uclass_platdata(dev);
uc_plat->label = label;
-
- if (ofnode_read_bool(node, "default-state")) {
- struct udevice *devp;
-
- ret = uclass_get_device_tail(dev, 0, &devp);
- if (ret)
- return ret;
- }
}
return 0;
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index c489deac2bb..c499601f000 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -36,7 +36,15 @@ static void serial_null(void)
/**
* on_baudrate() - Update the actual baudrate when the env var changes
*
+ * @name: changed environment variable
+ * @value: new value of the environment variable
+ * @op: operation (create, overwrite, or delete)
+ * @flags: attributes of environment variable change,
+ * see flags H_* in include/search.h
+ *
* This will check for a valid baudrate and only apply it if valid.
+ *
+ * Return: 0 on success, 1 on error
*/
static int on_baudrate(const char *name, const char *value, enum env_op op,
int flags)
diff --git a/drivers/usb/gadget/f_rockusb.c b/drivers/usb/gadget/f_rockusb.c
index b8833d0b543..e81eb164b0d 100644
--- a/drivers/usb/gadget/f_rockusb.c
+++ b/drivers/usb/gadget/f_rockusb.c
@@ -328,6 +328,7 @@ static int rockusb_tx_write(const char *buffer, unsigned int buffer_size)
memcpy(in_req->buf, buffer, buffer_size);
in_req->length = buffer_size;
+ debug("Transferring 0x%x bytes\n", buffer_size);
usb_ep_dequeue(rockusb_func->in_ep, in_req);
ret = usb_ep_queue(rockusb_func->in_ep, in_req, 0);
if (ret)
@@ -383,11 +384,25 @@ static int rockusb_tx_write_csw(u32 tag, int residue, u8 status, int size)
csw->residue = cpu_to_be32(residue);
csw->status = status;
#ifdef DEBUG
- printcsw((char *)&csw);
+ printcsw((char *)csw);
#endif
return rockusb_tx_write((char *)csw, size);
}
+static void tx_handler_send_csw(struct usb_ep *ep, struct usb_request *req)
+{
+ struct f_rockusb *f_rkusb = get_rkusb();
+ int status = req->status;
+
+ if (status)
+ debug("status: %d ep '%s' trans: %d\n",
+ status, ep->name, req->actual);
+
+ /* Return back to default in_req complete function after sending CSW */
+ req->complete = rockusb_complete;
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_GOOD, USB_BULK_CS_WRAP_LEN);
+}
+
static unsigned int rx_bytes_expected(struct usb_ep *ep)
{
struct f_rockusb *f_rkusb = get_rkusb();
@@ -407,6 +422,65 @@ static unsigned int rx_bytes_expected(struct usb_ep *ep)
return rx_remain;
}
+/* usb_request complete call back to handle upload image */
+static void tx_handler_ul_image(struct usb_ep *ep, struct usb_request *req)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(char, rbuffer, RKBLOCK_BUF_SIZE);
+ struct f_rockusb *f_rkusb = get_rkusb();
+ struct usb_request *in_req = rockusb_func->in_req;
+ int ret;
+
+ /* Print error status of previous transfer */
+ if (req->status)
+ debug("status: %d ep '%s' trans: %d len %d\n", req->status,
+ ep->name, req->actual, req->length);
+
+ /* On transfer complete reset in_req and feedback host with CSW_GOOD */
+ if (f_rkusb->ul_bytes >= f_rkusb->ul_size) {
+ in_req->length = 0;
+ in_req->complete = rockusb_complete;
+
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_GOOD,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+
+ /* Proceed with current chunk */
+ unsigned int transfer_size = f_rkusb->ul_size - f_rkusb->ul_bytes;
+
+ if (transfer_size > RKBLOCK_BUF_SIZE)
+ transfer_size = RKBLOCK_BUF_SIZE;
+ /* Read at least one block */
+ unsigned int blkcount = (transfer_size + f_rkusb->desc->blksz - 1) /
+ f_rkusb->desc->blksz;
+
+ debug("ul %x bytes, %x blks, read lba %x, ul_size:%x, ul_bytes:%x, ",
+ transfer_size, blkcount, f_rkusb->lba,
+ f_rkusb->ul_size, f_rkusb->ul_bytes);
+
+ int blks = blk_dread(f_rkusb->desc, f_rkusb->lba, blkcount, rbuffer);
+
+ if (blks != blkcount) {
+ printf("failed reading from device %s: %d\n",
+ f_rkusb->dev_type, f_rkusb->dev_index);
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_FAIL,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+ f_rkusb->lba += blkcount;
+ f_rkusb->ul_bytes += transfer_size;
+
+ /* Proceed with USB request */
+ memcpy(in_req->buf, rbuffer, transfer_size);
+ in_req->length = transfer_size;
+ in_req->complete = tx_handler_ul_image;
+ debug("Uploading 0x%x bytes\n", transfer_size);
+ usb_ep_dequeue(rockusb_func->in_ep, in_req);
+ ret = usb_ep_queue(rockusb_func->in_ep, in_req, 0);
+ if (ret)
+ printf("Error %d on queue\n", ret);
+}
+
/* usb_request complete call back to handle down load image */
static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
{
@@ -416,19 +490,6 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
unsigned int buffer_size = req->actual;
transfer_size = f_rkusb->dl_size - f_rkusb->dl_bytes;
- if (!f_rkusb->desc) {
- char *type = f_rkusb->dev_type;
- int index = f_rkusb->dev_index;
-
- f_rkusb->desc = blk_get_dev(type, index);
- if (!f_rkusb->desc ||
- f_rkusb->desc->type == DEV_TYPE_UNKNOWN) {
- puts("invalid mmc device\n");
- rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_FAIL,
- USB_BULK_CS_WRAP_LEN);
- return;
- }
- }
if (req->status != 0) {
printf("Bad status: %d\n", req->status);
@@ -442,7 +503,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
memcpy((void *)f_rkusb->buf, buffer, transfer_size);
f_rkusb->dl_bytes += transfer_size;
- int blks = 0, blkcnt = transfer_size / 512;
+ int blks = 0, blkcnt = transfer_size / f_rkusb->desc->blksz;
debug("dl %x bytes, %x blks, write lba %x, dl_size:%x, dl_bytes:%x, ",
transfer_size, blkcnt, f_rkusb->lba, f_rkusb->dl_size,
@@ -462,7 +523,7 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
req->complete = rx_handler_command;
req->length = EP_BUFFER_SIZE;
f_rkusb->buf = f_rkusb->buf_head;
- printf("transfer 0x%x bytes done\n", f_rkusb->dl_size);
+ debug("transfer 0x%x bytes done\n", f_rkusb->dl_size);
f_rkusb->dl_size = 0;
rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_GOOD,
USB_BULK_CS_WRAP_LEN);
@@ -473,8 +534,8 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
else
f_rkusb->buf = f_rkusb->buf_head;
- debug("remain %x bytes, %x sectors\n", req->length,
- req->length / 512);
+ debug("remain %x bytes, %lx sectors\n", req->length,
+ req->length / f_rkusb->desc->blksz);
}
req->actual = 0;
@@ -496,13 +557,101 @@ static void cb_read_storage_id(struct usb_ep *ep, struct usb_request *req)
{
ALLOC_CACHE_ALIGN_BUFFER(struct fsg_bulk_cb_wrap, cbw,
sizeof(struct fsg_bulk_cb_wrap));
+ struct f_rockusb *f_rkusb = get_rkusb();
char emmc_id[] = "EMMC ";
printf("read storage id\n");
memcpy((char *)cbw, req->buf, USB_BULK_CB_WRAP_LEN);
+
+ /* Prepare for sending subsequent CSW_GOOD */
+ f_rkusb->tag = cbw->tag;
+ f_rkusb->in_req->complete = tx_handler_send_csw;
+
rockusb_tx_write_str(emmc_id);
- rockusb_tx_write_csw(cbw->tag, cbw->data_transfer_length, CSW_GOOD,
- USB_BULK_CS_WRAP_LEN);
+}
+
+int __weak rk_get_bootrom_chip_version(unsigned int *chip_info, int size)
+{
+ return 0;
+}
+
+static void cb_get_chip_version(struct usb_ep *ep, struct usb_request *req)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(struct fsg_bulk_cb_wrap, cbw,
+ sizeof(struct fsg_bulk_cb_wrap));
+ struct f_rockusb *f_rkusb = get_rkusb();
+ unsigned int chip_info[4], i;
+
+ memset(chip_info, 0, sizeof(chip_info));
+ rk_get_bootrom_chip_version(chip_info, 4);
+
+ /*
+ * Chip Version is a string saved in BOOTROM address space Little Endian
+ *
+ * Ex for rk3288: 0x33323041 0x32303134 0x30383133 0x56323030
+ * which brings: 320A20140813V200
+ *
+ * Note that memory version do invert MSB/LSB so printing the char
+ * buffer will show: A02341023180002V
+ */
+ printf("read chip version: ");
+ for (i = 0; i < 4; i++) {
+ printf("%c%c%c%c",
+ (chip_info[i] >> 24) & 0xFF,
+ (chip_info[i] >> 16) & 0xFF,
+ (chip_info[i] >> 8) & 0xFF,
+ (chip_info[i] >> 0) & 0xFF);
+ }
+ printf("\n");
+ memcpy((char *)cbw, req->buf, USB_BULK_CB_WRAP_LEN);
+
+ /* Prepare for sending subsequent CSW_GOOD */
+ f_rkusb->tag = cbw->tag;
+ f_rkusb->in_req->complete = tx_handler_send_csw;
+
+ rockusb_tx_write((char *)chip_info, sizeof(chip_info));
+}
+
+static void cb_read_lba(struct usb_ep *ep, struct usb_request *req)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(struct fsg_bulk_cb_wrap, cbw,
+ sizeof(struct fsg_bulk_cb_wrap));
+ struct f_rockusb *f_rkusb = get_rkusb();
+ int sector_count;
+
+ memcpy((char *)cbw, req->buf, USB_BULK_CB_WRAP_LEN);
+ sector_count = (int)get_unaligned_be16(&cbw->CDB[7]);
+ f_rkusb->tag = cbw->tag;
+
+ if (!f_rkusb->desc) {
+ char *type = f_rkusb->dev_type;
+ int index = f_rkusb->dev_index;
+
+ f_rkusb->desc = blk_get_dev(type, index);
+ if (!f_rkusb->desc ||
+ f_rkusb->desc->type == DEV_TYPE_UNKNOWN) {
+ printf("invalid device \"%s\", %d\n", type, index);
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_FAIL,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+ }
+
+ f_rkusb->lba = get_unaligned_be32(&cbw->CDB[2]);
+ f_rkusb->ul_size = sector_count * f_rkusb->desc->blksz;
+ f_rkusb->ul_bytes = 0;
+
+ debug("require read %x bytes, %x sectors from lba %x\n",
+ f_rkusb->ul_size, sector_count, f_rkusb->lba);
+
+ if (f_rkusb->ul_size == 0) {
+ rockusb_tx_write_csw(cbw->tag, cbw->data_transfer_length,
+ CSW_FAIL, USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+
+ /* Start right now sending first chunk */
+ tx_handler_ul_image(ep, req);
}
static void cb_write_lba(struct usb_ep *ep, struct usb_request *req)
@@ -514,10 +663,26 @@ static void cb_write_lba(struct usb_ep *ep, struct usb_request *req)
memcpy((char *)cbw, req->buf, USB_BULK_CB_WRAP_LEN);
sector_count = (int)get_unaligned_be16(&cbw->CDB[7]);
+ f_rkusb->tag = cbw->tag;
+
+ if (!f_rkusb->desc) {
+ char *type = f_rkusb->dev_type;
+ int index = f_rkusb->dev_index;
+
+ f_rkusb->desc = blk_get_dev(type, index);
+ if (!f_rkusb->desc ||
+ f_rkusb->desc->type == DEV_TYPE_UNKNOWN) {
+ printf("invalid device \"%s\", %d\n", type, index);
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_FAIL,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+ }
+
f_rkusb->lba = get_unaligned_be32(&cbw->CDB[2]);
- f_rkusb->dl_size = sector_count * 512;
+ f_rkusb->dl_size = sector_count * f_rkusb->desc->blksz;
f_rkusb->dl_bytes = 0;
- f_rkusb->tag = cbw->tag;
+
debug("require write %x bytes, %x sectors to lba %x\n",
f_rkusb->dl_size, sector_count, f_rkusb->lba);
@@ -530,6 +695,50 @@ static void cb_write_lba(struct usb_ep *ep, struct usb_request *req)
}
}
+static void cb_erase_lba(struct usb_ep *ep, struct usb_request *req)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(struct fsg_bulk_cb_wrap, cbw,
+ sizeof(struct fsg_bulk_cb_wrap));
+ struct f_rockusb *f_rkusb = get_rkusb();
+ int sector_count, lba, blks;
+
+ memcpy((char *)cbw, req->buf, USB_BULK_CB_WRAP_LEN);
+ sector_count = (int)get_unaligned_be16(&cbw->CDB[7]);
+ f_rkusb->tag = cbw->tag;
+
+ if (!f_rkusb->desc) {
+ char *type = f_rkusb->dev_type;
+ int index = f_rkusb->dev_index;
+
+ f_rkusb->desc = blk_get_dev(type, index);
+ if (!f_rkusb->desc ||
+ f_rkusb->desc->type == DEV_TYPE_UNKNOWN) {
+ printf("invalid device \"%s\", %d\n", type, index);
+ rockusb_tx_write_csw(f_rkusb->tag, 0, CSW_FAIL,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+ }
+
+ lba = get_unaligned_be32(&cbw->CDB[2]);
+
+ debug("require erase %x sectors from lba %x\n",
+ sector_count, lba);
+
+ blks = blk_derase(f_rkusb->desc, lba, sector_count);
+ if (blks != sector_count) {
+ printf("failed erasing device %s: %d\n", f_rkusb->dev_type,
+ f_rkusb->dev_index);
+ rockusb_tx_write_csw(f_rkusb->tag,
+ cbw->data_transfer_length, CSW_FAIL,
+ USB_BULK_CS_WRAP_LEN);
+ return;
+ }
+
+ rockusb_tx_write_csw(cbw->tag, cbw->data_transfer_length, CSW_GOOD,
+ USB_BULK_CS_WRAP_LEN);
+}
+
void __weak rkusb_set_reboot_flag(int flag)
{
struct f_rockusb *f_rkusb = get_rkusb();
@@ -615,7 +824,7 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = {
},
{
.cmd = K_FW_LBA_READ_10,
- .cb = cb_not_support,
+ .cb = cb_read_lba,
},
{
.cmd = K_FW_LBA_WRITE_10,
@@ -643,7 +852,7 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = {
},
{
.cmd = K_FW_GET_CHIP_VER,
- .cb = cb_not_support,
+ .cb = cb_get_chip_version,
},
{
.cmd = K_FW_LOW_FORMAT,
@@ -662,6 +871,10 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = {
.cb = cb_not_support,
},
{
+ .cmd = K_FW_LBA_ERASE_10,
+ .cb = cb_erase_lba,
+ },
+ {
.cmd = K_FW_SESSION,
.cb = cb_not_support,
},
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index 1aa6be44bb4..8b3b19feaf3 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -877,14 +877,14 @@ static void thor_func_disable(struct usb_function *f)
/* Avoid freeing memory when ep is still claimed */
if (dev->in_ep->driver_data) {
- free_ep_req(dev->in_ep, dev->in_req);
usb_ep_disable(dev->in_ep);
+ free_ep_req(dev->in_ep, dev->in_req);
dev->in_ep->driver_data = NULL;
}
if (dev->out_ep->driver_data) {
- usb_ep_free_request(dev->out_ep, dev->out_req);
usb_ep_disable(dev->out_ep);
+ usb_ep_free_request(dev->out_ep, dev->out_req);
dev->out_ep->driver_data = NULL;
}
diff --git a/env/env.c b/env/env.c
index e033b461244..afed0f3c95c 100644
--- a/env/env.c
+++ b/env/env.c
@@ -186,14 +186,18 @@ int env_load(void)
continue;
printf("Loading Environment from %s... ", drv->name);
+ /*
+ * In error case, the error message must be printed during
+ * drv->load() in some underlying API, and it must be exactly
+ * one message.
+ */
ret = drv->load();
- if (ret)
- printf("Failed (%d)\n", ret);
- else
+ if (ret) {
+ debug("Failed (%d)\n", ret);
+ } else {
printf("OK\n");
-
- if (!ret)
return 0;
+ }
}
/*
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index ffe40a41606..b9a3a5079d1 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -99,8 +99,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access */
/* nand at CS0 */
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 9a207962147..c767961562c 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -66,8 +66,6 @@
/* Board NAND Info. */
#ifdef CONFIG_NAND
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_COUNT 64
#define CONFIG_SYS_NAND_PAGE_SIZE 2048
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 415924549bd..adadfb29bfa 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -89,8 +89,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access nand at */
/* CS0 */
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
index 2c889d4a858..0ea70cc1bf1 100644
--- a/include/configs/cm_t3517.h
+++ b/include/configs/cm_t3517.h
@@ -91,8 +91,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access nand at */
/* CS0 */
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index f36dc2dc2c8..1b4e33255d9 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -60,9 +60,6 @@
#define CONFIG_TWL4030_LED 1
/* Board NAND Info */
-
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_JFFS2_NAND
/* nand device jffs2 lives on */
#define CONFIG_JFFS2_DEV "nand0"
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index 0cad187a3cd..66dec07b2a9 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -81,8 +81,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access */
/* nand at CS0 */
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index 3b65a8505f0..d39546f15ca 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -37,8 +37,6 @@
/* Board NAND Info. */
#ifdef CONFIG_NAND
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
/* NAND devices */
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index a3d0e5fcaa6..bcad26b2f12 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -51,8 +51,6 @@
#endif /* CONFIG_NAND */
/* Board NAND Info. */
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
/* Environment information */
#define CONFIG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 92592827295..8edd16d3954 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -44,8 +44,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_SW
#define CONFIG_SYS_NAND_PAGE_SIZE 2048
#define CONFIG_SYS_NAND_OOBSIZE 64
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index c62b373de30..ca03fc167d6 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -56,8 +56,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access nand at */
/* CS0 */
diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h
index 4b596c680aa..02bf54ea6fc 100644
--- a/include/configs/tao3530.h
+++ b/include/configs/tao3530.h
@@ -70,8 +70,6 @@
/*
* Board NAND Info.
*/
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access nand at */
/* CS0 */
diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index 95c3ea9ce44..6b4edcc8c4a 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -65,9 +65,6 @@
#define CONFIG_TWL4030_LED
/* Board NAND Info */
-
-#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
- /* to access nand */
#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
/* to access nand at */
/* CS0 */
diff --git a/include/elf.h b/include/elf.h
index 6802428ac42..81f40191d73 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -593,6 +593,9 @@ unsigned long elf_hash(const unsigned char *name);
/* Values for Elf32/64_Ehdr.e_flags */
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
+#define EF_PPC64_ELFV1_ABI 0x00000001
+#define EF_PPC64_ELFV2_ABI 0x00000002
+
/* Cygnus local bits below */
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
diff --git a/include/led.h b/include/led.h
index 940b97f58c0..7bfdddfd6fa 100644
--- a/include/led.h
+++ b/include/led.h
@@ -106,4 +106,13 @@ enum led_state_t led_get_state(struct udevice *dev);
*/
int led_set_period(struct udevice *dev, int period_ms);
+/**
+ * led_default_state() - set the default state for all the LED
+ *
+ * This enables all leds which have default state.
+ * see Documentation/devicetree/bindings/leds/common.txt
+ *
+ */
+int led_default_state(void);
+
#endif
diff --git a/lib/smbios.c b/lib/smbios.c
index df3d26b0710..326eb00230d 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -116,7 +116,7 @@ static int smbios_write_type1(ulong *current, int handle)
t->manufacturer = smbios_add_string(t->eos, CONFIG_SMBIOS_MANUFACTURER);
t->product_name = smbios_add_string(t->eos, CONFIG_SMBIOS_PRODUCT_NAME);
if (serial_str) {
- strncpy((char*)t->uuid, serial_str, sizeof(t->uuid));
+ strncpy((char *)t->uuid, serial_str, sizeof(t->uuid));
t->serial_number = smbios_add_string(t->eos, serial_str);
}
@@ -278,6 +278,7 @@ ulong write_smbios_table(ulong addr)
/* populate minimum required tables */
for (i = 0; i < ARRAY_SIZE(smbios_write_funcs); i++) {
int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++);
+
max_struct_size = max(max_struct_size, tmp);
len += tmp;
}
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 0ec125160dd..bd264d2ba2b 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3567,7 +3567,6 @@ CONFIG_SYS_NAND_ACTL_ALE
CONFIG_SYS_NAND_ACTL_CLE
CONFIG_SYS_NAND_ACTL_DELAY
CONFIG_SYS_NAND_ACTL_NCE
-CONFIG_SYS_NAND_ADDR
CONFIG_SYS_NAND_ALE
CONFIG_SYS_NAND_AMASK
CONFIG_SYS_NAND_BAD_BLOCK_POS
diff --git a/test/dm/led.c b/test/dm/led.c
index 0071f216bb7..00de7b3997c 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -32,6 +32,9 @@ static int dm_test_led_default_state(struct unit_test_state *uts)
{
struct udevice *dev;
+ /* configure the default state (auto-probe) */
+ led_default_state();
+
/* Check that we handle the default-state property correctly. */
ut_assertok(led_get_by_label("sandbox:default_on", &dev));
ut_asserteq(LEDST_ON, led_get_state(dev));