]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agovideo: Fix line padding calculation for 16 and 24 BPP bitmaps
Sylwester Nawrocki [Tue, 1 Dec 2020 11:30:50 +0000 (12:30 +0100)]
video: Fix line padding calculation for 16 and 24 BPP bitmaps

Each row in the pixel array in the bitmap file is padded
if necessary so the row size is always a multiple of 4 bytes.
In current code the complement of row size to a multiple of
4 bytes is further unnecessarily multiplied by the pixel size.
This results in incorrect displaying of bitmaps having row size
that is not a multiple of 4 bytes. Fix this by removing
the unnecessary multiplication.

Tested with 24BPP bitmap and XRGB32 display.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotegra: video: fix tegra_dc_sor_config_panel()
Heinrich Schuchardt [Sun, 4 Apr 2021 23:48:51 +0000 (01:48 +0200)]
tegra: video: fix tegra_dc_sor_config_panel()

Bitwise OR has a higher operator precedence than the ternary conditional.
Add the missing parentheses.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoboard_f: cosmetic: change the debug trace to KB in reserve_video
Patrick Delaunay [Fri, 9 Apr 2021 16:02:06 +0000 (18:02 +0200)]
board_f: cosmetic: change the debug trace to KB in reserve_video

Update the debug trace for the reserved video memory to KB as indicated
in the message with "%luk"; before the patch the computed size
gd->relocaddr - addr is in bytes.

This patch aligns the debug trace in reserve_video() with others
functions, for example on stm32mp157c-dk2:

  - Reserving 3080192k for video at: dfd00000
  + Reserving 3008k for video at: dfd00000
    Reserving 873k for U-Boot at: dfc25000
    Reserving 32776k for malloc() at: ddc23000
    Reserving 72 Bytes for Board Info at: ddc22fb0
    Reserving 280 Bytes for Global Data at: ddc22e90
    Reserving 119072 Bytes for FDT at: ddc05d70
    Reserving 0x278 Bytes for bootstage at: ddc05af0

Fixes: 5630d2fbc50f3035 ("board: Show memory for frame buffers")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofinish removing mb862xx video driver
Trevor Woerner [Mon, 15 Mar 2021 22:52:45 +0000 (18:52 -0400)]
finish removing mb862xx video driver

drivers/video/mb862xx.c was removed in commit
9c1e098fb92de38f0017585658dd50c3009c84ab from December 2020, however, this
last little remnant in drivers/video/cfb_console.c remained.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
3 years agovideo: SIMPLE_PANEL depends on DM_GPIO
Asherah Connor [Wed, 3 Mar 2021 03:46:47 +0000 (14:46 +1100)]
video: SIMPLE_PANEL depends on DM_GPIO

SIMPLE_PANEL currently only depends on PANEL && BACKLIGHT, but the code
makes references to dm_gpio_set_value and gpio_request_by_name.  These
are defined in drivers/gpio/gpio-uclass.c, so a dependency on DM_GPIO
corrects these link errors:

aarch64-linux-gnu-ld.bfd: drivers/built-in.o: in function `simple_panel_set_backlight':
/home/kameliya/u-boot/drivers/video/simple_panel.c:42: undefined reference to `dm_gpio_set_value'
aarch64-linux-gnu-ld.bfd: drivers/built-in.o: in function `simple_panel_enable_backlight':
/home/kameliya/u-boot/drivers/video/simple_panel.c:27: undefined reference to `dm_gpio_set_value'
aarch64-linux-gnu-ld.bfd: drivers/built-in.o: in function `simple_panel_of_to_plat':
/home/kameliya/u-boot/drivers/video/simple_panel.c:72: undefined reference to `gpio_request_by_name'

This issue is only exposed if you have a board which enables
CONFIG_DM_VIDEO without CONFIG_DM_GPIO; so far, none do, but soon a QEMU
board may.

Signed-off-by: Asherah Connor <ashe@kivikakk.ee>
3 years agopwm: Add a driver for Chrome OS EC PWM
Alper Nebi Yasak [Thu, 22 Oct 2020 20:49:27 +0000 (23:49 +0300)]
pwm: Add a driver for Chrome OS EC PWM

This PWM is used in rk3399-gru-bob and rk3399-gru-kevin to control
the display brightness. We can only change the duty cycle, so on
set_config() we just try to match the duty cycle that dividing duty_ns
by period_ns gives us. To disable, we set the duty cycle to zero while
keeping the old value for when we want to re-enable it.

The cros_ec_set_pwm_duty() function is taken from Depthcharge's
cros_ec_set_bl_pwm_duty() but modified to use the generic pwm type.
The driver itself is very loosely based on rk_pwm.c for the general pwm
driver structure.

The devicetree binding file is from Linux, before it was converted to
YAML at 5df5a577a6b4 ("dt-bindings: pwm: Convert google,cros-ec-pwm.txt
to YAML format") in their repo.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agovideo: backlight: Support PWMs without a known period_ns
Alper Nebi Yasak [Thu, 22 Oct 2020 20:49:26 +0000 (23:49 +0300)]
video: backlight: Support PWMs without a known period_ns

The PWM device provided by Chrome OS EC doesn't really support anything
other than setting a relative duty cycle. To support it as a backlight,
this patch makes the PWM period optional in the device tree and pretends
the valid brightness range is its period_ns.

Also adds a sandbox test for a PWM channel that has a fixed period,
checking that the resulting duty_cycle matches on a set_config() even if
the requested period_ns can't be set.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agorockchip: video: vop: Add reset support
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:54 +0000 (11:27 +0100)]
rockchip: video: vop: Add reset support

In order to ensure that the VOP registers are in correct state,
add missing support for the VOP reset lines found in the device-tree

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: video: edp: Add missing reset support
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:53 +0000 (11:27 +0100)]
rockchip: video: edp: Add missing reset support

In order to ensure that the eDP registers are in correct state,
add missing support for the eDP reset lines found in the device-tree.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: video: vop: Fix format of fbbase in debug string
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:52 +0000 (11:27 +0100)]
rockchip: video: vop: Fix format of fbbase in debug string

The debug string printing the device name, framebuffer address and of node
is using %lu as format for the framebuffer address, which is not so nice.
Change it to %lx.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: pwm: Fix default polarity
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:51 +0000 (11:27 +0100)]
rockchip: pwm: Fix default polarity

In the code, the default polarity is set to positive/positive,
which is neither normal polarity or inverted polarity. It's
only the hardware default. This leads to booting linux with
wrong polarity setting.

Update the code to use PWM_DUTY_POSTIVE | PWM_INACTIVE_NEGATIVE
by default instead.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: Pinebook Pro: Enable edp
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:50 +0000 (11:27 +0100)]
rockchip: Pinebook Pro: Enable edp

- uboot rockchip edp code is looking for a rockchip,panel property
  for the edp dts node, so add it.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agoRockchip: video: vop: Reserve efi fb memory
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:49 +0000 (11:27 +0100)]
Rockchip: video: vop: Reserve efi fb memory

When booting with EFI and graphics, the memory used for framebuffer
has to be reserved, otherwise it may leads to kernel memory
overwrite.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agoRockchip: video: edp: Change interrupt polarity configuration
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:48 +0000 (11:27 +0100)]
Rockchip: video: edp: Change interrupt polarity configuration

The linux code is setting polarity configuration to 3 but
uboot code is setting it to 1. Change the configuration to match the
linux configuration

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: video: edp: Add rk3399 support
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:47 +0000 (11:27 +0100)]
rockchip: video: edp: Add rk3399 support

According to linux commit "drm/rockchip: analogix_dp: add rk3399 eDP
support" (82872e42bb1501dd9e60ca430f4bae45a469aa64), rk3288 and rk3399
eDP IPs are nearly the same, the difference is in the grf register
(SOC_CON6 versus SOC_CON20). So, change the code to use the right
register on each IP.

The clocks don't seem to be the same, the eDP clock is not at index 1
on rk3399, so don't try changing the clock at index 1 to rate 0 on
rk3399.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agorockchip: video: vop: Use endpoint compatible string to find VOP mode
Arnaud Patard (Rtp) [Fri, 5 Mar 2021 10:27:46 +0000 (11:27 +0100)]
rockchip: video: vop: Use endpoint compatible string to find VOP mode

The current code is using an hard coded enum and the of node reg value of
endpoint to find out if the endpoint is mipi/hdmi/lvds/edp/dp. The order
is different between rk3288, rk3399 vop little, rk3399 vop big.

A possible solution would be to make sure that the rk3288.dtsi and
rk3399.dtsi files have "expected" reg value or an other solution is
to find the kind of endpoint by comparing the endpoint compatible value.

This patch is implementing the more flexible second solution.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agoMerge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 9 Apr 2021 11:41:32 +0000 (07:41 -0400)]
Merge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20210409
-------------------

- Secure Boot :
- HAB for MX8M / MX7ULP
- CAAM fixes
- Fixes for imxrt1020
- Fixes for USDHC driver
- Fixes for Toradex (Colibri / Apalis)
- Switch to DM for several boards
- mx23 olinuxo
- usbarmory
- marsboard / riotboard
- Gateworks GW Ventana
- NXP upstream patches (LPDDR / CAAM / HAB)

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

3 years agoimx: bootaux fix elf loading
Max Krummenacher [Thu, 11 Mar 2021 17:18:07 +0000 (18:18 +0100)]
imx: bootaux fix elf loading

This reverts the arch/arm/mach-imx/imx_bootaux.c changes of commit
805b3cac1e0c. The loader function name was changed so that it does
not clash with the generically available function in lib/elf.c.

imx-bootaux loads an elf file linked for an auxilary core. Thus the
loader function requires address translation from the auxilary core's
address space to where those are mapped into U-Boot's address space.

So the elf loader is specific and must not be replaced with a generic
loader which doesn't provide the address translation functionality.

Fixes commit 805b3cac1e0c ("lib: elf: Move the generic elf
loading/validating functions to lib")

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agopico-imx6ul: Pass the PMIC I2C address in pmic_get()
Fabio Estevam [Fri, 5 Mar 2021 22:11:49 +0000 (19:11 -0300)]
pico-imx6ul: Pass the PMIC I2C address in pmic_get()

Pass "pfuze3000@8" in pmic_get() so that the PMIC node can
be found in the devicetree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary
Haibo Chen [Mon, 22 Mar 2021 10:55:38 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary

Some board like imx8mm-evkb, IO voltage switch from 3.3v to 1.8v need
around 18ms, common code only delay 10ms, so need to delay extra 8ms.
Otherwise voltage switch will timeout when wait for data0 line.

This IO voltage switch time depends on board design, depend on the
PMIC and capacitance. imx8mm-evkb board use PCA9450(PMIC) and 10uF
capacitance.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agommc: fsl_esdhc_imx: remove redundant cmd11 related code.
Haibo Chen [Mon, 22 Mar 2021 10:55:37 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: remove redundant cmd11 related code.

Common code already handle the voltage switch sequence based on spec,
so remove the redundant voltage switch code.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agoimx6: icorem6: chmod 644 enigcam.bmp
Heinrich Schuchardt [Tue, 16 Mar 2021 20:46:39 +0000 (21:46 +0100)]
imx6: icorem6: chmod 644 enigcam.bmp

Bitmap files should not be executable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
3 years agoimx: imx6ull: fix pinmux sel_input value for uart5 pins
Yuichiro Goto [Mon, 29 Mar 2021 00:14:02 +0000 (09:14 +0900)]
imx: imx6ull: fix pinmux sel_input value for uart5 pins

sel_input value for the following uart5 pins is
different between i.MX6UL and i.MX6ULL:

MX6_PAD_UART5_TX_DATA__UART5_DTE_RX
MX6_PAD_UART5_RX_DATA__UART5_DCE_RX
MX6_PAD_ENET1_RX_EN__UART5_DCE_RTS
MX6_PAD_ENET1_TX_DATA0__UART5_DTE_RTS
MX6_PAD_CSI_DATA02__UART5_DCE_RTS

As sel_input value for the second one is fixed by
the previous commit, fix the rest.

Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp>
3 years agodoc: imx: psb: Document usage of SRC_GPR10 PERSIST_SECONDARY_BOOT for A/B switching
Marek Vasut [Thu, 25 Mar 2021 00:20:48 +0000 (01:20 +0100)]
doc: imx: psb: Document usage of SRC_GPR10 PERSIST_SECONDARY_BOOT for A/B switching

Document SRC_GPR10 PERSIST_SECONDARY_BOOT functionality. This is useful for
reliable bootloader A/B updates, as it permits switching between two copies
of bootloader at different offsets of the same storage. The switch happens
in case one copy is corrupted OR can be enforced by user. This functionality
is present at least since i.MX53, however is poorly documented in all known
SoC datasheets, hence this document aims to clarify the usage, currently on
i.MX7D and i.MX8MM.

Signed-off-by: Marek Vasut <marex@denx.de> # Original MX7D work, this document
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> # All the MX8M work
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@foundries.io>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.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>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoARM: pcm058: Match mainline Linux NAND ECC layout/behaviour
Niel Fourie [Mon, 22 Mar 2021 13:05:11 +0000 (14:05 +0100)]
ARM: pcm058: Match mainline Linux NAND ECC layout/behaviour

Enabled "fsl,legacy-bch-geometry" in U-Boot device tree overlay
to match the legacy BCH geometry layout, which mainline Linux
applies when "fsl,use-minimum-ecc" is not specified in the device
tree.

Reinstated SYS_NAND_ONFI_DETECTION, which when disabled, masked
the mismatch on SOMs with Winbond NAND flash chips.

Signed-off-by: Niel Fourie <lusus@denx.de>
3 years agomx23_olinuxino: convert MMC to driver model
Trevor Woerner [Mon, 22 Mar 2021 15:31:29 +0000 (11:31 -0400)]
mx23_olinuxino: convert MMC to driver model

Convert the Olimex Olinuxino board's support for MMC to driver model following
Fabio Estevam's excellent example from:

commit: 23013aa9619881290dbeb6217f1fab863869050e:
mx23evk: Convert to driver model

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
3 years agomx23_olinuxino: enable device tree
Trevor Woerner [Mon, 22 Mar 2021 15:31:28 +0000 (11:31 -0400)]
mx23_olinuxino: enable device tree

Add the dts file for the Olimex Olinuxino from the linux kernel, and enable
its use in this machine's defconfig.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
3 years agommc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output
Haibo Chen [Wed, 3 Mar 2021 09:05:46 +0000 (17:05 +0800)]
mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output

For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these
are reserved bits. Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the
card clock output.

After commit b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support"),
we meet SD3.0 card can't work at UHS mode, mmc_switch_voltage() fail because
the second mmc_wait_dat0 return -ETIMEDOUT. According to SD spec, during
voltage switch, need to gate off/on the card clock. If not set the FRC_SDCLK_ON,
after CMD11, hardware will gate off the card clock automatically, so card do
not detect the clock off/on behavior, so will draw the data0 line low until
next command.

Fixes: b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support")
Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
3 years agoARM: imx: udoo: convert to DM_ETH
Peter Robinson [Fri, 2 Apr 2021 16:52:51 +0000 (17:52 +0100)]
ARM: imx: udoo: convert to DM_ETH

Convert the UDOO board to use DM_ETH.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: Convert block devices to DM
Peter Robinson [Fri, 2 Apr 2021 16:52:50 +0000 (17:52 +0100)]
ARM: imx: udoo: Convert block devices to DM

Enable DM block, DM MMC and DM SATA support on iMX6 Udoo
convert board code to match the DM support.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: drop MTD config
Peter Robinson [Fri, 2 Apr 2021 16:52:49 +0000 (17:52 +0100)]
ARM: imx: udoo: drop MTD config

The UDOO doesn't have any MTD storage so drop the config.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: udoo: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 16:52:48 +0000 (17:52 +0100)]
ARM: imx: udoo: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6 based Udoo boards.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: board: udoo: Import UDOO dts files
Peter Robinson [Fri, 2 Apr 2021 16:52:47 +0000 (17:52 +0100)]
ARM: board: udoo: Import UDOO dts files

Import the i.MX6 based UDOO dts files from Linux 5.12-rc1.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoARM: embestmx6boards: convert the mars/riot boards to DM SPI
Peter Robinson [Fri, 2 Apr 2021 14:52:33 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert the mars/riot boards to DM SPI

Enable DM_SPI and DM_SPI_FLASH on the mars/riot boards.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert mars/riot boards to DM_ETH
Peter Robinson [Fri, 2 Apr 2021 14:52:32 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert mars/riot boards to DM_ETH

Convert the boards to use DM_ETH.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert mars/riot boards to DM_USB
Peter Robinson [Fri, 2 Apr 2021 14:52:31 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert mars/riot boards to DM_USB

Convert the marsboard/riotboard to use DM_USB.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: convert the mars/riot boards to DM_MMC
Peter Robinson [Fri, 2 Apr 2021 14:52:30 +0000 (15:52 +0100)]
ARM: embestmx6boards: convert the mars/riot boards to DM_MMC

Convert the two Embest boards to use DM MMC.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: riotboard: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 14:52:29 +0000 (15:52 +0100)]
ARM: riotboard: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6D based riotboard.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: merge the riotboard's configs together
Peter Robinson [Fri, 2 Apr 2021 14:52:28 +0000 (15:52 +0100)]
ARM: embestmx6boards: merge the riotboard's configs together

It doesn't make much sense to have two separate configs for
the riotboard so let's merge the SPL config into the main one
for less duplication.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: marsboard: Enable OF_CONTROL and DM gpio/pin control
Peter Robinson [Fri, 2 Apr 2021 14:52:27 +0000 (15:52 +0100)]
ARM: marsboard: Enable OF_CONTROL and DM gpio/pin control

Enable OF_CONTROL and DM for gpio and pin control support
on the i.MX6Q based embestmx6boards marsboard.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: "Eric Bénard" <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: embestmx6boards: Import the marsboard/riotboard. dts files
Peter Robinson [Fri, 2 Apr 2021 14:52:26 +0000 (15:52 +0100)]
ARM: embestmx6boards: Import the marsboard/riotboard. dts files

Import the iMX6 based marsboard and riotboard. dts files from Linux 5.12-rc1

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: st: stm32f746-disco: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:35 +0000 (20:21 +0200)]
board: st: stm32f746-disco: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoboard: freescale: imxrt1050-evk: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:34 +0000 (20:21 +0200)]
board: freescale: imxrt1050-evk: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoboard: freescale: imxrt1020-evk: fix console is not enabled while init dram
Giulio Benetti [Sun, 4 Apr 2021 18:21:33 +0000 (20:21 +0200)]
board: freescale: imxrt1020-evk: fix console is not enabled while init dram

While initializing dram in spl_dram_init(), mdelay() is called that in
order calls get_ticks() that  verifies if timer exists, if doesn't, it
throws a panic(), but since preloader_console_init() has still not been
called those panic()s will fail. This doesn't help debugging, so let's
setup console before calling spl_dram_init() by moving it after
spl_dram_init().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoconfigs: imx8mn_beacon: Enable QSPI Support
Adam Ford [Sat, 3 Apr 2021 03:17:18 +0000 (22:17 -0500)]
configs: imx8mn_beacon: Enable QSPI Support

There is a QSPI chip connected to the FSPI.  Enable the defconfig
to support it.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoarm: dts: imx8mn, imx8mn-beacon: Sync dts files with Kernel 5.12-rc5
Adam Ford [Sat, 3 Apr 2021 03:17:17 +0000 (22:17 -0500)]
arm: dts: imx8mn, imx8mn-beacon: Sync dts files with Kernel 5.12-rc5

There have been a few updates including flexspi, so it's necessary
to re-sync.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoARM: board: usbarmory: Convert to OF_CONTROL and DM
Peter Robinson [Thu, 1 Apr 2021 21:17:06 +0000 (22:17 +0100)]
ARM: board: usbarmory: Convert to OF_CONTROL and DM

Convert usbarmory to OF_CONTROL and DM for gpio, pin
usb support on the i.MX53 based usbarmory.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Andrej Rosano <andrej@inversepath.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: board: usbarmory: Import the usbarmory dts file
Peter Robinson [Thu, 1 Apr 2021 21:17:05 +0000 (22:17 +0100)]
ARM: board: usbarmory: Import the usbarmory dts file

Import the iMX53 based usbarmory dts files from Linux 5.12-rc1

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Andrej Rosano <andrej@inversepath.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: toradex: apalis-imx8x: fix build instructions
Oleksandr Suvorov [Thu, 11 Mar 2021 20:00:37 +0000 (22:00 +0200)]
board: toradex: apalis-imx8x: fix build instructions

Fix an URL for downloading the SCFW binary for an Apalis iMX8X
and improve u-boot image build instructions.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoapalis/colibri_imx6: remove video= settings
Oleksandr Suvorov [Thu, 11 Mar 2021 20:00:36 +0000 (22:00 +0200)]
apalis/colibri_imx6: remove video= settings

Since Toradex provides the full set of overlays for Linux kernel
for display interfaces for both Apalis iMX6Q and Colibri iMX6DL
modules, the video= settings are obsolete. Remove them.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agocolibri_imx6ull/imx7: add missing tdxargs variable
Philippe Schenker [Thu, 11 Mar 2021 20:00:35 +0000 (22:00 +0200)]
colibri_imx6ull/imx7: add missing tdxargs variable

All the other boards have tdxargs specified for setting manual kernel
command-line arguments. Add them also to NAND-based boards.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agocolibri_imx6: adjust boot order
Igor Opaniuk [Thu, 11 Mar 2021 20:00:34 +0000 (22:00 +0200)]
colibri_imx6: adjust boot order

Remove duplicate of mmc0, set this boot order:
1) SD
2) eMMC
3) USB
4) DHCP boot

Fixes: 0e15165bc4e0 ("colibri_imx6: boot env configuration updates")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoboard: gateworks: venice: increase CONFIG_SYS_SPL_MALLOC_SIZE
Tim Harvey [Mon, 8 Mar 2021 21:52:36 +0000 (13:52 -0800)]
board: gateworks: venice: increase CONFIG_SYS_SPL_MALLOC_SIZE

commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading images")'
changed the way buffer allocation worked for SPL to a more flexible
method.

For venice this caused breakage that is resolved by increasing the size
of CONFIG_SYS_SPL_MALLOC_SIZE as the current FIT slighly exceeds 512KiB.

Additionally remove the unnecessary comment on CONFIG_SPL_BSS_MAX_SIZE
and CONFIG_SYS_SPL_MALLOC_SIZE as the size is obvious from the define.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoboard: gateworks: venice: fix gsc_get_dev
Tim Harvey [Mon, 8 Mar 2021 21:52:35 +0000 (13:52 -0800)]
board: gateworks: venice: fix gsc_get_dev

use dm_i2c_probe instead of i2c_get_chip which appears to be more
reliable.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoMAINTAINERS: Use my personal e-mail address
Fabio Estevam [Thu, 4 Mar 2021 17:09:34 +0000 (14:09 -0300)]
MAINTAINERS: Use my personal e-mail address

Use my personal e-mail address for U-Boot related work.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agoimx: ventana: enable dm for SPI
Tim Harvey [Mon, 1 Mar 2021 22:33:37 +0000 (14:33 -0800)]
imx: ventana: enable dm for SPI

Enable driver model for SPI which allows us to remove the iomux
and init.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm for MTD and NAND
Tim Harvey [Mon, 1 Mar 2021 22:33:36 +0000 (14:33 -0800)]
imx: ventana: enable dm for MTD and NAND

Enable driver model for MTD and NAND support allowing us to remove
the iomux, init, and most of the static configuration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm support for MMC and SATA
Tim Harvey [Mon, 1 Mar 2021 22:33:35 +0000 (14:33 -0800)]
imx: ventana: enable dm support for MMC and SATA

Enable driver model support for MMC and SATA.

Note that DM_MMC requires aliases for your mmc devices so
they are added to the dts. Linux does not support enumerating mmc
devices by alias so these are not present in the Linux dts.

Note that we still need board_mmc_init() and board_mmc_getcd() for
not DM SPL to support MMC.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: enable dm support for USB
Tim Harvey [Mon, 1 Mar 2021 22:33:34 +0000 (14:33 -0800)]
imx: ventana: enable dm support for USB

Enable dm support for USB (which also requires dm support for fixed
regulators used for vbus enable) and remove usb iomux which is no
longer needed.

We can remove the handling of otgpwr_en gpio as this is defined in
dt as usbotg vbus-supply but we need to keep the handling of
USB_HUB_RST# for boards that have a USB HUB as that isn't defined in
the dt's currently.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: add pinctrl and remove unneeded UART init and config
Tim Harvey [Mon, 1 Mar 2021 22:33:33 +0000 (14:33 -0800)]
imx: ventana: add pinctrl and remove unneeded UART init and config

Once the IMX6 pinctrl driver is added UART is fully using driver mode
so we no longer need to config and initialize it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: convert U-Boot to OF_CONTROL using FIT image
Tim Harvey [Mon, 1 Mar 2021 22:33:32 +0000 (14:33 -0800)]
imx: ventana: convert U-Boot to OF_CONTROL using FIT image

In preparation for dm conversion convert to OF_CONTROL by adding FIT image
support and multi dtb.

Add a board_fit_config_name_match to match the dtb based off of EEPROM
model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoarm: dts: imx6qdl-gw*: add dr_mode prop to dt to avoid error
Tim Harvey [Mon, 1 Mar 2021 22:33:31 +0000 (14:33 -0800)]
arm: dts: imx6qdl-gw*: add dr_mode prop to dt to avoid error

The fsl-usb dt bindings in Linux default dr_mode to 'host' for
backward compatibility however U-Boot prints an error if
this property does not exist. Declare it in the Gateworks
Ventana device-trees to avoid the error.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: ventana: add Gateworks Ventana dts
Tim Harvey [Mon, 1 Mar 2021 22:33:30 +0000 (14:33 -0800)]
imx: ventana: add Gateworks Ventana dts

Add Gateworks Ventana dts/dtsi files from Linux 5.11 in preparation for
conversion to driver-model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agodt-bindings: add tda1997x and bindings
Tim Harvey [Mon, 1 Mar 2021 22:33:29 +0000 (14:33 -0800)]
dt-bindings: add tda1997x and bindings

Add td1997x header from Linux to be included by dts files.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
3 years agospl: fit: nand: allow for non-page-aligned elements
Tim Harvey [Mon, 1 Mar 2021 22:33:28 +0000 (14:33 -0800)]
spl: fit: nand: allow for non-page-aligned elements

Add a weak nand_get_mtd function for nand drivers to provide mtd info
and use this to set pagesize such that reading of non page-aligned
elements can succeed.

The spl_load_simple_fit already handles block block access so all we
need to do is provide the nand writesize as the block length.

Further cleanup of the drivers which use nand_spl_loaders.c such as
am335x_spl_bch.c, atmel_nand.c, and nand_spl_simple.c could be done
using info from mtd_info instead of statically defined details.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agospl: fit: nand: skip bad block handling if NAND chip not fully defined
Tim Harvey [Mon, 1 Mar 2021 22:33:27 +0000 (14:33 -0800)]
spl: fit: nand: skip bad block handling if NAND chip not fully defined

commit 9f6a14c47ff9 ("spl: fit: nand: fix fit loading in case of bad blocks")
added support for adjusting the image offset to account for bad blocks.
However this requires nand_spl_adjust_offset() which requires fully defined
specifics of the NAND chip being used may not be avialable.

Allow skipping this support for drivers or configs which don't specify
the NAND chip details statically with defines.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoARM: imx: Add OCRAM_S into iMX8M MMU tables
Marek Vasut [Thu, 25 Feb 2021 20:52:26 +0000 (21:52 +0100)]
ARM: imx: Add OCRAM_S into iMX8M MMU tables

The OCRAM_S is regular memory, just like the OCRAM, add it to the MMU
tables so it can be used and cached.

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>
3 years agodoc: imx8mp-evk: update after using binman
Peng Fan [Tue, 6 Apr 2021 03:59:03 +0000 (11:59 +0800)]
doc: imx8mp-evk: update after using binman

update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mp-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:59:02 +0000 (11:59 +0800)]
imx8mp-evk: switch to use binman

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agodoc: imx8mn_evk: update doc after using binman
Peng Fan [Tue, 6 Apr 2021 03:59:01 +0000 (11:59 +0800)]
doc: imx8mn_evk: update doc after using binman

Update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mn-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:59:00 +0000 (11:59 +0800)]
imx8mn-evk: switch to use binman

Use binman to pack images.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mn-ddr4-evk: switch to use binman
Peng Fan [Tue, 6 Apr 2021 03:58:59 +0000 (11:58 +0800)]
imx8mn-ddr4-evk: switch to use binman

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agodoc: imx8mm_evk: update doc after using binman
Peng Fan [Tue, 6 Apr 2021 03:58:58 +0000 (11:58 +0800)]
doc: imx8mm_evk: update doc after using binman

Update doc after switch to binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8mm_evk: switch to use binman to pack images
Peng Fan [Tue, 6 Apr 2021 03:58:57 +0000 (11:58 +0800)]
imx8mm_evk: switch to use binman to pack images

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: fsl: refactor for 32 bit version CAAM support on ARM64
Ye Li [Thu, 25 Mar 2021 09:30:36 +0000 (17:30 +0800)]
crypto: fsl: refactor for 32 bit version CAAM support on ARM64

Previous patch "MLK-18044-4: crypto: caam: Fix pointer size to 32bit
for i.MX8M" breaks the 64 bits CAAM.

Since i.MX CAAM are all 32 bits no matter the ARM arch (32 or 64),
to adapt and not break 64 bits CAAM support,  add a new config
CONFIG_CAAM_64BIT and new relevant type "caam_dma_addr_t".

This config is default enabled when CONFIG_PHYS_64BIT is set except
for iMX8M.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agofsl_mfgprot: Fix typo in sign_mppubk()
Breno Lima [Thu, 25 Mar 2021 09:30:35 +0000 (17:30 +0800)]
fsl_mfgprot: Fix typo in sign_mppubk()

The signature is generated using manufacturing protection private key.

Fix typo in fsl_mfgprot.c.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8: Add DEK blob encapsulation
Clement Faure [Thu, 25 Mar 2021 09:30:34 +0000 (17:30 +0800)]
imx8: Add DEK blob encapsulation

Add DEK encapsulation support for imx8. The DEK blob is generated by the
SECO through the SCFW API.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8m: Add DEK blob encapsulation for imx8m
Clement Faure [Thu, 25 Mar 2021 09:30:33 +0000 (17:30 +0800)]
imx8m: Add DEK blob encapsulation for imx8m

Add DEK blob encapsulation support for IMX8M through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application call.
U-boot sends and receives the DEK and the DEK blob binaries through OP-TEE
dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx: caam: new u-boot command to set PRIBLOB bitfield from CAAM SCFGR register to 0x3
Clement Le Marquis [Thu, 25 Mar 2021 09:30:32 +0000 (17:30 +0800)]
imx: caam: new u-boot command to set PRIBLOB bitfield from CAAM SCFGR register to 0x3

It is highly recommended to set the PRIBLOB bitfield to 0x3 once your
encrypted boot image has booted up, this prevents the generation of new
blobs that can be used to decrypt an encrypted boot image. The PRIBLOB is
a sticky type bit and cannot be changed until the next power on reset.

Add the set_priblob_bitfield U-Boot command to prevent the generation of
new blobs.

Signed-off-by: Clement Le Marquis <clement.lemarquis@nxp.com>
Acked-by: Ye Li <Ye.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 8 Apr 2021 11:33:14 +0000 (07:33 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- Watchdog, Unleashed and Icicle improvements

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 8 Apr 2021 11:32:54 +0000 (07:32 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Add Armada 38x RTC driver (Marek)
- turris_omnia: Misc updates (enable RTC and other cmds) (Marek)
- ds414: Misc updates (enable XHCI_PCI USB support etc) (Phil)
- Convert MVEBU MMC driver to DM (Harm)
- kirkwood: Misc updates and cleanups to some boards (Harm)

3 years agoriscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes
Bin Meng [Wed, 31 Mar 2021 07:24:50 +0000 (15:24 +0800)]
riscv: dts: mpfs-icicle-kit: Drop 'clock-frequency' in the uart nodes

The uart nodes already provide <clocks> property for the driver to
dynamically calculate the correct clock frequency. There is no need
to keep the hard-coded <clock-frequency> property.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agoclk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag
Bin Meng [Wed, 31 Mar 2021 07:24:49 +0000 (15:24 +0800)]
clk: mpfs_clk: Enable DM_FLAG_PRE_RELOC flag

This driver is needed in the pre-relocation phase as the serial
driver depends on it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agoriscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN
Bin Meng [Wed, 31 Mar 2021 07:24:48 +0000 (15:24 +0800)]
riscv: mpfs-icicle-kit: Increase SYS_MALLOC_F_LEN

The RISC-V architecture default value of CONFIG_SYS_MALLOC_F_LEN
(0x1000) would not provide enough memory for devices like mpfs
clock and ns16550 serial to bind well before relocation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
3 years agotimer: sifive_clint: Support the official clint DT bindings
Bin Meng [Sat, 27 Mar 2021 11:57:35 +0000 (19:57 +0800)]
timer: sifive_clint: Support the official clint DT bindings

Linux kernel commit a2770b57d083 ("dt-bindings: timer: Add CLINT bindings")
adds the official DT bindings for CLINT, which uses "sifive,clint0"
as the compatible string. "riscv,clint0" is now legacy and has to
be kept for backward compatibility of legacy systems.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: assembler versions of memcpy, memmove, memset
Heinrich Schuchardt [Sat, 27 Mar 2021 11:37:04 +0000 (12:37 +0100)]
riscv: assembler versions of memcpy, memmove, memset

Provide optimized versions of memcpy(), memmove(), memset() copied from
the Linux kernel.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agotest: unit test for longjmp
Heinrich Schuchardt [Tue, 23 Mar 2021 18:11:27 +0000 (19:11 +0100)]
test: unit test for longjmp

Provide a unit test for the longjmp() library function

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Sean Anderson <seanga2@gmail.com>
3 years agoriscv: simplify longjmp
Heinrich Schuchardt [Tue, 23 Mar 2021 18:11:26 +0000 (19:11 +0100)]
riscv: simplify longjmp

The value returned by setjmp must be nonzero. If zero is passed as
parameter it must be replaced by 1.

This patch reduces the code size a bit.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoriscv: sifive: Rename fu540 board to unleashed
Bin Meng [Wed, 17 Mar 2021 03:10:58 +0000 (11:10 +0800)]
riscv: sifive: Rename fu540 board to unleashed

In preparation to add SiFive Unmatched board support, let's rename
the existing fu540 board to unleashed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoconfigs: EXT4, FAT, hush shell, env on S-mode MAIX
Heinrich Schuchardt [Sat, 6 Mar 2021 08:20:32 +0000 (08:20 +0000)]
configs: EXT4, FAT, hush shell, env on S-mode MAIX

* enable storing the environment in the SPI flash
* enable EXT4 and FAT file system
* enable hush shell
* run k210_bootcmd as default boot command

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
3 years agoriscv: Remove unused define in maix header
Sean Anderson [Thu, 11 Mar 2021 01:51:31 +0000 (20:51 -0500)]
riscv: Remove unused define in maix header

This define was left over from a previous revision, and was never used.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
3 years agoriscv: Enable watchdog for the k210
Sean Anderson [Thu, 11 Mar 2021 02:02:22 +0000 (21:02 -0500)]
riscv: Enable watchdog for the k210

This enables the necessary config options.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoriscv: Add watchdog bindings for the k210
Sean Anderson [Thu, 11 Mar 2021 02:02:21 +0000 (21:02 -0500)]
riscv: Add watchdog bindings for the k210

This adds the necessary bindings. Most of them are already there.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Acked-by: Rick Chen <rick@andestech.com>
3 years agowdt: dw: Free the clock on error
Sean Anderson [Thu, 11 Mar 2021 02:02:20 +0000 (21:02 -0500)]
wdt: dw: Free the clock on error

The clock subsystem requires that clk_free be called on clocks obtained via
clk_get_*.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agowdt: dw: Enable the clock before using it
Sean Anderson [Thu, 11 Mar 2021 02:02:19 +0000 (21:02 -0500)]
wdt: dw: Enable the clock before using it

The watchdog won't work if the clock isn't enabled.

Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agowdt: dw: Switch to if(CONFIG()) instead of using #if
Sean Anderson [Thu, 11 Mar 2021 02:02:18 +0000 (21:02 -0500)]
wdt: dw: Switch to if(CONFIG()) instead of using #if

This is preferred over #if because the compiler can check syntax even if
the feature is disabled. This cannot be used for CONFIG_CLK because
CONFIG_DW_WDT_CLOCK_KHZ is not defined on all platforms.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agowdt: dw: Switch to using fls for log2
Sean Anderson [Thu, 11 Mar 2021 02:02:17 +0000 (21:02 -0500)]
wdt: dw: Switch to using fls for log2

log_2_n_round_up is only found in arm. fls performs the same job and is
generic.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocrypto: caam: Add secure memory vid 3 support
Aymen Sghaier [Thu, 25 Mar 2021 09:30:29 +0000 (17:30 +0800)]
crypto: caam: Add secure memory vid 3 support

In i.MX8M platforms the secure memory block has a newer version
than those used in i.MX6/7 platforms, this patch update the driver
to use the correct registers offsets.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: caam: Fix pointer size to 32bit for i.MX8M
Aymen Sghaier [Thu, 25 Mar 2021 09:30:28 +0000 (17:30 +0800)]
crypto: caam: Fix pointer size to 32bit for i.MX8M

  The CAAM block used in i.MX8M is 32 bits address size but when the flag
 PHYS_64BIT is enabled for armv8, the CAAM driver will try to use a
 wrong pointer size.
  This patch fixes this issue.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocrypto: Add blob command support for i.MX8M platforms
Aymen Sghaier [Thu, 25 Mar 2021 09:30:27 +0000 (17:30 +0800)]
crypto: Add blob command support for i.MX8M platforms

 This patch enable blob command for mScale platforms.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>