You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/07/30 02:26:37 UTC

[incubator-nuttx] branch pci updated (49c2769 -> bf7ed8f)

This is an automated email from the ASF dual-hosted git repository.

btashton pushed a change to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    omit 49c2769  pcie: create MSI/MSIX related marcos and simplify the msi/msix routines
    omit 870dbea  pcie: cosmetic changes to fit check tools
    omit 8cd64f6  pcie: make pcie enumerate routine as common instead of architecture dependent
    omit 370d0fe  pcie: qemu: return -EINVAL if buffer argument is NULL
    omit 228acef  pcie: qemu: remove not used header
    omit a0e4d9e  pcie: checking bar > 4 for 64bit bars are sufficient
    omit 68f2bf5  pcie: enable don't take flags, hardcoded enabling flags
    omit 669be1f  pcie: types array should be null terminated
    omit d714782  virt: add qemu pci-testdev driver
    omit 5516251  x86_64: qemu: implement pci-e functions and enumerate pci-e devices on boot
    omit a9f98b8  pcie: add framework
     add 48dffbb  boards: spresense: Add nxrecorder to wifi/defconfig
     add 72ff383  boards/arm/stm32/stm3210e-eval/include/board.h: Fix buttons bits when CONFIG_DJOYSTICK is enabled.
     add fe7dfec  include/nuttx/input/djoystick.h: Fix some trivial typos and nxstyle issues.
     add c3ba603  boards/arm/stm32/olimex-stm32-p407: Add joystick support.
     add 6c68c2b  boards/arm/stm32/stm3210e-eval/include/board.h: Fix nxstyle issues.
     add 0acf6da  drivers/analog/ and include/nuttx/analog: Fix typos and nxstyle issues.
     add ebfc12d  drivers/: Fix some drivers mode priviliges.  It's not used but it's better to get it right.
     add 02ad0e9  drivers/leds/ncp5623c&pca9635pw: Fix nxstyle issues.
     add 8fdfb74  drivers: video: fix uninitialized variables
     add c6c0214  boards: arm: cxd56: initilize the video stream driver from the board
     add 5785340  sched/group: Change group_kill_children's argument from task_tcb_s to tcb_s
     add 07c0faf  Add support to CDC-MBIM USB host driver
     add e1be7ac  Fix netdev and add Apache license to the file
     add 6ff18a7  Rename NETDEV_WBIM_FORMAT with NETDEV_WWAM_FORMAT
     add 7609b67  Fix issues reported on PR #1233
     add 3a95c41  Fix devif_timer() function call
     add 089a633  Fix wrong space instead of TAB
     add 309dda3  sched: pthread_cleanup_[push|pop] should be callable from main thread
     add fd5fc2a  sched: Check the mutex consistent in main thread too
     add f70981c  sched: Make task_delete(getpid()) equal exit(EXIT_SUCCESS)
     add 6982eb3  sched: Remove SCHED_EXIT_KILL_CHILDREN option
     add 332e548  arch/stackframe: fix heap buffer overflow
     add 9153ca5  arch/renesas: fix nxstyle warning
     add 5fbf527  libc/locale: Add the mininal support for locale_t operation
     add f1814df  Move mallinfo from stdlib.h to malloc.h
     add a607e62  Include malloc.h instead of stdlib.h for mallinfo()
     add 55d9e5f  net: Add SocketCAN support
     add ff76ef0  s32k1xx: Added FlexCAN driver with SocketCAN support
     add 5f73dc8  Kinetis: Added FlexCAN driver with SocketCAN support
     add b5c5948  NXStyle fixes
     add ff01610  cstdlib:  mallinfo is no longer in stdlib.h
     add 875828b  Add a missing stdlib.h -> malloc.h change for mallinfo
     add 5e6d994  net/socket/getsockopt.c:  Eliminate warning
     add 155903f  net/can/can.h: Add can_setsockopt and can_getsockopt prototypes.
     add c8d83e0  net/can/can_setsockopt&can_getsockopt.c: Initialiaze ret variable to eliminate any warning.
     add 4a72bcc  boards/arm/s32k1xx/rddrone-uavcan146/configs/nsh/defconfig: Refresh the config.
     add 2160a65  sched: Don't call nxnotify_cancellation in task_setcancelstate
     add 4d634b9  sched: Consolidate the cancellation notification logic
     add fdb7e6e  net/igmp: Fix the compiler warning on 64bit platform
     add 3f1e89e  stm32l4 serial fix: clock divider for baud rate was not correctly set
     add 9786e3a  style fixes
     add 2bdc0c5  stm32l4 ADC: on 47x/48x parts, the ACSR register needs to be configured for ADC inputs to work
     add 7ce175b  style fixes
     add 6c333d7  bmp280: support getting temperature via ioctl()
     add 53387b5  style fixes
     add 8c74a31  vfs: fix support for PTY when CONFIG_NET is not enabled
     add ae92afd  drivers: audio: Fix cxd56_stop in cxd56.c
     add 66052f7  mkstemp: Only look at the trailing Xs
     add dde25b0  tools/nxstyle: Fix AddressSanitizer error
     add df2bc1e  Add syscall and irqhandler hooks in sched_note.h
     add ed9532e  CONFIG_SCHED_INSTRUMENTATION_SYSCALL should not available if the architecture does not support the required system hook note hooks.
     add 4fd506e  include/nuttx/sched_note.h: nxstyle fixes.
     add 4eecf85  FlexCAN interrupt fixes, old compiler fixes SocketCAN old compiler fix
     add efbe4c8  S32K1XX Enhanced EEPROM block device driver
     add 662bd5e  Added S32K1XX EEEPROM init code
     add ede6225  NXStyle fixes
     add 6a19f03  FlexCAN C89 Style initialization
     add 69e97c1  sched/sched/sched_note.c:  Implement interrupt/syscall support
     add 56fa98f  sched: Avoid call up_initial_state for idle thread twice
     add ec0212c  drivers/syslog/note_driver.c: nxstyle fix
     add 8013f66  boards/arm/imxrt/imxrt1060-evk: Remove deprecated lvgl configs
     add fa97e21  stm32l4: clocking fixes (would hang for MSI@48MHz on STM32L476)
     add b7d1858  stm32l4: add I2C timings for 48 MHz SYSCLK
     add 67ab8eb  style fixes
     add ebeeb0d  sched/pthread/pthread_cleanup.c:  Exclude kernel threads.
     add ba5fe5c  SocketCAN: Fixed dropping timestamped frames when running in CAN2.0B
     add c91a811  cstdlib:Add missing atox to std namespace
     add 3ec12a8  Makefile.unix:versioning insure it is a .git dir
     add 1ab98da  nuttx-names.dat: add strstr.
     add d96b22a  nuttx/names: add getchar into naming list
     add 1a59e5a  sim/names: add munmap into naming list
     add 6e8cf28  nuttx/names: add symbol name preprocessing support
     add b64060f  s32k1xx:flexcan clock_systimespec -> clock_systime_timespec
     add a13ebe5  arch/arm/stm32: Make SysTick as a Tickless clock source option
     add c02f0d4  baords/arm/stm32/olimex-smt32-p407: Add SPI configuration and set up the SPI3 pins present in the UEXT header. These PINS are used to test an external ST7735 LCD.
     add a09f88c  include/nuttx/video/fb.h: Several parentheses were missing in macros.
     add bd82486  drivers/lcd: Add support for the ST7735 TFT controller.
     add 530cad3  drivers/spi/spi_bitbang.c: Fix typos and nxstyle complaints.
     add 5cbebda  kinetis:Ethernet fixed & better interrupt management
     add 72a06a6  Docs and README: Add STM32G474, B-G474E-DPOW1 board
     add e538198  Update ReleaseNotes in preparation for the 9.1 release.
     add 062373a  tools/zipme.sh: Fix the typo error
     add 9bf4b55  tools/zipme.sh: Don't move the directory to nuttx/Documentation
     add 8b98768  tools/zipme.sh: Add executable bit
     add f3c0461  tools/version.sh: Make it invokable from everywhere
     add f24c71b  include/ftw.h:  Add header file
     add 1e166f7  sysconf: Implement _SC_ATEXIT_MAX query
     add d24bd78  libc: Implement pathconf and fpathconf
     add ef5d204  rewind: clear the error indicator
     add f56e0e0  fs/setfd: correct the return value
     add d6a0da4  net/vfcntl: fix nxstyle warning
     add f5039d0  sim: fix compile error caused by race condition
     add b06722c  boards/arm/stm32/stm32f769i-disco: Add support for external SDRAM
     add cf86459  boards/arm/stm32/stm32f769i-disco: Include missing header
     add 105d561  arch/arm/src/stm32f7: Refactor FMC functions for STM32F7
     add 807c1df  boards/arm/stm32f7/stm32f769i-disco: Apply NxStyle fixes
     add 701100f  drivers/sensors/mpu60x0: Add I2C support.
     add edd3dd3  libs: rv64: Fix _calc_imm() in arch_elf.c
     add 3c37d68  stm32l4 oneshot: assert period > 0, otherwise the timer never fires
     add 10a9464  tone: start playing tune immediately without delay
     add 1115f01  stm32l4 oneshot: style fix
     add b332741  tone: stop tone using 0 duty, not stop()
     add 74d13d7  sim: Add more names to nuttx-names.in
     add 05671fd  vpnkit: set mac address when available
     add 6661f56  waitpid: implement WNOHANG for CONFIG_SCHED_HAVE_PARENT=y
     add 91611de  waitid: implement WNOHANG
     add a7fdc4b  arch/arm/src/stm32/stm32f40xxx_i2c.c: Fix tracing enumeration. Values used in the ISR were taken from STM32F7 but the enumeration was not updated.
     add b83b83b  pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support
     add b4bea95  stm32l4: add support for booting into DFU mode
     add d1c538b  stm32l4: dfumode style fixes
     add c26521c  stm32l4 dfumode: move initialization point of bootloader jump instruction to correct place
     add 977f04a  libc: sysconf support _SC_NPROCESSORS_CONF/_SC_NPROCESSORS_ONLN
     add 98f0b0a  build/export: correct the export path
     add e82a9e0  make/export: copy mkdeps.c for export build
     add 41f4340  make/export: do not extract object from librarys
     add fd3be9e  make/export: support export extra library
     add 861f80e  stm32l4 RCC: configure flash wait states early, otherwise execution is corrupted when clock is increased before that
     add b2f3a4b  tools/nxstyle: Support the white list
     add 095e492  libc: Replace nuttx/lib/math.h with math.h
     add 676a2b7  stdio.h: Implement fseeko and ftello function
     add f6039bb  stm32f7: add CANIOC_SET_NART and CANIOC_SET_ABOM ioctl's to can driver
     add 7a346be  stm32f7: Add the option to include RTR in CAN header
     add 94e87bb  stm32: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
     add 10f93b9  stm32l4: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
     add 771f532  cxx: Remove CONFIG_NET guard from [get|set]hostname
     add 5de436b  tools: cxd56: mkspk: fix out of tree MAC build
     add 294fdd8  tools: cxd56: nxstyle fixes
     add d17b963  libc: Move double_t typedef from sys/types.h to math.h
     add 23e0134  mksyscall: Fix warning "variable 'i' is used uninitialized"
     add d0dc72c  boards/x86_64/intel64: enable CONFIG_LIBM=y
     add 43b6138  libc/stdio: Remove sys/types.h inclusion for printf/scanf
     add b71c491  libc/math: Fix warning: dereferencing type-punned pointer will break strict-aliasing rules
     add b12b307  Added support for STM32F412xx. Tested with the NUCLEO-F412ZG dev board as well as a custom board using the STM32F412CE.
     add b296adc  socket/SOL: sync the SOL index with linux
     add fcd6e1c  mm: Do not memcopy more than oldsize when realloc
     add e87617f  nxstyle: fixup style issues in mm_realloc.c
     add d8376ef  nxsched_release_tcb: Should release stack in kernel build too
     add 708f68a  stm32/nucleo-f412zg: update nucleo-f412zg files to fix nightly build break
     add ac1641d  stm32/nucleo-f412zg: refresh nsh defconfig
     add 62b777b  sched/task: unify task initialization
     add 2fc02ec  sched/task_init: change the stack pointer type to (void *)
     add b9ad4a0  binfmt/exec: allocate stack from internal
     add a81a260  vfs: Add chmod/fchmod/utimes function prototype
     add b896da2  make/export: copy incdir.c for export build
     add 36a0978  arch/risc-v/src/rv32im: update & complete risc-v rv32im arch
     add 0fe2884  libs/libc/machine/risc-v: add rv32 support
     add b8e5755  make/version: correct the version generation
     add 86c151e  S32K Small Fixes: - Typos / wrong names in s32k14x_irq.h, s32k1xx_memorymap.h and s32k1xx_pcc.h - Wrong base address for port input disable register in s32k1xx_pin.c - up_* still had to be changed to arm_* in some places
     add 1306cbc  S32K additional style fixes
     add 14ecb87  sched: Change tcb_s to task_tcb_s for nxtask_[un]init
     add eca1011  Expose xxx_caninitialize() correctly so it's usable in latedev init when there are multiple net devices
     add 4a40a7c  S32K148EVB netdev lateinit to support Enet & CAN at the same time
     add b938348  S32K1XX EEEPROM indentation fix
     add b598ab4  fs: Implement lstat function
     add 0b891d6  vfs: Define symlink as link
     add a102922  libc: Implement realpath
     add e7f2dc8  net/sockopt: change the socket option style from Linux to BSD
     add b8b2ac4  sim: Sync Linux CMODULEFLAGS with macOS
     add 028d0c0  sim: Disable stack protector for CMODULEFLAGS
     add 651eefc  fs: Rename link to symlink
     add 3db090a  S32K - Expand FlexTimer header file and add PWM support
     add b84ce84  S32K additional style fixes
     add e9c7df4  sched: Rename task_startup to nxtask_startup
     add 8153e31  sched: Call c++ global variables constructor inside nxtask_startup
     add 49020ac  boards: Remove the unused CONFIG_xxx_CXXINITIALIZE=y
     add 310b572  board/olimex-stm32-p407: Remove CONFIG_SYSTEM_NSH_CXXINITIALIZE
     add 3fbdc21  syscall/prctl: fix PR_SET_NAME failure if without <pid> arg
     add d938e2c  CI check: fix nxstyle warning
     add 628a352  make/export: use LDNAME instead of LDSCRIPT
     add 30d2b6c  make/export: export post build script
     add 9d78561  make/POSTBUILD: make BIN directory configurable
     add b984534  lib/math: Remove float32 and float64 definition
     add deb3b13  Udate TODO List
     add 993591d  arch/x86_64: Fix Warning: ignoring changed section attributes
     add 60fe0a0  libc: Refine the inline handling
     add 749e871  sim: Fix 32-bit module build
     add 9761235  libs/libc/semaphore/sem_getvalue: correct get_value descriptions
     add 95aa3a1  arch/tms570: Remove the unused frac variable
     add 2481b1b  Do not ignore .asm files that are tracked.
     add 247bc10  drivers/can: fix wrong use of nxsem_getvalue
     add 908ee31  drivers/can: enter_critical_section in can_poll
     add 1798383  drivers/can: correct checking sem is locked
     add 3472de3  Revert "sched/sched/sched_releasetcb.c:  Handle custom stack allocations."
     add 407c5db  check-release-candidate.sh script
     add 5fb9356  changing script name to match checkpatch.sh
     add ef3ba54  cleanup unneeded cd and rm commands
     add dbc025b  add examples to usage info
     add 1076b74  changed header comment filename to match current
     add b994d1f  fixing problem with trap not removing tempdir
     add 0f235bc  board/sim: Don't ignore any files under src/etc/ folder
     add 1a523e5  tools/zipme.sh: Remove the option to exclude patterns based on the VCS' "ignore" file.
     add 91ed14c  vfs/stat: Make the flag defintion more confirm POSIX standard
     add 67ef70d  vfs/dirread: Should return the same file type as lstat
     add a349595  gpio: extend gpio_pintype_e for pulldown/up and opendrain
     add 1bca457  libc: Always declare getenv, link/symlink and atexit/on_exit
     add 5d0b93a  boards: arm: cxd56xx: enable basic snapshot camera example
     add a62b453  spresense:example_camera: Remove CONFIG_SYSTEM_NSH_CXXINITIALIZE
     add 6b316ed  sim: add __cxa_atexit into the name list
     add 5da9cb3  libxx: Eanble HAVE_CXXINITIALIZE automatically if LIBCXX or UCLIBCXX enable
     add 05f6445  arch: Move *_getsp to the common place arch/arch.h
     add db02cea  arch/x86_64: Change up_getrsp to x64_getsp
     add 60b7b8b  arch/x86: change up_getsp to x86_getsp
     add 4176a38  arch/sim: implement sim_getsp
     add 924ba84  arch: call *_getsp in up_assert and board_crashdump
     add 3cbf6d5  Fix LCD pins to work correctly
     add 81d814b  include/nuttx/arch.h: Trivial typo fixes.
     add c3e256e  libxx: Make __dso_handle weak
     add 731594b  drivers/eeprom/spi_xx25xx: Fixes build error.
     add 9dff16e  fix nxstyle warning
     add fbfd9d6  libelf: Parse .ARM.exidx only for ARM architecture
     add aa0d57e  libc: Move unwind code to libs/libc/machine/arm
     add cfc58d1  nxstyle: Add some unwind name to the white list
     add 159053a  sim/c++: correct the compile flags
     add f36bf5e  arch/sim: Avoid build nuttx.rel and cleanrel concurrently
     add 19aaf7b  arch/sim: Move the generation of nuttx-names.dat into nuttx target
     add dc55968  arch/sim: Don't construct global C++ objects before main
     add 06a5b1f  drivers/can: fix tx_sem and rx_sem to be SEM_PRIO_NONE
     add b6ed339  drivers/can: base readers checks on cd_readers list itself
     add 53c84c7  Fix note type id for syscall enter/leave
     add 1f7e91d  Move note_register() declaration into the separate header
     add f392d24  Fix note driver initialization
     add 9db5d2a  Fix nxstyle warnings
     add 6abd03d  libxx: Unify uClibc++ and libc++ config
     add d32e9c3  boards: Move the C/C++ search path to the common place
     add 6f6d61e  fs/vfs: Implement statvfs and fstatvfs
     add bc95500  Add buttons support to iMXRT1060
     add df72e45  boards: stm32f4discovery: Update configs/elf
     add d214cff  boards: stm32f4discovery: Update configs/posix_spawn
     add aef6f4a  Add initial support for the QuickLogic EOS S3
     add 11a8c3e  checkrelease.sh now tries to build sim:nsh
     add ee875b2  boards: Move HOSTCC/HOSTCFLAGS to tools/Config.mk
     add 22b8834  boards: hifive1-revb: Increase UART0 RXBUFSIZE from 8 to 16
     add c4be707  boards: stm32f4discovery: Add ELF support to wifi/defconfig
     add 67589ad  sethost.sh: always print logs to ease identify problem in configure phase
     add fc2e785  testbuild.sh: suppress logs from configure stage in testbuild.sh
     add f5311de  boards: Remove the unused ARCHCCVERSION and ARCHCCMAJOR
     add 4910d43  build: Move the toolchain library setting to the common place
     add 954ee9d  Fixed AVR build issues
     add 65a866f  support for SAMA5D27 SDMMC peripheral
     add f5540e8  drivers: wireless: Fix compile error with DEBUG_WIRELESS_INFO in gs2200m.c
     add 8581195  implement system reset on SAMA5D27
     add 34bcf39  tools/configure.c: Don't redirect the output of make.
     add ac7e5de  libxx: Integrate uClibc++ latest official release
     add e5be32a  arch/stm32f7: Fixes bug in tickless driver where the compare register is set to a value less than the current time.
     add f91372c  stm32_tickless.c: Fix formatting issues.
     add 17bd5f3  tools/checkrelease.sh: auto import KEYS from the release server
     add 7db6199  arch/arm/src/nrf52: add a low-level TIMER interface
     add f6235c5  boards/arm/nrf52/nrf52840-dk: add highpri example configuration
     add 774ea6e  arch/arm/src/nrf52: add a low-level RTC interface
     add d6827ca  arch: up_assert shouldn't call exit directly
     add f66ead9  Update the boards matrix to add AVR builds.
     add 470624f  Use AVR Linux toolchain instead of buildroot
     add 871613f  libc: Typecast to avoid overflow in inet_addr for AVR
     add ff6e2e7  AVR: Fix warnings from pointer casts and prototype
     add 3a58926  Cast pointer to uintptr prior to ulong for ioctl
     add fe0b5df  boardctl: Remove warning pragma on BOARDIOC_USBDEV_CONNECT
     add 8319078  AVR: Remove warning pragma from SPI freq function
     add f27fbe8  REMOVE ME: Force build of AVR in test
     add 1a90a93  Revert "REMOVE ME: Force build of AVR in test"
     add 4f22f74  syscall: Remove g_funclookup and g_funcnparms
     add e7034c1  rwbuffer: Fix the wrong remaining block calculation in invalidation
     add aa57174  rwbuffer: Optimize the buffer algorithm
     add 79a3fd1  ESP32: Add driver support to SPI Master and Slave
     add 47f2090  arch: Change --print-file-name=libgcc.a to --print-libgcc-file-name
     add 0475540  drivers: wireless: Add 'select SCHED_LPWORK' to WL_GS2200M
     add 4cf3075  boards: spresense: Remove CONFIG_SCHED_LPWORK=y from wifi/defconfig
     add 11f8b7c  boards: stm32f4discovery: Remove CONFIG_SCHED_LPWORK=y from wifi/defconfig
     add e1ecb3e  libc: Don't define localtime[_r] to macro when CONFIG_LIBC_LOCALTIME not define
     add 7c54f51  Fix nxstyle warning
     add da3e6cb  board: Let avr/renesas utilize boards/Board.mk
     add 822061a  net: Fix dupulicated NET_USRSOCK in Kconfig
     add 97be116  fs/nxffs: Fix scan good block slowly and scan an invalid block
     add b329e23  boards: Move toolchain related variables to Toolchain.defs
     add 5ce8469  tools/mksyscall: Fix warning: '__builtin_strncpy' specified bound 256 equals destination size
     add 4152193  arch/arm/src/nrf52: add support for TIMER lowerhalf
     add 8fe3a46  boards/arm/nrf52/nrf52840-dk: add timer example
     add ba44a81  fix nxstyle warnings
     add ba274b9  Fix small formatting issues caused by VIM macro edition
     add 5efa93e  arch/Toolchain.defs: Change all ARCROSSDEV to CROSSDEV
     add 2b7528f  binfmt: Fix warning: unused variable ‘exidx’
     add 6c03a4e  libc: Add uuid implemenation
     add 1a901d7  board/arm: Remove -march and -mcpu option
     add b4b413e  arch/arm/src/arm/Toolchain.defs: Append "-P -x c" for CPP macro
     add 172aaa5  .gitignore: Don't ignore directories that have the .d extenion. .d directories are common for holding config and init scripts. They are being ignored with the global *.d pattern which is meant to ignore Make dependency files.
     add 89a79b0  fs/smartfs: Fix file size corruption when opening with overwriting mode
     add 5ee0432  net/socket: Fix sanity checking of socket interface
     add 76c87d2  net/socket: Fix nxstyle issue
     add fd220e7  arch/arm/src/stm32f7/stm32_dma.c: fix debug ifdef
     add e4b50c4  drivers/mmcsd: Fix minor bugs
     add 2b4d2cd  Fix note structure members types
     add 3767862  Create wrapper library for system call instrumentation
     add 02718f0  Syscall instrumentation build system support for Arm and RISC-V
     add ac34ac9  Add g_funcnames declaration in syscall.h
     add 9f8d528  tools/incdir: Assume GCC compatibility for unknown compilers
     add 131535d  drivers/lcd: Fix the memory leak when board_graphics_setup fail
     add 6be8dd4  tools/incdir: Fix the memory leak
     add da6bb94  drivers/lcd: Don't select NX_LCDDRIVER automatically
     add f044c82  drivers/lcd: Remove the redundant LCD_HWCURSOR
     add a5ef373  drivers/video: fb_read/fb_write need consider the current file position
     add 8792ade  Several USB improvements. Kinetis: Reworked USB driver for setup out data phase. Freedom K28: New config nshsdusb, with RNDIS support PL2303: Try to avoid clone detection. General: various nxstyle fixes General: license changed
     add cc00d2b  arch/sim: Call sched_note_cpu_* when SCHED_INSTRUMENTATION equal true
     add 9079d48  arch: imxrt: Fix auto negotiation for KSZ8081 PHY
     add a58193a  arch: imxrt: Fix style violations in imxrt_enet.c
     add f2446ec  arch/sim: unify the prefix(g_cpu_) for SMP related variables
     add 71a9d24  arch/sim: Replace sigprocmask with pthread_sigmask in main thread
     add 53f33a7  arch/sim: Synchronize the creation of idle thread by semaphore
     add 78862c5  arch/sim: Fix the wrong sleep time calculation in sim_idle_trampoline
     add 33ec242  Implement proposed POSIX _clockwait variants of existing _timedwait functions
     add 996e93d  sched: Replace license header with Apache License 2.0
     add b6218c6  drivers: audio: Replace license header with Apache License 2.0
     add 41e6ce2  include: audio: Replace license header with Apache License 2.0
     add 524f18c  libs: termios: Replace license header with Apache License 2.0
     add 500ead8  drivers/modem/altair: Update altair modem driver
     add d560ce6  cxd56xx: spresense: Add some improvements and fix bugs for Spresense board
     add e249a2f  Makefile: Fix Make.dep not updated by config changes
     add 27835c8  ramlog: Add overwrite option to ramlog
     add 904ec76  arch: lc823450: Fix nxstyle violations
     add cb1d11a  ESP32: Add driver support to I2C
     add 7a32a39  arch/sim: Move share memory allocation to up_hostmemory.c
     add 8a7ecf0  drivers: wireless: Fix null pointer dereference in gs2200m.c
     add a32506b  boards: s32k1xx: Remove SPITOOL_PROGNAME
     add 28eed28  sched: The secondary idle threads should call nx_idle_trampoline
     add d2f7546  net/usrsock: Add flags to sendto/recvfrom in usrsock
     add 1cb1fb4  libc: Replace all malloc/free to lib_malloc/lib_free
     add 5e95adf  rename README.txt to README.md
     add 0a6c81b  main README converted to Markdown format
     add 3cff139  libc: Make gethostname as syscall instead of uname
     add 338244d  procfs: Get version info from uname instead
     new 45c16a6  pcie: add framework
     new f8ba0cc  x86_64: qemu: implement pci-e functions and enumerate pci-e devices on boot
     new 21b508a  virt: add qemu pci-testdev driver
     new 45beb44  pcie: types array should be null terminated
     new a25ff31  pcie: enable don't take flags, hardcoded enabling flags
     new a2ea998  pcie: checking bar > 4 for 64bit bars are sufficient
     new 760282e  pcie: qemu: remove not used header
     new 6f14ffe  pcie: qemu: return -EINVAL if buffer argument is NULL
     new ddd4ba3  pcie: make pcie enumerate routine as common instead of architecture dependent
     new b2d0bf8  pcie: cosmetic changes to fit check tools
     new bf7ed8f  pcie: create MSI/MSIX related marcos and simplify the msi/msix routines

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (49c2769)
            \
             N -- N -- N   refs/heads/pci (bf7ed8f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/build.yml                        |    4 +-
 .gitignore                                         |    1 +
 Documentation/NuttShell.html                       |   10 +-
 Documentation/NuttX.html                           |   30 +
 Documentation/NuttxPortingGuide.html               |    2 +-
 Documentation/NuttxUserGuide.html                  |    8 -
 Documentation/README.html                          |    2 +
 README.md                                          | 2512 +++++++++++++
 README.txt                                         | 2537 -------------
 ReleaseNotes                                       |  354 ++
 TODO                                               |   69 +-
 arch/Kconfig                                       |   10 +
 arch/arm/Kconfig                                   |   14 +
 arch/arm/include/arch.h                            |   22 +-
 arch/arm/include/cxd56xx/gnss.h                    |   47 +-
 arch/arm/include/cxd56xx/gnss_type.h               |  455 ++-
 arch/arm/include/eoss3/chip.h                      |   43 +
 arch/arm/include/eoss3/irq.h                       |  141 +
 arch/arm/include/lc823450/chip.h                   |   12 -
 arch/arm/include/lc823450/clk.h                    |   12 +-
 arch/arm/include/lc823450/irq.h                    |   28 +-
 arch/arm/include/s32k1xx/s32k14x_irq.h             |    2 +-
 arch/arm/include/stm32/chip.h                      |   50 +
 arch/arm/include/stm32/stm32f40xxx_irq.h           |    6 +-
 arch/arm/include/tls.h                             |   18 -
 arch/arm/src/Makefile                              |   15 +-
 arch/arm/src/arm/Toolchain.defs                    |   32 +-
 arch/arm/src/arm/arm_assert.c                      |   29 +-
 arch/arm/src/armv6-m/Toolchain.defs                |   31 +-
 arch/arm/src/armv6-m/arm_assert.c                  |   29 +-
 arch/arm/src/armv7-a/Toolchain.defs                |   32 +-
 arch/arm/src/armv7-a/arm_assert.c                  |   29 +-
 arch/arm/src/armv7-m/Toolchain.defs                |   37 +-
 arch/arm/src/armv7-m/arm_assert.c                  |   29 +-
 arch/arm/src/armv7-r/Toolchain.defs                |   32 +-
 arch/arm/src/armv7-r/arm_assert.c                  |   29 +-
 arch/arm/src/armv8-m/Toolchain.defs                |   33 +-
 arch/arm/src/armv8-m/arm_assert.c                  |   29 +-
 arch/arm/src/common/arm_initialize.c               |    5 +-
 arch/arm/src/common/arm_stackframe.c               |    7 +-
 arch/arm/src/cxd56xx/Kconfig                       |  142 +-
 arch/arm/src/cxd56xx/Make.defs                     |    2 +-
 arch/arm/src/cxd56xx/chip.h                        |   16 -
 arch/arm/src/cxd56xx/cxd56_adc.c                   |   43 +
 arch/arm/src/cxd56xx/cxd56_allocateheap.c          |    6 +-
 arch/arm/src/cxd56xx/cxd56_charger.c               |   12 +-
 arch/arm/src/cxd56xx/cxd56_clock.c                 |   19 +-
 arch/arm/src/cxd56xx/cxd56_cpu1signal.c            |   30 +-
 arch/arm/src/cxd56xx/cxd56_cpu1signal.h            |    3 +-
 arch/arm/src/cxd56xx/cxd56_cpustart.c              |    2 +-
 arch/arm/src/cxd56xx/cxd56_dmac.c                  |    4 +-
 arch/arm/src/cxd56xx/cxd56_emmc.c                  |    1 +
 arch/arm/src/cxd56xx/cxd56_farapi.c                |    9 +-
 arch/arm/src/cxd56xx/cxd56_farapistub.S            |  550 +--
 arch/arm/src/cxd56xx/cxd56_farapistub.h            |    2 +-
 arch/arm/src/cxd56xx/cxd56_gauge.c                 |    2 +-
 arch/arm/src/cxd56xx/cxd56_geofence.c              |   26 +-
 arch/arm/src/cxd56xx/cxd56_gnss.c                  |  300 +-
 arch/arm/src/cxd56xx/cxd56_gnss_api.h              |  160 +-
 arch/arm/src/cxd56xx/cxd56_i2c.c                   |   39 +-
 arch/arm/src/cxd56xx/cxd56_icc.c                   |   33 +-
 arch/arm/src/cxd56xx/cxd56_pinconfig.c             |    3 +-
 arch/arm/src/cxd56xx/cxd56_pmic.c                  |  107 +-
 arch/arm/src/cxd56xx/cxd56_pmic.h                  |   16 +
 arch/arm/src/cxd56xx/cxd56_powermgr.c              |   61 +-
 arch/arm/src/cxd56xx/cxd56_pwm.c                   |   82 +-
 arch/arm/src/cxd56xx/cxd56_rtc.c                   |   18 +-
 arch/arm/src/cxd56xx/cxd56_rtc_lowerhalf.c         |   42 +-
 arch/arm/src/cxd56xx/cxd56_scu.c                   |   34 +-
 arch/arm/src/cxd56xx/cxd56_sdhci.c                 | 1775 ++-------
 arch/arm/src/cxd56xx/cxd56_sdhci.h                 |   13 +
 arch/arm/src/cxd56xx/cxd56_serial.c                |  267 +-
 arch/arm/src/cxd56xx/cxd56_sfc.c                   |   25 +-
 arch/arm/src/cxd56xx/cxd56_sph.c                   |    1 +
 arch/arm/src/cxd56xx/cxd56_spi.c                   |    7 +-
 arch/arm/src/cxd56xx/cxd56_start.c                 |   15 +
 arch/arm/src/cxd56xx/cxd56_sysctl.c                |    1 +
 arch/arm/src/cxd56xx/cxd56_timer.c                 |    2 +-
 arch/arm/src/cxd56xx/cxd56_uart0.c                 |   43 +-
 arch/arm/src/cxd56xx/cxd56_usbdev.c                |    1 -
 arch/arm/src/cxd56xx/hardware/cxd5602_backupmem.h  |    4 +-
 .../hardware/cxd5602_isop_hadc0_highspeed.h        |  278 ++
 arch/arm/src/eoss3/Kconfig                         |   16 +
 arch/arm/src/eoss3/Make.defs                       |   70 +
 arch/arm/src/eoss3/chip.h                          |   35 +
 arch/arm/src/eoss3/eoss3.h                         |   41 +
 arch/arm/src/eoss3/eoss3_clockconfig.c             |  130 +
 arch/arm/src/eoss3/eoss3_clockconfig.h             |   64 +
 arch/arm/src/eoss3/eoss3_gpio.c                    |  191 +
 arch/arm/src/eoss3/eoss3_gpio.h                    |  275 ++
 arch/arm/src/eoss3/eoss3_idle.c                    |   73 +
 arch/arm/src/eoss3/eoss3_irq.c                     |  559 +++
 arch/arm/src/eoss3/eoss3_lowputc.c                 |  130 +
 arch/arm/src/eoss3/eoss3_lowputc.h                 |   63 +
 arch/arm/src/eoss3/eoss3_serial.c                  |  636 ++++
 arch/arm/src/eoss3/eoss3_start.c                   |  350 ++
 arch/arm/src/eoss3/eoss3_start.h                   |   62 +
 arch/arm/src/eoss3/eoss3_timerisr.c                |  129 +
 arch/arm/src/eoss3/hardware/eoss3_clock.h          |  173 +
 arch/arm/src/eoss3/hardware/eoss3_intr.h           |  182 +
 arch/arm/src/eoss3/hardware/eoss3_iomux.h          |  321 ++
 arch/arm/src/eoss3/hardware/eoss3_memorymap.h      |   73 +
 arch/arm/src/eoss3/hardware/eoss3_uart.h           |  169 +
 arch/arm/src/imxrt/hardware/imxrt_gpio.h           |    3 +
 arch/arm/src/imxrt/imxrt_enet.c                    |   42 +-
 arch/arm/src/imxrt/imxrt_gpio.h                    |   17 +-
 arch/arm/src/imxrt/imxrt_gpioirq.c                 |   40 +-
 arch/arm/src/kinetis/Kconfig                       |   94 +-
 arch/arm/src/kinetis/Make.defs                     |    7 +
 arch/arm/src/kinetis/hardware/kinetis_flexcan.h    |   79 +-
 .../src/kinetis/hardware/kinetis_k28memorymap.h    |   41 +-
 arch/arm/src/kinetis/hardware/kinetis_usbhs.h      |   27 +-
 arch/arm/src/kinetis/kinetis.h                     |   91 +-
 arch/arm/src/kinetis/kinetis_enet.c                |  110 +-
 arch/arm/src/kinetis/kinetis_flexcan.c             | 1927 ++++++++++
 arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c       |   23 +-
 arch/arm/src/kinetis/kinetis_usbdev.c              | 1583 ++++----
 arch/arm/src/lc823450/chip.h                       |   30 +-
 arch/arm/src/lc823450/lc823450_adc.c               |   20 +-
 arch/arm/src/lc823450/lc823450_adc.h               |   48 +-
 arch/arm/src/lc823450/lc823450_allocateheap2.c     |   13 +-
 arch/arm/src/lc823450/lc823450_clockconfig.c       |   11 +-
 arch/arm/src/lc823450/lc823450_clockconfig.h       |    3 +-
 arch/arm/src/lc823450/lc823450_cpustart.c          |    3 +-
 arch/arm/src/lc823450/lc823450_dma.c               |   15 +-
 arch/arm/src/lc823450/lc823450_dma.h               |    2 +-
 arch/arm/src/lc823450/lc823450_dvfs2.c             |   23 +-
 arch/arm/src/lc823450/lc823450_dvfs2.h             |    2 +-
 arch/arm/src/lc823450/lc823450_gpio.c              |    5 +-
 arch/arm/src/lc823450/lc823450_gpio.h              |    4 +-
 arch/arm/src/lc823450/lc823450_i2c.h               |    5 +-
 arch/arm/src/lc823450/lc823450_lowputc.c           |   26 +-
 arch/arm/src/lc823450/lc823450_lowputc.h           |   15 +-
 arch/arm/src/lc823450/lc823450_mmcl.h              |    2 +-
 arch/arm/src/lc823450/lc823450_mpuinit2.h          |   26 +-
 arch/arm/src/lc823450/lc823450_mtd.h               |    2 +-
 arch/arm/src/lc823450/lc823450_procfs_dvfs.c       |    5 +-
 arch/arm/src/lc823450/lc823450_pwm.h               |    2 +-
 arch/arm/src/lc823450/lc823450_rtc.c               |   26 +-
 arch/arm/src/lc823450/lc823450_sdc.h               |   11 +-
 arch/arm/src/lc823450/lc823450_serial.c            |   83 +-
 arch/arm/src/lc823450/lc823450_serial.h            |   12 +-
 arch/arm/src/lc823450/lc823450_spifi2.c            |    6 +-
 arch/arm/src/lc823450/lc823450_spifi2.h            |    3 +-
 arch/arm/src/lc823450/lc823450_syscontrol.c        |   10 +-
 arch/arm/src/lc823450/lc823450_testset.c           |    1 +
 arch/arm/src/lc823450/lc823450_timer.h             |    2 +-
 arch/arm/src/lc823450/lc823450_usbdev.c            |   13 +-
 arch/arm/src/lc823450/lc823450_userspace.h         |   26 +-
 arch/arm/src/lc823450/lc823450_wdt.c               |   44 +-
 arch/arm/src/lc823450/lc823450_wdt.h               |    2 +-
 .../arm/src/max326xx/common/max326_rtc_lowerhalf.c |   17 +-
 arch/arm/src/nrf52/Kconfig                         |   16 +
 arch/arm/src/nrf52/Make.defs                       |   10 +
 arch/arm/src/nrf52/hardware/nrf52_rtc.h            |  108 +
 arch/arm/src/nrf52/hardware/nrf52_tim.h            |   86 +-
 arch/arm/src/nrf52/nrf52_rtc.c                     |  672 ++++
 arch/arm/src/nrf52/nrf52_rtc.h                     |  119 +
 arch/arm/src/nrf52/nrf52_tim.c                     |  857 +++++
 arch/arm/src/nrf52/nrf52_tim.h                     |  176 +
 arch/arm/src/nrf52/nrf52_tim_lowerhalf.c           |  538 +++
 arch/arm/src/nrf52/nrf52_tim_lowerhalf.h           |   42 +
 arch/arm/src/s32k1xx/Kconfig                       |  346 ++
 arch/arm/src/s32k1xx/Make.defs                     |   16 +
 arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h    |  103 +-
 arch/arm/src/s32k1xx/hardware/s32k1xx_ftfc.h       |  145 +
 arch/arm/src/s32k1xx/hardware/s32k1xx_ftm.h        | 1219 ++++++-
 arch/arm/src/s32k1xx/hardware/s32k1xx_memorymap.h  |   25 +-
 arch/arm/src/s32k1xx/hardware/s32k1xx_pcc.h        |    6 +-
 arch/arm/src/s32k1xx/s32k1xx_eeeprom.c             |  479 +++
 arch/arm/src/s32k1xx/s32k1xx_eeeprom.h             |   88 +
 arch/arm/src/s32k1xx/s32k1xx_enet.h                |   27 +-
 arch/arm/src/s32k1xx/s32k1xx_flexcan.c             | 1921 ++++++++++
 arch/arm/src/s32k1xx/s32k1xx_flexcan.h             |  122 +
 arch/arm/src/s32k1xx/s32k1xx_pin.c                 |   10 +-
 arch/arm/src/s32k1xx/s32k1xx_progmem.c             |  424 +++
 arch/arm/src/s32k1xx/s32k1xx_progmem.h             |   95 +
 arch/arm/src/s32k1xx/s32k1xx_pwm.c                 |  847 +++++
 arch/arm/src/s32k1xx/s32k1xx_pwm.h                 |  346 ++
 arch/arm/src/s32k1xx/s32k1xx_rtc.c                 |   85 +-
 arch/arm/src/s32k1xx/s32k1xx_rtc.h                 |    8 -
 arch/arm/src/s32k1xx/s32k1xx_start.c               |   16 +
 arch/arm/src/sam34/sam4cm_cpustart.c               |    8 +-
 arch/arm/src/sama5/Kconfig                         |   40 +
 arch/arm/src/sama5/Make.defs                       |   12 +
 arch/arm/src/sama5/hardware/_sama5d2x_memorymap.h  |   22 +-
 arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h     |   63 +-
 arch/arm/src/sama5/hardware/sam_rstc.h             |   95 +
 arch/arm/src/sama5/hardware/sam_sdmmc.h            |  603 +++
 arch/arm/src/sama5/hardware/sama5d2_sdmmc.h        |  619 ++++
 arch/arm/src/sama5/sam_hsmci_clkdiv.c              |    2 +-
 arch/arm/src/sama5/sam_pioirq.c                    |    2 +
 arch/arm/src/sama5/sam_sdmmc.c                     | 3859 ++++++++++++++++++++
 arch/arm/src/sama5/sam_sdmmc.h                     |  142 +
 arch/arm/src/sama5/sam_systemreset.c               |   75 +
 arch/arm/src/sama5/sam_tc.h                        |    3 +-
 arch/arm/src/sama5/sama5d2x_pio.c                  |   46 +-
 arch/arm/src/stm32/Kconfig                         |   40 +
 arch/arm/src/stm32/Make.defs                       |   16 +-
 arch/arm/src/stm32/hardware/stm32_i2c_v1.h         |    2 +-
 arch/arm/src/stm32/hardware/stm32_pwr.h            |   11 +-
 arch/arm/src/stm32/hardware/stm32f40xxx_rcc.h      |  147 +-
 arch/arm/src/stm32/stm32_allocateheap.c            |    5 +-
 arch/arm/src/stm32/stm32_can.c                     |   51 +-
 arch/arm/src/stm32/stm32_procfs_ccm.c              |    7 +-
 arch/arm/src/stm32/stm32_tickless.c                |   38 +-
 arch/arm/src/stm32/stm32_timerisr.c                |    8 +
 arch/arm/src/stm32/stm32f40xxx_i2c.c               |   62 +-
 arch/arm/src/stm32/stm32f40xxx_rcc.c               |   38 +-
 arch/arm/src/stm32f7/Make.defs                     |    4 +
 arch/arm/src/stm32f7/hardware/stm32_fmc.h          |  396 ++
 arch/arm/src/stm32f7/stm32_can.c                   |   51 +-
 arch/arm/src/stm32f7/stm32_dma.c                   |    2 +-
 arch/arm/src/stm32f7/stm32_fmc.c                   |  234 ++
 arch/arm/src/stm32f7/stm32_fmc.h                   |  435 +--
 arch/arm/src/stm32f7/stm32_procfs_dtcm.c           |    8 +-
 arch/arm/src/stm32f7/stm32_tickless.c              |   46 +-
 arch/arm/src/stm32h7/stm32_procfs_dtcm.c           |    6 +-
 arch/arm/src/stm32l4/Make.defs                     |    1 +
 arch/arm/src/stm32l4/hardware/stm32l4_gpio.h       |   24 +
 arch/arm/src/stm32l4/stm32l4_can.c                 |   51 +-
 arch/arm/src/stm32l4/stm32l4_dfumode.c             |  180 +
 arch/arm/src/stm32l4/stm32l4_dfumode.h             |   61 +
 arch/arm/src/stm32l4/stm32l4_gpio.c                |   71 +-
 arch/arm/src/stm32l4/stm32l4_i2c.c                 |   39 +-
 arch/arm/src/stm32l4/stm32l4_oneshot.c             |    4 +-
 arch/arm/src/stm32l4/stm32l4_serial.c              |  325 +-
 arch/arm/src/stm32l4/stm32l4x6xx_rcc.c             |   78 +-
 arch/arm/src/tms570/tms570_lowputc.c               |   31 +-
 arch/avr/include/avr/types.h                       |    3 +
 arch/avr/src/Makefile                              |    9 +-
 arch/avr/src/avr/Toolchain.defs                    |   34 +
 arch/avr/src/avr/up_initialstate.c                 |   10 +-
 arch/avr/src/avr/up_schedulesigaction.c            |   28 +-
 arch/avr/src/avr/up_spi.c                          |    8 +-
 arch/avr/src/avr/up_stackframe.c                   |   19 +-
 arch/avr/src/avr32/Toolchain.defs                  |   27 +
 arch/avr/src/avr32/up_stackframe.c                 |    7 +-
 arch/avr/src/common/up_assert.c                    |    8 +-
 arch/avr/src/common/up_initialize.c                |   15 +-
 arch/avr/src/common/up_internal.h                  |   17 +-
 arch/hc/include/arch.h                             |   15 +
 arch/hc/include/hcs12/irq.h                        |   24 +-
 arch/hc/include/tls.h                              |   15 -
 arch/hc/src/Makefile                               |   22 +-
 arch/hc/src/common/up_initialize.c                 |   12 +-
 arch/hc/src/common/up_stackframe.c                 |    7 +-
 arch/hc/src/m9s12/m9s12_assert.c                   |   12 +-
 arch/mips/include/arch.h                           |   15 +
 arch/mips/include/tls.h                            |   15 -
 arch/mips/src/Makefile                             |    9 +-
 arch/mips/src/common/mips_initialize.c             |    5 +-
 arch/mips/src/common/mips_stackframe.c             |    7 +-
 arch/mips/src/mips32/Toolchain.defs                |   29 +-
 arch/mips/src/mips32/mips_assert.c                 |   10 +-
 arch/mips/src/mips32/mips_dumpstate.c              |   19 +-
 arch/misoc/include/arch.h                          |   50 +
 arch/misoc/include/tls.h                           |   13 -
 arch/misoc/src/Makefile                            |    9 +-
 arch/misoc/src/lm32/Toolchain.defs                 |   31 +-
 arch/misoc/src/lm32/lm32_assert.c                  |   10 +-
 arch/misoc/src/lm32/lm32_dumpstate.c               |   27 +-
 arch/misoc/src/lm32/lm32_stackframe.c              |    7 +-
 arch/misoc/src/minerva/Toolchain.defs              |   28 +-
 arch/misoc/src/minerva/minerva_assert.c            |   10 +-
 arch/misoc/src/minerva/minerva_dumpstate.c         |   27 +-
 arch/misoc/src/minerva/minerva_stackframe.c        |    7 +-
 arch/or1k/include/arch.h                           |   21 +-
 arch/or1k/include/tls.h                            |   17 -
 arch/or1k/src/Makefile                             |    7 +-
 arch/or1k/src/common/up_assert.c                   |   35 +-
 arch/or1k/src/common/up_initialize.c               |   16 +-
 arch/or1k/src/common/up_stackframe.c               |    7 +-
 arch/or1k/src/mor1kx/Toolchain.defs                |   29 +-
 arch/renesas/src/Makefile                          |   22 +-
 arch/renesas/src/common/up_assert.c                |    8 +-
 arch/renesas/src/common/up_initialize.c            |   15 +-
 arch/renesas/src/common/up_stackframe.c            |    8 +-
 arch/renesas/src/rx65n/rx65n_rtc.c                 |    6 +-
 arch/risc-v/include/rv32im/irq.h                   |   52 +-
 arch/risc-v/include/rv32im/syscall.h               |   69 +-
 arch/risc-v/src/Makefile                           |   15 +-
 arch/risc-v/src/common/riscv_initialize.c          |    5 +
 arch/risc-v/src/common/riscv_stackframe.c          |    7 +-
 arch/risc-v/src/k210/k210_cpustart.c               |    2 +-
 arch/risc-v/src/rv32im/Toolchain.defs              |   31 +-
 arch/risc-v/src/rv32im/riscv_assert.c              |    8 +-
 arch/risc-v/src/rv32im/riscv_schedulesigaction.c   |  195 +
 arch/risc-v/src/rv32im/riscv_swint.c               |   70 +-
 arch/risc-v/src/rv64gc/Toolchain.defs              |   30 +-
 arch/risc-v/src/rv64gc/riscv_assert.c              |    8 +-
 arch/sim/include/arch.h                            |    9 +
 arch/sim/include/tls.h                             |    2 +-
 arch/sim/src/.gitignore                            |    7 +-
 arch/sim/src/Makefile                              |   82 +-
 arch/sim/src/nuttx-names.dat                       |  169 -
 arch/sim/src/nuttx-names.in                        |  214 ++
 arch/sim/src/sim/up_head.c                         |    4 +-
 arch/sim/src/sim/up_hostfs.c                       |   41 +-
 arch/sim/src/sim/up_hostmemory.c                   |   70 +-
 arch/sim/src/sim/up_initialize.c                   |   21 +-
 arch/sim/src/sim/up_internal.h                     |   11 +-
 arch/sim/src/sim/up_ioexpander.c                   |   10 +-
 arch/sim/src/sim/up_rptun.c                        |    8 +-
 arch/sim/src/sim/up_shmem.c                        |  110 -
 arch/sim/src/sim/up_simsmp.c                       |   95 +-
 arch/sim/src/sim/up_smpsignal.c                    |   29 +
 arch/sim/src/sim/up_stackframe.c                   |    7 +-
 arch/sim/src/sim/up_vpnkit.c                       |    2 +-
 arch/x86/include/i486/arch.h                       |   19 +-
 arch/x86/include/tls.h                             |    2 +-
 arch/x86/src/Makefile                              |   28 +-
 arch/x86/src/common/up_assert.c                    |   12 +-
 arch/x86/src/common/up_initialize.c                |    9 +-
 arch/x86/src/i486/up_stackframe.c                  |    7 +-
 arch/x86_64/include/intel64/arch.h                 |    2 +-
 arch/x86_64/include/tls.h                          |    2 +-
 arch/x86_64/src/Makefile                           |   22 +-
 arch/x86_64/src/common/up_assert.c                 |   24 +-
 arch/x86_64/src/common/up_initialize.c             |    5 +-
 arch/x86_64/src/intel64/intel64_head.S             |    4 +-
 arch/x86_64/src/intel64/up_stackframe.c            |    8 +-
 arch/xtensa/include/arch.h                         |   17 +
 arch/xtensa/include/esp32/irq.h                    |    4 +-
 arch/xtensa/include/tls.h                          |   17 -
 arch/xtensa/src/Makefile                           |    9 +-
 arch/xtensa/src/common/xtensa_assert.c             |   14 +-
 arch/xtensa/src/common/xtensa_dumpstate.c          |   19 -
 arch/xtensa/src/common/xtensa_initialize.c         |    5 +-
 arch/xtensa/src/common/xtensa_stackframe.c         |    7 +-
 arch/xtensa/src/esp32/Kconfig                      |  132 +-
 arch/xtensa/src/esp32/Make.defs                    |   11 +
 arch/xtensa/src/esp32/esp32_i2c.c                  |  956 +++++
 arch/xtensa/src/esp32/esp32_i2c.h                  |   92 +
 arch/xtensa/src/esp32/esp32_spi.c                  | 1017 ++++++
 arch/xtensa/src/esp32/esp32_spi.h                  |  163 +
 arch/xtensa/src/esp32/esp32_spi_slave.c            | 1038 ++++++
 arch/xtensa/src/esp32/hardware/esp32_i2c.h         | 1687 +++++++++
 arch/xtensa/src/esp32/hardware/esp32_spi.h         | 2833 ++++++++++++++
 arch/xtensa/src/lx6/Toolchain.defs                 |   30 +-
 arch/z16/src/Makefile                              |    2 +-
 arch/z16/src/common/z16_assert.c                   |   19 +-
 arch/z16/src/common/z16_initialize.c               |    5 +-
 arch/z16/src/common/z16_stackframe.c               |    7 +-
 arch/z16/src/z16f/Toolchain.defs                   |    2 +-
 arch/z80/src/Makefile.sdccl                        |    6 +-
 arch/z80/src/Makefile.sdccw                        |    6 +-
 arch/z80/src/Makefile.zdsiil                       |    2 +-
 arch/z80/src/Makefile.zdsiiw                       |    2 +-
 arch/z80/src/common/z80_assert.c                   |   19 +-
 arch/z80/src/common/z80_initialize.c               |    5 +-
 arch/z80/src/common/z80_stackframe.c               |    7 +-
 arch/z80/src/ez80/.gitignore                       |    2 +
 arch/z80/src/ez80/Toolchain.defs                   |    2 +-
 arch/z80/src/z180/.gitignore                       |    2 +
 arch/z80/src/z180/Toolchain.defs                   |   76 +
 arch/z80/src/z8/Toolchain.defs                     |    2 +-
 arch/z80/src/z80/.gitignore                        |    2 +
 arch/z80/src/z80/Toolchain.defs                    |   76 +
 audio/Makefile                                     |    2 +-
 binfmt/Makefile                                    |    2 +-
 binfmt/binfmt_execmodule.c                         |   24 +-
 binfmt/libelf/Kconfig                              |    2 +-
 binfmt/libelf/libelf_load.c                        |    4 +-
 boards/Board.mk                                    |    2 +-
 boards/Kconfig                                     |   23 +
 boards/Makefile                                    |    2 +-
 boards/README.txt                                  |    4 +
 boards/arm/a1x/pcduino-a10/configs/nsh/defconfig   |    1 -
 boards/arm/a1x/pcduino-a10/scripts/Make.defs       |   19 -
 .../am335x/beaglebone-black/configs/lcd/defconfig  |    1 -
 .../am335x/beaglebone-black/configs/nsh/defconfig  |    1 -
 .../arm/am335x/beaglebone-black/scripts/Make.defs  |   19 -
 boards/arm/c5471/c5471evm/scripts/Make.defs        |   19 -
 boards/arm/cxd56xx/common/src/Make.defs            |   17 +-
 boards/arm/cxd56xx/common/src/cxd56_ak09912_scu.c  |    2 +-
 boards/arm/cxd56xx/common/src/cxd56_altmdm.c       |  425 ++-
 boards/arm/cxd56xx/common/src/cxd56_altmdm_spi.c   |  279 --
 boards/arm/cxd56xx/common/src/cxd56_bcm20706.c     |  165 +
 .../arm/cxd56xx/common/src/cxd56_bm1422gmv_scu.c   |    2 +-
 boards/arm/cxd56xx/common/src/cxd56_bmi160_i2c.c   |   14 +-
 boards/arm/cxd56xx/common/src/cxd56_bmi160_scu.c   |   66 +-
 boards/arm/cxd56xx/common/src/cxd56_bmi160_spi.c   |   12 -
 boards/arm/cxd56xx/common/src/cxd56_bmp280_scu.c   |    4 +-
 boards/arm/cxd56xx/common/src/cxd56_emmcdev.c      |  101 +
 boards/arm/cxd56xx/common/src/cxd56_ili9340.c      |    4 +
 boards/arm/cxd56xx/common/src/cxd56_isx012.c       |   26 +-
 boards/arm/cxd56xx/common/src/cxd56_kx022_scu.c    |    2 +-
 boards/arm/cxd56xx/common/src/cxd56_lpm013m091a.c  |   25 +-
 boards/arm/cxd56xx/common/src/cxd56_sensors.c      |    2 +-
 boards/arm/cxd56xx/common/src/cxd56_spidev.c       |   84 +
 boards/arm/cxd56xx/common/src/cxd56_spisd.c        |  145 +
 boards/arm/cxd56xx/drivers/audio/Make.defs         |    4 +
 boards/arm/cxd56xx/drivers/audio/cxd56_audio.c     |   22 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c |   35 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_analog.c |    9 +-
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.c    |   16 +-
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.h    |    4 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h |    1 +
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c |    7 +-
 boards/arm/cxd56xx/drivers/sensors/Kconfig         |   82 +-
 boards/arm/cxd56xx/drivers/sensors/ak09912_scu.c   |    2 +-
 boards/arm/cxd56xx/drivers/sensors/bm1383glv_scu.c |   21 +-
 boards/arm/cxd56xx/drivers/sensors/bm1422gmv_scu.c |   20 +-
 boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c    |   76 +-
 boards/arm/cxd56xx/drivers/sensors/bmp280_scu.c    |    8 +-
 boards/arm/cxd56xx/drivers/sensors/kx022_scu.c     |    2 +-
 boards/arm/cxd56xx/drivers/sensors/rpr0521rs_scu.c |    2 +-
 boards/arm/cxd56xx/spresense/Kconfig               |   47 +-
 .../arm/cxd56xx/spresense/configs/audio/defconfig  |    4 +-
 .../cxd56xx/spresense/configs/audio_sdk/defconfig  |    5 +-
 .../arm/cxd56xx/spresense/configs/camera/defconfig |    3 +-
 boards/arm/cxd56xx/spresense/configs/elf/defconfig |    1 -
 .../spresense/configs/example_camera/defconfig     |   95 +
 .../spresense/configs/example_lcd/defconfig        |    4 +-
 boards/arm/cxd56xx/spresense/configs/lcd/defconfig |    4 +-
 boards/arm/cxd56xx/spresense/configs/lte/defconfig |    4 +-
 .../arm/cxd56xx/spresense/configs/module/defconfig |    1 -
 boards/arm/cxd56xx/spresense/configs/mpy/defconfig |    4 +-
 boards/arm/cxd56xx/spresense/configs/nsh/defconfig |    2 -
 .../spresense/configs/posix_spawn/defconfig        |    1 -
 .../arm/cxd56xx/spresense/configs/rndis/defconfig  |    2 +-
 boards/arm/cxd56xx/spresense/configs/smp/defconfig |    2 -
 .../arm/cxd56xx/spresense/configs/usbmsc/defconfig |    4 +-
 .../arm/cxd56xx/spresense/configs/usbnsh/defconfig |    4 +-
 .../arm/cxd56xx/spresense/configs/wifi/defconfig   |    5 +-
 boards/arm/cxd56xx/spresense/include/board.h       |   19 +-
 .../arm/cxd56xx/spresense/include/cxd56_altmdm.h   |   91 +-
 .../arm/cxd56xx/spresense/include/cxd56_bcm20706.h |  126 +
 .../arm/cxd56xx/spresense/include/cxd56_emmcdev.h  |   86 +
 boards/arm/cxd56xx/spresense/include/cxd56_power.h |   34 +
 .../arm/cxd56xx/spresense/include/cxd56_spidev.h   |   84 +
 boards/arm/cxd56xx/spresense/include/cxd56_spisd.h |   98 +
 boards/arm/cxd56xx/spresense/scripts/Make.defs     |   24 +-
 boards/arm/cxd56xx/spresense/scripts/ramconfig.ld  |    7 +-
 boards/arm/cxd56xx/spresense/src/Make.defs         |    4 +
 .../arm/cxd56xx/spresense/src/cxd56_altmdm_power.c |  101 +
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c   |  108 +-
 boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c     |    4 +-
 boards/arm/cxd56xx/spresense/src/cxd56_power.c     |   72 +-
 boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c    |    3 +-
 boards/arm/cxd56xx/spresense/src/cxd56_spi.c       |   14 +-
 boards/arm/cxd56xx/spresense/src/spresense.h       |   14 +-
 boards/arm/dm320/ntosd-dm320/scripts/Make.defs     |   18 -
 boards/arm/efm32/efm32-g8xx-stk/scripts/Make.defs  |   23 -
 boards/arm/efm32/efm32gg-stk3700/scripts/Make.defs |   23 -
 .../olimex-efm32g880f128-stk/scripts/Make.defs     |   23 -
 boards/arm/eoss3/quickfeather/Kconfig              |    8 +
 boards/arm/eoss3/quickfeather/README.txt           |    0
 .../arm/eoss3/quickfeather/configs/nsh/defconfig   |   48 +
 boards/arm/eoss3/quickfeather/include/board.h      |   66 +
 boards/arm/eoss3/quickfeather/scripts/Make.defs    |   74 +
 boards/arm/eoss3/quickfeather/scripts/ld.script    |  105 +
 .../arm/eoss3/quickfeather/scripts/quicknuttx.resc |   20 +
 boards/arm/eoss3/quickfeather/src/Makefile         |   31 +
 boards/arm/eoss3/quickfeather/src/eoss3_appinit.c  |   66 +
 boards/arm/eoss3/quickfeather/src/eoss3_autoleds.c |  143 +
 boards/arm/eoss3/quickfeather/src/eoss3_boot.c     |   83 +
 boards/arm/eoss3/quickfeather/src/eoss3_bringup.c  |   59 +
 boards/arm/eoss3/quickfeather/src/quickfeather.h   |   79 +
 boards/arm/imx6/sabre-6quad/configs/nsh/defconfig  |    1 -
 boards/arm/imx6/sabre-6quad/configs/smp/defconfig  |    1 -
 boards/arm/imx6/sabre-6quad/scripts/Make.defs      |   19 -
 boards/arm/imxrt/imxrt1020-evk/scripts/Make.defs   |   23 -
 boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c |    4 +-
 .../arm/imxrt/imxrt1050-evk/configs/knsh/Make.defs |   23 -
 .../imxrt1050-evk/configs/libcxxtest/Make.defs     |   29 +-
 .../imxrt1050-evk/configs/libcxxtest/defconfig     |    2 -
 boards/arm/imxrt/imxrt1050-evk/include/board.h     |   71 +-
 .../imxrt/imxrt1050-evk/kernel/imxrt_userspace.c   |    6 +-
 boards/arm/imxrt/imxrt1050-evk/scripts/Make.defs   |   23 -
 .../arm/imxrt/imxrt1060-evk/configs/knsh/Make.defs |   23 -
 .../imxrt1060-evk/configs/libcxxtest/Make.defs     |   29 +-
 .../imxrt1060-evk/configs/libcxxtest/defconfig     |    2 -
 .../arm/imxrt/imxrt1060-evk/configs/lvgl/defconfig |    9 -
 boards/arm/imxrt/imxrt1060-evk/include/board.h     |   85 +-
 .../imxrt/imxrt1060-evk/kernel/imxrt_userspace.c   |    6 +-
 boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs   |   23 -
 boards/arm/imxrt/imxrt1060-evk/src/imxrt1060-evk.h |   14 +-
 boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c |   18 +
 boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c |   50 +-
 boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c |    4 +-
 .../freedom-k28f/configs/nshsdusb/defconfig        |   93 +
 boards/arm/kinetis/freedom-k28f/scripts/Make.defs  |   23 -
 boards/arm/kinetis/freedom-k28f/src/k28_bringup.c  |   62 +-
 boards/arm/kinetis/freedom-k64f/scripts/Make.defs  |   23 -
 boards/arm/kinetis/freedom-k66f/scripts/Make.defs  |   23 -
 boards/arm/kinetis/kwikstik-k40/scripts/Make.defs  |   23 -
 boards/arm/kinetis/teensy-3.x/scripts/Make.defs    |   23 -
 boards/arm/kinetis/twr-k60n512/scripts/Make.defs   |   23 -
 boards/arm/kinetis/twr-k64f120m/scripts/Make.defs  |   23 -
 boards/arm/kl/freedom-kl25z/scripts/Make.defs      |   22 -
 boards/arm/kl/freedom-kl25z/src/Makefile           |    4 -
 boards/arm/kl/freedom-kl26z/scripts/Make.defs      |   22 -
 boards/arm/kl/teensy-lc/scripts/Make.defs          |   22 -
 .../lc823450-xgevk/kernel/lc823450_userspace.c     |   12 +-
 .../arm/lc823450/lc823450-xgevk/scripts/Make.defs  |   25 +-
 .../arm/lpc17xx_40xx/lincoln60/scripts/Make.defs   |   23 -
 .../lpc4088-devkit/configs/knsh/Make.defs          |   23 -
 .../lpc4088-devkit/kernel/lpc17_40_userspace.c     |    2 +-
 .../lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs  |   23 -
 .../lpc4088-devkit/src/lpc17_40_bringup.c          |    3 +-
 .../lpc4088-quickstart/configs/knsh/Make.defs      |   23 -
 .../lpc4088-quickstart/kernel/lpc17_40_userspace.c |    2 +-
 .../lpc4088-quickstart/scripts/Make.defs           |   23 -
 .../lpc4088-quickstart/src/lpc17_40_bringup.c      |    3 +-
 .../lpcxpresso-lpc1768/configs/thttpd/Make.defs    |   23 -
 .../lpcxpresso-lpc1768/scripts/Make.defs           |   23 -
 boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs   |   24 -
 boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs     |   23 -
 boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs  |   23 -
 .../lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c    |    3 +-
 .../configs/thttpd-binfs/Make.defs                 |   23 -
 .../configs/thttpd-nxflat/Make.defs                |   23 -
 .../olimex-lpc1766stk/scripts/Make.defs            |   23 -
 .../olimex-lpc1766stk/src/lpc17_40_bringup.c       |    3 +-
 .../lpc17xx_40xx/open1788/configs/knsh/Make.defs   |   23 -
 .../open1788/configs/knxterm/Make.defs             |   23 -
 .../open1788/kernel/lpc17_40_userspace.c           |    8 +-
 boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs |   23 -
 .../lpc17xx_40xx/open1788/src/lpc17_40_bringup.c   |    3 +-
 .../lpc17xx_40xx/pnev5180b/configs/knsh/Make.defs  |   22 -
 .../pnev5180b/kernel/lpc17_40_userspace.c          |    8 +-
 .../arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs   |   22 -
 .../arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs |   23 -
 .../lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs   |   22 -
 .../arm/lpc214x/mcu123-lpc214x/scripts/Make.defs   |   19 -
 boards/arm/lpc214x/zp214xpa/scripts/Make.defs      |   19 -
 .../arm/lpc2378/olimex-lpc2378/scripts/Make.defs   |   19 -
 boards/arm/lpc31xx/ea3131/configs/pgnsh/Make.defs  |   20 -
 boards/arm/lpc31xx/ea3131/scripts/Make.defs        |   19 -
 boards/arm/lpc31xx/ea3152/scripts/Make.defs        |   20 -
 .../arm/lpc31xx/olimex-lpc-h3131/scripts/Make.defs |   19 -
 .../lpc43xx/bambino-200e/configs/netnsh/Make.defs  |   24 +-
 .../lpc43xx/bambino-200e/kernel/lpc43_userspace.c  |    8 +-
 boards/arm/lpc43xx/bambino-200e/scripts/Make.defs  |   24 -
 .../arm/lpc43xx/lpc4330-xplorer/scripts/Make.defs  |   23 -
 boards/arm/lpc43xx/lpc4337-ws/scripts/Make.defs    |   23 -
 boards/arm/lpc43xx/lpc4357-evb/scripts/Make.defs   |   23 -
 boards/arm/lpc43xx/lpc4370-link2/scripts/Make.defs |   23 -
 .../lpc54xx/lpcxpresso-lpc54628/scripts/Make.defs  |   23 -
 .../arm/max326xx/max32660-evsys/scripts/Make.defs  |   23 -
 boards/arm/moxart/moxa/scripts/Make.defs           |   22 -
 boards/arm/nrf52/nrf52-feather/scripts/Make.defs   |   23 -
 boards/arm/nrf52/nrf52832-dk/scripts/Make.defs     |   23 -
 boards/arm/nrf52/nrf52840-dk/Kconfig               |    4 +
 .../nrf52/nrf52840-dk/configs/highpri/defconfig    |   48 +
 .../arm/nrf52/nrf52840-dk/configs/timer/defconfig  |   55 +
 boards/arm/nrf52/nrf52840-dk/scripts/Make.defs     |   23 -
 .../arm/nrf52/nrf52840-dk/scripts/flash_config.ld  |    6 +
 boards/arm/nrf52/nrf52840-dk/src/Makefile          |    8 +
 boards/arm/nrf52/nrf52840-dk/src/nrf52840-dk.h     |   23 +-
 boards/arm/nrf52/nrf52840-dk/src/nrf52_bringup.c   |   18 +
 boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c   |  303 ++
 boards/arm/nrf52/nrf52840-dk/src/nrf52_timer.c     |   58 +
 boards/arm/nrf52/nrf52840-dongle/scripts/Make.defs |   23 -
 boards/arm/nuc1xx/nutiny-nuc120/scripts/Make.defs  |   23 -
 boards/arm/nuc1xx/nutiny-nuc120/src/Makefile       |    4 -
 .../rddrone-uavcan144/configs/nsh/defconfig        |    2 -
 .../rddrone-uavcan144/configs/nshdebug/defconfig   |    2 -
 .../s32k1xx/rddrone-uavcan144/scripts/Make.defs    |   23 -
 .../rddrone-uavcan144/src/s32k1xx_bringup.c        |   21 +
 .../rddrone-uavcan144/src/s32k1xx_clockconfig.c    |    2 +-
 .../rddrone-uavcan146/configs/nsh/defconfig        |   17 +-
 .../rddrone-uavcan146/configs/nshdebug/defconfig   |    2 -
 .../arm/s32k1xx/rddrone-uavcan146/include/board.h  |   12 +-
 .../s32k1xx/rddrone-uavcan146/scripts/Make.defs    |   23 -
 .../rddrone-uavcan146/src/rddrone-uavcan146.h      |   10 +-
 .../rddrone-uavcan146/src/s32k1xx_bringup.c        |   21 +
 .../rddrone-uavcan146/src/s32k1xx_buttons.c        |   17 +-
 .../rddrone-uavcan146/src/s32k1xx_clockconfig.c    |    2 +-
 .../rddrone-uavcan146/src/s32k1xx_periphclocks.c   |   12 +-
 boards/arm/s32k1xx/s32k118evb/scripts/Make.defs    |   23 -
 .../arm/s32k1xx/s32k118evb/src/s32k1xx_bringup.c   |   21 +
 .../arm/s32k1xx/s32k144evb/configs/nsh/defconfig   |    1 -
 boards/arm/s32k1xx/s32k144evb/scripts/Make.defs    |   23 -
 .../arm/s32k1xx/s32k144evb/src/s32k1xx_bringup.c   |   21 +
 .../s32k1xx/s32k144evb/src/s32k1xx_clockconfig.c   |    2 +-
 .../arm/s32k1xx/s32k146evb/configs/nsh/defconfig   |    1 -
 boards/arm/s32k1xx/s32k146evb/scripts/Make.defs    |   23 -
 .../arm/s32k1xx/s32k146evb/src/s32k1xx_bringup.c   |   21 +
 .../s32k1xx/s32k146evb/src/s32k1xx_clockconfig.c   |    2 +-
 .../arm/s32k1xx/s32k148evb/configs/nsh/defconfig   |    1 -
 boards/arm/s32k1xx/s32k148evb/include/board.h      |    8 +
 boards/arm/s32k1xx/s32k148evb/scripts/Make.defs    |   23 -
 .../arm/s32k1xx/s32k148evb/src/s32k1xx_bringup.c   |   34 +
 .../s32k1xx/s32k148evb/src/s32k1xx_clockconfig.c   |    2 +-
 boards/arm/sam34/arduino-due/configs/nsh/defconfig |    1 -
 boards/arm/sam34/arduino-due/scripts/Make.defs     |   23 -
 boards/arm/sam34/arduino-due/src/sam_mmcsd.c       |    5 +-
 boards/arm/sam34/arduino-due/src/sam_touchscreen.c |    2 +-
 .../sam34/flipnclick-sam3x/configs/nsh/defconfig   |    1 -
 .../flipnclick-sam3x/configs/nxlines/defconfig     |    1 -
 .../arm/sam34/flipnclick-sam3x/scripts/Make.defs   |   22 -
 boards/arm/sam34/sam3u-ek/configs/knsh/Make.defs   |   23 -
 boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c   |    6 +-
 boards/arm/sam34/sam3u-ek/scripts/Make.defs        |   24 -
 boards/arm/sam34/sam4cmp-db/scripts/Make.defs      |   23 -
 boards/arm/sam34/sam4e-ek/scripts/Make.defs        |   23 -
 .../arm/sam34/sam4l-xplained/configs/nsh/defconfig |    1 -
 boards/arm/sam34/sam4l-xplained/scripts/Make.defs  |   23 -
 .../sam34/sam4s-xplained-pro/configs/nsh/defconfig |    1 -
 .../arm/sam34/sam4s-xplained-pro/scripts/Make.defs |   23 -
 .../arm/sam34/sam4s-xplained/configs/nsh/defconfig |    1 -
 boards/arm/sam34/sam4s-xplained/scripts/Make.defs  |   23 -
 boards/arm/sama5/sama5d2-xult/Kconfig              |   98 +
 boards/arm/sama5/sama5d2-xult/README.txt           |   13 +-
 .../sama5/sama5d2-xult/configs/netnsh/defconfig    |    1 -
 .../arm/sama5/sama5d2-xult/configs/nsh/defconfig   |    1 -
 .../sama5/sama5d2-xult/configs/sdmmcnsh/defconfig  |  147 +
 boards/arm/sama5/sama5d2-xult/include/board.h      |   22 +-
 boards/arm/sama5/sama5d2-xult/scripts/Make.defs    |   19 -
 boards/arm/sama5/sama5d2-xult/src/Makefile         |   12 +
 boards/arm/sama5/sama5d2-xult/src/sam_appinit.c    |    3 +
 boards/arm/sama5/sama5d2-xult/src/sam_bringup.c    |  115 +-
 boards/arm/sama5/sama5d2-xult/src/sam_hsmci.c      |  329 --
 boards/arm/sama5/sama5d2-xult/src/sam_reset.c      |   62 +
 boards/arm/sama5/sama5d2-xult/src/sam_sdmmc.c      |  336 ++
 boards/arm/sama5/sama5d2-xult/src/sama5d2-xult.h   |  169 +-
 .../ethernet-over-usb-2-high-speed/defconfig       |    1 -
 .../sama5/sama5d3-xplained/configs/nsh/defconfig   |    1 -
 .../arm/sama5/sama5d3-xplained/scripts/Make.defs   |   19 -
 boards/arm/sama5/sama5d3-xplained/src/sam_usb.c    |    4 +-
 .../arm/sama5/sama5d3x-ek/configs/demo/defconfig   |    1 -
 boards/arm/sama5/sama5d3x-ek/configs/nsh/defconfig |    1 -
 .../sama5/sama5d3x-ek/configs/nxplayer/defconfig   |    1 -
 boards/arm/sama5/sama5d3x-ek/scripts/Make.defs     |   19 -
 boards/arm/sama5/sama5d3x-ek/src/sama5d3x-ek.h     |   16 +-
 boards/arm/sama5/sama5d4-ek/configs/ipv6/defconfig |    1 -
 boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs |   19 -
 boards/arm/sama5/sama5d4-ek/configs/nsh/defconfig  |    1 -
 .../arm/sama5/sama5d4-ek/configs/ramtest/defconfig |    1 -
 boards/arm/sama5/sama5d4-ek/scripts/Make.defs      |   19 -
 .../arm/samd2l2/arduino-m0/configs/nsh/defconfig   |    1 -
 .../samd2l2/arduino-m0/configs/usbnsh/defconfig    |    1 -
 boards/arm/samd2l2/arduino-m0/scripts/Make.defs    |   23 -
 .../samd2l2/samd20-xplained/configs/nsh/defconfig  |    1 -
 .../arm/samd2l2/samd20-xplained/scripts/Make.defs  |   23 -
 .../samd2l2/samd21-xplained/configs/nsh/defconfig  |    1 -
 .../arm/samd2l2/samd21-xplained/scripts/Make.defs  |   23 -
 .../samd2l2/saml21-xplained/configs/nsh/defconfig  |    1 -
 .../arm/samd2l2/saml21-xplained/scripts/Make.defs  |   23 -
 boards/arm/samd5e5/metro-m4/configs/nsh/defconfig  |    1 -
 boards/arm/samd5e5/metro-m4/scripts/Make.defs      |   23 -
 .../same54-xplained-pro/configs/nsh/defconfig      |    1 -
 .../samd5e5/same54-xplained-pro/scripts/Make.defs  |   23 -
 .../configs/mrf24j40-starhub/defconfig             |    1 -
 .../samv7/same70-xplained/kernel/sam_userspace.c   |    6 +-
 boards/arm/samv7/same70-xplained/scripts/Make.defs |   23 -
 .../arm/samv7/samv71-xult/configs/knsh/Make.defs   |   23 -
 .../samv71-xult/configs/mrf24j40-starhub/defconfig |    1 -
 .../arm/samv7/samv71-xult/kernel/sam_userspace.c   |   13 +-
 boards/arm/samv7/samv71-xult/scripts/Make.defs     |   23 -
 boards/arm/stm32/axoloti/scripts/Make.defs         |   23 -
 boards/arm/stm32/axoloti/src/stm32_usbhost.c       |    1 +
 boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs   |   23 -
 boards/arm/stm32/clicker2-stm32/README.txt         |    1 -
 .../stm32/clicker2-stm32/configs/knsh/defconfig    |    1 -
 .../configs/mrf24j40-6lowpan/defconfig             |    1 -
 .../clicker2-stm32/configs/mrf24j40-mac/defconfig  |    1 -
 .../configs/mrf24j40-starhub/defconfig             |    1 -
 .../configs/mrf24j40-starpoint/defconfig           |    1 -
 .../arm/stm32/clicker2-stm32/configs/nsh/defconfig |    1 -
 .../stm32/clicker2-stm32/configs/usbnsh/defconfig  |    1 -
 .../clicker2-stm32/configs/xbee-6lowpan/defconfig  |    1 -
 .../stm32/clicker2-stm32/kernel/stm32_userspace.c  |   12 +-
 boards/arm/stm32/clicker2-stm32/scripts/Make.defs  |   22 -
 boards/arm/stm32/cloudctrl/scripts/Make.defs       |   23 -
 boards/arm/stm32/cloudctrl/src/stm32_usb.c         |   58 +-
 boards/arm/stm32/fire-stm32v2/scripts/Make.defs    |   23 -
 boards/arm/stm32/hymini-stm32v/scripts/Make.defs   |   23 -
 boards/arm/stm32/maple/scripts/Make.defs           |   23 -
 .../mikroe-stm32f4/configs/fulldemo/defconfig      |    1 -
 .../arm/stm32/mikroe-stm32f4/configs/nsh/defconfig |    1 -
 .../stm32/mikroe-stm32f4/configs/usbnsh/defconfig  |    1 -
 .../stm32/mikroe-stm32f4/kernel/stm32_userspace.c  |   13 +-
 boards/arm/stm32/mikroe-stm32f4/scripts/Make.defs  |   23 -
 boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c    |   60 +-
 boards/arm/stm32/nucleo-f103rb/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f207zg/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c     |   60 +-
 boards/arm/stm32/nucleo-f302r8/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f303re/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f303ze/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f334r8/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f410rb/scripts/Make.defs   |   23 -
 boards/arm/stm32/nucleo-f412zg/Kconfig             |   10 +
 boards/arm/stm32/nucleo-f412zg/README.txt          |  255 ++
 .../arm/stm32/nucleo-f412zg/configs/nsh/defconfig  |   69 +
 boards/arm/stm32/nucleo-f412zg/include/board.h     |  238 ++
 boards/arm/stm32/nucleo-f412zg/scripts/Make.defs   |   79 +
 boards/arm/stm32/nucleo-f412zg/scripts/f412zg.ld   |  120 +
 boards/arm/stm32/nucleo-f412zg/src/Make.defs       |   55 +
 boards/arm/stm32/nucleo-f412zg/src/nucleo-f412zg.h |  183 +
 boards/arm/stm32/nucleo-f412zg/src/stm32_appinit.c |   93 +
 .../arm/stm32/nucleo-f412zg/src/stm32_autoleds.c   |  118 +
 boards/arm/stm32/nucleo-f412zg/src/stm32_boot.c    |  114 +
 boards/arm/stm32/nucleo-f412zg/src/stm32_bringup.c |   99 +
 boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c     |  357 ++
 .../stm32/nucleo-f429zi/configs/netnsh/defconfig   |    1 -
 .../arm/stm32/nucleo-f429zi/configs/nsh/defconfig  |    1 -
 boards/arm/stm32/nucleo-f429zi/scripts/Make.defs   |   23 -
 .../arm/stm32/nucleo-f446re/configs/nsh/defconfig  |    1 -
 boards/arm/stm32/nucleo-f446re/scripts/Make.defs   |   31 +-
 .../stm32/nucleo-f4x1re/configs/f401-nsh/defconfig |    1 -
 .../configs/f411-mcp2515-extid/defconfig           |    1 -
 .../stm32/nucleo-f4x1re/configs/f411-nsh/defconfig |    1 -
 boards/arm/stm32/nucleo-f4x1re/scripts/Make.defs   |   31 +-
 boards/arm/stm32/nucleo-l152re/scripts/Make.defs   |   23 -
 .../olimex-stm32-e407/configs/bmp180/defconfig     |    1 -
 .../olimex-stm32-e407/configs/ina219/defconfig     |    1 -
 .../olimex-stm32-e407/configs/netnsh/defconfig     |    1 -
 .../stm32/olimex-stm32-e407/configs/nsh/defconfig  |    1 -
 .../olimex-stm32-e407/configs/usbnsh/defconfig     |    1 -
 .../arm/stm32/olimex-stm32-e407/scripts/Make.defs  |   23 -
 boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c |   14 +-
 .../olimex-stm32-h405/configs/usbnsh/defconfig     |    1 -
 .../arm/stm32/olimex-stm32-h405/scripts/Make.defs  |   22 -
 .../stm32/olimex-stm32-h407/configs/nsh/defconfig  |    1 -
 .../arm/stm32/olimex-stm32-h407/scripts/Make.defs  |   23 -
 boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c |   58 +-
 .../arm/stm32/olimex-stm32-p107/scripts/Make.defs  |   23 -
 .../stm32/olimex-stm32-p207/configs/nsh/defconfig  |    1 -
 .../arm/stm32/olimex-stm32-p207/scripts/Make.defs  |   22 -
 boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c |   58 +-
 .../olimex-stm32-p407/configs/audio/defconfig      |    1 -
 .../olimex-stm32-p407/configs/dhtxx/defconfig      |    1 -
 .../olimex-stm32-p407/configs/hidkbd/defconfig     |    1 -
 .../stm32/olimex-stm32-p407/configs/kelf/Make.defs |   24 -
 .../olimex-stm32-p407/configs/kmodule/Make.defs    |   24 -
 .../stm32/olimex-stm32-p407/configs/knsh/Make.defs |   22 -
 .../stm32/olimex-stm32-p407/configs/knsh/defconfig |    1 -
 .../stm32/olimex-stm32-p407/configs/nsh/defconfig  |    1 -
 .../olimex-stm32-p407/configs/zmodem/defconfig     |    1 -
 boards/arm/stm32/olimex-stm32-p407/include/board.h |   50 +-
 .../olimex-stm32-p407/kernel/stm32_userspace.c     |   13 +-
 .../arm/stm32/olimex-stm32-p407/scripts/Make.defs  |   22 -
 boards/arm/stm32/olimex-stm32-p407/src/Make.defs   |    6 +-
 .../olimex-stm32-p407/src/olimex-stm32-p407.h      |   55 +-
 .../arm/stm32/olimex-stm32-p407/src/stm32_boot.c   |   36 +-
 .../stm32/olimex-stm32-p407/src/stm32_bringup.c    |   10 +-
 .../stm32/olimex-stm32-p407/src/stm32_buttons.c    |   40 +-
 .../stm32/olimex-stm32-p407/src/stm32_djoystick.c  |  296 ++
 boards/arm/stm32/olimex-stm32-p407/src/stm32_spi.c |  195 +
 .../arm/stm32/olimex-stm32-p407/src/stm32_st7735.c |  121 +
 boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c |   58 +-
 boards/arm/stm32/olimexino-stm32/scripts/Make.defs |   23 -
 boards/arm/stm32/omnibusf4/configs/nsh/defconfig   |    1 -
 .../arm/stm32/omnibusf4/kernel/stm32_userspace.c   |    6 +-
 boards/arm/stm32/omnibusf4/scripts/Make.defs       |   23 -
 boards/arm/stm32/omnibusf4/src/stm32_usb.c         |   56 +-
 boards/arm/stm32/photon/scripts/Make.defs          |   22 -
 boards/arm/stm32/photon/src/stm32_wdt.c            |    5 +-
 boards/arm/stm32/shenzhou/scripts/Make.defs        |   23 -
 boards/arm/stm32/shenzhou/src/stm32_usb.c          |   58 +-
 boards/arm/stm32/stm3210e-eval/include/board.h     |   38 +-
 boards/arm/stm32/stm3210e-eval/scripts/Make.defs   |   23 -
 .../arm/stm32/stm3220g-eval/configs/nsh/defconfig  |    1 -
 .../arm/stm32/stm3220g-eval/configs/nsh2/defconfig |    1 -
 boards/arm/stm32/stm3220g-eval/scripts/Make.defs   |   23 -
 boards/arm/stm32/stm3220g-eval/src/stm32_usb.c     |   58 +-
 .../stm32/stm3240g-eval/configs/knxwm/Make.defs    |   23 -
 .../arm/stm32/stm3240g-eval/configs/nsh/defconfig  |    1 -
 .../arm/stm32/stm3240g-eval/configs/nsh2/defconfig |    1 -
 .../stm32/stm3240g-eval/kernel/stm32_userspace.c   |   13 +-
 boards/arm/stm32/stm3240g-eval/scripts/Make.defs   |   23 -
 boards/arm/stm32/stm3240g-eval/src/stm32_usb.c     |   58 +-
 boards/arm/stm32/stm32_tiny/scripts/Make.defs      |   23 -
 boards/arm/stm32/stm32_tiny/src/Make.defs          |    1 -
 boards/arm/stm32/stm32butterfly2/scripts/Make.defs |   23 -
 .../arm/stm32/stm32f103-minimum/scripts/Make.defs  |   23 -
 boards/arm/stm32/stm32f334-disco/scripts/Make.defs |   23 -
 .../stm32/stm32f3discovery/configs/nsh/defconfig   |    1 -
 .../stm32f3discovery/configs/usbnsh/defconfig      |    1 -
 .../arm/stm32/stm32f3discovery/scripts/Make.defs   |   23 -
 .../arm/stm32/stm32f411-minimum/scripts/Make.defs  |   22 -
 .../arm/stm32/stm32f411e-disco/scripts/Make.defs   |   22 -
 boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c  |   58 +-
 .../stm32/stm32f429i-disco/configs/adc/defconfig   |    1 -
 .../stm32f429i-disco/configs/extflash/defconfig    |    1 -
 .../stm32/stm32f429i-disco/configs/fb/defconfig    |    1 -
 .../stm32/stm32f429i-disco/configs/lcd/defconfig   |    1 -
 .../stm32/stm32f429i-disco/configs/lvgl/defconfig  |    1 -
 .../stm32/stm32f429i-disco/configs/nsh/defconfig   |    1 -
 .../stm32f429i-disco/configs/nxhello/defconfig     |    1 -
 .../stm32f429i-disco/configs/usbmsc/defconfig      |    1 -
 .../stm32f429i-disco/configs/usbnsh/defconfig      |    1 -
 .../arm/stm32/stm32f429i-disco/scripts/Make.defs   |   23 -
 boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c  |   58 +-
 boards/arm/stm32/stm32f4discovery/README.txt       |   11 +-
 .../stm32/stm32f4discovery/configs/audio/defconfig |    1 -
 .../stm32f4discovery/configs/canard/defconfig      |    1 -
 .../stm32f4discovery/configs/cxxtest/Make.defs     |   29 +-
 .../stm32f4discovery/configs/cxxtest/defconfig     |    1 -
 .../stm32/stm32f4discovery/configs/elf/Make.defs   |  120 -
 .../stm32/stm32f4discovery/configs/elf/defconfig   |    2 +-
 .../stm32f4discovery/configs/hciuart/defconfig     |    1 -
 .../stm32/stm32f4discovery/configs/ipv6/defconfig  |    1 -
 .../stm32f4discovery/configs/max31855/defconfig    |    1 -
 .../stm32f4discovery/configs/mmcsdspi/defconfig    |    1 -
 .../stm32f4discovery/configs/module/defconfig      |    1 -
 .../stm32f4discovery/configs/netnsh/defconfig      |    1 -
 .../stm32/stm32f4discovery/configs/nsh/defconfig   |    1 -
 .../stm32/stm32f4discovery/configs/pm/defconfig    |    1 -
 .../stm32f4discovery/configs/posix_spawn/Make.defs |  120 -
 .../stm32f4discovery/configs/posix_spawn/defconfig |    2 +-
 .../stm32f4discovery/configs/pseudoterm/defconfig  |    1 -
 .../stm32f4discovery/configs/rgbled/defconfig      |    1 -
 .../stm32/stm32f4discovery/configs/rndis/defconfig |    1 -
 .../stm32f4discovery/configs/testlibcxx/Make.defs  |   30 +-
 .../stm32f4discovery/configs/testlibcxx/defconfig  |    2 -
 .../stm32f4discovery/configs/usbmsc/defconfig      |    1 -
 .../stm32f4discovery/configs/usbnsh/defconfig      |    1 -
 .../stm32/stm32f4discovery/configs/wifi/defconfig  |   14 +-
 .../stm32f4discovery/configs/winbuild/Make.defs    |   21 -
 .../stm32f4discovery/configs/xen1210/defconfig     |    1 -
 .../stm32f4discovery/kernel/stm32_userspace.c      |   13 +-
 .../arm/stm32/stm32f4discovery/scripts/Make.defs   |   32 +-
 boards/arm/stm32/stm32f4discovery/src/stm32_usb.c  |   58 +-
 boards/arm/stm32/stm32ldiscovery/scripts/Make.defs |   23 -
 .../arm/stm32/stm32vldiscovery/scripts/Make.defs   |   22 -
 .../arm/stm32/viewtool-stm32f107/scripts/Make.defs |   23 -
 .../stm32/viewtool-stm32f107/src/stm32_max3421e.c  |   46 +-
 .../stm32f0l0g0/b-l072z-lrwan1/scripts/Make.defs   |   23 -
 boards/arm/stm32f0l0g0/nucleo-f072rb/README.txt    |    1 -
 .../stm32f0l0g0/nucleo-f072rb/scripts/Make.defs    |   23 -
 boards/arm/stm32f0l0g0/nucleo-f091rc/README.txt    |    1 -
 .../stm32f0l0g0/nucleo-f091rc/scripts/Make.defs    |   23 -
 .../stm32f0l0g0/nucleo-g070rb/scripts/Make.defs    |   23 -
 .../stm32f0l0g0/nucleo-g071rb/scripts/Make.defs    |   23 -
 .../stm32f0l0g0/nucleo-l073rz/scripts/Make.defs    |   23 -
 .../stm32f051-discovery/scripts/Make.defs          |   23 -
 .../stm32f072-discovery/scripts/Make.defs          |   23 -
 .../stm32f7/nucleo-144/configs/f722-nsh/Make.defs  |   22 -
 .../nucleo-144/configs/f746-evalos/Make.defs       |   23 -
 .../nucleo-144/configs/f746-evalos/defconfig       |    1 -
 .../stm32f7/nucleo-144/configs/f746-nsh/Make.defs  |   23 -
 .../nucleo-144/configs/f767-evalos/Make.defs       |   23 -
 .../nucleo-144/configs/f767-evalos/defconfig       |    1 -
 .../nucleo-144/configs/f767-netnsh/Make.defs       |   23 -
 .../stm32f7/nucleo-144/configs/f767-nsh/Make.defs  |   23 -
 boards/arm/stm32f7/nucleo-144/src/stm32_usb.c      |   66 +-
 boards/arm/stm32f7/stm32f746-ws/scripts/Make.defs  |   23 -
 boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c    |   66 +-
 .../stm32f7/stm32f746g-disco/configs/fb/defconfig  |    1 -
 .../stm32f746g-disco/configs/lvgl/defconfig        |    1 -
 .../stm32f746g-disco/configs/netnsh/defconfig      |    1 -
 .../stm32f7/stm32f746g-disco/configs/nsh/defconfig |    1 -
 .../stm32f746g-disco/configs/nxdemo/defconfig      |    1 -
 .../stm32f746g-disco/configs/nxterm/defconfig      |    1 -
 .../stm32f746g-disco/kernel/stm32_userspace.c      |   12 +-
 .../arm/stm32f7/stm32f746g-disco/scripts/Make.defs |   34 +-
 .../stm32f7/stm32f746g-disco/src/stm32_extmem.c    |   79 +-
 .../stm32f769i-disco/configs/netnsh/defconfig      |    1 -
 .../stm32f7/stm32f769i-disco/configs/nsh/defconfig |    1 -
 .../stm32f769i-disco/kernel/stm32_userspace.c      |   12 +-
 .../arm/stm32f7/stm32f769i-disco/scripts/Make.defs |   23 -
 boards/arm/stm32f7/stm32f769i-disco/src/Makefile   |    4 +
 .../stm32f769i-disco/src/stm32_appinitialize.c     |    1 +
 .../arm/stm32f7/stm32f769i-disco/src/stm32_boot.c  |   33 +-
 .../stm32f7/stm32f769i-disco/src/stm32_extmem.c    |  193 +
 .../stm32f769i-disco/src/stm32f769i-disco.h        |   41 +-
 .../stm32h7/nucleo-h743zi/configs/nsh/defconfig    |    1 -
 .../nucleo-h743zi/configs/nxlines_oled/defconfig   |    1 -
 .../stm32h7/nucleo-h743zi/configs/pwm/defconfig    |    1 -
 .../stm32h7/nucleo-h743zi/kernel/stm32_userspace.c |   12 +-
 boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs |   22 -
 boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c   |   64 +-
 .../stm32h7/stm32h747i-disco/configs/nsh/defconfig |    1 -
 .../stm32h747i-disco/kernel/stm32_userspace.c      |   12 +-
 .../arm/stm32h7/stm32h747i-disco/scripts/Make.defs |   22 -
 .../configs/spirit-6lowpan/defconfig               |    1 -
 .../configs/spirit-starhub/defconfig               |    1 -
 .../configs/spirit-starpoint/defconfig             |    1 -
 .../arm/stm32l4/b-l475e-iot01a/scripts/Make.defs   |   21 -
 .../stm32l4/nucleo-l432kc/configs/nsh/defconfig    |    1 -
 boards/arm/stm32l4/nucleo-l432kc/scripts/Make.defs |   22 -
 .../stm32l4/nucleo-l452re/configs/nsh/defconfig    |    1 -
 boards/arm/stm32l4/nucleo-l452re/scripts/Make.defs |   22 -
 .../stm32l4/nucleo-l476rg/configs/nsh/defconfig    |    1 -
 .../stm32l4/nucleo-l476rg/configs/nxdemo/defconfig |    1 -
 boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs |   36 +-
 .../stm32l4/nucleo-l496zg/configs/nsh/defconfig    |    1 -
 boards/arm/stm32l4/nucleo-l496zg/scripts/Make.defs |   22 -
 boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c   |   69 +-
 boards/arm/stm32l4/stm32l476-mdk/scripts/Make.defs |   22 -
 .../stm32l476vg-disco/configs/knsh/Make.defs       |   22 -
 .../stm32l476vg-disco/configs/knsh/defconfig       |    1 -
 .../stm32l476vg-disco/configs/nsh/defconfig        |    1 -
 .../stm32l476vg-disco/kernel/stm32l4_userspace.c   |   12 +-
 .../stm32l4/stm32l476vg-disco/scripts/Make.defs    |   22 -
 .../arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c  |   56 +-
 .../stm32l4r9ai-disco/configs/knsh/Make.defs       |   22 -
 .../stm32l4r9ai-disco/configs/knsh/defconfig       |    1 -
 .../stm32l4r9ai-disco/configs/nsh/defconfig        |    1 -
 .../stm32l4r9ai-disco/kernel/stm32l4_userspace.c   |    6 +-
 .../stm32l4/stm32l4r9ai-disco/scripts/Make.defs    |   22 -
 .../arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c  |   62 +-
 boards/arm/str71x/olimex-strp711/scripts/Make.defs |   19 -
 boards/arm/tiva/dk-tm4c129x/scripts/Make.defs      |   23 -
 boards/arm/tiva/eagle100/scripts/Make.defs         |   22 -
 boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs     |   23 -
 boards/arm/tiva/launchxl-cc1310/scripts/Make.defs  |   23 -
 .../arm/tiva/launchxl-cc1312r1/scripts/Make.defs   |   23 -
 boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs     |   23 -
 boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c  |   12 +-
 boards/arm/tiva/lm3s6965-ek/scripts/Make.defs      |   23 -
 boards/arm/tiva/lm3s8962-ek/scripts/Make.defs      |   23 -
 .../arm/tiva/lm4f120-launchpad/scripts/Make.defs   |   23 -
 .../arm/tiva/tm4c123g-launchpad/scripts/Make.defs  |   23 -
 .../arm/tiva/tm4c1294-launchpad/scripts/Make.defs  |   23 -
 .../arm/tms570/launchxl-tms57004/scripts/Make.defs |   19 -
 .../tms570/tms570ls31x-usb-kit/scripts/Make.defs   |   18 -
 boards/arm/xmc4/xmc4500-relax/scripts/Make.defs    |   23 -
 boards/arm/xmc4/xmc4700-relax/scripts/Make.defs    |   23 -
 boards/avr/at32uc3/avr32dev1/scripts/Make.defs     |   21 -
 .../at90usb/micropendous3/configs/hello/defconfig  |    3 +-
 boards/avr/at90usb/micropendous3/scripts/Make.defs |   19 -
 .../avr/at90usb/teensy-2.0/configs/hello/defconfig |    3 +-
 .../avr/at90usb/teensy-2.0/configs/nsh/defconfig   |    3 +-
 .../at90usb/teensy-2.0/configs/usbmsc/defconfig    |    5 +-
 boards/avr/at90usb/teensy-2.0/scripts/Make.defs    |   19 -
 boards/avr/atmega/amber/configs/hello/defconfig    |    3 +-
 boards/avr/atmega/amber/scripts/Make.defs          |   19 -
 .../arduino-mega2560/configs/hello/defconfig       |    2 +-
 .../atmega/arduino-mega2560/configs/nsh/defconfig  |    4 +-
 .../avr/atmega/arduino-mega2560/scripts/Make.defs  |   20 -
 boards/avr/atmega/arduino-mega2560/src/Makefile    |   53 +-
 .../atmega/moteino-mega/configs/hello/defconfig    |    2 +-
 .../avr/atmega/moteino-mega/configs/nsh/defconfig  |    2 +-
 boards/avr/atmega/moteino-mega/scripts/Make.defs   |   19 -
 boards/boardctl.c                                  |    1 -
 boards/hc/m9s12/demo9s12ne64/scripts/Make.defs     |   23 -
 boards/hc/m9s12/ne64badge/scripts/Make.defs        |   23 -
 boards/mips/pic32mx/mirtoo/scripts/Make.defs       |   19 -
 .../pic32mx/pic32mx-starterkit/scripts/Make.defs   |   19 -
 .../pic32mx-starterkit/src/pic32mx_appinit.c       |    3 +-
 boards/mips/pic32mx/pic32mx7mmb/scripts/Make.defs  |   19 -
 .../mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c   |    8 +-
 boards/mips/pic32mx/sure-pic32mx/scripts/Make.defs |   19 -
 .../pic32mx/sure-pic32mx/src/pic32mx_appinit.c     |    4 +-
 boards/mips/pic32mx/ubw32/scripts/Make.defs        |   19 -
 .../pic32mz/flipnclick-pic32mz/scripts/Make.defs   |   19 -
 .../pic32mz/pic32mz-starterkit/scripts/Make.defs   |   19 -
 boards/misoc/lm32/misoc/scripts/Make.defs          |   19 -
 boards/or1k/mor1kx/or1k/scripts/Make.defs          |   22 -
 boards/renesas/m16c/skp16c26/scripts/Make.defs     |    7 -
 boards/renesas/m16c/skp16c26/src/Makefile          |   40 +-
 .../renesas/rx65n/rx65n-grrose/scripts/Make.defs   |   10 +-
 boards/renesas/rx65n/rx65n-grrose/src/Makefile     |   43 +-
 .../renesas/rx65n/rx65n-rsk1mb/scripts/Make.defs   |   10 +-
 boards/renesas/rx65n/rx65n-rsk1mb/src/Makefile     |   43 +-
 .../renesas/rx65n/rx65n-rsk2mb/scripts/Make.defs   |   10 +-
 boards/renesas/rx65n/rx65n-rsk2mb/src/Makefile     |   43 +-
 boards/renesas/rx65n/rx65n/scripts/Make.defs       |   20 -
 boards/renesas/rx65n/rx65n/src/Makefile            |   43 +-
 boards/renesas/sh1/us7032evb1/scripts/Make.defs    |    4 -
 boards/renesas/sh1/us7032evb1/src/Makefile         |   39 +-
 .../fe310/hifive1-revb/configs/nsh/defconfig       |    2 +-
 boards/risc-v/fe310/hifive1-revb/scripts/Make.defs |   22 -
 boards/risc-v/gap8/gapuino/scripts/Make.defs       |   23 -
 .../risc-v/k210/maix-bit/kernel/k210_userspace.c   |    2 +-
 boards/risc-v/k210/maix-bit/scripts/Make.defs      |   22 -
 boards/risc-v/litex/arty_a7/scripts/Make.defs      |   22 -
 .../nr5m100/nr5m100-nexys4/configs/nsh/defconfig   |    1 -
 .../nr5m100/nr5m100-nexys4/scripts/Make.defs       |   23 -
 boards/sim/sim/sim/README.txt                      |    2 +-
 boards/sim/sim/sim/configs/cxxtest/Make.defs       |   30 +-
 boards/sim/sim/sim/configs/cxxtest/defconfig       |    2 +-
 boards/sim/sim/sim/scripts/Make.defs               |   27 +-
 boards/x86/qemu/qemu-i486/scripts/Make.defs        |    9 -
 .../intel64/qemu-intel64/configs/nsh/defconfig     |    1 +
 .../intel64/qemu-intel64/configs/ostest/defconfig  |    1 +
 .../x86_64/intel64/qemu-intel64/scripts/Make.defs  |    9 -
 .../xtensa/esp32/esp32-core/configs/nsh/defconfig  |    1 -
 .../xtensa/esp32/esp32-core/configs/smp/defconfig  |    1 -
 boards/xtensa/esp32/esp32-core/scripts/Make.defs   |   20 -
 boards/z16/z16f/z16f2800100zcog/scripts/Make.defs  |   10 -
 boards/z80/ez80/ez80f910200kitg/scripts/Make.defs  |   10 -
 boards/z80/ez80/ez80f910200zco/scripts/Make.defs   |   10 -
 boards/z80/ez80/makerlisp/scripts/Make.defs        |   10 -
 boards/z80/ez80/z20x/scripts/Make.defs             |   10 -
 boards/z80/z180/p112/scripts/Make.defs             |   86 +-
 boards/z80/z8/z8encore000zco/scripts/Make.defs     |   10 -
 boards/z80/z8/z8f64200100kit/scripts/Make.defs     |   10 -
 boards/z80/z80/z80sim/scripts/Make.defs            |   84 +-
 crypto/Makefile                                    |    2 +-
 drivers/Makefile                                   |    2 +-
 drivers/README.txt                                 |    2 +-
 drivers/analog/adc.c                               |   12 +-
 drivers/analog/comp.c                              |   16 +-
 drivers/analog/dac.c                               |   32 +-
 drivers/analog/lmp92001.c                          |   10 +-
 drivers/analog/opamp.c                             |   12 +-
 drivers/audio/cs43l22.c                            |    2 +-
 drivers/audio/cxd56.c                              |   60 +-
 drivers/audio/tone.c                               |   18 +-
 drivers/audio/vs1053.c                             |    2 +-
 drivers/audio/wm8776.c                             |   41 +-
 drivers/audio/wm8776.h                             |   41 +-
 drivers/audio/wm8904.c                             |    2 +-
 drivers/can/Kconfig                                |    6 +
 drivers/can/can.c                                  |  134 +-
 drivers/eeprom/spi_xx25xx.c                        |    1 +
 drivers/ioexpander/gpio.c                          |   14 +-
 drivers/ioexpander/gpio_lower_half.c               |   26 +-
 drivers/ioexpander/pca9538.c                       |    6 +
 drivers/ioexpander/pca9555.c                       |    6 +
 drivers/ioexpander/pcf8574.c                       |   10 +-
 drivers/ioexpander/skeleton.c                      |   14 +-
 drivers/ioexpander/tca64xx.c                       |   10 +-
 drivers/lcd/Kconfig                                |   33 +-
 drivers/lcd/Make.defs                              |    5 +
 drivers/lcd/lcd_framebuffer.c                      |   22 +-
 drivers/lcd/st7735.c                               |  680 ++++
 drivers/lcd/st7735.h                               |   53 +
 drivers/leds/ncp5623c.c                            |   10 +-
 drivers/leds/pca9635pw.c                           |   43 +-
 drivers/mmcsd/mmcsd_sdio.c                         |   14 +-
 drivers/modem/altair/Kconfig                       |   10 +-
 drivers/modem/altair/altmdm.c                      |    4 +-
 drivers/modem/altair/altmdm_dev.h                  |    5 +-
 drivers/modem/altair/altmdm_pm.c                   | 1132 +-----
 drivers/modem/altair/altmdm_pm.h                   |   16 +-
 drivers/modem/altair/altmdm_spi.c                  |  217 +-
 drivers/rwbuffer.c                                 |  213 +-
 drivers/sensors/Kconfig                            |    5 +
 drivers/sensors/Make.defs                          |    8 +-
 drivers/sensors/bmp280.c                           |   33 +-
 drivers/sensors/mpu60x0.c                          |   92 +-
 drivers/spi/spi_bitbang.c                          |   14 +-
 drivers/syslog/Kconfig                             |    7 +
 drivers/syslog/note_driver.c                       |   40 +-
 drivers/syslog/ramlog.c                            |   10 +
 drivers/timers/ds3231.c                            |    9 -
 drivers/timers/mcp794xx.c                          |    9 -
 drivers/timers/pcf85263.c                          |    9 -
 drivers/usbdev/pl2303.c                            |  318 +-
 drivers/usbhost/Kconfig                            |   10 +
 drivers/usbhost/Make.defs                          |    4 +
 drivers/usbhost/usbhost_cdcmbim.c                  | 2566 +++++++++++++
 drivers/video/fb.c                                 |   32 +-
 drivers/video/video.c                              |   15 +-
 drivers/wireless/Kconfig                           |    1 +
 drivers/wireless/gs2200m.c                         |   18 +-
 fs/Makefile                                        |    2 +-
 fs/binfs/fs_binfs.c                                |   15 +-
 fs/cromfs/cromfs.h                                 |    6 +-
 fs/cromfs/fs_cromfs.c                              |   84 +-
 fs/dirent/fs_readdir.c                             |   32 +-
 fs/driver/fs_blockpartition.c                      |    8 +-
 fs/inode/inode.h                                   |    9 +-
 fs/littlefs/lfs_vfs.c                              |    5 +-
 fs/mount/fs_automount.c                            |    2 +-
 fs/mount/fs_foreachmountpoint.c                    |    2 +-
 fs/mount/fs_procfs_mount.c                         |   15 +-
 fs/nfs/nfs_vfsops.c                                |   34 +-
 fs/nxffs/nxffs.h                                   |   46 +-
 fs/nxffs/nxffs_initialize.c                        |   34 +-
 fs/partition/fs_partition.c                        |    5 +-
 fs/procfs/Make.defs                                |    5 -
 fs/procfs/fs_procfscpuload.c                       |   11 +-
 fs/procfs/fs_procfscritmon.c                       |    5 +-
 fs/procfs/fs_procfsproc.c                          |    1 -
 fs/procfs/fs_procfsuptime.c                        |    1 -
 fs/procfs/fs_procfsversion.c                       |   18 +-
 fs/procfs/fs_skeleton.c                            |    1 -
 fs/romfs/fs_romfs.c                                |   18 +-
 fs/romfs/fs_romfs.h                                |    5 +
 fs/smartfs/smartfs_procfs.c                        |   65 +-
 fs/smartfs/smartfs_smart.c                         |   14 +-
 fs/spiffs/src/spiffs_check.c                       |  500 +--
 fs/spiffs/src/spiffs_gc.c                          |  224 +-
 fs/tmpfs/fs_tmpfs.h                                |    5 +-
 fs/unionfs/fs_unionfs.c                            |    8 +-
 fs/userfs/fs_userfs.c                              |   15 +-
 fs/vfs/Make.defs                                   |    2 +-
 fs/vfs/fs_fcntl.c                                  |    2 +
 fs/vfs/fs_fstat.c                                  |    2 +-
 fs/vfs/fs_link.c                                   |  186 -
 fs/vfs/fs_open.c                                   |    7 +-
 fs/vfs/fs_stat.c                                   |   96 +-
 fs/vfs/fs_symlink.c                                |  186 +
 fs/vfs/fs_write.c                                  |    9 +-
 graphics/Kconfig                                   |    2 +-
 graphics/Makefile                                  |    2 +-
 graphics/nxmu/nxmu_start.c                         |    4 +-
 include/assert.h                                   |   13 +-
 include/ctype.h                                    |   30 +-
 include/cxx/cmath                                  |    3 +
 include/cxx/cstddef                                |    8 -
 include/cxx/cstdlib                                |   10 +-
 include/cxx/cstring                                |    5 -
 include/cxx/cunistd                                |    6 +-
 include/dirent.h                                   |   59 +-
 include/ftw.h                                      |  215 ++
 include/locale.h                                   |   31 +-
 include/malloc.h                                   |   63 +
 include/net/if.h                                   |   51 +-
 include/netpacket/can.h                            |  144 +
 include/nuttx/analog/adc.h                         |   26 +-
 include/nuttx/analog/comp.h                        |   14 +-
 include/nuttx/analog/dac.h                         |   12 +-
 include/nuttx/analog/opamp.h                       |    4 +-
 include/nuttx/arch.h                               |   76 +-
 include/nuttx/audio/wm8776.h                       |   39 +-
 include/nuttx/can.h                                |  319 ++
 include/nuttx/can/can.h                            |   29 +-
 include/nuttx/can/error.h                          |  129 +
 include/nuttx/compiler.h                           |   26 +-
 include/nuttx/drivers/rwbuffer.h                   |    1 -
 include/nuttx/fs/fs.h                              |    4 +-
 include/nuttx/fs/hostfs.h                          |   60 +-
 include/nuttx/fs/userfs.h                          |   10 +-
 include/nuttx/input/djoystick.h                    |   24 +-
 include/nuttx/ioexpander/gpio.h                    |    9 +-
 include/nuttx/ioexpander/ioexpander.h              |   18 +-
 include/nuttx/irq.h                                |    8 +-
 include/nuttx/kmalloc.h                            |    1 +
 include/nuttx/kthread.h                            |   10 +-
 include/nuttx/lcd/st7735.h                         |   72 +
 include/nuttx/leds/pca9635pw.h                     |   23 +-
 include/nuttx/lib/math.h                           |   13 +
 include/nuttx/mm/iob.h                             |   10 +-
 include/nuttx/modem/altmdm.h                       |   21 +-
 include/nuttx/net/can.h                            |  122 +
 include/nuttx/net/ioctl.h                          |    8 +
 include/nuttx/net/net.h                            |   32 +-
 include/nuttx/net/usrsock.h                        |    2 +
 include/nuttx/sched.h                              |   72 +-
 include/nuttx/sched_note.h                         |  145 +-
 include/nuttx/semaphore.h                          |   84 +-
 include/nuttx/sensors/bmp280.h                     |   11 +
 include/nuttx/sensors/mpu60x0.h                    |   24 +-
 include/nuttx/spi/spi_bitbang.c                    |   63 +-
 include/nuttx/syslog/note_driver.h                 |   69 +
 include/nuttx/usb/cdc.h                            |  265 +-
 include/nuttx/userspace.h                          |   24 +-
 include/nuttx/video/fb.h                           |   23 +-
 include/nuttx/video/video.h                        |    5 +-
 include/nuttx/wqueue.h                             |    3 +-
 include/pthread.h                                  |   22 +-
 include/semaphore.h                                |    7 +-
 include/stdio.h                                    |   17 +-
 include/stdlib.h                                   |   90 +-
 include/strings.h                                  |   48 +-
 include/sys/prctl.h                                |   37 +-
 include/sys/socket.h                               |   33 +-
 include/sys/stat.h                                 |   69 +-
 include/sys/statvfs.h                              |   84 +
 include/sys/syscall.h                              |   19 +-
 include/sys/syscall_lookup.h                       |    8 +-
 include/sys/time.h                                 |   40 +-
 include/sys/types.h                                |   29 +-
 include/time.h                                     |   21 +-
 include/unistd.h                                   |   43 +-
 include/uuid.h                                     |  108 +
 libs/libc/Makefile                                 |    4 +-
 libs/libc/assert/Make.defs                         |   26 +
 libs/libc/assert/lib_assert.c                      |   38 +
 libs/libc/dirent/lib_scandir.c                     |   36 +-
 libs/libc/dlfcn/lib_dlopen.c                       |    6 +-
 libs/libc/grp/lib_getgrbuf.c                       |    9 +-
 libs/libc/hex2bin/lib_hex2bin.c                    |    6 +-
 libs/libc/locale/Make.defs                         |    3 +-
 libs/libc/locale/lib_duplocale.c                   |   47 +
 libs/libc/locale/lib_freelocale.c                  |   46 +
 libs/libc/locale/lib_newlocale.c                   |   49 +
 libs/libc/locale/lib_uselocale.c                   |   47 +
 libs/libc/machine/arm/Make.defs                    |    7 +
 libs/libc/machine/arm/gnu_unwind_find_exidx.c      |  121 +
 libs/libc/machine/risc-v/Make.defs                 |    4 +
 libs/libc/machine/risc-v/rv32/Kconfig              |   10 +
 libs/libc/machine/risc-v/rv32/Make.defs            |   29 +
 libs/libc/machine/risc-v/rv32/arch_memcpy.S        |  130 +
 libs/libc/machine/risc-v/rv64/arch_elf.c           |    2 +-
 libs/libc/math/lib_libsqrtapprox.c                 |   13 +-
 libs/libc/misc/lib_utsname.c                       |   20 +-
 libs/libc/net/lib_inetaddr.c                       |    7 +-
 libs/libc/net/lib_recvmsg.c                        |    7 +-
 libs/libc/net/lib_sendmsg.c                        |    4 +-
 libs/libc/pthread/Make.defs                        |    2 +-
 libs/libc/pthread/pthread_condtimedwait.c          |   57 +
 libs/libc/pthread/pthread_rwlock_rdlock.c          |   13 +-
 libs/libc/pthread/pthread_rwlock_wrlock.c          |   13 +-
 libs/libc/pwd/lib_getpwbuf.c                       |   12 +-
 libs/libc/sched/Make.defs                          |    2 +-
 libs/libc/sched/task_startup.c                     |   98 +-
 libs/libc/semaphore/sem_getvalue.c                 |    8 +-
 libs/libc/stdio/Make.defs                          |   17 +-
 libs/libc/stdio/legacy_dtoa.c                      |   60 +-
 libs/libc/stdio/legacy_libvsprintf.c               |   39 +-
 libs/libc/stdio/lib_dtoa_data.c                    |    5 +-
 libs/libc/stdio/lib_dtoa_engine.c                  |    3 -
 libs/libc/stdio/lib_dtoa_engine.h                  |    4 +-
 libs/libc/stdio/lib_fseeko.c                       |   34 +
 libs/libc/stdio/lib_ftello.c                       |   34 +
 libs/libc/stdio/lib_getc.c                         |   34 +
 libs/libc/stdio/lib_getchar.c                      |   34 +
 libs/libc/stdio/lib_libdtoa.c                      |    1 -
 libs/libc/stdio/lib_libvscanf.c                    |    4 +-
 libs/libc/stdio/lib_libvsprintf.c                  |    1 -
 libs/libc/stdio/lib_putc.c                         |   34 +
 libs/libc/stdio/lib_putchar.c                      |   34 +
 libs/libc/stdio/lib_rewind.c                       |   53 +
 libs/libc/stdio/lib_tempnam.c                      |    4 +-
 libs/libc/stdio/lib_vasprintf.c                    |    9 +-
 libs/libc/stdlib/Make.defs                         |   12 +-
 libs/libc/stdlib/lib_Exit.c                        |   35 +
 libs/libc/stdlib/lib_aligned_alloc.c               |   34 +
 libs/libc/stdlib/lib_atof.c                        |   36 +
 libs/libc/stdlib/lib_atoi.c                        |   34 +
 libs/libc/stdlib/lib_atol.c                        |   34 +
 libs/libc/stdlib/lib_atoll.c                       |   36 +
 libs/libc/stdlib/lib_mkstemp.c                     |   13 +-
 libs/libc/stdlib/lib_posix_memalign.c              |   36 +
 libs/libc/stdlib/lib_realpath.c                    |  237 ++
 libs/libc/stdlib/lib_srand.c                       |   16 +-
 libs/libc/termios/lib_cfmakeraw.c                  |   43 +-
 libs/libc/time/Make.defs                           |    2 +-
 libs/libc/time/lib_ctime.c                         |    4 -
 libs/libc/time/lib_ctimer.c                        |    4 -
 libs/libc/time/lib_gmtime.c                        |   11 +-
 libs/libc/time/lib_gmtimer.c                       |   19 +-
 libs/libc/time/lib_localtime.c                     |   14 +-
 libs/libc/time/lib_timespec_get.c                  |   41 +
 libs/libc/unistd/Make.defs                         |    4 +-
 libs/libc/unistd/lib_execl.c                       |   12 +-
 libs/libc/unistd/lib_fstatvfs.c                    |   73 +
 libs/libc/unistd/lib_gethostname.c                 |   42 +-
 libs/libc/unistd/lib_pathconf.c                    |  132 +
 libs/libc/unistd/lib_statvfs.c                     |   73 +
 libs/libc/unistd/lib_sysconf.c                     |   16 +
 libs/libc/userfs/lib_userfs.c                      |   88 +-
 libs/libc/uuid/Make.defs                           |   28 +
 libs/libc/uuid/lib_uuid_compare.c                  |   92 +
 libs/libc/uuid/lib_uuid_create.c                   |   70 +
 libs/libc/uuid/lib_uuid_create_nil.c               |   51 +
 libs/libc/uuid/lib_uuid_equal.c                    |   70 +
 libs/libc/uuid/lib_uuid_from_string.c              |  113 +
 libs/libc/uuid/lib_uuid_hash.c                     |   54 +
 libs/libc/uuid/lib_uuid_is_nil.c                   |   58 +
 libs/libc/uuid/lib_uuid_stream.c                   |   79 +
 libs/libc/uuid/lib_uuid_to_string.c                |   75 +
 libs/libc/zoneinfo/Makefile                        |    2 +-
 libs/libdsp/Makefile                               |    2 +-
 libs/libnx/Makefile                                |    2 +-
 libs/libxx/.gitignore                              |    1 +
 libs/libxx/Kconfig                                 |   51 +-
 libs/libxx/Makefile                                |   31 +-
 libs/libxx/cxx.defs                                |   24 +
 libs/libxx/libxx.hxx                               |    2 +-
 libs/libxx/libxx__gnu_unwind_find_exidx.cxx        |  108 -
 libs/libxx/libxx__gnu_unwind_find_exidx.hxx        |   79 -
 libs/libxx/libxx_cxa_atexit.cxx                    |    2 +-
 libs/libxx/system_configuration.h                  |  104 +
 libs/libxx/uClibc++.defs                           |   48 +
 mm/Makefile                                        |    2 +-
 mm/kmm_heap/kmm_mallinfo.c                         |    2 +-
 mm/mm_heap/mm_mallinfo.c                           |    2 +-
 mm/mm_heap/mm_realloc.c                            |   25 +-
 mm/umm_heap/umm_mallinfo.c                         |    2 +-
 net/Kconfig                                        |   23 +-
 net/Makefile                                       |    3 +-
 net/bluetooth/bluetooth_sockif.c                   |   38 +-
 net/can/Kconfig                                    |   97 +
 net/can/Make.defs                                  |   48 +
 net/can/can.h                                      |  448 +++
 net/can/can_callback.c                             |  242 ++
 net/can/can_conn.c                                 |  223 ++
 net/can/can_getsockopt.c                           |  222 ++
 net/can/can_input.c                                |  204 ++
 net/can/can_notifier.c                             |   83 +
 net/can/can_poll.c                                 |   88 +
 net/can/can_recvfrom.c                             |  846 +++++
 net/can/can_send.c                                 |  441 +++
 net/can/can_setsockopt.c                           |  179 +
 net/can/can_sockif.c                               |  856 +++++
 net/devif/Make.defs                                |    4 +
 net/devif/devif.h                                  |  112 +-
 net/devif/devif_cansend.c                          |  113 +
 net/devif/devif_poll.c                             |   48 +
 net/icmp/icmp_sockif.c                             |   18 +-
 net/icmpv6/icmpv6_sockif.c                         |   32 +-
 net/ieee802154/ieee802154_sockif.c                 |   49 +-
 net/igmp/igmp_timer.c                              |    4 +-
 net/inet/inet_sockif.c                             |    4 +
 net/local/local_sendpacket.c                       |    1 +
 net/local/local_sockif.c                           |   14 +-
 net/net_initialize.c                               |    7 +
 net/netdev/Kconfig                                 |    8 +
 net/netdev/netdev_ioctl.c                          |   48 +
 net/netdev/netdev_register.c                       |   21 +
 net/netlink/netlink_sockif.c                       |    4 +
 net/pkt/pkt_sockif.c                               |    4 +
 net/procfs/net_procfs.c                            |   10 +-
 net/procfs/net_procfs_route.c                      |   17 +-
 net/socket/Kconfig                                 |   24 +
 net/socket/Make.defs                               |    6 +
 net/socket/getpeername.c                           |   23 +-
 net/socket/getsockname.c                           |   13 +-
 net/socket/getsockopt.c                            |   34 +-
 net/socket/net_sockif.c                            |    7 +
 net/socket/net_vfcntl.c                            |   25 +-
 net/socket/recvfrom.c                              |   22 +-
 net/socket/recvmsg.c                               |  244 ++
 net/socket/send.c                                  |    5 +-
 net/socket/sendmsg.c                               |  243 ++
 net/socket/sendto.c                                |    5 +-
 net/socket/setsockopt.c                            |   38 +-
 net/socket/socket.h                                |    2 +-
 net/usrsock/Kconfig                                |   11 +
 net/usrsock/usrsock_recvfrom.c                     |   12 +-
 net/usrsock/usrsock_sendto.c                       |    9 +-
 net/utils/net_lock.c                               |   51 +
 openamp/Makefile                                   |    2 +-
 pass1/Makefile                                     |    2 +-
 sched/Kconfig                                      |   34 +-
 sched/Makefile                                     |    2 +-
 sched/group/group.h                                |    2 +-
 sched/group/group_killchildren.c                   |    6 +-
 sched/init/init.h                                  |   19 -
 sched/init/nx_smpstart.c                           |   32 +-
 sched/init/nx_start.c                              |   13 +-
 sched/irq/irq_dispatch.c                           |   13 +
 sched/irq/irq_spinlock.c                           |   43 +-
 sched/pthread/Make.defs                            |    2 +-
 sched/pthread/pthread.h                            |    4 +-
 sched/pthread/pthread_cancel.c                     |   58 +-
 sched/pthread/pthread_cleanup.c                    |   97 +-
 sched/pthread/pthread_condclockwait.c              |  371 ++
 sched/pthread/pthread_condtimedwait.c              |  369 --
 sched/pthread/pthread_exit.c                       |    7 +-
 sched/pthread/pthread_mutex.c                      |   84 +-
 sched/pthread/pthread_mutexinconsistent.c          |    4 +-
 sched/sched/sched_note.c                           |  103 +-
 sched/sched/sched_releasetcb.c                     |   24 +-
 sched/sched/sched_tasklistlock.c                   |   39 +-
 sched/sched/sched_thistask.c                       |   40 +-
 sched/sched/sched_waitid.c                         |   16 +
 sched/sched/sched_waitpid.c                        |    6 +
 sched/semaphore/Make.defs                          |    4 +-
 sched/semaphore/sem_clockwait.c                    |  299 ++
 sched/semaphore/sem_timedwait.c                    |  155 +-
 sched/signal/sig_default.c                         |   55 +-
 sched/task/Make.defs                               |    6 +-
 sched/task/exit.c                                  |   17 +-
 sched/task/task.h                                  |    4 +-
 sched/task/task_cancelpt.c                         |   98 +-
 sched/task/task_create.c                           |   69 +-
 sched/task/task_delete.c                           |   59 +-
 sched/task/task_init.c                             |   84 +-
 sched/task/task_prctl.c                            |   12 +-
 sched/task/task_restart.c                          |    2 +-
 sched/task/task_setcancelstate.c                   |   13 +-
 sched/task/task_start.c                            |    7 +-
 syscall/.gitignore                                 |    1 +
 syscall/Makefile                                   |   40 +-
 syscall/syscall.csv                                |   10 +-
 syscall/syscall_funclookup.c                       |  108 -
 syscall/syscall_names.c                            |   48 +
 syscall/syscall_nparms.c                           |   67 -
 syscall/syscall_wraps.h                            |   37 +
 syscall/{stubs => wraps}/.gitignore                |    0
 syscall/wraps/Make.defs                            |   21 +
 tools/Config.mk                                    |   41 +
 tools/Directories.mk                               |    5 +
 tools/FlatLibs.mk                                  |    6 +
 tools/KernelLibs.mk                                |    6 +
 tools/LibTargets.mk                                |    6 +
 tools/Makefile.export                              |   54 +-
 tools/Makefile.host                                |   28 -
 tools/Makefile.unix                                |   11 +-
 tools/Makefile.win                                 |    3 +-
 tools/ProtectedLibs.mk                             |    6 +
 tools/checkrelease.sh                              |  217 ++
 tools/configure.c                                  |   20 +-
 tools/cxd56/clefia.c                               |    6 +-
 tools/cxd56/clefia.h                               |    2 +-
 tools/cxd56/elf32.h                                |  175 +
 tools/cxd56/mkspk.c                                |    4 +-
 tools/cxd56/mkspk.h                                |   14 +-
 tools/incdir.c                                     |   13 +-
 tools/mkexport.sh                                  |   98 +-
 tools/mksyscall.c                                  |  314 +-
 tools/nxstyle.c                                    |   28 +-
 tools/sethost.sh                                   |    6 +-
 tools/testbuild.sh                                 |    2 +-
 tools/version.sh                                   |    8 +-
 tools/zds/Makefile                                 |   27 -
 tools/zipme.sh                                     |   12 +-
 video/Makefile                                     |    2 +-
 wireless/Makefile                                  |    2 +-
 wireless/bluetooth/bt_atomic.c                     |   21 -
 wireless/bluetooth/bt_atomic.h                     |   37 +-
 1395 files changed, 65122 insertions(+), 22126 deletions(-)
 create mode 100644 README.md
 delete mode 100644 README.txt
 create mode 100644 arch/arm/include/eoss3/chip.h
 create mode 100644 arch/arm/include/eoss3/irq.h
 create mode 100644 arch/arm/src/cxd56xx/hardware/cxd5602_isop_hadc0_highspeed.h
 create mode 100644 arch/arm/src/eoss3/Kconfig
 create mode 100644 arch/arm/src/eoss3/Make.defs
 create mode 100644 arch/arm/src/eoss3/chip.h
 create mode 100644 arch/arm/src/eoss3/eoss3.h
 create mode 100644 arch/arm/src/eoss3/eoss3_clockconfig.c
 create mode 100644 arch/arm/src/eoss3/eoss3_clockconfig.h
 create mode 100644 arch/arm/src/eoss3/eoss3_gpio.c
 create mode 100644 arch/arm/src/eoss3/eoss3_gpio.h
 create mode 100644 arch/arm/src/eoss3/eoss3_idle.c
 create mode 100644 arch/arm/src/eoss3/eoss3_irq.c
 create mode 100644 arch/arm/src/eoss3/eoss3_lowputc.c
 create mode 100644 arch/arm/src/eoss3/eoss3_lowputc.h
 create mode 100644 arch/arm/src/eoss3/eoss3_serial.c
 create mode 100644 arch/arm/src/eoss3/eoss3_start.c
 create mode 100644 arch/arm/src/eoss3/eoss3_start.h
 create mode 100644 arch/arm/src/eoss3/eoss3_timerisr.c
 create mode 100644 arch/arm/src/eoss3/hardware/eoss3_clock.h
 create mode 100644 arch/arm/src/eoss3/hardware/eoss3_intr.h
 create mode 100644 arch/arm/src/eoss3/hardware/eoss3_iomux.h
 create mode 100644 arch/arm/src/eoss3/hardware/eoss3_memorymap.h
 create mode 100644 arch/arm/src/eoss3/hardware/eoss3_uart.h
 create mode 100644 arch/arm/src/kinetis/kinetis_flexcan.c
 create mode 100644 arch/arm/src/nrf52/hardware/nrf52_rtc.h
 create mode 100644 arch/arm/src/nrf52/nrf52_rtc.c
 create mode 100644 arch/arm/src/nrf52/nrf52_rtc.h
 create mode 100644 arch/arm/src/nrf52/nrf52_tim.c
 create mode 100644 arch/arm/src/nrf52/nrf52_tim.h
 create mode 100644 arch/arm/src/nrf52/nrf52_tim_lowerhalf.c
 create mode 100644 arch/arm/src/nrf52/nrf52_tim_lowerhalf.h
 create mode 100644 arch/arm/src/s32k1xx/hardware/s32k1xx_ftfc.h
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_eeeprom.c
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_eeeprom.h
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_flexcan.c
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_flexcan.h
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_progmem.c
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_progmem.h
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_pwm.c
 create mode 100644 arch/arm/src/s32k1xx/s32k1xx_pwm.h
 create mode 100644 arch/arm/src/sama5/hardware/sam_rstc.h
 create mode 100644 arch/arm/src/sama5/hardware/sam_sdmmc.h
 create mode 100644 arch/arm/src/sama5/hardware/sama5d2_sdmmc.h
 create mode 100644 arch/arm/src/sama5/sam_sdmmc.c
 create mode 100644 arch/arm/src/sama5/sam_sdmmc.h
 create mode 100644 arch/arm/src/sama5/sam_systemreset.c
 create mode 100644 arch/arm/src/stm32f7/hardware/stm32_fmc.h
 create mode 100644 arch/arm/src/stm32f7/stm32_fmc.c
 create mode 100644 arch/arm/src/stm32l4/stm32l4_dfumode.c
 create mode 100644 arch/arm/src/stm32l4/stm32l4_dfumode.h
 create mode 100644 arch/risc-v/src/rv32im/riscv_schedulesigaction.c
 delete mode 100644 arch/sim/src/nuttx-names.dat
 create mode 100644 arch/sim/src/nuttx-names.in
 delete mode 100644 arch/sim/src/sim/up_shmem.c
 create mode 100644 arch/xtensa/src/esp32/esp32_i2c.c
 create mode 100644 arch/xtensa/src/esp32/esp32_i2c.h
 create mode 100644 arch/xtensa/src/esp32/esp32_spi.c
 create mode 100644 arch/xtensa/src/esp32/esp32_spi.h
 create mode 100644 arch/xtensa/src/esp32/esp32_spi_slave.c
 create mode 100644 arch/xtensa/src/esp32/hardware/esp32_i2c.h
 create mode 100644 arch/xtensa/src/esp32/hardware/esp32_spi.h
 create mode 100644 arch/z80/src/ez80/.gitignore
 create mode 100644 arch/z80/src/z180/.gitignore
 create mode 100644 arch/z80/src/z80/.gitignore
 delete mode 100644 boards/arm/cxd56xx/common/src/cxd56_altmdm_spi.c
 create mode 100644 boards/arm/cxd56xx/common/src/cxd56_bcm20706.c
 create mode 100644 boards/arm/cxd56xx/common/src/cxd56_emmcdev.c
 create mode 100644 boards/arm/cxd56xx/common/src/cxd56_spidev.c
 create mode 100644 boards/arm/cxd56xx/common/src/cxd56_spisd.c
 mode change 100644 => 100755 boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h
 create mode 100644 boards/arm/cxd56xx/spresense/configs/example_camera/defconfig
 create mode 100644 boards/arm/cxd56xx/spresense/include/cxd56_bcm20706.h
 create mode 100644 boards/arm/cxd56xx/spresense/include/cxd56_emmcdev.h
 create mode 100644 boards/arm/cxd56xx/spresense/include/cxd56_spidev.h
 create mode 100644 boards/arm/cxd56xx/spresense/include/cxd56_spisd.h
 create mode 100644 boards/arm/cxd56xx/spresense/src/cxd56_altmdm_power.c
 create mode 100644 boards/arm/eoss3/quickfeather/Kconfig
 create mode 100644 boards/arm/eoss3/quickfeather/README.txt
 create mode 100644 boards/arm/eoss3/quickfeather/configs/nsh/defconfig
 create mode 100644 boards/arm/eoss3/quickfeather/include/board.h
 create mode 100644 boards/arm/eoss3/quickfeather/scripts/Make.defs
 create mode 100644 boards/arm/eoss3/quickfeather/scripts/ld.script
 create mode 100644 boards/arm/eoss3/quickfeather/scripts/quicknuttx.resc
 create mode 100644 boards/arm/eoss3/quickfeather/src/Makefile
 create mode 100644 boards/arm/eoss3/quickfeather/src/eoss3_appinit.c
 create mode 100644 boards/arm/eoss3/quickfeather/src/eoss3_autoleds.c
 create mode 100644 boards/arm/eoss3/quickfeather/src/eoss3_boot.c
 create mode 100644 boards/arm/eoss3/quickfeather/src/eoss3_bringup.c
 create mode 100644 boards/arm/eoss3/quickfeather/src/quickfeather.h
 create mode 100644 boards/arm/kinetis/freedom-k28f/configs/nshsdusb/defconfig
 create mode 100644 boards/arm/nrf52/nrf52840-dk/configs/highpri/defconfig
 create mode 100644 boards/arm/nrf52/nrf52840-dk/configs/timer/defconfig
 create mode 100644 boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c
 create mode 100644 boards/arm/nrf52/nrf52840-dk/src/nrf52_timer.c
 create mode 100644 boards/arm/sama5/sama5d2-xult/configs/sdmmcnsh/defconfig
 delete mode 100644 boards/arm/sama5/sama5d2-xult/src/sam_hsmci.c
 create mode 100644 boards/arm/sama5/sama5d2-xult/src/sam_reset.c
 create mode 100644 boards/arm/sama5/sama5d2-xult/src/sam_sdmmc.c
 create mode 100644 boards/arm/stm32/nucleo-f412zg/Kconfig
 create mode 100644 boards/arm/stm32/nucleo-f412zg/README.txt
 create mode 100644 boards/arm/stm32/nucleo-f412zg/configs/nsh/defconfig
 create mode 100644 boards/arm/stm32/nucleo-f412zg/include/board.h
 create mode 100644 boards/arm/stm32/nucleo-f412zg/scripts/Make.defs
 create mode 100644 boards/arm/stm32/nucleo-f412zg/scripts/f412zg.ld
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/Make.defs
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/nucleo-f412zg.h
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/stm32_appinit.c
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/stm32_autoleds.c
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/stm32_boot.c
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/stm32_bringup.c
 create mode 100644 boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c
 create mode 100644 boards/arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c
 create mode 100644 boards/arm/stm32/olimex-stm32-p407/src/stm32_spi.c
 create mode 100644 boards/arm/stm32/olimex-stm32-p407/src/stm32_st7735.c
 delete mode 100644 boards/arm/stm32/stm32f4discovery/configs/elf/Make.defs
 delete mode 100644 boards/arm/stm32/stm32f4discovery/configs/posix_spawn/Make.defs
 create mode 100644 boards/arm/stm32f7/stm32f769i-disco/src/stm32_extmem.c
 create mode 100644 drivers/lcd/st7735.c
 create mode 100644 drivers/lcd/st7735.h
 create mode 100644 drivers/usbhost/usbhost_cdcmbim.c
 delete mode 100644 fs/vfs/fs_link.c
 create mode 100644 fs/vfs/fs_symlink.c
 create mode 100644 include/ftw.h
 create mode 100644 include/malloc.h
 create mode 100644 include/netpacket/can.h
 create mode 100644 include/nuttx/can.h
 create mode 100644 include/nuttx/can/error.h
 create mode 100644 include/nuttx/lcd/st7735.h
 create mode 100644 include/nuttx/net/can.h
 create mode 100644 include/nuttx/syslog/note_driver.h
 create mode 100644 include/sys/statvfs.h
 create mode 100644 include/uuid.h
 create mode 100644 libs/libc/assert/Make.defs
 create mode 100644 libs/libc/assert/lib_assert.c
 create mode 100644 libs/libc/locale/lib_duplocale.c
 create mode 100644 libs/libc/locale/lib_freelocale.c
 create mode 100644 libs/libc/locale/lib_newlocale.c
 create mode 100644 libs/libc/locale/lib_uselocale.c
 create mode 100644 libs/libc/machine/arm/gnu_unwind_find_exidx.c
 create mode 100644 libs/libc/machine/risc-v/rv32/Kconfig
 create mode 100644 libs/libc/machine/risc-v/rv32/Make.defs
 create mode 100644 libs/libc/machine/risc-v/rv32/arch_memcpy.S
 create mode 100644 libs/libc/pthread/pthread_condtimedwait.c
 create mode 100644 libs/libc/stdio/lib_fseeko.c
 create mode 100644 libs/libc/stdio/lib_ftello.c
 create mode 100644 libs/libc/stdio/lib_getc.c
 create mode 100644 libs/libc/stdio/lib_getchar.c
 create mode 100644 libs/libc/stdio/lib_putc.c
 create mode 100644 libs/libc/stdio/lib_putchar.c
 create mode 100644 libs/libc/stdio/lib_rewind.c
 create mode 100644 libs/libc/stdlib/lib_Exit.c
 create mode 100644 libs/libc/stdlib/lib_aligned_alloc.c
 create mode 100644 libs/libc/stdlib/lib_atof.c
 create mode 100644 libs/libc/stdlib/lib_atoi.c
 create mode 100644 libs/libc/stdlib/lib_atol.c
 create mode 100644 libs/libc/stdlib/lib_atoll.c
 create mode 100644 libs/libc/stdlib/lib_posix_memalign.c
 create mode 100644 libs/libc/stdlib/lib_realpath.c
 create mode 100644 libs/libc/time/lib_timespec_get.c
 create mode 100644 libs/libc/unistd/lib_fstatvfs.c
 create mode 100644 libs/libc/unistd/lib_pathconf.c
 create mode 100644 libs/libc/unistd/lib_statvfs.c
 create mode 100644 libs/libc/uuid/Make.defs
 create mode 100644 libs/libc/uuid/lib_uuid_compare.c
 create mode 100644 libs/libc/uuid/lib_uuid_create.c
 create mode 100644 libs/libc/uuid/lib_uuid_create_nil.c
 create mode 100644 libs/libc/uuid/lib_uuid_equal.c
 create mode 100644 libs/libc/uuid/lib_uuid_from_string.c
 create mode 100644 libs/libc/uuid/lib_uuid_hash.c
 create mode 100644 libs/libc/uuid/lib_uuid_is_nil.c
 create mode 100644 libs/libc/uuid/lib_uuid_stream.c
 create mode 100644 libs/libc/uuid/lib_uuid_to_string.c
 create mode 100644 libs/libxx/cxx.defs
 delete mode 100644 libs/libxx/libxx__gnu_unwind_find_exidx.cxx
 delete mode 100644 libs/libxx/libxx__gnu_unwind_find_exidx.hxx
 create mode 100644 libs/libxx/system_configuration.h
 create mode 100644 libs/libxx/uClibc++.defs
 create mode 100644 net/can/Kconfig
 create mode 100644 net/can/Make.defs
 create mode 100644 net/can/can.h
 create mode 100644 net/can/can_callback.c
 create mode 100644 net/can/can_conn.c
 create mode 100644 net/can/can_getsockopt.c
 create mode 100644 net/can/can_input.c
 create mode 100644 net/can/can_notifier.c
 create mode 100644 net/can/can_poll.c
 create mode 100644 net/can/can_recvfrom.c
 create mode 100644 net/can/can_send.c
 create mode 100644 net/can/can_setsockopt.c
 create mode 100644 net/can/can_sockif.c
 create mode 100644 net/devif/devif_cansend.c
 create mode 100644 net/socket/recvmsg.c
 create mode 100644 net/socket/sendmsg.c
 create mode 100644 sched/pthread/pthread_condclockwait.c
 delete mode 100644 sched/pthread/pthread_condtimedwait.c
 create mode 100644 sched/semaphore/sem_clockwait.c
 delete mode 100644 syscall/syscall_funclookup.c
 create mode 100644 syscall/syscall_names.c
 delete mode 100644 syscall/syscall_nparms.c
 create mode 100644 syscall/syscall_wraps.h
 copy syscall/{stubs => wraps}/.gitignore (100%)
 create mode 100644 syscall/wraps/Make.defs
 create mode 100755 tools/checkrelease.sh
 create mode 100644 tools/cxd56/elf32.h
 mode change 100644 => 100755 tools/zipme.sh


[incubator-nuttx] 07/11: pcie: qemu: remove not used header

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 760282ee36e04c09dc2e25037f9c28a3236104e6
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 19:03:11 2020 +0900

    pcie: qemu: remove not used header
---
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
index f754e66..2e0c392 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
@@ -72,7 +72,6 @@
 #include <nuttx/pcie/pcie.h>
 
 #include <nuttx/board.h>
-#include <nuttx/serial/uart_16550.h>
 #include <arch/board/board.h>
 
 #include "up_arch.h"


[incubator-nuttx] 08/11: pcie: qemu: return -EINVAL if buffer argument is NULL

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6f14ffe92b6beac684e24a1c74d4bfb1df9ba922
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 20:09:07 2020 +0900

    pcie: qemu: return -EINVAL if buffer argument is NULL
---
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c           |  6 ++++++
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h | 12 ++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
index 1308e22..5670fdd 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
@@ -221,6 +221,9 @@ static int qemu_pci_enumerate(FAR struct pcie_bus_s *bus,
 static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
                               FAR const void *buffer, unsigned int size)
 {
+  if(!buffer)
+      return -EINVAL;
+
   switch (size)
     {
       case 1:
@@ -254,6 +257,9 @@ static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
 static int qemu_pci_cfg_read(FAR struct pcie_dev_s *dev, uintptr_t addr,
                              FAR void *buffer, unsigned int size)
 {
+  if(!buffer)
+      return -EINVAL;
+
   switch (size)
     {
       case 1:
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
index 2e0c392..0665d83 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
@@ -107,6 +107,9 @@ static inline int __qemu_pci_cfg_write(uint16_t bfd, uintptr_t addr,
                                        FAR const void *buffer,
                                        unsigned int size)
 {
+  if(!buffer)
+      return -EINVAL;
+
   outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
 
   switch (size)
@@ -149,6 +152,9 @@ static inline int __qemu_pci_cfg_write64(uint16_t bfd, uintptr_t addr,
 {
   int ret;
 
+  if(!buffer)
+      return -EINVAL;
+
   ret = __qemu_pci_cfg_write(bfd, addr + 4, buffer + 4, 4);
   ret |= __qemu_pci_cfg_write(bfd, addr, buffer, 4);
 
@@ -175,6 +181,9 @@ static inline int __qemu_pci_cfg_write64(uint16_t bfd, uintptr_t addr,
 static inline int __qemu_pci_cfg_read(uint16_t bfd, uintptr_t addr,
                                       FAR void *buffer, unsigned int size)
 {
+  if(!buffer)
+      return -EINVAL;
+
   outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
 
   switch (size)
@@ -219,6 +228,9 @@ static inline int __qemu_pci_cfg_read64(uint16_t bfd,
 {
   int ret;
 
+  if(!buffer)
+      return -EINVAL;
+
   ret = __qemu_pci_cfg_read(bfd, addr + 4, buffer + 4, 4);
   ret |= __qemu_pci_cfg_read(bfd, addr, buffer, 4);
 


[incubator-nuttx] 03/11: virt: add qemu pci-testdev driver

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 21b508ac31d5d5c8926f8ec8f27b6f10759f54d1
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 01:02:38 2020 +0900

    virt: add qemu pci-testdev driver
---
 drivers/Kconfig               |   1 +
 drivers/Makefile              |   1 +
 drivers/pcie/pcie_root.c      |   5 +-
 drivers/virt/Kconfig          |  22 +++++++
 drivers/virt/Make.defs        |  37 ++++++++++++
 drivers/virt/qemu_pci_test.c  | 130 ++++++++++++++++++++++++++++++++++++++++++
 include/nuttx/virt/qemu_pci.h |  53 +++++++++++++++++
 7 files changed, 248 insertions(+), 1 deletion(-)

diff --git a/drivers/Kconfig b/drivers/Kconfig
index 513d3ea..aa11b3c 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -108,3 +108,4 @@ source drivers/syslog/Kconfig
 source drivers/platform/Kconfig
 source drivers/rf/Kconfig
 source drivers/pcie/Kconfig
+source drivers/virt/Kconfig
diff --git a/drivers/Makefile b/drivers/Makefile
index b0adab3..3de8472 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -74,6 +74,7 @@ include contactless/Make.defs
 include 1wire/Make.defs
 include rf/Make.defs
 include pcie/Make.defs
+include virt/Make.defs
 
 ifeq ($(CONFIG_SPECIFIC_DRIVERS),y)
 include platform/Make.defs
diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index 8764492..1fe2181 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -29,6 +29,7 @@
 #include <debug.h>
 
 #include <nuttx/pcie/pcie.h>
+#include <nuttx/virt/qemu_pci.h>
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -40,7 +41,9 @@
 
 struct pcie_dev_type_s *pci_device_types[] =
 {
-  NULL,
+#ifdef CONFIG_VIRT_QEMU_PCI_TEST
+  &pcie_type_qemu_pci_test,
+#endif /* CONFIG_VIRT_QEMU_PCI_TEST */
 };
 
 /****************************************************************************
diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig
new file mode 100644
index 0000000..bf8fb85
--- /dev/null
+++ b/drivers/virt/Kconfig
@@ -0,0 +1,22 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+#
+#
+menuconfig VIRT
+	bool "Virtualization"
+	default n
+	---help---
+		Drivers for virtualized and emulated devices
+
+if VIRT
+
+config VIRT_QEMU_PCI_TEST
+	bool "Driver for QEMU PCI test device"
+	default n
+	select PCIE
+	---help---
+		Driver for QEMU PCI test device
+
+endif # VIRT
diff --git a/drivers/virt/Make.defs b/drivers/virt/Make.defs
new file mode 100644
index 0000000..8ccfbe0
--- /dev/null
+++ b/drivers/virt/Make.defs
@@ -0,0 +1,37 @@
+############################################################################
+# drivers/pcie/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# Don't build anything if there is no CAN support
+
+ifeq ($(CONFIG_VIRT_QEMU_PCI_TEST),y)
+
+CSRCS += qemu_pci_test.c
+
+endif
+
+# Include virt device driver build support
+#
+ifeq ($(CONFIG_VIRT),y)
+
+DEPPATH += --dep-path virt
+VPATH += :virt
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)virt}
+
+endif
diff --git a/drivers/virt/qemu_pci_test.c b/drivers/virt/qemu_pci_test.c
new file mode 100644
index 0000000..ff1af63
--- /dev/null
+++ b/drivers/virt/qemu_pci_test.c
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * drivers/virt/qemu_pci_test.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Included Files
+ *****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/arch.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <math.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sched.h>
+
+#include <nuttx/pcie/pcie.h>
+#include <nuttx/virt/qemu_pci.h>
+
+/*****************************************************************************
+ * Pre-processor Definitions
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Private Types
+ *****************************************************************************/
+
+struct pci_test_dev_hdr_s
+{
+    volatile uint8_t test;       /* write-only, starts a given test number */
+    volatile uint8_t width_type; /* read-only, type and width of access for a given test.
+                                  * 1,2,4 for byte,word or long write.
+                                  * any other value if test not supported on this BAR */
+    volatile uint8_t pad0[2];
+    volatile uint32_t offset;    /* read-only, offset in this BAR for a given test */
+    volatile uint32_t data;      /* read-only, data to use for a given test */
+    volatile uint32_t count;     /* for debugging. number of writes detected. */
+    volatile uint8_t name[];     /* for debugging. 0-terminated ASCII string. */
+};
+
+/*****************************************************************************
+ * Public Functions
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Name: qemu_pci_test_probe
+ *
+ * Description:
+ *   Initialize device
+ *****************************************************************************/
+
+int qemu_pci_test_probe(FAR struct pcie_bus_s *bus,
+                        FAR struct pcie_dev_type_s *type, uint16_t bdf)
+{
+  uint32_t bar[2];
+  struct pcie_dev_s dev =
+    {
+      .bus = bus,
+      .type = type,
+      .bdf = bdf,
+    };
+
+  pci_enable_device(&dev, (PCI_CMD_MASTER | PCI_CMD_MEM));
+
+  for (int ii = 0; ii < 2; ii++)
+    {
+      pci_get_bar(&dev, ii, bar + ii);
+
+      if ((bar[ii] & PCI_BAR_IO) != PCI_BAR_IO)
+        {
+          pciinfo("Mapping BAR%d: %x\n", ii, bar[ii]);
+
+          pci_map_bar(&dev, ii, 0x1000, NULL);
+
+          struct pci_test_dev_hdr_s *ptr =
+            (struct pci_test_dev_hdr_s *)(uintptr_t)bar[ii];
+
+          int i = 0;
+          while (1)
+            {
+              ptr->test = i;
+
+              if (ptr->width_type != 1 &&
+                  ptr->width_type != 2 &&
+                  ptr->width_type != 4)
+                break;
+
+              pciinfo("Test[%d] Size:%d %s\n",
+                  i, ptr->width_type,
+                  ptr->name);
+
+              i++;
+            }
+        }
+    }
+
+  return OK;
+}
+
+/*****************************************************************************
+ * Public Data
+ *****************************************************************************/
+
+struct pcie_dev_type_s pcie_type_qemu_pci_test =
+{
+    .vendor = 0x1b36,
+    .device = 0x0005,
+    .class_rev = PCI_ID_ANY,
+    .name = "Qemu PCI test device",
+    .probe = qemu_pci_test_probe
+};
diff --git a/include/nuttx/virt/qemu_pci.h b/include/nuttx/virt/qemu_pci.h
new file mode 100644
index 0000000..f8e38f9
--- /dev/null
+++ b/include/nuttx/virt/qemu_pci.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ * include/nuttx/serial/uart_mcs99xx.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_VIRT_QEMU_PCI_TEST_H
+#define __INCLUDE_NUTTX_VIRT_QEMU_PCI_TEST_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdbool.h>
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+#ifdef CONFIG_VIRT_QEMU_PCI_TEST
+extern struct pcie_dev_type_s pcie_type_qemu_pci_test;
+#endif /* CONFIG_VIRT_QEMU_PCI_TEST */
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __INCLUDE_NUTTX_VIRT_QEMU_PCI_TEST_H */


[incubator-nuttx] 01/11: pcie: add framework

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 45c16a6c4e0394341eb8ab85421d8fd1c720f7a8
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Mon May 4 18:44:11 2020 +0900

    pcie: add framework
---
 Kconfig                   |  35 +++++
 drivers/Kconfig           |   1 +
 drivers/Makefile          |   1 +
 drivers/pcie/Kconfig      |  11 ++
 drivers/pcie/Make.defs    |  32 +++++
 drivers/pcie/pcie_root.c  | 354 ++++++++++++++++++++++++++++++++++++++++++++++
 include/debug.h           |  18 +++
 include/nuttx/pcie/pcie.h | 324 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 776 insertions(+)

diff --git a/Kconfig b/Kconfig
index 85ee240..008eaee 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1669,6 +1669,41 @@ config DEBUG_WATCHDOG_INFO
 		Enable watchdog time informational output to SYSLOG.
 
 endif # DEBUG_WATCHDOG
+
+config DEBUG_PCIE
+	bool "PCI-E Debug Features"
+	default n
+	depends on PCIE
+	---help---
+		Enable PCIE driver debug features.
+
+		Support for this debug option is architecture-specific and may not
+		be available for some MCUs.
+
+if DEBUG_PCIE
+
+config DEBUG_PCIE_ERROR
+	bool "PCI-E Error Output"
+	default n
+	depends on DEBUG_ERROR
+	---help---
+		Enable PCI-E driver error output to SYSLOG.
+
+config DEBUG_PCIE_WARN
+	bool "PCI-E Warnings Output"
+	default n
+	depends on DEBUG_WARN
+	---help---
+		Enable PCI-E driver warning output to SYSLOG.
+
+config DEBUG_PCIE_INFO
+	bool "PCI-E Informational Output"
+	default n
+	depends on DEBUG_INFO
+	---help---
+		Enable PCI-E driver informational output to SYSLOG.
+
+endif # DEBUG_PCIE
 endif # DEBUG_FEATURES
 
 config ARCH_HAVE_STACKCHECK
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 5220a94..513d3ea 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -107,3 +107,4 @@ source drivers/1wire/Kconfig
 source drivers/syslog/Kconfig
 source drivers/platform/Kconfig
 source drivers/rf/Kconfig
+source drivers/pcie/Kconfig
diff --git a/drivers/Makefile b/drivers/Makefile
index dd695b8..b0adab3 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -73,6 +73,7 @@ include wireless/Make.defs
 include contactless/Make.defs
 include 1wire/Make.defs
 include rf/Make.defs
+include pcie/Make.defs
 
 ifeq ($(CONFIG_SPECIFIC_DRIVERS),y)
 include platform/Make.defs
diff --git a/drivers/pcie/Kconfig b/drivers/pcie/Kconfig
new file mode 100644
index 0000000..d4138ff
--- /dev/null
+++ b/drivers/pcie/Kconfig
@@ -0,0 +1,11 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config PCIE
+	bool "Support for PCI-E Bus"
+	default n
+	---help---
+		Enables support for the PCI-E bus.
+		Backend bust be provided by per-arch or per-board implementation..
diff --git a/drivers/pcie/Make.defs b/drivers/pcie/Make.defs
new file mode 100644
index 0000000..68efee8
--- /dev/null
+++ b/drivers/pcie/Make.defs
@@ -0,0 +1,32 @@
+############################################################################
+# drivers/pcie/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# Don't build anything if there is no CAN support
+
+ifeq ($(CONFIG_PCIE),y)
+
+CSRCS += pcie_root.c
+
+# Include PCIE device driver build support
+
+DEPPATH += --dep-path pcie
+VPATH += :pcie
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)pcie}
+endif
diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
new file mode 100644
index 0000000..8764492
--- /dev/null
+++ b/drivers/pcie/pcie_root.c
@@ -0,0 +1,354 @@
+/****************************************************************************
+ * nuttx/drivers/pcie/pcie_root.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/pcie/pcie.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+struct pcie_dev_type_s *pci_device_types[] =
+{
+  NULL,
+};
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: pcie_initialize
+ *
+ * Description:
+ *  Initialize the PCI-E bus and enumerate the devices with give devices
+ *  type array
+ *
+ * Input Parameters:
+ *   bus    - An PCIE bus
+ *   types  - A array of PCIE device types
+ *   num    - Number of device types
+ *
+ * Returned Value:
+ *   OK if the driver was successfully register; A negated errno value is
+ *   returned on any failure.
+ *
+ ****************************************************************************/
+
+int pcie_initialize(FAR struct pcie_bus_s *bus)
+{
+  return bus->ops->pcie_enumerate(bus, pci_device_types);
+}
+
+/****************************************************************************
+ * Name: pci_enable_device
+ *
+ * Description:
+ *  Enable device with flags
+ *
+ * Input Parameters:
+ *   bdf - device BDF
+ *   flags - device ability to be enabled
+ *
+ * Return value:
+ *   -EINVAL: error
+ *   OK: OK
+ *
+ ****************************************************************************/
+
+int pci_enable_device(FAR struct pcie_dev_s *dev, uint32_t flags)
+{
+  uint16_t old_cmd;
+  uint16_t cmd;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_COMMAND, &old_cmd, 2);
+
+  cmd = old_cmd | flags;
+
+  dev->bus->ops->pci_cfg_write(dev, PCI_CFG_COMMAND, &cmd, 2);
+
+  pciinfo("%02x:%02x.%x, CMD: %x -> %x\n",
+          dev->bdf >> 8, (dev->bdf >> 3) & 0x1f, dev->bdf & 0x3,
+          old_cmd, cmd);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_find_cap
+ *
+ * Description:
+ *  Search through the PCI-e device capability list to find given capability.
+ *
+ * Input Parameters:
+ *   dev - Device
+ *   cap - Bitmask of capability
+ *
+ * Returned Value:
+ *   -1: Capability not supported
+ *   other: the offset in PCI configuration space to the capability structure
+ *
+ ****************************************************************************/
+
+int pci_find_cap(FAR struct pcie_dev_s *dev, uint16_t cap)
+{
+  uint8_t pos = PCI_CFG_CAP_PTR - 1;
+  uint16_t status;
+  uint8_t rcap;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_STATUS, &status, 2);
+
+  if (!(status & PCI_STS_CAPS))
+      return -EINVAL;
+
+  while (1)
+    {
+      dev->bus->ops->pci_cfg_read(dev, pos + 1, &pos, 1);
+      if (pos == 0)
+          return -EINVAL;
+
+      dev->bus->ops->pci_cfg_read(dev, pos, &rcap, 1);
+
+      if (rcap == cap)
+          return pos;
+    }
+}
+
+/****************************************************************************
+ * Name: pci_get_bar
+ *
+ * Description:
+ *  Get a 32 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_get_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                uint32_t *ret)
+{
+  if (bar > 5)
+      return -EINVAL;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4, ret, 4);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_get_bar64
+ *
+ * Description:
+ *  Get a 64 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_get_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  uint64_t *ret)
+{
+  if (bar > 5 || ((bar % 2) != 0))
+      return -EINVAL;
+
+  uint32_t barmem1;
+  uint32_t barmem2;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4, &barmem1, 4);
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4 + 4, &barmem2, 4);
+
+  *ret = ((uint64_t)barmem2 << 32) | barmem1;
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_set_bar
+ *
+ * Description:
+ *  Set a 32 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   val    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_set_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                uint32_t val)
+{
+  if (bar > 5)
+      return -EINVAL;
+
+  dev->bus->ops->pci_cfg_write(dev, PCI_CFG_BAR + bar * 4, &val, 4);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_set_bar64
+ *
+ * Description:
+ *  Set a 64 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   val    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_set_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  uint64_t val)
+{
+  if (bar > 5 || ((bar % 2) != 0))
+      return -EINVAL;
+
+  uint32_t barmem1 = (uint32_t)val;
+  uint32_t barmem2 = (uint32_t)(val >> 32);
+
+  dev->bus->ops->pci_cfg_write(dev, PCI_CFG_BAR + bar * 4, &barmem1, 4);
+  dev->bus->ops->pci_cfg_write(dev, PCI_CFG_BAR + bar * 4 + 4, &barmem2, 4);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_map_bar
+ *
+ * Description:
+ *  Map address in a 32 bits bar in the flat memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Content if not NULL
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_map_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                unsigned long length, uint32_t *ret)
+{
+  if (bar > 5)
+      return -EINVAL;
+
+  uint32_t barmem;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4, &barmem, 4);
+
+  if (((bar % 2) == 0 &&
+      (barmem & PCI_BAR_64BIT) == PCI_BAR_64BIT) ||
+      (barmem & PCI_BAR_IO)    == PCI_BAR_IO)
+      return -EINVAL;
+
+  if (!dev->bus->ops->pci_map_bar)
+      return -EINVAL;
+
+  dev->bus->ops->pci_map_bar(dev, barmem, length);
+
+  if (ret)
+    *ret = barmem;
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: pci_map_bar64
+ *
+ * Description:
+ *  Map address in a 64 bits bar in the flat memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Content if not NULL
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_map_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  unsigned long length, uint64_t *ret)
+{
+  if (bar > 5 || ((bar % 2) != 0))
+      return -EINVAL;
+
+  uint32_t barmem1;
+  uint32_t barmem2;
+  uint64_t barmem;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4, &barmem1, 4);
+
+  if ((barmem1 & PCI_BAR_64BIT) != PCI_BAR_64BIT ||
+      (barmem1 & PCI_BAR_IO)    == PCI_BAR_IO)
+      return -EINVAL;
+
+  dev->bus->ops->pci_cfg_read(dev, PCI_CFG_BAR + bar * 4 + 4, &barmem2, 4);
+
+  barmem = ((uint64_t)barmem2 << 32) | barmem1;
+
+  if (!dev->bus->ops->pci_map_bar64)
+      return -EINVAL;
+
+  dev->bus->ops->pci_map_bar64(dev, barmem, length);
+
+  if (ret)
+    *ret = barmem;
+
+  return OK;
+}
diff --git a/include/debug.h b/include/debug.h
index f4bc4d3..07a83b2 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -721,6 +721,24 @@
 #  define wdinfo      _none
 #endif
 
+#ifdef CONFIG_DEBUG_PCIE_ERROR
+#  define pcierr       _err
+#else
+#  define pcierr      _none
+#endif
+
+#ifdef CONFIG_DEBUG_PCIE_WARN
+#  define pciwarn     _warn
+#else
+#  define pciwarn     _none
+#endif
+
+#ifdef CONFIG_DEBUG_PCIE_INFO
+#  define pciinfo     _info
+#else
+#  define pciinfo     _none
+#endif
+
 /* Buffer dumping macros do not depend on varargs */
 
 #ifdef CONFIG_DEBUG_ERROR
diff --git a/include/nuttx/pcie/pcie.h b/include/nuttx/pcie/pcie.h
new file mode 100644
index 0000000..62adbb7
--- /dev/null
+++ b/include/nuttx/pcie/pcie.h
@@ -0,0 +1,324 @@
+/****************************************************************************
+ * include/nuttx/pcie/pcie.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_PCIE_PCIE_H
+#define __INCLUDE_NUTTX_PCIE_PCIE_H
+
+#ifdef CONFIG_PCIE
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+
+#include <nuttx/fs/ioctl.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define PCI_CFG_VENDOR_ID       0x000
+#define PCI_CFG_DEVICE_ID       0x002
+#define PCI_CFG_COMMAND         0x004
+# define PCI_CMD_IO             (1 << 0)
+# define PCI_CMD_MEM            (1 << 1)
+# define PCI_CMD_MASTER         (1 << 2)
+# define PCI_CMD_INTX_OFF       (1 << 10)
+#define PCI_CFG_STATUS          0x006
+# define PCI_STS_INT            (1 << 3)
+# define PCI_STS_CAPS           (1 << 4)
+#define PCI_CFG_REVERSION       0x008
+#define PCI_CFG_BAR             0x010
+# define PCI_BAR_IO             0x1
+# define PCI_BAR_1M             0x2
+# define PCI_BAR_64BIT          0x4
+#define PCI_CFG_CAP_PTR         0x034
+
+#define PCI_ID_ANY              0xffff
+#define PCI_DEV_CLASS_OTHER     0xff
+
+#define PCI_CAP_PM              0x01
+#define PCI_CAP_MSI             0x05
+#define PCI_CAP_MSIX            0x11
+# define MSIX_CTRL_ENABLE       0x8000
+# define MSIX_CTRL_FMASK        0x4000
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* The PCIE driver interface */
+
+struct pcie_bus_s;
+struct pcie_dev_type_s;
+struct pcie_dev_s;
+
+/* Bus related operations */
+
+struct pcie_bus_ops_s
+{
+    CODE int (*pcie_enumerate)(FAR struct pcie_bus_s *bus,
+                               FAR struct pcie_dev_type_s **types);
+
+    CODE int (*pci_cfg_write)(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                              FAR const void *buffer, unsigned int size);
+
+    CODE int (*pci_cfg_read)(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                             FAR void *buffer, unsigned int size);
+
+    CODE int (*pci_map_bar)(FAR struct pcie_dev_s *dev, uint32_t addr,
+                            unsigned long length);
+
+    CODE int (*pci_map_bar64)(FAR struct pcie_dev_s *dev, uint64_t addr,
+                            unsigned long length);
+
+    CODE int (*pci_msi_register)(FAR struct pcie_dev_s *dev,
+                                 uint16_t vector);
+
+    CODE int (*pci_msix_register)(FAR struct pcie_dev_s *dev,
+                                  uint32_t vector, uint32_t index);
+};
+
+/* PCIE bus private data. */
+
+struct pcie_bus_s
+{
+  FAR const struct pcie_bus_ops_s *ops; /* operations */
+};
+
+/* PCIE device type, defines by vendor ID and device ID */
+
+struct pcie_dev_type_s
+{
+  uint16_t      vendor;            /* Device vendor ID */
+  uint16_t      device;            /* Device ID */
+  uint32_t      class_rev;         /* Device reversion */
+  const char    *name;             /* Human readable name */
+
+  /* Call back function when a device is probed */
+
+  CODE int (*probe)(FAR struct pcie_bus_s *bus,
+                    FAR struct pcie_dev_type_s *type, uint16_t bdf);
+};
+
+/* PCIE device private data. */
+
+struct pcie_dev_s
+{
+    FAR struct pcie_bus_s       *bus;
+    FAR struct pcie_dev_type_s  *type;
+    uint16_t                    bdf;
+};
+
+/****************************************************************************
+ * Public Functions Prototypes
+ ****************************************************************************/
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Name: pcie_initialize
+ *
+ * Description:
+ *  Initialize the PCI-E bus and enumerate the devices with give devices
+ *  type array
+ *
+ * Input Parameters:
+ *   bus    - An PCIE bus
+ *   types  - A array of PCIE device types
+ *   num    - Number of device types
+ *
+ * Returned Value:
+ *   OK if the driver was successfully register; A negated errno value is
+ *   returned on any failure.
+ *
+ ****************************************************************************/
+
+int pcie_initialize(FAR struct pcie_bus_s *bus);
+
+/****************************************************************************
+ * Name: pci_enable_device
+ *
+ * Description:
+ *  Enable device with flags
+ *
+ * Input Parameters:
+ *   dev - device
+ *   flags - device ability to be enabled
+ *
+ * Return value:
+ *   -EINVAL: error
+ *   OK: OK
+ *
+ ****************************************************************************/
+
+int pci_enable_device(FAR struct pcie_dev_s *dev, uint32_t flags);
+
+/****************************************************************************
+ * Name: pci_find_cap
+ *
+ * Description:
+ *  Search through the PCI-e device capability list to find given capability.
+ *
+ * Input Parameters:
+ *   dev - Device
+ *   cap - Bitmask of capability
+ *
+ * Returned Value:
+ *   -1: Capability not supported
+ *   other: the offset in PCI configuration space to the capability structure
+ *
+ ****************************************************************************/
+
+int pci_find_cap(FAR struct pcie_dev_s *dev, uint16_t cap);
+
+/****************************************************************************
+ * Name: pci_map_bar
+ *
+ * Description:
+ *  Map address in a 32 bits bar in the flat memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Contentif not NULL
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_map_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                unsigned long length, uint32_t *ret);
+
+/****************************************************************************
+ * Name: pci_map_bar64
+ *
+ * Description:
+ *  Map address in a 64 bits bar in the flat memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Content if not NULL
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_map_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  unsigned long length, uint64_t *ret);
+
+/****************************************************************************
+ * Name: pci_get_bar
+ *
+ * Description:
+ *  Get a 32 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_get_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                uint32_t *ret);
+
+/****************************************************************************
+ * Name: pci_get_bar64
+ *
+ * Description:
+ *  Get a 64 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_get_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  uint64_t *ret);
+
+/****************************************************************************
+ * Name: pci_set_bar
+ *
+ * Description:
+ *  Set a 32 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   val    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_set_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
+                uint32_t val);
+
+/****************************************************************************
+ * Name: pci_set_bar64
+ *
+ * Description:
+ *  Set a 64 bits bar
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   val    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_set_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
+                  uint64_t val);
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+#endif
+#endif /* __INCLUDE_NUTTX_I2C_I2C_MASTER_H */


[incubator-nuttx] 02/11: x86_64: qemu: implement pci-e functions and enumerate pci-e devices on boot

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit f8ba0ccf237b92b8e12a9f48403e76ef56911a8b
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Mon May 4 18:45:22 2020 +0900

    x86_64: qemu: implement pci-e functions and enumerate pci-e devices on
    boot
---
 boards/x86_64/intel64/qemu-intel64/Kconfig         |   8 +
 boards/x86_64/intel64/qemu-intel64/include/board.h |   2 +
 boards/x86_64/intel64/qemu-intel64/src/Makefile    |   4 +
 boards/x86_64/intel64/qemu-intel64/src/qemu_boot.c |   6 +
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c | 461 +++++++++++++++++++++
 .../intel64/qemu-intel64/src/qemu_pcie_readwrite.h | 229 ++++++++++
 6 files changed, 710 insertions(+)

diff --git a/boards/x86_64/intel64/qemu-intel64/Kconfig b/boards/x86_64/intel64/qemu-intel64/Kconfig
index f72f3c0..5951271 100644
--- a/boards/x86_64/intel64/qemu-intel64/Kconfig
+++ b/boards/x86_64/intel64/qemu-intel64/Kconfig
@@ -2,3 +2,11 @@
 # For a description of the syntax of this configuration file,
 # see the file kconfig-language.txt in the NuttX tools repository.
 #
+#
+config QEMU_PCIE
+	bool "Initialize and enumerate PCI-E Bus"
+	default n
+	select PCIE
+
+	---help---
+		Enables initialization and scaning of standard x86-64 pcie bus.
diff --git a/boards/x86_64/intel64/qemu-intel64/include/board.h b/boards/x86_64/intel64/qemu-intel64/include/board.h
index 22b12cb..0bca067 100644
--- a/boards/x86_64/intel64/qemu-intel64/include/board.h
+++ b/boards/x86_64/intel64/qemu-intel64/include/board.h
@@ -66,6 +66,8 @@ extern "C"
  * Public Function Prototypes
  ****************************************************************************/
 
+void qemu_pcie_init(void);
+
 #undef EXTERN
 #if defined(__cplusplus)
 }
diff --git a/boards/x86_64/intel64/qemu-intel64/src/Makefile b/boards/x86_64/intel64/qemu-intel64/src/Makefile
index fcb378b..19287bd 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/Makefile
+++ b/boards/x86_64/intel64/qemu-intel64/src/Makefile
@@ -26,4 +26,8 @@ ifeq ($(CONFIG_LIB_BOARDCTL),y)
   CSRCS += qemu_appinit.c
 endif
 
+ifeq ($(CONFIG_QEMU_PCIE),y)
+  CSRCS += qemu_pcie.c
+endif
+
 include $(TOPDIR)/boards/Board.mk
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_boot.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_boot.c
index d80e905..fb7807c 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_boot.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_boot.c
@@ -68,6 +68,12 @@ void x86_64_boardinitialize(void)
   uart_putreg(CONFIG_16550_UART1_BASE, UART_MCR_OFFSET, UART_MCR_OUT2);
 #endif
 
+#ifdef CONFIG_QEMU_PCIE
+  /* Initialization of system */
+
+  qemu_pcie_init();
+#endif
+
   /* Configure on-board LEDs if LED support has been selected. */
 
 #ifdef CONFIG_ARCH_LEDS
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
new file mode 100644
index 0000000..1308e22
--- /dev/null
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
@@ -0,0 +1,461 @@
+/****************************************************************************
+ * boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/* The MSI and MSI-X vector setup function are taken from Jailhouse inmate
+ * library
+ *
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Copyright (c) Siemens AG, 2014
+ *
+ * Authors:
+ *  Jan Kiszka <ja...@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ * Alternatively, you can use or redistribute this file under the following
+ * BSD license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <assert.h>
+
+#include <nuttx/pcie/pcie.h>
+
+#include "qemu_pcie_readwrite.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define QEMU_PCIE_MAX_BDF 0x10000
+
+/****************************************************************************
+ * Private Functions Definitions
+ ****************************************************************************/
+
+static int qemu_pci_enumerate(FAR struct pcie_bus_s *bus,
+                               FAR struct pcie_dev_type_s **types);
+
+static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                              FAR const void *buffer, unsigned int size);
+
+static int qemu_pci_cfg_read(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                             FAR void *buffer, unsigned int size);
+
+static int qemu_pci_map_bar(FAR struct pcie_dev_s *dev, uint32_t addr,
+                            unsigned long length);
+
+static int qemu_pci_map_bar64(FAR struct pcie_dev_s *dev, uint64_t addr,
+                              unsigned long length);
+
+static int qemu_pci_msix_register(FAR struct pcie_dev_s *dev,
+                                  uint32_t vector, uint32_t index);
+
+static int qemu_pci_msi_register(FAR struct pcie_dev_s *dev,
+                                 uint16_t vector);
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+struct pcie_bus_ops_s qemu_pcie_bus_ops =
+{
+    .pcie_enumerate    =   qemu_pci_enumerate,
+    .pci_cfg_write     =   qemu_pci_cfg_write,
+    .pci_cfg_read      =   qemu_pci_cfg_read,
+    .pci_map_bar       =   qemu_pci_map_bar,
+    .pci_map_bar64     =   qemu_pci_map_bar64,
+    .pci_msix_register = qemu_pci_msix_register,
+    .pci_msi_register  = qemu_pci_msi_register,
+};
+
+struct pcie_bus_s qemu_pcie_bus =
+{
+    .ops = &qemu_pcie_bus_ops,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: qemu_pci_enumerate
+ *
+ * Description:
+ *  Scan the PCI bus and enumerate the devices.
+ *  Initialize any recognized devices, given in types.
+ *
+ * Input Parameters:
+ *   bus    - PCI-E bus structure
+ *   type   - List of pointers to devices types recognized, NULL terminated
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static int qemu_pci_enumerate(FAR struct pcie_bus_s *bus,
+                               FAR struct pcie_dev_type_s **types)
+{
+  unsigned int bdf;
+  uint16_t vid;
+  uint16_t id;
+  uint16_t rev;
+
+  if (!bus)
+      return -EINVAL;
+  if (!types)
+      return -EINVAL;
+
+  for (bdf = 0; bdf < QEMU_PCIE_MAX_BDF; bdf++)
+    {
+      __qemu_pci_cfg_read(bdf, PCI_CFG_VENDOR_ID, &vid, 2);
+      __qemu_pci_cfg_read(bdf, PCI_CFG_DEVICE_ID, &id, 2);
+      __qemu_pci_cfg_read(bdf, PCI_CFG_REVERSION, &rev, 2);
+
+      if (vid == PCI_ID_ANY)
+        continue;
+
+      pciinfo("[%02x:%02x.%x] Found %04x:%04x, class/reversion %08x\n",
+              bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
+              vid, id, rev);
+
+      for (int i = 0; types[i] != NULL; i++)
+        {
+          if (types[i]->vendor == PCI_ID_ANY ||
+              types[i]->vendor == vid)
+            {
+              if (types[i]->device == PCI_ID_ANY ||
+                  types[i]->device == id)
+                {
+                  if (types[i]->class_rev == PCI_ID_ANY ||
+                      types[i]->class_rev == rev)
+                    {
+                      if (types[i]->probe)
+                        {
+                          pciinfo("[%02x:%02x.%x] %s\n",
+                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
+                                  types[i]->name);
+                          types[i]->probe(bus, types[i], bdf);
+                        }
+                      else
+                        {
+                          pcierr("[%02x:%02x.%x] Error: Invalid \
+                                  device probe function\n",
+                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3);
+                        }
+                      break;
+                    }
+                }
+            }
+        }
+    }
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: qemu_pci_cfg_write
+ *
+ * Description:
+ *  Write 8, 16, 32, 64 bits data to PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   bdf    - Device private data
+ *   buffer - A pointer to the read-only buffer of data to be written
+ *   size   - The number of bytes to send from the buffer
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                              FAR const void *buffer, unsigned int size)
+{
+  switch (size)
+    {
+      case 1:
+      case 2:
+      case 4:
+        return __qemu_pci_cfg_write(dev->bdf, addr, buffer, size);
+      case 8:
+        return __qemu_pci_cfg_write(dev->bdf, addr, buffer, size);
+      default:
+        return -EINVAL;
+    }
+}
+
+/****************************************************************************
+ * Name: qemu_pci_cfg_read
+ *
+ * Description:
+ *  Read 8, 16, 32, 64 bits data from PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   buffer - A pointer to a buffer to receive the data from the device
+ *   size   - The requested number of bytes to be read
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static int qemu_pci_cfg_read(FAR struct pcie_dev_s *dev, uintptr_t addr,
+                             FAR void *buffer, unsigned int size)
+{
+  switch (size)
+    {
+      case 1:
+      case 2:
+      case 4:
+        return __qemu_pci_cfg_read(dev->bdf, addr, buffer, size);
+      case 8:
+        return __qemu_pci_cfg_read64(dev->bdf, addr, buffer, size);
+      default:
+        return -EINVAL;
+    }
+}
+
+/****************************************************************************
+ * Name: qemu_pci_map_bar
+ *
+ * Description:
+ *  Map address in a 32 bits bar in the memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static int qemu_pci_map_bar(FAR struct pcie_dev_s *dev, uint32_t addr,
+                            unsigned long length)
+{
+  up_map_region((void *)((uintptr_t)addr), length,
+      X86_PAGE_WR | X86_PAGE_PRESENT | X86_PAGE_NOCACHE | X86_PAGE_GLOBAL);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: qemu_pci_map_bar64
+ *
+ * Description:
+ *  Map address in a 64 bits bar in the memory address space
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   bar    - Bar number
+ *   length - Map length, multiple of PAGE_SIZE
+ *   ret    - Bar Content
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static int qemu_pci_map_bar64(FAR struct pcie_dev_s *dev, uint64_t addr,
+                              unsigned long length)
+{
+  up_map_region((void *)((uintptr_t)addr), length,
+      X86_PAGE_WR | X86_PAGE_PRESENT | X86_PAGE_NOCACHE | X86_PAGE_GLOBAL);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: qemu_pci_msix_register
+ *
+ * Description:
+ *  Map a device MSI-X vector to a platform IRQ vector
+ *
+ * Input Parameters:
+ *   dev - Device
+ *   vector - IRQ number of the platform
+ *   index  - Device MSI-X vector number
+ *
+ * Returned Value:
+ *   <0: Mapping failed
+ *    0: Mapping succeed
+ *
+ ****************************************************************************/
+
+static int qemu_pci_msix_register(FAR struct pcie_dev_s *dev,
+                                  uint32_t vector, uint32_t index)
+{
+  unsigned int bar;
+  uint16_t message_control;
+  uint32_t table_bar_ind;
+  uint32_t lo_table_addr;
+  uint32_t hi_table_addr;
+  uint64_t msix_table_addr = 0;
+
+  int cap = pci_find_cap(dev, PCI_CAP_MSIX);
+  if (cap < 0)
+      return -EINVAL;
+
+  __qemu_pci_cfg_read(dev->bdf, cap + 2, &message_control, 2);
+
+  /* bounds check */
+
+  if (index > (message_control & 0x3ff))
+      return -EINVAL;
+
+  __qemu_pci_cfg_read(dev->bdf, cap + 4, &table_bar_ind, 4);
+
+  bar = (table_bar_ind & 7) * 4 + PCI_CFG_BAR;
+
+  __qemu_pci_cfg_read(dev->bdf, bar, &lo_table_addr, 4);
+
+  if ((lo_table_addr & 6) == PCI_BAR_64BIT)
+    {
+      __qemu_pci_cfg_read(dev->bdf, bar + 4, &hi_table_addr, 4);
+      msix_table_addr = (uint64_t)hi_table_addr << 32;
+    }
+
+  msix_table_addr |= lo_table_addr & ~0xf;
+  msix_table_addr += table_bar_ind & ~0x7;
+
+  /* enable and mask */
+
+  message_control |= (MSIX_CTRL_ENABLE | MSIX_CTRL_FMASK);
+  __qemu_pci_cfg_write(dev->bdf, cap + 2, &message_control, 2);
+
+  msix_table_addr += 16 * index;
+  mmio_write32((uint32_t *)(msix_table_addr),
+               0xfee00000 | up_apic_cpu_id() << 12);
+  mmio_write32((uint32_t *)(msix_table_addr + 4), 0);
+  mmio_write32((uint32_t *)(msix_table_addr + 8), vector);
+  mmio_write32((uint32_t *)(msix_table_addr + 12), 0);
+
+  /* enable and unmask */
+
+  message_control &= ~MSIX_CTRL_FMASK;
+
+  __qemu_pci_cfg_write(dev->bdf, cap + 2, &message_control, 2);
+
+  return 0;
+}
+
+/****************************************************************************
+ * Name: qemu_pci_msi_register
+ *
+ * Description:
+ *  Map device MSI vectors to a platform IRQ vector
+ *
+ * Input Parameters:
+ *   dev - Device
+ *   vector - IRQ number of the platform
+ *
+ * Returned Value:
+ *   <0: Mapping failed
+ *    0: Mapping succeed
+ *
+ ****************************************************************************/
+
+static int qemu_pci_msi_register(FAR struct pcie_dev_s *dev, uint16_t vector)
+{
+  uint16_t ctl;
+  uint16_t data;
+
+  int cap = pci_find_cap(dev, PCI_CAP_MSI);
+  if (cap < 0)
+      return -1;
+
+  uint32_t dest = 0xfee00000 | (up_apic_cpu_id() << 12);
+  __qemu_pci_cfg_write(dev->bdf, cap + 4, &dest, 4);
+
+  __qemu_pci_cfg_read(dev->bdf, cap + 2, &ctl, 2);
+  if (ctl & (1 << 7))
+    {
+      uint32_t tmp = 0;
+      __qemu_pci_cfg_write(dev->bdf, cap + 8, &tmp, 4);
+      data = cap + 0x0c;
+    }
+  else
+    {
+      data = cap + 0x08;
+    }
+
+  __qemu_pci_cfg_write(dev->bdf, data, &vector, 2);
+
+  __qemu_pci_cfg_write(dev->bdf, cap + 2, &vector, 2);
+
+  uint16_t en = 0x0001;
+  __qemu_pci_cfg_write(dev->bdf, cap + 2, &en, 2);
+
+  return OK;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: qemu_pcie_init
+ *
+ * Description:
+ *  Initialize the PCI-E bus *
+ *
+ ****************************************************************************/
+
+void qemu_pcie_init(void)
+{
+  pcie_initialize(&qemu_pcie_bus);
+}
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
new file mode 100644
index 0000000..f754e66
--- /dev/null
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
@@ -0,0 +1,229 @@
+/****************************************************************************
+ * boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/* The PCI-E Definitions and part of the access routines are taken from
+ * Jailhouse inmate library
+ *
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Copyright (c) Siemens AG, 2014
+ *
+ * Authors:
+ *  Jan Kiszka <ja...@siemens.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ * Alternatively, you can use or redistribute this file under the following
+ * BSD license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __INCLUDE_NUTTX_PCIE_PCIE_READWRITE_H
+#define __INCLUDE_NUTTX_PCIE_PCIE_READWRITE_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <assert.h>
+
+#include <nuttx/pcie/pcie.h>
+
+#include <nuttx/board.h>
+#include <nuttx/serial/uart_16550.h>
+#include <arch/board/board.h>
+
+#include "up_arch.h"
+#include "up_internal.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define PCI_REG_ADDR_PORT       0xcf8
+#define PCI_REG_DATA_PORT       0xcfc
+
+#define PCI_CONE                (1 << 31)
+
+/****************************************************************************
+ * Name: __qemu_pci_cfg_write
+ *
+ * Description:
+ *  Write 8, 16, 32 bits data to PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   bfd    - Device private data
+ *   buffer - A pointer to the read-only buffer of data to be written
+ *   size   - The number of bytes to send from the buffer
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static inline int __qemu_pci_cfg_write(uint16_t bfd, uintptr_t addr,
+                                       FAR const void *buffer,
+                                       unsigned int size)
+{
+  outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
+
+  switch (size)
+    {
+      case 1:
+        outb(*(uint8_t *)(buffer), PCI_REG_DATA_PORT + (addr & 0x3));
+        break;
+      case 2:
+        outw(*(uint16_t *)(buffer), PCI_REG_DATA_PORT + (addr & 0x3));
+        break;
+      case 4:
+        outl(*(uint32_t *)(buffer), PCI_REG_DATA_PORT);
+        break;
+      default:
+        return -EINVAL;
+    }
+  return OK;
+}
+
+/****************************************************************************
+ * Name: __qemu_pci_cfg_write64
+ *
+ * Description:
+ *  Write 64 bits data to PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   bfd    - Device private data
+ *   buffer - A pointer to the read-only buffer of data to be written
+ *   size   - The number of bytes to send from the buffer
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static inline int __qemu_pci_cfg_write64(uint16_t bfd, uintptr_t addr,
+                                         FAR const void *buffer,
+                                         unsigned int size)
+{
+  int ret;
+
+  ret = __qemu_pci_cfg_write(bfd, addr + 4, buffer + 4, 4);
+  ret |= __qemu_pci_cfg_write(bfd, addr, buffer, 4);
+
+  return ret;
+}
+
+/****************************************************************************
+ * Name: __qemu_pci_cfg_read
+ *
+ * Description:
+ *  Read 8, 16, 32 bits data from PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   buffer - A pointer to a buffer to receive the data from the device
+ *   size   - The requested number of bytes to be read
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static inline int __qemu_pci_cfg_read(uint16_t bfd, uintptr_t addr,
+                                      FAR void *buffer, unsigned int size)
+{
+  outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
+
+  switch (size)
+    {
+      case 1:
+        *(uint8_t *)(buffer) = inb(PCI_REG_DATA_PORT + (addr & 0x3));
+        break;
+      case 2:
+        *(uint16_t *)(buffer) = inw(PCI_REG_DATA_PORT + (addr & 0x3));
+        break;
+      case 4:
+        *(uint32_t *)(buffer) = inl(PCI_REG_DATA_PORT);
+        break;
+      default:
+        return -EINVAL;
+    }
+
+    return OK;
+}
+
+/****************************************************************************
+ * Name: __qemu_pci_cfg_read
+ *
+ * Description:
+ *  Read 64 bits data from PCI-E configuration space of device
+ *  specified by dev
+ *
+ * Input Parameters:
+ *   dev    - Device private data
+ *   buffer - A pointer to a buffer to receive the data from the device
+ *   size   - The requested number of bytes to be read
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+static inline int __qemu_pci_cfg_read64(uint16_t bfd,
+                                        uintptr_t addr,
+                                        FAR void *buffer,
+                                        unsigned int size)
+{
+  int ret;
+
+  ret = __qemu_pci_cfg_read(bfd, addr + 4, buffer + 4, 4);
+  ret |= __qemu_pci_cfg_read(bfd, addr, buffer, 4);
+
+  return ret;
+}
+
+#endif /* __INCLUDE_NUTTX_PCIE_PCIE_READWRITE_H */


[incubator-nuttx] 09/11: pcie: make pcie enumerate routine as common instead of architecture dependent

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ddd4ba306edfaee51b0e189d17a9469deef33732
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 20:28:41 2020 +0900

    pcie: make pcie enumerate routine as common instead of architecture dependent
---
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c | 82 -------------------
 drivers/pcie/Kconfig                               | 11 ++-
 drivers/pcie/pcie_root.c                           | 92 +++++++++++++++++++++-
 3 files changed, 101 insertions(+), 84 deletions(-)

diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
index 5670fdd..f23bec9 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
@@ -74,15 +74,10 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define QEMU_PCIE_MAX_BDF 0x10000
-
 /****************************************************************************
  * Private Functions Definitions
  ****************************************************************************/
 
-static int qemu_pci_enumerate(FAR struct pcie_bus_s *bus,
-                               FAR struct pcie_dev_type_s **types);
-
 static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
                               FAR const void *buffer, unsigned int size);
 
@@ -107,7 +102,6 @@ static int qemu_pci_msi_register(FAR struct pcie_dev_s *dev,
 
 struct pcie_bus_ops_s qemu_pcie_bus_ops =
 {
-    .pcie_enumerate    =   qemu_pci_enumerate,
     .pci_cfg_write     =   qemu_pci_cfg_write,
     .pci_cfg_read      =   qemu_pci_cfg_read,
     .pci_map_bar       =   qemu_pci_map_bar,
@@ -126,82 +120,6 @@ struct pcie_bus_s qemu_pcie_bus =
  ****************************************************************************/
 
 /****************************************************************************
- * Name: qemu_pci_enumerate
- *
- * Description:
- *  Scan the PCI bus and enumerate the devices.
- *  Initialize any recognized devices, given in types.
- *
- * Input Parameters:
- *   bus    - PCI-E bus structure
- *   type   - List of pointers to devices types recognized, NULL terminated
- *
- * Returned Value:
- *   0: success, <0: A negated errno
- *
- ****************************************************************************/
-
-static int qemu_pci_enumerate(FAR struct pcie_bus_s *bus,
-                               FAR struct pcie_dev_type_s **types)
-{
-  unsigned int bdf;
-  uint16_t vid;
-  uint16_t id;
-  uint16_t rev;
-
-  if (!bus)
-      return -EINVAL;
-  if (!types)
-      return -EINVAL;
-
-  for (bdf = 0; bdf < QEMU_PCIE_MAX_BDF; bdf++)
-    {
-      __qemu_pci_cfg_read(bdf, PCI_CFG_VENDOR_ID, &vid, 2);
-      __qemu_pci_cfg_read(bdf, PCI_CFG_DEVICE_ID, &id, 2);
-      __qemu_pci_cfg_read(bdf, PCI_CFG_REVERSION, &rev, 2);
-
-      if (vid == PCI_ID_ANY)
-        continue;
-
-      pciinfo("[%02x:%02x.%x] Found %04x:%04x, class/reversion %08x\n",
-              bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
-              vid, id, rev);
-
-      for (int i = 0; types[i] != NULL; i++)
-        {
-          if (types[i]->vendor == PCI_ID_ANY ||
-              types[i]->vendor == vid)
-            {
-              if (types[i]->device == PCI_ID_ANY ||
-                  types[i]->device == id)
-                {
-                  if (types[i]->class_rev == PCI_ID_ANY ||
-                      types[i]->class_rev == rev)
-                    {
-                      if (types[i]->probe)
-                        {
-                          pciinfo("[%02x:%02x.%x] %s\n",
-                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
-                                  types[i]->name);
-                          types[i]->probe(bus, types[i], bdf);
-                        }
-                      else
-                        {
-                          pcierr("[%02x:%02x.%x] Error: Invalid \
-                                  device probe function\n",
-                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3);
-                        }
-                      break;
-                    }
-                }
-            }
-        }
-    }
-
-  return OK;
-}
-
-/****************************************************************************
  * Name: qemu_pci_cfg_write
  *
  * Description:
diff --git a/drivers/pcie/Kconfig b/drivers/pcie/Kconfig
index d4138ff..7ac9db5 100644
--- a/drivers/pcie/Kconfig
+++ b/drivers/pcie/Kconfig
@@ -3,9 +3,18 @@
 # see the file kconfig-language.txt in the NuttX tools repository.
 #
 
-config PCIE
+menuconfig PCIE
 	bool "Support for PCI-E Bus"
 	default n
 	---help---
 		Enables support for the PCI-E bus.
 		Backend bust be provided by per-arch or per-board implementation..
+
+if PCIE
+config PCIE_MAX_BDF
+	hex "Maximum bdf to scan on PCI-E bus"
+	default 0x10000
+	---help---
+		The maximum bdf number to be scaned on PCI-E bus
+
+endif
diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index 362e677..2b420e1 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -52,6 +52,96 @@ struct pcie_dev_type_s *pci_device_types[] =
  ****************************************************************************/
 
 /****************************************************************************
+ * Name: pci_enumerate
+ *
+ * Description:
+ *  Scan the PCI bus and enumerate the devices.
+ *  Initialize any recognized devices, given in types.
+ *
+ * Input Parameters:
+ *   bus    - PCI-E bus structure
+ *   type   - List of pointers to devices types recognized, NULL terminated
+ *
+ * Returned Value:
+ *   0: success, <0: A negated errno
+ *
+ ****************************************************************************/
+
+int pci_enumerate(FAR struct pcie_bus_s *bus,
+                  FAR struct pcie_dev_type_s **types)
+{
+  unsigned int bdf;
+  uint16_t vid;
+  uint16_t id;
+  uint16_t rev;
+  struct pcie_dev_s tmp_dev;
+  struct pcie_dev_type_s tmp_type =
+    {
+      .name = "Unknown",
+      .vendor = PCI_ID_ANY,
+      .device = PCI_ID_ANY,
+      .class_rev = PCI_ID_ANY,
+      .probe = NULL,
+    };
+
+  if (!bus)
+      return -EINVAL;
+  if (!types)
+      return -EINVAL;
+
+  for (bdf = 0; bdf < CONFIG_PCIE_MAX_BDF; bdf++)
+    {
+      tmp_dev.bus = bus;
+      tmp_dev.type = &tmp_type;
+      tmp_dev.bdf = bdf;
+
+      bus->ops->pci_cfg_read(&tmp_dev, PCI_CFG_VENDOR_ID, &vid, 2);
+      bus->ops->pci_cfg_read(&tmp_dev, PCI_CFG_DEVICE_ID, &id, 2);
+      bus->ops->pci_cfg_read(&tmp_dev, PCI_CFG_REVERSION, &rev, 2);
+
+      if (vid == PCI_ID_ANY)
+        continue;
+
+      pciinfo("[%02x:%02x.%x] Found %04x:%04x, class/reversion %08x\n",
+              bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
+              vid, id, rev);
+
+      for (int i = 0; types[i] != NULL; i++)
+        {
+          if (types[i]->vendor == PCI_ID_ANY ||
+              types[i]->vendor == vid)
+            {
+              if (types[i]->device == PCI_ID_ANY ||
+                  types[i]->device == id)
+                {
+                  if (types[i]->class_rev == PCI_ID_ANY ||
+                      types[i]->class_rev == rev)
+                    {
+                      if (types[i]->probe)
+                        {
+                          pciinfo("[%02x:%02x.%x] %s\n",
+                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3,
+                                  types[i]->name);
+                          types[i]->probe(bus, types[i], bdf);
+                        }
+                      else
+                        {
+                          pcierr("[%02x:%02x.%x] Error: Invalid \
+                                  device probe function\n",
+                                  bdf >> 8, (bdf >> 3) & 0x1f, bdf & 0x3);
+                        }
+                      break;
+                    }
+                }
+            }
+        }
+    }
+
+  return OK;
+}
+
+
+/****************************************************************************
  * Name: pcie_initialize
  *
  * Description:
@@ -71,7 +161,7 @@ struct pcie_dev_type_s *pci_device_types[] =
 
 int pcie_initialize(FAR struct pcie_bus_s *bus)
 {
-  return bus->ops->pcie_enumerate(bus, pci_device_types);
+  return pci_enumerate(bus, pci_device_types);
 }
 
 /****************************************************************************


[incubator-nuttx] 05/11: pcie: enable don't take flags, hardcoded enabling flags

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a25ff3141679c245197402dcde05e441e9e88c99
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 18:19:56 2020 +0900

    pcie: enable don't take flags, hardcoded enabling flags
---
 drivers/pcie/pcie_root.c     | 9 ++++-----
 drivers/virt/qemu_pci_test.c | 2 +-
 include/nuttx/pcie/pcie.h    | 5 ++---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index c5ee688..2592fbb 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -78,11 +78,10 @@ int pcie_initialize(FAR struct pcie_bus_s *bus)
  * Name: pci_enable_device
  *
  * Description:
- *  Enable device with flags
+ *  Enable device with MMIO
  *
  * Input Parameters:
- *   bdf - device BDF
- *   flags - device ability to be enabled
+ *   dev - device
  *
  * Return value:
  *   -EINVAL: error
@@ -90,14 +89,14 @@ int pcie_initialize(FAR struct pcie_bus_s *bus)
  *
  ****************************************************************************/
 
-int pci_enable_device(FAR struct pcie_dev_s *dev, uint32_t flags)
+int pci_enable_device(FAR struct pcie_dev_s *dev)
 {
   uint16_t old_cmd;
   uint16_t cmd;
 
   dev->bus->ops->pci_cfg_read(dev, PCI_CFG_COMMAND, &old_cmd, 2);
 
-  cmd = old_cmd | flags;
+  cmd = old_cmd | (PCI_CMD_MASTER | PCI_CMD_MEM);
 
   dev->bus->ops->pci_cfg_write(dev, PCI_CFG_COMMAND, &cmd, 2);
 
diff --git a/drivers/virt/qemu_pci_test.c b/drivers/virt/qemu_pci_test.c
index ff1af63..d0df753 100644
--- a/drivers/virt/qemu_pci_test.c
+++ b/drivers/virt/qemu_pci_test.c
@@ -79,7 +79,7 @@ int qemu_pci_test_probe(FAR struct pcie_bus_s *bus,
       .bdf = bdf,
     };
 
-  pci_enable_device(&dev, (PCI_CMD_MASTER | PCI_CMD_MEM));
+  pci_enable_device(&dev);
 
   for (int ii = 0; ii < 2; ii++)
     {
diff --git a/include/nuttx/pcie/pcie.h b/include/nuttx/pcie/pcie.h
index 62adbb7..8b5b98e 100644
--- a/include/nuttx/pcie/pcie.h
+++ b/include/nuttx/pcie/pcie.h
@@ -168,11 +168,10 @@ int pcie_initialize(FAR struct pcie_bus_s *bus);
  * Name: pci_enable_device
  *
  * Description:
- *  Enable device with flags
+ *  Enable device with MMIO
  *
  * Input Parameters:
  *   dev - device
- *   flags - device ability to be enabled
  *
  * Return value:
  *   -EINVAL: error
@@ -180,7 +179,7 @@ int pcie_initialize(FAR struct pcie_bus_s *bus);
  *
  ****************************************************************************/
 
-int pci_enable_device(FAR struct pcie_dev_s *dev, uint32_t flags);
+int pci_enable_device(FAR struct pcie_dev_s *dev);
 
 /****************************************************************************
  * Name: pci_find_cap


[incubator-nuttx] 06/11: pcie: checking bar > 4 for 64bit bars are sufficient

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit a2ea99857bd528ab27e4d01cd961cf1ee77696cb
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 18:20:20 2020 +0900

    pcie: checking bar > 4 for 64bit bars are sufficient
---
 drivers/pcie/pcie_root.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index 2592fbb..362e677 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -193,7 +193,7 @@ int pci_get_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
 int pci_get_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
                   uint64_t *ret)
 {
-  if (bar > 5 || ((bar % 2) != 0))
+  if (bar > 4 || ((bar % 2) != 0))
       return -EINVAL;
 
   uint32_t barmem1;
@@ -253,7 +253,7 @@ int pci_set_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
 int pci_set_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
                   uint64_t val)
 {
-  if (bar > 5 || ((bar % 2) != 0))
+  if (bar > 4 || ((bar % 2) != 0))
       return -EINVAL;
 
   uint32_t barmem1 = (uint32_t)val;
@@ -328,7 +328,7 @@ int pci_map_bar(FAR struct pcie_dev_s *dev, uint32_t bar,
 int pci_map_bar64(FAR struct pcie_dev_s *dev, uint32_t bar,
                   unsigned long length, uint64_t *ret)
 {
-  if (bar > 5 || ((bar % 2) != 0))
+  if (bar > 4 || ((bar % 2) != 0))
       return -EINVAL;
 
   uint32_t barmem1;


[incubator-nuttx] 11/11: pcie: create MSI/MSIX related marcos and simplify the msi/msix routines

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit bf7ed8f9f760a0bccf6b70834ebeac76cef5b39a
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 21:35:42 2020 +0900

    pcie: create MSI/MSIX related marcos and simplify the msi/msix routines
---
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c | 79 +++++++++++++---------
 include/nuttx/pcie/pcie.h                          | 33 ++++++++-
 2 files changed, 77 insertions(+), 35 deletions(-)

diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
index 439532c..0580593 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
@@ -266,53 +266,62 @@ static int qemu_pci_msix_register(FAR struct pcie_dev_s *dev,
   unsigned int bar;
   uint16_t message_control;
   uint32_t table_bar_ind;
-  uint32_t lo_table_addr;
-  uint32_t hi_table_addr;
+  uint32_t table_addr_32;
   uint64_t msix_table_addr = 0;
 
   int cap = pci_find_cap(dev, PCI_CAP_MSIX);
   if (cap < 0)
       return -EINVAL;
 
-  __qemu_pci_cfg_read(dev->bdf, cap + 2, &message_control, 2);
+  __qemu_pci_cfg_read(dev->bdf, cap + PCI_MSIX_MCR,
+                      &message_control, PCI_MSIX_MCR_SIZE);
 
   /* bounds check */
 
-  if (index > (message_control & 0x3ff))
+  if (index > (message_control & PCI_MSIX_MCR_TBL_MASK))
       return -EINVAL;
 
-  __qemu_pci_cfg_read(dev->bdf, cap + 4, &table_bar_ind, 4);
+  __qemu_pci_cfg_read(dev->bdf, cap + PCI_MSIX_TBL,
+                      &table_bar_ind, PCI_MSIX_TBL_SIZE);
 
-  bar = (table_bar_ind & 7) * 4 + PCI_CFG_BAR;
+  bar = (table_bar_ind & PCI_MSIX_BIR_MASK);
 
-  __qemu_pci_cfg_read(dev->bdf, bar, &lo_table_addr, 4);
+  if (!pci_get_bar(dev, bar, &table_addr_32))
+    {
+      /* 32 bit bar */
 
-  if ((lo_table_addr & 6) == PCI_BAR_64BIT)
+      msix_table_addr = table_addr_32;
+    }
+  else
     {
-      __qemu_pci_cfg_read(dev->bdf, bar + 4, &hi_table_addr, 4);
-      msix_table_addr = (uint64_t)hi_table_addr << 32;
+      pci_get_bar64(dev, bar, &msix_table_addr);
     }
 
-  msix_table_addr |= lo_table_addr & ~0xf;
-  msix_table_addr += table_bar_ind & ~0x7;
+  msix_table_addr &= ~0xf;
+  msix_table_addr += table_bar_ind & ~PCI_MSIX_BIR_MASK;
 
   /* enable and mask */
 
-  message_control |= (MSIX_CTRL_ENABLE | MSIX_CTRL_FMASK);
-  __qemu_pci_cfg_write(dev->bdf, cap + 2, &message_control, 2);
+  message_control |= (PCI_MSIX_MCR_EN | PCI_MSIX_MCR_FMASK);
+  __qemu_pci_cfg_write(dev->bdf, cap + PCI_MSIX_MCR,
+                       &message_control, PCI_MSIX_MCR_SIZE);
 
-  msix_table_addr += 16 * index;
-  mmio_write32((uint32_t *)(msix_table_addr),
-               0xfee00000 | up_apic_cpu_id() << 12);
-  mmio_write32((uint32_t *)(msix_table_addr + 4), 0);
-  mmio_write32((uint32_t *)(msix_table_addr + 8), vector);
-  mmio_write32((uint32_t *)(msix_table_addr + 12), 0);
+  msix_table_addr += PCI_MSIX_TBL_ENTRY_SIZE * index;
+  mmio_write32((uint32_t *)(msix_table_addr + PCI_MSIX_TBL_LO_ADDR),
+               0xfee00000 | up_apic_cpu_id() << PCI_MSIX_APIC_ID_OFFSET);
+  mmio_write32((uint32_t *)(msix_table_addr + PCI_MSIX_TBL_HI_ADDR),
+               0);
+  mmio_write32((uint32_t *)(msix_table_addr + PCI_MSIX_TBL_MSG_DATA),
+               vector);
+  mmio_write32((uint32_t *)(msix_table_addr + PCI_MSIX_TBL_VEC_CTL),
+               0);
 
   /* enable and unmask */
 
-  message_control &= ~MSIX_CTRL_FMASK;
+  message_control &= ~PCI_MSIX_MCR_FMASK;
 
-  __qemu_pci_cfg_write(dev->bdf, cap + 2, &message_control, 2);
+  __qemu_pci_cfg_write(dev->bdf, cap + PCI_MSIX_MCR,
+                       &message_control, PCI_MSIX_MCR_SIZE);
 
   return 0;
 }
@@ -342,27 +351,31 @@ static int qemu_pci_msi_register(FAR struct pcie_dev_s *dev, uint16_t vector)
   if (cap < 0)
       return -1;
 
-  uint32_t dest = 0xfee00000 | (up_apic_cpu_id() << 12);
-  __qemu_pci_cfg_write(dev->bdf, cap + 4, &dest, 4);
+  uint32_t dest = 0xfee00000 | (up_apic_cpu_id() << PCI_MSI_APIC_ID_OFFSET);
+  __qemu_pci_cfg_write(dev->bdf, cap + PCI_MSI_MAR, &dest, PCI_MSI_MAR_SIZE);
 
-  __qemu_pci_cfg_read(dev->bdf, cap + 2, &ctl, 2);
-  if (ctl & (1 << 7))
+  __qemu_pci_cfg_read(dev->bdf, cap + PCI_MSI_MCR, &ctl, PCI_MSI_MCR_SIZE);
+  if ((ctl & PCI_MSI_MCR_64) == PCI_MSI_MCR_64)
     {
       uint32_t tmp = 0;
-      __qemu_pci_cfg_write(dev->bdf, cap + 8, &tmp, 4);
-      data = cap + 0x0c;
+      __qemu_pci_cfg_write(dev->bdf,
+                           cap + PCI_MSI_MAR64_HI, &tmp,
+                           PCI_MSI_MAR64_HI_SIZE);
+      data = cap + PCI_MSI_MDR64;
     }
   else
     {
-      data = cap + 0x08;
+      data = cap + PCI_MSI_MDR;
     }
 
-  __qemu_pci_cfg_write(dev->bdf, data, &vector, 2);
+  __qemu_pci_cfg_write(dev->bdf, data, &vector, PCI_MSI_MDR_SIZE);
+
+  __qemu_pci_cfg_write(dev->bdf, cap + PCI_MSI_MCR, &vector,
+                       PCI_MSI_MCR_SIZE);
 
-  __qemu_pci_cfg_write(dev->bdf, cap + 2, &vector, 2);
+  uint16_t tmp = PCI_MSI_MCR_EN;
 
-  uint16_t en = 0x0001;
-  __qemu_pci_cfg_write(dev->bdf, cap + 2, &en, 2);
+  __qemu_pci_cfg_write(dev->bdf, cap + PCI_MSI_MCR, &tmp, PCI_MSI_MCR_SIZE);
 
   return OK;
 }
diff --git a/include/nuttx/pcie/pcie.h b/include/nuttx/pcie/pcie.h
index 8b5b98e..fffc791 100644
--- a/include/nuttx/pcie/pcie.h
+++ b/include/nuttx/pcie/pcie.h
@@ -59,10 +59,39 @@
 #define PCI_DEV_CLASS_OTHER     0xff
 
 #define PCI_CAP_PM              0x01
+
 #define PCI_CAP_MSI             0x05
+# define PCI_MSI_MCR            0x02
+# define PCI_MSI_MCR_SIZE       2
+# define PCI_MSI_MCR_EN         (1 << 0)
+# define PCI_MSI_MCR_64         (1 << 7)
+# define PCI_MSI_MAR            0x04
+# define PCI_MSI_MAR_SIZE       4
+# define PCI_MSI_MDR            0x08
+# define PCI_MSI_MDR_SIZE       2
+# define PCI_MSI_MAR64_HI       0x08
+# define PCI_MSI_MAR64_HI_SIZE  4
+# define PCI_MSI_MDR64          0x0c
+# define PCI_MSI_MDR64_SIZE     2
+# define PCI_MSI_APIC_ID_OFFSET 0xc
+
 #define PCI_CAP_MSIX            0x11
-# define MSIX_CTRL_ENABLE       0x8000
-# define MSIX_CTRL_FMASK        0x4000
+# define PCI_MSIX_MCR           0x02
+# define PCI_MSIX_MCR_SIZE      2
+# define PCI_MSIX_MCR_EN        (1 << 15)
+# define PCI_MSIX_MCR_FMASK     0x4000
+# define PCI_MSIX_MCR_TBL_MASK  0x03ff
+# define PCI_MSIX_TBL           0x04
+# define PCI_MSIX_TBL_SIZE      4
+# define PCI_MSIX_PBA           0x08
+# define PCI_MSIX_PBA_SIZE      4
+# define PCI_MSIX_BIR_MASK      0x07
+# define PCI_MSIX_TBL_ENTRY_SIZE 0x10
+# define PCI_MSIX_TBL_LO_ADDR   0x0
+# define PCI_MSIX_TBL_HI_ADDR   0x4
+# define PCI_MSIX_TBL_MSG_DATA  0x8
+# define PCI_MSIX_TBL_VEC_CTL   0xc
+# define PCI_MSIX_APIC_ID_OFFSET 0xc
 
 /****************************************************************************
  * Public Types


[incubator-nuttx] 04/11: pcie: types array should be null terminated

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 45beb44bdc0e75d30c8c517792c23ab1adb52650
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 15:07:41 2020 +0900

    pcie: types array should be null terminated
---
 drivers/pcie/pcie_root.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index 1fe2181..c5ee688 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -44,6 +44,7 @@ struct pcie_dev_type_s *pci_device_types[] =
 #ifdef CONFIG_VIRT_QEMU_PCI_TEST
   &pcie_type_qemu_pci_test,
 #endif /* CONFIG_VIRT_QEMU_PCI_TEST */
+  NULL,
 };
 
 /****************************************************************************


[incubator-nuttx] 10/11: pcie: cosmetic changes to fit check tools

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch pci
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit b2d0bf8c5fbf1636a6ebabcc5c571795a6cd45b6
Author: Yang Chung-Fan <so...@gmail.com>
AuthorDate: Wed May 6 20:31:01 2020 +0900

    pcie: cosmetic changes to fit check tools
---
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c           | 4 ++--
 boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h | 8 ++++----
 drivers/pcie/pcie_root.c                                     | 1 -
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
index f23bec9..439532c 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie.c
@@ -139,7 +139,7 @@ struct pcie_bus_s qemu_pcie_bus =
 static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
                               FAR const void *buffer, unsigned int size)
 {
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   switch (size)
@@ -175,7 +175,7 @@ static int qemu_pci_cfg_write(FAR struct pcie_dev_s *dev, uintptr_t addr,
 static int qemu_pci_cfg_read(FAR struct pcie_dev_s *dev, uintptr_t addr,
                              FAR void *buffer, unsigned int size)
 {
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   switch (size)
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
index 0665d83..01fc271 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pcie_readwrite.h
@@ -107,7 +107,7 @@ static inline int __qemu_pci_cfg_write(uint16_t bfd, uintptr_t addr,
                                        FAR const void *buffer,
                                        unsigned int size)
 {
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
@@ -152,7 +152,7 @@ static inline int __qemu_pci_cfg_write64(uint16_t bfd, uintptr_t addr,
 {
   int ret;
 
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   ret = __qemu_pci_cfg_write(bfd, addr + 4, buffer + 4, 4);
@@ -181,7 +181,7 @@ static inline int __qemu_pci_cfg_write64(uint16_t bfd, uintptr_t addr,
 static inline int __qemu_pci_cfg_read(uint16_t bfd, uintptr_t addr,
                                       FAR void *buffer, unsigned int size)
 {
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   outl(PCI_CONE | ((uint32_t)bfd << 8) | (addr & 0xfc), PCI_REG_ADDR_PORT);
@@ -228,7 +228,7 @@ static inline int __qemu_pci_cfg_read64(uint16_t bfd,
 {
   int ret;
 
-  if(!buffer)
+  if (!buffer)
       return -EINVAL;
 
   ret = __qemu_pci_cfg_read(bfd, addr + 4, buffer + 4, 4);
diff --git a/drivers/pcie/pcie_root.c b/drivers/pcie/pcie_root.c
index 2b420e1..b85c586 100644
--- a/drivers/pcie/pcie_root.c
+++ b/drivers/pcie/pcie_root.c
@@ -140,7 +140,6 @@ int pci_enumerate(FAR struct pcie_bus_s *bus,
   return OK;
 }
 
-
 /****************************************************************************
  * Name: pcie_initialize
  *