Re: [PATCH] Spec hierarchy dumping for a config
On Wed, May 3, 2023 at 11:12 AM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Hello Philip, > > On 28.04.23 11:27, Philip Kirkpatrick wrote: > > I don't know if anyone else will find this useful or if it already > > exists and I duplicated some effort, but I find it difficult to just > > read the files in the spec folder and understand how they are connected > > and what files are used in BSPs I'm interested in. I looked through the > > wscript and didn't see an existing way to dump the item tree for a given > > configuration, so I added it. The patch is as follows: > > this looks like a useful addition. I would make it a new command, for > example "./waf viewspec". > > I originally didn't do it that way because I was having a hard time figuring out how to add a new command that could get the build context for the correct variant and I needed to move on. I had some time today to look into it again today and got it figured out. > > > --- > > diff --git a/wscript b/wscript > > index 567f42db2f..4e59188188 100755 > > --- a/wscript > > +++ b/wscript > > @@ -151,6 +151,61 @@ def _is_enabled(enabled, enabled_by): > > return _IS_ENABLED_OP[key](enabled, value) > > return enabled_by in enabled > > > > +color_true = '\x1b[32m' > > +color_false = '\x1b[31m' > > +color_clear = '\x1b[0m' > > + > > +def _get_enabler_op_and(enabled, enabled_by): > > +and_str = "{ " > > +first = True > > +for next_enabled_by in enabled_by: > > +if first: > > +first = False > > +else: > > +and_str = and_str + " and " > > +and_str = and_str + _get_enabler(enabled, next_enabled_by) > > +return and_str + " }" > > Can this be simplified to > > " and ".join(_get_enabler(enabled, next_enabled_by) for next_enabled_by > in enabled_by) > > ? > Yes, it can! Thinking as a C programmer, I had no idea python could do that. "_get_enabler_op_or" can (and has been) also be reduced. > > + > > + > > +def _get_enabler_op_not(enabled, enabled_by): > > +return "{ " + color_true + "not " + color_false + > > _get_enabler(enabled, enabled_by) + color_clear + " }" > > + > > + > > +def _get_enabler_op_or(enabled, enabled_by): > > +or_str = "{ " > > +first = True > > +for next_enabled_by in enabled_by: > > +if first: > > +first = False > > +else: > > +or_str = or_str + " or " > > +if _is_enabled(enabled, next_enabled_by): > > +color_start = color_true > > +color_end = color_clear > > +else: > > +color_start = color_false > > +color_end = color_clear > > +or_str = or_str + color_start + _get_enabler(enabled, > > next_enabled_by) + color_end > > +return or_str + " }" > > + > > + > > +_GET_ENABLER_OP = { > > +"and": _get_enabler_op_and, > > +"not": _get_enabler_op_not, > > +"or": _get_enabler_op_or, > > +} > > + > > + > > +def _get_enabler(enabled, enabled_by): > > +if isinstance(enabled_by, bool): > > +return color_true + str(enabled_by) + color_clear > > +if isinstance(enabled_by, list): > > +return _get_enabler_op_or(enabled, enabled_by) > > +if isinstance(enabled_by, dict): > > +key, value = next(iter(enabled_by.items())) > > +return _GET_ENABLER_OP[key](enabled, value) > > +return enabled_by > > + > > > > def _asm_explicit_target(self, node): > > task = self.create_task("asm", node, > > @@ -233,6 +288,14 @@ class Item(object): > > "Build error related to item spec:{}: {}".format( > > self.uid, str(e))) > > > > + > > +def dump_spec(self, bld, bic, depth): > > +if _is_enabled(bld.env.ENABLE, self.get_enabled_by()): > > +enabler = _get_enabler(bld.env.ENABLE, > self.get_enabled_by()) > > +print("│ " * depth + "├──" + self.uid + " # enabled-by: " > > + enabler) > > +for p in self.links(): > > +p.dump_spec(bld, bic, depth + 1) > > + > > def do_defaults(self, enabled): > > return > > > > @@ -1320,6 +1383,14 @@ def options(ctx): > > help= > > "sets the option identified by KEY to the VALUE in the build > > specification; it is intended for RTEMS maintainers and may be used in > > the bspdefaults and configure commands", > > ) > > +rg.add_option( > > +"--rtems-dumpspec", > > +action="store_true", > > +dest="rtems_dump_spec", > > +default=False, > > +help= > > +"dumps the currently enable spec yaml files and the links tree; > > it is intended for RTEMS maintainers and may be used in the build > commands", > > +) > > > > > > def check_environment(conf): > > @@ -1587,8 +1658,14 @@ def build(bld): > > long_command_line_workaround(bld) > > bic = BuildItemContext(bld.env.ARCH_INCLUDES.split(), [], [], [], > > [], [], > > [])
[PATCH rtems v2 01/12] bsp/imxrt: Update support library from mcux-sdk
This imports new files from the mcux-sdk support library. NXP now offers the library as a git repository instead of a zip package. The git repository supports multiple CPUs from the i.MXRT family: https://github.com/nxp-mcuxpresso/mcux-sdk.git The imported files are from revision 2b9354539e6e4f722749e87b0bdc22966dc080d9 This revision is the same as MCUXpresso 2.13.0 with small bug fixes. For importing the files, a script has been used, that parses the mcux-sdk cmake files and creates the yaml files for RTEMS: https://raw.githubusercontent.com/c-mauderer/nxp-mcux-sdk/d21c3e61eb8602b2cf8f45fed0afa50c6aee932f/export_to_RTEMS.py NOTE: Due to the size, this is only the summary of the patch. You can find the full version here: https://gitlab.com/c-mauderer/rtems/-/commit/db46669083517749fea88b3440dbfc71adf6347c --- .../mcux-sdk/devices/MIMXRT1052/MIMXRT1052.h | 53558 + .../devices/MIMXRT1052/MIMXRT1052_features.h | 785 + .../devices/MIMXRT1052/drivers/fsl_clock.c| 1535 + .../devices/MIMXRT1052/drivers/fsl_clock.h| 2038 + .../MIMXRT1052/drivers/fsl_flexram_allocate.c |86 + .../MIMXRT1052/drivers/fsl_flexram_allocate.h |87 + .../devices/MIMXRT1052/drivers/fsl_iomuxc.h | 1241 + .../devices/MIMXRT1052/drivers/fsl_nic301.h | 308 + .../devices/MIMXRT1052/drivers/fsl_romapi.c | 162 + .../devices/MIMXRT1052/drivers/fsl_romapi.h | 565 + .../devices/MIMXRT1052/fsl_device_registers.h |36 + .../MIMXRT1052/gcc/startup_MIMXRT1052.S | 1077 + .../devices/MIMXRT1052/system_MIMXRT1052.c| 242 + .../devices/MIMXRT1052/system_MIMXRT1052.h| 131 + .../MIMXRT1052/xip/fsl_flexspi_nor_boot.c |49 + .../MIMXRT1052/xip/fsl_flexspi_nor_boot.h | 124 + .../devices/MIMXRT1166/MIMXRT1166_cm4.h | 93964 .../MIMXRT1166/MIMXRT1166_cm4_features.h | 903 + .../devices/MIMXRT1166/MIMXRT1166_cm7.h | 93031 +++ .../MIMXRT1166/MIMXRT1166_cm7_features.h | 890 + .../MIMXRT1166/drivers/cm4/fsl_cache.c| 507 + .../MIMXRT1166/drivers/cm4/fsl_cache.h| 340 + .../MIMXRT1166/drivers/cm7/fsl_cache.c| 602 + .../MIMXRT1166/drivers/cm7/fsl_cache.h| 463 + .../MIMXRT1166/drivers/fsl_anatop_ai.c| 357 + .../MIMXRT1166/drivers/fsl_anatop_ai.h| 533 + .../devices/MIMXRT1166/drivers/fsl_clock.c| 1929 + .../devices/MIMXRT1166/drivers/fsl_clock.h| 3308 + .../devices/MIMXRT1166/drivers/fsl_dcdc.c | 518 + .../devices/MIMXRT1166/drivers/fsl_dcdc.h | 1013 + .../MIMXRT1166/drivers/fsl_flexram_allocate.c |92 + .../MIMXRT1166/drivers/fsl_flexram_allocate.h |87 + .../devices/MIMXRT1166/drivers/fsl_gpc.c | 335 + .../devices/MIMXRT1166/drivers/fsl_gpc.h | 651 + .../devices/MIMXRT1166/drivers/fsl_iomuxc.h | 1770 + .../devices/MIMXRT1166/drivers/fsl_memory.h |89 + .../devices/MIMXRT1166/drivers/fsl_nic301.h | 293 + .../devices/MIMXRT1166/drivers/fsl_pgmc.c | 461 + .../devices/MIMXRT1166/drivers/fsl_pgmc.h | 783 + .../devices/MIMXRT1166/drivers/fsl_pmu.c | 959 + .../devices/MIMXRT1166/drivers/fsl_pmu.h | 855 + .../devices/MIMXRT1166/drivers/fsl_romapi.c | 250 + .../devices/MIMXRT1166/drivers/fsl_romapi.h | 724 + .../MIMXRT1166/drivers/fsl_soc_mipi_csi2rx.c |71 + .../MIMXRT1166/drivers/fsl_soc_mipi_csi2rx.h |66 + .../devices/MIMXRT1166/drivers/fsl_soc_src.c | 183 + .../devices/MIMXRT1166/drivers/fsl_soc_src.h | 754 + .../devices/MIMXRT1166/fsl_device_registers.h |44 + .../MIMXRT1166/gcc/startup_MIMXRT1166_cm4.S | 1421 + .../MIMXRT1166/gcc/startup_MIMXRT1166_cm7.S | 1421 + .../MIMXRT1166/system_MIMXRT1166_cm4.c| 176 + .../MIMXRT1166/system_MIMXRT1166_cm4.h| 118 + .../MIMXRT1166/system_MIMXRT1166_cm7.c| 159 + .../MIMXRT1166/system_MIMXRT1166_cm7.h| 118 + .../MIMXRT1166/xip/fsl_flexspi_nor_boot.c |49 + .../MIMXRT1166/xip/fsl_flexspi_nor_boot.h | 149 + .../imxrt/mcux-sdk/drivers/acmp/fsl_acmp.c| 662 + .../imxrt/mcux-sdk/drivers/acmp/fsl_acmp.h| 536 + .../drivers/adc_12b1msps_sar/fsl_adc.c| 395 + .../drivers/adc_12b1msps_sar/fsl_adc.h| 427 + .../mcux-sdk/drivers/adc_etc/fsl_adc_etc.c| 464 + .../mcux-sdk/drivers/adc_etc/fsl_adc_etc.h| 352 + bsps/arm/imxrt/mcux-sdk/drivers/aoi/fsl_aoi.c | 214 + bsps/arm/imxrt/mcux-sdk/drivers/aoi/fsl_aoi.h | 186 + .../imxrt/mcux-sdk/drivers/asrc/fsl_asrc.c| 1031 + .../imxrt/mcux-sdk/drivers/asrc/fsl_asrc.h| 761 + .../mcux-sdk/drivers/asrc/fsl_asrc_edma.c | 470 + .../mcux-sdk/drivers/asrc/fsl_asrc_edma.h | 245 + bsps/arm/imxrt/mcux-sdk/drivers/bee/fsl_bee.c | 303 + bsps/arm/imxrt/mcux-sdk/drivers/bee/fsl_bee.h | 254 + .../drivers/cache/armv7-m7/fsl_cache.c| 602 + .../drivers/cache/armv7-m7/fsl_cache.h| 463 +
[PATCH rtems v2 02/12] bsps/imxrt: (Re-)Apply RTEMS patches to new lib
Reapply patches used in the old version of the NXP library and apply patches necessary for the new version of the library. --- .../devices/MIMXRT1052/fsl_device_registers.h | 3 + .../MIMXRT1052/xip/fsl_flexspi_nor_boot.h | 4 + .../devices/MIMXRT1166/fsl_device_registers.h | 3 + .../MIMXRT1166/xip/fsl_flexspi_nor_boot.h | 4 + .../mcux-sdk/drivers/common/fsl_common.h | 310 ++ .../mcux-sdk/drivers/lpuart/fsl_lpuart.c | 17 + .../mcux-sdk/drivers/lpuart/fsl_lpuart.h | 4 + .../imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c | 40 +++ .../imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.h | 34 ++ 9 files changed, 419 insertions(+) diff --git a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/fsl_device_registers.h b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/fsl_device_registers.h index 54caf43ca6..35e988f1b3 100644 --- a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/fsl_device_registers.h +++ b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/fsl_device_registers.h @@ -10,6 +10,9 @@ #ifndef __FSL_DEVICE_REGISTERS_H__ #define __FSL_DEVICE_REGISTERS_H__ +#ifdef __rtems__ +#include +#endif /* __rtems__ */ /* * Include the cpu specific register header files. * diff --git a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h index 38d5d1833e..5f81090890 100644 --- a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h +++ b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h @@ -10,9 +10,11 @@ #include #include "fsl_common.h" +#ifndef __rtems__ #ifndef BOARD_FLASH_SIZE #include "board.h" #endif +#endif /* __rtems__ */ /*! @name Driver version */ /*@{*/ @@ -108,11 +110,13 @@ typedef struct _boot_data_ #define FLASH_BASE FlexSPI_AMBA_BASE #endif +#ifndef __rtems__ #if defined(BOARD_FLASH_SIZE) #define FLASH_SIZE BOARD_FLASH_SIZE #else #error "Please define macro BOARD_FLASH_SIZE" #endif +#endif /* __rtems__ */ #define PLUGIN_FLAG (uint32_t)0 /* External Variables */ diff --git a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/fsl_device_registers.h b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/fsl_device_registers.h index a2a9ae8c82..4508d6634f 100644 --- a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/fsl_device_registers.h +++ b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/fsl_device_registers.h @@ -10,6 +10,9 @@ #ifndef __FSL_DEVICE_REGISTERS_H__ #define __FSL_DEVICE_REGISTERS_H__ +#ifdef __rtems__ +#include +#endif /* __rtems__ */ /* * Include the cpu specific register header files. * diff --git a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/xip/fsl_flexspi_nor_boot.h b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/xip/fsl_flexspi_nor_boot.h index 6aeb096486..16c0c0a6be 100644 --- a/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/xip/fsl_flexspi_nor_boot.h +++ b/bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1166/xip/fsl_flexspi_nor_boot.h @@ -10,9 +10,11 @@ #include #include "fsl_common.h" +#ifndef __rtems__ #ifndef BOARD_FLASH_SIZE #include "board.h" #endif +#endif /* __rtems__ */ /*! @name Driver version */ /*@{*/ @@ -133,11 +135,13 @@ typedef struct _boot_data_ #define FLASH_BASE FlexSPI1_ALIAS_BASE #endif +#ifndef __rtems__ #if defined(BOARD_FLASH_SIZE) #define FLASH_SIZE BOARD_FLASH_SIZE #else #error "Please define macro BOARD_FLASH_SIZE" #endif +#endif /* __rtems__ */ #define PLUGIN_FLAG (uint32_t)0 /* External Variables */ diff --git a/bsps/arm/imxrt/mcux-sdk/drivers/common/fsl_common.h b/bsps/arm/imxrt/mcux-sdk/drivers/common/fsl_common.h index 84c7f9d2f0..17eaadb84d 100644 --- a/bsps/arm/imxrt/mcux-sdk/drivers/common/fsl_common.h +++ b/bsps/arm/imxrt/mcux-sdk/drivers/common/fsl_common.h @@ -21,6 +21,10 @@ #include "fsl_device_registers.h" +#ifdef __rtems__ +/* Usually provided by modern CMSIS */ +#define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline +#endif /* __rtems__ */ /*! * @addtogroup ksdk_common * @{ @@ -314,6 +318,312 @@ void SDK_Free(void *ptr); */ void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz); +#ifdef __rtems__ +/* Prototypes for IRQHandlers */ +void ADMA_FLEXCAN0_INT_DriverIRQHandler(void); +void ADMA_FLEXCAN1_INT_DriverIRQHandler(void); +void ADMA_FLEXCAN2_INT_DriverIRQHandler(void); +void ADMA_I2C0_INT_DriverIRQHandler(void); +void ADMA_I2C1_INT_DriverIRQHandler(void); +void ADMA_I2C2_INT_DriverIRQHandler(void); +void ADMA_I2C3_INT_DriverIRQHandler(void); +void ADMA_I2C4_INT_DriverIRQHandler(void); +void ADMA_SAI0_INT_DriverIRQHandler(void); +void ADMA_SAI1_INT_DriverIRQHandler(void); +void ADMA_SAI2_INT_DriverIRQHandler(void); +void ADMA_SAI3_INT_DriverIRQHandler(void); +void ADMA_SAI4_INT_DriverIRQHandler(void); +void ADMA_SAI5_INT_DriverIRQHandler(void); +void ADMA_SPI0_INT_DriverIRQHandler(void); +void ADMA_SPI1_INT_DriverIRQHandler(void); +void ADMA_SPI2_INT_DriverIRQHandler(void); +void ADMA_SPI3_INT_DriverIRQHandler(void);
[PATCH rtems v2 12/12] imx_iomux: Don't set reserved bits in PAD_CTL
On most i.MX* the upper bits in SW_PAD_CTL are reserved. On some chips, like the i.MXRT1166, they are a domain write protection. Setting them to 1 can have unexpected side effects. The device tree uses these bits for some flags. Make sure that they are not accidentally written to some value. --- bsps/arm/shared/pins/imx_iomux.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/bsps/arm/shared/pins/imx_iomux.c b/bsps/arm/shared/pins/imx_iomux.c index 1ff4186360..e6c604481a 100644 --- a/bsps/arm/shared/pins/imx_iomux.c +++ b/bsps/arm/shared/pins/imx_iomux.c @@ -307,7 +307,17 @@ int imx_iomux_configure_pins(const void *fdt, uint32_t cfgxref) WR4(sc, cfg->mux_reg, cfg->mux_val | sion); iomux_configure_input(sc, cfg->input_reg, cfg->input_val); if ((cfg->padconf_val & PADCONF_NONE) == 0) +#ifndef __rtems__ WR4(sc, cfg->padconf_reg, cfg->padconf_val); +#else /* __rtems__ */ + /* +* Need to mask the flags. On (for example) i.MXRT1166 +* they are used for domain write protection. On other +* i.MX* these are Reserved. +*/ + WR4(sc, cfg->padconf_reg, cfg->padconf_val + & ~(PADCONF_SION | PADCONF_NONE)); +#endif /* __rtems__ */ #ifndef __rtems__ if (bootverbose) { char name[32]; -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 05/12] bsps/imxrt: Get clock for IMXRT11xx in drivers
The mcux_sdk has a different interface for getting the clock for IMXRT11xx than for getting it in IMXRT10xx. Adapt simple drivers to support that interface. --- bsps/arm/imxrt/console/console.c | 35 +-- bsps/arm/imxrt/i2c/imxrt-lpi2c.c | 18 -- .../imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c | 8 + bsps/arm/imxrt/spi/imxrt-lpspi.c | 18 -- 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/bsps/arm/imxrt/console/console.c b/bsps/arm/imxrt/console/console.c index 05320f2c4c..e3f6a091c6 100644 --- a/bsps/arm/imxrt/console/console.c +++ b/bsps/arm/imxrt/console/console.c @@ -53,6 +53,7 @@ typedef struct { volatile LPUART_Type *regs; rtems_vector_number irq; const char *path; + clock_ip_name_t clock_ip; uint32_t src_clock_hz; lpuart_config_t config; } imxrt_lpuart_context; @@ -174,12 +175,15 @@ static bool imxrt_lpuart_set_attributes( return true; } -static uint32_t imxrt_lpuart_get_src_freq(void) +static uint32_t imxrt_lpuart_get_src_freq(clock_ip_name_t clock_ip) { uint32_t freq; +#if IMXRT_IS_MIMXRT10xx uint32_t mux; uint32_t divider; + (void) clock_ip; /* Not necessary for i.MXRT1050 */ + mux = CLOCK_GetMux(kCLOCK_UartMux); divider = 1; @@ -197,10 +201,36 @@ static uint32_t imxrt_lpuart_get_src_freq(void) divider *= CLOCK_GetDiv(kCLOCK_UartDiv) + 1U; freq /= divider; +#elif IMXRT_IS_MIMXRT11xx + /* + * FIXME: A future version of the mcux_sdk might provide a better method to + * get the clock instead of this hack. + */ + clock_root_t clock_root = clock_ip + kCLOCK_Root_Lpuart1 - kCLOCK_Lpuart1; + + freq = CLOCK_GetRootClockFreq(clock_root); +#else + #error Getting UART clock frequency is not implemented for this chip +#endif return freq; } +static clock_ip_name_t imxrt_lpuart_clock_ip(volatile LPUART_Type *regs) +{ + LPUART_Type *const base_addresses[] = LPUART_BASE_PTRS; + static const clock_ip_name_t lpuart_clocks[] = LPUART_CLOCKS; + size_t i; + + for (i = 0; i < RTEMS_ARRAY_SIZE(base_addresses); ++i) { +if (base_addresses[i] == regs) { + return lpuart_clocks[i]; +} + } + + return kCLOCK_IpInvalid; +} + static void imxrt_lpuart_init_hardware(imxrt_lpuart_context *ctx) { (void) LPUART_Init((LPUART_Type *)ctx->regs, >config, @@ -378,7 +408,8 @@ static void imxrt_lpuart_init_context_from_fdt( bsp_fatal(IMXRT_FATAL_LPI2C_INVALID_FDT); } - ctx->src_clock_hz = imxrt_lpuart_get_src_freq(); + ctx->clock_ip = imxrt_lpuart_clock_ip(ctx->regs); + ctx->src_clock_hz = imxrt_lpuart_get_src_freq(ctx->clock_ip); LPUART_GetDefaultConfig(>config); ctx->config.enableTx = true; diff --git a/bsps/arm/imxrt/i2c/imxrt-lpi2c.c b/bsps/arm/imxrt/i2c/imxrt-lpi2c.c index 783c6e18e6..d3aebc45e0 100644 --- a/bsps/arm/imxrt/i2c/imxrt-lpi2c.c +++ b/bsps/arm/imxrt/i2c/imxrt-lpi2c.c @@ -373,12 +373,15 @@ static int imxrt_lpi2c_hw_init(struct imxrt_lpi2c_bus *bus) return 0; } -static uint32_t imxrt_lpi2c_get_src_freq(void) +static uint32_t imxrt_lpi2c_get_src_freq(clock_ip_name_t clock_ip) { uint32_t freq; +#if IMXRT_IS_MIMXRT10xx uint32_t mux; uint32_t divider; + (void) clock_ip; /* Not necessary for i.MXRT1050 */ + mux = CLOCK_GetMux(kCLOCK_Lpi2cMux); divider = 1; @@ -396,6 +399,17 @@ static uint32_t imxrt_lpi2c_get_src_freq(void) divider *= CLOCK_GetDiv(kCLOCK_Lpi2cDiv) + 1; freq /= divider; +#elif IMXRT_IS_MIMXRT11xx + /* + * FIXME: A future version of the mcux_sdk might provide a better method to + * get the clock instead of this hack. + */ + clock_root_t clock_root = clock_ip + kCLOCK_Root_Lpi2c1 - kCLOCK_Lpi2c1; + + freq = CLOCK_GetRootClockFreq(clock_root); +#else + #error Getting I2C frequency is not implemented for this chip. +#endif return freq; } @@ -457,7 +471,7 @@ void imxrt_lpi2c_init(void) } bus->clock_ip = imxrt_lpi2c_clock_ip(bus->regs); - bus->src_clock_hz = imxrt_lpi2c_get_src_freq(); + bus->src_clock_hz = imxrt_lpi2c_get_src_freq(bus->clock_ip); eno = imxrt_lpi2c_hw_init(bus); if (eno != 0) { diff --git a/bsps/arm/imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c b/bsps/arm/imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c index a4e393896b..4c8bd71be5 100644 --- a/bsps/arm/imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c +++ b/bsps/arm/imxrt/mcux-sdk/drivers/qtmr_1/fsl_qtmr.c @@ -92,9 +92,17 @@ rtems_vector_number QTMR_get_IRQ_from_fdt(const void *fdt, int node) uint32_t QTMR_get_src_clk(TMR_Type *base) { +#if IMXRT_IS_MIMXRT10xx (void) base; return CLOCK_GetFreq(kCLOCK_IpgClk); +#elif IMXRT_IS_MIMXRT11xx +(void) base; + +return CLOCK_GetRootClockMux(kCLOCK_Root_Bus); +#else + #error Getting Timer clock frequency is not implemented for this chip +#endif } #endif /* __rtems__ */ diff --git a/bsps/arm/imxrt/spi/imxrt-lpspi.c b/bsps/arm/imxrt/spi/imxrt-lpspi.c index 80b47f9663..62503e4bd8 100644 ---
[PATCH rtems v2 08/12] bsps/imxrt: Support more chip variants in header
The different variants of the i.MXRT have some minimal differences in the fsl_flexspi_nor_config.h. Make sure that the header supports the different chips. --- .../imxrt/include/fsl_flexspi_nor_config.h| 49 +++ 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/bsps/arm/imxrt/include/fsl_flexspi_nor_config.h b/bsps/arm/imxrt/include/fsl_flexspi_nor_config.h index 4a2a158f50..541eb7e68a 100644 --- a/bsps/arm/imxrt/include/fsl_flexspi_nor_config.h +++ b/bsps/arm/imxrt/include/fsl_flexspi_nor_config.h @@ -1,13 +1,14 @@ /* - * Copyright (c) 2016, Freescale Semiconductor, Inc. - * Copyright 2016-2017 NXP + * Copyright 2017-2020 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause + * + * Based on file for EVKBIMSRT1050 with values for other EVKs integrated. */ -#ifndef __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__ -#define __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__ +#ifndef __FSL_FLEXSPI_NOR_CONFIG__ +#define __FSL_FLEXSPI_NOR_CONFIG__ #include #include @@ -15,8 +16,8 @@ /*! @name Driver version */ /*@{*/ -/*! @brief XIP_BOARD driver version 2.0.0. */ -#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) +/*! @brief XIP_BOARD driver version 2.0.1. */ +#define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) /*@}*/ /* FLEXSPI memory config block related defintions */ @@ -82,11 +83,39 @@ typedef enum _FlexSpiSerialClockFreq kFlexSpiSerialClk_30MHz = 1, kFlexSpiSerialClk_50MHz = 2, kFlexSpiSerialClk_60MHz = 3, +#if defined(MIMXRT1011_SERIES) +kFlexSpiSerialClk_75MHz = 4, +kFlexSpiSerialClk_80MHz = 5, +kFlexSpiSerialClk_100MHz = 6, +kFlexSpiSerialClk_120MHz = 7, +kFlexSpiSerialClk_133MHz = 8, +#elif defined(MIMXRT1015_SERIES) || defined(MIMXRT1021_SERIES) || defined(MIMXRT1024_SERIES) +kFlexSpiSerialClk_75MHz = 4, +kFlexSpiSerialClk_80MHz = 5, +kFlexSpiSerialClk_100MHz = 6, +kFlexSpiSerialClk_133MHz = 7, +#elif defined(MIMXRT1052_SERIES) kFlexSpiSerialClk_75MHz = 4, kFlexSpiSerialClk_80MHz = 5, kFlexSpiSerialClk_100MHz = 6, kFlexSpiSerialClk_133MHz = 7, kFlexSpiSerialClk_166MHz = 8, +#elif defined(MIMXRT1042_SERIES) || defined(MIMXRT1062_SERIES) || defined(MIMXRT1064_SERIES) +kFlexSpiSerialClk_75MHz = 4, +kFlexSpiSerialClk_80MHz = 5, +kFlexSpiSerialClk_100MHz = 6, +kFlexSpiSerialClk_120MHz = 7, +kFlexSpiSerialClk_133MHz = 8, +kFlexSpiSerialClk_166MHz = 9, +#elif defined(MIMXRT1166_cm4_SERIES) || defined(MIMXRT1166_cm7_SERIES) || \ + defined(MIMXRT1176_cm4_SERIES) || defined(MIMXRT1176_cm7_SERIES) +kFlexSpiSerialClk_80MHz = 4, +kFlexSpiSerialClk_100MHz = 5, +kFlexSpiSerialClk_120MHz = 6, +kFlexSpiSerialClk_133MHz = 7, +kFlexSpiSerialClk_166MHz = 8, +kFlexSpiSerialClk_200MHz = 9, +#endif } flexspi_serial_clk_freq_t; //!@brief FlexSPI clock configuration type @@ -249,13 +278,15 @@ typedef struct _flexspi_nor_config uint32_t sectorSize;//!< Sector size of Serial NOR uint8_t ipcmdSerialClkFreq; //!< Clock frequency for IP command uint8_t isUniformBlockSize; //!< Sector/Block size is the same -uint8_t reserved0[2]; //!< Reserved for future use +uint8_t isDataOrderSwapped; //!< The data order is swapped in OPI DDR mode (only i.MXRT11*) +uint8_t reserved0; //!< Reserved for future use uint8_t serialNorType; //!< Serial NOR Flash type: 0/1/2/3 uint8_t needExitNoCmdMode; //!< Need to exit NoCmd mode before other IP command uint8_t halfClkForNonReadCmd; //!< Half the Serial Clock for non-read command: true/false uint8_t needRestoreNoCmdMode; //!< Need to Restore NoCmd mode after IP commmand execution uint32_t blockSize; //!< Block size -uint32_t reserve2[11]; //!< Reserved for future use +uint32_t FlashStateCtx; //!< Flash State Context after being configured (only i.MXRT11*) +uint32_t reserve2[10]; //!< Reserved for future use } flexspi_nor_config_t; #ifdef __cplusplus @@ -265,4 +296,4 @@ extern "C" { #ifdef __cplusplus } #endif -#endif /* __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__ */ +#endif /* __FSL_FLEXSPI_NOR_CONFIG__ */ -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 07/12] bsps/imxrt: Remove unmaintained defines
The defines for the different clock frequencies in the fsl_clock_config.h do not represent the clock frequencies that have been set up in the registers. Remove them to avoid someone trusting in correct values. --- bsps/arm/imxrt/include/fsl_clock_config.h | 58 +-- .../nxp/boards/evkbimxrt1050/clock_config.c | 2 +- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/bsps/arm/imxrt/include/fsl_clock_config.h b/bsps/arm/imxrt/include/fsl_clock_config.h index f213ac7e23..5c09daf59d 100644 --- a/bsps/arm/imxrt/include/fsl_clock_config.h +++ b/bsps/arm/imxrt/include/fsl_clock_config.h @@ -8,6 +8,7 @@ #ifndef _CLOCK_CONFIG_H_ #define _CLOCK_CONFIG_H_ +#include #include "fsl_common.h" /*** @@ -34,61 +35,7 @@ void BOARD_InitBootClocks(void); } #endif /* __cplusplus*/ -/*** - ** Configuration BOARD_BootClockRUN *** - **/ -/*** - * Definitions for BOARD_BootClockRUN configuration - **/ -#define BOARD_BOOTCLOCKRUN_CORE_CLOCK 6U /*!< Core clock frequency: 6Hz */ - -/* Clock outputs (values are in Hz): */ -#define BOARD_BOOTCLOCKRUN_AHB_CLK_ROOT 6UL -#define BOARD_BOOTCLOCKRUN_CAN_CLK_ROOT 4000UL -#define BOARD_BOOTCLOCKRUN_CKIL_SYNC_CLK_ROOT 32768UL -#define BOARD_BOOTCLOCKRUN_CLKO1_CLK 0UL -#define BOARD_BOOTCLOCKRUN_CLKO2_CLK 0UL -#define BOARD_BOOTCLOCKRUN_CLK_1M 100UL -#define BOARD_BOOTCLOCKRUN_CLK_24M 2400UL -#define BOARD_BOOTCLOCKRUN_CSI_CLK_ROOT 1200UL -#define BOARD_BOOTCLOCKRUN_ENET1_TX_CLK 240UL -#define BOARD_BOOTCLOCKRUN_ENET_125M_CLK 240UL -#define BOARD_BOOTCLOCKRUN_ENET_25M_REF_CLK 120UL -#define BOARD_BOOTCLOCKRUN_FLEXIO1_CLK_ROOT 3000UL -#define BOARD_BOOTCLOCKRUN_FLEXIO2_CLK_ROOT 3000UL -#define BOARD_BOOTCLOCKRUN_FLEXSPI_CLK_ROOT 16000UL -#define BOARD_BOOTCLOCKRUN_GPT1_IPG_CLK_HIGHFREQ 7500UL -#define BOARD_BOOTCLOCKRUN_GPT2_IPG_CLK_HIGHFREQ 7500UL -#define BOARD_BOOTCLOCKRUN_IPG_CLK_ROOT 15000UL -#define BOARD_BOOTCLOCKRUN_LCDIF_CLK_ROOT 9642857UL -#define BOARD_BOOTCLOCKRUN_LPI2C_CLK_ROOT 6000UL -#define BOARD_BOOTCLOCKRUN_LPSPI_CLK_ROOT 10560UL -#define BOARD_BOOTCLOCKRUN_LVDS1_CLK 12UL -#define BOARD_BOOTCLOCKRUN_MQS_MCLK 63529411UL -#define BOARD_BOOTCLOCKRUN_PERCLK_CLK_ROOT 7500UL -#define BOARD_BOOTCLOCKRUN_PLL7_MAIN_CLK 2400UL -#define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK2 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI1_MCLK3 3000UL -#define BOARD_BOOTCLOCKRUN_SAI2_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK2 0UL -#define BOARD_BOOTCLOCKRUN_SAI2_MCLK3 3000UL -#define BOARD_BOOTCLOCKRUN_SAI3_CLK_ROOT 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK1 63529411UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK2 0UL -#define BOARD_BOOTCLOCKRUN_SAI3_MCLK3 3000UL -#define BOARD_BOOTCLOCKRUN_SEMC_CLK_ROOT 7500UL -#define BOARD_BOOTCLOCKRUN_SPDIF0_CLK_ROOT 3000UL -#define BOARD_BOOTCLOCKRUN_SPDIF0_EXTCLK_OUT 0UL -#define BOARD_BOOTCLOCKRUN_TRACE_CLK_ROOT 11733UL -#define BOARD_BOOTCLOCKRUN_UART_CLK_ROOT 8000UL -#define BOARD_BOOTCLOCKRUN_USBPHY1_CLK 0UL -#define BOARD_BOOTCLOCKRUN_USBPHY2_CLK 0UL -#define BOARD_BOOTCLOCKRUN_USDHC1_CLK_ROOT 19800UL -#define BOARD_BOOTCLOCKRUN_USDHC2_CLK_ROOT 19800UL - +#if IMXRT_IS_MIMXRT10xx /*! @brief Arm PLL set for BOARD_BootClockRUN configuration. */ extern const clock_arm_pll_config_t armPllConfig_BOARD_BootClockRUN; @@ -98,6 +45,7 @@ extern const clock_usb_pll_config_t usb1PllConfig_BOARD_BootClockRUN; /*! @brief Sys PLL for BOARD_BootClockRUN configuration. */ extern const clock_sys_pll_config_t sysPllConfig_BOARD_BootClockRUN; +#endif /*** * API for BOARD_BootClockRUN configuration diff --git a/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c b/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c index 4ab5216ee1..8f6980d0ef 100644 --- a/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c +++ b/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c @@ -487,5 +487,5 @@ void BOARD_BootClockRUN(void) /* Set GPT2 High frequency reference clock source. */ IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK; /* Set SystemCoreClock variable. */ -SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; +SystemCoreClock = 6U; } -- 2.35.3 ___
[PATCH rtems v2 03/12] bsps/imxrt: Adapt to new mcux-sdk version
Remove the old NXP MCUXpresso SDK and adapt the BSP so that it uses the new mcux-sdk. NOTE: Due to the size, this is only the summary of the patch. You can find the full version here: https://gitlab.com/c-mauderer/rtems/-/commit/2c979bc53bdf633b1fdabc7c5ecf2b1d90a85ac6 --- bsps/arm/imxrt/include/MIMXRT1052.h | 46183 bsps/arm/imxrt/include/MIMXRT1052_features.h | 688 - bsps/arm/imxrt/include/bsp.h | 1 + bsps/arm/imxrt/include/chip.h | 3 +- bsps/arm/imxrt/include/fsl_adc.h | 427 - bsps/arm/imxrt/include/fsl_adc_etc.h | 336 - bsps/arm/imxrt/include/fsl_aipstz.h | 134 - bsps/arm/imxrt/include/fsl_aoi.h | 186 - bsps/arm/imxrt/include/fsl_bee.h | 254 - bsps/arm/imxrt/include/fsl_cache.h| 457 - bsps/arm/imxrt/include/fsl_clock.h| 1550 - bsps/arm/imxrt/include/fsl_cmp.h | 321 - bsps/arm/imxrt/include/fsl_common.h | 967 - bsps/arm/imxrt/include/fsl_csi.h | 724 - bsps/arm/imxrt/include/fsl_dcdc.h | 496 - bsps/arm/imxrt/include/fsl_dcp.h | 569 - bsps/arm/imxrt/include/fsl_device_registers.h |41 - bsps/arm/imxrt/include/fsl_dmamux.h | 177 - bsps/arm/imxrt/include/fsl_edma.h | 951 - bsps/arm/imxrt/include/fsl_elcdif.h | 747 - bsps/arm/imxrt/include/fsl_enc.h | 458 - bsps/arm/imxrt/include/fsl_enet.h | 1855 - bsps/arm/imxrt/include/fsl_ewm.h | 218 - bsps/arm/imxrt/include/fsl_flexcan.h | 1422 - bsps/arm/imxrt/include/fsl_flexio.h | 700 - bsps/arm/imxrt/include/fsl_flexio_camera.h| 230 - .../imxrt/include/fsl_flexio_camera_edma.h| 130 - .../arm/imxrt/include/fsl_flexio_i2c_master.h | 486 - bsps/arm/imxrt/include/fsl_flexio_i2s.h | 560 - bsps/arm/imxrt/include/fsl_flexio_i2s_edma.h | 203 - bsps/arm/imxrt/include/fsl_flexio_mculcd.h| 685 - .../imxrt/include/fsl_flexio_mculcd_edma.h| 153 - bsps/arm/imxrt/include/fsl_flexio_spi.h | 702 - bsps/arm/imxrt/include/fsl_flexio_spi_edma.h | 207 - bsps/arm/imxrt/include/fsl_flexio_uart.h | 570 - bsps/arm/imxrt/include/fsl_flexio_uart_edma.h | 178 - bsps/arm/imxrt/include/fsl_flexram.h | 276 - bsps/arm/imxrt/include/fsl_flexram_allocate.h |99 - bsps/arm/imxrt/include/fsl_flexspi.h | 837 - bsps/arm/imxrt/include/fsl_flexspi_nor_boot.h | 130 - bsps/arm/imxrt/include/fsl_gpc.h | 231 - bsps/arm/imxrt/include/fsl_gpio.h | 342 - bsps/arm/imxrt/include/fsl_gpt.h | 509 - bsps/arm/imxrt/include/fsl_iomuxc.h | 1242 - bsps/arm/imxrt/include/fsl_kpp.h | 180 - bsps/arm/imxrt/include/fsl_lpi2c.h| 1266 - bsps/arm/imxrt/include/fsl_lpi2c_edma.h | 157 - bsps/arm/imxrt/include/fsl_lpspi.h| 1122 - bsps/arm/imxrt/include/fsl_lpspi_edma.h | 301 - bsps/arm/imxrt/include/fsl_lpuart.h | 866 - bsps/arm/imxrt/include/fsl_lpuart_edma.h | 173 - bsps/arm/imxrt/include/fsl_ocotp.h| 153 - bsps/arm/imxrt/include/fsl_pin_mux.h | 942 - bsps/arm/imxrt/include/fsl_pit.h | 332 - bsps/arm/imxrt/include/fsl_pmu.h | 671 - bsps/arm/imxrt/include/fsl_pwm.h | 987 - bsps/arm/imxrt/include/fsl_pxp.h | 1438 - bsps/arm/imxrt/include/fsl_qtmr.h | 473 - bsps/arm/imxrt/include/fsl_rtwdog.h | 425 - bsps/arm/imxrt/include/fsl_sai.h | 1572 - bsps/arm/imxrt/include/fsl_sai_edma.h | 268 - bsps/arm/imxrt/include/fsl_semc.h | 831 - bsps/arm/imxrt/include/fsl_snvs_hp.h | 626 - bsps/arm/imxrt/include/fsl_snvs_lp.h | 555 - bsps/arm/imxrt/include/fsl_spdif.h| 746 - bsps/arm/imxrt/include/fsl_spdif_edma.h | 192 - bsps/arm/imxrt/include/fsl_src.h | 602 - bsps/arm/imxrt/include/fsl_tempmon.h | 126 - bsps/arm/imxrt/include/fsl_trng.h | 228 - bsps/arm/imxrt/include/fsl_tsc.h | 524 - bsps/arm/imxrt/include/fsl_usdhc.h| 1581 - bsps/arm/imxrt/include/fsl_wdog.h | 305 - bsps/arm/imxrt/include/fsl_xbara.h| 183 - bsps/arm/imxrt/include/fsl_xbarb.h|82 - bsps/arm/imxrt/include/system_MIMXRT1052.h| 129 - .../imxrt/nxp/boards/evkbimxrt1050/pin_mux.c | 1073 +- .../nxp/devices/MIMXRT1052/drivers/fsl_adc.c | 395 - .../devices/MIMXRT1052/drivers/fsl_adc_etc.c | 433 - .../devices/MIMXRT1052/drivers/fsl_aipstz.c |51 - .../nxp/devices/MIMXRT1052/drivers/fsl_aoi.c | 214 - .../nxp/devices/MIMXRT1052/drivers/fsl_bee.c | 303 - .../devices/MIMXRT1052/drivers/fsl_cache.c| 602 -
[PATCH rtems v2 10/12] bsps/imxrt: Move board specific files
Move the files that are board specific and not specific to the chip family into a separate folder. --- .../evkbimxrt1050}/clock-arm-pll-config.c | 0 .../boards/evkbimxrt1050/clock_config.c | 0 .../evkbimxrt1050}/flash-dcd.c| 0 .../{nxp => }/boards/evkbimxrt1050/pin_mux.c | 0 spec/build/bsps/arm/imxrt/bspimxrt1052.yml| 19 --- spec/build/bsps/arm/imxrt/obj.yml | 7 --- 6 files changed, 16 insertions(+), 10 deletions(-) rename bsps/arm/imxrt/{start => boards/evkbimxrt1050}/clock-arm-pll-config.c (100%) rename bsps/arm/imxrt/{nxp => }/boards/evkbimxrt1050/clock_config.c (100%) rename bsps/arm/imxrt/{start => boards/evkbimxrt1050}/flash-dcd.c (100%) rename bsps/arm/imxrt/{nxp => }/boards/evkbimxrt1050/pin_mux.c (100%) diff --git a/bsps/arm/imxrt/start/clock-arm-pll-config.c b/bsps/arm/imxrt/boards/evkbimxrt1050/clock-arm-pll-config.c similarity index 100% rename from bsps/arm/imxrt/start/clock-arm-pll-config.c rename to bsps/arm/imxrt/boards/evkbimxrt1050/clock-arm-pll-config.c diff --git a/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c b/bsps/arm/imxrt/boards/evkbimxrt1050/clock_config.c similarity index 100% rename from bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c rename to bsps/arm/imxrt/boards/evkbimxrt1050/clock_config.c diff --git a/bsps/arm/imxrt/start/flash-dcd.c b/bsps/arm/imxrt/boards/evkbimxrt1050/flash-dcd.c similarity index 100% rename from bsps/arm/imxrt/start/flash-dcd.c rename to bsps/arm/imxrt/boards/evkbimxrt1050/flash-dcd.c diff --git a/bsps/arm/imxrt/nxp/boards/evkbimxrt1050/pin_mux.c b/bsps/arm/imxrt/boards/evkbimxrt1050/pin_mux.c similarity index 100% rename from bsps/arm/imxrt/nxp/boards/evkbimxrt1050/pin_mux.c rename to bsps/arm/imxrt/boards/evkbimxrt1050/pin_mux.c diff --git a/spec/build/bsps/arm/imxrt/bspimxrt1052.yml b/spec/build/bsps/arm/imxrt/bspimxrt1052.yml index 348b90bcdb..6c2b3339f9 100644 --- a/spec/build/bsps/arm/imxrt/bspimxrt1052.yml +++ b/spec/build/bsps/arm/imxrt/bspimxrt1052.yml @@ -8,10 +8,23 @@ copyrights: cppflags: [] enabled-by: true family: imxrt -includes: [] -install: [] +includes: +- bsps/arm/imxrt/mcux-sdk/drivers/common +- bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052 +- bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/drivers +- bsps/arm/imxrt/mcux-sdk/devices/MIMXRT1052/xip +install: +- destination: ${BSP_INCLUDEDIR}/imxrt + source: + - bsps/arm/imxrt/include/imxrt/imxrt1050.dtsi + - bsps/arm/imxrt/include/imxrt/imxrt1050-pinfunc.h links: - role: build-dependency uid: obj-mimxrt1052 -source: [] +source: +- bsps/arm/imxrt/boards/evkbimxrt1050/clock_config.c +- bsps/arm/imxrt/boards/evkbimxrt1050/flash-dcd.c +- bsps/arm/imxrt/boards/evkbimxrt1050/pin_mux.c +- bsps/arm/imxrt/boards/evkbimxrt1050/clock-arm-pll-config.c +- bsps/arm/imxrt/dts/imxrt1050-evkb.c type: build diff --git a/spec/build/bsps/arm/imxrt/obj.yml b/spec/build/bsps/arm/imxrt/obj.yml index b2c1d6fa4f..85cb350dd2 100644 --- a/spec/build/bsps/arm/imxrt/obj.yml +++ b/spec/build/bsps/arm/imxrt/obj.yml @@ -25,8 +25,6 @@ install: - bsps/arm/include/bsp/imx-iomux.h - destination: ${BSP_INCLUDEDIR}/imxrt source: - - bsps/arm/imxrt/include/imxrt/imxrt1050.dtsi - - bsps/arm/imxrt/include/imxrt/imxrt1050-pinfunc.h - bsps/arm/imxrt/include/imxrt/lpspi.h - bsps/arm/imxrt/include/imxrt/memory.h - bsps/arm/imxrt/include/imxrt/mpu-config.h @@ -38,16 +36,11 @@ install: links: [] source: - bsps/arm/imxrt/console/console.c -- bsps/arm/imxrt/dts/imxrt1050-evkb.c - bsps/arm/imxrt/i2c/imxrt-lpi2c.c -- bsps/arm/imxrt/nxp/boards/evkbimxrt1050/clock_config.c -- bsps/arm/imxrt/nxp/boards/evkbimxrt1050/pin_mux.c - bsps/arm/imxrt/spi/imxrt-lpspi.c - bsps/arm/imxrt/start/bspstart.c - bsps/arm/imxrt/start/bspstarthooks.c -- bsps/arm/imxrt/start/clock-arm-pll-config.c - bsps/arm/imxrt/start/flash-boot-data.c -- bsps/arm/imxrt/start/flash-dcd.c - bsps/arm/imxrt/start/flash-flexspi-config.c - bsps/arm/imxrt/start/flash-ivt.c - bsps/arm/imxrt/start/imxrt-ffec-init.c -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 11/12] bsps/imxrt: Make the OCRAM address configurable
Depending on the chip variant, the OCRAM can have different addresses. Make it configurable. --- spec/build/bsps/arm/imxrt/grp.yml | 2 ++ spec/build/bsps/arm/imxrt/linkcmdsmemory.yml| 4 ++-- spec/build/bsps/arm/imxrt/optmemocramorigin.yml | 17 + 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 spec/build/bsps/arm/imxrt/optmemocramorigin.yml diff --git a/spec/build/bsps/arm/imxrt/grp.yml b/spec/build/bsps/arm/imxrt/grp.yml index 17b4f48dab..feda472401 100644 --- a/spec/build/bsps/arm/imxrt/grp.yml +++ b/spec/build/bsps/arm/imxrt/grp.yml @@ -46,6 +46,8 @@ links: uid: optmemnullsz - role: build-dependency uid: optmemocramnocachesz +- role: build-dependency + uid: optmemocramorigin - role: build-dependency uid: optmemocramsz - role: build-dependency diff --git a/spec/build/bsps/arm/imxrt/linkcmdsmemory.yml b/spec/build/bsps/arm/imxrt/linkcmdsmemory.yml index 2d8187052f..cf66966b5d 100644 --- a/spec/build/bsps/arm/imxrt/linkcmdsmemory.yml +++ b/spec/build/bsps/arm/imxrt/linkcmdsmemory.yml @@ -5,8 +5,8 @@ content: | NULL : ORIGIN = 0x, LENGTH = ${IMXRT_MEMORY_NULL_SIZE:#010x} ITCM : ORIGIN = ${IMXRT_MEMORY_NULL_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_ITCM_SIZE:#010x} DTCM : ORIGIN = 0x2000, LENGTH = ${IMXRT_MEMORY_DTCM_SIZE:#010x} -OCRAM : ORIGIN = 0x2020, LENGTH = ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x} -OCRAM_NOCACHE : ORIGIN = 0x2020 + ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x} +OCRAM : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN}, LENGTH = ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x} +OCRAM_NOCACHE : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN} + ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x} PERIPHERAL : ORIGIN = 0x4000, LENGTH = 0x2000 FLASH_CONFIG : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x} FLASH_IVT : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x} diff --git a/spec/build/bsps/arm/imxrt/optmemocramorigin.yml b/spec/build/bsps/arm/imxrt/optmemocramorigin.yml new file mode 100644 index 00..c3d08918a7 --- /dev/null +++ b/spec/build/bsps/arm/imxrt/optmemocramorigin.yml @@ -0,0 +1,17 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-integer: null +- env-assign: null +build-type: option +copyrights: +- Copyright (C) 2023 embedded brains GmbH (http://www.embedded-brains.de) +default: +- enabled-by: true + value: 0x2020 +description: | + Origin of the OCRAM. +enabled-by: true +format: '{:#010x}' +links: [] +name: IMXRT_MEMORY_OCRAM_ORIGIN +type: build -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 06/12] bsps/shared: Fix header for fsl-edma
If a different chip variant is used in the i.mxrt BSP, a different header would have to be included. Make sure that the fsl-edma driver uses a header that doesn't have to be adapted. --- bsps/shared/dev/dma/fsl-edma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsps/shared/dev/dma/fsl-edma.c b/bsps/shared/dev/dma/fsl-edma.c index b3e1bb2fc5..3cb91c14e6 100644 --- a/bsps/shared/dev/dma/fsl-edma.c +++ b/bsps/shared/dev/dma/fsl-edma.c @@ -40,7 +40,7 @@ #include #include #ifdef LIBBSP_ARM_IMXRT_BSP_H -#include +#include #endif #define EDMA_CHANNELS_PER_GROUP 32U -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 09/12] bsps/imxrt: Make chip start code chip specific
Some parts of the startup code don't apply for all chips. Make that part chip specific. --- bsps/arm/imxrt/start/bspstart.c | 4 bsps/arm/imxrt/start/bspstarthooks.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bsps/arm/imxrt/start/bspstart.c b/bsps/arm/imxrt/start/bspstart.c index 445af04563..6d873f4afd 100644 --- a/bsps/arm/imxrt/start/bspstart.c +++ b/bsps/arm/imxrt/start/bspstart.c @@ -47,6 +47,7 @@ uint32_t imxrt_systick_frequency(void) static void imxrt_disable_wait_mode(void) { +#if IMXRT_IS_MIMXRT10xx /* * Prevent processor from entering WAIT or SLEEP mode when a WFI is executed. * This would switch off the normal interrupt controller and activate an @@ -58,6 +59,9 @@ static void imxrt_disable_wait_mode(void) * every WFI. */ CLOCK_SetMode(kCLOCK_ModeRun); +#else + #error Disabling wait mode not implemented for this chip. +#endif } void bsp_start(void) diff --git a/bsps/arm/imxrt/start/bspstarthooks.c b/bsps/arm/imxrt/start/bspstarthooks.c index a84f2a427f..5bd847b1cf 100644 --- a/bsps/arm/imxrt/start/bspstarthooks.c +++ b/bsps/arm/imxrt/start/bspstarthooks.c @@ -58,9 +58,11 @@ BSP_START_TEXT_SECTION void bsp_start_hook_1(void) BOARD_BootClockRUN(); BOARD_InitDEBUG_UARTPins(); +#if IMXRT_IS_MIMXRT10xx /* Reduce frequency for I2C */ CLOCK_SetDiv(kCLOCK_Lpi2cDiv, 5); /* Enable EDMA clock. We initialize the EDMA so we need the clock. */ CLOCK_EnableClock(kCLOCK_Dma); +#endif } -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 00/12] bsp/imxrt: Update SDK and prepare for new variant
Hello, this is the second version of the patch set to update the SDK files in the i.MXRT BSPs. Like said in the earlier version: I plan to add a i.MXRT1166 based BSP soon. The changes are: - I now only imported the SDK files for i.MXRT1050 and i.MXRT1166. With that the imported files (mainly first patch) are now only 18MB instead of 90MB. - The script to import the files is now removed. I added a link to it in the description of the import patch. I'll create a short note for the documentation soon. - I added some minor fixes that I noted during further tests. The full version of the two big patches (1 and 3) can be found on this branch: https://gitlab.com/c-mauderer/rtems/-/commits/cm/20230509_imxrt/ Best regards Christian ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH rtems v2 04/12] bsps/imxrt1052: PLL config based on speed grade
--- bsps/arm/imxrt/start/clock-arm-pll-config.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/bsps/arm/imxrt/start/clock-arm-pll-config.c b/bsps/arm/imxrt/start/clock-arm-pll-config.c index 12ad1867eb..2a0148e73a 100644 --- a/bsps/arm/imxrt/start/clock-arm-pll-config.c +++ b/bsps/arm/imxrt/start/clock-arm-pll-config.c @@ -26,8 +26,15 @@ */ #include "fsl_clock_config.h" +#include const clock_arm_pll_config_t armPllConfig_BOARD_BootClockRUN = { +#if (IMXRT_SPEEDGRADE == '6') .loopDivider = 100, +#elif (IMXRT_SPEEDGRADE == '5') +.loopDivider = 88, +#else +#error unknown speed grade of i.MXRT processor +#endif .src = 0, }; -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] rtems: Reference types in construct directives
--- cpukit/include/rtems/rtems/message.h | 3 ++- cpukit/include/rtems/rtems/tasks.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpukit/include/rtems/rtems/message.h b/cpukit/include/rtems/rtems/message.h index cd951f584b..d1432ffbb8 100644 --- a/cpukit/include/rtems/rtems/message.h +++ b/cpukit/include/rtems/rtems/message.h @@ -292,7 +292,8 @@ rtems_status_code rtems_message_queue_create( * @brief Constructs a message queue from the specified the message queue * configuration. * - * @param config is the message queue configuration. + * @param config is the pointer to an rtems_message_queue_config object. It + * configures the message queue. * * @param[out] id is the pointer to an ::rtems_id object. When the directive * call is successful, the identifier of the constructed message queue will diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h index 3214dad3f8..57ca618c48 100644 --- a/cpukit/include/rtems/rtems/tasks.h +++ b/cpukit/include/rtems/rtems/tasks.h @@ -671,7 +671,8 @@ rtems_status_code rtems_task_create( * * @brief Constructs a task from the specified task configuration. * - * @param config is the task configuration. + * @param config is the pointer to an rtems_task_config object. It configures + * the task. * * @param[out] id is the pointer to an ::rtems_id object. When the directive * call is successful, the identifier of the constructed task will be stored -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] c-user: Generate API type documentation
Close #4901. --- c-user/barrier/directives.rst | 12 +- c-user/clock/directives.rst |6 +- c-user/config/classic-init-task.rst |2 +- c-user/config/device-driver.rst |4 +- c-user/config/general.rst |2 +- c-user/dual-ported-memory/directives.rst | 12 +- c-user/interrupt/directives.rst | 28 +- c-user/io/directives.rst |2 +- c-user/message/directives.rst | 19 +- c-user/object-services/directives.rst |8 +- c-user/partition/directives.rst | 12 +- c-user/rate-monotonic/directives.rst | 16 +- c-user/region/directives.rst | 12 +- c-user/rtems_data_types.rst | 1862 ++--- c-user/scheduling-concepts/directives.rst | 26 +- c-user/semaphore/directives.rst | 19 +- c-user/task/directives.rst| 41 +- c-user/timer/directives.rst | 14 +- c-user/user-extensions/directives.rst | 12 +- 19 files changed, 1759 insertions(+), 350 deletions(-) diff --git a/c-user/barrier/directives.rst b/c-user/barrier/directives.rst index 59abc51..c51974c 100644 --- a/c-user/barrier/directives.rst +++ b/c-user/barrier/directives.rst @@ -67,9 +67,9 @@ Creates a barrier. barrier. ``id`` -This parameter is the pointer to an :c:type:`rtems_id` object. When the -directive call is successful, the identifier of the created barrier will be -stored in this object. +This parameter is the pointer to an :ref:`InterfaceRtemsId` object. When +the directive call is successful, the identifier of the created barrier +will be stored in this object. .. rubric:: DESCRIPTION: @@ -175,9 +175,9 @@ Identifies a barrier by the object name. This parameter is the object name to look up. ``id`` -This parameter is the pointer to an :c:type:`rtems_id` object. When the -directive call is successful, the object identifier of an object with the -specified name will be stored in this object. +This parameter is the pointer to an :ref:`InterfaceRtemsId` object. When +the directive call is successful, the object identifier of an object with +the specified name will be stored in this object. .. rubric:: DESCRIPTION: diff --git a/c-user/clock/directives.rst b/c-user/clock/directives.rst index d531918..e99c44e 100644 --- a/c-user/clock/directives.rst +++ b/c-user/clock/directives.rst @@ -137,7 +137,7 @@ Gets the time of day associated with the current :term:`CLOCK_REALTIME`. .. rubric:: PARAMETERS: ``time_of_day`` -This parameter is the pointer to an :c:type:`rtems_time_of_day` object. +This parameter is the pointer to an :ref:`InterfaceRtemsTimeOfDay` object. When the directive call is successful, the time of day associated with the :term:`CLOCK_REALTIME` at some point during the directive call will be stored in this object. @@ -1086,8 +1086,8 @@ Gets the seconds elapsed since the :term:`RTEMS epoch` and the current .. rubric:: PARAMETERS: ``seconds_since_rtems_epoch`` -This parameter is the pointer to an :c:type:`rtems_interval` object. When -the directive call is successful, the seconds elapsed since the +This parameter is the pointer to an :ref:`InterfaceRtemsInterval` object. +When the directive call is successful, the seconds elapsed since the :term:`RTEMS epoch` and the :term:`CLOCK_REALTIME` at some point during the directive call will be stored in this object. diff --git a/c-user/config/classic-init-task.rst b/c-user/config/classic-init-task.rst index 4974356..2f3059e 100644 --- a/c-user/config/classic-init-task.rst +++ b/c-user/config/classic-init-task.rst @@ -59,7 +59,7 @@ API initialization task. .. rubric:: CONSTRAINTS: The value of the configuration option shall be convertible to an integer of -type :c:type:`rtems_task_argument`. +type :ref:`InterfaceRtemsTaskArgument`. .. Generated from spec:/acfg/if/init-task-attributes diff --git a/c-user/config/device-driver.rst b/c-user/config/device-driver.rst index 971bb9e..9d46211 100644 --- a/c-user/config/device-driver.rst +++ b/c-user/config/device-driver.rst @@ -114,7 +114,7 @@ placement of application device driver initializers. .. rubric:: CONSTRAINTS: The value of the configuration option shall be a list of initializers for -structures of type :c:type:`rtems_driver_address_table`. +structures of type :ref:`InterfaceRtemsDriverAddressTable`. .. Generated from spec:/acfg/if/appl-needs-ata-driver @@ -718,7 +718,7 @@ of application device driver initializers. .. rubric:: CONSTRAINTS: The value of the configuration option shall be a list of initializers for -structures of type :c:type:`rtems_driver_address_table`. +structures of type :ref:`InterfaceRtemsDriverAddressTable`. .. Generated from spec:/acfg/if/ata-driver-task-priority diff --git a/c-user/config/general.rst b/c-user/config/general.rst
[PATCH] rtems: Add constraint to types
--- cpukit/include/rtems/rtems/intr.h | 42 +++ 1 file changed, 42 insertions(+) diff --git a/cpukit/include/rtems/rtems/intr.h b/cpukit/include/rtems/rtems/intr.h index 6bf6150b93..019bc806b2 100644 --- a/cpukit/include/rtems/rtems/intr.h +++ b/cpukit/include/rtems/rtems/intr.h @@ -1041,6 +1041,13 @@ typedef void ( *rtems_interrupt_per_handler_routine )( * rtems_interrupt_entry_initialize(). It may be installed for an interrupt * vector with rtems_interrupt_entry_install() and removed from an interrupt * vector by rtems_interrupt_entry_remove(). + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct rtems_interrupt_entry { /** @@ -2141,6 +2148,13 @@ rtems_status_code rtems_interrupt_handler_iterate( * view. Members shall not be accessed directly. The structure is initialized * by rtems_interrupt_server_create() and maintained by the interrupt server * support. + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct rtems_interrupt_server_control { #if defined(RTEMS_SMP) @@ -2191,6 +2205,13 @@ typedef struct rtems_interrupt_server_control { * * @par Notes * See also rtems_interrupt_server_create(). + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct { /** @@ -2819,6 +2840,13 @@ rtems_status_code rtems_interrupt_server_handler_iterate( * @par Notes * This structure shall be treated as an opaque data type from the API point of * view. Members shall not be accessed directly. + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct rtems_interrupt_server_action { /** @@ -2851,6 +2879,13 @@ typedef struct rtems_interrupt_server_action { * rtems_interrupt_server_entry_destroy(). Interrupt server actions can be * prepended to the entry by rtems_interrupt_server_action_prepend(). The * entry is submitted to be serviced by rtems_interrupt_server_entry_submit(). + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct { /** @@ -3165,6 +3200,13 @@ rtems_status_code rtems_interrupt_server_entry_move( * request can be set by rtems_interrupt_server_request_set_vector(). The * request is submitted to be serviced by * rtems_interrupt_server_request_submit(). + * + * @par Constraints + * @parblock + * The following constraints apply to this structure: + * + * * Members of the type shall not be accessed directly by the application. + * @endparblock */ typedef struct { /** -- 2.35.3 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel