Re: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable

2020-08-18 Thread Tom Rini
On Tue, Aug 18, 2020 at 10:09:31AM +0200, Stefano Babic wrote:
> On 13.08.20 03:16, Tom Rini wrote:
> > On Thu, Aug 13, 2020 at 12:52:22AM +, Peng Fan wrote:
> >> Hi Tom,
> >>
> >>> Subject: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable
> >>>
> >> []
> >>  
> >>> +
> >>>  config MX6UL_LITESOM
> >>>   bool
> >>>   select DM
> >>>   select DM_THERMAL
> >>> - select MX6UL
> >>
> >> Would keep it here to simplify defconfig?
> > 
> > No.  The litesom / opos6 cases highlight that we have two different ways
> > SoM+carrier are being handled today and those too could use unifacation.
> > But we can't drop MX6UL_LITESOM (or MX6UL_OPOS6UL) and would have
> > arch/arm/mach-imx/mx6/Makefile reference CONFIG_TARGET_xxx options,
> > which isn't something that looks right.
> 
> But now CONFIG_MX6UL_LITESOM is not selected at all with this patch, and
> build for (both) MX6UL_LITESOM and OPS6 is broken. IMHO we should also
> force to set the SOM (MX6UL_LITESOM or MX6UL_OPOS6UL) in the board Kconfig.

... I see I sent one of the versions that wasn't quite right for those
two cases.  I'll repost one where I stop dropping those two select's
later, sorry about that.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable

2020-08-18 Thread Stefano Babic
On 13.08.20 03:16, Tom Rini wrote:
> On Thu, Aug 13, 2020 at 12:52:22AM +, Peng Fan wrote:
>> Hi Tom,
>>
>>> Subject: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable
>>>
>> []
>>  
>>> +
>>>  config MX6UL_LITESOM
>>> bool
>>> select DM
>>> select DM_THERMAL
>>> -   select MX6UL
>>
>> Would keep it here to simplify defconfig?
> 
> No.  The litesom / opos6 cases highlight that we have two different ways
> SoM+carrier are being handled today and those too could use unifacation.
> But we can't drop MX6UL_LITESOM (or MX6UL_OPOS6UL) and would have
> arch/arm/mach-imx/mx6/Makefile reference CONFIG_TARGET_xxx options,
> which isn't something that looks right.

But now CONFIG_MX6UL_LITESOM is not selected at all with this patch, and
build for (both) MX6UL_LITESOM and OPS6 is broken. IMHO we should also
force to set the SOM (MX6UL_LITESOM or MX6UL_OPOS6UL) in the board Kconfig.

Best regards,
Stefano

-- 
=
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: sba...@denx.de
=


Re: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable

2020-08-12 Thread Tom Rini
On Thu, Aug 13, 2020 at 12:52:22AM +, Peng Fan wrote:
> Hi Tom,
> 
> > Subject: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable
> >
> []
>  
> > +
> >  config MX6UL_LITESOM
> > bool
> > select DM
> > select DM_THERMAL
> > -   select MX6UL
> 
> Would keep it here to simplify defconfig?

No.  The litesom / opos6 cases highlight that we have two different ways
SoM+carrier are being handled today and those too could use unifacation.
But we can't drop MX6UL_LITESOM (or MX6UL_OPOS6UL) and would have
arch/arm/mach-imx/mx6/Makefile reference CONFIG_TARGET_xxx options,
which isn't something that looks right.

-- 
Tom


signature.asc
Description: PGP signature


RE: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable

2020-08-12 Thread Peng Fan
Hi Tom,

> Subject: [PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable
>
[]
 
> +
>  config MX6UL_LITESOM
>   bool
>   select DM
>   select DM_THERMAL
> - select MX6UL

Would keep it here to simplify defconfig?

Regards,
Peng.

>   select SUPPORT_SPL
>   imply CMD_DM
> 
> @@ -73,7 +83,6 @@ config MX6UL_OPOS6UL
>   select DM_GPIO
>   select DM_MMC
>   select DM_THERMAL
> - select MX6UL
>   select SPL_DM if SPL
>   select SPL_OF_CONTROL if SPL
>   select SPL_PINCTRL if SPL
> @@ -81,12 +90,6 @@ config MX6UL_OPOS6UL
>   select SUPPORT_SPL
>   imply CMD_DM
> 
> -config MX6ULL
> - bool
> - select ROM_UNIFIED_SECTIONS
> - select SYSCOUNTER_TIMER
> - select SYS_L2CACHE_OFF
> -
>  config MX6_OCRAM_256KB
>   bool "Support 256KB OCRAM"
>   depends on MX6D || MX6Q
> @@ -110,14 +113,14 @@ choice
> 
>  config TARGET_ADVANTECH_DMS_BA16
>   bool "Advantech dms-ba16"
> + depends on MX6Q
>   select BOARD_LATE_INIT
> - select MX6Q
>   imply CMD_SATA
> 
>  config TARGET_APALIS_IMX6
>   bool "Toradex Apalis iMX6 board"
> + depends on MX6Q
>   select BOARD_LATE_INIT
> - select MX6Q
>   select DM
>   select DM_SERIAL
>   select DM_THERMAL
> @@ -127,8 +130,8 @@ config TARGET_APALIS_IMX6
> 
>  config TARGET_ARISTAINETOS2
>   bool "aristainetos2"
> + depends on MX6DL
>   select BOARD_LATE_INIT
> - select MX6DL
>   select SYS_I2C_MXC
>   select MXC_UART
>   select FEC_MXC
> @@ -138,8 +141,8 @@ config TARGET_ARISTAINETOS2
> 
>  config TARGET_ARISTAINETOS2B
>   bool "Support aristainetos2-revB"
> + depends on MX6DL
>   select BOARD_LATE_INIT
> - select MX6DL
>   select SYS_I2C_MXC
>   select MXC_UART
>   select FEC_MXC
> @@ -149,8 +152,8 @@ config TARGET_ARISTAINETOS2B
> 
>  config TARGET_ARISTAINETOS2BCSL
>   bool "Support aristainetos2-revB CSL"
> + depends on MX6DL
>   select BOARD_LATE_INIT
> - select MX6DL
>   select SYS_I2C_MXC
>   select MXC_UART
>   select FEC_MXC
> @@ -160,8 +163,8 @@ config TARGET_ARISTAINETOS2BCSL
> 
>  config TARGET_ARISTAINETOS2C
>   bool "Support aristainetos2-revC"
> + depends on MX6DL
>   select BOARD_LATE_INIT
> - select MX6DL
>   select SYS_I2C_MXC
>   select MXC_UART
>   select FEC_MXC
> @@ -171,20 +174,20 @@ config TARGET_ARISTAINETOS2C
> 
>  config TARGET_CGTQMX6EVAL
>   bool "cgtqmx6eval"
> + depends on MX6QDL
>   select BOARD_LATE_INIT
>   select DM
>   select DM_THERMAL
> - select MX6QDL
>   select SUPPORT_SPL
>   imply CMD_DM
> 
>  config TARGET_CM_FX6
>   bool "CM-FX6"
> + depends on MX6QDL
>   select BOARD_LATE_INIT
>   select DM
>   select DM_GPIO
>   select DM_SERIAL
> - select MX6QDL
>   select SUPPORT_SPL
>   imply CMD_DM
> 
> @@ -199,14 +202,14 @@ config TARGET_COLIBRI_IMX6
> 
>  config TARGET_COLIBRI_IMX6ULL
>   bool "Toradex Colibri iMX6ULL"
> + depends on MX6ULL
>   select BOARD_LATE_INIT
>   select DM
>   select DM_THERMAL
> - select MX6ULL
> 
>  config TARGET_DART_6UL
>   bool "Variscite imx6ULL dart(DART-SOM-6ULL)"
> - select MX6ULL
> + depends on MX6ULL
>   select DM
>   select DM_ETH
>   select DM_GPIO
> @@ -218,17 +221,18 @@ config TARGET_DART_6UL
> 
>  config TARGET_DHCOMIMX6
>   bool "dh_imx6"
> + depends on MX6QDL
>   select BOARD_EARLY_INIT_F
>   select BOARD_LATE_INIT
>   select DM
>   select DM_THERMAL
> - select MX6QDL
>   select SUPPORT_SPL
>   imply CMD_DM
>   imply CMD_SPL
> 
>  config TARGET_DISPLAY5
>   bool "LWN DISPLAY5 board"
> + depends on MX6Q
>   select DM
>   select DM_ETH
>   select DM_I2C
> @@ -246,12 +250,12 @@ config TARGET_EMBESTMX6BOARDS
> 
>  config TARGET_GE_BX50V3
>   bool "General Electric Bx50v3"
> + depends on MX6Q
>   select BOARD_LATE_INIT
> - select MX6Q
> 
>  config TARGET_GW_VENTANA
>   bool "gw_ventana"
> - select MX6QDL
> + depends on MX6QDL
>   select SUPPORT_SPL
>   imply CMD_SATA
>   imply CMD_SPL
> @@ -272,7 +276,7 @@ config TARGET_KOSAGI_NOVENA
> 
>  config TARGET_MCCMON6
>   bool "mccmon6"
> - select MX6QDL

[PATCH] arm: mx6: Make all i.MX6 SoCs user-selectable

2020-08-12 Thread Tom Rini
We have a number of platforms that are a combination of a carrier board
and System-on-Module (SoM) that in turn allows for the board to have
different SoCs on it.  In some cases, this is handled via board-specific
Kconfig options.  In other cases we make use of
CONFIG_SYS_EXTRA_OPTIONS.  This latter case however can lead to invalid
configurations as we will not in turn get options that in Kconfig are
selected by or depend on that setting.

To resolve this, make the SoC option a choice in Kconfig and make boards
depend on what they can support.  This change opens us up for further
clean-ups in the cases where a single CONFIG_TARGET_xxx can support
different SoCs and today they do not, or do not cleanly do so.

Reported-by: Matt Porter 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: "NXP i.MX U-Boot Team" 
Cc: Soeren Moch 
Cc: Markus Niebel 
Cc: Igor Opaniuk 
Cc: Heiko Schocher 
Cc: Hannes Schmelzer 
Cc: Otavio Salvador 
Cc: Nikita Kiryanov 
Cc: Andreas Geisreiter 
Cc: Ludwig Zenz 
Cc: Lukasz Majewski 
Cc: Akshay Bhat 
Cc: Ken Lin 
Cc: Ian Ray 
Cc: Tim Harvey 
Cc: Jagan Teki 
Cc: Raffaele RECALCATI 
Cc: Simone CIANNI 
Cc: Adam Ford 
Cc: Marcin Niestroj 
Cc: "Eric Bénard" 
Cc: Baruch Siach 
Cc: Jason Liu 
Cc: Ye Li 
Cc: Eric Nelson 
Cc: Troy Kisky 
Cc: Peng Fan 
Cc: Parthiban Nallathambi 
Cc: Marek Vasut 
Cc: "Sébastien Szymanski" 
Cc: Christian Gmeiner 
Cc: Niel Fourie 
Cc: Martyn Welch 
Cc: Richard Hu 
Cc: Stefan Roese 
Cc: Boris Brezillon 
Cc: Arkadiusz Karas 
Cc: Breno Lima 
Cc: Francesco Montefoschi 
Cc: Silvio Fricke 
Tested-by: Matt Porter  [colibri_imx6]
Signed-off-by: Tom Rini 
---
 arch/arm/mach-imx/mx6/Kconfig | 136 --
 board/seco/Kconfig|   6 +-
 board/tbs/tbs2910/Kconfig |   3 -
 board/tqc/tqma6/Kconfig   |   6 +-
 configs/apalis_imx6_defconfig |   3 +-
 configs/aristainetos2_defconfig   |   1 +
 configs/aristainetos2b_defconfig  |   1 +
 configs/aristainetos2bcsl_defconfig   |   1 +
 configs/aristainetos2c_defconfig  |   1 +
 configs/brppt2_defconfig  |   1 +
 configs/cgtqmx6eval_defconfig |   1 +
 configs/cm_fx6_defconfig  |   1 +
 configs/colibri-imx6ull_defconfig |   3 +-
 configs/colibri_imx6_defconfig|   3 +-
 configs/dh_imx6_defconfig |   1 +
 configs/display5_defconfig|   3 +-
 configs/display5_factory_defconfig|   3 +-
 configs/dms-ba16-1g_defconfig |   1 +
 configs/dms-ba16_defconfig|   1 +
 configs/ge_bx50v3_defconfig   |   1 +
 configs/gwventana_emmc_defconfig  |   1 +
 configs/gwventana_gw5904_defconfig|   1 +
 configs/gwventana_nand_defconfig  |   1 +
 configs/imx6dl_icore_nand_defconfig   |   1 +
 configs/imx6dl_mamoj_defconfig|   1 +
 configs/imx6q_icore_nand_defconfig|   1 +
 configs/imx6q_logic_defconfig |   1 +
 configs/imx6qdl_icore_mipi_defconfig  |   1 +
 configs/imx6qdl_icore_mmc_defconfig   |   1 +
 configs/imx6qdl_icore_nand_defconfig  |   1 +
 configs/imx6qdl_icore_rqs_defconfig   |   1 +
 configs/imx6ul_geam_mmc_defconfig |   1 +
 configs/imx6ul_geam_nand_defconfig|   1 +
 configs/imx6ul_isiot_emmc_defconfig   |   1 +
 configs/imx6ul_isiot_nand_defconfig   |   1 +
 configs/kp_imx6q_tpc_defconfig|   1 +
 configs/liteboard_defconfig   |   1 +
 configs/marsboard_defconfig   |   3 +-
 configs/mccmon6_nor_defconfig |   1 +
 configs/mccmon6_sd_defconfig  |   1 +
 configs/mx6cuboxi_defconfig   |   1 +
 configs/mx6dlarm2_defconfig   |   3 +-
 configs/mx6dlarm2_lpddr2_defconfig|   3 +-
 configs/mx6memcal_defconfig   |   3 +-
 configs/mx6qarm2_defconfig|   3 +-
 configs/mx6qarm2_lpddr2_defconfig |   3 +-
 configs/mx6qsabrelite_defconfig   |   3 +-
 configs/mx6sabreauto_defconfig|   1 +
 configs/mx6sabresd_defconfig  |   1 +
 configs/mx6slevk_defconfig|   1 +
 configs/mx6slevk_spinor_defconfig |   1 +
 configs/mx6slevk_spl_defconfig|   1 +
 configs/mx6sllevk_defconfig   |   1 +
 configs/mx6sllevk_plugin_defconfig|   1 +
 configs/mx6sxsabreauto_defconfig  |   1 +
 configs/mx6sxsabresd_defconfig|   1 +
 configs/mx6ul_14x14_evk_defconfig |   1 +
 configs/mx6ul_9x9_evk_defconfig   |   1 +
 configs/mx6ull_14x14_evk_defconfig|   1 +
 configs/mx6ull_14x14_evk_plugin_defconfig |   1 +
 configs/mx6ulz_14x14_evk_defconfig|   1 +
 configs/myir_mys_6ulx_defconfig   |   1 +
 configs/nitrogen6dl2g_defconfig   |   3 +-
 configs/nitrogen6dl_defconfig |   3 +-
 configs/nitrogen6q2g_defconfig|   3 +-
 configs/nitrogen6q_defconfig