Commit Graph

37 Commits

Author SHA1 Message Date
Gaël PORTAY 7bc822df04 boards: esp32: Fix documentation spelling
This fixes a simple documentation spelling typo on SoC name.

Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
2023-10-06 12:20:27 +01:00
Anas Nashif c3827ec48e boards: add vendor to board yaml
This is coming from devicetree and corrosponds to what we have in the
dts/bindings/vendor-prefixes.txt file.

This will allow for static filtering, especially with twister, i.e. no
need to build anything to know the vendor of a board

All of the vendor data was extracted automatically from the devicetree,
so some platforms might not have the right vendor or no vendor at all
right now, we need to fix some of the DTS information or do this
manually to get this 100% correct. But we are close.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-22 09:29:36 +02:00
Benjamin Cabé 4f1cd0e428 doc: Migrate subsys/ code samples to new Sphinx extension
This migrates the subsys code samples to the new Sphinx code-sample
extension, making it easier to find relevant samples when browsing
API reference.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-21 09:28:31 +02:00
Gerard Marull-Paretas 2e3193e04d boards: xtensa: heltec_wifi_lora32_v2: add missing init.h, device.h
File was using SYS_INIT (init.h) and DEVICE_DT_GET (device.h).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-08-30 11:55:14 +02:00
Fabio Baltieri 57e0da4d80 boards: add zephyr,code properties to the various gpio-keys nodes
Add gpio-keys codes for all boards. These are mostly INPUT_KEY_0 and so
on but I've used some more specific ones where it was obvious that
there's something else on the boards.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-07 11:26:26 +02:00
Marek Matej 6b57b3b786 soc: xtensa,riscv: esp32xx: refactor folder structure
Refactor the ESP32 target SOCs together with
all related boards. Most braking changes includes:

- changing the CONFIG_SOC_ESP32* to refer to
  the actual soc line (esp32,esp32s2,esp32s3,esp32c3)
- replacing CONFIG_SOC with the CONFIG_SOC_SERIES
- creating CONFIG_SOC_FAMILY_ESP32 to embrace all
  the ESP32 across all used architectures
- introducing CONFIG_SOC_PART_NUMBER_* to
  provide a SOC model config
- introducing the 'common' folder to hide all
  commonly used configs and files.
- updating west.yml to reflect previous changes in hal

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Marek Matej 79869f8abd dts: xtensa: esp32xx rework soc/sip list
Introduce dtsi files representing the
current portfolio of chips and modules
based on the followint criteria:

- flash size
- psram size
- gpio count
- certification status

Update the boards dts files according
to which SOC/SIP they are using.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Marek Matej 67357e5618 doc: esp32: Update the building instruction
Cover the 2nd stage bootloader options and
the extend the application build instructions
to include sysbuild.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-05-25 16:15:54 +02:00
Marek Matej 4796746b5e soc: esp32: MCUboot support
This make MCUboot build as Zephyr application.
Providing optinal 2nd stage bootloader to the
IDF bootloader, which is used by default.
This provides more flexibility when building
and loading multiple images and aims to
brings better DX to users by using the sysbuild.
MCUboot and applications has now separate
linker scripts.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-05-25 16:15:54 +02:00
Sylvio Alves c391832342 pinctrl: esp32: fix byte garbage before banner
All ESP32 boards shows a garbage char before Zephyr banner.
This happens during uart TX pin configuration that current
lacks setting as output high.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-05-11 08:26:52 -04:00
Gerard Marull-Paretas a5fd0d184a init: remove the need for a dummy device pointer in SYS_INIT functions
The init infrastructure, found in `init.h`, is currently used by:

- `SYS_INIT`: to call functions before `main`
- `DEVICE_*`: to initialize devices

They are all sorted according to an initialization level + a priority.
`SYS_INIT` calls are really orthogonal to devices, however, the required
function signature requires a `const struct device *dev` as a first
argument. The only reason for that is because the same init machinery is
used by devices, so we have something like:

```c
struct init_entry {
	int (*init)(const struct device *dev);
	/* only set by DEVICE_*, otherwise NULL */
	const struct device *dev;
}
```

As a result, we end up with such weird/ugly pattern:

```c
static int my_init(const struct device *dev)
{
	/* always NULL! add ARG_UNUSED to avoid compiler warning */
	ARG_UNUSED(dev);
	...
}
```

This is really a result of poor internals isolation. This patch proposes
a to make init entries more flexible so that they can accept sytem
initialization calls like this:

```c
static int my_init(void)
{
	...
}
```

This is achieved using a union:

```c
union init_function {
	/* for SYS_INIT, used when init_entry.dev == NULL */
	int (*sys)(void);
	/* for DEVICE*, used when init_entry.dev != NULL */
	int (*dev)(const struct device *dev);
};

struct init_entry {
	/* stores init function (either for SYS_INIT or DEVICE*)
	union init_function init_fn;
	/* stores device pointer for DEVICE*, NULL for SYS_INIT. Allows
	 * to know which union entry to call.
	 */
	const struct device *dev;
}
```

This solution **does not increase ROM usage**, and allows to offer clean
public APIs for both SYS_INIT and DEVICE*. Note that however, init
machinery keeps a coupling with devices.

**NOTE**: This is a breaking change! All `SYS_INIT` functions will need
to be converted to the new signature. See the script offered in the
following commit.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

init: convert SYS_INIT functions to the new signature

Conversion scripted using scripts/utils/migrate_sys_init.py.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

manifest: update projects for SYS_INIT changes

Update modules with updated SYS_INIT calls:

- hal_ti
- lvgl
- sof
- TraceRecorderSource

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

tests: devicetree: devices: adjust test

Adjust test according to the recently introduced SYS_INIT
infrastructure.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>

tests: kernel: threads: adjust SYS_INIT call

Adjust to the new signature: int (*init_fn)(void);

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-12 14:28:07 +00:00
Sylvio Alves 0567557d4f boards: esp32xx: update BT heap of all espressif boards
Current internal BT heap uses custom heap area, which reserves
unused RAM area. In order to free up some RAM, BT HAL
implementation was changed to use sysheap instead.
With this change, something around ~13kb is now available for
application, optmizing RAM usage.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-03-27 13:19:38 +00:00
Sylvio Alves 839050b994 boards: esp32: add default HEAP for all ESP32 boards
In order to avoid missing k_malloc options, add default
HEAP value for all boards.

Fixes #54428

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-02-14 20:53:22 +09:00
Sylvio Alves 42b33382f7 driver: clock: esp32: retrieve HW clock from DTS
ESP32 and ESP32-S2 HW clock are tied to DTS clock configuration.
This changes updates the default configuration to retrieve
this information from DTS.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-01-03 17:12:06 -05:00
Gaël PORTAY 15ffcb2845 boards: heltec_wifi_lora32_v2: fix indentations
This removes an empty line before closing the leds, and wraps the GPIO
button in a single line.

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-11-23 11:33:55 +01:00
Gaël PORTAY cd9d2db892 boards: heltec_wifi_lora32_v2: enable lora
This enables the support for the Semtech SX1276 chip on board (see the
pinout[1] and schematic[2] documents).

The chip is connected to SPI as follow:

| PIN  | GPIO   |
| ---- | -------|
| CS#  | GPIO18 |
| CLK  | GPIO5  |
| MOSI | GPIO27 |
| MISO | GPIO19 |
| RST# | GPIO14 |

Additionally, the LoRa DIO PINs are connected as follow:

| PIN  | GPIO   |
| ---- | -------|
| DIO0 | GPIO26 |
| DIO1 | GPIO35 |
| DIO2 | GPIO34 |

_Note_: The first three DIO PINs are connected to the ESP32 MCU only.

[1]: https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.1.pdf
[2]: https://resource.heltec.cn/download/WiFi_LoRa_32/V2/WIFI_LoRa_32_V2(868-915).PDF

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-10-31 11:23:20 +01:00
Thomas Stranger 932020d700 boards: remove pinmux as supported feature
The tag that marks pinmux as supported is not used by any test or
sample, therefore this doesn't seem needed anymore.

- remove from 3 mec1x boards, they still use pinmux,
  but as the tag is neither used in tests and pinmux
  deprecated anyway no need for it.
- remove from 5 esp32 boards, as they now use pinctrl.
- remove from 2 lpc boards, as they now use pinctrl.
- remove from 1 stm32 board, as it now uses pinctrl.
- remove from 1 npcx board, as it now uses pinctrl.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-09-19 13:54:48 -05:00
Sylvio Alves 9105f1ef61 docs: esp32: update openocd section
This PR removes information regarding previous
west extension related to OpenOCD download.
This extension is no longer available and manual download
is required until upstream OpenOCD receives
all xtensa and riscv patches.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-16 09:02:41 +01:00
Michael Laß 53af1ba59e boards: heltec_wifi_lora32_v2: improve documentation
* Document use of OLED display.
* Fix indentation in list of features.
* References are only rendered if they are used and currently most of
  them are not. Introduce a list of links in addition to the actual
  references to make them show up.

Signed-off-by: Michael Laß <bevan@bi-co.net>
2022-09-12 20:08:39 +00:00
Michael Laß fec126f190 boards: heltec_wifi_lora32_v2: enable trng0
trng0 refers to the entropy source in the ESP32, as defined in
esp32.dtsi. It enables the configuration item ENTROPY_ESP32_RNG and
therefore offers an entropy driver, making the use of
CONFIG_TEST_RANDOM_GENERATOR unnecessary.

This change helps running the esp32_wifi_station sample.

Signed-off-by: Michael Laß <bevan@bi-co.net>
2022-09-12 20:08:39 +00:00
Sylvio Alves a1a22f348b docs: esp32: add binary blobs documentation info
Updates all ESP32 boards with proper binary blob
download command.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-01 21:48:18 +00:00
Kumar Gala f2fa572561 entropy: remove Kconfig.defconfig* setting of entropy drivers
Now that entropy drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 23:37:33 -05:00
Gerard Marull-Paretas ada8d72888 boards: remove non-minimal peripherals from defconfig
According to the board porting guidelines, boards should "leave
peripherals and their drivers disabled by default". In Zephyr we
tipically enable GPIO and SERIAL, as they are virtually required by all
samples/tests in tree. However, for the rest of peripherals it is up to
the application/test to enable the necessary driver classes. It is also
useful that board's Kconfig.defconfig enables certain driver peripherals
based on a condition, e.g. enable I2C if SENSOR=y.

Ref. https://docs.zephyrproject.org/latest/hardware/porting/
board_porting.html#general-recommendations

This patch removes the following driver classes from defconfig files:

- CONFIG_ADC
- CONFIG_COUNTER
- CONFIG_EEPROM
- CONFIG_ENTROPY
- CONFIG_ESPI
- CONFIG_HWINFO
- CONFIG_I2C
- CONFIG_LED
- CONFIG_NETWORKING
- CONFIG_PS2
- CONFIG_PWM
- CONFIG_SENSOR
- CONFIG_SPI
- CONFIG_SPI_SLAVE
- CONFIG_WATCHDOG

Note that a previous attempt was done in #38510.

Fixes #30694

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Kumar Gala 35d93ef7bc drivers: i2c: esp32: Rework SDA/SDL pins as gpios in devicetree
For the !SOC_I2C_SUPPORT_HW_CLR_BUS in which we implement bus
reset via GPIOs, change the devicetree properties to be actual
gpio properties and update the code to reflect this.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 12:10:58 -05:00
Kumar Gala 1c1c57b31b gpio: remove defconfig/proj setting of GPIO drivers
Now that gpio drivers are enabled based on devicetree we can remove
any cases of them getting enabled by *defconfig and proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 08:49:38 +02:00
Benjamin Björnsson ab4a926c27 boards: Add alias to boards with watchdog enabled
Add alias to boards with watchdog enabled to facilitate the
move of samples/drivers/watchdog to use DT_ALIAS.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Glauber Maroto Ferreira ef76f1ae42 boards: xtensa: heltec_wifi_lora32_v2: dts: use pin grouping
update device tree pin states definitions and node
descriptions to group pins sharing common properties.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-01 16:22:18 +00:00
Kumar Gala 01640b9cda boards: remove usage of DT_LABEL
A number of boards utilize device_get_binding(DT_LABEL(...)) to
get a gpio for some purpose.  Switch over to using DEVICE_DT_GET
and device_is_ready() instead.  This is part of the ongoing
cleanup towards phasing out usage of the "label" property in DTS.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-27 12:45:19 +02:00
Sylvio Alves 922ae85767 boards: esp32: update Espressif boards documentation
Zephyr SDK toolchain integration requires all ESP32 family
board's documentation updates.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-11 10:47:27 +02:00
Sylvio Alves 20fbaaccc4 boards: esp32: added ignore tags
Espressif boards cannot have ble and wifi
CI build tests due to binary blobs policies.
This removes refered tests.

west.yml: update hal repository to get updates
that allows building using Zephyr's SDK.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-11 10:47:27 +02:00
Gerard Marull-Paretas db508379c2 boards: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all boards code to the
new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:57:15 +02:00
Glauber Maroto Ferreira f0479f5458 esp32/s2/c3-based boards: remove pinmux definitions
ESP32/S2/C3-based boards no longer support pinmux, which was
deprecated in favor of pinctrl.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Glauber Maroto Ferreira 758887230e boards: heltec_wifi_lora32_v2: change init priority
making board initialization depend on
GPIO_INIT_PRIORITY.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Glauber Maroto Ferreira 5769e7b07a boards: heltec_wifi_lora32_v2: update CMakeLists.txt
remove dependency on pinmux definition.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Glauber Maroto Ferreira 6dd0d5d24b boards: heltec_wifi_lora32_v2: dts: add default pinctrl states
update peripheral nodes to use default pinctrl states.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Alfredo Dal'Ava Junior 03cc8d0e1b esp32/heltec_wifi_lora32_v2: add documentation
Provides basic documentation based on generic board esp32

Signed-off-by: Alfredo Dal'Ava Junior <alfredo.junior@eldorado.org.br>
2022-03-07 10:46:40 +01:00
Alfredo Dal'Ava Junior 125f15d954 esp32/heltec_wifi_lora32_v2: Add HELTEC ESP32 WiFi LoRa 32 (V2)
Product page: https://heltec.org/project/wifi-lora-32/

Supported:
    - LED
    - PRG Button
    - OLED display

Unsupported:
    - LoRa

Tested with:
    - samples\hello_world
    - samples\basic\blinky
    - samples\basic\button
    - samples\boards\esp32\wifi_station
    - samples\subsys\display\lvgl

Signed-off-by: Alfredo Dal'Ava Junior <alfredo.junior@eldorado.org.br>
2022-03-07 10:46:40 +01:00