]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
4 years agoMAINTAINERS: Add Dario and Michael as NAND maintainers
Michael Trimarchi [Wed, 29 Jun 2022 15:57:51 +0000 (17:57 +0200)] 
MAINTAINERS: Add Dario and Michael as NAND maintainers

Both of us are working on NAND subsystem on several architectures and
we have boards and projects to improve the subsystem in uboot. The idea
is to guarantee quick feedback on patches sent on mailing list and most
of the time the possibilities to test them.

Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Tom Rini <trini@konsulko.com>
4 years agoboard/BuR/*: replace maintainer of BuR boards
Hannes Schmelzer [Wed, 29 Jun 2022 10:11:40 +0000 (12:11 +0200)] 
board/BuR/*: replace maintainer of BuR boards

Since I'm leaving the company with end of June, the maintainership will
be transferred to Wolfgang Wallner.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
4 years agochameleonv3: Add MAINTAINERS file
Tom Rini [Fri, 1 Jul 2022 19:55:54 +0000 (15:55 -0400)] 
chameleonv3: Add MAINTAINERS file

This file was missing, add.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge commit 'ef5ba2cef4a08b68caaa9215fcac142d3025bbf7' of https://github.com/tienfon...
Tom Rini [Fri, 1 Jul 2022 13:14:32 +0000 (09:14 -0400)] 
Merge commit 'ef5ba2cef4a08b68caaa9215fcac142d3025bbf7' of https://github.com/tienfong/uboot_mainline

4 years agoMerge tag 'u-boot-amlogic-20220701' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 1 Jul 2022 13:13:58 +0000 (09:13 -0400)] 
Merge tag 'u-boot-amlogic-20220701' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- search dtb for meson-axg-usb-ctrl on board axg

4 years agodrivers: clk: Update license for Intel N5X device
Teik Heng Chong [Wed, 29 Jun 2022 05:51:50 +0000 (13:51 +0800)] 
drivers: clk: Update license for Intel N5X device

All the source code of clk-mem-n5x.c and clk-n5x.c are from Intel,
update the license to use both GPL2.0 and BSD-3 Clause because this
copy of code may used for open source and internal project.

Signed-off-by: Teik Heng Chong <teik.heng.chong@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
4 years agosocfpga: arria10: Allow dcache_enable before relocation
Paweł Anikiel [Fri, 17 Jun 2022 10:47:26 +0000 (12:47 +0200)] 
socfpga: arria10: Allow dcache_enable before relocation

Before relocating to SDRAM, the ECC is initialized by clearing the
whole SDRAM. In order to speed this up, dcache_enable is used (see
sdram_init_ecc_bits).

Since commit 503eea451903 ("arm: cp15: update DACR value to activate
access control"), this no longer works, because running code in OCRAM
with the XN bit set causes a page fault. Override dram_bank_mmu_setup
to disable XN in the OCRAM and setup DRAM dcache before relocation.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosocfpga: arria10: Wait for fifo empty after writing bitstream
Paweł Anikiel [Fri, 17 Jun 2022 10:47:25 +0000 (12:47 +0200)] 
socfpga: arria10: Wait for fifo empty after writing bitstream

For some reason, on the Mercury+ AA1 module, calling
fpgamgr_wait_early_user_mode immediately after writing the peripheral
bitstream leaves the fpga in a broken state (ddr calibration hangs).
Adding a delay before the first sync word is written seems to fix this.
Inspecting the fpgamgr registers before and after the delay,
imgcfg_FifoEmpty is the only bit that changes. Waiting for this bit
(instead of a hardcoded delay) also fixes the issue.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosocfpga: arria10: Improve bitstream loading speed
Paweł Anikiel [Fri, 17 Jun 2022 10:47:24 +0000 (12:47 +0200)] 
socfpga: arria10: Improve bitstream loading speed

Apply some optimizations to speed up bitstream loading
(both for full and split periph/core bitstreams):

 * Change the size of the first fs read, so that all the subsequent
   reads are aligned to a specific value (called MAX_FIRST_LOAD_SIZE).
   This value was chosen so that in subsequent reads the fat fs driver
   doesn't have to allocate a temporary buffer in get_contents
   (assuming 8KiB clusters).

 * Change the buffer size to a larger value when reading to ddr
   (but not too large, because large transfers cause a stack overflow
   in the dwmmc driver).

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agosocfpga: arria10: Replace delays with busy waiting in cm_full_cfg
Paweł Anikiel [Fri, 17 Jun 2022 10:47:23 +0000 (12:47 +0200)] 
socfpga: arria10: Replace delays with busy waiting in cm_full_cfg

Using udelay while the clocks aren't fully configured causes the timer
system to save the wrong clock rate. Use sdelay and wait_on_value
instead (the values used in these functions were found experimentally).

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
4 years agosysreset: socfpga: Use parent device for reading base address
Paweł Anikiel [Fri, 17 Jun 2022 10:47:22 +0000 (12:47 +0200)] 
sysreset: socfpga: Use parent device for reading base address

This driver is a child of the rstmgr driver, both of which share the
same devicetree node. As a result, passing the child's udevice pointer
to dev_read_addr_ptr results in a failure of reading the #address-cells
property. Use the parent udevice pointer instead.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agomisc: atsha204a: Increase wake delay by tWHI
Paweł Anikiel [Fri, 17 Jun 2022 10:47:21 +0000 (12:47 +0200)] 
misc: atsha204a: Increase wake delay by tWHI

From the ATSHA204A datasheet (document DS40002025A):

Wake: If SDA is held low for a period greater than tWLO, the device
exits low-power mode and, after a delay of tWHI, is ready to receive
I2C commands.

tWHI value can be found in table 7-2.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfig: Add Chameleonv3 config
Paweł Anikiel [Fri, 17 Jun 2022 10:47:20 +0000 (12:47 +0200)] 
config: Add Chameleonv3 config

Add defconfig and Kconfig files for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: Add Chameleonv3 board dir
Paweł Anikiel [Fri, 17 Jun 2022 10:47:19 +0000 (12:47 +0200)] 
board: Add Chameleonv3 board dir

Add board directory for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarm: dts: Add Chameleonv3 devicetrees
Paweł Anikiel [Fri, 17 Jun 2022 10:47:18 +0000 (12:47 +0200)] 
arm: dts: Add Chameleonv3 devicetrees

Add devicetrees for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarm: dts: Add Chameleonv3 handoff headers
Paweł Anikiel [Fri, 17 Jun 2022 10:47:17 +0000 (12:47 +0200)] 
arm: dts: Add Chameleonv3 handoff headers

Add handoff headers for the Google Chameleonv3 variants: 480-2 and
270-3. Both files were generated using qts-filter-a10.sh.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarm: dts: Add Mercury+ AA1 devicetrees
Paweł Anikiel [Fri, 17 Jun 2022 10:47:16 +0000 (12:47 +0200)] 
arm: dts: Add Mercury+ AA1 devicetrees

Devicetree headers for Mercury+ AA1 module

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge tag 'u-boot-rockchip-20220630' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 1 Jul 2022 02:36:41 +0000 (22:36 -0400)] 
Merge tag 'u-boot-rockchip-20220630' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Fix for rk3328 nonopi-r2s boot env;
- Fix for rk8xx pmic boot on power plug-in;
- Fix for tee.bin support in fit image;
- rk3288 board dts update or fix;
- Some rk3399 board fix;

4 years agoMerge tag 'u-boot-at91-2022.10-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 30 Jun 2022 19:21:52 +0000 (15:21 -0400)] 
Merge tag 'u-boot-at91-2022.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

First set of u-boot-at91 features for the 2022.10 cycle:

This feature set includes mostly fixes and alignments: DT alignment with
Linux for sama7g5, removal of invalid eeprom compatibles, removal of
extra debug_uart_init calls for all at91 boards, support for pio4 driver
pioE bank, and other minor fixes and enhancements for sam9x60 and
sama5d2_icp boards.

4 years agoMerge tag 'versal-qspi-for-v2022.10' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 30 Jun 2022 13:32:15 +0000 (09:32 -0400)] 
Merge tag 'versal-qspi-for-v2022.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next

Versal QSPI/OSPI changes for v2022.10

- Add new flash types
- Add cadence ospi driver for Xilinx Versal

4 years agogpio: atmel_pio4: add support for PIO_PORTE
Mihai Sain [Wed, 25 May 2022 10:32:08 +0000 (13:32 +0300)] 
gpio: atmel_pio4: add support for PIO_PORTE

Add support for gpio PORT E, which is available on e.g. sama7g5 SoC.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
4 years agoMerge branch '2022-06-28-Kconfig-migrations' into next
Tom Rini [Wed, 29 Jun 2022 13:54:02 +0000 (09:54 -0400)] 
Merge branch '2022-06-28-Kconfig-migrations' into next

- Convert a large number of CONFIG symbols to Kconfig.  Of note is a
  large chunk of USB symbols (and dead code removal), ensuring all
  SPL/TPL/VPL symbols have an appropriate dependency, largely (but not
  entirely) removing the testing of CONFIG_SPL_BUILD in board headers,
  and allowing CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS to
  co-exist as this facilities migration of many platforms.

4 years agospi: cadence-qspi: Fix programming ospi flash speed
T Karthik Reddy [Thu, 12 May 2022 10:05:35 +0000 (04:05 -0600)] 
spi: cadence-qspi: Fix programming ospi flash speed

When the requested flash speed is 0, the baudrate division for the
requested speed causing drop in the performance. So set the ospi flash
to operate at max frequency when requested speed is zero.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220512100535.16364-6-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agospi: cadence_qspi: Enable apb linear mode for apb read & write operations
T Karthik Reddy [Thu, 12 May 2022 10:05:34 +0000 (04:05 -0600)] 
spi: cadence_qspi: Enable apb linear mode for apb read & write operations

On versal platform, enable apb linear mode for apb read and write
execute operations amd disable it when using dma reads. This is done by
xilinx_pm_request() secure calls when CONFIG_ZYNQMP_FIRMWARE is enabled,
else we use direct raw reads and writes in case of mini U-Boot.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220512100535.16364-5-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agospi: cadence-qspi: reset qspi flash for versal platform
T Karthik Reddy [Thu, 12 May 2022 10:05:33 +0000 (04:05 -0600)] 
spi: cadence-qspi: reset qspi flash for versal platform

When flash operated at non default mode like DDR, flash need to be reset
to operate in SDR mode to read flash ids by spi-nor framework. Reset the
flash to the default state before using the flash. This reset is handled
by a gpio driver, in case of mini U-Boot as gpio driver is disabled, we
do raw read and write access by the registers.
Versal platform utilizes spi calibration for read delay programming, so
incase by default read delay property is set in DT. We make sure not to
use read delay from DT by overwriting read_delay with -1.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220512100535.16364-4-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agoarm64: versal: Add versal specific cadence ospi driver
T Karthik Reddy [Thu, 12 May 2022 10:05:32 +0000 (04:05 -0600)] 
arm64: versal: Add versal specific cadence ospi driver

Add support for cadence ospi driver for Versal platform. This driver
provides support for DMA read operation which utilizes cadence qspi
driver.
If "cdns,is-dma" DT property is specified use dma for read operation
from cadence_qspi driver. As cadence_qspi_apb_dma_read() is defined in
cadence_ospi_versal driver add a weak function defination in
cadence_qspi driver.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220512100535.16364-3-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agospi: cadence-qspi: move cadence qspi macros to header file
T Karthik Reddy [Thu, 12 May 2022 10:05:31 +0000 (04:05 -0600)] 
spi: cadence-qspi: move cadence qspi macros to header file

Move all the cadence macros from cadence_qspi_apb.c to cadence_qspi.h
file.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220512100535.16364-2-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agomtd: spi-nor-ids: Add support for flashes tested by xilinx
Ashok Reddy Soma [Wed, 25 May 2022 05:17:12 +0000 (10:47 +0530)] 
mtd: spi-nor-ids: Add support for flashes tested by xilinx

Add support for various flashes from below manufacturers which are tested
by xilinx for years.

EON:
en25q128b
GIGA:
gd25lx256e
ISSI:
is25lp008
is25lp016
is25lp01g
is25wp008
is25wp016
is25wp01g
is25wx256
MACRONIX:
mx25u51245f
mx66u1g45g
mx66l2g45g
MICRON:
mt35xl512aba
mt35xu01g
SPANSION:
s70fs01gs_256k
SST:
sst26wf016b
WINBOND:
w25q16dw
w25q16jv
w25q512jv
w25q32bv
w25h02jv

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1653455832-14763-1-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agomtd: mxs_nand_spl: fix nand_command protocol violation
Andrea Scian [Tue, 21 Jun 2022 20:05:10 +0000 (22:05 +0200)] 
mtd: mxs_nand_spl: fix nand_command protocol violation

mxs_nand_command() implementation assume that it's working with a
LP NAND, which is a common case nowadays and thus uses two bytes
for column address.

However this is wrong for NAND_CMD_READID and NAND_CMD_PARAM, which
expects only one byte of column address, even for LP NANDs.
This leads to ONFI detection problem with some NAND manufacturer (like
Winbond) but not with others (like Samsung and Spansion)

We fix this with a simple workaround to avoid the 2nd byte column address
for those two commands.

Also align the code with nand_base to support 16 bit devices.

Tested on an iMX6SX device with:
* Winbond W29N04GVSIAA
* Spansion S34ML04G100TF100
* Samsung K9F4G08U00

Tested on imx8mn device with:
* Windbond W29N04GV

Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
CC: Stefano Babic <sbabic@denx.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
4 years agorockchip: pinebook-pro: sync PBP dtb to 5.18
Peter Robinson [Sun, 12 Jun 2022 14:25:29 +0000 (15:25 +0100)] 
rockchip: pinebook-pro: sync PBP dtb to 5.18

Sync the pinebook pro to upstream 5.18, in particular this brings
brings in a fix so the DP is disabled so Linux will actually boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: rockpro64: enable leds
Peter Robinson [Sun, 12 Jun 2022 13:52:25 +0000 (14:52 +0100)] 
rockchip: rockpro64: enable leds

The Rockpro64 has some GPIO leds so let's enable them so the
user gets some output in early boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: pinebook-pro: minor SPI flash fixes
Peter Robinson [Sun, 12 Jun 2022 13:47:14 +0000 (14:47 +0100)] 
rockchip: pinebook-pro: minor SPI flash fixes

Set a default offset for environment so it doesn't write it to
unexpected locations, drop unneeded mtd config option.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: Add option to prevent booting on power plug-in
Chris Morgan [Fri, 27 May 2022 18:18:20 +0000 (13:18 -0500)] 
rockchip: Add option to prevent booting on power plug-in

For Rockchip boards with the all rk8xx series PMICs (excluding the
rk808), it is sometimes desirable to not boot whenever the device is
plugged in. An example would be for the Odroid Go Advance.

This provides a configurable option to check the PMIC says it was
powered because of a plug-in event. If the value is 1 and this option
is selected, the device shuts down shortly after printing a message
to console stating the reason why it's shutting down. Powering up the
board with the power button is not affected.

This patch parallels the work done in the following patch series:
https://lore.kernel.org/u-boot/20220121133732.2397273-1-andre.przywara@arm.com/

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agopower: pmic: rk8xx: Support sysreset shutdown method
Chris Morgan [Fri, 27 May 2022 18:18:19 +0000 (13:18 -0500)] 
power: pmic: rk8xx: Support sysreset shutdown method

Add support for sysreset shutdown for this PMIC. The values were pulled
from the various datasheets, but for now it has only been tested on
the rk817 (for an Odroid Go Advance).

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agomach-rockchip: make_fit_atf.py: support OP-TEE tee.bin v1 format
Jerome Forissier [Wed, 11 May 2022 15:35:14 +0000 (17:35 +0200)] 
mach-rockchip: make_fit_atf.py: support OP-TEE tee.bin v1 format

This commit adds support for the OP-TEE 'tee.bin' v1 format for Rockchip
platforms.

Since OP-TEE 3.8.0, tee.bin contains meta-data in a proprietary format
in addition to the ELF data. They are essential information for proper
initialization of the TEE core, such as the size of the memory region
covered by the TEE or a compact representation of runtime relocation
data when ASLR is enabled.

With OP-TEE 3.8.0 onwards, 'tee.elf' MUST NOT be used and 'tee.bin'
MUST be used instead. Ignoring this recommendation can lead to crashes
as described in [3].

Link: [1] https://github.com/OP-TEE/optee_os/commit/5dd1570ac5b0f6563b1a9c074533a19107b8222d
Link: [2] https://github.com/OP-TEE/optee_os/blob/3.17.0/scripts/gen_tee_bin.py#L275-L302
Link: [3] https://github.com/OP-TEE/optee_os/issues/4542
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
4 years agorockchip: rk3328: nanopi-r2s: Use the sdcard for the env
Emmanuel Vadot [Tue, 3 May 2022 18:41:04 +0000 (20:41 +0200)] 
rockchip: rk3328: nanopi-r2s: Use the sdcard for the env

The NanoPi-R2S doesn't have eMMC so use the sdcard as the device
to save the environment variables

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoarm: dts: rockchip: rk3288: move dma-controller nodes
Johan Jonker [Mon, 2 May 2022 11:22:55 +0000 (13:22 +0200)] 
arm: dts: rockchip: rk3288: move dma-controller nodes

In order to better compare the Linux rk3288.dtsi version
with the u-boot version move the dma-controller nodes
to the DT root.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoarm: dts: rockchip: rk3288: sort mipi hdmi lvds and dp nodes
Johan Jonker [Mon, 2 May 2022 10:19:34 +0000 (12:19 +0200)] 
arm: dts: rockchip: rk3288: sort mipi hdmi lvds and dp nodes

In order to better compare the Linux rk3288.dtsi version
with the u-boot version sort the mipi,hdmi,lvds and dp nodes.

Changed:
  Rename mipi_dsi label.
  Rename dp nodename.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoarm: dts: rockchip: rk3288: bulk convert gpios to their constant counterparts
Johan Jonker [Mon, 2 May 2022 08:58:27 +0000 (10:58 +0200)] 
arm: dts: rockchip: rk3288: bulk convert gpios to their constant counterparts

Bulk convert rk3288 DT gpios to their constant counterparts.

Partial Linux sync for the rk3288.dtsi file.

ARM: dts: rockchip: bulk convert gpios to their constant counterparts
https://lore.kernel.org/all/20190402121852.14442-1-heiko@sntech.de/

sed -i -f script.sed rk3288.dtsi

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agoarm: dts: rockchip: remove usb-phy fallback string for rk3188
Johan Jonker [Fri, 29 Apr 2022 21:40:08 +0000 (23:40 +0200)] 
arm: dts: rockchip: remove usb-phy fallback string for rk3188

With the conversion of rockchip-usb-phy.yaml a long time used fallback
string for rk3066a/rk3188 was added. The linux driver doesn't do much with
the GRF phy address range, however the u-boot driver rockchip_usb2_phy.c
does. The bits in GRF_UOC0_CON2 for rk3066a/rk3188 and rk3288 for example
don't match. Remove the usb-phy fallback string for rk3188
to prevent possible strange side effects.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: board: change condition board_usb_init() in function
Johan Jonker [Fri, 29 Apr 2022 21:40:07 +0000 (23:40 +0200)] 
rockchip: board: change condition board_usb_init() in function

Change define condition in board_usb_init() function
to allow rk3066/rk3188 to use the USB PHY driver.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: usb: phy: add rk3066/rk3188 support
Johan Jonker [Fri, 29 Apr 2022 21:40:06 +0000 (23:40 +0200)] 
rockchip: usb: phy: add rk3066/rk3188 support

Add rk3066a/rk3188 support to rockchip_usb2_phy.c
They don't have completely identical usb phy registers,
so separate comapatible strings and data.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: usb: gadget: add rk3066 product id
Paweł Jarosz [Fri, 29 Apr 2022 21:40:05 +0000 (23:40 +0200)] 
rockchip: usb: gadget: add rk3066 product id

Product id of rk3066 usb otg is 0x300a.

Signed-off-by: Paweł Jarosz <paweljarosz3691@gmail.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: include: configs: remove unused configs for tag and size
Johan Jonker [Wed, 20 Apr 2022 12:54:10 +0000 (14:54 +0200)] 
rockchip: include: configs: remove unused configs for tag and size

The configs ROCKCHIP_CHIP_TAG and ROCKCHIP_MAX_INIT_SIZE were
originally added with rksd.c, rkspi.c and rkcommon.c in mind,
but are no longer in use and replaced by struct spl_info,
so remove unused configs for tag and size.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agophycore-rk3288: Avoid enabling partition support in SPL
Simon Glass [Fri, 11 Mar 2022 19:10:04 +0000 (12:10 -0700)] 
phycore-rk3288: Avoid enabling partition support in SPL

This is not needed or used, and adds code size. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
4 years agogw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
Tom Rini [Tue, 14 Jun 2022 02:57:37 +0000 (22:57 -0400)] 
gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT

Move the environment text over from being set via
CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
single environment file now.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
4 years agoComplete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment
Tom Rini [Tue, 14 Jun 2022 02:57:36 +0000 (22:57 -0400)] 
Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment

- Ensure that everyone setting mtdids= and mtdparts= is doing so via the
  CONFIG options.
- If the CONFIG options are set, ensure that the default environment
  sets mtdparts / mtdids.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoRename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD
Tom Rini [Tue, 14 Jun 2022 02:57:35 +0000 (22:57 -0400)] 
Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD

The "autoload" environment variable is always checked with env_get_yesno
as it can be set to any form of no.  The default behavior of
env_get_yesno is to return -1 on variables that are not set, which acts
as true in general (we test for non-zero return).  To convert
CONFIG_SYS_AUTOLOAD to Kconfig, given that it was almost always used to
set autoload to no, first rename to CONFIG_SYS_DISABLE_AUTOLOAD for
consistency sake.  Then, make it so that if enabled we set autoload=0 in
the default environment.  Migrate all platforms which set
CONFIG_SYS_AUTOLOAD to non-true or that set autoload to false in their
default environment to using CONFIG_SYS_DISABLE_AUTOLOAD

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoopos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT
Tom Rini [Tue, 14 Jun 2022 02:57:34 +0000 (22:57 -0400)] 
opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT

Move the environment text over from being set via
CONFIG_EXTRA_ENV_SETTINGS in include/configs/opos6uldev.h and over to
plain text in board/armadeus/opos6uldev/opos6uldev.env.  This lets us
manage env_version without a CONFIG variable.

Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_ENV_RANGE to Kconfig
Tom Rini [Tue, 14 Jun 2022 02:57:33 +0000 (22:57 -0400)] 
Convert CONFIG_ENV_RANGE to Kconfig

This converts the following to Kconfig:
   CONFIG_ENV_RANGE

Now that this is in Kconfig we can enforce a minimum size and so remove
the check in C code to ensure range is larger than size.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agodragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT
Tom Rini [Tue, 14 Jun 2022 02:57:32 +0000 (22:57 -0400)] 
dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT

With the exception of distro_boot support, we can move all of the rest
of the environment changes to come from CONFIG_EXTRA_ENV_TEXT and in
turn remove CONFIG_ENV_REFLASH.

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Remove include/generated/env.* under "make clean"
Tom Rini [Tue, 14 Jun 2022 02:57:31 +0000 (22:57 -0400)] 
env: Remove include/generated/env.* under "make clean"

When running "make clean" we want to remove env.in and well as env.txt.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict
Tom Rini [Tue, 14 Jun 2022 02:57:30 +0000 (22:57 -0400)] 
env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict

Largely, the use of CONFIG_EXTRA_ENV_SETTINGS can be migrated directly
to come from CONFIG_EXTRA_ENV_TEXT.  The biggest case that cannot easily
be migrated is distro_bootcmd support.  Rather than block migration on
this, remove the #error here so that we can being moving forward.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_SYS_USB_FAT_BOOT_PARTITION to Kconfig
Tom Rini [Mon, 13 Jun 2022 00:02:05 +0000 (20:02 -0400)] 
Convert CONFIG_SYS_USB_FAT_BOOT_PARTITION to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_USB_FAT_BOOT_PARTITION

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig
Tom Rini [Mon, 13 Jun 2022 00:02:04 +0000 (20:02 -0400)] 
Convert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_MAX_CONTROLLER_COUNT

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agocommon: usb: Update logic for usb.o, usb_hub.o and usb_storage.o
Tom Rini [Mon, 13 Jun 2022 00:02:03 +0000 (20:02 -0400)] 
common: usb: Update logic for usb.o, usb_hub.o and usb_storage.o

Now that we have consistently named symbols to enable USB host or gadget
controller support in SPL or full U-Boot, we do not need to
unconditionally build USB files nor depend on non-SPL symbols to know
when to build these common files.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agomx6memcal: Remove SPL_USB_HOST
Tom Rini [Mon, 13 Jun 2022 00:02:02 +0000 (20:02 -0400)] 
mx6memcal: Remove SPL_USB_HOST

As this particular platform is intended to be loaded and run a specific
set of routines in SPL, we do not need the ability to further use the
USB as a host device in SPL.  Disable this support.

Cc: Eric Nelson <eric@nelint.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Eric Nelson <eric@nelint.com>
4 years agousb: Remove non-DM code in ehci-fsl and xhci
Tom Rini [Mon, 13 Jun 2022 00:02:01 +0000 (20:02 -0400)] 
usb: Remove non-DM code in ehci-fsl and xhci

The DM_USB migration deadline has passed and this is not used in SPL.
Remove this now unused code.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_FPGA_STRATIX_V to Kconfig
Tom Rini [Mon, 13 Jun 2022 00:02:00 +0000 (20:02 -0400)] 
Convert CONFIG_FPGA_STRATIX_V to Kconfig

This converts the following to Kconfig:
   CONFIG_FPGA_STRATIX_V

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agofpga: Remove CONFIG_FPGA_COUNT
Tom Rini [Mon, 13 Jun 2022 00:01:59 +0000 (20:01 -0400)] 
fpga: Remove CONFIG_FPGA_COUNT

This define is only currently used in a single board, and always set to
one.  Define this within the board code and remove other references.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_ENV_MIN_ENTRIES et al to Kconfig
Tom Rini [Mon, 13 Jun 2022 00:01:58 +0000 (20:01 -0400)] 
Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig

This converts the following to Kconfig:
   CONFIG_ENV_MIN_ENTRIES
   CONFIG_ENV_MAX_ENTRIES

Cc: Michal Simek <michal.simek@amd.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoGlobally remove most CONFIG_SPL_BUILD tests from config headers
Tom Rini [Sat, 11 Jun 2022 02:59:38 +0000 (22:59 -0400)] 
Globally remove most CONFIG_SPL_BUILD tests from config headers

With the exception of how PowerPC handles SPL and TPL (which has its own
issues), we cannot safely hide options under CONFIG_SPL_BUILD.  Largely
remove the places that have this test today.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:37 +0000 (22:59 -0400)] 
Convert CONFIG_SYS_MPC85XX_NO_RESETVEC to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MPC85XX_NO_RESETVEC

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoRemove CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE and CONFIG_SPL_ABORT_ON_RAW_IMAGE
Tom Rini [Sat, 11 Jun 2022 02:59:36 +0000 (22:59 -0400)] 
Remove CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE and CONFIG_SPL_ABORT_ON_RAW_IMAGE

These symbols do not exist in mainline, remove them.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agosiemens: Move CONFIG_FACTORYSET to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:35 +0000 (22:59 -0400)] 
siemens: Move CONFIG_FACTORYSET to Kconfig

Introduce board/siemens/common/Kconfig and have it hold FACTORYSET to
start with.  Use select for this on the boards that need it.

Cc: Anatolij Gustschin <agust@denx.de>
Cc: Samuel Egli <samuel.egli@siemens.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agovideo: Migrate exynos display options to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:34 +0000 (22:59 -0400)] 
video: Migrate exynos display options to Kconfig

Following how it's done for the majority of drivers, add a new
VIDEO_EXYNOS option and Kconfig file under drivers/video/exynos and list
the current options there.

Cc: Anatolij Gustschin <agust@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
4 years agoarm: samsung: Migrate a number of symbols to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:33 +0000 (22:59 -0400)] 
arm: samsung: Migrate a number of symbols to Kconfig

- In a number of cases, use CONFIG_ARCH_EXYNOS[45] rather than
  CONFIG_EXYNOS[45]
- In other cases, test for CONFIG_ARCH_EXYNOS or CONFIG_ARCH_S5PC1XX
- Migrate specific SoC CONFIG values to Kconfig
- Use CONFIG_TARGET_x rather than CONFIG_x
- Migrate other CONFIG_EXYNOS_x symbols to Kconfig
- Reference CONFIG_EXYNOS_RELOCATE_CODE_BASE directly as EXYNOS_RELOCATE_CODE_BASE
- Rename CONFIG_S5P_PA_SYSRAM to CONFIG_SMP_PEN_ADDR to match the rest
  of U-Boot usage.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoarm: exynos: Remove old pwm backlight driver
Tom Rini [Sat, 11 Jun 2022 02:59:32 +0000 (22:59 -0400)] 
arm: exynos: Remove old pwm backlight driver

Remove the unused older exynos pwm backlight driver.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
4 years agoarm: samsung: Remove dead LCD code
Tom Rini [Sat, 11 Jun 2022 02:59:31 +0000 (22:59 -0400)] 
arm: samsung: Remove dead LCD code

Since bb5930d5c97f ("exynos: video: Convert several boards to driver
model for video") there have been no callers of any of the exynos_lcd_*
family of functions.  Remove these from the boards, and then remove
unused logo and related code as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
4 years agoblock: ide: Remove ide_preinit function
Tom Rini [Sat, 11 Jun 2022 02:59:30 +0000 (22:59 -0400)] 
block: ide: Remove ide_preinit function

The only platform currently that defines an ide_preinit function has an
empty one that immediately returns.  Remove this hook.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoata: sata_sil: Remove useless BLK guard in sata_sil.h
Tom Rini [Sat, 11 Jun 2022 02:59:29 +0000 (22:59 -0400)] 
ata: sata_sil: Remove useless BLK guard in sata_sil.h

Now that the driver only supports CONFIG_BLK, remove the useless guard
in sata_sil.h.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_LBA48 et al to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:28 +0000 (22:59 -0400)] 
Convert CONFIG_LBA48 et al to Kconfig

This converts the following to Kconfig:
   CONFIG_LBA48
   CONFIG_SYS_64BIT_LBA

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_FSL_SATA_V2 to Kconfig
Tom Rini [Sat, 11 Jun 2022 02:59:27 +0000 (22:59 -0400)] 
Convert CONFIG_FSL_SATA_V2 to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_SATA_V2

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoata: fsl_sata: Remove legacy non-BLK code
Tom Rini [Sat, 11 Jun 2022 02:59:26 +0000 (22:59 -0400)] 
ata: fsl_sata: Remove legacy non-BLK code

The migration deadline for this has passed and all boards have been
updated, remove this legacy code and references for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoata: dwc_ahsata: Remove legacy non-CONFIG_AHCI code
Tom Rini [Sat, 11 Jun 2022 02:59:25 +0000 (22:59 -0400)] 
ata: dwc_ahsata: Remove legacy non-CONFIG_AHCI code

The migration deadline for this has passed and all boards have been
updated, remove this legacy code and references for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoxtensa: Switch to using CONFIG_XTENSA for building device trees
Tom Rini [Sat, 11 Jun 2022 02:59:24 +0000 (22:59 -0400)] 
xtensa: Switch to using CONFIG_XTENSA for building device trees

The only use of CONFIG_XTFPGA was to build all of the in-tree device
trees.  Switch to using CONFIG_XTENSA instead of a non-Kconfig symbol.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agovpl: Ensure all VPL symbols in Kconfig have some VPL dependency
Tom Rini [Wed, 8 Jun 2022 12:24:40 +0000 (08:24 -0400)] 
vpl: Ensure all VPL symbols in Kconfig have some VPL dependency

Tighten up symbol dependencies in a number of places.  Ensure that a VPL
specific option has at least a direct dependency on VPL.  In places
where it's clear that we depend on something more specific, use that
dependency instead.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotpl: Ensure all TPL symbols in Kconfig have some TPL dependency
Tom Rini [Wed, 8 Jun 2022 12:24:39 +0000 (08:24 -0400)] 
tpl: Ensure all TPL symbols in Kconfig have some TPL dependency

Tighten up symbol dependencies in a number of places.  Ensure that a TPL
specific option has at least a direct dependency on TPL.  In places
where it's clear that we depend on something more specific, use that
dependency instead.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agospl: Move SPL_LDSCRIPT defaults to one place
Tom Rini [Wed, 8 Jun 2022 12:24:37 +0000 (08:24 -0400)] 
spl: Move SPL_LDSCRIPT defaults to one place

We want to keep all of the default values for SPL_LDSCRIPT in the same
place both for overall clarity as well as not polluting unrelated config
files.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agousb: ehci-mx5: Remove non-DM code
Tom Rini [Wed, 8 Jun 2022 12:24:36 +0000 (08:24 -0400)] 
usb: ehci-mx5: Remove non-DM code

The deadline for DM_USB migration has passed and all users have been
migrated.  Remove now unused code.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agousb: ehci-mxc: Remove
Tom Rini [Wed, 8 Jun 2022 12:24:35 +0000 (08:24 -0400)] 
usb: ehci-mxc: Remove

There are no platforms enabling this driver, remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoPowerPC: Remove some unused USB code
Tom Rini [Wed, 8 Jun 2022 12:24:34 +0000 (08:24 -0400)] 
PowerPC: Remove some unused USB code

These particular code paths aren't used anymore, remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_TEGRA_GPU to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:33 +0000 (08:24 -0400)] 
Convert CONFIG_TEGRA_GPU to Kconfig

This converts the following to Kconfig:
   CONFIG_TEGRA_GPU

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agousb: xhci-fsl: Remove non-DM code
Tom Rini [Wed, 8 Jun 2022 12:24:32 +0000 (08:24 -0400)] 
usb: xhci-fsl: Remove non-DM code

The deadline for DM_USB migration has passed and all users have been
migrated.  Remove now unused code.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_USB_EHCI_TXFIFO_THRESH to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:31 +0000 (08:24 -0400)] 
Convert CONFIG_USB_EHCI_TXFIFO_THRESH to Kconfig

This converts the following to Kconfig:
   CONFIG_USB_EHCI_TXFIFO_THRESH

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agousb: ehci-fsl: Remove non-DM code
Tom Rini [Wed, 8 Jun 2022 12:24:30 +0000 (08:24 -0400)] 
usb: ehci-fsl: Remove non-DM code

The deadline for DM_USB migration has passed and all users have been
migrated.  Remove now unused code.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_HAS_FSL_DR_USB to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:28 +0000 (08:24 -0400)] 
Convert CONFIG_HAS_FSL_DR_USB to Kconfig

This converts the following to Kconfig:
   CONFIG_HAS_FSL_DR_USB

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_EHCI_HCD_INIT_AFTER_RESET to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:27 +0000 (08:24 -0400)] 
Convert CONFIG_EHCI_HCD_INIT_AFTER_RESET to Kconfig

This converts the following to Kconfig:
   CONFIG_EHCI_HCD_INIT_AFTER_RESET

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_EHCI_DESC_BIG_ENDIAN et al to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:26 +0000 (08:24 -0400)] 
Convert CONFIG_EHCI_DESC_BIG_ENDIAN et al to Kconfig

This converts the following to Kconfig:
   CONFIG_EHCI_DESC_BIG_ENDIAN
   CONFIG_EHCI_MMIO_BIG_ENDIAN

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoehci-mxs: Remove non-DM code
Tom Rini [Wed, 8 Jun 2022 12:24:25 +0000 (08:24 -0400)] 
ehci-mxs: Remove non-DM code

This code is not enabled anywhere, drop it.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_EFLASH_PROTSECTORS to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:24 +0000 (08:24 -0400)] 
Convert CONFIG_EFLASH_PROTSECTORS to Kconfig

This converts the following to Kconfig:
   CONFIG_EFLASH_PROTSECTORS

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_E1000_NO_NVM to Kconfig
Tom Rini [Wed, 8 Jun 2022 12:24:23 +0000 (08:24 -0400)] 
Convert CONFIG_E1000_NO_NVM to Kconfig

This converts the following to Kconfig:
   CONFIG_E1000_NO_NVM

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge branch '2022-06-28-assorted-fixes'
Tom Rini [Tue, 28 Jun 2022 21:02:25 +0000 (17:02 -0400)] 
Merge branch '2022-06-28-assorted-fixes'

- Fix a squashfs security issue, an i2c access security issue and fix
  NAND booting on imx8mn_bsh_smm_s2

4 years agoconfigs: imx8mn_bsh_smm_s2: add mtdparts to bootargs
Dario Binacchi [Sun, 26 Jun 2022 10:05:18 +0000 (12:05 +0200)] 
configs: imx8mn_bsh_smm_s2: add mtdparts to bootargs

Passing the mtdparts environment variable to the Linux kernel is
required to properly mount the UBI rootfs.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
4 years agoconfigs: imx8mn_bsh_smm_s2: remove console from bootargs
Dario Binacchi [Sun, 26 Jun 2022 10:05:17 +0000 (12:05 +0200)] 
configs: imx8mn_bsh_smm_s2: remove console from bootargs

The Linux kernel device tree already specifies the device to be used for
boot console output with a stdout-path property under /chosen.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
4 years agoconfigs: imx8mn_bsh_smm_s2: add UBI commands
Dario Binacchi [Sun, 26 Jun 2022 10:05:16 +0000 (12:05 +0200)] 
configs: imx8mn_bsh_smm_s2: add UBI commands

imx8mn_bsh_smm_s2 uses ubifs rootfs, UBI commands are required to flash
it.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
4 years agoconfigs: imx8mn_bsh_smm_s2: add NAND driver
Dario Binacchi [Sun, 26 Jun 2022 10:05:15 +0000 (12:05 +0200)] 
configs: imx8mn_bsh_smm_s2: add NAND driver

It allows to boot from NAND.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
4 years agofs/squashfs: Use kcalloc when relevant
Miquel Raynal [Mon, 27 Jun 2022 10:20:03 +0000 (12:20 +0200)] 
fs/squashfs: Use kcalloc when relevant

A crafted squashfs image could embed a huge number of empty metadata
blocks in order to make the amount of malloc()'d memory overflow and be
much smaller than expected. Because of this flaw, any random code
positioned at the right location in the squashfs image could be memcpy'd
from the squashfs structures into U-Boot code location while trying to
access the rearmost blocks, before being executed.

In order to prevent this vulnerability from being exploited in eg. a
secure boot environment, let's add a check over the amount of data
that is going to be allocated. Such a check could look like:

if (!elem_size || n > SIZE_MAX / elem_size)
return NULL;

The right way to do it would be to enhance the calloc() implementation
but this is quite an impacting change for such a small fix. Another
solution would be to add the check before the malloc call in the
squashfs implementation, but this does not look right. So for now, let's
use the kcalloc() compatibility function from Linux, which has this
check.

Fixes: c5100613037 ("fs/squashfs: new filesystem")
Reported-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
4 years agoi2c: fix stack buffer overflow vulnerability in i2c md command
Nicolas Iooss [Fri, 10 Jun 2022 14:50:25 +0000 (14:50 +0000)] 
i2c: fix stack buffer overflow vulnerability in i2c md command

When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:

    int nbytes = length;
    #define DISP_LINE_LEN 16
    int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
    ret = dm_i2c_read(dev, addr, linebuf, linebytes);

On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.

The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.

Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.

Signed-off-by: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 years agoMerge tag 'u-boot-imx-20220628' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 28 Jun 2022 15:10:23 +0000 (11:10 -0400)] 
Merge tag 'u-boot-imx-20220628' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2022.07

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/12541