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

62 Commits

Author SHA1 Message Date
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
MrKevinWeiss
0a9c51fdf9
*.config: Modify all .config kconfig files 2024-03-26 14:53:40 +01:00
Benjamin Valentin
453a8be4f3 sys/cpp_new_delete: always enable the module when C++ is used 2024-02-07 11:40:23 +01:00
Benjamin Valentin
7add6c2fcc cpu/avr8_common: make pm_layered a DEFAULT_MODULE
This lets us disable it.
2024-01-11 21:14:43 +01:00
benpicco
714958ad3c
Merge pull request #20241 from benpicco/busy_wait
sys/busy_wait: add busy wait helper
2024-01-11 12:19:31 +00:00
Benjamin Valentin
5dc43bd62d cpu/avr8_common: AVR-8 needs 7 cycles per busy loop 2024-01-10 22:43:31 +01:00
Benjamin Valentin
112e378fcc cpu/avr8_common: fix build with !core_thread 2024-01-09 19:00:22 +01:00
Gerson Fernando Budke
ab70f20069
cpu/avr8_common: Fix PM and Common peripherals build
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-01 14:12:24 +01:00
Gerson Fernando Budke
3b9368a99e
cpu/avr8: Enable PM periph to all SoC
This refactor the current xmega PM peripheral to avr8 common and extend
PM to cpus families.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-12-01 14:12:23 +01:00
Marian Buschsieweke
cee7cccfd0
cpu/avr8_common/flash_utils: use C and linker for aliases
`flash_<funcname>()` is implemented by `<funcname>_P()` provided by
the AVR libc on AVR targets. Previously, the preprocessor was used
to do the aliasing, but this causes issues with LLVM: The signatures of
e.g. `printf_P()` expects `const char *`, whereas flash utils expects
`FLASH_ATTR const char *`. For GCC this will just implicitly drop the
`FLASH_ATTR`, while it requires an explicit cast for LLVM.

To implement the explicit cast, `static inline` function wrappers
where used instead where possible. But for the variadic functions
(e.g. `printf(fmt, ...)`) the linker is used to provide the aliases,
as there is no way to pass the variadic functions throw in C. The
alternative would be to implement `flash_printf()` by calling
`vprintf_P()`, but that increased ROM size quite a bit.

Finally, a work around for a bug in Ubuntu's toolchain has been added:
An unused function that calls to `printf_P()`, `fprintf_P()` and
`snprintf_P()`. Since this function is garbage collected anyway, it
has no impact on the generated ELF file.
2023-11-10 14:54:22 +01:00
Gerson Fernando Budke
783afbc666 cpu/avr8_common: Add AVR8_ISR macro
The current ISR implementation for AVR8 requires use of
avr8_[enter/exit]_isr pair which add some boilerplate on code.
This add AVR8_ISR which clean-up the code and make it simpler
and hides any schedule detail from the user perspective.

This is a preparation for future scheduling and irq optimizations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 20:00:19 +02:00
Gerson Fernando Budke
ceb414f046 cpu/avr8_common: Drop useless ret instruction
The thread_yield_higher is a normal functions. However it has a non
regular return instruction which is useless. This remove the useless
return on thread_yield_higher to save flash bytes.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 19:01:15 +02:00
Gerson Fernando Budke
93aa10cc5c cpu/avr8_common: Rework avr8_state variable
The avr8_state variable uses bit operation to set/clear the state. This
rework avr8_state to use increment/decrement instead. It introduce the
use of General Purpose IO Register 1 (GPIOR1) when available.

This is a preparation for future scheduling and irq optimizations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 19:01:14 +02:00
Gerson Fernando Budke
b7873015aa cpu/avr8_common: Split avr8_state
The avr8_state store state information used to determine scheduling
and uart irq. This move all uart irq states to avr8_state_uart
variable. It introduce the use of General Purpose IO Register 0
(GPIOR0) when available and now all uarts from xmega can be used.

This is a preparation for future scheduling and irq optimizations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-07-05 19:01:13 +02:00
Marian Buschsieweke
a6f48d84a0
cpu/avr8_common: fix typo in a comment 2023-06-28 22:36:21 +02:00
Hugues Larrive
b94cd39339 cpu/avr8_common: supports CPUs with missing CALL and JMP instructions 2023-06-22 17:35:36 +02:00
Hugues Larrive
996ff9ba25 cpu/avr8_common: added avr4.ld script 2023-06-22 17:35:14 +02:00
Benjamin Valentin
5274e30178 cpu/avr8_common: implement perror() 2023-04-26 10:31:09 +02:00
Marian Buschsieweke
c406f7ef42
cpu/avr8_common: Wrap stdio.h
This allows automatically moving format strings to flash, provided that
code previously compiled fine with `-Wformat-nonliteral` (which in RIOT
is the case due to `-Wformat=2`).
2023-02-27 12:31:03 +01:00
Marian Buschsieweke
4e3c0777fc
sys/flash_utils: add helpers for placing variables in flash
This adds a layer of convenience abstraction over classical Harvard
architectures (like most AVRs) that do not map the flash memory into
the data address space and modern Harvard architectures or von-Neumann
architectures that do so. The motivation is to safe a lot of RAM for
AVR by storing constant strings into flash.
2023-02-27 12:31:03 +01:00
bors[bot]
c8d60a2d31
Merge #18763
18763: sys/tiny_strerror: add missing error codes r=benpicco a=maribu

### Contribution description

When double-checking the error codes provided by newlib by default (without magic defines, such as `__LINUX_ERRNO_EXTENSIONS__` or `__CYGWIN__`), some where still missing in `tiny_strerror()`. This adds the missing ones.

This in turn showed that three errno codes were missing in the avr-libc compat `errno.h`, which are added as well.

### Testing procedure

Murdock should double check that the added errno codes indeed are defined by default.

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-14 22:41:37 +00:00
Marian Buschsieweke
b0ee095051
cpu/avr8_common/avr_libc_extra: add missing errno codes
Three standard POSIX errno codes somehow slipped through the cracks.
This adds the missing ones.
2023-01-12 08:39:30 +01:00
Benjamin Valentin
124b849503 cpu: call early_init() 2023-01-08 22:26:12 +01:00
Benjamin Valentin
0bd67d98d9 cpu: always rely on stdio.inc.mk for default stdio selection 2022-11-09 10:42:47 +01:00
Marian Buschsieweke
f02bc5791a
Merge pull request #18571 from maribu/sys/tiny_strerror
sys/tiny_strerror: add tiny `strerror()` implementation
2022-10-05 09:24:40 +02:00
Marian Buschsieweke
f1da9f6695
cpu/avr8_common: add strings.h for compatibility 2022-09-22 08:33:37 +02:00
Marian Buschsieweke
f6ed9fd781
cpu/avr8_common: use tiny_strerror_as_strerror
The custom `strerror()` is dropped and replaced by the module
`tiny_strerror_as_strerror`.
2022-09-20 15:51:11 +02:00
Benjamin Valentin
ea917f4b07 cpu: cpu_print_last_instruction() -> cpu_get_caller_pc() 2022-09-15 10:49:56 +02:00
Benjamin Valentin
34e11bf2bc sys/architecture: introduce uinttxtptr_t 2022-07-13 23:19:33 +02:00
Marian Buschsieweke
740c2faaa8
cpu/avr8_common: fix cpu_print_last_instruction 2022-06-20 19:56:00 +02:00
Marian Buschsieweke
21daf782a7
cpu/avr8_common: clean up thread_arch.c
Use __AVR_HAVE_RAMP<D,X,Y,Y>__ and __AVR_HAVE_3_BYTE_PC__ provided by
the compiler instead of custom macros.
2022-06-20 19:49:07 +02:00
8272e4fbd2
Merge pull request #17359 from benpicco/irq_is_in-bool
core: change return type of irq_is_in(), irq_is_enabled() to bool
2022-01-06 18:13:20 +01:00
Gunar Schorcht
d778e77c97 cpu/avr8_common: use C++ new and delete operator 2022-01-03 23:35:35 +01:00
Benjamin Valentin
41a5b7ef7a core: change return type of irq_is_in(), irq_is_enabled() to bool
This only cleans up the API, no change in behavior or users of the API
is expected.
2021-12-08 15:53:15 +01:00
Leandro Lanzieri
b534f26e17
cpu/avr8_common: model Kconfig 2021-11-22 12:25:29 +01:00
benpicco
f57e2f1e99
Merge pull request #16055 from benpicco/soc_init
cpu: call cpu_init() from startup code, not from board
2021-10-18 20:52:53 +02:00
Benjamin Valentin
3e20e939c6 cpu: drop cpu_init() from public headers
Boards are no longer supposed fo call the function, so drop it from
public header files.
2021-10-18 17:31:26 +02:00
Marian Buschsieweke
32be74291c
Merge pull request #16790 from maribu/cpu/avr8_common/ldscripts
cpu/avr8_common: Fix link with binutils > 2.35.2
2021-10-15 09:59:14 +02:00
Benjamin Valentin
cb18689712 cpu/avr8_common: call cpu_init() 2021-10-13 23:21:56 +02:00
Marian Buschsieweke
62d6a560b1
cpu/avr8_common: Fix link with binutils > 2.35.2
The xfa.ld script is incompatible with binutils > 2.35.2 and results
in firmwares that wont boot. Sadly, I couldn't figure out an elegant
way to fix the issue. Instead, I modified the linker script provided
by binutils to also include XFA.
2021-10-13 16:37:19 +02:00
Marian Buschsieweke
7bfc1814ae
Merge pull request #16917 from maribu/cpu/avr8_common/cleanup
cpu/avr8_common: Clean up cpu_print_last_inscrution()
2021-09-30 13:29:01 +02:00
Marian Buschsieweke
417bc949ab
cpu/avr8_common: Clean up cpu_print_last_inscrution() 2021-09-30 10:39:21 +02:00
Marian Buschsieweke
b12a8103e3
cpu/avr8_common: implement printf_float 2021-09-28 12:35:43 +02:00
Jean-Pierre De Jesus DIAZ
1759014134 cpu/avr8_common: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-05 20:38:52 +02:00
Benjamin Valentin
87f7e5a963 cpu/atmega_common: move clock init to common code
This code should not be in the realm of the board config, but in
common arch code.
2021-08-27 17:06:50 +02:00
Hauke Petersen
48e2d6e8f9 cpu/atmega_common: implement irq_is_enabled() 2021-08-25 08:01:05 +02:00
Benjamin Valentin
64846c0af4 avr_libc_extra: implement strerror()
Add a minimal implementation of `strerror()`.
All other targets use either newlib or picolibc and provide this
function, add it to AVR so we can rely on it in common code.
2021-08-09 16:24:04 +02:00
Francisco Molina
ca4ca1fac5
cpu/avr8_common: fix errno
avr only defines two errno MACROS, make sure RIOT header ERRNO match
the ones defined by avr.
2021-06-17 09:09:30 +02:00
Marian Buschsieweke
5cc62437da
cpu/avr8_common: move ldscripts from atmega_common
The ldscripts are already used for both ATmega and ATxmega, so it
makes sense to have them in the common folder.
2021-03-30 10:50:09 +02:00