oweals/u-boot.git
7 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-dm
Tom Rini [Sun, 4 Dec 2016 00:43:51 +0000 (19:43 -0500)]
Merge branch 'master' of git://denx.de/git/u-boot-dm

7 years agocmd: move CMD_PXE to Kconfig
Yann E. MORIN [Sun, 13 Nov 2016 20:59:52 +0000 (21:59 +0100)]
cmd: move CMD_PXE to Kconfig

Currently, CMD_PXE is forcibly enabled in config_distro_defaults.h, so
that general purpose distributions can rely on it being defined. This
header is included, under conditions or not, by various archs or
famillies of archs / SoCs.

However, it is very possible that boards based on those SoCs will not
have a physical ethernet connector at all, even if the have a MAC; for
example, the Nanopi Neo AIR (sunxi H3) does not. It is also possible
that network booting is absolutely not necessary for a device.

However, it is not possible to disable the PXE command, as it is
forcibly enabled and is non-configurable.

But it turns out we already have a config option to build a distro-ready
image, in the name of DISTRO_DEFAULTS.

Move CMD_PXE out of the hard-coded config_distro_defaults.h into a
Kconfig option, that gets selected by DISTRO_DEFAULTS when it is set.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Joe Hershberger <joe.hershberger@ni.com>
[trini: Make it select MENU, run moveconfig.py]
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoEnable DISTRO_DEFAULT on platforms that missed it before
Tom Rini [Tue, 29 Nov 2016 14:14:57 +0000 (09:14 -0500)]
Enable DISTRO_DEFAULT on platforms that missed it before

A number of platforms had been using the distro default feature before
it was moved to Kconfig but did not enable the new Kconfig option when
it was enabled.  This caused a regression in terms of features and this
introduces breakage when more things move to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocmd: Convert CMD_BOOTMENU
Tom Rini [Tue, 29 Nov 2016 14:14:56 +0000 (09:14 -0500)]
cmd: Convert CMD_BOOTMENU

Also convert MENU while we're in here.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoboard: ti: am57xx: add FIT image TEE processing
Andrew F. Davis [Tue, 29 Nov 2016 22:33:26 +0000 (16:33 -0600)]
board: ti: am57xx: add FIT image TEE processing

Populate the corresponding TEE image processing call to be
performed during FIT loadable processing.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoboard: ti: dra7xx: add FIT image TEE processing
Andrew F. Davis [Tue, 29 Nov 2016 22:33:25 +0000 (16:33 -0600)]
board: ti: dra7xx: add FIT image TEE processing

Populate the corresponding TEE image processing call to be
performed during FIT loadable processing.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap5: Add OPTEE node to fdt
Andrew F. Davis [Tue, 29 Nov 2016 22:33:24 +0000 (16:33 -0600)]
arm: omap5: Add OPTEE node to fdt

Add an OPTEE node to the FDT when TEE installation has completed
successfully. This informs the kernel of the presence of OPTEE.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap5: Add TEE loading support
Harinarayan Bhatta [Tue, 29 Nov 2016 22:33:23 +0000 (16:33 -0600)]
arm: omap5: Add TEE loading support

secure_tee_install is used to install and initialize a secure TEE OS such as
Linaro OP-TEE into the secure world. This function takes in the address
where the signed TEE image is loaded as an argument. The signed TEE image
consists of a header (struct tee_header), TEE code+data followed by the
signature generated using image signing tool from TI security development
package (SECDEV). Refer to README.ti-secure for more information.

This function uses 2 new secure APIs.

1. PPA_SERV_HAL_TEE_LOAD_MASTER - Must be called on CPU Core 0. Protected
   memory for TEE must be reserved before calling this function. This API
   needs arguments filled into struct ppa_tee_load_info. The TEE image is
   authenticated and if there are no errors, the control passes to the TEE
   entry point.

2. PPA_SERV_HAL_TEE_LOAD_SLAVE - Called on other CPU cores only after
   a TEE_LOAD_MASTER call. Takes no arguments. Checks if TEE was
   successfully loaded (on core 0) and transfers control to the same TEE
   entry point.

The code at TEE entry point is expected perform OS initialization steps
and return back to non-secure world (U-Boot).

Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap5: Add function to make an SMC call on cpu1
Harinarayan Bhatta [Tue, 29 Nov 2016 22:33:22 +0000 (16:33 -0600)]
arm: omap5: Add function to make an SMC call on cpu1

On DRA7xx platform, CPU Core 1 is not used in u-boot. However, in some
cases it is need to make secure API calls from Core 1. This patch adds
an assembly function to make a secure (SMC) call from CPU Core #1.

Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoimage: Add Trusted Execution Environment image type
Andrew F. Davis [Tue, 29 Nov 2016 22:33:21 +0000 (16:33 -0600)]
image: Add Trusted Execution Environment image type

Add a new image type representing Trusted Execution Environment (TEE)
image types. For example, an OP-TEE OS binary image.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoimage: Add FIT image loadable section custom processing
Andrew F. Davis [Tue, 29 Nov 2016 22:33:20 +0000 (16:33 -0600)]
image: Add FIT image loadable section custom processing

To help automate the loading of custom image types we add the ability
to define custom handlers for the loadable section types. When we find
a compatible type while loading a "loadable" image from a FIT image we
run its associated handlers to perform any additional steps needed for
loading this image.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodavinci: omapl138_lcdk: add DT support for EMMC boot
Fabien Parent [Tue, 29 Nov 2016 16:15:03 +0000 (17:15 +0100)]
davinci: omapl138_lcdk: add DT support for EMMC boot

When booting from EMMC, load the DTB and pass it to the kernel.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: improve readability of boot command
Fabien Parent [Tue, 29 Nov 2016 16:15:02 +0000 (17:15 +0100)]
davinci: omapl138_lcdk: improve readability of boot command

Improve the readability of the boot command. This will help a later
commit that adds DT support.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: add NAND SPL boot support
Fabien Parent [Tue, 29 Nov 2016 13:31:34 +0000 (14:31 +0100)]
davinci: omapl138_lcdk: add NAND SPL boot support

NAND SPL boot was missing. Add it. The README specific to omapl138-lcdk
is also removed because its content does not apply anymore, i.e. the
generated AIS image can be flashed directly to the NAND without
using any external tool to create and bootable AIS image.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lck: remove obsolete define
Fabien Parent [Tue, 29 Nov 2016 13:31:33 +0000 (14:31 +0100)]
davinci: omapl138_lck: remove obsolete define

NAND_MAX_CHIPS is not used anymore and has been replaced by
CONFIG_SYS_MAX_NAND_DEVICE. There is no need to keep the former
define.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: use correct name for CONFIG_SYS_NAND_MASK_ALE
Fabien Parent [Tue, 29 Nov 2016 13:31:32 +0000 (14:31 +0100)]
davinci: omapl138_lcdk: use correct name for CONFIG_SYS_NAND_MASK_ALE

CONFIG_SYS_ALE_MASK is not used anywhere. It has probably been
renamed to CONFIG_SYS_NAND_MASK_ALE. Rename it and remove the former
from the config_whitelist.txt file.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: use correct name for CONFIG_SYS_NAND_MASK_CLE
Fabien Parent [Tue, 29 Nov 2016 13:31:31 +0000 (14:31 +0100)]
davinci: omapl138_lcdk: use correct name for CONFIG_SYS_NAND_MASK_CLE

CONFIG_SYS_CLE_MASK is not used anywhere. It has probably been
renamed to CONFIG_SYS_NAND_MASK_CLE. Rename it and remove the former
from the config_whitelist.txt file.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: use correct define for 16 bit NAND chips
Fabien Parent [Tue, 29 Nov 2016 13:31:30 +0000 (14:31 +0100)]
davinci: omapl138_lcdk: use correct define for 16 bit NAND chips

The omapl138_lcdk header defines CONFIG_SYS_NAND_BUSWIDTH_16_BIT while
the correct name is CONFIG_SYS_NAND_BUSWIDTH_16BIT.
While renaming the only occurrence of CONFIG_SYS_NAND_BUSWIDTH_16_BIT,
let's also remove it from the config_whitelist.txt file.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoNAND: davinci: add support for NAND chips with 16 bits bus
Fabien Parent [Tue, 29 Nov 2016 13:31:29 +0000 (14:31 +0100)]
NAND: davinci: add support for NAND chips with 16 bits bus

The OMAPL138-LCD board uses a NAND chip with a 16 bits bus. Add
support into the davinci driver for 16 bit bus NAND chips.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: add u-boot sector for mmc/sd boot
Fabien Parent [Tue, 29 Nov 2016 13:23:41 +0000 (14:23 +0100)]
davinci: omapl138_lcdk: add u-boot sector for mmc/sd boot

Set the correct CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR value in order
to be able to boot from MMC/SD.

The SPL is stored at sector 0x75, while u-boot will follow at
sector 0xb5.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: da850evm: fix empty boot method list in the SPL
Fabien Parent [Tue, 29 Nov 2016 13:23:40 +0000 (14:23 +0100)]
davinci: da850evm: fix empty boot method list in the SPL

The list of available boot method is not part of the binary which
prevent the SPL from booting u-boot or Linux.

Add the missing .u_boot_list* sections to the binary to fix it.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: configure ddr2
Fabien Parent [Tue, 29 Nov 2016 13:23:39 +0000 (14:23 +0100)]
davinci: omapl138_lcdk: configure ddr2

The SPL is unable to load u-boot because the DDR2 is not configured.
Configure the DDR2.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: configure pll0
Fabien Parent [Tue, 29 Nov 2016 13:23:38 +0000 (14:23 +0100)]
davinci: omapl138_lcdk: configure pll0

The SPL is not able to boot properly because the PLL0 is not
configured. Configure it.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: davinci: Move CONFIG_SYS_DA850_DDR_INIT to Kconfig
Fabien Parent [Tue, 29 Nov 2016 13:23:37 +0000 (14:23 +0100)]
ARM: davinci: Move CONFIG_SYS_DA850_DDR_INIT to Kconfig

Clean config headers by moving CONFIG_SYS_DA850_DDR_INIT away to a
Kconfig file.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: davinci: Move CONFIG_SYS_DA850_PLL_INIT to Kconfig
Fabien Parent [Tue, 29 Nov 2016 13:23:36 +0000 (14:23 +0100)]
ARM: davinci: Move CONFIG_SYS_DA850_PLL_INIT to Kconfig

Clean config headers by moving CONFIG_SYS_DA850_PLL_INIT away to a
Kconfig file.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: DRA7x/AM57xx: Get rid of CONFIG_AM57XX
Nishanth Menon [Tue, 29 Nov 2016 09:52:00 +0000 (15:22 +0530)]
ARM: DRA7x/AM57xx: Get rid of CONFIG_AM57XX

CONFIG_AM57XX is just an unnecessary macro that is redundant given So,
remove the same instead of spreading through out the u-boot source
code and getting in the way to maintain common code for DRA7x family.

Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agousb: xhci: Remove assumption of DWC instance based on DRA7 SoC type
Nishanth Menon [Tue, 29 Nov 2016 09:51:59 +0000 (15:21 +0530)]
usb: xhci: Remove assumption of DWC instance based on DRA7 SoC type

Both AM57xx and DRA7xx share the same set of base addresses for DWC
controllers. The usage however differ with DWC2 instance used typically
in AM57xx evms while DWC1 instances used in DRA7x platforms.

Use TARGET_SOC config to differentiate so that CONFIG_AM57XX can be dropped.

Eventually, this needs to be dt-fied.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: K2G: DDR3: Fix up priv ID for MPU
Nishanth Menon [Tue, 29 Nov 2016 06:37:50 +0000 (12:07 +0530)]
ARM: K2G: DDR3: Fix up priv ID for MPU

For ECC enabled DDR, we use EDMA to reset all memory values to 0. For
K2E/L/H/K the priv ID of 8 was indicative of ARM, but that is not the
case for K2G, where it is 1.

Unfortunately, ddr3 code had hard coded the privID and had missed
identification previously. Fix the same, else unforeseen behavior can
be expected in our reset of DDR contents to 0 for ECC enablement.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: AMx3xx: Make FIT boot as default boot on HS devices
Lokesh Vutla [Tue, 29 Nov 2016 06:28:03 +0000 (11:58 +0530)]
ARM: AMx3xx: Make FIT boot as default boot on HS devices

Verification has to be done before booting any images on HS devices. So
default the boot to FIT on HS devices.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: AM57xx: Make FIT boot as default boot on HS devices
Lokesh Vutla [Tue, 29 Nov 2016 06:28:02 +0000 (11:58 +0530)]
ARM: AM57xx: Make FIT boot as default boot on HS devices

Verification has to be done before booting any images on HS devices. So
default the boot to FIT on HS devices.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: DRA7: Make FIT boot as default boot on HS devices
Lokesh Vutla [Tue, 29 Nov 2016 06:28:01 +0000 (11:58 +0530)]
ARM: DRA7: Make FIT boot as default boot on HS devices

Verification has to be done before booting any images on HS devices. So
default the boot to FIT on HS devices.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoti_armv7_common: env: Add support for loading FIT images
Lokesh Vutla [Tue, 29 Nov 2016 06:28:00 +0000 (11:58 +0530)]
ti_armv7_common: env: Add support for loading FIT images

FIT is a new image format which is a Tree like structure and gives more
flexibility in handling of various images. Mainly used for unification of
multiple images in a single blob and provide security information for each
image.

U-Boot already has support for loading such images, so adding the environment
support to load FIT image on all TI platforms.

Reviewed-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoti_armv7_common: env: Consolidate support for loading images from mmc
Lokesh Vutla [Tue, 29 Nov 2016 06:27:59 +0000 (11:57 +0530)]
ti_armv7_common: env: Consolidate support for loading images from mmc

Support for loading images from mmc is duplicated in all TI platforms.
Add this information to DEFAULT_MMC_TI_ARGS so that it can be reused
in all TI platforms.

Reviewed-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoconfigs: am43x: hs: Modify SPL load address to fix UART boot issue
Madan Srinivas [Tue, 29 Nov 2016 06:19:15 +0000 (11:49 +0530)]
configs: am43x: hs: Modify SPL load address to fix UART boot issue

An issue in the TI secure image generation tool causes the ROM to
load the SPL at a different load address than what is specified by
CONFIG_ISW_ENTRY_ADDR while doing a peripheral boot.

This causes the SPL to fail on secure devices during peripheral
boot.

The TI secure image generation tool has been fixed so that the SPL
will always be loaded at 0x403018E0 by the ROM code for both
peripheral and memory boot modes. am43x hs defconfig file have been
updated to reflect this change.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
7 years agocmd: crosec: Move cros_ec_decode_region helper to cmd/cros_ec.c
Moritz Fischer [Thu, 3 Nov 2016 14:53:52 +0000 (08:53 -0600)]
cmd: crosec: Move cros_ec_decode_region helper to cmd/cros_ec.c

The cros_ec_decode_region() function is only used in combination
with the crosec cmds. Move the function to the correct place.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: u-boot@lists.denx.de
Acked-by: Simon Glass <sjg@chromium.org>
7 years agodrivers: usb: musb: add ti musb host driver with driver model support
Mugunthan V N [Thu, 17 Nov 2016 09:08:11 +0000 (14:38 +0530)]
drivers: usb: musb: add ti musb host driver with driver model support

Add a TI MUSB host driver with driver model support and the
driver will be bound by the MUSB wrapper driver based on the
dr_mode device tree entry.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodrivers: usb: musb: adopt musb backend driver to driver model
Mugunthan V N [Thu, 17 Nov 2016 09:08:10 +0000 (14:38 +0530)]
drivers: usb: musb: adopt musb backend driver to driver model

Currently all backend driver ops uses hard coded physical
address, so to adopt the driver to DM, add device pointer to ops
call backs so that drivers can get physical addresses from the
usb driver priv/plat data.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoam33xx: board: probe misc drivers to register musb devices
Mugunthan V N [Thu, 17 Nov 2016 09:08:09 +0000 (14:38 +0530)]
am33xx: board: probe misc drivers to register musb devices

MUSB wrapper driver is bound as MISC device and underlying usb
devices are bind to usb drivers based on dr_mode, so probing the
MISC wrapper driver to register musb devices.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodrivers: usb: musb: add ti musb misc driver for wrapper
Mugunthan V N [Thu, 17 Nov 2016 09:08:08 +0000 (14:38 +0530)]
drivers: usb: musb: add ti musb misc driver for wrapper

Add a misc driver for MUSB wrapper, so that based on dr_mode the
USB devices can bind to USB host or USB device drivers.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoam33xx: board: do not register usb devices when CONFIG_DM_USB is defined
Mugunthan V N [Thu, 17 Nov 2016 09:08:07 +0000 (14:38 +0530)]
am33xx: board: do not register usb devices when CONFIG_DM_USB is defined

Do not register usb devices when CONFIG_DM_USB is define.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoconfigs: am335x: usb: do not define CONFIG_DM_USB for spl
Mugunthan V N [Thu, 17 Nov 2016 09:08:06 +0000 (14:38 +0530)]
configs: am335x: usb: do not define CONFIG_DM_USB for spl

Since OMAP's spl doesn't support DM currently, do not define
CONFIG_DM_USB for spl build.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agortc: Add RTC chip pcf2127 support
Meng Yi [Wed, 30 Nov 2016 07:47:31 +0000 (15:47 +0800)]
rtc: Add RTC chip pcf2127 support

This driver compatible with pcf2127 and pcf2129

Signed-off-by: Meng Yi <meng.yi@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Add dev_get_addr_size_index() to retrieve addr and size
Stefan Roese [Wed, 30 Nov 2016 06:24:47 +0000 (07:24 +0100)]
dm: core: Add dev_get_addr_size_index() to retrieve addr and size

The currently available functions accessing the 'reg' property of a
device only retrieve the address. Sometimes its also necessary to
retrieve the size described by the 'reg' property. This patch adds
the new function dev_get_addr_size_index() which retrieves both,
the address and the size described by the 'reg' property.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agolibfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY
Masahiro Yamada [Sat, 26 Nov 2016 02:02:10 +0000 (11:02 +0900)]
libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY

Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option")
allows us to skip memory setup of DTB, but a problem for ARM is that
spin_table_update_dt() and psci_update_dt() are skipped as well if
CONFIG_ARCH_FIXUP_FDT is disabled.

This commit allows us to skip only fdt_fixup_memory_banks() instead
of the whole of arch_fixup_fdt().  It will be useful when we want to
use a memory node from a kernel DTB as is, but need some fixups for
Spin-Table/PSCI.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Simon Glass <sjg@chromium.org>
Fixed build error for x86:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agocmd/fdt: fix uncallable systemsetup command
Fabien Parent [Thu, 24 Nov 2016 14:02:18 +0000 (15:02 +0100)]
cmd/fdt: fix uncallable systemsetup command

The function that is processing the 'fdt' parameters is one big
if-else if. In order to be able to type command faster only the first
few letter are checked to know which block of code to execute. For
systemsetup, the block of code that was executed was always the wrong
one and ended up in a failure.

} else if (argv[1][0] == 's') {
    process "fdt set" command
} else if (strncmp(argv[1], "sys", 3) == 0) {
    process "fdt systemsetup" command.
}

When typing "fdt systemsetup", the code that was executed was the code
for "fdt set".

This commit fix this issue by moving the "else if" for systemsetup
before the else if for "fdt set". This allow us to keep compatibility
with any script that make use of "fdt s" to set node values.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Acked-by: Simon Glass <sjg@chromium.org>
7 years agodrivers: usb: gadget: ether: prepare driver for driver model migration
Mugunthan V N [Fri, 18 Nov 2016 05:38:27 +0000 (11:08 +0530)]
drivers: usb: gadget: ether: prepare driver for driver model migration

prepare driver for driver model migration

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: use net device priv to pass usb ether priv
Mugunthan V N [Fri, 18 Nov 2016 05:37:18 +0000 (11:07 +0530)]
drivers: usb: gadget: ether: use net device priv to pass usb ether priv

Use net device priv to pass usb ether priv and use it in
net device ops callback.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: consolidate global devices to single struct
Mugunthan V N [Fri, 18 Nov 2016 05:36:13 +0000 (11:06 +0530)]
drivers: usb: gadget: ether: consolidate global devices to single struct

Consolidate the net device, usb eth device and gadget device
struct to single struct and a single global variable so that the
same can be passed as priv of ethernet driver.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: adopt to usb driver model
Mugunthan V N [Fri, 18 Nov 2016 05:19:12 +0000 (10:49 +0530)]
drivers: usb: gadget: ether: adopt to usb driver model

Convert usb ether gadget to adopt usb driver model

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodrivers: usb: gadget: ether: access network_started using local variable
Mugunthan V N [Fri, 18 Nov 2016 05:19:13 +0000 (10:49 +0530)]
drivers: usb: gadget: ether: access network_started using local variable

network_started of struct eth_dev can be accessed using local
variable dev and no reason to access it with the global struct.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agodm: blk: Fix get_desc to return block device descriptor
Michal Simek [Wed, 16 Nov 2016 16:37:42 +0000 (17:37 +0100)]
dm: blk: Fix get_desc to return block device descriptor

Current get_desc() implementation is not able to succesfully
finish and return pointer to block device descriptor.

Also function always return non zero value even device is found.

The patch fills block device descriptor and return 0 if device is found.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Handle global_data moving in SPL
Simon Glass [Sun, 13 Nov 2016 21:21:58 +0000 (14:21 -0700)]
dm: core: Handle global_data moving in SPL

When CONFIG_SPL_STACK_R is enabled, and spl_init() is called before
board_init_r(), spl_relocate_stack_gd() will move global_data to a new
place in memory. This affects driver model since it uses a list for the
uclasses. Unless this is updated the list will become invalid. When
looking for a non-existent uclass, such as when adding a new one, the loop
in uclass_find() may continue forever, thus causing a hang.

Add a function to correct this rather obscure bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Rename do_build to config_only
Simon Glass [Wed, 16 Nov 2016 21:09:25 +0000 (14:09 -0700)]
buildman: Rename do_build to config_only

This variable name is needlessly confusion. Adjust it to use a 'positive'
name instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agor2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:36 +0000 (00:15 +0200)]
r2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes

This change allows to reserve enough space at the end of board SDRAM
to store two copies of U-Boot and malloc heap.

Due to selection of the CONFIG_SYS_TEXT_BASE the second code/data
copying is not avoided, first of all this may depend on a used
toolchain, secondly at this point some level of volatility is wanted
to do more platform changes and do not care about probably changed
calculated in runtime relocation offset.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: generate position independent code for all platforms
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:35 +0000 (00:15 +0200)]
sh: generate position independent code for all platforms

Finally add fpic compilation option to produce relocatable code.
Note that this requires to define CONFIG_NEEDS_MANUAL_RELOC for all
board files, also relocation support still has some limitations
(e.g. a developer should care not to overwrite the executing code or
memset() with zeroes not yet relocated data on malloc init etc.),
which may be fixed while switching to PIE.

Due to short investigation the architecture code is not ready for PIE
linking, this will require some manipulations with .dyn* sections.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: share the correct version of start.S among all cpus
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:34 +0000 (00:15 +0200)]
sh: share the correct version of start.S among all cpus

It is easy to note that SH2/SH3/SH4 start.S code is practically
the same with a minor difference for SH2 where a short data header is
present. To avoid unwanted code duplication and to automatically
convert SH2 and SH3 platforms to generic board support move fixed SH4
start.S into arch/sh/lib/start.S and share it among all platforms.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: fix start.S by calling board_init_f() after first code relocation
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:33 +0000 (00:15 +0200)]
sh4: fix start.S by calling board_init_f() after first code relocation

Like on ARM platform keep the first code relocation from a U-boot
image storage to RAM at CONFIG_SYS_TEXT_BASE, then pass execution to a
generic board_init_f() with empty GD flags. If CONFIG_SYS_TEXT_BASE is
equal to a calculated by board_init_f() relocation address there will
be no more code and data copy, however it's worth to mention that the
first copy happens even if $pc on _start is the same as
CONFIG_SYS_TEXT_BASE, on practice this works without a problem.

Also note that _sh_start is renamed back to _start to correct
gd->mon_len calculation by setup_mon_len(), the opposite rename was
done in pre-generic board commit 2024b968ee9 ("sh: Fix build in start.S").

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add shared relocate_code() function and call board_init_r()
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:32 +0000 (00:15 +0200)]
sh: add shared relocate_code() function and call board_init_r()

Commits b61e90e6fd83 ("sh: Drop the arch-specific board init") and
f41e6088eb1a ("sh: Fix build errors for generic board") left code and
data relocation done in start.S, however further actual U-boot
configuration is not started anymore. Practically SH boards with the
code relocated into the expected position by start.S still can be
booted, so the change adds this option and provides an option how to
relocate code for board_init_r() execution.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add common dram_init() function for all boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:31 +0000 (00:15 +0200)]
sh: add common dram_init() function for all boards

Generic board support assumes a different method of specifying
DRAM size on board, also it can be shared among all boards, notably
only sh7763rdp board has a custom legacy dram_init(), however
the difference is only in printing some additional information,
this feature can be removed.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: define CONFIG_DISPLAY_BOARDINFO to print board information
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:30 +0000 (00:15 +0200)]
sh: define CONFIG_DISPLAY_BOARDINFO to print board information

All SH boards define a checkboard() function which outputs basic board
information on boot, however generic board support requires to define
CONFIG_DISPLAY_BOARDINFO to do that, so define it for the boards.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: remove undefined DEBUG preprocessor token from board config files
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:29 +0000 (00:15 +0200)]
sh: remove undefined DEBUG preprocessor token from board config files

By default this undef is a noop, moreover at this point when the
platform support is broken is prevents debugging of U-boot by manual
insertion of #define DEBUG into common files, so it makes sense to
remove the option from all SH boards as a harmful one.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: add MEMORY command to a shared linker script
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:28 +0000 (00:15 +0200)]
sh: add MEMORY command to a shared linker script

At the moment in runtime all defined sections are copied into or
created in RAM, specify this explicitly to assert potential out of RAM
placements of the sections.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: define entry point and reloc_dst inside a linker script
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:27 +0000 (00:15 +0200)]
sh: define entry point and reloc_dst inside a linker script

No functional change, concentrate linker script commands in one
place for convenience. Entry point is set to CONFIG_SYS_TEXT_BASE by
default on build, so this option can be omitted from being added to
the linker script.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: place board lowlevel_init code in the beginning of .text
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:26 +0000 (00:15 +0200)]
sh: place board lowlevel_init code in the beginning of .text

Reference lowlevel_init of all supported SH2A/SH3/SH4/SH4A boards
from a shared linker script, the lowlevel_init function will be called
by a relative address.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: use single u-boot linker script for all boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:25 +0000 (00:15 +0200)]
sh4: use single u-boot linker script for all boards

Three supported SH4/SH4A boards with the bootloader image stored on
SPI flash have own flavour of a linker script, in turn they are equal
among each other. The only difference is that the text from
lowlevel_init.o is placed right after start.o, which makes sense.

Note that .bss section is not marked as NOLOAD, because for about
10 years this is a default option of a GNU linker, either the
attribute is found or not the resulting image file is the same.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocommon: sh: add necessary define bits to board_f
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:24 +0000 (00:15 +0200)]
common: sh: add necessary define bits to board_f

Since a platform conversion to generic board support has not been
accomplished some architecture specific bits are missing from board_f
init sequence, the change adds a number of basic expected callbacks
into early init sequence.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agor2dplus: select rtl8139 driver in defconfig
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:23 +0000 (00:15 +0200)]
r2dplus: select rtl8139 driver in defconfig

CONFIG_RTL8139 was moved to a board defconfig by a commit 86e9dc86b1a2
("net: Move CONFIG_RTL8139 to Kconfig"), however it was done
incorrectly due to a missing CONFIG_NETDEVICES selection, thus
virtually it was just a removal of the driver compilation.

As an unlucky consequence the option was completely removed by a purge
commit adad96e60d0e ("configs: Re-sync HUSH options"), restore the
driver inclusion back.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agor2dplus: use P1 area space for text base and PCI system memory
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:22 +0000 (00:15 +0200)]
r2dplus: use P1 area space for text base and PCI system memory

While both options are acceptable use P1 area physical addresses
instead of external memory space of text base and PCI system memory
for unification purposes, all other supported superh boards have the
same selection.

This allows to easily ensure that CONFIG_SYS_TEXT_BASE is located
within available DRAM.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: remove __io config options from r2dplus and r7780mp boards
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:21 +0000 (00:15 +0200)]
sh4: remove __io config options from r2dplus and r7780mp boards

Defined __io is no-op for the SH architecture and it can be removed
from board files without any functional change.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agopci: sh7751: map PCI memory space into SDRAM
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:20 +0000 (00:15 +0200)]
pci: sh7751: map PCI memory space into SDRAM

For ease of use and accounting a condition that on SH4
pci_phys_to_bus() and pci_bus_to_phys() are one in one mappings due to
unimplemented __iomem() conversion, this change fixes access to SDRAM
memory by PCI devices.

This change also generalizes PCI system memory configuration, which is
taken from board specific defines rather than hardcoded in the PCI
host driver.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agopci: sh7751: fix up PCI I/O space address
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:19 +0000 (00:15 +0200)]
pci: sh7751: fix up PCI I/O space address

The change actually maps PCI I/O window to the same address on PCI bus
as it is stated by a comment, before the change transfers to the PCI I/O
space are failed due to misconfiguration of the most significant 14 bits
of the PCI address in PCIIOBR (note that it is set to 0x0).

Most probably the problem remained unnoticed, because communcation
to all tested PCI devices is done over PCI memory space only.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh4: cache: move exported cache manipulation functions into cache.c
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:18 +0000 (00:15 +0200)]
sh4: cache: move exported cache manipulation functions into cache.c

No functional change, moving cache manipulation functions into cache.c
allows to collect all of them in a single location and as a pleasant
side effect cache_control() function can be unexported now.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh: cache: don't modify CCR from P1 area
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:17 +0000 (00:15 +0200)]
sh: cache: don't modify CCR from P1 area

cache_wback_all() is a local function and it is called from
cache_control() only, which is in turn jumps to P2 area.

The change fixes an issue when cache_wback_all() returns from P2 to
P1, however cache_control() continues to manipulate with CCR
register, according to the User's Manual this is restricted.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agosh: cache use jump_to_P2() and back_to_P1() from asm/system.h
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:16 +0000 (00:15 +0200)]
sh: cache use jump_to_P2() and back_to_P1() from asm/system.h

Both jump_to_P2() and back_to_P1() functions are found in asm/system.h
header file and functionally they are the same, don't redefine them.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh3: remove unused cache.c file from being built
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:15 +0000 (00:15 +0200)]
sh3: remove unused cache.c file from being built

The change is similar to commit 994b56616bae ("sh: delete an unused
source file") for SH2, however here the removed cache.c file was
built and included into an image as a dead code.

If it is needed in future the contents can be reused from a similar
arch/sh/cpu/sh4/cache.c file, which is in turn will be moved to
a shared among all core flavours location at arch/sh/lib/cache.c.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: cache: correct flush_cache() to writeback and invalidate
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:14 +0000 (00:15 +0200)]
sh4: cache: correct flush_cache() to writeback and invalidate

In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, instead of doing cache invalidation only with
the wrapped 'ocbi' instruction pin flush_cache() to cache invalidation
with memory write-back done by 'ocbp'.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosh4: cache: correct dcache flush to invalidate with write-back
Vladimir Zapolskiy [Sun, 27 Nov 2016 22:15:13 +0000 (00:15 +0200)]
sh4: cache: correct dcache flush to invalidate with write-back

In common usecases flush_cache() assumes both cache invalidation and
write-back to memory, thus in flush_dcache_range() implementation
change SH4 cache write-back only instruction 'ocbwb' with cache purge
instruction 'ocbp', according to the User's Manual there should be no
performance penalty for that.

Note that under circumstances only cache invalidation is expected from
flush_cache() call, in these occasional cases the current version of
flush_cache() works, which is a wrapper over invalidate_dcache_range()
at the moment, this will be fixed in the following change.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
7 years agocompiler.h: use u-boot endian macros on OpenBSD
Jonathan Gray [Sat, 26 Nov 2016 04:18:00 +0000 (15:18 +1100)]
compiler.h: use u-boot endian macros on OpenBSD

When building u-boot on sparc64 and powerpc hosts it became clear that
u-boot expects endian conversion defines to be macros:

lib/crc32.c:87: error: braced-group within expression allowed only inside a function

For OpenBSD switch from using system definitions equivalent to the u-boot ones
and define glibc __BYTE_ORDER __BIG_ENDIAN __LITTLE_ENDIAN names, as at least
some parts of the non-cross build assumes those names are present (ie crc32.c).

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
7 years agoARM: am57xx_evm: enable DFU support
Sekhar Nori [Fri, 25 Nov 2016 08:55:55 +0000 (14:25 +0530)]
ARM: am57xx_evm: enable DFU support

AM57xx GP EVM has USB2 port of the SoC exposed as
USB client port.

It is useful to be able to use this port for USB
DFU downloads.

Enable USB DFU support. Tested on AM57x GP EVM Rev
A3 using DFU to download to connected SD card.

configs for HS version of the AM57x EVM are
included in the patch but not really tested.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoARM: ti: consolidate dfu environment variables
Sekhar Nori [Fri, 25 Nov 2016 08:55:54 +0000 (14:25 +0530)]
ARM: ti: consolidate dfu environment variables

Introduce include/environment/ti/dfu.h that
consolidates environment variable definitions
for various TI boards that support DFU today.

Tested on AM335x EVM, AM437x SK EVM and DRA74x
EVM by using DFU to write to SD card.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agobuildman: Clean up odd characters on the terminal
Simon Glass [Tue, 15 Nov 2016 22:32:59 +0000 (15:32 -0700)]
buildman: Clean up odd characters on the terminal

At present buildman leaves behind a few characters during its progress
updates, which looks odd. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Squash useless output from -K
Simon Glass [Sun, 13 Nov 2016 21:25:53 +0000 (14:25 -0700)]
buildman: Squash useless output from -K

When using #define CONFIG_SOME_OPTION, the value it set to '1'. When using
defconfig (i.e. CONFIG_SOME_OPTION=y) the value is set to 'y'. This results
in differences showing up with -K. These differences are seldom useful.

Adjust buildman to suppress these differences by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Add documentation for CONFIG checking
Simon Glass [Sun, 13 Nov 2016 21:25:52 +0000 (14:25 -0700)]
buildman: Add documentation for CONFIG checking

The -K option is not mentioned in the README at present. Add some notes
to describe how this is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agobuildman: Add an option to just create the config
Simon Glass [Sun, 13 Nov 2016 21:25:51 +0000 (14:25 -0700)]
buildman: Add an option to just create the config

Normally buildman does a full build of a board. This includes creating the
u-boot.cfg file which contains all the configuration options. Buildman uses
this file with the -K option, to show differences in effective configuration
for each commit.

Doing a full build of U-Boot just to create the u-boot.cfg file is wasteful.
Add a -D option which causes buildman to only create the configuration. This
is enough to support use of -K and can be done much more quickly (typically
5-10 times faster).

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoMakefile: Add a target to create the .cfg files
Simon Glass [Sun, 13 Nov 2016 21:25:50 +0000 (14:25 -0700)]
Makefile: Add a target to create the .cfg files

A common requirement when converting CONFIG options to Kconfig is to check
that the effective configuration has not changed due to the conversion. Add
a target which creates this configuration (in the form of u-boot.cfg) but
does not build U-Boot. This speeds up the checking.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agosandboxfs: Fix resource leak
Tom Rini [Tue, 18 Oct 2016 01:09:32 +0000 (21:09 -0400)]
sandboxfs: Fix resource leak

Now that we free resources in sandbox_fs_ls Coverity is letting us know
that in some cases we might leak.  So in case of error we should still
let os_dirent_free free anything that was allocated.

Fixes: 86167089b71c ("sandbox/fs: Free memory allocated by os_dirent_ls")
Reported-by: Coverity (CID: 153450)
Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agotpm: tpm_tis_lpc: Add support for AT97SC3204
George McCollister [Mon, 17 Oct 2016 14:24:32 +0000 (09:24 -0500)]
tpm: tpm_tis_lpc: Add support for AT97SC3204

The Atmel AT97SC3204 is also TIS compliant.
Modify the tpm_tis_lpc driver to check for the vid/did used by the
Atmel AT97SC3204 and report an appropriate description.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocmd/tpm_test: Fix misleading code indentation
Stefan Brüns [Sun, 16 Oct 2016 15:13:55 +0000 (17:13 +0200)]
cmd/tpm_test: Fix misleading code indentation

GCC 6.2 reasonably complains about the current code:

../cmd/tpm_test.c: In function ‘do_tpmtest’:
../cmd/tpm_test.c:540:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   for (i = 0; i < argc; i++)
   ^~~
../cmd/tpm_test.c:542:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
    printf("\n------\n");
    ^~~~~~

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Updated to remove C99 variable decl:
Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agocmd: scsi: Make private functions static
Michal Simek [Wed, 30 Nov 2016 11:18:36 +0000 (12:18 +0100)]
cmd: scsi: Make private functions static

Two functions should be static because they are not exported to any
other file.
Warnings were reported by sparse C=1.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Separate SCSI private block description initialization
Michal Simek [Wed, 30 Nov 2016 11:50:58 +0000 (12:50 +0100)]
scsi: Separate SCSI private block description initialization

When blk_create_device() is called some parameters in blk_desc are
automatically filled. Separate SCSI private initialization and SCSI full
block device initialization not to rewrite already prepared data.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Change scsi_scan() to be able to return value
Michal Simek [Wed, 30 Nov 2016 11:12:31 +0000 (12:12 +0100)]
scsi: Change scsi_scan() to be able to return value

With DM_SCSI this function will return more than one return value to
cover errors.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Make private functions static
Michal Simek [Wed, 30 Nov 2016 10:53:43 +0000 (11:53 +0100)]
scsi: Make private functions static

Several functions should be static because they are not exported to any
other file.
Warnings were reported by sparse C=1.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Remove completely unused functions
Michal Simek [Wed, 30 Nov 2016 10:54:52 +0000 (11:54 +0100)]
scsi: Remove completely unused functions

These functions are not called for any location.
This patch removes them scsi_trim_trail(), scsi_get_disk_count()
and scsi_setup_read6().

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Simplify scsi_read/scsi_write()
Michal Simek [Fri, 18 Nov 2016 15:22:42 +0000 (16:22 +0100)]
scsi: Simplify scsi_read/scsi_write()

There is no reason to directly point to static allocated array
when we have proper block_dev pointer available via parameter
in !CONFIG_BLK. For CONFIG_BLK this is read directly from uclass
platdata.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Move pccb buffer initalization directly to scsi_detect_dev
Michal Simek [Fri, 18 Nov 2016 15:14:24 +0000 (16:14 +0100)]
scsi: Move pccb buffer initalization directly to scsi_detect_dev

pccb is pointer to temporary buffer which is used only for sending
command. Make it local as is done in scsi_read/scsi_write.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Take lun from device block description
Michal Simek [Fri, 18 Nov 2016 14:52:51 +0000 (15:52 +0100)]
scsi: Take lun from device block description

Prepare LUN(Logical unit number) directly in block description structure
and reuse it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Extract device detection algorithm
Michal Simek [Fri, 18 Nov 2016 14:42:13 +0000 (15:42 +0100)]
scsi: Extract device detection algorithm

The patch enables running detection algorithm on block device
description structure.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoscsi: Extract block device initialization
Michal Simek [Fri, 18 Nov 2016 14:27:00 +0000 (15:27 +0100)]
scsi: Extract block device initialization

Extract block device initialization to specific function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocommon: miiphyutil: Work and report phy address in hex in mdio cmd
Michal Simek [Wed, 16 Nov 2016 07:41:01 +0000 (08:41 +0100)]
common: miiphyutil: Work and report phy address in hex in mdio cmd

It is confusing that mdio commands work and report phy id as
decimal value when mii is working with hex values.

For example:
ZynqMP> mdio list
gem:
21 - TI DP83867 <--> ethernet@ff0e0000
ZynqMP> mdio read ethernet@ff0e0000 0
Reading from bus gem
PHY at address 21:
0 - 0x1140
ZynqMP> mii dump 21 0
Incorrect PHY address. Range should be 0-31
...
ZynqMP> mii dump 15
0.     (1140)                 -- PHY control register --
  (8000:0000) 0.15    =     0    reset

U-Boot normally takes hex values that's why this patch is changing mdio
command to handle hex instead of changing mii command to handle decimal
values.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
7 years agoARM: zynq: Enable SD1 and qspi for picozed board
Siva Durga Prasad Paladugu [Fri, 7 Oct 2016 05:41:52 +0000 (11:11 +0530)]
ARM: zynq: Enable SD1 and qspi for picozed board

Enable SD1 and qspi for picozed board.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>