Merge branch 'master' of git://git.denx.de/u-boot-video
authorTom Rini <trini@konsulko.com>
Sat, 11 Aug 2018 23:48:13 +0000 (19:48 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 11 Aug 2018 23:48:13 +0000 (19:48 -0400)
48 files changed:
.travis.yml
Documentation/efi.rst [new file with mode: 0644]
Documentation/index.rst
Documentation/linker_lists.rst [new file with mode: 0644]
Documentation/serial.rst [new file with mode: 0644]
MAINTAINERS
README
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
arch/arm/include/asm/arch-rockchip/f_rockusb.h
arch/arm/mach-snapdragon/Makefile
arch/arm/mach-snapdragon/dram.c [new file with mode: 0644]
arch/arm/mach-snapdragon/include/mach/dram.h [new file with mode: 0644]
board/qualcomm/dragonboard410c/dragonboard410c.c
board/sandbox/sandbox.c
board/st/stm32mp1/stm32mp1.c
cmd/elf.c
cmd/sata.c
common/board_r.c
configs/omap3_logic_defconfig
configs/stm32mp15_basic_defconfig
disk/part.c
doc/README.iscsi
doc/README.rockusb
doc/uImage.FIT/source_file_format.txt
drivers/dfu/dfu.c
drivers/led/led-uclass.c
drivers/led/led_gpio.c
drivers/serial/serial.c
drivers/usb/gadget/f_rockusb.c
drivers/usb/gadget/f_thor.c
env/env.c
include/configs/am3517_crane.h
include/configs/am3517_evm.h
include/configs/cm_t35.h
include/configs/cm_t3517.h
include/configs/devkit8000.h
include/configs/mcx.h
include/configs/omap3_logic.h
include/configs/omap3_overo.h
include/configs/omap3_pandora.h
include/configs/omap3_zoom1.h
include/configs/tao3530.h
include/configs/tricorder.h
include/elf.h
include/led.h
lib/smbios.c
scripts/config_whitelist.txt
test/dm/led.c

index d5862066570d6ea068d6b7e848c925981a823c5b..4db629d15bd2da0036095f74634e25a661a49d77 100644 (file)
@@ -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 (file)
index 0000000..51c1de2
--- /dev/null
@@ -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:
index a7b0ee4e87d35be53c5e4edcd30b61c2b0457a02..0353c10a4b09afb6a8575673f9eab3849e6028af 100644 (file)
-====================
-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 (file)
index 0000000..72f514e
--- /dev/null
@@ -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 (file)
index 0000000..ed34e59
--- /dev/null
@@ -0,0 +1,7 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Serial system
+=============
+
+.. kernel-doc:: drivers/serial/serial.c
+   :internal:
index 58b61ac05882fb7eaf65be1fed5594d296d9d182..8a2f0a730c94363d6919c1bd5bf9a049cc88d175 100644 (file)
@@ -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 aee0f7371c423c8a48eb0546526be885bd410ac9..a91af2a1894ed9ed355e62c10996c8296ccceb49 100644 (file)
--- 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:
 =====================
index 39a0ebce9073fd794c5d8242ded88a37495e8f9f..4898483e1d16d35afd996a8fb85bccc6d7336749 100644 (file)
                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 {
index 0b62771c211a5928423744dfed50650ada23756d..9772321023b3c757736cee439c562897e4b9f5de 100644 (file)
@@ -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;
index 1d35fea9126e461ec305bc95c12d0e648701eb32..f375d07d03d1cc0012802ae8f51a66439f62642b 100644 (file)
@@ -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 (file)
index 0000000..79eb199
--- /dev/null
@@ -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 (file)
index 0000000..0a9eedd
--- /dev/null
@@ -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
index e7ead57f0dac313caab6ace495cee64be4f379bd..4f0b999e508fe3dcdc53805e4078a28c46252405 100644 (file)
@@ -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;
 }
 
index 195f620834bf81fbd694a1c2efdfa2340eb865b7..0e87674826a44379e83277c576bd40e9ce13819f 100644 (file)
@@ -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)
 {
index cc39fa6df9c37fa29aea9b9e0a57d5e47c94aa35..bfc8ab64d3771e6ffa42c4ece97a76e2d5276699 100644 (file)
@@ -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;
 }
index eafea38aed18938621ecafa4a5d3da0a13322046..22cba58c68c07426988f5557bc8e21569d7d7858 100644 (file)
--- 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 +
index cc12afb07e697728dce15460fd3189d3d44d5ddf..4f0c6e0137162e1990b115436be2e016a667edbd 100644 (file)
@@ -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;
        }
 
index 64f257409c93e61baf1d2e84e7534adc08c07ce7..9402c0ef2194f26a8cd37ca1dc43fd9191e09986 100644 (file)
@@ -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
        /*
index df1b42f3c2870ce50225642542f2cfaf2c219054..964e9b9a1d71309e0dd888b285d1dce784fa4dcc 100644 (file)
@@ -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
index ad21bdbab4f2ae0eb9e0d760a1c56eb9e9372968..5b7fa5b3a2e55660937fa9fd4e78d63a1bf36f71 100644 (file)
@@ -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
index 9266a09ec3f38d20855471680a70b8321ae9cdf7..9e457a6e72ef0c5af095a7f4e1a1b8b2ba0adedf 100644 (file)
@@ -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;
        }
index cb71c6e7446ce950fc2779e1f77a82745166de82..faee63626424e8842822f3dd6b1e2f23e0129ae9 100644 (file)
@@ -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)
index 5405dc48c114aadac6bdbf5e1dcae9ce08df77f2..66437e17e46bbd61f721c82a5fdfc62e15ece377 100644 (file)
@@ -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
 -----
index d2793a195dcfc904f176ce2fe38287a5f22191b2..d701b9bb760999af228658fd9d0b9a2fdc4fbe33 100644 (file)
@@ -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
index e7c91193b9899a3e39302557ab6ab0199cd162cf..318949529b302db73867f4bd311aa6203539fe7b 100644 (file)
@@ -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;
                }
 
index 2f4d69eedddc07fc9ff0c6a277a6558352b3c9db..2859475a6b8e99a93377d1182543a181aa94a455 100644 (file)
@@ -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",
index a36942b9348bdad938f8478cd91be17931dab499..93f6b913c6477de33a82387f8c24c95bd2faa53f 100644 (file)
@@ -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;
index c489deac2bba8c9a7c4ba627630df61d45bea0f5..c499601f000fef359f3176cd2dba5d87237c051a 100644 (file)
@@ -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)
index b8833d0b543b91d57f1be58caa921b6eefdafc5e..e81eb164b0d0a8afd1d031563769b644f8bdf326 100644 (file)
@@ -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,
@@ -661,6 +870,10 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = {
                .cmd = K_FW_SPI_WRITE_10,
                .cb = cb_not_support,
        },
+       {
+               .cmd = K_FW_LBA_ERASE_10,
+               .cb = cb_erase_lba,
+       },
        {
                .cmd = K_FW_SESSION,
                .cb = cb_not_support,
index 1aa6be44bb4d0894604dca8ad1f90e83bd0c225c..8b3b19feaf3d45dc074125ed1786a0f6a6a31051 100644 (file)
@@ -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;
        }
 
index e033b461244808b81df25aa0e02785e5f3c30463..afed0f3c95c3c173edc30c2e7cb04ab351955504 100644 (file)
--- 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;
+               }
        }
 
        /*
index ffe40a416065f21194f0b2d2b1503a50dbe902d6..b9a3a5079d1f5ca4aa904840b00ba5cfd9b21df8 100644 (file)
@@ -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 */
index 9a2079621472fab5ff48a35a2e9ebf6bc9bd290b..c767961562c0a16d3d555b5260b7d2cf6c1a6d06 100644 (file)
@@ -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
index 415924549bdb715384a16afa885f9d15f35afc66..adadfb29bfade3c7428c88be354fbf77415c1a2e 100644 (file)
@@ -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 */
index 2c889d4a85831735023abc14ddbb57476d939512..0ea70cc1bf1bcd534dfeab8b1b9b52542cbfab7c 100644 (file)
@@ -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 */
index f36dc2dc2c84210d768d5f83c81788d57fb6b910..1b4e33255d9c9078202778a190ef13215c9c99e4 100644 (file)
@@ -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"
index 0cad187a3cd4ba38fed5391a5340aa000160176e..66dec07b2a948188d2409d18e54e9d9e0fe7b0b6 100644 (file)
@@ -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 */
index 3b65a8505f01a26e526b155ec631c540d5501818..d39546f15ca25367dd04d3a3cfcbd4a18357eea1 100644 (file)
@@ -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
index a3d0e5fcaa60377a96d01273d15b9b9982fb377a..bcad26b2f12323f43a0d87f304f8de378e1fc711 100644 (file)
@@ -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 \
index 92592827295d5e6ee7fd0e3e3ee553ecd3c3bf48..8edd16d39548a6ee9dbba1b35d6871acaf89db6e 100644 (file)
@@ -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
index c62b373de3068705eec00bb498fe44ef1eb1597b..ca03fc167d6e79bfa5275d4303be1f6c2acec6ec 100644 (file)
@@ -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 */
index 4b596c680aa5e1d029f637de129f4a252602e96f..02bf54ea6fc7ab0068822ddb6ab806dc076e9831 100644 (file)
@@ -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 */
index 95c3ea9ce44de047d6cd1be39811e2730c179f7c..6b4edcc8c4ab4b46c3d689fcd1f8ff63f25d7d23 100644 (file)
@@ -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 */
index 6802428ac42a4185fddab39e6dce7610b6381ea1..81f40191d73bcaf7b7f5ae0649336002ead3641b 100644 (file)
@@ -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
index 940b97f58c00e0dde4c5969eeffe150b25da6f31..7bfdddfd6faba1ddcedc3d6da6687f7489241d1d 100644 (file)
@@ -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
index df3d26b07107088d7bee64897d5c677b4f3592ed..326eb00230dfd535b33ed425d48a1ecd18d8133e 100644 (file)
@@ -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;
        }
index 0ec125160dda38bbbaca61126160285e0fba6e16..bd264d2ba2beee2ce2ccd46bded311a3d76505c1 100644 (file)
@@ -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
index 0071f216bb78186ad258c74a3295940e9228ffe9..00de7b3997c87490a30a4b99eb27f1040e86f1cb 100644 (file)
@@ -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));