Commit Graph

47 Commits

Author SHA1 Message Date
Christian Mauderer
fc68da47d5 bsps/imxrt1166*: Absolute address for pins in FDT
The i.MXRT1166 has three iomux controllers. The driver in RTEMS
(originally for i.MX6) doesn't support that. Switching to absolute
addresses for the pins in the FDT works around that.

Compared to changing the IOMUX driver, it has the following advantages:

- If a devicetree is written, the pinctrl-groups don't have to be split
up between different iomux controllers which makes device trees simpler
to read.

- A driver or application doesn't has to handle multiple pinctrl-groups
which simplifies the drivers.
2024-06-07 06:46:00 +00:00
Christian Mauderer
f83968f309 bsps/arm/imxrt: Add license header to fdt-blobs
The C files that provide the device trees are generated with
rtems-bin2c. Due to that, the license information in these files is
lost. Therefore this patch adds the header manually. Also adapt the
commands that are used to generate the files to reflect that.
2024-06-07 06:46:00 +00:00
Christian Mauderer
ac0b4ae5c4 bsps/imxrt1166: Disable video_mux
The pinctrl-0 of the video_mux might overwrite pin settings done by
other peripherals. Disabling it by default prevents unexpected pin
settings.
2023-11-28 13:36:41 +01:00
Christian Mauderer
02f2316be7 bsp/imxrt1166: Support GPIO CS pins in LPSPI
With this, it is possible to use GPIOs as CS pins in the LPSPI. To avoid
additional complexity, the GPIOs will have the same limitations as the
native (hardware) CS pins.

The GPIO CS feature adds a number of extra code when starting SPI
transfers on this controller. Therefore it is possible to disable the
additional code by just setting the IMXRT_LPSPI_MAX_CS option to 0. In
that case only native CS pins are supported.

At the moment, this feature is only enabled on i.MXRT1166 by default
because it is not tested on i.MXRT1050. But it should work there too.
2023-11-28 13:36:41 +01:00
Christian Mauderer
094355d4f1 bsps/arm/imxrt: Optimize nocache memory settings
The nocache-memory was set as device memory. It's not necessary to be
that strict. Set it to normal non-cacheable non-shareable memory
instead.
2023-08-21 09:13:16 +02:00
Christian Mauderer
685f193280 bsps/arm/imxrt1166: Enable USB
Enable the USB modules in the FDT.
2023-08-21 09:13:16 +02:00
Christian Mauderer
91b1c7b0a6 bsps/imxrt: Fix enabling USBPHY in fsl_clock
The mcux-sdk tries to enable the USBPHY. But it uses the wrong register
for that. This patch fixes the bug.
2023-08-21 09:13:16 +02:00
Christian Mauderer
4a3ace7c7a bsps/imxrt: Add imxrt1166_cm7_saltshaker BSP
The BSP is for a custom i.MXRT1166 based board. At the moment, only the
cortex M7 is supported.
2023-07-24 14:41:06 +02:00
Christian Mauderer
780149bc38 bsps/imsrt: Make flash config more flexible
The flash configuration is something very board specific. So move the
file to a board specific location. Beneath that, not all controllers and
configurations need the flash config right at the address 0 of the
flash. For example on the i.MXRT11xx, the config has an offset for some
flash types.
2023-07-24 14:40:59 +02:00
Christian Mauderer
376db78f92 imxrt/mcux-sdk: Add HREQ-related bits
According to the reference manual the bits exist and they can be used.
Also confirmed by NXP support in the community forum:

https://community.nxp.com/t5/i-MX-RT/i-MXRT1160-LPSPI-HREQ-supported/m-p/1668647#M25512
2023-07-24 14:40:40 +02:00
Christian Mauderer
b831014b12 bsps/imxrt: Fix getting qtmr clock for i.MXRT11xx
The function returned a multiplexer value instead of the frequency.
2023-07-24 14:40:25 +02:00
Christian Mauderer
97819b8a31 bsps/imxrt: Move board specific files
Move the files that are board specific and not specific to the chip
family into a separate folder.
2023-05-22 09:45:42 +02:00
Christian Mauderer
c1a949745f 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.
2023-05-22 09:45:42 +02:00
Christian Mauderer
dd68ed6075 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.
2023-05-22 09:45:42 +02:00
Christian Mauderer
d941dd0dad 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.
2023-05-22 09:45:42 +02:00
Christian Mauderer
5e78c76c79 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.
2023-05-22 09:45:42 +02:00
Christian Mauderer
f3df09352c bsps/imxrt1052: PLL config based on speed grade 2023-05-22 09:45:42 +02:00
Christian Mauderer
f467635161 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.
2023-05-22 09:45:36 +02:00
Christian Mauderer
4cb2b07402 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.
2023-05-22 09:43:48 +02:00
Christian Mauderer
38ad41ecce 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
2023-05-22 09:43:48 +02:00
Sebastian Huber
bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Karel Gardas
139bc390b5 score/arm: enhance ARMV7M MPU setup with capability to set control register
Due to API change, the patch also fixes affected BSPs and uses
value provided by MPU CTRL spec option there.

Sponsored-By:	Precidata
2023-03-16 15:40:22 +01:00
Joel Sherrill
d42276615c bsps/arm/imxrt: Change license to BSD-2
Updates #3053.
2022-07-08 08:42:42 -05:00
Joel Sherrill
ba619b7f36 bsps/arm/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Christian Mauderer
6fe6622489 bsp/imxrt: Enforce alignment for devicetree
A device tree binary has to be 8 byte aligned in memory. This is checked
since RTEMS commit 34052ef78c "libfdt: Add
FDT alignment check to fdt_check_header()".
2022-02-21 09:30:05 +01:00
Christian Mauderer
e495633887 bsps/imxrt: Improve SPI driver
It wasn't possible to keep the CS line low between multiple message
descriptors in one transfer. This patch reworks the driver so that it is
possible.

Update #4180
2021-09-02 08:38:54 +02:00
Christian Mauderer
89b652a54d bsps/imxrt: Fix undefined symbol 2021-07-08 10:05:37 +02:00
Christian Mauderer
0d3453a47e bsps/imxrt: Simplify linkcmds and make it flexible
Calling the memory FLASH and EXTRAM instead of FLEXSPI and SDRAM makes
it simpler to support other types of external RAM. This patch also
removes some of the calculations and improves names and documentation to
avoid pitfalls. It removes a unnecessary memory definition.

Update #4180
2021-07-02 13:49:47 +02:00
Christian Mauderer
95a38dd3f1 bsps/imxrt: Allow different ARM PLL setting
Update #4180
2021-07-02 13:49:47 +02:00
Sebastian Huber
94cf67ca66 bsps/irq: Remove BSP_INTERRUPT_VECTOR_MAX
This define is no longer used.

Update #3269.
2021-06-24 11:36:27 +02:00
Sebastian Huber
cd5573c09d bsps/irq: Add BSP_INTERRUPT_VECTOR_COUNT
Assert BSP_INTERRUPT_VECTOR_MAX + 1 == BSP_INTERRUPT_VECTOR_COUNT.

After building all BSPs with this patch, BSP_INTERRUPT_VECTOR_MAX can be
removed and replaced by BSP_INTERRUPT_VECTOR_COUNT.  The
BSP_INTERRUPT_VECTOR_COUNT allows a default implementation which supports no
interrupt vector at all.  Using COUNT instead of MAX may avoid some
interpretation issues, for example is the maximum value a valid vector number
or not.

Update #3269.
2021-06-24 11:35:49 +02:00
Sebastian Huber
af73b7b64b bsps/irq: Remove BSP_INTERRUPT_VECTOR_MIN
Remove BSP_INTERRUPT_VECTOR_MIN and unconditionally let interrupt vector
numbers start with zero.

The BSP_INTERRUPT_VECTOR_MIN == 0 invariant was tested by the previous commit
and building all BSPs.

Update #3269.
2021-06-24 11:35:49 +02:00
Christian Mauderer
15e26f4d7f bsps/imxrt: Enable DMA clock
The EDMA is intialized so make sure the the clock is initialized too.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
691fec407a bsps/imxrt: Fix OCRAM, ITCM and DTCM sizes
The sizes are configurable via fuses or per software via some registers.
At the moment the registers are not changed. Changing the registers
destroys data stored in the RAM areas (like application code or data).
So either the fuses or some bootloader should be used to set them before
the application starts.

This also adds an OCRAM only linker command file.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
988cc1a795 bsps/imxrt: Add addresses and interrupts to dts
Add addresses and interrupts for most internal peripherals to the dts.
The additional aliases make it possible for an application to easily
access these informations.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
c30566667d bsps/imxrt: Reduce devicetree size
Remove symbols that would be necessary for overlays and decrease padding
that would be necessary for adding stuff during run-time.

Update #4180
2021-05-17 09:06:41 +02:00
Christian Mauderer
08e4e6f2bb bsps/imxrt: Fix documentation error
Update #4180
2021-05-17 09:06:36 +02:00
Christian Mauderer
65ab1cda10 bsps/arm/imxrt: Add FDT and FDT helper for QTMR
Makes it simpler to access the QTMR in an application via a FDT name or
link in an application specific FDT entry.
2021-03-21 12:30:29 +01:00
Christian Mauderer
36b4e8c394 bsps/imxrt: Add ioctl to LPSPI to get registers
This allows an application to get the registers of the LPSPI. That is
usefull for applications that want to use DMA for a very specialized and
highly optimized communication.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
d9794a1f97 bsps/imxrt: Add DMA numbers to dtsi
Also currently no driver uses these numbers, it is usefull for
applications that want to use the DMA.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
a434cc80cb bsps/shared: Adapt fsl-edma driver for imxrt
Note: The changes have been done with portability in mind. The driver
should (in theory) be able to replace the original one in the MPC BSPs
too. For full compatibility an adaption layer and especially a test
would be necessary. Because both are missing, don't integrate it into
the MPC BSP now.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
22e9dafb74 bsps/imxrt: Use standard names to avoid warnings
If spi or i2c slaves are "connected" to the spi or i2c bus, the device
tree compiler complains if the busses are not named spi or i2c.

Update #4180
2021-01-21 10:17:31 +01:00
Christian Mauderer
b63a187ec0 bsps/imxrt: Split up dts.
This allows simpler creation of own dts files for custom boards.

Update #4180
2020-12-14 11:10:38 +01:00
Christian Mauderer
7141afbb0e bsp/imxrt: Add new BSP
Update #4180
2020-11-20 08:53:19 +01:00
Christian Mauderer
57b5b29ce4 bsp/imxrt: Adapt imported files
Update #4180
2020-11-20 08:53:19 +01:00
Christian Mauderer
8abf858cf5 bsp/imxrt: Fix warnings for imported files
Update #4180
2020-11-20 08:53:18 +01:00
Christian Mauderer
48f6a6c302 bsp/imxrt: Import files from MCUXpresso SDK V2.8.5
The following files have been imported:

cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.h include/fsl_clock_config.h
cp ${SDK}/boards/evkbimxrt1050/project_template/dcd.c start/flash-dcd.c
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.h include/fsl_pin_mux.h
cp ${SDK}/boards/evkbimxrt1050/xip/evkbimxrt1050_flexspi_nor_config.h include/fsl_flexspi_nor_config.h
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052.h include
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052_features.h include
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.c nxp/devices/MIMXRT1052/drivers
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.h include
cp ${SDK}/devices/MIMXRT1052/fsl_device_registers.h include
cp ${SDK}/devices/MIMXRT1052/system_MIMXRT1052.h include/
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c nxp/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h include

Update #4180
2020-11-20 08:53:18 +01:00