Compare commits

...

103 commits

Author SHA1 Message Date
Jukka Laitinen
925b8b0904 drivers/bch/bchdev_driver.c: Fix BIOC_FLUSH
Don't fail if the lowerhalf mtd driver doesn't support BIOC_FLUSH;
This is normal - if the lowerhalf has nothing to do, it doesn't handle
the IOCTL.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-19 19:22:22 +08:00
wangmingrong1
1200d49b83 gcov: Disable stack checking
When enable CONFIG_STACK_CANARIES, in general, the stack check in the __gcov_fork function is:
" return fork();
18: e59f3020 ldr r3, [pc, #32] @ 40 <__gcov_fork+0x40>
1c: e5932000 ldr r2, [r3]
20: e59d3004 ldr r3, [sp, #4]
24: e0332002 eors r2, r3, r2
28: e3a03000 mov r3, #0
2c: 1a000002 bne 3c <__gcov_fork+0x3c>"
r3 is obtained by taking the value of sp offset. But after opening thumb, the second comparison value in
"8c6: 4a06 ldr r2, [pc, #24] @ (8e0 <__gcov_fork+0x30>)
8c8: 6811 ldr r1, [r2, #0]
8ca: 687a ldr r2, [r7, #4]
8cc: 4051 eors r1, r2"
is obtained through r7. Since r7 stores the stack address at this time, which stores the address of the parent process, the stack out of bounds will occur in the child process

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-19 19:22:12 +08:00
wangmingrong1
2c37282f46 gcov: Prevent pile insertion recursion
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-19 19:22:12 +08:00
wangmingrong1
dad9ad949d gcov: Fix gcov fork() issue
After code coverage is enabled, fork will be replaced by __gcov_fork

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-19 19:22:12 +08:00
YAMAMOTO Takashi
658d767b81 Explicitly enable CONFIG_LUA_LUV_MODULE's dependencies where it's enabled
In order to replace CONFIG_LUA_LUV_MODULE's "select" items
with "depends on".
2024-12-19 19:21:27 +08:00
anjiahao
22b12e17a6 procfs:add missing ',' to end of line
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
3e889039c4 imx_gpio: use small lock in arch/arm/src/imx6/imx_gpio.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
82874a5ad1 cxd: use small lock
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
15c80e68a0 modifyreg16: use small lock in modifyreg16
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
d48583604c at32_serial: use small lock in arch/arm/src/at32/at32_serial.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
2852064501 remove big lock in arch_phy_irq
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
366332a948 bt_buf: use small lock in wireless/bluetooth/bt_buf.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
hujun5
dbeedf9229 bt_buf: use small lock to protect bt_bufferlist_s
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 19:20:19 +08:00
Alin Jerpelea
11bc75a9d9 crypto/xform.c: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

NOTE
The code was reported as GPL by FOSS ID
and Xiaomi scanned the file xform.c with Black Duck Security and it showed
that the license was BSD-3-Clause and no risk was reported.

Since there is no clause on the license it was concluded as 0BSD

Refference
https://github.com/apache/nuttx/pull/15252

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 19:18:13 +08:00
chao an
cdef7da956 arm64/cache: add i/dcache check to avoid build break
arch/arm64/src/common/arm64_cache.c:344:35: error: macro "up_get_icache_linesize" passed 1 arguments, but takes just 0
  344 | size_t up_get_icache_linesize(void)
      |                                   ^

Feishu-Id: 4956395133

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-19 16:28:44 +08:00
Alin Jerpelea
476d1d4e3c arch/x86_64: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
7465fefd1b arch/xtensa: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
ecdad3af2f include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
b8a33af866 drivers/usbhost/hid_parser: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
5c1becab24 arch/arm: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
47df393ea6 drivers/input/uinput: migrate to ASF license
Xiaomi has submitted the SGA and the license can be migrated to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
24b791bdfc drivers/mtd/mtd_config_fs: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
hujun5
ad42a06060 some replacements were omitted.
fix regression from https://github.com/apache/nuttx/pull/15219

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 12:02:36 +08:00
hujun5
3025212c2c fix compile error
Create version.h
CC:  chip/tm4c/tm4c_gpio.c chip/tm4c/tm4c_gpio.c: In function 'tiva_configgpio':
chip/tm4c/tm4c_gpio.c:793:11: warning: implicit declaration of function 'spin_lock_irqsave' [-Wimplicit-function-declaration]
  793 |   flags = spin_lock_irqsave(&g_configgpio_lock);
      |           ^~~~~~~~~~~~~~~~~
CC:  nsh_parse.c chip/tm4c/tm4c_gpio.c:844:3: warning: implicit declaration of function 'spin_unlock_irqrestore' [-Wimplicit-function-declaration]
  844 |   spin_unlock_irqrestore(&g_configgpio_lock, flags);

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 11:54:37 +08:00
Filipe Cavalcanti
64aa1972af arch/risc-v/esp32c6: fix memcpy on AP password 2024-12-18 11:54:15 +08:00
Filipe Cavalcanti
aca36a1784 arch/xtensa: fix memcpy on AP password 2024-12-18 11:54:15 +08:00
YAMAMOTO Takashi
14edf1385c sim: Fix build errors on macOS
macOS 15.2
x86-64
Xcode 16.1
```
ld: warning: disabling chained fixups because of unaligned pointers
ld: illegal text-relocation in '_main'+0x1F (/Users/yamamoto/git/nuttx/nuttx/arc
h/sim/src/nuttx.rel) to '_g_argc'
```
2024-12-17 18:15:00 +08:00
Alin Jerpelea
9692409b2f libs/libc/stdlib: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 18:14:31 +08:00
Alin Jerpelea
661917e84d libs/libc/stdlib: remove BSD-4 clause
remove the advertising clause
3. All advertising materials mentioning features or use of this software must
display the following acknowledgement: This product includes software
developed by the University of California, Berkeley and its contributors.

permitted by Berkley amendment
https://ipira.berkeley.edu/sites/default/files/amendment_of_4-clause_bsd_software_license.pdf

following example from NETBSD and OPENBSD
eb7c1594f1
6580fee329

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 18:14:31 +08:00
hujun5
9c3fc91304 fs: fix comment in https://github.com/apache/nuttx/pull/15163
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:14:18 +08:00
hujun5
40e62f4d43 use atomic to protect f_refs
fix regresion from https://github.com/apache/nuttx/pull/14801

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:14:18 +08:00
YAMAMOTO Takashi
0028f0cae9 enable CONFIG_PIPES where CONFIG_LIBUV is enabled
after running the following script, reverted a few
unrelated modifications manually.
```
git grep -l CONFIG_LIBUV|grep defconfig|while read FILE;do
DIR=$(dirname $FILE)
./tools/configure.sh -E $DIR
kconfig-tweak -e CONFIG_PIPES
kconfig-tweak -d CONFIG_HOST_MACOS
make savedefconfig
cp defconfig $FILE
done
```

cf. https://github.com/apache/nuttx/issues/14773
2024-12-17 18:13:48 +08:00
hujun5
bff9935948 fix a typo
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:13:35 +08:00
hujun5
42d2a27621 esp32s3_rtc: use small lock in arch/xtensa/src/esp32s3/esp32s3_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:13:35 +08:00
hujun5
9f449d2da4 lc823450_rtc: use small lock in arch/arm/src/lc823450/lc823450_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:13:35 +08:00
hujun5
6bcf698615 esp32c3_rtc: use small lock in arch/risc-v/src/esp32c3-legacy/esp32c3_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:13:35 +08:00
hujun5
9ae786ca95 max32660_rtc: change spinlock name g_lock -> g_rtc_lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 18:13:35 +08:00
zhangyuan29
2b6282ea04 tools/ci: change sem_init_6_1 to support skip result
After SEM_VALUE_MAX change to INT_MAX, need to support
skip result.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-17 15:40:48 +08:00
zhangyuan29
8eb8472eed arm/lpc17xx: disable mqueue sysv
mqueue sysv not used, remove to reduce sram usage

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-17 15:40:48 +08:00
zhangyuan29
eae46b0823 sem: change sem wait to atomic operation
Add sem_wait fast operations, use atomic to ensure
atomicity of semcount operations, and do not depend
on critical section.

Test with robot:
before modify:
nxmutex_lock cost: 78 ns
nxmutex_unlock cost: 82 ns

after modify:
nxmutex_lock cost: 28 ns
nxmutex_unlock cost: 14 ns

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-17 15:40:48 +08:00
zhangyuan29
77091a2296 atomic: Unify the compare_exchange functions of nx and stdatomic
define nx_atomic_compare_exchange_weak and nx_atomic_compare_exchange_strong function

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-17 15:40:48 +08:00
chenrun1
9138e8af01 lib_pathbuffer.c:Use atomic instead of locks
Summary:
  Use atomic_cmpxchg to ensure that in multithreaded situations, if someone releases the buffer, it can be applied for in time. And use atomic_ulong to save free_bitmap

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-12-17 09:33:50 +08:00
chao an
4c379ecc98 libs/libc: rename LIBC_MAX_PATHBUFFER to LIBC_PATHBUFFER_MAX
Unified naming style:

if LIBC_PATHBUFFER
config LIBC_PATHBUFFER_MAX
...
config LIBC_PATHBUFFER_MALLOC
...
endif # LIBC_PATHBUFFER

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-17 09:33:50 +08:00
chao an
cf060b6bf2 libs/libc: add a option to disable path buffer by default
If the current platform does not require a large PATH_MAX size support and toolchain supports alloca(),
we could turn off this option to improve performance.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-17 09:33:50 +08:00
YAMAMOTO Takashi
1f65af208a libxx: Make LIBCXXABI default for sim/macOS
Fix build errors like:
https://github.com/apache/nuttx/issues/14774
2024-12-17 09:25:24 +08:00
zhaohaiyang1
bb7562c380 nuttx/can.h: delete "begin_packed_struct" and "end_packed_struct" qualifier
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-12-17 09:25:02 +08:00
YAMAMOTO Takashi
63a9e1ff89 fs/littlefs/Make.defs: fix a littlefs unpack regression
Note that $(CONFIG_FS_LITTLEFS_VERSION).tar.gz is expanded to
eg. "v2.5.1".tar.gz. The extra quotes break make's file existence
checks.

Fixes: https://github.com/apache/nuttx/issues/15148

The regression was caused by https://github.com/apache/nuttx/pull/14903
2024-12-17 09:24:28 +08:00
Alin Jerpelea
58bc6d5ec3 arch/esp32c3-legacy/esp32c3_ice40: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Copyright and Author information is missing from the License and was filled with
commit authorship
    Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
0bfa46497d drivers/spi/ice40: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Copyright and Author information is missing from the License and was filled with
commit authorship
    Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
1e85f0c195 arch/arm/xmc4: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
62306849ca boards/arm/s32k1xx: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
e5272996f7 include/crypto/sha1: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
11183f68ab include/crypto/rijndael: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
b95414e6ba include/crypto/poly1305: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
8ba848a12b include/crypto/md5: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
438caa767a include/crypto/cast: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
0f2337e175 include/search: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
a9e3614eaa crypto/sha1: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
fea44435d4 crypto/rijndael: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
97827ab26b crypto/poly1305: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
568add3259 crypto/md5: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
861f81d9d7 crypto/chacha: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
ef0045ba0d crypto/cast: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
9ea488fd60 tools/macar-qcs.sh: migrate license to ASF
Xiaomi has signed the SGA and we can migrate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
1a21acf5a4 arch/esp32c3-legacy/hardware: migrate license to ASF
the author has submitted the CLA and the license can be migrated to ASF
    Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Alin Jerpelea
d19c0b8444 arch/esp32c3-legacy/hardware: migrate license to ASF
both co-authors have submitted the CLA and the license can be migrated to ASF
 Co-authored-by: Dong Heng <dongheng@espressif.com>
 Co-authored-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Andre Heinemans
f4e650352e sensors: fix Make.defs for bmm150 2024-12-16 10:27:21 +08:00
simbit18
97371c5b45 windows native: fixed FAILED: System.map
fixed

[1025/1027] Generating System.map
FAILED: System.map C:/nuttxgit/nuttx/build/System.map
cmd.exe /C "cd /D C:\nuttxgit\nuttx\build && arm-none-eabi-nm nuttx | grep -v '(compiled)|($)|( [aUw] )|(..ng$)|(LASH[RL]DI)' | sort > System.map"
2024-12-16 10:27:06 +08:00
Andre Heinemans
84ab0a3785 lpuart: fix build errors for SINGLEWIRE and INVERT without SERIAL_TERMIOS 2024-12-16 10:26:48 +08:00
Andre Heinemans
a0f0252e92 arm64/imx9: tpm: fix TPM_FILTER_CHXFVAL_MASK macro 2024-12-16 09:56:55 +08:00
Tiago Medicci Serrano
0da4e44e48 rv-virt/citest: Increase init task stack size to 3072
After https://github.com/apache/nuttx/pull/15075, the size of the
stack size has decreased 8 bytes and the init stack size for the
rv-virt:citest defconfig was near its full capacity, which lead to
crashing the `ps` command. The init stack size for this defconfig
was increased from 2048 to 3072 to avoid stack overflow.
2024-12-13 18:19:54 +08:00
SPRESENSE
957516105f arch: cxd56xx: Fix not restart after TX error
Fix a bug that I2C driver can not transfer after TX abort error.
It caused by remaining NO_STOP flag status.
2024-12-13 18:19:49 +08:00
chao an
6825f66fd6 sched/clock: cleanup g_system_ticks reference if arch timer is enabled
continue work of: https://github.com/apache/nuttx/pull/15139

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-13 18:19:44 +08:00
ligd
1463a49396 sched/clock: call up_timer_gettime() to get higher resolution
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-12-13 18:19:44 +08:00
Windrow14
90870ae62e fs/fat/fs_fat32util.c: fix potential exception due to dividing zero during mounting when fat is corrupted
Check fs_fatsecperclus' value when read from eMMC device. Return an error if it is zero.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-12-13 18:19:38 +08:00
Jukka Laitinen
1a74a44022 fs/shm/shmfs_alloc.c: Allocate zero-initialized memory in flat build
POSIX requires that the shm objects are zero-initialized. This has been broken
in some earlier commits (starting from 9af5fc5d09)

Also fix the flat build memory allocation to allocate both object data and payload
in the same chunk (as the comment also suggests). This saves allocations and memory
in a system with lots of shm objects.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-13 18:19:38 +08:00
chao an
200015d514 binfmt/exec: initialize binary_s to empty to avoid invaild access
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-13 18:19:13 +08:00
chao an
c6dfdbad41 binfmt/loadable: move binary_s to stack to avoid access allocator
Improve performance by reducing allocator accesses

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-13 18:19:13 +08:00
chao an
5abcc49789 mps2-an500/knsh: disable SPINLOCK to avoid build break
workaround for remove libc depends from kernel api

build break on phase 2 userspace link:

| arm-none-eabi-ld -o nuttx_user.elf --undefined=nsh_main --entry=nsh_main -T /nuttx/boards/arm/mps/mps2-an500/scripts/memory.ld \
| -T /nuttx/boards/arm/mps/mps2-an500/scripts/user-space.ld -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ \
| -L/nuttx/staging/ -L/nuttx/staging/ mps_userspace.o --start-group -lproxies -lc -lmm -larch -lxx -lapps --end-group \
| "prebuilts/linux/gcc/arm/bin/../lib/gcc/arm-none-eabi/13.3.1/thumb/v7e-m+fp/hard/libgcc.a"
|
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `spin_unlock_wo_note':
| /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x298): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x29c): undefined reference to `g_irq_spin'
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `lib_put_pathbuffer':
| /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x210): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x214): undefined reference to `g_irq_spin'
| make[1]: *** [Makefile:61: nuttx_user.elf] Error 1
| make[1]: Leaving directory '/nuttx/boards/arm/mps/mps2-an500/kernel'
| make: *** [tools/Unix.mk:540: nuttx] Error 2

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 22:00:45 +08:00
chao an
2ccdd947a1 libc/chdir: replace heap alloc to path buffer to improve performance
realloc path buffer to avoid alloc from realpath()

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 22:00:45 +08:00
chao an
bf27e4d75d esp/mcpwm: fix unpaired spin lock
N/A

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 22:00:28 +08:00
Tiago Medicci Serrano
6eb9b09960 xtensa/esp32s3: Update the reserved size for struct __lock
After https://github.com/apache/nuttx/pull/15075, the static
assertion at `nuttx/arch/xtensa/src/esp32s3/esp32s3_libc_stubs.c`
was being triggered when building any of the ESP32-S3's defconfigs.
This commit updates the reserved size to reflect the changes
introduced by the related PR.
2024-12-12 22:00:07 +08:00
Jouni Ukkonen
75ef5ea11e arch/arm64/imx9: Fix usdhc dma receive
Invalidate cache when dma transfer is ready

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-12-12 21:58:39 +08:00
anjiahao
5e4c14d8e8 procfs:fix cmdline overflow
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-12-12 21:58:23 +08:00
chao an
a94264ea00 arm/cxd56xx: Add g_ prefix to rtc spin lock
continue work of a68b00206b

| commit a68b00206b
| Author: hujun5 <hujun5@xiaomi.com>
| Date:   Mon Dec 9 20:48:09 2024 +0800
|
|     cxd56_rtc.c: use small lock in arch/arm/src/cxd56xx/cxd56_rtc.c
|
|     reason:
|     We hope to remove all instances of spin_lock_irqsave(NULL).
|
|     Signed-off-by: hujun5 <hujun5@xiaomi.com>

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-11 20:35:45 +08:00
buxiasen
52c4408db9 document/drivertest: add more information in drivertest
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 20:35:28 +08:00
Nathan Hartman
532bf64515 Documentation: Tweak text about Zero Latency Interrupts
This is a follow-up to 366c8a5d94 (PR-15102).

* Documentation/guides/zerolatencyinterrupts.rst
  (Title): Make title case consistent.
  (Getting Back into the Game, Maskable Nested Interrupts): Clarify discussion
   about priorities.
  (Cortex-M3/4 Implementation): The first half of a sentence was deleted in
   366c8a5d9 because the Kconfig that was described there no longer exists:
   CONFIG_ARMV7M_USEBASEPRI. Write a new beginning for this sentence that
   matches current implementation.
  (Disabling the High Priority Interrupt): Change "cannot" to "must not be
   allowed to" to improve clarity.
  (Configuring High Priority Interrupts): Change "to NVIC" to "in NVIC" to
   improve clarity.
2024-12-11 20:35:28 +08:00
Xiang Xiao
34d1a7fd54 Documentation: Remove CONFIG_ARMV7M_USEBASEPRI from code base
since the basepri is always used without any configuraion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-11 20:35:28 +08:00
chao an
32ab151712 libc/chdir: chdir/fchdir should not depend on environment variables
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-11 20:35:00 +08:00
meijian
3fdcd065cf net/tcp_timer: fix tcp RTO abnormally large after retransmission occurs
when tcp retransmission only double conn->timer in Karn(tcp_timer.c L602), after retransmission in Jacobson
M is is now rtt test will become a negative value.
```
  signed char m;
  m = conn->rto - conn->timer; // M is now rtt test

  /* This is taken directly from VJs original code in his paper */

  m = m - (conn->sa >> 3);
  conn->sa += m;              //conn->sa is a negative value
  if (m < 0)
	{
	  m = -m;
	}

  m = m - (conn->sv >> 2);
  conn->sv += m;
  conn->rto = (conn->sa >> 3) + conn->sv; //rto
```
For example,we lost one ack packet, we will set conn->timer = 6 by backoff,conn->rto still 3.
After retransmission we will Do RTT estimation, then will get
```
conn->sa = 253
conn->rto = 46
```
Then if any packets lost it will wait for a long time before triggering a retransmission.

Test method.
We can reproduce this issue by adding drop ACK packets in tcp_input, and debug conn->rto after Jacobson.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-12-11 20:34:23 +08:00
hujun5
3063f2c0e0 litex_serial: use small lock in arch/risc-v/src/litex/litex_serial.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-11 00:52:20 +08:00
hujun5
7e5088f4ea cxd56_rtc.c: use small lock in arch/arm/src/cxd56xx/cxd56_rtc.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:59:17 +08:00
hujun5
ecab220c39 max32660_rtc: use small lock in arch/arm/src/max326xx/max32660/max32660_rtc.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:59:06 +08:00
simbit18
6b7722cfb4 build(CMAKE): fix pac sim elf ONLY in Linux platform
avoid SIM compilation post build issues on other platforms

same fix for build with make
https://github.com/apache/nuttx/pull/14800
2024-12-10 21:57:55 +08:00
hujun5
c8bdfb537e lc823450_dma: use small lock in arch/arm/src/lc823450/lc823450_dma.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:57:44 +08:00
hujun5
bae0b64da3 s32k3xx_serial: use small lock in arch/arm/src/s32k3xx/s32k3xx_serial.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-10 21:57:34 +08:00
simbit18
eec97064d7 fix nxstyle
Removed extra spaces from .h and .c files
2024-12-10 21:57:22 +08:00
Alan Carvalho de Assis
0164e09339 Doc: Fix kernel thread API
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-10 21:57:09 +08:00
Alan Carvalho de Assis
e268b2a5b9 Fix small typo in rp2040_adc.c 2024-12-10 21:57:09 +08:00
chao an
01e76ddcd9 limits/path: replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency
replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-10 21:56:57 +08:00
wangjianyu3
7562aff615 fs/tmpfs: Skip any slash at the beginning of relpath
`tmpfs_stat()` fails when relpath start with slash.

Log

  Host
    $ adb -s 1234 pull /tmp/subdir
    adb: warning: skipping special file '/tmp/subdir/uname' (mode = 0o0)
    /tmp/subdir/: 0 files pulled. 1 file skipped.

  Device
    state_process_list (411): stat failed </tmp/subdir//uname> -1 22

Ref: https://github.com/apache/nuttx/blame/master/libs/libc/stdlib/lib_realpath.c#L111
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-09 21:20:20 +08:00
hujun5
16b63ed837 armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfault

Background
    The origin of this issue is our desire to eliminate the function of storing
"regs" in g_current_regs and instead utilize (*running_task)->xcp.regs for storage.
The benefits of this approach include faster storage speed and
avoiding multiple accesses to g_current_regs during context switching,
thus ensuring that whether returning from an interrupt or an exception,
we consistently use this_task()->xcp.regs

Issue Encountered
    However, when storing registers, we must ensure that (running_task)->xcp.regs is invalid
so that it can be safely overwritten.
According to the existing logic, the only scenario where (running_task)->xcp.regs
is valid is during restore_context. We must accurately identify this scenario.
Initially, we used the condition (running_task)==NULL for this purpose, but we deemed
this approach unsatisfactory as it did not align well with the actual logic.
(running_task) should not be NULL. Consequently, we adopted other arch-specific methods for judgment,
but due to special logic in some arch, the judgment was not accurate, leading to this issue.

Solution:
    For armv6-m, we haven't found a more suitable solution, so we are sticking with (*running_task)==NULL.
    For armv7-m/armv8-m, by removing support for primask, we can achieve accurate judgment.

    PRIMASK is a design in armv6-m, that's why arm introduce BASEPRI from armv7-m.
It's wrong to provide this option for armv7-m/armv8-m arch.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 21:20:06 +08:00
hujun5
702affa63b armv6m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfalt

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 21:20:06 +08:00
427 changed files with 1874 additions and 2355 deletions

View file

@ -751,7 +751,7 @@ endif()
# Generate system map using the compiler toolchain. Conventionally, the tool # Generate system map using the compiler toolchain. Conventionally, the tool
# which dump symbols are called nm, though, some compiler toolchain may have a # which dump symbols are called nm, though, some compiler toolchain may have a
# different name. # different name.
if(NOT WIN32) if(NOT CMAKE_HOST_WIN32)
add_custom_command( add_custom_command(
OUTPUT System.map OUTPUT System.map
COMMAND COMMAND

View file

@ -1,3 +1,5 @@
====================================== ======================================
``drivertest`` vela cmocka driver test ``drivertest`` cmocka driver test
====================================== ======================================
This is a test for specific driver or chip based on cmocka.

View file

@ -7,20 +7,9 @@ framework dedicated for complex embedded systems.
This page contains notes on running some of NuttX boards on Renode. This page contains notes on running some of NuttX boards on Renode.
ARM-v7m
=======
Renode doesn't correctly handle ``SVC`` instruction escalation to HardFault
when ``PRIMASK=1`` which crashs NuttX in the first ``up_exit()`` call.
We can work around this problem by enabling BASEPRI::
CONFIG_ARMV7M_USEBASEPRI=y
stm32f4discovery stm32f4discovery
================ ================
``CONFIG_ARMV7M_USEBASEPRI=y`` must be set.
Renode doesn't support CCM memory, so we have to disable it Renode doesn't support CCM memory, so we have to disable it
with ``CONFIG_MM_REGIONS=1``. with ``CONFIG_MM_REGIONS=1``.
@ -55,8 +44,6 @@ Doesn't work. No BASEPRI implementation for ``Cotex-M0`` in NuttX.
nrf52840-dk nrf52840-dk
=========== ===========
``CONFIG_ARMV7M_USEBASEPRI=y`` must be set.
At default Renode uses UART with EasyDMA enabled (UARTE) which is not supported At default Renode uses UART with EasyDMA enabled (UARTE) which is not supported
by Nuttx yet. We can get around this by creating our own machine description by Nuttx yet. We can get around this by creating our own machine description
based on Renode default implementation:: based on Renode default implementation::
@ -101,7 +88,7 @@ Known issues:
stm32f746g-disco stm32f746g-disco
================ ================
``CONFIG_ARMV7M_USEBASEPRI=y`` and ``CONFIG_ARMV7M_BASEPRI_WAR=y`` must be set. ``CONFIG_ARMV7M_BASEPRI_WAR=y`` must be set.
Renode script:: Renode script::
@ -131,8 +118,6 @@ Known issues:
nucleo-h743zi nucleo-h743zi
============= =============
``CONFIG_ARMV7M_USEBASEPRI=y`` must be set.
Renode doesn't support ``PWR_CSR1_ACTVOSRDY`` bit so we have to disable Renode doesn't support ``PWR_CSR1_ACTVOSRDY`` bit so we have to disable
it with ``CONFIG_STM32H7_PWR_IGNORE_ACTVOSRDY=y``. it with ``CONFIG_STM32H7_PWR_IGNORE_ACTVOSRDY=y``.

View file

@ -43,18 +43,18 @@ Kernel Threads
============== ==============
Kernel threads are really like tasks except that they run inside the operating Kernel threads are really like tasks except that they run inside the operating
system and are started with ``kernel_thread()`` which is prototyped in system and are started with ``kthread_create()`` which is prototyped in
``include/nuttx/kthread.h``. The differ from tasks in that (1) in PROTECTED and ``include/nuttx/kthread.h``. The differ from tasks in that (1) in PROTECTED and
KERNEL builds, they have full supervisor privileges, and (2) they have full KERNEL builds, they have full supervisor privileges, and (2) they have full
access to all internal OS resources. access to all internal OS resources.
In order to build the task into the OS as a kernel thread, you simply have to: In order to build the task into the OS as a kernel thread, you simply have to:
(1) place the kernel thread code in your board source code directory, and (2) (1) place the kernel thread code in your board source code directory, and (2)
start it with ``kernel_thread()`` in your board bring-up logic. There a few start it with ``kthread_create()`` in your board bring-up logic. There a few
examples of this in the NuttX source tree. Here is one: examples of this in the NuttX source tree. Here is one:
`https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c <https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c>`_ `https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c <https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c>`_
So that is another trick that you can use to architecture optimal solutions: So that is another trick that you can use to architecture optimal solutions:
Create parts of your applications as kernel threads: They need to reside in Create parts of your applications as kernel threads: They need to reside in
your board/src directory and the need to be started with ``kernel_thread()`` in your board/src directory and the need to be started with ``kthread_create()`` in
your board bring-up logic. And that is it. your board bring-up logic. And that is it.

View file

@ -1,5 +1,5 @@
===================================================================== =====================================================================
High Performance: Zero Latency Interrupts, Maskable nested interrupts High Performance: Zero Latency Interrupts, Maskable Nested Interrupts
===================================================================== =====================================================================
Generic Interrupt Handling Generic Interrupt Handling
@ -125,9 +125,11 @@ The following table shows the priority levels of the Cortex-M family:
Low prio IRQ 0xB0 Low prio IRQ 0xB0
PendSV 0xE0 PendSV 0xE0
As you can see, the priority levels of the zero-latency interrupts can Lower priority *numbers* mean a higher priority on this architecture.
beyond the critical section and SVC.
But High prio IRQ can't call OS API. As you can see, the zero-latency interrupts have higher priority than
the critical section and SVC, but with the tradeoff that High prio IRQ
can't call OS APIs in ISR.
Maskable Nested Interrupts Maskable Nested Interrupts
@ -162,9 +164,11 @@ The following table shows the priority levels of the Cortex-M family:
Low prio IRQ 0xB0 Low prio IRQ 0xB0
PendSV 0xE0 PendSV 0xE0
Lower priority *numbers* mean a higher priority on this architecture.
As you can see, the priority levels of the maskable nested interrupts As you can see, the priority levels of the maskable nested interrupts
are between the critical section and the low-priority interrupts. are between the critical section and the low-priority interrupts. In
And High prio IRQ can call OS API in ISR. this case, High prio IRQ can call OS APIs in ISR.
Nested Interrupt Handling Nested Interrupt Handling
@ -216,8 +220,7 @@ Configuration Options
``CONFIG_ARCH_HIPRI_INTERRUPT`` ``CONFIG_ARCH_HIPRI_INTERRUPT``
If ``CONFIG_ARMV7M_USEBASEPRI`` is selected, then interrupts will be The OS disables interrupts by setting the *BASEPRI* register to
disabled by setting the *BASEPRI* register to
``NVIC_SYSH_DISABLE_PRIORITY`` so that most interrupts will not have ``NVIC_SYSH_DISABLE_PRIORITY`` so that most interrupts will not have
execution priority. *SVCall* must have execution priority in all execution priority. *SVCall* must have execution priority in all
cases. cases.
@ -255,8 +258,8 @@ priority interrupt response time.
Hence, if you need to disable the high priority interrupt, you will Hence, if you need to disable the high priority interrupt, you will
have to disable the interrupt either at the peripheral that generates have to disable the interrupt either at the peripheral that generates
the interrupt or at the interrupt controller, the *NVIC*. Disabling the interrupt or at the interrupt controller, the *NVIC*. Disabling
global interrupts via the *BASEPRI* register cannot affect high global interrupts via the *BASEPRI* register must not be allowed to
priority interrupts. affect high priority interrupts.
Dependencies Dependencies
------------ ------------
@ -287,7 +290,7 @@ There are two ways to do this:
* Alternatively, you could keep your vectors in FLASH but in order to * Alternatively, you could keep your vectors in FLASH but in order to
this, you would have to develop your own custom vector table. this, you would have to develop your own custom vector table.
Second, you need to set the priority of your interrupt to *NVIC* to Second, you need to set the priority of your interrupt in *NVIC* to
``NVIC_SYSH_HIGH_PRIORITY`` using the standard interface: ``NVIC_SYSH_HIGH_PRIORITY`` using the standard interface:
``int up_prioritize_irq(int irq, int priority);`` ``int up_prioritize_irq(int irq, int priority);``

View file

@ -110,7 +110,6 @@ If you are going to use a debugger, you should make sure that the following
settings are selection in your configuration file:: settings are selection in your configuration file::
CONFIG_DEBUG_SYMBOLS=y : Enable debug symbols in the build CONFIG_DEBUG_SYMBOLS=y : Enable debug symbols in the build
CONFIG_ARMV7M_USEBASEPRI=y : Use the BASEPRI register to disable interrupts
STM32 ST-LINK Utility STM32 ST-LINK Utility
--------------------- ---------------------

View file

@ -226,7 +226,6 @@ If you are going to use a debugger, you should make sure that the following
settings are selection in your configuration file:: settings are selection in your configuration file::
CONFIG_DEBUG_SYMBOLS=y : Enable debug symbols in the build CONFIG_DEBUG_SYMBOLS=y : Enable debug symbols in the build
CONFIG_ARMV7M_USEBASEPRI=y : Use the BASEPRI register to disable interrupts
STM32 ST-LINK Utility STM32 ST-LINK Utility
--------------------- ---------------------

View file

@ -1279,11 +1279,6 @@ config ARCH_HIPRI_INTERRUPT
is extended to any other family, then this discussion will have to is extended to any other family, then this discussion will have to
be generalized. be generalized.
If ARMV7M_USEBASEPRI is selected, then interrupts will be disabled
by setting the BASEPRI register to NVIC_SYSH_DISABLE_PRIORITY so
that most interrupts will not have execution priority. SVCall must
have execution priority in all cases.
In the normal cases, interrupts are not nest-able and all interrupts In the normal cases, interrupts are not nest-able and all interrupts
run at an execution priority between NVIC_SYSH_PRIORITY_MIN and run at an execution priority between NVIC_SYSH_PRIORITY_MIN and
NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for

View file

@ -65,11 +65,7 @@
*/ */
#define REG_R13 (0) /* R13 = SP at time of interrupt */ #define REG_R13 (0) /* R13 = SP at time of interrupt */
#ifdef CONFIG_ARMV7M_USEBASEPRI
#define REG_BASEPRI (1) /* BASEPRI */ #define REG_BASEPRI (1) /* BASEPRI */
#else
# define REG_PRIMASK (1) /* PRIMASK */
#endif
#define REG_R4 (2) /* R4 */ #define REG_R4 (2) /* R4 */
#define REG_R5 (3) /* R5 */ #define REG_R5 (3) /* R5 */
#define REG_R6 (4) /* R6 */ #define REG_R6 (4) /* R6 */
@ -385,13 +381,9 @@ static inline void raisebasepri(uint32_t basepri)
static inline void up_irq_disable(void) always_inline_function; static inline void up_irq_disable(void) always_inline_function;
static inline void up_irq_disable(void) static inline void up_irq_disable(void)
{ {
#ifdef CONFIG_ARMV7M_USEBASEPRI
/* Probably raising priority */ /* Probably raising priority */
raisebasepri(NVIC_SYSH_DISABLE_PRIORITY); raisebasepri(NVIC_SYSH_DISABLE_PRIORITY);
#else
__asm__ __volatile__ ("\tcpsid i\n");
#endif
} }
/* Save the current primask state & disable IRQs */ /* Save the current primask state & disable IRQs */
@ -400,31 +392,11 @@ static inline irqstate_t up_irq_save(void)
always_inline_function noinstrument_function; always_inline_function noinstrument_function;
static inline irqstate_t up_irq_save(void) static inline irqstate_t up_irq_save(void)
{ {
#ifdef CONFIG_ARMV7M_USEBASEPRI
/* Probably raising priority */ /* Probably raising priority */
uint8_t basepri = getbasepri(); uint8_t basepri = getbasepri();
raisebasepri(NVIC_SYSH_DISABLE_PRIORITY); raisebasepri(NVIC_SYSH_DISABLE_PRIORITY);
return (irqstate_t)basepri; return (irqstate_t)basepri;
#else
unsigned short primask;
/* Return the current value of primask register and set
* bit 0 of the primask register to disable interrupts
*/
__asm__ __volatile__
(
"\tmrs %0, primask\n"
"\tcpsid i\n"
: "=r" (primask)
:
: "memory");
return primask;
#endif
} }
/* Enable IRQs */ /* Enable IRQs */
@ -444,27 +416,9 @@ static inline void up_irq_restore(irqstate_t flags)
always_inline_function noinstrument_function; always_inline_function noinstrument_function;
static inline void up_irq_restore(irqstate_t flags) static inline void up_irq_restore(irqstate_t flags)
{ {
#ifdef CONFIG_ARMV7M_USEBASEPRI
/* In this case, we are always retaining or lowering the priority value */ /* In this case, we are always retaining or lowering the priority value */
setbasepri((uint32_t)flags); setbasepri((uint32_t)flags);
#else
/* If bit 0 of the primask is 0, then we need to restore
* interrupts.
*/
__asm__ __volatile__
(
"\ttst %0, #1\n"
"\tbne.n 1f\n"
"\tcpsie i\n"
"1:\n"
:
: "r" (flags)
: "cc", "memory");
#endif
} }
/* Get/set IPSR */ /* Get/set IPSR */

View file

@ -33,12 +33,7 @@
* Pre-processor Prototypes * Pre-processor Prototypes
****************************************************************************/ ****************************************************************************/
/* If CONFIG_ARMV7M_USEBASEPRI is selected, then interrupts will be disabled /* In the normal cases, interrupts are not nest-able and all interrupts run
* by setting the BASEPRI register to NVIC_SYSH_DISABLE_PRIORITY so that most
* interrupts will not have execution priority. SVCall must have execution
* priority in all cases.
*
* In the normal cases, interrupts are not nest-able and all interrupts run
* at an execution priority between NVIC_SYSH_PRIORITY_MIN and * at an execution priority between NVIC_SYSH_PRIORITY_MIN and
* NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for SVCall). * NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for SVCall).
* *

View file

@ -65,11 +65,7 @@
*/ */
#define REG_R13 (0) /* R13 = SP at time of interrupt */ #define REG_R13 (0) /* R13 = SP at time of interrupt */
#ifdef CONFIG_ARMV8M_USEBASEPRI
#define REG_BASEPRI (1) /* BASEPRI */ #define REG_BASEPRI (1) /* BASEPRI */
#else
# define REG_PRIMASK (1) /* PRIMASK */
#endif
#define REG_R4 (2) /* R4 */ #define REG_R4 (2) /* R4 */
#define REG_R5 (3) /* R5 */ #define REG_R5 (3) /* R5 */
#define REG_R6 (4) /* R6 */ #define REG_R6 (4) /* R6 */
@ -358,13 +354,9 @@ static inline void setbasepri(uint32_t basepri)
static inline void up_irq_disable(void) always_inline_function; static inline void up_irq_disable(void) always_inline_function;
static inline void up_irq_disable(void) static inline void up_irq_disable(void)
{ {
#ifdef CONFIG_ARMV8M_USEBASEPRI
/* Probably raising priority */ /* Probably raising priority */
raisebasepri(NVIC_SYSH_DISABLE_PRIORITY); raisebasepri(NVIC_SYSH_DISABLE_PRIORITY);
#else
__asm__ __volatile__ ("\tcpsid i\n");
#endif
} }
/* Save the current primask state & disable IRQs */ /* Save the current primask state & disable IRQs */
@ -373,31 +365,11 @@ static inline irqstate_t up_irq_save(void)
always_inline_function noinstrument_function; always_inline_function noinstrument_function;
static inline irqstate_t up_irq_save(void) static inline irqstate_t up_irq_save(void)
{ {
#ifdef CONFIG_ARMV8M_USEBASEPRI
/* Probably raising priority */ /* Probably raising priority */
uint8_t basepri = getbasepri(); uint8_t basepri = getbasepri();
raisebasepri(NVIC_SYSH_DISABLE_PRIORITY); raisebasepri(NVIC_SYSH_DISABLE_PRIORITY);
return (irqstate_t)basepri; return (irqstate_t)basepri;
#else
unsigned short primask;
/* Return the current value of primask register and set
* bit 0 of the primask register to disable interrupts
*/
__asm__ __volatile__
(
"\tmrs %0, primask\n"
"\tcpsid i\n"
: "=r" (primask)
:
: "memory");
return primask;
#endif
} }
/* Enable IRQs */ /* Enable IRQs */
@ -417,27 +389,9 @@ static inline void up_irq_restore(irqstate_t flags)
always_inline_function noinstrument_function; always_inline_function noinstrument_function;
static inline void up_irq_restore(irqstate_t flags) static inline void up_irq_restore(irqstate_t flags)
{ {
#ifdef CONFIG_ARMV8M_USEBASEPRI
/* In this case, we are always retaining or lowering the priority value */ /* In this case, we are always retaining or lowering the priority value */
setbasepri((uint32_t)flags); setbasepri((uint32_t)flags);
#else
/* If bit 0 of the primask is 0, then we need to restore
* interrupts.
*/
__asm__ __volatile__
(
"\ttst %0, #1\n"
"\tbne.n 1f\n"
"\tcpsie i\n"
"1:\n"
:
: "r" (flags)
: "cc", "memory");
#endif
} }
/* Get/set IPSR */ /* Get/set IPSR */

View file

@ -33,12 +33,7 @@
* Pre-processor Prototypes * Pre-processor Prototypes
****************************************************************************/ ****************************************************************************/
/* If CONFIG_ARMV8M_USEBASEPRI is selected, then interrupts will be disabled /* In the normal cases, interrupts are not nest-able and all interrupts run
* by setting the BASEPRI register to NVIC_SYSH_DISABLE_PRIORITY so that most
* interrupts will not have execution priority. SVCall must have execution
* priority in all cases.
*
* In the normal cases, interrupts are not nest-able and all interrupts run
* at an execution priority between NVIC_SYSH_PRIORITY_MIN and * at an execution priority between NVIC_SYSH_PRIORITY_MIN and
* NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for SVCall). * NVIC_SYSH_PRIORITY_MAX (with NVIC_SYSH_PRIORITY_MAX reserved for SVCall).
* *

View file

@ -112,7 +112,7 @@ typedef unsigned int _size_t;
*/ */
#ifdef __thumb2__ #ifdef __thumb2__
#if defined(CONFIG_ARMV7M_USEBASEPRI) || defined(CONFIG_ARCH_ARMV6M) || defined(CONFIG_ARMV8M_USEBASEPRI) #if defined(CONFIG_ARCH_ARMV6M) || defined(CONFIG_ARCH_ARMV7M) || defined(CONFIG_ARCH_ARMV8M)
typedef unsigned char irqstate_t; typedef unsigned char irqstate_t;
#else #else
typedef unsigned short irqstate_t; typedef unsigned short irqstate_t;

View file

@ -65,7 +65,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
* is invalid, and we can safely overwrite it. * is invalid, and we can safely overwrite it.
*/ */
if (!(NVIC_IRQ_SVCALL == irq && regs[REG_R0] == SYS_restore_context)) if (*running_task != NULL)
{ {
tcb->xcp.regs = regs; tcb->xcp.regs = regs;
} }

View file

@ -165,6 +165,7 @@ retry:
rtcb->irqcount--; rtcb->irqcount--;
#endif #endif
g_running_tasks[this_cpu()] = NULL;
rtcb->xcp.regs = rtcb->xcp.saved_regs; rtcb->xcp.regs = rtcb->xcp.saved_regs;
arm_fullcontextrestore(); arm_fullcontextrestore();
UNUSED(regs); UNUSED(regs);

View file

@ -13,30 +13,10 @@ config ARMV7M_HAVE_DCACHE
bool bool
default n default n
config ARMV7M_USEBASEPRI
bool "Use BASEPRI Register"
default ARCH_HIPRI_INTERRUPT
depends on ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7
---help---
Use the BASEPRI register to enable and disable interrupts. By
default, the PRIMASK register is used for this purpose. This
usually results in hardfaults when supervisor calls are made.
Though, these hardfaults are properly handled by the RTOS, the
hardfaults can confuse some debuggers. With the BASEPRI
register, these hardfaults, will be avoided. For more details see
https://cwiki.apache.org/confluence/display/NUTTX/ARMv7-M+Hardfaults%2C+SVCALL%2C+and+Debuggers
WARNING: If CONFIG_ARCH_HIPRI_INTERRUPT is selected, then you
MUST select CONFIG_ARMV7M_USEBASEPRI. The Kconfig dependencies
here will permit to select an invalid configuration because it
cannot enforce that requirement. If you create this invalid
configuration, you will encounter some problems that may be
very difficult to debug.
config ARMV7M_BASEPRI_WAR config ARMV7M_BASEPRI_WAR
bool "Cortex-M7 r0p1 Errata 837070 Workaround" bool "Cortex-M7 r0p1 Errata 837070 Workaround"
default n default n
depends on ARMV7M_USEBASEPRI && ARCH_CORTEXM7 depends on ARCH_CORTEXM7
---help--- ---help---
Enable workaround for r0p1 Errata 837070: Increasing priority using Enable workaround for r0p1 Errata 837070: Increasing priority using
write to BASEPRI does not take effect immediately. write to BASEPRI does not take effect immediately.

View file

@ -71,14 +71,6 @@
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8 # if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8
# error Interrupt stack must be used with high priority interrupts in protected mode # error Interrupt stack must be used with high priority interrupts in protected mode
# endif
/* Use the BASEPRI to control interrupts is required if nested, high
* priority interrupts are supported.
*/
# ifndef CONFIG_ARMV7M_USEBASEPRI
# error CONFIG_ARMV7M_USEBASEPRI must be used with CONFIG_ARCH_HIPRI_INTERRUPT
# endif # endif
#endif #endif
@ -151,11 +143,8 @@ exception_common:
mov r2, r1 /* R2=Copy of the main/process stack pointer */ mov r2, r1 /* R2=Copy of the main/process stack pointer */
add r2, #HW_XCPT_SIZE /* R2=MSP/PSP before the interrupt was taken */ add r2, #HW_XCPT_SIZE /* R2=MSP/PSP before the interrupt was taken */
/* (ignoring the xPSR[9] alignment bit) */ /* (ignoring the xPSR[9] alignment bit) */
#ifdef CONFIG_ARMV7M_USEBASEPRI
mrs r3, basepri /* R3=Current BASEPRI setting */ mrs r3, basepri /* R3=Current BASEPRI setting */
#else
mrs r3, primask /* R3=Current PRIMASK setting */
#endif
#ifdef CONFIG_ARCH_FPU #ifdef CONFIG_ARCH_FPU
@ -237,11 +226,7 @@ exception_common:
/* Restore the interrupt state */ /* Restore the interrupt state */
#ifdef CONFIG_ARMV7M_USEBASEPRI
msr basepri, r3 /* Restore interrupts priority masking */ msr basepri, r3 /* Restore interrupts priority masking */
#else
msr primask, r3 /* Restore interrupts */
#endif
msr control, r12 /* Restore control */ msr control, r12 /* Restore control */

View file

@ -42,10 +42,6 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* If CONFIG_ARMV7M_USEBASEPRI=n, then debug output from this file may
* interfere with context switching!
*/
#ifdef CONFIG_DEBUG_HARDFAULT_ALERT #ifdef CONFIG_DEBUG_HARDFAULT_ALERT
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__) # define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
#else #else
@ -79,50 +75,7 @@ int arm_hardfault(int irq, void *context, void *arg)
uint32_t cfsr = getreg32(NVIC_CFAULTS); uint32_t cfsr = getreg32(NVIC_CFAULTS);
UNUSED(cfsr); UNUSED(cfsr);
UNUSED(hfsr);
/* Get the value of the program counter where the fault occurred */
#ifndef CONFIG_ARMV7M_USEBASEPRI
uint32_t *regs = (uint32_t *)context;
uint16_t *pc = (uint16_t *)regs[REG_PC] - 1;
/* Check if the pc lies in known FLASH memory.
* REVISIT: What if the PC lies in "unknown" external memory? Best
* use the BASEPRI register if you have external memory.
*/
#ifdef CONFIG_BUILD_PROTECTED
/* In the kernel build, SVCalls are expected in either the base, kernel
* FLASH region or in the user FLASH region.
*/
if (((uintptr_t)pc >= (uintptr_t)_START_TEXT &&
(uintptr_t)pc < (uintptr_t)_END_TEXT) ||
((uintptr_t)pc >= (uintptr_t)USERSPACE->us_textstart &&
(uintptr_t)pc < (uintptr_t)USERSPACE->us_textend))
#else
/* SVCalls are expected only from the base, kernel FLASH region */
if ((uintptr_t)pc >= (uintptr_t)_START_TEXT &&
(uintptr_t)pc < (uintptr_t)_END_TEXT)
#endif
{
/* Fetch the instruction that caused the Hard fault */
uint16_t insn = *pc;
hfinfo(" PC: %p INSN: %04x\n", pc, insn);
/* If this was the instruction 'svc 0', then forward processing
* to the SVCall handler
*/
if (insn == INSN_SVC0)
{
hfinfo("Forward SVCall\n");
return arm_svcall(irq, context, arg);
}
}
#endif
if (hfsr & NVIC_HFAULTS_FORCED) if (hfsr & NVIC_HFAULTS_FORCED)
{ {

View file

@ -161,19 +161,9 @@ void up_initial_state(struct tcb_s *tcb)
/* Enable or disable interrupts, based on user configuration */ /* Enable or disable interrupts, based on user configuration */
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
#ifdef CONFIG_ARMV7M_USEBASEPRI
xcp->regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; xcp->regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
xcp->regs[REG_PRIMASK] = 1;
#endif
#else /* CONFIG_SUPPRESS_INTERRUPTS */ #else /* CONFIG_SUPPRESS_INTERRUPTS */
#ifdef CONFIG_ARMV7M_USEBASEPRI
xcp->regs[REG_BASEPRI] = 0; xcp->regs[REG_BASEPRI] = 0;
#endif
#endif /* CONFIG_SUPPRESS_INTERRUPTS */ #endif /* CONFIG_SUPPRESS_INTERRUPTS */
} }

View file

@ -1,9 +1,13 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/arm_itm.c * arch/arm/src/armv7-m/arm_itm.c
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: * met:
@ -29,11 +33,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -91,11 +91,7 @@ up_saveusercontext:
/* Save r13, primask, r4~r11 */ /* Save r13, primask, r4~r11 */
mov r2, sp mov r2, sp
#ifdef CONFIG_ARMV7M_USEBASEPRI
mrs r3, basepri mrs r3, basepri
#else
mrs r3, primask
#endif
stmia r0!, {r2-r11} stmia r0!, {r2-r11}
/* Save EXC_RETURN to 0xffffffff */ /* Save EXC_RETURN to 0xffffffff */

View file

@ -138,11 +138,7 @@ void up_schedule_sigaction(struct tcb_s *tcb)
*/ */
tcb->xcp.regs[REG_PC] = (uint32_t)arm_sigdeliver; tcb->xcp.regs[REG_PC] = (uint32_t)arm_sigdeliver;
#ifdef CONFIG_ARMV7M_USEBASEPRI
tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
tcb->xcp.regs[REG_PRIMASK] = 1;
#endif
tcb->xcp.regs[REG_XPSR] = ARMV7M_XPSR_T; tcb->xcp.regs[REG_XPSR] = ARMV7M_XPSR_T;
#ifdef CONFIG_BUILD_PROTECTED #ifdef CONFIG_BUILD_PROTECTED
tcb->xcp.regs[REG_LR] = EXC_RETURN_THREAD; tcb->xcp.regs[REG_LR] = EXC_RETURN_THREAD;

View file

@ -89,11 +89,7 @@ retry:
while (rtcb->irqcount > 0) while (rtcb->irqcount > 0)
{ {
#ifdef CONFIG_ARMV7M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
#else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
#endif
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
@ -139,11 +135,7 @@ retry:
(rtcb->flags & TCB_FLAG_SIGNAL_ACTION) == 0) (rtcb->flags & TCB_FLAG_SIGNAL_ACTION) == 0)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
# ifdef CONFIG_ARMV7M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
# else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
# endif
#endif #endif
goto retry; goto retry;
} }
@ -169,11 +161,7 @@ retry:
/* We need to keep the IRQ lock until task switching */ /* We need to keep the IRQ lock until task switching */
rtcb->irqcount++; rtcb->irqcount++;
#ifdef CONFIG_ARMV7M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
#else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
#endif
rtcb->irqcount--; rtcb->irqcount--;
#endif #endif

View file

@ -57,13 +57,8 @@ static const uint16_t g_reg_offs[] =
#if 0 #if 0
UINT16_MAX, /* msp */ UINT16_MAX, /* msp */
TCB_REG_OFF(REG_R13), TCB_REG_OFF(REG_R13),
# ifdef CONFIG_ARMV7M_USEBASEPRI
UINT16_MAX, /* primask */ UINT16_MAX, /* primask */
TCB_REG_OFF(REG_BASEPRI), TCB_REG_OFF(REG_BASEPRI),
# else
TCB_REG_OFF(REG_PRIMASK),
UINT16_MAX, /* basepri */
# endif
UINT16_MAX, /* faultmask */ UINT16_MAX, /* faultmask */
UINT16_MAX, /* control */ UINT16_MAX, /* control */

View file

@ -1,9 +1,10 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/dwt.h * arch/arm/src/armv7-m/dwt.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* * SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* All rights reserved. * SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -30,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/etm.h * arch/arm/src/armv7-m/etm.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileCopyrightText: 2014 2014 Silicon Laboratories, Inc.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,9 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/itm.h * arch/arm/src/armv7-m/itm.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -29,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,9 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/tpi.h * arch/arm/src/armv7-m/tpi.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -29,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -13,25 +13,6 @@ config ARMV8M_HAVE_DCACHE
bool bool
default n default n
config ARMV8M_USEBASEPRI
bool "Use BASEPRI Register"
default ARCH_HIPRI_INTERRUPT
---help---
Use the BASEPRI register to enable and disable interrupts. By
default, the PRIMASK register is used for this purpose. This
usually results in hardfaults when supervisor calls are made.
Though, these hardfaults are properly handled by the RTOS, the
hardfaults can confuse some debuggers. With the BASEPRI
register, these hardfaults, will be avoided. For more details see
https://cwiki.apache.org/confluence/display/NUTTX/ARMv7-M+Hardfaults%2C+SVCALL%2C+and+Debuggers
WARNING: If CONFIG_ARCH_HIPRI_INTERRUPT is selected, then you
MUST select CONFIG_ARMV8M_USEBASEPRI. The Kconfig dependencies
here will permit to select an invalid configuration because it
cannot enforce that requirement. If you create this invalid
configuration, you will encounter some problems that may be
very difficult to debug.
config ARMV8M_ICACHE config ARMV8M_ICACHE
bool "Use I-Cache" bool "Use I-Cache"
default n default n

View file

@ -1,14 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv8-m/arm_cache.c * arch/arm/src/armv8-m/arm_cache.c
* *
* Copyright (C) 2015, 2018-2019 Gregory Nutt. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause
* Author: Gregory Nutt <gnutt@nuttx.org> * SPDX-FileCopyrightText: 2015, 2018-2019 Gregory Nutt. All rights reserved.
* Bob Feretich <bob.feretich@rafresearch.com> * SPDX-FileCopyrightText: 2009 - 2014 ARM LIMITED. All rights reserved.
* * SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* Some logic in this header file derives from the ARM CMSIS core_cm7.h * SPDX-FileContributor: Bob Feretich <bob.feretich@rafresearch.com>
* header file which has a compatible 3-clause BSD license:
*
* Copyright (c) 2009 - 2014 ARM LIMITED. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions

View file

@ -72,14 +72,6 @@
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8 # if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8
# error Interrupt stack must be used with high priority interrupts in protected mode # error Interrupt stack must be used with high priority interrupts in protected mode
# endif
/* Use the BASEPRI to control interrupts is required if nested, high
* priority interrupts are supported.
*/
# ifndef CONFIG_ARMV8M_USEBASEPRI
# error CONFIG_ARMV8M_USEBASEPRI must be used with CONFIG_ARCH_HIPRI_INTERRUPT
# endif # endif
#endif #endif
@ -154,11 +146,7 @@ exception_common:
stmdb r1!, {r0} stmdb r1!, {r0}
#endif #endif
#ifdef CONFIG_ARMV8M_USEBASEPRI
mrs r3, basepri /* R3=Current BASEPRI setting */ mrs r3, basepri /* R3=Current BASEPRI setting */
#else
mrs r3, primask /* R3=Current PRIMASK setting */
#endif
#ifdef CONFIG_ARCH_FPU #ifdef CONFIG_ARCH_FPU
@ -258,11 +246,7 @@ exception_common:
/* Restore the interrupt state */ /* Restore the interrupt state */
#ifdef CONFIG_ARMV8M_USEBASEPRI
msr basepri, r3 /* Restore interrupts priority masking */ msr basepri, r3 /* Restore interrupts priority masking */
#else
msr primask, r3 /* Restore interrupts */
#endif
msr control, r12 msr control, r12

View file

@ -42,10 +42,6 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* If CONFIG_ARMV8M_USEBASEPRI=n, then debug output from this file may
* interfere with context switching!
*/
#ifdef CONFIG_DEBUG_HARDFAULT_ALERT #ifdef CONFIG_DEBUG_HARDFAULT_ALERT
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__) # define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
#else #else
@ -82,50 +78,7 @@ int arm_hardfault(int irq, void *context, void *arg)
#endif /* CONFIG_DEBUG_SECUREFAULT */ #endif /* CONFIG_DEBUG_SECUREFAULT */
UNUSED(cfsr); UNUSED(cfsr);
UNUSED(hfsr);
/* Get the value of the program counter where the fault occurred */
#ifndef CONFIG_ARMV8M_USEBASEPRI
uint32_t *regs = (uint32_t *)context;
uint16_t *pc = (uint16_t *)regs[REG_PC] - 1;
/* Check if the pc lies in known FLASH memory.
* REVISIT: What if the PC lies in "unknown" external memory? Best
* use the BASEPRI register if you have external memory.
*/
#ifdef CONFIG_BUILD_PROTECTED
/* In the kernel build, SVCalls are expected in either the base, kernel
* FLASH region or in the user FLASH region.
*/
if (((uintptr_t)pc >= (uintptr_t)_START_TEXT &&
(uintptr_t)pc < (uintptr_t)_END_TEXT) ||
((uintptr_t)pc >= (uintptr_t)USERSPACE->us_textstart &&
(uintptr_t)pc < (uintptr_t)USERSPACE->us_textend))
#else
/* SVCalls are expected only from the base, kernel FLASH region */
if ((uintptr_t)pc >= (uintptr_t)_START_TEXT &&
(uintptr_t)pc < (uintptr_t)_END_TEXT)
#endif
{
/* Fetch the instruction that caused the Hard fault */
uint16_t insn = *pc;
hfinfo(" PC: %p INSN: %04x\n", pc, insn);
/* If this was the instruction 'svc 0', then forward processing
* to the SVCall handler
*/
if (insn == INSN_SVC0)
{
hfinfo("Forward SVCall\n");
return arm_svcall(irq, context, arg);
}
}
#endif
if (hfsr & NVIC_HFAULTS_FORCED) if (hfsr & NVIC_HFAULTS_FORCED)
{ {

View file

@ -168,17 +168,11 @@ void up_initial_state(struct tcb_s *tcb)
#ifdef CONFIG_SUPPRESS_INTERRUPTS #ifdef CONFIG_SUPPRESS_INTERRUPTS
#ifdef CONFIG_ARMV8M_USEBASEPRI
xcp->regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; xcp->regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
xcp->regs[REG_PRIMASK] = 1;
#endif
#else /* CONFIG_SUPPRESS_INTERRUPTS */ #else /* CONFIG_SUPPRESS_INTERRUPTS */
#ifdef CONFIG_ARMV8M_USEBASEPRI
xcp->regs[REG_BASEPRI] = 0; xcp->regs[REG_BASEPRI] = 0;
#endif
#endif /* CONFIG_SUPPRESS_INTERRUPTS */ #endif /* CONFIG_SUPPRESS_INTERRUPTS */
} }

View file

@ -83,11 +83,7 @@ up_saveusercontext:
/* Save r13, primask, r4~r11 */ /* Save r13, primask, r4~r11 */
mov r2, sp mov r2, sp
#ifdef CONFIG_ARMV7M_USEBASEPRI
mrs r3, basepri mrs r3, basepri
#else
mrs r3, primask
#endif
stmia r0!, {r2-r11} stmia r0!, {r2-r11}
/* Save EXC_RETURN to 0xffffffff */ /* Save EXC_RETURN to 0xffffffff */

View file

@ -138,11 +138,7 @@ void up_schedule_sigaction(struct tcb_s *tcb)
*/ */
tcb->xcp.regs[REG_PC] = (uint32_t)arm_sigdeliver; tcb->xcp.regs[REG_PC] = (uint32_t)arm_sigdeliver;
#ifdef CONFIG_ARMV8M_USEBASEPRI
tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY;
#else
tcb->xcp.regs[REG_PRIMASK] = 1;
#endif
tcb->xcp.regs[REG_XPSR] = ARMV8M_XPSR_T; tcb->xcp.regs[REG_XPSR] = ARMV8M_XPSR_T;
#ifdef CONFIG_BUILD_PROTECTED #ifdef CONFIG_BUILD_PROTECTED
tcb->xcp.regs[REG_LR] = EXC_RETURN_THREAD; tcb->xcp.regs[REG_LR] = EXC_RETURN_THREAD;

View file

@ -89,11 +89,7 @@ retry:
while (rtcb->irqcount > 0) while (rtcb->irqcount > 0)
{ {
#ifdef CONFIG_ARMV8M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
#else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
#endif
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
@ -139,11 +135,7 @@ retry:
(rtcb->flags & TCB_FLAG_SIGNAL_ACTION) == 0) (rtcb->flags & TCB_FLAG_SIGNAL_ACTION) == 0)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
# ifdef CONFIG_ARMV8M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
# else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
# endif
#endif #endif
goto retry; goto retry;
} }
@ -169,11 +161,7 @@ retry:
/* We need to keep the IRQ lock until task switching */ /* We need to keep the IRQ lock until task switching */
rtcb->irqcount++; rtcb->irqcount++;
#ifdef CONFIG_ARMV8M_USEBASEPRI
leave_critical_section((uint8_t)regs[REG_BASEPRI]); leave_critical_section((uint8_t)regs[REG_BASEPRI]);
#else
leave_critical_section((uint16_t)regs[REG_PRIMASK]);
#endif
rtcb->irqcount--; rtcb->irqcount--;
#endif #endif

View file

@ -57,13 +57,8 @@ static const uint16_t g_reg_offs[] =
#if 0 #if 0
UINT16_MAX, /* msp */ UINT16_MAX, /* msp */
TCB_REG_OFF(REG_R13), TCB_REG_OFF(REG_R13),
# ifdef CONFIG_ARMV8M_USEBASEPRI
UINT16_MAX, /* primask */ UINT16_MAX, /* primask */
TCB_REG_OFF(REG_BASEPRI), TCB_REG_OFF(REG_BASEPRI),
# else
TCB_REG_OFF(REG_PRIMASK),
UINT16_MAX, /* basepri */
# endif
UINT16_MAX, /* faultmask */ UINT16_MAX, /* faultmask */
UINT16_MAX, /* control */ UINT16_MAX, /* control */

View file

@ -1,9 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv8-m/dwt.h * arch/arm/src/armv8-m/dwt.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -29,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv8-m/etm.h * arch/arm/src/armv8-m/etm.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,9 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv8-m/itm.h * arch/arm/src/armv8-m/itm.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -29,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,9 +1,11 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv8-m/tpi.h * arch/arm/src/armv8-m/tpi.h
* *
* Copyright (c) 2009 - 2013 ARM LIMITED * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville. All rights reserved.
* SPDX-FileCopyrightText: 2009 - 2013 ARM LIMITED
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* All rights reserved.
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -29,9 +31,6 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -183,7 +183,6 @@ static int at32_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void at32_prioritize_syscall(int priority) static inline void at32_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -195,7 +194,6 @@ static inline void at32_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: at32_irqinfo * Name: at32_irqinfo
@ -328,9 +326,8 @@ void up_irqinitialize(void)
#ifdef CONFIG_ARCH_IRQPRIO #ifdef CONFIG_ARCH_IRQPRIO
/* up_prioritize_irq(AT32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(AT32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
at32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); at32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -196,6 +196,7 @@ struct up_dev_s
struct uart_dev_s dev; /* Generic UART device */ struct uart_dev_s dev; /* Generic UART device */
uint16_t ie; /* Saved interrupt mask bits value */ uint16_t ie; /* Saved interrupt mask bits value */
uint16_t sr; /* Saved status bits */ uint16_t sr; /* Saved status bits */
spinlock_t lock; /* Spinlock */
/* Has been initialized and HW is setup. */ /* Has been initialized and HW is setup. */
@ -1087,10 +1088,10 @@ static inline void up_serialout(struct up_dev_s *priv, int offset,
} }
/**************************************************************************** /****************************************************************************
* Name: up_setusartint * Name: up_setusartint_nolock
****************************************************************************/ ****************************************************************************/
static inline void up_setusartint(struct up_dev_s *priv, uint16_t ie) static inline void up_setusartint_nolock(struct up_dev_s *priv, uint16_t ie)
{ {
uint32_t cr; uint32_t cr;
@ -1117,16 +1118,18 @@ static inline void up_setusartint(struct up_dev_s *priv, uint16_t ie)
* Name: up_restoreusartint * Name: up_restoreusartint
****************************************************************************/ ****************************************************************************/
#if defined(HAVE_RS485) || CONSOLE_UART > 0
static void up_restoreusartint(struct up_dev_s *priv, uint16_t ie) static void up_restoreusartint(struct up_dev_s *priv, uint16_t ie)
{ {
irqstate_t flags; irqstate_t flags;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&priv->lock);
up_setusartint(priv, ie); up_setusartint_nolock(priv, ie);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: up_disableusartint * Name: up_disableusartint
@ -1136,7 +1139,7 @@ static void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
{ {
irqstate_t flags; irqstate_t flags;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&priv->lock);
if (ie) if (ie)
{ {
@ -1175,9 +1178,9 @@ static void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
/* Disable all interrupts */ /* Disable all interrupts */
up_setusartint(priv, 0); up_setusartint_nolock(priv, 0);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
/**************************************************************************** /****************************************************************************
@ -1490,6 +1493,8 @@ static int up_setup(struct uart_dev_s *dev)
priv->ie = 0; priv->ie = 0;
spin_lock_init(&priv->lock);
/* Mark device as initialized. */ /* Mark device as initialized. */
priv->initialized = true; priv->initialized = true;
@ -2044,13 +2049,13 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
irqstate_t flags; irqstate_t flags;
uint32_t tx_break; uint32_t tx_break;
flags = enter_critical_section(); flags = spin_lock_irqsave(&priv->lock);
/* Disable any further tx activity */ /* Disable any further tx activity */
priv->ie |= USART_CR1_IE_BREAK_INPROGRESS; priv->ie |= USART_CR1_IE_BREAK_INPROGRESS;
up_txint(dev, false); up_txint_nolock(dev, false);
/* Configure TX as a GPIO output pin and Send a break signal */ /* Configure TX as a GPIO output pin and Send a break signal */
@ -2058,7 +2063,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
priv->tx_gpio); priv->tx_gpio);
at32_configgpio(tx_break); at32_configgpio(tx_break);
leave_critical_section(flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
break; break;
@ -2066,7 +2071,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
{ {
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&priv->lock);
/* Configure TX back to U(S)ART */ /* Configure TX back to U(S)ART */
@ -2076,9 +2081,9 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
/* Enable further tx activity */ /* Enable further tx activity */
up_txint(dev, true); up_txint_nolock(dev, true);
leave_critical_section(flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
break; break;
# else # else
@ -2087,10 +2092,10 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
uint32_t cr1; uint32_t cr1;
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&priv->lock);
cr1 = up_serialin(priv, AT32_USART_CTRL1_OFFSET); cr1 = up_serialin(priv, AT32_USART_CTRL1_OFFSET);
up_serialout(priv, AT32_USART_CTRL1_OFFSET, cr1 | USART_CR1_SBK); up_serialout(priv, AT32_USART_CTRL1_OFFSET, cr1 | USART_CR1_SBK);
leave_critical_section(flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
break; break;
@ -2099,10 +2104,10 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
uint32_t cr1; uint32_t cr1;
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&priv->lock);
cr1 = up_serialin(priv, AT32_USART_CTRL1_OFFSET); cr1 = up_serialin(priv, AT32_USART_CTRL1_OFFSET);
up_serialout(priv, AT32_USART_CTRL1_OFFSET, cr1 & ~USART_CR1_SBK); up_serialout(priv, AT32_USART_CTRL1_OFFSET, cr1 & ~USART_CR1_SBK);
leave_critical_section(flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
break; break;
# endif # endif
@ -2156,10 +2161,9 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status)
****************************************************************************/ ****************************************************************************/
#if defined(SERIAL_HAVE_TXDMA_OPS) || defined(SERIAL_HAVE_NODMA_OPS) #if defined(SERIAL_HAVE_TXDMA_OPS) || defined(SERIAL_HAVE_NODMA_OPS)
static void up_rxint(struct uart_dev_s *dev, bool enable) static void up_rxint_nolock(struct uart_dev_s *dev, bool enable)
{ {
struct up_dev_s *priv = (struct up_dev_s *)dev->priv; struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
irqstate_t flags;
uint16_t ie; uint16_t ie;
/* USART receive interrupts: /* USART receive interrupts:
@ -2177,7 +2181,6 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
* " " USART_STS_ROERR Overrun Error Detected * " " USART_STS_ROERR Overrun Error Detected
*/ */
flags = enter_critical_section();
ie = priv->ie; ie = priv->ie;
if (enable) if (enable)
{ {
@ -2201,8 +2204,17 @@ static void up_rxint(struct uart_dev_s *dev, bool enable)
/* Then set the new interrupt state */ /* Then set the new interrupt state */
up_restoreusartint(priv, ie); up_setusartint_nolock(priv, ie);
leave_critical_section(flags); }
static void up_rxint(struct uart_dev_s *dev, bool enable)
{
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
irqstate_t flags;
flags = spin_lock_irqsave(&priv->lock);
up_rxint_nolock(dev, enable);
spin_unlock_irqrestore(&priv->lock, flags);
} }
#endif #endif
@ -2563,10 +2575,10 @@ static void up_dma_txint(struct uart_dev_s *dev, bool enable)
#if defined(SERIAL_HAVE_RXDMA_OPS) || defined(SERIAL_HAVE_NODMA_OPS) || \ #if defined(SERIAL_HAVE_RXDMA_OPS) || defined(SERIAL_HAVE_NODMA_OPS) || \
defined(CONFIG_AT32_SERIALBRK_BSDCOMPAT) defined(CONFIG_AT32_SERIALBRK_BSDCOMPAT)
static void up_txint(struct uart_dev_s *dev, bool enable)
static void up_txint_nolock(struct uart_dev_s *dev, bool enable)
{ {
struct up_dev_s *priv = (struct up_dev_s *)dev->priv; struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
irqstate_t flags;
/* USART transmit interrupts: /* USART transmit interrupts:
* *
@ -2577,7 +2589,6 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
* USART_CTRL3_CTSCFIEN USART_SR_CTS CTS flag (not used) * USART_CTRL3_CTSCFIEN USART_SR_CTS CTS flag (not used)
*/ */
flags = enter_critical_section();
if (enable) if (enable)
{ {
/* Set to receive an interrupt when the TX data register is empty */ /* Set to receive an interrupt when the TX data register is empty */
@ -2599,12 +2610,11 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
# ifdef CONFIG_AT32_SERIALBRK_BSDCOMPAT # ifdef CONFIG_AT32_SERIALBRK_BSDCOMPAT
if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS) if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS)
{ {
leave_critical_section(flags);
return; return;
} }
# endif # endif
up_restoreusartint(priv, ie); up_setusartint_nolock(priv, ie);
#else #else
/* Fake a TX interrupt here by just calling uart_xmitchars() with /* Fake a TX interrupt here by just calling uart_xmitchars() with
@ -2618,11 +2628,20 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
{ {
/* Disable the TX interrupt */ /* Disable the TX interrupt */
up_restoreusartint(priv, priv->ie & ~USART_CTRL1_TDBEIEN); up_setusartint_nolock(priv, priv->ie & ~USART_CTRL1_TDBEIEN);
}
} }
leave_critical_section(flags); static void up_txint(struct uart_dev_s *dev, bool enable)
{
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
irqstate_t flags;
flags = spin_lock_irqsave(&priv->lock);
up_txint_nolock(dev, enable);
spin_unlock_irqrestore(&priv->lock, flags);
} }
#endif #endif
/**************************************************************************** /****************************************************************************
@ -2929,7 +2948,7 @@ void at32_serial_dma_poll(void)
{ {
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&priv->lock);
#ifdef CONFIG_USART1_RXDMA #ifdef CONFIG_USART1_RXDMA
if (g_usart1priv.rxdma != NULL) if (g_usart1priv.rxdma != NULL)
@ -2987,7 +3006,7 @@ void at32_serial_dma_poll(void)
} }
#endif #endif
leave_critical_section(flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
#endif #endif

View file

@ -60,9 +60,18 @@ void up_exit(int status)
nxtask_exit(); nxtask_exit();
/* Scheduler parameters will update inside syscall */ /* Update g_running_tasks */
#ifdef CONFIG_ARCH_ARMV6M
/* ARMV6M syscal may trigger hard fault We use
* running_task != NULL to determine whether it is
* a context for restoration.
*/
g_running_tasks[this_cpu()] = NULL;
#else
g_running_tasks[this_cpu()] = this_task(); g_running_tasks[this_cpu()] = this_task();
#endif
/* Then switch contexts */ /* Then switch contexts */

View file

@ -33,6 +33,12 @@
#include "arm_internal.h" #include "arm_internal.h"
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_modifyreg_lock = SP_UNLOCKED;
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -50,10 +56,10 @@ void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits)
irqstate_t flags; irqstate_t flags;
uint16_t regval; uint16_t regval;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_modifyreg_lock);
regval = getreg16(addr); regval = getreg16(addr);
regval &= ~clearbits; regval &= ~clearbits;
regval |= setbits; regval |= setbits;
putreg16(regval, addr); putreg16(regval, addr);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_modifyreg_lock, flags);
} }

View file

@ -87,7 +87,6 @@ static int csk6_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV8M_USEBASEPRI
static inline void csk6_prioritize_syscall(int priority) static inline void csk6_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -99,7 +98,6 @@ static inline void csk6_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@ -180,9 +178,7 @@ void up_irqinitialize(void)
/* up_prioritize_irq(CSK6_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(CSK6_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV8M_USEBASEPRI
csk6_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); csk6_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -53,6 +53,12 @@
#define INTC_EN(n) (CXD32_INTC_BASE + 0x10 + (((n) >> 5) << 2)) #define INTC_EN(n) (CXD32_INTC_BASE + 0x10 + (((n) >> 5) << 2))
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_cxd32_lock = SP_UNLOCKED;
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
@ -74,7 +80,7 @@ static void cxd32_dumpnvic(const char *msg, int irq)
{ {
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&g_cxd32_lock);
irqinfo("NVIC (%s, irq=%d):\n", msg, irq); irqinfo("NVIC (%s, irq=%d):\n", msg, irq);
irqinfo(" INTCTRL: %08x VECTAB: %08x\n", getreg32(NVIC_INTCTRL), irqinfo(" INTCTRL: %08x VECTAB: %08x\n", getreg32(NVIC_INTCTRL),
getreg32(NVIC_VECTAB)); getreg32(NVIC_VECTAB));
@ -103,7 +109,7 @@ static void cxd32_dumpnvic(const char *msg, int irq)
getreg32(NVIC_IRQ48_51_PRIORITY), getreg32(NVIC_IRQ48_51_PRIORITY),
getreg32(NVIC_IRQ52_55_PRIORITY), getreg32(NVIC_IRQ52_55_PRIORITY),
getreg32(NVIC_IRQ56_59_PRIORITY)); getreg32(NVIC_IRQ56_59_PRIORITY));
leave_critical_section(flags); spin_unlock_irqrestore(&g_cxd32_lock, flags);
} }
#else #else
# define cxd32_dumpnvic(msg, irq) # define cxd32_dumpnvic(msg, irq)
@ -154,7 +160,6 @@ static int cxd32_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void cxd32_prioritize_syscall(int priority) static inline void cxd32_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -166,7 +171,6 @@ static inline void cxd32_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
static int excinfo(int irq, uintptr_t *regaddr, uint32_t *bit) static int excinfo(int irq, uintptr_t *regaddr, uint32_t *bit)
{ {
@ -282,9 +286,7 @@ void up_irqinitialize(void)
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
cxd32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); cxd32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.
@ -312,21 +314,6 @@ void up_irqinitialize(void)
cxd32_dumpnvic("initial", CXD32_IRQ_NIRQS); cxd32_dumpnvic("initial", CXD32_IRQ_NIRQS);
/* If a debugger is connected, try to prevent it from catching hardfaults.
* If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal
* operation.
*/
#if defined(CONFIG_DEBUG_FEATURES) && !defined(CONFIG_ARMV7M_USEBASEPRI)
{
uint32_t regval;
regval = getreg32(NVIC_DEMCR);
regval &= ~NVIC_DEMCR_VCHARDERR;
putreg32(regval, NVIC_DEMCR);
}
#endif
/* And finally, enable interrupts */ /* And finally, enable interrupts */
#ifndef CONFIG_SUPPRESS_INTERRUPTS #ifndef CONFIG_SUPPRESS_INTERRUPTS
@ -350,14 +337,14 @@ void up_disable_irq(int irq)
if (irq >= CXD32_IRQ_EXTINT) if (irq >= CXD32_IRQ_EXTINT)
{ {
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd32_lock);
irq -= CXD32_IRQ_EXTINT; irq -= CXD32_IRQ_EXTINT;
bit = 1 << (irq & 0x1f); bit = 1 << (irq & 0x1f);
regval = getreg32(INTC_EN(irq)); regval = getreg32(INTC_EN(irq));
regval &= ~bit; regval &= ~bit;
putreg32(regval, INTC_EN(irq)); putreg32(regval, INTC_EN(irq));
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd32_lock, flags);
putreg32(bit, NVIC_IRQ_CLEAR(irq)); putreg32(bit, NVIC_IRQ_CLEAR(irq));
} }
else else
@ -389,14 +376,14 @@ void up_enable_irq(int irq)
if (irq >= CXD32_IRQ_EXTINT) if (irq >= CXD32_IRQ_EXTINT)
{ {
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd32_lock);
irq -= CXD32_IRQ_EXTINT; irq -= CXD32_IRQ_EXTINT;
bit = 1 << (irq & 0x1f); bit = 1 << (irq & 0x1f);
regval = getreg32(INTC_EN(irq)); regval = getreg32(INTC_EN(irq));
regval |= bit; regval |= bit;
putreg32(regval, INTC_EN(irq)); putreg32(regval, INTC_EN(irq));
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd32_lock, flags);
putreg32(bit, NVIC_IRQ_ENABLE(irq)); putreg32(bit, NVIC_IRQ_ENABLE(irq));
} }
else else

View file

@ -112,6 +112,8 @@ struct uartdev
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static spinlock_t g_cxd32xx_lock = SP_UNLOCKED;
static const struct uartdev g_uartdevs[] = static const struct uartdev g_uartdevs[] =
{ {
{ {
@ -270,7 +272,7 @@ void cxd32_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
uint32_t fbrd; uint32_t fbrd;
uint32_t lcr_h; uint32_t lcr_h;
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd32xx_lock);
div = (uint64_t)(basefreq); div = (uint64_t)(basefreq);
div *= (uint64_t)(256); div *= (uint64_t)(256);
@ -287,5 +289,5 @@ void cxd32_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
lcr_h = getreg32(uartbase + CXD32_UART_LCR_H); lcr_h = getreg32(uartbase + CXD32_UART_LCR_H);
putreg32(lcr_h, uartbase + CXD32_UART_LCR_H); putreg32(lcr_h, uartbase + CXD32_UART_LCR_H);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd32xx_lock, flags);
} }

View file

@ -95,6 +95,8 @@
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static spinlock_t g_cxd56_lock = SP_UNLOCKED;
static xcpt_t g_isr[MAX_SLOT]; static xcpt_t g_isr[MAX_SLOT];
static uint32_t g_bothedge = 0; static uint32_t g_bothedge = 0;
@ -114,7 +116,7 @@ static int alloc_slot(int pin, bool isalloc)
: CXD56_TOPREG_IOCAPP_INTSEL0; : CXD56_TOPREG_IOCAPP_INTSEL0;
int offset = (pin < PIN_IS_CLK) ? 1 : 56; int offset = (pin < PIN_IS_CLK) ? 1 : 56;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_cxd56_lock);
for (slot = 0; slot < MAX_SYS_SLOT; slot++) for (slot = 0; slot < MAX_SYS_SLOT; slot++)
{ {
@ -144,12 +146,12 @@ static int alloc_slot(int pin, bool isalloc)
} }
else else
{ {
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
return -ENXIO; /* no space */ return -ENXIO; /* no space */
} }
} }
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
if (PIN_IS_CLK <= pin) if (PIN_IS_CLK <= pin)
{ {
@ -309,13 +311,13 @@ static void invert_irq(int irq)
irqstate_t flags; irqstate_t flags;
uint32_t val; uint32_t val;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_cxd56_lock);
val = getreg32(CXD56_INTC_INVERT); val = getreg32(CXD56_INTC_INVERT);
val ^= (1 << (irq - CXD56_IRQ_EXTINT)); val ^= (1 << (irq - CXD56_IRQ_EXTINT));
putreg32(val, CXD56_INTC_INVERT); putreg32(val, CXD56_INTC_INVERT);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
} }
static bool inverted_irq(int irq) static bool inverted_irq(int irq)
@ -431,9 +433,9 @@ int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
irq_attach(irq, NULL, NULL); irq_attach(irq, NULL, NULL);
g_isr[slot] = NULL; g_isr[slot] = NULL;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_cxd56_lock);
g_bothedge &= ~(1 << slot); g_bothedge &= ~(1 << slot);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
return irq; return irq;
} }
@ -447,9 +449,9 @@ int cxd56_gpioint_config(uint32_t pin, uint32_t gpiocfg, xcpt_t isr,
{ {
/* set GPIO pseudo both edge interrupt */ /* set GPIO pseudo both edge interrupt */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_cxd56_lock);
g_bothedge |= (1 << slot); g_bothedge |= (1 << slot);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
/* detect the change from the current signal */ /* detect the change from the current signal */

View file

@ -667,6 +667,7 @@ static int cxd56_i2c_transfer(struct i2c_master_s *dev,
if (priv->error != OK) if (priv->error != OK)
{ {
ret = priv->error; ret = priv->error;
wostop = 0;
break; break;
} }

View file

@ -100,6 +100,12 @@ const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
}; };
#endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */ #endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */
/****************************************************************************
* Private Data
****************************************************************************/
static spinlock_t g_cxd56_lock = SP_UNLOCKED;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
@ -117,7 +123,7 @@ static void cxd56_dumpnvic(const char *msg, int irq)
{ {
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&g_cxd56_lock);
irqinfo("NVIC (%s, irq=%d):\n", msg, irq); irqinfo("NVIC (%s, irq=%d):\n", msg, irq);
irqinfo(" INTCTRL: %08x VECTAB: %08x\n", getreg32(NVIC_INTCTRL), irqinfo(" INTCTRL: %08x VECTAB: %08x\n", getreg32(NVIC_INTCTRL),
getreg32(NVIC_VECTAB)); getreg32(NVIC_VECTAB));
@ -146,7 +152,7 @@ static void cxd56_dumpnvic(const char *msg, int irq)
getreg32(NVIC_IRQ48_51_PRIORITY), getreg32(NVIC_IRQ48_51_PRIORITY),
getreg32(NVIC_IRQ52_55_PRIORITY), getreg32(NVIC_IRQ52_55_PRIORITY),
getreg32(NVIC_IRQ56_59_PRIORITY)); getreg32(NVIC_IRQ56_59_PRIORITY));
leave_critical_section(flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
} }
#else #else
# define cxd56_dumpnvic(msg, irq) # define cxd56_dumpnvic(msg, irq)
@ -197,7 +203,6 @@ static int cxd56_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void cxd56_prioritize_syscall(int priority) static inline void cxd56_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -209,7 +214,6 @@ static inline void cxd56_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
static int excinfo(int irq, uintptr_t *regaddr, uint32_t *bit) static int excinfo(int irq, uintptr_t *regaddr, uint32_t *bit)
{ {
@ -333,9 +337,7 @@ void up_irqinitialize(void)
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
cxd56_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); cxd56_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.
@ -363,21 +365,6 @@ void up_irqinitialize(void)
cxd56_dumpnvic("initial", CXD56_IRQ_NIRQS); cxd56_dumpnvic("initial", CXD56_IRQ_NIRQS);
/* If a debugger is connected, try to prevent it from catching hardfaults.
* If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal
* operation.
*/
#if defined(CONFIG_DEBUG_FEATURES) && !defined(CONFIG_ARMV7M_USEBASEPRI)
{
uint32_t regval;
regval = getreg32(NVIC_DEMCR);
regval &= ~NVIC_DEMCR_VCHARDERR;
putreg32(regval, NVIC_DEMCR);
}
#endif
/* And finally, enable interrupts */ /* And finally, enable interrupts */
#ifndef CONFIG_SUPPRESS_INTERRUPTS #ifndef CONFIG_SUPPRESS_INTERRUPTS
@ -424,14 +411,14 @@ void up_disable_irq(int irq)
g_cpu_for_irq[irq] = -1; g_cpu_for_irq[irq] = -1;
#endif #endif
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd56_lock);
irq -= CXD56_IRQ_EXTINT; irq -= CXD56_IRQ_EXTINT;
bit = 1 << (irq & 0x1f); bit = 1 << (irq & 0x1f);
regval = getreg32(INTC_EN(irq)); regval = getreg32(INTC_EN(irq));
regval &= ~bit; regval &= ~bit;
putreg32(regval, INTC_EN(irq)); putreg32(regval, INTC_EN(irq));
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
putreg32(bit, NVIC_IRQ_CLEAR(irq)); putreg32(bit, NVIC_IRQ_CLEAR(irq));
} }
else else
@ -479,14 +466,14 @@ void up_enable_irq(int irq)
} }
#endif #endif
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd56_lock);
irq -= CXD56_IRQ_EXTINT; irq -= CXD56_IRQ_EXTINT;
bit = 1 << (irq & 0x1f); bit = 1 << (irq & 0x1f);
regval = getreg32(INTC_EN(irq)); regval = getreg32(INTC_EN(irq));
regval |= bit; regval |= bit;
putreg32(regval, INTC_EN(irq)); putreg32(regval, INTC_EN(irq));
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd56_lock, flags);
putreg32(bit, NVIC_IRQ_ENABLE(irq)); putreg32(bit, NVIC_IRQ_ENABLE(irq));
} }
else else

View file

@ -113,6 +113,8 @@ struct rtc_backup_s
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static spinlock_t g_rtc_lock = SP_UNLOCKED;
/* Callback to use when the alarm expires */ /* Callback to use when the alarm expires */
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
@ -434,7 +436,7 @@ int up_rtc_settime(const struct timespec *tp)
irqstate_t flags; irqstate_t flags;
uint64_t count; uint64_t count;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_rtc_lock);
#ifdef RTC_DIRECT_CONTROL #ifdef RTC_DIRECT_CONTROL
/* wait until previous write request is completed */ /* wait until previous write request is completed */
@ -457,7 +459,7 @@ int up_rtc_settime(const struct timespec *tp)
g_rtc_save->offset = (int64_t)count - (int64_t)cxd56_rtc_count(); g_rtc_save->offset = (int64_t)count - (int64_t)cxd56_rtc_count();
#endif #endif
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_rtc_lock, flags);
rtc_dumptime(tp, "Setting time"); rtc_dumptime(tp, "Setting time");
@ -485,12 +487,12 @@ uint64_t cxd56_rtc_count(void)
* 1st post -> 2nd pre, and should be operated in atomic. * 1st post -> 2nd pre, and should be operated in atomic.
*/ */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_rtc_lock);
val = (uint64_t)getreg32(CXD56_RTC0_RTPOSTCNT) << 15; val = (uint64_t)getreg32(CXD56_RTC0_RTPOSTCNT) << 15;
val |= getreg32(CXD56_RTC0_RTPRECNT); val |= getreg32(CXD56_RTC0_RTPRECNT);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_rtc_lock, flags);
return val; return val;
} }
@ -512,12 +514,12 @@ uint64_t cxd56_rtc_almcount(void)
uint64_t val; uint64_t val;
irqstate_t flags; irqstate_t flags;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_rtc_lock);
val = (uint64_t)getreg32(CXD56_RTC0_SETALMPOSTCNT(0)) << 15; val = (uint64_t)getreg32(CXD56_RTC0_SETALMPOSTCNT(0)) << 15;
val |= (getreg32(CXD56_RTC0_SETALMPRECNT(0)) & 0x7fff); val |= (getreg32(CXD56_RTC0_SETALMPRECNT(0)) & 0x7fff);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_rtc_lock, flags);
return val; return val;
} }
@ -559,7 +561,7 @@ int cxd56_rtc_setalarm(struct alm_setalarm_s *alminfo)
{ {
/* The set the alarm */ /* The set the alarm */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_rtc_lock);
cbinfo->ac_cb = alminfo->as_cb; cbinfo->ac_cb = alminfo->as_cb;
cbinfo->ac_arg = alminfo->as_arg; cbinfo->ac_arg = alminfo->as_arg;
@ -590,7 +592,7 @@ int cxd56_rtc_setalarm(struct alm_setalarm_s *alminfo)
while (RTCREG_ALM_BUSY_MASK & getreg32(CXD56_RTC0_ALMOUTEN(id))); while (RTCREG_ALM_BUSY_MASK & getreg32(CXD56_RTC0_ALMOUTEN(id)));
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_rtc_lock, flags);
rtc_dumptime(&alminfo->as_time, "New Alarm time"); rtc_dumptime(&alminfo->as_time, "New Alarm time");
ret = OK; ret = OK;
@ -632,7 +634,7 @@ int cxd56_rtc_cancelalarm(enum alm_id_e alarmid)
{ {
/* Unset the alarm */ /* Unset the alarm */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_rtc_lock);
cbinfo->ac_cb = NULL; cbinfo->ac_cb = NULL;
@ -665,7 +667,7 @@ int cxd56_rtc_cancelalarm(enum alm_id_e alarmid)
putreg32(mask, CXD56_RTC0_ALMCLR); putreg32(mask, CXD56_RTC0_ALMCLR);
} }
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_rtc_lock, flags);
ret = OK; ret = OK;
} }

View file

@ -129,6 +129,8 @@ struct uartdev
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static spinlock_t g_cxd32xx_lock = SP_UNLOCKED;
static struct uartdev g_uartdevs[] = static struct uartdev g_uartdevs[] =
{ {
{ {
@ -206,7 +208,7 @@ static void cxd56_uart_pincontrol(int ch, bool on)
static void cxd56_uart_start(int ch) static void cxd56_uart_start(int ch)
{ {
irqstate_t flags = enter_critical_section(); irqstate_t flags = spin_lock_irqsave(&g_cxd32xx_lock);
cxd56_setbaud(CONSOLE_BASE, CONSOLE_BASEFREQ, CONSOLE_BAUD); cxd56_setbaud(CONSOLE_BASE, CONSOLE_BASEFREQ, CONSOLE_BAUD);
@ -214,7 +216,7 @@ static void cxd56_uart_start(int ch)
putreg32(g_cr, g_uartdevs[ch].uartbase + CXD56_UART_CR); putreg32(g_cr, g_uartdevs[ch].uartbase + CXD56_UART_CR);
leave_critical_section(flags); spin_unlock_irqrestore(&g_cxd32xx_lock, flags);
} }
/**************************************************************************** /****************************************************************************
@ -230,7 +232,7 @@ static void cxd56_uart_stop(int ch)
{ {
uint32_t cr; uint32_t cr;
irqstate_t flags = enter_critical_section(); irqstate_t flags = spin_lock_irqsave(&g_cxd32xx_lock);
while (UART_FR_BUSY & getreg32(g_uartdevs[ch].uartbase + CXD56_UART_FR)); while (UART_FR_BUSY & getreg32(g_uartdevs[ch].uartbase + CXD56_UART_FR));
@ -242,7 +244,7 @@ static void cxd56_uart_stop(int ch)
g_lcr = getreg32(g_uartdevs[ch].uartbase + CXD56_UART_LCR_H); g_lcr = getreg32(g_uartdevs[ch].uartbase + CXD56_UART_LCR_H);
putreg32(0, g_uartdevs[ch].uartbase + CXD56_UART_LCR_H); putreg32(0, g_uartdevs[ch].uartbase + CXD56_UART_LCR_H);
leave_critical_section(flags); spin_unlock_irqrestore(&g_cxd32xx_lock, flags);
} }
/**************************************************************************** /****************************************************************************
@ -463,7 +465,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
uint32_t div; uint32_t div;
uint32_t lcr_h; uint32_t lcr_h;
irqstate_t flags = spin_lock_irqsave(NULL); irqstate_t flags = spin_lock_irqsave(&g_cxd32xx_lock);
if (uartbase == CXD56_UART2_BASE) if (uartbase == CXD56_UART2_BASE)
{ {
@ -475,7 +477,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
} }
else else
{ {
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd32xx_lock, flags);
return; return;
} }
@ -502,7 +504,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
putreg32(lcr_h, uartbase + CXD56_UART_LCR_H); putreg32(lcr_h, uartbase + CXD56_UART_LCR_H);
finish: finish:
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_cxd32xx_lock, flags);
} }
/**************************************************************************** /****************************************************************************

View file

@ -1,7 +1,10 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/efm32_flash.c * arch/arm/src/efm32/efm32_flash.c
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2015 Pierre-Noel Bouteville.
* SPDX-FileContributor: Pierre-Noel Bouteville <pnb990@gmail.com>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,9 +27,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2015 Pierre-Noel Bouteville. All rights reserved.
* Author: Pierre-Noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -178,7 +178,6 @@ static int efm32_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void efm32_prioritize_syscall(int priority) static inline void efm32_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -190,7 +189,6 @@ static inline void efm32_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: efm32_irqinfo * Name: efm32_irqinfo
@ -328,11 +326,9 @@ void up_irqinitialize(void)
irq_attach(EFM32_IRQ_SVCALL, arm_svcall, NULL); irq_attach(EFM32_IRQ_SVCALL, arm_svcall, NULL);
irq_attach(EFM32_IRQ_HARDFAULT, arm_hardfault, NULL); irq_attach(EFM32_IRQ_HARDFAULT, arm_hardfault, NULL);
#ifdef CONFIG_ARMV7M_USEBASEPRI
/* Set the priority of the SVCall interrupt */ /* Set the priority of the SVCall interrupt */
efm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); efm32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_acmp.h * arch/arm/src/efm32/hardware/efm32_acmp.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_adc.h * arch/arm/src/efm32/hardware/efm32_adc.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_aes.h * arch/arm/src/efm32/hardware/efm32_aes.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_burtc.h * arch/arm/src/efm32/hardware/efm32_burtc.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_calibrate.h * arch/arm/src/efm32/hardware/efm32_calibrate.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_cmu.h * arch/arm/src/efm32/hardware/efm32_cmu.h
* *
* (C) Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_dac.h * arch/arm/src/efm32/hardware/efm32_dac.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_devinfo.h * arch/arm/src/efm32/hardware/efm32_devinfo.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_dma.h * arch/arm/src/efm32/hardware/efm32_dma.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_emu.h * arch/arm/src/efm32/hardware/efm32_emu.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,6 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_flash.h * arch/arm/src/efm32/hardware/efm32_flash.h
* *
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The * this work for additional information regarding copyright ownership. The

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_gpio.h * arch/arm/src/efm32/hardware/efm32_gpio.h
* *
* (C) Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_i2c.h * arch/arm/src/efm32/hardware/efm32_i2c.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_lcd.h * arch/arm/src/efm32/hardware/efm32_lcd.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_lesense.h * arch/arm/src/efm32/hardware/efm32_lesense.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_letimer.h * arch/arm/src/efm32/hardware/efm32_letimer.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_leuart.h * arch/arm/src/efm32/hardware/efm32_leuart.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,6 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_memorymap.h * arch/arm/src/efm32/hardware/efm32_memorymap.h
* *
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The * this work for additional information regarding copyright ownership. The

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_msc.h * arch/arm/src/efm32/hardware/efm32_msc.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_pcnt.h * arch/arm/src/efm32/hardware/efm32_pcnt.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_prs.h * arch/arm/src/efm32/hardware/efm32_prs.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_rmu.h * arch/arm/src/efm32/hardware/efm32_rmu.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_romtable.h * arch/arm/src/efm32/hardware/efm32_romtable.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_rtc.h * arch/arm/src/efm32/hardware/efm32_rtc.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_timer.h * arch/arm/src/efm32/hardware/efm32_timer.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_usart.h * arch/arm/src/efm32/hardware/efm32_usart.h
* *
* (C) Copyright 2014 Silicon Labs, http://www.silabs.com * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* special damages, or any other relief, or for any claim by any third party, * special damages, or any other relief, or for any claim by any third party,
* arising from your use of this Software. * arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_usb.h * arch/arm/src/efm32/hardware/efm32_usb.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_vcmp.h * arch/arm/src/efm32/hardware/efm32_vcmp.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,12 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32_wdog.h * arch/arm/src/efm32/hardware/efm32_wdog.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileCopyrightText: 2014 Gregory Nutt. All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* SPDX-FileContributor: Gregory Nutt <gnutt@nuttx.org>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,11 +29,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Authors: Pierre-noel Bouteville <pnb990@gmail.com>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,6 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32g_memorymap.h * arch/arm/src/efm32/hardware/efm32g_memorymap.h
* *
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The * this work for additional information regarding copyright ownership. The

View file

@ -1,7 +1,10 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32gg_memorymap.h * arch/arm/src/efm32/hardware/efm32gg_memorymap.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,9 +27,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -1,7 +1,10 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/efm32/hardware/efm32tg_memorymap.h * arch/arm/src/efm32/hardware/efm32tg_memorymap.h
* *
* Copyright 2014 Silicon Laboratories, Inc. http://www.silabs.com</b> * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014 Silicon Laboratories, Inc.
* SPDX-FileCopyrightText: 2014 Pierre-noel Bouteville . All rights reserved.
* SPDX-FileContributor: Pierre-noel Bouteville <pnb990@gmail.com>
* *
* Permission is granted to anyone to use this software for any purpose, * Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
@ -24,9 +27,6 @@
* incidental, or special damages, or any other relief, or for any claim by * incidental, or special damages, or any other relief, or for any claim by
* any third party, arising from your use of this Software. * any third party, arising from your use of this Software.
* *
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
* Author: Pierre-noel Bouteville <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:

View file

@ -159,7 +159,6 @@ static int eoss3_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void eoss3_prioritize_syscall(int priority) static inline void eoss3_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -171,7 +170,6 @@ static inline void eoss3_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: eoss3_irqinfo * Name: eoss3_irqinfo
@ -309,11 +307,9 @@ void up_irqinitialize(void)
irq_attach(EOSS3_IRQ_SVCALL, arm_svcall, NULL); irq_attach(EOSS3_IRQ_SVCALL, arm_svcall, NULL);
irq_attach(EOSS3_IRQ_HARDFAULT, arm_hardfault, NULL); irq_attach(EOSS3_IRQ_HARDFAULT, arm_hardfault, NULL);
#ifdef CONFIG_ARMV7M_USEBASEPRI
/* Set the priority of the SVCall interrupt */ /* Set the priority of the SVCall interrupt */
eoss3_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); eoss3_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -184,7 +184,6 @@ static int gd32_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void gd32_prioritize_syscall(int priority) static inline void gd32_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -196,7 +195,6 @@ static inline void gd32_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: gd32_irqinfo * Name: gd32_irqinfo
@ -332,9 +330,8 @@ void up_irqinitialize(void)
#ifdef CONFIG_ARCH_IRQPRIO #ifdef CONFIG_ARCH_IRQPRIO
/* up_prioritize_irq(GD32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(GD32_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
gd32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); gd32_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -48,6 +48,8 @@
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static spinlock_t g_imx_gpio_lock = SP_UNLOCKED;
static const uint8_t g_gpio1_padmux[IMX_GPIO_NPINS] = static const uint8_t g_gpio1_padmux[IMX_GPIO_NPINS] =
{ {
IMX_PADMUX_GPIO00_INDEX, /* GPIO1 Pin 0 */ IMX_PADMUX_GPIO00_INDEX, /* GPIO1 Pin 0 */
@ -515,7 +517,7 @@ int imx_config_gpio(gpio_pinset_t pinset)
/* Configure the pin as an input initially to avoid any spurious outputs */ /* Configure the pin as an input initially to avoid any spurious outputs */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_imx_gpio_lock);
/* Configure based upon the pin mode */ /* Configure based upon the pin mode */
@ -558,7 +560,7 @@ int imx_config_gpio(gpio_pinset_t pinset)
break; break;
} }
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_imx_gpio_lock, flags);
return ret; return ret;
} }
@ -576,9 +578,9 @@ void imx_gpio_write(gpio_pinset_t pinset, bool value)
int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; int port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT; int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
flags = enter_critical_section(); flags = spin_lock_irqsave(&g_imx_gpio_lock);
imx_gpio_setoutput(port, pin, value); imx_gpio_setoutput(port, pin, value);
leave_critical_section(flags); spin_unlock_irqrestore(&g_imx_gpio_lock, flags);
} }
/**************************************************************************** /****************************************************************************
@ -596,8 +598,8 @@ bool imx_gpio_read(gpio_pinset_t pinset)
int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT; int pin = (pinset & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT;
bool value; bool value;
flags = enter_critical_section(); flags = spin_lock_irqsave(&g_imx_gpio_lock);
value = imx_gpio_getinput(port, pin); value = imx_gpio_getinput(port, pin);
leave_critical_section(flags); spin_unlock_irqrestore(&g_imx_gpio_lock, flags);
return value; return value;
} }

View file

@ -260,7 +260,6 @@ static int imxrt_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void imxrt_prioritize_syscall(int priority) static inline void imxrt_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -272,7 +271,6 @@ static inline void imxrt_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: imxrt_irqinfo * Name: imxrt_irqinfo
@ -398,9 +396,6 @@ static int imxrt_irqinfo(int irq, uintptr_t *regaddr, uint32_t *bit,
void up_irqinitialize(void) void up_irqinitialize(void)
{ {
uintptr_t regaddr; uintptr_t regaddr;
#if defined(CONFIG_DEBUG_SYMBOLS) && !defined(CONFIG_ARMV7M_USEBASEPRI)
uint32_t regval;
#endif
int nintlines; int nintlines;
int i; int i;
@ -475,9 +470,8 @@ void up_irqinitialize(void)
#ifdef CONFIG_ARCH_IRQPRIO #ifdef CONFIG_ARCH_IRQPRIO
/* up_prioritize_irq(IMXRT_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(IMXRT_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
imxrt_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); imxrt_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.
@ -505,17 +499,6 @@ void up_irqinitialize(void)
imxrt_dumpnvic("initial", NR_IRQS); imxrt_dumpnvic("initial", NR_IRQS);
/* If a debugger is connected, try to prevent it from catching hardfaults.
* If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal
* operation.
*/
#if defined(CONFIG_DEBUG_SYMBOLS) && !defined(CONFIG_ARMV7M_USEBASEPRI)
regval = getreg32(NVIC_DEMCR);
regval &= ~NVIC_DEMCR_VCHARDERR;
putreg32(regval, NVIC_DEMCR);
#endif
#ifndef CONFIG_SUPPRESS_INTERRUPTS #ifndef CONFIG_SUPPRESS_INTERRUPTS
/* Initialize logic to support a second level of interrupt decoding for /* Initialize logic to support a second level of interrupt decoding for
* GPIO pins. * GPIO pins.

View file

@ -2465,7 +2465,10 @@ static int imxrt_interrupt(int irq, void *context, void *arg)
static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg) static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
{ {
#if defined(CONFIG_SERIAL_TIOCSERGSTRUCT) || defined(CONFIG_SERIAL_TERMIOS) #if defined(CONFIG_SERIAL_TIOCSERGSTRUCT) || \
defined(CONFIG_SERIAL_TERMIOS) || \
defined(CONFIG_IMXRT_LPUART_SINGLEWIRE ) || \
defined(CONFIG_IMXRT_LPUART_INVERT )
struct inode *inode = filep->f_inode; struct inode *inode = filep->f_inode;
struct uart_dev_s *dev = inode->i_private; struct uart_dev_s *dev = inode->i_private;
irqstate_t flags; irqstate_t flags;
@ -2664,7 +2667,6 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCSSINGLEWIRE: case TIOCSSINGLEWIRE:
{ {
uint32_t regval; uint32_t regval;
irqstate_t flags;
struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev; struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev;
flags = spin_lock_irqsave(&priv->lock); flags = spin_lock_irqsave(&priv->lock);
@ -2712,7 +2714,6 @@ static int imxrt_ioctl(struct file *filep, int cmd, unsigned long arg)
uint32_t ctrl; uint32_t ctrl;
uint32_t stat; uint32_t stat;
uint32_t regval; uint32_t regval;
irqstate_t flags;
struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev; struct imxrt_uart_s *priv = (struct imxrt_uart_s *)dev;
flags = spin_lock_irqsave(&priv->lock); flags = spin_lock_irqsave(&priv->lock);

View file

@ -1,11 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/kinetis/kinetis_cfmconfig.c * arch/arm/src/kinetis/kinetis_cfmconfig.c
* *
* https://github.com/jodersky/nuttx/tree/teensy31-7.6 * SPDX-License-Identifier: MIT
* * SPDX-FileCopyrightText: 2012-2013 Andrew Payne
* Barely based on "bare metal" sample from Freedom board:
* Copyright (c) 2012-2013 Andrew Payne
*
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),

View file

@ -190,7 +190,6 @@ static int kinetis_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void kinetis_prioritize_syscall(int priority) static inline void kinetis_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -202,7 +201,6 @@ static inline void kinetis_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: kinetis_irqinfo * Name: kinetis_irqinfo
@ -361,9 +359,7 @@ void up_irqinitialize(void)
/* Set the priority of the SVCall interrupt */ /* Set the priority of the SVCall interrupt */
#ifdef CONFIG_ARMV7M_USEBASEPRI
kinetis_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); kinetis_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -1,6 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/kl/kl_cfmconfig.c * arch/arm/src/kl/kl_cfmconfig.c
* Copyright (c) 2012-2013 Andrew Payne *
* SPDX-License-Identifier: MIT
* SPDX-FileCopyrightText: 2012-2013 Andrew Payne
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),

View file

@ -106,7 +106,7 @@ struct lc823450_dmach_s
struct lc823450_dma_s struct lc823450_dma_s
{ {
mutex_t lock; /* For exclusive access to the DMA channel list */ spinlock_t lock; /* For exclusive access to the DMA channel list */
/* This is the state of each DMA channel */ /* This is the state of each DMA channel */
@ -123,7 +123,7 @@ static int phydmastart(struct lc823450_phydmach_s *pdmach);
static struct lc823450_dma_s g_dma = static struct lc823450_dma_s g_dma =
{ {
.lock = NXMUTEX_INITIALIZER, .lock = SP_UNLOCKED,
}; };
volatile uint8_t g_dma_inprogress; volatile uint8_t g_dma_inprogress;
@ -144,7 +144,7 @@ static int dma_interrupt_core(void *context)
pdmach = (struct lc823450_phydmach_s *)context; pdmach = (struct lc823450_phydmach_s *)context;
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_dma.lock);
q_ent = pdmach->req_q.tail; q_ent = pdmach->req_q.tail;
DEBUGASSERT(q_ent != NULL); DEBUGASSERT(q_ent != NULL);
dmach = (struct lc823450_dmach_s *)q_ent; dmach = (struct lc823450_dmach_s *)q_ent;
@ -154,18 +154,20 @@ static int dma_interrupt_core(void *context)
/* finish one transfer */ /* finish one transfer */
sq_remlast(&pdmach->req_q); sq_remlast(&pdmach->req_q);
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_dma.lock, flags);
if (dmach->callback) if (dmach->callback)
dmach->callback((DMA_HANDLE)dmach, dmach->arg, 0); dmach->callback((DMA_HANDLE)dmach, dmach->arg, 0);
} }
else else
{ {
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_dma.lock, flags);
} }
up_disable_clk(LC823450_CLOCK_DMA); up_disable_clk(LC823450_CLOCK_DMA);
flags = spin_lock_irqsave(&g_dma.lock);
phydmastart(pdmach); phydmastart(pdmach);
spin_unlock_irqrestore(&g_dma.lock, flags);
return OK; return OK;
} }
@ -212,20 +214,16 @@ static int dma_interrupt(int irq, void *context, void *arg)
static int phydmastart(struct lc823450_phydmach_s *pdmach) static int phydmastart(struct lc823450_phydmach_s *pdmach)
{ {
irqstate_t flags;
int trnum; int trnum;
struct lc823450_dmach_s *dmach; struct lc823450_dmach_s *dmach;
sq_entry_t *q_ent; sq_entry_t *q_ent;
flags = spin_lock_irqsave(NULL);
q_ent = pdmach->req_q.tail; q_ent = pdmach->req_q.tail;
if (!q_ent) if (!q_ent)
{ {
pdmach->inprogress = 0; pdmach->inprogress = 0;
spin_unlock_irqrestore(NULL, flags);
return 0; return 0;
} }
@ -288,7 +286,6 @@ static int phydmastart(struct lc823450_phydmach_s *pdmach)
modifyreg32(DMACCFG(dmach->chn), 0, DMACCFG_ITC | DMACCFG_E); modifyreg32(DMACCFG(dmach->chn), 0, DMACCFG_ITC | DMACCFG_E);
spin_unlock_irqrestore(NULL, flags);
return 0; return 0;
} }
@ -613,7 +610,7 @@ int lc823450_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg)
/* select physical channel */ /* select physical channel */
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_dma.lock);
sq_addfirst(&dmach->q_ent, &g_dma.phydmach[dmach->chn].req_q); sq_addfirst(&dmach->q_ent, &g_dma.phydmach[dmach->chn].req_q);
@ -627,7 +624,7 @@ int lc823450_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg)
phydmastart(&g_dma.phydmach[dmach->chn]); phydmastart(&g_dma.phydmach[dmach->chn]);
} }
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_dma.lock, flags);
return OK; return OK;
} }
@ -644,7 +641,7 @@ void lc823450_dmastop(DMA_HANDLE handle)
DEBUGASSERT(dmach != NULL); DEBUGASSERT(dmach != NULL);
flags = spin_lock_irqsave(NULL); flags = spin_lock_irqsave(&g_dma.lock);
modifyreg32(DMACCFG(dmach->chn), DMACCFG_ITC | DMACCFG_E, 0); modifyreg32(DMACCFG(dmach->chn), DMACCFG_ITC | DMACCFG_E, 0);
@ -660,5 +657,5 @@ void lc823450_dmastop(DMA_HANDLE handle)
sq_rem(&dmach->q_ent, &pdmach->req_q); sq_rem(&dmach->q_ent, &pdmach->req_q);
} }
spin_unlock_irqrestore(NULL, flags); spin_unlock_irqrestore(&g_dma.lock, flags);
} }

View file

@ -216,7 +216,6 @@ static int lc823450_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void lc823450_prioritize_syscall(int priority) static inline void lc823450_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -228,7 +227,6 @@ static inline void lc823450_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: lc823450_extint_clr * Name: lc823450_extint_clr
@ -488,9 +486,8 @@ void up_irqinitialize(void)
#ifdef CONFIG_ARCH_IRQPRIO #ifdef CONFIG_ARCH_IRQPRIO
/* up_prioritize_irq(LC823450_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(LC823450_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
lc823450_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); lc823450_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

View file

@ -28,6 +28,7 @@
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/spinlock.h>
#include <nuttx/timers/rtc.h> #include <nuttx/timers/rtc.h>
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
@ -136,6 +137,7 @@ static void rtc_pmnotify(struct pm_callback_s *cb, enum pm_state_e pmstate);
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
static alarmcb_t g_alarmcb; static alarmcb_t g_alarmcb;
static spinlock_t g_alarmcb_lock = SP_UNLOCKED;
#endif #endif
#ifdef CONFIG_RTC_SAVE_DEFAULT #ifdef CONFIG_RTC_SAVE_DEFAULT
@ -581,6 +583,7 @@ int up_rtc_settime(const struct timespec *ts)
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
int up_rtc_setalarm(const struct timespec *ts, alarmcb_t callback) int up_rtc_setalarm(const struct timespec *ts, alarmcb_t callback)
{ {
irqstate_t flags;
struct tm *tp; struct tm *tp;
if (g_alarmcb) if (g_alarmcb)
@ -589,9 +592,12 @@ int up_rtc_setalarm(const struct timespec *ts, alarmcb_t callback)
} }
tp = gmtime(&ts->tv_sec); tp = gmtime(&ts->tv_sec);
#ifdef CONFIG_RTC_DIV #ifdef CONFIG_RTC_DIV
tm_divider(tp, CONFIG_RTC_DIV_M, CONFIG_RTC_DIV_N); tm_divider(tp, CONFIG_RTC_DIV_M, CONFIG_RTC_DIV_N);
#endif /* CONFIG_RTC_DIV */ #endif /* CONFIG_RTC_DIV */
flags = spin_lock_irqsave(&g_alarmcb_lock);
g_alarmcb = callback; g_alarmcb = callback;
#if 0 #if 0
llinfo("SETALARM (%04d/%02d/%02d %02d:%02d:%02d)\n", llinfo("SETALARM (%04d/%02d/%02d %02d:%02d:%02d)\n",
@ -623,6 +629,8 @@ int up_rtc_setalarm(const struct timespec *ts, alarmcb_t callback)
modifyreg8(RTC_RTCINT, 1 << RTC_RTCINT_SET, 1 << RTC_RTCINT_AIE); modifyreg8(RTC_RTCINT, 1 << RTC_RTCINT_SET, 1 << RTC_RTCINT_AIE);
spin_unlock_irqrestore(&g_alarmcb_lock, flags);
return OK; return OK;
} }
@ -633,14 +641,14 @@ int up_rtc_setalarm(const struct timespec *ts, alarmcb_t callback)
int up_rtc_cancelalarm(void) int up_rtc_cancelalarm(void)
{ {
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = spin_lock_irqsave(&g_alarmcb_lock);
g_alarmcb = NULL; g_alarmcb = NULL;
/* Disable IRQ */ /* Disable IRQ */
putreg8(0, RTC_RTCINT); putreg8(0, RTC_RTCINT);
leave_critical_section(flags); spin_unlock_irqrestore(&g_alarmcb_lock, flags);
return 0; return 0;
} }

View file

@ -1,7 +1,8 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/lc823450/lc823450_symbols.ld * arch/arm/src/lc823450/lc823450_symbols.ld
* *
* Copyright (C) 2014-2015 ON Semiconductor. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause
* SPDX-FileCopyrightText: 2014-2015 ON Semiconductor. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions

View file

@ -165,7 +165,6 @@ static int lpc17_40_reserved(int irq, void *context, void *arg)
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARMV7M_USEBASEPRI
static inline void lpc17_40_prioritize_syscall(int priority) static inline void lpc17_40_prioritize_syscall(int priority)
{ {
uint32_t regval; uint32_t regval;
@ -177,7 +176,6 @@ static inline void lpc17_40_prioritize_syscall(int priority)
regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT); regval |= (priority << NVIC_SYSH_PRIORITY_PR11_SHIFT);
putreg32(regval, NVIC_SYSH8_11_PRIORITY); putreg32(regval, NVIC_SYSH8_11_PRIORITY);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: lpc17_40_irqinfo * Name: lpc17_40_irqinfo
@ -333,9 +331,8 @@ void up_irqinitialize(void)
#ifdef CONFIG_ARCH_IRQPRIO #ifdef CONFIG_ARCH_IRQPRIO
/* up_prioritize_irq(LPC17_40_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */ /* up_prioritize_irq(LPC17_40_IRQ_PENDSV, NVIC_SYSH_PRIORITY_MIN); */
#endif #endif
#ifdef CONFIG_ARMV7M_USEBASEPRI
lpc17_40_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY); lpc17_40_prioritize_syscall(NVIC_SYSH_SVCALL_PRIORITY);
#endif
/* If the MPU is enabled, then attach and enable the Memory Management /* If the MPU is enabled, then attach and enable the Memory Management
* Fault handler. * Fault handler.

Some files were not shown because too many files have changed in this diff Show more