]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
6 years agoConvert CONFIG_SYS_DV_CLKMODE et al to Kconfig
Adam Ford [Tue, 23 Jan 2018 10:04:28 +0000 (04:04 -0600)]
Convert CONFIG_SYS_DV_CLKMODE et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_DV_CLKMODE
   CONFIG_SYS_DA850_PLL0_POSTDIV
   CONFIG_SYS_DA850_PLL0_PLLDIV1
   CONFIG_SYS_DA850_PLL0_PLLDIV2
   CONFIG_SYS_DA850_PLL0_PLLDIV3
   CONFIG_SYS_DA850_PLL0_PLLDIV4
   CONFIG_SYS_DA850_PLL0_PLLDIV5
   CONFIG_SYS_DA850_PLL0_PLLDIV6
   CONFIG_SYS_DA850_PLL0_PLLDIV7
   CONFIG_SYS_DA850_PLL1_POSTDIV
   CONFIG_SYS_DA850_PLL1_PLLDIV1
   CONFIG_SYS_DA850_PLL1_PLLDIV2
   CONFIG_SYS_DA850_PLL1_PLLDIV3

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_SYS_BOOT_GET_{CMDLINE, KBD} to Kconfig
Derald D. Woods [Mon, 22 Jan 2018 23:17:10 +0000 (17:17 -0600)]
Convert CONFIG_SYS_BOOT_GET_{CMDLINE, KBD} to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_BOOT_GET_CMDLINE
CONFIG_SYS_BOOT_GET_KBD

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Tue, 30 Jan 2018 15:09:01 +0000 (10:09 -0500)]
Merge git://git.denx.de/u-boot-x86

6 years agox86: kconfig: Remove meaningless 'select n'
Ulf Magnusson [Tue, 30 Jan 2018 12:59:03 +0000 (13:59 +0100)]
x86: kconfig: Remove meaningless 'select n'

'select n' selects a constant symbol, which is meaningless and has no
effect. Maybe this was meant to be a 'default n', though bool and
tristate symbols already implicitly default to n.

Discovered in Kconfiglib (https://github.com/ulfalizer/Kconfiglib),
which does more strict checking here:

kconfiglib.KconfigSyntaxError: board/google/Kconfig:34: Couldn't parse ' select n': expected nonconstant symbol

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: quark: Fix unused warnings
Tom Rini [Sat, 27 Jan 2018 20:13:47 +0000 (15:13 -0500)]
x86: quark: Fix unused warnings

The variable t_rfc is never used, so drop it.  The variables ddr_wctl
and ddr_wcmd are only used in certain manual instances, so guard their
declaration by the same check as their use.

Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
6 years agocmd/bdinfo: print relocation info on X86
Heinrich Schuchardt [Wed, 24 Jan 2018 18:52:29 +0000 (19:52 +0100)]
cmd/bdinfo: print relocation info on X86

For debugging U-Boot in qemu-x86 the relocation address is needed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: qemu: qfw: Implement acpi_get_rsdp_addr()
Bin Meng [Tue, 30 Jan 2018 13:01:17 +0000 (05:01 -0800)]
x86: qemu: qfw: Implement acpi_get_rsdp_addr()

U-Boot on QEMU does not build ACPI table by ourself, instead it uses
the prebuilt ACPI table via the qfw interface. This implements the
qfw version of acpi_get_rsdp_addr() for setup_zimage().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
6 years agox86: acpi: Use an API to get the ACPI RSDP table address
Bin Meng [Tue, 30 Jan 2018 13:01:16 +0000 (05:01 -0800)]
x86: acpi: Use an API to get the ACPI RSDP table address

At present the acpi_rsdp_addr variable is directly referenced in
setup_zimage(). This changes to use an API for better encapsulation
and extension.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
6 years agox86: zImage: Propagate acpi_rsdp_addr to kernel via boot parameters
Andy Shevchenko [Wed, 10 Jan 2018 17:40:15 +0000 (19:40 +0200)]
x86: zImage: Propagate acpi_rsdp_addr to kernel via boot parameters

New field acpi_rsdp_addr, which has been introduced in boot protocol
v2.14 [1], in boot parameters tells kernel the exact address of RDSP
ACPI table. Knowing it increases robustness of the kernel by avoiding
in some cases traversal through a part of physical memory.
It will slightly reduce boot time by the same reason.

[1] See Linux kernel commit

  2f74cbf ("x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr")
  @ https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=2f74cbf

for the details.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: updated the kernel commit git URL and fixed one style issue]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: zImage: Move subarch assignment out of cmd_line check
Andy Shevchenko [Wed, 10 Jan 2018 17:40:14 +0000 (19:40 +0200)]
x86: zImage: Move subarch assignment out of cmd_line check

The commit

  20bfac0599bd ("x86: zImage: add Intel MID platforms support")

introduced an assignment of subarch field in boot parameters, though
missed the right place of doing that. It doesn't matter if we have or
not a kernel command line supplied, we just set that field. Although
guard it by protocol version which supports it.

Fixes: 20bfac0599bd ("x86: zImage: add Intel MID platforms support")
Cc: Vincent Tinelli <vincent.tinelli@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: Fix reference to QEMU variant of write_acpi_tables()
Andy Shevchenko [Wed, 10 Jan 2018 17:33:10 +0000 (19:33 +0200)]
x86: Fix reference to QEMU variant of write_acpi_tables()

The commit

  eece493a7ac1 ("cmd: qfw: bring ACPI generation code into qfw core")

moves ACPI related code to another file and missed an update of
references in acpi_table.c.

Do it now.

Fixes: eece493a7ac1 ("cmd: qfw: bring ACPI generation code into qfw core")
Cc: Miao Yan <yanmiaobest@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: tangier: Make _CRS for BTH0 Serialized to avoid warning
Andy Shevchenko [Wed, 10 Jan 2018 16:07:26 +0000 (18:07 +0200)]
x86: tangier: Make _CRS for BTH0 Serialized to avoid warning

ASL compiler warns:

  ASL     board/intel/edison/dsdt.asl
  board/intel/edison/dsdt.asl.tmp    238:             Method (_CRS, 0, NotSerialized)
  Remark   2120 -      Control Method should be made Serialized ^  (due to creation of named objects within)

Do as suggested by ASL compiler.

Fixes: 5d8c4ebd95e2 ("x86: tangier: Add Bluetooth to ACPI table")
Reported-by: Ferry Toth <fntoth@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agoconfigs: x86: allow to override CONFIG_BOOTCOMMAND
Heinrich Schuchardt [Wed, 3 Jan 2018 15:23:46 +0000 (16:23 +0100)]
configs: x86: allow to override CONFIG_BOOTCOMMAND

Allow to override CONFIG_BOOTCOMMAND in .config.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agoPrepare v2018.03-rc1
Tom Rini [Tue, 30 Jan 2018 01:12:33 +0000 (20:12 -0500)]
Prepare v2018.03-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agospl: include timezone in banner
Klaus Goger [Thu, 4 Jan 2018 06:22:11 +0000 (07:22 +0100)]
spl: include timezone in banner

Include the timezone in the SPL banner so the timestamp matches with
that from u-boot proper.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoaes: Allow non-zero initialization vector
Андрей Мозжухин [Wed, 3 Jan 2018 12:43:56 +0000 (15:43 +0300)]
aes: Allow non-zero initialization vector

AES encryption in CBC mode, in most cases, must be used with random
initialization vector. Using the same key and initialization vector several
times is weak and must be avoided.

Added iv parameter to the aes_cbc_encrypt_blocks and aes_cbc_decrypt_blocks
functions for passing initialization vector.

Command 'aes' now also require the initialization vector parameter.

Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
6 years agokconfig: revert change that was not needed for -Wformat-security
Masahiro Yamada [Sun, 28 Jan 2018 09:41:23 +0000 (18:41 +0900)]
kconfig: revert change that was not needed for -Wformat-security

Recent GCC versions warn if the format string is not a literal
because the compiler cannot check the argument validity at compile
time.

Commit 192bc6948b02 ("Fix GCC format-security errors and convert
sprintfs.") blindly replaced sprintf() with strcpy(), including
many cases where the format parameter is a string literal.

For the kconfig change:

    sprintf(header, "   ");

..., here the format parameter is a string literal "   ", so it is
definitely equivalent to:

    strcpy(header, "   ");

Of course, if the 'header' did not have enough length for containing
"   ", it would be a security problem, but another problem.  (in this
case, the 'header' is 4 byte length buffer, so it is not a problem at
all.)

The kconfig code is kept as synced with Linux as possible, but this
change made the code out-of-sync for nothing.  Just reverting.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agofs: btrfs: Fix printf format character warning
Tom Rini [Sat, 27 Jan 2018 22:23:21 +0000 (17:23 -0500)]
fs: btrfs: Fix printf format character warning

When printing a size_t value we need to use %zu for portability between
32bit and 64bit targets.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Behun <marek.behun@nic.cz>
6 years agomvpp2: Fix warning over 32bit vs 64bit targets
Tom Rini [Sat, 27 Jan 2018 19:48:08 +0000 (14:48 -0500)]
mvpp2: Fix warning over 32bit vs 64bit targets

When we have a driver that is used on both 32bit and 64bit targets and
we are talking about address space we cannot use u64 nor u32 and instead
need to use phys_addr_t.

Fixes: 377883f16d36 ("net: mvpp2x: fix phy connected to wrong mdio issue")
Cc: Stefan Chulski <stefanc@marvell.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agoclk: clk_stm32: Add .set_rate callback
Patrice Chotard [Mon, 29 Jan 2018 17:14:14 +0000 (18:14 +0100)]
clk: clk_stm32: Add .set_rate callback

Since 'commit f4fcba5c5baa ("clk: implement clk_set_defaults()")'
STM32F4 family board can't boot.

Above patch calls clk_set_rate() for all nodes with assigned-clock-rates
property. Clock driver for STM32F family doesn't implement .set_rate
callback which make clk_set_defaults() exit on error and prevent board
to boot.

Fixes: f4fcba5c5baa ("clk: implement clk_set_defaults()")
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoboard: stm32: Fix stm32f746-disco boot
Patrice Chotard [Mon, 29 Jan 2018 12:44:20 +0000 (13:44 +0100)]
board: stm32: Fix stm32f746-disco boot

Since 'commit af2f44267 ("fdc spl: use different BOARD_INIT MACRO for spl and tpl")'
board stm32f746-disco can't boot.

The macro CONFIG_IS_ENABLED() can't evaluate the value of
CONFIG_SPL_BOARD_INIT as it was defined in include/configs/stm32f746-disco.h
without attributed value.

Moving CONFIG_SPL_BOARD_INIT from stm32f746-disco.h to mach-stm32/Kconfig
fixes this issue.

Fixes: af2f44267 ("fdc spl: use different BOARD_INIT MACRO for spl and tpl")
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoserial: Make full device search optional
Alexander Graf [Mon, 29 Jan 2018 12:57:20 +0000 (13:57 +0100)]
serial: Make full device search optional

Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
added code to search for more serial devices if the default one was not
probed correctly.

Unfortunately, that breaks omap3_evm. So while investigating why that is
the case, let's disable the full search for everyone but bcm283x where it
is needed.

Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
Reported-by: Derald D. Woods <woods.technical@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Mon, 29 Jan 2018 13:17:28 +0000 (08:17 -0500)]
Merge git://git.denx.de/u-boot-marvell

6 years agoMerge git://git.denx.de/u-boot-cfi-flash
Tom Rini [Mon, 29 Jan 2018 13:17:13 +0000 (08:17 -0500)]
Merge git://git.denx.de/u-boot-cfi-flash

6 years agotools/mrvl_uart.sh: Tidy script output
Andreas Färber [Sat, 20 Jan 2018 12:18:39 +0000 (13:18 +0100)]
tools/mrvl_uart.sh: Tidy script output

Fix a typo in help output (awailable -> available).
Tidy the grammar - not the board connects to a port, we do.

While at it, be consistent in upper-casing the comments.

Fixes: eee4835d22 ("tools: Add Marvell recovery image download script")
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Igal Liberman <igall@marvell.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agotools/mrvl_uart.sh: Fix minicom baudrate
Andreas Färber [Sat, 20 Jan 2018 12:07:09 +0000 (13:07 +0100)]
tools/mrvl_uart.sh: Fix minicom baudrate

minicom doesn't inherit the baudrate from stty but uses its own
defaults, such as for example 57600, whereas we expect 115200 here.
Explicitly tell minicom which baudrate to use.

Fixes: eee4835d22 ("tools: Add Marvell recovery image download script")
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Igal Liberman <igall@marvell.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Always define cfi_flash_num_flash_banks
Mario Six [Fri, 26 Jan 2018 13:43:56 +0000 (14:43 +0100)]
cfi_flash: Always define cfi_flash_num_flash_banks

The variable cfi_flash_num_flash_banks is defined iff
CONFIG_SYS_MAX_FLASH_BANKS_DETECT is defined, but it is used
unconditionally in the function cfi_flash_init_dm. This leads to a
undefined variable compile error when CONFIG_SYS_MAX_FLASH_BANKS_DETECT
is not defined, but DM is enabled.

Fix this by always defining the cfi_flash_num_flash_banks variable.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix indention
Mario Six [Fri, 26 Jan 2018 13:43:55 +0000 (14:43 +0100)]
cfi_flash: Fix indention

When long expressions surrounded by parentheses are split into multiple
lines, each consecutive line should be aligned with the corresponding
parenthesis. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix long lines
Mario Six [Fri, 26 Jan 2018 13:43:54 +0000 (14:43 +0100)]
cfi_flash: Fix long lines

Long lines (>80 characters) should be avoided where possible. Break up
some long lines where it's not detrimental to readability.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Bound-check index before array access
Mario Six [Fri, 26 Jan 2018 13:43:53 +0000 (14:43 +0100)]
cfi_flash: Bound-check index before array access

In a while loop in cfi_flash.c the array "start" is accessed at the index
"sector" before the index variable "sector" is bounds-checked, which
might lead to accesses beyond the bounds of the array.

Swap the order of the checks in the "&&" expression, so that the
short-circuit evaluation prevents out-of-bounds array accesses.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agoflash: Fix spelling of "ERR_TIMOUT"
Mario Six [Fri, 26 Jan 2018 13:43:52 +0000 (14:43 +0100)]
flash: Fix spelling of "ERR_TIMOUT"

checkpatch.pl complains about the spelling of ERR_TIMOUT. Since the
error is only used in a handful of files, we rename the error to
ERR_TIMEOUT.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Rename camel-case variables
Mario Six [Fri, 26 Jan 2018 13:43:51 +0000 (14:43 +0100)]
cfi_flash: Rename camel-case variables

Camel-case naming should be avoided. Rename two camel-case variables,
and fix their usage accordingly.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix strings split across lines
Mario Six [Fri, 26 Jan 2018 13:43:50 +0000 (14:43 +0100)]
cfi_flash: Fix strings split across lines

Strings should not be split accross multiple lines. Where possible and
not detrimental to readability, fix the instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Use u8 pointers instead of void pointers
Mario Six [Fri, 26 Jan 2018 13:43:49 +0000 (14:43 +0100)]
cfi_flash: Use u8 pointers instead of void pointers

According to the C standard, pointer arithmetic for pointers of type
void is undefined behavior (the assumption that they're 8-bit wide is a
GCC-specific assumption). In the interest of keeping the code
standards-compliant, and also better communicate intent, switch all
void* variables where pointer arithmetic is used to u8* variables.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Remove assignments from if conditions
Mario Six [Fri, 26 Jan 2018 13:43:48 +0000 (14:43 +0100)]
cfi_flash: Remove assignments from if conditions

The condition in if statements should not be used for variable
assignment. Instead, the assignment should be done in a separate step
beforehand. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Remove return from void function
Mario Six [Fri, 26 Jan 2018 13:43:47 +0000 (14:43 +0100)]
cfi_flash: Remove return from void function

void functions don't need an explicit return at the end.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix placement of brace
Mario Six [Fri, 26 Jan 2018 13:43:46 +0000 (14:43 +0100)]
cfi_flash: Fix placement of brace

The opening brace of block statements should be attached to the
statement itself, and not be on a separate line.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix else after break
Mario Six [Fri, 26 Jan 2018 13:43:45 +0000 (14:43 +0100)]
cfi_flash: Fix else after break

If in a loop, the if block in a if/else statement ends in a break, the
statements in the else blockcan be extracted, since the break stops the
execution.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix spelling of "Unknown"
Mario Six [Fri, 26 Jan 2018 13:43:44 +0000 (14:43 +0100)]
cfi_flash: Fix spelling of "Unknown"

"Unkown" should be spelled "Unknown".

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Add missing braces in blocks
Mario Six [Fri, 26 Jan 2018 13:43:43 +0000 (14:43 +0100)]
cfi_flash: Add missing braces in blocks

In if/else statements, either both blocks (if and else) should have
braces or both blocks should not have braces, but mixed configurations
are discouraged. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Remove unnecessary braces
Mario Six [Fri, 26 Jan 2018 13:43:42 +0000 (14:43 +0100)]
cfi_flash: Remove unnecessary braces

"==" and "!=" bind tighter than the boolean operators, so parentheses
around them in compound logical statements are unnecessary. Fix all
instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix comment style
Mario Six [Fri, 26 Jan 2018 13:43:41 +0000 (14:43 +0100)]
cfi_flash: Fix comment style

Comment blocks should end with a "*/" on a separate line, not with the
"*/" attached to the end of the last line of text. Fix all instances
where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Use __func__ macro instead of function name
Mario Six [Fri, 26 Jan 2018 13:43:40 +0000 (14:43 +0100)]
cfi_flash: Use __func__ macro instead of function name

printf/debug statements should not include the file name as a hardcoded
string, but instead use the __func__ macro. Fix all instances where this
occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix logical continuations
Mario Six [Fri, 26 Jan 2018 13:43:39 +0000 (14:43 +0100)]
cfi_flash: Fix logical continuations

When splitting long logical statements across multiple lines, the
logical operators should be at the end of the lines. Fix all instances
where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Remove braces for single-statement blocks
Mario Six [Fri, 26 Jan 2018 13:43:38 +0000 (14:43 +0100)]
cfi_flash: Remove braces for single-statement blocks

Blocks with a single statement should not be enclosed in braces. Fix all
instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix missing/superfluous lines
Mario Six [Fri, 26 Jan 2018 13:43:37 +0000 (14:43 +0100)]
cfi_flash: Fix missing/superfluous lines

There should be no consecutive blank lines, and no blank lines at the
end of blocks. But there should be blank lines between variable
declarations and code. Fix all instances where either occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix spacing around casts/operators
Mario Six [Fri, 26 Jan 2018 13:43:36 +0000 (14:43 +0100)]
cfi_flash: Fix spacing around casts/operators

There should be spaces around operators, and no spaces between a cast
and the variable its being applied to. Fix all instances where this
occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix indent of case statements
Mario Six [Fri, 26 Jan 2018 13:43:35 +0000 (14:43 +0100)]
cfi_flash: Fix indent of case statements

case statements should be at the same level of indent as the switch
keyword. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix whitespace with casting
Mario Six [Fri, 26 Jan 2018 13:43:34 +0000 (14:43 +0100)]
cfi_flash: Fix whitespace with casting

When casting to a pointer type, the asterisk should be attached to the
type name, not separated by a space. Fix all instances where this
occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix Parenthesis spacing
Mario Six [Fri, 26 Jan 2018 13:43:33 +0000 (14:43 +0100)]
cfi_flash: Fix Parenthesis spacing

There should not be additional spaces when nesting parentheses
("( (...) )"). Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix style of pointer declarations
Mario Six [Fri, 26 Jan 2018 13:43:32 +0000 (14:43 +0100)]
cfi_flash: Fix style of pointer declarations

In a pointer declaration there should not be a space between the
asterisk and the pointer name. Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agocfi_flash: Fix space between function name and parenthesis
Mario Six [Fri, 26 Jan 2018 13:43:31 +0000 (14:43 +0100)]
cfi_flash: Fix space between function name and parenthesis

There should not be a space between a function name and a parenthesis
("func (...)"). Fix all instances where this occurs.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agoMerge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Tom Rini [Sun, 28 Jan 2018 23:26:00 +0000 (18:26 -0500)]
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-01-28

This is the second part of patches for 2018.03-rc1, fixing
a few minor issues and adding a readme file for iSCSI booting.

6 years agoefi_loader: add a README.iscsi describing booting via iSCSI
Heinrich Schuchardt [Sun, 28 Jan 2018 14:26:02 +0000 (15:26 +0100)]
efi_loader: add a README.iscsi describing booting via iSCSI

The appended README explains how U-Boot and iPXE can be used
to boot a diskless system from an iSCSI SAN.

The maintainer for README.efi and README.iscsi is set.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: s/Adress/Address/]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: consistently use %pD to print device paths
Heinrich Schuchardt [Fri, 26 Jan 2018 06:20:54 +0000 (07:20 +0100)]
efi_loader: consistently use %pD to print device paths

Now that we have %pD support in vsprintf we should avoid separate
logic for printing device paths in other places.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: do not install NULL as device path
Heinrich Schuchardt [Fri, 26 Jan 2018 05:50:54 +0000 (06:50 +0100)]
efi_loader: do not install NULL as device path

In an image is loaded from memory we do not have a device path.
Do not install NULL as device path in this case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agovsprintf.c: correct printing of a NULL device path
Heinrich Schuchardt [Fri, 26 Jan 2018 05:30:30 +0000 (06:30 +0100)]
vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Call Exit() on return from payload in StartImage()
Alexander Graf [Thu, 25 Jan 2018 23:47:53 +0000 (00:47 +0100)]
efi_loader: Call Exit() on return from payload in StartImage()

When a UEFI payload just returns instead of calling the Exit() callback,
we handle that in efi_do_enter() and call Exit on its behalf, so that
the loaded_image->exit_status value is correct.

We were missing that logic in StartImage(). Call it there too.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix comments in indent_string()
Heinrich Schuchardt [Wed, 24 Jan 2018 18:21:36 +0000 (19:21 +0100)]
efi_loader: fix comments in indent_string()

Provide a better description for indent_string.
Fix a typo.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: catch misspelled bootefi subcommand
Heinrich Schuchardt [Wed, 24 Jan 2018 19:33:54 +0000 (20:33 +0100)]
efi_loader: catch misspelled bootefi subcommand

If 'bootefi hello' or 'bootefi selftest' can be executed depends on the
configuration.

If an invalid non-numeric 1st argument is passed to bootefi, e.g.
'bootefi hola', this string is converted to 0 and U-Boot jumps to
this typically invalid address.

With the patch the online help is shown instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Always use EFIAPI instead of asmlinkage
Alexander Graf [Tue, 23 Jan 2018 23:18:08 +0000 (00:18 +0100)]
efi_loader: Always use EFIAPI instead of asmlinkage

EFI calls are usually defined as asmlinkage. That means we pass all parameters
to functions via the stack x86_32.

On x86_64 however, we need to also stick to the MS ABI calling conventions,
which the EFIAPI define conveniently handles for us. Most EFI functions were
also marked with EFIAPI, except for the entry call.

So this patch adjusts all entry calls to use EFIAPI instead of the manual
asmlinkage attribute.

While at it, we also change the prototype of the entry point to return
efi_status_t instead of ulong, as this is the correct prototype definition.

Signed-off-by: Alexander Graf <agraf@suse.de>
---

v1 -> v2:

  - Use efi_status_t in all occurences

6 years agoefi: Conflict efi_loader with different stub bitness
Alexander Graf [Wed, 24 Jan 2018 13:54:21 +0000 (14:54 +0100)]
efi: Conflict efi_loader with different stub bitness

We have 2 users of the EFI headers: efi_loader and the EFI stub. Efi_loader
always expects that the bitness of the definitions it uses is identical to
the execution.

The EFI stub however allows to run x86_64 U-Boot on 32bit EFI and the other
way around, so it allows for different bitness of EFI definitions and U-Boot
environment.

This patch explicitly requests via Kconfig that efi_loader can only be enabled
if the bitness is identical. Because we can run efi_loader on x86_64 without
EFI stub enabled, it also ensures that this case propagates the correct ABI
constraints.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge git://git.denx.de/u-boot-rockchip
Tom Rini [Sun, 28 Jan 2018 18:56:19 +0000 (13:56 -0500)]
Merge git://git.denx.de/u-boot-rockchip

6 years agoomap3_logic: Clean up I2C pin muxing.
Adam Ford [Thu, 25 Jan 2018 20:15:38 +0000 (14:15 -0600)]
omap3_logic: Clean up I2C pin muxing.

The SOM has external pull-up resistors, so let's turn these off.
It was helping reduce some errors when running I2C1 @ 2.6MHz.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agospl: add option to disable SPL banner output
Anatolij Gustschin [Thu, 25 Jan 2018 17:45:22 +0000 (18:45 +0100)]
spl: add option to disable SPL banner output

Selecting this option will reduce SPL boot time by approx. 6 ms
(e. g. with 70 bytes long banner string at 115200 baud).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agobcm2835_pinctrl: Probe pre-reloc
Alexander Graf [Thu, 25 Jan 2018 11:05:56 +0000 (12:05 +0100)]
bcm2835_pinctrl: Probe pre-reloc

The serial drivers now depend on the pinctrl driver to determine whether
they are enabled. That means if a serial device wants to be used pre-reloc,
we also need the pinctrl device pre-reloc.

Adapt the pinctrl driver as well as dts overlay accordingly.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm2835_pl011_serial: Add BCM2835 specific serial driver
Alexander Graf [Thu, 25 Jan 2018 11:05:55 +0000 (12:05 +0100)]
bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMAINTAINERS: Take over BCM2835 maintainership
Alexander Graf [Thu, 25 Jan 2018 11:05:54 +0000 (12:05 +0100)]
MAINTAINERS: Take over BCM2835 maintainership

It seems as if I have more interest in BCM2835 support than most others,
so I'll bite the bullet and declare myself maintainer. It'd be a shame
to leave that platform orphaned.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm2835_mu_serial: Convert to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:53 +0000 (12:05 +0100)]
bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl01x: Convert CONFIG_PL01X_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:52 +0000 (12:05 +0100)]
pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl011: Convert CONFIG_PL011_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:51 +0000 (12:05 +0100)]
pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl010: Convert CONFIG_PL010_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:50 +0000 (12:05 +0100)]
pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl01x: Convert to dev_read
Alexander Graf [Thu, 25 Jan 2018 11:05:49 +0000 (12:05 +0100)]
pl01x: Convert to dev_read

The fdtdec API is deprecated, convert the pl010 and pl011 devices to
use the dev_read API instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Fail loading if not muxed
Alexander Graf [Thu, 25 Jan 2018 11:05:48 +0000 (12:05 +0100)]
serial_bcm283x_mu: Fail loading if not muxed

The bcm283x mini-uart is only really usable as U-Boot serial output
when it is muxed to the UART pins of the RPi pin header.

So fail probing in case it is not muxed correctly, as in that case
firmware did not initialize it properly either.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Always skip init
Alexander Graf [Thu, 25 Jan 2018 11:05:47 +0000 (12:05 +0100)]
serial_bcm283x_mu: Always skip init

The serial initialization doesn't always quite work for me, so let's
always skip it for now. We know that firmware on the RPi initializes
us properly already.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Convert to dev_read
Alexander Graf [Thu, 25 Jan 2018 11:05:46 +0000 (12:05 +0100)]
serial_bcm283x_mu: Convert to dev_read

The fdtdec API got deprecated in favor of dev_read calls.
Use those instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agorpi: Determine PL011/Mini-UART availability at runtime
Alexander Graf [Thu, 25 Jan 2018 11:05:45 +0000 (12:05 +0100)]
rpi: Determine PL011/Mini-UART availability at runtime

Firmware on the Raspberry Pi family of devices can dynamically configure either
the PL011, Mini-UART or no device at all to be routed to the user accessible
UART pins.

That means we need to always include both drivers, because we can never be sure
which of the two serial devices firmware actually chooses to use.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial: bcm283x_mu: Remove support for post-init disabling
Alexander Graf [Thu, 25 Jan 2018 11:05:44 +0000 (12:05 +0100)]
serial: bcm283x_mu: Remove support for post-init disabling

We are switching to a model where a serial device doesn't even get probed when
it's not muxed properly, so we don't need device specific disabling
functionality anymore.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agorpi: Remove runtime disabling support for serial
Alexander Graf [Thu, 25 Jan 2018 11:05:43 +0000 (12:05 +0100)]
rpi: Remove runtime disabling support for serial

We are switching to a model where our board file can directly fail probing
of serial devices when they're not usable, so remove the current runtime
hack we have.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial: Use next serial device if probing fails
Alexander Graf [Thu, 25 Jan 2018 11:05:42 +0000 (12:05 +0100)]
serial: Use next serial device if probing fails

Currently our serial device search chokes on the fact that the serial
probe function could fail. If it does, instead of searching for the next
usable serial device, it just quits.

This patch changes the fallback logic so that even when a serial device
was not probed correctly, we just try the next ones until we find one that
works.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoam33xx: board: Call spl_early_init() to support sdram_init()
Faiz Abbas [Wed, 24 Jan 2018 09:14:49 +0000 (14:44 +0530)]
am33xx: board: Call spl_early_init() to support sdram_init()

With driver model enabled in SPL, sdram_init() requires device tree
and malloc to be initialized.
Therefore call spl_early_init() in early_system_init().

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
6 years agoarm: add support for PDU001
Felix Brack [Tue, 23 Jan 2018 17:27:22 +0000 (18:27 +0100)]
arm: add support for PDU001

This patch adds support for the PDU001 board.

Signed-off-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agommc: Add bcm2835 sdhost controller
Alexander Graf [Tue, 23 Jan 2018 17:05:22 +0000 (18:05 +0100)]
mmc: Add bcm2835 sdhost controller

The BCM2835 family of SoCs has 2 different SD controllers: One based on
the SDHCI spec and a custom, home-grown one.

This patch implements a driver for the latter based on the Linux driver.
This is needed so that we can make use of device trees that assume driver
presence of both SD controllers.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm283x: Add pinctrl driver
Alexander Graf [Tue, 23 Jan 2018 17:05:21 +0000 (18:05 +0100)]
bcm283x: Add pinctrl driver

The bcm283x family of SoCs have a GPIO controller that also acts as
pinctrl controller.

This patch introduces a new pinctrl driver that can actually properly mux
devices into their device tree defined pin states and is now the primary
owner of the gpio device. The previous GPIO driver gets moved into a
subdevice of the pinctrl driver, bound to the same OF node.

That way whenever a device asks for pinctrl support, it gets it
automatically from the pinctrl driver and GPIO support is still available
in the normal command line phase.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopowerpc: Drop CONFIG_WALNUT and other related dead code
Tuomas Tynkkynen [Sun, 21 Jan 2018 16:16:42 +0000 (18:16 +0200)]
powerpc: Drop CONFIG_WALNUT and other related dead code

CONFIG_WALNUT was dropped in June 2017 in:
commit 98f705c9cefdfd ("powerpc: remove 4xx support")

While at it, the related CONFIG_MACH_SPECIFIC and the have_of
and _machine variables are unused as well, so drop them too.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agolibfdt: migrate include/libfdt_env.h to a wrapper
Masahiro Yamada [Sun, 21 Jan 2018 10:19:18 +0000 (19:19 +0900)]
libfdt: migrate include/libfdt_env.h to a wrapper

libfdt_env.h is supposed to provide system-dependent defines.

scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable
for user-space, so we should use this for USE_HOSTCC case.

For compiling U-Boot, we need to override such system-dependent
defines, so use <linux/libfdt_env.h> imported from Linux.

<libfdt.h> selects a proper one.  Maybe, we should split header
inclusion completely, but I do not want too many patches at one.

I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: migrate libfdt.h to a wrapper + U-Boot own code
Masahiro Yamada [Sun, 21 Jan 2018 10:19:17 +0000 (19:19 +0900)]
libfdt: migrate libfdt.h to a wrapper + U-Boot own code

There is tons of code duplication between lib/libfdt/libfdt.h and
scripts/dtc/libfdt/libfdt.h.  Evacuate the U-Boot own code to
include/libfdt.h and remove lib/libfdt/libfdt.h.

For host tools, <libfdt.h> should include scripts/dtc/libfdt/libfdt.h,
which is already suitable for user-space.

For compiling U-Boot, <linux/libfdt.h> should be included because we
need a different libfdt_env.h .

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agolibfdt: move working_fdt and FDT_RAMDISK_OVERHEAD to include/libfdt.h
Masahiro Yamada [Sun, 21 Jan 2018 10:19:16 +0000 (19:19 +0900)]
libfdt: move working_fdt and FDT_RAMDISK_OVERHEAD to include/libfdt.h

libfdt_env.h exists to contain system-dependent defines:

  - typedef of fdt*_t
  - fdt*_to_cpu(), cpu_to_fdt*

working_fdt and FDT_RAMDISK_OVERHEAD are unrelated to the environment,
so they must get out of this header.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotools: include necessary headers explicitly
Masahiro Yamada [Sun, 21 Jan 2018 10:19:15 +0000 (19:19 +0900)]
tools: include necessary headers explicitly

Several host-tools use "bool" type without including <stdbool.h>.
This relies on the crappy header inclusion chain.

tools/Makefile has the following line:

  HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \

All host-tools are forced to include libfdt_env.h even if they are
totally unrelated to FDT.  Then, <stdbool.h> is indirectly included
as follows:

     include/libfdt_env.h
  -> include/linux/types.h
  -> <stdbool.h>

I am fixing this horrible crap.  In advance, I need to add necessary
include directives explicitly.  tools/fdtgrep.c needs more; <fctl.h>
for open() and <errno.h> for errno.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: fix <linux/libfdt.h>
Masahiro Yamada [Sun, 21 Jan 2018 10:19:14 +0000 (19:19 +0900)]
libfdt: fix <linux/libfdt.h>

I do not remember why, but this is apparently a file-copy mistake.
The file name is libfdt.h, but its content is that of libfdt_env.h

Re-import it from upstream Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c
Masahiro Yamada [Sun, 21 Jan 2018 10:19:13 +0000 (19:19 +0900)]
libfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c

The only difference between scripts/dtc/libfdt/fdt_rw.c and
lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().

It is only used by fdtgrep, so we do not need to compile it for U-Boot
image.  Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agohost-tools: use python2 explicitly for shebang
Masahiro Yamada [Sun, 21 Jan 2018 09:34:57 +0000 (18:34 +0900)]
host-tools: use python2 explicitly for shebang

All of these host tools are apparently written for Python2,
not Python3.

Use 'python2' in the shebang line according to PEP 394
(https://www.python.org/dev/peps/pep-0394/).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support
Derald D. Woods [Sun, 21 Jan 2018 03:16:14 +0000 (21:16 -0600)]
ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support

The omap3_evm board does not boot when commit:
    a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
is applied after commit:
    3dde8f2037 ("Merge git://git.denx.de/u-boot-mmc")

This commit reduces the CONFIG_EXTRA_ENV_SETTINGS size and better
leverages the existing distro bootcmd infrastructure.

- Use updated UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC naming found in am335x_evm.h and ti_omap4_common.h
- Remove extra environment content that is no longer needed

[MMC(0:1)/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-fat
label omap3-evm-mmc-fat
kernel /zImage
fdt /omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[MMC(0:2)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-ext4
label omap3-evm-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[NAND(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-nand-ubifs
label omap3-evm-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd rootfstype=ubifs rootwait
---8<-------------------------------------------------------------------

Fixes: a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agodistro bootcmd: Allow board defined UBI partition and volume names
Derald D. Woods [Sun, 21 Jan 2018 03:16:13 +0000 (21:16 -0600)]
distro bootcmd: Allow board defined UBI partition and volume names

This commit allows overriding the default assumption that the boot UBI
MTD partition is named 'UBI' and the UBI volume is 'boot'. A board
desiring to use a legacy or alternative NAND layout can now define the
following two extra environment variables:

bootubipart=<some_ubi_partition_name>
bootubivol=<some_ubi_volume_name>

EXAMPLE:

[include/configs/some_board.h]
---8<-------------------------------------------------------------------
[...]
#include <config_distro_defaults.h>

#define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV

#define BOOT_TARGET_DEVICES(func) \
func(UBIFS, ubifs, 0)

#include <config_distro_bootcmd.h>
[...]
#define CONFIG_EXTRA_ENV_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
"bootubivol=rootfs\0" \
"bootubipart=rootfs\0" \
BOOTENV
[...]
---8<-------------------------------------------------------------------

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agospl: use different BOARD_INIT MACRO for spl and tpl
Kever Yang [Sat, 20 Jan 2018 10:00:26 +0000 (18:00 +0800)]
spl: use different BOARD_INIT MACRO for spl and tpl

SPL and TPL may not always need spl_board_init() at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agofs: btrfs: Fix unaligned memory accesses
Alberto Sánchez Molero [Sat, 20 Jan 2018 07:17:57 +0000 (09:17 +0200)]
fs: btrfs: Fix unaligned memory accesses

Loading files stored with lzo compression from a btrfs filesystem was
producing unaligned memory accesses, which were causing a data abort
and a reset on an Orange Pi Zero.

The change in hash.c is not triggered by any error but follows the
same pattern. Please confirm.

Fixed according to doc/README.unaligned-memory-access.txt

Signed-off-by: Alberto Sánchez Molero <alsamolero@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
6 years agospl: atf: pass NULL for bl32_ep pc
Kever Yang [Wed, 17 Jan 2018 03:05:38 +0000 (11:05 +0800)]
spl: atf: pass NULL for bl32_ep pc

ATF use bl32_ep_info->pc to decide if thre is an available bl32,
let's mark it as NULL first.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: rk3036: enable rockusb support on rk3036 based device
Eddie Cai [Wed, 17 Jan 2018 01:51:41 +0000 (09:51 +0800)]
rockchip: rk3036: enable rockusb support on rk3036 based device

Rockchip Rockusb driver already merged. So we enable rockusb
support on rk3036 based device.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: dts: rk3128: update pwm-cell for pwm0
Kever Yang [Tue, 16 Jan 2018 08:08:18 +0000 (16:08 +0800)]
rockchip: dts: rk3128: update pwm-cell for pwm0

The backlight pwm-cell is 3.

This remove the warning in buildman:
arch/arm/dts/rk3126-evb.dtb: Warning (pwms_property): Property 'pwms', cell 3 is not a phandle reference in /backlight
arch/arm/dts/rk3126-evb.dtb: Warning (pwms_property): Missing property '#pwm-cells' in node /sram@10080400 or bad phandle (referred from /backlight:pwms[3])

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: clk: guard set_parent implementations against OF_PLATDATA
Philipp Tomsich [Thu, 25 Jan 2018 14:27:10 +0000 (15:27 +0100)]
rockchip: clk: guard set_parent implementations against OF_PLATDATA

The set_parent implementations do not make sense when OF_PLATDATA is
enabled.  We guard these against OF_PLATDATA and don't populate the
set_parent-op when this is the case.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>