soc: nxp_s32: consolidate part number options

Currently, the NXP S32 SoCs have three redundant Kconfig hidden
options to define the part number. To streamline this, we will
retain `CONFIG_SOC_PART_NUMBER` to store the part number as a
string and `CONFIG_SOC_PART_NUMBER_<part>` that can be selected
by the boards.

Furthermore, for drivers requiring conditional code compilation
based on the target SoC, they should utilize the series or SoC
config option as applicable, instead of the part number config.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This commit is contained in:
Manuel Argüelles 2023-11-14 20:45:38 +07:00 committed by Mahesh Mahadevan
commit 1a05cfc03a
6 changed files with 9 additions and 13 deletions

View file

@ -4,4 +4,4 @@
config BOARD_MR_CANHUBK3
bool "mr_canhubk3"
depends on SOC_SERIES_S32K3XX
select SOC_PART_NUMBER_S32K344
select SOC_PART_NUMBER_PS32K344EHVPBS

View file

@ -78,7 +78,7 @@ static inline struct net_if *get_iface(struct eth_nxp_s32_data *ctx, uint16_t vl
#endif
}
#if defined(CONFIG_SOC_PART_NUMBER_S32K3)
#if defined(CONFIG_SOC_SERIES_S32K3XX)
static int select_phy_interface(Gmac_Ip_MiiModeType mode)
{
uint32_t regval;
@ -105,7 +105,7 @@ static int select_phy_interface(Gmac_Ip_MiiModeType mode)
}
#else
#error "SoC not supported"
#endif /* CONFIG_SOC_PART_NUMBER_S32K3 */
#endif /* CONFIG_SOC_SERIES_S32K3XX */
static int eth_nxp_s32_init(const struct device *dev)
{

View file

@ -35,8 +35,4 @@ config NXP_S32_DEST_RESET_THRESHOLD
source "soc/arm/nxp_s32/*/Kconfig.soc"
config SOC_PART_NUMBER
default SOC_PART_NUMBER_S32ZE_R52 if SOC_SERIES_S32ZE_R52
default SOC_PART_NUMBER_S32K3 if SOC_SERIES_S32K3XX
endif # SOC_FAMILY_NXP_S32

View file

@ -71,7 +71,7 @@ static int nxp_s32_power_init(void)
};
const Power_Ip_PMC_ConfigType pmc_cfg = {
#ifdef CONFIG_SOC_PART_NUMBER_S32K3
#ifdef CONFIG_SOC_SERIES_S32K3XX
/* PMC Configuration Register (CONFIG) */
.ConfigRegister = PMC_CONFIG_LMEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMEN))
| PMC_CONFIG_LMBCTLEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMBCTLEN)),

View file

@ -14,12 +14,12 @@ endchoice
if SOC_SERIES_S32K3XX
config SOC_PART_NUMBER_S32K344
config SOC_PART_NUMBER_PS32K344EHVPBS
bool
config SOC_PART_NUMBER_S32K3
config SOC_PART_NUMBER
string
default "S32K344" if SOC_PART_NUMBER_S32K344
default "PS32K344EHVPBS" if SOC_PART_NUMBER_PS32K344EHVPBS
help
This string holds the full part number of the SoC. It is a hidden option
that you should not set directly. The part number selection choice defines

View file

@ -1,6 +1,6 @@
# NXP S32Z/E MCUs family
# Copyright 2022 NXP
# Copyright 2022-2023 NXP
# SPDX-License-Identifier: Apache-2.0
choice
@ -18,7 +18,7 @@ if SOC_SERIES_S32ZE_R52
config SOC_PART_NUMBER_S32Z27
bool
config SOC_PART_NUMBER_S32ZE_R52
config SOC_PART_NUMBER
string
default "S32Z27" if SOC_PART_NUMBER_S32Z27
help