Commit graph

147 commits

Author SHA1 Message Date
Ulf Magnusson f052de56a0 soc: arm: kconfig: Clean up SOC_PART_NUMBER definitions
Put a common definition of the SOC_PART_NUMBER symbol in
soc/arm/Kconfig, to make it always available for ARM SoCs. Have the
other definitions extend the base definition, without repeating the
type.

Also put the help text on just the base definition. It will show up in
the generated documentation and when looking at the symbol information
at any of the definition locations in the menuconfig (after going into
show-all mode).

Trying to get rid of unnecessary "full" symbol definitions in
Kconfig.defconfig files, to make the organization clearer. It can also
help with finding unused symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-29 06:06:54 +01:00
Ulf Magnusson a02c333963 arm/riscv: kconfig: Remove type from NUM_IRQS in defconfig files
Add a common definition for NUM_IRQS in arch/arm/core/Kconfig and
arch/riscv/Kconfig. That way, the type doesn't have to be given for
NUM_IRQS in all the Kconfig.defconfig files.

Trying to get rid of unnecessary "full" symbol definitions in
Kconfig.defconfig files, to make the organization clearer. It can also
help with finding unused symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-28 08:27:28 -05:00
Loic Poulain a019e92d23 soc: nxp: rt: Add CSI video support
Add CSI node to generic nxp rt dtsi.
Add corresponding dts binding.
Add CSI capability for rt MCUs.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-10-25 15:13:53 -05:00
Ulf Magnusson 2b61031c8f kconfig: Remove symbol types from Kconfig.defconfig files
Same deal as in commit 7fdb525754 ("kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), but I hacked Kconfiglib to also
find cases where the type is given separately as e.g.

    config FOO
            int
            default 3

Motivation (from a note in
https://docs.zephyrproject.org/latest/guides/kconfig/index.html):

    For a symbol defined in multiple locations (e.g., in a
    Kconfig.defconfig file in Zephyr), it is best to only give the
    symbol type for the "base" definition of the symbol, and to use
    'default' (instead of 'def_<type>' value) for the remaining
    definitions. That way, if the base definition of the symbol is
    removed, the symbol ends up without a type, which generates a
    warning that points to the other definitions. That makes the extra
    definitions easier to discover and remove.

It's also nice if 'def_bool' and the like turn into a semi-reliable flag
that the symbol is only defined in Kconfig.defconfig files. That might
be a sign that things could be cleaned up.

Will do a separate pass later to remove some symbols only defined in
Kconfig.defconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-24 12:40:22 -05:00
Kumar Gala 22e7449b73 kconfig: Introduce typed dt kconfig functions
Replace:
  dt_chosen_reg_addr
  dt_chosen_reg_size
  dt_node_reg_addr
  dt_node_reg_size

with:
  dt_chosen_reg_addr_int
  dt_chosen_reg_size_int
  dt_chosen_reg_addr_hex
  dt_chosen_reg_size_hex
  dt_node_reg_addr_int
  dt_node_reg_size_int
  dt_node_reg_addr_hex
  dt_node_reg_size_hex

So that we get the proper formatted string for the type of symbol.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00
Kumar Gala 9784f800a6 i2c: Rename CONFIG_I2C_[0..5]_NAME -> DT_I2C_[0..5]_NAME
Now that everything is DT based for I2C drivers we can rename the
CONFIG_I2C_[0..5]_NAME define to DT_I2C_[0..5]_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-23 11:31:32 -05:00
Maureen Helm f8cfe453fd soc: nxp_imx: Configure default sdhc driver at the soc series level
Configures the default sdhc driver for the imx rt soc series so
applications don't have to configure it explicitly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-10-23 09:49:05 -05:00
Ulf Magnusson ac9fe11f2f Kconfig: Remove copy-pasted comments on some promptless symbols
Remove the

    # Omit prompt to signify a "hidden" option

comments that appear on some symbols. They seem to have been copy-pasted
at random, as there are lots of promptless symbols that don't have them
(that's confusing in itself, because it might give the idea that the
ones with comments are special in some way).

I suspect those comments wouldn't have helped me much if I didn't know
Kconfig either. There's a lot more Kconfig documentation now too, e.g.
https://docs.zephyrproject.org/latest/guides/kconfig/index.html.

Keep some comments that give more information than the symbol having no
prompt.

Also do some minor drive-by cleanup.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-17 13:05:24 -05:00
Andrew Boie 8c98a97581 arm: arch code naming cleanup
This patch re-namespaces global variables and functions
that are used only within the arch/arm/ code to be
prefixed with z_arm_.

Some instances of CamelCase have been corrected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-04 10:46:23 +02:00
Ioannis Glaropoulos 95c2968d32 soc: arm: nxp: cleanup in soc.h headers
A commit that organizes the soc.h header of NXP SoCs:
- removing redundant inclusions of sys/util.h
- removing inclusions of device.h and kernel_includes.h
- including the auto-generated DTS board header
- including the fsl_common.h header
- fixing minor style issues

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-09-23 18:02:00 -07:00
Loic Poulain 9608a8e64e soc: nxp:rt: Add DATA_OCRAM config
Enable config for On-Chip RAM data.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-09-16 14:55:20 -05:00
Loic Poulain f78f7076aa soc: nxp: rt: Add custom memory areas to linker script
RT SOCs have several memory areas (OCRAMs, DTCM, ITCM, SDRAM, FLASH...)
but only two are selected for FLASH (code) and RAM (data).
It would be good to let the linker be aware about other regions, which
could then be used by drivers or application to create dedicated
sections and relocate memory. For example if we have code in ITCM and
data in DTCM, we still need a dma-able region/section for e.g.
video/camera buffers.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-09-16 14:55:20 -05:00
Kumar Gala 2632647ea0 kconfig: nxp_imx: rt: Convert to use new kconfigfunctions
Convert use of dt_int_val/dt_hex_val to dt_node_reg_{addr,size}.  As
we want to remove dt_int_val/dt_hex_val.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Joris Offouga ccd6bf1d07 soc/mcimx7_m4: Add i.MX7 Dual Kconfig SoC partnumber define
Adds the proper Kconfig entries for the i.MX7D partnumber presented
on Pico-pi board.

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
2019-09-11 08:47:53 -05:00
Andy Liu b888f8f892 dts: arm: nxp_rt: Fix typo in DT_PWM_MCUX_3_INDEX definition
DT_NXP_IMX_4PWM_03DC000_PWM3_INDEX should be
DT_NXP_IMX_PWM_403DC000_PWM3_INDEX.

Signed-off-by: Andy Liu <andy@madmachine.io>
2019-09-10 14:35:43 -05:00
Neill Kapron 6225592e27 SOC: Boards: NXP: Enable ethernet for mimxrt1060_evk
This enables ethernet functionality on the mimxrt1062 SOC
and mimxrt1060_evk board.

Signed-off-by: Neill Kapron <nkapron@gmail.com>
2019-09-10 07:44:08 -05:00
Peter Bigot ddf9b144ce soc/arm/nxp*: rearrange for standard use of extern "C"
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Remove extern "C" support from files that don't declare objects or
functions.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-20 00:49:15 +02:00
Kumar Gala 6abbed2975 soc: arm: mcimx6x_m4: Floating Point support required by default
The HAL/SDK code for imx6sx utilizes floating point support in
CCM_ANALOG_GetPllFreq function which is utilized by drivers to determine
clock information.  As such we should enable hardware FP support by
default so we don't get pure soft-float emulation and pull in a bunch of
extra code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-16 11:53:36 -05:00
Loic Poulain df583f27a9 soc: nxp_imx: Add PWM config
Enable MCUX PWM driver if PWM config is selected and hardware
support it.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Loic Poulain 630e0c7a6e dts: arm: nxp: rt: Add PWM nodes
i.MX RT10XX processors have four eFlexPWM modules, each containing
four 2-channels PWM submodules.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-07 07:38:40 -05:00
Kumar Gala 352687df05 nxp_imx: Fix dts build error
The SoC clock init code for USB was using a deprecated DTS define.
Switch to using the non-deprecated form.

Fixes: #17772

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-25 16:10:11 +02:00
Piotr Zięcik 01e2789b8c soc: nxp_rt: Get system clock frequency from DTS
The SoC initialization code used timer clock frequency
as a system clock frequency. This commit corrects that by
obtaining the needed value from DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Peter A. Bigot ec2ba8d968 drivers: eth_mcux: update for dts change to local-mac-address
uint8_array values are now generated as structure initializers.  Update
the code accordingly.  The implementation assumes that existing
devicetree source does not provide the correct OUI so preserves the
in-driver override of the value provided by devicetree and its setting
for random/unique addresses.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-11 06:50:27 -04:00
Jun Yang 27d8329fc9 clock/usdhc: Enable clock of USDHC of i.MXRT
Enable clock of USDHC of i.MXRT.

Add clock interface for USDHC in ccm.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Jun Yang 6ff5ac05e4 usdhc/pinmux: configure pinmux of usdhc on mimxrt1050 evk
Implementation of pinmux of usdhc depends on board design.

Usdhc driver could change pinmux according to SD mode, SoC

should provide API for this. Board pinmux should register

its pinmux function to SoC.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Jun Yang c6864dbea3 Kconfig: Kconfig support i.MX RT USDHC
Add Kconifg options to support i.MXRT USDHC driver.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Andy Ross 05c8e05634 soc/arm: Remove 1 kHz tick rate default for mcimx7_m4 and msp432p401r
As with the STM32 boards, these had an existing default for tick rate
that is now lower than the 10 kHz default.  They're SysTick devices
that can handle the higher rate just fine.  Use that.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Loic Poulain 050a715d21 soc: nxp: rt: Enable mcux gpt when counter is enabled
Enable NXP MCUX driver and devices when counter config is selected.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-01 11:53:07 -05:00
Loic Poulain 304c5fd196 dts: arm: nxp_rt: Add GPT nodes
i.MX RT chips have two GPT modules.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-01 11:53:07 -05:00
Loic Poulain 517ef0d688 soc: nxp:rt: Add HAS_MCUX_GPT flag
For RT SOCs with General Purporse Timer module(s) (GPT).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-07-01 11:53:07 -05:00
Anas Nashif a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Mark Wang 906f3789f2 dts: nxp: nxp_rt: add usbd1 for rt1050 and works as default usb.
add usbd1 and use it as the default usb device.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-30 06:45:12 -05:00
Kumar Gala 18ab73d02c dts: nxp: nxp_rt: Fix unit-address for usb node
The first reg of the node is 0x402E0200 so the unit address should match
that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-24 09:47:18 -05:00
Ioannis Glaropoulos 75f681b0d9 soc: arm: add ARM MPU node info and fixup for Cortex-M7 SoCs
Unlike Cortex-M3 and Cortex-M4, in Cortex-M7 the number of
MPU regions may vary based on the implementation. This commit
adds a DTS node for the ARM MPU peripheral in the device tree
of Cortex-M7 SoCs and updates the fixup files, so we may extract
the number of MPU regions at build time. SoCs:
- nxp_rt
- same70
- stm32f7

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-20 14:06:10 -05:00
Ioannis Glaropoulos fb713aa062 soc: arm: move z_clearfaults() in kernel_arch_init()
In kernel_arch_init() we initialize the ARM core (interrupt
setup, fault init, etc.) so we can also move z_clearfaults()
in the same function and skip invoking it in the SoC init
functions.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-17 09:48:11 -07:00
Henrik Brix Andersen 56dfb62e40 drivers: serial: uart_mcux_lpuart: add support for LPUARTs with two IRQs
Add support for NXP MCUX LPUART devices with separate IRQ lines for
transmit and receive status interrupts (e.g. the Kinetis KE1xF SoC
series).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-14 15:00:11 -05:00
Ryan QIAN 90dc25b256 soc: arm: nxp_imx: rt: update flash size of 32KB
- Add 32KB to flash size

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-05-14 12:23:42 -05:00
Mark Wang 32f8521cce soc: nxp_imx: configure USB device EHCI controller driver for rt1050
add usbd1 definition to rt dts file,
set EHCI controller config default value in rt1050 default config file,
add EHCI controller driver MACROs to dts_fixup.h,
initialize EHCI clock in rt soc.c
add HAS_MCUX_USB_EHCI for supported soc in Kconfig.soc

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-09 13:37:02 -05:00
Loic Poulain e5609997e0 soc: nxp_imx: mimxrt1064_evk: Add I2C support
I2C1 is routed to J24 Arduino interface (D14/I2C_SDA, D15/I2C_SCL).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-04-26 03:48:07 -07:00
Ioannis Glaropoulos ccf90fd9c2 soc: arm: select CPU_HAS_SYSTICK in ARCH Kconfig
ARM SysTick timer is implemented by default in ARMv7-M
and Mainline ARMv8-M processors, so we include the
corresponding Kconfig symbol in arch/arm/core/cortex-M/Kconfig
and remove the selections from the Cortex-M SOCs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-25 23:09:23 -07:00
Ioannis Glaropoulos ce0dcea4b1 soc: arm: remove redundant CPU_CORTEX_M selection
CPU_CORTEX_M does not need to be selected by Kconfig
symbols that already select a CORTEX_M variant.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-25 23:09:23 -07:00
Ryan QIAN f44514d1e4 arch: arm: nxp: imxrt1015: add device support
- Add SoC information for RT1015

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-04-18 16:11:34 -05:00
Ulf Magnusson 7fdb525754 kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
Same deal as in commit 4638652214 ("Kconfig: Use 'default' instead of
'def_bool' in Kconfig.defconfig files"), fixing new stuff that got
introduced since then.

Some symbols, like ALTERA_AVALON_PIO, are only defined in
Kconfig.defconfig files, and so need the def_bool.

Motivation (from the note at the end of
guides/kconfig/index.html#common-shorthands):

For a symbol defined in multiple locations (e.g., in a Kconfig.defconfig
file in Zephyr), it is best to only give the symbol type for the "base"
definition of the symbol, and to use 'default' (instead of 'def_<type>'
value) for the remaining definitions. That way, if the base definition
of the symbol is removed, the symbol ends up without a type, which
generates a warning that points to the other definitions. That makes the
extra definitions easier to discover and remove.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-04-18 12:20:49 -04:00
Patrik Flykt fd42bf7443 soc: Rename reserved function names
Rename reserved function names in the soc/ subdirectory.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Maureen Helm 5cdbd39e33 soc: nxp_imx: Configure NUM_IRQS independently for each rt soc
Not all i.mx rt socs have the same number of irqs, so move the default
configuration from the soc series level to the individual socs. The
rt1020 hardware reference manual (IMXRT1020RM Rev.1 12/2018) incorrectly
documents 160 irqs (#142-159 reserved), but the soc actually has 142
irqs.

Fixes tests/kernel/gen_isr_table for the mimxrt1020_evk board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-26 22:16:47 -04:00
Loic Poulain 116dd8e527 dts: arm: nxp: rt106x: Unified OCRAM node
The iMX RT1060 and RT1064 have additional dedicated 512KB on-chip ram.
This OCRAM2 is mapped at 0x20200000, formerly OCRAM1 (flexram) mapping
which is moved to 0x20280000 in order to guarentee global OCRAM memory
continuity regardless OCRAM1 size configuration (256KB by default).

In default configuration, this gives 768KB (512+256) on-chip ram:
0x20200000 to 0x202BFFFF.

OCRAM2:           0x20200000 - 0x2027FFFF
OCRAM1(FlexRam):  0x2028FFFF - 0x202BFFFF

Add this memory region as a single node in the rt1060 device tree.

Note: MPU expects power of two memory region, in case of 768KB, let
the MPU configure 1MB instead.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-03-15 06:40:23 -05:00
Maureen Helm a259279bb2 soc: nxp_imx: Add rt1052 A1 silicon part numbers
Adds imx rt1052 A1 silicon part numbers. Previously we only had A0
silicon part numbers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-10 10:51:43 -05:00
Maureen Helm 1c49129d0c soc: nxp_imx: Sort imx rt part numbers in alpha order
Sorts the imx rt part numbers so they are in alphabetical order.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-10 10:51:43 -05:00
David B. Kinder e731bdc81a doc: fix docs, include, and Kconfig misspellings
Fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-28 09:32:12 +01:00
Loic Poulain cf856183d1 soc: nxp_imx: mimxrt1064_evk: Enable ethernet support
The i.MX RT1064 evk has one ethernet (10/100M) connector via KSZ8081RNB
phy. Enable related dts nodes and config flags

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-02-26 08:04:40 -06:00
Loic Poulain e980ef8a8e soc: nxp_imx: Add on-chip flash code location support
iMXRT1064 has 4MB on-chip Flash memory (flexspi2) mapped to 0x70000000.
Add it as configurable code location for MIMXRT1064-EVK board.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-02-26 08:04:40 -06:00
Kumar Gala 97529e00b2 soc: imxrt: Fixup setting of MPU Kconfig
We should be selecting CPU_HAS_ARM_MPU at this level and not
CPU_HAS_MPU.  Change the cases of CPU_HAS_MPU to CPU_HAS_ARM_MPU.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-20 16:39:49 -06:00
Piotr Zięcik 240783a229 soc: Cleanup SYS_POWER_*_SUPPORTED Kconfig options
This commit removes "select SYS_POWER_*_SUPPORTED" entries from
Kconfig on SoCs which are not implementing sys_set_power_state()
method used to control power mode.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-19 13:25:36 -05:00
Maureen Helm cf94d6811a soc: nxp_imx: Default to on-chip memories at soc level
Refactor the imx rt code/data location config defaults such that we
default to on-chip memories at the soc level and override to external
memories at the board level. This means that we frequently override soc
defaults for evk boards, but it removes the assumption that all imx rt
boards (particularly non-evk boards) will have the same external
memories as evk boards.

The end result is that imx rt evk boards still have the same defaults as
before, but the way we get there is different.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-18 15:14:18 -05:00
Maureen Helm f0a20c62ac soc: nxp_imx: Add missing dts fixups for gpio 2,3,4 instances
The imx rt dts fixup was missing gpio 2,3,4 instances. This caused a
build error in the gpio driver when an application enabled:

CONFIG_GPIO_MCUX_IGPIO_2=y
CONFIG_GPIO_MCUX_IGPIO_3=y
CONFIG_GPIO_MCUX_IGPIO_4=y

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-15 21:34:49 -06:00
Maureen Helm 19d1fd0d6c soc: nxp_imx: Clean up whitespace in dts_fixup.h
Clean up whitespace in the imx rt dts_fixup.h so columns are aligned.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-15 21:34:49 -06:00
Maureen Helm 0540b1a699 soc: nxp_imx: Move code/data location configs to soc level
The imx rt family of socs has several options for linking code and data
into internal or external memories, and up until now we have handled
these options at the board level. This has resulted in several Kconfig
symbols being defined in multiple places and triggering warnings in
documentation builds:

warning: the default selection CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) of <choice> (defined at boards/arm/mimxrt1050_evk/Kconfig:9) is not contained in the choice
warning: the choice symbol CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) is defined with a prompt outside the choice
warning: the choice symbol CODE_HYPERFLASH (defined at boards/arm/mimxrt1050_evk/Kconfig:16, boards/arm/mimxrt1060_evk/Kconfig:16) is defined with a prompt outside the choice
warning: the choice symbol CODE_QSPI (defined at boards/arm/mimxrt1050_evk/Kconfig:19, boards/arm/mimxrt1060_evk/Kconfig:19) is defined with a prompt outside the choice
warning: the choice symbol CODE_ITCM (defined at boards/arm/mimxrt1050_evk/Kconfig:13, boards/arm/mimxrt1060_evk/Kconfig:13) is defined with a prompt outside the choice
warning: the choice symbol CODE_HYPERFLASH (defined at boards/arm/mimxrt1050_evk/Kconfig:16, boards/arm/mimxrt1060_evk/Kconfig:16) is defined with a prompt outside the choice
warning: the choice symbol CODE_QSPI (defined at boards/arm/mimxrt1050_evk/Kconfig:19, boards/arm/mimxrt1060_evk/Kconfig:19) is defined with a prompt outside the choice

The number of warnings increased as we added more imx rt boards. Fix the
warnings by moving code and data location configs from the board level
to the soc level.

The default memories for all imx rt boards are unchanged. The
mimxrt10{20,50,60}_evk boards still default to hyperflash/qspi for code
and sdram for data. The mimxrt1064_evk board still defaults to ITCM for
code and DTCM for data because jlink does not yet support programming
internal flash.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-13 17:52:20 -05:00
Piotr Zięcik 7a49356c77 power: Fix naming of Kconfig options controlling low power states
The SYS_POWER_LOW_POWER_STATE_SUPPORTED and SYS_POWER_LOW_POWER_STATE
suggests one low power state but these options control multiple
low power state. This commit uses plural in the names to indicate
that.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-12 07:46:32 -05:00
Kumar Gala d85042f97f soc: nxp_imx: Convert to use DT_ prefixed defines
The soc nxp_imx RDC code has been using non DT_ prefixed defines for DT
generated defines.  Switch to use DT_ prefixed ones as we want to
deprecated the non DT_ prefixed defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 16:03:17 -06:00
Ioannis Glaropoulos 5fb4ac94fb soc: arm: indicate double precision floating-point unit
Select CPU_HAS_FPU_DOUBLE_PRECISION in SAM E70 and NXP I.MX RT
series of MCUs to signify double-precision floating-point unit.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-02-08 14:09:18 -06:00
Stanislav Poboril e2904c8c5f imx: Add EPIT peripheral support for i.MX6SoloX soc
Add EPIT (Enhanced Periodic Interrupt Timer) peripheral support
for i.MX6SoloX soc.

Origin: Original

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2019-02-07 16:14:00 -05:00
Maureen Helm bf0abe4438 soc: nxp_imx: Enable mcux elcdif driver and clocks
Enables the mcux elcdif shim driver and clocks on imx rt socs when the
display driver interface is enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 14:28:55 -06:00
Andrei Gansari 6d36f2e2f4 mimxrt1050_evk: cache enable
Cacheing mechanisms enabled and non-cache area added.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-01-31 13:22:58 -06:00
Maureen Helm 501db1e0b9 soc: nxp_imx: Promote driver defaults to soc series level
Streamlines repetitious code enabling default drivers by promoting it to
the soc series level.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-28 21:21:01 -05:00
Maureen Helm 605e599b1a ext: mcux: Add HAS_MCUX_ENET config
Adds a new config HAS_MCUX_ENET to constrain which socs can enable the
mcux ethernet driver. This will prevent users from enabling the driver
on socs like kl25z or kw41z which do not have ethernet mac hardware.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-28 21:21:01 -05:00
Ryan QIAN fe9ea3b26c arch: arm: nxp: imxrt1064: add device support
- Add SoC information for RT1064

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-24 07:59:52 -06:00
Aurelien Jarno 0e7a6ec9ab boards: mimxrt1020_evk: Enable mcux ethernet driver and pins
Enables the mcux ethernet driver and pin muxes on the mimxrt1020_evk
board, the same way it is done on the mimxrt1050_evk board. Updates the
board documentation and yaml supported list accordingly.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-22 08:37:39 -06:00
Aurelien Jarno ba459d002c soc: nxp_imx: Fix enabling ENET PLL outputs
The ENET PLL should be enabled if the SoC is the MIMXRT1021 (it used by
the ARM core) or if the ENET device is enabled.

The 500MHz clock should be enabled if the SoC is the MIMXRT1021.

The ENET clock should be enabled if the ENET device is enabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-22 08:37:39 -06:00
Aurelien Jarno 17f4d6bec7 soc: nxp_imx: fix ENET_PLL selection for MIMXRT1021
Kconfig currently emits a warning when building for a MIMXRT1021 SoC:

  warning: INIT_ENET_PLL (defined at
  soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052:66) has direct
  dependencies NET_L2_ETHERNET && SOC_MIMXRT1052 && SOC_SERIES_IMX_RT
  with value n, but is currently being y-selected by the following
  symbols:
   - SOC_MIMXRT1021 (defined at soc/arm/nxp_imx/rt/Kconfig.soc:12),
  with value y, direct dependencies <choice> (value: y), and select
  condition <choice> (value: y)

This is due to the fact the ENET PLL is the one used by the ARM core on
the MIMXRT1021 so it is always enabled, while it is declared protected
by NET_L2_ETHERNET and SOC_SERIES_IMX_RT.

Fix that by declaring the symbol in Kconfig.defconfig.series.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-22 08:37:39 -06:00
Maureen Helm 9cad30814d soc: nxp_imx: Enable mcux lpi2c driver and clocks
Enables the mcux lpi2c shim driver and clocks on all imx rt socs when
the i2c driver interface is enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-18 06:49:35 -05:00
Maureen Helm 2484e301b1 soc: nxp_imx: Add missing dts fixups for lpuart instance 2
Adds dts fixups for lpuart instance 2, which will be used for the
arduino_serial connection on the mimxrt1020_evk board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-16 12:32:16 -06:00
Aurelien Jarno 074f8a0a26 soc: nxp_imx: Add support for TRNG
Add support for the TRNG device contained in the i.MX RT SoCs. It uses
the existing MCUX driver, and mostly consists in adding the Kconfig and
DTS entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-10 21:22:15 -06:00
Maureen Helm a9389da038 soc: nxp_imx: Add support for device configuration data (DCD)
Adds support for the device configuration data (DCD), which provides a
sequence of commands to the imx rt boot ROM to initialize components
such as an SDRAM.

It is now possible to use the external SDRAM instead of the internal
DTCM on the mimxrt1020_evk, mimxrt1050_evk, and mimxrt1060_evk. Note,
however, that the default board configurations still link data into
internal DTCM, therefore you must use a device tree overlay to override
"zephyr,sram = &sdram0"

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-09 16:01:25 -06:00
Maureen Helm b5551d0690 soc: boards: Reserve space for the imx boot header at the soc level
Moves the default TEXT_SECTION_OFFSET from the board level to the soc
level for the imx rt series. This offset is used to reserve space for
the imx boot header for external xip flash images.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-09 16:01:25 -06:00
Maureen Helm 8e3004953d soc: nxp_imx: Add support for external xip flash boot header
Adds support for the boot data, image vector table, and FlexSPI NOR
config structures used by the imx rt boot ROM to boot an application
from an external xip flash device.

It is now possible to build and flash a bootable zephyr image to the
external xip flash on the mimxrt1020_evk, mimxrt1050_evk, and
mimxrt1060_evk boards via the 'ninja flash' build target and jlink
runner. Note, however, that the default board configurations still link
code into internal ITCM, therefore you must set CONFIG_CODE_HYPERFLASH=y
or CONFIG_CODE_QSPI=y explicitly to override the default. You must also
set CONFIG_NXP_IMX_RT_BOOT_HEADER=y to build the boot header into the
image.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-09 16:01:25 -06:00
Ryan QIAN b416758e9f arch: arm: nxp: imxrt1021: add device support
- Add Soc information for RT1020

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-09 11:39:31 -06:00
Ryan QIAN e66e6b054c soc: nxp_imx: rt: fix enet pll initialization config macro name
- Update config macro name for enet pll
- Update impacted defconfig of RT1052

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2019-01-09 11:39:31 -06:00
Andrei Gansari f6d3f6b92b mimix1050rt: gPTP build fix
Sets iMX RT's cmake and fixup to enable gPTP in MCUX_ETH.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-01-09 07:57:18 -06:00
Flavio Ceolin 359adfc959 soc: arm: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Maureen Helm 6876dc71c1 soc: nxp_imx: Fix ethernet build error
Fixes an ethernet build error introduced with MCUXpresso SDK 2.5.0,
caused by a slight change in the ethernet pll configuration structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-04 14:35:35 -05:00
Patrik Flykt 8325a395ea soc: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Ioannis Glaropoulos 8204ecbead arch: arm: mpu: declare and define arm_mpu_config as const
Declare and define arm_mpu_config and arm_mpu_regions
structs as const, as they are not modified in run-time.

Fixes #10320

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-21 09:44:21 -05:00
Diego Sueiro 6d070c77b6 drivers/ipm: Add IPM support for i.MX7
This patch ads the support for the IPM drivers on i.MX7 SoC family.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-11-21 04:03:59 -06:00
Andrei Gansari a5174be648 mimxrt1050_evk: enabling networking hardware
Enables Networking hardware on i.MX-RT 1050-EVKB board.
Pinout enabled board specific etherenet connection, also pin
initialization was moved later to PRE_KERNEL_2 in order to have
sysclock initialized before.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2018-11-20 09:54:25 -06:00
Stanislav Poboril 871fc0f3c2 imx: Add Messaging Unit peripheral support for i.MX6SoloX soc
Add Messaging Unit B peripheral support for i.MX6SoloX soc so it can
use IMX IPM.

Origin: Original

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2018-11-19 08:38:38 -06:00
Ulf Magnusson 4638652214 Kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
This can help find unused symbols. Those end up without a type if
'default' is used instead of 'def_bool', which generates a warning.

Search for "Kconfig.defconfig" in
https://docs.zephyrproject.org/latest/application/kconfig-tips.html for
a longer explanation.

Keep the 'def_bool' for the following symbols, which seem to be
deliberately defined only in Kconfig.defconfig files:

 - ALTERA_AVALON_I2C
 - ALTERA_AVALON_MSGDMA
 - ALTERA_AVALON_PIO
 - ALTERA_AVALON_QSPI
 - ALTERA_AVALON_SYSID
 - CLOCK_CONTROL_IMX_CCM
 - CPU_EM4_DMIPS
 - CPU_EM4_FPUDA
 - CPU_EM4_FPUS
 - FP_FPU_DA
 - I2C_GECKO

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-13 16:04:01 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Sebastian Bøe 8eb734cd82 DT: Rename from dts.fixup to dts_fixup.h
The Zephyr configuration system uses many different files in many
different formats. It makes it a lot easier for users to understand
what these files do if when we use the correct file extensions.

To this end we rename the dts.fixup files to the correct file
extension '.h'.

This is a breaking change for out-of-tree fixup files. Such files will
be detected and given an appropriate error message.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-08 11:38:56 -04:00
Maureen Helm c73d5c7880 boards: mimxrt1050_evk: Enable lpuart3 for bluetooth hci
Enables instance 3 of the lpuart driver, adds dts fixups, and configures
pinmuxes to use bluetooth hci on the mimxrt1050_evk board. Updates board
documentation accordingly.

Tested with samples/bluetooth/peripheral_hr, with frdm_kw41z attached as
an arduino shield running the nxp hci controller application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-27 05:55:55 +05:30
Maureen Helm 3b72a54506 soc: nxp_imx: Use generated clock controller in dts fixup
Use the generated "_CLOCK_CONTROLLER" macro for the lpuart clock name.
This change is similar to commit
e81d9b98fe, but applied to nxp_imx.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-27 05:55:55 +05:30
Ryan QIAN 5b62ea0e7a arch: arm: nxp: imxrt1060: add device support
- Add SoC information for RT1060

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2018-09-26 18:14:22 -05:00
Piotr Zięcik d393186d51 arch: arm: Introduce CPU_HAS_ARM_MPU and CPU_HAS_NXP_MPU options
This commit introduces CPU_HAS_ARM_MPU and CPU_HAS_NXP_MPU options,
which indicate which flavour of MPU is supported by given SoC family.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Piotr Zięcik edfcab428b arch: nxp_imx: Remove ARM_MPU_IMX_RT option.
The ARM_MPU_IMX_RT option is just selecting ARM_MPU option,
which could be also controlled through menuconfig.

This commit removes the ARM_MPU_IMX_RT option and replaces
its usage by ARM_MPU option.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Maureen Helm ae8d4edede soc: arm: Enable the lpspi driver and clock for the imxrt soc
Enables the mcux lpspi shim driver and subsystem clock for the imxrt
soc.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-19 09:15:29 -04:00
Anas Nashif 70d819b405 arm: soc: move arm SoCs to top-dir
Move the SoC outside of the architecture tree and put them at the same
level as boards and architectures allowing both SoCs and boards to be
maintained outside the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-13 00:56:48 -04:00