pico-imx7d: Add support for BL33 case
Subsystems (3)
v3 cover pico-imx7d: Add support for BL33 case
Add configuration to boot U-boot as BL33 case. The boot flow is ATF -> OPTEE -> U-boot.
Changes vs V2:
- Revise fix to UART clock ID.
- Add documentation of build and test for BL33 usage case.
- Add device tree to store public key for FIT image verfication usage.
- Add revert patch to LCD support. Pico-pi does not boot with it. I see it is suggested to be reverted in maillist.
Changes vs V1:
- Remove DCD file.
- Add a patch to fix uart clock root ID.
- Change file name from pico-pi-imx7d_bl33_defconfig to pico-imx7d_bl33_defconfig
Jun Nie (9):
Revert "pico-imx7d: Add LCD support"
mx7_common: Share configs to skip low level init
imx: mx7: Add empty arch_cpu_init if skipped
pico-imx7d: Correct uart clock root
pico-imx7d: Reserve region of memory to OPTEE
pico-imx7d: Add boot option for verified boot
pico-imx7d: Add device tree for pico-imx7d
pico-imx7d: Add bl33 config
pico-imx7d: README: Add BL33 usage case
arch/arm/dts/Makefile | 1 +
arch/arm/dts/imx7d-pico-pi.dts | 93 ++++
arch/arm/dts/imx7d-pico.dtsi | 585 +++++++++++++++++++++
arch/arm/include/asm/arch-mx7/clock.h | 18 +
arch/arm/mach-imx/Kconfig | 7 +
arch/arm/mach-imx/mx7/clock.c | 2 +-
arch/arm/mach-imx/mx7/soc.c | 5 +
board/technexion/pico-imx7d/README.pico-imx7d_BL33 | 44 ++
board/technexion/pico-imx7d/pico-imx7d.c | 60 +--
configs/pico-hobbit-imx7d_defconfig | 1 -
...i-imx7d_defconfig => pico-imx7d_bl33_defconfig} | 40 +-
configs/pico-imx7d_defconfig | 1 -
configs/pico-pi-imx7d_defconfig | 1 -
include/configs/mx7_common.h | 11 +
include/configs/pico-imx7d.h | 50 +-
include/configs/warp7.h | 11 -
16 files changed, 826 insertions(+), 104 deletions(-)
create mode 100644 arch/arm/dts/imx7d-pico-pi.dts
create mode 100644 arch/arm/dts/imx7d-pico.dtsi
create mode 100644 board/technexion/pico-imx7d/README.pico-imx7d_BL33
copy configs/{pico-pi-imx7d_defconfig => pico-imx7d_bl33_defconfig} (65%)Signature · 1 line
2.7.4
PATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
This reverts commit 9e3c0174da842dd88f5feaffbf843ba332233897.
--- board/technexion/pico-imx7d/pico-imx7d.c | 55 -------------------------------- configs/pico-hobbit-imx7d_defconfig | 1 - configs/pico-imx7d_defconfig | 1 - configs/pico-pi-imx7d_defconfig | 1 - include/configs/pico-imx7d.h | 12 ------- 5 files changed, 70 deletions(-)
board/technexion/pico-imx7d/pico-imx7d.c +0 -55
@@ -39,16 +39,8 @@ DECLARE_GLOBAL_DATA_PTR;#define I2C_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM) - -#define LCD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_PU100KOHM | \ - PAD_CTL_DSE_3P3V_49OHM) - -#define LCD_SYNC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_PU100KOHM | \ - PAD_CTL_DSE_3P3V_196OHM) - #ifdef CONFIG_SYS_I2C_MXC #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) - /* I2C4 for PMIC */ static struct i2c_pads_info i2c_pad_info4 = { .scl = {
@@ -254,58 +246,11 @@ int board_early_init_f(void)return 0 ; } -#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_SYNC_PAD_CTRL ), -MX7D_PAD_LCD_HSYNC__LCD_HSYNC |MUX_PAD_CTRL (LCD_SYNC_PAD_CTRL ), -MX7D_PAD_LCD_VSYNC__LCD_VSYNC |MUX_PAD_CTRL (LCD_SYNC_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 ), -MX7D_PAD_LCD_DATA18__LCD_DATA18 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA19__LCD_DATA19 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA20__LCD_DATA20 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA21__LCD_DATA21 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA22__LCD_DATA22 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA23__LCD_DATA23 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_GPIO1_IO06__GPIO1_IO6 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_GPIO1_IO11__GPIO1_IO11 |MUX_PAD_CTRL (NO_PAD_CTRL ), -}; - -void setup_lcd (void ) -{ -imx_iomux_v3_setup_multiple_pads (lcd_pads,ARRAY_SIZE (lcd_pads)); -/* Set Brightness to high */ -gpio_direction_output (IMX_GPIO_NR (1 ,11 ) ,1 ); -/* Set LCD enable to high */ -gpio_direction_output (IMX_GPIO_NR (1 ,6 ) ,1 ); -} -#endif -int board_init (void ) {/* address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; -#ifdef CONFIG_VIDEO_MXS -setup_lcd (); -#endif #ifdef CONFIG_FEC_MXC setup_fec ();#endif
configs/pico-hobbit-imx7d_defconfig +0 -1
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=y
configs/pico-imx7d_defconfig +0 -1
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=y
configs/pico-pi-imx7d_defconfig +0 -1
@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=y
include/configs/pico-imx7d.h +0 -12
@@ -64,12 +64,10 @@#define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "image=zImage\0" \ - "splashpos=m,m\0" \ "console=ttymxc4\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ - "videomode=video=ctfb:x:800,y:480,depth:24,mode:0,pclk:30000,le:46,ri:210,up:22,lo:23,hs:20,vs:10,sync:0,vmode:0\0" \ BOOTMENU_ENV \ "fdt_addr=0x83000000\0" \ "fdt_addr_r=0x83000000\0" \
@@ -133,16 +131,6 @@#define CONFIG_POWER_PFUZE3000 #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08 -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS -#define CONFIG_VIDEO_LOGO -#define CONFIG_SPLASH_SCREEN -#define CONFIG_SPLASH_SCREEN_ALIGN -#define CONFIG_BMP_16BPP -#define CONFIG_VIDEO_BMP_RLE8 -#define CONFIG_VIDEO_BMP_LOGO -#endif -/* FLASH and environment organization */ #define CONFIG_ENV_SIZE SZ_8K
Signature · 1 line
2.7.4
Fabio Estevam
reviewerPATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
Quoted 2 lines · Jun Nie
This reverts commit
9e3c0174da842dd88f5feaffbf843ba332233897.
Why are you reverting it?
PATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
Quoted 6 lines · Fabio Estevam <[email protected]> 于2019年4月24日周三 下午6:30写道:
Quoted 2 lines · Jun Nie
This reverts commit
9e3c0174da842dd88f5feaffbf843ba332233897.Why are you reverting it?
It blocks boot up with default defconfig. I see it is suggested to be reverted in mailist weeks ago. I thought you guys knew about it.
Fabio Estevam
reviewerPATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
Hi Jun,
Quoted 2 lines · Jun Nie
It blocks boot up with default defconfig. I see it is suggested to be reverted in mailist weeks ago. I thought you guys knew about it.
Please keep in mind that the rationale of a patch must always be provided.
In this case the issue is related to the limit of the current that the host PC USB port can provide.
Please see the following commit for detaisl:
commit 00102ae52055e294ac37ae1380f37620f4a8bb26
Author: Fabio Estevam <[email protected]> Date: Wed Mar 27 20:03:39 2019 -0300
pico-imx7d: README: Recommend the usage of a USB hub
Since commit 9e3c0174da842 ("pico-imx7d: Add LCD support") we started to notice some hangs in U-Boot.
There is not an issue on such commit per se, but due to the LCD support the current drawn is increased and this may cause issues when powering pico-imx7d-pi from USB.
Some computers may be a bit strict with USB current draw and will shut down their ports if the draw is too high.
The solution for that is to use an externally powered USB hub between the board and the host computer.
Add such recommendation to the README file.
PATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
Quoted 5 lines · Fabio Estevam <[email protected]> 于2019年4月25日周四 上午11:28写道:
Hi Jun,
On Wed, Apr 24, 2019 at 11:53 PM Jun Nie <[email protected]> wrote:
Quoted 7 lines
Quoted 2 lines
It blocks boot up with default defconfig. I see it is suggested to be reverted in mailist weeks ago. I thought you guys knew about it.
Please keep in mind that the rationale of a patch must always be provided.
In this case the issue is related to the limit of the current that the host PC USB port can provide.
Thank you very much for this info! I did not noticed this patch yet. So power supply should be changed or disable LCD as a workaround locally.
Jun
Quoted 25 lines
Please see the following commit for detaisl:
commit
00102ae52055e294ac37ae1380f37620f4a8bb26Author: Fabio Estevam <[email protected]> Date: Wed Mar 27 20:03:39 2019 -0300pico-imx7d: README: Recommend the usage of a USB hub
Since commit
9e3c0174da842("pico-imx7d: Add LCD support") we started to notice some hangs in U-Boot.There is not an issue on such commit per se, but due to the LCD support the current drawn is increased and this may cause issues when powering pico-imx7d-pi from USB.
Some computers may be a bit strict with USB current draw and will shut down their ports if the draw is too high.
The solution for that is to use an externally powered USB hub between the board and the host computer.
Add such recommendation to the README file.
Signed-off-by Fabio Estevam <[email protected]>
PATCH v3 1/9 Revert "pico-imx7d: Add LCD support"
In reply to Jun NieQuoted 2 lines · Jun Nie
This reverts commit
9e3c0174da842dd88f5feaffbf843ba332233897.
---
This drops a feature developped from someone else without any clarification. I won't apply this.
Regards,
Stefano Babic
Quoted 152 lines
board/technexion/pico-imx7d/pico-imx7d.c | 55 -------------------------------- configs/pico-hobbit-imx7d_defconfig | 1 - configs/pico-imx7d_defconfig | 1 - configs/pico-pi-imx7d_defconfig | 1 - include/configs/pico-imx7d.h | 12 ------- 5 files changed, 70 deletions(-)board/technexion/pico-imx7d/pico-imx7d.c +0
-55@@ -39,16 +39,8 @@ DECLARE_GLOBAL_DATA_PTR;#define I2C_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM) - -#define LCD_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_PU100KOHM | \ - PAD_CTL_DSE_3P3V_49OHM) - -#define LCD_SYNC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_PU100KOHM | \ - PAD_CTL_DSE_3P3V_196OHM) - #ifdef CONFIG_SYS_I2C_MXC #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) - /* I2C4 for PMIC */ static struct i2c_pads_info i2c_pad_info4 = { .scl = {@@ -254,58 +246,11 @@ int board_early_init_f(void)return 0 ; } -#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_SYNC_PAD_CTRL ), -MX7D_PAD_LCD_HSYNC__LCD_HSYNC |MUX_PAD_CTRL (LCD_SYNC_PAD_CTRL ), -MX7D_PAD_LCD_VSYNC__LCD_VSYNC |MUX_PAD_CTRL (LCD_SYNC_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 ), -MX7D_PAD_LCD_DATA18__LCD_DATA18 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA19__LCD_DATA19 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA20__LCD_DATA20 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA21__LCD_DATA21 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA22__LCD_DATA22 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_LCD_DATA23__LCD_DATA23 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_GPIO1_IO06__GPIO1_IO6 |MUX_PAD_CTRL (LCD_PAD_CTRL ), -MX7D_PAD_GPIO1_IO11__GPIO1_IO11 |MUX_PAD_CTRL (NO_PAD_CTRL ), -}; - -void setup_lcd (void ) -{ -imx_iomux_v3_setup_multiple_pads (lcd_pads,ARRAY_SIZE (lcd_pads)); -/* Set Brightness to high */ -gpio_direction_output (IMX_GPIO_NR (1 ,11 ) ,1 ); -/* Set LCD enable to high */ -gpio_direction_output (IMX_GPIO_NR (1 ,6 ) ,1 ); -} -#endif -int board_init (void ) {/* address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; -#ifdef CONFIG_VIDEO_MXS -setup_lcd (); -#endif #ifdef CONFIG_FEC_MXC setup_fec ();#endif configs/pico-hobbit-imx7d_defconfig +0
-1@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=yconfigs/pico-imx7d_defconfig +0
-1@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=yconfigs/pico-pi-imx7d_defconfig +0
-1@@ -57,5 +57,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y -CONFIG_VIDEO=y CONFIG_OF_LIBFDT=yinclude/configs/pico-imx7d.h +0
-12@@ -64,12 +64,10 @@#define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "image=zImage\0" \ - "splashpos=m,m\0" \ "console=ttymxc4\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ - "videomode=video=ctfb:x:800,y:480,depth:24,mode:0,pclk:30000,le:46,ri:210,up:22,lo:23,hs:20,vs:10,sync:0,vmode:0\0" \ BOOTMENU_ENV \ "fdt_addr=0x83000000\0" \ "fdt_addr_r=0x83000000\0" \@@ -133,16 +131,6 @@#define CONFIG_POWER_PFUZE3000 #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08 -#ifdef CONFIG_VIDEO -#define CONFIG_VIDEO_MXS -#define CONFIG_VIDEO_LOGO -#define CONFIG_SPLASH_SCREEN -#define CONFIG_SPLASH_SCREEN_ALIGN -#define CONFIG_BMP_16BPP -#define CONFIG_VIDEO_BMP_RLE8 -#define CONFIG_VIDEO_BMP_LOGO -#endif -/* FLASH and environment organization */ #define CONFIG_ENV_SIZE SZ_8K
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 v3 2/9 mx7_common: Share configs to skip low level init
In reply to Jun NieShare configs in mx7 to skip low level init if we are in the case where OPTEE is loaded already (maybe by ARM Trusted Firmware) and that most of the low level initialization is already done and that we may/should skip it doing them here.
Fix the definition detection with size detection to decide whether to skip it.
--- include/configs/mx7_common.h | 11 +++++++++++ include/configs/warp7.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-)
include/configs/mx7_common.h +11 -0
@@ -54,4 +54,15 @@#endif #endif +/* +* If we have defined the OPTEE ram size and not OPTEE it means that we were +* launched by OPTEE, because of that we shall skip all the low level +* initialization since it was already done by ATF or OPTEE +*/ +#if (CONFIG_OPTEE_TZDRAM_SIZE !=0 ) +#ifndef CONFIG_OPTEE +#define CONFIG_SKIP_LOWLEVEL_INIT +#endif +#endif +#endif
include/configs/warp7.h +0 -11
@@ -13,17 +13,6 @@#define PHYS_SDRAM_SIZE SZ_512M -/* -* If we have defined the OPTEE ram size and not OPTEE it means that we were -* launched by OPTEE, because of that we shall skip all the low level -* initialization since it was already done by ATF or OPTEE -*/ -#ifdef CONFIG_OPTEE_TZDRAM_SIZE -#ifndef CONFIG_OPTEE -#define CONFIG_SKIP_LOWLEVEL_INIT -#endif -#endif -#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR/* Size of malloc() pool */
Signature · 1 line
2.7.4
PATCH v3 3/9 imx: mx7: Add empty arch_cpu_init if skipped
In reply to Jun NieAdd empty arch_cpu_init if low level init is skipped. So that it does not break spl compile though spl is not needed in the skipped case actually.
--- arch/arm/mach-imx/mx7/soc.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/mach-imx/mx7/soc.c +5 -0
@@ -286,6 +286,11 @@ int arch_cpu_init(void) return 0; } +#else +int arch_cpu_init (void ) +{ +return 0 ; +}#endif #ifdef CONFIG_ARCH_MISC_INIT
Signature · 1 line
2.7.4
PATCH v3 3/9 imx: mx7: Add empty arch_cpu_init if skipped
Hi Jun
Quoted 15 lines
Subject: [PATCH v3 3/9] imx: mx7: Add empty
arch_cpu_initif skippedAdd empty
arch_cpu_initif low level init is skipped. So that it does not break spl compile though spl is not needed in the skipped case actually.Signed-off-by Jun Nie <[email protected]>--- arch/arm/mach-imx/mx7/soc.c | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/mach-imx/mx7/soc.c +0
-0
arch/arm/mach-imx/mx7/soc.c int arch_cpu_init(void) · line 294
Quoted 9 lines
arch/arm/mach-imx/mx7/soc.c +5
-0@@ -286,6 +286,11 @@ int arch_cpu_init(void) return 0; } +#else +int arch_cpu_init (void ) +{ +return 0 ; +}#endif
Please describe what ATF/OP-TEE initialization has done when booting into uboot.
I think SKIP_LOWLEVEL_INIT is mostly for lowlevel_init, not arch_cpu_init.
init_aips/init_csu/isolate_resources/init_snvs might be done in your ATF, I am not sure, but imx_enet_mdio_fixup, mxs_dma_init, imx_gpcv2_init, are these also done in ATF?
Regards,
Peng.
Quoted 4 lines
arch/arm/mach-imx/mx7/soc.c +0
-1#ifdef CONFIG_ARCH_MISC_INIT --2.7.4
PATCH v3 3/9 imx: mx7: Add empty arch_cpu_init if skipped
Quoted 6 lines
Please describe what ATF/OP-TEE initialization has done when booting into uboot.
I think
SKIP_LOWLEVEL_INITis mostly forlowlevel_init, notarch_cpu_init.
Quoted 6 lines
init_aips/init_csu/isolate_resources/init_snvs might be done in your ATF, I am not sure, but
imx_enet_mdio_fixup,mxs_dma_init,imx_gpcv2_init, are these also done in ATF?Regards,
Peng.
Yes, aips/csu/snvs/caam/watchdog are initialized. Other missing stuff does not introduce issue in my case so I just added back the empty function to pass build. Will add them back for safe in next version. Thanks for the reminder.
Quoted 6 lines
Quoted 5 lines
#ifdef
CONFIG_ARCH_MISC_INIT
--
2.7.4
PATCH v3 4/9 pico-imx7d: Correct uart clock root
In reply to Jun NieCorrect uart clock root ID. Incorrect ID may result the clock is gated because rate value 0 is returned in imx_get_uartclk()
--- arch/arm/include/asm/arch-mx7/clock.h | 18 ++++++++++++++++++ arch/arm/mach-imx/Kconfig | 7 +++++++ arch/arm/mach-imx/mx7/clock.c | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-mx7/clock.h +18 -0
@@ -175,6 +175,24 @@ enum clk_root_index { CLK_ROOT_MAX, }; +#if (CONFIG_IMX_CONSOLE_UART_ID ==1 ) +#define UART_CLK_ROOT UART1_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==2 ) +#define UART_CLK_ROOT UART2_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==3 ) +#define UART_CLK_ROOT UART3_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==4 ) +#define UART_CLK_ROOT UART4_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==5 ) +#define UART_CLK_ROOT UART5_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==6 ) +#define UART_CLK_ROOT UART6_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID ==7 ) +#define UART_CLK_ROOT UART7_CLK_ROOT +#else +#error "Invalid IMX UART ID for serial console is defined" +#endif +struct clk_root_setting {enum clk_root_index root;u32 setting;
arch/arm/mach-imx/Kconfig +7 -0
@@ -27,6 +27,13 @@ config IMX_BOOTAUX help bootaux [addr] to boot auxiliary core. +config IMX_CONSOLE_UART_ID + int "UART ID for console" + default 1 + depends on ARCH_MX7 + help + Specify the UART ID that's for serial console. + config USE_IMXIMG_PLUGIN bool "Use imximage plugin code" depends on ARCH_MX7 || ARCH_MX6
arch/arm/mach-imx/mx7/clock.c +1 -1
@@ -53,7 +53,7 @@ static u32 get_ipg_clk(void)u32 imx_get_uartclk (void ) { -return get_root_clk (UART1_CLK_ROOT ); +return get_root_clk (UART_CLK_ROOT ); }u32 imx_get_fecclk (void )
Signature · 1 line
2.7.4
PATCH v3 4/9 pico-imx7d: Correct uart clock root
Quoted 6 lines
Subject: [PATCH v3 4/9] pico-imx7d: Correct uart clock root
Correct uart clock root ID. Incorrect ID may result the clock is gated because rate value 0 is returned in
imx_get_uartclk()
Yes. hardcoding to UART1_ROOT_CLK in imx_get_uartclk is not good. But actually init_clk_uart configures all the uart with same root clk, so it should work as expected.
Regards,
Peng.
Quoted 69 lines
Signed-off-by Jun Nie <[email protected]>--- arch/arm/include/asm/arch-mx7/clock.h | 18 ++++++++++++++++++ arch/arm/mach-imx/Kconfig | 7 +++++++ arch/arm/mach-imx/mx7/clock.c | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-)arch/arm/include/asm/arch-mx7/clock.h +6
-0@@ -175,6 +175,24 @@ enum clk_root_index { CLK_ROOT_MAX, }; +#if (CONFIG_IMX_CONSOLE_UART_ID ==1 ) +#define UART_CLK_ROOT UART1_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID == 2) #define UART_CLK_ROOT +UART2_CLK_ROOT #elif (CONFIG_IMX_CONSOLE_UART_ID == 3) #define +UART_CLK_ROOT UART3_CLK_ROOT #elif (CONFIG_IMX_CONSOLE_UART_ID == 4) +#define UART_CLK_ROOT UART4_CLK_ROOT #elif(
CONFIG_IMX_CONSOLE_UART_ID
+== 5) #defineUART_CLK_ROOTUART5_CLK_ROOT#elif +(CONFIG_IMX_CONSOLE_UART_ID == 6) #defineUART_CLK_ROOTUART6_CLK_ROOTarch/arm/include/asm/arch-mx7/clock.h +5
-0+#elif (CONFIG_IMX_CONSOLE_UART_ID == 7) #define UART_CLK_ROOT +UART7_CLK_ROOT #else #error "Invalid IMX UART ID for serial console is +defined" +#endif +struct clk_root_setting {enum clk_root_index root;u32 setting;arch/arm/mach-imx/Kconfig index renamed from arch/arm/mach-imx/Kconfig +0
-0ec09ef2..7c5db30 100644
arch/arm/mach-imx/Kconfig +7
-0@@ -27,6 +27,13 @@ config IMX_BOOTAUX help bootaux [addr] to boot auxiliary core. +config IMX_CONSOLE_UART_ID + int "UART ID for console" + default 1 + depends on ARCH_MX7 + help + Specify the UART ID that's for serial console. + config USE_IMXIMG_PLUGIN bool "Use imximage plugin code" depends on ARCH_MX7 || ARCH_MX6(quoted diff) +0
-0
b/arch/arm/mach-imx/mx7/clock.cindex 8cda71c..e364b16 100644arch/arm/mach-imx/mx7/clock.c +1
-2@@ -53,7 +53,7 @@ static u32 get_ipg_clk(void)u32 imx_get_uartclk (void ) { -return get_root_clk (UART1_CLK_ROOT ); +return get_root_clk (UART_CLK_ROOT ); }u32 imx_get_fecclk (void ) --2.7.4
PATCH v3 4/9 pico-imx7d: Correct uart clock root
Quoted 11 lines · Peng Fan <[email protected]> 于2019年4月24日周三 下午1:15写道:
Quoted 7 lines
Subject: [PATCH v3 4/9] pico-imx7d: Correct uart clock root
Correct uart clock root ID. Incorrect ID may result the clock is gated because rate value 0 is returned in
imx_get_uartclk()Yes. hardcoding to
UART1_ROOT_CLKinimx_get_uartclkis not good. But actuallyinit_clk_uartconfigures all the uart with same root clk, so it should work as expected.
Right, but init_clk_uart is not called in SKIP_LOWLEVEL_INIT case. #ifndef CONFIG_SKIP_LOWLEVEL_INITcpu_init_crit() -> lowlevel_init() -> s_init() -> clock_init() -> init_clk_uart()
#endif
Quoted 74 lines
Regards,
Peng.Quoted 69 lines
Signed-off-by Jun Nie <[email protected]>--- arch/arm/include/asm/arch-mx7/clock.h | 18 ++++++++++++++++++ arch/arm/mach-imx/Kconfig | 7 +++++++ arch/arm/mach-imx/mx7/clock.c | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-)arch/arm/include/asm/arch-mx7/clock.h +6
-0@@ -175,6 +175,24 @@ enum clk_root_index { CLK_ROOT_MAX, }; +#if (CONFIG_IMX_CONSOLE_UART_ID ==1 ) +#define UART_CLK_ROOT UART1_CLK_ROOT +#elif (CONFIG_IMX_CONSOLE_UART_ID == 2) #define UART_CLK_ROOT +UART2_CLK_ROOT #elif (CONFIG_IMX_CONSOLE_UART_ID == 3) #define +UART_CLK_ROOT UART3_CLK_ROOT #elif (CONFIG_IMX_CONSOLE_UART_ID == 4) +#define UART_CLK_ROOT UART4_CLK_ROOT #elif(
CONFIG_IMX_CONSOLE_UART_ID
+== 5) #defineUART_CLK_ROOTUART5_CLK_ROOT#elif +(CONFIG_IMX_CONSOLE_UART_ID == 6) #defineUART_CLK_ROOTUART6_CLK_ROOTarch/arm/include/asm/arch-mx7/clock.h +5
-0+#elif (CONFIG_IMX_CONSOLE_UART_ID == 7) #define UART_CLK_ROOT +UART7_CLK_ROOT #else #error "Invalid IMX UART ID for serial console is +defined" +#endif +struct clk_root_setting {enum clk_root_index root;u32 setting;arch/arm/mach-imx/Kconfig index renamed from arch/arm/mach-imx/Kconfig +0
-0ec09ef2..7c5db30 100644
arch/arm/mach-imx/Kconfig +7
-0@@ -27,6 +27,13 @@ config IMX_BOOTAUX help bootaux [addr] to boot auxiliary core. +config IMX_CONSOLE_UART_ID + int "UART ID for console" + default 1 + depends on ARCH_MX7 + help + Specify the UART ID that's for serial console. + config USE_IMXIMG_PLUGIN bool "Use imximage plugin code" depends on ARCH_MX7 || ARCH_MX6(quoted diff) +0
-0
b/arch/arm/mach-imx/mx7/clock.cindex 8cda71c..e364b16 100644arch/arm/mach-imx/mx7/clock.c +1
-2@@ -53,7 +53,7 @@ static u32 get_ipg_clk(void)u32 imx_get_uartclk (void ) { -return get_root_clk (UART1_CLK_ROOT ); +return get_root_clk (UART_CLK_ROOT ); }u32 imx_get_fecclk (void ) --2.7.4
Fabio Estevam
reviewerPATCH v3 4/9 pico-imx7d: Correct uart clock root
In reply to Jun Niearch/arm/mach-imx/Kconfig config IMX_BOOTAUX · line 35
Quoted 6 lines · Jun Nie
arch/arm/mach-imx/Kconfig +6
-0+config IMX_CONSOLE_UART_ID + int "UART ID for console" + default 1 + depends on ARCH_MX7 + help + Specify the UART ID that's for serial console.
We don't need this after DM conversion, right?
PATCH v3 4/9 pico-imx7d: Correct uart clock root
Quoted 11 lines · Fabio Estevam <[email protected]> 于2019年4月24日周三 下午6:32写道:
arch/arm/mach-imx/Kconfig config IMX_BOOTAUX · line 35
Quoted 6 lines · Jun Nie
arch/arm/mach-imx/Kconfig +6
-0+config IMX_CONSOLE_UART_ID + int "UART ID for console" + default 1 + depends on ARCH_MX7 + help + Specify the UART ID that's for serial console.We don't need this after DM conversion, right?
Supposed so.
PATCH v3 5/9 pico-imx7d: Reserve region of memory to OPTEE
In reply to Jun NieSubtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size so that the OPTEE memory is not override during u-boot relocation.
Note the OPTEE boot process will itself subtract the DRAM region it lives in from the memory map passed to Linux.
--- board/technexion/pico-imx7d/pico-imx7d.c | 5 +++++ 1 file changed, 5 insertions(+)
board/technexion/pico-imx7d/pico-imx7d.c +5 -0
@@ -60,6 +60,11 @@ int dram_init(void) { gd->ram_size =imx_ddr_size (); +/* Subtract the defined OPTEE runtime firmware length */ +#ifdef CONFIG_OPTEE_TZDRAM_SIZE + gd->ram_size -=CONFIG_OPTEE_TZDRAM_SIZE ; +#endif +return 0 ; }
Signature · 1 line
2.7.4
PATCH v3 5/9 pico-imx7d: Reserve region of memory to OPTEE
Quoted 20 lines
Subject: [PATCH v3 5/9] pico-imx7d: Reserve region of memory to OPTEE
Subtracts
CONFIG_OPTEE_TZDRAM_SIZEfrom the available DRAM size so that the OPTEE memory is not override during u-boot relocation.Note the OPTEE boot process will itself subtract the DRAM region it lives in from the memory map passed to Linux.
Signed-off-by Jun Nie <[email protected]>--- board/technexion/pico-imx7d/pico-imx7d.c | 5 +++++ 1 file changed, 5 insertions(+)board/technexion/pico-imx7d/pico-imx7d.c +0
-0
board/technexion/pico-imx7d/pico-imx7d.c int dram_init(void) · line 66
Quoted 7 lines
board/technexion/pico-imx7d/pico-imx7d.c +4
-0@@ -60,6 +60,11 @@ int dram_init(void) { gd->ram_size =imx_ddr_size (); +/* Subtract the defined OPTEE runtime firmware length */ #ifdef +CONFIG_OPTEE_TZDRAM_SIZE + gd->ram_size -=CONFIG_OPTEE_TZDRAM_SIZE ;#endif +
Better describe that OP-TEE runs at the top of DRAM. Actually the best method should be modify dram banks, because OP-TEE not always runs at top DRAM. Since this is pico board specific, so
Regards,
Peng.
Quoted 5 lines
board/technexion/pico-imx7d/pico-imx7d.c +0
-1return 0 ; } --2.7.4
PATCH v3 6/9 pico-imx7d: Add boot option for verified boot
In reply to Jun NieAdd boot option to boot from fitimage to support verified boot. The boot script plain text file should be packed into fit blob as image with name of bootscr.
--- include/configs/pico-imx7d.h | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
include/configs/pico-imx7d.h +35 -3
@@ -52,11 +52,29 @@"/boot/imx7d-pico-pi.dtb ext4 0 1;" \"rootfs part 0 1\0" \ -#define BOOTMENU_ENV \ +/* When booting with FIT specify the node entry containing boot.scr */ +#if defined(CONFIG_FIT ) +#define PICO_BOOT_ENV \ + "bootscr_fitimage_name=bootscr\0" \ + "bootscriptaddr=0x83200000\0" \ + "fdtovaddr=0x83100000\0" \ + "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ + "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ + "rootwait rw;\0" \ + "loadbootscript=" \ + "load mmc ${mmcdev}:${mmcpart} ${bootscriptaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source ${bootscriptaddr}:${bootscr_fitimage_name}\0" +#else +#define PICO_BOOT_ENV \ "bootmenu_0=Boot using PICO-Hobbit baseboard=" \ "setenv fdtfile imx7d-pico-hobbit.dtb\0" \ "bootmenu_1=Boot using PICO-Pi baseboard=" \ "setenv fdtfile imx7d-pico-pi.dtb\0" \ + BOOTENV +#endif +#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
@@ -68,7 +86,6 @@"fdt_high=0xffffffff\0" \"initrd_high=0xffffffff\0" \"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ -BOOTMENU_ENV \"fdt_addr=0x83000000\0" \"fdt_addr_r=0x83000000\0" \ "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
@@ -88,7 +105,22 @@"name=rootfs,size=0,uuid=${uuid_gpt_rootfs}\0" \"fastboot_partition_alias_system=rootfs\0" \"setup_emmc=mmc dev 0; gpt write mmc 0 $partitions; reset;\0" \ - BOOTENV + PICO_BOOT_ENV + +#if defined(CONFIG_FIT ) +#define CONFIG_BOOTCOMMAND \ + "mmc dev ${mmcdev};" \ + "mmc dev ${mmcdev}; if mmc rescan; then " \ + "if run loadbootscript; then " \ + "iminfo ${bootscriptaddr};" \ + "if test $? -eq 1; then hab_failsafe; fi;" \ + "run bootscript; " \ + "else " \ + "echo Fail to load fitImage with boot script;" \ + "hab_failsafe;" \ + "fi; " \ + "fi" +#endif #define BOOT_TARGET_DEVICES (func) \ func(MMC, mmc, 0) \
Signature · 1 line
2.7.4
PATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
In reply to Jun NieCopy device tree files from Linux directly.
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/imx7d-pico-pi.dts | 93 +++++++ arch/arm/dts/imx7d-pico.dtsi | 585 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 679 insertions(+) create mode 100644 arch/arm/dts/imx7d-pico-pi.dts create mode 100644 arch/arm/dts/imx7d-pico.dtsi
arch/arm/dts/Makefile +1 -0
@@ -555,6 +555,7 @@ dtb-$(CONFIG_ARCH_MX6) += \ dtb-$(CONFIG_MX7) += imx7d-sdb.dtb \ imx7d-sdb-qspi.dtb \ + imx7d-pico-pi.dtb \ imx7-colibri-emmc.dtb \ imx7-colibri-rawnand.dtb \ imx7s-warp.dtb
arch/arm/dts/imx7d-pico-pi.dts new file +93 -0
93 lines not on this page · raw message
arch/arm/dts/imx7d-pico.dtsi new file +585 -0
585 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
Quoted 4 lines
Subject: [PATCH v3 7/9] pico-imx7d: Add device tree for pico-imx7d
Copy device tree files from Linux directly.
Please describe which specific commit from Linux kernel upstream
Regards,
Peng.
Quoted 712 lines
Signed-off-by Jun Nie <[email protected]>--- arch/arm/dts/Makefile | 1 + arch/arm/dts/imx7d-pico-pi.dts | 93 +++++++ arch/arm/dts/imx7d-pico.dtsi | 585 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 679 insertions(+) create mode 100644 arch/arm/dts/imx7d-pico-pi.dts create mode 100644
arch/arm/dts/imx7d-pico.dtsiarch/arm/dts/Makefile index renamed from arch/arm/dts/Makefile +0
-00aee8df..e6cb1d3 100644
arch/arm/dts/Makefile +1
-0@@ -555,6 +555,7 @@ dtb-$(CONFIG_ARCH_MX6) += \ dtb-$(CONFIG_MX7) += imx7d-sdb.dtb \ imx7d-sdb-qspi.dtb \ + imx7d-pico-pi.dtb \ imx7-colibri-emmc.dtb \ imx7-colibri-rawnand.dtb \ imx7s-warp.dtbarch/arm/dts/imx7d-pico-pi.dts new file +91
-0@@ -0,0 +1,93 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) // // Copyright 2017 NXP + +#include "imx7d-pico.dtsi" + +/ { + model = "TechNexion PICO-IMX7D Board and PI baseboard"; + compatible = "technexion,imx7d-pico-pi", "fsl,imx7d"; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_leds>; + + led { + label = "gpio-led"; + gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "imx7-sgtl5000"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,cpu { + sound-dai = <&sai1>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + }; + }; +}; + +&i2c1 { + sgtl5000: codec at a { + #sound-dai-cells = <0>; + reg = <0x0a>; + compatible = "fsl,sgtl5000"; + clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>; + VDDA-supply = <®_2p5v>; + VDDIO-supply = <®_vref_1v8>; + }; +}; + +&i2c4 { + polytouch: touchscreen at 38 { + compatible = "edt,edt-ft5x06"; + reg = <0x38>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_touchscreen>; + interrupt-parent = <&gpio2>; + interrupts = <13 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + }; +}; + +&iomuxc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hog>; + + pinctrl_hog: hoggrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA00__GPIO2_IO0 0x14 + MX7D_PAD_EPDC_DATA01__GPIO2_IO1 0x14 + MX7D_PAD_EPDC_DATA02__GPIO2_IO2 0x14 + MX7D_PAD_EPDC_DATA03__GPIO2_IO3 0x14 + MX7D_PAD_EPDC_DATA05__GPIO2_IO5 0x14 + MX7D_PAD_EPDC_DATA12__GPIO2_IO12 0x14 + MX7D_PAD_EPDC_DATA07__GPIO2_IO7 0x14 + >; + }; + + pinctrl_gpio_leds: gpioledsgrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA06__GPIO2_IO6 0x14 + >; + }; + + pinctrl_touchscreen: touchscreengrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA04__GPIO2_IO4 0x14 + MX7D_PAD_EPDC_DATA13__GPIO2_IO13 0x14 + >; + }; + +};arch/arm/dts/imx7d-pico.dtsi new renamed from arch/arm/dts/imx7d-pico.dtsi +0
-0file mode 100644 index 0000000..3fd595a
arch/arm/dts/imx7d-pico.dtsi new file +382
-0@@ -0,0 +1,585 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) // // Copyright 2017 NXP + +/dts-v1/; + +#include "imx7d.dtsi" + +/ { + /* Will be filled by the bootloader */ + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0>; + }; + + reg_wlreg_on: regulator-wlreg_on { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_wlreg_on>; + regulator-name = "wlreg_on"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio4 16 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_2p5v: regulator-2p5v { + compatible = "regulator-fixed"; + regulator-name = "2P5V"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + reg_usb_otg1_vbus: regulator-usb-otg1-vbus { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1_pwr>; + compatible = "regulator-fixed"; + regulator-name = "usb_otg1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio4 5 GPIO_ACTIVE_LOW>; + }; + + reg_usb_otg2_vbus: regulator-usb-otg2-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_otg2_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + reg_vref_1v8: regulator-vref-1v8 { + compatible = "regulator-fixed"; + regulator-name = "vref-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + usdhc2_pwrseq: usdhc2_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&clks IMX7D_CLKO2_ROOT_DIV>; + clock-names = "ext_clock"; + }; +}; + +&clks { + assigned-clocks = <&clks IMX7D_CLKO2_ROOT_SRC>, + <&clks IMX7D_CLKO2_ROOT_DIV>; + assigned-clock-parents = <&clks IMX7D_CKIL>; + assigned-clock-rates = <0>, <32768>; +}; + +&ecspi3 { + cs-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ecspi3>; + status = "okay"; +}; + +&fec1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_enet1>; + assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>, + <&clks IMX7D_ENET1_TIME_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; + assigned-clock-rates = <0>, <100000000>; + phy-mode = "rgmii"; + phy-handle = <ðphy0>; + fsl,magic-packet; + phy-reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>; + status = "okay"; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy0: ethernet-phy at 1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + status = "okay"; + }; + }; +}; + +&flexcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can1>; + status = "okay"; +}; + +&flexcan2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can2>; + status = "okay"; +}; + +&i2c1 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c4>; + status = "okay"; + + pmic: pfuze3000 at 8 { + compatible = "fsl,pfuze3000"; + reg = <0x08>; + + regulators { + sw1a_reg: sw1a { + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <6250>; + }; + /* use sw1c_reg to align with pfuze100/pfuze200 */ + sw1c_reg: sw1b { + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <1475000>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <6250>; + }; + + sw2_reg: sw2 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1850000>; + regulator-boot-on; + regulator-always-on; + }; + + sw3a_reg: sw3 { + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1650000>; + regulator-boot-on; + regulator-always-on; + }; + + swbst_reg: swbst { + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5150000>; + }; + + snvs_reg: vsnvs { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; + }; + + vref_reg: vrefddr { + regulator-boot-on; + regulator-always-on; + }; + + vgen1_reg: vldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen2_reg: vldo2 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1550000>; + }; + + vgen3_reg: vccsd { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen4_reg: v33 { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen5_reg: vldo3 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vgen6_reg: vldo4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; + }; +}; + +&sai1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai1>; + assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>, + <&clks IMX7D_SAI1_ROOT_CLK>; + assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>; + assigned-clock-rates = <0>, <24576000>; + status = "okay"; +}; + + +&pwm1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm1>; + status = "okay"; +}; + +&pwm2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm2>; + status = "okay"; +}; + +&pwm3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm3>; + status = "okay"; +}; + +&pwm4 { /* Backlight */ + status = "okay"; +}; + +&uart5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart5>; + assigned-clocks = <&clks IMX7D_UART5_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + status = "okay"; +}; + +&uart6 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart6>; + assigned-clocks = <&clks IMX7D_UART6_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>; + uart-has-rtscts; + status = "okay"; +}; + +&uart7 { /* Bluetooth */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart7>; + assigned-clocks = <&clks IMX7D_UART7_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>; + uart-has-rtscts; + status = "okay"; +}; + +&usbotg1 { + vbus-supply = <®_usb_otg1_vbus>; + status = "okay"; +}; + +&usbotg2 { + vbus-supply = <®_usb_otg2_vbus>; + dr_mode = "host"; + status = "okay"; +}; + +&usdhc1 { + pinctrl-names = "default", "state_100mhz", "state_200mhz"; + pinctrl-0 = <&pinctrl_usdhc1>; + pinctrl-1 = <&pinctrl_usdhc1_100mhz>; + pinctrl-2 = <&pinctrl_usdhc1_200mhz>; + cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; + bus-width = <4>; + tuning-step = <2>; + vmmc-supply = <®_3p3v>; + wakeup-source; + no-1-8-v; + keep-power-in-suspend; + status = "okay"; +}; + +&usdhc2 { /* Wifi SDIO */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_wifi_clk>; + no-1-8-v; + non-removable; + keep-power-in-suspend; + wakeup-source; + vmmc-supply = <®_wlreg_on>; + mmc-pwrseq = <&usdhc2_pwrseq>; + status = "okay"; +}; + +&usdhc3 { + pinctrl-names = "default", "state_100mhz", "state_200mhz"; + pinctrl-0 = <&pinctrl_usdhc3>; + pinctrl-1 = <&pinctrl_usdhc3_100mhz>; + pinctrl-2 = <&pinctrl_usdhc3_200mhz>; + assigned-clocks = <&clks IMX7D_USDHC3_ROOT_CLK>; + assigned-clock-rates = <400000000>; + bus-width = <8>; + no-1-8-v; + fsl,tuning-step = <2>; + non-removable; + status = "okay"; +}; + +&wdog1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdog>; + fsl,ext-reset-output; + status = "okay"; +}; + +&iomuxc { + pinctrl_ecspi3: ecspi3grp { + fsl,pins = < + MX7D_PAD_I2C1_SCL__ECSPI3_MISO 0x2 + MX7D_PAD_I2C1_SDA__ECSPI3_MOSI 0x2 + MX7D_PAD_I2C2_SCL__ECSPI3_SCLK 0x2 + MX7D_PAD_I2C2_SDA__GPIO4_IO11 0x14 + >; + }; + + pinctrl_i2c1: i2c1grp { + fsl,pins = < + MX7D_PAD_UART1_TX_DATA__I2C1_SDA 0x4000007f + MX7D_PAD_UART1_RX_DATA__I2C1_SCL 0x4000007f + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX7D_PAD_UART2_TX_DATA__I2C2_SDA 0x4000007f + MX7D_PAD_UART2_RX_DATA__I2C2_SCL 0x4000007f + >; + }; + + pinctrl_enet1: enet1grp { + fsl,pins = < + MX7D_PAD_SD2_CD_B__ENET1_MDIO 0x3 + MX7D_PAD_SD2_WP__ENET1_MDC 0x3 + MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC 0x1 + MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0 0x1 + MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1 0x1 + MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2 0x1 + MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3 0x1 + MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL0x1arch/arm/dts/imx7d-pico.dtsi new file +6
-0+ MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC 0x1 + MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0 0x1 + MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1 0x1 + MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2 0x1 + MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3 0x1 + MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL0x1arch/arm/dts/imx7d-pico.dtsi new file +1
-0+ MX7D_PAD_SD3_RESET_B__GPIO6_IO11
0x1/* Ethernet reset */arch/arm/dts/imx7d-pico.dtsi new file +194
-1+ >; + }; + + pinctrl_can1: can1frp { + fsl,pins = < + MX7D_PAD_SAI1_RX_DATA__FLEXCAN1_RX 0x59 + MX7D_PAD_SAI1_TX_BCLK__FLEXCAN1_TX 0x59 + >; + }; + + pinctrl_can2: can2frp { + fsl,pins = < + MX7D_PAD_SAI1_TX_SYNC__FLEXCAN2_RX 0x59 + MX7D_PAD_SAI1_TX_DATA__FLEXCAN2_TX 0x59 + >; + }; + + pinctrl_i2c4: i2c4grp { + fsl,pins = < + MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA 0x4000007f + MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL 0x4000007f + >; + }; + + pinctrl_pwm1: pwm1 { + fsl,pins = < + MX7D_PAD_GPIO1_IO08__PWM1_OUT 0x7f + >; + }; + + pinctrl_pwm2: pwm2 { + fsl,pins = < + MX7D_PAD_GPIO1_IO09__PWM2_OUT 0x7f + >; + }; + + pinctrl_pwm3: pwm3 { + fsl,pins = < + MX7D_PAD_GPIO1_IO10__PWM3_OUT 0x7f + >; + }; + + pinctrl_reg_wlreg_on: regregongrp { + fsl,pins = < + MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16 0x59 + >; + }; + + pinctrl_sai1: sai1grp { + fsl,pins = < + MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK 0x1f + MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC 0x1f + MX7D_PAD_ENET1_COL__SAI1_TX_DATA0 0x30 + MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0 0x1f + >; + }; + + pinctrl_uart5: uart5grp { + fsl,pins = < + MX7D_PAD_I2C4_SDA__UART5_DCE_TX 0x79 + MX7D_PAD_I2C4_SCL__UART5_DCE_RX 0x79 + >; + }; + + pinctrl_uart6: uart6grp { + fsl,pins = < + MX7D_PAD_EPDC_DATA08__UART6_DCE_RX 0x79 + MX7D_PAD_EPDC_DATA09__UART6_DCE_TX 0x79 + MX7D_PAD_EPDC_DATA10__UART6_DCE_RTS 0x79 + MX7D_PAD_EPDC_DATA11__UART6_DCE_CTS 0x79 + >; + }; + + pinctrl_uart7: uart7grp { + fsl,pins = < + MX7D_PAD_ECSPI2_MOSI__UART7_DCE_TX 0x79 + MX7D_PAD_ECSPI2_SCLK__UART7_DCE_RX 0x79 + MX7D_PAD_ECSPI2_SS0__UART7_DCE_CTS 0x79 + MX7D_PAD_ECSPI2_MISO__UART7_DCE_RTS 0x79 + >; + }; + + pinctrl_usbotg1_pwr: usbotg_pwr { + fsl,pins = < + MX7D_PAD_UART3_TX_DATA__GPIO4_IO5 0x14 + >; + }; + + pinctrl_usdhc1: usdhc1grp { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x59 + MX7D_PAD_SD1_CLK__SD1_CLK 0x19 + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x59 + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x59 + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x59 + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x59 + MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc1_100mhz: usdhc1grp_100mhz { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x5a + MX7D_PAD_SD1_CLK__SD1_CLK 0x1a + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x5a + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x5a + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x5a + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x5a + MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc1_200mhz: usdhc1grp_200mhz { + fsl,pins = < + MX7D_PAD_SD1_CMD__SD1_CMD 0x5b + MX7D_PAD_SD1_CLK__SD1_CLK 0x1b + MX7D_PAD_SD1_DATA0__SD1_DATA0 0x5b + MX7D_PAD_SD1_DATA1__SD1_DATA1 0x5b + MX7D_PAD_SD1_DATA2__SD1_DATA2 0x5b + MX7D_PAD_SD1_DATA3__SD1_DATA3 0x5b + MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x15 + >; + }; + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < + MX7D_PAD_SD2_CMD__SD2_CMD 0x59 + MX7D_PAD_SD2_CLK__SD2_CLK 0x19 + MX7D_PAD_SD2_DATA0__SD2_DATA0 0x59 + MX7D_PAD_SD2_DATA1__SD2_DATA1 0x59 + MX7D_PAD_SD2_DATA2__SD2_DATA2 0x59 + MX7D_PAD_SD2_DATA3__SD2_DATA3 0x59 + >; + }; + + pinctrl_usdhc3: usdhc3grp { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x59 + MX7D_PAD_SD3_CLK__SD3_CLK 0x19 + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x59 + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x59 + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x59 + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x59 + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x59 + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x59 + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x59 + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x59 + >; + }; + + pinctrl_usdhc3_100mhz: usdhc3grp_100mhz { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x5a + MX7D_PAD_SD3_CLK__SD3_CLK 0x1a + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x5a + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x5a + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x5a + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x5a + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x5a + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x5a + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x5a + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x5a + >; + }; + + pinctrl_usdhc3_200mhz: usdhc3grp_200mhz { + fsl,pins = < + MX7D_PAD_SD3_CMD__SD3_CMD 0x5b + MX7D_PAD_SD3_CLK__SD3_CLK 0x1b + MX7D_PAD_SD3_DATA0__SD3_DATA0 0x5b + MX7D_PAD_SD3_DATA1__SD3_DATA1 0x5b + MX7D_PAD_SD3_DATA2__SD3_DATA2 0x5b + MX7D_PAD_SD3_DATA3__SD3_DATA3 0x5b + MX7D_PAD_SD3_DATA4__SD3_DATA4 0x5b + MX7D_PAD_SD3_DATA5__SD3_DATA5 0x5b + MX7D_PAD_SD3_DATA6__SD3_DATA6 0x5b + MX7D_PAD_SD3_DATA7__SD3_DATA7 0x5b + >; + }; +}; + +&iomuxc_lpsr { + pinctrl_wifi_clk: wificlkgrp { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO03__CCM_CLKO2 0x7d + >; + }; + + pinctrl_wdog: wdoggrp { + fsl,pins = < + MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x74 + >; + }; +}; --2.7.4
Fabio Estevam
reviewerPATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
In reply to Jun NieQuoted 4 lines · Jun Nie
Copy device tree files from Linux directly.
Signed-off-by Jun Nie <[email protected]>
There is a series from Joris that does the pico-mx7d DM conversion.
PATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
Quoted 8 lines · Fabio Estevam <[email protected]> 于2019年4月24日周三 下午6:31写道:
Quoted 4 lines · Jun Nie
Copy device tree files from Linux directly.
Signed-off-by Jun Nie <[email protected]>There is a series from Joris that does the pico-mx7d DM conversion.
When is that series expected to be merged?
PATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
Quoted 4 lines · Jun Nie
Quoted 3 lines · Fabio Estevam <[email protected]> 于2019年4月24日周三 下午6:31写道:
Quoted 1 line · Jun Nie
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Copy device tree files from Linux directly.
Signed-off-by Jun Nie <[email protected]>There is a series from Joris that does the pico-mx7d DM conversion.
When is that series expected to be merged?
I merged Joris' series and build is in progress.
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 v3 7/9 pico-imx7d: Add device tree for pico-imx7d
Quoted 6 lines
I merged Joris' series and build is in progress.
Regards,
Stefano
Great! I will prepare my patch based on that. But I cannot find latest pico patch on denx master repo. Did you merge it to your own repo and pulled to denx master later, just like linux work flow? I am not familiar with u-boot work flow yet. Thanks for point the repo in advance!
Jun
PATCH v3 7/9 pico-imx7d: Add device tree for pico-imx7d
Quoted 8 lines · Jun Nie
Quoted 6 lines
I merged Joris' series and build is in progress.
Regards,
StefanoGreat! I will prepare my patch based on that. But I cannot find latest pico patch on denx master repo.
Right.
Quoted 2 lines
Did you merge it to your own repo and
pulled to denx master later, just like linux work flow?
Yes.
Quoted 2 lines
I am not
familiar with u-boot work flow yet.
Because PR are rejected if not verified by Travis, I push first to
https://github.com/sbabic/u-boot-imx (-next branch). If report from Travis is ok (this is needed in PR), I push to git.denx.de/u-boot-imx (-master).
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 v3 8/9 pico-imx7d: Add bl33 config
In reply to Jun NieAdd default configuration to run u-boot as BL33 in the boot flow case of ATF(ARM Trusted Firmware) -> OPTEE -> U-boot.
--- configs/pico-imx7d_bl33_defconfig | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 configs/pico-imx7d_bl33_defconfig
configs/pico-imx7d_bl33_defconfig new file +63 -0
@@ -0,0 +1,63 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX7=y +CONFIG_SYS_TEXT_BASE=0x87800000 +CONFIG_SPL_GPIO_SUPPORT=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SECURE_BOOT=y +CONFIG_TARGET_PICO_IMX7D=y +CONFIG_SPL_MMC_SUPPORT=y +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_SPL=y +CONFIG_ARMV7_BOOT_SEC_DEFAULT=y +CONFIG_IMX_CONSOLE_UART_ID=5 +CONFIG_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_FIT_VERBOSE=y +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" +CONFIG_DEFAULT_FDT_FILE="imx7d-pico-pi.dtb" +CONFIG_BOUNCE_BUFFER=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_USB_HOST_SUPPORT=y +CONFIG_SPL_USB_GADGET=y +CONFIG_SPL_USB_SDP_SUPPORT=y +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_BOOTD is not set +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_SPL=y +CONFIG_CMD_SPL_WRITE_SIZE=0x20000 +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_DFU=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_USB_SDP=y +CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_PXE=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="imx7d-pico-pi" +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DFU_MMC=y +CONFIG_FSL_ESDHC=y +CONFIG_PHYLIB=y +CONFIG_MII=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_MXC_USB_OTG_HACTIVE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="FSL" +CONFIG_USB_GADGET_VENDOR_NUM=0x0525 +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_CI_UDC=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_USB_ETHER=y +CONFIG_USB_ETH_CDC=y +CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_OPTEE_TZDRAM_SIZE=0x2000000
Signature · 1 line
2.7.4
PATCH v3 9/9 pico-imx7d: README: Add BL33 usage case
In reply to Jun NieAdd Documentation of BL33 usage case. U-boot is in non-secure world in this case.
--- board/technexion/pico-imx7d/README.pico-imx7d_BL33 | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 board/technexion/pico-imx7d/README.pico-imx7d_BL33
board/technexion/pico-imx7d/README.pico-imx7d_BL33 new file +44 -0
@@ -0,0 +1,44 @@ +This document describes the instruction to build and flash ATF/OPTEE/U-Boot on +pico-imx7d board. U-Boot is loaded as part of FIP image by ATF in this setup. +The boot sequence is ATF -> OPTEE -> U-Boot -> Linux. U-Boot is in non-secure +world in this case. + +- Build u-boot + Set environment variable of CROSS_COMPILE for your toolchain and ARCH=arm + $ make pico-imx7d_bl33_defconfig + $ make all + +- Download and build OPTEE + $ git clone git at github.com:OP-TEE/optee_os.git + $ make PLATFORM=imx PLATFORM_FLAVOR=mx7dpico_mbl CFG_BOOT_SECONDARY_REQUEST=y ARCH=arm + +- Download and build ATF + $ git clone https://git.linaro.org/landing-teams/working/mbl/arm-trusted-firmware.git -b linaro-imx7 + $ make DEBUG=1 PLAT=picopi ARCH=aarch32 ARM_ARCH_MAJOR=7 \ + CROSS_COMPILE=arm-linux-gnueabihf- LOG_LEVEL=50 V=1 \ + CRASH_REPORTING=1 AARCH32_SP=optee all + Save file content in this link to file pico-imx7d.cfg: + http://git.linaro.org/landing-teams/working/mbl/u-boot.git/tree/board/technexion/pico-imx7d/pico-imx7d.cfg?h=linaro-imx + $ u-boot/tools/mkimage -n pico-imx7d.cfg -T imximage -e 0x9df00000 -d \ + build/picopi/debug/bl2.bin bl2.imx + +- Create FIP image + Create a fiptool_images/ folder in ATF folder, copy u-boot.bin in u-boot +folder and tee*.bin in optee out/arm-plat-imx/core/tee/ folder to +fiptool_images. Run below command in ATF folder to generate FIP image. + $ make -C tools/fiptool/ + $ tools/fiptool/fiptool create --tos-fw fiptool_images/tee-header_v2.bin \ + --tos-fw-extra1 fiptool_images/tee-pager_v2.bin \ + --tos-fw-extra2 fiptool_images/tee-pageable_v2.bin \ + --nt-fw fiptool_images/u-boot.bin \ + fip.bin + +- Burn the images to eMMC for test. + Run below command in atf folder: + $ dd if=build/picopi/debug/bl2.bin.imx of=/dev/disk/by-id/usb-<your device> bs=1024 seek=1;sync + $ dd if=fip.bin of=/dev/disk/by-id/usb-<your device> bs=1024 seek=1;sync + +- Test + Just boot up your board and wait for u-boot start up after ATF's log. + For booting Linux in FIT image, please reference the FIT files in + u-boot doc/uImage.FIT/ folder.
Signature · 1 line
2.7.4