imx: add Boundary Devices Nitrogen8M board support
Subsystems (3)
PATCH 1/1 imx: add Boundary Devices Nitrogen8M board support
This adds basic support for the Nitrogen8M board. It's based on the NXP i.MX8MQ and provides 2GB of memory. This code has been based on the i.MX8M EVK board support, and Boundary Devices' git repository. So far the eMMC and onboard Ethernet can be used to boot, with more device support yet to be implemented. Please note that this only supports the 2G version, with 1 rank bit, which is Boundary Devices' "nitrogen8m" defconfig as well.
arch/arm/dts/Makefile +3 -1
@@ -629,7 +629,9 @@ dtb-$(CONFIG_ARCH_IMX8) += \ fsl-imx8qxp-colibri.dtb \ fsl-imx8qxp-mek.dtb -dtb-$(CONFIG_ARCH_IMX8M) += fsl-imx8mq-evk.dtb +dtb-$(CONFIG_ARCH_IMX8M) += \ + fsl-imx8mq-evk.dtb \ + imx8mq-nitrogen8m.dtb dtb-$(CONFIG_RCAR_GEN2) += \ r8a7790-lager-u-boot.dtb \
arch/arm/dts/imx8mq-nitrogen8m.dts new file +363 -0
363 lines not on this page · raw message
arch/arm/mach-imx/imx8m/Kconfig +6 -0
@@ -16,8 +16,14 @@ config TARGET_IMX8MQ_EVK select IMX8M select IMX8M_LPDDR4 +config TARGET_NITROGEN8M + bool "nitrogen8m" + select IMX8M + select IMX8M_LPDDR4 + endchoice source "board/freescale/imx8mq_evk/Kconfig" +source "board/boundary/nitrogen8m/Kconfig" endif
board/boundary/nitrogen8m/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +if TARGET_NITROGEN8M + +config SYS_BOARD + default "nitrogen8m" + +config SYS_VENDOR + default "boundary" + +config SYS_CONFIG_NAME + default "nitrogen8m" + +config DDR_RANK_BITS + int "ddr rank bits" + default 1 + +endif
board/boundary/nitrogen8m/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright 2016 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += nitrogen8m.o + +ifdef CONFIG_SPL_BUILD +obj-y += spl.o +obj-y += lpddr4_timing.o +endif
board/boundary/nitrogen8m/lpddr4_timing.c new file +1259 -0
1,259 lines not on this page · raw message
board/boundary/nitrogen8m/nitrogen8m.c new file +237 -0
237 lines not on this page · raw message
board/boundary/nitrogen8m/spl.c new file +237 -0
237 lines not on this page · raw message
configs/nitrogen8m_defconfig new file +61 -0
61 lines not on this page · raw message
include/configs/nitrogen8m.h new file +157 -0
157 lines not on this page · raw message
Fabio Estevam
reviewerPATCH 1/1 imx: add Boundary Devices Nitrogen8M board support
Hi Patrick,
[Adding Troy, NXP U-Boot folks and Stefano]
Thanks for your contribution.
Quoted 12 lines · Patrick Wildt
This adds basic support for the Nitrogen8M board. It's based on the NXP i.MX8MQ and provides 2GB of memory. This code has been based on the i.MX8M EVK board support, and Boundary Devices' git repository. So far the eMMC and onboard Ethernet can be used to boot, with more device support yet to be implemented. Please note that this only supports the 2G version, with 1 rank bit, which is Boundary Devices' "nitrogen8m" defconfig as well.
Signed-off-by Patrick Wildt <[email protected]>
arch/arm/dts/imx8mq-nitrogen8m.dts line 19
Quoted 7 lines
arch/arm/dts/imx8mq-nitrogen8m.dts new file +7
-0+/ { + model = "Boundary Devices i.MX8MQ Nitrogen8M"; + compatible = "boundary,imx8mq-nitrogen8m", "fsl,imx8mq"; + + chosen { + bootargs = "console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200"; + };
This earlycon part should be removed.
board/boundary/nitrogen8m/lpddr4_timing.c line 1238
Quoted 7 lines
board/boundary/nitrogen8m/lpddr4_timing.c new file +7
-0+/* P1 400mts 1D */ + .drate = 400, + .fw_type = FW_1D_IMAGE, + .fsp_cfg = lpddr4_fsp1_cfg, + .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp1_cfg), + }, +#if 0
No if 0 please.
Quoted 14 lines
board/boundary/nitrogen8m/nitrogen8m.c new file +14
-0+static int setup_fec (void ) +{ +struct iomuxc_gpr_base_regs *gpr = + (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR ; + +/* Pull PHY into reset */ +gpio_request (IMX_GPIO_NR (1 ,9 ),"fec1_rst" ); +gpio_direction_output (IMX_GPIO_NR (1 ,9 ),0 ); + +/* Set bootstrap pins for AR8035 */ +gpio_request (IMX_GPIO_NR (1 ,26 ),"fec1_rd0" ); +gpio_direction_output (IMX_GPIO_NR (1 ,26 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,27 ),"fec1_rd1" ); +gpio_direction_output (IMX_GPIO_NR (1 ,27 ),0 );
board/boundary/nitrogen8m/nitrogen8m.c line 177
Quoted 10 lines
board/boundary/nitrogen8m/nitrogen8m.c new file +10
-0+gpio_request (IMX_GPIO_NR (1 ,28 ),"fec1_rd2" ); +gpio_direction_output (IMX_GPIO_NR (1 ,28 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,29 ),"fec1_rd3" ); +gpio_direction_output (IMX_GPIO_NR (1 ,29 ),1 ); +gpio_request (IMX_GPIO_NR (1 ,24 ),"fec1_rx_ctl" ); +gpio_direction_output (IMX_GPIO_NR (1 ,24 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,25 ),"fec1_rxc" ); +gpio_direction_output (IMX_GPIO_NR (1 ,25 ),1 ); +imx_iomux_v3_setup_multiple_pads (fec1_strap_pads, +ARRAY_SIZE (fec1_strap_pads));
There is DM support from the FEC, so no need to have all this board code.
board/boundary/nitrogen8m/spl.c line 144
Quoted 4 lines
board/boundary/nitrogen8m/spl.c new file +4
-0+ +/* +* 9e (1e = 30) default .9 V +* 0.6V to 1.23V in 10 MV steps
These commands look too cryptic.
board/boundary/nitrogen8m/spl.c line 152
Quoted 8 lines
board/boundary/nitrogen8m/spl.c new file +8
-0+*/ + +/* Enable I2C1A, ARM/DRAM */ +i2c_write (I2C_MUX_ADDR ,1 ,1 ,NULL ,0 ); +/* +* .6 + .40 = 1.00 +*/ + val8 =0x80 +40 ;
Please add defines for these values.
PATCH 1/1 imx: add Boundary Devices Nitrogen8M board support
Quoted 5 lines · Fabio Estevam
Hi Patrick,
[Adding Troy, NXP U-Boot folks and Stefano]
Thanks for your contribution.
Thanks for looking at it!
Quoted 13 lines · Patrick Wildt
Quoted 11 lines
This adds basic support for the Nitrogen8M board. It's based on the NXP i.MX8MQ and provides 2GB of memory. This code has been based on the i.MX8M EVK board support, and Boundary Devices' git repository. So far the eMMC and onboard Ethernet can be used to boot, with more device support yet to be implemented. Please note that this only supports the 2G version, with 1 rank bit, which is Boundary Devices' "nitrogen8m" defconfig as well.
Signed-off-by Patrick Wildt <[email protected]>
Quoted 9 lines
arch/arm/dts/imx8mq-nitrogen8m.dts line 19
Quoted 7 lines
arch/arm/dts/imx8mq-nitrogen8m.dts new file +7
-0+/ { + model = "Boundary Devices i.MX8MQ Nitrogen8M"; + compatible = "boundary,imx8mq-nitrogen8m", "fsl,imx8mq"; + + chosen { + bootargs = "console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200"; + };This earlycon part should be removed.
Sure, ok.
Quoted 9 lines
board/boundary/nitrogen8m/lpddr4_timing.c line 1238
Quoted 7 lines
board/boundary/nitrogen8m/lpddr4_timing.c new file +7
-0+/* P1 400mts 1D */ + .drate = 400, + .fw_type = FW_1D_IMAGE, + .fsp_cfg = lpddr4_fsp1_cfg, + .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp1_cfg), + }, +#if 0 No if 0 please.
That was taken from Boundary Devices directly, I'll get rid of it.
Quoted 18 lines
Quoted 18 lines
board/boundary/nitrogen8m/nitrogen8m.c new file +18
-0+static int setup_fec (void ) +{ +struct iomuxc_gpr_base_regs *gpr = + (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR ; + +/* Pull PHY into reset */ +gpio_request (IMX_GPIO_NR (1 ,9 ),"fec1_rst" ); +gpio_direction_output (IMX_GPIO_NR (1 ,9 ),0 ); + +/* Set bootstrap pins for AR8035 */ +gpio_request (IMX_GPIO_NR (1 ,26 ),"fec1_rd0" ); +gpio_direction_output (IMX_GPIO_NR (1 ,26 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,27 ),"fec1_rd1" ); +gpio_direction_output (IMX_GPIO_NR (1 ,27 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,28 ),"fec1_rd2" ); +gpio_direction_output (IMX_GPIO_NR (1 ,28 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,29 ),"fec1_rd3" ); +gpio_direction_output (IMX_GPIO_NR (1 ,29 ),1 );
Quoted 8 lines
board/boundary/nitrogen8m/nitrogen8m.c line 177
Quoted 6 lines
board/boundary/nitrogen8m/nitrogen8m.c new file +6
-0+gpio_request (IMX_GPIO_NR (1 ,24 ),"fec1_rx_ctl" ); +gpio_direction_output (IMX_GPIO_NR (1 ,24 ),0 ); +gpio_request (IMX_GPIO_NR (1 ,25 ),"fec1_rxc" ); +gpio_direction_output (IMX_GPIO_NR (1 ,25 ),1 ); +imx_iomux_v3_setup_multiple_pads (fec1_strap_pads, +ARRAY_SIZE (fec1_strap_pads));There is DM support from the FEC, so no need to have all this board code.
I should have added a better comment for this whole block I think, sorry. This does not bootrstrap the FEC, but it bootstrap the Phy. The thing is that Boundary Devices configures the Phy by pulling the Ethernet TX/RX pins to specific modes. When the Phy is pulled from reset, it will sample those pins and configure itself based on the information. I don't think the FEC driver takes care of it, and I highly doubt it is supposed to take care of it.
Quoted 6 lines
board/boundary/nitrogen8m/spl.c line 144
Quoted 4 lines
board/boundary/nitrogen8m/spl.c new file +4
-0+ +/* +* 9e (1e = 30) default .9 V +* 0.6V to 1.23V in 10 MV steps These commands look too cryptic.
I agree. This code is taken from Boundary devices. I will try to find the datasheet for the controller and come up with something nicer.
Quoted 10 lines
board/boundary/nitrogen8m/spl.c line 152
Quoted 8 lines
board/boundary/nitrogen8m/spl.c new file +8
-0+*/ + +/* Enable I2C1A, ARM/DRAM */ +i2c_write (I2C_MUX_ADDR ,1 ,1 ,NULL ,0 ); +/* +* .6 + .40 = 1.00 +*/ + val8 =0x80 +40 ;Please add defines for these values.
Thanks!
Patrick
PATCH v2 1/1 imx: add Boundary Devices Nitrogen8M board support
In reply to Fabio EstevamThis adds basic support for the Nitrogen8M board. It's based on the NXP i.MX8MQ and provides 2GB of memory. This code has been based on the i.MX8M EVK board support, and Boundary Devices' git repository. So far the eMMC and onboard Ethernet can be used to boot, with more device support yet to be implemented. Please note that this only supports the 2G version, with 1 rank bit, which is Boundary Devices' "nitrogen8m" defconfig as well.
---
Changes for v2:
- Added explanation for the phy initialization
- Improved readability of the voltage regulator initialization
- Used correct fdtfile environment variable instead of fdt_file
- Removed earlycon from device tree and extra environment
- Removed #if 0 from LPDDR4 timing
arch/arm/dts/Makefile | 4 +- arch/arm/dts/imx8mq-nitrogen8m.dts | 363 ++++++ arch/arm/mach-imx/imx8m/Kconfig | 6 + board/boundary/nitrogen8m/Kconfig | 16 + board/boundary/nitrogen8m/Makefile | 12 + board/boundary/nitrogen8m/lpddr4_timing.c | 1250 +++++++++++++++++++++ board/boundary/nitrogen8m/nitrogen8m.c | 244 ++++ board/boundary/nitrogen8m/spl.c | 232 ++++ configs/nitrogen8m_defconfig | 61 + include/configs/nitrogen8m.h | 157 +++ 10 files changed, 2344 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/imx8mq-nitrogen8m.dts create mode 100644 board/boundary/nitrogen8m/Kconfig create mode 100644 board/boundary/nitrogen8m/Makefile create mode 100644 board/boundary/nitrogen8m/lpddr4_timing.c create mode 100644 board/boundary/nitrogen8m/nitrogen8m.c create mode 100644 board/boundary/nitrogen8m/spl.c create mode 100644 configs/nitrogen8m_defconfig create mode 100644 include/configs/nitrogen8m.h
arch/arm/dts/Makefile +3 -1
@@ -629,7 +629,9 @@ dtb-$(CONFIG_ARCH_IMX8) += \ fsl-imx8qxp-colibri.dtb \ fsl-imx8qxp-mek.dtb -dtb-$(CONFIG_ARCH_IMX8M) += fsl-imx8mq-evk.dtb +dtb-$(CONFIG_ARCH_IMX8M) += \ + fsl-imx8mq-evk.dtb \ + imx8mq-nitrogen8m.dtb dtb-$(CONFIG_RCAR_GEN2) += \ r8a7790-lager-u-boot.dtb \
arch/arm/dts/imx8mq-nitrogen8m.dts new file +363 -0
363 lines not on this page · raw message
arch/arm/mach-imx/imx8m/Kconfig +6 -0
@@ -16,8 +16,14 @@ config TARGET_IMX8MQ_EVK select IMX8M select IMX8M_LPDDR4 +config TARGET_NITROGEN8M + bool "nitrogen8m" + select IMX8M + select IMX8M_LPDDR4 + endchoice source "board/freescale/imx8mq_evk/Kconfig" +source "board/boundary/nitrogen8m/Kconfig" endif
board/boundary/nitrogen8m/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +if TARGET_NITROGEN8M + +config SYS_BOARD + default "nitrogen8m" + +config SYS_VENDOR + default "boundary" + +config SYS_CONFIG_NAME + default "nitrogen8m" + +config DDR_RANK_BITS + int "ddr rank bits" + default 1 + +endif
board/boundary/nitrogen8m/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright 2016 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += nitrogen8m.o + +ifdef CONFIG_SPL_BUILD +obj-y += spl.o +obj-y += lpddr4_timing.o +endif
board/boundary/nitrogen8m/lpddr4_timing.c new file +1250 -0
1,250 lines not on this page · raw message
board/boundary/nitrogen8m/nitrogen8m.c new file +244 -0
244 lines not on this page · raw message
board/boundary/nitrogen8m/spl.c new file +232 -0
232 lines not on this page · raw message
configs/nitrogen8m_defconfig new file +61 -0
61 lines not on this page · raw message
include/configs/nitrogen8m.h new file +157 -0
157 lines not on this page · raw message
Signature · 1 line
2.23.0
Fabio Estevam
reviewerPATCH v2 1/1 imx: add Boundary Devices Nitrogen8M board support
Quoted 10 lines · Patrick Wildt
This adds basic support for the Nitrogen8M board. It's based on the NXP i.MX8MQ and provides 2GB of memory. This code has been based on the i.MX8M EVK board support, and Boundary Devices' git repository. So far the eMMC and onboard Ethernet can be used to boot, with more device support yet to be implemented. Please note that this only supports the 2G version, with 1 rank bit, which is Boundary Devices' "nitrogen8m" defconfig as well.
Signed-off-by Patrick Wildt <[email protected]>
Troy, could you please help reviewing this?
Thanks