oweals/u-boot.git
4 years agoMerge branch 'next' of git://git.denx.de/u-boot-usb into next
Tom Rini [Tue, 31 Mar 2020 21:24:19 +0000 (17:24 -0400)]
Merge branch 'next' of git://git.denx.de/u-boot-usb into next

4 years agousb: Migrate to support live DT for some driver
Kever Yang [Wed, 4 Mar 2020 00:59:50 +0000 (08:59 +0800)]
usb: Migrate to support live DT for some driver

Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT.
This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use
ofnode as parameter instead of fdt offset. And all the drivers who use
these APIs update to use live dt APIs at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agousb: ehci-msm: Use dev interface to get device address
Kever Yang [Wed, 4 Mar 2020 00:59:49 +0000 (08:59 +0800)]
usb: ehci-msm: Use dev interface to get device address

Use dev_read_addr_ptr() instead of devfdt_get_addr() so that we can support
live DT.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
4 years agousb: dwc3-of-simple: Drop redundant inclding header file
Kever Yang [Wed, 4 Mar 2020 00:59:48 +0000 (08:59 +0800)]
usb: dwc3-of-simple: Drop redundant inclding header file

The fdtdec.h is no use in this file, remove the include code.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoMerge branch '2020-03-27-master-imports'
Tom Rini [Fri, 27 Mar 2020 21:54:38 +0000 (17:54 -0400)]
Merge branch '2020-03-27-master-imports'

- Update a few MAINTAINERS entries
- cache alignment fix in ext4 code
- Two small test fixes

4 years agotest: typo decompression
Heinrich Schuchardt [Mon, 23 Mar 2020 17:47:47 +0000 (18:47 +0100)]
test: typo decompression

%s/decopmression/decompression/

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMAINTAINERS: add myself as maintainer of fs/btrfs
Marek Behún [Wed, 25 Mar 2020 11:04:46 +0000 (12:04 +0100)]
MAINTAINERS: add myself as maintainer of fs/btrfs

Signed-off-by: Marek Behún <marek.behun@nic.cz>
4 years agofs: ext4: Fix alignment of cache buffers
Jan Kiszka [Wed, 25 Mar 2020 20:27:51 +0000 (21:27 +0100)]
fs: ext4: Fix alignment of cache buffers

We need to align the cache buffer to ARCH_DMA_MINALIGN in order to avoid
access errors like

CACHE: Misaligned operation at range [be0231e0be0235e0]

seen on the MCIMX7SABRE.

Fixes: d5aee659f217 ("fs: ext4: cache extent data")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
4 years agoMAINTAINERS: Add usb.h entry to usb
Marek Vasut [Wed, 25 Mar 2020 20:35:53 +0000 (21:35 +0100)]
MAINTAINERS: Add usb.h entry to usb

Add usb.h file into the USB list.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
4 years agotest/py: mmc: Fix 'mmc info' testcase
Harald Seiler [Thu, 26 Mar 2020 17:07:27 +0000 (18:07 +0100)]
test/py: mmc: Fix 'mmc info' testcase

Commit 41e30dcf8796 ("cmd: mmc: Make Mode: printout consistent") fixed
the layout of `mmc info` output.  Reflect this change in the respective
testcase.

Also fix a typo in the documentation.

Fixes: 41e30dcf8796 ("cmd: mmc: Make Mode: printout consistent")
Signed-off-by: Harald Seiler <hws@denx.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoRevert "vexpress_ca9x4: Enable use of correct DTB file and restore EFI loader."
Tom Rini [Fri, 27 Mar 2020 15:47:04 +0000 (11:47 -0400)]
Revert "vexpress_ca9x4: Enable use of correct DTB file and restore EFI loader."

Currently this causes failures of the platform when running the EFI
loader tests, so disable it for now.

This reverts commit af827140e5965e5bb2bcad1c53ca8419b428ff6d.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'u-boot-rockchip-20200327' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 27 Mar 2020 01:39:59 +0000 (21:39 -0400)]
Merge tag 'u-boot-rockchip-20200327' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip

- Fixed for rv1108 and elgin-rv1108 board
- Fix the keyboard from USB instead of CrOS EC

4 years agoMerge tag 'u-boot-stm32-20200324' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 26 Mar 2020 17:18:22 +0000 (13:18 -0400)]
Merge tag 'u-boot-stm32-20200324' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm into next

- stm32mp: fix command stboard
- stm32mp: update kernel device tree according the part number
- stm32mp: add 800 MHz profile support = stm32mp15xd and stm32mp15xf
- stm32mp: set cp15 frequency in psci cpu on
- stm32mp: DT alignment with Linux 5.6-rc1
- stm32mp: clk: add SPI5 support and correct CKSELR masks
- stm32mp: ram: fixes on LPDDR2/LPDDR3 support and on tuning
- stm32: i2c: allows for any bus frequency
- sti: timer: livetree and clk API conversion

4 years agorockchip: mkimage: Use an existing macro instead of a decimal value
Miquel Raynal [Wed, 18 Mar 2020 16:22:55 +0000 (17:22 +0100)]
rockchip: mkimage: Use an existing macro instead of a decimal value

Depending on the SoC, a header of four characters is prepended to the
image. There is already a macro defining the number of characters:
RK_SPL_HDR_SIZE, so use it instead of hardcoding "4".

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorv1108: Fix boot regression
Otavio Salvador [Fri, 13 Mar 2020 17:42:48 +0000 (14:42 -0300)]
rv1108: Fix boot regression

Since commit 79030a486128 ("rockchip: Add Single boot image
(with binman, pad_cat)") the following boot regression is seen:

U-Boot 2020.04-rc3-00050-gd16e18ca6c-dirty (Mar 09 2020 - 11:40:07 -0300)

Model: Elgin RV1108 R1 board
DRAM:  128 MiB
initcall sequence 67fd12a0 failed at call 6000b927 (err=-22)

This happens because the above commit missed to include the
"rockchip-u-boot.dtsi" for rv1108, so include this file
like it done for other Rockchip SoC dtsi's.

Fixes: 79030a486128 ("rockchip: Add Single boot image (with binman, pad_cat)")
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoelgin-rv1108: Avoid adc_channel_single_shot error
Otavio Salvador [Fri, 13 Mar 2020 17:42:47 +0000 (14:42 -0300)]
elgin-rv1108: Avoid adc_channel_single_shot error

Currently the following error message is seen during boot:

U-Boot 2020.01-08751-g55759ae141 (Mar 09 2020 - 14:44:52 -0300)

Model: Elgin RV1108 R1 board
DRAM:  128 MiB
APLL: 600000000 DPLL:1200000000 GPLL:1188000000
ACLK_BUS: 148500000 ACLK_PERI:148500000 HCLK_PERI:148500000 PCLK_PERI:74250000
MMC:   dwmmc@30110000: 0
Loading Environment from MMC... OK
In:    serial@10210000
Out:   serial@10210000
Err:   serial@10210000
Model: Elgin RV1108 R1 board
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
....

Since the elgin-rv1108 does not use ADC to read the download
key status, select CONFIG_ROCKCHIP_BOOT_MODE_REG=0 to avoid
such error.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoelgin-rv1108: Use rk_board_late_init() for GPIO settings
Otavio Salvador [Fri, 13 Mar 2020 17:42:46 +0000 (14:42 -0300)]
elgin-rv1108: Use rk_board_late_init() for GPIO settings

Since commit 8e9a8d0d0c8c ("rockchip: elgin-rv1108: use board_early_init_f
for per-boar init") the function that configure the board GPIOs is no
longer called since CONFIG_BOARD_EARLY_INIT_F=y is not selected.

These GPIOs do not need to be configured in such early stagem, so change it
to rk_board_late_init() and also select CONFIG_BOARD_LATE_INIT=y
to fix the regression.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoARM: dts: Activate pullups in the console pins on rv1108-elgin-r1
Otavio Salvador [Fri, 13 Mar 2020 17:42:45 +0000 (14:42 -0300)]
ARM: dts: Activate pullups in the console pins on rv1108-elgin-r1

In order to make the console pins more robust to noise, activate
the pullups and increase its drive strength.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: Change keyboard input from CrOS EC keyboard to a USB keyboard
Peter Robinson [Mon, 2 Mar 2020 07:57:55 +0000 (07:57 +0000)]
rockchip: Change keyboard input from CrOS EC keyboard to a USB keyboard

These boards aren't ChromeOS devices so won't have a cros-ec-keyb
input as it's the keyboard available via the ChromeOS Embedded
Controller. Update them to use a USB keyboard which would actually
be available. Also enable the usb keyboard option for those devices
that don't have it enabled already.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: evb-rv1108: Use syscon API to get grf base
Kever Yang [Wed, 19 Feb 2020 01:46:06 +0000 (09:46 +0800)]
rockchip: evb-rv1108: Use syscon API to get grf base

Use syscon API to get grf base instead of get from dts.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agorockchip: elgin-rv1108: Use syscon API to get grf base
Kever Yang [Wed, 19 Feb 2020 01:46:05 +0000 (09:46 +0800)]
rockchip: elgin-rv1108: Use syscon API to get grf base

Use syscon API to get grf base instead of get from dts.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
4 years agotimer: sti: use clk API to get timer clock rate
Nicolas Heemeryck [Fri, 13 Mar 2020 22:42:44 +0000 (23:42 +0100)]
timer: sti: use clk API to get timer clock rate

Retrieve clock rate through device tree. This mimics the behavior of
arm_global_timer in Linux.

Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@gmail.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agotimer: sti: convert to livetree
Nicolas Heemeryck [Fri, 13 Mar 2020 22:42:43 +0000 (23:42 +0100)]
timer: sti: convert to livetree

Update STI timer to support a live tree

Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@gmail.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoi2c: stm32f7_i2c: allows for any bus frequency
Alain Volmat [Fri, 6 Mar 2020 10:09:14 +0000 (11:09 +0100)]
i2c: stm32f7_i2c: allows for any bus frequency

Do not limit to 3 (100KHz, 400KHz, 1MHz) bus frequencies, but
instead allow for any frequency. Depending on the requested
frequency (via the clock-frequency DT entry), use the spec
data from either Standard, Fast or Fast Plus mode.

In order to do so, the driver do not use anymore spec identifier
by directly handle the requested frequency and from it retrieve
the corresponding spec data to be used for the computation
of the timing register.

Signed-off-by: Alain Volmat <alain.volmat@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: the property st, phy-cal becomes optional
Patrick Delaunay [Fri, 6 Mar 2020 10:14:11 +0000 (11:14 +0100)]
ram: stm32mp1: the property st, phy-cal becomes optional

This parameter "st,phy-cal" becomes optional and when it is
absent the built-in PHY calibration is done.

It is the case in the helper dtsi file "stm32mp15-ddr.dtsi"
except if DDR_PHY_CAL_SKIP is defined.

This patch also impact the ddr interactive mode
- the registers of the param 'phy.cal' are initialized to 0 when
  "st,phy-cal" is not present in device tree (default behavior when
  DDR_PHY_CAL_SKIP is not activated)
- the info 'cal' field can be use to change the calibration behavior
  - cal=1 => use param phy.cal to initialize the PHY, built-in training
             is skipped
  - cal=0 => param phy.cal is absent, built-in training is used (default)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: reduce delay after BIST reset for tuning
Patrick Delaunay [Fri, 6 Mar 2020 10:14:10 +0000 (11:14 +0100)]
ram: stm32mp1: reduce delay after BIST reset for tuning

Reduce the delay after BIST delay, from 1ms to 10us
which is enough accoriding datasheet.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1_ddr: fix self refresh disable during DQS training
Patrick Delaunay [Fri, 6 Mar 2020 10:14:09 +0000 (11:14 +0100)]
ram: stm32mp1_ddr: fix self refresh disable during DQS training

DDRCTRL_PWRCTL.SELFREF_EN needs to be reset before DQS training step, not
to enter in self refresh mode during the execution of this phase.
Depending on settings, it can be set after the DQS training.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: update BIST config for tuning
Patrick Delaunay [Fri, 6 Mar 2020 10:14:08 +0000 (11:14 +0100)]
ram: stm32mp1: update BIST config for tuning

Update the BIST config to compute the real use mask for the real
bank, row and col of the used DDR. The values are get from addrmap
register value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: tuning: deactivate derating during BIST test
Patrick Delaunay [Fri, 6 Mar 2020 10:14:07 +0000 (11:14 +0100)]
ram: stm32mp1: tuning: deactivate derating during BIST test

The derating (timing parameter derating using MR4 read value)
can't be activated during BIST test, as the MR4 read answer will
be not understood by BIST (BISTGSR.BDONE bit stay at 0,
BISTWCSR.DXWCNT = 0x206 instead of BISTWCR.BWCNT = 0x200).

This patch only impacts the tuning on LPDDR2/LPDDR3,
if derateen.derate_enable = 1.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: tuning: add timeout for polling BISTGSR.BDDONE
Patrick Delaunay [Fri, 6 Mar 2020 10:14:06 +0000 (11:14 +0100)]
ram: stm32mp1: tuning: add timeout for polling BISTGSR.BDDONE

Avoid to block the tuning procedure on BIST error (not finished
BIST procedure) by adding a 1000us timeout on the polling of
BISTGSR.BDDONE executed to detect the end of BIST.

The normal duration of the BIST test is around 5us.

This patch also cleanup comments.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: don't display the prompt two times
Patrick Delaunay [Fri, 6 Mar 2020 10:14:05 +0000 (11:14 +0100)]
ram: stm32mp1: don't display the prompt two times

Remove one "DDR>" display on command
- next
- step
- go

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: display result for software read DQS gating
Patrick Delaunay [Fri, 6 Mar 2020 10:14:04 +0000 (11:14 +0100)]
ram: stm32mp1: display result for software read DQS gating

Display result information for software read DQS gating, the tuning 0
which be used by CubeMX DDR tuning tools.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoram: stm32mp1: increase vdd2_ddr: buck2 for 32bits LPDDR
Patrick Delaunay [Fri, 6 Mar 2020 10:14:03 +0000 (11:14 +0100)]
ram: stm32mp1: increase vdd2_ddr: buck2 for 32bits LPDDR

Need to increase the LPDDR2/LPDDR3 the voltage vdd2_ddr: buck2
form 1.2V to 1.25V for 32bits configuration.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoARM: dts: stm32mp1: DT alignment with Linux 5.6-rc1
Patrick Delaunay [Fri, 6 Mar 2020 16:54:41 +0000 (17:54 +0100)]
ARM: dts: stm32mp1: DT alignment with Linux 5.6-rc1

This commit manages diversity for STM32M15x SOCs with:
- dedicated files to support all STM32MP15 SOCs family.
  The differences between those SOCs are:
  -STM32MP151 [1]: common file.
  -STM32MP153 [2]: STM32MP151 + CANs + a second CortexA7-CPU.
  -STM32MP157 [3]: STM32MP153 + DSI + GPU.
- new files to manage security diversity on STM32MP15x SOCs.
  On STM32MP15xY, "Y" gives information:
  -Y = A means no cryp IP and no secure boot.
  -Y = C means cryp IP + secure boot.
- stm32mp157 pinctrl files to better manage package diversity.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoclk: stm32mp1: add SPI5_K support
Patrick Delaunay [Mon, 9 Mar 2020 13:59:23 +0000 (14:59 +0100)]
clk: stm32mp1: add SPI5_K support

Add clock support for SPI5, as this instance is available on extension
connector of ST board.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoclk: stm32mp1: correct CKSELR masks
Patrick Delaunay [Mon, 9 Mar 2020 13:59:22 +0000 (14:59 +0100)]
clk: stm32mp1: correct CKSELR masks

Correct three masks used to access on the RCC register
RCC_QSPICKSELR, RCC_FMCCKSELR and RCC_ADCCKSELR: only 3 bits.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: psci: set cntfrq register of cpu on
Ludovic Barre [Mon, 2 Mar 2020 10:27:02 +0000 (11:27 +0100)]
stm32mp: psci: set cntfrq register of cpu on

This path allows to set the cntfrq register of targeted cpu.

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp1: add 800 MHz profile support
Patrick Delaunay [Wed, 26 Feb 2020 10:26:43 +0000 (11:26 +0100)]
stm32mp1: add 800 MHz profile support

The STM32MP1 series is available in 3 different lines which are pin-to-pin
compatible:
- STM32MP157: Dual Cortex-A7 cores, Cortex-M4 core @ 209 MHz,
              3D GPU, DSI display interface and CAN FD
- STM32MP153: Dual Cortex-A7 cores, Cortex-M4 core @ 209 MHz
              and CAN FD
- STM32MP151: Single Cortex-A7 core, Cortex-M4 core @ 209 MHz

Each line comes with a security option (cryptography & secure boot)
& a Cortex-A frequency option :

- A : Cortex-A7 @ 650 MHz
- C : Secure Boot + HW Crypto + Cortex-A7 @ 650 MHz
- D : Cortex-A7 @ 800 MHz
- F : Secure Boot + HW Crypto + Cortex-A7 @ 800 MHz

This patch adds the support of STM32MP15xD and STM32MP15xF in U-Boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: fdt: update kernel device tree according the part number
Patrick Delaunay [Wed, 12 Feb 2020 18:37:44 +0000 (19:37 +0100)]
arm: stm32mp: fdt: update kernel device tree according the part number

Update the kernel device tree for STM32MP15x product lines according
the used soc and its part number, when CONFIG_OF_SYSTEM_SETUP is activated:
- STM32MP15XA hasn't Crypto (cryp1/2)
- STM32M151 and STM32M153 hasn't 3D GPU and DSI host
- STM32M151 hasn't CAN FD and has single A7

For example:

FDT: cpu 1 node remove for STM32MP151AAA Rev.B
FDT: can@4400e000 node disabled for STM32MP151AAA Rev.B
FDT: gpu@59000000 node disabled for STM32MP151AAA Rev.B
FDT: dsi@5a000000 node disabled for STM32MP151AAA Rev.B

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: add function get_soc_name
Patrick Delaunay [Wed, 12 Feb 2020 18:37:43 +0000 (19:37 +0100)]
arm: stm32mp: add function get_soc_name

Add a function get_soc_name to get a string with the full name
of the SOC "STM32MP15xxx Rev.x"

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: display reference only for STMicroelectronics board
Patrick Delaunay [Wed, 12 Feb 2020 18:37:42 +0000 (19:37 +0100)]
board: stm32mp1: display reference only for STMicroelectronics board

Display the reference MBxxxx found in OTP49
only for STMicroelectronics boards when CONFIG_CMD_STBOARD
is activated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
# Conflicts:
# board/st/stm32mp1/stm32mp1.c

4 years agoboard: stm32mp1: add finished good in board identifier OTP
Patrick Delaunay [Tue, 24 Mar 2020 08:05:00 +0000 (09:05 +0100)]
board: stm32mp1: add finished good in board identifier OTP

Update the command stboard to support the updated coding of OTP 59 with
finished good.

The ST product codification have several element
- "Commercial Product Name" (CPN): type of product board (DKX, EVX)
  associated to the board ID "MBxxxx"
- "Finished Good" or "Finish Good" (FG):
  effective content of the product without chip STM32MP1 (LCD, Wifi, …)
- BOM: cost variant for same FG
  (for example, several provider of the same component)

For example
- commercial product = STM32MP157C-EV1
- Finished Good = EVA32MP157A1$AU1

Booth information are written on board and these information is also saved
in OTP59:

bit [31:16] (hex) => Board id, MBxxxx
bit [15:12] (dec) => Variant CPN (1....15)
bit [11:8]  (dec) => Revision board (index with A = 1, Z = 26)
bit [7:4]   (dec) => Variant FG : finished good (NEW)
bit [3:0]   (dec) => BOM (01, .... 255)

The updated command is:
  stboard [-y] <Board> <VarCPN> <Revision> <VarFG> <BOM>

And the displayed STMicroelectronics board identification is:
  Board: MB<Board> Var<VarCPN>.<VarFG> Rev.<Revision>-<BOM>

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: improve the error message for smc
Patrick Delaunay [Wed, 12 Feb 2020 18:37:40 +0000 (19:37 +0100)]
arm: stm32mp: improve the error message for smc

Add the SMC code and operation for trace on errors.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: stboard: lock the OTP after programming
Patrick Delaunay [Wed, 12 Feb 2020 18:37:39 +0000 (19:37 +0100)]
board: stm32mp1: stboard: lock the OTP after programming

Lock the OTP used for board identification for the ST boards after
programming.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: bsec: add permanent lock support in bsec driver
Patrick Delaunay [Wed, 12 Feb 2020 18:37:38 +0000 (19:37 +0100)]
arm: stm32mp: bsec: add permanent lock support in bsec driver

Add BSEC lock access (read / write) at 0xC0000000 offset of misc driver.
The write access only available for Trusted boot mode, based on new
SMC STM32_SMC_WRLOCK_OTP.

With the fuse command, the permanent lock status is accessed with
0x10000000 offset (0xC0000000 - 0x8000000 for OTP sense/program
divided by u32 size), for example:

Read lock status of fuse 57 (0x39)

  STM32MP> fuse sense 0 0x10000039 1

  Sensing bank 0:

  Word 0x10000039: 00000000

Set permanent lock of fuse 57 (0x39)

  STM32MP> fuse prog 0 0x10000039 1

  Sensing bank 0:

  Word 0x10000039: 00000000

WARNING: the OTP lock is updated only after reboot

WARING: Programming lock or fuses is an irreversible operation!
        This may brick your system.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: bsec: remove unneeded test
Patrick Delaunay [Wed, 12 Feb 2020 18:37:37 +0000 (19:37 +0100)]
arm: stm32mp: bsec: remove unneeded test

Remove the test offs < 0 , as offs is unsigned.

This patch solves the warnings when compiling with W=1
on stm32mp1 board:

In function ‘stm32mp_bsec_read’:
arch/arm/mach-stm32mp/bsec.c:368:11: warning:
comparison of unsigned expression < 0 is always false [-Wtype-limits]
  368 |  if (offs < 0 || (offs % 4) || (size % 4))
      |           ^
In function ‘stm32mp_bsec_write’:
arch/arm/mach-stm32mp/bsec.c:405:11: warning:
comparison of unsigned expression < 0 is always false [-Wtype-limits]
  405 |  if (offs < 0 || (offs % 4) || (size % 4))
      |           ^

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: read OTP in command stboard
Patrick Delaunay [Wed, 12 Feb 2020 18:37:36 +0000 (19:37 +0100)]
board: stm32mp1: read OTP in command stboard

Read the value directly from the OTP and no more of the shadows
to avoid the need of reboot after stboard command to have correct value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: update command stboard on misc_write result
Patrick Delaunay [Wed, 12 Feb 2020 18:37:35 +0000 (19:37 +0100)]
board: stm32mp1: update command stboard on misc_write result

Update management of misc_write, which now return length of data
after the commit 8729b1ae2cbd ("misc: Update read() and write()
methods to return bytes xfered")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
4 years agovexpress_ca9x4: Enable use of correct DTB file and restore EFI loader.
Kristian Amlie [Tue, 25 Feb 2020 17:22:16 +0000 (18:22 +0100)]
vexpress_ca9x4: Enable use of correct DTB file and restore EFI loader.

EFI was disabled in f95b8a4b5f64f because of the missing DTB file,
and indeed, the DTB file is required to load recent versions of GRUB
(2.04) correctly.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4 years agoMerge tag 'efi-2020-04-rc4-5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 23 Mar 2020 14:14:31 +0000 (10:14 -0400)]
Merge tag 'efi-2020-04-rc4-5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4 (5)

This series contains bug fixes for the UEFI sub-system:

* report correct variable length in GetNextVariable()
* correct copying direction if freestanding memmove()
* remove const for parameter of GetNextVariableName()
* correct function descriptions

Unit tests are added and adjusted.

4 years agoefi_loader: definition of GetNextVariableName()
Heinrich Schuchardt [Sun, 22 Mar 2020 17:28:20 +0000 (18:28 +0100)]
efi_loader: definition of GetNextVariableName()

'vendor' is both an input and an output parameter. So it cannot be
constant.

Fixes: 0bda81bfdc5c ("efi_loader: use const efi_guid_t * for variable services")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: test CalculateCrc32, CopyMem, SetMem
Heinrich Schuchardt [Sun, 22 Mar 2020 08:32:55 +0000 (09:32 +0100)]
efi_selftest: test CalculateCrc32, CopyMem, SetMem

Provide unit tests for CalculateCrc32(), CopyMem(), SetMem().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: fix freestanding memmove()
Heinrich Schuchardt [Sun, 22 Mar 2020 08:52:48 +0000 (09:52 +0100)]
efi_loader: fix freestanding memmove()

For EFI binaries we have to provide an implementation of memmove() in
efi_freestanding.c.

Before this patch the memmove() function was copying in the wrong
direction.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: description efi_convert_pointer()
Heinrich Schuchardt [Sun, 22 Mar 2020 07:28:15 +0000 (08:28 +0100)]
efi_loader: description efi_convert_pointer()

Correct the description of function efi_convert_pointer().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: simplify logical expression in efi_disk_add_dev()
Heinrich Schuchardt [Thu, 19 Mar 2020 14:45:52 +0000 (15:45 +0100)]
efi_loader: simplify logical expression in efi_disk_add_dev()

To check if a variable is non-zero there is no need for '!= 0'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: check length reported by GetNextVariableName()
Heinrich Schuchardt [Fri, 20 Mar 2020 18:20:17 +0000 (19:20 +0100)]
efi_selftest: check length reported by GetNextVariableName()

GetNextVariableName should report the length of the variable including the
final 0x0000 in bytes.

Check this in the unit test.

Increase the buffer size for variable names. 40 bytes is too short.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: correct reported length in GetNextVariable()
Heinrich Schuchardt [Fri, 20 Mar 2020 18:04:34 +0000 (19:04 +0100)]
efi_loader: correct reported length in GetNextVariable()

The runtime service GetNextVariable() returns the length of the next
variable including the closing 0x0000. This length should be in bytes.

Comparing the output of EDK2 and U-Boot shows that this is currently not
correctly implemented:

EDK2:
OsIndicationsSupported: 46
PlatformLang: 26
PlatformLangCodes: 36

U-Boot:
OsIndicationsSupported: 23
PlatformLang: 13
PlatformLangCodes: 18

Provide correct length in GetNextVariable().

Fixes: d99a87f84b75 ("efi_loader: implement GetNextVariableName()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: fix function descriptions in efi_disk.c
Heinrich Schuchardt [Thu, 19 Mar 2020 12:49:34 +0000 (13:49 +0100)]
efi_loader: fix function descriptions in efi_disk.c

Use Sphinx style for function descriptions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: description of efi_variable.c
Heinrich Schuchardt [Thu, 19 Mar 2020 17:15:18 +0000 (17:15 +0000)]
efi_loader: description of efi_variable.c

Correct the file description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Wed, 18 Mar 2020 11:48:53 +0000 (07:48 -0400)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

- Revert "sunxi: psci: avoid error address-of-packed-member"

4 years agoMerge tag 'efi-2020-04-rc4-4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 18 Mar 2020 11:48:39 +0000 (07:48 -0400)]
Merge tag 'efi-2020-04-rc4-4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4 (4)

This series fixes several bugs:

* consider the /reserved-memory node in the device tree
* consider memory reservations created in ft_board_setup()
* correct output of 'efidebug memmap' on the sandbox
* correct the definition of efi_capsule_header()

Furthermore some definitions needed for future patches are added to
header files.

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 18 Mar 2020 11:48:11 +0000 (07:48 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv

- Fix sbi_remote_sfence_vma{,_asid}.
- Avoid calling sbi_clear_ipi().
- Add new SBI v0.2 extensions support.

4 years agoRevert "sunxi: psci: avoid error address-of-packed-member"
Tomasz Duszynski [Sun, 16 Feb 2020 12:17:16 +0000 (13:17 +0100)]
Revert "sunxi: psci: avoid error address-of-packed-member"

Using memcpy() for some MMIO access is generally frowned upon and might
break things on some platforms. Allwinner H3, which fails to boot, being
an example here.

Moreover, fields being accessed are naturally aligned and warnings
produced by GCC have been quiesced for some time already by:

53dc8ae ("gcc-9: silence 'address-of-packed-member' warning")

That said, it should be okay to revert this commit.

This reverts commit 9bd34a69a453d409792e08c00953ce8862145e65.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
4 years agoMerge tag 'ti-v2020.07-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti...
Tom Rini [Tue, 17 Mar 2020 15:59:58 +0000 (11:59 -0400)]
Merge tag 'ti-v2020.07-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti into next

K3 J721E:
* OSPI boot support
* Support for loading remote cores in R5 SPL
* PMIC ESM Support
* Minor fixes for R5F and C7x remoteproc drivers

K3 AM654:
* Update AVS class 0 voltages.
* Add I2C nodes

DRA7xx/AM57xx:
* Fixed Android boot on AM57xx

AM33/AM43/Davinci:
* switch to driver model for the net and mdio driver for baltos
* Add DM/DTS support for omap video driver
* Enable fastboot on am335x-evm

4 years agoMerge tag '20200316-for-next' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 17 Mar 2020 15:33:59 +0000 (11:33 -0400)]
Merge tag '20200316-for-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c into next

i2c: for next
- i2c-gpio: make it possible to run deblock sequence on driver probe
- i2c-gpio: add clock stretching support
- updates the Designware I2C driver for high speed mode,
  fix a bug and add some improvements.
- add DM support for memory based bootcounter driver

4 years agoMerge branch '2020-03-16-kbuild-etc-resync-v4.18' into next
Tom Rini [Tue, 17 Mar 2020 13:54:45 +0000 (09:54 -0400)]
Merge branch '2020-03-16-kbuild-etc-resync-v4.18' into next

- Update our Kbuild / Kconfig and relate functionality to be in line
  with the Linux kernel v4.18 release.

4 years agoefi_loader: correct a definition of struct efi_capsule_header
AKASHI Takahiro [Tue, 17 Mar 2020 02:12:37 +0000 (11:12 +0900)]
efi_loader: correct a definition of struct efi_capsule_header

See UEFI specification, section 8.5.3.
In addition, the structure, efi_capsule_header, should be "packed"
as it is a serialized binary format in a capsule file.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
4 years agoefi_loader: export a couple of protocol related functions
AKASHI Takahiro [Tue, 17 Mar 2020 02:12:36 +0000 (11:12 +0900)]
efi_loader: export a couple of protocol related functions

This is a preparatory patch.
Those functions will be used in an implementation of UEFI firmware
management protocol as part of my capsule update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
4 years agoefi_loader: define System Resource Table macros
AKASHI Takahiro [Tue, 17 Mar 2020 02:12:35 +0000 (11:12 +0900)]
efi_loader: define System Resource Table macros

Some of those values will be used in an implementation of UEFI firmware
management protocol as part of my capsule update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
4 years agoefi_loader: define OsIndicationsSupported flags
AKASHI Takahiro [Tue, 17 Mar 2020 02:12:34 +0000 (11:12 +0900)]
efi_loader: define OsIndicationsSupported flags

These flags are expected to be set in OsIndicationsSupported variable
if corresponding features are supported. See UEFI specification,
section 8.5.4.

In particular, capsule-related flags will be used in my capsule
update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Fix misspelled EFI_OS_INDICATIONS_BOOT_TO_FW_UI.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: bootefi: Parse reserved-memory node from DT
Atish Patra [Sat, 14 Mar 2020 00:11:30 +0000 (17:11 -0700)]
cmd: bootefi: Parse reserved-memory node from DT

Currently, bootefi only parses memory reservation block to setup
EFI reserved memory mappings. However, it doesn't parse the
reserved-memory[1] device tree node that also can contain the
reserved memory regions.

Add capability to parse reserved-memory node and update the EFI memory
mappings accordingly.

1. <U-Boot source>/doc/device-tree-bindings/reserved-memory/reserved-memory.txt]

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Fix an endless loop.

The /reserved-memory node may have children without reg property. Remove
a superfluous debug statement.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: map addresses to sysmem in efidebug memmap
Heinrich Schuchardt [Sat, 14 Mar 2020 07:44:07 +0000 (08:44 +0100)]
cmd: map addresses to sysmem in efidebug memmap

Addresses in the sandbox's device tree are in the sandbox's virtual address
space. If we want to compare memory reservations in the device-tree with
the output of 'efidebug memmap', we need to convert back to this address
space.

Adjust the output of the 'efidebug memmap' command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: create reservations after ft_board_setup
Heinrich Schuchardt [Sat, 14 Mar 2020 09:59:34 +0000 (10:59 +0100)]
efi_loader: create reservations after ft_board_setup

Some memory reservations are made in ft_board_setup(). Ensure that we
create reserved memory map entries after ft_board_setup().

The downside of this patch is that if bootefi is called multiple times with
an devicetree argument superfluous reservations for the old copies of the
device tree will exist. But that is still better than missing a reservation.

Deleting the superfluous reservations is not possible because reservations
in the memory map are rounded to page size and may be coallesced.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoriscv: Implement new SBI v0.2 extensions
Bin Meng [Tue, 10 Mar 2020 02:35:31 +0000 (19:35 -0700)]
riscv: Implement new SBI v0.2 extensions

Few v0.1 SBI calls are being replaced by new SBI calls that follows
v0.2 calling convention.

Implement the replacement extensions and few additional new SBI
function calls that makes way for a better SBI interface in future.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
4 years agoriscv: Introduce a new config for SBI v0.1
Bin Meng [Tue, 10 Mar 2020 02:35:30 +0000 (19:35 -0700)]
riscv: Introduce a new config for SBI v0.1

We now have SBI v0.2 which is more scalable and extendable to handle
future needs for RISC-V supervisor interfaces.

Introduce a new config and move all SBI v0.1 code under that config.
This allows to implement the new replacement SBI extensions cleanly
and remove v0.1 extensions easily in future. Currently, the config
is enabled by default. Once all M-mode software, with v0.1, is no
longer in use, this config option and all relevant code can be easily
removed.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407361/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
4 years agoriscv: Add SBI v0.2 extension definitions
Bin Meng [Tue, 10 Mar 2020 02:35:29 +0000 (19:35 -0700)]
riscv: Add SBI v0.2 extension definitions

Few v0.1 SBI calls are being replaced by new SBI calls that follows
v0.2 calling convention.

This patch just defines these new extensions.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407359/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
4 years agoriscv: Add basic support for SBI v0.2
Bin Meng [Tue, 10 Mar 2020 02:35:28 +0000 (19:35 -0700)]
riscv: Add basic support for SBI v0.2

The SBI v0.2 introduces a base extension which is backward compatible
with v0.1. Implement all helper functions and minimum required SBI
calls from v0.2 for now. All other base extension function will be
added later as per need.

As v0.2 calling convention is backward compatible with v0.1, remove
the v0.1 helper functions and just use v0.2 calling convention.

Add a new Kconfig options CONFIG_SBI for the new SBI v0.2 codes, and
let CONFIG_SBI_IPI depend on it.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407363/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
4 years agoriscv: Mark existing SBI as v0.1 SBI
Bin Meng [Tue, 10 Mar 2020 02:35:27 +0000 (19:35 -0700)]
riscv: Mark existing SBI as v0.1 SBI

As per the new SBI specification, current SBI implementation version
is defined as 0.1 and will be removed/replaced in future. Each of the
function call in 0.1 is defined as a separate extension which makes
easier to replace them one at a time.

Rename existing implementation to reflect that. This patch is just
a preparatory patch for SBI v0.2 and doesn't introduce any functional
changes.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407355/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
4 years agoriscv: Avoid calling sbi_clear_ipi()
Bin Meng [Fri, 6 Mar 2020 08:44:17 +0000 (00:44 -0800)]
riscv: Avoid calling sbi_clear_ipi()

There is no need for S-mode U-Boot to call sbi_clear_ipi() as it
can be cleared directly from S-mode. This saves some cycles.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas@auer.io>
4 years agoriscv: Fix sbi_remote_sfence_vma{,_asid}
Bin Meng [Fri, 6 Mar 2020 08:44:16 +0000 (00:44 -0800)]
riscv: Fix sbi_remote_sfence_vma{,_asid}

Currently sbi_remote_sfence_vma{,_asid} does not pass their arguments
to SBI at all, which is semantically incorrect.

This keeps in sync with Linux kernel commit:
  a21344dfc6ad: fix sbi_remote_sfence_vma{,_asid}

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas@auer.io>
4 years agoconfigs: Drop '$(ARCH)' usage in CONFIG_SPL_LDSCRIPT
Tom Rini [Wed, 11 Mar 2020 22:11:18 +0000 (18:11 -0400)]
configs: Drop '$(ARCH)' usage in CONFIG_SPL_LDSCRIPT

In a few boards we had overridden, intentionally, the value used for
CONFIG_SPL_LDSCRIPT.  However, rather than using the ARCH value (arm)
they used the $(ARCH) variable in make.  This doesn't help really, so
switch to a hard-coded value.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agokconfig / kbuild: re-sync with Linux 4.18
Tom Rini [Wed, 11 Mar 2020 22:11:17 +0000 (18:11 -0400)]
kconfig / kbuild: re-sync with Linux 4.18

Align Kconfig and Kbuild logic to Linux 4.18 release with minimal impact
on files outside of this scope.

Our previous Kconfig sync was done by commit e91610da7c8a ("kconfig:
re-sync with Linux 4.17-rc4").

A very small number of changes upstream since our sync with v4.17-rc4
that exist in the v4.18 release have already been applied here and have
been omitted from the list in this commit (and are readily available in
our own git history).

The imported Linux commits are:
[From prior to v4.17-rc4]
39a33ff80a25 kbuild: remove cc-option-align
db547ef19064 Kbuild: don't add obj tree in additional includes
b999596b963a Kbuild: don't add ../../ to include path

[From v4.17 to v4.18]
b3aa58d2e85d fixdep: suppress consecutive / from file paths in dependency list files
74656b682902 kbuild: disable new dtc graph and unit-address warnings
74d931716151 genksyms: remove symbol prefix support
e6ecfb45072c kbuild: do not display CHK for filechk
0b669a5076fd kconfig: refactor Qt package checks for building qconf
b464ef583dc7 kconfig: refactor GTK+ package checks for building gconf
1c5af5cf9308 kconfig: refactor ncurses package checks for building mconf and nconf
694c49a7c01c kconfig: drop localization support
96f60dfa5819 trace: Use -mcount-record for dynamic ftrace
bb222ceeb327 kconfig: remove string expansion in file_lookup()
96d8e48da55a kconfig: remove string expansion for mainmenu after yyparse()
5b31a9746756 kconfig: remove sym_expand_string_value()
137c0118a900 kconfig: make default prompt of mainmenu less specific
e298f3b49def kconfig: add built-in function support
2fd5b09c201e kconfig: add 'shell' built-in function
9de071536c87 kconfig: begin PARAM state only when seeing a command keyword
9ced3bddec08 kconfig: support user-defined function and recursively expanded variable
1175c02506ff kconfig: support simply expanded variable
ed2a22f277c6 kconfig: support append assignment operator
82bc8bd82e5c kconfig: expand lefthand side of assignment statement
1d6272e6fe43 kconfig: add 'info', 'warning-if', and 'error-if' built-in functions
a702a6176e2f kconfig: add 'filename' and 'lineno' built-in variables
915f64901eb3 kconfig: error out if a recursive variable references itself
2bece88f89fa kconfig: test: add Kconfig macro language tests
21c54b774744 kconfig: show compiler version text in the top comment
59f7b5847b0c kbuild: $(CHECK) doesnt need NOSTDINC_FLAGS twice
145167650b96 kbuild: add endianness flag to CHEKCFLAGS
1f2f01b122d7 kbuild: add machine size to CHECKFLAGS
d6a0c8a1326b kconfig: Add testconfig into make help output
bb6d83dde191 kbuild: Move last word of nconfig help to the previous line
8593080c0fcf kconfig: fix localmodconfig
ed7d40bc67b8 tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount
b2d00d7c61c8 kconfig: fix line numbers for if-entries in menu tree
ecd53ac2f2c6 kconfig: handle P_SYMBOL in print_symbol()
73d1c580f92b kconfig: loop boundary condition fix
48f6e3cf5bc6 kbuild: do not drop -I without parameter
bd412d81b7ea kbuild: .PHONY is not a variable, but PHONY is
6916162c7308 kbuild: remove duplicated comments about PHONY

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agoscripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc
Rob Herring [Wed, 11 Mar 2020 22:11:16 +0000 (18:11 -0400)]
scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc

This adds the following commits from upstream:

84e414b0b5bc tests: Add a test case for the omit-if-no-ref keyword
4038fd90056e dtc: add ability to make nodes conditional on them being referenced
e1f139ea4900 checks: drop warning for missing PCI bridge bus-range
f4eba68d89ee checks: Print duplicate node name instead of parent name
46df1fb1b211 .travis.yml: Run valgrind checks via Travis
14a3002a1aee tests: Update valgrind suppressions for sw_tree1
02c5fe9debc0 tests: Remove valgrind error from tests/get_path
df536831d02c checks: add graph binding checks
2347c96edcbe checks: add a check for duplicate unit-addresses of child nodes
8f1b35f88395 Correct overlay syntactic sugar for generating target-path fragments
afbddcd418fb Suppress warnings on overlay fragments
119e27300359 Improve tests for dtc overlay generation

[From Linux Kernel commit 50aafd60898a8b3edf2f60e014a8288da3b2e5e3]
Signed-off-by: Rob Herring <robh@kernel.org>
[For applying to U-Boot]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoAzure / GitLab / Travis: Add Kconfig unit tests to a job
Tom Rini [Wed, 11 Mar 2020 22:11:15 +0000 (18:11 -0400)]
Azure / GitLab / Travis: Add Kconfig unit tests to a job

The Kconfig language provides a unit test that can be run.  As these
require pytest to be installed and run very quickly, bundle them in to
an existing CI job.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agomach-davinci: Hard-code the default SPL_LDSCRIPT path
Tom Rini [Wed, 11 Mar 2020 22:11:14 +0000 (18:11 -0400)]
mach-davinci: Hard-code the default SPL_LDSCRIPT path

As there is only one linker script to use in this case, rather than use
the BOARDDIR variable hard-code the path.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agoedminiv2: Move CONFIG_SPL_LDSCRIPT to defconfig
Tom Rini [Wed, 11 Mar 2020 22:11:13 +0000 (18:11 -0400)]
edminiv2: Move CONFIG_SPL_LDSCRIPT to defconfig

As there is only one machine under mach-orion5x, having a Kconfig entry
for SPL_LDSCRIPT is not helpful, move this to the defconfig file.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agomx31pdk: Move CONFIG_SPL_LDSCRIPT to defconfig
Tom Rini [Mon, 24 Feb 2020 18:05:36 +0000 (13:05 -0500)]
mx31pdk: Move CONFIG_SPL_LDSCRIPT to defconfig

As there is only one mx31pdk config file and with upcoming updates to
the Kconfig parsing logic, rather than have an entry in
board/freescale/mx31pdk/Kconfig, move this single setting to the
defconfig file.

Cc: Magnus Lilja <lilja.magnus@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Magnus Lilja <lilja.magnus@gmail.com>
4 years agoKconfig: Remove redundant variable sets
Tom Rini [Wed, 11 Mar 2020 22:11:12 +0000 (18:11 -0400)]
Kconfig: Remove redundant variable sets

In a few places we have Kconfig entries that set SPL_LDSCRIPT to what is
the default value anyways.  Drop these.

Cc: Michal Simek <monstr@monstr.eu>
Cc: Rick Chen <rick@andestech.com>
Cc: Philippe Reynes <tremyfr@yahoo.fr>
Cc: Eric Jarrige <eric.jarrige@armadeus.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com> (for Microblaze)
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agospl: Kconfig: Escape '$(ARCH)' in LDSCRIPT entries
Tom Rini [Wed, 11 Mar 2020 22:11:11 +0000 (18:11 -0400)]
spl: Kconfig: Escape '$(ARCH)' in LDSCRIPT entries

The default SPL / TPL linker script is in the $(ARCH) directory.  The
way we use this today works but isn't ideal.  With an update to Kconfig
to re-sync with the Linux Kernel, we need to escape the '$' here so that
it will end up being evaluated by make.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agokbuild: remove unused dtc-version.sh script
Masahiro Yamada [Tue, 25 Feb 2020 23:02:24 +0000 (08:02 +0900)]
kbuild: remove unused dtc-version.sh script

This is U-Boot own code, and no longer used since commit 36dd5f1b8abc
("dtc: Switch to building and using our own dtc unless provided").

Prior to that commit, U-Boot relied on an external dtc, so this script
was used to check the dtc version.

Now U-Boot bundles our own dtc in script/dtc/dtc like Linux kernel.

Users are still allowed to pass DTC= option from the command line,
but they are supposed to choose correct version of dtc in this case.
So, we do not check the dtc version any more.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agospl.h: make <spl.h> self-contained
Masahiro Yamada [Mon, 24 Feb 2020 17:25:46 +0000 (02:25 +0900)]
spl.h: make <spl.h> self-contained

The static inline function spl_phase needs <asm/global_data.h>.

Some functions take pointers to struct blk_desc or image_header.
Add forward declarations.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodebug_uart.h: make <debug_uart.h> self-contained
Masahiro Yamada [Mon, 24 Feb 2020 17:24:54 +0000 (02:24 +0900)]
debug_uart.h: make <debug_uart.h> self-contained

'uint' is not a primitive type. You need to include <linux/types.h>
or otherwise change it to (unsigned int).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoasm-generic/u-boot.h: make <asm-generic/u-boot.h> self-contained
Masahiro Yamada [Mon, 24 Feb 2020 17:24:17 +0000 (02:24 +0900)]
asm-generic/u-boot.h: make <asm-generic/u-boot.h> self-contained

This header uses 'phys_addr_t' and 'ulong'. Include the definitions.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
[trini: Move include to below __ASSEMBLY__ test]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoglobal_data.h: make <asm-generic/global_data.h> self-contained
Masahiro Yamada [Mon, 24 Feb 2020 17:22:27 +0000 (02:22 +0900)]
global_data.h: make <asm-generic/global_data.h> self-contained

The compiler never knows what 'bd_t' is without including <asm/u-boot.h>.

By changing it to (struct bd_info), the compiler learns it is struct.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agoscripts/Makefile.lib: Re-add -Wno-simple_bus_reg to DTC_FLAGS
Tom Rini [Mon, 24 Feb 2020 17:50:35 +0000 (12:50 -0500)]
scripts/Makefile.lib: Re-add -Wno-simple_bus_reg to DTC_FLAGS

This exists in Linux Kernel with commit 70523a3ce5ff so put it in the
list of DTC_FLAGS that mirror Linux as we will catch up there.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agoscripts/Makefile.lib: Restore PCI related warnings to DTC_FLAGS
Tom Rini [Mon, 24 Feb 2020 17:50:34 +0000 (12:50 -0500)]
scripts/Makefile.lib: Restore PCI related warnings to DTC_FLAGS

While we are working on correcting usage related to the pci_bridge and
pci_device_bus_num warnings, disable these flags for now.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agokbuild: Re-sync DTC flag logic with v4.17
Tom Rini [Mon, 24 Feb 2020 17:50:33 +0000 (12:50 -0500)]
kbuild: Re-sync DTC flag logic with v4.17

The way that we have been handling additional DTC warning flags hasn't
matched the way the Linux Kernel does.  Resync this logic with v4.17.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agokbuild: fixdep: Resync this with v4.17
Tom Rini [Mon, 24 Feb 2020 17:50:32 +0000 (12:50 -0500)]
kbuild: fixdep: Resync this with v4.17

The previous kbuild resync of e91610da7c8a ("kconfig: re-sync with Linux
4.17-rc4") accidentally did not sync the fixdep program.  This commit
brings fixdep in line with the rest of that previous resync.

This includes all of the following Linux kernel commits:
fbfa9be9904e kbuild: move include/config/ksym/* to include/ksym/*
5b8ad96d1a44 fixdep: remove some false CONFIG_ matches
14a596a7e6fd fixdep: remove stale references to uml-config.h
ab9ce9feed36 fixdep: use existing helper to check modular CONFIG options
87b95a81357d fixdep: refactor parse_dep_file()
5d1ef76f5a22 fixdep: move global variables to local variables of main()
ccfe78873c22 fixdep: remove unneeded memcpy() in parse_dep_file()
4003fd80cba9 fixdep: factor out common code for reading files
01b5cbe7012f fixdep: use malloc() and read() to load dep_file to buffer
41f92cffba19 fixdep: remove unnecessary <arpa/inet.h> inclusion
7c2ec43a2154 fixdep: exit with error code in error branches of do_config_file()
4e433fc4d1a9 fixdep: trivial: typo fix and correction
dee81e988674 fixdep: faster CONFIG_ search
c1a95fda2a40 kbuild: add fine grained build dependencies for exported symbols
d8329e35cc08 fixdep: accept extra dependencies on stdin
4c835b57b8de fixdep: constify strrcmp arguments

Of note is that when applying dee81e988674 above our logic in that area
required some careful consideration to continue to apply.

[Fold in bugfix to allow us to include 638e69cf2230 from upstream]
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
[Merge everything to U-Boot, rework dee81e988674]
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agofixdep: fix U-Boot own code to handle only valid symbol characters
Masahiro Yamada [Tue, 18 Feb 2020 11:05:39 +0000 (20:05 +0900)]
fixdep: fix U-Boot own code to handle only valid symbol characters

Currently, fixdep skips parsing include/linux/kconfig.h, but if it
parsed it, it would translate the following code in kconfig.h

  config_enabled(CONFIG_VAL(option##_MODULE)

into:

  $(wildcard include/config/option##/module.h)

When Kbuild includes .*.cmd, it would emit the following error:

  *** unterminated call to function 'wildcard': missing ')'.  Stop.

This issue prevents us from importing the upstream Linux commit
638e69cf2230 ("fixdep: do not ignore kconfig.h").

Fix this by handling only alphanumerical characters and underscores.
This makes sense because they match to the valid character sets in
Kconfig symbols.

As a side-note, you can reproduce this issue only on GNU Make <= 4.2.1

For GNU Make <= 4.2.1, the '#' always means the start of a comment.
Hence, GNU Make thinks the closing ')' is missing.

The following commit in GNU Make changed how it handles '#' in
function invocations. So, this does not happen for GNU Make 4.3

| commit c6966b323811c37acedff05b576b907b06aea5f4
| Author: Paul Smith <psmith@gnu.org>
| Date:   Thu Dec 22 18:47:26 2016 -0500
|
|    [SV 20513] Un-escaped # are not comments in function invocations

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reported-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 16 Mar 2020 16:33:24 +0000 (12:33 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Fix timer wrap (Chris)
- Use dev_read only if OF_PLATDATA is not enabled (Walter)