Commit graph

64 commits

Author SHA1 Message Date
Daniel Leung f6d8909a6d boards: mec15xxevb_assy6853: use DTS node labels for PWM pinmux
The DT_INST_* macros for PWM may not exactly point to the hardware
instance (e.g. DT_INST_0 may not point to PWM0). So use the node
labels for a more precise match.

Fixes #26782

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-15 06:14:56 -04:00
Jose Alberto Meza bd2a71f6da boards: arm: mchp: Configure VCI pins as GPIOs only when required
Default alternate function for the MEC15xx VCI pins makes them
HW-controlled.
Most common scenario is that pins are used as GPIOs, however
there are still some board designs where HW-controlled is desired.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-06-10 18:32:57 -04: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
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
Daniel Leung 13ef99831a drivers: gpio: mchp_xec: Convert to using new device tree macros
Convert driver to use the new device tree macro's instead of
dts_fixup.h based macros. This moves us closer to removing both
dts_fixup.h and per instance Kconfig symbols.

The pinmux_mchp_xec is also being updated since it's using DT
from GPIO.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Daniel Leung 5692702248 drivers: pinmux: mchp_xec: Convert to using new device tree macros
Convert driver to use the new device tree macro's instead of
dts_fixup.h based macros. This moves us closer to removing both
dts_fixup.h and per instance Kconfig symbols.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Daniel Leung f59d56b534 drivers: spi: xec_qmspi: Convert to using DT_INST macros
Convert driver to use instance macro's instead of dts_fixup.h based
macros.  This moves us closer to removing both dts_fixup.h and per
instance Kconfig symbols.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Daniel Leung 8e916f5745 board: mec15xxevb_assy6853: use new DT macro to refer to UART
Pinmux needs to be set for UART_2 if it is enabled. So use
the new DT macro to refer to the DT node.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Mark Olsson 1ca4aedc35 tests: drivers: fixes for failing tests
Tests were failing as they were looking for an alias which didn't exist
Also, because some code in kscan_handlers.c wasn't compilable

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Kumar Gala 1f603e8d14 boards: arm: mec15xxevb_assy6853: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-03 04:12:14 -05:00
Timo Teräs 6fd168e9a1 driver: uart: ns16550: convert to DT_INST_*
Change to code to use the automatically generated DT_INST_*
defines and remove the now unneeded configs and fixups.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2020-03-14 02:22:05 +02:00
Jose Alberto Meza 8462a372e0 boards : arm : Add PECI support for MEC15xx EVB
Enable PECI block for MEC15 boards.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-13 18:53:04 +02:00
Francisco Munoz e11da0582d boards: arm: mec15xxevb_assy6853: Enable TACH driver
Enables the tachometer driver for microchip evaluation board
mec15xxevb_assy6853.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2020-03-13 08:49:21 -05:00
Francisco Munoz f488d4d1f4 boards: mec15xxevb_assy6853: Disable KSCAN to avoid test case issues
This change addresses issue# 21756 where the expected thread
count does not match because kscan module is enabled in this board.
The Microchip kscan driver is contributing to the total thread count,
therefore interfering with the expected test result.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2020-02-18 19:10:47 -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
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
Daniel Leung d2bce6eb27 boards: mec15xxevb_assy6853: add DTS for PCA9555
There is a GPIO expander connected to I2C0 on board.
This adds the DTS entry.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 83f36b3cff boards: arm/mec15xxevb_assy6853: add LEDs in DTS
This adds LEDs into the DTS file so various GPIO tests can utilize
this definitions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Maksim Masalski e31199a3d4 docs: mec15xxevb assy6853 updated sequence events
During the first real test of my manual by another developer,
I found out that it would be better to update sequence of events.
Also found out misprints, and some actions was not so obvious.
Corrected manual to be more green developers friendly.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-01-24 16:59:03 -08:00
Daniel Leung 549fdb9ec9 i2c: mchp_xec: define driver instaces based on device tree...
...instead of kconfig.

This provides a bit more flexibility in defining driver
instances. Also, since the DTS defines 5 I2C controllers,
the driver code is extended to cover all 5 if the controllers
are enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-18 13:33:20 -05:00
Daniel Leung 6ecb36cbe0 dts: arm: mec1501hsz: rename I2C nodes
The I2C controllers on the MEC1501 SoC can be attached to
different I2C output line. For example, the I2C #0 controller
can be used with I2C7 physical lines out of SoC. The output
selection is done by the attribute "port_sel". This renames
the parent I2C nodes on the SoC side to refer to
the controller themselves instead of the output lines to
avoid confusion. The labels of these nodes are also renamed
to reflect the controllers.

On the board level, the DTS labels are overwritten to indicate
the actual output lines.

Aliases are also provided in both SoC and board levels to
provide shortcuts to the DTS nodes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-18 13:33:20 -05:00
Maksim Masalski 12e7295307 docs: error in mec15xxevb assy6853 in set up manual
Error in that manual.
Header JP39 should have connected jumpers 1-2, 3-4.
In docs I wrote that is to make sure JP39 does not have any jumper.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-01-17 08:32:17 -05:00
Maksim Masalski de345e2a63 docs: mec15xxevb assy6853 updated set up manual
the .. image directive can only have white-space before. Resolved it.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-12-20 13:03:29 -05:00
Maksim Masalski b7f07dcff7 docs: mec15xxevb assy6853 updated set up manual
Setup manual was modified, added detailed description how to launch
and program board, added more photos for better understanding
of the setup process.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-12-20 13:03:29 -05:00
Jose Alberto Meza b3236ebf42 boards: arm: mchp: Enable additional drivers for MEC15xxEVB board
Configure as GPIOs pins that by default are not GPIOs
Enable pinmux for port F
Enable ADC, PWM drivers by default, but keep SPI disabled.
Swap I2C instances since I2C0 is multiplexed with UART2
Select VTR3 as 1.8V

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-12 11:47:50 -08:00
Scott Worley 60915c884f soc : mec1501 : Deep and light sleep example
Created MEC1501 deep and light sleep example for MCHP MEC1501.
Modifications were made to SoC, board, timer, and hello world
sample program. Power management split into SoC power
implementing the interface and device power for device specific
logic.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-12-09 11:57:03 -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
Daniel Leung 265b6ff59e boards: mec15xxevb_assy6853: enable flashing with build command
This utilizes the newly introduced dediprog west flash runner to flash
the image onto the onboard SPI chip.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-03 12:30:45 +01:00
Ulf Magnusson 975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +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
Scott Worley c8b1eb79a1 drivers : spi : mec1501 : XEC SPI driver
SPI driver for MEC1501 QMSPI supporting synchronous only.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2019-10-23 19:18:32 -07:00
Francisco Munoz de1bb01657 boards: mec15xxevb_assy6853: Add Kscan and PS/2 to peripherals
Introduce Kscan and PS/2 to the list of supported peripherals

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Francisco Munoz eb5e97b7ea boards: arm: mec15xxevb_assy6853: Enable Keyboard Scan
Add pinmux and Kconfig switches in order to enable the
keyboard scan matrix driver.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-10-16 13:29:21 -07:00
Jose Alberto Meza 7c32bfa645 boards: mchp: Add option to switch GPIO bank voltage
Add KConfig board support to match board jumper settings
Failing to update bank selection will affect GPIOs tied to VTR3

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-10-04 13:11:08 -07:00
Andrei Emeltchenko c66b269ae6 boards: mec15xxevb_assy6853: Include counter, adc, watchdog to tests
Add counter, adc and watchdog tests to sanity check for the board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-30 12:20:39 -05:00
Daniel Leung f209af2290 boards: mec15xxevb_assy6853: allow custom SPI config file
This adds a way to specify a custom SPI configuration file to be
used with the image generation tool. For example, this can be
used to reduce the SPI image size to allow faster flashing
(e.g. 512KB instead of 16MB).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-27 11:45:37 -04:00
Andrei Emeltchenko a4c319681c boards: mec15xxevb_assy6853: Enable pwm sanitycheck
Enable following sanitychecks

mec15xxevb_assy6853/samples/basic/servo_motor/sample.servo_motor
mec15xxevb_assy6853/tests/drivers/pwm/pwm_api/peripheral.pwm

Run with: sanitycheck -t pwm -p mec15xxevb_assy6853

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-25 13:19:04 -04:00
Andrei Emeltchenko d7c6aec32a boards: mec15xxevb_assy6853: Add PWM alias for tests
Adding alias allows us to build test tests/drivers/pwm/pwm_api

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-25 13:19:04 -04:00
Daniel Leung 511c77474d boards/mec1501: configure pinmux for ADC
This sets the pinmux to do ADC if enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-25 06:12:52 -04:00
Daniel Leung 27319e96c5 boards: mec15xxevb_assy6853: enable ADC in DTS
This enables the ADC block in DTS.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-25 06:12:52 -04:00
Kumar Gala ddfeafa7f7 boards: mec1501modular_assy6885: Reduce image file size
Removed mec15xxevb_assy6853.jpg as its not used and vastly reduced
the image size as the files were extremely large.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-21 13:35:14 -07:00
Andrei Emeltchenko 5e0bfafcf8 doc: mec15xxevb_assy6853: Correct socket name
Fix incorrect SPI socket name.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-20 14:32:12 -04:00
Jose Alberto Meza 437256d17c boards: mec15xxevb: Select physical UART mapped to eSPI host logical port
Map eSPI UART traffic to UART1 on MEC1501 modular board.
Remove unnecessary dts fields

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-09-20 14:30:40 -04:00
Daniel Leung e85407db41 board: mec15xxevb_assy6853: generate flashable image
This adds an extra step at the end of build to generate a flashable
image using Microchip tool available at:
https://github.com/MicrochipTech/CPGZephyrDocs

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-20 09:09:51 -04:00
Daniel Leung e17cc8b4cd boards: mec15xxevb_assy6853: enable PWM in DTS
This enables the PWM blocks in DTS. Only PWM0 has been enabled
and tested due to board/jumper configurations.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-19 20:45:37 -04:00
Daniel Leung 2c3d287794 boards/mec1501: Configure pinmux relevantly for PWM
Each and every instance has a specific pin.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-19 20:45:37 -04:00
Andrei Emeltchenko cf7555a841 boards: mec15xxevb_assy6853: Correct jumper settings
Correct jumper settings.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-09-19 14:40:35 -04:00
Francisco Munoz 35590daeaa boards: mec15xxevb_assy6853: Enable PS/2 devices
Enable PS/2 instances in dts and mux data and clk pins.
It also contains new Kconfig switches for the PS/2 controller

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-09-18 13:23:52 +08:00
Tomasz Bursztyka 403e6f1b99 soc/arm: Add a fixup for counter/alarm sample to compile with MEC1501
There are 2 other timers that could be selected, let's just take the
first 32bits one. This should be sufficient to verify the driver.

Enabling the timer in relevant board's dts file as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-09-14 12:13:49 +08:00