toradex: imx: fixes and updates for v2020.10
Subsystems (4)
v2 cover toradex: imx: fixes and updates for v2020.10
This is the common combined patch-series, which superseeds [1], [2], [3].
Includes:
1. Fixes for splash screen logo drawing in Colibri iMX7/iMX6ULL.
2. Support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters).
3. DDRC size fixes in A7-M4 mapping table for bootaux command.
v2:
- ?ombine [1], [2], [3] into one patch-series.
- Correct strings for carrier board names/adapters.
- Fix display timings, sync with downstream Toradex Linux.
[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=185024
[2]: https://patchwork.ozlabs.org/project/uboot/list/?series=185100
[3]: https://patchwork.ozlabs.org/project/uboot/list/?series=185354
Igor Opaniuk (14):
imx: mx7: fix DDRC size in A7-M4 mapping table
toradex: tdx-cfg-block: add EEPROM read/store wrappers
toradex: tdx-cfg-block: add carrier boards and display adapters
toradex: tdx-cfg-block: add support for EEPROM
toradex: tdx-cfg-clock: add migration routine from PID8
toradex: tdx-cfg-block: add carrier board info printing
ARM: dts: imx8mm-verdin: eeprom nodes adjustments
verdin-imx8mm: add EEPROM support for carrier board
ARM: dts: imx6ull-colibri: move u-boot specific node
toradex: common: show boot logo
ARM: dts: imx7-colibri: multiple node updates
colibri-imx6ull: show boot logo
colibri-imx6ull: fix splash screen logo drawing
colibri-imx7: fix splash logo drawing
arch/arm/dts/imx6ull-colibri-u-boot.dtsi | 45 ++ arch/arm/dts/imx6ull-colibri.dtsi | 43 -- arch/arm/dts/imx7-colibri-emmc.dts | 2 +- arch/arm/dts/imx7-colibri-rawnand.dts | 10 +- arch/arm/dts/imx7-colibri-u-boot.dtsi | 39 ++ arch/arm/dts/imx7-colibri.dtsi | 65 ++- arch/arm/dts/imx8mm-verdin.dts | 22 +- arch/arm/mach-imx/mx7/soc.c | 2 +- .../toradex/colibri-imx6ull/colibri-imx6ull.c | 40 +- board/toradex/colibri_imx7/MAINTAINERS | 1 + board/toradex/colibri_imx7/colibri_imx7.c | 44 +- board/toradex/common/Kconfig | 18 + board/toradex/common/Makefile | 1 + board/toradex/common/tdx-cfg-block.c | 402 ++++++++++++++++-- board/toradex/common/tdx-cfg-block.h | 16 + board/toradex/common/tdx-common.c | 54 +++ board/toradex/common/tdx-common.h | 4 + board/toradex/common/tdx-eeprom.c | 90 ++++ board/toradex/common/tdx-eeprom.h | 14 + board/toradex/verdin-imx8mm/Kconfig | 6 + configs/colibri-imx6ull_defconfig | 1 + configs/colibri_imx7_defconfig | 2 + configs/colibri_imx7_emmc_defconfig | 2 + configs/verdin-imx8mm_defconfig | 1 + 24 files changed, 730 insertions(+), 194 deletions(-) create mode 100644 arch/arm/dts/imx7-colibri-u-boot.dtsi create mode 100644 board/toradex/common/tdx-eeprom.c create mode 100644 board/toradex/common/tdx-eeprom.h
Signature · 1 line
2.17.1
PATCH v2 1/14 imx: mx7: fix DDRC size in A7-M4 mapping table
From: Igor Opaniuk <[email protected]>
According to i.MX 7Solo Applications Processor Reference Manual, 2.1.3 Cortex-M4 Memory Map, M4 can address only 1536MB of DDRC (Start Address: 0x8000_0000; End Address: 0xDFFF_FFFF). Correct DDRC size to 0x60000000.
---
(no changes since v1)
arch/arm/mach-imx/mx7/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx7/soc.c +1 -1
@@ -218,7 +218,7 @@ const struct rproc_att hostmap[] = { { 0x00940000, 0x00940000, 0x20000 }, /* OCRAM_PXP */ { 0x20240000, 0x00940000, 0x20000 }, /* OCRAM_PXP */ { 0x10000000, 0x80000000, 0x0fff0000 }, /* DDR Code alias */ - { 0x80000000, 0x80000000, 0xe0000000 }, /* DDRC */ + { 0x80000000, 0x80000000, 0x60000000 }, /* DDRC */ { /* sentinel */ } }; #endif
Signature · 1 line
2.17.1
PATCH v2 2/14 toradex: tdx-cfg-block: add EEPROM read/store wrappers
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
These functions wrap functionality for storing config blocks in EEPROM.
---
(no changes since v1)
board/toradex/common/Makefile | 1 + board/toradex/common/tdx-eeprom.c | 90 +++++++++++++++++++++++++++++++ board/toradex/common/tdx-eeprom.h | 14 +++++ 3 files changed, 105 insertions(+) create mode 100644 board/toradex/common/tdx-eeprom.c create mode 100644 board/toradex/common/tdx-eeprom.h
board/toradex/common/Makefile +1 -0
@@ -8,4 +8,5 @@ obj- := __dummy__.o else obj-$(CONFIG_TDX_CFG_BLOCK) += tdx-cfg-block.o obj-y += tdx-common.o +obj-y += tdx-eeprom.o endif
board/toradex/common/tdx-eeprom.c new file +90 -0
90 lines not on this page · raw message
board/toradex/common/tdx-eeprom.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2020 Toradex +*/ + +#ifndef _TDX_EEPROM_H +#define _TDX_EEPROM_H + +#include <i2c_eeprom.h> + +int read_tdx_eeprom_data (u32 eeprom_id,int offset,uint8_t *buf,int size); +int write_tdx_eeprom_data (u32 eeprom_id,int offset,uint8_t *buf,int size); + +#endif /* _TDX_EEPROM_H */
Signature · 1 line
2.17.1
PATCH v2 3/14 toradex: tdx-cfg-block: add carrier boards and display adapters
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Add defines for supported carrier boards and display adapters.
---
(no changes since v1)
board/toradex/common/tdx-cfg-block.c | 12 ++++++++++++ board/toradex/common/tdx-cfg-block.h | 11 +++++++++++ 2 files changed, 23 insertions(+)
board/toradex/common/tdx-cfg-block.c +12 -0
@@ -124,6 +124,18 @@ const char * const toradex_modules[] = { [57] = "Verdin iMX8M Mini DualLite 1GB", }; +const char *const toradex_carrier_boards[] = { + [0 ] ="UNKNOWN CARRIER BOARD" , + [155 ] ="Dahlia" , + [156 ] ="Verdin Development Board" , +}; + +const char *const toradex_display_adapters[] = { + [0 ] ="UNKNOWN DISPLAY ADAPTER" , + [157 ] ="Verdin DSI to HDMI Adapter" , + [159 ] ="Verdin DSI to LVDS Adapter" , +}; +#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC static int tdx_cfg_block_mmc_storage (u8 *config_block,int write) {
board/toradex/common/tdx-cfg-block.h +11 -0
@@ -80,7 +80,18 @@ enum { VERDIN_IMX8MMDL, }; +enum { +DAHLIA =155 , +VERDIN_DEVELOPMENT_BOARD =156 , +}; + +enum { +VERDIN_DSI_TO_HDMI_ADAPTER =157 , +VERDIN_DSI_TO_LVDS_ADAPTER =159 , +}; +extern const char *const toradex_modules[]; +extern const char *const toradex_carrier_boards[];extern bool valid_cfgblock;extern struct toradex_hw tdx_hw_tag;extern struct toradex_eth_addr tdx_eth_addr;
Signature · 1 line
2.17.1
PATCH v2 4/14 toradex: tdx-cfg-block: add support for EEPROM
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
This introduces support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters).
To enable EEPROM as a storage for the main config block:
TDX_HAVE_EEPROM=y.
For additional EEPROMs please enable this Kconfig symbol:
TDX_CFG_BLOCK_EXTRA=y.
Information about existing EEPROM chips is provided via Device Tree using aliases.
You can also write configuration for the carrier board using create_carrier subcommand for cfgblock. Example:
Verdin iMX8MM # cfgblock create_carrier
Supported carrier boards:
UNKNOWN CARRIER = [0]
Verdin Carrier Board = [1]
Choose your carrier board (provide ID): 1
Enter carrier board version (e.g. V1.1B): V1.0A
Enter carrier board serial number: 10622780
Also with barcode:
Verdin iMX8MM # cfgblock create carrier -y 0156100010622780
---
(no changes since v1)
board/toradex/common/Kconfig | 18 ++ board/toradex/common/tdx-cfg-block.c | 312 +++++++++++++++++++++++---- board/toradex/common/tdx-cfg-block.h | 3 + 3 files changed, 294 insertions(+), 39 deletions(-)
board/toradex/common/Kconfig +18 -0
@@ -20,6 +20,12 @@ config TDX_HAVE_NAND config TDX_HAVE_NOR bool +config TDX_HAVE_EEPROM + bool + +config TDX_HAVE_EEPROM_EXTRA + bool + if TDX_CFG_BLOCK config TDX_CFG_BLOCK_IS_IN_MMC
@@ -37,6 +43,11 @@ config TDX_CFG_BLOCK_IS_IN_NOR depends on TDX_HAVE_NOR default y +config TDX_CFG_BLOCK_IS_IN_EEPROM + bool + depends on TDX_HAVE_EEPROM + default y + config TDX_CFG_BLOCK_DEV int "Toradex config block eMMC device ID" depends on TDX_CFG_BLOCK_IS_IN_MMC
@@ -66,4 +77,11 @@ config TDX_CFG_BLOCK_2ND_ETHADDR Ethernet carrier boards. This options enables the code to set the second Ethernet address as environment variable (eth1addr). +config TDX_CFG_BLOCK_EXTRA + bool "Support for additional EEPROMs (carrier board, display adapter)" + depends on TDX_HAVE_EEPROM_EXTRA + help + Enables fetching auxilary config blocks from carrier board/display + adapter EEPROMs. + endif
board/toradex/common/tdx-cfg-block.c +273 -39
438 lines not on this page · raw message
board/toradex/common/tdx-cfg-block.h +3 -0
@@ -94,9 +94,12 @@ extern const char * const toradex_modules[];extern const char *const toradex_carrier_boards[];extern bool valid_cfgblock;extern struct toradex_hw tdx_hw_tag; +extern struct toradex_hw tdx_car_hw_tag;extern struct toradex_eth_addr tdx_eth_addr;extern u32 tdx_serial; +extern u32 tdx_car_serial;int read_tdx_cfg_block (void ); +int read_tdx_cfg_block_carrier (void );#endif /* _TDX_CFG_BLOCK_H */
Signature · 1 line
2.17.1
PATCH v2 5/14 toradex: tdx-cfg-clock: add migration routine from PID8
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Add migration routine from PID8 pre-stored values on EEPROM (including sane value checks).
---
(no changes since v1)
board/toradex/common/tdx-cfg-block.c | 78 ++++++++++++++++++++++++++++ board/toradex/common/tdx-cfg-block.h | 2 + 2 files changed, 80 insertions(+)
board/toradex/common/tdx-cfg-block.c +78 -0
@@ -649,6 +649,84 @@ out:return ret; } +int check_pid8_sanity (char *pid8) +{ +char s_carrierid_verdin_dev[5 ]; +char s_carrierid_dahlia[5 ]; + +sprintf (s_carrierid_verdin_dev,"0%d" ,VERDIN_DEVELOPMENT_BOARD ); +sprintf (s_carrierid_dahlia,"0%d" ,DAHLIA ); + +/* sane value check, first 4 chars which represent carrier id */ +if (!strncmp (pid8, s_carrierid_verdin_dev,4 )) +return 0 ; + +if (!strncmp (pid8, s_carrierid_dahlia,4 )) +return 0 ; + +return -EINVAL ; +} + +int try_migrate_tdx_cfg_block_carrier (void ) +{ +char pid8[8 ]; +int offset =0 ; +int ret =CMD_RET_SUCCESS ; +size_t size =TDX_CFG_BLOCK_EXTRA_MAX_SIZE ; +u8 *config_block; + +memset (pid8,0x0 ,8 ); + ret =read_tdx_eeprom_data (TDX_EEPROM_ID_CARRIER ,0x0 , (u8 *)pid8,8 ); +if (ret) +return ret; + +if (check_pid8_sanity (pid8)) +return -EINVAL ; + +/* Allocate RAM area for config block */ + config_block =memalign (ARCH_DMA_MINALIGN , size); +if (!config_block) { +printf ("Not enough malloc space available!\n" ); +return CMD_RET_FAILURE ; + } + +memset (config_block,0xff , size); +/* we try parse PID8 concatenating zeroed serial number */ + tdx_car_hw_tag.ver_major = pid8[4 ] -'0' ; + tdx_car_hw_tag.ver_minor = pid8[5 ] -'0' ; + tdx_car_hw_tag.ver_assembly = pid8[7 ] -'0' ; + + pid8[4 ] ='\0' ; + tdx_car_hw_tag.prodid =simple_strtoul (pid8,NULL ,10 ); + +/* Valid Tag */ +write_tag (config_block, &offset,TAG_VALID ,NULL ,0 ); + +/* Product Tag */ +write_tag (config_block, &offset,TAG_HW , (u8 *)&tdx_car_hw_tag, +sizeof (tdx_car_hw_tag)); + +/* Serial Tag */ +write_tag (config_block, &offset,TAG_CAR_SERIAL , (u8 *)&tdx_car_serial, +sizeof (tdx_car_serial)); + +memset (config_block + offset,0 ,32 - offset); + ret =write_tdx_eeprom_data (TDX_EEPROM_ID_CARRIER ,0x0 , config_block, + size); +if (ret) { +printf ("Failed to write Toradex Extra config block: %d\n" , + ret); + ret =CMD_RET_FAILURE ; + goto out; + } + +printf ("Successfully migrated to Toradex Config Block from PID8\n" ); + +out: +free (config_block); +return ret; +} +static int get_cfgblock_carrier_interactive (void ) {char message[CONFIG_SYS_CBSIZE ];
board/toradex/common/tdx-cfg-block.h +2 -0
@@ -102,4 +102,6 @@ extern u32 tdx_car_serial;int read_tdx_cfg_block (void );int read_tdx_cfg_block_carrier (void ); +int try_migrate_tdx_cfg_block_carrier (void ); +#endif /* _TDX_CFG_BLOCK_H */
Signature · 1 line
2.17.1
PATCH v2 6/14 toradex: tdx-cfg-block: add carrier board info printing
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Add carrier board info printing during boot time:
U-Boot 2020.07-rc4-02435-g1756e05 (Jun 22 2020 - 22:43:59 +0300)
CPU: Freescale i.MX8MMQ rev1.0 at 1200 MHz
....
Carrier: Toradex Verdin Development Board V1.0A, Serial# 10622780 Verdin iMX8MM #
---
(no changes since v1)
board/toradex/common/tdx-common.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
board/toradex/common/tdx-common.c +28 -0
@@ -19,6 +19,12 @@static char tdx_serial_str[9 ];static char tdx_board_rev_str[6 ]; +#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA +static char tdx_car_serial_str[9 ]; +static char tdx_car_rev_str[6 ]; +static char *tdx_carrier_board_name; +#endif +#ifdef CONFIG_REVISION_TAG u32 get_board_rev (void ) {
@@ -88,6 +94,28 @@ int show_board_info(void) toradex_modules[tdx_hw_tag.prodid], tdx_board_rev_str, tdx_serial_str); +#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA +if (read_tdx_cfg_block_carrier ()) { +printf ("MISSING TORADEX CARRIER CONFIG BLOCKS\n" ); +try_migrate_tdx_cfg_block_carrier (); + }else { + tdx_carrier_board_name = (char *) + toradex_carrier_boards[tdx_car_hw_tag.prodid]; + +sprintf (tdx_car_serial_str,"%08u" , tdx_car_serial); +sprintf (tdx_car_rev_str,"V%1d.%1d%c" , + tdx_car_hw_tag.ver_major, + tdx_car_hw_tag.ver_minor, + (char )tdx_car_hw_tag.ver_assembly + +'A' ); + +env_set ("carrier_serial#" , tdx_car_serial_str); +printf ("Carrier: Toradex %s %s, Serial# %s\n" , + tdx_carrier_board_name, + tdx_car_rev_str, + tdx_car_serial_str); + } +#endif }/*
Signature · 1 line
2.17.1
PATCH v2 7/14 ARM: dts: imx8mm-verdin: eeprom nodes adjustments
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Rename EEPROM nodes.
Create aliases for EEPROM to unify their order:
eeprom0 - on-module EEPROM
eeprom1 - carrier-board EEPROM
eeprom2 - MIPI-DSI to HDMI adapter EEPROM
---
(no changes since v1)
arch/arm/dts/imx8mm-verdin.dts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
arch/arm/dts/imx8mm-verdin.dts +14 -8
@@ -16,6 +16,12 @@ stdout-path = &uart1; }; + aliases { + eeprom0 = &eeprom_module; + eeprom1 = &eeprom_carrier_board; + eeprom2 = &eeprom_display_adapter; + }; + /* fixed clock dedicated to SPI CAN controller */ clk20m: oscillator { compatible = "fixed-clock";
@@ -321,8 +327,8 @@ vcc-supply = <&ldo5_reg>; }; - eeprom at 50 { - compatible = "st,24c02"; + eeprom_module: eeprom at 50 { + compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>; reg = <0x50>; };
@@ -377,16 +383,16 @@ status = "okay"; }; - /* EEPROM on MIPI-DSI to HDMI adapter */ - eeprom_50: eeprom at 50 { - compatible = "st,24c02"; + /* EEPROM on display adapter (MIPI DSI Display Adapter) */ + eeprom_display_adapter: eeprom at 50 { + compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>; reg = <0x50>; }; - /* EEPROM on Verdin Development board */ - eeprom_57: eeprom at 57 { - compatible = "st,24c02"; + /* EEPROM on carrier board */ + eeprom_carrier_board: eeprom at 57 { + compatible = "st,24c02", "atmel,24c02", "i2c-eeprom"; pagesize = <16>; reg = <0x57>; };
Signature · 1 line
2.17.1
PATCH v2 8/14 verdin-imx8mm: add EEPROM support for carrier board
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Enable these Kconfig symbols:
TDX_CFG_BLOCK_EXTRA=y
TDX_HAVE_EEPROM_EXTRA=y
---
(no changes since v1)
board/toradex/verdin-imx8mm/Kconfig | 6 ++++++ configs/verdin-imx8mm_defconfig | 1 + 2 files changed, 7 insertions(+)
board/toradex/verdin-imx8mm/Kconfig +6 -0
@@ -12,9 +12,15 @@ config SYS_CONFIG_NAME config TDX_CFG_BLOCK default y +config TDX_CFG_BLOCK_EXTRA + default y + config TDX_HAVE_MMC default y +config TDX_HAVE_EEPROM_EXTRA + default y + config TDX_CFG_BLOCK_DEV default "0"
configs/verdin-imx8mm_defconfig +1 -0
@@ -74,6 +74,7 @@ CONFIG_MXC_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_DM_MMC=y CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_FSL_ESDHC_IMX=y
Signature · 1 line
2.17.1
PATCH v2 9/14 ARM: dts: imx6ull-colibri: move u-boot specific node
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
1. Move aliases and legacy lcdif node to the u-boot specific dts include.
2. Provide proper display timings, as in the downstream Toradex kernel [1].
---
(no changes since v1)
arch/arm/dts/imx6ull-colibri-u-boot.dtsi | 45 ++++++++++++++++++++++++ arch/arm/dts/imx6ull-colibri.dtsi | 43 ---------------------- 2 files changed, 45 insertions(+), 43 deletions(-)
arch/arm/dts/imx6ull-colibri-u-boot.dtsi +45 -0
@@ -3,6 +3,15 @@ * Copyright 2019 Toradex AG */ +/ { + aliases { + u-boot,dm-pre-reloc; + mmc0 = &usdhc1; + usb0 = &usbotg1; /* required for ums */ + display0 = &lcdif; + }; +}; + &pinctrl_uart1 { u-boot,dm-pre-reloc; };
@@ -10,3 +19,39 @@ &pinctrl_uart1_ctrl1 { u-boot,dm-pre-reloc; }; + +&lcdif { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lcdif_dat + &pinctrl_lcdif_ctrl>; + status = "okay"; + display = <&display0>; + u-boot,dm-pre-reloc; + + display0: display0 { + bits-per-pixel = <18>; + bus-width = <24>; + status = "okay"; + + display-timings { + native-mode = <&timing_vga>; + timing_vga: 640x480 { + u-boot,dm-pre-reloc; + clock-frequency = <25175000>; + hactive = <640>; + vactive = <480>; + hback-porch = <40>; + hfront-porch = <24>; + vback-porch = <32>; + vfront-porch = <11>; + hsync-len = <96>; + vsync-len = <2>; + + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; + }; + }; +};
arch/arm/dts/imx6ull-colibri.dtsi +0 -43
55 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 10/14 toradex: common: show boot logo
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Add function for showing boot logo, embed into u-boot blob.
---
(no changes since v1)
board/toradex/common/tdx-common.c | 26 ++++++++++++++++++++++++++ board/toradex/common/tdx-common.h | 4 ++++ 2 files changed, 30 insertions(+)
board/toradex/common/tdx-common.c +26 -0
@@ -9,6 +9,13 @@#include <init.h> #include <linux/libfdt.h> +#ifdef CONFIG_DM_VIDEO +#include <bmp_logo.h> +#include <dm.h> +#include <splash.h> +#include <video.h> +#endif +#include "tdx-cfg-block.h" #include <asm/setup.h> #include "tdx-common.h"
@@ -196,3 +203,22 @@ int ft_common_board_setup(void *blob, bd_t *bd) }#endif /* CONFIG_TDX_CFG_BLOCK */ + +#if defined(CONFIG_DM_VIDEO ) +int show_boot_logo (void ) +{ +struct udevice *dev; +int ret; +int xpos, ypos; + +splash_get_pos (&xpos, &ypos); + + ret =uclass_get_device (UCLASS_VIDEO ,0 , &dev); +if (ret) +return ret; + + ret =video_bmp_display (dev, (ulong )bmp_logo_bitmap, xpos, ypos, true); + +return ret; +} +#endif /* CONFIG_DM_VIDEO */
board/toradex/common/tdx-common.h +4 -0
@@ -11,4 +11,8 @@int ft_common_board_setup (void *blob,bd_t *bd); +#if defined(CONFIG_DM_VIDEO ) +int show_boot_logo (void ); +#endif +#endif /* _TDX_COMMON_H */
Signature · 1 line
2.17.1
PATCH v2 11/14 ARM: dts: imx7-colibri: multiple node updates
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
1. Move u-boot specific nodes to u-boot dts include: legacy lcdif node and aliases.
2. Add iomux configuration for LCD.
3. Drop un-needed u-boot,dm-pre-reloc for alias node.
4. Fix display-timings, use the one from Toradex downstream kernel [1]
---
(no changes since v1)
arch/arm/dts/imx7-colibri-emmc.dts | 2 +- arch/arm/dts/imx7-colibri-rawnand.dts | 10 ++-- arch/arm/dts/imx7-colibri-u-boot.dtsi | 39 ++++++++++++++++ arch/arm/dts/imx7-colibri.dtsi | 65 +++++++++++++------------- board/toradex/colibri_imx7/MAINTAINERS | 1 + 5 files changed, 79 insertions(+), 38 deletions(-) create mode 100644 arch/arm/dts/imx7-colibri-u-boot.dtsi
arch/arm/dts/imx7-colibri-emmc.dts +1 -1
@@ -5,13 +5,13 @@ /dts-v1/; #include "imx7-colibri.dtsi" +#include "imx7-colibri-u-boot.dtsi" / { model = "Toradex Colibri iMX7D 1GB (eMMC)"; compatible = "toradex,imx7d-colibri-emmc", "fsl,imx7d"; aliases { - u-boot,dm-pre-reloc; mmc0 = &usdhc3; mmc1 = &usdhc1; display1 = &lcdif;
arch/arm/dts/imx7-colibri-rawnand.dts +6 -4
@@ -5,19 +5,21 @@ /dts-v1/; #include "imx7-colibri.dtsi" +#include "imx7-colibri-u-boot.dtsi" / { model = "Toradex Colibri iMX7S/D"; compatible = "toradex,imx7-colibri", "fsl,imx7"; - chosen { - stdout-path = &uart1; - }; - aliases { + display1 = &lcdif; usb0 = &usbotg1; /* required for ums */ }; + chosen { + stdout-path = &uart1; + }; + reg_5v0: regulator-5v0 { compatible = "regulator-fixed"; regulator-name = "5V";
arch/arm/dts/imx7-colibri-u-boot.dtsi new file +39 -0
@@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright 2020 Toradex + */ + +&lcdif { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lcdif_dat + &pinctrl_lcdif_ctrl>; + display = <&display0>; + u-boot,dm-pre-reloc; + + display0: display0 { + bits-per-pixel = <18>; + bus-width = <18>; + status = "okay"; + + display-timings { + native-mode = <&timing_vga>; + timing_vga: 640x480 { + clock-frequency = <25175000>; + hactive = <640>; + vactive = <480>; + hback-porch = <40>; + hfront-porch = <24>; + vback-porch = <32>; + vfront-porch = <11>; + hsync-len = <96>; + vsync-len = <2>; + + de-active = <1>; + hsync-active = <0>; + vsync-active = <0>; + pixelclk-active = <0>; + }; + }; + }; +};
arch/arm/dts/imx7-colibri.dtsi +32 -33
74 lines not on this page · raw message
board/toradex/colibri_imx7/MAINTAINERS +1 -0
@@ -9,5 +9,6 @@ F: include/configs/colibri_imx7.h F: configs/colibri_imx7_defconfig F: configs/colibri_imx7_emmc_defconfig F: arch/arm/dts/imx7-colibri.dtsi +F: arch/arm/dts/imx7-colibri-u-boot.dtsi F: arch/arm/dts/imx7-colibri-emmc.dts F: arch/arm/dts/imx7-colibri-rawnand.dts
Signature · 1 line
2.17.1
PATCH v2 12/14 colibri-imx6ull: show boot logo
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
1. Show boot logo embed in U-Boot blob.
2. Drop iomux configration for LCD, and use the one provided in device tree.
---
(no changes since v1)
.../toradex/colibri-imx6ull/colibri-imx6ull.c | 40 ++++--------------- 1 file changed, 7 insertions(+), 33 deletions(-)
board/toradex/colibri-imx6ull/colibri-imx6ull.c +7 -33
@@ -57,32 +57,7 @@ static void setup_gpmi_nand(void) }#endif /* CONFIG_NAND_MXS */ -#ifdef CONFIG_VIDEO_MXS -static iomux_v3_cfg_t const lcd_pads[] = { -MX6_PAD_LCD_CLK__LCDIF_CLK |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_ENABLE__LCDIF_ENABLE |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_HSYNC__LCDIF_HSYNC |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_CLK__LCDIF_CLK |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA00__LCDIF_DATA00 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA01__LCDIF_DATA01 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA02__LCDIF_DATA02 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA03__LCDIF_DATA03 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA04__LCDIF_DATA04 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA05__LCDIF_DATA05 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA06__LCDIF_DATA06 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA07__LCDIF_DATA07 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA08__LCDIF_DATA08 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA09__LCDIF_DATA09 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA10__LCDIF_DATA10 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA11__LCDIF_DATA11 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA12__LCDIF_DATA12 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA13__LCDIF_DATA13 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA14__LCDIF_DATA14 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA15__LCDIF_DATA15 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA16__LCDIF_DATA16 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX6_PAD_LCD_DATA17__LCDIF_DATA17 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -}; - +#ifdef CONFIG_DM_VIDEO static iomux_v3_cfg_t const backlight_pads[] = {/* Backlight On */ MX6_PAD_JTAG_TMS__GPIO1_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
@@ -95,8 +70,6 @@ static iomux_v3_cfg_t const backlight_pads[] = {static int setup_lcd (void ) { -imx_iomux_v3_setup_multiple_pads (lcd_pads,ARRAY_SIZE (lcd_pads)); -imx_iomux_v3_setup_multiple_pads (backlight_pads,ARRAY_SIZE (backlight_pads));/* Set BL_ON */
@@ -153,11 +126,6 @@ int board_init(void)#ifdef CONFIG_NAND_MXS setup_gpmi_nand ();#endif - -#ifdef CONFIG_VIDEO_MXS -setup_lcd (); -#endif -return 0 ; }
@@ -203,6 +171,12 @@ int board_late_init(void) }#endif /* CONFIG_CMD_USB_SDP */ +#if defined(CONFIG_DM_VIDEO ) +setup_lcd (); + +show_boot_logo (); +#endif +return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 13/14 colibri-imx6ull: fix splash screen logo drawing
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Configure white on black for video console.
---
(no changes since v1)
configs/colibri-imx6ull_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/colibri-imx6ull_defconfig +1 -0
@@ -91,3 +91,4 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_DM_VIDEO=y CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_FDT_FIXUP_PARTITIONS=y +CONFIG_SYS_WHITE_ON_BLACK=y
Signature · 1 line
2.17.1
PATCH v2 14/14 colibri-imx7: fix splash logo drawing
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
1. Configure white on black for video console.
2. Enable printing bmp logo during late board init stage.
3. Use iomux configuration from device tree.
---
(no changes since v1)
board/toradex/colibri_imx7/colibri_imx7.c | 44 +++++++---------------- configs/colibri_imx7_defconfig | 2 ++ configs/colibri_imx7_emmc_defconfig | 2 ++ 3 files changed, 16 insertions(+), 32 deletions(-)
board/toradex/colibri_imx7/colibri_imx7.c +12 -32
@@ -100,32 +100,7 @@ static void setup_gpmi_nand(void) }#endif -#ifdef CONFIG_VIDEO_MXS -static iomux_v3_cfg_t const lcd_pads[] = { -MX7D_PAD_LCD_CLK__LCD_CLK |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_ENABLE__LCD_ENABLE |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_HSYNC__LCD_HSYNC |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_VSYNC__LCD_VSYNC |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA00__LCD_DATA0 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA01__LCD_DATA1 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA02__LCD_DATA2 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA03__LCD_DATA3 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA04__LCD_DATA4 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA05__LCD_DATA5 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA06__LCD_DATA6 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA07__LCD_DATA7 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA08__LCD_DATA8 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA09__LCD_DATA9 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA10__LCD_DATA10 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA11__LCD_DATA11 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA12__LCD_DATA12 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA13__LCD_DATA13 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA14__LCD_DATA14 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA15__LCD_DATA15 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA16__LCD_DATA16 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA17__LCD_DATA17 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -}; - +#ifdef CONFIG_DM_VIDEO static iomux_v3_cfg_t const backlight_pads[] = {/* Backlight On */ MX7D_PAD_SD1_WP__GPIO5_IO1 | MUX_PAD_CTRL(NO_PAD_CTRL),
@@ -139,8 +114,6 @@ static iomux_v3_cfg_t const backlight_pads[] = {static int setup_lcd (void ) { -imx_iomux_v3_setup_multiple_pads (lcd_pads,ARRAY_SIZE (lcd_pads)); -imx_iomux_v3_setup_multiple_pads (backlight_pads,ARRAY_SIZE (backlight_pads));/* Set BL_ON */
@@ -215,10 +188,6 @@ int board_init(void)setup_gpmi_nand ();#endif -#ifdef CONFIG_VIDEO_MXS -setup_lcd (); -#endif -#ifdef CONFIG_USB_EHCI_MX7 imx_iomux_v3_setup_multiple_pads (usb_cdet_pads,ARRAY_SIZE (usb_cdet_pads));gpio_request (USB_CDET_GPIO ,"usb-cdet-gpio" );
@@ -382,4 +351,15 @@ int board_usb_phy_mode(int port) return USB_INIT_HOST; } } + +int board_late_init (void ) +{ +#if defined(CONFIG_DM_VIDEO ) +setup_lcd (); + +show_boot_logo (); +#endif +return 0 ; +} +#endif
configs/colibri_imx7_defconfig +2 -0
@@ -89,3 +89,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_DM_VIDEO=y CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_FDT_FIXUP_PARTITIONS=y +CONFIG_BOARD_LATE_INIT=y +CONFIG_SYS_WHITE_ON_BLACK=y
configs/colibri_imx7_emmc_defconfig +2 -0
@@ -84,3 +84,5 @@ CONFIG_CI_UDC=y CONFIG_DM_VIDEO=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_BOARD_LATE_INIT=y +CONFIG_SYS_WHITE_ON_BLACK=y
Signature · 1 line
2.17.1
v2 cover toradex: imx: fixes and updates for v2020.10
In reply to Igor OpaniukHi Stefano,
Quoted 64 lines · Igor Opaniuk
This is the common combined patch-series, which superseeds [1], [2], [3].
Includes:
1. Fixes for splash screen logo drawing in Colibri iMX7/iMX6ULL.
2. Support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters).
3. DDRC size fixes in A7-M4 mapping table for bootaux command.v2:
- ?ombine [1], [2], [3] into one patch-series.
- Correct strings for carrier board names/adapters.
- Fix display timings, sync with downstream Toradex Linux.[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=185024
[2]: https://patchwork.ozlabs.org/project/uboot/list/?series=185100
[3]: https://patchwork.ozlabs.org/project/uboot/list/?series=185354Igor Opaniuk (14):
imx: mx7: fix DDRC size in A7-M4 mapping table
toradex: tdx-cfg-block: add EEPROM read/store wrappers
toradex: tdx-cfg-block: add carrier boards and display adapters
toradex: tdx-cfg-block: add support for EEPROM
toradex: tdx-cfg-clock: add migration routine from PID8
toradex: tdx-cfg-block: add carrier board info printing
ARM: dts: imx8mm-verdin: eeprom nodes adjustments
verdin-imx8mm: add EEPROM support for carrier board
ARM: dts: imx6ull-colibri: move u-boot specific node
toradex: common: show boot logo
ARM: dts: imx7-colibri: multiple node updates
colibri-imx6ull: show boot logo
colibri-imx6ull: fix splash screen logo drawing
colibri-imx7: fix splash logo drawingarch/arm/dts/imx6ull-colibri-u-boot.dtsi | 45 ++ arch/arm/dts/imx6ull-colibri.dtsi | 43 -- arch/arm/dts/imx7-colibri-emmc.dts | 2 +- arch/arm/dts/imx7-colibri-rawnand.dts | 10 +- arch/arm/dts/imx7-colibri-u-boot.dtsi | 39 ++ arch/arm/dts/imx7-colibri.dtsi | 65 ++- arch/arm/dts/imx8mm-verdin.dts | 22 +- arch/arm/mach-imx/mx7/soc.c | 2 +- .../toradex/colibri-imx6ull/colibri-imx6ull.c | 40 +- board/toradex/colibri_imx7/MAINTAINERS | 1 + board/toradex/colibri_imx7/colibri_imx7.c | 44 +- board/toradex/common/Kconfig | 18 + board/toradex/common/Makefile | 1 + board/toradex/common/tdx-cfg-block.c | 402 ++++++++++++++++-- board/toradex/common/tdx-cfg-block.h | 16 + board/toradex/common/tdx-common.c | 54 +++ board/toradex/common/tdx-common.h | 4 + board/toradex/common/tdx-eeprom.c | 90 ++++ board/toradex/common/tdx-eeprom.h | 14 + board/toradex/verdin-imx8mm/Kconfig | 6 + configs/colibri-imx6ull_defconfig | 1 + configs/colibri_imx7_defconfig | 2 + configs/colibri_imx7_emmc_defconfig | 2 + configs/verdin-imx8mm_defconfig | 1 + 24 files changed, 730 insertions(+), 194 deletions(-) create mode 100644 arch/arm/dts/imx7-colibri-u-boot.dtsi create mode 100644 board/toradex/common/tdx-eeprom.c create mode 100644 board/toradex/common/tdx-eeprom.h
Quoted 3 lines
--
2.17.1
Any chance to get it merged?
Thanks
--
Best regards - Freundliche Gr?sse - Meilleures salutations
Igor Opaniuk
mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
v2 cover toradex: imx: fixes and updates for v2020.10
Hi Igor,
Quoted 67 lines · Igor Opaniuk
Hi Stefano,
Quoted 64 lines · Igor Opaniuk
This is the common combined patch-series, which superseeds [1], [2], [3].
Includes:
1. Fixes for splash screen logo drawing in Colibri iMX7/iMX6ULL.
2. Support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters).
3. DDRC size fixes in A7-M4 mapping table for bootaux command.v2:
- ?ombine [1], [2], [3] into one patch-series.
- Correct strings for carrier board names/adapters.
- Fix display timings, sync with downstream Toradex Linux.[1]: https://patchwork.ozlabs.org/project/uboot/list/?series=185024
[2]: https://patchwork.ozlabs.org/project/uboot/list/?series=185100
[3]: https://patchwork.ozlabs.org/project/uboot/list/?series=185354Igor Opaniuk (14):
imx: mx7: fix DDRC size in A7-M4 mapping table
toradex: tdx-cfg-block: add EEPROM read/store wrappers
toradex: tdx-cfg-block: add carrier boards and display adapters
toradex: tdx-cfg-block: add support for EEPROM
toradex: tdx-cfg-clock: add migration routine from PID8
toradex: tdx-cfg-block: add carrier board info printing
ARM: dts: imx8mm-verdin: eeprom nodes adjustments
verdin-imx8mm: add EEPROM support for carrier board
ARM: dts: imx6ull-colibri: move u-boot specific node
toradex: common: show boot logo
ARM: dts: imx7-colibri: multiple node updates
colibri-imx6ull: show boot logo
colibri-imx6ull: fix splash screen logo drawing
colibri-imx7: fix splash logo drawingarch/arm/dts/imx6ull-colibri-u-boot.dtsi | 45 ++ arch/arm/dts/imx6ull-colibri.dtsi | 43 -- arch/arm/dts/imx7-colibri-emmc.dts | 2 +- arch/arm/dts/imx7-colibri-rawnand.dts | 10 +- arch/arm/dts/imx7-colibri-u-boot.dtsi | 39 ++ arch/arm/dts/imx7-colibri.dtsi | 65 ++- arch/arm/dts/imx8mm-verdin.dts | 22 +- arch/arm/mach-imx/mx7/soc.c | 2 +- .../toradex/colibri-imx6ull/colibri-imx6ull.c | 40 +- board/toradex/colibri_imx7/MAINTAINERS | 1 + board/toradex/colibri_imx7/colibri_imx7.c | 44 +- board/toradex/common/Kconfig | 18 + board/toradex/common/Makefile | 1 + board/toradex/common/tdx-cfg-block.c | 402 ++++++++++++++++-- board/toradex/common/tdx-cfg-block.h | 16 + board/toradex/common/tdx-common.c | 54 +++ board/toradex/common/tdx-common.h | 4 + board/toradex/common/tdx-eeprom.c | 90 ++++ board/toradex/common/tdx-eeprom.h | 14 + board/toradex/verdin-imx8mm/Kconfig | 6 + configs/colibri-imx6ull_defconfig | 1 + configs/colibri_imx7_defconfig | 2 + configs/colibri_imx7_emmc_defconfig | 2 + configs/verdin-imx8mm_defconfig | 1 + 24 files changed, 730 insertions(+), 194 deletions(-) create mode 100644 arch/arm/dts/imx7-colibri-u-boot.dtsi create mode 100644 board/toradex/common/tdx-eeprom.c create mode 100644 board/toradex/common/tdx-eeprom.h
Quoted 6 lines
Quoted 3 lines
--
2.17.1Any chance to get it merged?
Yes, sorry, I saw patches, most of patches (see EEprom, etc) are very specific to Toradex, and I cannot say a lot. I do not see any isse and I will merge them. They will be part of my next PR to Tom.
Regards,
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 2/14 toradex: tdx-cfg-block: add EEPROM read/store wrappers
In reply to Igor OpaniukHi Igor,
Quoted 7 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
These functions wrap functionality for storing config blocks in EEPROM.
Signed-off-by Igor Opaniuk <[email protected]>---
This breaks one of your (obsolete ?) board, colibri_pxa270
Reason is a side-effect in dm/read.h:
arm: + colibri_pxa270
+In file included from include/dm.h:12,
+ from board/toradex/common/tdx-eeprom.c:6:+include/dm/read.h: In function 'dev_read_alias_seq':+include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use in this function)
+ 932 | return -ENOTSUPP;
+ | ^~~~~~~~+include/dm/read.h:932:10: note: each undeclared identifier is reported only once for each function it appears in
+make[2]: *** [scripts/Makefile.build:266:board/toradex/common/tdx-eeprom.o] Error 1
+make[1]: *** [Makefile:1793: board/toradex/common] Error 2 +make: *** [Makefile:167: sub-make] Error 2
Adding the include to dm/read.h, issue is solved:
include/dm/read.h +1 -0
@@ -12,6 +12,7 @@#include <dm/fdtaddr.h> #include <dm/ofnode.h> #include <dm/uclass.h> +#include <linux/errno.h> struct resource ;
I could add it myself if there is a general agreement, but the usual way is to repost it.
Best regards,
Stefano
Quoted 136 lines
(no changes since v1)
board/toradex/common/Makefile | 1 + board/toradex/common/tdx-eeprom.c | 90 +++++++++++++++++++++++++++++++ board/toradex/common/tdx-eeprom.h | 14 +++++ 3 files changed, 105 insertions(+) create mode 100644 board/toradex/common/tdx-eeprom.c create mode 100644 board/toradex/common/tdx-eeprom.hboard/toradex/common/Makefile +1
-0@@ -8,4 +8,5 @@ obj- := __dummy__.o else obj-$(CONFIG_TDX_CFG_BLOCK) += tdx-cfg-block.o obj-y += tdx-common.o +obj-y += tdx-eeprom.o endifboard/toradex/common/tdx-eeprom.c new file +90
-0@@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (c) 2020 Toradex +*/ + +#include <dm.h> +#include <i2c_eeprom.h> +#include <linux/errno.h> + +DECLARE_GLOBAL_DATA_PTR ; + +static int get_tdx_eeprom (u32 eeprom_id,struct udevice **devp) +{ +int ret =0 ; +int node; +ofnode eeprom; +char eeprom_str[16 ]; +const char *path; + +if (!gd->fdt_blob) { +printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); +return -EFAULT ; + } + + node =fdt_path_offset (gd->fdt_blob,"/aliases" ); +if (node <0 ) +return -ENODEV ; + +sprintf (eeprom_str,"eeprom%d" , eeprom_id); + + path =fdt_getprop (gd->fdt_blob, node, eeprom_str,NULL ); +if (!path) { +printf ("%s: no alias for %s\n" , __func__, eeprom_str); +return -ENODEV ; + } + + eeprom =ofnode_path (path); +if (!ofnode_valid (eeprom)) { +printf ("%s: invalid hardware path to EEPROM\n" , __func__); +return -ENODEV ; + } + + ret =uclass_get_device_by_ofnode (UCLASS_I2C_EEPROM , eeprom, devp); +if (ret) { +printf ("%s: cannot find EEPROM by node\n" , __func__); +return ret; + } + +return ret; +} + +int read_tdx_eeprom_data (u32 eeprom_id,int offset,u8 *buf, +int size) +{ +struct udevice *dev; +int ret; + + ret =get_tdx_eeprom (eeprom_id, &dev); +if (ret) +return ret; + + ret =i2c_eeprom_read (dev,0x0 , buf, size); +if (ret) { +printf ("%s: error reading data from EEPROM id: %d!, ret = %d\n" , + __func__, eeprom_id, ret); +return ret; + } + +return ret; +} + +int write_tdx_eeprom_data (u32 eeprom_id,int offset,u8 *buf, +int size) +{ +struct udevice *dev; +int ret; + + ret =get_tdx_eeprom (eeprom_id, &dev); +if (ret) +return ret; + + ret =i2c_eeprom_write (dev,0x0 , buf, size); +if (ret) { +printf ("%s: error writing data to EEPROM id: %d, ret = %d\n" , + __func__, eeprom_id, ret); +return ret; + } + +return ret; +}board/toradex/common/tdx-eeprom.h new file +14
-0@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2020 Toradex +*/ + +#ifndef _TDX_EEPROM_H +#define _TDX_EEPROM_H + +#include <i2c_eeprom.h> + +int read_tdx_eeprom_data (u32 eeprom_id,int offset,uint8_t *buf,int size); +int write_tdx_eeprom_data (u32 eeprom_id,int offset,uint8_t *buf,int size); + +#endif /* _TDX_EEPROM_H */
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 2/14 toradex: tdx-cfg-block: add EEPROM read/store wrappers
Quoted 46 lines · Stefano Babic
Hi Igor,
Quoted 7 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
These functions wrap functionality for storing config blocks in EEPROM.
Signed-off-by Igor Opaniuk <[email protected]>---
This breaks one of your (obsolete ?) board,
colibri_pxa270Reason is a side-effect in
dm/read.h:arm: +
colibri_pxa270(quoted diff) +4
-0+In file included from include/dm.h:12, + from board/toradex/common/tdx-eeprom.c:6: +include/dm/read.h: In function 'dev_read_alias_seq': +include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use inthis function)
(quoted diff) +3
-0+ 932 | return -ENOTSUPP; + | ^~~~~~~~ +include/dm/read.h:932:10: note: each undeclared identifier is reportedonly once for each function it appears in
+make[2]: *** [scripts/Makefile.build:266:board/toradex/common/tdx-eeprom.o] Error 1(quoted diff) +2
-0+make[1]: *** [Makefile:1793: board/toradex/common] Error 2 +make: *** [Makefile:167: sub-make] Error 2Adding the include to
dm/read.h, issue is solved:include/dm/read.h +1
-0@@ -12,6 +12,7 @@#include <dm/fdtaddr.h> #include <dm/ofnode.h> #include <dm/uclass.h> +#include <linux/errno.h> struct resource ;
Quoted 2 lines
I could add it myself if there is a general agreement, but the usual way is to repost it.
This is also fixed by:
http://patchwork.ozlabs.org/project/uboot/patch/20200723120138.10625-1-dmurphy at ti.com/ as Dan also ran in to this problem. I assigned it to Simon but if you
want to take it as part of being able to pick up Igor's series now I'm
sure that's fine. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200727/87fd0506/attachment.sig>
PATCH v2 2/14 toradex: tdx-cfg-block: add EEPROM read/store wrappers
Quoted 47 lines · Tom Rini
Quoted 46 lines · Stefano Babic
Hi Igor,
Quoted 7 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
These functions wrap functionality for storing config blocks in EEPROM.
Signed-off-by Igor Opaniuk <[email protected]>---
This breaks one of your (obsolete ?) board,
colibri_pxa270Reason is a side-effect in
dm/read.h:arm: +
colibri_pxa270(quoted diff) +4
-0+In file included from include/dm.h:12, + from board/toradex/common/tdx-eeprom.c:6: +include/dm/read.h: In function 'dev_read_alias_seq': +include/dm/read.h:932:10: error: 'ENOTSUPP' undeclared (first use inthis function)
(quoted diff) +3
-0+ 932 | return -ENOTSUPP; + | ^~~~~~~~ +include/dm/read.h:932:10: note: each undeclared identifier is reportedonly once for each function it appears in
+make[2]: *** [scripts/Makefile.build:266:board/toradex/common/tdx-eeprom.o] Error 1(quoted diff) +2
-0+make[1]: *** [Makefile:1793: board/toradex/common] Error 2 +make: *** [Makefile:167: sub-make] Error 2Adding the include to
dm/read.h, issue is solved:include/dm/read.h +1
-0@@ -12,6 +12,7 @@#include <dm/fdtaddr.h> #include <dm/ofnode.h> #include <dm/uclass.h> +#include <linux/errno.h> struct resource ;
Quoted 8 lines
Quoted 2 lines
I could add it myself if there is a general agreement, but the usual way is to repost it.
This is also fixed by:
http://patchwork.ozlabs.org/project/uboot/patch/20200723120138.10625-1-dmurphy at ti.com/ as Dan also ran in to this problem. I assigned it to Simon but if you
want to take it as part of being able to pick up Igor's series now I'm
sure that's fine. Thanks!
Fine, thanks ! I pick up Dan's.
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 11/14 ARM: dts: imx7-colibri: multiple node updates
In reply to Igor OpaniukQuoted 8 lines
From: Igor Opaniuk <[email protected]>
1. Move u-boot specific nodes to u-boot dts include: legacy lcdif
node and aliases.
2. Add iomux configuration for LCD.
3. Drop un-needed u-boot,dm-pre-reloc for alias node.
4. Fix display-timings, use the one from Toradex downstream kernel [1]
[1]: https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi?h=toradex_4.9-2.3.x-imx#n206Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 7/14 ARM: dts: imx8mm-verdin: eeprom nodes adjustments
In reply to Igor OpaniukQuoted 7 lines
From: Igor Opaniuk <[email protected]>
Rename EEPROM nodes.
Create aliases for EEPROM to unify their order:
eeprom0 - on-module EEPROM
eeprom1 - carrier-board EEPROM
eeprom2 - MIPI-DSI to HDMI adapter EEPROMSigned-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 10/14 toradex: common: show boot logo
In reply to Igor OpaniukQuoted 3 lines
From: Igor Opaniuk <[email protected]>
Add function for showing boot logo, embed into u-boot blob.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 12/14 colibri-imx6ull: show boot logo
In reply to Igor OpaniukQuoted 5 lines
From: Igor Opaniuk <[email protected]>
1. Show boot logo embed in U-Boot blob.
2. Drop iomux configration for LCD, and use the one provided in device tree.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 2/14 toradex: tdx-cfg-block: add EEPROM read/store wrappers
In reply to Igor OpaniukQuoted 3 lines
From: Igor Opaniuk <[email protected]>
These functions wrap functionality for storing config blocks in EEPROM.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 4/14 toradex: tdx-cfg-block: add support for EEPROM
In reply to Igor OpaniukQuoted 21 lines
From: Igor Opaniuk <[email protected]>
This introduces support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters).
To enable EEPROM as a storage for the main config block:
TDX_HAVE_EEPROM=y.
For additional EEPROMs please enable thisKconfigsymbol:
TDX_CFG_BLOCK_EXTRA=y.
Information about existing EEPROM chips is provided via Device Tree using aliases.
You can also write configuration for the carrier board usingcreate_carriersubcommand for cfgblock. Example:
Verdin iMX8MM # cfgblockcreate_carrier
Supported carrier boards:
UNKNOWN CARRIER = [0]
Verdin Carrier Board = [1]
Choose your carrier board (provide ID): 1
Enter carrier board version (e.g. V1.1B): V1.0A
Enter carrier board serial number: 10622780
Also with barcode:
Verdin iMX8MM # cfgblock create carrier -y 0156100010622780
Quoted 1 line
Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 8/14 verdin-imx8mm: add EEPROM support for carrier board
In reply to Igor OpaniukQuoted 5 lines
From: Igor Opaniuk <[email protected]>
Enable theseKconfigsymbols:
TDX_CFG_BLOCK_EXTRA=y
TDX_HAVE_EEPROM_EXTRA=ySigned-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 13/14 colibri-imx6ull: fix splash screen logo drawing
In reply to Igor OpaniukQuoted 3 lines
From: Igor Opaniuk <[email protected]>
Configure white on black for video console.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 3/14 toradex: tdx-cfg-block: add carrier boards and display adapters
In reply to Igor OpaniukQuoted 3 lines
From: Igor Opaniuk <[email protected]>
Add defines for supported carrier boards and display adapters.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 14/14 colibri-imx7: fix splash logo drawing
In reply to Igor OpaniukQuoted 5 lines
From: Igor Opaniuk <[email protected]>
1. Configure white on black for video console.
2. Enable printing bmp logo during late board init stage.
3. Use iomux configuration from device tree.Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 1/14 imx: mx7: fix DDRC size in A7-M4 mapping table
In reply to Igor OpaniukQuoted 7 lines
From: Igor Opaniuk <[email protected]> According to i.MX 7Solo Applications Processor Reference Manual, 2.1.3 Cortex-M4 Memory Map, M4 can address only 1536MB of DDRC (Start Address: 0x8000_0000; End Address: 0xDFFF_FFFF). Correct DDRC size to
0x60000000.Fixes c0f037f6("mach-imx: bootaux: elf firmware support")Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 6/14 toradex: tdx-cfg-block: add carrier board info printing
In reply to Igor OpaniukQuoted 8 lines
From: Igor Opaniuk <[email protected]>
Add carrier board info printing during boot time:
U-Boot 2020.07-rc4-02435-g1756e05 (Jun 22 2020 - 22:43:59 +0300)
CPU: Freescale i.MX8MMQ rev1.0 at 1200 MHz
....
Carrier: Toradex Verdin Development Board V1.0A, Serial# 10622780 Verdin iMX8MM #Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 5/14 toradex: tdx-cfg-clock: add migration routine from PID8
In reply to Igor OpaniukQuoted 4 lines
From: Igor Opaniuk <[email protected]>
Add migration routine from PID8 pre-stored values on EEPROM (including sane value checks).Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 9/14 ARM: dts: imx6ull-colibri: move u-boot specific node
In reply to Igor OpaniukQuoted 6 lines
From: Igor Opaniuk <[email protected]>
1. Move aliases and legacy lcdif node to the u-boot specific dts include.
2. Provide proper display timings, as in the downstream Toradex kernel
[1].
[1]: https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi?h=toradex_4.9-2.3.x-imx#n183Signed-off-by Igor Opaniuk <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================