1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

6821 Commits

Author SHA1 Message Date
benpicco
1a30a3a280
Merge pull request #15707 from ML-PA-Consulting-GmbH/fix/20210105__sam0_common-periph-flashpage__fix_unaligned_write
sam0_common/periph/flashpage: fix unaligned write
2021-01-22 20:24:53 +01:00
Marian Buschsieweke
0d432b59fe
Merge pull request #15840 from benpicco/cpu/atmega-rm_ldscripts_compat
cpu/atmega*: drop ldscripts_compat
2021-01-22 20:20:57 +01:00
Benjamin Valentin
236c4db83e cpu/atmega*: drop ldscripts_compat
Those were only needed with very old toolchains.
These days they cause more confusion than benefit, so drop them.
2021-01-22 19:05:20 +01:00
benpicco
e1052f0152
Merge pull request #15833 from yarrick/esp_emac_debug
cpu/esp32: Add newline to emac_main debug prints
2021-01-22 14:36:24 +01:00
517fc585b1
cpu/native: Add dummy thread_arch.h header 2021-01-22 09:21:46 +01:00
Erik Ekman
1d6aa2e865 cpu/esp32: Add newline to emac_main debug prints 2021-01-21 20:55:02 +01:00
Benjamin Valentin
f11fc64af6 cpu/sam0_common: PWM: fix build on samd20
There is no SYNCBUSY register, so the dummy fallback does not work.
This code path is not used anyway, so just ifdef it out.
2021-01-21 20:29:15 +01:00
b1f7fd3905
cpu/stm32: fix wrong max clock for stm32f423xx line 2021-01-21 18:31:15 +01:00
84dfc88ca3
cpu/arm7_common: Inline thread_yield_higher function 2021-01-20 10:37:42 +01:00
Marian Buschsieweke
21264b80cf
cpu/stm32/periph_eth: improve debugging output
Add ENABLE_DEBUG_VERBOSE flag, so that the noise during debugging can be
reduced. This is super helpful when testing under load, as otherwise there is
just too much noise in the output.
2021-01-20 10:36:59 +01:00
Marian Buschsieweke
788f997452
cpu/stm32/periph_eth: fix error handling
An earlier version of periph_eth used to always pack the first chunk of the
outgoing frame to the first DMA descriptor by telling the DMA to jump back
to the first descriptor within the last descriptor. This worked fine unless
the frame was send in one chunk (as e.g. lwip does), which resulted due to a
hardware bug in a frame being send out twice. For that reason, the behavior was
changed to cycle throw the linked DMA descriptor list in round-robin fashion.
However, the error checking was not updated accordingly. Hence, the error
check might run over (parts of) unrelated frames and fail to detect errors
correctly.

This commit fixes the issue and also provides proper return codes for errors.

Additionally, an DMA reset is performed on detected errors during RX/TX. I'm
not sure if/when this is needed, as error conditions are neigh impossible to
produce. But better be safe than sorry.
2021-01-20 10:35:05 +01:00
Francisco
4cc6c23ec6
Merge pull request #15809 from maribu/bitband-fix
sys/bit: provide CPU_HAS_SRAM_BITBAND
2021-01-20 10:22:04 +01:00
Daniel Lockau
ef7cbdb312 cpu/sam0_common/periph/flashpage: fix unaligned writes 2021-01-20 09:55:47 +01:00
Marian Buschsieweke
716441d0c3
cpu/cortexm_common: fix atomic_utils_arch.h
Only use bit-banding if all of SRAM supports bit-banding
2021-01-20 09:19:33 +01:00
Marian Buschsieweke
51db33375a
sys/bit: provide CPU_HAS_SRAM_BITBAND
CPU_HAS_SRAM_BITBAND can be used to check whether bit-banding is supported for
all of SRAM. With partially supported bit-banding, this feature is more of a
foot gun that a valuable tool.
2021-01-20 09:18:09 +01:00
e1941d8976
cpu/stm32f2f4f7: expose clock settings in Kconfig 2021-01-19 22:09:16 +01:00
b35e4f4a95
Merge pull request #15796 from fjmolinas/pr_rtc_lock_unlock
cpu/stm32/rtc: add unlock/lock to rtc_clear_alarm
2021-01-19 17:29:22 +01:00
Francisco Molina
7c12ea7416
cpu/stm32/rtc: add unlock/lock to rtc_clear_alarm 2021-01-19 13:33:17 +01:00
bce9e3caeb
cpu/msp430_common: Add dummy thread_arch.h header 2021-01-19 11:03:22 +01:00
0b01a999be
cpu/mips32r2_common: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
9979646b8b
cpu/fe310: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
0129e73ec0
cpu/cortexm_common: Inline thread_yield_higher function 2021-01-19 11:03:21 +01:00
0d43c96ac7
cpu/avr8_common: Add dummy thread_arch.h header
The thread_yield_higher function is complex enough to not inline it for
the avr8 cpu
2021-01-19 11:03:21 +01:00
6d3d067443
cpu/cortexm_common: Do not use SVC for cpu_switch_context_exit
Directly use the pendsv interrupt instead of chaining through the SVC
interrupt
2021-01-18 16:27:17 +01:00
Leandro Lanzieri
63407b5e5b
cpu/lpc23xx/mci: add module to Kconfig 2021-01-18 10:42:34 +01:00
ba518ede09
cpu/fe310: Uncrustify code 2021-01-15 12:02:55 +01:00
Marian Buschsieweke
253a634b85
Merge pull request #15636 from jia200x/pr/nrf802154/fix_rssi
radio/nrf802154: fix set_cca_threshold range
2021-01-14 15:28:29 +01:00
Jose Alamos
f2fa3ca12f
radio/nrf802154: fix set_cca_threshold range
This commit fixes the CCA threshold range for set_cca_threshold.
Without this commit the threshold overflows when using values below
the receiver sensitivity.
2021-01-14 14:33:56 +01:00
Jose Alamos
698df63cfb
nrf802154/hal: fix unwanted emissions at the end of ACK frame
This commit turns off the transceiver immediately after sending an ACK
frame in order to avoid unwanted emissions (see ERRATA ID 204).
When the radio stays in TX_ON without an explicit transition, the radio
keeps sending a spurious signal for some milliseconds.
2021-01-14 11:06:11 +01:00
Jose Alamos
3c56cdf0c0
cc2538_rf/radio_hal: fix transmit function
This commit sets the correct value to the MCU_CTRL bit for the
cc2538_rf. This variable is used to detect when the radio is doing
transmission with CCA. Since this was not set to 1 when sending without
CCA, the `confirm_transmit` function returned -EAGAIN after the TX_DONE
event (which violates the HAL API).

This error was discovered using some Radio HAL riotctrl scripts by @LarsKowoll.
2021-01-14 10:34:50 +01:00
José Alamos
2bf10413d0
Merge pull request #15397 from fjmolinas/pr_ieee802154_crc_error
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR
2021-01-14 10:29:17 +01:00
Francisco Molina
fe1e16cdc7
sys/net/iee802154/radio: add IEEE802154_RADIO_INDICATION_CRC_ERROR 2021-01-13 23:42:41 +01:00
Francisco Molina
6d4d00ebe9
cpu/nrf52/nrf802154_radio: fix rssi calculation 2021-01-13 19:45:13 +01:00
Francisco Molina
f8bc934785
cpu/cc2538/radio/cc2538_rf_radio_ops: fix rssi reporting 2021-01-13 19:45:11 +01:00
Marian Buschsieweke
605220ce06
Merge pull request #15736 from bergzand/pr/riscv/use_ecall
cpu/fe310: Use ecall instruction for thread yield
2021-01-13 14:03:19 +01:00
Marian Buschsieweke
582f8d8430
Merge pull request #15754 from maribu/rssi
sys/net/gnrc: fix in-band signaling of no RSSI
2021-01-13 13:28:06 +01:00
5a203413a1
cpu/fe310: Remove software IRQ handling 2021-01-13 12:51:32 +01:00
1b2adb4821
cpu/fe310: Use ecall instruction for thread yield 2021-01-13 12:51:25 +01:00
Marian Buschsieweke
e2c5467d09
cpu/nrf5x_common/radio/nrfmin: drop duplicated code
`gnrc_netif_hdr_build()` calls internally `gnrc_netif_hdr_init()`, which does
initialize `gnrc_netif_hdr_t::rssi` and `gnrc_netif_hdr_t::lqi`. So no need to
do this twice.
2021-01-13 08:53:17 +01:00
Benjamin Valentin
3a7aa5d09a cpu/sam0_common: RTC: add timeout to spurious tamper event
Errate 2.17.4 says:

> Upon enabling the RTC tamper detection feature, a false tamper
> detection *can* be reported by the RTC.

It turns out that this spurious event is not always generated.
If RTC alarm is used and the CPU was previously woken from hibernate
by RTC, it *can* happen that the false tamper event is *not* generated.

In this case, we will block indefinitely on the mutex.

To solve this, add a timeout to the event.
Also poll the event instead of using a mutex, as we have already set
`PM->SLEEPCFG.bit.SLEEPMODE` at this point.
2021-01-12 17:36:40 +01:00
Benjamin Valentin
5b11da01c1 cpu/sam0_common: UART: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
93d27bb9a0 cpu/sam0_common: I2C: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
81e06f46a4 cpu/samd21: add samd20 to Kconfig 2021-01-12 15:48:39 +01:00
Benjamin Valentin
31b8dad147 cpu/samd21: add support for SAMD20 2021-01-12 15:48:39 +01:00
Benjamin Valentin
7b65398ae1 cpu/sam0_common: add samd20 vendor files
Files from Atmel.SAMD20_DFP.1.3.165.atpack
2021-01-12 15:48:39 +01:00
Benjamin Valentin
8004aa4d34 cpu/sam0_common: not every CPU has DMA 2021-01-12 15:48:37 +01:00
Leandro Lanzieri
2cf3c603c7
cpu/kinetis/timer: consider no LPTMR when no config present 2021-01-12 15:31:37 +01:00
dylad
bca340d338 cpu/nrf52: update RIOTBOOT_LEN w/ MODULE_USBUS_DFU 2021-01-12 11:34:22 +01:00
dylad
9d02efb4ea cpu/cortexm_common: increase RIOTBOOT_LEN size when usbus_dfu is used 2021-01-12 11:34:22 +01:00
Martine Lenders
19565f4aea
Merge pull request #15741 from aabadie/pr/boards/lpc1768_common_conf
boards/lpc1768: move vendor conf code to CPU level
2021-01-12 10:30:03 +01:00
Sebastiaan de Schaetzen
6e90111eb9 stm32/periph/uart: set flow control bits before enabling uart 2021-01-12 07:37:19 +01:00
Jens Wetterich
450ede0da0 cpu/esp_common: Add missing includes and ISO-C++ compatibility 2021-01-10 18:02:39 +01:00
1090e55683
boards/lpc1768: move vendor conf code to CPU level 2021-01-08 21:47:10 +01:00
b13598cdc4
cpu/stm32: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
ba85c2d9ca
cpu/sam0_common: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
8dbe37969b
cpu/qn908x: fix ENABLE_DEBUG definition 2021-01-08 14:37:33 +01:00
189f7d862d
cpu/esp32: fix typo in timer documentation 2021-01-08 12:04:24 +01:00
8acf9398e8
Merge pull request #15723 from aabadie/pr/tools/codespell_fixes
tools/codespell: fix new typos found by recent version + add new ignored words
2021-01-08 11:01:49 +01:00
b4458e73f2
cpu/esp32: fix typo in Doxygen comment
depenend => depend
2021-01-08 10:15:32 +01:00
Leandro Lanzieri
131c0069d8
Merge pull request #15706 from aabadie/pr/cpu/stm32_mco_kconfig
cpu/stm32: model MCO clock configuration in kconfig
2021-01-08 09:49:00 +01:00
Bas Stottelaar
31c5c4988e
Merge pull request #15377 from basilfx/feature/efm32_slstk3400a
boards/slstk3400a: add support
2021-01-08 07:29:03 +01:00
Gerson Fernando Budke
1426e15679 cpu/avr8_common: Normalize method prefix name
Refactor atmega_ prefix to avr8_ prefix and update copyrights.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:42 -03:00
Gerson Fernando Budke
4cbd311196 cpu: Refact atmega_common into avr8_common
Split atmega_common code into avr8_common folder.  This moves common
avr8 code to be used for all avr8 variants: tiny, mega and xmega.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:29:22 -03:00
Gerson Fernando Budke
a0028a9ff8 cpu/atmega_common: Split cpu.c into atmega_cpu/cpu.c
Split cpu.c file into cpu.c and atmega_cpu.c files.  This extract mega
specific code from common code.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
Gerson Fernando Budke
4d68dd5aea cpu/atmega_common: Extract clock definitions
Refactor clock definitions from cpu.h to clock.h.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-01-07 16:17:05 -03:00
d027454ad4
cpu/stm32/kconfig: use depends on instead of if 2021-01-07 16:07:04 +01:00
e8a5493080
cpu/stm32: model MCO in Kconfig for l4/wb 2021-01-07 16:02:30 +01:00
0e39c2ba17
cpu/stm32: model MCO in Kconfig for l0/l1 2021-01-07 16:02:29 +01:00
a9b154b4ac
cpu/stm32: model MCO in Kconfig for g0/g4 2021-01-07 16:02:29 +01:00
1f0e6c1057
cpu/stm32: model MCO in Kconfig for f0/f1/f3 2021-01-07 16:02:29 +01:00
5e719816d2
cpu/stm32/kconfigs: select cpu fam/lines without mco prescaler 2021-01-07 16:02:29 +01:00
Bas Stottelaar
d831a7e746 cpu/efm32: adapt MPU-capable cpus 2021-01-06 23:44:54 +01:00
Bas Stottelaar
ef8985fbbd cpu/efm32: add support for efm32hg family 2021-01-06 23:44:53 +01:00
Marian Buschsieweke
4714e38911
cpu/atmega_common: drop unused module
The module cpu_atmega_common_cxx seems to be non-existing and not used. It is
unclear whether this slipped in by accident or if this was actually useful at
some point in time. In any case, the module is not present (anymore) and cannot
be used, so let's clean up the Makefile.
2021-01-06 20:46:56 +01:00
Marian Buschsieweke
b14ca8318e
Merge pull request #15680 from maribu/msp430-malloc
cpu/msp430_common: use malloc_thread_safe
2021-01-03 11:21:03 +01:00
Marian Buschsieweke
cc8070cede
Merge pull request #15681 from maribu/mips-malloc
cpu/mips32r2_common: use malloc_thread_safe
2021-01-03 11:20:41 +01:00
Jens Wetterich
e36a0d883a esp_common/esp_now: use netdev_register() 2020-12-23 19:44:57 +01:00
73d3232f67
Merge pull request #15673 from maribu/fe310-malloc
cpu/fe310: use malloc_thread_safe
2020-12-21 13:29:02 +01:00
Marian Buschsieweke
9a61e27f8d
Merge pull request #15679 from maribu/arm7-malloc
cpu/arm7_common: use malloc_thread_safe
2020-12-21 10:00:34 +01:00
benpicco
7d8f801b20
Merge pull request #15650 from aabadie/pr/cpu/stm32_clk_merge_f0f1f3
cpu/stm32: merge f0/f1/f3 clock configuration headers
2020-12-20 02:31:12 +01:00
iosabi
70113b5fd3 cpu/qn908x: Implement blocking I2C support
This initial I2C support allows to use the I2C bus in controller mode to
interact with multiple peripherals in blocking mode. The CPU will
perform a busy wait when transferring data over I2C.
2020-12-19 22:41:57 +00:00
Marian Buschsieweke
7f7bf8454b
cpu/mips32r2_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 18:17:32 +01:00
Marian Buschsieweke
dfb67cef91
cpu/msp430_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 17:30:40 +01:00
Marian Buschsieweke
915d14eb98
cpu/arm7_common: use malloc_thread_safe
This should fix concurrent dynamic memory allocation.
2020-12-18 17:23:12 +01:00
Martine Lenders
6646682873
Merge pull request #15611 from benpicco/boards/eui_provider.h
net/eui_provider: API cleanup
2020-12-18 15:02:57 +01:00
Marian Buschsieweke
277ddcb108
cpu/cortexm_common: fix select in Kconfig
Only select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG is true.
2020-12-18 12:50:33 +01:00
Marian Buschsieweke
b422ef9970
cpu/fe310: use malloc_thread_safe 2020-12-18 10:29:37 +01:00
Leandro Lanzieri
a76deec9a8
Merge pull request #15646 from aabadie/pr/cpu/fe310_common_clock_kconfig
cpu/fe310: boards/hifive1*: move all clock configuration at CPU level
2020-12-18 09:46:34 +01:00
Marian Buschsieweke
c8d16d21f7
Merge pull request #15606 from maribu/malloc-newlib-picolibc
sys/malloc_thread_safe: new module
2020-12-17 19:55:32 +01:00
dc77914ce8
cpu/fe310: add clock configuration header 2020-12-17 15:53:31 +01:00
aaca1331ca
cpu/fe310: move clock Kconfig to cpu 2020-12-17 15:53:31 +01:00
Marian Buschsieweke
09b41d2e1e
cpu/cortexm_common: use malloc_thread_safe module 2020-12-17 15:39:05 +01:00
Marian Buschsieweke
902aa29b62
sys/malloc_thread_safe: split out of cpu/atmega_common
Split out Gunar Schorcht's clever approach to provide thread safe malloc for
AVR into a system module and make AVR depend on this. This allows other
platforms to also use this.
2020-12-17 15:39:05 +01:00
048e8446ef
cpu/stm32f0: remove old clock configuration header 2020-12-17 08:38:40 +01:00
45c2b19f25
cpu/stm32: merge f0f1f3 clock configuration headers 2020-12-17 08:38:40 +01:00
ab477a94b0
Merge pull request #15635 from bergzand/pr/cortex_m0/pendsv_r12_clobber
cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M0
2020-12-15 22:58:25 +01:00
Kevin "Tristate Tom" Weiss
5a1dabc025
Merge pull request #15639 from dylad/pr/saml11/fix_iobus_gpio
cpu/saml11: fix GPIO/IOBUS management
2020-12-15 20:52:29 +01:00
dylad
e98459f414 cpu/saml11: fix GPIO/IOBUS management 2020-12-15 17:00:54 +01:00
8f1a42cbbf
cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M0 2020-12-15 13:16:02 +01:00
Daniel Lockau
33afc0ddab cpu/native/rtc: add rtc_set_time implementation 2020-12-15 12:52:35 +01:00
Dylan Laduranty
aec905d697
Merge pull request #15620 from benpicco/cpu/sam0_common/dac_startup
cpu/sam0_common: DAC: wait for DAC to be ready
2020-12-15 12:25:32 +01:00
benpicco
89c32e5be2
Update cpu/cc2538/include/cc2538_eui_primary.h
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2020-12-14 15:23:13 +01:00
Benjamin Valentin
fe9ae5bc80 net/eui_provider: provide index to the callback function
If the same callback function is used for multiple interfaces
(`NETDEV_INDEX_ANY`), it is necessary to also provide the index of
the interface to hand out and address.
2020-12-14 00:22:18 +01:00
dylad
c934d5dde3 kconfig: add PERIPH_ETH feature to samd5x 2020-12-13 22:30:54 +01:00
dylad
a1f5b6182d cpu/sam0: add initial Ethernet support 2020-12-13 22:01:50 +01:00
Benjamin Valentin
c5c46ba35b cpu/sam0_common: DAC: wait for DAC to be ready
The DAC can have some start-up delay.
If we try to write to it before it's ready, it will get stuck.

This happens now that `tests/driver_dac_dds` immediately sets a DAC
value after init.

The samd2x class of MCUs doesn't have this bit, but a quick test on
samd10 shows that it might not be nececary there - the DAC does not
get stuck when writing to it immediately after init.
2020-12-13 02:11:36 +01:00
Benjamin Valentin
8f72212eb0 cpu/sam0_common: SPI: add support for QSPI in SPI mode
We can use the QSPI peripheral as an additional (non-Quad) SPI peripheral.
2020-12-11 22:33:08 +01:00
Benjamin Valentin
94c7f40b9c cpu/sam0_common: SPI: add support for SAMD20 2020-12-11 22:33:07 +01:00
Benjamin Valentin
fb2a6b7024 cpu/sam0_common: SPI: cleanup
Insert whitespace and factor out functions to make it easier to
add functionality.
2020-12-11 22:33:07 +01:00
Benjamin Valentin
b6642a8cb7 cpu/samd21: add samd10 to Kconfig 2020-12-11 18:25:36 +01:00
Benjamin Valentin
a94919aeed cpu/samd21: add support for SAMD10 2020-12-11 18:25:36 +01:00
Benjamin Valentin
531fca952b cpu/sam0_common: add samd10 vendor files
Files from Atmel.SAMD10_DFP.1.1.77.atpack
2020-12-11 18:25:36 +01:00
benpicco
e6a4d0a4d5
Merge pull request #15569 from fjmolinas/pr_cc2538_uart_nonblocking
cpu/cc2538: add periph_uart_nonblocking
2020-12-11 10:57:36 +01:00
Francisco Molina
bc737a1f76
cpu/cc2538: add periph_uart_nonblocking
Add periph_uart_nonblocking. Since cc2538 has a transmit FIFO write
to the FIFO first and to a tsrb buffer only when the transmit FIFO
is full.

Rely on the FIFO TXIFLSEL condition to fill up FIFO as space becomes
available.
2020-12-11 09:36:16 +01:00
benpicco
c5b5788eb7
Merge pull request #15570 from benpicco/sys/bit.h
sys/bit: move bit.h header to sys/
2020-12-11 08:36:36 +01:00
Francisco
7bbe36ff6b
Merge pull request #15588 from benpicco/native/pm_layered
cpu/native: pm: fix build with pm_layered
2020-12-10 13:05:45 +01:00
Leandro Lanzieri
c4d832e653
Merge pull request #15001 from aabadie/pr/boards/stm32f0f1f3_clock_kconfig_only
boards/stm32f1f3: model clock configuration in Kconfig
2020-12-09 14:04:25 +01:00
benpicco
dd7a268ef8
Merge pull request #15527 from Einhornhool/pr/nrf52_i2c_reconfigure
cpu/nrf52: Add i2c reconfigure feature
2020-12-08 21:09:55 +01:00
Einhornhool
40d749644f cpu/nrf52: Add i2c reconfigure for use with CryptoAuth devices 2020-12-08 21:27:03 +02:00
Benjamin Valentin
d7ed3418b5 cpu/native: pm: fix build with pm_layered 2020-12-08 18:24:02 +01:00
8f6005b26e
boards: cpu: stm32f1: use .config for specific iotlab PLL_PREDIV 2020-12-08 18:02:57 +01:00
Francisco
ee80e5aced
Merge pull request #15534 from jia200x/pr/cc2538_rf_submac
cc2538_rf: default to netdev_ieee802154_submac
2020-12-08 17:59:37 +01:00
c68f63b318
cpu/stm32f1f3: handle custom pll prediv/mul at cpu level 2020-12-08 17:36:52 +01:00
0f23c875a2
cpu/stm32: adapt Kconfig clock configuration for f1/f3 2020-12-08 17:36:51 +01:00
Benjamin Valentin
e300dfe47e sys/bit: move bit.h from cortexm_common/ to sys/
The bit access functions are not tied to Cortex-M CPUs, here they only
provide optimisations via bit-banding.

But the functions are generally useful - so move them to an arch independent
location.
2020-12-08 17:07:41 +01:00
04ca147f59 cpu/cortexm_common: fix r12 clobber in pendsv for Cortex-M3+ 2020-12-08 13:29:54 +01:00
977f0dfd70 cpu/cortexm_common: split isr_pendsv() 2020-12-08 10:14:45 +01:00
iosabi
3890091ced cpu/qn908x: Add the RTC module.
This patch implements the real time clock module for the QN908X cpus.

This module is very straightforward with only the one notable drawback
that it doesn't have a match register like the CTIMER block to implement
the alarm function. Instead, this driver can only use the interrupt
generated ever 1 second to implement the alarm match comparison in
software.
2020-12-06 20:49:51 +00:00
iosabi
ac4c4d6132 cpu/qn908x: Fix triggering GPIO IRQ.
The IRQ for each GPIO port needs to be enabled in the NVIC on top of
enabling the corresponding bit in the GPIO port.

This was not caught in tests before because I was testing with a larger
stack of commits (including UART and timers) which also had this fix.

Manually poking the GPIOs while using tests/periph_gpio now properly
fires the interrupts.
2020-12-06 18:07:44 +00:00
benpicco
f72e98d0a0
Merge pull request #15557 from iosabi/qn908x_ctimer
cpu/qn908x: Add timer driver based on CTIMER.
2020-12-05 17:36:36 +01:00
iosabi
ef4b58f4f0 cpu/qn908x: Add timer driver based on CTIMER.
The QN908x CPU has several timer modules: one RTC (Real-Time Clock) that
can count from the 32kHz internal clock or 32.768 kHz external clock,
four CTIMER that use the APB clock and have four channels each and one
SCT timer with up to 10 channels running on the AHB clock.

This patch implements a timer driver for the CTIMER blocks only, which
is enough to make the xtimer module work. Future patches should improve
on this module to support using the RTC CNT2 32-bit free-running
counter unit and/or the SCT timer.
2020-12-04 23:18:27 +01:00
iosabi
80bd203b4d cpu/qn908x: Add missing gpio & uart enum values.
GPIO_BOTH gpio_flank_t; UART_PARTY_MARK and UART_PARTY_SPACE in
uart_parity_t; and UART_DATA_BITS_5 and UART_DATA_BITS_6
uart_data_bits_t enum values where missing from the periph_cpu.h header
since they are not supported by the CPU. This was causing some tests to
fail to compile, but only after adding the periph_timer module.

This patch adds those missing macros and makes the corresponding
functions fail when trying to use them.

A minor fix to the NWDT_TIME_LOWER_LIMIT value setting it to 1U to avoid
a -Werror=type-limits error in the tests/periph_wdt test. In theory 0
is a totally valid value although a bit useless since it will trigger
the WDT right away.
2020-12-04 23:18:27 +01:00
benpicco
ffebb5d792
Merge pull request #15529 from chrysn-pull-requests/nrf5x-periph_timer_periodic
cpu/nrf5x: implement periph_timer_periodic
2020-12-04 22:02:50 +01:00
chrysn
e3e89fe513 cpu/nrf5x: implement periph_timer_periodic 2020-12-04 19:03:44 +01:00
iosabi
bd929a3746 cpu/qn908x: Add support for UART.
The QN908x has four FLEXCOMM interfaces that support a subset of UART,
SPI or I2C each one. This patch adds generic support for dealing with
the FLEXCOMM initialization and interrupts and adds a driver for
RX/TX support in UART.

With this patch is now possible to use a shell on the device over UART.
2020-12-03 20:53:49 +01:00
benpicco
a80631a297
Merge pull request #15074 from maribu/ptp-clock
drivers/periph/ptp_clock
2020-12-03 09:59:07 +01:00
Marian Buschsieweke
ea3752db77
cpu/stm32: Added PTP clock implementation 2020-12-02 17:53:00 +01:00
benpicco
646e665a86
Merge pull request #13855 from iosabi/qn908x_initial
cpu/qn908x: Initial minimal support for NXP QN908x CPUs.
2020-12-02 10:31:38 +01:00
iosabi
cde8ac6093 cpu/qn908x: Initial minimal support for NXP QN908x CPUs.
The NXP QN908x CPU family is a Cortex-M4F CPU with integrated USB,
Bluetooth Low Energy and in some variants NFC. This patch implements the
first steps for having support for this CPU.

While the QN908x can be considered the successor of similar chips from
NXP like the KW41Z when looking at the feature set, the internal
architecture, boot image format and CPU peripherals don't match those
in the Kinetis line. Therefore, this patch creates a new directory for
just the QN908x chip under cpu/qn908x.

The minimal set of peripherals are implemented in this patch to allow
the device to boot and enable a GPIO: the gpio and wdt peripheral
modules only.

The wdt driver is required to boot and disable the wdt. On reset, the
wdt is disabled by the chip, however the QN908x bootloader stored in
the internal ROM enables the wdt and sets a timer to reboot after 10
seconds, therefore it is needed to disable the wdt in RIOT OS soon
after booting. This patch sets it up such that when no periph_wdt module
is used the Watchdog is disabled, but if the periph_wdt is used it must
be configured (initialized) within the first 10 seconds.

Tests performed:
Defined a custom board for this CPU and compiled a simple application
that blinks some LEDs. Manually tested with periph_wdt and with
periph_wdt_cb as well.
2020-12-02 02:47:07 +00:00
iosabi
21fd1f9258 Add vendor files for the NXP QN908x cpu
In preparation for adding support for the QN908x cpus, this patch adds
a pristine copy of the vendor SDK files needed for initial support.
The only modification to these files is to add '#ifdef __cplusplus'
guards to all the header files, even if not needed or already
present as '#if defined(__cplusplus)', to make sure
./dist/tools/externc/check.sh check passes.

These files are located under vendor/ directories (both
cpu/qn908x/include/vendor/ and cpu/qn908x/vendor/) and are part of NXP's
SDK for the QN908x family available for download from:
  https://mcuxpresso.nxp.com/en/builder

The files included in these vendor/ directories are released by NXP
under an Open Source license as described in each file, but only the
files used by the next patch are included here.
2020-12-02 02:45:53 +00:00
benpicco
418aaa6e67
Merge pull request #15388 from benpicco/boards/e104-bt5010a-tb
boards/e104-bt5011a-tb: add support for the E104-BT5011A Test Board
2020-12-02 00:24:33 +01:00
Jose Alamos
28ca3e202f cc2538_rf: default to netdev_ieee802154_submac 2020-12-01 13:20:49 +01:00
Martine Lenders
e2af953cc8
Merge pull request #15132 from benpicco/nrf802154-submac
cpu/nrf52: nrf802154: default to netdev_ieee802154_submac
2020-12-01 12:23:42 +01:00
b0b19203a7
Merge pull request #15190 from benpicco/boards/wefun-f401cc
boards/common/weact-f4x1cx: create common WeAct boards
2020-12-01 12:03:38 +01:00
Benjamin Valentin
fea9e68b88 nrf802154: don't hard-code max TX power
The smaller family members only have 4dBm max output power.
2020-12-01 11:42:52 +01:00
d527ab6994
cpu: boards: esp: use common esptool makefile 2020-12-01 10:36:42 +01:00
Francisco
4afc04523c
Merge pull request #14490 from yarrick/esp32_eth_kit
boards: add support for the ESP32-Ethernet-Kit board
2020-12-01 10:09:36 +01:00
Benjamin Valentin
0ed34cdb4d cpu/stm32: periph_eth: drop addr from eth_conf_t
MAC address is now supplied by EUI provider, no need to hard-code
it for the board.
2020-11-29 23:11:14 +01:00
Benjamin Valentin
a28a60f16c cpu/stm32: periph_eth: register with netdev 2020-11-29 23:10:37 +01:00
6e658868e0
cpu/cc2538: enable UART IRQ only if cb is not NULL 2020-11-28 10:30:33 +01:00
Erik Ekman
2afa93c9f7 boards/esp32-ethernet-kit: Setup Kconfig to match makefiles 2020-11-28 10:18:54 +01:00
Erik Ekman
064f58e7aa boards/esp32: add ESP32-Ethernet-Kit v1.2 board 2020-11-28 10:18:54 +01:00
Erik Ekman
db91be6ef8 cpu/esp32: add esp_jtag pseudomodule and feature
Available on esp32-wrover-kit and esp32-ethernet-kit boards.
2020-11-28 10:18:54 +01:00
Erik Ekman
e3142c39f0 boards/esp32: add ESP32-Ethernet-Kit board
Mostly copied from esp32-wroom-kit and Ethernet part from
esp32-olimex-evb.

Ethernet and serial port has been tested (on v1.2 board).
2020-11-28 10:18:54 +01:00
Erik Ekman
f28de6a544 cpu/esp32: add support for IP101G Ethernet phy
As used in ESP32-Ethernet-Kit board:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html

Inspired by existing code for lan8720 PHY as well as latest ESP32 code:
https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth_phy_ip101.c

Phy datasheet available: http://www.bdtic.com/ICplus/IP101G.html
2020-11-28 10:15:14 +01:00
a1ca06d6f4 cpu/efm32: coretemp.h: add missing stdint.h include 2020-11-25 17:52:34 +01:00
1d5e2e9cd9 all: remove traces of kernel_types.h
Automatically removed using:

    $ git grep -l kernel_types | xargs sed -i '/^#include .kernel_types/d'
2020-11-25 17:52:34 +01:00
575189510d
Merge pull request #15465 from maribu/atomic-utils-volatile
sys/atomic_utils: Use volatile qualifier
2020-11-24 22:05:33 +01:00
Marian Buschsieweke
dd48ced151
cpu/*/atomic_utils_arch.h: Add volatile qualifier 2020-11-24 14:00:52 +01:00
3f0ea86963 cpu/stm32/include/periph_cpu.h: add missing limits.h include 2020-11-23 16:56:34 +01:00
ba28bf849c cpu/esp_common: add missing include for limits.h in freertos/task.h 2020-11-23 16:56:34 +01:00
benpicco
ba8c8e29ad
Merge pull request #15498 from kaspar030/efm32_fix_tim_t
cpu/efm32/periph/timer: fix timer_t -> tim_t
2020-11-23 16:22:04 +01:00
Benjamin Valentin
264d0e3354 cpu/nrf52: nrf802154: default to netdev_ieee802154_submac
The basic nrf802154 driver lacks ACK handling and retransmissions,
which degrades it's usefulness.

The 802.15.4 Sub-MAC fixes all those issues.

Enable it by default for this driver to make it better behaved.
2020-11-23 13:09:32 +01:00
925056c829 cpu/efm32/periph/timer: fix timer_t -> tim_t 2020-11-23 12:33:28 +01:00
Bas Stottelaar
3881b2f0cd cpu/efm32: add support for efr32mg1b 2020-11-23 00:21:32 +01:00
benpicco
63af227f01
Merge pull request #15464 from maribu/esp-cast-align
cpu/esp*: Fix cast alignment issues
2020-11-19 23:34:42 +01:00
benpicco
5e819632be
Merge pull request #15463 from maribu/riscv-cast-align
cpu/fe310: Silence -Wcast-align
2020-11-19 19:05:53 +01:00
Bas Stottelaar
6f60185bfa cpu/efm32: define Kconfig option for efm32_coretemp 2020-11-18 18:43:33 +01:00
Bas Stottelaar
34c252d0e6
Merge pull request #15461 from basilfx/feature/efm32_driver_coretemp
cpu/efm32: add coretemp driver
2020-11-18 15:08:29 +01:00
e322bfbd47
Merge pull request #15421 from leandrolanzieri/pr/kconfig/native/hello_world
Kconfig: add modules to test on native
2020-11-18 15:02:34 +01:00
81c270dc1b
stm32/flashpage: Remove page address casts from erase
This removes the redefinitions of the page address in the erase
function.
2020-11-18 12:30:40 +01:00
Bas Stottelaar
431e6efdf6 cpu/efm32: add coretemp driver 2020-11-18 12:28:45 +01:00
aebf6f06d8
stm32/flashpage: Add common stm32_flashpage_block_t type
This commits adds a common type for the block writes to the flash of the
stm32. Depending on the family, the type has a different size. This
allows the removal of a number of ifdefs to track the differences
between families, simplifying the flashpage code
2020-11-18 12:04:57 +01:00
Marian Buschsieweke
921bc7f6e0
cpu/esp*: Fix cast alignment issues
- Add `WORD_ALIGNED` attribute to potentially unaligned allocations
- Use intermediate cast to `uintptr_t` to silence false positives of
  `-Wcast-align`
2020-11-18 10:19:23 +01:00
Leandro Lanzieri
43cc7beb26
cpu/native: add periph_spidev module to Kconfig 2020-11-18 10:08:01 +01:00
Leandro Lanzieri
2306516d0d
drivers/periph_common: add CPU specific RTC Kconfig 2020-11-18 10:08:00 +01:00
Leandro Lanzieri
c4fda9f4a9
cpu/native/backtrace: add module to Kconfig 2020-11-18 10:08:00 +01:00
Leandro Lanzieri
1d868f2b7b
cpu/native: select needed modules in Kconfig 2020-11-18 10:07:59 +01:00
Leandro Lanzieri
8715f19c26
cpu/native/periph: add Native GPIO modules to Kconfig 2020-11-18 10:07:59 +01:00
Leandro Lanzieri
8df4512960
cpu/native: add default configuration 2020-11-18 10:07:58 +01:00
Marian Buschsieweke
21bf7c0d01
cpu/fe310: Silence -Wcast-align 2020-11-18 09:58:52 +01:00
benpicco
1f7fdbc97a
Merge pull request #15099 from maribu/cortexm-common-cast-align
cpu/cortexm_common: Silence -Wcast-align false positives
2020-11-18 00:38:03 +01:00
Leandro Lanzieri
5a04f94b63
Merge pull request #14967 from aabadie/pr/boards/stm32f0_clock_kconfig_only
boards/stm32f0: add Kconfig for clock configuration
2020-11-17 12:14:10 +01:00
Francisco
fe510cd823
Merge pull request #15439 from leandrolanzieri/pr/drivers/network_devices_remove_netif_dep
drivers/network devices: remove unused netif dependency
2020-11-17 12:06:18 +01:00
benpicco
309d79c763
Merge pull request #15453 from benpicco/cpu/sam0_common-flashpage_aux_write
cpu/sam0_common: flashpage: rename to sam0_flashpage_aux_write()
2020-11-17 10:41:45 +01:00
benpicco
dbba4f9393
Merge pull request #15378 from benpicco/native/mtd_pagewise
native/mtd: implement .write_page()
2020-11-17 10:34:55 +01:00
Benjamin Valentin
2845554b4e cpu/sam0_common: flashpage: rename to sam0_flashpage_aux_write()
`flashpage_write_raw()` got renamed to `flashpage_write()`.
Now `sam0_flashpage_aux_write_raw()` is the only remaining 'raw'
function, even though it behaves just like `flashpage_write()`.

So let's also rename that for consistency.
2020-11-17 00:34:31 +01:00
Martine Lenders
a07d3e0fc9
Merge pull request #14755 from benpicco/examples/gnrc_border_router-native
examples/gnrc_border_route: simplify ZEP setup on native
2020-11-13 18:41:03 +01:00
Benjamin Valentin
90f3c15084 socket_zep: send dummy HELLO packet on connect 2020-11-13 18:10:57 +01:00
f626758aaf
Merge pull request #15392 from fjmolinas/pr_cc2538_riotboot
boards/cc2538: add riotboot feature
2020-11-13 15:39:55 +01:00
Francisco Molina
8598176544
boards: add riotboot to cc2538 based boards 2020-11-13 14:51:58 +01:00
Francisco Molina
ab9abf2f51
cpu/cc2538: add riotboot
Flash Customer Configuration Area (CCA) is never written when the
riotboot module is used. This required a riot application to have
been previously flashed. riotboot will completely ignore this
section, neither writing or erasing it.

Slot flashing is currenly only supported with Jlink.

Co-authored-by: Brenton Chetty <brent7984@gmail.com>
2020-11-13 14:51:57 +01:00
57116e737b
Merge pull request #14691 from gdoffe/mp1_dev
Port of RIOT-OS to stm32mp1
2020-11-13 12:34:19 +01:00
Gilles DOFFE
e4fa203db4 cpu/stm32: STM32MP1 family has no flash
Then CPU_FLASH_BASE cannot be defined as FLASH_BASE does not exist.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
5ec5b335f1 cpu/stm32: add Kconfig files for STM32MP157CAC model
Note that Kconfig.models was not generated with gen_kconfig.py tool
due to lack of ProductsList.xlsx file for STM32MP1 family.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
ce0ef8939c cpu/stm32: disable periph_wdt for mp1 family
In STM32MP1 family, independant watchdogs (IWDG1 and IWDG2) are
dedicated to the MPU (Cortex-A7). Thus simply disable the feature
for STM32MP1 family.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
2ac0467807 cpu/stm32: configure timer2 for stm32mp1 boards
This timer will be used by RIOT-OS as the scheduling timer for
stm32mp157c-dk2 board.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
504fba61b8 cpu/stm32: add uart support for stm32mp1
stm32mp1 family uart driver is the same than for other stm32 families.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
ec97eb8447 cpu/stm32: set CPU_LINE for stm32mp157c
Set CPU_LINE variable according to informations extracted from
stm32_info.mk.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
7b7a75c3ca cpu/stm32: setup memory length for stm32mp157x
The stm32mp157c has the particularity to not having flash memory but
only SRAM.
Thus a part of SRAM must be considered as a ROM to flash the firmware
into.
In case of the stm32mp157c, the RETRAM (64kB) is used as ROM and the
4 banks of SRAM (384kB) are used as RAM.
However, as ROM_LEN, RAM_LEN, ROM_START_ADDRESS, RAM_START_ADDRESS and
ROM_OFFSET could be overloaded by user, set them with "?=" operator.
If the ROM_START_ADDRESS and the RAM_START_ADDRESS are not set at the
end of that file, it is a classic stm32 MCU with flash, thus set this
variables with common memory addresses for stm32 MCU family:
ROM_START_ADDR ?= 0x08000000
RAM_START_ADDR ?= 0x20000000

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
4bfbb75578 cpu/stm32: add stm32mp1_eng_mode pseudomodule
In Engineering mode (BOOT0 off and BOOT2 on), only the Cortex-M4
core is running. It means that all clocks have to be setup
by the Cortex-M4 core.
In other modes, the clocks are setup by the Cortex-A7 and then should
not be setup by Cortex-M4.
stm32mp1_eng_mode pseudomodule have to be used in Engineering mode
to ensure clocks configuration with IS_USED(MODULE_STM32MP1_ENG_MODE)
macro.
This macro can also be used in periph_conf.h to define clock source
for each peripheral.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
3008574d0e cpu/stm32: remove uneeded pm macro tests
STM32_PM_STOP and STM32_PM_STANDBY are always defined in periph_cpu.h,
Thus it is not needed to test them.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
6bac94fb6d cpu/stm32: setup power management for stm32mp1
According to stm32mp157 documentation:
* "The CStop mode is entered for MCU when the SLEEPDEEP bit in the Cortex®-M4 System Control
   register is set." Thus set PM_STOP_CONFIG to 0.
* "The CStandby mode applies only to the MPU sub-system."
  Set PM_STANDBY_CONFIG to (0) and do not enter standby mode for
  stm32mp1.

As PM_STOP_CONFIG is already defined before for CPU_FAM_STM32WB, replace
it with CPU_FAM_STM32MP1.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
e9a6b448cf cpu/stm32: add gpio support for stm32mp1 family
stm32mp1 is configuring gpio slightly differently that common stm32:
* port_num is computed differently, thus test MCU family to apply
  the good calculation.
* Rising and falling edge state on interrupts. Do not test if falling
  or rising edge, just launch the callback in all cases.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
be2c0ae179 cpu/stm32: define CPU_IRQ_NUMOF for stm32mp157cac
This MCU has 150 interrupt vectors.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
91a12c200c cpu/stm32: do not retrieve cmsis headers
Normally, CMSIS headers are retrieved as package from ST git repository
for each stm32.
However stm32mp1 family does not have a CMSIS headers repository but
have been included into RIOT source code in a previous commit.
For stm32mp1, CMSIS headers package must then not be retrieved and
vectors have to be generated from already in-source CMSIS headers.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
d6400c77de cpu/stm32: include stm32mp1 vendor headers
Include stm32mp1 vendors header. CORE_CM4 must be defined to include
Cortex-M4 core headers.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
169097ac21 cpu/stm32: add stm32mp157x vendor headers
Add vendor CMSIS headers from STMicroelectronics:
https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_architecture#CMSIS

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
e6aef8f626 cpu/stm32: get info from stm32mp1 cpu model
stm32mp1 ordering informations are not the same than classical
single MCU.
And as stm32mp1 has no flash, just extract second part of model name
and pincount.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
c3e29bb1fa cpu/stm32: setup clocks for stm32mp1
As stm32mp1 clocks are not configured like for other stm32, do not use
stmclk_common.c

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
d173097d7f cpu/stm32: do not build bootloader for mp1
The stm32mp1 family has no flash. The firmware is loaded directly in
RAM by stlink programmer or by Cortex-A7 bootloader/OS.
Thus bootloader is useless for this family, disable it.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
4f0fd9cf95 cpu/stm32: add GPIO_PIN macro for stm32mp1 family
As stm32mp1 family accesses gpio pins with a different
offset than other stm32, create a specific macro.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
bdc1cce04d cpu/stm32: enable MPU for stm32mp1
stm32mp1 family has a MPU (Memory Processing Unit).
Thus adds the feature.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
8279e54272 cpu/stm32: add clock configuration for stm32mp1
Configure stm32mp1 Cortex-M4 MCU core clock according to board
configuration.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
d78e13e906 cpu/stm32: add stm32mp1 support to clk_conf
clk_conf is a useful tool to produce clock headers for new boards.
But it only supports STM32Fx families.
This commits add the definition of a new family: STM32MP1.
Only the STM32MP157 is supported for now.

First build clk_conf:
$ make -C cpu/stm32/dist/clk_conf/

Clock header can be generated with the following command once clk_conf is
built:
$ cpu/stm32/dist/clk_conf/clk_conf stm32mp157 208000000 24000000 1
This command line will produce a core clock of 208MHz with a 24MHz HSE
oscillator and will use LSE clock which corresponds to the STM32MP157C-DK2
board configuration.
The command will output the header to copy paste into the periph_conf.h of
the board:

/**
 * @name    Clock settings
 *
 * @note    This is auto-generated from
 *          `cpu/stm32/dist/clk_conf/clk_conf.c`
 * @{
 */
/* give the target core clock (HCLK) frequency [in Hz],
 * maximum: 209MHz */
#define CLOCK_CORECLOCK     (208000000U)
/* 0: no external high speed crystal available
 * else: actual crystal frequency [in Hz] */
#define CLOCK_HSE           (24000000U)
/* 0: no external low speed crystal available,
 * 1: external crystal available (always 32.768kHz) */
#define CLOCK_LSE           (1U)
/* peripheral clock setup */
#define CLOCK_MCU_DIV       RCC_MCUDIVR_MCUDIV_1     /* max 209MHz */
#define CLOCK_MCU           (CLOCK_CORECLOCK / 1)
#define CLOCK_APB1_DIV      RCC_APB1DIVR_APB1DIV_2     /* max 104MHz */
#define CLOCK_APB1          (CLOCK_CORECLOCK / 2)
#define CLOCK_APB2_DIV      RCC_APB2DIVR_APB2DIV_2     /* max 104MHz */
#define CLOCK_APB2          (CLOCK_CORECLOCK / 2)
#define CLOCK_APB3_DIV      RCC_APB3DIVR_APB3DIV_2     /* max 104MHz */
#define CLOCK_APB3          (CLOCK_CORECLOCK / 2)

/* Main PLL factors */
#define CLOCK_PLL_M          (2)
#define CLOCK_PLL_N          (52)
#define CLOCK_PLL_P          (3)
#define CLOCK_PLL_Q          (13)
/** @} */

This result has been verified with STM32CubeMX, the official ST tool.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
5e30e60fec cpu/stm32: avoid configuring stm32mp1 APB1 clock
APB1 bus clock is always enabled is not manageable by RCC register.
So avoid enabling it.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
7a2550da9b cpu/stm32: add stm32mp1 peripheral busses
Add stm32mp1 peripheral busses AHB1, AHB2, AHB3 and AHB4 with
enable/disable functions.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
67f37950a0 cpu/stm32: default i2c configuration
* Setup i2c speed to I2C_SPEED_LOW by default
* enable i2c_write_regs() function.
* i2c frequency needs to be specified into board periph_conf.h

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
f39aa979af cpu/stm32: setup CLOCK_LSI for stm32mp1
Set stm32mp1 family LSI clock frequency to 32KHz as specified in datasheet.
STM32MP157C example:
https://www.st.com/resource/en/datasheet/stm32mp157c.pdf

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Gilles DOFFE
ba5f8e1cda cpu/stm32: consider starting white spaces in gen_vectors.py
In some CMSIS headers, "typedef enum" could be preceded by white
spaces. Thus consider them when parsing the line.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
2020-11-13 10:43:08 +01:00
Leandro Lanzieri
0e52e2747e
drivers: remove netif as dependency for network device drivers 2020-11-13 09:25:59 +01:00
Leandro Lanzieri
d4be753df8
cpu/native: remove unused can_linux module
b4f29035ce adapted the can_linux module to
the periph_can interface. This is a cleanup of some things that stayed
behind. Here the makefile is removed, the references to can_linux in the
dependency resolution and configuration Makefile are changed to the
standard periph_can, and the startup code is adapted.
2020-11-13 09:11:50 +01:00
benpicco
d9598a0f54
Merge pull request #15412 from bergzand/pr/flashpage/merge_raw
periph_flashpage: Make pagewise API optional
2020-11-12 22:32:21 +01:00
benpicco
93b978bb66
Merge pull request #15258 from lutgaru/cc26x0setuptrimdevice
Cc26x0setuptrimdevice
2020-11-12 22:20:32 +01:00
792e031a95
Merge pull request #14331 from maribu/atomic_utils
sys/atomic_utils: Functions for atomic access
2020-11-12 21:44:53 +01:00
1c063a74ea
stm32: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:42 +01:00
72d7a903a2
sam0: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:41 +01:00
61052dbed7
msp430: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:41 +01:00
e176649266
nrf5x: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:40 +01:00
f85594eb55
kinetis: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
9a79124fba
efm32: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:39 +01:00
3c10425b4c
cc2538: Adapt to flashpage/flashpage_pagewise API 2020-11-11 23:16:38 +01:00
Benjamin Valentin
d63141fb02 cpu/nrf52: remove softdevice linkerscripts
Support for softdevice was removed in 35b6ccedf3
Those linkerscripts were leftover, they are not used anymore.
2020-11-11 18:18:37 +01:00
benpicco
38552ed41a
Merge pull request #15413 from benpicco/cpu/efm32_rtc_helper
cpu/efm32: RTC Series 0: use RTC helper functions
2020-11-11 17:19:59 +01:00
Bas Stottelaar
9f9f8637f3 cpu/efm32: add support for ezr32wg 2020-11-10 22:59:46 +01:00
9d13c07e92
cpu/stm32f0: handle custom pll prediv/mul at cpu level 2020-11-10 15:55:38 +01:00
5d77b7d90d
cpu/stm32: show PLL params in menuconfig with CUSTOM_PLL_PARAMS 2020-11-10 14:53:37 +01:00
03ee0c938f
cpu/stm32: adapt Kconfig clock configuration for f0 2020-11-10 14:53:12 +01:00
Benjamin Valentin
4e8c461f46 cpu/sam0_common: flashpage: invalidate cache on _lock() 2020-11-10 14:21:47 +01:00
Benjamin Valentin
e6192a13bd cpu/sam0_common: flashpage: support unaligned writes
We can pad the unaligned bytes with 0xFF to make up a whole word that
can be written.
2020-11-10 12:18:47 +01:00
Benjamin Valentin
20f093ede6 cpu/sam0_common: flashpage: introduce functions to write to user page 2020-11-10 12:18:47 +01:00
Benjamin Valentin
360c0b27fc cpu/saml1x: add NVM User Page Mapping 2020-11-10 12:18:47 +01:00
Benjamin Valentin
fecc5bdcff cpu/saml21: add NVM User Page Mapping 2020-11-10 12:18:47 +01:00
Benjamin Valentin
c5f8742877 cpu/samd21: add NVM User Page Mapping 2020-11-10 12:18:47 +01:00
Benjamin Valentin
edbb5fe9d0 cpu/samd5x: add NVM User Page Mapping 2020-11-10 12:18:47 +01:00
Marian Buschsieweke
56a54a773e
cpu/native: Add atomic_utils_arch.h 2020-11-10 10:55:14 +01:00
Marian Buschsieweke
a892c1aa23
cpu/atmega_common: Add atomic_utils_arch.h 2020-11-10 10:55:14 +01:00
Marian Buschsieweke
3f4577d430
cpu/msp430_common: Add atomic_utils_arch.h 2020-11-10 10:55:13 +01:00
Marian Buschsieweke
ce0982485d
cpu/fe310: Add atomic_utils_arch.h 2020-11-10 10:55:13 +01:00
Marian Buschsieweke
1d2e0592d3
cpu/mips32r2_common: Add atomic_utils_arch.h 2020-11-10 10:55:13 +01:00