Skip to content

Commit b22f44a

Browse files
authored
Merge pull request #1382 from NickeZ/upgrade-asf4
external/asf4: Upgrade to latest version
2 parents 5fa56cc + ded55a7 commit b22f44a

File tree

206 files changed

+41181
-63623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+41181
-63623
lines changed

.clang-tidy

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Checks: >-
1616
-performance-no-int-to-ptr,
1717
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
1818
-readability-avoid-unconditional-preprocessor-if,
19-
-readability-suspicious-call-argument
19+
-readability-suspicious-call-argument,
20+
-clang-diagnostic-incompatible-pointer-types-discards-qualifiers
2021
HeaderFilterRegex: '.*'
2122
ExtraArgs:
2223
- -Wno-unknown-warning-option

external/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ if(CMAKE_CROSSCOMPILING)
113113
asf4-drivers/hal/src/hal_io.c
114114
asf4-drivers/hal/src/hal_sha_sync.c
115115
asf4-drivers/hpl/systick/hpl_systick.c
116-
asf4-drivers/hal/src/hal_usart_async.c
117-
asf4-drivers/hal/utils/src/utils_ringbuffer.c
118116
asf4-drivers/hpl/gclk/hpl_gclk.c
119117
asf4-drivers/hpl/oscctrl/hpl_oscctrl.c
120118
asf4-drivers/hpl/mclk/hpl_mclk.c
@@ -133,6 +131,8 @@ if(CMAKE_CROSSCOMPILING)
133131
asf4-drivers/usb/device/usbdc.c
134132
)
135133

134+
target_compile_options(asf4-drivers-min PRIVATE -Wno-cast-qual -Wno-unused-parameter -Wno-missing-prototypes -Wno-missing-declarations -Wno-bad-function-cast -Wno-strict-prototypes -Wno-old-style-definition)
135+
136136
target_link_libraries(asf4-drivers-min samd51a-ds)
137137
set_property(TARGET asf4-drivers-min PROPERTY INTERFACE_LINK_LIBRARIES "")
138138

@@ -170,6 +170,9 @@ if(CMAKE_CROSSCOMPILING)
170170
asf4-drivers/sd_mmc/sd_mmc.c
171171
asf4-drivers/diskio/sdmmc_diskio.c
172172
)
173+
174+
target_compile_options(asf4-drivers PRIVATE -Wno-cast-qual -Wno-unused-parameter -Wno-switch-default -Wno-bad-function-cast -Wno-implicit-fallthrough)
175+
173176
target_link_libraries(asf4-drivers
174177
PRIVATE
175178
samd51a-ds

external/asf4-drivers/Config/RTE_Components.h

-54
This file was deleted.

external/asf4-drivers/Config/hpl_aes_config.h

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* Auto-generated config file hpl_cmcc_config.h */
2+
#ifndef HPL_CMCC_CONFIG_H
3+
#define HPL_CMCC_CONFIG_H
4+
5+
// <<< Use Configuration Wizard in Context Menu >>>
6+
7+
// <h> Basic Configuration
8+
9+
// <q> Cache enable
10+
//<i> Defines the cache should be enabled or not.
11+
// <id> cmcc_enable
12+
#ifndef CONF_CMCC_ENABLE
13+
#define CONF_CMCC_ENABLE 0x0
14+
#endif
15+
16+
// <o> Cache Size
17+
//<i> Defines the cache memory size to be configured.
18+
// <0x0=>1 KB
19+
// <0x1=>2 KB
20+
// <0x2=>4 KB
21+
// <id> cache_size
22+
#ifndef CONF_CMCC_CACHE_SIZE
23+
#define CONF_CMCC_CACHE_SIZE 0x2
24+
#endif
25+
26+
// <e> Advanced Configuration
27+
// <id> cmcc_advanced_configuration
28+
// <q> Data cache disable
29+
//<i> Defines the data cache should be disabled or not.
30+
// <id> cmcc_data_cache_disable
31+
#ifndef CONF_CMCC_DATA_CACHE_DISABLE
32+
#define CONF_CMCC_DATA_CACHE_DISABLE 0x0
33+
#endif
34+
35+
// <q> Instruction cache disable
36+
//<i> Defines the Instruction cache should be disabled or not.
37+
// <id> cmcc_inst_cache_disable
38+
#ifndef CONF_CMCC_INST_CACHE_DISABLE
39+
#define CONF_CMCC_INST_CACHE_DISABLE 0x0
40+
#endif
41+
42+
// <q> Clock Gating disable
43+
//<i> Defines the clock gating should be disabled or not.
44+
// <id> cmcc_clock_gating_disable
45+
#ifndef CONF_CMCC_CLK_GATING_DISABLE
46+
#define CONF_CMCC_CLK_GATING_DISABLE 0x0
47+
#endif
48+
49+
// </e>
50+
// </h>
51+
52+
// <<< end of configuration section >>>
53+
54+
#endif // HPL_CMCC_CONFIG_H

external/asf4-drivers/Config/hpl_oscctrl_config.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
// <i> Indicates whether Quick Lock Disable is enabled or not
304304
// <id> dfll_arch_qldis
305305
#ifndef CONF_DFLL_QLDIS
306-
#define CONF_DFLL_QLDIS 1//0 // FIXME - was 0; datasheet says 'should' be set for USB crystal less mode
306+
#define CONF_DFLL_QLDIS 1
307307
#endif
308308

309309
// <q> Chill Cycle Disable
@@ -332,7 +332,7 @@
332332
// <1=>Closed Loop Mode
333333
// <id> dfll_mode
334334
#ifndef CONF_DFLL_MODE
335-
#define CONF_DFLL_MODE 0x1// FIXME - was 0x0; datasheet says should be 1 for USB crystal less mode
335+
#define CONF_DFLL_MODE 0x1
336336
#endif
337337

338338
// <o> Coarse Maximum Step <0x0-0x1F>
@@ -344,7 +344,7 @@
344344
// <o> Fine Maximum Step <0x0-0xFF>
345345
// <id> dfll_arch_fstep
346346
#ifndef CONF_DFLL_FSTEP
347-
#define CONF_DFLL_FSTEP 0xA//0x1// FIXME - datasheet 54.14 says should be 0xA
347+
#define CONF_DFLL_FSTEP 0xa
348348
#endif
349349

350350
// <o> DFLL Multiply Factor <0x0-0xFFFF>
@@ -430,18 +430,21 @@
430430
#endif
431431

432432
// <o> Loop Divider Ratio Fractional Part <0x0-0x1F>
433+
// <i> Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
433434
// <id> fdpll0_ldrfrac
434435
#ifndef CONF_FDPLL0_LDRFRAC
435436
#define CONF_FDPLL0_LDRFRAC 0x0
436437
#endif
437438

438439
// <o> Loop Divider Ratio Integer Part <0x0-0x1FFF>
440+
// <i> Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
439441
// <id> fdpll0_ldr
440442
#ifndef CONF_FDPLL0_LDR
441443
#define CONF_FDPLL0_LDR 0x2f
442444
#endif
443445

444446
// <o> Clock Divider <0x0-0x7FF>
447+
// <i> This Clock divider is only for XOSC clock input to DPLL
445448
// <id> fdpll0_clock_div
446449
#ifndef CONF_FDPLL0_DIV
447450
#define CONF_FDPLL0_DIV 0x0
@@ -555,18 +558,21 @@
555558
#endif
556559

557560
// <o> Loop Divider Ratio Fractional Part <0x0-0x1F>
561+
// <i> Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
558562
// <id> fdpll1_ldrfrac
559563
#ifndef CONF_FDPLL1_LDRFRAC
560564
#define CONF_FDPLL1_LDRFRAC 0x0
561565
#endif
562566

563567
// <o> Loop Divider Ratio Integer Part <0x0-0x1FFF>
568+
// <i> Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
564569
// <id> fdpll1_ldr
565570
#ifndef CONF_FDPLL1_LDR
566571
#define CONF_FDPLL1_LDR 0x3b
567572
#endif
568573

569574
// <o> Clock Divider <0x0-0x7FF>
575+
// <i> This Clock divider is only for XOSC clock input to DPLL
570576
// <id> fdpll1_clock_div
571577
#ifndef CONF_FDPLL1_DIV
572578
#define CONF_FDPLL1_DIV 0x0

0 commit comments

Comments
 (0)