]> git.sur5r.net Git - u-boot/log
u-boot
6 years agoARM: uniphier: increase the firmware size in update command environment
Masahiro Yamada [Fri, 2 Feb 2018 05:16:36 +0000 (14:16 +0900)]
ARM: uniphier: increase the firmware size in update command environment

If a bigger EL32 is used, fip.bin can be larger than the currently
assumed boot firmware size.  Adjust the update commands.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years ago.travis.yml: Add lzop
Tom Rini [Wed, 14 Mar 2018 18:02:49 +0000 (14:02 -0400)]
.travis.yml: Add lzop

We need lzop now in order to make some FIT images that use LZO
compression on the contents.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoMerge git://git.denx.de/u-boot-sunxi
Tom Rini [Wed, 14 Mar 2018 17:27:14 +0000 (13:27 -0400)]
Merge git://git.denx.de/u-boot-sunxi

6 years agosunxi: move CONFIG_SYS_TEXT_BASE out of defconfigs
Andre Przywara [Sat, 3 Mar 2018 23:49:02 +0000 (23:49 +0000)]
sunxi: move CONFIG_SYS_TEXT_BASE out of defconfigs

Commit 278b90ce786f ("configs: Migrate CONFIG_SYS_TEXT_BASE") made
CONFIG_SYS_TEXT_BASE a proper Kconfig variable, with the consequence
of moving the common definition shared by almost every sunxi board
into 123 individual defconfig files. But the U-Boot start address
for Allwinner boards is a platform decision which has been around for
ages, so defining it in each *board* config file seems a bit over the
top.
Define the standard values (160MB into DRAM for most SoCs, with two
SoC exceptions) if ARCH_SUNXI is selected, and delete the lines from
the individual defconfigs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agocommon/memsize.c: restore content of the base address
Patrick Delaunay [Thu, 25 Jan 2018 17:07:46 +0000 (18:07 +0100)]
common/memsize.c: restore content of the base address

For the last return of function get_ram_size(),
when size=maxsize, restore the base address (*base)
content.

Add comment for the remaining case to avoid regression:
this case is already correctly handled.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agocommon/memsize.c: prepare get_ram_size update
Patrick Delaunay [Thu, 25 Jan 2018 17:07:45 +0000 (18:07 +0100)]
common/memsize.c: prepare get_ram_size update

Save the content of the base address in a new variable
in stack (save_base) to prepare restore this content.

This patch don't modified code behavior and stack usage.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
6 years agoconfigs: am335x_boneblack: Enable fastboot flash capability
Sam Protsenko [Tue, 27 Feb 2018 21:45:04 +0000 (23:45 +0200)]
configs: am335x_boneblack: Enable fastboot flash capability

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoomap: Fix AM335x build with enabled fastboot flash
Sam Protsenko [Tue, 27 Feb 2018 21:45:03 +0000 (23:45 +0200)]
omap: Fix AM335x build with enabled fastboot flash

When enabling CONFIG_FASTBOOT_FLASH in am335x_boneblack_defconfig, next
build errors and warnings occur:

    arch/arm/mach-omap2/utils.c: In function ‘omap_set_fastboot_cpu’:
    arch/arm/mach-omap2/utils.c:26:16: warning: implicit declaration of
              function ‘omap_revision’ [-Wimplicit-function-declaration]
              u32 cpu_rev = omap_revision();
                            ^~~~~~~~~~~~~
    arch/arm/mach-omap2/utils.c:29:7: error: ‘DRA762_ES1_0’ undeclared
              (first use in this function)

Include asm/omap_common.h explicitly to avoid those.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoARM: dts: dra7x: Make pinctrl and IOdelays for MMC2 available in SPL
Jean-Jacques Hiblot [Tue, 27 Feb 2018 16:05:50 +0000 (17:05 +0100)]
ARM: dts: dra7x: Make pinctrl and IOdelays for MMC2 available in SPL

The SPL can't use high speed MMC modes if the associated pinctrl and
IOdelays are described in the DTS.
Make them available in SPL by tagging the nodes with 'u-boot,dm-spl;'

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agoconfigs: dra7xx_evm: Enable support for the HS200 mmc mode in the SPL
Jean-Jacques Hiblot [Tue, 27 Feb 2018 16:05:49 +0000 (17:05 +0100)]
configs: dra7xx_evm: Enable support for the HS200 mmc mode in the SPL

Beside enabling the support for HS200 in mmc core, enabling the HS200
support in the SPL requires multi-dtb support in the SPL because pinctrl
and IOdelays vary across SOCs.

Also we need to make sure that the pinctrl properties arenot removed from
the dts by setting CONFIG_OF_SPL_REMOVE_PROPS to remove only clocks and
interrupts properties.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agoARM: dts: dra76-evm: shift to using common IOdelay data
Jean-Jacques Hiblot [Tue, 27 Feb 2018 16:05:48 +0000 (17:05 +0100)]
ARM: dts: dra76-evm: shift to using common IOdelay data

Now that we have a device-tree include file with common
MMC/SD IOdelay data for DRA76x SoC, shift the EVM device-tree
file to using that.
Also fix the name of the IO voltage regulator for mmc1.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agoARM: dts: dra76x: create a common file with MMC/SD IOdelay data
Jean-Jacques Hiblot [Tue, 27 Feb 2018 16:05:47 +0000 (17:05 +0100)]
ARM: dts: dra76x: create a common file with MMC/SD IOdelay data

Add a common device-tree include file with MMC/SD IOdelay data
for DRA76x SoC based on the linux DTSI file.

In the most common case, IOdelay data available in datamanual
can directly be used. This file caters to that common case.

Data is based on DRA76x datamanual, SPRS993A, revised July 2017.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
6 years agoARM: omap3: evm: Sync with omap3_beagle configuration
Derald D. Woods [Mon, 26 Feb 2018 23:52:59 +0000 (17:52 -0600)]
ARM: omap3: evm: Sync with omap3_beagle configuration

This commit does the following for OMAP3 EVM:

- Track omap3_beagle changes where possible
- Remove CONFIG_SYS_MPUCLK and CONFIG_MTD which are not needed for the
  default board configuration to work.
- Remove CONFIG_SPL_SYS_MALLOC_SIMPLE and CONFIG_SYS_MALLOC_F_LEN from
  default config. CONFIG_SYS_MALLOC_F_LEN=0x400 is set by configuration
  automatically. [allows board to boot with SERIAL_SEARCH_ALL=y]
- Use updated NAND layout:

device nand0 <omap2-nand.0>, # parts = 6

#: name size offset
-------------------------------------------------
0: spl 0x00080000(512k) 0x00000000
1: u-boot 0x001e0000(1920k) 0x00080000
2: u-boot-env 0x00020000(128k) 0x00260000
3: dtb 0x00020000(128k) 0x00280000
4: kernel 0x00600000(6m) 0x002a0000
5: rootfs 0x0f760000(-) 0x008a0000
-------------------------------------------------

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agoARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout
Derald D. Woods [Mon, 26 Feb 2018 23:52:58 +0000 (17:52 -0600)]
ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout

This commit does the following for BeagleBoard{-xM}:

- Enable DM_SERIAL which also enables SPL_DM_SERIAL
- Misc. config updates in support of DM_SERIAL
- Use updated NAND layout (BeagleBoard):

device nand0 <omap2-nand.0>, # parts = 6

#: name size offset
-------------------------------------------------
0: spl 0x00080000(512k) 0x00000000
1: u-boot 0x001e0000(1920k) 0x00080000
2: u-boot-env 0x00020000(128k) 0x00260000
3: dtb 0x00020000(128k) 0x00280000
4: kernel 0x00600000(6m) 0x002a0000
5: rootfs 0x0f760000(-) 0x008a0000
-------------------------------------------------

- Use MMC and UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC and NAND support defined in omap3_beagle.h

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

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

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

The board's 'bootcmd' can also be overridden with:

CONFIG_BOOTCOMMAND="run findfdt; run mmcboot"
CONFIG_BOOTCOMMAND="run findfdt; run nandboot"
CONFIG_BOOTCOMMAND="run findfdt; run ramboot"

or

CONFIG_BOOTCOMMAND="run findfdt; run somethingelse"

The use of 'run findfdt' is required.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agoARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file
Derald D. Woods [Mon, 26 Feb 2018 23:52:57 +0000 (17:52 -0600)]
ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file

BeagleBoard 'xM' does not really have NAND. CONFIG_MTDIDS_DEFAULT and
CONFIG_MTDPARTS_DEFAULT can/should be empty for 'xM'. This commit sets
the defined values if they exist.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agoenv: ti: boot: Get rid of magic numbers
Sam Protsenko [Mon, 26 Feb 2018 21:18:01 +0000 (23:18 +0200)]
env: ti: boot: Get rid of magic numbers

Get the start address and the size of partitions using partition names
rather than partition numbers. This way we can change the partition
table further without changing the boot code.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
6 years agocmd: part: Extract common code to separate function
Sam Protsenko [Mon, 26 Feb 2018 21:18:00 +0000 (23:18 +0200)]
cmd: part: Extract common code to separate function

Refactor the code for "part start" and "part size" commands to avoid
code duplication.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
6 years agocmd: part: Allow passing partition name to start and size
Sam Protsenko [Mon, 26 Feb 2018 21:17:59 +0000 (23:17 +0200)]
cmd: part: Allow passing partition name to start and size

Allow passing the partition name to "part start" and "part size"
commands, so we can avoid magic numbers in the environment.

Consider one real use-case: in include/environment/ti/boot.h we have
commands like these:

    setenv boot_part 9
    part start mmc ${mmcdev} ${boot_part} boot_start
    part size mmc ${mmcdev} ${boot_part} boot_size
    mmc read ${loadaddr} ${boot_start} ${boot_size}

Now suppose that we have changed the partition table and boot_part now
is 10. We will need to fix commands above. And anyone who relies on
these boot commands, will need to change them accordingly, too (this was
an actual case in our lab while testing Linux boot on Android
environment).

By providing the option to pass partition name instead, we fix mentioned
issue, by eliminating the necessity to use magic numbers.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
6 years agotest/py: highlight warnings in the log summary
Stephen Warren [Tue, 20 Feb 2018 19:51:55 +0000 (12:51 -0700)]
test/py: highlight warnings in the log summary

Currently, if a test emits a warning message but otherwise passes, there's
no indication of this in the log summary, which can lead to warnings being
missed. Enhance the test logic to explicitly mention warnings in otherwise
passing tests, and not to collapse the log sections for tests with
warnings, so that they're more easily seen when scanning the log.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
6 years agotest/py: add MMC/SD block read test
Stephen Warren [Tue, 20 Feb 2018 19:51:54 +0000 (12:51 -0700)]
test/py: add MMC/SD block read test

Add a standalone MMC block read test. This allows direct testing of MMC
access rather than relying on doing so as a side-effect of e.g. DFU or
UMS testing, which may not be enabled on all platforms.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
6 years agodisk: part: use common api to lookup part driver
Kever Yang [Sat, 10 Feb 2018 09:55:38 +0000 (17:55 +0800)]
disk: part: use common api to lookup part driver

Do not need to scan disk every time when we get part info
by name.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
[trini: Fix build in !CONFIG_HAVE_BLOCK_DEVICE case]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agodisk: part: scan the disk if the part_type is unknown
Kever Yang [Sat, 10 Feb 2018 09:55:37 +0000 (17:55 +0800)]
disk: part: scan the disk if the part_type is unknown

If a DUT do not have partition table, and we write one with 'gpt write'
cmd, we should able to list the partition with 'part list' cmd.
It's reasonable to scan the disk again if the initial part_type is
unknown in case we just write a new one into disk.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
6 years agomach-stm32: Use default memory map as background region
Patrice Chotard [Wed, 28 Feb 2018 16:15:00 +0000 (17:15 +0100)]
mach-stm32: Use default memory map as background region

On linux kernel side, on STM32F7 and STM32H7 SoCs, DMA requires
uncachable regions. These regions are defined in DT.
Since kernel linux v4.15, on ARMv7-M Cortex, kernel is able
to configure MPU regions depending on DT settings.

As kernel is able to configure MPU, this allows to remove
MPU region settings in bootloader.

On Cortex M processors, MPU allows to use a default memory map.
(see B3.5.4 MPU Control Register, MPU_CTRL in
https://developer.arm.com/products/architecture/m-profile/docs/ddi0403/latest/armv7-m-architecture-reference-manual)
Use the default memory map as background region for all STM32 SoCs
family with an additional MPU region corresponding to the SDRAM area.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoconfigs: stm32: Enable DOS_PARTITION for STM32F4/F7 boards
Patrice Chotard [Wed, 28 Feb 2018 15:49:55 +0000 (16:49 +0100)]
configs: stm32: Enable DOS_PARTITION for STM32F4/F7 boards

Enable DOS_PARTITION for boards STM32F429-eval, STM32F469-disco
and STM32F746-disco.
This allows to read FAT partition on mmc.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: Add support for stm32f746-evaluation board support
Patrice Chotard [Fri, 16 Feb 2018 12:27:03 +0000 (13:27 +0100)]
ARM: dts: Add support for stm32f746-evaluation board support

This board offers:
  _ STM32F746NGH6 microcontroller with 1 Mbyte Flash and 320+4 Kbytes RAM
  _ Six 5 V power supply options:
        Power jack
        ST-LINK/V2-1 USB connector
        User USB HS connector
        User USB FS1 connector
        User USB FS2 connector
        Daughterboard
  _ SAI Audio DAC, stereo audio jack which supports headset with microphone
  _ Stereo digital microphone, audio jack connector used to connect
    external speakers
  _ 2 Gbytes (or more) SDMMC interface microSD card
  _ RF-EEPROM on I2C compatible serial interface
  _ RS-232 communication
  _ IrDA transceiver
  _ JTAG/SWD and ETM trace debug support, ST-LINK/V2-1 embedded
  _ IEEE-802.3-2002 compliant Ethernet connector
  _ Camera module
  _ 8Mx32 bit SDRAM, 1Mx16 bit SRAM & 8Mx16 bit Nor Flash
  _ 512 Mbits QuadSPI Nor Flash
  _ 5.7 inch 640x480 pixel TFT color LCD with capacitive touch panel
  _ Joystick with 4-direction control and selector
  _ Reset, WakeUp/Tamper or key button
  _ 4 color user LEDs
  _ Extension connectors & memory connectors for daughterboard or
    wrapping board
  _ USB OTG HS and FS with Micro-AB connectors
  _ RTC with backup battery
  _ CAN 2.0A/B compliant connection
  _ Potentiometer
  _ Motor control connector

More detailed information are available here :
http://www.st.com/en/evaluation-tools/stm32746g-eval.html

To compile stm32f746-eval board, use same defconfig as
stm32f746-disco, the only difference is to pass
"DEVICE_TREE=stm32746g-eval".

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Vikas Manocha <vikas.manocha@st.com>
6 years agoarch-stm32: Clean arch-stm32f7/syscfg.h
Patrice Chotard [Fri, 9 Feb 2018 12:09:57 +0000 (13:09 +0100)]
arch-stm32: Clean arch-stm32f7/syscfg.h

Remove all unused defines

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoarch-stm32: Remove stm32_periph.h
Patrice Chotard [Fri, 9 Feb 2018 12:09:56 +0000 (13:09 +0100)]
arch-stm32: Remove stm32_periph.h

Remove arch/arm/include/asm/arch-stm32fx/stm32_periph.h
as all defines or enums are no more used.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoarch-stm32: Factorize stm32.h for STM32F4 and F7
Patrice Chotard [Fri, 9 Feb 2018 12:09:55 +0000 (13:09 +0100)]
arch-stm32: Factorize stm32.h for STM32F4 and F7

For STM32F4 and F7 SoCx family, a specific stm32.h file exists.
Some common defines are duplicated or even unused in each of
these stm32.h.

Factorize all common definition in arch/arm/include/asm/stm32f.h and keep
specific definitions in each arch/arm/include/asm/arch-stm32fx/stm32.h.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoarch-stm32: Move gpio.h for STM32 SoCs in include/asm/
Patrice Chotard [Fri, 9 Feb 2018 12:09:54 +0000 (13:09 +0100)]
arch-stm32: Move gpio.h for STM32 SoCs in include/asm/

Instead to have 3 identical gpio.h for all STM32 SoCs,
migrate them in one file in include/asm.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoarch-stm32f4: Remove fmc.h file
Patrice Chotard [Fri, 9 Feb 2018 12:09:53 +0000 (13:09 +0100)]
arch-stm32f4: Remove fmc.h file

fmc.h file is no more used, remove it.
All FMC related defines are declared in drivers/ram/stm32_sdram.c
which is common to all STM32 SoCs.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32: limit sdio frequency to 14Mhz for stm32f429i-eval
Patrice Chotard [Thu, 8 Feb 2018 16:25:19 +0000 (17:25 +0100)]
ARM: dts: stm32: limit sdio frequency to 14Mhz for stm32f429i-eval

This avoids the following errors while reading on mmc:
  Read data bytes CRC error: 0x2
  switch to partitions #0, OK
  mmc0 is current device
  Read data bytes CRC error: 0x82002
  ** Unrecognized filesystem type **

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Add DSI clock support
Patrice Chotard [Thu, 8 Feb 2018 16:20:51 +0000 (17:20 +0100)]
clk: clk_stm32f: Add DSI clock support

DSI clock is available on STM32F769-disco and
STM32F469-disco board.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Add set_rate for LTDC clock
Patrice Chotard [Thu, 8 Feb 2018 16:20:50 +0000 (17:20 +0100)]
clk: clk_stm32f: Add set_rate for LTDC clock

Implement set_rate() for LTDC clock only, set_rate for other
clocks will be added if needed. This is needed by future LTDC driver
improvements.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Configure SAI PLL to generate LTDC pixel clock
Patrice Chotard [Thu, 8 Feb 2018 16:20:49 +0000 (17:20 +0100)]
clk: clk_stm32f: Configure SAI PLL to generate LTDC pixel clock

Configure SAI PLL configuration to generate LTDC pixel clock on
the PLLSAIR output.

PLLSAI is enabled only if CONFIG_VIDEO_STM32 flag is set.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Rework SDMMC stm32_clk_get_rate() part
Patrice Chotard [Thu, 8 Feb 2018 16:20:48 +0000 (17:20 +0100)]
clk: clk_stm32f: Rework SDMMC stm32_clk_get_rate() part

Rework the way SDMMC clock get rate is done in a more
generic way :

_ Add stm32_clk_get_pllsai_rate() which give the PLLSAI
  indicated output rate.

_ Add stm32_clk_get_pllsai_vco_rate() which give the VCO
  internal rate.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: No more need of 48Mhz from PLL_SAI
Patrice Chotard [Thu, 8 Feb 2018 16:20:47 +0000 (17:20 +0100)]
clk: clk_stm32f: No more need of 48Mhz from PLL_SAI

Initially, 48Mhz for SDIO clock was generated from SAI pll for
STM32F469 and STM32F746 SoCs, but this solution was not suitable
for STM32F429 SoCs.

A generic solution is to used the PLL_Q output as 48Mhz clock
for all STM32F SOCs family.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Fix RCC_PLLSAICFGR mask defines
Patrice Chotard [Thu, 8 Feb 2018 16:20:46 +0000 (17:20 +0100)]
clk: clk_stm32f: Fix RCC_PLLSAICFGR mask defines

Use the correct name for RCC_PLLSAICFGR_PLLSAIx_MASK masks.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Fix stm32_clk_get_rate()
Patrice Chotard [Thu, 8 Feb 2018 16:20:45 +0000 (17:20 +0100)]
clk: clk_stm32f: Fix stm32_clk_get_rate()

Wrong parameter was passed to stm32_clk_pll48clk_rate().
sysclk (PLL_p output value) was passed instead of VCO value.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agommc: stm32: sdmmc2: add support for st, pin-ckinsdmmc_ckin
Patrick Delaunay [Wed, 7 Feb 2018 16:19:59 +0000 (17:19 +0100)]
mmc: stm32: sdmmc2: add support for st, pin-ckinsdmmc_ckin

This patch adds "st,pin-ckin" support to activate sdmmc_ckin feature.
When using an external driver (a voltage switch transceiver),
it's advised to select SDMMC_CKIN feedback clock input to sample
the received data.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agommc: stm32: sdmmc2: add hardware flow control support
Patrick Delaunay [Wed, 7 Feb 2018 16:19:58 +0000 (17:19 +0100)]
mmc: stm32: sdmmc2: add hardware flow control support

The hardware flow control functionality is used to avoid
FIFO underrun (TX mode) and overrun (RX mode) errors.
The behavior is to stop SDMMC_CK during data transfer and
freeze the SDMMC state machines.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoboard: stm32: switch to DM STM32 timer
Patrice Chotard [Wed, 7 Feb 2018 09:44:50 +0000 (10:44 +0100)]
board: stm32: switch to DM STM32 timer

Use available DM stm32_timer driver instead of dedicated
mach-stm32/stm32fx/timer.c.

Remove all defines or files previously used for timer usage in
arch/arm/include/asm/arch-stm32fx and in arch/arm/mach-stm32/stm32fx

Enable DM STM32_TIMER for STM32F4/F7 and H7.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32: Add timer support for STM32F7
Patrice Chotard [Wed, 7 Feb 2018 09:44:49 +0000 (10:44 +0100)]
ARM: dts: stm32: Add timer support for STM32F7

Add missing timer node to enable timer5 for STM32F7 SoCs family

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32h7: Fix prescaler for Domain 3
Patrice Chotard [Wed, 7 Feb 2018 09:44:48 +0000 (10:44 +0100)]
clk: clk_stm32h7: Fix prescaler for Domain 3

d1cfgr register was used to calculate the domain 3
prescaler value instead of d3cfgr.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32h7: Fix stm32_clk_get_rate() for timer
Patrice Chotard [Wed, 7 Feb 2018 09:44:47 +0000 (10:44 +0100)]
clk: clk_stm32h7: Fix stm32_clk_get_rate() for timer

For timer clock, an additional prescaler is used which
was not taken into account previously.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Fix stm32_clk_get_rate() for timer
Patrice Chotard [Wed, 7 Feb 2018 09:44:46 +0000 (10:44 +0100)]
clk: clk_stm32f: Fix stm32_clk_get_rate() for timer

For timer clock, an additionnal prescaler is used which was
not taken into account previously.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agotimer: stm32: Add timer support for STM32 SoCs family
Patrice Chotard [Wed, 7 Feb 2018 09:44:45 +0000 (10:44 +0100)]
timer: stm32: Add timer support for STM32 SoCs family

This timer driver is using GPT Timer (General Purpose Timer)
available on all STM32 SOCs family.
This driver can be used on STM32F4/F7 and H7 SoCs family

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoMerge git://git.denx.de/u-boot-rockchip
Tom Rini [Tue, 13 Mar 2018 23:00:29 +0000 (19:00 -0400)]
Merge git://git.denx.de/u-boot-rockchip

6 years agoMerge branch 'next' of git://git.denx.de/u-boot-video next
Tom Rini [Tue, 13 Mar 2018 21:32:47 +0000 (17:32 -0400)]
Merge branch 'next' of git://git.denx.de/u-boot-video

6 years agork3288: vyasa: Add eMMC boot support
Jagan Teki [Wed, 14 Feb 2018 15:56:22 +0000 (21:26 +0530)]
rk3288: vyasa: Add eMMC boot support

RK3288 Vyasa has eMMC boot support, with JP4 open.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: Add usb otg for rk3288-vyasa
Jagan Teki [Wed, 14 Feb 2018 15:56:21 +0000 (21:26 +0530)]
ARM: dts: rockchip: Add usb otg for rk3288-vyasa

Add usb otg support for rk3288-vyasa, board support usb1 otg
power through otg_vbus_drv and naming conversion followed
as per schematic.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: Add usb host for rk3288-vyasa
Jagan Teki [Wed, 14 Feb 2018 15:56:20 +0000 (21:26 +0530)]
ARM: dts: rockchip: Add usb host for rk3288-vyasa

Add usb host support for rk3288-vyasa, board support hub power
through phy_pwr_en and usb2 host power through usb2_pwr_en and
naming conversion followed as per schematic.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: rk3288-vyasa: defconfig: Enable gmac support
Jagan Teki [Wed, 14 Feb 2018 15:56:19 +0000 (21:26 +0530)]
rockchip: rk3288-vyasa: defconfig: Enable gmac support

Enable gmac support for rk3288-vyasa board.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: Add gmac support for rk3288-vyasa board
Jagan Teki [Wed, 14 Feb 2018 15:56:18 +0000 (21:26 +0530)]
ARM: dts: rockchip: Add gmac support for rk3288-vyasa board

Sync gmac dts node from Linux.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: Add regulators for rk3288-vyasa
Jagan Teki [Wed, 14 Feb 2018 15:56:17 +0000 (21:26 +0530)]
ARM: dts: rockchip: Add regulators for rk3288-vyasa

Add supporting regulators for rk3288-vyasa board, dc12_vbat is
parent regulatorand followed regulators as are child regulators.
regulator naming conversion followed as per schematic for better
readability and easy for identification.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: rk3288-vyasa: Use vmmc-supply from PMIC
Jagan Teki [Wed, 14 Feb 2018 15:56:16 +0000 (21:26 +0530)]
ARM: dts: rockchip: rk3288-vyasa: Use vmmc-supply from PMIC

rk808, SWITCH_REG1 has configured for sdmmc regulator as vcc_sd,
so use the same by renaming vcc33_sd to vcc_sd(as per schematic)
and drop explicit regulator definition from root.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: rk3288-vyasa: Remove vdd_log from rk808, DCDC_REG1
Jagan Teki [Wed, 14 Feb 2018 15:56:15 +0000 (21:26 +0530)]
ARM: dts: rockchip: rk3288-vyasa: Remove vdd_log from rk808, DCDC_REG1

vdd_log, never used on DCDC_REG1 of rk808 from latest schematic so
remove the same and update the regulator-name as 'vdd_arm' to sync
with existing rk3288 board dts files.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rockchip: Sync rk3288-vyasa dts from Linux
Jagan Teki [Wed, 14 Feb 2018 15:56:14 +0000 (21:26 +0530)]
ARM: dts: rockchip: Sync rk3288-vyasa dts from Linux

Sync rk3288-vyasa board dts from Linux for proper updates and maintenance
- rk3288-vyasa.dts: Similar to Linux dts
- rk3288-vyasa-u-boot.dtsi: u-boot dts changes

Also updated MAINTAINERS for these dts files.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: add text_offset to kernel_addr_r on aarch64 platforms
Klaus Goger [Mon, 19 Feb 2018 07:02:26 +0000 (08:02 +0100)]
rockchip: add text_offset to kernel_addr_r on aarch64 platforms

Booting a aarch64 Linux kernel requires the image to be placed
text_offset bytes from a 2MB aligned address.
See https://www.kernel.org/doc/Documentation/arm64/booting.txt

booti_setup() takes care about this alignment and will relocate the
image if not properly aligned with memmove(). This can require up
to double the size of the loaded image and therefore accidentally
overwrite content placed there (i.e ramdisk_addr_r) for large kernel
images.

By adding text_offset to the default kernel_addr_r we can prevent that
from happening for kernels larger 18MB and also save a few cycles.

We can assume a text_offset of 0x80000 for most cases, all others will be
handled by booti_setup() anyway.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pwm: convert to use live dt
Kever Yang [Thu, 8 Feb 2018 13:15:21 +0000 (21:15 +0800)]
rockchip: pwm: convert to use live dt

use live dt api to get base addr

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: rk1108: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:10 +0000 (11:53 +0800)]
rockchip: clk: rk1108: convert to use live dt

Use live dt api to get cru base addr.

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: rk3328: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:09 +0000 (11:53 +0800)]
rockchip: clk: rk3328: convert to use live dt

Use live dt api to get cru base addr.

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: rk3288: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:08 +0000 (11:53 +0800)]
rockchip: clk: rk3288: convert to use live dt

Use live dt api to get cru base addr.

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: rk322x: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:07 +0000 (11:53 +0800)]
rockchip: clk: rk322x: convert to use live dt

Use live dt api to get cru base addr.

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: rk3188: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:06 +0000 (11:53 +0800)]
rockchip: clk: rk3188: convert to use live dt

Use live dt api to get cru base addr.

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: rk3036: convert to use live dt
Kever Yang [Sun, 11 Feb 2018 03:53:05 +0000 (11:53 +0800)]
rockchip: clk: rk3036: convert to use live dt

Use live dt api to get cru base addr.

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 agosunxi: Add A20-SOM204-EVB-eMMC board
Stefan Mavrodiev [Fri, 2 Feb 2018 13:56:33 +0000 (15:56 +0200)]
sunxi: Add A20-SOM204-EVB-eMMC board

A20-SOM204 board has option with onboard 16GB eMMC. The chip is wired
to MMC2 slot.

This patch adds defconfig and dts files for this board. The dts is same
with mainline kernel.

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agosunxi: Add A20-SOM204-EVB board
Stefan Mavrodiev [Fri, 2 Feb 2018 13:56:18 +0000 (15:56 +0200)]
sunxi: Add A20-SOM204-EVB board

This is new System-On-Module platform with universal dimm socket for
easy insertation. The EVB board is designed to be universal with
future modules.

Base features of A20-SOM204 board includes:
* 1GB DDR3 RAM
* AXP209 PMU
* KSZ9031 Gigabit PHY
* AT24C16 EEPROM
* Status LED
* LCD connector
* GPIO connector

There will be variants with the following options:
* Second LAN8710A Megabit PHY
* 16MB SPI Flash memory
* eMMC card
* ATECC508 crypto device

The EVB board has:
* Debug UART
* MicroSD card connector
* USB-OTG connector
* Two USB host
* RTL8723BS WiFi/BT combo
* IrDA transceiver/receiver
* HDMI connector
* VGA connector
* Megabit ethernet transceiver
* Gigabit ethernet transceiver
* SATA connector
* CAN driver
* CSI camera
* MIC and HP connectors
* PCIe x4 connector
* USB3 connector
* Two UEXT connectors
* Two user LEDs

Some of the features are multiplexed and cannot be used the same time:
CAN and Megabit PHY. Others are not usable with A20 SoC: PCIe and USB3.

This patch adds defconfig and dts files for this board. The dts is same
with mainline kernel, except some nodes are removed to make file
compatible with existing dtsi file.

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agoMove CONFIG_PHY_ADDR to Kconfig
Stefan Mavrodiev [Fri, 2 Feb 2018 13:53:38 +0000 (15:53 +0200)]
Move CONFIG_PHY_ADDR to Kconfig

CONFIG_PHY_ADDR is used for old-style configuration. This makes
impossible changing the PHY address, if multiple boards share a same
config header file (for example include/configs/sunxi-common.h).

Moving this to Kconfig helps overcoming this issue. It's defined
as entry inside PHYLIB section.

After the implemention, moveconfig was run. The issues are:
edb9315a - CONFIG_PHYLIB is not enabled. Entry is
  deleted.

- ds414 - CONFIG_PHYLIB is in incompatible format:
  { 0x1, 0x0 }. This entry is also deleted.

- devkit3250 - The PHY_ADDR is in hex format (0x1F).
  Manually CONFIG_PHY_ADDR=31 is added in
  the defconfig.

After the changes the suspicious defconfigs passes building.

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
[jagan: rebased on master]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agonet: sun8i_emac: Fix PHY initialization
Samuel Holland [Sun, 28 Jan 2018 05:53:20 +0000 (23:53 -0600)]
net: sun8i_emac: Fix PHY initialization

The previous code tried to update the PHY parameters without waiting for
autonegotiation to complete. This caused wrong values to be written to
the EMAC in sun8i_adjust_link(). As a result, any commands that called
eth_start() before autonegotiation completed would find the network
nonfunctional. Fix this by using the correct function to start up the
PHY.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agoARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well
Tuomas Tynkkynen [Tue, 6 Mar 2018 21:38:22 +0000 (23:38 +0200)]
ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

In README.sunxi64 we tell the user how to optionally create
u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the
build system create the file automatically just like it does for 32-bit
sunxi boards.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agoARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile
Tuomas Tynkkynen [Tue, 6 Mar 2018 21:38:21 +0000 (23:38 +0200)]
ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile

We're going to need this logic for 64-bit builds as well, so move it
out from under arch/arm/cpu/armv7.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agommc: sunxi: support cd-inverted
Heinrich Schuchardt [Thu, 1 Feb 2018 22:39:19 +0000 (23:39 +0100)]
mmc: sunxi: support cd-inverted

With CONFIG_DM_MMC the BananaPi does not detect SD cards.

The sunxi device trees use the cd-inverted property to indicate that
the card detect is inverted.

This property is documented in Linux kernel devicetree/bindings/mmc/mmc.txt
The property is not marked as deprecated.

A similar patch was posted by Tuomas but is in status "Changes Requested".
https://patchwork.ozlabs.org/patch/850377/

This patch is a stripped down version of his patch.

Suggested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agosunxi: Add reg property for USB OTG node in sun8i-a83t.dtsi
Chen-Yu Tsai [Mon, 5 Feb 2018 14:03:25 +0000 (22:03 +0800)]
sunxi: Add reg property for USB OTG node in sun8i-a83t.dtsi

When the OTG node was added, its reg property for its address space was
missing. With commit f4f9896ac310 ("musb: sunxi: Use base address from
device tree"), the OTG controller's address is derived from the device
tree exclusively. The missing property results in U-boot crashing when
MUSB is initialized.

Fixes: b0bea6678981 ("sunxi: Add USB and R_PIO nodes to sun8i-a83t.dtsi")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Tested-by: Jagan Teki <jagan@openedev.com>
6 years agosunxi: Pine64: temporarily remove extra Pine64 non-plus DT
Andre Przywara [Sat, 27 Jan 2018 00:52:22 +0000 (00:52 +0000)]
sunxi: Pine64: temporarily remove extra Pine64 non-plus DT

With the merge of the new u-boot.itb size check now the build for
pine64_plus_defconfig breaks, as this file gets too large:
=============
u-boot.itb exceeds file size limit:
  limit:  516096 bytes
  actual: 521852 bytes
  excess: 5756 bytes
make: *** [u-boot.itb] Error 1
=============
One easily fixable reason is that we actually have two .dtbs in our FIT
image, one for the regular Pine64+ board, and one for the non-plus version.
The only difference U-Boot cares about is the 100Mbit Ethernet PHY used
on the non-plus version, however Ethernet isn't enabled in the non-plus
DT anyway.
So we could avoid the non-plus special handling, and remove that extra
.dtb from the FIT image, which saves a few KBs and brings us back below the
limit. The Pine64 would boot with a Pine64+ .dtb, and would fail to
enable Ethernet. Given that it didn't work in the first place, this is not
a regression.
Once we switch to a non-MMC environment, we can bring this back, then
with a proper .dtb and hopefully working Ethernet.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
6 years agoPrepare v2018.03 v2018.03
Tom Rini [Tue, 13 Mar 2018 12:02:19 +0000 (08:02 -0400)]
Prepare v2018.03

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoimx: hab: Convert DCD non-NULL error to warning
Bryan O'Donoghue [Fri, 9 Mar 2018 13:07:21 +0000 (13:07 +0000)]
imx: hab: Convert DCD non-NULL error to warning

commit 8c4037a09a5c ("imx: hab: Ensure the IVT DCD pointer is Null prior
to calling HAB authenticate function.") makes the DCD field being NULL a
dependency.

This change though will break loading and executing of existing pre-signed
binaries on a u-boot update i.e. if this change is deployed on a board you
will be forced to redo all images on that board to NULL out the DCD.

There is no prior guidance from NXP that the DCD must be NULL similarly
public guidance on usage of the HAB doesn't call out this NULL dependency
(see boundary devices link).

Since later SoCs will reject a non-NULL DCD there's no reason to make a
NULL DCD a requirement, however if there is an actual dependency for later
SoCs the appropriate fix would be to do SoC version checking.

Earlier SoCs are capable (and happy) to authenticate images with non-NULL
DCDs, we should not be forcing this change on downstream users -
particularly if it means those users now must rewrite their build systems
and/or redeploy signed images in the field.

Fixes: 8c4037a09a5c ("imx: hab: Ensure the IVT DCD pointer is Null prior
to calling HAB authenticate function.")

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Link: https://boundarydevices.com/high-assurance-boot-hab-dummies
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agodoc: mxc_hab: Update i.MX HAB documentation
Breno Lima [Thu, 22 Feb 2018 00:42:56 +0000 (00:42 +0000)]
doc: mxc_hab: Update i.MX HAB documentation

The README.mxc_hab is outdated and need improvements, add the following
modifications:

- Reorganize document and remove duplicate content
- Add CST download link
- Update CST package name
- Align command lines with CST v2.3.3
- Update U-Boot binary name
- Remove CSF padding since is not documented in AN4581

Signed-off-by: Breno Lima <breno.lima@nxp.com>
6 years agodoc: mxc_hab: Move HAB related info to the appropriate doc
Breno Lima [Thu, 22 Feb 2018 00:42:55 +0000 (00:42 +0000)]
doc: mxc_hab: Move HAB related info to the appropriate doc

Currently the High Assurance Boot procedure is documented in two
places:

- doc/README.imx6
- doc/README.mxc_hab

It is better to consolidate all HAB related information into
README.mxc_hab file, so move the content from README.imx6 to
README.mxc_hab.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoimx: hab: Make usage of packed attribute consistent
Bryan O'Donoghue [Fri, 9 Mar 2018 13:07:20 +0000 (13:07 +0000)]
imx: hab: Make usage of packed attribute consistent

commit cd2d46003ce1 ("arm: imx: hab: Add IVT header definitions") declares
struct ivt_header as "__attribute__((packed))".

commit ed286bc80e9d ("imx: hab: Check if CSF is valid before
authenticating image") declares struct hab_hdr with __packed.

This patch makes the __packed convention consistent.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoimx: hab: Fix usage of packed attribute
Bryan O'Donoghue [Fri, 9 Mar 2018 13:07:19 +0000 (13:07 +0000)]
imx: hab: Fix usage of packed attribute

commit ed286bc80e9d ("imx: hab: Check if CSF is valid before authenticating
image") makes use of "__packed" as a prefix to the "struct hab_hdr"
declaration.

With my compiler "gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)" we
get:

./arch/arm/include/asm/mach-imx/hab.h:42:25: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘{’ token
 struct __packed hab_hdr {

Fix this problem by including <linux/compiler.h>

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoARM: dts: imx6dl-icore-rqs: Fix to include correct dtsi
Jagan Teki [Tue, 6 Mar 2018 11:45:59 +0000 (17:15 +0530)]
ARM: dts: imx6dl-icore-rqs: Fix to include correct dtsi

This patch fixes the wrongly included dtsi file which was
breaking mainline support for Engicam i.CoreM6 DualLite/Solo RQS.

Linux commit details for the same change as
"ARM: dts: imx6dl: Include correct dtsi file for Engicam i.CoreM6
DualLite/Solo RQS"
(sha1: c0c6bb2322964bd264b4ddedaa5776f40c709f0c)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoARM: dts: imx6qdl-icore-rqs: Sync usdhc4 node from Linux
Jagan Teki [Tue, 6 Mar 2018 11:45:58 +0000 (17:15 +0530)]
ARM: dts: imx6qdl-icore-rqs: Sync usdhc4 node from Linux

usdhc4 node need to update pinctrl, bus-width and non-removable
properties, sync the same from Linux.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoMerge git://git.denx.de/u-boot-imx
Tom Rini [Fri, 9 Mar 2018 18:29:58 +0000 (13:29 -0500)]
Merge git://git.denx.de/u-boot-imx

6 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 9 Mar 2018 14:27:23 +0000 (09:27 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agotools/mkimage: Use proper output parameter in dtc-system call
Stefan Theil [Thu, 8 Mar 2018 08:00:13 +0000 (09:00 +0100)]
tools/mkimage: Use proper output parameter in dtc-system call

The system call used by mkimage to run dtc redirects stdout to a
temporary file. This can cause problems on Windows (with a MinGW
cross-compiled version). Using the "-o" dtc parameter avoids
this problem.

Signed-off-by: Stefan Theil <stefan.theil@mixed-mode.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agofs: ext4: Do not print mount fail message when not ext4 filesystem
Marek Behún [Wed, 7 Mar 2018 23:26:08 +0000 (00:26 +0100)]
fs: ext4: Do not print mount fail message when not ext4 filesystem

Other filesystem drivers don't do this.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
6 years agoMAINTAINERS: bring sections into alphabetic order
Heinrich Schuchardt [Wed, 7 Mar 2018 03:04:29 +0000 (04:04 +0100)]
MAINTAINERS: bring sections into alphabetic order

NETWORK should be after NAND_FLASH.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agoscripts/coccinelle: add some more coccinelle tests
Heinrich Schuchardt [Thu, 8 Mar 2018 19:56:17 +0000 (20:56 +0100)]
scripts/coccinelle: add some more coccinelle tests

kmerr: verify that malloc and calloc are followed by a check to verify
that we are not out of memory.

badzero: Compare pointer-typed values to NULL rather than 0

Both checks are copied from the Linux kernel archive.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agoyaffs2: iterator variable cannot be NULL
Heinrich Schuchardt [Thu, 8 Mar 2018 21:52:29 +0000 (22:52 +0100)]
yaffs2: iterator variable cannot be NULL

The iterator of list_for_each() is never NULL.

Identified with coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agobcm283x_pl011: Flush RX queue after setting baud rate
Alexander Graf [Wed, 7 Mar 2018 21:08:25 +0000 (22:08 +0100)]
bcm283x_pl011: Flush RX queue after setting baud rate

After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt on Raspberry Pis that use pl011 for serial.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg <goran@lundberg.email>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoserial_bcm283x_mu: Flush RX queue after setting baud rate
Alexander Graf [Wed, 7 Mar 2018 21:08:24 +0000 (22:08 +0100)]
serial_bcm283x_mu: Flush RX queue after setting baud rate

After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg <goran@lundberg.email>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agosunxi: video: mark framebuffer as EFI reserved memory
Heinrich Schuchardt [Sat, 3 Mar 2018 09:30:17 +0000 (10:30 +0100)]
sunxi: video: mark framebuffer as EFI reserved memory

Inform the EFI subsystem that the framebuffer memory is reserved.

Without the patch the AllocatePool boot service allocates memory from the
framebuffer which will will be overwritten by screen output.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agoARM: Drop unreferenced CONFIG_* defines named after boards
Tuomas Tynkkynen [Mon, 5 Mar 2018 23:46:39 +0000 (01:46 +0200)]
ARM: Drop unreferenced CONFIG_* defines named after boards

The following config symbols are only defined once and never referenced
anywhere else:

CONFIG_AT91SAM9263EK
CONFIG_AT91SAM9RLEK
CONFIG_BARIX_IPAM390
CONFIG_BOARD_H2200
CONFIG_EP9301
CONFIG_KZM_A9_GT
CONFIG_PICOSAM
CONFIG_PLATINUM_PICON
CONFIG_PLATINUM_TITANIUM
CONFIG_PM9261
CONFIG_PM9263
CONFIG_PM9G45
CONFIG_SIEMENS_DRACO
CONFIG_SIEMENS_PXM2
CONFIG_SIEMENS_RUT
CONFIG_SMDKC100
CONFIG_SMDKV310
CONFIG_STM32F4DISCOVERY

Most of them are config symbols named after the respective boards which
seems to have been a standard practice at some point.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoARM: Drop unreferenced CONFIG_* defines named after SoCs
Tuomas Tynkkynen [Mon, 5 Mar 2018 23:46:38 +0000 (01:46 +0200)]
ARM: Drop unreferenced CONFIG_* defines named after SoCs

The following config symbols are only defined once and never referenced
anywhere else:

CONFIG_ARM926EJS
CONFIG_CPUAT91
CONFIG_EXYNOS5800
CONFIG_SYS_CORTEX_R4

Most of them are config symbols named after the respective SoCs which
seems to have been a standard practice at some point.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agoMIPS: Drop unreferenced CONFIG_* defines
Tuomas Tynkkynen [Mon, 5 Mar 2018 23:46:37 +0000 (01:46 +0200)]
MIPS: Drop unreferenced CONFIG_* defines

The following config symbols are only defined once and never referenced
anywhere else:

CONFIG_DBAU1X00
CONFIG_PB1X00

Most of them are config symbols named after the respective boards which
seems to have been a standard practice at some point.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agotreewide: Fix gdsys mail addresses
Mario Six [Tue, 6 Mar 2018 07:04:58 +0000 (08:04 +0100)]
treewide: Fix gdsys mail addresses

The @gdsys.cc addresses are supposed to be used for mailing lists.
Switch all occurrences of @gdsys.de mail addresses to their @gdsys.cc
equivalent.

Also, Dirk's address was wrong in one place; fix that as well.

Signed-off-by: Mario Six <six@gdsys.cc>
6 years agoARM: qemu-arm: Increase CONFIG_SYS_CBSIZE
Tuomas Tynkkynen [Mon, 5 Mar 2018 21:20:41 +0000 (23:20 +0200)]
ARM: qemu-arm: Increase CONFIG_SYS_CBSIZE

CONFIG_SYS_CBSIZE determines the maximum length of the kernel command
line, and the default value of 256 is too small for booting some Linux
images in the wild.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
6 years agoimx: syscounter: make sure asm is volatile
Yasushi SHOJI [Thu, 8 Mar 2018 04:21:10 +0000 (13:21 +0900)]
imx: syscounter: make sure asm is volatile

Without the volatile attribute, compilers are entitled to optimize out
the same asm().  In the case of __udelay() in syscounter.c, it calls
`get_ticks()` twice, one for the starting time and the second in the
loop to check the current time.  When compilers inline `get_ticks()`
they see the same `mrrc` instructions and optimize out the second one.
This leads to infinite loop since we don't get updated value from the
system counter.

Here is a portion of the disassembly of __udelay:

  88: 428b       cmp r3, r1
  8a: f8ce 20a4  str.w r2, [lr, #164] ; 0xa4
  8e: bf08       it eq
  90: 4282       cmpeq r2, r0
  92: f8ce 30a0  str.w r3, [lr, #160] ; 0xa0
  96: d3f7       bcc.n 88 <__udelay+0x88>
  98: e8bd 8cf0  ldmia.w sp!, {r4, r5, r6, r7, sl, fp, pc}

Note that final jump / loop at 96 to 88, we don't have any `mrrc`.

With a volatile attribute, the above changes to this:

  8a: ec53 2f0e  mrrc 15, 0, r2, r3, cr14
  8e: 42ab       cmp r3, r5
  90: f8c1 20a4  str.w r2, [r1, #164] ; 0xa4
  94: bf08       it eq
  96: 42a2       cmpeq r2, r4
  98: f8c1 30a0  str.w r3, [r1, #160] ; 0xa0
  9c: d3f5       bcc.n 8a <__udelay+0x8a>
  9e: e8bd 8cf0  ldmia.w sp!, {r4, r5, r6, r7, sl, fp, pc}
  a2: bf00       nop

I'm advised[1] to put volatile on all asm(), so this commit also adds it
to the asm() in timer_init().

[1]: https://lists.denx.de/pipermail/u-boot/2018-March/322062.html

Signed-off-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoimximage: Remove failure when no IVT offset is found
Fabio Estevam [Fri, 9 Mar 2018 11:25:00 +0000 (08:25 -0300)]
imximage: Remove failure when no IVT offset is found

Sometimes imximage throws the following error:

  CFGS    board/freescale/vf610twr/imximage.cfg.cfgtmp
  CFGS    board/freescale/vf610twr/imximage.cfg.cfgtmp
  MKIMAGE u-boot-dtb.imx
Error: No BOOT_FROM tag in board/freescale/vf610twr/imximage.cfg.cfgtmp
arch/arm/mach-imx/Makefile:100: recipe for target 'u-boot-dtb.imx' failed

Later on, when running mkimage for the u-boot.imx it will succeed in
finding the IVT offset.

Looks like some race condition happening during parallel build when
processing mkimage for u-boot-dtb.imx and u-boot.imx.

A proper fix still needs to be implemented, but as a workaround let's
remove the error when the IVT offset is not found.

It is useful to have such message, especially during bring-up phase,
but the build error that it causes is severe, so better avoid the
build error for now.

The error checking can be re-implemented later when we have a proper
fix.

Reported-by: Breno Lima <breno.lima@nxp.com>
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agovideo: indicate code page of bitmap fonts
Heinrich Schuchardt [Fri, 2 Mar 2018 19:50:17 +0000 (20:50 +0100)]
video: indicate code page of bitmap fonts

Add comments clarifying that the bitmap fonts support code page 437.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>