]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agoMerge tag 'u-boot-atmel-2021.07-b' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 19 Apr 2021 15:34:17 +0000 (11:34 -0400)]
Merge tag 'u-boot-atmel-2021.07-b' of https://source.denx.de/u-boot/custodians/u-boot-atmel

Second set of u-boot-atmel features for 2021.07 cycle:

This small feature set include support for 5th PIO bank on pio4 pinctrl
driver and a fix for the SPL on sama5d3.

3 years agoRevert "spl: Drop bd_info in the data section"
Alexandru Gagniuc [Thu, 8 Apr 2021 16:56:11 +0000 (11:56 -0500)]
Revert "spl: Drop bd_info in the data section"

This reverts commit 38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75.

struct global_data contains a pointer to the bd_info structure. This
pointer was populated spl_set_bd() to a pre-allocated bd_info in the
".data" section. The referenced commit replaced this mechanism to one
that uses malloc(). That new mechanism is only used if SPL_ALLOC_BD=y.
which very few boards do.

The result is that (struct global_data)->bd is NULL in SPL on most
platforms. This breaks falcon mode, since arch_fixup_fdt() tries to
access (struct global_data)->bd and set the "/memory" node in the
devicetree. The result is that the "/memory" node contains garbage
values, causing linux to panic() as it sets up the page table.

Instead of trying to fix the mess, potentially causing other issues,
revert to the code that worked, while this change is reworked.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoARM: dts: at91: sama5d3: add u-boot properties to sama5d3 pit timer
Manuel Reis [Tue, 6 Apr 2021 09:39:53 +0000 (10:39 +0100)]
ARM: dts: at91: sama5d3: add u-boot properties to sama5d3 pit timer

in the early SPL boot stage whenever there is a call to udelay,
dm_timer_init fails to find the pit timer whenever it traverses
the device tree, if this property is not present

Signed-off-by: Manuel Reis <mluis.reis@gmail.com>
CC: Eugen Hristev <eugen.hristev@microchip.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
3 years agoARM: dts: at91: sama7g5: change pinctrl compatible to sama7g5
Eugen Hristev [Wed, 7 Apr 2021 08:39:29 +0000 (11:39 +0300)]
ARM: dts: at91: sama7g5: change pinctrl compatible to sama7g5

Change the pinctrl compatible to sama7g5, the right one for this product.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
3 years agogpio: atmel_pio4: add support for sama7g5 pio4 version with 5 banks
Eugen Hristev [Wed, 7 Apr 2021 08:39:28 +0000 (11:39 +0300)]
gpio: atmel_pio4: add support for sama7g5 pio4 version with 5 banks

Add support for sama7g5 pinctrl variant, with 5 banks with a degraded
8 line only 5th bank.
Based on Linux Kernel implementation.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
3 years agoMerge tag 'efi-2021-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 18 Apr 2021 12:47:27 +0000 (08:47 -0400)]
Merge tag 'efi-2021-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc1-2

Documentation:
man-page for fatinfo

Bug fixes:
memory leak in efi_capsule_scan_dir()
incorrect invocations of EFI_CALL macro creating ESRT table
buffer overflow in tcg2_create_digest()

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sun, 18 Apr 2021 12:46:58 +0000 (08:46 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

This is a patchset which makes away with the .bind() controller indexing
workaround which was broken since before v2021.04, and then adds PHY
support and MX8M support on top of that. Better add it into the release
early to get as much testing as possible done, because this really does
a lot of changes to the ehci-mx6 driver.

3 years agoMerge tag 'ti-v2021.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Sun, 18 Apr 2021 12:46:39 +0000 (08:46 -0400)]
Merge tag 'ti-v2021.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti

- Support for pinmux status command on beaglebone
- Updates for MMC speed modes for J721e-evm
- Fix MMC booting on omap35_logic_somlv board

3 years agoMerge branch '2021-04-16-env-updates'
Tom Rini [Sun, 18 Apr 2021 12:44:25 +0000 (08:44 -0400)]
Merge branch '2021-04-16-env-updates'

- SPI Flash ENV improvements / cleanups
- Redundant support for FAT
- Assorted bugfixes

3 years agoARM: imx8m: verdin-imx8mm: Enable USB Host support
Marek Vasut [Wed, 31 Mar 2021 21:46:35 +0000 (23:46 +0200)]
ARM: imx8m: verdin-imx8mm: Enable USB Host support

Enable USB host support on MX8MM Verdin.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agousb: ehci-mx6: Add iMX8M support
Marek Vasut [Fri, 2 Apr 2021 12:07:22 +0000 (14:07 +0200)]
usb: ehci-mx6: Add iMX8M support

The iMX8M uses nop PHY, select PHY and NOP_PHY automatically.
Otherwise, the DM capable driver is now perfectly compatible.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Fix aarch64 build warnings
Marek Vasut [Tue, 6 Apr 2021 18:37:16 +0000 (20:37 +0200)]
usb: ehci-mx6: Fix aarch64 build warnings

Fix cast from pointer to integer of different size by casting the
pointer to uintptr_t instead of uint32_t, the former has correct
size on both 32bit and 64bit architectures.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Add fsl,imx7d-usb compatible string
Marek Vasut [Fri, 2 Apr 2021 11:07:59 +0000 (13:07 +0200)]
usb: ehci-mx6: Add fsl,imx7d-usb compatible string

Add new compatible string, used by some more up-to-date DTs.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Set default CONFIG_MXC_USB_PORTSC if not defined
Marek Vasut [Sat, 10 Apr 2021 14:03:04 +0000 (16:03 +0200)]
usb: ehci-mx6: Set default CONFIG_MXC_USB_PORTSC if not defined

There is now multiple copies of CONFIG_MXC_USB_PORTSC in configs set to
PORT_PTS_UTMI | PORT_PTS_PTW, which is in fact the default register value
for MX6, MX7 and MX7ULP. Define the default value of CONFIG_MXC_USB_PORTSC
in the driver and use it in case CONFIG_MXC_USB_PORTSC is not defined in
config, to reduce the duplication.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Add generic EHCI PHY support
Marek Vasut [Fri, 2 Apr 2021 11:07:49 +0000 (13:07 +0200)]
usb: ehci-mx6: Add generic EHCI PHY support

In case PHY support is enabled, use the generic EHCI PHY support
to start and stop the PHY.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Use portnr from DT in DM case
Marek Vasut [Fri, 2 Apr 2021 11:56:28 +0000 (13:56 +0200)]
usb: ehci-mx6: Use portnr from DT in DM case

In case the platform uses DM, determine port number, which is
used as offset in USBMISC registers, from PHY node DT aliases,
just like Linux does.

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Pass MISC address to usb_oc_config()
Marek Vasut [Wed, 31 Mar 2021 21:24:41 +0000 (23:24 +0200)]
usb: ehci-mx6: Pass MISC address to usb_oc_config()

Instead of passing ad-hoc sequence number to usb_oc_config(), pass in
the USB MISC address itself. The USB MISC address comes from DT in DM
case, and from the old method using controller index in non-DM case.

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Split usb_power_config()
Marek Vasut [Wed, 31 Mar 2021 21:00:23 +0000 (23:00 +0200)]
usb: ehci-mx6: Split usb_power_config()

Split usb_power_config() per SoC and pass in USB PHY, USBNC and ANATOP
addresses instead of ad-hoc sequence numbers. This is only applicable
on legacy systems which do not implement proper PHY support. Once PHY
support is available, parts of this can be removed altogether and moved
to the PHY driver, similar to Linux phy-mxs-usb.c .

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Pass PHY address to usb_*_phy*()
Marek Vasut [Wed, 31 Mar 2021 20:10:35 +0000 (22:10 +0200)]
usb: ehci-mx6: Pass PHY address to usb_*_phy*()

Instead of passing ad-hoc index to USB PHY handling functions and then
try and figure out the PHY address, pass in the PHY address itself. For
DM case, this address comes easily from DT. For non-DM case, the previous
method is still present, however the non-DM case will soon be removed.

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Split ehci_mx6_common_init()
Marek Vasut [Wed, 31 Mar 2021 19:40:24 +0000 (21:40 +0200)]
usb: ehci-mx6: Split ehci_mx6_common_init()

In order to pass component addresses around easily instead of passing
ad-hoc sequence numbers, it is necessary to split ehci_mx6_common_init().
Make it so and call the separate functions instead.

Since board_ehci_hcd_init() makes no sense in DM case, do not call it
in DM case.

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Parse USB PHY and MISC offsets from DT
Marek Vasut [Wed, 31 Mar 2021 21:06:07 +0000 (23:06 +0200)]
usb: ehci-mx6: Parse USB PHY and MISC offsets from DT

In case DM and OF controler is enabled, but PHY support is disabled,
parse USB PHY and MISC component addresses from DT manually. Those
component addresses will be used in subsequent patches to access the
ANATOP, PHY and MISC registers matching the controller and thus get
rid of the ad-hoc controller sequence number mapping.

Fixes: 4de51cc25b5 ("usb: ehci-mx6: Drop assignment of sequence number")
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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Unify USBNC registers
Marek Vasut [Wed, 31 Mar 2021 20:19:00 +0000 (22:19 +0200)]
usb: ehci-mx6: Unify USBNC registers

Merge USBNC register layout structure into a single one, instead of
having three separate structures and a lot of ifdeffery. No functional
change.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Add DM clock support
Marek Vasut [Wed, 31 Mar 2021 10:28:03 +0000 (12:28 +0200)]
usb: ehci-mx6: Add DM clock support

Add support for using DM clock framework to enable and disable all the
necessary clock for the USB controller.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agousb: ehci-mx6: Turn off Vbus on probe failure
Marek Vasut [Wed, 31 Mar 2021 10:19:27 +0000 (12:19 +0200)]
usb: ehci-mx6: Turn off Vbus on probe failure

The driver turns on Vbus regulator in probe, but fails to turn it back
off in case of probe failure. Add the missing code.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoimx: power-domain: Add fsl,imx8mn-gpc compatible string
Marek Vasut [Fri, 9 Apr 2021 22:19:27 +0000 (00:19 +0200)]
imx: power-domain: Add fsl,imx8mn-gpc compatible string

The driver is compatible with iMX8MN, add missing compatible string.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoimx: power-domain: Add fsl,imx8mm-gpc compatible string
Marek Vasut [Fri, 2 Apr 2021 11:32:40 +0000 (13:32 +0200)]
imx: power-domain: Add fsl,imx8mm-gpc compatible string

The driver is compatible with iMX8MM, add missing compatible string.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoARM: dts: imx8mn: Add power domain nodes
Marek Vasut [Fri, 9 Apr 2021 22:16:06 +0000 (00:16 +0200)]
ARM: dts: imx8mn: Add power domain nodes

Add power domain nodes to DT.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoARM: dts: imx8mm: Add power domain nodes
Marek Vasut [Fri, 2 Apr 2021 11:14:53 +0000 (13:14 +0200)]
ARM: dts: imx8mm: Add power domain nodes

Add power domain nodes to DT.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoARM: dts: imx8mn: Replace deprecated fsl,usbphy DT props with phys
Marek Vasut [Fri, 9 Apr 2021 22:12:03 +0000 (00:12 +0200)]
ARM: dts: imx8mn: Replace deprecated fsl,usbphy DT props with phys

The fsl,usbphy DT property is deprecated, replace it with phys DT
property and specify #phy-cells, so that the generic PHY framework
can parse the PHY bindings without any extra hacking.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoARM: dts: imx8mm: Replace deprecated fsl,usbphy DT props with phys
Marek Vasut [Wed, 31 Mar 2021 09:47:25 +0000 (11:47 +0200)]
ARM: dts: imx8mm: Replace deprecated fsl,usbphy DT props with phys

The fsl,usbphy DT property is deprecated, replace it with phys DT
property and specify #phy-cells, so that the generic PHY framework
can parse the PHY bindings without any extra hacking.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoARM: dts: k2g-evm: Use standard compatible string for USB no-op PHY
Marek Vasut [Wed, 31 Mar 2021 09:24:31 +0000 (11:24 +0200)]
ARM: dts: k2g-evm: Use standard compatible string for USB no-op PHY

The standard compatible string is "usb-nop-xceiv", use it.
Note that keystone-k2g.dtsi already uses the aforementioned
compat string, so this patch can only remove the override.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoarc: emsdp/iotdk: Use standard compatible string for USB no-op PHY
Marek Vasut [Wed, 31 Mar 2021 09:23:36 +0000 (11:23 +0200)]
arc: emsdp/iotdk: Use standard compatible string for USB no-op PHY

The standard compatible string is "usb-nop-xceiv", use it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agophy: nop-phy: Add standard usb-nop-xceiv compat string
Marek Vasut [Wed, 31 Mar 2021 09:21:07 +0000 (11:21 +0200)]
phy: nop-phy: Add standard usb-nop-xceiv compat string

The USB no-op PHY uses "usb-nop-xceiv" compatible string. This driver is
compatible with USB no-op PHY, so add the compatible string.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
3 years agoefi_loader: fix possible buffer overflow
Masahisa Kojima [Wed, 14 Apr 2021 02:55:49 +0000 (11:55 +0900)]
efi_loader: fix possible buffer overflow

Variable "final" will have SHA512 digest, but currently
the array size is not sufficient. Let's fix it.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: memory leak in efi_capsule_scan_dir()
Heinrich Schuchardt [Sun, 11 Apr 2021 04:53:04 +0000 (06:53 +0200)]
efi_loader: memory leak in efi_capsule_scan_dir()

If realloc() fails, we should free the old buffer.

Fixes: c74cd8bd08d1: ("efi_loader: capsule: add capsule_on_disk support")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: esrt: Remove incorrect invocations of EFI_CALL macro
Sughosh Ganu [Wed, 14 Apr 2021 07:08:25 +0000 (12:38 +0530)]
efi_loader: esrt: Remove incorrect invocations of EFI_CALL macro

Remove function invocations using the EFI_CALL macro for those
functions that do not have an EFI_ENTRY call in their definition. Such
functions can use u-boot api's which rely on u-boot global data(gd)
pointer. The Arm and RiscV architectures maintain a separate gd
pointer, one for u-boot, and a separate gd for the efi application.

Calling a function through the EFI_CALL macro changes the gd pointer
to that used for the efi application, with u-boot gd being
unavailable. Any function then trying to dereference u-boot's gd will
result in an abort.

Fix this issue by removing the EFI_CALL macro for all of such
functions which do not begin by an EFI_ENTRY function call.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: duplicate target 'youtube'
Heinrich Schuchardt [Sat, 10 Apr 2021 18:32:03 +0000 (20:32 +0200)]
doc: duplicate target 'youtube'

Two external references cannot have the same name:

doc/chromium/overview.rst:5:
WARNING: Duplicate explicit target name: "youtube"

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: fatinfo man-page
Heinrich Schuchardt [Sun, 11 Apr 2021 18:28:13 +0000 (20:28 +0200)]
doc: fatinfo man-page

Provide a man-page for the fatinfo command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: imx: psb: fix footnotes
Heinrich Schuchardt [Sun, 11 Apr 2021 15:03:53 +0000 (17:03 +0200)]
doc: imx: psb: fix footnotes

In reStructured text footnotes are referenced like [1]_.

Add missing underscores.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Marek Vasut <marex@denx.de>
3 years agoboard: toradex: apalis-imx8x: fix build warning
Heinrich Schuchardt [Sat, 10 Apr 2021 18:07:54 +0000 (20:07 +0200)]
board: toradex: apalis-imx8x: fix build warning

The length of an underline must match the length of the header.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoenv: sf: remove the static env_flash variable
Patrick Delaunay [Wed, 24 Feb 2021 10:52:36 +0000 (11:52 +0100)]
env: sf: remove the static env_flash variable

As the the SPI flash is probed and is released in each ENV sf function
the env_flash no more need to be static.

This patch move this device handle as local variable of each function and
simplify the associated code (env_flash is never == NULL when
setup_flash_device is called).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoenv: sf: add missing spi_flash_free
Patrick Delaunay [Wed, 24 Feb 2021 10:52:35 +0000 (11:52 +0100)]
env: sf: add missing spi_flash_free

Free the SPI resources by calling spi_flash_free() in each env sf
function to avoid issue for other SPI users.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoenv: sf: add support of command env erase
Patrick Delaunay [Tue, 9 Feb 2021 10:48:52 +0000 (11:48 +0100)]
env: sf: add support of command env erase

Add support of opts erase for env in SPI flash;
this opts is used by command 'env erase'.

This command only fills the env offset by 0x0 (bit flip to 0) and
the saved environment becomes invalid (with bad CRC).

It doesn't erase the sector here to avoid issue when the sector
is larger than the env (i.e. embedded when
CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE).

The needed sector erase will be managed in the next "env save" command,
using the opt ".save", before to update the environment in SPI flash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoenv: sf: update the use of macro ENV_SAVE_PTR
Patrick Delaunay [Tue, 9 Feb 2021 10:48:51 +0000 (11:48 +0100)]
env: sf: update the use of macro ENV_SAVE_PTR

Remove CONFIG_IS_ENABLED(SAVEENV) as it is already tested in
the ENV_SAVE_PTR macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoenv: add ENV_ERASE_PTR macro
Patrick Delaunay [Tue, 9 Feb 2021 10:48:50 +0000 (11:48 +0100)]
env: add ENV_ERASE_PTR macro

Add ENV_ERASE_PTR macro to handle erase opts and remove the associated
ifdef.

This patch is a extension of previous commit 82b2f4135719 ("env_internal.h:
add alternative ENV_SAVE_PTR macro").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoenv: Fix invalid env handling in env_init()
Marek Vasut [Wed, 20 Jan 2021 14:45:16 +0000 (15:45 +0100)]
env: Fix invalid env handling in env_init()

This fixes the case where there are multiple environment drivers, one of
them is the default environment one, and it is followed by an environment
driver which does not implement .init() callback. The default environment
driver sets gd->env_valid to ENV_INVALID and returns 0 from its .init()
callback implementation, which is valid behavior for default environment.

Since the subsequent environment driver does not implement .init(), it
also does not modify the $ret variable in the loop. Therefore, the loop
is exited with gd->env_valid=ENV_INVALID and ret=0, which means that the
code further down in env_init() will not reset the environment to the
default one, which is incorrect.

This patch sets the $ret variable back to -ENOENT in case the env_valid
is set to ENV_INVALID by an environment driver, so that the environment
would be correctly reset back to default one, unless a subsequent driver
loads a valid environment.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-By: Tim Harvey <tharvey@gateworks.com>
3 years agoenv/fat.c: support redund environment
Brandon Maier [Sat, 16 Jan 2021 21:14:43 +0000 (15:14 -0600)]
env/fat.c: support redund environment

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
CC: Wolfgang Denk <wd@denx.de>
3 years agoenv: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCE
Martin Fuzzey [Mon, 11 Jan 2021 10:27:20 +0000 (11:27 +0100)]
env: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCE

Since commit 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
a warning message is displayed when setenv -f is used WITHOUT
CONFIG_ENV_ACCESS_IGNORE_FORCE, but the variable is set anyway, resulting
in lots of log pollution.

env_flags_validate() returns 0 if the access is accepted, or non zero
if it is refused.

So the original code
#ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE
if (flag & H_FORCE)
return 0;
#endif

was correct, it returns 0 (accepts the modification) if forced UNLESS
IGNORE_FORCE is set (in which case access checks in the following code
are applied). The broken patch just added a printf to the force accepted
case.

To obtain the intent of the patch we need this:
if (flag & H_FORCE) {
#ifdef CONFIG_ENV_ACCESS_IGNORE_FORCE
printf("## Error: Can't force access to \"%s\"\n", name);
#else
return 0;
#endif
}

Fixes: 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
3 years agoenv: increment redund flag on read fail
Brandon Maier [Thu, 17 Dec 2020 23:19:18 +0000 (17:19 -0600)]
env: increment redund flag on read fail

If one of the reads fails when importing redundant environments (a
single read failure), the env_flags wouldn't get initialized in
env_import_redund(). If a user then calls saveenv, the new environment
will have the wrong flags value. So on the next load the new environment
will be ignored.

While debugging this, I also noticed that env/sf.c was not correctly
handling a single read failure, as it would not check the crc before
assigning it to gd->env_addr.

Having a special error path for when there is a single read failure
seems unnecessary and may lead to future bugs. Instead collapse the
'single read failure' error to be the same as a 'single crc failure'.
That way env_check_redund() either passes or fails, and if it passes we
are guaranteed to have checked the CRC.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
CC: Wolfgang Denk <wd@denx.de>
CC: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoenv: add CONFIG_ENV_SECT_SIZE_AUTO
Rasmus Villemoes [Wed, 14 Apr 2021 18:51:43 +0000 (20:51 +0200)]
env: add CONFIG_ENV_SECT_SIZE_AUTO

This is roughly the U-Boot side equivalent to commit
e282c422e0 (tools: fw_env: use erasesize from MEMGETINFO ioctl). The
motivation is the case where one has a board with several revisions,
where the SPI flashes have different erase sizes.

In our case, we have an 8K environment, and the flashes have erase
sizes of 4K (newer boards) and 64K (older boards). Currently, we must
set CONFIG_ENV_SECT_SIZE to 64K to make the code work on the older
boards, but for the newer ones, that ends up wasting quite a bit of
time reading/erasing/restoring the last 56K.

At first, I wanted to allow setting CONFIG_ENV_SECT_SIZE to 0 to mean
"use the erase size the chip reports", but that config
option is used in a number of preprocessor conditionals, and shared
between ENV_IS_IN_FLASH and ENV_IS_IN_SPI_FLASH.

So instead, introduce a new boolean config option, which for now can
only be used with ENV_IS_IN_SPI_FLASH. If left off, there's no change
in behaviour.

The only slightly annoying detail is that, when selected, the compiler
is apparently not smart enough to see that the the saved_size and
saved_offset variables are only used under the same "if (sect_size >
CONFIG_ENV_SIZE)" condition as where they are computed, so we need to
initialize them to 0 to avoid "may be used uninitialized" warnings.

On our newer boards with the 4K erase size, saving the environment now
takes 0.080 seconds instead of 0.53 seconds, which directly translates
to that much faster boot time since our logic always causes the
environment to be written during boot.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
3 years agoenv/sf.c: use a variable to hold the sector size
Rasmus Villemoes [Wed, 14 Apr 2021 18:51:42 +0000 (20:51 +0200)]
env/sf.c: use a variable to hold the sector size

As preparation for the next patch, use a local variable to represent
the sector size. No functional change.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
3 years agoarm: dts: k3-j721e-main: Update the speed modes supported and their itap delay values...
Aswath Govindraju [Mon, 12 Apr 2021 15:40:55 +0000 (21:10 +0530)]
arm: dts: k3-j721e-main: Update the speed modes supported and their itap delay values for MMCSD subsystems

According to latest errata of J721e [1], HS400 mode is not supported
in MMCSD0 subsystem (i2024) and SDR104 mode is not supported in MMCSD1/2
subsystems (i2090). Therefore, replace mmc-hs400-1_8v with mmc-hs200-1_8v
in MMCSD0 subsystem and add a sdhci mask to disable SDR104 speed mode.

Also, update the itap delay values for all the MMCSD subsystems according
the latest J721e data sheet[2]

[1] - https://www.ti.com/lit/er/sprz455/sprz455.pdf
[2] - https://www.ti.com/lit/ds/symlink/tda4vm.pdf

Fixes: 70e167495ab2 ("arm: dts: k3-j721e: Sync Linux v5.11-rc6 dts into U-Boot")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Fri, 16 Apr 2021 12:30:25 +0000 (08:30 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi

This adds support for devices with R40 dual rank DRAM, and asymmetric
A64 DRAM devices like the Pinephone/3GB.
Also we enable automatic gzipped kernel support, and allow scripted
DT overlay support. The rest of the patches are cleanups, but also
some sunxi-specific preparatory patches for USB3.0 and improved HDMI
support. The bulk of those changes will go through other trees, though.

Build-tested for all 156 sunxi boards, and boot tested on a A64, A20, R40,
H5, H6 and H616 board. USB, SD card, eMMC, HDMI and Ethernet all work
there (where applicable), with the exception of Ethernet on the H5. Since
this is already broken in v2021.04, I will send a separate fix.

3 years agosunxi: video: select dw-hdmi in Kconfig, not Makefile
Jernej Skrabec [Sat, 6 Mar 2021 19:54:19 +0000 (20:54 +0100)]
sunxi: video: select dw-hdmi in Kconfig, not Makefile

Currently sunxi Makefile manually specifies full path to dw-hdmi common
code. However, that is not needed because it can be selected in Kconfig
instead.

Select proper symbol in Kconfig and drop path from Makefile.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: arm64: Add addresses for compressed kernel load
Arnaud Ferraris [Sat, 20 Feb 2021 12:14:15 +0000 (13:14 +0100)]
sunxi: arm64: Add addresses for compressed kernel load

The "booti" command to load arm64 Linux kernels supports automatic
decompression of zipped kernel images, but relies on some environment
variables to point to usable buffer RAM.

Add those variables and let them point to some default values, that
should cover most use-cases.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: binman: Do not hardcode U-Boot load address
Samuel Holland [Mon, 8 Feb 2021 06:03:17 +0000 (00:03 -0600)]
sunxi: binman: Do not hardcode U-Boot load address

The FIT description has access to the configuration variables. Use the
appropriate variable instead of hardcoding the address.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: binman: Respect the default FIT configuration
Samuel Holland [Mon, 8 Feb 2021 06:03:16 +0000 (00:03 -0600)]
sunxi: binman: Respect the default FIT configuration

binman can fill in the default FIT configuration index as selected by
the "default-dt" argument, which is set to CONFIG_DEFAULT_DEVICE_TREE.
Let's respect the user's configuration by taking advantage of this
feature, instead of always defaulting to the first device tree in
CONFIG_OF_LIST.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoclk: sunxi: h6: Add XHCI clocks
Samuel Holland [Mon, 8 Feb 2021 05:57:20 +0000 (23:57 -0600)]
clk: sunxi: h6: Add XHCI clocks

The XHCI controller has its own clock and reset. Add them.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoclk: sunxi: Add a dummy clock driver for the RTC
Samuel Holland [Mon, 8 Feb 2021 05:57:19 +0000 (23:57 -0600)]
clk: sunxi: Add a dummy clock driver for the RTC

The 32kHz clock ("LOSC") on sunxi SoCs is provided by the RTC. It is
used, among other things, by the XHCI controller in the H6. To be able
to call clk_get_bulk() on the XHCI controller, some device needs to
provide all referenced clocks.

Since LOSC is a fixed-rate always-on clock, implementation is trivial.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: enable dual rank memory on R40
Icenowy Zheng [Thu, 25 Feb 2021 16:13:25 +0000 (00:13 +0800)]
sunxi: enable dual rank memory on R40

Previously we do not have proper dual rank memory detection on R40
(because we omitted PIR_QSGATE, which does not work on R40 with our
configuration), and dual rank memory is just simply disabled as early
R40 boards available (Banana Pi M2 Ultra and Berry) have single rank
memory.

As a board with dual rank memory (Forlinx OKA40i-C) is now known to us,
we need to have a way to do memory rank detection to support that board.

Add some routine to detect memory rank by trying to access the memory
in rank 1 and check for error status of the memory controller, and then
enable dual rank memory on R40.

Similar routine can be used to detect half DQ width (which is also
detected by PIR_QSGATE on other SoCs), but it's left unimplemented
because there's no known R40 board with half DQ width now.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
[Andre: Move R40 detect code call into sunxi_dram_init()]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: support asymmetric dual rank DRAM on A64/R40
Icenowy Zheng [Thu, 25 Feb 2021 16:13:24 +0000 (00:13 +0800)]
sunxi: support asymmetric dual rank DRAM on A64/R40

Previously we have known that R40 has a configuration register for its
rank 1, which allows different configuration than rank 0. Reverse
engineering of newest libdram of A64 from Allwinner shows that A64 has
this register too. It's bit 0 (which enables dual rank in rank 0
configuration register) means a dedicated rank size setup is used for
rank 1.

Now, Pine64 scheduled to use a 3GiB LPDDR3 DRAM chip (which has 2GiB
rank 0 and 1GiB rank 1) on PinePhone, that makes asymmetric dual rank
DRAM support necessary.

Add this support. The code could support both A64 and R40, but because
dual rank detection is broken on R40 now, we cannot really use it on R40
currently.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agosunxi: add fdtoverlay_addr_r environment variable
Jernej Skrabec [Tue, 23 Mar 2021 20:27:31 +0000 (21:27 +0100)]
sunxi: add fdtoverlay_addr_r environment variable

Commit 69076dff2284 ("cmd: pxe: add support for FDT overlays") added
support for loading DT overlay files to PXE boot. However, it needs
additional environment variable which points to memory location which
can be used to temporary store overlay data.

Add it and in the process unify alignment using spaces and fix comment.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
3 years agoMerge branch '2021-04-14-assorted-vboot-improvements'
Tom Rini [Thu, 15 Apr 2021 21:10:25 +0000 (17:10 -0400)]
Merge branch '2021-04-14-assorted-vboot-improvements'

- Add ECDSA support to FIT images
- Improve FIT image loadables (incl fpga) support
- Further FIT improvements with SPL

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Thu, 15 Apr 2021 17:11:19 +0000 (13:11 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

update ls1028aqds networking protocol, config in ls1021atwr, env in ls1012a
Add seli3 board support, booke watchdog, update eTSEC support in ppc-qemu
Add DM_SERIAL and lpuart in sl28, add DM_ETH support for some of powerpc platforms

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Thu, 15 Apr 2021 13:19:31 +0000 (09:19 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Minor fix to Apollo Lake devicetree bindings for FSP
- Refactor Designware PCIe drivers to core and SoC parts
- Add Amlogic Meson Designware PCIe controller driver

3 years agoconfigs: T1042D4RDB: enable DM_ETH
Camelia Groza [Tue, 13 Apr 2021 16:48:05 +0000 (19:48 +0300)]
configs: T1042D4RDB: enable DM_ETH

Enable DM_ETH and DM_MDIO for the T1042D4RDB.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t1042d4rdb: add FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:48:04 +0000 (19:48 +0300)]
powerpc: dts: t1042d4rdb: add FMan v3 nodes

Add the FMan v3 nodes for the T1042D4RDB. The nodes are copied over with
little modification from the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t1042: add QorIQ DPAA 1 FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:48:03 +0000 (19:48 +0300)]
powerpc: dts: t1042: add QorIQ DPAA 1 FMan v3 nodes

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T1042 SoC.
The device tree nodes are copied over with little modification
from the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: T4240RDB: enable DM_ETH
Camelia Groza [Tue, 13 Apr 2021 16:48:02 +0000 (19:48 +0300)]
configs: T4240RDB: enable DM_ETH

Enable DM_ETH and DM_MDIO for the T4240RDB.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: qoriq: update the mdio offsets under the second FMan v3
Camelia Groza [Tue, 13 Apr 2021 16:48:01 +0000 (19:48 +0300)]
powerpc: dts: qoriq: update the mdio offsets under the second FMan v3

When two FMan's are present on a board, the MDIO nodes are found at the
same offsets inside each FMan. This causes "non unique device name"
errors when registering the MDIO nodes under the second FMan. Fix this
by updating the offsets of the MDIO nodes to include the parent FMan's
offset.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t4240rdb: add FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:48:00 +0000 (19:48 +0300)]
powerpc: dts: t4240rdb: add FMan v3 nodes

Add the FMan v3 nodes for the T4240RDB. The nodes are copied over with
little modification from the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t4240: add QorIQ DPAA 1 FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:47:59 +0000 (19:47 +0300)]
powerpc: dts: t4240: add QorIQ DPAA 1 FMan v3 nodes

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T4240 SoC.
The device tree nodes are copied over with little modification
from the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: T2080RDB: enable DM_ETH
Camelia Groza [Tue, 13 Apr 2021 16:47:58 +0000 (19:47 +0300)]
configs: T2080RDB: enable DM_ETH

Enable DM_ETH and DM_MDIO for the T2080RDB.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: freescale: t208xrdb: fdt fixups under DM_ETH
Camelia Groza [Tue, 13 Apr 2021 16:47:57 +0000 (19:47 +0300)]
board: freescale: t208xrdb: fdt fixups under DM_ETH

Disable the FMan mEMAC 5 and 6 nodes from the fdt since they are not
available under the supported RCW. Also disable the associated
"fsl,dpa-ethernet" nodes that reference them.

This is a simplified version of the fdt_fixup_fman_ethernet call for
use under DM_ETH.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t2080rdb: add FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:47:56 +0000 (19:47 +0300)]
powerpc: dts: t2080rdb: add FMan v3 nodes

Add the FMan v3 nodes for the T2080RDB. The nodes are copied over with
little modification from the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: t2080: add QorIQ DPAA 1 FMan v3 nodes
Camelia Groza [Tue, 13 Apr 2021 16:47:55 +0000 (19:47 +0300)]
powerpc: dts: t2080: add QorIQ DPAA 1 FMan v3 nodes

Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T2080 SoC.
The device tree nodes are copied over with little modification from
the Linux kernel source code.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agols1012a: use default scan_dev_for_boot
Mian Yousaf Kaukab [Tue, 30 Mar 2021 14:04:14 +0000 (16:04 +0200)]
ls1012a: use default scan_dev_for_boot

scan_dev_for_efi is supposed to be called from scan_dev_for_boot.
However, this call is missing for ls1012a boards. As a result EFI
boot doesn’t work. Fix this issue by removing custom definition of
scan_dev_for_boot and use the default definition instead.

Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: sl28: add config to enable console output on SER0
Michael Walle [Fri, 26 Mar 2021 18:40:59 +0000 (19:40 +0100)]
board: sl28: add config to enable console output on SER0

Sometimes it is desireable to have the console output on the first
serial line. Introduce a configuration option for it (in the board
scope).

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: sl28: enable DM_SERIAL
Michael Walle [Fri, 26 Mar 2021 18:40:58 +0000 (19:40 +0100)]
board: sl28: enable DM_SERIAL

With all preparations in place, switch over to DM_SERIAL.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoboard: sl28: move DM_* configs to Kconfig
Michael Walle [Fri, 26 Mar 2021 18:40:57 +0000 (19:40 +0100)]
board: sl28: move DM_* configs to Kconfig

Move the CONFIG_DM_* from the defconfig to the TARGET_SL28 config.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: fsl-layerscape: spl: call spl_early_init()
Michael Walle [Fri, 26 Mar 2021 18:40:56 +0000 (19:40 +0100)]
armv8: fsl-layerscape: spl: call spl_early_init()

DM_SERIAL needs both the device tree as well as an early heap. Thus, we
have to call spl_early_init() to initialize the memory allocator and the
setup the device tree.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoarmv8: fsl-layerscape: spl: add debug UART support
Michael Walle [Fri, 26 Mar 2021 18:40:55 +0000 (19:40 +0100)]
armv8: fsl-layerscape: spl: add debug UART support

To use the debug UART we have to call debug_uart_init() in the SPL. Do
so as soon as possible.

As an example, here is how you can use it on a LS1028A SoC:
CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_BASE=0x21c0500
CONFIG_DEBUG_UART_CLOCK=200000000

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agofreescale: ls1021atwr: Drop use of CONFIG_RESET
Simon Glass [Fri, 26 Mar 2021 03:13:01 +0000 (16:13 +1300)]
freescale: ls1021atwr: Drop use of CONFIG_RESET

It is not recommended to use CONFIG_xxx defines for things which are not
Kconfig options. Rename this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodoc: board: qemu-ppce500: Document eTSEC usage
Bin Meng [Sun, 14 Mar 2021 12:15:06 +0000 (20:15 +0800)]
doc: board: qemu-ppce500: Document eTSEC usage

Document how to launch a QEMU session with eTSEC as a network device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoppc: qemu: Enable eTSEC support
Bin Meng [Sun, 14 Mar 2021 12:15:05 +0000 (20:15 +0800)]
ppc: qemu: Enable eTSEC support

QEMU ppce500 target can dynamically instantiate an eTSEC device
if "-device eTSEC" is given to QEMU. This commit enables eTSEC
driver and the required fixed PHY driver to create a usable
network configuration using eTSEC.

Unlike a real world 85xx board that usually stores the eTSEC MAC
address in an EEPROM, CONFIG_NET_RANDOM_ETHADDR is required for
QEMU otherwise U-Boot ethernet initialization complains no valid
ethernet address is set.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoppc: qemu: Create a virtual memory mapping of the platform bus
Bin Meng [Sun, 14 Mar 2021 12:15:04 +0000 (20:15 +0800)]
ppc: qemu: Create a virtual memory mapping of the platform bus

QEMU ppce500 target can dynamically instantiate an eTSEC device on
a platform bus if "-device eTSEC" is given to QEMU. It is presented
as a "simple-bus" in the device tree, with an additional compatible
string "qemu,platform".

Let's create a virtual memory mapping for it in misc_init_r(), in
preparation to adding eTSEC support.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agotest: dm: Add a test case for simple-bus <ranges>
Bin Meng [Sun, 14 Mar 2021 12:15:03 +0000 (20:15 +0800)]
test: dm: Add a test case for simple-bus <ranges>

This adds a test case to verify reading <ranges> of a simple-bus is
working as expected.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodm: core: Correctly read <ranges> of simple-bus
Bin Meng [Sun, 14 Mar 2021 12:15:02 +0000 (20:15 +0800)]
dm: core: Correctly read <ranges> of simple-bus

At present we decode simple bus <ranges> using the following assumption:

- parent #address-cells 1
- child #address-cells 1
- child #size-cells 1

However this might not always be the case.

Update to use fdt_addr_t and fdt_size_t in 'struct simple_bus_plat', and
use fdt_read_ranges() to correctly decode it according to the actual
parent and child #address-cells / #size-cells under a Kconfig option
CONFIG_SIMPLE_BUS_CORRECT_RANGE which can be turned on for any board
that needs it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: tsec: Support <reg> property from the subnode "queue-group"
Bin Meng [Sun, 14 Mar 2021 12:15:01 +0000 (20:15 +0800)]
net: tsec: Support <reg> property from the subnode "queue-group"

At present the tsec driver uses a non-standard DT bindings to get
its <reg> base / size. The upstream Linux kernel seems to require
the <reg> base / size to be put under a subnode of the eTSEC node
with a name prefix "queue-group". This is not documented in the
kernel DT bindings, but it looks every dtsi file that contains the
eTSEC node was written like this.

This commit updates the tsec driver to handle this case.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodt-bindings: net: Update Freescale TSEC to support "queue-group"
Bin Meng [Sun, 14 Mar 2021 12:15:00 +0000 (20:15 +0800)]
dt-bindings: net: Update Freescale TSEC to support "queue-group"

At present the Freescale TSEC node DT bindings doc requires a <reg>
property in the TSEC node. But this might not always be the case.
In the upstream Linux kernel, there is no DT bindings doc for it
but the kernel driver tests a subnode of a name prefixed with
"queue-group", as we can see from gfar_of_init():

  for_each_available_child_of_node(np, child) {
      if (!of_node_name_eq(child, "queue-group"))
  ...

in drivers/net/ethernet/freescale/gianfar.c

Update our DT bindings to describe this alternate description.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: tsec: Use map_physmem() directly instead of dev_remap_addr()
Bin Meng [Sun, 14 Mar 2021 12:14:59 +0000 (20:14 +0800)]
net: tsec: Use map_physmem() directly instead of dev_remap_addr()

dev_remap_addr() eventually calls dev_read_addr_index(), while
pdata->iobase holds the return value of dev_read_addr() that calls
dev_read_addr_index() too. Such duplication can be avoided by using
map_physmem() directly.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agotest: dm: Add a case to test ofnode_phy_is_fixed_link()
Bin Meng [Sun, 14 Mar 2021 12:14:58 +0000 (20:14 +0800)]
test: dm: Add a case to test ofnode_phy_is_fixed_link()

This adds a test case to test the new ofnode_phy_is_fixed_link() API.
Both the new and old DT bindings are covered.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agosandbox: Add a DSA sandbox driver and unit test
Claudiu Manoil [Sun, 14 Mar 2021 12:14:57 +0000 (20:14 +0800)]
sandbox: Add a DSA sandbox driver and unit test

The DSA sandbox driver is used for unit testing the DSA class code.
It implements a simple 2 port switch plus 1 CPU port, and uses a
very simple tag to identify the ports.

The DSA sandbox device is connected via CPU port to a regular Ethernet
sandbox device, called 'dsa-test-eth, managed by the existing eth
sandbox driver.  The 'dsa-test-eth' is not intended for testing the
eth class code however, but it is used to emulate traffic through the
'lan0' and 'lan1' front pannel switch ports.  To achieve this the dsa
sandbox driver registers a tx handler for the 'dsa-test-eth' device.
The switch ports, labeled as 'lan0' and 'lan1', are also registered
as eth devices by the dsa class code this time.  So pinging through
these switch ports is as easy as:

=> setenv ethact lan0
=> ping 1.2.3.5

Unit tests for the dsa class code were also added.  The 'dsa_probe'
test exercises most API functions from dsa.h.  The 'dsa' unit test
simply exercises ARP/ICMP traffic through the two switch ports,
including tag injection and extraction, with the help of the dsa
sandbox driver.

I took care to minimize the impact on the existing eth unit tests,
though some adjustments needed to be made with the addition of
extra eth interfaces used by the dsa unit tests. The additional eth
interfaces also require MAC addresses, these have been added to the
sandbox default environment.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Message-Id: <20210216224804.3355044-5-olteanv@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: tsec: Use dm_eth_phy_connect() directly for the DM case
Vladimir Oltean [Sun, 14 Mar 2021 12:14:56 +0000 (20:14 +0800)]
net: tsec: Use dm_eth_phy_connect() directly for the DM case

Now that the fixed phy driver has been fully adapted to OF APIs,
and dm_eth_phy_connect() already can handle the fixed phy, call
dm_eth_phy_connect() directly in the DM tsec driver.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210216224804.3355044-4-olteanv@gmail.com>
[bmeng: split from "net: mdio: teach dm_eth_phy_connect to connect to fixed PHY"]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: fixed: Support the old DT binding
Bin Meng [Sun, 14 Mar 2021 12:14:55 +0000 (20:14 +0800)]
net: phy: fixed: Support the old DT binding

Update fixedphy_probe() to support the old DT binding.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: fixed: Add the missing ending newline
Bin Meng [Sun, 14 Mar 2021 12:14:54 +0000 (20:14 +0800)]
net: phy: fixed: Add the missing ending newline

The printf statement doesn't end with a newline. Add it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: fixed: Make driver ops static
Bin Meng [Sun, 14 Mar 2021 12:14:53 +0000 (20:14 +0800)]
net: phy: fixed: Make driver ops static

The PHY driver ops should be made static.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: Simplify the logic of phy_connect_fixed()
Bin Meng [Sun, 14 Mar 2021 12:14:52 +0000 (20:14 +0800)]
net: phy: Simplify the logic of phy_connect_fixed()

Simplify the logic of phy_connect_fixed() by using the new API
ofnode_phy_is_fixed_link(), which brings additional bonus of
supporting the old DT bindings.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: xilinx: Drop #ifdef CONFIG_DM_ETH around phy_connect_gmii2rgmii()
Bin Meng [Sun, 14 Mar 2021 12:14:51 +0000 (20:14 +0800)]
net: phy: xilinx: Drop #ifdef CONFIG_DM_ETH around phy_connect_gmii2rgmii()

At present phy_connect_gmii2rgmii() is implemented using a DM API
dev_of_offset() hence it cannot support a non-DM configuration.
Remove the non-DM version prototype of phy_connect_gmii2rgmii()
and make the driver depend on CONFIG_DM_ETH.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agonet: phy: xilinx: Be compatible with live OF tree
Bin Meng [Sun, 14 Mar 2021 12:14:50 +0000 (20:14 +0800)]
net: phy: xilinx: Be compatible with live OF tree

Following the same updates that were done to the fixed phy driver,
use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver
can support live DT.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>