Commit graph

34 commits

Author SHA1 Message Date
Alexandre Bourdiol 6f55614222 board: arm: Enable MPU for all STM32 boards supporting it
Only boards with at least 64K Flash will activate MPU because:
MPU + UERSPACE + All switches implicity activated
(CONFIG_MPU_STACK_GUARD, CONFIG_ARM_STACK_PROTECTION ...)
will consume about 40K Flash
(value computed on nucleo_f767_zi on tests/arch/arm/arm_ramfunc/).

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-06-19 08:55:44 -05:00
Erwan Gouriou f9d5df3937 boards: stm32: pinmux: Restore Kconfig control on pinmux (serial)
In order to avoid pin configuration conflicts between peripherals,
add CONFIG_SERIAL flag to for each serial pinmux configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 12:09:19 +02:00
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Alexandre Bourdiol 18f2129895 board/arm/stm32h747i_disco: add documentation for support of openocd
Add documentation for OpenOCD usage and restrictions

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-06 10:57:56 -05:00
Alexandre Bourdiol 28c9271939 board/arm/stm32h747i_disco: add support of flash with openocd
Allow to flash either Cortex M4 or M7 with OpenOCD
(depending on which Board/Core has been compiled)
Command: west flash

Warning: Dependency with recent OpenOCD patch:
Windows: https://gnutoolchains.com/arm-eabi/openocd/
         version 20200408
Linux : http://openocd.zylin.com/
        SHA1: 0a804222da63c5f849efa23b019a59e2dea76842

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-06 10:57:56 -05:00
Kumar Gala fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Erwan Gouriou 1be8bda215 boards: stm32: Fix boards names in yaml and/or doc files
For auto doc generation purpose, get name value of boards' yaml files
in sync with name provided as board name in .rst file


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-05 10:05:56 -05:00
Erwan Gouriou 81f27c2265 boards: stm32: Use dt API for serial peripheral configuration
Replace use of Kconfig UART_X symbols by calls to DT API.
Clean driver from symbols definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-20 15:27:56 -05:00
Ulf Magnusson a42a42cd5a kconfig: Replace defconfig singe-symbol 'if's with 'depends on'
Same deal as in commit eddd98f ("kconfig: Replace some single-symbol
'if's with 'depends on'"), for all symbols defined within defconfig
files. See that commit for an explanation.

Maybe 'if's were used originally to mirror the 'if's in the main Kconfig
files, and then it got copied around by people assuming 'if' must work
differently from 'depends on'. It doesn't match in every spot at least.
Better to keep it simple and just consistently use 'depends on' when
it's a single symbol/choice I think. Helps reinforce that 'if' isn't
magic too.

Verified by printing all Kconfig menu nodes (symbols, choices, menus,
etc.) before and after the change and diffing (should show no
difference).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-12 10:32:13 -06:00
Erwan Gouriou 137d4c1882 board: stm32h474i_disco: Small fixes on m4 core
ST-Link VPC is wired to UART_1.
Console should be assigned to this peripheral to be available.
By default UART_1 is assigned to m7 core and not available to m4.

This commit does not change this, but makes it easier to change
UART_1 assignment from m7 to m4 core.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-11 17:41:49 +02:00
Ulf Magnusson c5839f834b kconfig: Remove assignments to CONFIG_<arch> syms and hide them
All board defconfig files currently set the architecture in addition to
the board and the SoC, by setting e.g. CONFIG_ARM=y. This spams up
defconfig files.

CONFIG_<arch> symbols currently being set in configuration files also
means that they are configurable (can be changed in menuconfig and in
configuration files), even though changing the architecture won't work,
since other things get set from -DBOARD=<board>. Many boards also allow
changing the architecture symbols independently from the SoC symbols,
which doesn't make sense.

Get rid of all assignments to CONFIG_<arch> symbols and clean up the
relationships between symbols and the configuration interface, like
this:

1. Remove the choice with the CONFIG_<arch> symbols in arch/Kconfig and
   turn the CONFIG_<arch> symbols into invisible
   (promptless/nonconfigurable) symbols instead.

   Getting rid of the choice allows the symbols to be 'select'ed (choice
   symbols don't support 'select').

2. Select the right CONFIG_<arch> symbol from the SOC_SERIES_* symbols.
   This makes sense since you know the architecture if you know the SoC.

   Put the select on the SOC_* symbol instead for boards that don't have
   a SOC_SERIES_*.

3. Remove all assignments to CONFIG_<arch> symbols. The assignments
   would generate errors now, since the symbols are promptless.

The change was done by grepping for assignments to CONFIG_<arch>
symbols, finding the SOC_SERIES_* (or SOC_*) symbol being set in the
same defconfig file, and putting a 'select' on it instead.

See
https://github.com/ulfalizer/zephyr/commits/hide-arch-syms-unsquashed
for a split-up version of this commit, which will make it easier to see
how stuff was done. This needs to go in as one commit though.

This change is safer than it might seem re. outstanding PRs, because any
assignment to CONFIG_<arch> symbols generates an error now, making
outdated stuff easy to catch.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 00:50:08 -06:00
Kumar Gala 1dc4b1dd2f boards: shrink image sizes
Reduce images sizes of boards.  Get a roughly 3x reduction in size.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-07 13:52:45 -05:00
Erwan Gouriou 124004c29a boards: stm32: Remove useless CONFIG_BOARD_FOO from _defconfig files
CONFIG_BOARD_FOO is enabled in a number of board *_defconfig files
although it is useless as it is set by default (as defined as a
one option choice, symbol defaults to 'y').
CONFIG_BOARD_FOO should remain only in target that are defined
in boards providing multiple choices (dual cores, board with multiple
revisions).

Clean it from STM32 impacted boards.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 11:29:21 -06:00
Erwan Gouriou 702bb73e3e boards: stm32h747i_disco: Add arduino connector header
Add arduino connection dts description and update target
yaml files.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou fc52f097b8 boards: stm32: Fix buttons and leds configuration
On some stm32 based boards buttons and leds configuration
was wrong. Fix that.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Erwan Gouriou 31ed7e931b boards: stm32: Update board definition using new GPIO api
Move GPIO_ACTIVE_INT_HIGH/LOW to GPIO_ACTIVE_HIGH/LOW.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Antony Pavlov 276c26b01a boards/arm: dts: fix formatting
Replace spaces by tabs. Drop extra empty lines.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2020-01-07 08:46:26 -05:00
Kumar Gala cd0f8d5c4f include: Fix use of <sys_io.h> -> <sys/sys_io.h>
Fix #include <sys_io.h> as it has been deprecated and
should be #include <sys/sys_io.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Erwan Gouriou 4dc303b99b dts: stm32: Remove pinctrl definitions
dts pinctrl definitions were pushed in tree without the code
available to deal with it. They have been kept waiting for the
code, but this is taking much more time than initially thought.

So in current zephyr tree, for all STM32 boards, we have pinmux.c
file which is used to configure pins and these files that are
basically no-op. This situation is creating a lot of confusion
especially to new comers, and create useless maintenance effort.

Remove these files for now.
When zephyr will ready to use them, this commit could be reverted.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-11-06 18:26:04 +01:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
David B. Kinder 0c8e7eaeef doc: fix refs to non-supported board
Comparing the output of "west boards" with mentions of boards in build
instructions (:board: boardname) found a couple of incorrect board
references.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-31 16:57:52 +01: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
Erwan Gouriou 5881f118c0 soc: stm32: Enable cortex-m systick timer by default
Move systick activation in soc/ as a Kconfig.defconfig file and
remove activation in boards _defconfig files.
This will allow to deactivate it in a more flexible way
with upcoming LPTIMER as tick source when power management
features are enabled.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-10-11 14:55:48 -07:00
Marti Bolivar 27e5dd131f doc: s/device tree/devicetree/
DTSpec writes this as a single word, presumably to make it easier to
grep for / more precise. Follow along in the rest of the docs now that
our main DT docs page agrees with this usage.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-10-08 11:53:40 +02:00
Erwan Gouriou 5a12d51285 boards: Clean up references to env variable PROJECT_SOURCE_DIR
As recommended in cmake/app/boilerplate.cmake, ZEPHYR_BASE should
be preferred to PROJECT_SOURCE_DIR.
Do the change for all boards still referring to PROJECT_SOURCE_DIR.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 13:16:16 -05:00
Erwan Gouriou e0c2b16b29 boards: stm32h747i_disco: Minor fixes
* Exlude _m4target from net tests as they assume SERIAL is enabled,
which is not the case (yet).
Fixes: #19065
* Zephyr drivers headers were moved from include/ to include/drivers.
Update pinmux.h path to the new location.
* Add missing status line on joystick_left dts node.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 09:02:15 -05:00
Erwan Gouriou d847117dc2 boards: stm32h747i_disco: Use default tick rate
Remove SYS_CLOCK_TICKS_PER_SEC configuration to use default value.

Fixes #18228

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-13 20:23:43 +02:00
Ulf Magnusson 6e5e1e028d dts: Replace more status = "ok" with status = "okay"
Same deal as in commit a84ded74ea ("dts: Replace status = "ok" with
status = "okay""), for newly introduced stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-08-08 14:03:25 -05:00
Erwan Gouriou b837252269 boards: stm32h474i_disco: Fix m4 core sys clock
System clock for m4 core was set to same clock as m7 core.
This is wrong as m4 its value is actually based on clock frequency
value after D1CPRE (sys_d1cpre_ck) divided per HPRE value, 200MHz in
current case.
This also matches the max clock speed for the m4 core (200MHz)

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-05 13:27:21 +02:00
Erwan Gouriou c12688ecbf boards: stm32h747i_disco: Enforce same clock configuration on both ...
cores

In order to prevent potential misconfiguration set the clock setting,
which impacts both cores, under board.defconfig file which is used
by both core.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-05 13:27:21 +02:00
Erwan Gouriou 749c22401b boards: stm32h747i_disco: Fix picture size
Set board picture to a reasonable size.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-25 10:51:49 -04:00
Erwan Gouriou 79e4d0af62 boards: stm32h747i_disco: Provide doc
Provide doc for stm32h747i_disco.
Includes basic description for building and flashing
individual cores.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou 0fbf0c397a boards: stm32h747i_disco: Add m4 target
Add m4 target to stm32h747i_disco.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00
Erwan Gouriou afcb1ae71f boards: Add stm32h747i_disco, C-M7 target
Add C-M7 target for board stm32h747i_disco.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-07-04 08:50:04 -04:00