From f3435b75efbfd7614ff873f8bfa90a031d6d27e8 Mon Sep 17 00:00:00 2001 From: David Leach Date: Wed, 4 Aug 2021 13:03:20 -0500 Subject: [PATCH] hal: nxp: Update to SDK 2.10.0 Updating to the SDK 2.10.0 for select platforms. west.yml: - Update to point to the NXP HAL update with SDK 2.10.0 files - modules/tee/tfm needed to be updated to synchronize the LPCXPRESSO55S69 platform SDK to version 2.10.0 to be in sync with Zephyr usage of SDK 2.10.0 drivers/counter/counter_mcux_pit.c: - underlying SDK 2.10.0 adjusted the setting by -1 so need to adjust the reported value set by +1 drivers/ethernet/eth_mcux.c: - SDK2.10 ethernet driver provided an assert test that highlighted we were using the wrong clock source on various platforms. drivers/memc/memc_mcux_flexspi.c: - SDK2.10 added compile time conditional on whether a field was defined for the flexspi configuration structure. Signed-off-by: David Leach --- drivers/counter/counter_mcux_pit.c | 9 ++++++++- drivers/ethernet/eth_mcux.c | 6 ++++++ drivers/memc/memc_mcux_flexspi.c | 3 +++ west.yml | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/counter/counter_mcux_pit.c b/drivers/counter/counter_mcux_pit.c index 22851dcdae1..4688cc89595 100644 --- a/drivers/counter/counter_mcux_pit.c +++ b/drivers/counter/counter_mcux_pit.c @@ -33,7 +33,14 @@ static uint32_t mcux_pit_get_top_value(const struct device *dev) const struct mcux_pit_config *config = dev->config; pit_chnl_t channel = config->pit_channel; - return config->base->CHANNEL[channel].LDVAL; + /* + * According to RM, the LDVAL trigger = clock ticks -1 + * The underlying HAL driver function PIT_SetTimerPeriod() + * automatically subtracted 1 from the value that ends up in + * LDVAL so for reporting purposes we need to add it back in + * here to by consistent. + */ + return (config->base->CHANNEL[channel].LDVAL + 1); } static int mcux_pit_start(const struct device *dev) diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index 4227d98e342..1b34aeaf66d 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -919,7 +919,13 @@ static void eth_mcux_init(const struct device *dev) context->phy_state = eth_mcux_phy_state_initial; +#if defined(CONFIG_SOC_SERIES_IMX_RT10XX) + sys_clock = CLOCK_GetFreq(kCLOCK_IpgClk); +#elif defined(SOC_SERIES_IMX_RT11XX) + sys_clock = CLOCK_GetFreq(kCLOCK_Root_Bus); +#else sys_clock = CLOCK_GetFreq(kCLOCK_CoreSysClk); +#endif ENET_GetDefaultConfig(&enet_config); enet_config.interrupt |= kENET_RxFrameInterrupt; diff --git a/drivers/memc/memc_mcux_flexspi.c b/drivers/memc/memc_mcux_flexspi.c index 60859749ce1..8691d1fcdc9 100644 --- a/drivers/memc/memc_mcux_flexspi.c +++ b/drivers/memc/memc_mcux_flexspi.c @@ -127,7 +127,10 @@ static int memc_flexspi_init(const struct device *dev) flexspi_config.ahbConfig.enableAHBCachable = config->ahb_cacheable; flexspi_config.ahbConfig.enableAHBPrefetch = config->ahb_prefetch; flexspi_config.ahbConfig.enableReadAddressOpt = config->ahb_read_addr_opt; +#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) && \ + FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) flexspi_config.enableCombination = config->combination_mode; +#endif flexspi_config.enableSckBDiffOpt = config->sck_differential_clock; flexspi_config.rxSampleClock = config->rx_sample_clock; diff --git a/west.yml b/west.yml index 7218940d182..ff4a9d6b12e 100644 --- a/west.yml +++ b/west.yml @@ -88,7 +88,7 @@ manifest: groups: - hal - name: hal_nxp - revision: 69c5db5d41f351d843326df0d133807910c8190b + revision: d7387dc67266f74e8d4dd6b908ec447dd2efc942 path: modules/hal/nxp groups: - hal @@ -212,7 +212,7 @@ manifest: - debug - name: trusted-firmware-m path: modules/tee/tfm - revision: 1ab3b62d641070a6e8574634168c374645f382b8 + revision: c74be3890c9d975976fde1b1a3b2f5742bec34c0 groups: - tee