Commit graph

12 commits

Author SHA1 Message Date
Vincent Wan 2599f705a8 drivers: cc32xx: use DT_INST_FOREACH to reduce code duplication
Use DT_INST_FOREACH macro to combine code used for multiple instances.
Remove unnecessary Kconfig options and dts fixups for GPIO instances.

A side-effect to using DT_INST_FOREACH is that GPIO ports A0 and A3
are now enabled, whereas they were originally disabled by default as
an optimization.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-26 06:05:10 -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
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
Vincent Wan d5850ac686 gpio: Update cc32xx gpio driver to use new gpio api
Updates the cc32xx gpio driver and all associated boards to use new
device tree compatible gpio configuration flags. Implements new port
get/set/clear/toggle and pin_interrupt_configure functions recently
added to the gpio api.

Tested with:

samples/basic/blinky
samples/basic/button
tests/drivers/gpio/gpio_api_1pin
tests/drivers/gpio/gpio_basic_api

On boards:

cc3220sf_launchxl
cc3235sf_launchxl

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot 4549d379da treewide: use full path to pinmux.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Ulf Magnusson 5c1a3fd6f7 boards: cc322xsf_launchxl: Do not assign promptless HAS_CC3220SDK sym
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is (always) selected, in
soc/arm/ti_simplelink/cc32xx/Kconfig.soc.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-15 18:02:48 -05:00
Ulf Magnusson f200e76773 boards: kconfig: Do not assign promptless SOC_FAMILY_TISIMPLELINK
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is selected by the SOC_SERIES_CC13X2_CC26X2,
SOC_SERIES_CC2650, SOC_SERIES_CC32XX, and SOC_SERIES_MSP432P4XX symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-15 18:01:26 -05:00
Ulf Magnusson 8f8f69e283 boards: kconfig: Do not assign promptless SERIAL_HAS_DRIVER
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is enabled through being selected by other symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:35:26 -05:00
Ulf Magnusson 1f38ea77ba kconfig: Clean up 'config FOO' (two spaces) definitions
Must've been copy-pasted around.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05: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
Vincent Wan 89930a4259 boards: cc3235sf_launchxl: use OpenOCD from Zephyr SDK
We should use OpenOCD from the latest Zephyr SDK as opposed to using TI
OpenOCD.

There is a known issue with the current release (0.10.2) of the SDK in
how it resets the network processor, but we can deal with it
subsequently.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 10:22:30 +03:00
Vincent Wan 8afe649144 boards: cc3235sf_launchxl: add support for TI CC3235SF LaunchPad
This commit adds the TI CC3235SF LaunchPad as a new board in Zephyr.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-09-10 10:22:30 +03:00