platform/kernel/u-boot.git
2 years agoconfigs: imx8mn_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:34 +0000 (12:23 +0800)]
configs: imx8mn_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mp_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:33 +0000 (12:23 +0800)]
configs: imx8mp_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: imx8mm_evk: drop unused SDHC macro
Peng Fan [Fri, 15 Apr 2022 04:23:32 +0000 (12:23 +0800)]
configs: imx8mm_evk: drop unused SDHC macro

With SPL_DM_MMC and DM_MMC, the two macros not needed, drop it.
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoARM: imx: imx8m: Fix board_get_usable_ram_top()
Marek Vasut [Thu, 14 Apr 2022 13:51:46 +0000 (15:51 +0200)]
ARM: imx: imx8m: Fix board_get_usable_ram_top()

The 4 GiB boundary is at 0xffffffff+1 , not at 0x80000000, fix this.

The PHYS_SDRAM of i.MX8M is at 0x40000000 , so to restrict ram_top
below 4 GiB, the ram_top has to be set to 0xffffffff as it is not
an offset from the start of PHYS_SDRAM, but rather a physical address
marking the topmost allowed DRAM address.

Fixes: e27bddff4b9 ("imx8m: Restrict usable memory to space below 4G boundary")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agoconfigs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO
Ian Ray [Thu, 14 Apr 2022 11:05:46 +0000 (14:05 +0300)]
configs: ge_bx50v3: remove CONFIG_PCIE_IMX_POWER_GPIO

This GPIO is actually an input "Q7_3V3_PCIE_WAKE#_IN" not an output, so
remove the misleaading and incorrect definition.

Cc: Tim Harvey <tharvey@gateworks.com> (re: pci: imx: use vpcie-supply if defined by device-tree)
Signed-off-by: Ian Ray <ian.ray@ge.com>
2 years agopci: imx: remove weak overrides no longer used
Tim Harvey [Wed, 13 Apr 2022 22:57:37 +0000 (15:57 -0700)]
pci: imx: remove weak overrides no longer used

There are no users of the imx6_pcie_toggle_power and imx6_pcie_toggle_reset
weak overrides and as these functions are able to be handled now via dt
properties lets remove these.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agopci: imx: use vpcie-supply if defined by device-tree
Tim Harvey [Wed, 13 Apr 2022 22:54:37 +0000 (15:54 -0700)]
pci: imx: use vpcie-supply if defined by device-tree

If vpcie-supply is defined by device-tree use that if
CONFIG_PCIE_IMX_POWER_GPIO is not defined.

Note that after this the following boards which define
CONFIG_PCIE_IMX_POWER_GPIO in their board header file as well as their
device-tree should be able to remove CONFIG_PCIE_IMX_PERST_GPIO without
consequence:
 - mx6sabresd
 - mx6sxsabresd
 - novena

Note that the ge_bx50v3 board uses CONFIG_PCIE_IMX_POWER_GPIO and does
not have vpcie-supply defined in it's pcie node in the dt thus removing
CONFIG_PCIE_IMX_POWER_GPIO globally can't be done until that board adds
vpcie-supply.

Cc: Ian Ray <ian.ray@ge.com> (maintainer:GE BX50V3 BOARD)
Cc: Sebastian Reichel <sebastian.reichel@collabora.com> (maintainer:GE BX50V3 BOARD)
Cc: Fabio Estevam <festevam@gmail.com> (maintainer:MX6SABRESD BOARD)
Cc: Marek Vasut <marex@denx.de> (maintainer:NOVENA BOARD)
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: toradex: drop colibri pxa270 support
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:32 +0000 (11:33 +0200)]
board: toradex: drop colibri pxa270 support

The Colibri PXA270 has been end-of-life since quite a while and would
require more and more maintenance (e.g. DM conversions).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoboard: gateworks: venice: add imx8mp-venice-gw740x support
Tim Harvey [Wed, 13 Apr 2022 18:31:09 +0000 (11:31 -0700)]
board: gateworks: venice: add imx8mp-venice-gw740x support

The GW74xx is based on the i.MX 8M Plus SoC featuring:
 - LPDDR4 DRAM
 - eMMC FLASH
 - Gateworks System Controller
 - PCIe Gen 3.0 switch (build option)
 - USB 3.0 HUB
 - USB Type-C front panel connector
 - GPS
 - 3-axis accelerometer
 - CAN bus
 - 6x GbE RJ45 front-panel jacks
  - 1x IMX8M FEC RGMII GbE (with Passive PoE)
  - 5x IMX8M EQOS RGMII 6 port GbE Switch
    (1x with 802.3af class 5 Active PoE)
 - RS232/RS485/RS422 serial transceiver
 - MIPI header (DSI/CSI/GPIO/PWM/I2S)
 - DigI/O header (UART/GPIO/I2C/ADC)
 - 802.11ac WiFi
 - Bluetooth BLE
 - 3x MiniPCIe sockets with PCI/USB
 - 1x M.2 Socket with USB2.0, PCIe, and dual-SIM
 - PMIC
 - Wide range DC input supply (8V to 60V DC)

Do the following to add support for this and future imx8mp-venice boards:
 - add dts
 - add DRAM config
 - add PMIC config
 - add IMX8MP support in spl.c and venice.c

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: add additional levels for dtb name match
Tim Harvey [Wed, 13 Apr 2022 18:31:08 +0000 (11:31 -0700)]
board: gateworks: venice: add additional levels for dtb name match

Gateworks produces many products from a single PCB with subloaded
components. Add an additional two levels of dtb name matching so that
for example a GW7400-A matches the dtb name of gw74xx.dtb

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: gw_ventana: use comomn GSC driver
Tim Harvey [Wed, 13 Apr 2022 16:29:16 +0000 (09:29 -0700)]
board: gateworks: gw_ventana: use comomn GSC driver

Use the common GSC driver.

This allows us to do some additional cleanup:
 - use the GSC driver functions
 - move waiting for the EEPROM to the SPL int (it will always be ready
   after this)
 - move eeprom functions into eeprom file and elimate GSC_I2C_BUS
 - eliminate some redundant EEPROM reads (the EEPROM must be read in
   SPL before relocation, in SPL after relocation, and in U-Boot init.
   All subsequent uses can use the global structure)
 - remove unnecessary header files and alphabatize includes

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m, n}_venice_defconfig: enable md5sum and crc32 commands
Tim Harvey [Wed, 13 Apr 2022 16:12:10 +0000 (09:12 -0700)]
imx8m{m, n}_venice_defconfig: enable md5sum and crc32 commands

Enable the md5sum and crc32 commands.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}-venice-gw7902: add support for GPY111 phy
Tim Harvey [Wed, 13 Apr 2022 16:09:49 +0000 (09:09 -0700)]
imx8m{m,n}-venice-gw7902: add support for GPY111 phy

The TI DP83867 phy has been replaced with the MaxLinear GPY111 phy
due to part availability. Add support for it:
 - increase post-reset time to 300ms per datasheet
 - add tx-delay/rx-delay config

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}_venice_defconfig: add DT overlay support
Tim Harvey [Wed, 13 Apr 2022 16:05:04 +0000 (09:05 -0700)]
imx8m{m,n}_venice_defconfig: add DT overlay support

enable CONFIG_OF_LIBFDT_OVERLAY to support applying dt overlays in
U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoarm: dts: imx8m*-venice: add gpio hog support
Tim Harvey [Wed, 13 Apr 2022 16:02:44 +0000 (09:02 -0700)]
arm: dts: imx8m*-venice: add gpio hog support

Add gpio hog support for board-specific gpio lines:
- put hogs in u-boot.dtsi so as to keep the regular dts files
  in sync with the kernel. The hogs will not be put in the kernel
  as that makes them un-usable by userspace as well as
  re-initializes them to dt defaults overriding changes which may
  have been done by bootloader commands.
- specify gpio names and initial config
- enable GPIO_HOG

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: gateworks: venice: use common GSC driver
Tim Harvey [Wed, 13 Apr 2022 15:56:40 +0000 (08:56 -0700)]
board: gateworks: venice: use common GSC driver

Use the common GSC driver.

This allows us to do some additional cleanup:
 - rename gsc{.c,.h} to eeprom{.c.h} for clarity
 - collapse eeprom_get_dev
 - remove unnecessary header files and alphabatize includes

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: enable DM_SERIAL
Tim Harvey [Wed, 13 Apr 2022 15:47:19 +0000 (08:47 -0700)]
board: gateworks: venice: enable DM_SERIAL

Enable DM_SERIAL.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoconfigs: imx8m{m,n}_venice_defconfig: add usb support
Tim Harvey [Wed, 13 Apr 2022 15:42:52 +0000 (08:42 -0700)]
configs: imx8m{m,n}_venice_defconfig: add usb support

Enable USB support for host controller and various USB ethernet
devices.

Example usage of USB Mass Storage (UMS) support:
 u-boot=> mmc list
 FSL_SDHC: 0
 FSL_SDHC: 1
 FSL_SDHC: 2 (eMMC)
 u-boot=> ums 0 mmc 2
 UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe30000

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}_venice: update env memory layout
Tim Harvey [Wed, 13 Apr 2022 15:25:10 +0000 (08:25 -0700)]
imx8m{m,n}_venice: update env memory layout

Update distro config env memory layout:
 - loadaddr=0x48200000 allows for 130MB area for uncompressing (ie FIT
   images, kernel_comp_addr_r)
 - fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
 - scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
 - ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoconfigs: tdx: apalis/colibri_imx6: use preboot as well
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:35 +0000 (11:33 +0200)]
configs: tdx: apalis/colibri_imx6: use preboot as well

Use PREBOOT as well. This allows a customer to just set fdt_board as
on any other module to customize the device tree for his carrier
board.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: tdx: apalis_imx6: drop hw v1.0 support
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:34 +0000 (11:33 +0200)]
configs: tdx: apalis_imx6: drop hw v1.0 support

Drop optional support for the ancient Apalis iMX6 V1.0 hardware which
had the UART wired as DCE rather than DTE.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoboard: colibri_imx7: fix usb start on solo
Marcel Ziswiler [Wed, 13 Apr 2022 09:33:33 +0000 (11:33 +0200)]
board: colibri_imx7: fix usb start on solo

This fixes the following crash when run on a Colibri iMX7S aka solo:

Colibri iMX7 # usb start
starting USB...
Bus usb@30b10000: USB EHCI 1.00
Bus usb@30b20000:

The i.MX 7Solo has only one single USB OTG1 but no USB host port. Trying
to initialize the nonexisting port just crashes.

While at it also drop board_usb_phy_mode() which is also no longer used
in the driver model age.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: tdx: Do not overwrite fdtfile if it got set manually
Philippe Schenker [Wed, 13 Apr 2022 09:33:31 +0000 (11:33 +0200)]
configs: tdx: Do not overwrite fdtfile if it got set manually

In case a customer wants to set fdtfile currently preboot overrides it
always with preboot just before the bootdelay. Use test -n to check
if fdtfile is already set and only set it if nothing got touched manually

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: colibri-imx7/-emmc: enable booting from usb sdp
Oleksandr Suvorov [Wed, 13 Apr 2022 09:33:30 +0000 (11:33 +0200)]
configs: colibri-imx7/-emmc: enable booting from usb sdp

For recovery purpose allow booting via SDP over USB as well.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoconfigs: toradex: enable missing fit options
Oleksandr Suvorov [Wed, 13 Apr 2022 09:33:29 +0000 (11:33 +0200)]
configs: toradex: enable missing fit options

Add missing support of FIT-images and enable a verbosity for
this feature.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: drop legacy nfsboot script
Igor Opaniuk [Wed, 13 Apr 2022 09:33:28 +0000 (11:33 +0200)]
toradex: drop legacy nfsboot script

Drop legacy nfsboot script in favor of distroboot DHCP boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: set default dhcp distroboot scriptname
Igor Opaniuk [Wed, 13 Apr 2022 09:33:27 +0000 (11:33 +0200)]
toradex: set default dhcp distroboot scriptname

Use the same name of DHCP Distroboot script as in regular eMMC case.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: globally disable video support
Igor Opaniuk [Wed, 13 Apr 2022 09:33:26 +0000 (11:33 +0200)]
toradex: globally disable video support

As video support is very specific depending on the exact display
customisation we decided to disable video support for all out modules
by default.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: apalis-imx8x: drop support for apalis imx8x
Denys Drozdov [Wed, 13 Apr 2022 09:33:25 +0000 (11:33 +0200)]
toradex: apalis-imx8x: drop support for apalis imx8x

Drop Apalis iMX8X platform as it never left sample state and is no
longer supported.

Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoarm: dts: imx8mp: Import GPCv2 subset, HSIOMIX and USB PD
Marek Vasut [Tue, 12 Apr 2022 22:42:57 +0000 (00:42 +0200)]
arm: dts: imx8mp: Import GPCv2 subset, HSIOMIX and USB PD

Add DT bindings for a subset of GPCv2 which handles USB and PCIe PDs,
HSIOMIX PD controller and missing USB PD properties. This is required
to bring up the DWC3 USB controller up.

This is based on linux next and patches which are still pending
review, but which are likely going to be part of Linux 5.19:
b2d67d7bdf74 ("arm64: dts: imx8mp: disable usb3_phy1")
290918c72a29 ("arm64: dts: imx8mp: Add memory for USB3 glue layer to usb3 nodes")
https://www.spinics.net/lists/arm-kernel/msg958501.html

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agousb: dwc3: Implement .glue_configure for i.MX8MP
Marek Vasut [Tue, 12 Apr 2022 22:42:56 +0000 (00:42 +0200)]
usb: dwc3: Implement .glue_configure for i.MX8MP

The i.MX8MP glue needs to be configured based on a couple of DT
properties, implement .glue_configure callback to parse those DT
properties and configure the glue accordingly.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agousb: dwc3: Rename .select_dr_mode to .glue_configure
Marek Vasut [Tue, 12 Apr 2022 22:42:55 +0000 (00:42 +0200)]
usb: dwc3: Rename .select_dr_mode to .glue_configure

Rename the select_dr_mode callback to glue_configure, the callback is
used for more than enforcing controller mode even on the TI chips, so
change the name to a more generic one. No functional change.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: power-domain: Add i.MX8MP HSIOMIX driver
Marek Vasut [Tue, 12 Apr 2022 22:42:54 +0000 (00:42 +0200)]
imx: power-domain: Add i.MX8MP HSIOMIX driver

Add trivial driver for i.MX8MP HSIOMIX handling. This is responsible
for enabling the GPCv2 power domains and clock for USB 3.0 and PCIe
in the correct order. Currently supported is the USB 3.0 part which
can be tested, PCIe support should be easy to add.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: power-domain: Add i.MX8MP support
Marek Vasut [Tue, 12 Apr 2022 22:42:53 +0000 (00:42 +0200)]
imx: power-domain: Add i.MX8MP support

Add i.MX8MP power domain handling into the driver. This is based on the
Linux GPCv2 driver state which is soon to be in Linux next.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-gw74xx
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agopower_domain: Add power_domain_get_by_name()
Marek Vasut [Tue, 12 Apr 2022 22:42:52 +0000 (00:42 +0200)]
power_domain: Add power_domain_get_by_name()

Implement power_domain_get_by_name() convenience function which parses
DT property 'power-domain-names' and looks up power domain by matching
name.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
2 years agoimx: power-domain: Get rid of SMCCC dependency
Marek Vasut [Tue, 12 Apr 2022 22:42:51 +0000 (00:42 +0200)]
imx: power-domain: Get rid of SMCCC dependency

This driver is the only SMCCC dependency in iMX8M U-Boot port. Rework
the driver based on Linux GPCv2 driver to directly control the GPCv2
block instead of using SMCCC calls. This way, U-Boot can operate the
i.MX8M power domains without depending on anything else.

This is losely based on Linux GPCv2 driver. The GPU, VPU, MIPI power
domains are not supported to save space, since they are not useful in
the bootloader. The only domains kept are ones for HSIO, PCIe, USB.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: power-domain: Inline arch-imx8m/power-domain.h
Marek Vasut [Tue, 12 Apr 2022 22:42:50 +0000 (00:42 +0200)]
imx: power-domain: Inline arch-imx8m/power-domain.h

The arch/arm/include/asm/arch-imx8m/power-domain.h is not included
anywhere except in drivers/power/domain/imx8m-power-domain.c, just
inline the content and drop the header. No functional change.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx: power-domain: Descend into pgc subnode if present
Marek Vasut [Tue, 12 Apr 2022 22:42:49 +0000 (00:42 +0200)]
imx: power-domain: Descend into pgc subnode if present

In case the power domain node structure is gpc@303a0000/pgc/power-domain@N,
do not bind power domain driver to the 'pgc' node, but rather descend into
it and only bind power domain drivers to power-domain@N subnodes. This way
we do not waste one useless driver instance associated with 'pgc' node.

Tested-By: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice-defconfig
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agopower-domain: Return 0 if ops unimplemented and remove empty functions
Marek Vasut [Tue, 12 Apr 2022 22:42:48 +0000 (00:42 +0200)]
power-domain: Return 0 if ops unimplemented and remove empty functions

In case the ops is not implemented, return 0 in the core right away.
This is better than having multiple copies of functions which just
return 0 in each power domain driver. Drop all those empty functions.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
2 years agoimx8ulp: clock: Fix lcd clock algo
Loic Poulain [Thu, 31 Mar 2022 10:39:37 +0000 (12:39 +0200)]
imx8ulp: clock: Fix lcd clock algo

The div loop uses reassign and reuse parent_rate, which causes
the parent rate reference to be wrong after the first loop, the
resulting clock becomes incorrect for div != 1.

Fixes: 829e06bf4175 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Wed, 20 Apr 2022 18:48:59 +0000 (14:48 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-20-assorted-improvements'
Tom Rini [Wed, 20 Apr 2022 18:33:53 +0000 (14:33 -0400)]
Merge branch '2022-04-20-assorted-improvements'

- Two TI K3 updates, update SYS_MALLOC_F_LEN default to be 0x2000 and
  move TI am33xx to use that as well, fix DT relocation with multiple
  DRAM banks, and add a gpio read sub-command.

2 years agocmd: gpio: Add `gpio read` subcommand
Diego Rondini [Mon, 11 Apr 2022 10:02:09 +0000 (12:02 +0200)]
cmd: gpio: Add `gpio read` subcommand

As explained in commit 4af2a33ee5b9 ("cmd: gpio: Make `gpio input`
return pin value again") the `gpio input` is used in scripts to obtain
the value of a pin, despite the fact that CMD_RET_FAILURE is
indistinguishable from a valid pin value.
To be able to detect failures and properly use the value of a GPIO in
scripts we introduce the `gpio read` command that sets the variable
`name` to the value of the pin. Return code of the `gpio read` command
can be used to check for CMD_RET_SUCCESS or CMD_RET_FAILURE.
CONFIG_CMD_GPIO_READ is used to enable the `gpio read` command.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
2 years agoram: k3-ddrss: Allow use of dt provided initial frequency
Dave Gerlach [Fri, 8 Apr 2022 21:46:50 +0000 (16:46 -0500)]
ram: k3-ddrss: Allow use of dt provided initial frequency

Allow device tree to provide ti,ddr-freq0 to be used as the initial DDR
frequency that is set for lpddr4 before initialization of the
controller. Make this optional and continue to use PLL bypass frequency
as is done currently if ti,ddr-freq0 is not provided.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2 years agoimage: fdt: Fix DT relocation handling with multiple DRAM banks with gap
Marek Vasut [Fri, 8 Apr 2022 00:09:19 +0000 (02:09 +0200)]
image: fdt: Fix DT relocation handling with multiple DRAM banks with gap

The current implementation of boot_relocate_fdt() places DT at the
highest usable DRAM address, which is calculated as:
  env_get_bootm_low() + env_get_bootm_mapsize()
which by default becomes gd->ram_base + gd->ram_size.

Systems like i.MX53 can have multiple DRAM banks with gap between them,
e.g. have DRAM at 0x70000000-0x8fffffff and 0xb0000000-0xcfffffff , so
for them the calculated highest DRAM address is 0xafffffff, which is
exactly in the gap and thus not usable.

Fix this by iterating over all DRAM banks and tracking the remaining
amount of the total mapping size obtained from env_get_bootm_mapsize().
Limit the maximum LMB area size to each bank, to avoid using nonexistent
DRAM.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2 years agoam33xx: Update SYS_MALLOC_F_LEN to use 0x2000 as the default
Tom Rini [Thu, 7 Apr 2022 16:33:24 +0000 (12:33 -0400)]
am33xx: Update SYS_MALLOC_F_LEN to use 0x2000 as the default

A number of platforms here had already been increasing the size a bit,
so lets moving all of them up.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoKconfig: Change SYS_MALLOC_F_LEN default to 0x2000
Tom Rini [Thu, 7 Apr 2022 16:33:23 +0000 (12:33 -0400)]
Kconfig: Change SYS_MALLOC_F_LEN default to 0x2000

The most commonly used value today is 0x2000 and not 0x400.  Rework the
Kconfig logic to use this more frequently used value as the default.

Cc: Andrew F. Davis <afd@ti.com>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Alison Wang <alison.wang@nxp.com>
Cc: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
Cc: Andes <uboot@andestech.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Bharat Gooty <bharat.gooty@broadcom.com>
Cc: David Lechner <david@lechnology.com>
Cc: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Cc: Eugeniy Paltsev <paltsev@synopsys.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Gerald Kerma <dreagle@doukki.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Holger Brunck <holger.brunck@hitachienergy.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Kristian Amlie <kristian.amlie@northern.tech>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Liviu Dudau <liviu.dudau@foss.arm.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Cc: Matthias Brugger <mbrugger@suse.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Walle <michael@walle.cc>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Paul Kocialkowski <contact@paulk.fr>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Cc: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Bosch <stefan_b@posteo.net>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: Thomas Weber <weber@corscience.de>
Cc: Tony Dinh <mibodhi@gmail.com>
Cc: Trevor Woerner <twoerner@gmail.com>
Cc: Vitaly Andrianov <vitalya@ti.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: liuhao <liuhao@phytium.com.cn>
Cc: lixinde <lixinde@phytium.com.cn>
Cc: shuyiqi <shuyiqi@phytium.com.cn>
Cc: weichangzheng <weichangzheng@phytium.com.cn>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Kristian Amlie <kristian.amlie@northern.tech>
2 years agoram: k3-ddrss: Fix register name and explain its usage
Dominic Rath [Wed, 6 Apr 2022 09:56:47 +0000 (11:56 +0200)]
ram: k3-ddrss: Fix register name and explain its usage

The k3-ddrss driver wants to configure the DDRSS_V2A_CTL_REG to reflect
the maximum possible SDRAM of 2 GB for AM64x (instead of the register's
default that says 8 GB, which the AM64x DDR controller wouldn't support).

The offset 0x20 was correct, but the register name DDRSS_V2A_R1_MAT_REG
was that of the next register at offset 0x24.

Signed-off-by: Dominic Rath <rath@ibv-augsburg.net>
2 years agoMerge branch '2022-04-19-assorted-updates'
Tom Rini [Tue, 19 Apr 2022 21:02:21 +0000 (17:02 -0400)]
Merge branch '2022-04-19-assorted-updates'

- Migrate CONFIG_SYS_MEM_TOP_HIDE to Kconfig, IOMUX bugfix, 2 BTRFS
bugfixes, update .gitignore and .mailmap files, aspeed GPIO bugfix,
image-fit and squashfs code cleanups, enable EXT4 and ISO partitions on
DeveloperBox.
- populate u-boot,bootconf under /chosen, see
  https://github.com/devicetree-org/dt-schema/pull/71 for corresponding
  change

2 years agofs: Allow to compile FS_BTRFS when SPL is enabled
Pali Rohár [Thu, 7 Apr 2022 12:53:25 +0000 (14:53 +0200)]
fs: Allow to compile FS_BTRFS when SPL is enabled

Currently there is no btrfs support in SPL. But macro CONFIG_FS_BTRFS is
defined also when building SPL. When both FS_BTRFS and SPL are enabled
then build process throw compile error.

Fix check for btrfs code in fstypes[] to allow compiling FS_BTRFS only in
proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agobtrfs: Fix compilation on big endian systems
Pali Rohár [Thu, 7 Apr 2022 12:51:03 +0000 (14:51 +0200)]
btrfs: Fix compilation on big endian systems

Fix following two compile errors on big endian systems:

  CC      fs/btrfs/btrfs.o
In file included from include/linux/byteorder/big_endian.h:107,
                 from ./arch/powerpc/include/asm/byteorder.h:82,
                 from ./arch/powerpc/include/asm/bitops.h:8,
                 from include/linux/bitops.h:152,
                 from include/uuid.h:9,
                 from fs/btrfs/btrfs.c:10:
fs/btrfs/conv-funcs.h: In function ‘btrfs_key_to_disk’:
include/linux/byteorder/generic.h:90:21: error: ‘__cpu_to_le16’ undeclared (first use in this function); did you mean ‘__cpu_to_le16p’?
 #define cpu_to_le16 __cpu_to_le16
                     ^~~~~~~~~~~~~
fs/btrfs/conv-funcs.h:79:10: note: in expansion of macro ‘cpu_to_le16’
   __u16: cpu_to_le16,     \
          ^~~~~~~~~~~

  CC      fs/btrfs/compression.o
In file included from ./arch/powerpc/include/asm/unaligned.h:9,
                 from fs/btrfs/compression.c:16:
include/linux/unaligned/access_ok.h:6:19: error: redefinition of ‘get_unaligned_le16’
 static inline u16 get_unaligned_le16(const void *p)
                   ^~~~~~~~~~~~~~~~~~
In file included from fs/btrfs/ctree.h:16,
                 from fs/btrfs/btrfs.h:12,
                 from fs/btrfs/compression.c:8:
include/linux/unaligned/le_byteshift.h:40:19: note: previous definition of ‘get_unaligned_le16’ was here
 static inline u16 get_unaligned_le16(const void *p)
                   ^~~~~~~~~~~~~~~~~~

Include file asm/unaligned.h contains arch specific macros and functions
for unaligned access as opposite to linux/unaligned le_byteshift.h which
contains macros and functions specific to little endian systems only.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Qu Wenruo <wqu@suse.com>
2 years agoIOMUX: Fix access past end of console_devices
Sean Anderson [Wed, 6 Apr 2022 18:36:35 +0000 (14:36 -0400)]
IOMUX: Fix access past end of console_devices

We should only access console_devices[file][i] once we have checked that i
< cd_count[file]. Otherwise, we will access uninitialized memory at the end
of the loop. console_devices[file][i] should not be NULL, but putting the
assignment in the loop condition allows us to ensure that i is checked
beforehand. This isn't a bug, but it does make valgrind stop complaining.

Fixes: 400797cad3 ("IOMUX: Split out for_each_console_dev() helper macro")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Andrew Scull <ascull@google.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 years agoConvert CONFIG_SYS_MEM_TOP_HIDE to Kconfig
Tom Rini [Wed, 6 Apr 2022 14:33:32 +0000 (10:33 -0400)]
Convert CONFIG_SYS_MEM_TOP_HIDE to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MEM_TOP_HIDE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agotools: add boot/ to .gitignore
Du Huanpeng [Thu, 7 Apr 2022 09:37:49 +0000 (17:37 +0800)]
tools: add boot/ to .gitignore

/tools/boot/ is a build product. Add it to .gitignore

Signed-off-by: Du Huanpeng <dhu@hodcarrier.org>
2 years agofs/squashfs: simplify sqfs_read()
Heinrich Schuchardt [Mon, 11 Apr 2022 20:54:44 +0000 (22:54 +0200)]
fs/squashfs: simplify sqfs_read()

* Don't check argument of free(). Free does this itself.
* Reduce scope of data_buffer. Remove duplicate free().
* Avoid superfluous NULL assignment.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2 years agoimage-fit: don't check free() argument
Heinrich Schuchardt [Mon, 11 Apr 2022 18:08:03 +0000 (20:08 +0200)]
image-fit: don't check free() argument

* free() checks if its argument is NULL. Remove duplicate checks.
* Remove duplicate free(ovcopy).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agogpio: aspeed: Fix incorrect offset of read back register.
Billy Tsai [Wed, 13 Apr 2022 05:34:51 +0000 (13:34 +0800)]
gpio: aspeed: Fix incorrect offset of read back register.

The offset of the current read back register is the value of the gpio pin,
not the value written for the gpio output.
This patch fix it to avoid the other gpio output value controlled by the
same register being set incorrectly.

Fixes: 7ad889b0f37a ("gpio: Add Aspeed GPIO driver")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2 years agoconfigs: Enable EXT4 and ISO partitions for the DeveloperBox
Ilias Apalodimas [Tue, 12 Apr 2022 21:16:44 +0000 (00:16 +0300)]
configs: Enable EXT4 and ISO partitions for the DeveloperBox

Since this box is SystemReady compliant enable ISO_PARTITION which is
needed to start some installers (e.g Fedora).  While at it enable EXT4
as well which is a common filesystem for targets

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2 years ago.mailmap: Start to use new amd.com email address
Michal Simek [Thu, 14 Apr 2022 13:50:46 +0000 (15:50 +0200)]
.mailmap: Start to use new amd.com email address

Xilinx has been acquired by AMD that's why emails should be also updated.
The patch is updating .mailmap file and also MAINTAINERS files as was done
by commit 5cd1ecb99490 ("ppc: qemu: Update MAINTAINERS for correct email
address").
The rest of my emails are not going to change.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoimage-fdt: save name of FIT configuration in '/chosen' node
Daniel Golle [Tue, 12 Apr 2022 20:00:43 +0000 (21:00 +0100)]
image-fdt: save name of FIT configuration in '/chosen' node

It can be useful for the OS (Linux) to know which configuration has
been chosen by U-Boot when launching a FIT image.
Store the name of the FIT configuration node used in a new string
property called 'u-boot,bootconf' in the '/chosen' node in device tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'u-boot-rockchip-20220418' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 19 Apr 2022 12:50:23 +0000 (08:50 -0400)]
Merge tag 'u-boot-rockchip-20220418' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add rk3066 SoC support;
- Add rk3066 MK808 board support;
- dts sync from kernel for rk322x, rk3288;
- some other board level config update;

2 years agoMerge branch '2022-04-18-dm-reducing-spl-memory-usage'
Tom Rini [Tue, 19 Apr 2022 12:14:15 +0000 (08:14 -0400)]
Merge branch '2022-04-18-dm-reducing-spl-memory-usage'

- Assorted DM cleanups from Simon.  This results in some noticeable
  binary size savings in SPL.

2 years agodm: core: Deal with a wrinkle with linker lists
Simon Glass [Sun, 27 Mar 2022 20:26:20 +0000 (14:26 -0600)]
dm: core: Deal with a wrinkle with linker lists

When every member of a linker list is aligned by the compiler, we can no
longer rely on the sizeof of the struct to determine the number of
entries.

For example, if the struct size is 0x90 but every entry is aligned to 0xa0
by the compiler, the linker list entries takes more space in memory and
the calculation of the number of entries is incorrect. For example, we may
see 0x12 entries when there are only 0x11.

This is a real problem. There may be a general solution, although I cannot
currently think of one. So far it only bites with OF_PLATDATA_RT which
creates a pointer to each entry of the 'struct udevice' linker_list. This
does not happen without that option, so it only affects SPL.

Work around it by manually calculating the aligned size of struct udevice,
then using that for the n_ent calculation.

Note: the alignment fix to linker list was here:

   0b2fa98aa5e linker_lists: Fix alignment issue

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Allow devres to be disabled in SPL
Simon Glass [Sun, 27 Mar 2022 20:26:19 +0000 (14:26 -0600)]
dm: core: Allow devres to be disabled in SPL

At present if devres is enabled in U-Boot proper it is enabled in SPL.
We don't normally want it there, so disable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Angus Ainslie <angus@akkea.ca>
2 years agosandbox: Align linker lists to a 32-byte boundary
Simon Glass [Sun, 27 Mar 2022 20:26:18 +0000 (14:26 -0600)]
sandbox: Align linker lists to a 32-byte boundary

Use this larger boundary to ensure that linker lists at least start on the
maximum possible alignment boundary. See also the CONFIG_LINKER_LIST_ALIGN
setting, but that is host-arch-specific, so it seems better to use the
largest value for every host architecture.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: Allow link flags to be given
Simon Glass [Sun, 27 Mar 2022 20:26:17 +0000 (14:26 -0600)]
sandbox: Allow link flags to be given

At present the link flags are not used for sandbox. Update the command
line to use them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMakefile: Avoid resetting link flags in config.mk
Simon Glass [Sun, 27 Mar 2022 20:26:16 +0000 (14:26 -0600)]
Makefile: Avoid resetting link flags in config.mk

This makes it impossible to change them elsewhere. The default value is
'empty' anyway, so just drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMakefile: Drop a stale comment about linking
Simon Glass [Sun, 27 Mar 2022 20:26:15 +0000 (14:26 -0600)]
Makefile: Drop a stale comment about linking

The bug mentioned here is fixed, so drop the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: Correct loss of early output in SPL
Simon Glass [Sun, 27 Mar 2022 20:26:14 +0000 (14:26 -0600)]
sandbox: Correct loss of early output in SPL

At present fputc() is used before the console is available, then write()
is used. These are not compatible. Since fputc() buffers internally it is
better to use the write(), so that a partial line is immediately
displayed.

This has a slight effect on performance, but we are already using write()
for the vast majority of the output with no obvious impacts.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agorockchip: video: mipi: add more compatible strings for rk3288/rk3399
Johan Jonker [Sat, 16 Apr 2022 08:25:16 +0000 (10:25 +0200)]
rockchip: video: mipi: add more compatible strings for rk3288/rk3399

The rk3288/RK3399 DT synced from Linux contains some different
compatible strings in the mipi node then origanal used in U-boot.
Allow both options to be backwards compatible and to be able
to handle recent rk3288.dtsi and rk3399.dtsi files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: video: rk_edp: add more rk3288 edp node options
Johan Jonker [Sat, 16 Apr 2022 07:45:56 +0000 (09:45 +0200)]
rockchip: video: rk_edp: add more rk3288 edp node options

The rk3288 DT synced from Linux contains some different
properties in the edp node then origanal used in U-boot.
Allow both options to be backwards compatible and to be able
to handle recent rk3288.dtsi files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoboard: rk3288: add more DT files to MAINTAINERS
Johan Jonker [Fri, 15 Apr 2022 21:21:45 +0000 (23:21 +0200)]
board: rk3288: add more DT files to MAINTAINERS

A number of rk3229/rk3288 DT files are synced from Linux.
Add a maintainer to look after them and to help with
review and testing.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoboard: google: veyron: add more DT files to MAINTAINERS
Johan Jonker [Fri, 15 Apr 2022 21:21:44 +0000 (23:21 +0200)]
board: google: veyron: add more DT files to MAINTAINERS

The Google Veyron rk3288 DT files are synced from Linux.
Add a maintainer to look after them and to help with
review and testing.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: fix boot_devices constants
Johan Jonker [Fri, 15 Apr 2022 21:21:43 +0000 (23:21 +0200)]
rockchip: fix boot_devices constants

The DT node name pattern in mmc-controller.yaml for mmc
is "^mmc(@.*)?$". The Rockchip mmc nodes have been synced
with Linux, so update the boot_devices constants as well.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: move all rk3288 u-boot specific properties in separate dtsi files
Johan Jonker [Fri, 15 Apr 2022 21:21:39 +0000 (23:21 +0200)]
arm: dts: rockchip: move all rk3288 u-boot specific properties in separate dtsi files

In order to sync rk3288.dtsi from Linux it needed to
move all u-boot specific properties in separate dtsi files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3288-cru: sync the clock dt-binding header from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:38 +0000 (23:21 +0200)]
rockchip: rk3288-cru: sync the clock dt-binding header from Linux

In order to update the DT for rk3288
sync the clock dt-binding header.
This is the state as of v5.17 in Linux.
Keep SCLK_MAC_PLL in use for rk3288 clock driver.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3288-power: sync power domain dt-binding header from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:37 +0000 (23:21 +0200)]
rockchip: rk3288-power: sync power domain dt-binding header from Linux

In order to update the DT for rk3288
sync the power domain dt-binding header.
This is the state as of v5.17 in Linux.
Change location to be more in line with other SoCs.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: sync rk3229-evb.dts from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:36 +0000 (23:21 +0200)]
arm: dts: rockchip: sync rk3229-evb.dts from Linux

Sync rk3229-evb.dts from Linux version 5.17.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: sync rk322x.dtsi from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:35 +0000 (23:21 +0200)]
arm: dts: rockchip: sync rk322x.dtsi from Linux

Sync rk322x.dtsi from Linux version 5.17.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: move all rk322x u-boot specific properties in separate dtsi files
Johan Jonker [Fri, 15 Apr 2022 21:21:34 +0000 (23:21 +0200)]
arm: dts: rockchip: move all rk322x u-boot specific properties in separate dtsi files

In order to sync rk322x.dtsi from Linux, move all
U-boot specific properties in separate dtsi files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3228-cru: sync the clock dt-binding header from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:33 +0000 (23:21 +0200)]
rockchip: rk3228-cru: sync the clock dt-binding header from Linux

In order to update the DT for rk3228
sync the clock dt-binding header.
This is the state as of v5.17 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3228-power: sync power domain dt-binding header from Linux
Johan Jonker [Fri, 15 Apr 2022 21:21:32 +0000 (23:21 +0200)]
rockchip: rk3228-power: sync power domain dt-binding header from Linux

In order to update the DT for rk3228
sync the power domain dt-binding header.
This is the state as of v5.17 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agodoc: rockchip: add rk3066 Rikomagic MK808
Johan Jonker [Sat, 16 Apr 2022 15:09:52 +0000 (17:09 +0200)]
doc: rockchip: add rk3066 Rikomagic MK808

Add rk3066 Rikomagic MK808 to the list of
mainline supported Rockchip boards.
Include instructions for creating and programming
images to NAND and SD card.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agodoc: rockchip: add px30/rk3326 boards and examples
Johan Jonker [Sat, 16 Apr 2022 15:09:51 +0000 (17:09 +0200)]
doc: rockchip: add px30/rk3326 boards and examples

There are several PX30/RK3326 boards in use without
mentioning in rockchip.rst. Add boards and examples.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agodoc: rockchip: restyle rockchip.rst
Johan Jonker [Sat, 16 Apr 2022 15:09:50 +0000 (17:09 +0200)]
doc: rockchip: restyle rockchip.rst

With more text coming to the rockchip.rst document,
give it a restyle first.

Changed:
  sort build examples alphabetically
  add git clone example
  fix bash examples
  fix phrases (grammer)
  fix typos

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3066: add mk808_defconfig
Johan Jonker [Sat, 16 Apr 2022 15:09:49 +0000 (17:09 +0200)]
rockchip: rk3066: add mk808_defconfig

This commit adds the default configuration file and
relevant description for a MK808 board.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3066: add Rikomagic MK808 board
Johan Jonker [Sat, 16 Apr 2022 15:09:48 +0000 (17:09 +0200)]
rockchip: rk3066: add Rikomagic MK808 board

MK808 is a RK3066-based board with 1 USB host and 1 USB OTG port,
HDMI and a micro-SD card slot. It also includes on-board NAND
and 1GB of SDRAM.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3066: add core support
Johan Jonker [Sat, 16 Apr 2022 15:09:47 +0000 (17:09 +0200)]
rockchip: rk3066: add core support

Add the core architecture code for the rk3066.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: tools: add rk3066 support to rkcommon.c
Johan Jonker [Sat, 16 Apr 2022 15:09:46 +0000 (17:09 +0200)]
rockchip: tools: add rk3066 support to rkcommon.c

Add rk3066 support to rkcommon.c

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: add rk3066a-mk808.dts
Johan Jonker [Sat, 16 Apr 2022 15:09:45 +0000 (17:09 +0200)]
arm: dts: rockchip: add rk3066a-mk808.dts

MK808 is a RK3066-based board with 1 USB host and 1 USB OTG port,
HDMI and a micro-SD card slot. It also includes on-board NAND
and 1GB of SDRAM. Add rk3066a-mk808.dts. Move U-boot specific
things in a rk3066a-mk808-u-boot.dtsi file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: add rk3066a.dtsi
Johan Jonker [Sat, 16 Apr 2022 15:09:44 +0000 (17:09 +0200)]
arm: dts: rockchip: add rk3066a.dtsi

In the Linux DT the file rk3xxx.dtsi is shared between
rk3066 and rk3188. Add rk3066a.dtsi. Move U-boot specific
things in a rk3066a-u-boot.dtsi file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: fix include rk3xxx-u-boot.dtsi
Johan Jonker [Sat, 16 Apr 2022 15:09:43 +0000 (17:09 +0200)]
arm: dts: rockchip: fix include rk3xxx-u-boot.dtsi

Move the include for rk3xxx-u-boot.dtsi to rk3188-u-boot.dtsi
to stay in line with U-boot dtsi files.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: fix rk3xxx-u-boot.dtsi
Johan Jonker [Sat, 16 Apr 2022 15:09:42 +0000 (17:09 +0200)]
arm: dts: rockchip: fix rk3xxx-u-boot.dtsi

The file rk3xxx-u-boot.dtsi was original only for rk3188 and SPL.
With rk3066 added some nodes are also needed in TPL,
so change them to u-boot,dm-pre-reloc

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3066: add sdram driver
Paweł Jarosz [Sat, 16 Apr 2022 15:09:41 +0000 (17:09 +0200)]
rockchip: rk3066: add sdram driver

Add rockchip rk3066 sdram driver

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>
2 years agorockchip: rk3066: add rk3066 pinctrl driver
Paweł Jarosz [Sat, 16 Apr 2022 15:09:40 +0000 (17:09 +0200)]
rockchip: rk3066: add rk3066 pinctrl driver

Add driver supporting pin multiplexing on rk3066 platform.

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>
2 years agorockchip: rk3066: add clock driver for rk3066 soc
Paweł Jarosz [Sat, 16 Apr 2022 15:09:39 +0000 (17:09 +0200)]
rockchip: rk3066: add clock driver for rk3066 soc

Add the clock driver for the rk3066 platform.

Derived from the rk3288 and rk3188 driver it
supports only a bare minimum to bring up the system
to reduce the TPL size for:
  SDRAM clock configuration.
  The boot devices NAND, EMMC, SDMMC, SPI.
  A UART for the debug messages (fixed) at 115200n8.
  A SARADC for the recovery button.
  A TIMER for the delays (fixed).

There's support for two possible frequencies,
the safe 600MHz which will work with default pmic settings and
will be set to get away from the 24MHz default and
the maximum of 1.416Ghz, which boards can set if they
were able to get pmic support for it.

After the clock tree is set during the TPL probe
there's no parent update support.

In OF_REAL mode the drivers ns16550.c and dw-apb-timer.c
obtain the (fixed) clk_get_rate from the clock driver
instead of platdata.

The rk3066 cru node has a number of assigned-clocks properties
that call the .set_rate() function. Add them to the list so that
they return a 0 instead of -ENOENT.

Signed-off-by: Paweł Jarosz <paweljarosz3691@gmail.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rk3066: add grf header file
Paweł Jarosz [Sat, 16 Apr 2022 15:09:38 +0000 (17:09 +0200)]
rockchip: rk3066: add grf header file

grf is needed by various drivers for rk3066 soc.

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>
2 years agorockchip: rk3066-power: sync power domain dt-binding header from Linux
Johan Jonker [Sat, 16 Apr 2022 15:09:37 +0000 (17:09 +0200)]
rockchip: rk3066-power: sync power domain dt-binding header from Linux

In order to update the DT for rk3066
sync the power domain dt-binding header.
This is the state as of v5.12 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL
Johan Jonker [Sat, 9 Apr 2022 16:55:14 +0000 (18:55 +0200)]
rockchip: serial: Kconfig: allow ROCKCHIP_SERIAL enabled in TPL

The serial_rockchip.c driver converts platdata to the data structure
used in the ns16550.c file and then calls the function
ns16550_serial_probe().
When compiled with OF_REAL the serial_rockchip.c driver returns
now -ENODEV when probed and does no harm.
The config ROCKCHIP_SERIAL is currently depends on SPL_OF_PLATDATA.
Allow serial port use for both SPL and TPL by removing this
dependency and SPL_BUILD restriction.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL
Johan Jonker [Sat, 9 Apr 2022 16:55:13 +0000 (18:55 +0200)]
rockchip: serial: Kconfig: add select SYS_NS16550 to config ROCKCHIP_SERIAL

The Rockchip serial driver depends on an enabled NS16550 driver,
so add select SYS_NS16550 to config ROCKCHIP_SERIAL.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>