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:
parent
8ca4f5b4a1
commit
1a05cfc03a
6 changed files with 9 additions and 13 deletions
|
@ -4,4 +4,4 @@
|
||||||
config BOARD_MR_CANHUBK3
|
config BOARD_MR_CANHUBK3
|
||||||
bool "mr_canhubk3"
|
bool "mr_canhubk3"
|
||||||
depends on SOC_SERIES_S32K3XX
|
depends on SOC_SERIES_S32K3XX
|
||||||
select SOC_PART_NUMBER_S32K344
|
select SOC_PART_NUMBER_PS32K344EHVPBS
|
||||||
|
|
|
@ -78,7 +78,7 @@ static inline struct net_if *get_iface(struct eth_nxp_s32_data *ctx, uint16_t vl
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_SOC_PART_NUMBER_S32K3)
|
#if defined(CONFIG_SOC_SERIES_S32K3XX)
|
||||||
static int select_phy_interface(Gmac_Ip_MiiModeType mode)
|
static int select_phy_interface(Gmac_Ip_MiiModeType mode)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
@ -105,7 +105,7 @@ static int select_phy_interface(Gmac_Ip_MiiModeType mode)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error "SoC not supported"
|
#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)
|
static int eth_nxp_s32_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,8 +35,4 @@ config NXP_S32_DEST_RESET_THRESHOLD
|
||||||
|
|
||||||
source "soc/arm/nxp_s32/*/Kconfig.soc"
|
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
|
endif # SOC_FAMILY_NXP_S32
|
||||||
|
|
|
@ -71,7 +71,7 @@ static int nxp_s32_power_init(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
const Power_Ip_PMC_ConfigType pmc_cfg = {
|
const Power_Ip_PMC_ConfigType pmc_cfg = {
|
||||||
#ifdef CONFIG_SOC_PART_NUMBER_S32K3
|
#ifdef CONFIG_SOC_SERIES_S32K3XX
|
||||||
/* PMC Configuration Register (CONFIG) */
|
/* PMC Configuration Register (CONFIG) */
|
||||||
.ConfigRegister = PMC_CONFIG_LMEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMEN))
|
.ConfigRegister = PMC_CONFIG_LMEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMEN))
|
||||||
| PMC_CONFIG_LMBCTLEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMBCTLEN)),
|
| PMC_CONFIG_LMBCTLEN(IS_ENABLED(CONFIG_NXP_S32_PMC_LMBCTLEN)),
|
||||||
|
|
|
@ -14,12 +14,12 @@ endchoice
|
||||||
|
|
||||||
if SOC_SERIES_S32K3XX
|
if SOC_SERIES_S32K3XX
|
||||||
|
|
||||||
config SOC_PART_NUMBER_S32K344
|
config SOC_PART_NUMBER_PS32K344EHVPBS
|
||||||
bool
|
bool
|
||||||
|
|
||||||
config SOC_PART_NUMBER_S32K3
|
config SOC_PART_NUMBER
|
||||||
string
|
string
|
||||||
default "S32K344" if SOC_PART_NUMBER_S32K344
|
default "PS32K344EHVPBS" if SOC_PART_NUMBER_PS32K344EHVPBS
|
||||||
help
|
help
|
||||||
This string holds the full part number of the SoC. It is a hidden option
|
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
|
that you should not set directly. The part number selection choice defines
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# NXP S32Z/E MCUs family
|
# NXP S32Z/E MCUs family
|
||||||
|
|
||||||
# Copyright 2022 NXP
|
# Copyright 2022-2023 NXP
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
choice
|
choice
|
||||||
|
@ -18,7 +18,7 @@ if SOC_SERIES_S32ZE_R52
|
||||||
config SOC_PART_NUMBER_S32Z27
|
config SOC_PART_NUMBER_S32Z27
|
||||||
bool
|
bool
|
||||||
|
|
||||||
config SOC_PART_NUMBER_S32ZE_R52
|
config SOC_PART_NUMBER
|
||||||
string
|
string
|
||||||
default "S32Z27" if SOC_PART_NUMBER_S32Z27
|
default "S32Z27" if SOC_PART_NUMBER_S32Z27
|
||||||
help
|
help
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue