diff --git a/ChangeLog b/ChangeLog index b5567cf8f3a944c10b09e0d907d58bfde93ae741..3653cd3ec4770ef60b3d27ac84ffd876233b03ed 100755 --- a/ChangeLog +++ b/ChangeLog @@ -3130,7 +3130,7 @@ point numbers. * lib/stdio/lib_libdtoa.c and lib_libvsprintf.c: Correct some floating point options. - * arch/arm/lpc43xx/lpc32_usb0dev.c: Add framework for development of + * arch/arm/lpc43xx/lpc43_usb0dev.c: Add framework for development of an USB0, device-side driver for the LPC43XX. The initial check-in, however, is simply for the LPC31xx driver with name changes. The LPC31xx has the same USB IP, but will require some additional initialization @@ -4440,7 +4440,7 @@ * binfmt/binfmt_execmodule.c: Here is a place where I forget to update the call to sched_releasetcb() to pass the thread type as the second parameter (2013-03-23). - * arch/arm/src/lm, kinetis, lpc32, and nuc1xx: Add kernel build + * arch/arm/src/lm, kinetis, lpc43, and nuc1xx: Add kernel build support to all ARMv7-M and ARMv6-M chips. There are no configurations in place to to verify these additions! (2013-03-24). @@ -10964,7 +10964,7 @@ (2015-09-09). * configs/nucleo-f303re: Support for the STMicro Nucleo F303RE board from Paul Alexander Patience (2015-09-10). - * arch/arm/src/lpc43xx/lpc32_ehci.c and .h: LPC43xx EHCI driver from + * arch/arm/src/lpc43xx/lpc43_ehci.c and .h: LPC43xx EHCI driver from Ilya Averyanov (2015-09-10). * ARMv7-M, all "lazy" interrupt stack logic. Assembly instruction that fetches the saved value is incorrect; replace with more @@ -12348,7 +12348,7 @@ adds DEBUGASSERT for invalid geometry and additional memory debug logic. Also fixes the dangling pointer on error bug. From Ken Pettit (2016-07-14). - * arch/arm/src/lpc32xx: Extend LPC43xx EMC code to support SDRAM on a + * arch/arm/src/lpc43xx: Extend LPC43xx EMC code to support SDRAM on a dynamic memory interface. From Vytautas Lukenskas (2016-07-19). * arch/sim/src: Add the simulated QSPI (N25Q) flash to the simulation and modify sim up_spiflash.c to enable it to run with different MTD @@ -12772,6 +12772,9 @@ * STM32 DMA2D: fix an error in up_dma2dcreatelayer where an invalid pointer was returned when a certain underlying function failed. From Jens Gräf (2016-10-07). + +7.19 2016-12-26 Gregory Nutt + * include/nuttx/fs/nxffs.h: Needs forward reference to struct mtd_dev_s and needs to include stdbool.h (2016-10-09). * STM32F103 Minimum: Note in Kconfig that the board supports buttons. @@ -12844,16 +12847,16 @@ (2016-10-19). * libc/locale: Allows c++ code to compile with or without CONFIG_LIBC_LOCALE and will generate a link error if CONFIG_LIBC_LOCALE - is not defined and setlocale is referneced. With CONFIG_LIBC_LOCALE + is not defined and setlocale is referenced. With CONFIG_LIBC_LOCALE defined setlocale will act as if MB string is not supported and return "C" for POSIX. C and "". From David Sidrane (2016-10-19). - * Add vectors for interrupt levels 2-6 (2016-10-20). - * strtof: Add strtof() as simply a copy of strtod with types and + * Xtensa ESP32: Add vectors for interrupt levels 2-6 (2016-10-20). + * strtof(): Add strtof() as simply a copy of strtod with types and limits changed (2016-10-20). * arch/arm/src/stm32v7: Register the watchdog device at the configured device path CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt. From Frank Benkert (2016-10-21). - * configs/*/defdonf The buttons example was changed to archbuttons. As + * configs/*/defconfig: The buttons example was changed to archbuttons. As a result all of the button configurations are broken and need some renaming in the defconfig files. Noted by Frank Berkert (2016-10-21). * configs/stm32f103-minimum: Add support to PWM on STM32F103-Minimum @@ -12909,7 +12912,7 @@ found in the F4. From David Sidrane (2016-10-26). * arch/arm/src/stm32f7: stm32f76xx77xx_pinmap.h Missed one. From David Sidrane (2016-10-26). - * LPC32xx serial: Fix a typo in ioctl TIOCSRS485 ioctl. From Vytautas + * LPC43xx serial: Fix a typo in ioctl TIOCSRS485 ioctl. From Vytautas Lukenskas (2016-10-27). * sched/clock: Correct clock initialization. The correct range for the month is 0-11 but is entered as 1-12 in the .config file @@ -12919,7 +12922,7 @@ * sched/Kconfig: Add ranges to START_YEAR, MONTH, and DAY (2016-10-28). * configs/nucleo-f303re: Add STM32 F303RE hello configuration; remove duplicate setting from board.h. From Marc Rechté (2016-10-18). - * arch/arm/src/lpc32xx: Restore RS485 mode on serial port open (if + * arch/arm/src/lpc43xx: Restore RS485 mode on serial port open (if RS485 is enabled via menuconfig). From Vytautas Lukenskas (2016-10-28). * arch/arm/src/stm32f7: otgdev fixed typo. From David Sidrane (2016-10-28). @@ -12949,14 +12952,12 @@ From Paul A. Patience (2016-11-02). * drivers/ and drivers/spi: Fix Kconfig warning. This commit moves the ARCH_HAVE_SPI options outside the check for SPI. Those options don't - depend on SPI, and Kconfig files in arch/ enable them even if SPI isn't - enabled. - - Sourcing the driver's Kconfig in drivers/Kconfig only if support for - the driver is enabled prevents us from defining these ARCH_HAVE options - in the driver's Kconfig. We should probably remove the other checks in - drivers/Kconfig and check if the drivers are enabled only in their - Kconfig. From Paul A. Patience (2016-11-02). + depend on SPI, and Kconfig files in arch/ enable them even if SPI + isn't enabled. Source the driver's Kconfig in drivers/Kconfig only + if support for the driver is enabled prevents us from defining these + ARCH_HAVE options in the driver's Kconfig. We should probably remove + the other checks in drivers/Kconfig and check if the drivers are + enabled only in their Kconfig. From Paul A. Patience (2016-11-02). * Move protoypes for the non-standard include/semaphore.h file to the non-standard include/nuttx/semaphore.h with the other non-standard semaphore interfaces (2016-11-02). @@ -13100,7 +13101,7 @@ argument so that there can be additional usage. From Sebastien Lorquet (2016-11-17). * All timer lower half drivers. Port Sebastien's changes to all all - other implementations of the timer lower half. Very many just and + other implementations of the timer lower half. Many changes and untested. Expect some problems. (2016-11-17). * sched/irq: irq_csection() has a bad assumption in the SMP case. It assumed that the state of certain variables. That was true on entry @@ -13130,5 +13131,348 @@ So this change adds locking (via enter_critical section) to wdog expiration logic for the the case if the SMP configuration (2016-11-18). - -7.19 2016-xx-xx Gregory Nutt + * SAM3/4: Add delay between setting and clearing the endpoint RESET bit + in sam_ep_resume(). We need to add a delay between setting and + clearing the endpoint reset bit in SAM_UDP_RSTEP. Without the delay the + USB controller will (may?) not reset the endpoint. If the endpoint is + not being reset, the Data Toggle (DTGLE) bit will not to be cleared + which will cause the next transaction to fail if DTGLE is 1. If that + happens the host will time-out and reset the bus. Adding this delay + may also fix the USBMSC_STALL_RACEWAR in usbmsc_scsi.c, however this + has not been verified yet. From Wolfgang Reißnegger (2016-11-18). + * SAM3/4: Remove unused 'halted' flag in UDP driver. From Wolfgang + Reißnegger (2016-11-18). + * SAM3/4: Remove 'stalled' flag in UDP driver. The flag is not necessary. + The state of the endpoint can be determined using 'epstate' instead. + From Wolfgang Reißnegger (2016-11-18). + * USBMSC: Fix length of mode6 sense reply packet. From Wolfgang + Reißnegger (2016-11-18). + * configs/dk-tm4c129x: Typo fix. From Wolfgang Reißnegger (2016-11-18). + * Typo fix in sam_udp.c. From Wolfgang Reißnegger (2016-11-18). + * STM32: STM32F303xB and STM32F303xC chips have 4 ADCs. From Paul A. + Patience (2016-11-19). + * vfork(): Fix a race condition in the SMP case. Existing logic + depended on the fact that the child would not run until waitpid was + called because the child had the same priority as the parent. BUT + in the SMP case that is not true... the child may run immediately on + a different CPU (2016-11-19). + * arch/: Add option to use low-priority work queue to all Ethernet + drivers in arch that support CONFIG_NET_NOINTS (2016-11-19). + * sched/clock: Correct calculation for the case of Tickless mode with + a 32-bit timer. In that case, the calculation was returning + millisecond accuracy. That is not good when the timer accuracy is < 1 + msec. From Rajan Gill (2016-11-19). + * sched/task: task_restart() test not supported on SMP systems. This is + not fully implemented (2016-11-19). + * This commit adds a new internal interfaces and fixes a problem with + three APIs in the SMP configuration. The new internal interface is + sched_cpu_pause(tcb). This function will pause a CPU if the task + associated with 'tcb' is running on that CPU. This allows a different + CPU to modify that OS data stuctures associated with the CPU. When the + other CPU is resumed, those modifications can safely take place. The + three fixes are to handle cases in the SMP configuration where one CPU + does need to make modifications to TCB and data structures on a task + that could be running running on another CPU. Those three cases are + task_delete(), task_restart(), and execution of signal handles. In + all three cases the solutions is basically the same: (1) Call + sched_cpu_pause(tcb) to pause the CPU on which the task is running, + (2) perform the necessary operations, then (3) call up_cpu_resume() to + restart the paused CPU (2016-11-20). + * task_restart: Make sure new task starts with pre-emption disabled and + not in a critical section (2016-11-21). + * Fix a typo in a spinlock macro (2016-11-21). + * Spinlocks: Added capability to provide architecture-specific memory + barriers. This was for i.MX6 but does not help with the SMP problems. + It is still a good feature (2016-11-21). + * Remove a assertion condition that appears to rarely cause false-alarm + assertions. Teported by Petteri Aimonen (2016-11-21). + * The examples/qencoder app was trying to init the encoder by a direct + call into the board, cheating in a local header to declare the normally + unavailable function prototype. From Sebastien Lorquet (2016-11-22). + * configs: All QE encoder files. Last change made timer hard-coded to 3. + Make configurable (2016-11-22). + * configs: Remove all traces of the no-longer existent ARCHBUTTONS + example. Remove all button configurations that depended on the + obsoleted ARCHBUTTON example (2016-11-22). + * nucleo-l476rg: Add better selection of timer (2016-11-22). + * implementation of dumpgpio for stm32l4, was required for pwm debug. + From Sebastien Lorquet (2016-11-22). + * SMP: Add logic to avoid a deadlock condition when CPU1 is hung waiting + for g_cpu_irqlock and CPU0 is waitin for g_cpu_paused (2016-11-22). + * Misoc: Add timer driver. From Ramtin Amin (2016-11-22). + * Misoc: Add commits and warnings about missing caculation of the timer + reload value (2016-11-22). + * SAM3/4: Name of method is now setcallback, not sethandler (2016-11-22). + * sam4s-xplained-pro/nsh: Configuration uses old, improper timer interface. + CONFIG_TIMER disabled in configuration. (2016-11-22). + * sam4s-xplained-pro: Remove obsolete timer initialization logic + (2016-11-22). + * Misoc LM32: Make system timer configurable via CONFIG_USEC_PER_TICK. + From Ramtin Amin (2016-11-23). + * LPC43xx: Add timer driver; configs/bambino-200e: Add support for timer + driver. From Alan Carvalho de Assis (2016-11-23). + * SMP: Fix backward condition in test (2016-11-23). + * ARMv7-A SMP: Add a little logic to signal handling (2016-11-24). + * Misoc LM32: Add signal handling logic. From Ramtin Amin (2016-11-24). + * SMP: Add spin_trylock(). Use this in conditions where other CPUs need + to stopped but we cannot call enter_critical_section (2016-11-24). + * Fix for F1 RTC Clock, tested on F103. From Maciej Wójcik (2016-11-25). + * SMP: Fix yet another potential deadlock (2016-11-25). + * Enable CONFIG_RTC in the hymini-stm32v/nsh2 (kitchensink) config. + From Maciej Wójcik (2016-11-26). + * This adds support for keeping i.MX6 inter-processor communication data + in a non-cached address region (2016-11-26). + * i.MX6: Disable non-cached region support. Add SCU register definitions + (2016-11-26). + * i.MX6: Add some controls to enable SMP cache coherency in SMP mode + (2016-11-26). + * ARMv7-A: Fix some SCU SMP logic (2016-11-26). + * ARMv7-A/i.MX6: Modify handling of the SMP cache coherency + configuration so that it is identical to the steps from the TRM. + Makes no differenct, however (2016-11-27). + * The Smoothie project needs to compile C++ inside config/boardname/src/ + to use with High Priority Interruption, then I modified the board + configs Makefile to support it. It works fine for the first time + compilation, but if we execute "touch config/boardname/src/Pin.cxx" + and execute "make" it will not detect that Pin.cxx was modified. I + think there is some other place I should modify, but I didn't find + it. From Alan Carvalho de Assis (2016-11-27). + * ARMv7-A/i.MX6 SMP: Move SMP coherent cache setup to earlier in + initialization of CPUn, n>0 (2016-11-27). + * ARMv7 GIC: SGIs are non-maskable but go through the same path as other, + maskable interrupts. Added logic to serialize SGI processing when + necessary (2016-11-27). + * sched_note: Extend OS instrumentation to include some SMP events + (2016-11-27). + * sched_note: Add spinlock instrumentation; In SMP configurations, + select to log only notes from certain CPUs (2016-11-28). + * Misoc LM3: Add Misoc Ethernet driver. Integrate network support into + configs/misoc/hello. Remove configs/misoc/include/generated directory. + I suppose the the intent now is that this is a symbolic link? DANGER! + This means that you cannot compile this code with first generating + these files a providing a symbolic link to this location! From Ramtin + Amin (2016-11-28). + * Add tools/showsize.sh (2016-11-28). + * configs/misoc: Add a sample directory containing generated sources. + This is really only useful for performing test builds. You really + must generate the Misoc architecture for a real-life build. From + Ramtin Amin (2016-11-28). + * sched_note: Permit spinlock and critical section notes in in-memory + buffer iff sched_not_get() interfaces is disabled (2016-11-28). + * STM32 DAC: Fix shift value whenever there are is a DAC2 and, hence, + up to three interfaces. From Marc Rechté (2016-11-29). + * Back out a debug change that was included in commit (2016-11-29). + * i.MX6: Don't output the alphabet if CONFIG_DEBUG_FEATURES is not set + (2016-11-29). + * Misoc LM32: Add logic to flush/invalidate caches. From Ramtin Amin + (2016-11-29). + * drivers/net/: Adapt all Ethernet drivers to work as though + CONFIG_NET_MULTIBUFFER were set. Remove all references to + CONFIG_NET_MULTIBUFFER (2016-11-29). + * stm32_otghshost: if STM32F446 increase number of channels to 16. From + Janne Rosberg (2016-11-30). + * usbhost_composite: fix end offset in usbhost_copyinterface(). From + Janne Rosberg (2016-11-30). + * usbhost_cdcacm: add CDC_SUBCLASS_ACM and CDC_PROTO_ATM to supported + class and proto. From Janne Rosberg (2016-11-30). + * LPC43 SD/MMC: Correct some git definitions on SMMC control register + in lpc43_sdmmc.h. From Alan Carvalho de Assis (2016-11-30). + * STM32L4: Correct USART1/2 definitions. Use default mbed UART4 + settings. From Sebastien Lorquet (2016-12-01). + * boardctl: Add new boardctl() command ,BOARDIOC_NX_START, to start the + NX server as a kernel thread (2016-12-01). + * GPDMA driver for the LPC43xx. The GPDMA block is basically the same + as the LPC17xx. Only the clock configuration is different and LPC43xx + has four different DMA request sources, where LPC17xx has only two. + From Alan Carvalho de Assis (2016-12-01). + * Remove RGMP and RGMP drivers (2016-12-02). + * i.MX6: Add an untested SPI driver taken directly from the i.MX1 port + (2016-12-02). + * Eliminate CONFIG_NO_NOINTS. There is no longer any support for + interrupt level processing of the network stack. Lots of files changed + -> lots of testing needed (2016-12-03). + * Fix DEBUGASSERT() in group_signal.c. From Masayuki Ishikawa + (2016-12-04). + * Add support for the SAM5CMP-DB board. From Masayuki Ishikawa + (2016-12-04). + * SAM3/4: Add SMP support for the dual-core SAM4CM. From Masayuki + Ishikawa (2016-12-04). + * C Library: Allow option to enable IP address conversions even when the + IP address family is not supported (2016-12-04). + * SSD1306: Fix errors in SPI mode configuration. From Gong Darcy + (2016-12-04). + * SAMA5 does not build when executing from SDRAM before board + frequencies are not constant. Rather, the bootloader configures the + clocking and we must derive the clocking from the MCK left by the + bootloader. This means lots more computations. This is untested on + initial commit because I don't have a good PWM test setup right now + (2016-12-04). + * Olimex-LPC1766-STK: Enable procfs in NSH configuration. Automount + /proc on startup (2016-12-05). + * SAM4CMP-DB: Add hooks to auto-mount the procfs file system on startup + in board bring-up logic (2016-12-05). + * Remove all references to BOARDIOC_PWMSETUP and board_pwm_setup() + (2016-12-05). + * Remove all references to BOARDIOC_ADCSETUP and board_adc_setup() + (2016-12-05). + * Added Timers 2-5 and control of SAI and I2S PLLs. From David Sidrane + (2016-12-05). + * Added support for stmf469 SAI and I2S PLL configuration and STM446 + fixes. From David Sidrane (2016-12-05). + * Expanded otgfs support to stm32F469 and stm32f446. Added missing bits + definitions, Used stm32F469 and stm32f446 bit definitions, Removed + unsed header file. From David Sidrane (2016-12-05). + * Remove BOARDIOC_CAN_INITIALIZE. CAN initialization is now done in the + board initialization logic just like every other device driver + (2016-12-06). + * STM32F7: Allow the config to override the clock edge setting. From + David Sidrane (2016-12-06). + * For Cortex-A9, should also set ACTLR.FW in SMP mode to enble TLB and + cache broadcasts. Does not fix SMP cache problem (2016-12-07). + * sched notes: Add additional note to see if/when CPU is started in SMP + mode (2016-12-07). + * EFM32: Fix a compilation error. From Pierre-noel Bouteville + (2016-12-07). + * pthreads: Add pthread_cleanup_push() and pthread_cleanup_pop() + (2016-12-08). + * BUGFIX:STM32F427 was rebooting. Over reached family. From David + Sidrane (2016-12-08). + * Add pthread_setcanceltype() and pthread_testcancel() (2016-12-09). + * Added STM32F469 RAM size and deliberated STM32F446 size. From David + Sidrane (2016-12-09). + * Typo in stm32f76xx77xx_pinmap.h edited online with Bitbucket. From + David Sidrane (2016-12-09). + * stm32_allocateheap.c edited online with Bitbucket. From David Sidrane + (2016-12-09). + * LPC43xx SD card: Correct pin configuration options needed for SD card + pins. From Alan Carvalho de Assis (2016-12-09). + * pthread_mutex_destroy(): Fix an error in destroying a mutex which can + occur after a pthread has been canceled while holding the mutex + (2016-12-09). + * Add support for cancellation points (2016-12-09). + * Forgot to add some files in the last commit (2016-12-10). + * Correct some default font IDs. From Pierre-Noel Bouteville + (2016-12-10). + * task_delete() now obeys all cancellation point semantics (2016-12-10). + * Add task_setcancelstate(), task_setcanceltype(), and task_testcancel(). + These are non-standard interfaces analogous to the correponding pthread_ + interfaces that provide cancellation controls for tasks (2016-12-10). + * i.MX6 interrupt handling: Additional logic needed to handle nested + interrupts when an interrupt stack is used (2016-12-13). + * SAMV7 MCAN: Prevent Interrupt-Flooding of ACKE when not connected to + CAN-BUS. An Acknowledge-Error will occur every time no other CAN Node + acknowledges the message sent. This will also occur if the device is + not connected to the can-bus. The CAN-Standard declares, that the Chip + has to retry a given message as long as it is not sent successfully (or + it is not cancelled by the application). Every time the chip tries to + resend the message an Acknowledge-Error-Interrupt is generated. At high + baud rates this can lead in extremely high CPU load just for handling + the interrupts (and possibly the error handling in the application). To + prevent this Interrupt-Flooding we disable the ACKE once it is seen as + long we didn't transfer at least one message successfully. From Frank + Benkert (2016-12-13). + * i.MX6: Remove non-cached, inter-cpu memory region. Not a useful + concept (2016-12-13). + * minnsh Configurations: Remove minnsh configurations and support logic: + up_getc() and lowinstream. This was an interesting exercise to see + just how small you could get NuttX, but otherwise it was not useful: + (1) the NSH code violated the OS interface layer by callup up_getc and + up_putc directly, and (2) while waiting for character input, NSH would + call up_getc() which would hog all of the CPU. Not a reasonable + solution other than as a proof of concept (2016-12-13). + * Calypso Boards: Remove all Calypso board configurations (2016-12-13). + * Calypso: Remove Calypso architecture support and support for Calypso + SERCOMM driver (2016-12-13). + * ESP32 core v2: Two changes (1) flushes the UART TX buffer in the esp32 + serial shutdown routine. The ROM bootloader does not flush the FIFO + before handing over to user code, so some of this output is not + currently seen when the UART is reconfigured in early stages of + startup. And changes the openocd config file's default flash voltage + from 1.8V to 3.3V. This is not necessary right now, but may save some + hard-to-debug moments down the track (3.3V-only flash running at 1.8V + often half-works and does weird things...). From Angus Gratton + (2016-12-14). + * Xtensa ESP32: Add missing ENTRY() and RET() macros in C callable + assembly language. At one time I though the that the ESP32 support the + CALL0 ABI. I was mistaken so there may be a few more like this + (2016-12-14). + * Xtensa ESP32: Fix a couple of bugs associated with handling of CPU + interrupts (2016-12-14). + * Xtensa ESP32: Fix several build-related issues associated with vector + section (2016-12-15). + * Xtensa ESP32: Fix missing CALL0 ABI condition (2016-12-15). + * Xtensa EPS32: Make sure that all C callable assembly functions includes + ENTRY prologue and RET epilogue (2016-12-15). + * Xtensa ESP32: Fix windowspill register handling + Use r6, not r2 when + passing paramters with call4 (2016-12-16). + * Xtensa ESP32: Use r6, not r2 when passing paramters with call4 + (2016-12-16). + * Xtensa ESP32: Correct a logic problem the prevented dumping the IDLE + thread's stack on an assertion (2016-12-16). + * Xtensa ESP32: Fix some missing SMP logic (2016-12-16). + * Xtensa ESP32: Basically a redesign of the interrupt dispatch logic + (2016-12-16). + * Xtensa ESP32: Level 1 interrupts should return via RFE (2016-12-17). + * Xtensa ESP32: One register getting clobber on context save (2016-12-17). + * STM32 F7: Fix some STM32F7 copy paste errors. From David Sidrane + (2016-12-17). + * CDC/ACM Device Class: uart_ops_s portion of cdcacm will not be + initalized with correct functions if CONFIG_SERIAL_DMA is lit + (2016-12-17). + * Xtensa ESP32: Using wrong register to disable interrupts (2016-12-17). + * Xtensa ESP32: Fix clobbered a9 in co-processor context save/restore + (2016-12-17). + * Xtensa ESP32: Need to clone some logic for synchronous context switch. + Window spill logic in the conmon restores logic is inappropriate in + this context (2016-12-17). + * sscanf(): Add scansets to the scanf function. Enabled + CONFIG_LIBC_SCANSET option. From Aleksandr Vyhovanec (2016-12-17). + * Xtensa ESP32: Fix context save logic when called in window ABI + configuration. Add an IDLE stack. Don't depend on the mystery stack + received from the bootloader (2016-12-18). + * Xtensa ESP32: Need to spill registers to memory as the last dying + action before switching to a new thread (2016-12-18). + * ESP32 Serial: Add logic to prevent infinite loops in interrupt handler + (2016-12-18). + * Xtensa ESP32: Automatically mount /proc at start-up (2016-12-19). + * Xtensa ESP32: Corrects timer initialization and timer input frequency + (2016-12-19). + * Tiva PWM: Support PWM_PULSECOUNT feature for TI tiva. From Young.Mu + (2016-12-20). + * Xtensa ESP32: Missing prologue/epilogue macros on C callable function + (2016-12-20). + * Xtensa ESP32: Update APP CPU startup logic to match current Expressif + example code. Fix errors APP CPU startup (2016-12-20). + * fs/procfs: Fix procfs status for SMP case (2016-12-20). + * Xtensa ESP32: Clock frequency is different if running from IRAM or is + booting from FLASH. This is a booltloader issue (2016-12-20). + * Xtensa ESP32: Basic port is function in both single CPU and dual CPU + SMP configurations. There is an NSH configuration for each CPU + configuration (2016-12-21). + * STM32 F4: Merge in support for the Olimex STM32 P407 board (2016-12-21). + * Xtensa ESP32: Add an OS test to verify the port (2016-12-22). + * Xtensa ESP32: Corrects a problem with dispatching to signal handlers: + Cannot vector directly to the signal handling function as in other ABIs + under the Xtensa Window ABI. In that case, we need to go through a + tiny hook when performs the correct window call (call4) otherwise + registers will be scrambled in the signal handler (2016-12-22). + * SAMV7 CAN: Make delete_filter functions more robust. From Frank + Benkert (2016-12-23). + * Xtensa ESP32: Add stack checking logic (2016-12-23). + * sched note: record ID enumeration now results on constant values; ID + values do not change with configuration. This makes writing + post-processing software much easier (2016-12-24). + * STM32 F3: Forgot to update chip.h for STM32F303x[BC]'s 4 ADCs + (2016-12-24). + * STM32 F4: Allow dma in 1 bit mode in STM32F4xxx. From David Sidrane + (2016-12-24). + * termios.h: Fix CRTSCTS define to include input and output flow. + From Lorenz Meier (2016-12-26). + * SMP: Enforce this rule: Tasks which are normally restored when + sched_unlock() is called must remain pending (1) if we are in a + critical section, i.e., g_cpu_irqlock is locked , or (2) other CPUs + still have pre-emption disabled, i.e., g_cpu_schedlock is locked. In + those cases, the release of the pending tasks must be deferred until + those conditions are met (2016-12-26). + +7.20 2017-xx-xx Gregory Nutt diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 18963bc574faffc9b866e0b128e4280fbb841638..decdfae63496ac683b0fc98e92f02d2c22a7d2eb 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: October 8, 2016

+

Last Updated: December 26, 2016

@@ -317,7 +317,7 @@

-

  • POSIX/ANSI-like task controls, named message queues, counting semaphores, clocks/timers, signals, pthreads, environment variables, filesystem.
  • +
  • POSIX/ANSI-like task controls, named message queues, counting semaphores, clocks/timers, signals, pthreads, cancellation points, environment variables, filesystem.
  • @@ -1339,11 +1339,11 @@

    Released Versions

    In addition to the ever-changing GIT repository, there are frozen released versions of NuttX available. - The current release is NuttX 7.18. - NuttX 7.18 is the 118th release of NuttX. - It was released on October 8, 2016, and is available for download from the + The current release is NuttX 7.19. + NuttX 7.19 is the 119th release of NuttX. + It was released on December 26, 2016, and is available for download from the Bitbucket.org website. - Note that the release consists of two tarballs: nuttx-7.18.tar.gz and apps-7.18.tar.gz. + Note that the release consists of two tarballs: nuttx-7.19.tar.gz and apps-7.19.tar.gz. Both may be needed (see the top-level nuttx/README.txt file for build information).

    @@ -1352,7 +1352,7 @@
    • nuttx.

        - Release notes for NuttX 7.18 are available here. + Release notes for NuttX 7.19 are available here. Release notes for all released versions on NuttX are available in the Bitbucket GIT. The ChangeLog for all releases of NuttX is available in the ChangeLog file that can viewed in the Bitbucket GIT. The ChangeLog for the current release is at the bottom of that file. @@ -1360,7 +1360,7 @@

    • apps.
    • +
    • Misoc +
    • Renesas/Hitachi:
      • Renesas/Hitachi SuperH (1/2)
      • @@ -1453,6 +1457,15 @@ +
      • RISC-V (1) +
          +
        +
      • +
      • Xtensa LX6: + +
      • ZiLOG
      • +
      • Expressif +
          +
        • ESP32 (Dual Xtensa LX6) +
        +
      • Freescale
      • - -
      • Moxa
      • + +
      • nuvoTon
        • nuvoTon NUC120 (ARM Cortex-M0)
        • @@ -1604,7 +1622,6 @@
        • Texas Instruments (some formerly Luminary)
          • TI TMS320-C5471 (ARM7TDMI)
          • -
          • TI Calypso (ARM7TDMI)
          • TI TMS320-DM320 (ARM9E6JS)
          • TI/Stellaris LM3S6432 (ARM Cortex-M3)
          • TI/Stellaris LM3S6432S2E (ARM Cortex-M3)
          • @@ -1695,31 +1712,6 @@

            - -
            - -

            - TI Calypso. - This port supports the TI "Calypso" MCU used in various cell phones (and, in particular, - by the Osmocom-bb project). - Like the c5471, NuttX operates on the ARM7 of this dual core processor. - Board support is available for the Motorola C139, C155 and W220 phones and for the Pirelli DP-L10 phone. -

            -
              -

              - STATUS: - This port was contributed by Denis Carilki and includes the work of Denis Carikli, Alan Carvalho de Assis, and Stefan Richter. - Calypso support first appeared in NuttX-6.17 with LCD drivers. - Support for the Calypso keyboard was added in NuttX-6.24 by Denis Carilki. - Refer to the NuttX board README files for the Compal E88, Compal E99 and Pirelli DP-L10 phones for further information. -

              -
            - - - -
            -
            -
            @@ -3160,7 +3152,7 @@ nsh>
          • Kamami STM32 Butterfly 2 - Support for the Kamami STM32 Butterfly 2 was contributed by Michał Łyszczek in NuttX-7/18. That port features the STMicro STM32F107VC MCU. + Support for the Kamami STM32 Butterfly 2 was contributed by Michał Łyszczek in NuttX-7.18. That port features the STMicro STM32F107VC MCU.

            STATUS: @@ -3743,11 +3735,14 @@ nsh>

          • NuttX-7.3 Support for the Olimex STM32 H405 board was added in NuttX-7.3.
          • -
          • - Refer to the NuttX board README file for further information. +
          • NuttX-7.19 + Support for the Olimex STM32 P405 board was added in NuttX-7.19.

          +

          + Refer to the STM3240G-EVAL board README file for further information. +

          STMicro STM32F4-Discovery. This port uses the STMicro STM32F4-Discovery board featuring the STM32F407VGT6 MCU. @@ -3817,6 +3812,11 @@ nsh> Networking configurations were added in NuttX-7.18. See the NuttX board README file for further information about the NuttX port.

          +

          + Olimex STM32 P407. + Support for the Olimex STM32 P407 development board appeared in NuttX-7.19. + See the NuttX board README file for further information about the NuttX port. +

          @@ -4332,7 +4332,7 @@ Mem: 29232 5920 23312 23312

          - Atmel SAM4C. + Atmel SAM4CM. General architectural support was provided for SAM4CM family in NuttX 7.3 This was architecture-only support, meaning that support for the boards with these chips is available, but no support for any publicly available boards was included. The SAM4CM port should be compatible with most of the SAM3/4 drivers (like HSMCI, DMAC, etc.) but those have not be verified on hardware as of this writing. @@ -4340,6 +4340,18 @@ Mem: 29232 5920 23312 23312

          + +
          + +

          + Atmel SAM4CMP-DB. + Support for the SAM4CMP-DB board was contributed to NuttX by Masayuki Ishikawa in NuttX-7.19. + The SAM4CM is a dual-CPU part and SMP was included for the ARMv7-M and SAM3/4 families. + The SAM4CMP-DB board support includes an NSH configuration that operates in an SMP configuration. + Refer to the NuttX board README file for further information. +

          + +

          @@ -4856,6 +4868,23 @@ Mem: 29232 5920 23312 23312
        + + + + + Misoc LM32. + + + +
        + +

        + Misoc LM32 Architectural Support. + Architectural support for the Misoc LM32 was contributed by Ramtin Amin in NuttX 7.19. Driver support is basic in this initial release: Serial, Timer, and Ethernet. "Board" support is a available for developing with Misoc LM32 under Qemu or on your custom FPGA. +

        + + + @@ -4920,34 +4949,6 @@ Mem: 29232 5920 23312 23312
      - -
      -
      - - -
      - -

      - RGMP. - RGMP stands for RTOS and GPOS on Multi-Processor. - RGMP is a project for running GPOS and RTOS simultaneously on multi-processor platforms - You can port your favorite RTOS to RGMP together with an unmodified Linux to form a hybrid operating system. - This makes your application able to use both RTOS and GPOS features. -

      -

      - See the RGMP Wiki for further information about RGMP. -

      -
        -

        - STATUS: - This initial port of NuttX to RGMP was provided in NuttX-6.3. - This initial RGP port provides only minimal driver support and does not use the native NuttX interrupt system. - This is a great, stable starting point for anyone interest in working with NuttX under RGMP! - Refer to the NuttX README file for further information. -

        -
      - - @@ -5250,6 +5251,53 @@ BFD_ASSERT (*plt_offset != (bfd_vma) -1);
    + + + + + + RISC-V. + + + +
    + +

    + RISC-V Architectural Support. + Basic support for the RISC-V architecture was contributed by Ken Pettit in NuttX-7.19. The initial release is thin but a great starting point for anyone interested in RISC-V development with NuttX. +

    + + + + + + + ESP32 (Dual Xtensa LX6). + + + +
    + +

    + Xtensa LX6 ESP32 Architectural Support. + Basic architectural support for Xtensa LX6 processors and the port for the Expressif ESP32 were added in NuttX-7.19. + The basic ESP32 port is function in both single CPU and dual CPU SMP configurations. +

    +

    + Expressif ESP32 Core v2 Board + The NuttX release includes support for Expressif ESP32 Core v2 board. + There is an NSH configuration for each CPU configuration and an OS test configuration for verificatin of the port. +

    +

    + STATUS. + ESP32 support in NuttX-7.19 is functional, but very preliminary. + There is little yet in the way of device driver support. + Outstanding issues include missing clock configuration logic, missing partition tables to support correct configuration from FLASH, and some serial driver pin configuration issues. + The configuration is usable despite these limitations. + Refer to the NuttX board README file for further information. + + + diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 8ecbf7abc7f1708c44a339850d500be216c4a450..f1007f49926cbb047c9535d5eba895ec3e17055a 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -1008,10 +1008,6 @@ drivers/ | |-- Kconfig | |-- Make.defs | `-- (Common sensor driver source files) -|-- sercomm/ -| |-- Kconfig -| |-- Make.defs -| `-- (Files for the Calypso SERCOMM driver) |-- serial/ | |-- Kconfig | |-- Make.defs @@ -1170,8 +1166,6 @@ include/ | | `-- (Power management header files) | |-sensors/ | | `-- (Sensor device driver header files) -| |-sercomm/ -| | `-- (SERCOMM driver header files) | |-serial/ | | `-- (Serial driver header files) | |-spi/ diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 3766eba646fda9464e641f870b44ecacf44972e0..5f1b35ca94605e132238f17d98af62eb238ddf81 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

    NuttX Operating System

    User's Manual

    by

    Gregory Nutt

    -

    Last Updated: July 24, 2015

    +

    Last Updated: December 11, 2016

    @@ -204,48 +204,57 @@ paragraphs.
  • 2.1.4 task_delete
  • 2.1.5 task_restart
  • +

    + Non-standard extensions to VxWorks-like interfaces to support POSIX Cancellation Points. +

    +

    Standard interfaces

    Standard vfork and exec[v|l] interfaces:

    Standard posix_spawn interfaces:

    Non-standard task control interfaces inspired by posix_spawn:

    2.1.1 task_create

    @@ -469,8 +478,21 @@ int task_delete(pid_t pid);

    Description: - This function causes a specified task to cease to exist -- its stack and TCB will be deallocated. - This function is the companion to task_create(). + This function causes a specified task to cease to exist. + Its stack and TCB will be deallocated. + This function is the companion to task_create(). + This is the version of the function exposed to the user; + it is simply a wrapper around the internal, task_terminate() function. +

    +

    + The logic in this function only deletes non-running tasks. + If the pid parameter refers to to the currently runing task, then processing is redirected to exit(). + This can only happen if a task calls task_delete() in order to delete itself. +

    +

    + This function obeys the semantics of pthread cancellation: + task deletion is deferred if cancellation is disabled or if deferred cancellation is supported (with Cancellation Points enabled). +

    Input Parameters:

      @@ -485,7 +507,8 @@ int task_delete(pid_t pid);
      • OK, or ERROR if the task cannot be deleted. - This function can fail if the provided pid does not correspond to a task (errno is not set). + The errno is set to indicate the nature of the failure. + This function can fail, for example, if the provided pid does not correspond to a currently executing task.

      @@ -583,7 +606,128 @@ VxWorks provides the following similar interface:

    -

    2.1.6 exit

    +

    2.1.6 task_setcancelstate

    +

    +Function Prototype: +

    +

    +    #include <sched.h>
    +    int task_setcancelstate(int state, int *oldstate);
    +
    +

    +Description: +The task_setcancelstate() function atomically +sets both the calling task's cancelability state to the indicated +state and returns the previous cancelability state at the location +referenced by oldstate. +Legal values for state are TASK_CANCEL_ENABLE and TASK_CANCEL_DISABLE. +

    +

    +Any pending thread cancellation may occur at the time that the +cancellation state is set to TASK_CANCEL_ENABLE. +

    +

    +The cancelability state and type of any newly created tasks are TASK_CANCEL_ENABLE and TASK_CANCEL_DEFERRED respectively. +

    +Input Parameters: +

    +

    +

      +
    • state +New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.
    • +
    • oldstate. +Location to return the previous cancellation state. +
    +

    +

    +Returned Value: +

    +

    +Zero (OK) on success; ERROR is returned on any failure with the errno value set appropriately: +

    +

    +

      +
    • ESRCH. +No thread could be found corresponding to that specified by the given thread ID.
    • +
    +

    +Assumptions/Limitations: +

    +POSIX Compatibility: This is a non-standard interface. It extends the functionality of pthread_setcancelstate() to tasks and supports use of task_delete(). +

    + +

    2.1.7 task_setcanceltype

    +

    +Function Prototype: +

    +

    +    #include <sched.h>
    +    int task_setcanceltype(int type, FAR int *oldtype);
    +
    +

    +Description: +The task_setcanceltype() function atomically both sets the calling task's cancelability type to the indicated type and returns the previous cancelability type at the location referenced by oldtype. +Legal values for type are TASK_CANCEL_DEFERRED and TASK_CANCEL_ASYNCHRONOUS. +

    +

    +The cancelability state and type of any newly created tasks are TASK_CANCEL_ENABLE and TASK_CANCEL_DEFERRED respectively. +

    +

    +Input Parameters: +

    +

    +

      +
    • type +New cancellation state. One of PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.
    • +
    • oldtype. +Location to return the previous cancellation type. +
    +

    +

    +Returned Value: +

    +

    +Zero (OK) on success; ERROR is returned on any failure with the errno value set appropriately: +

    +

    +

      +
    • ESRCH. +No thread could be found corresponding to that specified by the given thread ID.
    • +
    +

    +

    +POSIX Compatibility: This is a non-standard interface. It extends the functionality of pthread_setcanceltype() to tasks and supports use of task_delete(). +

    + +

    2.1.8 task_testcancel

    +

    +Function Prototype: +

    +

    +

    +    #include <sched.h>
    +    void task_testcancel(void);
    +
    +

    +

    +Description: +

    +

    +The task_testcancel() function creates a Cancellation Point in the calling task. +The task_testcancel() function has no effect if cancelability is disabled. +

    +

    +Input Parameters: None +

    +

    +Returned Value: None +

    +

    +POSIX Compatibility: This is a non-standard interface. It extends the functionality of pthread_testcancel() to tasks and supports use of task_delete(). +

    + + +

    2.1.9 exit

    Function Prototype: @@ -629,7 +773,7 @@ And the UNIX interface:

  • The code parameter is ignored. -

    2.1.7 getpid

    +

    2.1.10 getpid

    Function Prototype: @@ -657,7 +801,7 @@ level. Compatible with the POSIX interface of the same name.

    -

    2.1.8 vfork

    +

    2.1.11 vfork

    Function Prototype:

    @@ -691,7 +835,7 @@ pid_t vfork(void); Compatible with the Unix interface of the same name.

    -

    2.1.9 execv

    +

    2.1.12 execv

    Function Prototype:

    @@ -777,7 +921,7 @@ int execv(FAR const char *path, FAR char *const argv[]); There are, however, several compatibility issues as detailed in the description above.

    -

    2.1.10 execl

    +

    2.1.13 execl

    Function Prototype:

    @@ -821,7 +965,7 @@ int execl(FAR const char *path, ...); There are, however, several compatibility issues as detailed in the description of execv().

    -

    2.1.11 posix_spawn and posix_spawnp

    +

    2.1.14 posix_spawn and posix_spawnp

    Function Prototype:

    @@ -964,7 +1108,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file, For the caller of posix_spawn(), the provided argv[0] will correspond to argv[1] received by the new task.

    -

    2.1.12 posix_spawn_file_actions_init

    +

    2.1.15 posix_spawn_file_actions_init

    Function Prototype:

    @@ -990,7 +1134,7 @@ int posix_spawn_file_actions_init(FAR posix_spawn_file_actions_t *file_actions); On success, this function returns 0; on failure it will return an error number from <errno.h>.

    -

    2.1.13 posix_spawn_file_actions_destroy

    +

    2.1.16 posix_spawn_file_actions_destroy

    Function Prototype:

    @@ -1017,7 +1161,7 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.14 posix_spawn_file_actions_addclose

    +

    2.1.17 posix_spawn_file_actions_addclose

    Function Prototype:

    @@ -1048,7 +1192,7 @@ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actio On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.15 posix_spawn_file_actions_adddup2

    +

    2.1.18 posix_spawn_file_actions_adddup2

    Function Prototype:

    @@ -1085,7 +1229,7 @@ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_action On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.16 posix_spawn_file_actions_addopen

    +

    2.1.19 posix_spawn_file_actions_addopen

    Function Prototype:

    @@ -1130,7 +1274,7 @@ int posix_spawn_file_actions_addopen(FAR posix_spawn_file_actions_t *file_action On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.17 posix_spawnattr_init

    +

    2.1.20 posix_spawnattr_init

    Function Prototype:

    @@ -1166,7 +1310,7 @@ int posix_spawnattr_init(FAR posix_spawnattr_t *attr); On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.18 posix_spawnattr_getflags

    +

    2.1.21 posix_spawnattr_getflags

    Function Prototype:

    @@ -1196,7 +1340,7 @@ int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr, FAR short *flags On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.19 posix_spawnattr_getschedparam

    +

    2.1.22 posix_spawnattr_getschedparam

    Function Prototype:

    @@ -1226,7 +1370,7 @@ int posix_spawnattr_getschedparam(FAR const posix_spawnattr_t *attr, FAR struct On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.20 posix_spawnattr_getschedpolicy

    +

    2.1.23 posix_spawnattr_getschedpolicy

    Function Prototype:

    @@ -1256,7 +1400,7 @@ int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr, FAR int *p On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.21 posix_spawnattr_getsigmask

    +

    2.1.24 posix_spawnattr_getsigmask

    Function Prototype:

    @@ -1288,7 +1432,7 @@ int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr, FAR sigset_t * On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.22 posix_spawnattr_setflags

    +

    2.1.25 posix_spawnattr_setflags

    Function Prototype:

    @@ -1318,7 +1462,7 @@ int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags); On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.23 posix_spawnattr_setschedparam

    +

    2.1.26 posix_spawnattr_setschedparam

    Function Prototype:

    @@ -1348,7 +1492,7 @@ int posix_spawnattr_setschedparam(FAR posix_spawnattr_t *attr, FAR const struct On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.24 posix_spawnattr_setschedpolicy

    +

    2.1.27 posix_spawnattr_setschedpolicy

    Function Prototype:

    @@ -1378,7 +1522,7 @@ int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy); On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.25 posix_spawnattr_setsigmask

    +

    2.1.28 posix_spawnattr_setsigmask

    Function Prototype:

    @@ -1410,7 +1554,7 @@ int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr, FAR const sigset_t * On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.26 task_spawn

    +

    2.1.29 task_spawn

    Function Prototype:

    @@ -1524,7 +1668,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, This is a non-standard interface inspired by posix_spawn().

    -

    2.1.26 task_spawnattr_getstacksize

    +

    2.1.30 task_spawnattr_getstacksize

    Function Prototype:

    @@ -1554,7 +1698,7 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, FAR size_t *s On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.26 task_spawnattr_setstacksize

    +

    2.1.31 task_spawnattr_setstacksize

    Function Prototype:

    @@ -1584,7 +1728,7 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, size_t stacksize); On success, this function returns 0; on failure it will return an error number from <errno.h>

    -

    2.1.12 posix_spawn_file_actions_init

    +

    2.1.32 posix_spawn_file_actions_init

    Function Prototype:

    @@ -3380,6 +3524,29 @@ interface of the same name. inheritance logic.
  • +

    + Locking versus Signaling Semaphores. + Semaphores (and mutexes) may be used for many different purposes. + One typical use of for mutual exclusion and locking of resources: + In this usage, the thread that needs exclusive access to a resources takes the semaphore to get access to the resource. + The same thread subsequently releases the seamphore count when it no longer needs exclusive access. + Priority inheritance is intended just for this usage case. +

    +

    + In a different usage case, a semaphore may to be used to signal an event: + One thread A waits on a semaphore for an event to occur. + When the event occurs, another thread B will post the semaphore waking the waiting thread A. + This is a completely different usage model; notice that in the mutual exclusion case, the same thread takes and posts the semaphore. In the signaling case, one thread takes the seamphore and a different thread posts the samphore. Priority inheritance should never be used in this signaling case. + Subtle, strange behaviors may result. +

    +

    + When priority inheritance is enabled with CONFIG_PRIORITY_INHERITANCE, the default protocol for the semaphore will be to use priority inheritance. + For signaling semaphores, priority inheritance must be explicitly disabled by calling sem_setprotocol with SEM_PRIO_NONE. + For the case of pthread mutexes, pthread_mutexattr_setprotocol with PTHREAD_PRIO_NONE. +

    +

    + This is discussed in much more detail on this Wiki page. +

    POSIX semaphore interfaces:

    @@ -3394,6 +3561,8 @@ interface of the same name.
  • 2.5.8 sem_trywait
  • 2.5.9 sem_post
  • 2.5.10 sem_getvalue
  • +
  • 2.5.11 sem_getprotocol
  • +
  • 2.5.12 sem_setprotocol
  • 2.5.1 sem_init

    @@ -3868,6 +4037,75 @@ number of tasks waiting for the semaphore. interface of the same name.

    +

    2.5.11 sem_getprotocol

    +

    +Function Prototype: +

    +

    +    #include <nuttx/semaphore.h>
    +    int sem_getprotocol(FAR const pthread_mutexattr_t *attr, FAR int *protocol);
    +
    +

    +Description: Return the value of the semaphore protocol attribute. +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the semaphore to be queried
    • +
    • protocol. The user provided location in which to store the protocol value. May be one of SEM_PRIO_NONE, or SEM_PRIO_INHERIT, SEM_PRIO_PROTECT.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the sem_getprotocol() function will return zero (OK). +Otherwise, an -1 (ERROR) will be returned and the errno value will be set to indicate the nature of the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Non-standard NuttX interface. Should not be used in portable code. Analogous to pthread_muxtexattr_getprotocol(). +

    + +

    2.5.12 sem_setprotocol

    +

    +Function Prototype: +

    +

    +    #include <nuttx/semaphore.h>
    +    int sem_setprotocol(FAR pthread_mutexattr_t *attr, int protocol);
    +
    +

    +Description: Set semaphore protocol attribute. See the paragraph Locking versus Signaling Semaphores for some important information about the use of this interface. + +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the semaphore to be modified
    • +
    • protocol. The new protocol to use. One of SEM_PRIO_NONE, or SEM_PRIO_INHERIT, SEM_PRIO_PROTECT. SEM_PRIO_INHERIT is supported only if CONFIG_PRIORITY_INHERITANCE is defined; SEM_PRIO_PROTECT is not currently supported in any configuration.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the sem_getprotocol() function will return zero (OK). +Otherwise, an -1 (ERROR) will be returned and the errno value will be set to indicate the nature of the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Non-standard NuttX interface. Should not be used in portable code. Analogous to pthread_muxtexattr_setprotocol(). +

    +
    @@ -4587,9 +4825,9 @@ interface of the same name. See the NuttX Threading Wiki page and the Tasks vs. Threads FAQ for additional information on tasks and threads in NuttX.

    - Signalling Multi-threaded Task Groups. + Signaling Multi-threaded Task Groups. The behavior of signals in the multi-thread task group is complex. - NuttX emulates a process model with task groups and follows the POSIX rules for signalling behavior. + NuttX emulates a process model with task groups and follows the POSIX rules for signaling behavior. Normally when you signal the task group you would signal using the task ID of the main task that created the group (in practice, a different task should not know the IDs of the internal threads created within the task group); that ID is remembered by the task group (even if the main task thread exits).

    @@ -5424,12 +5662,15 @@ be sent.

  • 2.8.13 pthread_exit
  • 2.8.14 pthread_cancel
  • 2.8.15 pthread_setcancelstate
  • -
  • 2.8.16 pthread_testcancelstate
  • -
  • 2.8.17 pthread_join
  • -
  • 2.8.18 pthread_yield
  • -
  • 2.8.19 pthread_self
  • -
  • 2.8.20 pthread_getschedparam
  • -
  • 2.8.21 pthread_setschedparam
  • +
  • 2.8.16 pthread_setcanceltype
  • +
  • 2.8.17 pthread_testcancel
  • +
  • 2.8.18 pthread_cleanup_pop
  • +
  • 2.8.19 pthread_cleanup_push
  • +
  • 2.8.20 pthread_join
  • +
  • 2.8.21 pthread_yield
  • +
  • 2.8.22 pthread_self
  • +
  • 2.8.23 pthread_getschedparam
  • +
  • 2.8.24 pthread_setschedparam
  • Thread Specific Data. @@ -5439,64 +5680,66 @@ be sent. (2) The main task thread does not had thread-specific data.

    pthread Mutexes.

    Condition Variables.

    Barriers.

    Initialization.

    Signals.

    @@ -5515,8 +5758,6 @@ be sent.

  • pthread_attr_setscope. get and set the contentionscope attribute.
  • pthread_attr_setstack. get and set stack attributes.
  • pthread_attr_setstackaddr. get and set the stackaddr attribute.
  • -
  • pthread_cleanup_pop. establish cancellation handlers.
  • -
  • pthread_cleanup_push. establish cancellation handlers.
  • pthread_condattr_getclock. set the clock selection condition variable attribute.
  • pthread_condattr_getpshared. get the process-shared condition variable attribute.
  • pthread_condattr_setclock. set the clock selection condition variable attribute.
  • @@ -5527,9 +5768,7 @@ be sent.
  • pthread_mutex_setprioceiling. get and set the priority ceiling of a mutex.
  • pthread_mutex_timedlock. lock a mutex.
  • pthread_mutexattr_getprioceiling. get and set the prioceiling attribute of the mutex attributes object.
  • -
  • pthread_mutexattr_getprotocol. get and set the protocol attribute of the mutex attributes object.
  • pthread_mutexattr_setprioceiling. get and set the prioceiling attribute of the mutex attributes object.
  • -
  • pthread_mutexattr_setprotocol. get and set the protocol attribute of the mutex attributes object.
  • pthread_rwlock_destroy. destroy and initialize a read-write lock object.
  • pthread_rwlock_init. destroy and initialize a read-write lock object.
  • pthread_rwlock_rdlock. lock a read-write lock object for reading.
  • @@ -5543,14 +5782,12 @@ be sent.
  • pthread_rwlockattr_getpshared. get and set the process-shared attribute of the read-write lock attributes object.
  • pthread_rwlockattr_init. destroy and initialize the read-write lock attributes object.
  • pthread_rwlockattr_setpshared. get and set the process-shared attribute of the read-write lock attributes object.
  • -
  • pthread_setcanceltype. set cancelability state.
  • pthread_setconcurrency. get and set the level of concurrency.
  • pthread_spin_destroy. destroy or initialize a spin lock object.
  • pthread_spin_init. destroy or initialize a spin lock object.
  • pthread_spin_lock. lock a spin lock object.
  • pthread_spin_trylock. lock a spin lock object.
  • pthread_spin_unlock. unlock a spin lock object.
  • -
  • pthread_testcancel. set cancelability state.
  • 2.8.1 pthread_attr_init

    @@ -5985,19 +6222,15 @@ interface of the same name.

    Description: -

    The pthread_cancel() function will request that thread -be canceled. The target thread's cancelability state determines -when the cancellation takes effect. When the -cancellation is acted on, thread will be terminated.

    +

    The pthread_cancel() function will request that thread be canceled. +The target thread's cancelability state, enabled, or disabled, determines when the cancellation takes effect: When the cancellation is acted on, thread will be terminated. +When cancelability is disabled, all cancellations are held pending in the target thread until the thread re-enables cancelability.

    -

    When cancelability is disabled, all cancels are held pending -in the target thread until the thread changes the cancelability. -When cancelability is deferred, all cancels are held pending in -the target thread until the thread changes the cancelability or -calls pthread_testcancel().

    +

    The target thread's cancelability state determines how the cancellation is acted on: +Either asychronrously or deferred. +Asynchronous cancellations we be acted upon immediately (when enabled), interrupting the thread with its processing in an abritray state.

    -

    Cancelability is asynchronous; all cancels are acted upon -immediately (when enable), interrupting the thread with its processing.

    +

    When cancelability is deferred, all cancellations are held pending in the target thread until the thread changes the cancelability type or a Cancellation Point function such as pthread_testcancel() is entered.

    Input Parameters: @@ -6018,16 +6251,10 @@ No thread could be found corresponding to that specified by the given thread ID. Assumptions/Limitations:

    -POSIX Compatibility: Comparable to the POSIX -interface of the same name. Except:

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. Except:

      -
    • The thread-specific data destructor functions will be called for thread. -However, these destructors are not currently supported.
    • -
    • Cancellation types are not supported. The thread will be canceled -at the time that pthread_cancel() is called or, if cancellation is disabled, at -the time when cancellation is re-enabled.
    • -
    • pthread_testcancel() is not supported.
    • -
    • Thread cancellation at cancellation points is not supported.
    • +
    • The thread-specific data destructor functions will be not called for thread +These destructors are not currently supported.

    2.8.15 pthread_setcancelstate

    @@ -6040,23 +6267,29 @@ the time when cancellation is re-enabled.

    Description: -

    The pthread_setcancelstate() function atomically +

    +

    +The pthread_setcancelstate() function atomically sets both the calling thread's cancelability state to the indicated state and returns the previous cancelability state at the location referenced by oldstate. -Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.<.li> - -

    Any pending thread cancellation may occur at the time that the -cancellation state is set to PTHREAD_CANCEL_ENABLE.

    - +Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE. +

    +

    +Any pending thread cancellation may occur at the time that the +cancellation state is set to PTHREAD_CANCEL_ENABLE. +

    +

    Input Parameters: +

    • state -New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.<.li> +New cancellation state. One of PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.
    • oldstate. Location to return the previous cancellation state.
    +

    Returned Value:

    @@ -6072,38 +6305,149 @@ No thread could be found corresponding to that specified by the given thread ID. POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.16 pthread_testcancelstate

    +

    2.8.16 pthread_setcanceltype

    Function Prototype:

         #include <pthread.h>
    -    int pthread_setcancelstate(void);
    +    int pthread_setcanceltype(int type, FAR int *oldtype);
     

    Description: -

    NOT SUPPORTED +The pthread_setcanceltype() function atomically both sets the calling thread's cancelability type to the indicated type and returns the previous cancelability type at the location referenced by oldtype. +Legal values for type are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS. +

    +

    +The cancelability state and type of any newly created threads are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively. +

    +

    Input Parameters: +

      -
    • To be provided.
    • +
    • type +New cancellation state. One of PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.
    • +
    • oldtype. +Location to return the previous cancellation type.
    +

    Returned Value:

    If successful, the pthread_setcancelstate() function will return zero (OK). Otherwise, an error number will be +returned to indicate the error. +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    + +

    2.8.17 pthread_testcancel

    +

    +Function Prototype: +

    +

    +

    +    #include <pthread.h>
    +    void pthread_testcancel(void);
    +
    +

    +

    +Description: +

    +

    +The pthread_testcancel() function creates a Cancellation Point in the calling thread. +The pthread_testcancel() function has no effect if cancelability is disabled. +

    +

    +Input Parameters: None +

    +

    +Returned Value: None +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    + +

    2.8.18 pthread_cleanup_pop

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    void pthread_cleanup_pop(int execute);
    +
    +

    +Description: +

    +

    +The pthread_cleanup_pop() function will remove the routine at the top of the calling thread's cancellation cleanup stack and optionally invoke it (if execute is non-zero). +

    +

    +Input Parameters: +

    +

    +

      +
    • execute. Execute the popped cleanup function immediately.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the pthread_setcancelstate() function will return +zero (OK). Otherwise, an error number will be returned to indicate the error:

    +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    + +

    2.8.19 pthread_cleanup_push

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    void pthread_cleanup_push(CODE void (*routine)(FAR void *), FAR void *arg);
    +
    +

    +Description: +

    +

    +The pthread_cleanup_push() function will push the specified cancellation cleanup handler routine onto the calling thread's cancellation cleanup stack. +

    +

    +The cancellation cleanup handler will be popped from the cancellation cleanup stack and invoked with the argument arg when: +

    +

      -
    • To be provided.
    • +
    • The thread exits (that is, calls pthread_exit()).
    • +
    • The thread acts upon a cancellation request.
    • +
    • The thread calls pthread_cleanup_pop() with a non-zero execute argument.
    -Assumptions/Limitations: +

    -POSIX Compatibility: Comparable to the POSIX -interface of the same name. +Input Parameters: +

    +

      +
    • routine. The cleanup routine to be pushed on the the cleanup stack.
    • +
    • arg. An argument that will accompany the callback.
    • +
    +

    +Returned Value: +

    +If successful, the pthread_setcancelstate() function will return +zero (OK). Otherwise, an error number will be +returned to indicate the error. +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    -

    2.8.17 pthread_join

    +

    2.8.20 pthread_join

    Function Prototype:

    @@ -6136,7 +6480,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.18 pthread_yield

    +

    2.8.21 pthread_yield

    Function Prototype:

    @@ -6169,7 +6513,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.19 pthread_self

    +

    2.8.22 pthread_self

    Function Prototype:

    @@ -6201,7 +6545,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.20 pthread_getschedparam

    +

    2.8.23 pthread_getschedparam

    Function Prototype:

    @@ -6291,7 +6635,7 @@ interface of the same name. Comparable to the POSIX interface of the same name.

    -

    2.8.21 pthread_setschedparam

    +

    2.8.24 pthread_setschedparam

    Function Prototype:

    @@ -6383,7 +6727,7 @@ interface of the same name. Comparable to the POSIX interface of the same name.

    -

    2.8.22 pthread_key_create

    +

    2.8.25 pthread_key_create

    Function Prototype:

    @@ -6438,7 +6782,7 @@ interface of the same name.

  • The present implementation ignores the destructor argument. -

    2.8.23 pthread_setspecific

    +

    2.8.26 pthread_setspecific

    Function Prototype:

    @@ -6488,7 +6832,7 @@ interface of the same name. destructor function. -

    2.8.24 pthread_getspecific

    +

    2.8.27 pthread_getspecific

    Function Prototype:

    @@ -6529,7 +6873,7 @@ interface of the same name. destructor function. -

    2.8.25 pthread_key_delete

    +

    2.8.28 pthread_key_delete

    Function Prototype:

    @@ -6561,7 +6905,7 @@ this function does nothing in the present implementation. POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.26 pthread_mutexattr_init

    +

    2.8.29 pthread_mutexattr_init

    Function Prototype:

    @@ -6592,7 +6936,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.27 pthread_mutexattr_destroy

    +

    2.8.30 pthread_mutexattr_destroy

    Function Prototype:

    @@ -6623,7 +6967,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.28 pthread_mutexattr_getpshared

    +

    2.8.31 pthread_mutexattr_getpshared

    Function Prototype:

    @@ -6655,7 +6999,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.29 pthread_mutexattr_setpshared

    +

    2.8.32 pthread_mutexattr_setpshared

    Function Prototype:

    @@ -6687,7 +7031,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.30 pthread_mutexattr_gettype

    +

    2.8.33 pthread_mutexattr_gettype

    Function Prototype:

    @@ -6722,7 +7066,7 @@ returned to indicate the error:

    POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.31 pthread_mutexattr_settype

    +

    2.8.34 pthread_mutexattr_settype

    Function Prototype:

    @@ -6776,7 +7120,77 @@ returned to indicate the error:

    POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.32 pthread_mutex_init

    +

    2.8.35 pthread_mutexattr_getprotocol

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    int pthread_mutexattr_getprotocol(FAR const pthread_mutexattr_t *attr,
    +                                      FAR int *protocol);
    +
    +

    +Description: Return the value of the mutex protocol attribute.. +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the mutex attributes to be queried
    • +
    • protocol. The user provided location in which to store the protocol value. May be one of PTHREAD_PRIO_NONE, or PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the pthread_mutexattr_getprotocol() function will return zero (OK). +Otherwise, an error number will be returned to indicate the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    + +

    2.8.36 pthread_mutexattr_setprotocol

    +

    +Function Prototype: +

    +

    +    #include <pthread.h>
    +    int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr,
    +                                      int protocol);
    +
    +

    +Description: Set mutex protocol attribute. See the paragraph Locking versus Signaling Semaphores for some important information about the use of this interface. +

    +

    +Input Parameters: +

    +

    +

      +
    • attr. A pointer to the mutex attributes to be modified
    • +
    • protocol. The new protocol to use. One of PTHREAD_PRIO_NONE, or PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT. PTHREAD_PRIO_INHERIT is supported only if CONFIG_PRIORITY_INHERITANCE is defined; PTHREAD_PRIO_PROTECT is not currently supported in any configuration.
    • +
    +

    +

    +Returned Value: +

    +

    +If successful, the pthread_mutexattr_setprotocol() function will return zero (OK). +Otherwise, an error number will be returned to indicate the error. +

    +

    +Assumptions/Limitations: +

    +

    +POSIX Compatibility: Comparable to the POSIX interface of the same name. +

    + +

    2.8.37 pthread_mutex_init

    Function Prototype:

    @@ -6805,10 +7219,9 @@ returned to indicate the error: Assumptions/Limitations:

    -POSIX Compatibility: Comparable to the POSIX -interface of the same name. +POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.33 pthread_mutex_destroy

    +

    2.8.38 pthread_mutex_destroy

    Function Prototype:

    @@ -6839,7 +7252,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.34 pthread_mutex_lock

    +

    2.8.39 pthread_mutex_lock

    Function Prototype:

    @@ -6905,7 +7318,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.35 pthread_mutex_trylock

    +

    2.8.40 pthread_mutex_trylock

    Function Prototype:

    @@ -6945,7 +7358,7 @@ Otherwise, an error number will be returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.36 pthread_mutex_unlock

    +

    2.8.41 pthread_mutex_unlock

    Function Prototype:

    @@ -6991,7 +7404,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.37 pthread_condattr_init

    +

    2.8.42 pthread_condattr_init

    Function Prototype:

    @@ -7022,7 +7435,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.38 pthread_condattr_destroy

    +

    2.8.43 pthread_condattr_destroy

    Function Prototype:

    @@ -7053,7 +7466,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.39 pthread_cond_init

    +

    2.8.44 pthread_cond_init

    Function Prototype:

    @@ -7084,7 +7497,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.40 pthread_cond_destroy

    +

    2.8.45 pthread_cond_destroy

    Function Prototype:

    @@ -7115,7 +7528,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.41 pthread_cond_broadcast

    +

    2.8.46 pthread_cond_broadcast

    Function Prototype:

    @@ -7146,7 +7559,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.42 pthread_cond_signal

    +

    2.8.47 pthread_cond_signal

    Function Prototype:

    @@ -7177,7 +7590,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.43 pthread_cond_wait

    +

    2.8.48 pthread_cond_wait

    Function Prototype:

    @@ -7208,7 +7621,7 @@ returned to indicate the error: POSIX Compatibility: Comparable to the POSIX interface of the same name. -

    2.8.44 pthread_cond_timedwait

    +

    2.8.49 pthread_cond_timedwait

    Function Prototype:

    @@ -7245,7 +7658,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.45 pthread_barrierattr_init

    +

    2.8.50 pthread_barrierattr_init

    Function Prototype:

    @@ -7278,7 +7691,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.46 pthread_barrierattr_destroy

    +

    2.8.51 pthread_barrierattr_destroy

    Function Prototype:

    @@ -7310,7 +7723,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.47 pthread_barrierattr_setpshared

    +

    2.8.52 pthread_barrierattr_setpshared

    Function Prototype:

    @@ -7348,7 +7761,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.48 pthread_barrierattr_getpshared

    +

    2.8.53 pthread_barrierattr_getpshared

    Function Prototype:

    @@ -7380,7 +7793,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.49 pthread_barrier_init

    +

    2.8.54 pthread_barrier_init

    Function Prototype:

    @@ -7450,7 +7863,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.50 pthread_barrier_destroy

    +

    2.8.55 pthread_barrier_destroy

    Function Prototype:

    @@ -7494,7 +7907,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.51 pthread_barrier_wait

    +

    2.8.56 pthread_barrier_wait

    Function Prototype:

    @@ -7554,7 +7967,7 @@ interface of the same name.

    -

    2.8.52 pthread_once

    +

    2.8.57 pthread_once

    Function Prototype:

    @@ -7598,7 +8011,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.53 pthread_kill

    +

    2.8.58 pthread_kill

    Function Prototype:

    @@ -7660,7 +8073,7 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.

    -

    2.8.54 pthread_sigmask

    +

    2.8.59 pthread_sigmask

    Function Prototype:

    @@ -9975,6 +10388,7 @@ notify a task when a message is available on a queue.
  • lio_listio
  • listen
  • localtime_r
  • +
  • Locking versus Signaling Semaphores
  • lseek
  • Named Message Queue Interfaces
  • mkdir
  • @@ -9992,9 +10406,9 @@ notify a task when a message is available on a queue.
  • mq_timedsend
  • mq_unlink
  • mmap
  • +
  • Network Interfaces
  • -
  • Network Interfaces
  • on_exit
  • open
  • opendir
  • @@ -10060,9 +10474,11 @@ notify a task when a message is available on a queue.
  • pthread_key_delete
  • pthread_kill
  • pthread_mutexattr_destroy
  • +
  • pthread_mutexattr_getprotocol
  • pthread_mutexattr_getpshared
  • pthread_mutexattr_gettype
  • pthread_mutexattr_init
  • +
  • pthread_mutexattr_setprotocol
  • pthread_mutexattr_setpshared
  • pthread_mutexattr_settype
  • pthread_mutex_destroy
  • @@ -10074,10 +10490,11 @@ notify a task when a message is available on a queue.
  • pthread_once
  • pthread_self
  • pthread_setcancelstate
  • +
  • pthread_setcanceltype
  • pthread_setschedparam
  • pthread_setspecific
  • pthread_sigmask
  • -
  • pthread_testcancelstate
  • +
  • pthread_testcancel
  • pthread_yield
  • puts
  • RAM disk driver
  • @@ -10107,10 +10524,12 @@ notify a task when a message is available on a queue.
  • Counting Semaphore Interfaces
  • sem_close
  • sem_destroy
  • +
  • sem_getprotocol
  • sem_getvalue
  • sem_init
  • sem_open
  • sem_post
  • +
  • sem_setprotocol
  • sem_trywait
  • sem_unlink
  • sem_wait
  • @@ -10147,10 +10566,13 @@ notify a task when a message is available on a queue.
  • task_init
  • task_restart
  • Task Scheduling Interfaces +
  • task_setcancelstate
  • +
  • task_spawn
  • task_spawnattr_getstacksize
  • task_spawnattr_setstacksize
  • Task Switching Interfaces +
  • task_testcancel
  • telldir
  • timer_create
  • timer_delete
  • diff --git a/Documentation/README.html b/Documentation/README.html index a9577df8ce9e4685489fd5144cd6018c09b1de93..0341347d9d0a33c09a8f3fb058b5946bd8626374 100644 --- a/Documentation/README.html +++ b/Documentation/README.html @@ -8,7 +8,7 @@

    NuttX README Files

    -

    Last Updated: November 14, 2016

    +

    Last Updated: December 21, 2016

    @@ -70,12 +70,6 @@ nuttx/ | | `- README.txt | |- cloudctrl/ | | `- README.txt - | |- compal_e86/ - | | `- README.txt - | |- compal_e88/ - | | `- README.txt - | |- compal_e99/ - | | `- README.txt | |- demo9s12ne64/ | | `- README.txt | |- dk-tm4c129x/ @@ -183,6 +177,8 @@ nuttx/ | | `- README.txt | |- olimex-stm32-p207/ | | `- README.txt + | |- olimex-stm32-p407/ + | | `- README.txt | |- olimex-strp711/ | | `- README.txt | |- open1788/ @@ -199,12 +195,8 @@ nuttx/ | | `- README.txt | |- pic32mz-starterkit/ | | `- README.txt - | |- pirelli_dpl10/ - | | `- README.txt | |- qemu-i486/ | | `- README.txt - | |- rgmp/ - | | `- README.txt | |- sabre-6quad/ | | `- README.txt | |- sama5d2-xult/ @@ -223,6 +215,8 @@ nuttx/ | | `- README.txt | |- sam3u-ek/ | | `- README.txt + | |- sam4cmp-db + | | `- README.txt | |- sam4e-ek/ | | `- README.txt | |- sam4l-xplained/ @@ -328,8 +322,6 @@ nuttx/ | | `- README.txt | |- sensors/ | | `- README.txt - | |- sercomm/ - | | `- README.txt | |- syslog/ | | `- README.txt | `- README.txt diff --git a/Kconfig b/Kconfig index bf1f1c7b4b31ee0a3c8e9cbb0c9077289dbc4d91..188f9d007b0250190c5f380d186ec0e96e56f2b2 100644 --- a/Kconfig +++ b/Kconfig @@ -45,6 +45,14 @@ config HOST_OTHER endchoice +config TOOLCHAIN_WINDOWS + bool + default n + depends on HOST_WINDOWS + ---help--- + Selected internally if the selected Windows environment is compatible + with the use of Windows native toolchains. + choice prompt "Windows Build Environment" default WINDOWS_CYGWIN @@ -52,24 +60,34 @@ choice config WINDOWS_NATIVE bool "Windows Native" + select TOOLCHAIN_WINDOWS ---help--- Build natively in a CMD.exe environment with Windows style paths (like C:\cgywin\home) config WINDOWS_CYGWIN bool "Cygwin" + select TOOLCHAIN_WINDOWS ---help--- Build natively in a Cygwin environment with POSIX style paths (like - /cygdrive/c/cgywin/home) + /cygdrive/c/Program Files) + +config WINDOWS_UBUNTU + bool "Ubuntu under Windows 10" + ---help--- + Build natively in an Unbuntu shell under Windoes 10 environment with + POSIX style paths (like /mnt/c/Program Files) config WINDOWS_MSYS bool "MSYS" + select TOOLCHAIN_WINDOWS ---help--- Build natively in a Cygwin environment with POSIX style paths (like /cygdrive/c/cgywin/home) config WINDOWS_OTHER bool "Windows POSIX-like environment" + select TOOLCHAIN_WINDOWS ---help--- Build natively in another POSIX-like environment. Additional support may be necessary diff --git a/README.txt b/README.txt index 3a673b7e9a818f673e7918af3d811403a481e50a..80957b3b2be9b94e091479e3f858eca9973bdaea 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,10 @@ README ^^^^^^ - o Installation + o Environments - Installing Cygwin + - Ubuntu Bash under Windows 10 + o Installation - Download and Unpack - Semi-Optional apps/ Package - Installation Directories with Spaces in the Path @@ -34,21 +36,49 @@ README - Window Native Toolchain Issues o Documentation -INSTALLATION +ENVIRONMENTS ^^^^^^^^^^^^ - NuttX may be installed and built on a Linux system or on a Windows - system if Cygwin is installed. The MSYS environment is an option - to Cygwin on the Windows platform. However, I have little experience - that that configuration and it will not be discussed in this README - file. - - Instructions for installation of Cygwin on Windows system are provided - in the following paragraph. - - NuttX can also be installed and built on a native Windows system, but - with some potential tool-related issues (see the discussion "Native - Windows Build" below). + NuttX requires a POSIX development environment such as you would find under + Linux or OSX. NuttX may be also be installed and built on Windows system + if you also provde such a POSIX development environment. Options for a + POSIX development environment under Windows include: + + - An installation of Linux on a virtual machine (VM) in Windows. I have + not been happy using a VM myself. I have had stability problems with + open source VMs and commercial VMs cost more than I want to spend. + Sharing files with Linux running in a VM is awkward; sharing devices + connected to the Windows box with Linux in a VM is, at the very least, + confusing; Using Windows tools (such as Segger J-Link) with files + built under the Linux VM is not a possibility. + + - The Cygwin environment. Instructions for installation of Cygwin on a + Windows system are provided in the following paragraph, "Installing + Cygwin". Cygwin is a mature, well-tested, and very convenient + environment. It is especially expecially convenient if you need to + integrate with Windows tools and files. Downsides are that the + installation time is very long and the compile times are slow. + + - Ubuntu/Bash shell under Windows 10. This is a new option under + Windows 10. See the section "Ubuntu Bash under Windows 10" below. + This is an improvement over Cygwin if your concern is compile time; + its build performance is comparable to native Linux, certainly better + than the Cygwin build time. It also installs in a tiny fraction of + the time as Cygwin, perhaps 20 minutes for the basic Ubuntu install + (vs. more than a day for the complete Cygwin install). + + - The MSYS environment. I have no experience using the MSYS environment + and that configuration will not be discussed in this README file. + See http://www.mingw.org/wiki/MSYS if you are interested in + using MSYS. People report to me that they have used MSYS + successfully. I suppose that the advantages of the MSYS environemnt + is that it is closer to a native Windows environment and uses only a + minimal of add-on POSIX-land tools. + + - NuttX can also be installed and built on a native Windows system, but + with some potential tool-related issues (see the discussion "Native + Windows Build" under "Building NuttX" below). GNUWin32 is used to + provide compatible native windows tools. Installing Cygwin ----------------- @@ -84,6 +114,9 @@ Installing Cygwin "Publishing". You can try omitting KDE, Gnome, GTK, and other graphics packages if you don't plan to use them. + Perhaps a minimum set would be those packages listed below for the + "Ubuntu Bash under Windows 10" installation? + After installing Cygwin, you will get lots of links for installed tools and shells. I use the RXVT native shell. It is fast and reliable and does not require you to run the Cygwin X server (which is neither @@ -95,6 +128,136 @@ Installing Cygwin about 5GiB. The server I selected was also very slow so it took over a day to do the whole install! +Ubuntu Bash under Windows 10 +---------------------------- + + A better version of a command-line only Ubuntu under Windows 10 (beta) + has recently been made available from Microsoft. + + Installation + ------------ + Installation instructions abound on the Internet complete with screen + shots. I will attempt to duplicate those instructions in full here. + Here are the simplified installation steps: + + - Open "Settings". + - Click on "Update & security". + - Click on "For Developers". + - Under "Use developer features", select the "Developer mode" option to + setup the environment to install Bash. + - A message box should pop up. Click "Yes" to turn on developer mode. + - After the necessary components install, you'll need to restart your + computer. + + Once your computer reboots: + + - Open "Control Panel". + - Click on "Programs". + - Click on "Turn Windows features on or off". + - A list of features will pop up, check the "Windows Subsystem for Linux + (beta)" option. + - Click OK. + - Once the components installed on your computer, click the "Restart + now" button to complete the task. + + After your computer restarts, you will notice that Bash will not appear in + the "Recently added" list of apps, this is because Bash isn't actually + installed yet. Now that you have setup the necessary components, use the + following steps to complete the installation of Bash: + + - Open "Start", do a search for bash.exe, and press "Enter". + - On the command prompt, type y and press Enter to download and install + Bash from the Windows Store. This will take awhile. + - Then you'll need to create a default UNIX user account. This account + doesn't have to be the same as your Windows account. Enter the + username in the required field and press Enter (you can't use the + username "admin"). + - Close the "bash.exe" command prompt. + + Now that you completed the installation and setup, you can open the Bash + tool from the Start menu like you would with any other app. + + Accessing Windows Files from Ubuntu + ----------------------------------- + File sysems will be mounted under "/mnt" so for example "C:\Program Files" + appears at "/mnt/c/Program Files". This is as opposed to Cgwin where + the same directory would appear at "/cygdrive/c/Program Files". + + With these differences (perhaps a few other Windows quirks) the Ubuntu + install works just like Ubuntu running natively on your PC. + + Accessing Ubuntu Files From Windows + ----------------------------------- + In Ubuntu Userspace for Windows, the Ubuntu file system root directory is + at: + + %localappdata%\lxss\rootfs + + Or + + C:\Users\Username\AppData\Local\lxss\rootfs + + Install Linux Software. + ----------------------- + Use "sudo apt-get install ". As examples, this is how + you would get GIT: + + $ sudo apt-get install git + + This will get you a compiler for your host PC: + + $ sudo apt-get install gcc + + This will get you an ARM compiler for your target: + + $ sudo apt-get install gcc-arm-none-eabi + + NOTE: That is just an example. I am not sure if apt-get will give you a + current or usable compiler. You should carefully select your toolchain + for the needs of your project.] + + You will also need to the get the kconfig-frontends configuration as + described below under "NuttX Configuration tool". In order build the + kconfig-frontends configuration tool you will also need: make, gperf, + flex, bison, and libncurses-dev. + + That is enough to do a basic NuttX build. + + Integrating with Windows Tools + ------------------------------ + If you want to integrate with Windows native tools, then you would need + deal with the same kind of craziness as with integrating Cygwin with + native toolchains, see the section "Cygwin Build Problems" below. + + However, there is currently no build support for using Windows native + tools with Ubuntu under Windows. This tool combination is made to work + with Cygwin through the use of the 'cygpath -w' tool that converts paths + from say '/cydrive/c/Program Files' to 'C:\Program Files'. There is, + however, no corresponding tool to convert '/mnt/c/Program Files' in the + Ubuntu environment. + + Graphics Support + ---------------- + The Ubuntu version support by Microsoft is a command-line only version. + There is no support for Linux graphics utilities. + + This limititation is not a limitation of Ubuntu, however, only in what + Microsoft is willing to support. If you install a X-Server, then you + can also use basic graphics utilities. See for example: + + http://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/ + + Many Linux graphics programs would, however, also require a graphics + framework like GTK or Qt. So this might be a trip down the rabbit hole. + +INSTALLATION +^^^^^^^^^^^^ + + There are two ways to get NuttX: You may download released, stable + tarballs from wither the Bitbucket or Sourceforge download locations. + Or you may get NuttX by cloning the Bitbucket GIT repositories. Let's + consider the released tarballs first: + Download and Unpack ------------------- @@ -105,6 +268,11 @@ Download and Unpack match the various instructions in the documentation and some scripts in the source tree. + Download locations: + + https://bitbucket.org/nuttx/nuttx/downloads + https://sourceforge.net/projects/nuttx/files/nuttx/ + Semi-Optional apps/ Package --------------------------- @@ -1287,12 +1455,6 @@ nuttx/ | | `- README.txt | |- cloudctrl | | `- README.txt - | |- compal_e86 - | | `- README.txt - | |- compal_e88 - | | `- README.txt - | |- compal_e99 - | | `- README.txt | |- demo0s12ne64/ | | `- README.txt | |- dk-tm4c129x/ @@ -1399,6 +1561,8 @@ nuttx/ | | `- README.txt | |- olimex-stm32-p207/ | | `- README.txt + | |- olimex-stm32-p407/ + | | `- README.txt | |- olimex-strp711/ | | `- README.txt | |- open1788/ @@ -1415,12 +1579,8 @@ nuttx/ | | `- README.txt | |- pic32mz-starterkit/ | | `- README.txt - | |- pirelli_dpl10/ - | | `- README.txt | |- qemu-i486/ | | `- README.txt - | |- rgmp/ - | | `- README.txt | |- sabre-6quad/ | | `- README.txt | |- sama5d2-xult/ @@ -1439,6 +1599,8 @@ nuttx/ | | `- README.txt | |- sam3u-ek/ | | `- README.txt + | |- sam4cmp-db + | | `- README.txt | |- sam4e-ek/ | | `- README.txt | |- sam4l-xplained/ @@ -1544,8 +1706,6 @@ nuttx/ | | `- README.txt | |- sensors/ | | `- README.txt - | |- sercomm/ - | | `- README.txt | |- syslog/ | | `- README.txt | `- README.txt diff --git a/ReleaseNotes b/ReleaseNotes index 18b20f8b148d7ebddd1575a584f04ee7b0cc22ef..e7d50a4053256e739f5b955e2cc465a9e91e0e0a 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -12294,3 +12294,794 @@ detailed bugfix information): - apps/examples/oneshot: If the requested delay is > max_delay, then break the delay up into several pieces. + +NuttX-7.19 Release Notes +------------------------ + +The 119th release of NuttX, Version 7.19, was made on December 26, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.19.tar.gz and +apps-7.19.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - sched/semaphore, sched/phread/, libc/semaphore, libc/pthread: Add + pthread_mutexattr_get/set_protocol and non-standard + sem_get/set_protocol. These may use to enable or disable priority + inheritance on a single semaphore. + - Spinlocks: Added capability to provide architecture-specific memory + barriers. + - SMP: Add spin_trylock(). Use this in conditions where other CPUs need + to stopped but we cannot call enter_critical_section(). + - sched note: Extend OS instrumentation to include some SMP events. + Also add spinlock instrumentation; In SMP configurations, add a + filter mask to log only notes from certain CPUs. + - sched note: Permit spinlock and critical section notes in in-memory + buffer iff sched_not_get() interfaces is disabled. + - sched note: Add additional note to see if/when CPU is started in SMP + mode. + - sched note: Record ID enumeration now results on constant values; ID + values do not change with configuration. This makes writing post-processing software much easier. + - boardctl: Add new boardctl() command, BOARDIOC_NX_START, to start the + NX server as a kernel thread. + - pthreads: Add pthread_cleanup_push() and pthread_cleanup_pop(). + - pthreads: Added pthread_setcanceltype() and pthread_testcancel(). + - pthreads: Add support for cancellation points. + - task_delete() now obeys all cancellation point semantics. + - Add task_setcancelstate(), task_setcanceltype(), and + task_testcancel(). These are non-standard interfaces analogous to the + correponding pthread_ interfaces that provide cancellation controls + for tasks. + + * Graphics/Display Drivers: + + - boardctl: Add new boardctl() command, BOARDIOC_NX_START, to start the + NX server as a kernel thread. + + * Networking/Network Drivers: + + - Network drivers: Add option to use low-priority work queue to all + Ethernet and MAC level drivers. + - Network Drivers: Adapt all Ethernet (and other MAC) drivers to work + as though CONFIG_NET_MULTIBUFFER were set. Remove all references to + CONFIG_NET_MULTIBUFFER. + - Eliminate CONFIG_NO_NOINTS. There is no longer any support for + interrupt level processing of the network stack. Lots of files changed. + + * Other Common Device Drivers: + + - Vishay VEML6070: Add Vishay VEML6070 driver. From Alan Carvalho de + Assis. + + * ARMv7-A + + - ARMv7-A/i.MX6: Add SCU register definitions. Add some controls to + enable SMP cache coherency in SMP mode. Makes no difference, however + -- cache still incoherent on i.MX6. + - ARMv7 GIC: SGIs are non-maskable but go through the same path as + other, maskable interrupts. Added logic to serialize SGI processing + when necessary. + + * Atmel SAM3/4: + + - SAM3/4: Add SMP support for the dual-core SAM4CM. From Masayuki + Ishikawa. + + * Atmel SAM3/4 Drivers: + + - Add support for the SAM5CMP-DB board. From Masayuki Ishikawa. + + * Atmel SAM3/4 Boards: + + - SAM4CMP-DB: Add support for the Atmel SAM4CMP-DB board running in an + SMP configuration. From Masayuki Ishikawa. + - SAM4CMP-DB: Add hooks to auto-mount the procfs file system on startup + in board bring-up logic. + + * Atmel SAMV7 Drivers: + + - SAMv7: Register the watchdog device at the configured device path + CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt. From Frank Benkert. + + * Calypso + + - Calyps: Remove all Calypso board configurations. Remove Calypso + architecture support and support for Calypso SERCOMM driver. + + * Misoc LM32: + + - Misoc LM32: Adds basic support for the Misoc procoessors and the LM32 + in particular. From Ramtin Amin. + - Misoc LM32: Add signal handling logic. From Ramtin Amin. + - Misoc LM32: Add logic to flush/invalidate caches. From Ramtin Amin. + + * Misoc LM32 Drivers: + + - Misoc LM32 Serial: Add interrupting Misoc serial driver. From Ramtin + Amin. + - Misoc LM32 Timer: Add timer driver. From Ramtin Amin. + - Misoc LM32: Add Misoc Ethernet driver From Ramtin Amin. + + * Misoc LM32 Boards: + + - Misoc LM32 Qemu: Board support for testing Misoc LM32 with Qemu. From + Ramtin Amin. + - Misoc LM32 Qemu: Integrate network support into configs/misoc/hello. + From Ramtin Amin. + - Misoc LM32 Qemu: Remove configs/misoc/include/generated directory. I + suppose the the intent now is that this is a symbolic link? DANGER! + This means that you cannot compile this code with first generating + these files a providing a symbolic link to this location! There is a + sample directory containing generated sources. This is really only + useful for performing test builds. You really must generate the Misoc + architecture for a real-life build. From Ramtin Amin. + + * NXP Freescale i.MX6 Drivers: + + - i.MX6: Add an untested SPI driver taken directly from the i.MX1 port. + + * NXP Freescale Kinetis: + + - Kinetis: Added missing headers. Kinetis broke out SPI to + kinetis/kinetis_spi.h. Broke out DMA to use the modern Nuttx chip + inclusion - still STUBS. Add Kinetis support for ARMV7-M Common + Vector and FPU. Allow CONFIG_ARMV7M_CMNVECTOR, + CONFIG_STACK_COLORATION, CONFIG_ARCH_FPU. Fix i2c driver offset + swapped for value in kinetis_i2c_putreg. From David Sidrane. + + * NXP Freescale Kinetis Drivers: + + - Kinetis: Add UID Unique ID. From Neil Hancock. + + * NXP Freescale Kinetis Boards: + + - Freedom-K64F board: Add support for UID Unique ID. From Neil Hancock. + + * NXP Freescale LPC17xx Boards: + + - Olimex-LPC1766-STK: Enable procfs in NSH configuration. Automount + /proc on startup. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx: Add timer driver: From Alan Carvalho de Assis. + - LPC43xx GPDMA driver: The GPDMA block is basically the same as the + LPC17xx. Only the clock configuration is different and LPC43xx has + four different DMA request sources, where LPC17xx has only two. From + Alan Carvalho de Assis. + + * NXP Freescale LPC43xx Boards: + + - Bambino 200E: Add basic support to Micromint Bambino 200E board. + This includes contributions from Jim Wolfman. From Alan Carvalho de + Assis. + - Bambino 200E: Add support for timer driver. From Alan Carvalho de + Assis. + + * RGMP: + + - Remove RGMP and RGMP drivers. + + * RISC-V: + + - RISC-V: Add support for the RISC-V architecture and + configs/nr5m100-nexys4 board. The board support on this is pretty + thin, but it seems like maybe a good idea to get the base RISC-V stuff + in since there are people interested in it. From Ken Pettit. + + * STMicro STM32 Drivers: + + - STM32 F3: Implemention of the STM32 F37xx SDADC module. There are + also changes to ADC, DAC modules. SDADC has only been tested in DMA + mode and does not support external TIMER triggers. This is a work in + progress. From Marc Recht. + - STM32 F3: Add PWM driver support for STMF37xx. The changes have been + tested successfuly for TIM4 and TIM17 (different IPs). From Marc + Recht. + - STM32 F4: Support oversampling by 8 for the STM32 F4. From David + Sidrane. + - STM32 F4: Added Timers 2-5 and control of SAI and I2S PLLs. Added + support for stmf469 SAI and I2S PLL configuration and STM446 fixes. + From David Sidrane. + - STM32 F4: Expanded OTGFS support to stm32F469 and stm32f446. Added + missing bit definitions, Used stm32F469 and stm32f446 bit + definitions, Removed unsed header file. From David Sidrane. + - STM32 F4: Allow dma in 1 bit mode in STM32F4xxx. From David Sidrane. + - STM32 F7: Allow the config to override the clock edge setting. From + David Sidrane. + - STM32 L4: Support Complementary PWM outputs on STM32L4. From + Sebastien Lorquet. + - STM32 L4: Add implementation of dumpgpio for stm32l4, was required + for pwm debug. From Sebastien Lorquet. + + * STMicro STM32 Boards: + + - STM32F103 Minimum: Add button support. From Alan Carvalho de Assis. + - STM32F103 Minimum: Add support to PWM on STM32F103-Minimum board. + From Alan Carvalho de Assis. + - STM32F103 Minimum: Add RGB LED support on STM32F103 Minimum board. + From Alan Carvalho de Assis. + - STM32F103 Minimum: Add Vishay VEML6070 driver support to the + STM32F103-Minimum board. From Alan Carvalho de Assis. + - Nucleo-F303RE: Add STM32 F303RE hello configuration. From Marc + Recht. + - Nucleo-L476: Support PWM testing on board Nucleo L476. From + Sebastien Lorquet. + - Nucleo L476: Add support for timers to Nucleo L476. From Sebastien + Lorquet. + - Hymini STM32v: Enable CONFIG_RTC in the hymini-stm32v/nsh2 + (kitchensink) config. From Maciej Wjcik. + - Olimex STM32-p407: Add support for the Olimex STM32 P407 board. + + * TI Tiva Drivers: + + - Tiva PWM: Support PWM_PULSECOUNT feature for TI tiva. From Young.Mu. + + * Xtensa/ESP32 + + - Xtensa ESP32: Basic architectural support for Xtensa processors and + the Expressif. ESP32 added. + - Xtensa ESP32: Add EXPERIMENTAL hooks to support lazy Xtensa + co-processor state restore in the future. + - Xtensa ESP32: Basic port is function in both single CPU and dual CPU + SMP configurations. There is an NSH configuration for each CPU + configuration. Outstanding issues include missing clock configuration + logic, missing partition tables to support correct configuration from + FLASH, and some serial driver pin configuration issues. + - Xtensa ESP32: Add stack checking logic. + + * Xtensa/ESP32 Boards: + + - ESP32 Core v2: Basic support for Expressif ESP32 Core v2 board + added. The initial release includes an NSH and an SMP test + configuration. + - ESP32 Core v2: Add configuration to support linking NuttX for + execution out of IRAM. + - ESP32 Core v2: Automatically mount /proc at start-up. + - ESP32 Core v2: Add an OS test to verify the port. + + * C Library/Header Files: + + - libc/locale: Add a dummy setlocale() function to avoid drawing the + function from newlib. Add clocale header file. + - include/locale.h: Modify locale.h to add localeconv() and lconv + structure. From Alan Carvalho de Assis. + - libc/locale: Allows c++ code to compile with or without + CONFIG_LIBC_LOCALE and will generate a link error if + CONFIG_LIBC_LOCALE is not defined and setlocale is referenced. With + CONFIG_LIBC_LOCALE defined setlocale will act as if MB string is not + supported and return "C" for POSIX. C and "". From David Sidrane. + - libc/wchar: Add wcslen, wmemchr, wmemcmp, wmemcpy wmemset, btowc, + mbrtowc, mbtowc, wcscmp, wcscoll, and wmemmove to NuttX. From Alan + Carvalho de Assis. + - libc/wctype: Add functions wcrtomb, wcslcpy, wcsxfrm, wctob, wctomb, + wctype, localeconv, strcoll, strxfrm, swctype, towlower, towupper and + wcsftime. Add wctype.h; Move lib_wctype.c to libc/wctype. From Alan + Carvalho de Assis. + - include/ctype.h : Add isblank() macro to ctype.h. From Alan Carvalho + de Assis. + - lic/stdlib: Add strtof() and strtold() as simply a copy of strtod + with types and limits changed. + - sscanf(): Use strtof() instead of strtod() if a short floating point + value was requested. The should help performance with MCUs with + 32-bit FPU support with some additional code size. + - sscanf(): Add scansets to the scanf function. Enabled + CONFIG_LIBC_SCANSET option. From Aleksandr Vyhovanec. + - include/inttypes.h: Add architecture-specific inttypes.h. From Paul + A. Patience. + - C Library: Allow option to enable IP address conversions even when + the IP address family is not supported. + + * Build/Configuration System: + + - The Smoothie project needs to compile C++ inside config/boardname/src/ + to use with High Priority Interruption, then I modified the board + configs Makefile to support it. It works fine for the first time + compilation, but if we execute "touch config/boardname/src/Pin.cxx" + and execute "make" it will not detect that Pin.cxx was modified. I + think there is some other place I should modify, but I didn't find + it. From Alan Carvalho de Assis. + + * Tools: + + - tools/: Add tools/showsize.sh. + + * NSH: apps/nshlib: + + - NSH: dd command will show statistics. From Masayuki Ishikawa. + + * Applications: apps/system: + + - apps/system/sched_note: Extend to include additions to instumentation + for SMP. + - apps/system/sched_note: Add support for spinlock notes. + - apps/system/sched_note: Add support for new scheduler instrumentation. + + * Platforms: apps/platform: + + - ESP32 Core v2: Add platform support for the ESP32 core v2 board. + - Olimex STM32-p407: Add platform support for the Olimex STM32 P407. + + * Graphics: apps/graphics + + - graphics/traveler/tcledit and libwld: Add an X11 Tcl/Tk tool that can + be used to edit Traveler world files. + - Graphics: Remove all NX server taks. Instead, call boardctl() to the + NX server kernel thread. + + * Applications: apps/examples: + + - examples/buttons: Add a new buttons example that uses the button + character driver instead of the architecture buttons directly. From + Alan Carvalho de Assis. + - examples/cctype: Add an example to verify cctype functions. + - Remove RGMP example. + - examples/ostest: Extend the pthread cancellation test to exercise + pthread_cleanup_push() (and pthread_cleanup_pop() indirectly via + pthread_cancel() and pthread_exit(). + - examples/ostest: enhance pthread cancellation test some. + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.20. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - sched/semaphore: Within the OS, when a thread obtains a semaphore + count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is + enabled. If a count is available, then sem_wait() calls + sem_addholder(), otherwise it waited for the semaphore and called + sem_addholder() when it eventually received the count. This caused a + problem when the thread calling sem_wait() was very low priority. + When it received the count, there may be higher priority threads + "hogging" the CPU that prevent the lower priority task from running + and, as a result, the sem_addholder() may be delayed indefinitely. + The fix was to have sem_post() call sem_addholder() just before + restarting the thread waiting for the semaphore count. This problem + was noted by Benix Vincent who also suggested the solution. + - Many files: Make sure that priority inheritance is not enabled for + semaphores whose primary use is signaling (vs locking of resources) by + calling sem_setprotocol(). + - sched/semaphore: sem_trywait() no longer modifies the errno value + UNLESS an error occurs. This allows these functions to be used + internally without clobbering the errno value. From Freddie Chopin. + - sched/clock: Correct clock initialization. The correct range for the + month is 0-11 but is entered as 1-12 in the .config file. Add ranges + to START_YEAR, MONTH, and DAY in sched/Kconfig. + - sched/clock: Correct calculation for the case of Tickless mode with a + 32-bit timer. In that case, the calculation was returning millisecond + accuracy. That is not good when the timer accuracy is < 1 msec. From + Rajan Gill. + - Work Queue: When queuing new LP work, don't signal any threads if + they are all busy. From Heesub Shin. + - Work Queue: Signal sent from work_signal() may interrupt the low + priority worker thread that is already running. For example, the + worker thread that is waiting for a semaphore could be woken up by the + signal and break any synchronization assumption as a result. It also + does not make any sense to send signal if it is already running and + busy. This change fixes it. From Heesub Shin. + - Fix DEBUGASSERT() in group_signal.c. From Masayuki Ishikawa. + - Eliminate bad boardctl() commands: Remove all references to + BOARDIOC_PWMSETUP and board_pwm_setup(). Remove all references to + BOARDIOC_ADCSETUP and board_adc_setup(). Remove + BOARDIOC_CAN_INITIALIZE. CAN initialization is now done in the board + initialization logic just like every other device driver. + - pthreads: Fix an error in pthread_mutex_destroy(). An error could + occur while destroying a mutex after a pthread has been canceled while + holding the mutex. + - task_restart: Make sure new task starts with pre-emption disabled and + not in a critical section. + - Enter/leave Critical Sections. Major redeign to + enter/leave_critical_section logic to deal with the case where + interrupts are disabled only on the local CPU. In this case, some + rather complex spinlocks must be used to maintain the critical section + accross all CPUs. + - SMP Critical Sections: Fixes for the SMP case: (1) Change order for + SMP case in enter_critical_section: (1) Disable local interrupts + BEFORE taking spinlock and (2) If SMP is enabled, if any interrupt + handler calls enter_critical_section(), it should take the spinlock. + - SMP wdogs: Wdog timers use a tasking interface that to manipulate + wdogs, and a different interface in the timer interrupt handling logic + to manage wdog expirations. In the single CPU case, this is fine. + Since the tasking level code calls enter_critical_section, interrupts + are disabled and no conflicts can occur. But that may not be the case + in the SMP case. Most architectures do not permit disabling + interrupts on other CPUs so enter_critical_section must work + differently: Locks are required to protect code. this change adds + locking (via enter_critical section) to wdog expiration logic for the + the case if the SMP configuration. + - SMP vfork(): Fix a race condition in the SMP case. Existing logic + depended on the fact that the child would not run until waitpid was + called because the child had the same priority as the parent. BUT in + the SMP case that is not true... the child may run immediately on a + different CPU. + - SMP: This change adds a new internal interfaces and fixes a problem + with three APIs in the SMP configuration. The new internal interface + is sched_cpu_pause(tcb). This function will pause a CPU if the task + associated with 'tcb' is running on that CPU. This allows a different + CPU to modify that OS data stuctures associated with the CPU. When + the other CPU is resumed, those modifications can safely take place. + The three fixes are to handle cases in the SMP configuration where one + CPU does need to make modifications to TCB and data structures on a + task that could be running running on another CPU. Those three cases + are task_delete(), task_restart(), and execution of signal handlers. + In all three cases the solutions is basically the same: (1) Call + sched_cpu_pause(tcb) to pause the CPU on which the task is running, + (2) perform the necessary operations, then (3) call up_cpu_resume() to + restart the paused CPU. + - SMP: Add logic to avoid a deadlock condition when CPU1 is hung waiting + for g_cpu_irqlock with interrupts interrupts and CPU0 is waiting for + g_cpu_paused. + - SMP: Enforce this rule: Tasks which are normally restored when + sched_unlock() is called must remain pending (1) if we are in a + critical section, i.e., g_cpu_irqlock is locked , or (2) other CPUs + still have pre-emption disabled, i.e., g_cpu_schedlock is locked. In + those cases, the release of the pending tasks must be deferred until + those conditions are met. + + * File System/Block Drivers/MTD Drivers: + + - AT24XX EEPROM MTD driver: Added EEPROM timeout. Fromo Aleksandr + Vyhovanec. + - fs/procfs: Fix procfs status for SMP case. + + * Graphics/Graphic Drivers: + + - Fonts: Correct some default font IDs. From Pierre-Noel Bouteville. + + * Common Drivers: + + - usbhost/enumerate: Fix possible buffer overwrite. From Janne Rosberg. + - usbhost/composite: Fix compile; missing semicolons. From Jann Rosberg. + - syslog: Fixes required for file syslog output. From Max Kriegleder. + - SPI configuration: Fix Kconfig warning. This change moves the + ARCH_HAVE_SPI options outside the check for SPI. Those options don't + depend on SPI, and Kconfig files in arch/ enable them even if SPI + isn't enabled. Source the driver's Kconfig in drivers/Kconfig only + if support for the driver is enabled prevents us from defining these + ARCH_HAVE options in the driver's Kconfig. We should probably remove + the other checks in drivers/Kconfig and check if the drivers are + enabled only in their Kconfig. From Paul A. Patience. + - drivers/timer: Remove the timer driver TIOC_SETHANDLER IOCTL call. + This calls directly from the timer driver into application code. That + is non-standard, non-portable, and cannot be supported. Instead, add + timer driver hooks to support signal notification of timer + expiration. Signal notification logic added by Sebastien Lorquet. + - All timer lower half drivers. Port Sebastien's changes to all other + implementations of the timer lower half. + - USB MSC Device: Fix length of mode6 sense reply packet. From + Wolfgang Reinegger. + - USB Composite Host: Fix end offset in usbhost_copyinterface(). From + Janne Rosberg. + - USB CDC/ACM Host: Add CDC_SUBCLASS_ACM and CDC_PROTO_ATM to + supported class and proto. From Janne Rosberg. + - SSD1306: Fix errors in SPI mode configuration. From Gong Darcy. + - CDC/ACM Device Class: uart_ops_s portion of cdcacm will not be + initalized with correct functions if CONFIG_SERIAL_DMA is selected. + + * Networking/Network Drivers: + + - drivers/net/tun.c: Fix bug in TUN interface driver. From Max Nekludov. + + * ARMv7-A: + + - ARMv7-A SMP: Add SMP logic to signal handling. + + * ARMv7-M: + + - ARMv7-M: Fix double allocation of MPU region in mmu.h. + + * ARMv7-R: + + - ARMv7-R: Fix compilation error. This change fixes compilation errors + on MPU support for ARMv7-R. From Heesub Shin. + - ARMv7-R: fix invalid drbar handling. In ARMv7-R, [31:5] bits of DRBAR + is physical base address and other bits are reserved and SBZ. Thus, + there is no point in passing other than the base address. From Heesub + Shin. + - ARMv7-R: Remove the redundant update on SCTLR. mpu_control() is + invoking cp15_wrsctlr() around SCTLR update redundantly. From Heesub + Shin. + - ARMv7-R: add new Kconfig entries for d/i-cache. Unlike in ARMv7-A/M, + Kconfig entries for data and instruction caches are currently missing + in ARMv7-R. This change adds those missing Kconfig entries. Actual + implmenetation for those functions will be added in the subsequent + patches. From Heesub Shin. + - ARMv7-R: Add cache handling functions. This change adds functions for + enabling and disabling d/i-caches which were missing for ARMv7-R. + From Heesub Shin. + - ARMv7-R: Fix typo in mpu support. s/ARMV7M/ARMV7R/g. From Heesub Shin. + - ARMv7-R: Fix CPSR corruption after exception handling. A sporadic + hang with consequent crash was observed when booting. It seemed to be + caused by the corrupted or wrong CPSR restored on return from + exception. NuttX restores the context using code like this: msr spsr, + r1. GCC translates this to: msr spsr_fc, r1. As a result, not all + SPSR fields are updated on exception return. This should be: msr + spsr_fsxc, r1. On some evaluation boards, spsr_svc may have totally + invalid value at power-on-reset. As it is not initialized at boot, the + code above may result in the corruption of cpsr and thus unexpected + behavior. From Heesub Shin. + - ARMv7-R: Fix to restore the Thumb flag in CPSR. Thumb flag in CPSR is + not restored back when the context switch occurs while executing thumb + instruction. From Heesub Shin. + + * Atmel SAM3/4 Drivers: + + - SAM3/4 UDP: Add delay between setting and clearing the endpoint RESET + bit in sam_ep_resume(). We need to add a delay between setting and + clearing the endpoint reset bit in SAM_UDP_RSTEP. Without the delay + the USB controller will (may?) not reset the endpoint. If the + endpoint is not being reset, the Data Toggle (DTGLE) bit will not to + be cleared which will cause the next transaction to fail if DTGLE is + 1. If that happens the host will time-out and reset the bus. Adding + this delay may also fix the USBMSC_STALL_RACEWAR in usbmsc_scsi.c, + however this has not been verified yet. From Wolfgang Reinegger. + - SAM3/4: Remove unused 'halted' flag from UDP driver. From Wolfgang + Reinegger. + - SAM3/4: Remove 'stalled' flag from the UDP driver. This flag is not + necessary because the state of the endpoint can be determined using + 'epstate' instead. From Wolfgang Reinegger. + + * Atmel SAM3/4 Boards: + + - SAM4S Xplained Pro: Configuration uses old, improper timer interface. + CONFIG_TIMER disabled in configuration. Remove obsolete timer + initialization logic. + + * Atmel SAMV7 Drivers: + + - SAMv7 USBDEVHS: A problem occurred with the SAMV7 USBDEVHS driver if + the USB cable is unplugged while a large amount of data is send over + an IN endpoint using DMA. If the USB cable is plugged in again after a + few seconds it is not possible to send data over this IN endpoint + again, all other endpoints work as expected. The problem occurs + because if the USB cable is unplugged while an DMA transfer is in + flight the transfer is canceled but the register SAM_USBHS_DEVDMACTRL + is left in an undefined state. The problem was fixed the problem by + resetting the register SAM_USBHS_DEVDMACTRL to a known state. + Additionally all pending interrupts are cleared. From Stefan Kolb. + - SAMV7 MCAN: Prevent Interrupt-Flooding of ACKE when not connected to + CAN-BUS. An Acknowledge-Error will occur every time no other CAN Node + acknowledges the message sent. This will also occur if the device is + not connected to the can-bus. The CAN-Standard declares, that the Chip + has to retry a given message as long as it is not sent successfully + (or it is not cancelled by the application). Every time the chip tries + to resend the message an Acknowledge-Error-Interrupt is generated. At + high baud rates this can lead in extremely high CPU load just for + handling the interrupts (and possibly the error handling in the + application). To prevent this Interrupt-Flooding we disable the ACKE + once it is seen as long we didn't transfer at least one message + successfully. From Frank Benkert. + - SAMV7 MCAN: Make delete_filter functions more robust. From Frank + Benkert. + + * Atmel SAMA5 Drivers: + + - SAMA5 PWM: Driver does not build when executing from SDRAM before + board frequencies are not constant. Rather, the bootloader configures + the clocking and we must derive the clocking from the MCK left by the + bootloader. This means lots more computations. This is untested on + initial change because I don't have a good PWM test setup right now. + + * Misoc LM32: + + - Misoc LM32: Corrects a bug that never occured in qemu on simulation or + real fpga. The error was that the r1 register was being modified out + of context switching and not restoring it. From Ramtin Amin + + * NXP Freescale i.MX6: + + - i.MX6 interrupt handling: Additional logic needed to handle nested + interrupts when an interrupt stack is used. Nesting can occur because + SGI interrupts are non-maskable. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx serial: Fix a typo in ioctl TIOCSRS485 ioctl. From Vytautas + Lukenskas. + - LPC43xx serial: Restore RS485 mode on serial port open (if RS485 is + enabled via menuconfig). From Vytautas Lukenskas. + - LPC43xx SD/MMC: Correct some definitions on SMMC control register in + lpc43_sdmmc.h. From Alan Carvalho de Assis. + - LPC43xx SD card: Correct pin configuration options needed for SD card + pins. From Alan Carvalho de Assis. + + * SiLabs EFM32: + + - EFM32: Fix a compilation error. From Pierre-noel Bouteville. + + * STMicro STM32 Drivers: + + - STM32 CHxN channels are always outputs. From Sebastien Lorquet. + - STM32 DAC: Fix shift value whenever there are is a DAC2 and, hence, + up to three interfaces. From Marc Recht. + - STM32 F1: Add TIM8 to STM32F103V pinmap. From Maciej Wjcik. + - STM32 F1: Fix for F1 RTC Clock, tested on F103. From Maciej Wjcik. + - STM32 F3: STM32F303xB and STM32F303xC chips have 4 ADCs. From Paul + A. Patience. + - STM32 F4: A new implementation of the STM32 F4 I2C bottom half. The + common I2C as this did not handled correctly in the current + implementation (see also https://github.com/PX4/NuttX/issues/54). The + changes almost exclusively affect the ISR. From Max Kriegleder. + - STM32 F4 OTGHS Host: If STM32F446 increase number of channels to + 16. From Janne Rosberg. + - STM32 F4: I think, that Size is (highest address+1 - Base address). + Base address has been removed and if address+count >= size we are + outside of the Flash. From David Sidrane. + - STM32 F4: Fix ADC compilation error when DMA isn't enabled. From Paul + A. Patience. + - STM32 F4: STM32F427 was rebooting. Over reached family. From David + Sidrane. + - STM32 F4: Added STM32F469 RAM size and deliberated STM32F446 size. + From David Sidrane. + - STM32 F4: Typo in stm32f76xxxx_pinmap.h edited online with + Bitbucket. From David Sidrane. + - STM32 F7: stm32_i2c.c Dejavu. Fixes a bug previously found in the + F4. From David Sidrane. + - STM32 F7: OTGDEV fixed typo. From David Sidrane. + - STM32 F7: Fix to SPI-Master driver. Without this the chip select + decoding feature will not work properly. From Michael Spahlinger. + - STM32 F7: STM32F7 SD/MMC driver depends on CONFIG_SDIO_DMA which is + only defined in stm32/Kconfig. Changed to CONFIG_STM32F7_SDMMC_DMA + and defined in stm32f7/Kconfig. + - STM32 F7: Fix some STM32F7 copy paste errors. From David Sidrane. + - STM32 L4: Complementary PWM outputs on STM32L4" (1) too many + parentheses when calculating max chan count and (2) channel 4 does not + have a complementary output. From Sebastien Lorquet. + - STM32 L4: Fix I2C devices RCC registers. From Sebastien Lorquet. + - STM32 L4: Enable and renaming for 32l4 UARTs 4 and 5. From Sebastien + Lorquet. + - STM32 L4: Change the way to configure quadrature encoder prescalers. + From Sebastien Lorquet. + - STM32 L4: Correct USART1/2 definitions. Use default mbed UART4 + settings. From Sebastien Lorquet. + + * STMicro STM32 Boards: + + - STM32F103 Minimum: Fix Timers 2 to 7 clock frequencies. From Alan + Carvalho de Assis. + - Nucleo-F303RE: Remove duplicate setting from board.h. From Marc + Recht. + - Nucleo F303RE: Various fixes to get the ADC configuration building + again after PR. Refresh all configurations. + - Nucleo L476RG: Add better selection of timer. + + * TI Tiva Boards: + + - DK-TM4C129x: Typo fix. From Wolfgang Reinegger. + + * Xtensa ESP32: + + - ESP32 core v2: Flush the UART TX buffer in the esp32 serial shutdown + routine. The ROM bootloader does not flush the FIFO before handing + over to user code, so some of this output is not currently seen when + the UART is reconfigured in early stages of startup. From Angus + Gratton. + - Xtensa ESP32: Corrects a problem with dispatching to signal + handlers: Cannot vector directly to the signal handling function as + in other ABIs under the Xtensa Window ABI. In that case, we need to + go through a tiny hook when performs the correct window call (call4) + otherwise registers will be scrambled in the signal handler. + + * Xtensa ESP32 Boards: + + - ESP32 core v2: Changes the openocd config file's default flash + voltage from 1.8V to 3.3V. This is not necessary right now, but may + save some hard-to-debug moments down the track (3.3V-only flash + running at 1.8V often half-works and does weird things...). From + Angus Gratton. + + * C Library/Header Files: + + - libc/stdio: Fixes sscanf() %sn where strlen(data) < n. From David + Sidrane. + - libc/stdio: Include wchar.h in lib_libvsprintf.c to fix compilation + error. From Alan Carvalho de Assis. + - include/sys/time.h: timersub macro modified per recommendations of + phreakuencies. + - include/ctype.h and cxx/cctype: Implement ctype.h functions as inline + if possible. cctype can then properly select namespace. + - include/: Fix a number of header files with mismatched 'extern C {' + and '}'. + - libc/unisted: Change brings strtol() and related functions more + conformant with POSIX. Corner cases like strtol(-2147483648, NULL, + 10) now pass clang -fsanitize=integer without warnings. From Juha + Niskanen. + - libc/unistd: sleep() was returning remaining nanoseconds (kind of), + instead the remaining seconds. From Eunbong Song. + - termios.h: Fix CRTSCTS define to include input and output flow. From + Lorenz Meier. + + * Build/Configuration System: + + - configs/*/defconfig: The buttons example was changed to archbuttons. + As a result all of the button configurations are broken and need some + renaming in the defconfig files. Noted by Frank Berkert. + - config/*/defconfgs: More fallout from name change of + apps/examples/buttons to archbuttons. + - configs: All QE encoder files. Last change made timer hard-coded to + 3. Make configurable. + - configs: Remove all traces of the no-longer existent ARCHBUTTONS + example. Remove all button configurations that depended on the + obsoleted ARCHBUTTON example. + - minnsh Configurations: Remove minnsh configurations and support + logic: up_getc() and lowinstream. This was an interesting exercise + to see just how small you could get NuttX, but otherwise it was not + useful: (1) the NSH code violated the OS interface layer by callup + up_getc() and up_putc() directly, and (2) while waiting for character + input, NSH would call up_getc() which would hog all of the CPU. Not a + reasonable solution other than as a proof of concept. + + * Application Build/Configuration System: + + - Make.defs: Using wrong link script if native window tool used with + Cygwin. + + * apps/platform: + + - ESP32 Core v2 Platform: Fix some naming that prevented building the + C++ support. + + * apps/nshlib: + + - NSH Library: nsh_getdirpath(), use snprint instead of sprintf to + avoid possibility of buffer overrun. Noted by Chung Hwan Kim. + + * apps/system: + + - Remove std_readline(). This called up_getc() and up_putc() directly, + violating the POSIX OS interface. + + * apps/netutils: + + - FTPD: Fixed bug that didn't free ftpd ressources on exit. From Pascal + Speck. + - NTP client: Fix missing left parenthesis. From Pierre-Noel Bouteville. + - cJSON: Import patch to fix:cJSON_PrintUnformatted() behaves unexpected + if an empty array shall be printed to text. from Jerome Lang + 2012-04-19. From Pierre-Noel Bouteville. + - esp8266 update cosmetic and many bug fix. From Pierre-Noel Bouteville. + - FTPD: Fix bug un ftpd file or socket may be not closed. From + Pierre-Noel Bouteville. + + * apps/modbus: + + - Modbus Master is missing many files and doesn't compile at all. More + details in + https://groups.yahoo.com/neo/groups/nuttx/conversations/topics/13734. + From Vytautas Lukenskas. + + * apps/examples: + + - The examples/qencoder app was trying to init the encoder by a direct + call into the board, cheating in a local header to declare the + normally unavailable function prototype. From Sebastien Lorquet. + - apps/examples/timer: Should detach signal handler before exiting. + - examples/qencode: The examples/qencoder app was trying to init the + encoder by a direct call into the board, cheating in a local header to + declare the normally unavailable function prototype. From Sebastien + Lorquet. + - apps/examples/archbuttons: Removed becaue it violates OS interface + principles. + - examples/adc, pwm, can: Remove all usage of BOARDIOC_ADCTEST_SETUP, + BIOARDIOC_PWMSETUP. Remove BOARDIOC_CAN_INITIALIZE. CAN + initialization is now done in the board initialization logic just like + every other device driver. + - examples/ostest: Add some delays to the pthread cancellation test. + With deferred cancellation enabled, things happen more asynchronously. diff --git a/TODO b/TODO index 77fb109fe401fb662df0c1d29bda50378d0c3615..eefde1ac507394e4408b0cbfff1e218f2f0c673e 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated November 19, 2016) +NuttX TODO List (Last updated January 10, 2017) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -9,8 +9,8 @@ issues related to each board port. nuttx/: - (13) Task/Scheduler (sched/) - (2) SMP + (12) Task/Scheduler (sched/) + (1) SMP (1) Memory Management (mm/) (1) Power Management (drivers/pm) (3) Signals (sched/signal, arch/) @@ -22,7 +22,7 @@ nuttx/: (12) Network (net/, drivers/net) (4) USB (drivers/usbdev, drivers/usbhost) (0) Other drivers (drivers/) - (11) Libraries (libc/, libm/) + (12) Libraries (libc/, libm/) (11) File system/Generic drivers (fs/, drivers/) (9) Graphics Subsystem (graphics/) (2) Build system / Toolchains @@ -31,8 +31,8 @@ nuttx/: apps/ and other Add-Ons: - (3) Network Utilities (apps/netutils/) - (2) NuttShell (NSH) (apps/nshlib) + (2) Network Utilities (apps/netutils/) + (1) NuttShell (NSH) (apps/nshlib) (1) System libraries apps/system (apps/system) (1) Pascal add-on (pcode/) (4) Other Applications & Tests (apps/examples/) @@ -101,16 +101,37 @@ o Task/Scheduler (sched/) Status: Open Priority: Medium Low for now - Title: ISSUES WITH atexit() AND on_exit() + Title: ISSUES WITH atexit(), on_exit(), AND pthread_cleanup_pop() Description: These functions execute with the following bad properties: 1. They run with interrupts disabled, 2. They run in supervisor mode (if applicable), and 3. They do not obey any setup of PIC or address environments. Do they need to? + 4. In the case of task_delete() and pthread_cancel(), these + callbacks will run on the thread of execution and address + context of the caller of task. That is very bad! The fix for all of these issues it to have the callbacks - run on the caller's thread (as with signal handlers). + run on the caller's thread as is currently done with + signal handlers. Signals are delivered differently in + PROTECTED and KERNEL modes: The deliver is involes a + signal handling trampoline function in the user address + space and two signal handlers: One to call the signal + handler trampoline in user mode (SYS_signal_handler) and + on in with the signal handler trampoline to return to + supervisor mode (SYS_signal_handler_return) + + The primary difference is in the location of the signal + handling trampoline: + + - In PROTECTED mode, there is on a single user space blob + with a header at the beginning of the block (at a well- + known location. There is a pointer to the signal handler + trampoline function in that header. + - In the KERNEL mode, a special process signal handler + trampoline is used at a well-known location in every + process address space (ARCH_DATA_RESERVE->ar_sigtramp). Status: Open Priority: Medium Low. This is an important change to some less important interfaces. For the average user, these @@ -144,20 +165,6 @@ o Task/Scheduler (sched/) incompatibilities could show up in porting some code). Priority: Low - Title: REMOVE TASK_DELETE - Description: Need to remove or fix task delete. This interface is non- - standard and not safe. Arbitrary deleting tasks can cause - serious problems such as memory leaks. Better to remove it - than to retain it as a latent bug. - - Currently used within the OS and also part of the - implementation of pthread_cancel() and task_restart() (which - should also go for the same reasons). It is used in - NxWM::CNxConsole to terminate console tasks and also in - apps/netutils/thttpd to kill CGI tasks that timeout. - Status: Open - Priority: Low and not easily removable. - Title: RELEASE SEMAPHORES HELD BY CANCELED THREADS: Description: Commit: fecb9040d0e54baf14b729e556a832febfe8229e: "In case a thread is doing a blocking operation (e.g. read()) @@ -308,70 +315,33 @@ o Task/Scheduler (sched/) o SMP ^^^ - Title: SPINLOCKS AND DATA CACHES - Description: If spinlocks are used in a system with a data cache, then there - may be a problem with cache coherency in some CPU architectures: - When one CPU modifies the spinlock, the changes may not be - visible to another CPU if it does not share the data cache. - That would cause failure in the spinlock logic. + Title: SMP AND DATA CACHES + Description: When spinlocks, semaphores, etc. are used in an SMP system with + a data cache, then there may be problems with cache coherency + in some CPU architectures: When one CPU modifies the shared + object, the changes may not be visible to another CPU if it + does not share the data cache. That would cause failure in + the IPC logic. Flushing the D-cache on writes and invalidating before a read is - not really an option. spinlocks are normally 8-bits in size and - cache lines are typically 32-bytes so that would have side effects - unless the spinlocks were made to be the same size as one cache - line. - - This might be doable if a write-through cache is used. Then you - could always safely invalidate the cache line before reading the - spinlock because there should never be any dirty cache lines in - this case. - - The better option is to add compiler independent "ornamentation" - to the spinlock so that the spinlocks are all linked together - into a separate, non-cacheable memory regions. Because of - region alignment and minimum region mapping sizes this could - still be wasteful of memory. This would work in systems that - have both data cache and either an MPU or an MMU. - Status: Open - Priority: High. spinlocks, and hence SMP, will not work on such systems - without this change. - - Title: DEADLOCK SCENARIO WITH up_cpu_pause(). - Description: I think there is a possibilty for a hang in up_cpu_pause(). - Suppose this situation: - - - CPU1 is in a critical section and has the g_cpu_irqlock - spinlock. - - CPU0 takes an interrupt and attempts to enter the critical - section. It spins waiting on g_cpu_irqlock with interrupt - disabled. - - CPU1 calls up_cpu_pause() to pause operation on CPU1. This - will issue an inter-CPU interrupt to CPU0 - - But interrupts are disabled. What will happen? I think - that this is a deadlock: Interrupts will stay disabled on - CPU0 because it is spinning in the interrupt handler; - up_cpu_pause() will hang becuase the inter-CPU interrupt - is pending. - - Are inter-CPU interrupts maskable in the same way as other - interrupts? If the are not-maskable, then we must also handle - them as nested interrupts in some fashion. - - A work-around might be to check the state of other-CPU - interrupt handler inside the spin loop of up_cpu_pause(). - Having the other CPU spinning and waiting for up_cpu_pause() - provided that (1) the pending interrupt can be cleared, and - (2) leave_critical_section() is not called prior to the point - where up_cpu_resume() is called, and (3) up_cpu_resume() is - smart enough to know that it should not attempt to resume a - non-paused CPU. - - This would require some kind of information about each - interrupt handler: In an interrupt, waiting for spinlock, - have spinlock, etc. - - Status: Open - Priority: Medium-High. I don't know for certain that this is a problem but it seems like it could + not really an option. That would essentially effect every memory + access and there may be side-effects due to cache line sizes + and alignment. + + For the same reason a separate, non-cacheable memory region is + not an option. Essentially all data would have to go in the + non-cached region and you would have no benefit from the data + cache. + + On ARM Cortex-A, each CPU has a separate data cache. However, + the MPCore's Snoop Controller Unit supports coherency among + the different caches. The SCU is enabled by the SCU control + register and each CPU participates in the SMP coherency by + setting the ACTLR_SMP bit in the auxiliary control register + (ACTLR). + + Status: Closed + Priority: High on platforms that may have the issue. o Memory Management (mm/) ^^^^^^^^^^^^^^^^^^^^^^^ @@ -444,7 +414,7 @@ o Memory Management (mm/) So in this case, NuttX work just link Linux or or *nix systems: All memory allocated by processes or threads in processes will - be recovered when the process exists. + be recovered when the process exits. But not for the flat memory build. In that case, the issues above do apply. There is no safe way to recover the memory in @@ -457,7 +427,9 @@ o Memory Management (mm/) it is inherently unsafe, I would never incorporate anything like that into NuttX. - Status: Open. No changes are planned. + Status: Open. No changes are planned. NOTE: This applies to the FLAT + and PROTECTED builds only. There is no such leaking of memory + in the KERNEL build mode. Priority: Medium/Low, a good feature to prevent memory leaks but would have negative impact on memory usage and code size. @@ -528,12 +500,6 @@ o Signals (sched/signal, arch/) o pthreads (sched/pthreads) ^^^^^^^^^^^^^^^^^ - Title: CANCELLATION POINTS - Description: pthread_cancel(): Should implement cancellation points and - pthread_testcancel() - Status: Open. No changes are planned. - Priority: Low, probably not that useful - Title: PTHREAD_PRIO_PROTECT Description: Extend pthread_mutexattr_setprotocol() support PTHREAD_PRIO_PROTECT: @@ -594,6 +560,44 @@ o pthreads (sched/pthreads) solution. So I discarded a few hours of programming. Not a big loss from the experience I gained." + Title: ISSUES WITH CANCELLATION POINTS + Description: According to POIX cancellation points must occur when a thread is executing + the following functions. There are some execptions as noted: + + accept() mq_timedsend() NA putpmsg() sigtimedwait() + 04 aio_suspend() NA msgrcv() pwrite() NA sigwait() + NA clock_nanosleep() NA msgsnd() read() sigwaitinfo() + close() NA msync() NA readv() 01 sleep() + connect() nanosleep() recv() 02 system() + -- creat() open() recvfrom() NA tcdrain() + fcntl() pause() NA recvmsg() 01 usleep() + NA fdatasync() poll() select() -- wait() + fsync() pread() sem_timedwait() waitid() + NA getmsg() NA pselect() sem_wait() waitpid() + NA getpmsg() pthread_cond_timedwait() send() write() + NA lockf() pthread_cond_wait() NA sendmsg() NA writev() + mq_receive() pthread_join() sendto() + mq_send() pthread_testcancel() 03 sigpause() + mq_timedreceive() NA putmsg() sigsuspend() + + NA Not supported + -- Doesn't need instrumentation. Handled by lower level calls. + nn See note nn + + NOTE 01: sleep() and usleep() are user-space functions in the C library and cannot + serve as cancellation points. They are, however, simple wrappers around nanosleep + which is a true cancellation point. + NOTE 02: system() is actually implemented in apps/ as part of NSH. It cannot be + a cancellation point either. + NOTE 03: sigpause() is a user-space function in the C library and cannot serve as + cancellation points. It is, however, a simple wrapper around sigsuspend() + which is a true cancellation point. + NOTE 04: aio_suspend() is a user-space function in the C library and cannot serve as + cancellation points. It does call around sigtimedwait() which is a true cancellation + point. + Status: Not really open. This is just the way it is. + Priority: Nothing additional is planned. + o Message Queues (sched/mqueue) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1080,41 +1084,18 @@ o Network (net/, drivers/net) Priority: Medium. Important on slow applications that will not accept connections promptly. - Title: INTERRUPT LEVEL PROCESSING IN ETHERNET DRIVERS - Description: Too many Ethernet drivers do interrupt-level processing with - the network stack. The network stack supports either interrupt - level processing or normal task level processing (depending on - CONFIG_NET_NOINTS). This is really a very bad use of CPU - resources; All of the network stack processing should be - modified to use a work queue (and, all use of CONFIG_NET_NOINTS=n - should be eliminated). This applies to many Ethernet drivers: - - ARCHITECTURE CONFIG_NET_NOINTS? ADDRESS FILTER SUPPORT? - C5471 NO NO - STM32 YES YES - STM32F7 YES YES - TIVA ----------------------- ------ - LM3S NO NO - TM4C YES YES - eZ80 NO NO - Kinetis YES YES (not tested) - LPC17xx YES YES (not tested) - LPC43xx YES YES (not tested) - DMxxx NIC NO NO - PIC32 NO NO - RGMP ??? ??? - SAM3/4 YES YES - SAMA5D ----------------------- ------ - EMACA NO YES (not tested) - EMACB YES YES - GMAC NO YES (not tested) - SAMV7 YES YES - SIM N/A (No interrupts) NO - - The general outline of how this might be done is included in - drivers/net/skeleton.c - Status: Open - Priority: Pretty high if you want a well behaved system. + Title: IPv6 REQUIRES ADDRESS FILTER SUPPORT + Description: IPv6 requires that the Ethernet driver support NuttX address + filter interfaces. Several Ethernet drivers do support there, + however. Others support the address filtering interfaces but + have never been verifed: + + C5471, LM3X, ez80, DM0x90 NIC, PIC: Do not support address + filteringing. + Kinetis, LPC17xx, LPC43xx: Untested address filter support + + Status: Open + Priority: Pretty high if you want a to use IPv6 on these platforms. Title: UDP MULTICAST RECEPTION Description: The logic in udp_input() expects either a single receive socket or @@ -1511,10 +1492,28 @@ o Libraries (libc/, libm/) 2016-07-30: Numerous fixes and performance improvements from David Alessio. -Status: Open -Priority: Low for casual users but clearly high if you need care about + Status: Open + Priority: Low for casual users but clearly high if you need care about these incorrect corner case behaviors in the math libraries. + Title: Repartition libc functionality. + Description: There are many things implemented within the kernel (for example + under sched/pthread) that probably should be migrated in the + C library where it belongs. + + I would really like to see a little flavor of a micro-kernel + at the OS interface: I would like to see more primitive OS + system calls with more higher level logic in the C library. + + One awkward thing is the incompatibility of KERNEL vs FLAT + builds: In the kernel build, it would be nice to move many + of the thread-specific data items out of the TCB and into + the process address environment where they belong. It is + difficult to make this compatible with the FLAT build, + however. + Status: Open + Priority: Low + o File system / Generic drivers (fs/, drivers/) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1713,18 +1712,6 @@ o Graphics Subsystem (graphics/) Status: Open Priority: Medium low - Title: IMPROVED NxTERM FONT CACHING - Description: Now each NxTerm instance has its own private font cache - whose size is determined by CONFIG_NXTERM_MXCHARS. If there - are multiple NxTerm instances using the same font, each will - have a separate font cache. This is inefficient and wasteful - of memory: Each NxTerm instance should share a common font - cache. - Status: Open - Priority: Medium. Not important for day-to-day testing but would be - a critical improvement if NxTerm were to be used in a - product. - Title: NxTERM VT100 SUPPORT Description: If the NxTerm will be used with the Emacs-like command line editor (CLE), then it will need to support VT100 cursor control @@ -1761,6 +1748,37 @@ o Graphics Subsystem (graphics/) Priority: Low, not a serious issue but worth noting. There is no plan to change this behavior. + Title: REMOVE SINGLE USER MODE + Description: NX graphics supports two modes: A simple single user mode and + more complex multi-user mode selected with CONFIG_NX_MULTIUSER=y. + In this configuration, an application can start the NX server + with boardctrl(BOARDIOC_NX_START); After that, all graphic + interactions are via a thin layer in libnx/. The OS + interface is only via messages sent and received using POSIX + message queues. So this is good code and respects all of the + POSIX interfacing rules. Hence, it works well in all build + modes (FLAT, PROTECTED, and KERNEL builds). + + But without CONFIG_NX_MULTIUSER, the single user applications + violate all of the rules and calls internal NX functions + directly. This includes all calls to internal OSfunctions + with names like, nx_open, up_fbinitialize, board_lcd_*, and + others. This is a violation of interfacing standard in all + cases and can only be made to work in the FLAT build mode. + + The single user mode does have some desirable properties: It + is lighter weight and so more suitable for very resource limited + platforms. But I think that in the long run the only reasonable + solution is to eliminate the single user mode and provide only + the multi-user mode with the message queue interface. + Status: Open + Priority: Low-Medium, not a serious issue but worth noting. Single user + mode is a blemish on the OS and not compatible with the RTOS + roadmap. But neither is there any critical necessity to + remove the offending code immediately. Be aware: If you use + the single user mode, it will be yanked out from under your + feet in the not-so-distant future. + o Build system ^^^^^^^^^^^^ @@ -1790,21 +1808,6 @@ o Build system Priority: Low, since I am not aware of anyone using the Windows Native build. But, of course, very high if you want to use it. - Title: REMOVE SINGLE USER MODE - Description: The graphics sub-system can operate in either a single-user mode or - in a multi-user mode. In the multiple-user mode, a kernel thread - is used to support a graphics server. Multiple applications may then - communicate with the server using a message queue. This users only - standard POSIX interfaces and works in all build modes (FLAT, - PROTECTED, and KERNEL builds). - - The single-user mode, on the hand, uses inappropriate calls directly - into the OS. This violates the POSIX interface and must, eventually, - be eliminated. These inappropriate calls can only be supported in - the FLAT build mode. - Status: Open - Priority: Medium-High - o Other drivers (drivers/) ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1997,13 +2000,6 @@ o Network Utilities (apps/netutils/) Status: Open Priority: Medium - Title: THTTPD WARNINGS - Description: If the network is enabled, but THTTPD is not configured, it spews out lots - of pointless warnings. This is kind of annoying and unprofessional; needs to - be fixed someday. - Status: Open. An annoyance, but not a real problem. - Priority: Low - Title: NETWORK MONITOR NOT GENERALLY AVAILABLE Description: The NSH network management logic has general applicability but is currently useful only because it is embedded in the NSH @@ -2023,11 +2019,6 @@ o NuttShell (NSH) (apps/nshlib) Status: Open Priority: Low - Title: ARPPING COMMAND - Description: Add an arping command - Status: Open - Priority: Low (enhancement) - o System libraries apps/system (apps/system) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2083,7 +2074,12 @@ o Other Applications & Tests (apps/examples/) it stops rendering. This is not a problem for the examples/nx code because it uses so few fonts, but if the logic were leveraged for more general purposes, it would be a problem. + Update: see examples/nxtext for some improved font cache handling. + Update: The NXTERM font cache has been generalized and is now + offered as the standard, common font cache for all applications. + both the nx and nxtext examples should be modified to use this + common font cache. See interfaces defined in nxfonts.h. Status: Open Priority: Low. This is not really a problem because examples/nx works fine with its bogus font caching. diff --git a/arch/Kconfig b/arch/Kconfig index 0125994830f2e94453d1c77faafdbdab811778e3..f57f510355f755f744c0ec1ff367c5911517910e 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -46,12 +46,6 @@ config ARCH_MISOC ---help--- MISOC -config ARCH_RGMP - bool "RGMP" - ---help--- - RTOS and GPOS on Multi-Processor (RGMP) architecture. See - http://rgmp.sourceforge.net/wiki/index.php/Main_Page. - config ARCH_RENESAS bool "Renesas" select ARCH_NOINTC @@ -83,6 +77,8 @@ config ARCH_X86 config ARCH_XTENSA bool "Xtensa" + select ARCH_HAVE_STACKCHECK + select ARCH_HAVE_CUSTOMOPT ---help--- Cadence® Tensilica® Xtensa® actictures. @@ -107,7 +103,6 @@ config ARCH default "hc" if ARCH_HC default "mips" if ARCH_MIPS default "misoc" if ARCH_MISOC - default "rgmp" if ARCH_RGMP default "renesas" if ARCH_RENESAS default "risc-v" if ARCH_RISCV default "sim" if ARCH_SIM @@ -121,7 +116,6 @@ source arch/avr/Kconfig source arch/hc/Kconfig source arch/mips/Kconfig source arch/misoc/Kconfig -source arch/rgmp/Kconfig source arch/renesas/Kconfig source arch/risc-v/Kconfig source arch/sim/Kconfig diff --git a/arch/README.txt b/arch/README.txt index 4d4fe01ec13faa924629f8c2b011a92b13995c49..a0f604e4affe695ed956fb33191c3e1bb5e94b6a 100644 --- a/arch/README.txt +++ b/arch/README.txt @@ -158,7 +158,6 @@ arch/arm - ARM-based micro-controllers MCU support arch/arm/include/a1x and arch/arm/src/a1x arch/arm/include/c5471 and arch/arm/src/c5471 - arch/arm/include/calypso and arch/arm/src/calypso arch/arm/include/dm320 and arch/arm/src/dm320 arch/arm/include/efm32 and arch/arm/src/efm32 arch/arm/include/imx1 and arch/arm/src/imx1 @@ -222,17 +221,6 @@ arch/renesas - Support for Renesas and legacy Hitachi microcontrollers. arch/renesas/include/m16c and arch/renesas/src/m16c arch/renesas/include/sh1 and arch/renesas/src/sh1 -arch/rgmp - - RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project - for running GPOS and RTOS simultaneously on multi-processor platforms. - You can port your favorite RTOS to RGMP together with an unmodified - Linux to form a hybrid operating system. This makes your application - able to use both RTOS and GPOS features. - - See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further - information about RGMP. - arch/risc-v This directory is dedicated to ports to the RISC-V family. diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9b721e2a3ead055e21d09a522fa1db9ab12e1a02..d56e0a861e1c2c31db4a9b4c67effda01a868fb6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -31,16 +31,6 @@ config ARCH_CHIP_C5471 ---help--- TI TMS320 C5471, A180, or DA180 (ARM7TDMI) -config ARCH_CHIP_CALYPSO - bool "Calypso" - select ARCH_ARM7TDMI - select ARCH_HAVE_HEAP2 - select ARCH_HAVE_LOWVECTORS - select OTHER_UART_SERIALDRIVER - select ARCH_HAVE_POWEROFF - ---help--- - TI Calypso-based cell phones (ARM7TDMI) - config ARCH_CHIP_DM320 bool "TMS320 DM320" select ARCH_ARM926EJS @@ -409,7 +399,6 @@ config ARCH_CHIP string default "a1x" if ARCH_CHIP_A1X default "c5471" if ARCH_CHIP_C5471 - default "calypso" if ARCH_CHIP_CALYPSO default "dm320" if ARCH_CHIP_DM320 default "efm32" if ARCH_CHIP_EFM32 default "imx1" if ARCH_CHIP_IMX1 @@ -625,9 +614,6 @@ endif if ARCH_CHIP_C5471 source arch/arm/src/c5471/Kconfig endif -if ARCH_CHIP_CALYPSO -source arch/arm/src/calypso/Kconfig -endif if ARCH_CHIP_DM320 source arch/arm/src/dm320/Kconfig endif diff --git a/arch/rgmp/src/arm/sigentry.S b/arch/arm/include/arm/spinlock.h similarity index 80% rename from arch/rgmp/src/arm/sigentry.S rename to arch/arm/include/arm/spinlock.h index 1e413450bf6573c61f7215f23eb366fe0c38fa06..ee3db052cf0002db9f13b0b8a547196ec97e2aad 100644 --- a/arch/rgmp/src/arm/sigentry.S +++ b/arch/arm/include/arm/spinlock.h @@ -1,12 +1,8 @@ /**************************************************************************** - * arch/rgmp/src/arm/sigentry.S + * arch/arm/include/armv7-a/spinlock.h * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,13 +33,7 @@ * ****************************************************************************/ - .globl up_sigentry -up_sigentry: - sub sp, sp, #68 @ 68 is the size of Trapframe - mov r0, sp - bl up_sigdeliver - add sp, sp, #4 @ skip current_task - pop {r0-r12, lr} - rfefd sp! +#ifndef __ARCH_ARM_INCLUDE_ARM_SPINLOCK_H +#define __ARCH_ARM_INCLUDE_ARM_SPINLOCK_H - \ No newline at end of file +#endif /* __ARCH_ARM_INCLUDE_ARM_SPINLOCK_H */ diff --git a/arch/arm/src/stm32/stm32_getc.h b/arch/arm/include/armv6-m/spinlock.h similarity index 79% rename from arch/arm/src/stm32/stm32_getc.h rename to arch/arm/include/armv6-m/spinlock.h index 651165fba5ed562dcb856275ff70482068bb5750..c1d154b37001652e6624c535d113ed7519cce219 100644 --- a/arch/arm/src/stm32/stm32_getc.h +++ b/arch/arm/include/armv6-m/spinlock.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * arch/arm/src/stm32/stm32_getc.h +/**************************************************************************** + * arch/arm/include/armv7-a/spinlock.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,17 +31,9 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_ARM_SRC_STM32_STM32_GETC_H -#define __ARCH_ARM_SRC_STM32_STM32_GETC_H +#ifndef __ARCH_ARM_INCLUDE_ARMV6_M_SPINLOCK_H +#define __ARCH_ARM_INCLUDE_ARMV6_M_SPINLOCK_H -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include "chip.h" - -#endif /* __ARCH_ARM_SRC_STM32_STM32_GETC_H */ +#endif /* __ARCH_ARM_INCLUDE_ARMV6_M_SPINLOCK_H */ diff --git a/arch/rgmp/include/arm/arch/subarch/arch.h b/arch/arm/include/armv7-a/spinlock.h similarity index 78% rename from arch/rgmp/include/arm/arch/subarch/arch.h rename to arch/arm/include/armv7-a/spinlock.h index e5f3fff10f93ad6892b0c744442d0956407c60cd..764a96ecef3104a8f27e6dde4c816cd7afb0864f 100644 --- a/arch/rgmp/include/arm/arch/subarch/arch.h +++ b/arch/arm/include/armv7-a/spinlock.h @@ -1,12 +1,8 @@ /**************************************************************************** - * arch/rgmp/include/arm/arch/subarch/arch.h + * arch/arm/include/armv7-a/spinlock.h * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,22 +33,7 @@ * ****************************************************************************/ -#ifndef __RGMP_ARCH_SUBARCH_ARCH_H -#define __RGMP_ARCH_SUBARCH_ARCH_H - -#ifndef __ASSEMBLY__ - - -static inline void up_mdelay(uint32_t msec) -{ - -} - -static inline void up_udelay(uint32_t usec) -{ - -} - -#endif /* !__ASSEMBLY__ */ +#ifndef __ARCH_ARM_INCLUDE_ARMV7_A_SPINLOCK_H +#define __ARCH_ARM_INCLUDE_ARMV7_A_SPINLOCK_H -#endif +#endif /* __ARCH_ARM_INCLUDE_ARMV7_A_SPINLOCK_H */ diff --git a/configs/misoc/include/generated/common.h b/arch/arm/include/armv7-m/spinlock.h similarity index 76% rename from configs/misoc/include/generated/common.h rename to arch/arm/include/armv7-m/spinlock.h index 38859deefab48d8308a8bd1c139c1ef477ab4460..79a06b4173f94731d24c8379f0999dc9e07c1183 100644 --- a/configs/misoc/include/generated/common.h +++ b/arch/arm/include/armv7-m/spinlock.h @@ -1,8 +1,8 @@ /**************************************************************************** - * configs/misoc/include/generated/common.h + * arch/arm/include/armv7-a/spinlock.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Ramtin Amin + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,17 +33,7 @@ * ****************************************************************************/ -#ifndef __CONFIGS_MISOC_INCLUDE_GENERATED_COMMON_H -#define __CONFIGS_MISOC_INCLUDE_GENERATED_COMMON_H +#ifndef __ARCH_ARM_INCLUDE_ARMV7_M_SPINLOCK_H +#define __ARCH_ARM_INCLUDE_ARMV7_M_SPINLOCK_H -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifdef __ASSEMBLER__ -# define MMPTR(x) x -#else -# define MMPTR(x) (*((volatile unsigned int *)(x))) -#endif - -#endif /* __CONFIGS_MISOC_INCLUDE_GENERATED_COMMON_H */ +#endif /* __ARCH_ARM_INCLUDE_ARMV7_M_SPINLOCK_H */ diff --git a/arch/arm/include/armv7-r/spinlock.h b/arch/arm/include/armv7-r/spinlock.h new file mode 100644 index 0000000000000000000000000000000000000000..ab7900fa7337d90291c62b4cbfd716559e2a474c --- /dev/null +++ b/arch/arm/include/armv7-r/spinlock.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * arch/arm/include/armv7-r/spinlock.h + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __ARCH_ARM_INCLUDE_ARMV7_R_SPINLOCK_H +#define __ARCH_ARM_INCLUDE_ARMV7_R_SPINLOCK_H + +#endif /* __ARCH_ARM_INCLUDE_ARMV7_R_SPINLOCK_H */ diff --git a/arch/arm/include/calypso/clock.h b/arch/arm/include/calypso/clock.h deleted file mode 100644 index a10a607a5d232d960e1f2861ef101fcab6cd42ef..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/clock.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H -#define __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H - -#include - -#define CALYPSO_PLL26_52_MHZ ((2 << 8) | 0) -#define CALYPSO_PLL26_86_7_MHZ ((10 << 8) | 2) -#define CALYPSO_PLL26_87_MHZ ((3 << 8) | 0) -#define CALYPSO_PLL13_104_MHZ ((8 << 8) | 0) - -enum mclk_div { - _ARM_MCLK_DIV_1 = 0, - ARM_MCLK_DIV_1 = 1, - ARM_MCLK_DIV_2 = 2, - ARM_MCLK_DIV_3 = 3, - ARM_MCLK_DIV_4 = 4, - ARM_MCLK_DIV_5 = 5, - ARM_MCLK_DIV_6 = 6, - ARM_MCLK_DIV_7 = 7, - ARM_MCLK_DIV_1_5 = 0x80 | 1, - ARM_MCLK_DIV_2_5 = 0x80 | 2, -}; - -void calypso_clock_set(uint8_t vtcxo_div2, uint16_t inp, enum mclk_div mclk_div); -void calypso_pll_set(uint16_t inp); -void calypso_clk_dump(void); - -/* CNTL_RST */ -enum calypso_rst { - RESET_DSP = (1 << 1), - RESET_EXT = (1 << 2), - RESET_WDOG = (1 << 3), -}; - -void calypso_reset_set(enum calypso_rst calypso_rst, int active); -int calypso_reset_get(enum calypso_rst); - -enum calypso_bank { - CALYPSO_nCS0 = 0, - CALYPSO_nCS1 = 2, - CALYPSO_nCS2 = 4, - CALYPSO_nCS3 = 6, - CALYPSO_nCS7 = 8, - CALYPSO_CS4 = 0xa, - CALYPSO_nCS6 = 0xc, -}; - -enum calypso_mem_width { - CALYPSO_MEM_8bit = 0, - CALYPSO_MEM_16bit = 1, - CALYPSO_MEM_32bit = 2, -}; - -void calypso_mem_cfg(enum calypso_bank bank, uint8_t ws, - enum calypso_mem_width width, int we); - -/* Enable or disable the internal bootrom mapped to 0x0000'0000 */ -void calypso_bootrom(int enable); - -/* Enable or disable the debug unit */ -void calypso_debugunit(int enable); - -/* configure the RHEA bus bridge[s] */ -void calypso_rhea_cfg(uint8_t fac0, uint8_t fac1, uint8_t timeout, - uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1); - -#endif /* __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H */ diff --git a/arch/arm/include/calypso/debug.h b/arch/arm/include/calypso/debug.h deleted file mode 100644 index 9596946775756250a5b5dd9dabef3230503dc9d7..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/debug.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H -#define __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - -/* - * Check at compile time that something is of a particular type. - * Always evaluates to 1 so you may use it easily in comparisons. - */ -#define typecheck(type,x) \ -({ type __dummy; \ - typeof(x) __dummy2; \ - (void)(&__dummy == &__dummy2); \ - 1; \ -}) - -#ifdef DEBUG -#define dputchar(x) putchar(x) -#define dputs(x) puts(x) -#define dphex(x,y) phex(x,y) -#define printd(x, ...) printf(x, ##__VA_ARGS__) -#else -#define dputchar(x) -#define dputs(x) -#define dphex(x,y) -#define printd(x, args ...) -#endif - -#endif /* __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H */ diff --git a/arch/arm/include/calypso/defines.h b/arch/arm/include/calypso/defines.h deleted file mode 100644 index 4f29560c8332f41b0eba7db613b64b037921b597..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/defines.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H -#define __ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H - -#define __attribute_const__ __attribute__((__const__)) - -/* type properties */ -#define __packed __attribute__((packed)) -#define __aligned(alignment) __attribute__((aligned(alignment))) -#define __unused __attribute__((unused)) - -/* linkage */ -#define __section(name) __attribute__((section(name))) - -/* force placement in zero-waitstate memory */ -#define __ramtext __section(".ramtext") - -#endif /* !__ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H */ diff --git a/arch/arm/include/calypso/irq.h b/arch/arm/include/calypso/irq.h deleted file mode 100644 index 0dda3f312feec579d446f491cd1b04f479fa1398..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/irq.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** - * arch/arm/include/calypso/irq.h - * Driver for Calypso IRQ controller - * - * (C) 2010 by Harald Welte - * (C) 2011 by Stefan Richter - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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_IRQ_H -#error "This file should never be included directly! Use " -#endif - -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H -#define __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H - -#ifndef __ASSEMBLY__ - -enum irq_nr { - IRQ_WATCHDOG = 0, - IRQ_TIMER1 = 1, - IRQ_TIMER2 = 2, - IRQ_TSP_RX = 3, - IRQ_TPU_FRAME = 4, - IRQ_TPU_PAGE = 5, - IRQ_SIMCARD = 6, - IRQ_UART_MODEM = 7, - IRQ_KEYPAD_GPIO = 8, - IRQ_RTC_TIMER = 9, - IRQ_RTC_ALARM_I2C = 10, - IRQ_ULPD_GAUGING = 11, - IRQ_EXTERNAL = 12, - IRQ_SPI = 13, - IRQ_DMA = 14, - IRQ_API = 15, - IRQ_SIM_DETECT = 16, - IRQ_EXTERNAL_FIQ = 17, - IRQ_UART_IRDA = 18, - IRQ_ULPD_GSM_TIMER = 19, - IRQ_GEA = 20, - _NR_IRQS -}; - -#endif /* __ASSEMBLY__ */ - -/* Don't use _NR_IRQS!!! Won't work in preprocessor... */ -#define NR_IRQS 21 - -#define IRQ_SYSTIMER IRQ_TIMER2 - -#endif /* __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H */ diff --git a/arch/arm/include/calypso/memory.h b/arch/arm/include/calypso/memory.h deleted file mode 100644 index a4ce1e890ee2c57b98cdfe61e0814600cc6cc4ee..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/memory.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H -#define __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H - -#define __arch_getb(a) (*(volatile unsigned char *)(a)) -#define __arch_getw(a) (*(volatile unsigned short *)(a)) -#define __arch_getl(a) (*(volatile unsigned int *)(a)) - -#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) -#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) -#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) - -#define __raw_writeb(v,a) __arch_putb(v,a) -#define __raw_writew(v,a) __arch_putw(v,a) -#define __raw_writel(v,a) __arch_putl(v,a) - -#define __raw_readb(a) __arch_getb(a) -#define __raw_readw(a) __arch_getw(a) -#define __raw_readl(a) __arch_getl(a) - -#define writeb(v,a) __arch_putb(v,a) -#define writew(v,a) __arch_putw(v,a) -#define writel(v,a) __arch_putl(v,a) - -#define readb(a) __arch_getb(a) -#define readw(a) __arch_getw(a) -#define readl(a) __arch_getl(a) - -#endif /* __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H */ diff --git a/arch/arm/include/calypso/timer.h b/arch/arm/include/calypso/timer.h deleted file mode 100644 index 93a1bd1492508a27af51a76edb776b175badd86b..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/timer.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H -#define __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H - -/* Enable or Disable a timer */ -void hwtimer_enable(int num, int on); - -/* Configure pre-scaler and if timer is auto-reload */ -void hwtimer_config(int num, uint8_t pre_scale, int auto_reload); - -/* Load a timer with the given value */ -void hwtimer_load(int num, uint16_t val); - -/* Read the current timer value */ -uint16_t hwtimer_read(int num); - -/* Enable or disable the watchdog */ -void wdog_enable(int on); - -/* Reset cpu using watchdog */ -void wdog_reset(void); - -/* power up the timers */ -void hwtimer_init(void); - -#endif /* __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H */ diff --git a/arch/arm/include/calypso/uwire.h b/arch/arm/include/calypso/uwire.h deleted file mode 100644 index 0ca6c376ca7c326618db38f025f4a84d531bbfa0..0000000000000000000000000000000000000000 --- a/arch/arm/include/calypso/uwire.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ARCH_ARM_INCLUDE_CALYPSO_UWIRE_H -#define __ARCH_ARM_INCLUDE_CALYPSO_UWIRE_H -void uwire_init(void); -int uwire_xfer(int cs, int bitlen, const void *dout, void *din); -#endif - diff --git a/arch/arm/include/kinetis/chip.h b/arch/arm/include/kinetis/chip.h index f2fa5fbb4e707b0732f369f6a4d9e0e27dc9a117..5e784f43634c4879cfcd359c743ce89cfaa14d21 100644 --- a/arch/arm/include/kinetis/chip.h +++ b/arch/arm/include/kinetis/chip.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/include/kinetis/chip.h * - * Copyright (C) 2011, 2013, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -151,105 +151,105 @@ defined(CONFIG_ARCH_CHIP_MK20DX128VLH7) || \ defined(CONFIG_ARCH_CHIP_MK20DX256VLH7) -# define KINETIS_K20 1 /* Kinetics K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_K20 1 /* Kinetics K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ #if defined(CONFIG_ARCH_CHIP_MK20DX64VLH7) -# define KINETIS_FLASH_SIZE (64*1024) /* 64Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (16*1024) /* 16Kb */ +# define KINETIS_FLASH_SIZE (64*1024) /* 64Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (16*1024) /* 16Kb */ #elif defined(CONFIG_ARCH_CHIP_MK20DX128VLH7) -# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ #else /* if defined(CONFIG_ARCH_CHIP_MK20DX256VLH7) */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ #endif -# undef KINETIS_MPU /* No memory protection unit */ -# undef KINETIS_EXTBUS /* No external bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# undef KINETIS_NSDHC /* No SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 3 /* Three UARTs */ -# define KINETIS_NSPI 1 /* One SPI module */ -# define KINETIS_NCAN 1 /* Two CAN controller */ -# define KINETIS_NI2S 1 /* One I2S module */ -# undef KINETIS_NSLCD /* No segment LCD interface */ -# define KINETIS_NADC16 2 /* Two 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 2 /* Two 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# undef KINETIS_NRNG /* No random number generator */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# undef KINETIS_NCRC /* No CRC */ +# undef KINETIS_MPU /* No memory protection unit */ +# undef KINETIS_EXTBUS /* No external bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# undef KINETIS_NSDHC /* No SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 3 /* Three UARTs */ +# define KINETIS_NSPI 1 /* One SPI module */ +# define KINETIS_NCAN 1 /* Two CAN controller */ +# define KINETIS_NI2S 1 /* One I2S module */ +# undef KINETIS_NSLCD /* No segment LCD interface */ +# define KINETIS_NADC16 2 /* Two 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 2 /* Two 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# undef KINETIS_NRNG /* No random number generator */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# undef KINETIS_NCRC /* No CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40X64VFX50) || defined(CONFIG_ARCH_CHIP_MK40X64VLH50) || \ defined(CONFIG_ARCH_CHIP_MK40X64VLK50) || defined(CONFIG_ARCH_CHIP_MK40X64VMB50) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (64*1024) /* 64Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (16*1024) /* 16Kb */ -# undef KINETIS_MPU /* No memory protection unit */ -# undef KINETIS_EXTBUS /* No external bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# undef KINETIS_NSDHC /* No SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (64*1024) /* 64Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (16*1024) /* 16Kb */ +# undef KINETIS_MPU /* No memory protection unit */ +# undef KINETIS_EXTBUS /* No external bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# undef KINETIS_NSDHC /* No SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ # if defined(CONFIG_ARCH_CHIP_MK40X64VLK50) || defined(CONFIG_ARCH_CHIP_MK40X64VMB50) -# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ # else -# undef KINETIS_NCAN /* No CAN in 64-pin chips */ +# undef KINETIS_NCAN /* No CAN in 64-pin chips */ # endif -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 25x8/29x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# undef KINETIS_NRNG /* No random number generator */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 25x8/29x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# undef KINETIS_NRNG /* No random number generator */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40X128VFX50) || defined(CONFIG_ARCH_CHIP_MK40X128VLH50) || \ defined(CONFIG_ARCH_CHIP_MK40X128VLK50) || defined(CONFIG_ARCH_CHIP_MK40X128VMB50) || \ @@ -257,758 +257,799 @@ defined(CONFIG_ARCH_CHIP_MK40X128VFX72) || defined(CONFIG_ARCH_CHIP_MK40X128VLH72) || \ defined(CONFIG_ARCH_CHIP_MK40X128VLK72) || defined(CONFIG_ARCH_CHIP_MK40X128VMB72) || \ defined(CONFIG_ARCH_CHIP_MK40X128VLL72) || defined(CONFIG_ARCH_CHIP_MK40X128VML72) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ -# undef KINETIS_MPU /* No memory protection unit */ -# undef KINETIS_EXTBUS /* No external bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# undef KINETIS_NSDHC /* No SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ +# undef KINETIS_MPU /* No memory protection unit */ +# undef KINETIS_EXTBUS /* No external bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# undef KINETIS_NSDHC /* No SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40X256VLK72) || defined(CONFIG_ARCH_CHIP_MK40X256VMB72) || \ defined(CONFIG_ARCH_CHIP_MK40X256VLL72) || defined(CONFIG_ARCH_CHIP_MK40X256VML72) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (32*1024) /* 64Kb */ -# undef KINETIS_MPU /* No memory protection unit */ -# undef KINETIS_EXTBUS /* No external bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# undef KINETIS_NSDHC /* No SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXMEM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (32*1024) /* 64Kb */ +# undef KINETIS_MPU /* No memory protection unit */ +# undef KINETIS_EXTBUS /* No external bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# undef KINETIS_NSDHC /* No SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40X128VLQ100) || defined(CONFIG_ARCH_CHIP_MK40X128VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ -# define KINETIS_FLEXMEM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* One SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (128*1024) /* 128Kb */ +# define KINETIS_FLEXMEM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_SRAM_SIZE (32*1024) /* 32Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* One SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40X256VLQ100) || defined(CONFIG_ARCH_CHIP_MK40X256VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXMEM_SIZE (256*1024) /* 256Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 32Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* One SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXMEM_SIZE (256*1024) /* 256Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 32Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* One SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK40N512VLK100) || defined(CONFIG_ARCH_CHIP_MK40N512VMB100) || \ defined(CONFIG_ARCH_CHIP_MK40N512VLL100) || defined(CONFIG_ARCH_CHIP_MK40N512VML100) || \ defined(CONFIG_ARCH_CHIP_MK40N512VLQ100) || defined(CONFIG_ARCH_CHIP_MK40N512VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# define KINETIS_K40 1 /* Kinetics K40 family */ -# undef KINETIS_K60 /* Not Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ -# undef KINETIS_FLEXMEM_SIZE /* No FlexMemory */ -# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# undef KINETIS_NENET /* No Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* One SD host controller */ -# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 2 /* Two I2C modules */ -# undef KINETIS_NISO7816 /* No UART with ISO-786 */ -# define KINETIS_NUART 6 /* Six UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 1 /* One I2S module */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# define KINETIS_K40 1 /* Kinetics K40 family */ +# undef KINETIS_K60 /* Not Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ +# undef KINETIS_FLEXMEM_SIZE /* No FlexMemory */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# undef KINETIS_NENET /* No Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* One SD host controller */ +# undef KINETIS_NTOUCHIF /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 2 /* Two I2C modules */ +# undef KINETIS_NISO7816 /* No UART with ISO-786 */ +# define KINETIS_NUART 6 /* Six UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 1 /* One I2S module */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 40x8/44x4)*/ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 2 /* Two Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# define KINETIS_NDAC6 3 /* Three 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Two 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N256VLL100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60X256VLL100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXRAM_SIZE (4*1024) /* 32Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXRAM_SIZE (4*1024) /* 32Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N512VLL100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (512*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_ENET_HAS_DBSWAP /* MAC-NET supports DBSWP bit */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ -# undef KINETIS_NADC15 /* No 15-channel ADC */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (512*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_ENET_HAS_DBSWAP /* MAC-NET supports DBSWP bit */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# define KINETIS_NADC13 1 /* No 13-channel ADC (ADC1) */ +# undef KINETIS_NADC15 /* No 15-channel ADC */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N256VML100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60X256VML100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N512VML100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (512*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 4 /* Four additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ -# undef KINETIS_NADC18 /* No 18-channel ADC */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 1 /* One 12-bit DAC */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (512*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 4 /* Four additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC12 1 /* One 12-channel ADC (ADC0)*/ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC1) */ +# undef KINETIS_NADC18 /* No 18-channel ADC */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 1 /* One 12-bit DAC */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N256VLQ100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60X256VLQ100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N512VLQ100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N256VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60X256VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ -# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ -# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXNVM_SIZE (256*1024) /* 256Kb */ +# define KINETIS_FLEXRAM_SIZE (4*1024) /* 4Kb */ +# define KINETIS_SRAM_SIZE (64*1024) /* 64Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK60N512VMD100) -# undef KINETIS_K20 /* Not Kinetis K20 family */ -# undef KINETIS_K40 /* Not Kinetics K40 family */ -# define KINETIS_K60 1 /* Kinetis K60 family */ -# undef KINETIS_K64 /* Not Kinetis K64 family */ -# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ -# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ -# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ -# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ -# define KINETIS_MPU 1 /* Memory protection unit */ -# define KINETIS_EXTBUS 1 /* External bus interface */ -# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ -# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ -# define KINETIS_NUSBHOST 1 /* One USB host controller */ -# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ -# define KINETIS_NUSBDEV 1 /* One USB device controller */ -# define KINETIS_NSDHC 1 /* SD host controller */ -# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ -# define KINETIS_NI2C 3 /* Three I2C modules */ -# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ -# define KINETIS_NUART 5 /* Five additional UARTs */ -# define KINETIS_NSPI 3 /* Three SPI modules */ -# define KINETIS_NCAN 2 /* Two CAN controllers */ -# define KINETIS_NI2S 2 /* Two I2S modules */ -# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ -# define KINETIS_NADC16 4 /* Four 16-bit ADC */ -# undef KINETIS_NADC12 /* No 12-channel ADC */ -# undef KINETIS_NADC13 /* No 13-channel ADC */ -# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ -# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ -# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ -# define KINETIS_NCMP 3 /* Three analog comparators */ -# undef KINETIS_NDAC6 /* No 6-bit DAC */ -# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ -# define KINETIS_NVREF 1 /* Voltage reference */ -# undef KINETIS_NTIMERS12 /* No 12 channel timers */ -# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ -# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ -# undef KINETIS_NTIMERS20 /* No 20 channel timers */ -# define KINETIS_NRTC 1 /* Real time clock */ -# undef KINETIS_NRNG /* No random number generator */ -# undef KINETIS_NMMCAU /* No hardware encryption */ -# undef KINETIS_NTAMPER /* No tamper detect */ -# define KINETIS_NCRC 1 /* CRC */ +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (512*1024) /* 512Kb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 16 /* Up to 16 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NISO7816 1 /* One UART with ISO-786 */ +# define KINETIS_NUART 5 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NSLCD 1 /* One segment LCD interface (up to 36x8/40x4) */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# undef KINETIS_NADC12 /* No 12-channel ADC */ +# undef KINETIS_NADC13 /* No 13-channel ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NADC18 1 /* One 18-channel ADC (ADC1) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 3 /* Three analog comparators */ +# undef KINETIS_NDAC6 /* No 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# undef KINETIS_NTIMERS12 /* No 12 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# undef KINETIS_NTIMERS20 /* No 20 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# undef KINETIS_NRNG /* No random number generator */ +# undef KINETIS_NMMCAU /* No hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ + +#elif defined(CONFIG_ARCH_CHIP_MK60FN1M0VLQ12) +# undef KINETIS_K20 /* Not Kinetis K20 family */ +# undef KINETIS_K40 /* Not Kinetics K40 family */ +# define KINETIS_K60 1 /* Kinetis K60 family */ +# define KINETIS_NEW_MCG 1 /* Kinetis New MCG - different VDIV */ +# undef KINETIS_K64 /* Not Kinetis K64 family */ +# define KINETIS_FLASH_SIZE (1024*1024) /* 1Mb */ +# undef KINETIS_FLEXNVM_SIZE /* No FlexNVM */ +# undef KINETIS_FLEXRAM_SIZE /* No FlexRAM */ +# define KINETIS_SRAM_SIZE (128*1024) /* 128Kb */ +# define KINETIS_MPU 1 /* Memory protection unit */ +# define KINETIS_EXTBUS 1 /* External bus interface */ +# define KINETIS_NDMACH 32 /* Up to 32 DMA channels */ +# define KINETIS_NENET 1 /* One IEEE 1588 Ethernet controller */ +# define KINETIS_NUSBHOST 1 /* One USB host controller */ +# define KINETIS_NUSBOTG 1 /* With USB OTG controller */ +# define KINETIS_NUSBDEV 1 /* One USB device controller */ +# define KINETIS_NSDHC 1 /* SD host controller */ +# define KINETIS_NTOUCHIF 1 /* Xtrinsic touch sensing interface */ +# define KINETIS_NI2C 3 /* Three I2C modules */ +# define KINETIS_NUART 6 /* Five additional UARTs */ +# define KINETIS_NSPI 3 /* Three SPI modules */ +# define KINETIS_NCAN 2 /* Two CAN controllers */ +# define KINETIS_NI2S 2 /* Two I2S modules */ +# define KINETIS_NADC16 4 /* Four 16-bit ADC */ +# define KINETIS_NADC15 1 /* One 15-channel ADC (ADC0) */ +# define KINETIS_NPGA 4 /* Four Programmable Gain Amplifiers */ +# define KINETIS_NCMP 4 /* Four analog comparators */ +# undef KINETIS_NDAC6 4 /* Four 6-bit DAC */ +# define KINETIS_NDAC12 2 /* Twp 12-bit DACs */ +# define KINETIS_NVREF 1 /* Voltage reference */ +# define KINETIS_NTIMERS8 2 /* Two 8 channel timers */ +# define KINETIS_NTIMERS20 4 /* Four 20 channel timers */ +# define KINETIS_NTIMERS12 3 /* Three 12 channel timers */ +# define KINETIS_NTIMERS2 2 /* Two 2 channel timers */ +# define KINETIS_NRTC 1 /* Real time clock */ +# define KINETIS_NRNG 1 /* Random number generator */ +# define KINETIS_NMMCAU 1 /* Hardware encryption */ +# undef KINETIS_NTAMPER /* No tamper detect */ +# define KINETIS_NCRC 1 /* CRC */ #elif defined(CONFIG_ARCH_CHIP_MK64FN1M0VLL12) # undef KINETIS_K20 /* Not Kinetics K20 family */ diff --git a/arch/arm/include/spinlock.h b/arch/arm/include/spinlock.h index 44e405e6303157eb59f1b23137223d5b9e49deb7..16079cc81a333f6fed72d3e7b80662859eb0390f 100644 --- a/arch/arm/include/spinlock.h +++ b/arch/arm/include/spinlock.h @@ -44,13 +44,59 @@ # include #endif /* __ASSEMBLY__ */ +/* Include ARM architecture-specific IRQ definitions (including register + * save structure and up_irq_save()/up_irq_restore() functions) + */ + +#if defined(CONFIG_ARCH_CORTEXA5) || defined(CONFIG_ARCH_CORTEXA8) || \ + defined(CONFIG_ARCH_CORTEXA9) +# include +#elif defined(CONFIG_ARCH_CORTEXR4) || defined(CONFIG_ARCH_CORTEXR4F) || \ + defined(CONFIG_ARCH_CORTEXR5) || defined(CONFIG_ARCH_CORTEXR5F) || \ + defined(CONFIG_ARCH_CORTEXR7) || defined(CONFIG_ARCH_CORTEXR7F) +# include +#elif defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4) || \ + defined(CONFIG_ARCH_CORTEXM7) +# include +#elif defined(CONFIG_ARCH_CORTEXM0) +# include +#else +# include +#endif + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Spinlock states */ + #define SP_UNLOCKED 0 /* The Un-locked state */ #define SP_LOCKED 1 /* The Locked state */ +/* Memory barriers for use with NuttX spinlock logic + * + * Data Memory Barrier (DMB) acts as a memory barrier. It ensures that all + * explicit memory accesses that appear in program order before the DMB + * instruction are observed before any explicit memory accesses that appear + * in program order after the DMB instruction. It does not affect the + * ordering of any other instructions executing on the processor + * + * dmb st - Data memory barrier. Wait for stores to complete. + * + * Data Synchronization Barrier (DSB) acts as a special kind of memory + * barrier. No instruction in program order after this instruction executes + * until this instruction completes. This instruction completes when: (1) All + * explicit memory accesses before this instruction complete, and (2) all + * Cache, Branch predictor and TLB maintenance operations before this + * instruction complete. + * + * dsb sy - Data syncrhonization barrier. Assures that the CPU waits until + * all memory accesses are complete + */ + +#define SP_DSB(n) __asm__ __volatile__ ("dsb sy" : : : "memory") +#define SP_DMB(n) __asm__ __volatile__ ("dmb st" : : : "memory") + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index 8f06701b518dfdb12230fe2021f970090f0bc5bb..137383bb0936d701539b9ba1a2045e3149eb21ec 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -1374,7 +1374,7 @@ # define STM32_NLCD 0 /* (0) No LCD */ # define STM32_NUSBOTG 0 /* USB FS device, but no USB OTG FS/HS */ # define STM32_NGPIO 37 /* GPIOA-F */ -# define STM32_NADC 3 /* (3) 12-bit ADC1-3 */ +# define STM32_NADC 4 /* (3) 12-bit ADC1-4 */ # define STM32_NDAC 2 /* (2) 12-bit DAC1-2 */ # define STM32_NCAPSENSE 0 /* (0) No capacitive sensing channels */ # define STM32_NCRC 1 /* (1) CRC calculation unit */ @@ -1414,7 +1414,7 @@ # define STM32_NLCD 0 /* (0) No LCD */ # define STM32_NUSBOTG 0 /* USB FS device, but no USB OTG FS/HS */ # define STM32_NGPIO 52 /* GPIOA-F */ -# define STM32_NADC 3 /* (3) 12-bit ADC1-3 */ +# define STM32_NADC 4 /* (3) 12-bit ADC1-4 */ # define STM32_NDAC 2 /* (2) 12-bit DAC1-2 */ # define STM32_NCAPSENSE 0 /* (0) No capacitive sensing channels */ # define STM32_NCRC 1 /* (1) CRC calculation unit */ @@ -1494,7 +1494,7 @@ # define STM32_NLCD 0 /* (0) No LCD */ # define STM32_NUSBOTG 0 /* USB FS device, but no USB OTG FS/HS */ # define STM32_NGPIO 87 /* GPIOA-F */ -# define STM32_NADC 3 /* (3) 12-bit ADC1-3 */ +# define STM32_NADC 4 /* (3) 12-bit ADC1-4 */ # define STM32_NDAC 2 /* (2) 12-bit DAC1-2 */ # define STM32_NCAPSENSE 0 /* (0) No capacitive sensing channels */ # define STM32_NCRC 1 /* (1) CRC calculation unit */ diff --git a/arch/arm/include/stm32l4/chip.h b/arch/arm/include/stm32l4/chip.h index 12d718764060f81070e5897e5b8cd95a2e426531..9d0712b27682037e9224e5f89104edf1259841c9 100644 --- a/arch/arm/include/stm32l4/chip.h +++ b/arch/arm/include/stm32l4/chip.h @@ -77,7 +77,7 @@ # define STM32L4_NBTIM 2 /* Two basic timers, TIM6-7 */ # define STM32L4_NLPTIM 2 /* Two low-power timers, LPTIM1-2 */ # define STM32L4_NRNG 1 /* Random number generator (RNG) */ -# define STM32L4_NUART 4 /* UART 4-5 */ +# define STM32L4_NUART 2 /* UART 4-5 */ # define STM32L4_NUSART 3 /* USART 1-3 */ # define STM32L4_NLPUART 1 /* LPUART 1 */ # define STM32L4_NSPI 3 /* SPI1-3 */ diff --git a/arch/arm/src/arm/Kconfig b/arch/arm/src/arm/Kconfig index 53f0958b2e2fd339c6e8097b1a026599c69090c6..4b9ce185510f29490a4adeaeb4beb4b1d5b1cc89 100644 --- a/arch/arm/src/arm/Kconfig +++ b/arch/arm/src/arm/Kconfig @@ -7,8 +7,8 @@ comment "ARM Configuration Options" choice prompt "Toolchain Selection" - default ARM_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS - default ARM_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS + default ARM_TOOLCHAIN_GNU_EABIW if TOOLCHAIN_WINDOWS + default ARM_TOOLCHAIN_GNU_EABIL if !TOOLCHAIN_WINDOWS config ARM_TOOLCHAIN_BUILDROOT bool "Buildroot (Cygwin or Linux)" @@ -24,11 +24,11 @@ config ARM_TOOLCHAIN_CODESOURCERYL config ARM_TOOLCHAIN_CODESOURCERYW bool "CodeSourcery GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARM_TOOLCHAIN_DEVKITARM bool "devkitARM GNU toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARM_TOOLCHAIN_GNU_EABIL bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)" @@ -38,7 +38,7 @@ config ARM_TOOLCHAIN_GNU_EABIL config ARM_TOOLCHAIN_GNU_EABIW bool "Generic GNU EABI toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) configured for arm-none-eabi-. diff --git a/arch/arm/src/armv6-m/Kconfig b/arch/arm/src/armv6-m/Kconfig index ed8b54a8e1a06c89ed5864f86e1be46649e2df06..ed56bc9a71e7f7b36730fc08ed420fafe6e0d45a 100644 --- a/arch/arm/src/armv6-m/Kconfig +++ b/arch/arm/src/armv6-m/Kconfig @@ -7,12 +7,12 @@ comment "ARMV6M Configuration Options" choice prompt "Toolchain Selection" - default ARMV6M_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS - default ARMV6M_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS + default ARMV6M_TOOLCHAIN_GNU_EABIW if TOOLCHAIN_WINDOWS + default ARMV6M_TOOLCHAIN_GNU_EABIL if !TOOLCHAIN_WINDOWS config ARMV6M_TOOLCHAIN_ATOLLIC bool "Atollic Lite/Pro for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV6M_TOOLCHAIN_BUILDROOT bool "Buildroot (Cygwin or Linux)" @@ -24,7 +24,7 @@ config ARMV6M_TOOLCHAIN_CODEREDL config ARMV6M_TOOLCHAIN_CODEREDW bool "CodeRed for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV6M_TOOLCHAIN_CODESOURCERYL bool "CodeSourcery GNU toolchain under Linux" @@ -32,11 +32,11 @@ config ARMV6M_TOOLCHAIN_CODESOURCERYL config ARMV6M_TOOLCHAIN_CODESOURCERYW bool "CodeSourcery GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV6M_TOOLCHAIN_DEVKITARM bool "devkitARM GNU toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV6M_TOOLCHAIN_GNU_EABIL bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)" @@ -46,7 +46,7 @@ config ARMV6M_TOOLCHAIN_GNU_EABIL config ARMV6M_TOOLCHAIN_GNU_EABIW bool "Generic GNU EABI toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) configured for arm-none-eabi. diff --git a/arch/arm/src/armv7-a/Kconfig b/arch/arm/src/armv7-a/Kconfig index 85ad10bbee0c202068ccec5d04ae73a1af94596c..312ed8d44132832d707fb09e93c690d6d0a5d26b 100644 --- a/arch/arm/src/armv7-a/Kconfig +++ b/arch/arm/src/armv7-a/Kconfig @@ -128,8 +128,8 @@ endif # ARMV7A_HAVE_L2CC choice prompt "Toolchain Selection" - default ARMV7A_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS - default ARMV7A_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS + default ARMV7A_TOOLCHAIN_GNU_EABIW if TOOLCHAIN_WINDOWS + default ARMV7A_TOOLCHAIN_GNU_EABIL if !TOOLCHAIN_WINDOWS config ARMV7A_TOOLCHAIN_BUILDROOT bool "Buildroot (Cygwin or Linux)" @@ -145,11 +145,11 @@ config ARMV7A_TOOLCHAIN_CODESOURCERYL config ARMV7A_TOOLCHAIN_CODESOURCERYW bool "CodeSourcery GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV7A_TOOLCHAIN_DEVKITARM bool "devkitARM GNU toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV7A_TOOLCHAIN_GNU_EABIL bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)" @@ -159,7 +159,7 @@ config ARMV7A_TOOLCHAIN_GNU_EABIL config ARMV7A_TOOLCHAIN_GNU_EABIW bool "Generic GNU EABI toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) configured for arm-none-eabi-. diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 3c798d33a0d832f98753fb80496b695c51969b03..72952e0cfaa096d8902ff03440d4ece14c70bd07 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -53,6 +53,7 @@ #include "up_arch.h" #include "sched/sched.h" +#include "irq/irq.h" #include "up_internal.h" /**************************************************************************** @@ -345,10 +346,21 @@ static void _up_assert(int errorcode) if (CURRENT_REGS || this_task()->pid == 0) { + /* Disable interrupts on this CPU */ + (void)up_irq_save(); + for (; ; ) { +#ifdef CONFIG_SMP + /* Try (again) to stop activity on other CPUs */ + + (void)spin_trylock(&g_cpu_irqlock); +#endif + #ifdef CONFIG_ARCH_LEDS + /* FLASH LEDs a 2Hz */ + board_autoled_on(LED_PANIC); up_mdelay(250); board_autoled_off(LED_PANIC); diff --git a/arch/arm/src/armv7-a/arm_cpuhead.S b/arch/arm/src/armv7-a/arm_cpuhead.S index 487fee0a46bc805660b030c47d20c34976627b10..02735e36d50c39df1d5ff8a558fcf138d66df0fa 100644 --- a/arch/arm/src/armv7-a/arm_cpuhead.S +++ b/arch/arm/src/armv7-a/arm_cpuhead.S @@ -308,7 +308,11 @@ __cpu3_start: orr r0, r0, #(SCTLR_RR) #endif -#ifndef CPU_DCACHE_DISABLE + /* In SMP configurations, the data cache will not be enabled until later + * after SMP cache coherency has been setup. + */ + +#if 0 /* !defined(CPU_DCACHE_DISABLE) && !defined(CONFIG_SMP) */ /* Dcache enable * * SCTLR_C Bit 2: DCache enable diff --git a/arch/arm/src/armv7-a/arm_cpupause.c b/arch/arm/src/armv7-a/arm_cpupause.c index 7689598b552bf5b109111ef7520567536f407cd0..ef324448e2235b774816c2973309f64676c7846d 100644 --- a/arch/arm/src/armv7-a/arm_cpupause.c +++ b/arch/arm/src/armv7-a/arm_cpupause.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "up_internal.h" #include "gic.h" @@ -55,18 +56,58 @@ * Private Data ****************************************************************************/ -static volatile spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS]; -static volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS]; +/* These spinlocks are used in the SMP configuration in order to implement + * up_cpu_pause(). The protocol for CPUn to pause CPUm is as follows + * + * 1. The up_cpu_pause() implementation on CPUn locks both g_cpu_wait[m] + * and g_cpu_paused[m]. CPUn then waits spinning on g_cpu_paused[m]. + * 2. CPUm receives the interrupt it (1) unlocks g_cpu_paused[m] and + * (2) locks g_cpu_wait[m]. The first unblocks CPUn and the second + * blocks CPUm in the interrupt handler. + * + * When CPUm resumes, CPUn unlocks g_cpu_wait[m] and the interrupt handler + * on CPUm continues. CPUm must, of course, also then unlock g_cpu_wait[m] + * so that it will be ready for the next pause operation. + */ + +static volatile spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS] SP_SECTION; +static volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS] SP_SECTION; /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: arm_pause_handler + * Name: up_cpu_pausereq * * Description: - * This is the handler for SGI2. It performs the following operations: + * Return true if a pause request is pending for this CPU. + * + * Input Parameters: + * cpu - The index of the CPU to be queried + * + * Returned Value: + * true = a pause request is pending. + * false = no pasue request is pending. + * + ****************************************************************************/ + +bool up_cpu_pausereq(int cpu) +{ + return spin_islocked(&g_cpu_paused[cpu]); +} + +/**************************************************************************** + * Name: up_cpu_paused + * + * Description: + * Handle a pause request from another CPU. Normally, this logic is + * executed from interrupt handling logic within the architecture-specific + * However, it is sometimes necessary necessary to perform the pending + * pause operation in other contexts where the interrupt cannot be taken + * in order to avoid deadlocks. + * + * This function performs the following operations: * * 1. It saves the current task state at the head of the current assigned * task list. @@ -75,49 +116,107 @@ static volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS]; * head of the ready to run list. * * Input Parameters: - * Standard interrupt handling + * cpu - The index of the CPU to be paused * * Returned Value: - * Zero on success; a negated errno value on failure. + * On success, OK is returned. Otherwise, a negated errno value indicating + * the nature of the failure is returned. * ****************************************************************************/ -int arm_pause_handler(int irq, FAR void *context) +int up_cpu_paused(int cpu) { FAR struct tcb_s *tcb = this_task(); - int cpu = up_cpu_index(); /* Update scheduler parameters */ sched_suspend_scheduler(tcb); - /* Save the current context at CURRENT_REGS into the TCB at the head of the - * assigned task list for this CPU. +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that we are paused */ + + sched_note_cpu_paused(tcb); +#endif + + /* Save the current context at CURRENT_REGS into the TCB at the head + * of the assigned task list for this CPU. */ up_savestate(tcb->xcp.regs); - /* Wait for the spinlock to be released */ + /* Release the g_cpu_puased spinlock to synchronize with the + * requesting CPU. + */ spin_unlock(&g_cpu_paused[cpu]); + + /* Wait for the spinlock to be released. The requesting CPU will release + * the spinlcok when the CPU is resumed. + */ + spin_lock(&g_cpu_wait[cpu]); - /* Restore the exception context of the tcb at the (new) head of the - * assigned task list. + /* This CPU has been resumed. Restore the exception context of the TCB at + * the (new) head of the assigned task list. */ tcb = this_task(); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that we have resumed */ + + sched_note_cpu_resumed(tcb); +#endif + /* Reset scheduler parameters */ sched_resume_scheduler(tcb); - /* Then switch contexts. Any necessary address environment changes will - * be made when the interrupt returns. + /* Then switch contexts. Any necessary address environment changes + * will be made when the interrupt returns. */ up_restorestate(tcb->xcp.regs); spin_unlock(&g_cpu_wait[cpu]); + + return OK; +} + +/**************************************************************************** + * Name: arm_pause_handler + * + * Description: + * This is the handler for SGI2. It performs the following operations: + * + * 1. It saves the current task state at the head of the current assigned + * task list. + * 2. It waits on a spinlock, then + * 3. Returns from interrupt, restoring the state of the new task at the + * head of the ready to run list. + * + * Input Parameters: + * Standard interrupt handling + * + * Returned Value: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +int arm_pause_handler(int irq, FAR void *context) +{ + int cpu = this_cpu(); + + /* Check for false alarms. Such false could occur as a consequence of + * some deadlock breaking logic that might have already serviced the SG2 + * interrupt by calling up_cpu_paused(). If the pause event has already + * been processed then g_cpu_paused[cpu] will not be locked. + */ + + if (spin_islocked(&g_cpu_paused[cpu])) + { + return up_cpu_paused(cpu); + } + return OK; } @@ -134,7 +233,7 @@ int arm_pause_handler(int irq, FAR void *context) * CPU. * * Input Parameters: - * cpu - The index of the CPU to be stopped/ + * cpu - The index of the CPU to be stopped * * Returned Value: * Zero on success; a negated errno value on failure. @@ -145,6 +244,12 @@ int up_cpu_pause(int cpu) { int ret; +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the pause event */ + + sched_note_cpu_pause(this_task(), cpu); +#endif + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); /* Take the both spinlocks. The g_cpu_wait spinlock will prevent the SGI2 @@ -208,6 +313,12 @@ int up_cpu_pause(int cpu) int up_cpu_resume(int cpu) { +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the resume event */ + + sched_note_cpu_resume(this_task(), cpu); +#endif + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); /* Release the spinlock. Releasing the spinlock will cause the SGI2 diff --git a/arch/arm/src/armv7-a/arm_cpustart.c b/arch/arm/src/armv7-a/arm_cpustart.c index 88906a717ded5441a01f73310458fff480089ffc..d63c035db68f1d5c7af0e0d0ad07d7dc1a59c55e 100644 --- a/arch/arm/src/armv7-a/arm_cpustart.c +++ b/arch/arm/src/armv7-a/arm_cpustart.c @@ -43,10 +43,11 @@ #include #include +#include #include "up_internal.h" -#include "gic.h" #include "cp15_cacheops.h" +#include "gic.h" #include "sched/sched.h" #ifdef CONFIG_SMP @@ -104,13 +105,18 @@ static inline void arm_registerdump(FAR struct tcb_s *tcb) int arm_start_handler(int irq, FAR void *context) { - FAR struct tcb_s *tcb; + FAR struct tcb_s *tcb = this_task(); + + sinfo("CPU%d Started\n", this_cpu()); + +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that this CPU has started */ - sinfo("CPU%d Started\n", up_cpu_index()); + sched_note_cpu_started(tcb); +#endif /* Reset scheduler parameters */ - tcb = this_task(); sched_resume_scheduler(tcb); /* Dump registers so that we can see what is going to happen on return */ @@ -159,6 +165,12 @@ int up_cpu_start(int cpu) DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the start event */ + + sched_note_cpu_start(this_task(), cpu); +#endif + /* Make the content of CPU0 L1 cache has been written to coherent L2 */ cp15_clean_dcache(CONFIG_RAM_START, CONFIG_RAM_END - 1); diff --git a/arch/arm/src/armv7-a/arm_doirq.c b/arch/arm/src/armv7-a/arm_doirq.c index b3d98151c0bcb262f2b0e10901a684e78fb80544..fa3e104582383162b874619a58dfd86b165aed78 100644 --- a/arch/arm/src/armv7-a/arm_doirq.c +++ b/arch/arm/src/armv7-a/arm_doirq.c @@ -40,10 +40,10 @@ #include #include -#include -#include #include +#include +#include #include #include @@ -51,21 +51,40 @@ #include "up_internal.h" #include "group/group.h" +#include "gic.h" /**************************************************************************** - * Public Functions + * Private Data ****************************************************************************/ -uint32_t *arm_doirq(int irq, uint32_t *regs) -{ - board_autoled_on(LED_INIRQ); -#ifdef CONFIG_SUPPRESS_INTERRUPTS - PANIC(); +/* A bit set of pending, non-maskable SGI interrupts, on bit set for each + * supported CPU. + */ + +#ifdef CONFIG_ARMV7A_HAVE_GICv2 +#ifdef CONFIG_SMP +static uint16_t g_sgi_pending[CONFIG_SMP_NCPUS]; #else - /* Nested interrupts are not supported */ +static uint16_t g_sgi_pending[1]; +#endif +#endif - DEBUGASSERT(CURRENT_REGS == NULL); +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: _arm_doirq + * + * Description: + * Receives the one decoded interrupt and dispatches control to the + * attached interrupt handler. + * + ****************************************************************************/ +#ifndef CONFIG_SUPPRESS_INTERRUPTS +static inline uint32_t *_arm_doirq(int irq, uint32_t *regs) +{ /* Current regs non-zero indicates that we are processing an interrupt; * CURRENT_REGS is also used to manage interrupt level context switches. */ @@ -110,8 +129,131 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) regs = (uint32_t *)CURRENT_REGS; CURRENT_REGS = NULL; + + return regs; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: arm_doirq + * + * Description: + * Receives the decoded GIC interrupt information and dispatches control + * to the attached interrupt handler. There are two versions: + * + * 1) For the simple case where all interrupts are maskable. In that + * simple case, arm_doirq() is simply a wrapper for the inlined + * _arm_do_irq() that does the real work. + * + * 2) With the GICv2, there are 16 non-maskable software generated + * interrupts (SGIs) that also come through arm_doirq(). In that case, + * we must avoid nesting interrupt handling and serial the processing. + * + ****************************************************************************/ + +#ifndef CONFIG_ARMV7A_HAVE_GICv2 +uint32_t *arm_doirq(int irq, uint32_t *regs) +{ + board_autoled_on(LED_INIRQ); +#ifdef CONFIG_SUPPRESS_INTERRUPTS + PANIC(); +#else + /* Nested interrupts are not supported */ + + DEBUGASSERT(CURRENT_REGS == NULL); + + /* Dispatch the interrupt to its attached handler */ + + regs = _arm_doirq(irq, regs); +#endif + + board_autoled_off(LED_INIRQ); + return regs; +} +#endif + +#ifdef CONFIG_ARMV7A_HAVE_GICv2 +uint32_t *arm_doirq(int irq, uint32_t *regs) +{ +#ifndef CONFIG_SUPPRESS_INTERRUPTS + uint32_t bit; + int cpu; + int i; +#endif + + board_autoled_on(LED_INIRQ); +#ifdef CONFIG_SUPPRESS_INTERRUPTS + PANIC(); + +#else + /* Get the CPU processing the interrupt */ + +#ifdef CONFIG_SMP + cpu = up_cpu_index(); +#else + cpu = 0; +#endif + + /* Non-zero CURRENT_REGS indicates that we are already processing an + * interrupt. This could be a normal event for the case of the GICv2; + * Software generated interrupts are non-maskable. + * + * REVISIT: There is no support for nested SGIs! That will cause an + * assertion below. There is also no protection for concurrent access + * to g_sgi_pending for that case. + */ + + if (CURRENT_REGS != NULL) + { + int ndx = irq - GIC_IRQ_SGI0; + bit = (1 << (ndx)); + + /* Only an SGI should cause this event. We also cannot support + * multiple pending SGI interrupts. + */ + + ASSERT((unsigned int)irq <= GIC_IRQ_SGI15 && + (g_sgi_pending[cpu] & bit) == 0); + + /* Mare the SGI as pending and return immediately */ + + sinfo("SGI%d pending\n", ndx); + g_sgi_pending[cpu] |= bit; + return regs; + } + + /* Dispatch the interrupt to its attached handler */ + + regs = _arm_doirq(irq, regs); + + /* Then loop dispatching any pending SGI interrupts that occcurred during + * processing of the interrupts. + */ + + for (i = 0; i < 16 && g_sgi_pending[cpu] != 0; i++) + { + /* Check if this SGI is pending */ + + bit = (1 << i); + if ((g_sgi_pending[cpu] & bit) != 0) + { + /* Clear the pending bit */ + + g_sgi_pending[cpu] &= ~bit; + + /* And dispatch the SGI */ + + sinfo("Dispatching pending SGI%d\n", i + GIC_IRQ_SGI0); + regs = _arm_doirq(i + GIC_IRQ_SGI0, regs); + } + } #endif board_autoled_off(LED_INIRQ); return regs; } +#endif diff --git a/arch/arm/src/armv7-a/arm_gicv2.c b/arch/arm/src/armv7-a/arm_gicv2.c index e99eb540fdef6e55cd24f9c9cd30aeae5f380630..dce0b621ed98f1096d1e55d3df108739daf3aa19 100644 --- a/arch/arm/src/armv7-a/arm_gicv2.c +++ b/arch/arm/src/armv7-a/arm_gicv2.c @@ -122,7 +122,7 @@ void arm_gic0_initialize(void) } #ifdef CONFIG_SMP - /* Attach SGI interrupt handlers */ + /* Attach SGI interrupt handlers. This attaches the handler for all CPUs. */ DEBUGVERIFY(irq_attach(GIC_IRQ_SGI1, arm_start_handler)); DEBUGVERIFY(irq_attach(GIC_IRQ_SGI2, arm_pause_handler)); @@ -574,5 +574,4 @@ int arm_gic_irq_trigger(int irq, bool edge) return -EINVAL; } - #endif /* CONFIG_ARMV7A_HAVE_GICv2 */ diff --git a/arch/arm/src/armv7-a/arm_head.S b/arch/arm/src/armv7-a/arm_head.S index c98ab30719d5774314346cea3c4ab0ece6007022..27c2a5b4dcfb628db63ee069385070ef01a39735 100644 --- a/arch/arm/src/armv7-a/arm_head.S +++ b/arch/arm/src/armv7-a/arm_head.S @@ -450,7 +450,11 @@ __start: orr r0, r0, #(SCTLR_RR) #endif -#ifndef CPU_DCACHE_DISABLE + /* In SMP configurations, the data cache will not be enabled until later + * after SMP cache coherency has been setup. + */ + +#if !defined(CPU_DCACHE_DISABLE) && !defined(CONFIG_SMP) /* Dcache enable * * SCTLR_C Bit 2: DCache enable @@ -638,7 +642,7 @@ __start: #endif /* Perform early C-level, platform-specific initialization. Logic - * within arm_boot() must configure SDRAM and call arm_ram_initailize. + * within arm_boot() must configure SDRAM and call arm_data_initialize(). */ bl arm_boot diff --git a/arch/arm/src/armv7-a/arm_pghead.S b/arch/arm/src/armv7-a/arm_pghead.S index 1a546c813d4007ea2105fb0ae544df94dc469956..1dda0acdd929ba56db8fa450e68d781300c084df 100644 --- a/arch/arm/src/armv7-a/arm_pghead.S +++ b/arch/arm/src/armv7-a/arm_pghead.S @@ -434,7 +434,11 @@ __start: orr r0, r0, #(SCTLR_RR) #endif -#ifndef CPU_DCACHE_DISABLE + /* In SMP configurations, the data cache will not be enabled until later + * after SMP cache coherency has been setup. + */ + +#if !defined(CPU_DCACHE_DISABLE) && !defined(CONFIG_SMP) /* Dcache enable * * SCTLR_C Bit 2: DCache enable @@ -670,7 +674,7 @@ __start: #endif /* Perform early C-level, platform-specific initialization. Logic - * within arm_boot() must configure SDRAM and call arm_ram_initailize. + * within arm_boot() must configure SDRAM and call arm_data_initialize(). */ bl arm_boot diff --git a/arch/arm/src/armv7-a/arm_schedulesigaction.c b/arch/arm/src/armv7-a/arm_schedulesigaction.c index 89df348ba039c8942f4c76ac3692b48be245482f..9f1a46f67542b2a245d73006af5bec0462302d7a 100644 --- a/arch/arm/src/armv7-a/arm_schedulesigaction.c +++ b/arch/arm/src/armv7-a/arm_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_schedulesigaction.c * - * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,8 @@ #include "up_internal.h" #include "up_arch.h" +#include "irq/irq.h" + #ifndef CONFIG_DISABLE_SIGNALS /**************************************************************************** @@ -90,6 +92,7 @@ * ****************************************************************************/ +#ifndef CONFIG_SMP void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; @@ -105,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) if (!tcb->xcp.sigdeliver) { /* First, handle some special cases when the signal is being delivered - * to the currently executing task. + * to task that is currently executing on this CPU. */ sinfo("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); @@ -142,16 +145,16 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * the signals have been delivered. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; - tcb->xcp.saved_cpsr = CURRENT_REGS[REG_CPSR]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_cpsr = CURRENT_REGS[REG_CPSR]; /* Then set up to vector to the trampoline with interrupts * disabled */ - CURRENT_REGS[REG_PC] = (uint32_t)up_sigdeliver; - CURRENT_REGS[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); + CURRENT_REGS[REG_PC] = (uint32_t)up_sigdeliver; + CURRENT_REGS[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); /* And make sure that the saved context in the TCB is the same * as the interrupt return context. @@ -163,7 +166,168 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) /* Otherwise, we are (1) signaling a task is not running from an * interrupt handler or (2) we are not in an interrupt handler and the - * running task is signalling some non-running task. + * running task is signalling some other non-running task. + */ + + else + { + /* Save the return lr and cpsr and one scratch register. These + * will be restored by the signal trampoline after the signals + * have been delivered. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; + tcb->xcp.saved_cpsr = tcb->xcp.regs[REG_CPSR]; + + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; + tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); + } + } + + leave_critical_section(flags); +} +#endif /* !CONFIG_SMP */ + +#ifdef CONFIG_SMP +void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) +{ + irqstate_t flags; + int cpu; + int me; + + sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + + /* Make sure that interrupts are disabled */ + + flags = enter_critical_section(); + + /* Refuse to handle nested signal actions */ + + if (!tcb->xcp.sigdeliver) + { + /* First, handle some special cases when the signal is being delivered + * to task that is currently executing on any CPU. + */ + + sinfo("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + + if (tcb->task_state == TSTATE_TASK_RUNNING) + { + me = this_cpu(); + cpu = tcb->cpu; + + /* CASE 1: We are not in an interrupt handler and a task is + * signalling itself for some reason. + */ + + if (cpu == me && !CURRENT_REGS) + { + /* In this case just deliver the signal now. */ + + sigdeliver(tcb); + } + + /* CASE 2: The task that needs to receive the signal is running. + * This could happen if the task is running on another CPU OR if + * we are in an interrupt handler and the task is running on this + * CPU. In the former case, we will have to PAUSE the other CPU + * first. But in either case, we will have to modify the return + * state as well as the state in the TCB. + * + * Hmmm... there looks like a latent bug here: The following logic + * would fail in the strange case where we are in an interrupt + * handler, the thread is signalling itself, but a context switch + * to another task has occurred so that CURRENT_REGS does not + * refer to the thread of this_task()! + */ + + else + { + /* If we signalling a task running on the other CPU, we have + * to PAUSE the other CPU. + */ + + if (cpu != me) + { + up_cpu_pause(cpu); + } + + /* Save the return lr and cpsr and one scratch register + * These will be restored by the signal trampoline after + * the signals have been delivered. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_cpsr = CURRENT_REGS[REG_CPSR]; + + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. + */ + + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; + + /* Handle a possible race condition where the TCB was suspended + * just before we paused the other CPU. The critical section + * established above will prevent new threads from running on + * that CPU, but it will not guarantee that the running thread + * did not suspend itself (allowing any threads "assigned" to + * the CPU to run). + */ + + if (tcb->task_state != TSTATE_TASK_RUNNING) + { + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; + tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); + } + else + { + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + CURRENT_REGS[REG_PC] = (uint32_t)up_sigdeliver; + CURRENT_REGS[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); + + /* In an SMP configuration, the interrupt disable logic also + * involves spinlocks that are configured per the TCB irqcount + * field. This is logically equivalent to enter_critical_section(). + * The matching call to leave_critical_section() will be + * performed in up_sigdeliver(). + */ + + spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); + + /* And make sure that the saved context in the TCB is the same + * as the interrupt return context. + */ + + up_savestate(tcb->xcp.regs); + } + + /* RESUME the other CPU if it was PAUSED */ + + if (cpu != me) + { + up_cpu_resume(cpu); + } + } + } + + /* Otherwise, we are (1) signaling a task is not running from an + * interrupt handler or (2) we are not in an interrupt handler and the + * running task is signalling some other non-running task. */ else @@ -173,20 +337,28 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) * have been delivered. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; - tcb->xcp.saved_cpsr = tcb->xcp.regs[REG_CPSR]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; + tcb->xcp.saved_cpsr = tcb->xcp.regs[REG_CPSR]; + + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. + */ + + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; /* Then set up to vector to the trampoline with interrupts * disabled */ - tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; - tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; + tcb->xcp.regs[REG_CPSR] = (PSR_MODE_SVC | PSR_I_BIT | PSR_F_BIT); } } leave_critical_section(flags); } +#endif /* CONFIG_SMP */ #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv7-a/arm_scu.c b/arch/arm/src/armv7-a/arm_scu.c new file mode 100644 index 0000000000000000000000000000000000000000..eedf179e73161438d738872ce2af869d634cd3b5 --- /dev/null +++ b/arch/arm/src/armv7-a/arm_scu.c @@ -0,0 +1,227 @@ +/**************************************************************************** + * arch/arm/src/armv7-a/arm_scu.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include + +#include "up_arch.h" +#include "cp15_cacheops.h" +#include "sctlr.h" +#include "cache.h" +#include "scu.h" + +#ifdef CONFIG_SMP + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: arm_get_sctlr + * + * Description: + * Get the contents of the SCTLR register + * + ****************************************************************************/ + +static inline uint32_t arm_get_sctlr(void) +{ + uint32_t sctlr; + + __asm__ __volatile__ + ( + "\tmrc p15, 0, %0, c1, c0, 0\n" /* Read SCTLR */ + : "=r"(sctlr) + : + : + ); + + return sctlr; +} + +/**************************************************************************** + * Name: arm_set_sctlr + * + * Description: + * Set the contents of the SCTLR register + * + ****************************************************************************/ + +static inline void arm_set_sctlr(uint32_t sctlr) +{ + __asm__ __volatile__ + ( + "\tmcr p15, 0, %0, c1, c0, 0\n" /* Write SCTLR */ + : + : "r"(sctlr) + : + ); +} + +/**************************************************************************** + * Name: arm_get_actlr + * + * Description: + * Get the contents of the ACTLR register + * + ****************************************************************************/ + +static inline uint32_t arm_get_actlr(void) +{ + uint32_t actlr; + + __asm__ __volatile__ + ( + "\tmrc p15, 0, %0, c1, c0, 1\n" /* Read ACTLR */ + : "=r"(actlr) + : + : + ); + + return actlr; +} + +/**************************************************************************** + * Name: arm_set_actlr + * + * Description: + * Set the contents of the ACTLR register + * + ****************************************************************************/ + +static inline void arm_set_actlr(uint32_t actlr) +{ + __asm__ __volatile__ + ( + "\tmcr p15, 0, %0, c1, c0, 1\n" /* Write ACTLR */ + : + : "r"(actlr) + : + ); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: arm_enable_smp + * + * Description: + * Enable the SCU and make certain that current CPU is participating in + * the SMP cache coherency. + * + * Assumption: + * Called early in the CPU start-up. No special critical sections are + * needed if only CPU-private registers are modified. + * + ****************************************************************************/ + +void arm_enable_smp(int cpu) +{ + uint32_t regval; + + /* Handle actions unique to CPU0 which comes up first */ + + if (cpu == 0) + { + /* Invalidate the SCU duplicate tags for all processors */ + + putreg32((SCU_INVALIDATE_ALL_WAYS << SCU_INVALIDATE_CPU0_SHIFT) | + (SCU_INVALIDATE_ALL_WAYS << SCU_INVALIDATE_CPU1_SHIFT) | + (SCU_INVALIDATE_ALL_WAYS << SCU_INVALIDATE_CPU2_SHIFT) | + (SCU_INVALIDATE_ALL_WAYS << SCU_INVALIDATE_CPU3_SHIFT), + SCU_INVALIDATE); + + /* Invalidate CPUn L1 data cache so that is will we be reloaded from + * coherent L2. + */ + + cp15_invalidate_dcache_all(); + ARM_DSB(); + + /* Invalidate the L2C-310 -- Missing logic. */ + + /* Enable the SCU */ + + regval = getreg32(SCU_CTRL); + regval |= SCU_CTRL_ENABLE; + putreg32(regval, SCU_CTRL); + } + + /* Actions for other CPUs */ + + else + { + /* Invalidate CPUn L1 data cache so that is will we be reloaded from + * coherent L2. + */ + + cp15_invalidate_dcache_all(); + ARM_DSB(); + + /* Wait for the SCU to be enabled by the primary processor -- should + * not be necessary. + */ + } + + /* Enable the data cache, set the SMP mode with ACTLR.SMP=1. + * + * SMP - Sgnals if the Cortex-A9 processor is taking part in coherency + * or not. + * + * Cortex-A9 also needs ACTLR.FW=1 + * + * FW - Cache and TLB maintenance broadcast. + */ + + regval = arm_get_actlr(); + regval |= ACTLR_SMP; +#ifdef CONFIG_ARCH_CORTEXA9 + regval |= ACTLR_FW; +#endif + arm_set_actlr(regval); + + regval = arm_get_sctlr(); + regval |= SCTLR_C; + arm_set_sctlr(regval); +} + +#endif diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index be720a464c3550d648b6c4ec52f9de108bc54ba8..5d89583282032ac543a151682ff517f94b31b212 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-a/arm_sigdeliver.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,18 +103,27 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - up_irq_restore(regs[REG_CPSR]); + leave_critical_section(regs[REG_CPSR]); - /* Deliver the signals */ + /* Deliver the signal */ sigdeliver(rtcb); /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original * errno that is needed by the user logic (it is probably EINTR). + * + * REVISIT: In SMP mode up_irq_save() probably only disables interrupts + * on the local CPU. We do not want to call enter_critical_section() + * here, however, because we don't want this state to stick after the + * call to up_fullcontextrestore(). + * + * I would prefer that all interrupts are disabled when + * up_fullcontextrestore() is called, but that may not be necessary. */ sinfo("Resuming\n"); + (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv7-a/arm_testset.S b/arch/arm/src/armv7-a/arm_testset.S index e89cbb3adc554a1cab2e3208a1bf4954379abbcb..638736e4d6729815674902098a7e3c867ee42760 100644 --- a/arch/arm/src/armv7-a/arm_testset.S +++ b/arch/arm/src/armv7-a/arm_testset.S @@ -75,7 +75,7 @@ * This function must be provided via the architecture-specific logoic. * * Input Parameters: - * lock - The address of spinlock object. + * lock - The address of spinlock object (r0). * * Returned Value: * The spinlock is always locked upon return. The value of previous value @@ -84,6 +84,8 @@ * obtain the lock) or SP_UNLOCKED if the spinlock was previously unlocked * (meaning that we successfully obtained the lock) * + * Modifies: r1, r2, and lr + * ****************************************************************************/ .globl up_testset @@ -98,7 +100,7 @@ up_testset: 1: ldrexb r2, [r0] /* Test if spinlock is locked or not */ cmp r2, r1 /* Already locked? */ - beq 2f /* If alrady locked, return SP_LOCKED */ + beq 2f /* If already locked, return SP_LOCKED */ /* Not locked ... attempt to lock it */ diff --git a/arch/arm/src/armv7-a/arm_vectors.S b/arch/arm/src/armv7-a/arm_vectors.S index 33d1f8fc550dc6e49d4e7623e2a66892de87837d..8a76e000b563ec9c1c9e6a19322ce8e0af7ec0ff 100644 --- a/arch/arm/src/armv7-a/arm_vectors.S +++ b/arch/arm/src/armv7-a/arm_vectors.S @@ -64,6 +64,10 @@ g_fiqtmp: .word 0 /* Saved lr */ .word 0 /* Saved spsr */ #endif +#if CONFIG_ARCH_INTERRUPTSTACK > 3 && defined(CONFIG_ARMV7A_HAVE_GICv2) +g_nestlevel: + .word 0 /* Interrupt nesting level */ +#endif /************************************************************************************ * Private Functions @@ -172,13 +176,53 @@ arm_vectorirq: mov r0, sp /* Get r0=xcp */ #if CONFIG_ARCH_INTERRUPTSTACK > 3 +#ifdef CONFIG_ARMV7A_HAVE_GICv2 + /* We will switch to the interrupt stack, UNLESS we are processing a + * nested interrupt in which case we are already using the interrupt + * stack. SGI interrupts may be nested because they are non-maskable. + */ + + ldr r5, .Lirqnestlevel /* r1=Points to interrupt nesting level */ + ldr r1, [r5] /* Get r1= nesting level */ + add r1, r1, #1 /* Increment nesting level */ + str r1, [r5] /* Save r1= nesting level */ + + cmp r1, #1 /* r1>1 if nested */ + bgt .Lintnested /* Use current SP if nested */ +#endif + + /* Call arm_decodeirq() on the interrupt stack */ + ldr sp, .Lirqstackbase /* SP = interrupt stack base */ str r0, [sp] /* Save the user stack pointer */ mov r4, sp /* Save the SP in a preserved register */ bic sp, sp, #7 /* Force 8-byte alignment */ bl arm_decodeirq /* Call the handler */ ldr sp, [r4] /* Restore the user stack pointer */ + +#ifdef CONFIG_ARMV7A_HAVE_GICv2 + b .Lintreturn + + /* Call arm_decodeirq() on whatever stack is in place */ + +.Lintnested: + mov r4, sp /* Save the SP in a preserved register */ + bic sp, sp, #7 /* Force 8-byte alignment */ + bl arm_decodeirq /* Call the handler */ + mov sp, r4 /* Restore the possibly unaligned stack pointer */ + + /* Decrement the nesting level (r5 should be preserved) */ + +.Lintreturn: + ldr r1, [r5] /* Get r1= nesting level */ + cmp r1, #0 /* A sanity check*/ + subgt r1, r1, #1 /* Decrement nesting level */ + strgt r1, [r5] /* Save r1= nesting level */ +#endif + #else + /* Call arm_decodeirq() on the user stack */ + mov r4, sp /* Save the SP in a preserved register */ bic sp, sp, #7 /* Force 8-byte alignment */ bl arm_decodeirq /* Call the handler */ @@ -227,6 +271,10 @@ arm_vectorirq: #if CONFIG_ARCH_INTERRUPTSTACK > 3 .Lirqstackbase: .word g_intstackbase +#ifdef CONFIG_ARMV7A_HAVE_GICv2 +.Lirqnestlevel: + .word g_nestlevel +#endif #endif .size arm_vectorirq, . - arm_vectorirq .align 5 @@ -937,7 +985,7 @@ arm_vectorfiq: .word g_fiqtmp #if CONFIG_ARCH_INTERRUPTSTACK > 3 .Lfiqstackbase: - .word g_intstackbase + .word g_fiqstackbase #endif #else @@ -965,5 +1013,21 @@ g_intstackbase: .size g_intstackbase, 4 .size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3) + .globl g_fiqstackalloc + .type g_fiqstackalloc, object + .globl g_fiqstackbase + .type g_fiqstackbase, object + +/************************************************************************************ + * Name: g_fiqstackalloc/g_fiqstackbase + ************************************************************************************/ + +g_fiqstackalloc: + .skip ((CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4) +g_fiqstackbase: + .skip 4 + .size g_fiqstackbase, 4 + .size g_fiqstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3) + #endif /* CONFIG_ARCH_INTERRUPTSTACK > 3 */ .end diff --git a/arch/arm/src/armv7-a/cache.h b/arch/arm/src/armv7-a/cache.h index dda36271e2d865a5e2533e9201feea5952fc9845..c9af0611f7b31d4a16fac7ca43b299f68f08c283 100644 --- a/arch/arm/src/armv7-a/cache.h +++ b/arch/arm/src/armv7-a/cache.h @@ -50,6 +50,16 @@ * Pre-processor Definitions ************************************************************************************/ +/* Intrinsics are used in these inline functions */ + +#define arm_isb(n) __asm__ __volatile__ ("isb " #n : : : "memory") +#define arm_dsb(n) __asm__ __volatile__ ("dsb " #n : : : "memory") +#define arm_dmb(n) __asm__ __volatile__ ("dmb " #n : : : "memory") + +#define ARM_DSB() arm_dsb(15) +#define ARM_ISB() arm_isb(15) +#define ARM_DMB() arm_dmb(15) + /************************************************************************************ * Inline Functions ************************************************************************************/ diff --git a/arch/arm/src/armv7-a/mmu.h b/arch/arm/src/armv7-a/mmu.h index 9ce8280b73232ba793c8a0d11ed0e958f41aeb77..c6338d33378b30395f574085ac6aac80ed98a4f6 100644 --- a/arch/arm/src/armv7-a/mmu.h +++ b/arch/arm/src/armv7-a/mmu.h @@ -513,7 +513,6 @@ * NMRR registers. For the simple case where TEX[2:0] = 0b000, the control * is as follows: * - * * MEMORY INNER OUTER OUTER SHAREABLE * C B TYPE CACHEABILITY CACHEABILITY ATTRIBUTE * - - ---------- ------------- ------------ ----------------- @@ -602,7 +601,6 @@ #define MMU_L2_PGTABFLAGS (PTE_TYPE_SMALL | PTE_WRITE_THROUGH | PTE_AP_RW1) #define MMU_L1_VECTORFLAGS (PMD_TYPE_PTE | PMD_PTE_PXN | PMD_PTE_DOM(0)) - #define MMU_L2_VECTRWFLAGS (PTE_TYPE_SMALL | PTE_WRITE_THROUGH | PTE_AP_RW1) #define MMU_L2_VECTROFLAGS (PTE_TYPE_SMALL | PTE_WRITE_THROUGH | PTE_AP_R1) #define MMU_L2_VECTORFLAGS MMU_L2_VECTRWFLAGS @@ -1424,6 +1422,28 @@ void mmu_l1_restore(uintptr_t vaddr, uint32_t l1entry); # define mmu_l1_clrentry(v) mmu_l1_restore(v,0) #endif +/**************************************************************************** + * Name: mmu_l2_setentry + * + * Description: + * Set one small (4096B) entry in a level2 translation table. + * + * Input Parameters: + * l2vaddr - the virtual address of the beginning of the L2 translation + * table. + * paddr - The physical address to be mapped. Must be aligned to a 4KB + * address boundary + * vaddr - The virtual address to be mapped. Must be aligned to a 4KB + * address boundary + * mmuflags - The MMU flags to use in the mapping. + * + ****************************************************************************/ + +#ifndef CONFIG_ARCH_ROMPGTABLE +void mmu_l2_setentry(uint32_t l2vaddr, uint32_t paddr, uint32_t vaddr, + uint32_t mmuflags); +#endif + /************************************************************************************ * Name: mmu_l1_map_region * diff --git a/arch/arm/src/armv7-a/scu.h b/arch/arm/src/armv7-a/scu.h new file mode 100644 index 0000000000000000000000000000000000000000..a84fb0cc4f84bdaa007b4ee61edd1bd295cf947f --- /dev/null +++ b/arch/arm/src/armv7-a/scu.h @@ -0,0 +1,176 @@ +/**************************************************************************** + * arch/arm/src/armv7-a/scu.h + * Generic Interrupt Controller Definitions + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Reference: + * Cortex™-A9 MPCore, Revision: r4p1, Technical Reference Manual, ARM DDI + * 0407I (ID091612). + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __ARCH_ARM_SRC_ARMV7_A_SCU_H +#define __ARCH_ARM_SRC_ARMV7_A_SCU_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "mpcore.h" /* For MPCORE_SCU_VBASE */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Register offsets *********************************************************/ + +#define SCU_CTRL_OFFSET 0x0000 /* SCU Control Register (Implementation defined) */ +#define SCU_CONFIG_OFFSET 0x0004 /* SCU Configuration Register (Implementation defined) */ +#define SCU_PWRSTATUS_OFFSET 0x0008 /* SCU CPU Power Status Register */ +#define SCU_INVALIDATE_OFFSET 0x000c /* SCU Invalidate All Registers in Secure State */ +#define SCU_FILTERSTART_OFFSET 0x0040 /* Filtering Start Address Register Defined by FILTERSTART input */ +#define SCU_FILTEREND_OFFSET 0x0044 /* Filtering End Address Register Defined by FILTEREND input */ +#define SCU_SAC_OFFSET 0x0050 /* SCU Access Control (SAC) Register */ +#define SCU_SNSAC_OFFSET 0x0054 /* SCU Non-secure Access Control (SNSAC) Register */ + +/* Register addresses *******************************************************/ + +#define SCU_CTRL (MPCORE_SCU_VBASE+SCU_CTRL_OFFSET) +#define SCU_CONFIG (MPCORE_SCU_VBASE+SCU_CONFIG_OFFSET) +#define SCU_PWRSTATUS (MPCORE_SCU_VBASE+SCU_PWRSTATUS_OFFSET) +#define SCU_INVALIDATE (MPCORE_SCU_VBASE+SCU_INVALIDATE_OFFSET) +#define SCU_FILTERSTART (MPCORE_SCU_VBASE+SCU_FILTERSTART_OFFSET) +#define SCU_FILTEREND (MPCORE_SCU_VBASE+SCU_FILTEREND_OFFSET) +#define SCU_SAC (MPCORE_SCU_VBASE+SCU_SAC_OFFSET) +#define SCU_SNSAC (MPCORE_SCU_VBASE+SCU_SNSAC_OFFSET) + +/* Register bit-field definitions *******************************************/ + +/* SCU Control Register (Implementation defined) */ + +#define SCU_CTRL_ENABLE (1 << 0) /* SCU enable */ +#define SCU_CTRL_ADDRFILTER (1 << 1) /* Address filtering enable */ +#define SCU_CTRL_RAMPARITY (1 << 2) /* SCU RAMs parity enable */ +#define SCU_CTRL_LINFILL (1 << 3) /* SCU speculative linefill enable */ +#define SCU_CTRL_PORT0 (1 << 4) /* Force all device to port0 enable */ +#define SCU_CTRL_STANDBY (1 << 5) /* SCU standby enable */ +#define SCU_CTRL_ICSTANDBY (1 << 6) /* IC standby enable */ + +/* SCU Configuration Register (Implementation defined) */ + +#define SCU_CONFIG_NCPUS_SHIFT 0 /* CPU number Number of CPUs present */ +#define SCU_CONFIG_NCPUS_MASK (3 << SCU_CONFIG_NCPUS_SHIFT) +# define SCU_CONFIG_NCPUS(r) ((((uint32_t)(r) & SCU_CONFIG_NCPUS_MASK) >> SCU_CONFIG_NCPUS_SHIFT) + 1) +#define SCU_CONFIG_SMPCPUS_SHIFT 4 /* Processors that are in SMP or AMP mode */ +#define SCU_CONFIG_SMPCPUS_MASK (15 << SCU_CONFIG_SMPCPUS_SHIFT) +# define SCU_CONFIG_CPU_SMP(n) (1 << ((n)+4)) +# define SCU_CONFIG_CPU0_SMP (1 << 4) +# define SCU_CONFIG_CPU1_SMP (1 << 5) +# define SCU_CONFIG_CPU2_SMP (1 << 6) +# define SCU_CONFIG_CPU3_SMP (1 << 7) + +#define SCU_CONFIG_TAGRAM_16KB 0 +#define SCU_CONFIG_TAGRAM_32KB 1 +#define SCU_CONFIG_TAGRAM_64KB 2 + +#define SCU_CONFIG_CPU0_TAGRAM_SHIFT 8 /* CPU 0 tag RAM size */ +#define SCU_CONFIG_CPU0_TAGRAM_MASK (3 << SCU_CONFIG_CPU0_TAGRAM_SHIFT) +#define SCU_CONFIG_CPU1_TAGRAM_SHIFT 10 /* CPU 1 tag RAM size */ +#define SCU_CONFIG_CPU1_TAGRAM_MASK (3 << SCU_CONFIG_CPU0_TAGRAM_SHIFT) +#define SCU_CONFIG_CPU2_TAGRAM_SHIFT 12 /* CPU 1 tag RAM size */ +#define SCU_CONFIG_CPU2_TAGRAM_MASK (3 << SCU_CONFIG_CPU0_TAGRAM_SHIFT) +#define SCU_CONFIG_CPU3_TAGRAM_SHIFT 14 /* CPU 1 tag RAM size */ +#define SCU_CONFIG_CPU3_TAGRAM_MASK (3 << SCU_CONFIG_CPU0_TAGRAM_SHIFT) + +/* SCU CPU Power Status Register */ + +#define SCU_PWRSTATUS_NORMAL 0 +#define SCU_PWRSTATUS_DORMANT 2 +#define SCU_PWRSTATUS_PWROFF 3 + +#define SCU_PWRSTATUS_CPU0_SHIFT 0 /* CPU0 status Power status */ +#define SCU_PWRSTATUS_CPU0_MASK (3 << SCU_PWRSTATUS_CPU0_SHIFT) +#define SCU_PWRSTATUS_CPU1_SHIFT 8 /* CPU1 status Power status */ +#define SCU_PWRSTATUS_CPU1_MASK (3 << SCU_PWRSTATUS_CPU1_SHIFT) +#define SCU_PWRSTATUS_CPU2_SHIFT 16 /* CPU2 status Power status */ +#define SCU_PWRSTATUS_CPU2_MASK (3 << SCU_PWRSTATUS_CPU2_SHIFT) +#define SCU_PWRSTATUS_CPU3_SHIFT 24 /* CPU3 status Power status */ +#define SCU_PWRSTATUS_CPU3_MASK (3 << SCU_PWRSTATUS_CPU3_SHIFT) + +/* SCU Invalidate All Registers in Secure State */ + +#define SCU_INVALIDATE_ALL_WAYS 15 +#define SCU_INVALIDATE_CPU0_SHIFT 0 /* Ways that must be invalidated for CPU0 */ +#define SCU_INVALIDATE_CPU0_MASK (15 << SCU_INVALIDATE_CPU0_SHIFT) +#define SCU_INVALIDATE_CPU1_SHIFT 4 /* Ways that must be invalidated for CPU1 */ +#define SCU_INVALIDATE_CPU1_MASK (15 << SCU_INVALIDATE_CPU1_SHIFT) +#define SCU_INVALIDATE_CPU2_SHIFT 8 /* Ways that must be invalidated for CPU2 */ +#define SCU_INVALIDATE_CPU2_MASK (15 << SCU_INVALIDATE_CPU2_SHIFT) +#define SCU_INVALIDATE_CPU3_SHIFT 12 /* Ways that must be invalidated for CPU3 */ +#define SCU_INVALIDATE_CPU3_MASK (15 << SCU_INVALIDATE_CPU3_SHIFT) + +/* Filtering Start Address Register Defined by FILTERSTART input */ + +#define SCU_FILTERSTART_SHIFT 10 /* Filtering start address */ +#define SCU_FILTERSTART_MASK (0xfff << SCU_FILTERSTART_SHIFT) + +/* Filtering End Address Register Defined by FILTEREND input */ + +#define SCU_FILTEREND_SHIFT 10 /* Filtering start address */ +#define SCU_FILTEREND_MASK (0xfff << SCU_FILTEREND_SHIFT) + +/* SCU Access Control (SAC) Register */ + +#define SCU_SAC_CPU(n) (1 << (n)) /* CPUn may access components */ + +/* SCU Non-secure Access Control (SNSAC) Register */ + +#define SCU_SNSAC_COMP_CPU(n) (1 << (n)) /* CPUn has non-secure access to components */ +#define SCU_SNSAC_PTIM_CPU(n) (1 << ((n)+4)) /* CPUn has non-secure access to private timers */ +#define SCU_SNSAC_GTIM_CPU(n) (1 << ((n)+8)) /* CPUn has non-secure access to global timer */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: arm_enable_smp + * + * Description: + * Enable the SCU and make certain that current CPU is participating in + * the SMP cache coherency. + * + ****************************************************************************/ + +void arm_enable_smp(int cpu); + +#endif /* __ARCH_ARM_SRC_ARMV7_A_SCU_H */ diff --git a/arch/arm/src/armv7-m/Kconfig b/arch/arm/src/armv7-m/Kconfig index 404dce07538ef771a6b176e8109dedf20fc6313e..4c66b55d54d2f55a97b2b1d4a15e566f8c3ed6d6 100644 --- a/arch/arm/src/armv7-m/Kconfig +++ b/arch/arm/src/armv7-m/Kconfig @@ -48,12 +48,12 @@ config ARMV7M_DTCM choice prompt "Toolchain Selection" - default ARMV7M_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS - default ARMV7M_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS + default ARMV7M_TOOLCHAIN_GNU_EABIW if TOOLCHAIN_WINDOWS + default ARMV7M_TOOLCHAIN_GNU_EABIL if !TOOLCHAIN_WINDOWS config ARMV7M_TOOLCHAIN_IARW bool "IAR for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_IAR config ARMV7M_TOOLCHAIN_IARL @@ -63,7 +63,7 @@ config ARMV7M_TOOLCHAIN_IARL config ARMV7M_TOOLCHAIN_ATOLLIC bool "Atollic Lite/Pro for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU config ARMV7M_TOOLCHAIN_BUILDROOT @@ -78,7 +78,7 @@ config ARMV7M_TOOLCHAIN_CODEREDL config ARMV7M_TOOLCHAIN_CODEREDW bool "CodeRed for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU config ARMV7M_TOOLCHAIN_CODESOURCERYL @@ -88,12 +88,12 @@ config ARMV7M_TOOLCHAIN_CODESOURCERYL config ARMV7M_TOOLCHAIN_CODESOURCERYW bool "CodeSourcery GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU config ARMV7M_TOOLCHAIN_DEVKITARM bool "devkitARM GNU toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU config ARMV7M_TOOLCHAIN_GNU_EABIL @@ -106,7 +106,7 @@ config ARMV7M_TOOLCHAIN_GNU_EABIL config ARMV7M_TOOLCHAIN_GNU_EABIW bool "Generic GNU EABI toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) @@ -114,7 +114,7 @@ config ARMV7M_TOOLCHAIN_GNU_EABIW config ARMV7M_TOOLCHAIN_RAISONANCE bool "STMicro Raisonance for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS select ARM_TOOLCHAIN_GNU endchoice diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index b34cfc73950343db2ab09940953f55a9daf14fab..11f29cd653422c3b58535fabcac7249c72115eec 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -53,6 +53,7 @@ #include "up_arch.h" #include "sched/sched.h" +#include "irq/irq.h" #include "up_internal.h" /**************************************************************************** @@ -319,6 +320,12 @@ static void up_dumpstate(void) #endif +#ifdef CONFIG_SMP + /* Show the CPU number */ + + _alert("CPU%d:\n", up_cpu_index()); +#endif + /* Then dump the registers (if available) */ up_registerdump(); @@ -351,6 +358,12 @@ static void _up_assert(int errorcode) (void)up_irq_save(); for (; ; ) { +#ifdef CONFIG_SMP + /* Try (again) to stop activity on other CPUs */ + + (void)spin_trylock(&g_cpu_irqlock); +#endif + #ifdef CONFIG_ARCH_LEDS board_autoled_on(LED_PANIC); up_mdelay(250); diff --git a/arch/arm/src/armv7-m/up_doirq.c b/arch/arm/src/armv7-m/up_doirq.c index b51c10e55823bf3ca9861292e97258244519c3cd..ed33a27aed11b1429c558dabfb38b9278f6b7821 100644 --- a/arch/arm/src/armv7-m/up_doirq.c +++ b/arch/arm/src/armv7-m/up_doirq.c @@ -50,22 +50,6 @@ #include "up_arch.h" #include "up_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/armv7-m/up_schedulesigaction.c b/arch/arm/src/armv7-m/up_schedulesigaction.c index cf70662510c47a0515ee4825353446af5a522c66..42aa2932ba64ce13f56a3ef67af8512a83780ba1 100644 --- a/arch/arm/src/armv7-m/up_schedulesigaction.c +++ b/arch/arm/src/armv7-m/up_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_schedulesigaction.c * - * Copyright (C) 2009-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,8 @@ #include "up_internal.h" #include "up_arch.h" +#include "irq/irq.h" + #ifndef CONFIG_DISABLE_SIGNALS /**************************************************************************** @@ -91,6 +93,7 @@ * ****************************************************************************/ +#ifndef CONFIG_SMP void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; @@ -163,7 +166,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) #endif CURRENT_REGS[REG_XPSR] = ARMV7M_XPSR_T; #ifdef CONFIG_BUILD_PROTECTED - CURRENT_REGS[REG_LR] = EXC_RETURN_PRIVTHR; + CURRENT_REGS[REG_LR] = EXC_RETURN_PRIVTHR; #endif /* And make sure that the saved context in the TCB is the same * as the interrupt return context. @@ -216,5 +219,214 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) leave_critical_section(flags); } +#endif /* !CONFIG_SMP */ + +#ifdef CONFIG_SMP +void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) +{ + irqstate_t flags; + int cpu; + int me; + + sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + + /* Make sure that interrupts are disabled */ + + flags = enter_critical_section(); + + /* Refuse to handle nested signal actions */ + + if (!tcb->xcp.sigdeliver) + { + /* First, handle some special cases when the signal is being delivered + * to task that is currently executing on any CPU. + */ + + sinfo("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + + if (tcb->task_state == TSTATE_TASK_RUNNING) + { + me = this_cpu(); + cpu = tcb->cpu; + + /* CASE 1: We are not in an interrupt handler and a task is + * signalling itself for some reason. + */ + + if (cpu == me && !CURRENT_REGS) + { + /* In this case just deliver the signal now. */ + + sigdeliver(tcb); + } + + /* CASE 2: The task that needs to receive the signal is running. + * This could happen if the task is running on another CPU OR if + * we are in an interrupt handler and the task is running on this + * CPU. In the former case, we will have to PAUSE the other CPU + * first. But in either case, we will have to modify the return + * state as well as the state in the TCB. + * + * Hmmm... there looks like a latent bug here: The following logic + * would fail in the strange case where we are in an interrupt + * handler, the thread is signalling itself, but a context switch + * to another task has occurred so that CURRENT_REGS does not + * refer to the thread of this_task()! + */ + + else + { + /* If we signalling a task running on the other CPU, we have + * to PAUSE the other CPU. + */ + + if (cpu != me) + { + up_cpu_pause(cpu); + } + + /* Save the return PC, CPSR and either the BASEPRI or PRIMASK + * registers (and perhaps also the LR). These will be + * restored by the signal trampoline after the signal has been + * delivered. + */ + + tcb->xcp.sigdeliver = (FAR void *)sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; +#ifdef CONFIG_ARMV7M_USEBASEPRI + tcb->xcp.saved_basepri = CURRENT_REGS[REG_BASEPRI]; +#else + tcb->xcp.saved_primask = CURRENT_REGS[REG_PRIMASK]; +#endif + tcb->xcp.saved_xpsr = CURRENT_REGS[REG_XPSR]; +#ifdef CONFIG_BUILD_PROTECTED + tcb->xcp.saved_lr = CURRENT_REGS[REG_LR]; +#endif + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. + */ + + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; + + /* Handle a possible race condition where the TCB was suspended + * just before we paused the other CPU. The critical section + * established above will prevent new threads from running on + * that CPU, but it will not guarantee that the running thread + * did not suspend itself (allowing any threads "assigned" to + * the CPU to run). + */ + + if (tcb->task_state != TSTATE_TASK_RUNNING) + { + /* Then set up to vector to the trampoline with interrupts + * disabled. We must already be in privileged thread mode + * to be here. + */ + + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; +#ifdef CONFIG_ARMV7M_USEBASEPRI + tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; +#else + tcb->xcp.regs[REG_PRIMASK] = 1; +#endif + tcb->xcp.regs[REG_XPSR] = ARMV7M_XPSR_T; +#ifdef CONFIG_BUILD_PROTECTED + tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR; +#endif + } + else + { + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + CURRENT_REGS[REG_PC] = (uint32_t)up_sigdeliver; +#ifdef CONFIG_ARMV7M_USEBASEPRI + CURRENT_REGS[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; +#else + CURRENT_REGS[REG_PRIMASK] = 1; +#endif + CURRENT_REGS[REG_XPSR] = ARMV7M_XPSR_T; +#ifdef CONFIG_BUILD_PROTECTED + CURRENT_REGS[REG_LR] = EXC_RETURN_PRIVTHR; +#endif + /* In an SMP configuration, the interrupt disable logic also + * involves spinlocks that are configured per the TCB irqcount + * field. This is logically equivalent to enter_critical_section(). + * The matching call to leave_critical_section() will be + * performed in up_sigdeliver(). + */ + + spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); + + /* And make sure that the saved context in the TCB is the same + * as the interrupt return context. + */ + + up_savestate(tcb->xcp.regs); + } + + /* RESUME the other CPU if it was PAUSED */ + + if (cpu != me) + { + up_cpu_resume(cpu); + } + } + } + + /* Otherwise, we are (1) signaling a task is not running from an + * interrupt handler or (2) we are not in an interrupt handler and the + * running task is signalling some other non-running task. + */ + + else + { + /* Save the return PC, CPSR and either the BASEPRI or PRIMASK + * registers (and perhaps also the LR). These will be restored + * by the signal trampoline after the signal has been delivered. + */ + + tcb->xcp.sigdeliver = (FAR void *)sigdeliver; + tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; +#ifdef CONFIG_ARMV7M_USEBASEPRI + tcb->xcp.saved_basepri = tcb->xcp.regs[REG_BASEPRI]; +#else + tcb->xcp.saved_primask = tcb->xcp.regs[REG_PRIMASK]; +#endif + tcb->xcp.saved_xpsr = tcb->xcp.regs[REG_XPSR]; +#ifdef CONFIG_BUILD_PROTECTED + tcb->xcp.saved_lr = tcb->xcp.regs[REG_LR]; +#endif + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. + */ + + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; + + /* Then set up to vector to the trampoline with interrupts + * disabled. We must already be in privileged thread mode to be + * here. + */ + + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; +#ifdef CONFIG_ARMV7M_USEBASEPRI + tcb->xcp.regs[REG_BASEPRI] = NVIC_SYSH_DISABLE_PRIORITY; +#else + tcb->xcp.regs[REG_PRIMASK] = 1; +#endif + tcb->xcp.regs[REG_XPSR] = ARMV7M_XPSR_T; +#ifdef CONFIG_BUILD_PROTECTED + tcb->xcp.regs[REG_LR] = EXC_RETURN_PRIVTHR; +#endif + } + } + + leave_critical_section(flags); +} +#endif /* CONFIG_SMP */ #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/arm/src/armv7-m/up_sigdeliver.c b/arch/arm/src/armv7-m/up_sigdeliver.c index 6169b512796e839588dfaee8b2dd40c5ff8d6b1c..5aff11499c2630f32e12785f1c94e56d57e68b1d 100644 --- a/arch/arm/src/armv7-m/up_sigdeliver.c +++ b/arch/arm/src/armv7-m/up_sigdeliver.c @@ -54,18 +54,6 @@ #ifndef CONFIG_DISABLE_SIGNALS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -124,9 +112,9 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ #ifdef CONFIG_ARMV7M_USEBASEPRI - up_irq_restore((uint8_t)regs[REG_BASEPRI]); + leave_critical_section((uint8_t)regs[REG_BASEPRI]); #else - up_irq_restore((uint16_t)regs[REG_PRIMASK]); + leave_critical_section((uint16_t)regs[REG_PRIMASK]); #endif /* Deliver the signal */ @@ -136,9 +124,18 @@ void up_sigdeliver(void) /* Output any debug messages BEFORE restoring errno (because they may * alter errno), then disable interrupts again and restore the original * errno that is needed by the user logic (it is probably EINTR). + * + * REVISIT: In SMP mode up_irq_save() probably only disables interrupts + * on the local CPU. We do not want to call enter_critical_section() + * here, however, because we don't want this state to stick after the + * call to up_fullcontextrestore(). + * + * I would prefer that all interrupts are disabled when + * up_fullcontextrestore() is called, but that may not be necessary. */ sinfo("Resuming\n"); + (void)up_irq_save(); rtcb->pterrno = saved_errno; diff --git a/arch/arm/src/armv7-m/up_signal_dispatch.c b/arch/arm/src/armv7-m/up_signal_dispatch.c index 4a03a26b213e7d39ceedd7086c6c10162d4d6051..9ec7d151529ca35f84e4dc939165e35f8882d9a5 100644 --- a/arch/arm/src/armv7-m/up_signal_dispatch.c +++ b/arch/arm/src/armv7-m/up_signal_dispatch.c @@ -46,18 +46,6 @@ #if ((defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)) || \ defined(CONFIG_BUILD_KERNEL)) && !defined(CONFIG_DISABLE_SIGNALS) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/armv7-r/Kconfig b/arch/arm/src/armv7-r/Kconfig index 1f46770cb6abcd0e857c97ac0f81462920aa31d6..03012b5da25b6f9d9738586023a1fae572303f62 100644 --- a/arch/arm/src/armv7-r/Kconfig +++ b/arch/arm/src/armv7-r/Kconfig @@ -144,8 +144,8 @@ endif # ARMV7R_HAVE_L2CC choice prompt "Toolchain Selection" - default ARMV7R_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS - default ARMV7R_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS + default ARMV7R_TOOLCHAIN_GNU_EABIW if TOOLCHAIN_WINDOWS + default ARMV7R_TOOLCHAIN_GNU_EABIL if !TOOLCHAIN_WINDOWS config ARMV7R_TOOLCHAIN_BUILDROOT bool "Buildroot (Cygwin or Linux)" @@ -161,11 +161,11 @@ config ARMV7R_TOOLCHAIN_CODESOURCERYL config ARMV7R_TOOLCHAIN_CODESOURCERYW bool "CodeSourcery GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV7R_TOOLCHAIN_DEVKITARM bool "devkitARM GNU toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config ARMV7R_TOOLCHAIN_GNU_EABIL bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)" @@ -175,7 +175,7 @@ config ARMV7R_TOOLCHAIN_GNU_EABIL config ARMV7R_TOOLCHAIN_GNU_EABIW bool "Generic GNU EABI toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) configured for arm-none-eabi-. diff --git a/arch/arm/src/armv7-r/cache.h b/arch/arm/src/armv7-r/cache.h index a0d25c89410756160f7cf52b35e53bcb57cef8a5..721f40313f29236c6ffcc0b7d0f10ec304129ccf 100644 --- a/arch/arm/src/armv7-r/cache.h +++ b/arch/arm/src/armv7-r/cache.h @@ -51,7 +51,7 @@ * Pre-processor Definitions ************************************************************************************/ -/* intrinsics are used in these inline functions */ +/* Intrinsics are used in these inline functions */ #define arm_isb(n) __asm__ __volatile__ ("isb " #n : : : "memory") #define arm_dsb(n) __asm__ __volatile__ ("dsb " #n : : : "memory") @@ -61,7 +61,7 @@ #define ARM_ISB() arm_isb(15) #define ARM_DMB() arm_dmb(15) - /************************************************************************************ +/************************************************************************************ * Inline Functions ************************************************************************************/ diff --git a/arch/arm/src/c5471/Kconfig b/arch/arm/src/c5471/Kconfig index 17b615a0973de6b10fe31faaecf11b7afd0054fc..5f46d7684a967f190b343a84a55c81e9e26fae08 100644 --- a/arch/arm/src/c5471/Kconfig +++ b/arch/arm/src/c5471/Kconfig @@ -110,3 +110,23 @@ config C5471_BASET10 bool "10BaseT FullDuplex" endchoice + +choice + prompt "Ethernet work queue" + default C5471_LPWORK if SCHED_LPWORK + default C5471_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config C5471_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config C5471_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index b7563aa0545b5909eb66f29080f050120a840245..a163cecaabe482c65e383be8fb72411705ed7d29 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,25 @@ ****************************************************************************/ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_C5471_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_C5471_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_C5471_HPWORK nor CONFIG_C5471_LPWORK defined +# endif +#endif + /* CONFIG_C5471_NET_NINTERFACES determines the number of physical interfaces * that will be supported. */ @@ -273,12 +293,16 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct eth_hdr_s *)c5471->c_dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->c_dev.d_buf) /**************************************************************************** * Private Types ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + /* The c5471_driver_s encapsulates all state information for a single c5471 * hardware interface */ @@ -288,6 +312,7 @@ struct c5471_driver_s bool c_bifup; /* true:ifup false:ifdown */ WDOG_ID c_txpoll; /* TX poll timer */ WDOG_ID c_txtimeout; /* TX timeout timer */ + struct work_s c_work; /* For deferring work to the work queue */ /* Note: According to the C547x documentation: "The software has to maintain * two pointers to the current RX-CPU and TX-CPU descriptors. At init time, @@ -356,36 +381,44 @@ static int c5471_phyinit (void); /* Support logic */ -static inline void c5471_inctxcpu(struct c5471_driver_s *c5471); -static inline void c5471_incrxcpu(struct c5471_driver_s *c5471); +static inline void c5471_inctxcpu(struct c5471_driver_s *priv); +static inline void c5471_incrxcpu(struct c5471_driver_s *priv); /* Common TX logic */ -static int c5471_transmit(struct c5471_driver_s *c5471); +static int c5471_transmit(struct c5471_driver_s *priv); static int c5471_txpoll(struct net_driver_s *dev); /* Interrupt handling */ #ifdef CONFIG_C5471_NET_STATS -static void c5471_rxstatus(struct c5471_driver_s *c5471); +static void c5471_rxstatus(struct c5471_driver_s *priv); #endif -static void c5471_receive(struct c5471_driver_s *c5471); +static void c5471_receive(struct c5471_driver_s *priv); #ifdef CONFIG_C5471_NET_STATS -static void c5471_txstatus(struct c5471_driver_s *c5471); +static void c5471_txstatus(struct c5471_driver_s *priv); #endif -static void c5471_txdone(struct c5471_driver_s *c5471); +static void c5471_txdone(struct c5471_driver_s *priv); + +static void c5471_interrupt_work(FAR void *arg); static int c5471_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static void c5471_polltimer(int argc, uint32_t arg, ...); -static void c5471_txtimeout(int argc, uint32_t arg, ...); +static void c5471_txtimeout_work(FAR void *arg); +static void c5471_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void c5471_poll_work(FAR void *arg); +static void c5471_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int c5471_ifup(struct net_driver_s *dev); static int c5471_ifdown(struct net_driver_s *dev); + +static void c5471_txavail_work(FAR void *arg); static int c5471_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP static int c5471_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); static int c5471_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); @@ -393,10 +426,10 @@ static int c5471_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); /* Initialization functions */ -static void c5471_eimreset (struct c5471_driver_s *c5471); -static void c5471_eimconfig(struct c5471_driver_s *c5471); -static void c5471_reset(struct c5471_driver_s *c5471); -static void c5471_macassign(struct c5471_driver_s *c5471); +static void c5471_eimreset (struct c5471_driver_s *priv); +static void c5471_eimconfig(struct c5471_driver_s *priv); +static void c5471_reset(struct c5471_driver_s *priv); +static void c5471_macassign(struct c5471_driver_s *priv); /**************************************************************************** * Private Functions @@ -411,7 +444,8 @@ static void c5471_macassign(struct c5471_driver_s *c5471); ****************************************************************************/ #ifdef CONFIG_C5471_NET_DUMPBUFFER -static inline void c5471_dumpbuffer(const char *msg, const uint8_t *buffer, unsigned int nbytes) +static inline void c5471_dumpbuffer(const char *msg, const uint8_t *buffer, + unsigned int nbytes) { /* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_NET have to be * defined or the following does nothing. @@ -789,20 +823,20 @@ static int c5471_phyinit (void) * ****************************************************************************/ -static inline void c5471_inctxcpu(struct c5471_driver_s *c5471) +static inline void c5471_inctxcpu(struct c5471_driver_s *priv) { - if (EIM_TXDESC_WRAP_NEXT & getreg32(c5471->c_txcpudesc)) + if (EIM_TXDESC_WRAP_NEXT & getreg32(priv->c_txcpudesc)) { /* Loop back around to base of descriptor queue */ - c5471->c_txcpudesc = getreg32(EIM_CPU_TXBA) + EIM_RAM_START; + priv->c_txcpudesc = getreg32(EIM_CPU_TXBA) + EIM_RAM_START; } else { - c5471->c_txcpudesc += 2*sizeof(uint32_t); + priv->c_txcpudesc += 2*sizeof(uint32_t); } - ninfo("TX CPU desc: %08x\n", c5471->c_txcpudesc); + ninfo("TX CPU desc: %08x\n", priv->c_txcpudesc); } /**************************************************************************** @@ -812,20 +846,20 @@ static inline void c5471_inctxcpu(struct c5471_driver_s *c5471) * ****************************************************************************/ -static inline void c5471_incrxcpu(struct c5471_driver_s *c5471) +static inline void c5471_incrxcpu(struct c5471_driver_s *priv) { - if (EIM_RXDESC_WRAP_NEXT & getreg32(c5471->c_rxcpudesc)) + if (EIM_RXDESC_WRAP_NEXT & getreg32(priv->c_rxcpudesc)) { /* Loop back around to base of descriptor queue */ - c5471->c_rxcpudesc = getreg32(EIM_CPU_RXBA) + EIM_RAM_START; + priv->c_rxcpudesc = getreg32(EIM_CPU_RXBA) + EIM_RAM_START; } else { - c5471->c_rxcpudesc += 2*sizeof(uint32_t); + priv->c_rxcpudesc += 2*sizeof(uint32_t); } - ninfo("RX CPU desc: %08x\n", c5471->c_rxcpudesc); + ninfo("RX CPU desc: %08x\n", priv->c_rxcpudesc); } /**************************************************************************** @@ -836,7 +870,7 @@ static inline void c5471_incrxcpu(struct c5471_driver_s *c5471) * handling or from watchdog based polling. * * Parameters: - * c5471 - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * OK on success; a negated errno on failure @@ -845,9 +879,9 @@ static inline void c5471_incrxcpu(struct c5471_driver_s *c5471) * ****************************************************************************/ -static int c5471_transmit(struct c5471_driver_s *c5471) +static int c5471_transmit(struct c5471_driver_s *priv) { - struct net_driver_s *dev = &c5471->c_dev; + struct net_driver_s *dev = &priv->c_dev; volatile uint16_t *packetmem; uint16_t framelen; bool bfirstframe; @@ -856,12 +890,12 @@ static int c5471_transmit(struct c5471_driver_s *c5471) unsigned int i; unsigned int j; - nbytes = (dev->d_len + 1) & ~1; - j = 0; - bfirstframe = true; - c5471->c_lastdescstart = c5471->c_rxcpudesc; + nbytes = (dev->d_len + 1) & ~1; + j = 0; + bfirstframe = true; + priv->c_lastdescstart = priv->c_rxcpudesc; - ninfo("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc); + ninfo("Packet size: %d RX CPU desc: %08x\n", nbytes, priv->c_rxcpudesc); c5471_dumpbuffer("Transmit packet", dev->d_buf, dev->d_len); while (nbytes) @@ -869,7 +903,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471) /* Verify that the hardware is ready to send another packet */ /* Words #0 and #1 of descriptor */ - while (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) + while (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) { /* Loop until the SWITCH lets go of the descriptor giving us access * rights to submit our new ether frame to it. @@ -878,18 +912,18 @@ static int c5471_transmit(struct c5471_driver_s *c5471) if (bfirstframe) { - putreg32((getreg32(c5471->c_rxcpudesc) | EIM_RXDESC_FIF), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) | EIM_RXDESC_FIF), priv->c_rxcpudesc); } else { - putreg32((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_FIF), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) & ~EIM_RXDESC_FIF), priv->c_rxcpudesc); } - putreg32((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_PADCRC), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) & ~EIM_RXDESC_PADCRC), priv->c_rxcpudesc); if (bfirstframe) { - putreg32((getreg32(c5471->c_rxcpudesc) | EIM_RXDESC_PADCRC), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) | EIM_RXDESC_PADCRC), priv->c_rxcpudesc); } if (nbytes >= EIM_PACKET_BYTES) @@ -908,7 +942,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471) /* Words #2 and #3 of descriptor */ - packetmem = (uint16_t *)getreg32(c5471->c_rxcpudesc + sizeof(uint32_t)); + packetmem = (uint16_t *)getreg32(priv->c_rxcpudesc + sizeof(uint32_t)); for (i = 0; i < nshorts; i++, j++) { /* 16-bits at a time. */ @@ -916,43 +950,45 @@ static int c5471_transmit(struct c5471_driver_s *c5471) packetmem[i] = htons(((uint16_t *)dev->d_buf)[j]); } - putreg32(((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_BYTEMASK) | framelen), c5471->c_rxcpudesc); + putreg32(((getreg32(priv->c_rxcpudesc) & ~EIM_RXDESC_BYTEMASK) | framelen), + priv->c_rxcpudesc); nbytes -= framelen; ninfo("Wrote framelen: %d nbytes: %d nshorts: %d\n", framelen, nbytes, nshorts); if (0 == nbytes) { - putreg32((getreg32(c5471->c_rxcpudesc) | EIM_RXDESC_LIF), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) | EIM_RXDESC_LIF), priv->c_rxcpudesc); } else { - putreg32((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_LIF), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) & ~EIM_RXDESC_LIF), priv->c_rxcpudesc); } /* We're done with that descriptor; give access rights back to h/w */ - putreg32((getreg32(c5471->c_rxcpudesc) | EIM_RXDESC_OWN_HOST), c5471->c_rxcpudesc); + putreg32((getreg32(priv->c_rxcpudesc) | EIM_RXDESC_OWN_HOST), priv->c_rxcpudesc); /* Next, tell Ether Module that those submitted bytes are ready for the wire */ putreg32(0x00000001, EIM_CPU_RXREADY); - c5471->c_lastdescend = c5471->c_rxcpudesc; + priv->c_lastdescend = priv->c_rxcpudesc; /* Advance to the next free descriptor */ - c5471_incrxcpu(c5471); + c5471_incrxcpu(priv); bfirstframe = false; } /* Packet transferred .. Update statistics */ #ifdef CONFIG_C5471_NET_STATS - c5471->c_txpackets++; + priv->c_txpackets++; #endif /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(c5471->c_txtimeout, C5471_TXTIMEOUT, c5471_txtimeout, 1, (uint32_t)c5471); + (void)wd_start(priv->c_txtimeout, C5471_TXTIMEOUT, + c5471_txtimeout_expiry, 1, (wdparm_t)priv); return OK; } @@ -979,13 +1015,13 @@ static int c5471_transmit(struct c5471_driver_s *c5471) static int c5471_txpoll(struct net_driver_s *dev) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; + struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; /* If the polling resulted in data that should be sent out on the network, * the field d_len is set to a value > 0. */ - if (c5471->c_dev.d_len > 0) + if (priv->c_dev.d_len > 0) { /* Look up the destination MAC address and add it to the Ethernet * header. @@ -993,10 +1029,10 @@ static int c5471_txpoll(struct net_driver_s *dev) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(c5471->c_dev.d_flags)) + if (IFF_IS_IPv4(priv->c_dev.d_flags)) #endif { - arp_out(&c5471->c_dev); + arp_out(&priv->c_dev); } #endif /* CONFIG_NET_IPv4 */ @@ -1005,19 +1041,19 @@ static int c5471_txpoll(struct net_driver_s *dev) else #endif { - neighbor_out(&c5471->c_dev); + neighbor_out(&priv->c_dev); } #endif /* CONFIG_NET_IPv6 */ /* Send the packet */ - c5471_transmit(c5471); + c5471_transmit(priv); /* Check if the ESM has let go of the RX descriptor giving us access * rights to submit another Ethernet frame. */ - if ((EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) != 0) + if ((EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) != 0) { /* No, then return non-zero to terminate the poll */ @@ -1039,7 +1075,7 @@ static int c5471_txpoll(struct net_driver_s *dev) * An interrupt was received indicating that the last RX packet(s) is done * * Parameters: - * c5471 - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1049,9 +1085,9 @@ static int c5471_txpoll(struct net_driver_s *dev) ****************************************************************************/ #ifdef CONFIG_C5471_NET_STATS -static void c5471_rxstatus(struct c5471_driver_s *c5471) +static void c5471_rxstatus(struct c5471_driver_s *priv) { - uint32_t desc = c5471->c_txcpudesc; + uint32_t desc = priv->c_txcpudesc; uint32_t rxstatus; /* Walk that last packet we just received to collect xmit status bits. */ @@ -1091,44 +1127,44 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471) { if ((rxstatus & EIM_TXDESC_RETRYERROR) != 0) { - c5471->c_rxretries++; - ninfo("c_rxretries: %d\n", c5471->c_rxretries); + priv->c_rxretries++; + ninfo("c_rxretries: %d\n", priv->c_rxretries); } if ((rxstatus & EIM_TXDESC_HEARTBEAT) != 0) { - c5471->c_rxheartbeat++; - ninfo("c_rxheartbeat: %d\n", c5471->c_rxheartbeat); + priv->c_rxheartbeat++; + ninfo("c_rxheartbeat: %d\n", priv->c_rxheartbeat); } if ((rxstatus & EIM_TXDESC_LCOLLISON) != 0) { - c5471->c_rxlcollision++; - ninfo("c_rxlcollision: %d\n", c5471->c_rxlcollision); + priv->c_rxlcollision++; + ninfo("c_rxlcollision: %d\n", priv->c_rxlcollision); } if ((rxstatus & EIM_TXDESC_COLLISION) != 0) { - c5471->c_rxcollision++; - ninfo("c_rxcollision: %d\n", c5471->c_rxcollision); + priv->c_rxcollision++; + ninfo("c_rxcollision: %d\n", priv->c_rxcollision); } if ((rxstatus & EIM_TXDESC_CRCERROR) != 0) { - c5471->c_rxcrc++; - ninfo("c_rxcrc: %d\n", c5471->c_rxcrc); + priv->c_rxcrc++; + ninfo("c_rxcrc: %d\n", priv->c_rxcrc); } if ((rxstatus & EIM_TXDESC_UNDERRUN) != 0) { - c5471->c_rxunderrun++; - ninfo("c_rxunderrun: %d\n", c5471->c_rxunderrun); + priv->c_rxunderrun++; + ninfo("c_rxunderrun: %d\n", priv->c_rxunderrun); } if ((rxstatus & EIM_TXDESC_LOC) != 0) { - c5471->c_rxloc++; - ninfo("c_rxloc: %d\n", c5471->c_rxloc); + priv->c_rxloc++; + ninfo("c_rxloc: %d\n", priv->c_rxloc); } } } @@ -1141,7 +1177,7 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471) * An interrupt was received indicating the availability of a new RX packet * * Parameters: - * c5471 - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1150,9 +1186,9 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471) * ****************************************************************************/ -static void c5471_receive(struct c5471_driver_s *c5471) +static void c5471_receive(struct c5471_driver_s *priv) { - struct net_driver_s *dev = &c5471->c_dev; + struct net_driver_s *dev = &priv->c_dev; uint16_t *packetmem; bool bmore = true; int packetlen = 0; @@ -1166,12 +1202,12 @@ static void c5471_receive(struct c5471_driver_s *c5471) * the EIM for additional packets that might be received later from the network. */ - ninfo("Reading TX CPU desc: %08x\n", c5471->c_txcpudesc); + ninfo("Reading TX CPU desc: %08x\n", priv->c_txcpudesc); while (bmore) { /* Words #0 and #1 of descriptor */ - if (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_txcpudesc)) + if (EIM_TXDESC_OWN_HOST & getreg32(priv->c_txcpudesc)) { /* No further packets to receive. */ @@ -1182,7 +1218,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) * and update the accumulated packet size */ - framelen = (getreg32(c5471->c_txcpudesc) & EIM_TXDESC_BYTEMASK); + framelen = (getreg32(priv->c_txcpudesc) & EIM_TXDESC_BYTEMASK); packetlen += framelen; /* Check if the received packet will fit within the network packet buffer */ @@ -1191,7 +1227,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) { /* Get the packet memory from words #2 and #3 of descriptor */ - packetmem = (uint16_t *)getreg32(c5471->c_txcpudesc + sizeof(uint32_t)); + packetmem = (uint16_t *)getreg32(priv->c_txcpudesc + sizeof(uint32_t)); /* Divide by 2 with round up to get the number of 16-bit words. */ @@ -1201,7 +1237,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) for (i = 0 ; i < nshorts; i++, j++) { - /* Copy the data data from the hardware to c5471->c_dev.d_buf 16-bits at + /* Copy the data data from the hardware to priv->c_dev.d_buf 16-bits at * a time. */ @@ -1213,7 +1249,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) ninfo("Discarding framelen: %d packetlen\n", framelen, packetlen); } - if (getreg32(c5471->c_txcpudesc) & EIM_TXDESC_LIF) + if (getreg32(priv->c_txcpudesc) & EIM_TXDESC_LIF) { bmore = false; } @@ -1222,16 +1258,16 @@ static void c5471_receive(struct c5471_driver_s *c5471) * the settings of a select few. Can leave descriptor words 2/3 alone. */ - putreg32((getreg32(c5471->c_txcpudesc) & (EIM_TXDESC_WRAP_NEXT | EIM_TXDESC_INTRE)), - c5471->c_txcpudesc); + putreg32((getreg32(priv->c_txcpudesc) & (EIM_TXDESC_WRAP_NEXT | EIM_TXDESC_INTRE)), + priv->c_txcpudesc); /* Next, Give ownership of now emptied descriptor back to the Ether Module's SWITCH */ - putreg32((getreg32(c5471->c_txcpudesc) | EIM_TXDESC_OWN_HOST), c5471->c_txcpudesc); + putreg32((getreg32(priv->c_txcpudesc) | EIM_TXDESC_OWN_HOST), priv->c_txcpudesc); /* Advance to the next data buffer */ - c5471_inctxcpu(c5471); + c5471_inctxcpu(priv); } /* Adjust the packet length to remove the CRC bytes that the network doesn't care about. */ @@ -1241,7 +1277,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) #ifdef CONFIG_C5471_NET_STATS /* Increment the count of received packets */ - c5471->c_rxpackets++; + priv->c_rxpackets++; #endif /* If we successfully transferred the data into the network buffer, then pass it on @@ -1250,7 +1286,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) if (packetlen > 0 && packetlen < CONFIG_NET_ETH_MTU) { - /* Set amount of data in c5471->c_dev.d_len. */ + /* Set amount of data in priv->c_dev.d_len. */ dev->d_len = packetlen; ninfo("Received packet, packetlen: %d type: %02x\n", packetlen, ntohs(BUF->type)); @@ -1283,7 +1319,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) */ if (dev->d_len > 0 && - (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) + (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { /* Update the Ethernet header with the correct MAC address */ @@ -1302,7 +1338,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) /* And send the packet */ - c5471_transmit(c5471); + c5471_transmit(priv); } } else @@ -1323,7 +1359,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) */ if (dev->d_len > 0 && - (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) + (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { /* Update the Ethernet header with the correct MAC address */ @@ -1342,7 +1378,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) /* And send the packet */ - c5471_transmit(c5471); + c5471_transmit(priv); } } else @@ -1359,9 +1395,9 @@ static void c5471_receive(struct c5471_driver_s *c5471) */ if (dev->d_len > 0 && - (EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) + (EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { - c5471_transmit(c5471); + c5471_transmit(priv); } } #endif @@ -1372,7 +1408,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) /* Increment the count of dropped packets */ nwarn("WARNING: Too big! packetlen: %d\n", packetlen); - c5471->c_rxdropped++; + priv->c_rxdropped++; } #endif } @@ -1384,7 +1420,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) * An interrupt was received indicating that the last TX packet(s) is done * * Parameters: - * c5471 - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1394,27 +1430,27 @@ static void c5471_receive(struct c5471_driver_s *c5471) ****************************************************************************/ #ifdef CONFIG_C5471_NET_STATS -static void c5471_txstatus(struct c5471_driver_s *c5471) +static void c5471_txstatus(struct c5471_driver_s *priv) { - uint32_t desc = c5471->c_lastdescstart; + uint32_t desc = priv->c_lastdescstart; uint32_t txstatus; /* Walk that last packet we just sent to collect xmit status bits. */ txstatus = 0; - if (c5471->c_lastdescstart && c5471->c_lastdescend) + if (priv->c_lastdescstart && priv->c_lastdescend) { for (; ; ) { txstatus |= (getreg32(desc) & EIM_RXDESC_STATUSMASK); - if (desc == c5471->c_lastdescend) + if (desc == priv->c_lastdescend) { break; } /* This packet is made up of several descriptors, find next one in chain. */ - if (EIM_RXDESC_WRAP_NEXT & getreg32(c5471->c_rxcpudesc)) + if (EIM_RXDESC_WRAP_NEXT & getreg32(priv->c_rxcpudesc)) { /* Loop back around to base of descriptor queue. */ @@ -1431,44 +1467,44 @@ static void c5471_txstatus(struct c5471_driver_s *c5471) { if ((txstatus & EIM_RXDESC_MISS) != 0) { - c5471->c_txmiss++; - ninfo("c_txmiss: %d\n", c5471->c_txmiss); + priv->c_txmiss++; + ninfo("c_txmiss: %d\n", priv->c_txmiss); } if ((txstatus & EIM_RXDESC_VLAN) != 0) { - c5471->c_txvlan++; - ninfo("c_txvlan: %d\n", c5471->c_txvlan); + priv->c_txvlan++; + ninfo("c_txvlan: %d\n", priv->c_txvlan); } if ((txstatus & EIM_RXDESC_LFRAME) != 0) { - c5471->c_txlframe++; - ninfo("c_txlframe: %d\n", c5471->c_txlframe); + priv->c_txlframe++; + ninfo("c_txlframe: %d\n", priv->c_txlframe); } if ((txstatus & EIM_RXDESC_SFRAME) != 0) { - c5471->c_txsframe++; - ninfo("c_txsframe: %d\n", c5471->c_txsframe); + priv->c_txsframe++; + ninfo("c_txsframe: %d\n", priv->c_txsframe); } if ((txstatus & EIM_RXDESC_CRCERROR) != 0) { - c5471->c_txcrc++; - ninfo("c_txcrc: %d\n", c5471->c_txcrc); + priv->c_txcrc++; + ninfo("c_txcrc: %d\n", priv->c_txcrc); } if ((txstatus & EIM_RXDESC_OVERRUN) != 0) { - c5471->c_txoverrun++; - ninfo("c_txoverrun: %d\n", c5471->c_txoverrun); + priv->c_txoverrun++; + ninfo("c_txoverrun: %d\n", priv->c_txoverrun); } if ((txstatus & EIM_RXDESC_OVERRUN) != 0) { - c5471->c_txalign++; - ninfo("c_txalign: %d\n", c5471->c_txalign); + priv->c_txalign++; + ninfo("c_txalign: %d\n", priv->c_txalign); } } } @@ -1481,7 +1517,7 @@ static void c5471_txstatus(struct c5471_driver_s *c5471) * An interrupt was received indicating that the last TX packet(s) is done * * Parameters: - * c5471 - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1490,50 +1526,50 @@ static void c5471_txstatus(struct c5471_driver_s *c5471) * ****************************************************************************/ -static void c5471_txdone(struct c5471_driver_s *c5471) +static void c5471_txdone(struct c5471_driver_s *priv) { /* If no further xmits are pending, then cancel the TX timeout */ - wd_cancel(c5471->c_txtimeout); + wd_cancel(priv->c_txtimeout); /* Then poll the network for new XMIT data */ - (void)devif_poll(&c5471->c_dev, c5471_txpoll); + (void)devif_poll(&priv->c_dev, c5471_txpoll); } /**************************************************************************** - * Function: c5471_interrupt + * Function: c5471_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static int c5471_interrupt(int irq, FAR void *context) +static void c5471_interrupt_work(FAR void *arg) { -#if CONFIG_C5471_NET_NINTERFACES == 1 - register struct c5471_driver_s *c5471 = &g_c5471[0]; -#else -# error "Additional logic needed to support multiple interfaces" -#endif + FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg; + + /* Process pending Ethernet interrupts */ + + net_lock(); /* Get and clear interrupt status bits */ - c5471->c_eimstatus = getreg32(EIM_STATUS); + priv->c_eimstatus = getreg32(EIM_STATUS); /* Handle interrupts according to status bit settings */ /* Check if we received an incoming packet, if so, call c5471_receive() */ - if ((EIM_STATUS_CPU_TX & c5471->c_eimstatus) != 0) + if ((EIM_STATUS_CPU_TX & priv->c_eimstatus) != 0) { /* An incoming packet has been received by the EIM from the network and * the interrupt associated with EIM's CPU TX queue has been asserted. It @@ -1545,17 +1581,17 @@ static int c5471_interrupt(int irq, FAR void *context) #ifdef CONFIG_C5471_NET_STATS /* Check for RX errors */ - c5471_rxstatus(c5471); + c5471_rxstatus(priv); #endif /* Process the received packet */ - c5471_receive(c5471); + c5471_receive(priv); } /* Check is a packet transmission just completed. If so, call c5471_txdone */ - if ((EIM_STATUS_CPU_RX & c5471->c_eimstatus) != 0) + if ((EIM_STATUS_CPU_RX & priv->c_eimstatus) != 0) { /* An outgoing packet has been processed by the EIM and the interrupt * associated with EIM's CPU RX que has been asserted. It is the EIM's @@ -1566,65 +1602,120 @@ static int c5471_interrupt(int irq, FAR void *context) #ifdef CONFIG_C5471_NET_STATS /* Check for TX errors */ - c5471_txstatus(c5471); + c5471_txstatus(priv); #endif /* Handle the transmission done event */ - c5471_txdone(c5471); + c5471_txdone(priv); } - /* Enable Ethernet interrupts (perhaps excluding the TX done interrupt if - * there are no pending transmissions. + net_unlock(); + + /* Re-enable Ethernet interrupts */ + + up_enable_irq(C5471_IRQ_ETHER); +} + +/**************************************************************************** + * Function: c5471_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int c5471_interrupt(int irq, FAR void *context) +{ +#if CONFIG_C5471_NET_NINTERFACES == 1 + register struct c5471_driver_s *priv = &g_c5471[0]; +#else +# error "Additional logic needed to support multiple interfaces" +#endif + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. */ + up_disable_irq(C5471_IRQ_ETHER); + + /* TODO: Determine if a TX transfer just completed */ + + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be no race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->c_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->c_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->c_work, c5471_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: c5471_txtimeout + * Function: c5471_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static void c5471_txtimeout(int argc, uint32_t arg, ...) +static void c5471_txtimeout_work(FAR void *arg) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)arg; + FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg; /* Increment statistics */ + net_lock(); #ifdef CONFIG_C5471_NET_STATS - c5471->c_txtimeouts++; - ninfo("c_txtimeouts: %d\n", c5471->c_txtimeouts); + priv->c_txtimeouts++; + ninfo("c_txtimeouts: %d\n", priv->c_txtimeouts); #endif /* Then try to restart the hardware */ - c5471_ifdown(&c5471->c_dev); - c5471_ifup(&c5471->c_dev); + c5471_ifdown(&priv->c_dev); + c5471_ifup(&priv->c_dev); /* Then poll the network for new XMIT data */ - (void)devif_poll(&c5471->c_dev, c5471_txpoll); + (void)devif_poll(&priv->c_dev, c5471_txpoll); + net_unlock(); } /**************************************************************************** - * Function: c5471_polltimer + * Function: c5471_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1634,27 +1725,113 @@ static void c5471_txtimeout(int argc, uint32_t arg, ...) * None * * Assumptions: + * Global interrupts are disabled by the watchdog logic. * ****************************************************************************/ -static void c5471_polltimer(int argc, uint32_t arg, ...) +static void c5471_txtimeout_expiry(int argc, wdparm_t arg, ...) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)arg; + struct c5471_driver_s *priv = (struct c5471_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + up_disable_irq(C5471_IRQ_ETHER); + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->c_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->c_work, c5471_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: c5471_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void c5471_poll_work(FAR void *arg) +{ + FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg; /* Check if the ESM has let go of the RX descriptor giving us access rights * to submit another Ethernet frame. */ - if ((EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) + net_lock(); + if ((EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { /* If so, update TCP timing states and poll the network for new XMIT data */ - (void)devif_timer(&c5471->c_dev, c5471_txpoll); + (void)devif_timer(&priv->c_dev, c5471_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(c5471->c_txpoll, C5471_WDDELAY, c5471_polltimer, 1, arg); + (void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, 1, + (wdparm_t)priv); + net_unlock(); +} + +/**************************************************************************** + * Function: c5471_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void c5471_poll_expiry(int argc, wdparm_t arg, ...) +{ + struct c5471_driver_s *priv = (struct c5471_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->c_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->c_work, c5471_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, + 1, arg); + } } /**************************************************************************** @@ -1677,7 +1854,7 @@ static void c5471_polltimer(int argc, uint32_t arg, ...) static int c5471_ifup(struct net_driver_s *dev) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; + struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; volatile uint32_t clearbits; ninfo("Bringing up: %d.%d.%d.%d\n", @@ -1686,11 +1863,11 @@ static int c5471_ifup(struct net_driver_s *dev) /* Initilize Ethernet interface */ - c5471_reset(c5471); + c5471_reset(priv); /* Assign the MAC to the device */ - c5471_macassign(c5471); + c5471_macassign(priv); /* Clear pending interrupts by reading the EIM status register */ @@ -1712,11 +1889,12 @@ static int c5471_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(c5471->c_txpoll, C5471_WDDELAY, c5471_polltimer, 1, (uint32_t)c5471); + (void)wd_start(priv->c_txpoll, C5471_WDDELAY, c5471_poll_expiry, + 1, (wdparm_t)priv); /* Enable the Ethernet interrupt */ - c5471->c_bifup = true; + priv->c_bifup = true; up_enable_irq(C5471_IRQ_ETHER); return OK; } @@ -1739,7 +1917,7 @@ static int c5471_ifup(struct net_driver_s *dev) static int c5471_ifdown(struct net_driver_s *dev) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; + struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; irqstate_t flags; ninfo("Stopping\n"); @@ -1764,60 +1942,94 @@ static int c5471_ifdown(struct net_driver_s *dev) /* Cancel the TX poll timer and TX timeout timers */ - wd_cancel(c5471->c_txpoll); - wd_cancel(c5471->c_txtimeout); + wd_cancel(priv->c_txpoll); + wd_cancel(priv->c_txtimeout); /* Reset the device */ - c5471->c_bifup = false; + priv->c_bifup = false; leave_critical_section(flags); return OK; } /**************************************************************************** - * Function: c5471_txavail + * Function: c5471_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int c5471_txavail(struct net_driver_s *dev) +static void c5471_txavail_work(FAR void *arg) { - struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private; - irqstate_t flags; + FAR struct c5471_driver_s *priv = (FAR struct c5471_driver_s *)arg; ninfo("Polling\n"); - flags = enter_critical_section(); /* Ignore the notification if the interface is not yet up */ - if (c5471->c_bifup) + net_lock(); + if (priv->c_bifup) { /* Check if the ESM has let go of the RX descriptor giving us access * rights to submit another Ethernet frame. */ - if ((EIM_TXDESC_OWN_HOST & getreg32(c5471->c_rxcpudesc)) == 0) + if ((EIM_TXDESC_OWN_HOST & getreg32(priv->c_rxcpudesc)) == 0) { /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&c5471->c_dev, c5471_txpoll); + (void)devif_poll(&priv->c_dev, c5471_txpoll); } } - leave_critical_section(flags); + net_unlock(); +} + +/**************************************************************************** + * Function: c5471_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int c5471_txavail(FAR struct net_driver_s *dev) +{ + struct c5471_driver_s *priv = (struct c5471_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->c_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->c_work, c5471_txavail_work, priv, 0); + } + return OK; } @@ -1895,7 +2107,7 @@ static int c5471_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) * ****************************************************************************/ -static void c5471_eimreset (struct c5471_driver_s *c5471) +static void c5471_eimreset (struct c5471_driver_s *priv) { /* Stop the EIM module clock */ @@ -1925,8 +2137,8 @@ static void c5471_eimreset (struct c5471_driver_s *c5471) /* All EIM register should now be in there power-up default states */ - c5471->c_lastdescstart = 0; - c5471->c_lastdescend = 0; + priv->c_lastdescstart = 0; + priv->c_lastdescend = 0; } /**************************************************************************** @@ -1939,7 +2151,7 @@ static void c5471_eimreset (struct c5471_driver_s *c5471) * ****************************************************************************/ -static void c5471_eimconfig(struct c5471_driver_s *c5471) +static void c5471_eimconfig(struct c5471_driver_s *priv) { volatile uint32_t pbuf; volatile uint32_t desc; @@ -2006,7 +2218,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* TX CPU */ ninfo("TX CPU desc: %08x pbuf: %08x\n", desc, pbuf); - c5471->c_txcpudesc = desc; + priv->c_txcpudesc = desc; putreg32((desc & 0x0000ffff), EIM_CPU_TXBA); /* 16-bit offset address */ for (i = NUM_DESC_TX-1; i >= 0; i--) { @@ -2036,7 +2248,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) /* RX CPU */ ninfo("RX CPU desc: %08x pbuf: %08x\n", desc, pbuf); - c5471->c_rxcpudesc = desc; + priv->c_rxcpudesc = desc; putreg32((desc & 0x0000ffff), EIM_CPU_RXBA); /* 16-bit offset address */ for (i = NUM_DESC_RX-1; i >= 0; i--) { @@ -2147,17 +2359,17 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471) * ****************************************************************************/ -static void c5471_reset(struct c5471_driver_s *c5471) +static void c5471_reset(struct c5471_driver_s *priv) { #if defined(CONFIG_C5471_PHY_LU3X31T_T64) ninfo("EIM reset\n"); - c5471_eimreset(c5471); + c5471_eimreset(priv); #endif ninfo("PHY init\n"); c5471_phyinit(); ninfo("EIM config\n"); - c5471_eimconfig(c5471); + c5471_eimconfig(priv); } /**************************************************************************** @@ -2172,9 +2384,9 @@ static void c5471_reset(struct c5471_driver_s *c5471) * ****************************************************************************/ -static void c5471_macassign(struct c5471_driver_s *c5471) +static void c5471_macassign(struct c5471_driver_s *priv) { - struct net_driver_s *dev = &c5471->c_dev; + struct net_driver_s *dev = &priv->c_dev; uint8_t *mptr = dev->d_mac.ether_addr_octet; register uint32_t tmp; @@ -2248,6 +2460,7 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(g_c5471, 0, CONFIG_C5471_NET_NINTERFACES*sizeof(struct c5471_driver_s)); + g_c5471[0].c_dev.d_buf = g_pktbuf; /* Single packet buffer */ g_c5471[0].c_dev.d_ifup = c5471_ifup; /* I/F down callback */ g_c5471[0].c_dev.d_ifdown = c5471_ifdown; /* I/F up (new IP address) callback */ g_c5471[0].c_dev.d_txavail = c5471_txavail; /* New TX data callback */ diff --git a/arch/arm/src/calypso/Kconfig b/arch/arm/src/calypso/Kconfig deleted file mode 100644 index e044280f6269506a88aea11e65cf644a639a958c..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/Kconfig +++ /dev/null @@ -1,115 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -comment "Calypso Configuration Options" - -menu "Modem UART Configuration" - -config UART_MODEM_BAUD - int "Modem UART BAUD" - default 115200 - -config UART_MODEM_PARITY - int "Modem UART parity" - default 0 - ---help--- - Modem UART parity. 0=None, 1=Odd, 2=Even. Default: None - -config UART_MODEM_BITS - int "Modem UART number of bits" - default 8 - ---help--- - Modem UART number of bits. Default: 8 - -config UART_MODEM_2STOP - int "Modem UART two stop bits" - default 0 - ---help--- - 0=1 stop bit, 1=Two stop bits. Default: 1 stop bit - -config UART_MODEM_RXBUFSIZE - int "Modem UART Rx buffer size" - default 256 - ---help--- - Modem UART Rx buffer size. Default: 256 - -config UART_MODEM_TXBUFSIZE - int "Modem UART Tx buffer size" - default 256 - ---help--- - Modem UART Tx buffer size. Default: 256 - -config UART_MODEM_HWFLOWCONTROL - bool "Hardware flow control" - default n - ---help--- - Enabled Modem UART hardware flow control. Default: n - -endmenu - -menu "IrDA UART Configuration" - -config UART_IRDA_BAUD - int "IrDA UART BAUD" - default 115200 - -config UART_IRDA_PARITY - int "IrDA UART parity" - default 0 - ---help--- - IrDA UART parity. 0=None, 1=Odd, 2=Even. Default: None - -config UART_IRDA_BITS - int "IrDA UART number of bits" - default 8 - ---help--- - IrDA UART number of bits. Default: 8 - -config UART_IRDA_2STOP - int "IrDA UART two stop bits" - default 0 - ---help--- - 0=1 stop bit, 1=Two stop bits. Default: 1 stop bit - -config UART_IRDA_RXBUFSIZE - int "IrDA UART Rx buffer size" - default 256 - ---help--- - IrDA UART Rx buffer size. Default: 256 - -config UART_IRDA_TXBUFSIZE - int "IrDA UART Tx buffer size" - default 256 - ---help--- - IrDA UART Tx buffer size. Default: 256 - -config UART_IRDA_HWFLOWCONTROL - bool "Hardware flow control" - default n - ---help--- - Enabled IrDA UART hardware flow control. Default: n - -endmenu - -choice - prompt "Serial Console Selection" - default SERIAL_CONSOLE_NONE - depends on DEV_CONSOLE - -# See drivers/Kconfig -config USE_SERCOMM_CONSOLE - bool "SERCOMM console" - select SERCOMM_CONSOLE - -config SERIAL_MODEM_CONSOLE - bool "Serial console on modem UART" - -config SERIAL_IRDA_CONSOLE - bool "Serial console on IrDA UART" - -config SERIAL_CONSOLE_NONE - bool "No serial console" - -endchoice diff --git a/arch/arm/src/calypso/Make.defs b/arch/arm/src/calypso/Make.defs deleted file mode 100644 index c3d6b6b0bb53d4c625c3e08aefc5c8445bc6dc01..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/Make.defs +++ /dev/null @@ -1,71 +0,0 @@ -############################################################################ -# calypso/Make.defs -# -# Copyright (C) 2007, 2013-2015 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Copyright (C) 2011 Stefan Richter. All rights reserved. -# Author: Stefan Richter -# -# 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. -# 3. Neither the name Gregory Nutt nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -HEAD_ASRC = calypso_head.S - -CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S -CMN_ASRCS += up_nommuhead.S vfork.S -CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copyfullstate.c -CMN_CSRCS += up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c -CMN_CSRCS += up_doirq.c up_exit.c up_idle.c up_initialstate.c up_initialize.c -CMN_CSRCS += up_interruptcontext.c up_prefetchabort.c up_releasepending.c -CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c -CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_syscall.c up_unblocktask.c -CMN_CSRCS += up_undefinedinsn.c up_usestack.c calypso_power.c up_vfork.c - -ifeq ($(CONFIG_ELF),y) -CMN_CSRCS += up_elf.c -else ifeq ($(CONFIG_MODULE),y) -CMN_CSRCS += up_elf.c -endif - -ifeq ($(CONFIG_STACK_COLORATION),y) -CMN_CSRCS += up_checkstack.c -endif - -CHIP_ASRCS = calypso_lowputc.S -CHIP_CSRCS = calypso_irq.c calypso_heap.c calypso_serial.c clock.c -CHIP_CSRCS += calypso_uwire.c calypso_armio.c calypso_keypad.c - -ifeq ($(CONFIG_SPI),y) -CHIP_CSRCS += calypso_spi.c -endif - -ifneq ($(CONFIG_SCHED_TICKLESS),y) -CHIP_CSRCS += calypso_timer.c -endif diff --git a/arch/arm/src/calypso/calypso_armio.c b/arch/arm/src/calypso/calypso_armio.c deleted file mode 100644 index c210fa34dce0e2b030308775ad9a30056e5f5d04..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_armio.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * Driver for shared features of ARMIO modules - * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "up_arch.h" - -/**************************************************************************** - * HW access - ****************************************************************************/ - -#define BASE_ADDR_ARMIO 0xfffe4800 -#define ARMIO_REG(x) (BASE_ADDR_ARMIO + (x)) - -enum armio_reg { - LATCH_IN = 0x00, - LATCH_OUT = 0x02, - IO_CNTL = 0x04, - CNTL_REG = 0x06, - LOAD_TIM = 0x08, - KBR_LATCH_REG = 0x0a, - KBC_REG = 0x0c, - BUZZ_LIGHT_REG = 0x0e, - LIGHT_LEVEL = 0x10, - BUZZER_LEVEL = 0x12, - GPIO_EVENT_MODE = 0x14, - KBD_GPIO_INT = 0x16, - KBD_GPIO_MASKIT = 0x18, - GPIO_DEBOUNCING = 0x1a, - GPIO_LATCH = 0x1c, -}; - -#define KBD_INT (1 << 0) -#define GPIO_INT (1 << 1) - -/**************************************************************************** - * ARMIO interrupt handler - * forward keypad events - * forward GPIO events - ****************************************************************************/ - -static int kbd_gpio_irq(int irq, uint32_t *regs) -{ - return calypso_kbd_irq(irq, regs); -} - -/**************************************************************************** - * Initialize ARMIO - ****************************************************************************/ - -void calypso_armio(void) -{ - /* Enable ARMIO clock */ - - putreg16(1 << 5, ARMIO_REG(CNTL_REG)); - - /* Mask GPIO interrupt and keypad interrupt */ - - putreg16(KBD_INT | GPIO_INT, ARMIO_REG(KBD_GPIO_MASKIT)); - - /* Attach and enable the interrupt */ - - irq_attach(IRQ_KEYPAD_GPIO, (xcpt_t)kbd_gpio_irq); - up_enable_irq(IRQ_KEYPAD_GPIO); -} diff --git a/arch/arm/src/calypso/calypso_head.S b/arch/arm/src/calypso/calypso_head.S deleted file mode 100644 index eb83b68516f261043edeb713474cb864fda7b5d2..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_head.S +++ /dev/null @@ -1,23 +0,0 @@ -/* Place a branch to the real head at the entry point */ -.section .text.start - b __start - - -/* Exception Vectors like they are needed for the exception vector - indirection of the internal boot ROM. The following section must - be liked to appear at 0x80001c */ -.section .text.exceptions -_undef_instr: - b up_vectorundefinsn -_sw_interr: - b up_vectorswi -_prefetch_abort: - b up_vectorprefetch -_data_abort: - b up_vectordata -_reserved: - b _reserved -_irq: - b up_vectorirq -_fiq: - b up_vectorfiq diff --git a/arch/arm/src/calypso/calypso_irq.c b/arch/arm/src/calypso/calypso_irq.c deleted file mode 100644 index 85f4f084589bb7ac4e68b25f5761191a3bdcfdd3..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_irq.c +++ /dev/null @@ -1,357 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_irq.c - * Driver for Calypso IRQ controller - * - * (C) 2010 by Harald Welte - * (C) 2011 by Stefan Richter - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 - -#include -#include - -#include -#include - -#include -#include - -#include "arm.h" -#include "up_internal.h" -#include "up_arch.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define BASE_ADDR_IRQ 0xfffffa00 -#define BASE_ADDR_IBOOT_EXC 0x0080001C - -enum irq_reg -{ - IT_REG1 = 0x00, - IT_REG2 = 0x02, - MASK_IT_REG1 = 0x08, - MASK_IT_REG2 = 0x0a, - IRQ_NUM = 0x10, - FIQ_NUM = 0x12, - IRQ_CTRL = 0x14, -}; - -#define ILR_IRQ(x) (0x20 + (x*2)) -#define IRQ_REG(x) (BASE_ADDR_IRQ + (x)) - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* g_current_regs[] holds a references to the current interrupt level - * register storage structure. If is non-NULL only during interrupt - * processing. Access to g_current_regs[] must be through the macro - * CURRENT_REGS for portability. - */ - -volatile uint32_t *g_current_regs[1]; -extern uint32_t _exceptions; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static uint8_t default_irq_prio[] = -{ - [IRQ_WATCHDOG] = 0xff, - [IRQ_TIMER1] = 0xff, - [IRQ_TIMER2] = 0xff, - [IRQ_TSP_RX] = 0, - [IRQ_TPU_FRAME] = 3, - [IRQ_TPU_PAGE] = 0xff, - [IRQ_SIMCARD] = 0xff, - [IRQ_UART_MODEM] = 8, - [IRQ_KEYPAD_GPIO] = 4, - [IRQ_RTC_TIMER] = 9, - [IRQ_RTC_ALARM_I2C] = 10, - [IRQ_ULPD_GAUGING] = 2, - [IRQ_EXTERNAL] = 12, - [IRQ_SPI] = 0xff, - [IRQ_DMA] = 0xff, - [IRQ_API] = 0xff, - [IRQ_SIM_DETECT] = 0, - [IRQ_EXTERNAL_FIQ] = 7, - [IRQ_UART_IRDA] = 2, - [IRQ_ULPD_GSM_TIMER] = 1, - [IRQ_GEA] = 0xff, -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -static void _irq_enable(enum irq_nr nr, int enable) -{ - uintptr_t reg = IRQ_REG(MASK_IT_REG1); - uint16_t val; - - if (nr > 15) - { - reg = IRQ_REG(MASK_IT_REG2); - nr -= 16; - } - - val = getreg16(reg); - if (enable) - { - val &= ~(1 << nr); - } - else - { - val |= (1 << nr); - } - - putreg16(val, reg); -} - -static void set_default_priorities(void) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(default_irq_prio); i++) - { - uint16_t val; - uint8_t prio = default_irq_prio[i]; - - if (prio > 31) - { - prio = 31; - } - - val = getreg16(IRQ_REG(ILR_IRQ(i))); - val &= ~(0x1f << 2); - val |= prio << 2; - - /* Make edge mode default. Hopefully causes less trouble */ - - val |= 0x02; - - putreg16(val, IRQ_REG(ILR_IRQ(i))); - } -} - -/* Install the exception handlers to where the ROM loader jumps */ - -static void calypso_exceptions_install(void) -{ - uint32_t *exceptions_dst = (uint32_t *) BASE_ADDR_IBOOT_EXC; - uint32_t *exceptions_src = &_exceptions; - int i; - - for (i = 0; i < 7; i++) - { - *exceptions_dst++ = *exceptions_src++; - } -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_irqinitialize - * - * Description: - * Setup the IRQ and FIQ controllers - * - ****************************************************************************/ - -void up_irqinitialize(void) -{ - /* Prepare hardware */ - - calypso_exceptions_install(); - CURRENT_REGS = NULL; - - /* Switch to internal ROM */ - - calypso_bootrom(1); - - /* Set default priorities */ - - set_default_priorities(); - - /* Mask all interrupts off */ - - putreg16(0xffff, IRQ_REG(MASK_IT_REG1)); - putreg16(0xffff, IRQ_REG(MASK_IT_REG2)); - - /* clear all pending interrupts */ - putreg16(0, IRQ_REG(IT_REG1)); - putreg16(0, IRQ_REG(IT_REG2)); - - /* Enable interrupts globally to the ARM core */ - -#ifndef CONFIG_SUPPRESS_INTERRUPTS - up_irq_restore(SVC_MODE | PSR_F_BIT); -#endif -} - -/**************************************************************************** - * Name: up_disable_irq - * - * Description: - * Disable the IRQ specified by 'irq' - * - ****************************************************************************/ - -void up_disable_irq(int irq) -{ - if ((unsigned)irq < NR_IRQS) - { - _irq_enable(irq, 0); - } -} - -/**************************************************************************** - * Name: up_enable_irq - * - * Description: - * Enable the IRQ specified by 'irq' - * - ****************************************************************************/ - -void up_enable_irq(int irq) -{ - if ((unsigned)irq < NR_IRQS) - { - _irq_enable(irq, 1); - } -} - -/**************************************************************************** - * Name: up_prioritize_irq - * - * Description: - * Set the priority of an IRQ. - * - ****************************************************************************/ - -#ifndef CONFIG_ARCH_IRQPRIO -int up_prioritize_irq(int nr, int prio) -{ - uint16_t val; - - if (prio == -1) - { - prio = default_irq_prio[nr]; - } - - if (prio > 31) - { - prio = 31; - } - - val = prio << 2; - putreg16(val, IRQ_REG(ILR_IRQ(nr))); - - return 0; -} -#endif - -/**************************************************************************** - * Entry point for interrupts - ****************************************************************************/ - -void up_decodeirq(uint32_t *regs) -{ - uint8_t num, tmp; - uint32_t *saved_regs; - - /* XXX: What is this??? - * Passed to but ignored in IRQ handlers - * Only valid meaning is apparently non-NULL == IRQ context */ - - saved_regs = (uint32_t *)CURRENT_REGS; - CURRENT_REGS = regs; - - /* Detect & deliver the IRQ */ - - num = getreg8(IRQ_REG(IRQ_NUM)) & 0x1f; - irq_dispatch(num, regs); - - /* Start new IRQ agreement */ - - tmp = getreg8(IRQ_REG(IRQ_CTRL)); - tmp |= 0x01; - putreg8(tmp, IRQ_REG(IRQ_CTRL)); - - CURRENT_REGS = saved_regs; -} - -/**************************************************************************** - * Entry point for FIQs - ****************************************************************************/ - -void calypso_fiq(void) -{ - uint8_t num, tmp; - uint32_t *regs; - - /* XXX: What is this??? - * Passed to but ignored in IRQ handlers - * Only valid meaning is apparently non-NULL == IRQ context */ - - regs = (uint32_t *)CURRENT_REGS; - CURRENT_REGS = (uint32_t *)# - - /* Detect & deliver like an IRQ but we are in FIQ context */ - - num = getreg8(IRQ_REG(FIQ_NUM)) & 0x1f; - irq_dispatch(num, regs); - - /* Start new FIQ agreement */ - - tmp = getreg8(IRQ_REG(IRQ_CTRL)); - tmp |= 0x02; - putreg8(tmp, IRQ_REG(IRQ_CTRL)); - - CURRENT_REGS = regs; -} diff --git a/arch/arm/src/calypso/calypso_keypad.c b/arch/arm/src/calypso/calypso_keypad.c deleted file mode 100644 index 1d9b11b98a7896e8bc6a440b0886d44122bc9e45..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_keypad.c +++ /dev/null @@ -1,385 +0,0 @@ -/**************************************************************************** - * Driver for Calypso keypad hardware - * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/**************************************************************************** - * HW access - ****************************************************************************/ - -#define BASE_ADDR_ARMIO 0xfffe4800 -#define ARMIO_REG(x) ((void *)BASE_ADDR_ARMIO + (x)) - -enum armio_reg -{ - LATCH_IN = 0x00, - LATCH_OUT = 0x02, - IO_CNTL = 0x04, - CNTL_REG = 0x06, - LOAD_TIM = 0x08, - KBR_LATCH_REG = 0x0a, - KBC_REG = 0x0c, - BUZZ_LIGHT_REG = 0x0e, - LIGHT_LEVEL = 0x10, - BUZZER_LEVEL = 0x12, - GPIO_EVENT_MODE = 0x14, - KBD_GPIO_INT = 0x16, - KBD_GPIO_MASKIT = 0x18, - GPIO_DEBOUNCING = 0x1a, - GPIO_LATCH = 0x1c, -}; - -#define KBD_INT (1 << 0) -#define GPIO_INT (1 << 1) - -/**************************************************************************** - * Decoder functions for matrix and power button - ****************************************************************************/ - -static int btn_dec(uint32_t * btn_state, uint8_t col, uint8_t reg, - char *buf, size_t buflen, size_t * len) -{ - uint8_t diff = (*btn_state ^ reg) & 0x1f; - - while (diff) - { - uint8_t val = diff & ~(diff - 1); - uint8_t sc = val >> 1; - sc |= sc << 2; - sc += col; - sc += (sc & 0x20) ? 0x26 : 0x3f; - - if (reg & val) - { - sc |= 0x20; - } - - /* Check for space in buffer and dispatch */ - - if (*len < buflen) - { - buf[(*len)++] = sc; - } - else - { - break; - } - - /* Only change diff if dispatched/buffer not full */ - - diff ^= val; - } - - /* Store new state of the buttons (but only if they where dispatch) */ - - *btn_state >>= 5; -#ifdef INCLUDE_ALL_COLS - *btn_state |= (reg ^ diff) << 20; -#else - *btn_state |= (reg ^ diff) << 15; -#endif - return diff; -} - -static int pwr_btn_dec(uint32_t * state, uint8_t reg, char *buf, size_t * len) -{ - if (reg) - { - /* Check for pressed power button. If pressed, ignore other - * buttons since it collides with an entire row. - */ - - if (~*state & 0x80000000) - { - buf[0] = 'z'; - *len = 1; - *state |= 0x80000000; - } - - return 1; /* break loop in caller */ - } - else - { - /* Check for released power button. */ - - if (*state & 0x80000000) - { - buf[0] = 'Z'; - *len = 1; - - *state &= 0x7fffffff; - - /* Don't scan others when released; might trigger - * false keystrokes otherwise - */ - - return 1; - } - } - - return 0; /* Continue with other columns */ -} - -/**************************************************************************** - * Keypad: Fileops Prototypes and Structures - ****************************************************************************/ - -typedef FAR struct file file_t; - -static int keypad_open(file_t * filep); -static int keypad_close(file_t * filep); -static ssize_t keypad_read(file_t * filep, FAR char *buffer, size_t buflen); -#ifndef CONFIG_DISABLE_POLL -static int keypad_poll(file_t * filep, FAR struct pollfd *fds, bool setup); -#endif - -static const struct file_operations keypad_ops = -{ - keypad_open, /* open */ - keypad_close, /* close */ - keypad_read, /* read */ - 0, /* write */ - 0, /* seek */ - 0, /* ioctl */ -#ifndef CONFIG_DISABLE_POLL - keypad_poll /* poll */ -#endif -}; - -static sem_t kbdsem; - -/**************************************************************************** - * Keypad: Fileops - ****************************************************************************/ - -static int keypad_open(file_t * filep) -{ - register uint16_t reg; - - /* Unmask keypad interrupt */ - - reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); - writew(reg & ~KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); - - return OK; -} - -static int keypad_close(file_t * filep) -{ - register uint16_t reg; - - /* Mask keypad interrupt */ - - reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); - writew(reg | KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); - - return OK; -} - -static ssize_t keypad_read(file_t * filep, FAR char *buf, size_t buflen) -{ - static uint32_t btn_state = 0; - register uint16_t reg; - uint16_t col, col_mask; - size_t len = 0; - - if (buf == NULL || buflen < 1) - { - /* Well... nothing to do */ - - return -EINVAL; - } - -retry: - col = 1; - col_mask = 0x1e; - - if (!btn_state) - { - /* Drive all cols low such that all buttons cause events */ - - writew(0, ARMIO_REG(KBC_REG)); - - /* No button currently pressed, use IRQ */ - - reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); - writew(reg & ~KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); - sem_wait(&kbdsem); - } - else - { - writew(0x1f, ARMIO_REG(KBC_REG)); - usleep(80000); - } - - /* Scan columns */ - -#ifdef INCLUDE_ALL_COLS - while (col <= 6) - { -#else - while (col <= 5) - { -#endif - /* Read keypad latch and immediately set new column since - * synchronization takes about 5usec. For the 1st round, the - * interrupt has prepared this and the context switch takes - * long enough to serve as a delay. - */ - - reg = readw(ARMIO_REG(KBR_LATCH_REG)); - writew(col_mask, ARMIO_REG(KBC_REG)); - - /* Turn pressed buttons into 1s */ - - reg = 0x1f & ~reg; - - if (col == 1) - { - /* Power/End switch */ - - if (pwr_btn_dec(&btn_state, reg, buf, &len)) - { - break; - } - } - else - { - /* Non-power switches */ - - if (btn_dec(&btn_state, col, reg, buf, buflen, &len)) - { - break; - } - } - - /* Select next column and respective mask */ - - col_mask = 0x1f & ~(1 << col++); - - /* We have to wait for synchronization of the inputs. The - * processing is too fast if no/few buttons are processed. - */ - - usleep(5); - - /* XXX: usleep seems to suffer hugh overhead. Better this!? - * If nothing else can be done, it's overhead still wastes - * time 'usefully'. - */ - /* sched_yield(); up_udelay(2); */ - } - - /* If we don't have anything to return, retry to avoid EOF */ - - if (!len) - { - goto retry; - } - - return len; -} - -/**************************************************************************** - * Keypad interrupt handler - * mask interrupts - * prepare column drivers for scan - * posts keypad semaphore - ****************************************************************************/ - -int calypso_kbd_irq(int irq, uint32_t * regs) -{ - register uint16_t reg; - - /* Mask keypad interrupt */ - - reg = readw(ARMIO_REG(KBD_GPIO_MASKIT)); - writew(reg | KBD_INT, ARMIO_REG(KBD_GPIO_MASKIT)); - - /* Turn off column drivers */ - - writew(0x1f, ARMIO_REG(KBC_REG)); - - /* Let the userspace know */ - - sem_post(&kbdsem); - - return 0; -} - -/**************************************************************************** - * Initialize device, add /dev/... nodes - ****************************************************************************/ - -void up_keypad(void) -{ - /* kbssem semaphore helps leaving IRQ ctx as soon as possible. This - * semaphore is used for signaling and, hence, should not have priority - * inheritance enabled. - */ - - sem_init(&kbdsem, 0, 0); - sem_setprotocol(&kbdsem, SEM_PRIO_NONE); - - /* Drive cols low in idle state such that all buttons cause events */ - - writew(0, ARMIO_REG(KBC_REG)); - - (void)register_driver("/dev/keypad", &keypad_ops, 0444, NULL); -} - -int keypad_kbdinit(void) -{ - calypso_armio(); - up_keypad(); - - return OK; -} diff --git a/arch/arm/src/calypso/calypso_power.c b/arch/arm/src/calypso/calypso_power.c deleted file mode 100644 index 11b51a629bf63315435e70725a0df8bd4f47ed56..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_power.c +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include -#include - -#include "calypso_spi.h" - -/**************************************************************************** - * Name: board_power_off - * - * Description: - * Power off the board. - * - * If this function returns, then it was not possible to power-off the - * board due to some other constraints. - * - * Input Parameters: - * status - Status information provided with the power off event. - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -#ifdef CONFIG_BOARDCTL_POWEROFF -int board_power_off(int status) -{ - struct spi_dev_s *spi = calypso_spibus_initialize(0); - uint16_t tx; - - SPI_SETBITS(spi, 16); - (void)SPI_HWFEATURES(spi, 0); - - tx = (1 << 6) | (1 << 1); - SPI_SNDBLOCK(spi, &tx, 1); - - tx = (1 << 6) | (30 << 1); - SPI_SNDBLOCK(spi, &tx, 1); - - return 0; -} -#endif diff --git a/arch/arm/src/calypso/calypso_serial.c b/arch/arm/src/calypso/calypso_serial.c deleted file mode 100644 index 0c4a44c0c14d90c08489ed35ac9e388a12c10aab..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_serial.c +++ /dev/null @@ -1,968 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_serial.c - * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter - * - * based on c5471/c5471_serial.c - * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "chip.h" -#include "up_arch.h" -#include "up_internal.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define BASE_BAUD 115200 - -#if defined(CONFIG_UART_IRDA_HWFLOWCONTROL) || defined(CONFIG_UART_MODEM_HWFLOWCONTROL) -# define CONFIG_UART_HWFLOWCONTROL -#endif - -#if UART_FCR_OFFS == UART_EFR_OFFS -# define UART_MULTIPLEX_REGS - -/* HW flow control not supported yet */ - -# undef CONFIG_UART_HWFLOWCONTROL -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct uart_regs_s -{ - uint32_t ier; - uint32_t lcr; - uint32_t fcr; -#ifdef CONFIG_UART_HWFLOWCONTROL - uint32_t efr; - uint32_t tcr; -#endif -}; - -struct up_dev_s -{ - unsigned int uartbase; /* Base address of UART registers */ - unsigned int baud_base; /* Base baud for conversions */ - unsigned int baud; /* Configured baud */ - uint8_t xmit_fifo_size; /* Size of transmit FIFO */ - uint8_t irq; /* IRQ associated with this UART */ - uint8_t parity; /* 0=none, 1=odd, 2=even */ - uint8_t bits; /* Number of bits (7 or 8) */ -#ifdef CONFIG_UART_HWFLOWCONTROL - bool flowcontrol; /* true: Hardware flow control - * is enabled. */ -#endif - bool stopbits2; /* true: Configure with 2 - * stop bits instead of 1 */ - struct uart_regs_s regs; /* Shadow copy of readonly regs */ - -#ifdef CONFIG_SERCOMM_CONSOLE - bool sercomm; /* Call sercomm in interrupt if true */ -#endif -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static int up_interrupt(int irq, void *context); -static int up_ioctl(struct file *filep, int cmd, unsigned long arg); -static int up_receive(struct uart_dev_s *dev, unsigned int *status); -static void up_rxint(struct uart_dev_s *dev, bool enable); -static bool up_rxavailable(struct uart_dev_s *dev); -static void up_send(struct uart_dev_s *dev, int ch); -static void up_txint(struct uart_dev_s *dev, bool enable); -static bool up_txready(struct uart_dev_s *dev); -static bool up_txempty(struct uart_dev_s *dev); - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static const struct uart_ops_s g_uart_ops = -{ - .setup = up_setup, - .shutdown = up_shutdown, - .attach = up_attach, - .detach = up_detach, - .ioctl = up_ioctl, - .receive = up_receive, - .rxint = up_rxint, - .rxavailable = up_rxavailable, -#ifdef CONFIG_SERIAL_IFLOWCONTROL - .rxflowcontrol = NULL, -#endif - .send = up_send, - .txint = up_txint, - .txready = up_txready, - .txempty = up_txempty, -}; - -/* I/O buffers */ - -static char g_irdarxbuffer[CONFIG_UART_IRDA_RXBUFSIZE]; -static char g_irdatxbuffer[CONFIG_UART_IRDA_TXBUFSIZE]; -static char g_modemrxbuffer[CONFIG_UART_MODEM_RXBUFSIZE]; -static char g_modemtxbuffer[CONFIG_UART_MODEM_TXBUFSIZE]; - -/* This describes the state of the C5471 serial IRDA port. */ - -static struct up_dev_s g_irdapriv = -{ - .xmit_fifo_size = UART_IRDA_XMIT_FIFO_SIZE, - .baud_base = BASE_BAUD, - .uartbase = UART_IRDA_BASE, - .baud = CONFIG_UART_IRDA_BAUD, - .irq = UART_IRQ_IRDA, - .parity = CONFIG_UART_IRDA_PARITY, - .bits = CONFIG_UART_IRDA_BITS, -#ifdef CONFIG_UART_IRDA_HWFLOWCONTROL - .flowcontrol = true, -#endif - .stopbits2 = CONFIG_UART_IRDA_2STOP, - -#ifdef CONFIG_SERCOMM_CONSOLE - .sercomm = false, -#endif -}; - -static uart_dev_t g_irdaport = -{ - .recv = - { - .size = CONFIG_UART_IRDA_RXBUFSIZE, - .buffer = g_irdarxbuffer, - }, - .xmit = - { - .size = CONFIG_UART_IRDA_TXBUFSIZE, - .buffer = g_irdatxbuffer, - }, - .ops = &g_uart_ops, - .priv = &g_irdapriv, -}; - -/* This describes the state of the C5471 serial Modem port. */ - -static struct up_dev_s g_modempriv = -{ - .xmit_fifo_size = UART_XMIT_FIFO_SIZE, - .baud_base = BASE_BAUD, - .uartbase = UART_MODEM_BASE, - .baud = CONFIG_UART_MODEM_BAUD, - .irq = UART_IRQ_MODEM, - .parity = CONFIG_UART_MODEM_PARITY, - .bits = CONFIG_UART_MODEM_BITS, -#ifdef CONFIG_UART_MODEM_HWFLOWCONTROL - .flowcontrol = true, -#endif - .stopbits2 = CONFIG_UART_MODEM_2STOP, - -#ifdef CONFIG_SERCOMM_CONSOLE - .sercomm = false, -#endif -}; - -static uart_dev_t g_modemport = -{ - .recv = - { - .size = CONFIG_UART_MODEM_RXBUFSIZE, - .buffer = g_modemrxbuffer, - }, - .xmit = - { - .size = CONFIG_UART_MODEM_TXBUFSIZE, - .buffer = g_modemtxbuffer, - }, - .ops = &g_uart_ops, - .priv = &g_modempriv, -}; - -/* Now, which one with be tty0/console and which tty1? */ - -#ifdef CONFIG_SERIAL_IRDA_CONSOLE -# define CONSOLE_DEV g_irdaport -# define TTYS0_DEV g_irdaport -# define TTYS1_DEV g_modemport -#else -# define CONSOLE_DEV g_modemport -# define TTYS0_DEV g_modemport -# define TTYS1_DEV g_irdaport -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_inserial - ****************************************************************************/ - -static inline uint32_t up_inserial(struct up_dev_s *priv, uint32_t offset) -{ -#if UART_REGISTER_BITS == 8 - return getreg8(priv->uartbase + offset); -#elif UART_REGISTER_BITS == 32 - return getreg32(priv->uartbase + offset); -#else -#error Unsupported number of bits set in UART_REGISTER_BITS -#endif -} - -/**************************************************************************** - * Name: up_serialout - ****************************************************************************/ - -static inline void up_serialout(struct up_dev_s *priv, uint32_t offset, uint32_t value) -{ -#if UART_REGISTER_BITS == 8 - putreg8(value & 0xff, priv->uartbase + offset); -#elif UART_REGISTER_BITS == 32 - putreg32(value, priv->uartbase + offset); -#endif -} - -/**************************************************************************** - * Name: up_disableuartint - ****************************************************************************/ - -static inline void up_disableuartint(struct up_dev_s *priv, uint16_t *ier) -{ - if (ier) - { - *ier = priv->regs.ier & UART_IER_INTMASK; - } - priv->regs.ier &= ~UART_IER_INTMASK; - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); -} - -/**************************************************************************** - * Name: up_restoreuartint - ****************************************************************************/ - -static inline void up_restoreuartint(struct up_dev_s *priv, uint16_t ier) -{ - priv->regs.ier |= ier & (UART_IER_RECVINT | UART_IER_XMITINT); - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); -} - -/**************************************************************************** - * Name: up_waittxready - ****************************************************************************/ - -static inline void up_waittxready(struct up_dev_s *priv) -{ - int tmp; - - for (tmp = 1000 ; tmp > 0 ; tmp--) - { - if ((up_inserial(priv, UART_SSR_OFFS) & UART_SSR_TXFULL) == 0) - { - break; - } - } -} -/**************************************************************************** - * Name: up_disablebreaks - ****************************************************************************/ - -static inline void up_disablebreaks(struct up_dev_s *priv) -{ - priv->regs.lcr &= ~UART_LCR_BOC; - up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr); -} - -/**************************************************************************** - * Name: up_enablebreaks - ****************************************************************************/ - -static inline void up_enablebreaks(struct up_dev_s *priv) -{ - priv->regs.lcr |= UART_LCR_BOC; - up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr); -} - -/**************************************************************************** - * Name: up_setrate - ****************************************************************************/ - -static inline void up_setrate(struct up_dev_s *priv, unsigned int rate) -{ - uint32_t div_bit_rate; - - switch (rate) - { - case 115200: - div_bit_rate = BAUD_115200; - break; - case 57600: - div_bit_rate = BAUD_57600; - break; - case 38400: - div_bit_rate = BAUD_38400; - break; - case 19200: - div_bit_rate = BAUD_19200; - break; - case 4800: - div_bit_rate = BAUD_4800; - break; - case 2400: - div_bit_rate = BAUD_2400; - break; - case 1200: - div_bit_rate = BAUD_1200; - break; - case 9600: - default: - div_bit_rate = BAUD_9600; - break; - } - -#ifdef UART_DIV_BIT_RATE_OFFS - up_serialout(priv, UART_DIV_BIT_RATE_OFFS, div_bit_rate); -#else - up_serialout(priv, UART_DIV_LOW_OFFS, div_bit_rate); - up_serialout(priv, UART_DIV_HIGH_OFFS, div_bit_rate >> 8); -#endif -} - -/**************************************************************************** - * Name: up_setup - * - * Description: - * Configure the UART baud, bits, parity, fifos, etc. This - * method is called the first time that the serial port is - * opened. - * - ****************************************************************************/ -#include -static int up_setup(struct uart_dev_s *dev) -{ -#ifndef CONFIG_SUPPRESS_UART_CONFIG - struct up_dev_s *priv = dev->priv; - unsigned int cval; - - if (priv->bits == 7) - { - cval = UART_LCR_7BITS; - } - else - { - cval = UART_LCR_8BITS; - } - - if (priv->stopbits2) - { - cval |= UART_LCR_2STOP; - } - - if (priv->parity == 1) /* Odd parity */ - { - cval |= (UART_LCR_PAREN | UART_LCR_PARODD); - } - else if (priv->parity == 2) /* Even parity */ - { - cval |= (UART_LCR_PAREN | UART_LCR_PAREVEN); - } - - /* Both the IrDA and MODEM UARTs support RESET and UART mode. */ - - up_serialout(priv, UART_MDR_OFFS, MDR_RESET_MODE); - up_serialout(priv, UART_LCR_OFFS, 0xbf); - up_serialout(priv, UART_XON1_OFFS, 0x00); - up_serialout(priv, UART_XON2_OFFS, 0x00); - up_serialout(priv, UART_XOFF1_OFFS, 0x00); - up_serialout(priv, UART_XOFF2_OFFS, 0x00); - up_serialout(priv, UART_EFR_OFFS, 0x00); - up_serialout(priv, UART_LCR_OFFS, 0x00); - up_mdelay(5); - - up_serialout(priv, UART_MDR_OFFS, MDR_UART_MODE); - up_mdelay(5); - - priv->regs.ier = up_inserial(priv, UART_IER_OFFS); - priv->regs.lcr = up_inserial(priv, UART_LCR_OFFS); -#ifdef CONFIG_UART_HWFLOWCONTROL - if (priv->flowcontrol) - { - priv->regs.efr = up_inserial(priv, UART_EFR_OFFS); - priv->regs.tcr = up_inserial(priv, UART_TCR_OFFS); - } -#endif - - up_disableuartint(priv, NULL); - -#ifdef UART_MULTIPLEX_REGS - up_serialout(priv, UART_LCR_OFFS, 0x00bf); -#endif - - up_serialout(priv, UART_EFR_OFFS, 0x0010); /* Unprotect enhanced control */ - -#ifdef UART_MULTIPLEX_REGS - priv->regs.lcr = 0x80; - up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr); - //up_serialout(priv, UART_MCR_OFFS, 1 << 4); /* loopback */ -#endif - - up_serialout(priv, UART_TFCR_OFFS, 0); /* Reset to 0 */ - up_serialout(priv, UART_RFCR_OFFS, UART_FCR_RX_CLR); /* Clear RX fifo */ - up_serialout(priv, UART_TFCR_OFFS, UART_FCR_TX_CLR); /* Clear TX fifo */ - priv->regs.fcr = UART_FCR_FIFO_EN; - up_serialout(priv, UART_TFCR_OFFS, priv->regs.fcr); /* Enable RX/TX fifos */ - - up_disablebreaks(priv); - - /* Set the RX and TX trigger levels to the minimum */ - - priv->regs.fcr = (priv->regs.fcr & 0xffffff0f) | UART_FCR_FTL; - up_serialout(priv, UART_RFCR_OFFS, priv->regs.fcr); - - up_setrate(priv, priv->baud); - -#ifdef UART_MULTIPLEX_REGS - up_serialout(priv, UART_SCR_OFFS, 1); /* Disable DMA */ - priv->regs.lcr = (uint32_t)cval; /* Configure mode, return to THR/RHR */ -#else - priv->regs.lcr &= 0xffffffe0; /* clear original field, and... */ - priv->regs.lcr |= (uint32_t)cval; /* Set new bits in that field. */ -#endif - up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr); - -#ifdef CONFIG_UART_HWFLOWCONTROL - if (priv->flowcontrol) - { - /* Set the FIFO level triggers for flow control - * Halt = 48 bytes, resume = 12 bytes - */ - - priv->regs.tcr = (priv->regs.tcr & 0xffffff00) | 0x0000003c; - up_serialout(priv, UART_TCR_OFFS, priv->regs.tcr); - - /* Enable RTS/CTS flow control */ - - priv->regs.efr |= 0x000000c0; - up_serialout(priv, UART_EFR_OFFS, priv->regs.efr); - } - else - { - /* Disable RTS/CTS flow control */ - - priv->regs.efr &= 0xffffff3f; - up_serialout(priv, UART_EFR_OFFS, priv->regs.efr); - } -#endif -#endif - return OK; -} - -/**************************************************************************** - * Name: up_shutdown - * - * Description: - * Disable the UART. This method is called when the serial port is closed - * - ****************************************************************************/ - -static void up_shutdown(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; - up_disableuartint(priv, NULL); -} - -/**************************************************************************** - * Name: up_attach - * - * Description: - * Configure the UART to operation in interrupt driven mode. This method is - * called when the serial port is opened. Normally, this is just after the - * the setup() method is called, however, the serial console may operate in - * a non-interrupt driven mode during the boot phase. - * - * RX and TX interrupts are not enabled when by the attach method (unless the - * hardware supports multiple levels of interrupt enabling). The RX and TX - * interrupts are not enabled until the txint() and rxint() methods are called. - * - ****************************************************************************/ - -static int up_attach(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - int ret; - - /* Attach and enable the IRQ */ - - ret = irq_attach(priv->irq, up_interrupt); - if (ret == OK) - { - /* Enable the interrupt (RX and TX interrupts are still disabled - * in the UART - */ - - up_enable_irq(priv->irq); - } - - return ret; -} - -/**************************************************************************** - * Name: up_detach - * - * Description: - * Detach UART interrupts. This method is called when the serial port is - * closed normally just before the shutdown method is called. The exception is - * the serial console which is never shutdown. - * - ****************************************************************************/ - -static void up_detach(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - up_disable_irq(priv->irq); - irq_detach(priv->irq); -} - -/**************************************************************************** - * Name: up_interrupt - * - * Description: - * This is the UART interrupt handler. It will be invoked - * when an interrupt received on the 'irq' It should call - * uart_transmitchars or uart_receivechar to perform the - * appropriate data transfers. The interrupt handling logic\ - * must be able to map the 'irq' number into the approprite - * uart_dev_s structure in order to call these functions. - * - ****************************************************************************/ - -static int up_interrupt(int irq, void *context) -{ - struct uart_dev_s *dev = NULL; - struct up_dev_s *priv; - volatile uint32_t cause; - - if (g_irdapriv.irq == irq) - { - dev = &g_irdaport; - } - else if (g_modempriv.irq == irq) - { - dev = &g_modemport; - } - else - { - PANIC(); - } - priv = (struct up_dev_s *)dev->priv; - - cause = up_inserial(priv, UART_ISR_OFFS) & 0x0000003f; - - if ((cause & 0x0000000c) == 0x0000000c) - { - uint32_t ier_val = 0; - - /* Is this an interrupt from the IrDA UART? */ - - if (irq == UART_IRQ_IRDA) - { - /* Save the currently enabled IrDA UART interrupts - * so that we can restore the IrDA interrupt state - * below. - */ - - ier_val = up_inserial(priv, UART_IER_OFFS); - - /* Then disable all IrDA UART interrupts */ - - up_serialout(priv, UART_IER_OFFS, 0); - } - - /* Receive characters from the RX fifo */ - -#ifdef CONFIG_SERCOMM_CONSOLE - if (priv->sercomm) - { - sercomm_recvchars(dev); - } - else -#endif - { - uart_recvchars(dev); - } - - /* read UART_RHR to clear int condition - * toss = up_inserialchar(priv,&status); - */ - - /* Is this an interrupt from the IrDA UART? */ - - if (irq == UART_IRQ_IRDA) - { - /* Restore the IrDA UART interrupt enables */ - - up_serialout(priv, UART_IER_OFFS, ier_val); - } - } - else if ((cause & 0x0000000c) == 0x00000004) - { -#ifdef CONFIG_SERCOMM_CONSOLE - if (priv->sercomm) - { - sercomm_recvchars(dev); - } - else -#endif - { - uart_recvchars(dev); - } - } - - if ((cause & 0x00000002) != 0) - { -#ifdef CONFIG_SERCOMM_CONSOLE - if (priv->sercomm) - { - sercomm_xmitchars(dev); - } - else -#endif - { - uart_xmitchars(dev); - } - } - - return OK; -} - -/**************************************************************************** - * Name: up_ioctl - * - * Description: - * All ioctl calls will be routed through this method - * - ****************************************************************************/ - -static int up_ioctl(struct file *filep, int cmd, unsigned long arg) -{ - struct inode *inode = filep->f_inode; - struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - int ret = OK; - - switch (cmd) - { -#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT - case TIOCSERGSTRUCT: - { - struct up_dev_s *user = (struct up_dev_s *)arg; - if (!user) - { - ret = -EINVAL; - } - else - { - memcpy(user, dev, sizeof(struct up_dev_s)); - } - } - break; -#endif - - case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ - { - irqstate_t flags = enter_critical_section(); - up_enablebreaks(priv); - leave_critical_section(flags); - } - break; - - case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */ - { - irqstate_t flags; - flags = enter_critical_section(); - up_disablebreaks(priv); - leave_critical_section(flags); - } - break; - - default: - ret = -ENOTTY; - break; - } - - return ret; -} - -/**************************************************************************** - * Name: up_receive - * - * Description: - * Called (usually) from the interrupt level to receive one character from - * the UART. Error bits associated with the receipt are provided in the - * the return 'status'. - * - ****************************************************************************/ - -static int up_receive(struct uart_dev_s *dev, unsigned int *status) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - uint32_t rhr; - uint32_t lsr; - - /* Construct a 16bit status word that uses the high byte to - * hold the status bits associated with framing,parity,break - * and a low byte that holds error bits of LSR for - * conditions such as overflow, etc. - */ - - rhr = up_inserial(priv, UART_RHR_OFFS); - lsr = up_inserial(priv, UART_LSR_OFFS); - - *status = (unsigned int)((rhr & 0x0000ff00) | (lsr & 0x000000ff)); - - return rhr & 0x000000ff; -} - -/**************************************************************************** - * Name: up_rxint - * - * Description: - * Call to enable or disable RX interrupts - * - ****************************************************************************/ - -static void up_rxint(struct uart_dev_s *dev, bool enable) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - if (enable) - { -#ifndef CONFIG_SUPPRESS_SERIAL_INTS - priv->regs.ier |= UART_IER_RECVINT; - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); -#endif - } - else - { - priv->regs.ier &= ~UART_IER_RECVINT; - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); - } -} - -/**************************************************************************** - * Name: up_rxavailable - * - * Description: - * Return true if the receive fifo is not empty - * - ****************************************************************************/ - -static bool up_rxavailable(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - return up_inserial(priv, UART_LSR_OFFS) & UART_RX_FIFO_NOEMPTY; -} - -/**************************************************************************** - * Name: up_send - * - * Description: - * This method will send one byte on the UART - * - ****************************************************************************/ - -static void up_send(struct uart_dev_s *dev, int ch) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - up_serialout(priv, UART_THR_OFFS, (uint8_t)ch); -} - -/**************************************************************************** - * Name: up_txint - * - * Description: - * Call to enable or disable TX interrupts - * - ****************************************************************************/ - -static void up_txint(struct uart_dev_s *dev, bool enable) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - if (enable) - { -#ifndef CONFIG_SUPPRESS_SERIAL_INTS - priv->regs.ier |= UART_IER_XMITINT; - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); -#endif - } - else - { - priv->regs.ier &= ~UART_IER_XMITINT; - up_serialout(priv, UART_IER_OFFS, priv->regs.ier); - } -} - -/**************************************************************************** - * Name: up_txready - * - * Description: - * Return true if the tranmsit fifo is not full - * - ****************************************************************************/ - -static bool up_txready(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - return (up_inserial(priv, UART_SSR_OFFS) & UART_SSR_TXFULL) == 0; -} - -/**************************************************************************** - * Name: up_txempty - * - * Description: - * Return true if the transmit fifo is empty - * - ****************************************************************************/ - -static bool up_txempty(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - return (up_inserial(priv, UART_LSR_OFFS) & UART_LSR_TREF) != 0; -} - -/**************************************************************************** - * Public Funtions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_earlyserialinit - * - * Description: - * Performs the low level UART initialization early in - * debug so that the serial console will be available - * during bootup. This must be called before up_serialinit. - * - ****************************************************************************/ - -void up_earlyserialinit(void) -{ - up_disableuartint(TTYS0_DEV.priv, NULL); - up_disableuartint(TTYS1_DEV.priv, NULL); - - CONSOLE_DEV.isconsole = true; - up_setup(&CONSOLE_DEV); -} - -/**************************************************************************** - * Name: up_serialinit - * - * Description: - * Register serial console and serial ports. This assumes - * that up_earlyserialinit was called previously. - * - ****************************************************************************/ - -void up_serialinit(void) -{ -#ifdef CONFIG_SERCOMM_CONSOLE - ((struct up_dev_s *)TTYS0_DEV.priv)->sercomm = true; - (void)sercomm_register("/dev/console", &TTYS0_DEV); - (void)uart_register("/dev/ttyS0", &TTYS1_DEV); -#else - (void)uart_register("/dev/console", &CONSOLE_DEV); - (void)uart_register("/dev/ttyS0", &TTYS0_DEV); - (void)uart_register("/dev/ttyS1", &TTYS1_DEV); -#endif -} - -/**************************************************************************** - * Name: up_putc - * - * Description: - * Provide priority, low-level access to support OS debug - * writes - * - ****************************************************************************/ - -int up_putc(int ch) -{ - struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv; - uint16_t ier; - - up_disableuartint(priv, &ier); - up_waittxready(priv); - up_serialout(priv, UART_THR_OFFS, (uint8_t)ch); - - /* Check for LF */ - - if (ch == '\n') - { - /* Add CR */ - - up_waittxready(priv); - up_serialout(priv, UART_THR_OFFS, '\r'); - } - - up_waittxready(priv); - up_restoreuartint(priv, ier); - return ch; -} - diff --git a/arch/arm/src/calypso/calypso_spi.c b/arch/arm/src/calypso/calypso_spi.c deleted file mode 100644 index 36727927c43680dfb23f20f173a80efeb0b14822..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_spi.c +++ /dev/null @@ -1,314 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_spi.c - * SPI driver for TI Calypso - * - * Copyright (C) 2010 Harald Welte - * Copyright (C) 2011 Stefan Richter - * - * Part of this source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include - -#include "up_arch.h" -#include "calypso_spi.h" - -#warning "MOST OF SPI API IS INCOMPLETE! (Wrapper around Osmocom driver)" -extern void spi_init(void); -extern int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din); - -#ifndef CONFIG_SPI_EXCHANGE -#error "Calypso HW only supports exchange. Enable CONFIG_SPI_EXCHANGE!" -#endif - -struct calypso_spidev_s -{ - struct spi_dev_s spidev; /* External driver interface */ - int nbits; /* Number of transfered bits */ - sem_t exclsem; /* Supports mutually exclusive access */ -}; - -static int spi_lock(FAR struct spi_dev_s *dev, bool lock) -{ - struct calypso_spidev_s *priv = (struct calypso_spidev_s *)dev; - - if (lock) - { - /* Take the semaphore (perhaps waiting) */ - - while (sem_wait(&priv->exclsem) != 0) - { - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(errno == EINTR); - } - } - else - { - (void)sem_post(&priv->exclsem); - } - - return OK; -} - -/* STUBS! */ - -static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, - bool selected) -{ -} - -static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) -{ - return frequency; -} - -static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) -{ -} - -/* Osmocom wrapper */ - -static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) -{ - ((FAR struct calypso_spidev_s *)dev)->nbits = nbits; -} - -static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, - FAR void *rxbuffer, size_t nwords) -{ - FAR struct calypso_spidev_s *priv = (FAR struct calypso_spidev_s *)dev; - size_t i; - - for (i = 0; i < nwords; i++) - { - spi_xfer(0, priv->nbits, txbuffer + i, rxbuffer + i); - } -} - -static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) -{ - uint16_t buf = wd; - spi_exchange(dev, &buf, &buf, 1); - return buf; -} - -static const struct spi_ops_s g_spiops = -{ - .lock = spi_lock, - .select = spi_select, - .setfrequency = spi_setfrequency, - .setmode = spi_setmode, - .setbits = spi_setbits, -#ifdef CONFIG_SPI_HWFEATURES - .hwfeatures = 0, -#endif - .status = 0, -#ifdef CONFIG_SPI_CMDDATA - .cmddata = 0, -#endif - .send = spi_send, -#ifdef CONFIG_SPI_EXCHANGE - .exchange = spi_exchange, -#else - .sndblock = spi_sndblock, - .recvblock = spi_recvblock, -#endif - .registercallback = 0, -}; - -static struct calypso_spidev_s g_spidev = -{ - .spidev = { &g_spiops }, - .nbits = 0, - .exclsem = SEM_INITIALIZER(1) -}; - -void spi_init(void) -{ - putreg16(SPI_SET1_EN_CLK | SPI_SET1_WR_IRQ_DIS | SPI_SET1_RDWR_IRQ_DIS, - SPI_REG(REG_SET1)); - - putreg16(0x0001, SPI_REG(REG_SET2)); -} - -int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) -{ - uint8_t bytes_per_xfer; - uint8_t reg_status, reg_ctrl = 0; - uint32_t tmp; - - if (bitlen == 0) - { - return 0; - } - - if (bitlen > 32) - { - return -1; - } - - if (dev_idx > 4) - { - return -1; - } - - bytes_per_xfer = bitlen / 8; - if (bitlen % 8) - { - bytes_per_xfer ++; - } - - reg_ctrl |= (bitlen - 1) << SPI_CTRL_NB_SHIFT; - reg_ctrl |= (dev_idx & 0x7) << SPI_CTRL_AD_SHIFT; - - if (bitlen <= 8) - { - tmp = *(uint8_t *)dout; - tmp <<= 24 + (8-bitlen); /* align to MSB */ - } - else if (bitlen <= 16) - { - tmp = *(uint16_t *)dout; - tmp <<= 16 + (16-bitlen); /* align to MSB */ - } - else - { - tmp = *(uint32_t *)dout; - tmp <<= (32-bitlen); /* align to MSB */ - } - - spiinfo("spi_xfer(dev_idx=%u, bitlen=%u, data_out=0x%08x): ", - dev_idx, bitlen, tmp); - - /* fill transmit registers */ - - putreg16(tmp >> 16, SPI_REG(REG_TX_MSB)); - putreg16(tmp & 0xffff, SPI_REG(REG_TX_LSB)); - - /* initiate transfer */ - - if (din) - { - reg_ctrl |= SPI_CTRL_RDWR; - } - else - { - reg_ctrl |= SPI_CTRL_WR; - } - - putreg16(reg_ctrl, SPI_REG(REG_CTRL)); - spiinfo("reg_ctrl=0x%04x ", reg_ctrl); - - /* wait until the transfer is complete */ - - while (1) - { - reg_status = getreg16(SPI_REG(REG_STATUS)); - spiinfo("status=0x%04x ", reg_status); - if (din && (reg_status & SPI_STATUS_RE)) - { - break; - } - else if (reg_status & SPI_STATUS_WE) - { - break; - } - } - - /* FIXME: calibrate how much delay we really need (seven 13MHz cycles) */ - - usleep(1000); - - if (din) - { - tmp = getreg16(SPI_REG(REG_RX_MSB)) << 16; - tmp |= getreg16(SPI_REG(REG_RX_LSB)); - spiinfo("data_in=0x%08x ", tmp); - - if (bitlen <= 8) - { - *(uint8_t *)din = tmp & 0xff; - } - else if (bitlen <= 16) - { - *(uint16_t *)din = tmp & 0xffff; - } - else - { - *(uint32_t *)din = tmp; - } - } - - spiinfo("\n"); - - return 0; -} - -/**************************************************************************** - * Name: calypso_spibus_initialize - * - * Description: - * Initialize the selected SPI port - * - * Input Parameter: - * Port number (for hardware that has mutiple SPI interfaces) - * - * Returned Value: - * Valid SPI device structure reference on succcess; a NULL on failure - * - ****************************************************************************/ - -FAR struct spi_dev_s *calypso_spibus_initialize(int port) -{ - switch (port) - { - case 0: /* SPI master device */ - spi_init(); - return (FAR struct spi_dev_s *)&g_spidev; - - case 1: /* uWire device */ - return NULL; - - default: - return NULL; - } -} diff --git a/arch/arm/src/calypso/calypso_spi.h b/arch/arm/src/calypso/calypso_spi.h deleted file mode 100644 index 70ca2ad9d0a826788a96d1af5d70865b142801b3..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_spi.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H -#define ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define BASE_ADDR_SPI 0xfffe3000 -#define SPI_REG(n) (BASE_ADDR_SPI+(n)) - -#define SPI_SET1_EN_CLK (1 << 0) -#define SPI_SET1_WR_IRQ_DIS (1 << 4) -#define SPI_SET1_RDWR_IRQ_DIS (1 << 5) - -#define SPI_CTRL_RDWR (1 << 0) -#define SPI_CTRL_WR (1 << 1) -#define SPI_CTRL_NB_SHIFT 2 -#define SPI_CTRL_AD_SHIFT 7 - -#define SPI_STATUS_RE (1 << 0) /* Read End */ -#define SPI_STATUS_WE (1 << 1) /* Write End */ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -enum spi_regs -{ - REG_SET1 = 0x00, - REG_SET2 = 0x02, - REG_CTRL = 0x04, - REG_STATUS = 0x06, - REG_TX_LSB = 0x08, - REG_TX_MSB = 0x0a, - REG_RX_LSB = 0x0c, - REG_RX_MSB = 0x0e, -}; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: calypso_spibus_initialize - * - * Description: - * Initialize the selected SPI port - * - * Input Parameter: - * Port number (for hardware that has mutiple SPI interfaces) - * - * Returned Value: - * Valid SPI device structure reference on succcess; a NULL on failure - * - ****************************************************************************/ - -FAR struct spi_dev_s *calypso_spibus_initialize(int port); - -#endif /* ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H */ diff --git a/arch/arm/src/calypso/calypso_timer.c b/arch/arm/src/calypso/calypso_timer.c deleted file mode 100644 index 86626c5de64944b6b6c854b9445965517e0e4c95..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_timer.c +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_timer.c - * Calypso DBB internal Timer Driver - * - * (C) 2010 by Harald Welte - * (C) 2011 by Stefan Richter - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include - -#include -#include -#include - -#include "up_arch.h" - -#define BASE_ADDR_TIMER 0xfffe3800 -#define TIMER2_OFFSET 0x3000 - -#define TIMER_REG(n, m) (((n)-1) ? (BASE_ADDR_TIMER + TIMER2_OFFSET + (m)) : (BASE_ADDR_TIMER + (m))) - -enum timer_reg -{ - CNTL_TIMER = 0x00, - LOAD_TIMER = 0x02, - READ_TIMER = 0x04, -}; - -enum timer_ctl -{ - CNTL_START = (1 << 0), - CNTL_AUTO_RELOAD = (1 << 1), - CNTL_CLOCK_ENABLE = (1 << 5), -}; - -/* Regular Timers (1 and 2) */ - -void hwtimer_enable(int num, int on) -{ - uint8_t ctl; - - if (num < 1 || num > 2) - { - printf("Unknown timer %d\n", num); - return; - } - - ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); - if (on) - { - ctl |= CNTL_START | CNTL_CLOCK_ENABLE; - } - else - { - ctl &= ~CNTL_START; - } - - putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); -} - -void hwtimer_config(int num, uint8_t pre_scale, int auto_reload) -{ - uint8_t ctl; - - ctl = (pre_scale & 0x7) << 2; - if (auto_reload) - ctl |= CNTL_AUTO_RELOAD; - - putreg8(ctl, TIMER_REG(num, CNTL_TIMER)); -} - -void hwtimer_load(int num, uint16_t val) -{ - putreg16(val, TIMER_REG(num, LOAD_TIMER)); -} - -uint16_t hwtimer_read(int num) -{ - uint8_t ctl = getreg8(TIMER_REG(num, CNTL_TIMER)); - - /* Somehow a read results in an abort */ - - if ((ctl & (CNTL_START | CNTL_CLOCK_ENABLE)) != (CNTL_START | CNTL_CLOCK_ENABLE)) - { - return 0xffff; - } - - return getreg16(TIMER_REG(num, READ_TIMER)); -} - -/**************************************************************************** - * Watchdog Timer - ****************************************************************************/ - -#define BASE_ADDR_WDOG 0xfffff800 -#define WDOG_REG(m) (BASE_ADDR_WDOG + m) - -enum wdog_reg -{ - WD_CNTL_TIMER = CNTL_TIMER, - WD_LOAD_TIMER = LOAD_TIMER, - WD_READ_TIMER = 0x02, - WD_MODE = 0x04, -}; - -enum wdog_ctl -{ - WD_CTL_START = (1 << 7), - WD_CTL_AUTO_RELOAD = (1 << 8) -}; - -enum wdog_mode -{ - WD_MODE_DIS_ARM = 0xF5, - WD_MODE_DIS_CONFIRM = 0xA0, - WD_MODE_ENABLE = (1 << 15) -}; - -#define WD_CTL_PRESCALE(value) (((value)&0x07) << 9) - -static void wdog_irq(__unused enum irq_nr nr) -{ - puts("=> WATCHDOG\n"); -} - -void wdog_enable(int on) -{ - if (!on) - { - putreg16(WD_MODE_DIS_ARM, WDOG_REG(WD_MODE)); - putreg16(WD_MODE_DIS_CONFIRM, WDOG_REG(WD_MODE)); - } -} - -void wdog_reset(void) -{ - /* Enable watchdog */ - - putreg16(WD_MODE_ENABLE, WDOG_REG(WD_MODE)); - - /* Force expiration */ - - putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); - putreg16(0x0000, WDOG_REG(WD_LOAD_TIMER)); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Function: up_timerisr - * - * Description: - * The timer ISR will perform a variety of services for - * various portions of the systems. - * - ****************************************************************************/ - -int up_timerisr(int irq, uint32_t *regs) -{ - /* Process timer interrupt */ - - sched_process_timer(); - return 0; -} - -/**************************************************************************** - * Function: up_timer_initialize - * - * Description: - * Setup Calypso HW timer 2 to cause system ticks. - * - * This function is called during start-up to initialize - * the timer interrupt. - * - ****************************************************************************/ - -void up_timer_initialize(void) -{ - up_disable_irq(IRQ_SYSTIMER); - - /* The timer runs at 13MHz / 32, i.e. 406.25kHz */ - /* 4062 ticks until expiry yields 100Hz interrupt */ - - hwtimer_load(2, 4062); - hwtimer_config(2, 0, 1); - hwtimer_enable(2, 1); - - /* Attach and enable the timer interrupt */ - - irq_attach(IRQ_SYSTIMER, (xcpt_t)up_timerisr); - up_enable_irq(IRQ_SYSTIMER); -} diff --git a/arch/arm/src/calypso/calypso_uwire.c b/arch/arm/src/calypso/calypso_uwire.c deleted file mode 100644 index fe2c33b7cc152392786c3e19cd7890b0c42b8c9f..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/calypso_uwire.c +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_uwire.c - * Driver for Calypso uWire Master Controller - * - * (C) 2010 by Sylvain Munaut - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 -#include -#include - -#include "up_arch.h" - -#define BASE_ADDR_UWIRE 0xfffe4000 -#define UWIRE_REG(n) (BASE_ADDR_UWIRE+(n)) - -enum uwire_regs -{ - REG_DATA = 0x00, - REG_CSR = 0x02, - REG_SR1 = 0x04, - REG_SR2 = 0x06, - REG_SR3 = 0x08, -}; - -#define UWIRE_CSR_BITS_RD(n) (((n) & 0x1f) << 0) -#define UWIRE_CSR_BITS_WR(n) (((n) & 0x1f) << 5) -#define UWIRE_CSR_IDX(n) (((n) & 3) << 10) -#define UWIRE_CSR_CS_CMD (1 << 12) -#define UWIRE_CSR_START (1 << 13) -#define UWIRE_CSR_CSRB (1 << 14) -#define UWIRE_CSR_RDRB (1 << 15) - -#define UWIRE_CSn_EDGE_RD (1 << 0) /* 1=falling 0=rising */ -#define UWIRE_CSn_EDGE_WR (1 << 1) /* 1=falling 0=rising */ -#define UWIRE_CSn_CS_LVL (1 << 2) -#define UWIRE_CSn_FRQ_DIV2 (0 << 3) -#define UWIRE_CSn_FRQ_DIV4 (1 << 3) -#define UWIRE_CSn_FRQ_DIV8 (2 << 3) -#define UWIRE_CSn_CKH - -#define UWIRE_CSn_SHIFT(n) (((n) & 1) ? 6 : 0) -#define UWIRE_CSn_REG(n) (((n) & 2) ? REG_SR2 : REG_SR1) - -#define UWIRE_SR3_CLK_EN (1 << 0) -#define UWIRE_SR3_CLK_DIV2 (0 << 1) -#define UWIRE_SR3_CLK_DIV4 (1 << 1) -#define UWIRE_SR3_CLK_DIV7 (2 << 1) -#define UWIRE_SR3_CLK_DIV10 (3 << 1) - -static inline void _uwire_wait(int mask, int val) -{ - while ((getreg16(UWIRE_REG(REG_CSR)) & mask) != val); -} - -void uwire_init(void) -{ - putreg16(UWIRE_SR3_CLK_EN | UWIRE_SR3_CLK_DIV2, UWIRE_REG(REG_SR3)); - - /* FIXME only init CS0 for now */ - - putreg16(((UWIRE_CSn_CS_LVL | UWIRE_CSn_FRQ_DIV2) << UWIRE_CSn_SHIFT(0)), - UWIRE_REG(UWIRE_CSn_REG(0))); - putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); -} - -int uwire_xfer(int cs, int bitlen, const void *dout, void *din) -{ - uint16_t tmp = 0; - - if (bitlen <= 0 || bitlen > 16) - return -1; - - if (cs < 0 || cs > 4) - return -1; - - /* FIXME uwire_init always selects CS0 for now */ - - _info("uwire_xfer(dev_idx=%u, bitlen=%u\n", cs, bitlen); - - /* select the chip */ - - putreg16(UWIRE_CSR_IDX(0) | UWIRE_CSR_CS_CMD, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); - - if (dout) - { - if (bitlen <= 8) - tmp = *(uint8_t *)dout; - else if (bitlen <= 16) - tmp = *(uint16_t *)dout; - - tmp <<= 16 - bitlen; /* align to MSB */ - putreg16(tmp, UWIRE_REG(REG_DATA)); - _info(", data_out=0x%04hx", tmp); - } - - tmp = (dout ? UWIRE_CSR_BITS_WR(bitlen) : 0) | - (din ? UWIRE_CSR_BITS_RD(bitlen) : 0) | - UWIRE_CSR_START; - putreg16(tmp, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); - - if (din) - { - _uwire_wait(UWIRE_CSR_RDRB, UWIRE_CSR_RDRB); - - tmp = getreg16(UWIRE_REG(REG_DATA)); - _info(", data_in=0x%08x", tmp); - - if (bitlen <= 8) - *(uint8_t *)din = tmp & 0xff; - else if (bitlen <= 16) - *(uint16_t *)din = tmp & 0xffff; - } - - /* unselect the chip */ - - putreg16(UWIRE_CSR_IDX(0) | 0, UWIRE_REG(REG_CSR)); - _uwire_wait(UWIRE_CSR_CSRB, 0); - - _info(")\n"); - - return 0; -} diff --git a/arch/arm/src/calypso/chip.h b/arch/arm/src/calypso/chip.h deleted file mode 100644 index bea381cc385a082fd86bb136b02e84aaa6b5615a..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/chip.h +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** - * calypso/chip.h - * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter - * - * based on: c5471/chip.h - * Copyright (C) 2007 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_ARM_SRC_CALYPSO_CHIP_H -#define __ARCH_ARM_SRC_CALYPSO_CHIP_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* UARTs ********************************************************************/ - -#define UART_IRDA_BASE 0xffff5000 -#define UART_MODEM_BASE 0xffff5800 -#define UART_UIR 0xffff6000 -#define UARTn_IO_RANGE 0x00000800 - -/* Common UART Registers. Expressed as offsets from the BASE address */ - -#define UART_RHR_OFFS 0x00000000 /* Rcv Holding Register */ -#define UART_THR_OFFS 0x00000000 /* Xmit Holding Register */ -#define UART_FCR_OFFS 0x00000002 /* FIFO Control Register */ -#define UART_RFCR_OFFS 0x00000002 /* Rcv FIFO Control Register */ -#define UART_TFCR_OFFS 0x00000002 /* Xmit FIFO Control Register */ -#define UART_SCR_OFFS 0x00000010 /* Status Control Register */ -#define UART_LCR_OFFS 0x00000003 /* Line Control Register */ -#define UART_LSR_OFFS 0x00000005 /* Line Status Register */ -#define UART_SSR_OFFS 0x00000011 /* Supplementary Status Register */ -#define UART_MCR_OFFS 0x00000004 /* Modem Control Register */ -#define UART_MSR_OFFS 0x00000006 /* Modem Status Register */ -#define UART_IER_OFFS 0x00000001 /* Interrupt Enable Register */ -#define UART_ISR_OFFS 0x00000002 /* Interrupt Status Register */ -#define UART_EFR_OFFS 0x00000002 /* Enhanced Feature Register */ -#define UART_XON1_OFFS 0x00000004 /* XON1 Character Register */ -#define UART_XON2_OFFS 0x00000005 /* XON2 Character Register */ -#define UART_XOFF1_OFFS 0x00000006 /* XOFF1 Character Register */ -#define UART_XOFF2_OFFS 0x00000007 /* XOFF2 Character Register */ -#define UART_SPR_OFFS 0x00000007 /* Scratch-pad Register */ -#define UART_DIV_LOW_OFFS 0x00000000 /* Divisor for baud generation */ -#define UART_DIV_HIGH_OFFS 0x00000001 -#define UART_TCR_OFFS 0x00000006 /* Transmission Control Register */ -#define UART_TLR_OFFS 0x00000007 /* Trigger Level Register */ -#define UART_MDR_OFFS 0x00000008 /* Mode Definition Register */ - -/* UART Settings ************************************************************/ - -/* Miscellaneous UART settings. */ - -#define UART_REGISTER_BITS 8 -#define UART_IRQ_MODEM IRQ_UART_MODEM -#define UART_IRQ_IRDA IRQ_UART_IRDA - -#define UART_RX_FIFO_NOEMPTY 0x00000001 -#define UART_SSR_TXFULL 0x00000001 -#define UART_LSR_TREF 0x00000020 - -#define UART_XMIT_FIFO_SIZE 64 -#define UART_IRDA_XMIT_FIFO_SIZE 64 - -/* UART_LCR Register */ - /* Bits 31-7: Reserved */ -#define UART_LCR_BOC 0x00000040 /* Bit 6: Break Control */ - /* Bit 5: Parity Type 2 */ -#define UART_LCR_PAREVEN 0x00000010 /* Bit 4: Parity Type 1 */ -#define UART_LCR_PARODD 0x00000000 -#define UART_LCR_PARMARK 0x00000010 -#define UART_LCR_PARSPACE 0x00000011 -#define UART_LCR_PAREN 0x00000008 /* Bit 3: Paity Enable */ -#define UART_LCR_PARDIS 0x00000000 -#define UART_LCR_2STOP 0x00000004 /* Bit 2: Number of stop bits */ -#define UART_LCR_1STOP 0x00000000 -#define UART_LCR_5BITS 0x00000000 /* Bits 0-1: Word-length */ -#define UART_LCR_6BITS 0x00000001 -#define UART_LCR_7BITS 0x00000002 -#define UART_LCR_8BITS 0x00000003 - -#define UART_FCR_FTL 0x000000f0 -#define UART_FCR_FIFO_EN 0x00000001 -#define UART_FCR_TX_CLR 0x00000002 -#define UART_FCR_RX_CLR 0x00000004 - -#define UART_IER_RECVINT 0x00000001 -#define UART_IER_XMITINT 0x00000002 -#define UART_IER_LINESTSINT 0x00000004 -#define UART_IER_MODEMSTSINT 0x00000008 /* IrDA UART only */ -#define UART_IER_XOFFINT 0x00000020 -#define UART_IER_RTSINT 0x00000040 /* IrDA UART only */ -#define UART_IER_CTSINT 0x00000080 /* IrDA UART only */ -#define UART_IER_INTMASK 0x000000ff - -#define BAUD_115200 0x00000007 -#define BAUD_57600 0x00000014 -#define BAUD_38400 0x00000021 -#define BAUD_19200 0x00000006 -#define BAUD_9600 0x0000000C -#define BAUD_4800 0x00000018 -#define BAUD_2400 0x00000030 -#define BAUD_1200 0x00000060 - -#define MDR_UART_MODE 0x00000000 /* Both IrDA and Modem UARTs */ -#define MDR_SIR_MODE 0x00000001 /* IrDA UART only */ -#define MDR_AUTOBAUDING_MODE 0x00000002 /* Modem UART only */ -#define MDR_RESET_MODE 0x00000007 /* Both IrDA and Modem UARTs */ - -/* SPI **********************************************************************/ - -#define MAX_SPI 3 - -#define SPI_REGISTER_BASE 0xffff2000 - -/* ARMIO ********************************************************************/ -/* Timers / Watchdog ********************************************************/ - -#define C5471_TIMER0_CTRL 0xffff2a00 -#define C5471_TIMER0_CNT 0xffff2a04 -#define C5471_TIMER1_CTRL 0xffff2b00 -#define C5471_TIMER1_CNT 0xffff2b04 -#define C5471_TIMER2_CTRL 0xffff2c00 -#define C5471_TIMER2_CNT 0xffff2c04 - -/* Interrupts ***************************************************************/ - -#define HAVE_SRC_IRQ_BIN_REG 0 - -#define INT_FIRST_IO 0xffff2d00 -#define INT_IO_RANGE 0x5C - -#define IT_REG 0xffff2d00 -#define MASK_IT_REG 0xffff2d04 -#define SRC_IRQ_REG 0xffff2d08 -#define SRC_FIQ_REG 0xffff2d0c -#define SRC_IRQ_BIN_REG 0xffff2d10 -#define INT_CTRL_REG 0xffff2d18 - -#define ILR_IRQ0_REG 0xffff2d1C /* 0-Timer 0 */ -#define ILR_IRQ1_REG 0xffff2d20 /* 1-Timer 1 */ -#define ILR_IRQ2_REG 0xffff2d24 /* 2-Timer 2 */ -#define ILR_IRQ3_REG 0xffff2d28 /* 3-GPIO0 */ -#define ILR_IRQ4_REG 0xffff2d2c /* 4-Ethernet */ -#define ILR_IRQ5_REG 0xffff2d30 /* 5-KBGPIO[7:0] */ -#define ILR_IRQ6_REG 0xffff2d34 /* 6-Uart serial */ -#define ILR_IRQ7_REG 0xffff2d38 /* 7-Uart IRDA */ -#define ILR_IRQ8_REG 0xffff2d3c /* 8-KBGPIO[15:8] */ -#define ILR_IRQ9_REG 0xffff2d40 /* 9-GPIO3 */ -#define ILR_IRQ10_REG 0xffff2d44 /* 10-GPIO2 */ -#define ILR_IRQ11_REG 0xffff2d48 /* 11-I2C */ -#define ILR_IRQ12_REG 0xffff2d4c /* 12-GPIO1 */ -#define ILR_IRQ13_REG 0xffff2d50 /* 13-SPI */ -#define ILR_IRQ14_REG 0xffff2d54 /* 14-GPIO[19:4] */ -#define ILR_IRQ15_REG 0xffff2d58 /* 15-API */ - -/* CLKM *********************************************************************/ - -#define CLKM 0xffff2f00 -#define CLKM_CTL_RST 0xffff2f10 -#define CLKM_RESET 0xffff2f18 - -#define CLKM_RESET_EIM 0x00000008 -#define CLKM_EIM_CLK_STOP 0x00000010 -#define CLKM_CTL_RST_LEAD_RESET 0x00000000 -#define CLKM_CTL_RST_EXT_RESET 0x00000002 - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#endif /* __ARCH_ARM_SRC_CALYPSO_CHIP_H */ diff --git a/arch/arm/src/calypso/clock.c b/arch/arm/src/calypso/clock.c deleted file mode 100644 index 29dc2f8273ad66a264a3eccac1ada2c809c5b1ac..0000000000000000000000000000000000000000 --- a/arch/arm/src/calypso/clock.c +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** - * arch/arm/src/calypso/clock.c - * Driver for Calypso clock management - * - * (C) 2010 by Harald Welte - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include - -#include -#include - -//#define DEBUG -#include - -#include -#include - -#include "up_arch.h" - -#define REG_DPLL 0xffff9800 -#define DPLL_LOCK (1 << 0) -#define DPLL_BREAKLN (1 << 1) -#define DPLL_BYPASS_DIV_SHIFT 2 /* 2 bits */ -#define DPLL_PLL_ENABLE (1 << 4) -#define DPLL_PLL_DIV_SHIFT 5 /* 2 bits */ -#define DPLL_PLL_MULT_SHIFT 7 /* 5 bits */ -#define DPLL_TEST (1 << 12) -#define DPLL_IOB (1 << 13) /* Initialize on break */ -#define DPLL_IAI (1 << 14) /* Initialize after Idle */ - -#define BASE_ADDR_CLKM 0xfffffd00 -#define CLKM_REG(m) (BASE_ADDR_CLKM+(m)) - -enum clkm_reg -{ - CNTL_ARM_CLK = 0, - CNTL_CLK = 2, - CNTL_RST = 4, - CNTL_ARM_DIV = 8, -}; - -/* CNTL_ARM_CLK */ - -#define ARM_CLK_BIG_SLEEP (1 << 0) /* MCU Master Clock enabled? */ -#define ARM_CLK_CLKIN_SEL0 (1 << 1) /* MCU source clock (0 = DPLL output, 1 = VTCXO or CLKIN */ -#define ARM_CLK_CLKIN_SEL (1 << 2) /* 0 = VTCXO or 1 = CLKIN */ -#define ARM_CLK_MCLK_DIV5 (1 << 3) /* enable 1.5 or 2.5 division factor */ -#define ARM_CLK_MCLK_DIV_SHIFT 4 /* 3 bits */ -#define ARM_CLK_DEEP_POWER_SHIFT 8 -#define ARM_CLK_DEEP_SLEEP 12 - -/* CNTL_CLK */ -#define CLK_IRQ_CLK_DIS (1 << 0) /* IRQ clock control (0 always, 1 according ARM_MCLK_EN) */ -#define CLK_BRIDGE_CLK_DIS (1 << 1) -#define CLK_TIMER_CLK_DIS (1 << 2) -#define CLK_DPLL_DIS (1 << 3) /* 0: DPLL is not stopped during SLEEP */ -#define CLK_CLKOUT_EN (1 << 4) /* Enable CLKOUT output pins */ -#define CLK_EN_IDLE3_FLG (1 << 5) /* DSP idle flag control (1 = - * SAM/HOM register forced to HOM when DSP IDLE3) */ -#define CLK_VCLKOUT_DIV2 (1 << 6) /* 1: VCLKOUT-FR is divided by 2 */ -#define CLK_VTCXO_DIV2 (1 << 7) /* 1: VTCXO is dividied by 2 */ - -#define BASE_ADDR_MEMIF 0xfffffb00 -#define MEMIF_REG(x) (BASE_ADDR_MEMIF+(x)) - -enum memif_reg -{ - API_RHEA_CTL = 0x0e, - EXTRA_CONF = 0x10, -}; - -static void dump_reg16(uint32_t addr, char *name) -{ - printf("%s=0x%04x\n", name, getreg16(addr)); -} - -void calypso_clk_dump(void) -{ - dump_reg16(REG_DPLL, "REG_DPLL"); - dump_reg16(CLKM_REG(CNTL_ARM_CLK), "CNTL_ARM_CLK"); - dump_reg16(CLKM_REG(CNTL_CLK), "CNTL_CLK"); - dump_reg16(CLKM_REG(CNTL_RST), "CNTL_RST"); - dump_reg16(CLKM_REG(CNTL_ARM_DIV), "CNTL_ARM_DIV"); -} - -void calypso_pll_set(uint16_t inp) -{ - uint8_t mult = inp >> 8; - uint8_t div = inp & 0xff; - uint16_t reg = getreg16(REG_DPLL); - - reg &= ~0x0fe0; - reg |= (div & 0x3) << DPLL_PLL_DIV_SHIFT; - reg |= (mult & 0x1f) << DPLL_PLL_MULT_SHIFT; - reg |= DPLL_PLL_ENABLE; - - putreg16(reg, REG_DPLL); -} - -void calypso_reset_set(enum calypso_rst calypso_rst, int active) -{ - uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); - - if (active) - reg |= calypso_rst; - else - reg &= ~calypso_rst; - - putreg8(reg, CLKM_REG(CNTL_RST)); -} - -int calypso_reset_get(enum calypso_rst calypso_rst) -{ - uint8_t reg = getreg8(CLKM_REG(CNTL_RST)); - - if (reg & calypso_rst) - return 1; - else - return 0; -} - -void calypso_clock_set(uint8_t vtcxo_div2, uint16_t inp, enum mclk_div mclk_div) -{ - uint16_t cntl_clock = getreg16(CLKM_REG(CNTL_CLK)); - uint16_t cntl_arm_clk = getreg16(CLKM_REG(CNTL_ARM_CLK)); - - /* First set the vtcxo_div2 */ - - cntl_clock &= ~CLK_VCLKOUT_DIV2; - if (vtcxo_div2) - cntl_clock |= CLK_VTCXO_DIV2; - else - cntl_clock &= ~CLK_VTCXO_DIV2; - - putreg16(cntl_clock, CLKM_REG(CNTL_CLK)); - - /* Then configure the MCLK divider */ - - cntl_arm_clk &= ~ARM_CLK_CLKIN_SEL0; - if (mclk_div & 0x80) - { - mclk_div &= ~0x80; - cntl_arm_clk |= ARM_CLK_MCLK_DIV5; - } - else - cntl_arm_clk &= ~ARM_CLK_MCLK_DIV5; - - cntl_arm_clk &= ~(0x7 << ARM_CLK_MCLK_DIV_SHIFT); - cntl_arm_clk |= (mclk_div << ARM_CLK_MCLK_DIV_SHIFT); - putreg16(cntl_arm_clk, CLKM_REG(CNTL_ARM_CLK)); - - /* Then finally set the PLL */ - - calypso_pll_set(inp); -} - -void calypso_mem_cfg(enum calypso_bank bank, uint8_t ws, - enum calypso_mem_width width, int we) -{ - putreg16((ws & 0x1f) | ((width & 3) << 5) | ((we & 1) << 7), - BASE_ADDR_MEMIF + bank); -} - -void calypso_bootrom(int enable) -{ - uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); - - conf |= (3 << 8); - - if (enable) - conf &= ~(1 << 9); - - putreg16(conf, MEMIF_REG(EXTRA_CONF)); -} - -void calypso_debugunit(int enable) -{ - uint16_t conf = getreg16(MEMIF_REG(EXTRA_CONF)); - - if (enable) - conf &= ~(1 << 11); - else - conf |= (1 << 11); - - putreg16(conf, MEMIF_REG(EXTRA_CONF)); -} - -#define REG_RHEA_CNTL 0xfffff900 -#define REG_API_CNTL 0xfffff902 -#define REG_ARM_RHEA 0xfffff904 - -void calypso_rhea_cfg(uint8_t fac0, uint8_t fac1, uint8_t timeout, - uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1) -{ - putreg16(fac0 | (fac1 << 4) | (timeout << 8), REG_RHEA_CNTL); - putreg16(ws_h | (ws_l << 5), REG_API_CNTL); - putreg16(w_en0 | (w_en1 << 1), REG_ARM_RHEA); -} diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index 4d16f2a8a55c2c0fe8ebf12b55c6fe61118f316c..190382a2da310725e943929b0b3eee5028fcae17 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_exit.c * - * Copyright (C) 2007-2009, 201-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 201-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,15 +41,17 @@ #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" #include "sched/sched.h" #include "group/group.h" +#include "irq/irq.h" #include "up_internal.h" /**************************************************************************** @@ -140,11 +142,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); @@ -177,4 +179,3 @@ void _exit(int status) up_fullcontextrestore(tcb->xcp.regs); } - diff --git a/arch/arm/src/efm32/efm32_lowputc.c b/arch/arm/src/efm32/efm32_lowputc.c index b3fa2ee3866e0077a4bf4db7595c3d358cfd7937..26ec02884aa3664881c864eab95903e165785bf2 100644 --- a/arch/arm/src/efm32/efm32_lowputc.c +++ b/arch/arm/src/efm32/efm32_lowputc.c @@ -281,7 +281,8 @@ static void efm32_leuart_setbaud(uintptr_t base, uint32_t baud) void efm32_lowsetup(void) { -#if defined(HAVE_UART_DEVICE) || defined(HAVE_LEUART_DEVICE) +#if defined(HAVE_UART_DEVICE) || defined(HAVE_LEUART_DEVICE) || \ + defined(HAVE_SPI_DEVICE) uint32_t regval; #endif diff --git a/arch/arm/src/imx6/Make.defs b/arch/arm/src/imx6/Make.defs index 4870aa1d1de74e3aa0b92853040c9931c3357ed0..9986ac23d9d40e203e128b71d2331cedb70c2c6e 100644 --- a/arch/arm/src/imx6/Make.defs +++ b/arch/arm/src/imx6/Make.defs @@ -81,6 +81,7 @@ CMN_CSRCS += arm_unblocktask.c arm_undefinedinsn.c ifeq ($(CONFIG_SMP),y) CMN_CSRCS += arm_cpuindex.c arm_cpustart.c arm_cpupause.c arm_cpuidlestack.c +CMN_CSRCS += arm_scu.c endif ifeq ($(CONFIG_DEBUG_IRQ_INFO),y) diff --git a/arch/arm/src/imx6/chip/imx_memorymap.h b/arch/arm/src/imx6/chip/imx_memorymap.h index c91fb924e093e1095bb85200a4c28fbbf03404f5..c9ad19dfdf353053ff32ba10c76580e9c046e578 100644 --- a/arch/arm/src/imx6/chip/imx_memorymap.h +++ b/arch/arm/src/imx6/chip/imx_memorymap.h @@ -122,6 +122,16 @@ #define IMX_MMDCDDR_PSECTION 0x10000000 /* 10000000-ffffffff 3840 MB MMDC-DDR Controller */ /* 10000000-7fffffff 1792 MB */ +/* By default, NuttX uses a 1-1 memory mapping. So the unused, reserved + * address in the top-level memory map are candidates for other mapping uses: + * + * 00018000-000fffff Reserved -- Not used + * 00400000-007fffff Reserved -- Not used + * 00d00000-00ffffff Reserved -- Not used + * 0220c000-023fffff Reserved -- Not used + * 80000000-efffffff Reserved -- Level 2 page table (See below) + */ + /* i.MX6 DMA PSECTION Offsets */ #define IMX_CAAMRAM_OFFSET 0x00000000 /* 00000000-00003fff 16 KB CAAM (16K secure RAM) */ @@ -897,7 +907,7 @@ * 0x80000000-0xefffffff: Undefined (1.75 GB) * * That is the offset where the main L2 page tables will be positioned. This - * corresponds to page table offsets 0x000002000 up to 0x000003c00. That + * corresponds to page table offsets 0x00002000 up to 0x00003c00. That * is 1792 entries, each mapping 4KB of address for a total of 7MB of virtual * address space) * @@ -918,6 +928,14 @@ */ #ifndef CONFIG_ARCH_LOWVECTORS + /* Memory map + * VIRTUAL ADDRESS RANGE L1 PG TABLE L2 PG TABLE DESCRIPTION + * START END OFFSET SIZE + * ---------- ---------- ------------ ---------------------------- + * 0x80000000 0x803fffff 0x000002000 0x000000400 Vectors (1MiB) + * 0x80100000 0x806fffff 0x000002400 0x000001800 Paging (6MiB) + */ + /* Vector L2 page table offset/size */ # define VECTOR_L2_OFFSET 0x000002000 @@ -939,10 +957,18 @@ # define PGTABLE_L2_SIZE 0x000001800 #else + /* Memory map + * VIRTUAL ADDRESS RANGE L1 PG TABLE L2 PG TABLE DESCRIPTION + * START END OFFSET SIZE + * ---------- ---------- ------------ ---------------------------- + * 0x80000000 0x806fffff 0x000002000 0x000001c00 Paging (7MiB) + */ + /* Paging L2 page table offset/size */ # define PGTABLE_L2_OFFSET 0x000002000 # define PGTABLE_L2_SIZE 0x000001c00 + #endif /* Paging L2 page table base addresses @@ -974,14 +1000,30 @@ */ #ifdef CONFIG_ARCH_LOWVECTORS /* Vectors located at 0x0000:0000 */ - - /* Vectors will always lie at the beginnin of OCRAM */ +/* Vectors will always lie at the beginning of OCRAM + * + * OCRAM Memory Map: + * ---------- ---------- --------------------------- + * START END CONTENT + * ---------- ---------- --------------------------- + * 0x00000000 0x00010000 Vectors (VECTOR_TABLE_SIZE) + * 0x00010000 0x0003c000 Unused + * 0x0003c000 0x00004000 Page table (PGTABLE_SIZE) + */ # define IMX_VECTOR_PADDR IMX_OCRAM_PBASE # define IMX_VECTOR_VSRAM IMX_OCRAM_VBASE # define IMX_VECTOR_VADDR 0x00000000 #else /* Vectors located at 0xffff:0000 -- this probably does not work */ +/* OCRAM Memory Map: + * ---------- ---------- --------------------------- + * START END CONTENT + * ---------- ---------- --------------------------- + * 0x00000000 0x00004000 Page table (PGTABLE_SIZE) + * 0x00004000 0x00030000 Unused + * 0x00030000 0x00010000 Vectors (VECTOR_TABLE_SIZE) + */ # define IMX_VECTOR_PADDR (IMX_OCRAM_PBASE + IMX_OCRAM_SIZE - VECTOR_TABLE_SIZE) # define IMX_VECTOR_VSRAM (IMX_OCRAM_VBASE + IMX_OCRAM_SIZE - VECTOR_TABLE_SIZE) diff --git a/arch/arm/src/imx6/imx_boot.c b/arch/arm/src/imx6/imx_boot.c index edfd5304a14386affc0dcda7a02312e0d18515db..6abc6f8b15753ea4479657b7a8a341b6d0ff7703 100644 --- a/arch/arm/src/imx6/imx_boot.c +++ b/arch/arm/src/imx6/imx_boot.c @@ -52,6 +52,7 @@ #include "chip.h" #include "arm.h" #include "mmu.h" +#include "scu.h" #include "cache.h" #include "fpu.h" #include "up_internal.h" @@ -64,6 +65,16 @@ #include "imx_serial.h" #include "imx_boot.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_FEATURES +# define PROGRESS(c) imx_lowputc(c) +#else +# define PROGRESS(c) +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -388,8 +399,10 @@ static inline void imx_wdtdisable(void) void arm_boot(void) { -#ifdef CONFIG_ARCH_RAMFUNCS +#if defined(CONFIG_ARCH_RAMFUNCS) const uint32_t *src; +#endif +#if defined(CONFIG_ARCH_RAMFUNCS) || defined(CONFIG_SMP) && defined(SMP_INTERCPU_NONCACHED) uint32_t *dest; #endif @@ -398,7 +411,7 @@ void arm_boot(void) */ imx_setupmappings(); - imx_lowputc('A'); + PROGRESS('A'); /* Make sure that all other CPUs are in the disabled state. This is a * formality because the other CPUs are actually running then we have @@ -406,13 +419,21 @@ void arm_boot(void) */ imx_cpu_disable(); + PROGRESS('B'); + +#ifdef CONFIG_SMP + /* Enable SMP cache coherency for CPU0 */ + + arm_enable_smp(0); + PROGRESS('C'); +#endif /* Provide a special mapping for the OCRAM interrupt vector positioned in * high memory. */ imx_vectormapping(); - imx_lowputc('B'); + PROGRESS('D'); #ifdef CONFIG_ARCH_RAMFUNCS /* Copy any necessary code sections from FLASH to RAM. The correct @@ -426,14 +447,14 @@ void arm_boot(void) *dest++ = *src++; } - imx_lowputc('C'); + PROGRESS('E'); /* Flush the copied RAM functions into physical RAM so that will * be available when fetched into the I-Cache. */ arch_clean_dcache((uintptr_t)&_sramfuncs, (uintptr_t)&_eramfuncs) - imx_lowputc('D'); + PROGRESS('F'); #endif /* Setup up vector block. _vector_start and _vector_end are exported from @@ -441,37 +462,35 @@ void arm_boot(void) */ imx_copyvectorblock(); - imx_lowputc('E'); + PROGRESS('G'); /* Disable the watchdog timer */ imx_wdtdisable(); - imx_lowputc('F'); + PROGRESS('H'); /* Initialize clocking to settings provided by board-specific logic */ imx_clockconfig(); - imx_lowputc('G'); + PROGRESS('I'); #ifdef CONFIG_ARCH_FPU /* Initialize the FPU */ arm_fpuconfig(); - imx_lowputc('H'); + PROGRESS('J'); #endif - /* Perform board-specific initialization, This must include: - * - * - Initialization of board-specific memory resources (e.g., SDRAM) - * - Configuration of board specific resources (PIOs, LEDs, etc). + /* Perform board-specific memroy initialization, This must include + * initialization of board-specific memory resources (e.g., SDRAM) * * NOTE: We must use caution prior to this point to make sure that * the logic does not access any global variables that might lie * in SDRAM. */ - imx_board_initialize(); - imx_lowputc('I'); + imx_memory_initialize(); + PROGRESS('K'); #ifdef NEED_SDRAM_REMAPPING /* SDRAM was configured in a temporary state to support low-level @@ -480,7 +499,7 @@ void arm_boot(void) */ imx_remap(); - imx_lowputc('J'); + PROGRESS('L'); #endif #ifdef CONFIG_BOOT_SDRAM_DATA @@ -489,13 +508,20 @@ void arm_boot(void) */ arm_data_initialize(); - imx_lowputc('K'); + PROGRESS('M'); #endif + /* Perform board-specific device initialization. This would include + * configuration of board specific resources such as GPIOs, LEDs, etc. + */ + + imx_board_initialize(); + PROGRESS('N'); + /* Perform common, low-level chip initialization (might do nothing) */ imx_lowsetup(); - imx_lowputc('L'); + PROGRESS('O'); #ifdef USE_EARLYSERIALINIT /* Perform early serial initialization if we are going to use the serial @@ -503,7 +529,7 @@ void arm_boot(void) */ imx_earlyserialinit(); - imx_lowputc('M'); + PROGRESS('P'); #endif /* Now we can enable all other CPUs. The enabled CPUs will start execution @@ -512,6 +538,6 @@ void arm_boot(void) */ imx_cpu_enable(); - imx_lowputc('N'); - imx_lowputc('\n'); + PROGRESS('Q'); + PROGRESS('\n'); } diff --git a/arch/arm/src/imx6/imx_boot.h b/arch/arm/src/imx6/imx_boot.h index 11c1ef56fe38f2b4795b4172fb7997df90db98a0..7f98d347acd51d0f908c3ef58741333883445cf6 100644 --- a/arch/arm/src/imx6/imx_boot.h +++ b/arch/arm/src/imx6/imx_boot.h @@ -110,14 +110,37 @@ void imx_cpu_enable(void); # define imx_cpu_enable() #endif +/**************************************************************************** + * Name: imx_memory_initialize + * + * Description: + * All i.MX6 architectures must provide the following entry point. This + * entry point is called early in the initialization before memory has + * been configured. This board-specific function is responsible for + * configuring any on-board memories. + * + * Logic in imx_memory_initialize must be careful to avoid using any + * global variables because those will be uninitialized at the time this + * function is called. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void imx_memory_initialize(void); + /**************************************************************************** * Name: imx_board_initialize * * Description: * All i.MX6 architectures must provide the following entry point. This - * entry point is called early in the initialization -- after all memory - * has been configured and mapped but before any devices have been - * initialized. + * entry point is called in the initialization phase -- after + * imx_memory_initialize and after all memory has been configured and + * mapped but before any devices have been initialized. * * Input Parameters: * None diff --git a/arch/arm/src/imx6/imx_cpuboot.c b/arch/arm/src/imx6/imx_cpuboot.c index 50b23b5c1d403f8256df08f9b7eb650a05878f16..818b327a4bc4c3cee317fbefdb7d7c8ee3891685 100644 --- a/arch/arm/src/imx6/imx_cpuboot.c +++ b/arch/arm/src/imx6/imx_cpuboot.c @@ -51,9 +51,9 @@ #include "chip/imx_src.h" #include "sctlr.h" #include "smp.h" +#include "scu.h" #include "fpu.h" #include "gic.h" -#include "cp15_cacheops.h" #ifdef CONFIG_SMP @@ -260,6 +260,10 @@ void imx_cpu_enable(void) void arm_cpu_boot(int cpu) { + /* Enable SMP cache coherency for the CPU */ + + arm_enable_smp(cpu); + #ifdef CONFIG_ARCH_FPU /* Initialize the FPU */ @@ -297,10 +301,6 @@ void arm_cpu_boot(int cpu) (void)up_irq_enable(); #endif - /* Invalidate CPUn L1 so that is will be reloaded from coherent L2. */ - - cp15_invalidate_dcache_all(); - /* The next thing that we expect to happen is for logic running on CPU0 * to call up_cpu_start() which generate an SGI and a context switch to * the configured NuttX IDLE task. diff --git a/arch/arm/src/imx6/imx_ecspi.c b/arch/arm/src/imx6/imx_ecspi.c new file mode 100644 index 0000000000000000000000000000000000000000..15c602a7c962ee4348889eec7602ace4bb5ef927 --- /dev/null +++ b/arch/arm/src/imx6/imx_ecspi.c @@ -0,0 +1,1445 @@ +/**************************************************************************** + * arch/arm/src/imx6/imx_ecspi.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Derives from the i.MX1 CSPI driver: + * + * Copyright (C) 2009-2010, 2013, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "up_internal.h" +#include "up_arch.h" + +#include "chip.h" +#include "imx_gpio.h" +#include "imx_ecspi.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* The i.MX6 supports 25SPI interfaces. Which have been enabled? */ + +#define __SPI1_NDX 0 + +#ifdef CONFIG_IMX6_ECSPI1 +# define SPI1_NDX __SPI1_NDX +# define __SPI1_PRESENT 1 +# define __SPI2_NDX (__SPI1_NDX + 1) +#else +# define __SPI1_PRESENT 0 +# define __SPI2_NDX __SPI1_NDX +#endif + +#ifdef CONFIG_IMX6_ECSPI2 +# define SPI2_NDX __SPI2_NDX +# define __SPI2_PRESENT 1 +# define __SPI3_NDX (__SPI2_NDX + 1) +#else +# define __SPI2_PRESENT 0 +# define __SPI3_NDX __SPI2_NDX +#endif + +#ifdef CONFIG_IMX6_ECSPI3 +# define SPI3_NDX __SPI3_NDX +# define __SPI3_PRESENT 1 +# define __SPI4_NDX (__SPI3_NDX + 1) +#else +# define __SPI3_PRESENT 0 +# define __SPI4_NDX __SPI3_NDX +#endif + +#ifdef CONFIG_IMX6_ECSPI4 +# define SPI4_NDX __SPI4_NDX +# define __SPI4_PRESENT 1 +# define __SPI5_NDX (__SPI4_NDX + 1) +#else +# define __SPI4_PRESENT 0 +# define __SPI5_NDX __SPI5_NDX +#endif + +#ifdef CONFIG_IMX6_ECSPI5 +# define SPI5_NDX __SPI5_NDX +# define __SPI5_PRESENT 1 +# define __SPI6_NDX (__SPI5_NDX + 1) +#else +# define __SPI5_PRESENT 0 +# define __SPI6_NDX __SPI5_NDX +#endif + +#define NSPIS (__SPI1_PRESENT + __SPI2_PRESENT + __SPI3_PRESENT + \ + __SPI4_PRESENT + __SPI5_PRESENT) + +/* Compile the rest of the file only if at least one SPI interface has been + * enabled. + */ + +#if NSPIS > 0 + +/* The number of words that will fit in the Tx FIFO */ + +#define IMX_TXFIFO_WORDS 8 + +/**************************************************************************** + * Private Type Definitions + ****************************************************************************/ + + /* Per SPI callouts to board-specific logic */ + +typedef CODE void (*imx_select_t)(FAR struct spi_dev_s *dev, + enum spi_dev_e devid, bool selected); +typedef CODE uint8_t (*imx_status_t)(FAR struct spi_dev_s *dev, + enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +typedef CODE int (*imx_cmddata_t)(FAR struct spi_dev_s *dev, + enum spi_dev_e devid, bool cmd); +#endif + +struct imx_spidev_s +{ + const struct spi_ops_s *ops; /* Common SPI operations */ +#ifndef CONFIG_SPI_POLLWAIT + sem_t waitsem; /* Wait for transfer to complete */ +#endif + sem_t exclsem; /* Supports mutually exclusive access */ + + /* These following are the source and destination buffers of the transfer. + * they are retained in this structure so that they will be accessible + * from an interrupt handler. The actual type of the buffer is uint8_t is + * nbits <=8 and uint16_t is nbits >8. + */ + + void *txbuffer; /* Source buffer */ + void *rxbuffer; /* Destination buffer */ + + /* These are functions pointers that are configured to perform the + * appropriate transfer for the particular kind of exchange that is + * occurring. Differnt functions may be selected depending on (1) + * if the tx or txbuffer is NULL and depending on the number of bits + * per word. + */ + + void (*txword)(struct imx_spidev_s *priv); + void (*rxword)(struct imx_spidev_s *priv); + + uint32_t base; /* SPI register base address */ + uint32_t frequency; /* Current desired SCLK frequency */ + uint32_t actual; /* Current actual SCLK frequency */ + + int ntxwords; /* Number of words left to transfer on the Tx FIFO */ + int nrxwords; /* Number of words received on the Rx FIFO */ + int nwords; /* Number of words to be exchanged */ + + uint8_t mode; /* Current mode */ + uint8_t nbits; /* Current number of bits per word */ + uint8_t spindx; /* SPI index */ +#ifndef CONFIG_SPI_POLLWAIT + uint8_t irq; /* SPI IRQ number */ + xcpt_t handler; /* ECSPI interrupt handler */ +#endif + + /* Per SPI callouts to board-specific logic */ + + imx_select_t select; /* Select callout */ + imx_status_t status; /* Status callout */ +#ifdef CONFIG_SPI_CMDDATA + imx_cmddata_t cmddata; /* Cmddata callout */ +#endif +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/* SPI register access */ + +static inline uint32_t spi_getreg(struct imx_spidev_s *priv, unsigned int offset); +static inline void spi_putreg(struct imx_spidev_s *priv, unsigned int offset, uint32_t value); + +/* SPI data transfer */ + +static void spi_txnull(struct imx_spidev_s *priv); +static void spi_txuint16(struct imx_spidev_s *priv); +static void spi_txuint8(struct imx_spidev_s *priv); +static void spi_rxnull(struct imx_spidev_s *priv); +static void spi_rxuint16(struct imx_spidev_s *priv); +static void spi_rxuint8(struct imx_spidev_s *priv); +static int spi_performtx(struct imx_spidev_s *priv); +static inline void spi_performrx(struct imx_spidev_s *priv); +static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, + void *rxbuffer, unsigned int nwords); + +/* Interrupt handling */ + +#ifndef CONFIG_SPI_POLLWAIT +static int spi_interrupt(struct imx_spidev_s *priv); +#ifdef CONFIG_IMX6_ECSPI1 +static int ecspi1_interrupt(int irq, void *context); +#endif +#ifdef CONFIG_IMX6_ECSPI2 +static int ecspi2_interrupt(int irq, void *context); +#endif +#ifdef CONFIG_IMX6_ECSPI3 +static int ecspi3_interrupt(int irq, void *context); +#endif +#ifdef CONFIG_IMX6_ECSPI4 +static int ecspi4_interrupt(int irq, void *context); +#endif +#ifdef CONFIG_IMX6_ECSPI5 +static int ecspi5_interrupt(int irq, void *context); +#endif +#endif + +/* SPI methods */ + +static int spi_lock(FAR struct spi_dev_s *dev, bool lock); +static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, + bool selected); +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, + uint32_t frequency); +static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode); +static void spi_setbits(FAR struct spi_dev_s *dev, int nbits); +static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd); +static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +static int spi_cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, + bool cmd); +#endif +#ifdef CONFIG_SPI_EXCHANGE +static void spi_exchange(FAR struct spi_dev_s *dev, + FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords); +#else +static void spi_sndblock(FAR struct spi_dev_s *dev, + FAR const void *buffer, size_t nwords); +static void spi_recvblock(FAR struct spi_dev_s *dev, + FAR void *buffer, size_t nwords); +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Common SPI operations */ + +static const struct spi_ops_s g_spiops = +{ + .lock = spi_lock, + .select = spi_select, /* Provided externally by board logic */ + .setfrequency = spi_setfrequency, + .setmode = spi_setmode, + .setbits = spi_setbits, +#ifdef CONFIG_SPI_HWFEATURES + .hwfeatures = 0, /* Not supported */ +#endif + .status = spi_status, /* Provided externally by board logic */ +#ifdef CONFIG_SPI_CMDDATA + .cmddata = spi_cmddata, +#endif + .send = spi_send, +#ifdef CONFIG_SPI_EXCHANGE + .exchange = spi_exchange, +#else + .sndblock = spi_sndblock, + .recvblock = spi_recvblock, +#endif +}; + +/* This supports is up to five SPI busses/ports */ + +static struct imx_spidev_s g_spidev[] = +{ +#ifdef CONFIG_IMX6_ECSPI1 + { + .ops = &g_spiops, + .base = IMX_ECSPI1_VBASE, + .spindx = SPI1_NDX, +#ifndef CONFIG_SPI_POLLWAIT + .irq = IMX_IRQ_ECSPI1, + .handler = ecspi1_interrupt, +#endif + .select = imx_spi1select, + .status = imx_spi1status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spi1cmddata, +#endif + } +#endif + +#ifdef CONFIG_IMX6_ECSPI2 + , { + .ops = &g_spiops, + .base = IMX_ECSPI2_VBASE, + .spindx = SPI2_NDX, +#ifndef CONFIG_SPI_POLLWAIT + .irq = IMX_IRQ_ECSPI2, + .handler = ecspi2_interrupt, +#endif + .select = imx_spi2select, + .status = imx_spi2status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spi2cmddata, +#endif + } +#endif + +#ifdef CONFIG_IMX6_ECSPI3 + , { + .ops = &g_spiops, + .base = IMX_ECSPI3_VBASE, + .spindx = SPI3_NDX, +#ifndef CONFIG_SPI_POLLWAIT + .irq = IMX_IRQ_ECSPI3, + .handler = ecspi3_interrupt, +#endif + .select = imx_spi3select, + .status = imx_spi3status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spi3cmddata, +#endif + } +#endif + +#ifdef CONFIG_IMX6_ECSPI4 + , { + .ops = &g_spiops, + .base = IMX_ECSPI4_VBASE, + .spindx = SPI4_NDX, +#ifndef CONFIG_SPI_POLLWAIT + .irq = IMX_IRQ_ECSPI4, + .handler = ecspi4_interrupt, +#endif + .select = imx_spi4select, + .status = imx_spi4status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spi4cmddata, +#endif + } +#endif + +#ifdef CONFIG_IMX6_ECSPI5 + , { + .ops = &g_spiops, + .base = IMX_ECSPI5_VBASE, + .spindx = SPI5_NDX, +#ifndef CONFIG_SPI_POLLWAIT + .irq = IMX_IRQ_ECSPI5, + .handler = ecspi5_interrupt, +#endif + .select = imx_spi5select, + .status = imx_spi5status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spi5cmddata, +#endif + } +#endif +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: spi_getreg + * + * Description: + * Read the SPI register at this offeset + * + * Input Parameters: + * priv - Device-specific state data + * offset - Offset to the SPI register from the register base address + * + * Returned Value: + * Value of the register at this offset + * + ****************************************************************************/ + +static inline uint32_t spi_getreg(struct imx_spidev_s *priv, unsigned int offset) +{ + return getreg32(priv->base + offset); +} + +/**************************************************************************** + * Name: spi_putreg + * + * Description: + * Write the value to the SPI register at this offeset + * + * Input Parameters: + * priv - Device-specific state data + * offset - Offset to the SPI register from the register base address + * value - Value to write + * + * Returned Value: + * None + * + ****************************************************************************/ + +static inline void spi_putreg(struct imx_spidev_s *priv, unsigned int offset, uint32_t value) +{ + putreg32(value, priv->base + offset); +} + +/**************************************************************************** + * Name: spi_txnull, spi_txuint16, and spi_txuint8 + * + * Description: + * Transfer all ones, a uint8_t, or uint16_t to Tx FIFO and update the txbuffer + * pointer appropriately. The selected function dependes on (1) if there + * is a source txbuffer provided, and (2) if the number of bits per + * word is <=8 or >8. + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void spi_txnull(struct imx_spidev_s *priv) +{ + spi_putreg(priv, ECSPI_TXDATA_OFFSET, 0xffff); +} + +static void spi_txuint16(struct imx_spidev_s *priv) +{ + uint16_t *ptr = (uint16_t *)priv->txbuffer; + spi_putreg(priv, ECSPI_TXDATA_OFFSET, *ptr++); + priv->txbuffer = (void *)ptr; +} + +static void spi_txuint8(struct imx_spidev_s *priv) +{ + uint8_t *ptr = (uint8_t *)priv->txbuffer; + spi_putreg(priv, ECSPI_TXDATA_OFFSET, *ptr++); + priv->txbuffer = (void *)ptr; +} + +/**************************************************************************** + * Name: spi_rxnull,spi_rxuint16, and spi_rxuint8 + * + * Description: + * Discard input, save a uint8_t, or or save a uint16_t from Tx FIFO in the + * user rxvbuffer and update the rxbuffer pointer appropriately. The + * selected function dependes on (1) if there is a desination rxbuffer + * provided, and (2) if the number of bits per word is <=8 or >8. + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void spi_rxnull(struct imx_spidev_s *priv) +{ + (void)spi_getreg(priv, ECSPI_RXDATA_OFFSET); +} + +static void spi_rxuint16(struct imx_spidev_s *priv) +{ + uint16_t *ptr = (uint16_t *)priv->rxbuffer; + *ptr++ = (uint16_t)spi_getreg(priv, ECSPI_TXDATA_OFFSET); + priv->rxbuffer = (void *)ptr; +} + +static void spi_rxuint8(struct imx_spidev_s *priv) +{ + uint8_t *ptr = (uint8_t *)priv->rxbuffer; + *ptr++ = (uint8_t)spi_getreg(priv, ECSPI_TXDATA_OFFSET); + priv->rxbuffer = (void *)ptr; +} + +/**************************************************************************** + * Name: spi_performtx + * + * Description: + * If the Tx FIFO is empty, then transfer as many words as we can to + * the FIFO. + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * The number of words written to the Tx FIFO (a value from 0 to 8, + * inclusive). + * + ****************************************************************************/ + +static int spi_performtx(struct imx_spidev_s *priv) +{ + uint32_t regval; + int ntxd = 0; /* Number of words written to Tx FIFO */ + + /* Check if the Tx FIFO is empty */ + + if ((spi_getreg(priv, ECSPI_STATREG_OFFSET) & ECSPI_INT_TE) != 0) + { + /* Check if all of the Tx words have been sent */ + + if (priv->ntxwords > 0) + { + /* No.. Transfer more words until either the TxFIFO is full or + * until all of the user provided data has been sent. + */ + + for (; ntxd < priv->ntxwords && ntxd < IMX_TXFIFO_WORDS; ntxd++) + { + priv->txword(priv); + } + + /* Update the count of words to to transferred */ + + priv->ntxwords -= ntxd; + } + else + { + /* Yes.. The transfer is complete, disable Tx FIFO empty interrupt */ + + regval = spi_getreg(priv, ECSPI_INTREG_OFFSET); + regval &= ~ECSPI_INT_TE; + spi_putreg(priv, ECSPI_INTREG_OFFSET, regval); + } + } + return ntxd; +} + +/**************************************************************************** + * Name: spi_performrx + * + * Description: + * Transfer as many bytes as possible from the Rx FIFO to the user Rx + * buffer (if one was provided). + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * None + * + ****************************************************************************/ + +static inline void spi_performrx(struct imx_spidev_s *priv) +{ + /* Loop while data is available in the Rx FIFO */ + + while ((spi_getreg(priv, ECSPI_STATREG_OFFSET) & ECSPI_INT_RR) != 0) + { + /* Have all of the requested words been transferred from the Rx FIFO? */ + + if (priv->nrxwords < priv->nwords) + { + /* No.. Read more data from Rx FIFO */ + + priv->rxword(priv); + priv->nrxwords++; + } + } +} + +/**************************************************************************** + * Name: spi_startxfr + * + * Description: + * If data was added to the Tx FIFO, then start the exchange + * + * Input Parameters: + * priv - Device-specific state data + * ntxd - The number of bytes added to the Tx FIFO by spi_performtx. + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void spi_startxfr(struct imx_spidev_s *priv, int ntxd) +{ + uint32_t regval; + + /* The XCH bit initiates an exchange in master mode. It remains set + * remains set while the exchange is in progress but is automatically + * clear when all data in the Tx FIFO and shift register are shifted out. + * So if we have added data to the Tx FIFO on this interrupt, we must + * set the XCH bit to resume the exchange. + */ + + if (ntxd > 0) + { + regval = spi_getreg(priv, ECSPI_CONREG_OFFSET); + regval |= ECSPI_CONREG_XCH; + spi_putreg(priv, ECSPI_CONREG_OFFSET, regval); + } +} + +/**************************************************************************** + * Name: spi_transfer + * + * Description: + * Exchange a block data with the SPI device + * + * Input Parameters: + * priv - Device-specific state data + * txbuffer - The buffer of data to send to the device (may be NULL). + * rxbuffer - The buffer to receive data from the device (may be NULL). + * nwords - The total number of words to be exchanged. If the interface + * uses <= 8 bits per word, then this is the number of uint8_t's; + * if the interface uses >8 bits per word, then this is the + * number of uint16_t's + * + * Returned Value: + * 0: success, <0:Negated error number on failure + * + ****************************************************************************/ + +static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer, + void *rxbuffer, unsigned int nwords) +{ +#ifndef CONFIG_SPI_POLLWAIT + irqstate_t flags; + uint32_t regval; + int ret; +#endif + int ntxd; + + /* Set up to perform the transfer */ + + priv->txbuffer = (uint8_t *)txbuffer; /* Source buffer */ + priv->rxbuffer = (uint8_t *)rxbuffer; /* Destination buffer */ + priv->ntxwords = nwords; /* Number of words left to send */ + priv->nrxwords = 0; /* Number of words received */ + priv->nwords = nwords; /* Total number of exchanges */ + + /* Set up the low-level data transfer function pointers */ + + if (priv->nbits > 8) + { + priv->txword = spi_txuint16; + priv->rxword = spi_rxuint16; + } + else + { + priv->txword = spi_txuint8; + priv->rxword = spi_rxuint8; + } + + if (!txbuffer) + { + priv->txword = spi_txnull; + } + + if (!rxbuffer) + { + priv->rxword = spi_rxnull; + } + + /* Prime the Tx FIFO to start the sequence (saves one interrupt) */ + +#ifndef CONFIG_SPI_POLLWAIT + flags = enter_critical_section(); + ntxd = spi_performtx(priv); + spi_startxfr(priv, ntxd); + + /* Enable transmit empty interrupt */ + + regval = spi_getreg(priv, ECSPI_INTREG_OFFSET); + regval |= ECSPI_INT_TE; + spi_putreg(priv, ECSPI_INTREG_OFFSET, regval); + leave_critical_section(flags); + + /* Wait for the transfer to complete. Since there is no handshake + * with SPI, the following should complete even if there are problems + * with the transfer, so it should be safe with no timeout. + */ + + do + { + /* Wait to be signaled from the interrupt handler */ + + ret = sem_wait(&priv->waitsem); + } + while (ret < 0 && errno == EINTR); + +#else + /* Perform the transfer using polling logic. This will totally + * dominate the CPU until the transfer is complete. Only recommended + * if (1) your SPI is very fast, and (2) if you only use very short + * transfers. + */ + + do + { + /* Handle outgoing Tx FIFO transfers */ + + ntxd = spi_performtx(priv); + + /* Handle incoming Rx FIFO transfers */ + + spi_performrx(priv); + + /* Resume the transfer */ + + spi_startxfr(priv, ntxd); + + /* If there are other threads at this same priority level, + * the following may help: + */ + + sched_yield(); + } + while (priv->nrxwords < priv->nwords); +#endif + return OK; +} + +/**************************************************************************** + * Name: spi_interrupt + * + * Description: + * Common ECSPI interrupt handling logic + * + * Input Parameters: + * priv - Device-specific state data + * + * Returned Value: + * 0: success, <0:Negated error number on failure + * + ****************************************************************************/ + +#ifndef CONFIG_SPI_POLLWAIT +static int spi_interrupt(struct imx_spidev_s *priv) +{ + int ntxd; + + DEBUGASSERT(priv != NULL); + + /* Handle outgoing Tx FIFO transfers */ + + ntxd = spi_performtx(priv); + + /* Handle incoming Rx FIFO transfers */ + + spi_performrx(priv); + + /* Resume the transfer */ + + spi_startxfr(priv, ntxd); + + /* Check if the transfer is complete */ + + if (priv->nrxwords >= priv->nwords) + { + /* Yes, wake up the waiting thread */ + + sem_post(&priv->waitsem); + } + + return OK; +} +#endif + +/**************************************************************************** + * Name: ecspiN_interrupt, N=1..5 + * + * Description: + * Individual ECPSI interrupt handlers. + * + * Input Parameters: + * Standard interrupt handler inputs + * + * Returned Value: + * 0: success, <0:Negated error number on failure + * + ****************************************************************************/ + +#ifndef CONFIG_SPI_POLLWAIT +#ifdef CONFIG_IMX6_ECSPI1 +static int ecspi1_interrupt(int irq, void *context) +{ + return spi_interrupt(&g_spidev[SPI1_NDX]); +} +#endif + +#ifdef CONFIG_IMX6_ECSPI2 +static int ecspi2_interrupt(int irq, void *context) +{ + return spi_interrupt(&g_spidev[SPI2_NDX]); +} +#endif + +#ifdef CONFIG_IMX6_ECSPI3 +static int ecspi3_interrupt(int irq, void *context) +{ + return spi_interrupt(&g_spidev[SPI3_NDX]); +} +#endif + +#ifdef CONFIG_IMX6_ECSPI4 +static int ecspi4_interrupt(int irq, void *context) +{ + return spi_interrupt(&g_spidev[SPI4_NDX]); +} +#endif + +#ifdef CONFIG_IMX6_ECSPI5 +static int ecspi5_interrupt(int irq, void *context) +{ + return spi_interrupt(&g_spidev[SPI5_NDX]); +} +#endif +#endif + +/**************************************************************************** + * Name: spi_lock + * + * Description: + * On SPI busses where there are multiple devices, it will be necessary to + * lock SPI to have exclusive access to the busses for a sequence of + * transfers. The bus should be locked before the chip is selected. After + * locking the SPI bus, the caller should then also call the setfrequency, + * setbits, and setmode methods to make sure that the SPI is properly + * configured for the device. If the SPI buss is being shared, then it + * may have been left in an incompatible state. + * + * Input Parameters: + * dev - Device-specific state data + * lock - true: Lock spi bus, false: unlock SPI bus + * + * Returned Value: + * None + * + ****************************************************************************/ + +static int spi_lock(FAR struct spi_dev_s *dev, bool lock) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + + if (lock) + { + /* Take the semaphore (perhaps waiting) */ + + while (sem_wait(&priv->exclsem) != 0) + { + /* The only case that an error should occur here is if the wait + * was awakened by a signal. + */ + + DEBUGASSERT(errno == EINTR); + } + } + else + { + (void)sem_post(&priv->exclsem); + } + + return OK; +} + +/**************************************************************************** + * Name: spi_select + * + * Description: + * Enable/disable the SPI chip select. The implementation of this method + * must include handshaking: If a device is selected, it must hold off + * all other attempts to select the device until the device is deselected. + * Required. + * + * Input Parameters: + * dev - Device-specific state data + * devid - Identifies the device to select + * selected - true: slave selected, false: slave de-selected + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, + bool selected) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + + DEBUGASSERT(priv != NULL && priv->select != NULL); + priv->select(dev, devid, selected); +} + +/**************************************************************************** + * Name: spi_setfrequency + * + * Description: + * Set the SPI frequency. + * + * Input Parameters: + * dev - Device-specific state data + * frequency - The SPI frequency requested + * + * Returned Value: + * Returns the actual frequency selected + * + ****************************************************************************/ + +static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + uint32_t actual; + + DEBUGASSERT(priv != NULL); + actual = priv->actual; + + if (frequency != priv->frequency) + { + uint32_t freqbits; + uint32_t regval; + + if (frequency >= IMX_PERCLK2_FREQ / 4) + { + freqbits = ECSPI_CONREG_DIV4; + actual = IMX_PERCLK2_FREQ / 4; + } + else if (frequency >= IMX_PERCLK2_FREQ / 8) + { + freqbits = ECSPI_CONREG_DIV8; + actual = IMX_PERCLK2_FREQ / 8; + } + else if (frequency >= IMX_PERCLK2_FREQ / 16) + { + freqbits = ECSPI_CONREG_DIV16; + actual = IMX_PERCLK2_FREQ / 16; + } + else if (frequency >= IMX_PERCLK2_FREQ / 32) + { + freqbits = ECSPI_CONREG_DIV32; + actual = IMX_PERCLK2_FREQ / 32; + } + else if (frequency >= IMX_PERCLK2_FREQ / 64) + { + freqbits = ECSPI_CONREG_DIV64; + actual = IMX_PERCLK2_FREQ / 64; + } + else if (frequency >= IMX_PERCLK2_FREQ / 128) + { + freqbits = ECSPI_CONREG_DIV128; + actual = IMX_PERCLK2_FREQ / 128; + } + else if (frequency >= IMX_PERCLK2_FREQ / 256) + { + freqbits = ECSPI_CONREG_DIV256; + actual = IMX_PERCLK2_FREQ / 256; + } + else /* if (frequency >= IMX_PERCLK2_FREQ / 512) */ + { + freqbits = ECSPI_CONREG_DIV512; + actual = IMX_PERCLK2_FREQ / 512; + } + + /* Then set the selected frequency */ + + regval = spi_getreg(priv, ECSPI_CONREG_OFFSET); + regval &= ~(ECSPI_CONREG_DATARATE_MASK); + regval |= freqbits; + spi_putreg(priv, ECSPI_CONREG_OFFSET, regval); + + priv->frequency = frequency; + priv->actual = actual; + } + + return actual; +} + +/**************************************************************************** + * Name: spi_setmode + * + * Description: + * Set the SPI mode. Optional. See enum spi_mode_e for mode definitions + * + * Input Parameters: + * dev - Device-specific state data + * mode - The SPI mode requested + * + * Returned Value: + * none + * + ****************************************************************************/ + +static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + if (priv && mode != priv->mode) + { + uint32_t modebits; + uint32_t regval; + + /* Select the CTL register bits based on the selected mode */ + + switch (mode) + { + case SPIDEV_MODE0: /* CPOL=0 CHPHA=0 */ + modebits = 0; + break; + + case SPIDEV_MODE1: /* CPOL=0 CHPHA=1 */ + modebits = ECSPI_CONREG_PHA; + break; + + case SPIDEV_MODE2: /* CPOL=1 CHPHA=0 */ + modebits = ECSPI_CONREG_POL; + break; + + case SPIDEV_MODE3: /* CPOL=1 CHPHA=1 */ + modebits = ECSPI_CONREG_PHA | ECSPI_CONREG_POL; + break; + + default: + return; + } + + /* Then set the selected mode */ + + regval = spi_getreg(priv, ECSPI_CONREG_OFFSET); + regval &= ~(ECSPI_CONREG_PHA | ECSPI_CONREG_POL); + regval |= modebits; + spi_putreg(priv, ECSPI_CONREG_OFFSET, regval); + } +} + +/**************************************************************************** + * Name: spi_setbits + * + * Description: + * Set the number of bits per word. + * + * Input Parameters: + * dev - Device-specific state data + * nbits - The number of bits requests + * + * Returned Value: + * none + * + ****************************************************************************/ + +static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + if (priv && nbits != priv->nbits && nbits > 0 && nbits <= 16) + { + uint32_t regval = spi_getreg(priv, ECSPI_CONREG_OFFSET); + regval &= ~ECSPI_CONREG_BITCOUNT_MASK; + regval |= ((nbits - 1) << ECSPI_CONREG_BITCOUNT_SHIFT); + spi_putreg(priv, ECSPI_CONREG_OFFSET, regval); + priv->nbits = nbits; + } +} + +/**************************************************************************** + * Name: spi_send + * + * Description: + * Exchange one word on SPI + * + * Input Parameters: + * dev - Device-specific state data + * wd - The word to send. the size of the data is determined by the + * number of bits selected for the SPI interface. + * + * Returned Value: + * response + * + ****************************************************************************/ + +static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + uint16_t response = 0; + + (void)spi_transfer(priv, &wd, &response, 1); + return response; +} + +/**************************************************************************** + * Name: spi_status + * + * Description: + * Get SPI/MMC status. Optional. + * + * Input Parameters: + * dev - Device-specific state data + * devid - Identifies the device to report status on + * + * Returned Value: + * Returns a bitset of status values (see SPI_STATUS_* defines) + * + ****************************************************************************/ + +static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + uint8_t ret = 0; + + DEBUGASSERT(priv != NULL); + + if (priv->status != NULL); + { + ret = priv->select(dev, devid); + } + + return ret; +} + +/**************************************************************************** + * Name: spi_cmddata + * + * Description: + * Some devices require and additional out-of-band bit to specify if the + * next word sent to the device is a command or data. This is typical, for + * example, in "9-bit" displays where the 9th bit is the CMD/DATA bit. + * This function provides selection of command or data. + * + * This "latches" the CMD/DATA state. It does not have to be called before + * every word is transferred; only when the CMD/DATA state changes. This + * method is required if CONFIG_SPI_CMDDATA is selected in the NuttX + * configuration + * + * Input Parameters: + * dev - Device-specific state data + * cmd - TRUE: The following word is a command; FALSE: the following words + * are data. + * + * Returned Value: + * OK unless an error occurs. Then a negated errno value is returned + * + ****************************************************************************/ + +#ifdef CONFIG_SPI_CMDDATA +static int spi_cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, + bool cmd) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + int ret = -ENOSYS; + + DEBUGASSERT(priv != NULL); + + if (priv->cmddata != NULL); + { + ret = priv->cmddata(dev, devid, cmd); + } + + return ret; +} +#endif + +/**************************************************************************** + * Name: SPI_EXCHANGE + * + * Description: + * Exahange a block of data from SPI. Required. + * + * Input Parameters: + * dev - Device-specific state data + * buffer - A pointer to the buffer of data to be sent + * rxbuffer - A pointer to the buffer in which to recieve data + * nwords - the length of data that to be exchanged in units of words. + * The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_SPI_EXCHANGE +static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, + FAR void *rxbuffer, size_t nwords) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + (void)spi_transfer(priv, txbuffer, rxbuffer, nwords); +} +#endif + +/**************************************************************************** + * Name: spi_sndblock + * + * Description: + * Send a block of data on SPI + * + * Input Parameters: + * dev - Device-specific state data + * buffer - A pointer to the buffer of data to be sent + * nwords - the length of data to send from the buffer in number of words. + * The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifndef CONFIG_SPI_EXCHANGE +static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t nwords) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + (void)spi_transfer(priv, buffer, NULL, nwords); +} +#endif + +/**************************************************************************** + * Name: spi_recvblock + * + * Description: + * Revice a block of data from SPI + * + * Input Parameters: + * dev - Device-specific state data + * buffer - A pointer to the buffer in which to recieve data + * nwords - the length of data that can be received in the buffer in number + * of words. The wordsize is determined by the number of bits-per-word + * selected for the SPI interface. If nbits <= 8, the data is + * packed into uint8_t's; if nbits >8, the data is packed into uint16_t's + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifndef CONFIG_SPI_EXCHANGE +static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nwords) +{ + struct imx_spidev_s *priv = (struct imx_spidev_s *)dev; + (void)spi_transfer(priv, NULL, buffer, nwords); +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: imx_spibus_initialize + * + * Description: + * Initialize common parts the selected SPI port. Initialization of + * chip select GPIOs must have been performed by board specific logic + * prior to calling this function. Specifically: GPIOs should have + * been configured for output, and all chip selects disabled. + * + * One GPIO, SS (PB2 on the eZ8F091) is reserved as a chip select. However, + * If multiple devices on on the bus, then multiple chip selects will be + * required. Theregore, all GPIO chip management is deferred to board- + * specific logic. + * + * Input Parameter: + * Port number (for hardware that has mutiple SPI interfaces) + * + * Returned Value: + * Valid SPI device structre reference on succcess; a NULL on failure + * + ****************************************************************************/ + +FAR struct spi_dev_s *imx_spibus_initialize(int port) +{ + struct imx_spidev_s *priv; + uint8_t regval; + + /* Only the SPI1 interface is supported */ + + switch (port) + { +#ifdef CONFIG_IMX6_ECSPI1 + case 1: + /* Select SPI1 */ + + priv = &g_spidev[SPI1_NDX]; + + /* Configure SPI1 GPIOs (NOTE that SS is not initialized here, the + * logic in this file makes no assumptions about chip select) + */ + + imxgpio_configpfinput(GPIOC, 13); /* Port C, pin 13: RDY */ + imxgpio_configpfoutput(GPIOC, 14); /* Port C, pin 14: SCLK */ + imxgpio_configpfinput(GPIOC, 16); /* Port C, pin 16: MISO */ + imxgpio_configpfoutput(GPIOC, 17); /* Port C, pin 17: MOSI */ + break; +#endif /* CONFIG_IMX6_ECSPI1 */ + +#ifdef CONFIG_IMX6_ECSPI2 + case 2: + /* Select SPI2 */ + + priv = &g_spidev[SPI2_NDX]; + + /* Configure SPI2 GPIOs */ + /* SCLK: AIN of Port A, pin 0 -OR- AIN of Port D, pin 7 */ + +#if 1 + imxgpio_configoutput(GPIOA, 0); /* Set GIUS=1 OCR=0 DIR=OUT */ +#else + imxgpio_configoutput(GPIOD, 7); /* Set GIUS=1 OCR=0 DIR=OUT */ +#endif + + /* SS: AIN of Port A, pin 17 -OR- AIN of Port D, pin 8.(NOTE that SS + * is not initialized here, the logic in this file makes no assumptions + * about chip select) + */ + + /* RXD: AOUT of Port A, pin 1 -OR- AOUT of Port D, pin 9 */ + +#if 1 + imxgpio_configinput(GPIOA, 1); /* Set GIUS=1 OCR=0 DIR=IN */ + + /* Select input from SPI2_RXD_0 pin (AOUT Port A, pin 1) */ + + regval = getreg32(IMX_SC_FMCR); + regval &= ~FMCR_SPI2_RXDSEL; + putreg32(regval, IMX_SC_FMCR); +#else + imxgpio_configinput(GPIOD, 9); /* Set GIUS=1 OCR=0 DIR=IN */ + + /* Select input from SPI2_RXD_1 pin (AOUT Port D, pin 9) */ + + regval = getreg32(IMX_SC_FMCR); + regval |= FMCR_SPI2_RXDSEL; + putreg32(regval, IMX_SC_FMCR); +#endif + + /* TXD: BIN of Port D, pin 31 -OR- AIN of Port D, pin 10 */ + +#if 1 + imxgpio_configinput(GPIOD, 31); + imxgpio_ocrbin(GPIOD, 31); + imxgpio_dirout(GPIOD, 31); +#else + imxgpio_configoutput(GPIOD, 10); +#endif + break; +#endif /* CONFIG_IMX6_ECSPI2 */ + + default: + return NULL; + } + + /* Initialize the state structure */ + /* Initialize Semaphores */ + +#ifndef CONFIG_SPI_POLLWAIT + /* Initialize the semaphore that is used to wake up the waiting + * thread when the DMA transfer completes. This semaphore is used for + * signaling and, hence, should not have priority inheritance enabled. + */ + + sem_init(&priv->waitsem, 0, 0); + sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); +#endif + sem_init(&priv->exclsem, 0, 1); + + /* Initialize control register: min frequency, ignore ready, master mode, mode=0, 8-bit */ + + spi_putreg(priv, ECSPI_CONREG_OFFSET, + ECSPI_CONREG_DIV512 | /* Lowest frequency */ + ECSPI_CONREG_DRCTL_IGNRDY | /* Ignore ready */ + ECSPI_CONREG_MODE | /* Master mode */ + (7 << ECSPI_CONREG_BITCOUNT_SHIFT)); /* 8-bit data */ + + /* Make sure state agrees with data */ + + priv->mode = SPIDEV_MODE0; + priv->nbits = 8; + + /* Set the initial clock frequency for identification mode < 400kHz */ + + spi_setfrequency((FAR struct spi_dev_s *)priv, 400000); + + /* Enable interrupts on data ready (and certain error conditions */ + +#ifndef CONFIG_SPI_POLLWAIT + spi_putreg(priv, ECSPI_INTREG_OFFSET, + ECSPI_INT_RR | /* RXFIFO Data Ready Interrupt Enable */ + ECSPI_INT_RO | /* RXFIFO Overflow Interrupt Enable */ + ECSPI_INT_BO); /* Bit Count Overflow Interrupt Enable */ +#else + spi_putreg(priv, ECSPI_INTREG_OFFSET, 0); /* No interrupts */ +#endif + + /* Set the clock source=bit clock and number of clocks inserted between + * transactions = 2. + */ + + spi_putreg(priv, ECSPI_PERIODREG_OFFSET, 2); + + /* No DMA */ + + spi_putreg(priv, ECSPI_DMAREG_OFFSET, 0); + + /* Attach the interrupt */ + +#ifndef CONFIG_SPI_POLLWAIT + DEBUGVERIFY(irq_attach(priv->irq, priv->handler)); +#endif + + /* Enable SPI */ + + regval = spi_getreg(priv, ECSPI_CONREG_OFFSET); + regval |= ECSPI_CONREG_SPIEN; + spi_putreg(priv, ECSPI_CONREG_OFFSET, regval); + + /* Enable SPI interrupts */ + +#ifndef CONFIG_SPI_POLLWAIT + up_enable_irq(priv->irq); +#endif + return (FAR struct spi_dev_s *)priv; +} + +#endif /* NSPIS > 0 */ diff --git a/arch/arm/src/imx6/imx_irq.c b/arch/arm/src/imx6/imx_irq.c index e00a8e9527dfa0585a8760d097da4663353c8d45..b15a9a4e6ddbc7a707196b4e51390c3e47398d78 100644 --- a/arch/arm/src/imx6/imx_irq.c +++ b/arch/arm/src/imx6/imx_irq.c @@ -134,11 +134,11 @@ void up_irqinitialize(void) CURRENT_REGS = NULL; #ifndef CONFIG_SUPPRESS_INTERRUPTS +#ifdef CONFIG_IMX6_PIO_IRQ /* Initialize logic to support a second level of interrupt decoding for * PIO pins. */ -#ifdef CONFIG_IMX6_PIO_IRQ imx_gpioirq_initialize(); #endif diff --git a/arch/arm/src/imx6/imx_timerisr.c b/arch/arm/src/imx6/imx_timerisr.c index 60f8864177fec17af9a72a58556c9cdd8b00d0b9..4c76666493731c49ce93e8987ee803e8c5e12d3c 100644 --- a/arch/arm/src/imx6/imx_timerisr.c +++ b/arch/arm/src/imx6/imx_timerisr.c @@ -115,10 +115,6 @@ static void up_output_compare(uint32_t sr, uint32_t of) if ((sr & of) != 0) { - /* Clear the pending output compare interrupt */ - - putreg32(of, IMX_GPT_SR); - /* Process timer interrupt event */ sched_process_timer(); @@ -140,9 +136,16 @@ static void up_output_compare(uint32_t sr, uint32_t of) int up_timerisr(int irq, uint32_t *regs) { - /* Sample the SR (once) and process all pending output compare interrupt */ + /* Sample the SR (once) */ uint32_t sr = getreg32(IMX_GPT_SR); + + /* Clear GPT status register */ + + putreg32(sr, IMX_GPT_SR); + + /* Process all pending output compare interrupt */ + up_output_compare(sr, GPT_INT_OF1); up_output_compare(sr, GPT_INT_OF2); up_output_compare(sr, GPT_INT_OF3); diff --git a/arch/arm/src/kinetis/Kconfig b/arch/arm/src/kinetis/Kconfig index cf781ade5e0cb8b3ecc9a5f940a4852d2d17f023..980905f18a2fd375ca8d710278f467d2f6dbb658 100644 --- a/arch/arm/src/kinetis/Kconfig +++ b/arch/arm/src/kinetis/Kconfig @@ -120,6 +120,12 @@ config ARCH_CHIP_MK60X256VMD100 select KINETIS_HAVE_I2C1 select KINETIS_HAVE_I2C2 +config ARCH_CHIP_MK60FN1M0VLQ12 + bool "MK60FN1M0VLQ12" + select ARCH_FAMILY_K60 + select KINETIS_HAVE_I2C1 + select KINETIS_HAVE_I2C2 + config ARCH_CHIP_MK64FN1M0VLL12 bool "MK64FN1M0VLL12" select ARCH_FAMILY_K64 @@ -254,7 +260,6 @@ config KINETIS_ENET select ARCH_HAVE_NETDEV_STATISTICS select NET select NETDEVICES - select NET_MULTIBUFFER ---help--- Support Ethernet (K6x only) diff --git a/arch/arm/src/kinetis/Make.defs b/arch/arm/src/kinetis/Make.defs index e4dd09df79082b7241f7eb1e26104fad27a9dbd3..a3a9d17343970ebe0f447dace76d46cf02c6d1ae 100644 --- a/arch/arm/src/kinetis/Make.defs +++ b/arch/arm/src/kinetis/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # arch/arm/src/kinetis/Make.defs # -# Copyright (C) 2011, 2013-2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2013-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -174,6 +174,9 @@ endif ifeq ($(CONFIG_RTC),y) CHIP_CSRCS += kinetis_rtc.c +ifeq ($(CONFIG_RTC_DRIVER),y) +CHIP_CSRCS += kinetis_rtc_lowerhalf.c +endif endif ifeq ($(CONFIG_NET),y) diff --git a/arch/arm/src/kinetis/chip/kinetis_k60pinmux.h b/arch/arm/src/kinetis/chip/kinetis_k60pinmux.h index 4e7619c18fb38e9fabe5d9239b3469c96d623a9d..888a5955840f58f5b66a24f9ee718d5535481b61 100644 --- a/arch/arm/src/kinetis/chip/kinetis_k60pinmux.h +++ b/arch/arm/src/kinetis/chip/kinetis_k60pinmux.h @@ -55,10 +55,10 @@ * configuration (with no suffix) that maps to the correct alternative. */ -#if defined(CONFIG_ARCH_CHIP_MK60N256VLQ100) || defined(CONFIG_ARCH_CHIP_MK60X256VLQ100) || \ +#if defined(CONFIG_ARCH_CHIP_MK60N256VLQ100) || defined(CONFIG_ARCH_CHIP_MK60X256VLQ100) || \ defined(CONFIG_ARCH_CHIP_MK60N512VLQ100) || defined(CONFIG_ARCH_CHIP_MK60N256VMD100) || \ defined(CONFIG_ARCH_CHIP_MK60X256VMD100) || defined(CONFIG_ARCH_CHIP_MK60N512VMD100) || \ - defined(CONFIG_ARCH_CHIP_MK60N512VLL100) + defined(CONFIG_ARCH_CHIP_MK60N512VLL100) || defined(CONFIG_ARCH_CHIP_MK60FN1M0VLQ12) #define PIN_TSI0_CH1 (PIN_ANALOG | PIN_PORTA | PIN0) #define PIN_UART0_CTS_1 (PIN_ALT2 | PIN_PORTA | PIN0) diff --git a/arch/arm/src/kinetis/chip/kinetis_mcg.h b/arch/arm/src/kinetis/chip/kinetis_mcg.h index fe8dccc60e1d8419634d008d9af9aa184c32bbe7..42e2f14412caf32131ffded5f8245221ef074905 100644 --- a/arch/arm/src/kinetis/chip/kinetis_mcg.h +++ b/arch/arm/src/kinetis/chip/kinetis_mcg.h @@ -151,7 +151,11 @@ #define MCG_C6_VDIV_SHIFT (0) /* Bits 0-4: VCO Divider */ #define MCG_C6_VDIV_MASK (31 << MCG_C6_VDIV_SHIFT) +#ifdef KINETIS_NEW_MCG +# define MCG_C6_VDIV(n) ((uint32_t)((n)-16) << MCG_C6_VDIV_SHIFT) /* n=16..47 */ +#else # define MCG_C6_VDIV(n) ((uint32_t)((n)-24) << MCG_C6_VDIV_SHIFT) /* n=24..55 */ +#endif #define MCG_C6_CME (1 << 5) /* Bit 5: Clock Monitor Enable */ #define MCG_C6_PLLS (1 << 6) /* Bit 6: PLL Select */ #define MCG_C6_LOLIE (1 << 7) /* Bit 7: Loss of Lock Interrrupt Enable */ diff --git a/arch/arm/src/kinetis/chip/kinetis_rtc.h b/arch/arm/src/kinetis/chip/kinetis_rtc.h index 948c6ce87719dc21176d860fcf13fdec5270bc0b..4ad016af6c01049f6041b4ea8e984cc50b161dff 100644 --- a/arch/arm/src/kinetis/chip/kinetis_rtc.h +++ b/arch/arm/src/kinetis/chip/kinetis_rtc.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/kinetis/chip/kinetis_rtc.h * - * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,39 +52,80 @@ /* Register Offsets *****************************************************************/ -#define KINETIS_RTC_TSR_OFFSET 0x0000 /* RTC Time Seconds Register */ -#define KINETIS_RTC_TPR_OFFSET 0x0004 /* RTC Time Prescaler Register */ -#define KINETIS_RTC_TAR_OFFSET 0x0008 /* RTC Time Alarm Register */ -#define KINETIS_RTC_TCR_OFFSET 0x000c /* RTC Time Compensation Register */ -#define KINETIS_RTC_CR_OFFSET 0x0010 /* RTC Control Register */ -#define KINETIS_RTC_SR_OFFSET 0x0014 /* RTC Status Register */ -#define KINETIS_RTC_LR_OFFSET 0x0018 /* RTC Lock Register */ -#if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64) -# define KINETIS_RTC_IER_OFFSET 0x001c /* RTC Interrupt Enable Register (K40) */ +/* NXP/Freescale has familes and technology generations (sometimes seen as processor + * speed). These are organized into feature families, and faster speeds sometimes + * have extended features. Families are K02 K10 K20 K22 K24 K30 K40 K50 K60 K64 K65 + * K66 K70 K80 + * + * So far only two variations/generations on the RTC have been discovered. + * GEN1 RTC_TSR TPR TAR TCR CR SR LR IER WAR RAR + * GEN2 RTC_TSR TPR TAR TCR CR SR LR IER TTSR MER MCLR MCHR WAR RAR + * + * KINETIS RTC_GEN1 K20P32-->K20P81M K22 K40 K50 K60@100Mhz K64 120MHz + * Assumed K10 K11 + * + * KINETIS_RTC_GEN2 K02 K20P144M K26P169 K60@120Mhz K65x K66x + * + * Note current naming doesn't allow GEN1:MK60FN...Q10 & GEN2:MK60FN...Q12 + */ + +#if defined(KINETIS_K26) || defined(KINETIS_K65) || defined(KINETIS_K66) +# define KINETIS_RTC_GEN2 #endif + +#define KINETIS_RTC_TSR_OFFSET 0x0000 /* RTC Time Seconds Register */ +#define KINETIS_RTC_TPR_OFFSET 0x0004 /* RTC Time Prescaler Register */ +#define KINETIS_RTC_TAR_OFFSET 0x0008 /* RTC Time Alarm Register */ +#define KINETIS_RTC_TCR_OFFSET 0x000c /* RTC Time Compensation Register */ +#define KINETIS_RTC_CR_OFFSET 0x0010 /* RTC Control Register */ +#define KINETIS_RTC_SR_OFFSET 0x0014 /* RTC Status Register */ +#define KINETIS_RTC_LR_OFFSET 0x0018 /* RTC Lock Register */ +#define KINETIS_RTC_IER_OFFSET 0x001c /* RTC Interrupt Enable Register (K40) */ + #ifdef KINETIS_K60 -# define KINETIS_RTC_CCR_OFFSET 0x001c /* RTC Chip Configuration Register (K60) */ + /* Haven't found a processor or nuttx file where KINETIS_RTC_CCR is in it + * from K60P100M100SF2V2RM this would be called KINETIS_RTC_IER_OFFSET. + */ + +# define KINETIS_RTC_CCR_OFFSET 0x001c /* RTC Chip Configuration Register (K60) */ #endif -#define KINETIS_RTC_WAR_OFFSET 0x0800 /* RTC Write Access Register */ -#define KINETIS_RTC_RAR_OFFSET 0x0804 /* RTC Read Access Register */ + +#ifdef KINETIS_RTC_GEN2 +# define KINETIS_RTC_TTSR_OFFSET 0x0020 /* RTC Tamper Times Seconds Register */ +# define KINETIS_RTC_MR_OFFSET 0x0024 /* RTC Monotonic Enable Register */ +# define KINETIS_RTC_MCLR_OFFSET 0x0028 /* RTC Monotonic Counter Low Register */ +# define KINETIS_RTC_MCHR_OFFSET 0x002c /* RTC Monotonic Counter High Register */ +#endif + +#define KINETIS_RTC_WAR_OFFSET 0x0800 /* RTC Write Access Register */ +#define KINETIS_RTC_RAR_OFFSET 0x0804 /* RTC Read Access Register */ /* Register Addresses ***************************************************************/ -#define KINETIS_RTC_TSR (KINETIS_RTC_BASE+KINETIS_RTC_TSR_OFFSET) -#define KINETIS_RTC_TPR (KINETIS_RTC_BASE+KINETIS_RTC_TPR_OFFSET) -#define KINETIS_RTC_TAR (KINETIS_RTC_BASE+KINETIS_RTC_TAR_OFFSET) -#define KINETIS_RTC_TCR (KINETIS_RTC_BASE+KINETIS_RTC_TCR_OFFSET) -#define KINETIS_RTC_CR (KINETIS_RTC_BASE+KINETIS_RTC_CR_OFFSET) -#define KINETIS_RTC_SR (KINETIS_RTC_BASE+KINETIS_RTC_SR_OFFSET) -#define KINETIS_RTC_LR (KINETIS_RTC_BASE+KINETIS_RTC_LR_OFFSET) -#if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64) -# define KINETIS_RTC_IER (KINETIS_RTC_BASE+KINETIS_RTC_IER_OFFSET) -#endif +#define KINETIS_RTC_TSR (KINETIS_RTC_BASE+KINETIS_RTC_TSR_OFFSET) +#define KINETIS_RTC_TPR (KINETIS_RTC_BASE+KINETIS_RTC_TPR_OFFSET) +#define KINETIS_RTC_TAR (KINETIS_RTC_BASE+KINETIS_RTC_TAR_OFFSET) +#define KINETIS_RTC_TCR (KINETIS_RTC_BASE+KINETIS_RTC_TCR_OFFSET) +#define KINETIS_RTC_CR (KINETIS_RTC_BASE+KINETIS_RTC_CR_OFFSET) +#define KINETIS_RTC_SR (KINETIS_RTC_BASE+KINETIS_RTC_SR_OFFSET) +#define KINETIS_RTC_LR (KINETIS_RTC_BASE+KINETIS_RTC_LR_OFFSET) +#define KINETIS_RTC_IER (KINETIS_RTC_BASE+KINETIS_RTC_IER_OFFSET) + #ifdef KINETIS_K60 -# define KINETIS_CCR_IER (KINETIS_RTC_BASE+KINETIS_RTC_CCR_OFFSET) +/* From K60P100M100SF2V2RM this would be called KINETIS_RTC_IER */ + +# define KINETIS_CCR_IER (KINETIS_RTC_BASE+KINETIS_RTC_CCR_OFFSET) +#endif + +#ifdef KINETIS_RTC_GEN2 +# define KINETIS_RTC_TTSR (KINETIS_RTC_BASE+KINETIS_RTC_TTSR_OFFSET) +# define KINETIS_RTC_MER (KINETIS_RTC_BASE+KINETIS_RTC_MER_OFFSET) +# define KINETIS_RTC_MCLR (KINETIS_RTC_BASE+KINETIS_RTC_MCLR_OFFSET) +# define KINETIS_RTC_MCHR (KINETIS_RTC_BASE+KINETIS_RTC_MCHR_OFFSET) #endif -#define KINETIS_RTC_WAR (KINETIS_RTC_BASE+KINETIS_RTC_WAR_OFFSET) -#define KINETIS_RTC_RAR (KINETIS_RTC_BASE+KINETIS_RTC_RAR_OFFSET) + +#define KINETIS_RTC_WAR (KINETIS_RTC_BASE+KINETIS_RTC_WAR_OFFSET) +#define KINETIS_RTC_RAR (KINETIS_RTC_BASE+KINETIS_RTC_RAR_OFFSET) /* Register Bit Definitions *********************************************************/ @@ -92,104 +133,133 @@ /* RTC Time Prescaler Register */ -#define RTC_TPR_SHIFT (0) /* Bits 0-15: Time Prescaler Register */ -#define RTC_TPR_MASK (0xffff << RTC_TPR_SHIFT) +#define RTC_TPR_SHIFT (0) /* Bits 0-15: Time Prescaler Register */ +#define RTC_TPR_MASK (0xffff << RTC_TPR_SHIFT) /* Bits 16-31: Reserved */ /* RTC Time Alarm Register (32-bits of time alarm) */ /* RTC Time Compensation Register (32-bits) */ -#define RTC_TCR_TCR_SHIFT (0) /* Bits 0-7: Time Compensation Register */ -#define RTC_TCR_TCR_MASK (0xff << RTC_TCR_CIR_MASK) -#define RTC_TCR_CIR_SHIFT (8) /* Bits 8-15: Compensation Interval Register */ -#define RTC_TCR_CIR_MASK (0xff << RTC_TCR_CIR_SHIFT) -#define RTC_TCR_TCV_SHIFT (16) /* Bits 16-23: Time Compensation Value */ -#define RTC_TCR_TCV_MASK (0xff << RTC_TCR_TCV_SHIFT) -#define RTC_TCR_CIC_SHIFT (24) /* Bits 24-31: Compensation Interval Counter */ -#define RTC_TCR_CIC_MASK (0xff << RTC_TCR_CIC_SHIFT) +#define RTC_TCR_TCR_SHIFT (0) /* Bits 0-7: Time Compensation Register */ +#define RTC_TCR_TCR_MASK (0xff << RTC_TCR_CIR_MASK) +#define RTC_TCR_CIR_SHIFT (8) /* Bits 8-15: Compensation Interval Register */ +#define RTC_TCR_CIR_MASK (0xff << RTC_TCR_CIR_SHIFT) +#define RTC_TCR_TCV_SHIFT (16) /* Bits 16-23: Time Compensation Value */ +#define RTC_TCR_TCV_MASK (0xff << RTC_TCR_TCV_SHIFT) +#define RTC_TCR_CIC_SHIFT (24) /* Bits 24-31: Compensation Interval Counter */ +#define RTC_TCR_CIC_MASK (0xff << RTC_TCR_CIC_SHIFT) /* RTC Control Register (32-bits) */ -#define RTC_CR_SWR (1 << 0) /* Bit 0: Software Reset */ -#define RTC_CR_WPE (1 << 1) /* Bit 1: Wakeup Pin Enable */ -#define RTC_CR_SUP (1 << 2) /* Bit 2: Supervisor Access */ -#define RTC_CR_UM (1 << 3) /* Bit 3: Update Mode */ - /* Bits 4-7: Reserved */ -#define RTC_CR_OSCE (1 << 8) /* Bit 8: Oscillator Enable */ -#define RTC_CR_CLKO (1 << 9) /* Bit 9: Clock Output */ -#define RTC_CR_SC16P (1 << 10) /* Bit 10: Oscillator 16pF load configure */ -#define RTC_CR_SC8P (1 << 11) /* Bit 11: Oscillator 8pF load configure */ -#define RTC_CR_SC4P (1 << 12) /* Bit 12: Oscillator 4pF load configure */ -#define RTC_CR_SC2P (1 << 13) /* Bit 13: Oscillator 2pF load configure */ - /* Bits 14-31: Reserved */ +#define RTC_CR_SWR (1 << 0) /* Bit 0: Software Reset */ +#define RTC_CR_WPE (1 << 1) /* Bit 1: Wakeup Pin Enable */ +#define RTC_CR_SUP (1 << 2) /* Bit 2: Supervisor Access */ +#define RTC_CR_UM (1 << 3) /* Bit 3: Update Mode */ + /* Bits 4-7: Reserved */ +#define RTC_CR_OSCE (1 << 8) /* Bit 8: Oscillator Enable */ +#define RTC_CR_CLKO (1 << 9) /* Bit 9: Clock Output */ +#define RTC_CR_SC16P (1 << 10) /* Bit 10: Oscillator 16pF load configure */ +#define RTC_CR_SC8P (1 << 11) /* Bit 11: Oscillator 8pF load configure */ +#define RTC_CR_SC4P (1 << 12) /* Bit 12: Oscillator 4pF load configure */ +#define RTC_CR_SC2P (1 << 13) /* Bit 13: Oscillator 2pF load configure */ + /* Bits 14-31: Reserved */ /* RTC Status Register (32-bits) */ -#define RTC_SR_TIF (1 << 0) /* Bit 0: Time Invalid Flag */ -#define RTC_SR_TOF (1 << 1) /* Bit 1: Time Overflow Flag */ - /* Bit 3: Reserved */ -#define RTC_SR_TAF (1 << 2) /* Bit 2: Time Alarm Flag */ -#define RTC_SR_TCE (1 << 4) /* Bit 4: Time Counter Enable */ - /* Bits 5-31: Reserved */ +#define RTC_SR_TIF (1 << 0) /* Bit 0: Time Invalid Flag */ +#define RTC_SR_TOF (1 << 1) /* Bit 1: Time Overflow Flag */ +#define RTC_SR_TAF (1 << 2) /* Bit 2: Time Alarm Flag */ + +#ifdef KINETIS_RTC_GEN2 +# define RTC_SR_MOF (1 << 3) /* Bit 3: Time Monotonic overflow Flag */ +#endif + /* Bit 3: Reserved RTC_GEN1 */ +#define RTC_SR_TCE (1 << 4) /* Bit 4: Time Counter Enable */ + /* Bits 5-31: Reserved */ /* RTC Lock Register (32-bits) */ - /* Bits 0-2: Reserved */ -#define RTC_LR_TCL (1 << 3) /* Bit 3: Time Compensation Lock */ -#define RTC_LR_CRL (1 << 4) /* Bit 4: Control Register Lock */ -#define RTC_LR_SRL (1 << 5) /* Bit 5: Status Register Lock */ -#if defined(KINETIS_K20) || defined(KINETIS_K40) -# define RTC_LR_LRL (1 << 6) /* Bit 6: Lock Register Lock (K40) */ + /* Bits 0-2: Reserved */ +#define RTC_LR_TCL (1 << 3) /* Bit 3: Time Compensation Lock */ +#define RTC_LR_CRL (1 << 4) /* Bit 4: Control Register Lock */ +#define RTC_LR_SRL (1 << 5) /* Bit 5: Status Register Lock */ +#define RTC_LR_LRL (1 << 6) /* Bit 6: Lock Register Lock */ + /* Bit 7: Reserved */ +#ifdef KINETIS_RTC_GEN2 +# define RTC_LR_TTSL (1 << 8) /* Bit 8: Tamper Time Seconds Lock */ +# define RTC_LR_MEL (1 << 9) /* Bit 9: Monotonic Enable lock */ +# define RTC_LR_MCLL (1 << 10) /* Bit 10: Monotoic Counter Low Lock */ +# define RTC_LR_MCHL (1 << 11) /* Bit 10: Monotoic Counter High Lock */ #endif - /* Bits 7-31: Reserved */ + /* Bits 12-31: Reserved */ /* RTC Interrupt Enable Register (32-bits, K40) */ -#if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64) -# define RTC_IER_TIIE (1 << 0) /* Bit 0: Time Invalid Interrupt Enable */ -# define RTC_IER_TOIE (1 << 1) /* Bit 1: Time Overflow Interrupt Enable */ -# define RTC_IER_TAIE (1 << 2) /* Bit 2: Time Alarm Interrupt Enable */ - /* Bit 3: Reserved */ -# define RTC_IER_TSIE (1 << 4) /* Bit 4: Time Seconds Interrupt Enable */ - /* Bits 5-31: Reserved */ +# define RTC_IER_TIIE (1 << 0) /* Bit 0: Time Invalid Interrupt Enable */ +# define RTC_IER_TOIE (1 << 1) /* Bit 1: Time Overflow Interrupt Enable */ +# define RTC_IER_TAIE (1 << 2) /* Bit 2: Time Alarm Interrupt Enable */ + +#ifdef KINETIS_RTC_GEN2 +# define RTC_IER_MOIE (1 << 3) /* Bit 3: Monotonic Overflow Interrupt Enable */ #endif -/* RTC Chip Configuration Register (32-bits,K60) */ +# define RTC_IER_TSIE (1 << 4) /* Bit 4: Time Seconds Interrupt Enable */ + /* Bits 5-6: Reserved */ +# define RTC_IER_WPON (1 << 7) /* Bit 7: Wakeup Pin On */ #ifdef KINETIS_K60 -# define RTC_CCR_CONFIG_SHIFT (0) /* Bits 0-7: Chip Configuration */ -# define RTC_CCR_CONFIG_MASK (0xff << RTC_CCR_CONFIG_SHIFT) - /* Bits 8-31: Reserved */ +/* RTC Chip Configuration Register (32-bits,K60) */ +/* Haven't found this in K60P100M100SF2V2RM */ + +# define RTC_CCR_CONFIG_SHIFT (0) /* Bits 0-7: Chip Configuration */ +# define RTC_CCR_CONFIG_MASK (0xff << RTC_CCR_CONFIG_SHIFT) + /* Bits 8-31: Reserved */ #endif /* RTC Write Access Register (32-bits) */ -#define RTC_WAR_TSRW (1 << 0) /* Bit 0: Time Seconds Register Write */ -#define RTC_WAR_TPRW (1 << 1) /* Bit 1: Time Prescaler Register Write */ -#define RTC_WAR_TARW (1 << 2) /* Bit 2: Time Alarm Register Write */ -#define RTC_WAR_TCRW (1 << 3) /* Bit 3: Time Compensation Register Write */ -#define RTC_WAR_CRW (1 << 4) /* Bit 4: Control Register Write */ -#define RTC_WAR_SRW (1 << 5) /* Bit 5: Status Register Write */ -#define RTC_WAR_LRW (1 << 6) /* Bit 6: Lock Register Write */ -#if defined(KINETIS_K40) || defined(KINETIS_K64) -# define RTC_WAR_IERW (1 << 7) /* Bit 7: Interrupt Enable Register Write */ -#endif +#define RTC_WAR_TSRW (1 << 0) /* Bit 0: Time Seconds Register Write */ +#define RTC_WAR_TPRW (1 << 1) /* Bit 1: Time Prescaler Register Write */ +#define RTC_WAR_TARW (1 << 2) /* Bit 2: Time Alarm Register Write */ +#define RTC_WAR_TCRW (1 << 3) /* Bit 3: Time Compensation Register Write */ +#define RTC_WAR_CRW (1 << 4) /* Bit 4: Control Register Write */ +#define RTC_WAR_SRW (1 << 5) /* Bit 5: Status Register Write */ +#define RTC_WAR_LRW (1 << 6) /* Bit 6: Lock Register Write */ +#define RTC_WAR_IERW (1 << 7) /* Bit 7: Interrupt Enable Register Write */ + #ifdef KINETIS_K60 -# define RTC_WAR_CCRW (1 << 7) /* Bit 7: Chip Config Register Write */ +/* This looks like old name, from K60P100M100SF2V2RM bit 7 would be called RTC_RAR_IERW */ + +# define RTC_WAR_CCRW (1 << 7) /* Bit 7: Chip Config Register Write */ #endif - /* Bits 8-31: Reserved */ + /* Bits 8-31: Reserved */ /* RTC Read Access Register */ -#define RTC_RAR_TSRR (1 << 0) /* Bit 0: Time Seconds Register Read */ -#define RTC_RAR_TPRR (1 << 1) /* Bit 1: Time Prescaler Register Read */ -#define RTC_RAR_TARR (1 << 2) /* Bit 2: Time Alarm Register Read */ -#define RTC_RAR_TCRR (1 << 3) /* Bit 3: Time Compensation Register Read */ -#define RTC_RAR_CRR (1 << 4) /* Bit 4: Control Register Read */ -#define RTC_RAR_SRR (1 << 5) /* Bit 5: Status Register Read */ -#define RTC_RAR_LRR (1 << 6) /* Bit 6: Lock Register Read */ -#if defined(KINETIS_K40) || defined(KINETIS_K64) -# define RTC_RAR_IERR (1 << 7) /* Bit 7: Interrupt Enable Register Read */ -#endif +#define RTC_RAR_TSRR (1 << 0) /* Bit 0: Time Seconds Register Read */ +#define RTC_RAR_TPRR (1 << 1) /* Bit 1: Time Prescaler Register Read */ +#define RTC_RAR_TARR (1 << 2) /* Bit 2: Time Alarm Register Read */ +#define RTC_RAR_TCRR (1 << 3) /* Bit 3: Time Compensation Register Read */ +#define RTC_RAR_CRR (1 << 4) /* Bit 4: Control Register Read */ +#define RTC_RAR_SRR (1 << 5) /* Bit 5: Status Register Read */ +#define RTC_RAR_LRR (1 << 6) /* Bit 6: Lock Register Read */ +#define RTC_RAR_IERR (1 << 7) /* Bit 7: Interrupt Enable Register Read */ + #ifdef KINETIS_K60 -# define RTC_RAR_CCRR (1 << 7) /* Bit 7: Chip Config Register Read */ +/* This is possibly an old name, from K60P100M100SF2V2RM bit 7 would be called + * RTC_RAR_IERR. + */ + +# define RTC_RAR_CCRR (1 << 7) /* Bit 7: Chip Config Register Read */ +#endif + +#ifdef KINETIS_RTC_GEN2 +# define RTC_RAR_TTSR (1 << 8) /* Bit 8: Tamper Time Seconds Read */ +# define RTC_RAR_MERR (1 << 9) /* Bit 9: Monotonic Enable Read */ +# define RTC_RAR_MCLR (1 << 10) /* Bit 10: Monotoic Counter Low Register Read */ +# define RTC_RAR_MCHR (1 << 11) /* Bit 10: Monotoic Counter High Register Read */ +#endif + /* Bits 11-31: Reserved */ + +#if defined(KINETIS_RTC_GEN2)/* && defined(CONFIG_RTC_MAGIC) */ +# define CONFIG_RTC_MAGICL 0xfacefee0 +# define CONFIG_RTC_MAGICH 0xef32a141 #endif - /* Bits 8-31: Reserved */ /************************************************************************************ * Public Types diff --git a/arch/arm/src/kinetis/kinetis_alarm.h b/arch/arm/src/kinetis/kinetis_alarm.h index 751cfd8cf059b6f5669a090563b478da97931de8..3815e374c88a63fad966c400193d985def48271b 100644 --- a/arch/arm/src/kinetis/kinetis_alarm.h +++ b/arch/arm/src/kinetis/kinetis_alarm.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/kinetis/kinetis_alarm.h * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Matias v01d * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,34 @@ typedef CODE void (*alarmcb_t)(void); +/* These features are in KinetisK 1st generation + * Time Alarm Interrupt + * Time Overflow Interrupt + * Time Seconds Interrupt + * + * For KinetisK 2nd Generation devices + * 64bit Monotonic register. + */ + +enum alm_id_e +{ + /* Used for indexing - must be sequential */ + + RTC_ALARMA = 0, /* RTC ALARM A */ + RTC_ALARMM, /* FUT: RTC Monotonic */ + RTC_ALARM_LAST +}; + +/* Structure used to pass parmaters to set an alarm */ + +struct alm_setalarm_s +{ + int as_id; /* enum alm_id_e */ + struct tm as_time; /* Alarm expiration time */ + alarmcb_t as_cb; /* Callback (if non-NULL) */ + FAR void *as_arg; /* Argument for callback */ +}; + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -84,7 +112,6 @@ extern "C" * ****************************************************************************/ -struct timespec; int kinetis_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback); /**************************************************************************** @@ -103,6 +130,30 @@ int kinetis_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback); int kinetis_rtc_cancelalarm(void); +/**************************************************************************** + * Name: kinetis_rtc_lowerhalf + * + * Description: + * Instantiate the RTC lower half driver for the Kinetis. General usage: + * + * #include + * #include "kinetis_rtc.h> + * + * struct rtc_lowerhalf_s *lower; + * lower = kinetis_rtc_lowerhalf(); + * rtc_initialize(0, lower); + * + * Input Parameters: + * None + * + * Returned Value: + * On success, a non-NULL RTC lower interface is returned. + * NULL is returned on any failure. + * + ****************************************************************************/ + +FAR struct rtc_lowerhalf_s *kinetis_rtc_lowerhalf(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/arch/arm/src/kinetis/kinetis_clockconfig.c b/arch/arm/src/kinetis/kinetis_clockconfig.c index 7d3d6ecb22ac812bdbd19921a4d6dc01b99662ff..bac16f218b9b8473a49fab2fcf440983c8002fce 100644 --- a/arch/arm/src/kinetis/kinetis_clockconfig.c +++ b/arch/arm/src/kinetis/kinetis_clockconfig.c @@ -152,7 +152,7 @@ void kinetis_pllconfig(void) */ #ifdef BOARD_FRDIV - putreg8(BOARD_FRDIV | MCG_C1_CLKS_EXTREF, KINETIS_MCG_C1); + putreg8((BOARD_FRDIV << MCG_C1_FRDIV_SHIFT) | MCG_C1_CLKS_EXTREF, KINETIS_MCG_C1); #else putreg8(MCG_C1_FRDIV_DIV256 | MCG_C1_CLKS_EXTREF, KINETIS_MCG_C1); #endif diff --git a/arch/arm/src/kinetis/kinetis_config.h b/arch/arm/src/kinetis/kinetis_config.h index 1ce2e7ee5e3e6b80a4a27aec8b5d92e861e44791..daa15e5ff69133b3114ac706b4d51fce1fcf2893 100644 --- a/arch/arm/src/kinetis/kinetis_config.h +++ b/arch/arm/src/kinetis/kinetis_config.h @@ -80,7 +80,7 @@ #undef HAVE_UART_DEVICE #if defined(CONFIG_KINETIS_UART0) || defined(CONFIG_KINETIS_UART1) || \ defined(CONFIG_KINETIS_UART2) || defined(CONFIG_KINETIS_UART3) || \ - defined(CONFIG_KINETIS_UART5) + defined(CONFIG_KINETIS_UART4) || defined(CONFIG_KINETIS_UART5) # define HAVE_UART_DEVICE 1 #endif diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index a546103d365c28a712b090ab0e8a3e44921fd7fa..30707e47ac1ecb885d0410eb8424397ca623cfe7 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -53,14 +53,11 @@ #include #include #include +#include #include #include #include -#ifdef CONFIG_NET_NOINTS -# include -#endif - #ifdef CONFIG_NET_PKT # include #endif @@ -84,13 +81,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_KINETIS_EMAC_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_KINETIS_EMAC_LPWORK) @@ -119,10 +115,6 @@ #define NENET_NBUFFERS \ (CONFIG_KINETIS_ENETNTXBUFFERS+CONFIG_KINETIS_ENETNRXBUFFERS) -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required in the configuration" -#endif - /* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per * second. */ @@ -223,9 +215,7 @@ struct kinetis_driver_s uint8_t phyaddr; /* Selected PHY address */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif struct enet_desc_s *txdesc; /* A pointer to the list of TX descriptor */ struct enet_desc_s *rxdesc; /* A pointer to the list of RX descriptors */ @@ -283,24 +273,15 @@ static int kinetis_txpoll(struct net_driver_s *dev); static void kinetis_receive(FAR struct kinetis_driver_s *priv); static void kinetis_txdone(FAR struct kinetis_driver_s *priv); -static inline void kinetis_interrupt_process(FAR struct kinetis_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void kinetis_interrupt_work(FAR void *arg); -#endif static int kinetis_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void kinetis_txtimeout_process(FAR struct kinetis_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void kinetis_txtimeout_work(FAR void *arg); -#endif static void kinetis_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void kinetis_poll_process(FAR struct kinetis_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void kinetis_poll_work(FAR void *arg); -#endif static void kinetis_polltimer_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ @@ -308,10 +289,7 @@ static void kinetis_polltimer_expiry(int argc, uint32_t arg, ...); static int kinetis_ifup(struct net_driver_s *dev); static int kinetis_ifdown(struct net_driver_s *dev); -static inline void kinetis_txavail_process(FAR struct kinetis_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void kinetis_txavail_work(FAR void *arg); -#endif static int kinetis_txavail(struct net_driver_s *dev); #ifdef CONFIG_NET_IGMP @@ -828,27 +806,31 @@ static void kinetis_txdone(FAR struct kinetis_driver_s *priv) } /**************************************************************************** - * Function: kinetis_interrupt_process + * Function: kinetis_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * The network is locked. * ****************************************************************************/ -static inline void kinetis_interrupt_process(FAR struct kinetis_driver_s *priv) +static void kinetis_interrupt_work(FAR void *arg) { + FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; uint32_t pending; + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Get the set of unmasked, pending interrupt. */ pending = getreg32(KINETIS_ENET_EIR) & getreg32(KINETIS_ENET_EIMR); @@ -896,36 +878,8 @@ static inline void kinetis_interrupt_process(FAR struct kinetis_driver_s *priv) putreg32(ENET_RDAR, KINETIS_ENET_RDAR); } -} -/**************************************************************************** - * Function: kinetis_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void kinetis_interrupt_work(FAR void *arg) -{ - FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - kinetis_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ @@ -936,7 +890,6 @@ static void kinetis_interrupt_work(FAR void *arg) up_enable_irq(KINETIS_IRQ_EMACRX); up_enable_irq(KINETIS_IRQ_EMACMISC); } -#endif /**************************************************************************** * Function: kinetis_interrupt @@ -962,7 +915,6 @@ static int kinetis_interrupt(int irq, FAR void *context) { register FAR struct kinetis_driver_s *priv = &g_enet[0]; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. Because Ethernet interrupts are * also disabled if the TX timeout event occurs, there can be no race * condition here. @@ -991,37 +943,33 @@ static int kinetis_interrupt(int irq, FAR void *context) /* Schedule to perform the interrupt processing on the worker thread. */ work_queue(ETHWORK, &priv->work, kinetis_interrupt_work, priv, 0); - -#else - /* Process the interrupt now */ - - kinetis_interrupt_process(priv); -#endif - return OK; } /**************************************************************************** - * Function: kinetis_txtimeout_process + * Function: kinetis_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success + * + * Assumptions: + * The network is locked. * ****************************************************************************/ -static inline void kinetis_txtimeout_process(FAR struct kinetis_driver_s *priv) +static void kinetis_txtimeout_work(FAR void *arg) { + FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; + /* Increment statistics and dump debug info */ + net_lock(); NETDEV_TXTIMEOUTS(&priv->dev); /* Take the interface down and bring it back up. The is the most agressive @@ -1034,39 +982,9 @@ static inline void kinetis_txtimeout_process(FAR struct kinetis_driver_s *priv) /* Then poll the network for new XMIT data */ (void)devif_poll(&priv->dev, kinetis_txpoll); + net_unlock(); } -/**************************************************************************** - * Function: kinetis_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void kinetis_txtimeout_work(FAR void *arg) -{ - FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - kinetis_txtimeout_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: kinetis_txtimeout_expiry * @@ -1090,7 +1008,6 @@ static void kinetis_txtimeout_expiry(int argc, uint32_t arg, ...) { FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -1110,36 +1027,34 @@ static void kinetis_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, kinetis_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - kinetis_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: kinetis_poll_process + * Function: kinetis_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static inline void kinetis_poll_process(FAR struct kinetis_driver_s *priv) +static void kinetis_poll_work(FAR void *arg) { + FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; + /* Check if there is there is a transmission in progress. We cannot perform * the TX poll if he are unable to accept another packet for transmission. */ + net_lock(); if (!kinetics_txringfull(priv)) { /* If so, update TCP timing states and poll the network for new XMIT data. Hmmm.. @@ -1154,39 +1069,9 @@ static inline void kinetis_poll_process(FAR struct kinetis_driver_s *priv) (void)wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, 1, (wdparm_t)priv); + net_unlock(); } -/**************************************************************************** - * Function: kinetis_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void kinetis_poll_work(FAR void *arg) -{ - FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - kinetis_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: kinetis_polltimer_expiry * @@ -1209,7 +1094,6 @@ static void kinetis_polltimer_expiry(int argc, uint32_t arg, ...) { FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -1229,12 +1113,6 @@ static void kinetis_polltimer_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, KINETIS_WDDELAY, kinetis_polltimer_expiry, 1, (wdparm_t)arg); } - -#else - /* Process the interrupt now */ - - kinetis_poll_process(priv); -#endif } /**************************************************************************** @@ -1421,29 +1299,29 @@ static int kinetis_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: kinetis_txavail_process + * Function: kinetis_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void kinetis_txavail_process(FAR struct kinetis_driver_s *priv) +static void kinetis_txavail_work(FAR void *arg) { - net_lock_t state; + FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; /* Ignore the notification if the interface is not yet up */ - state = net_lock(); + net_lock(); if (priv->bifup) { /* Check if there is room in the hardware to hold another outgoing @@ -1460,37 +1338,9 @@ static inline void kinetis_txavail_process(FAR struct kinetis_driver_s *priv) } } - net_unlock(state); + net_unlock(); } -/**************************************************************************** - * Function: kinetis_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void kinetis_txavail_work(FAR void *arg) -{ - FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)arg; - - /* Perform the poll */ - - kinetis_txavail_process(priv); -} -#endif - /**************************************************************************** * Function: kinetis_txavail * @@ -1515,7 +1365,6 @@ static int kinetis_txavail(struct net_driver_s *dev) FAR struct kinetis_driver_s *priv = (FAR struct kinetis_driver_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -1528,12 +1377,6 @@ static int kinetis_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, kinetis_txavail_work, priv, 0); } -#else - /* Perform the out-of-cycle poll now */ - - kinetis_txavail_process(priv); -#endif - return OK; } diff --git a/arch/arm/src/kinetis/kinetis_rtc.c b/arch/arm/src/kinetis/kinetis_rtc.c index ca0f4848d19ff0f48ffe15434596d89ef8ff116e..19db2796b44cb71a5f8ca888f9e0c125e21e6188 100644 --- a/arch/arm/src/kinetis/kinetis_rtc.c +++ b/arch/arm/src/kinetis/kinetis_rtc.c @@ -60,12 +60,23 @@ #if defined(CONFIG_RTC) +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#if !defined(BOARD_RTC_CAP) +/* Capacitance values 8pF if not already defined */ + +# define BOARD_RTC_CAP RTC_CR_SC8P | RTC_CR_SC4P +#endif + /**************************************************************************** * Private Data ****************************************************************************/ #ifdef CONFIG_RTC_ALARM static alarmcb_t g_alarmcb; +static bool rtc_irq_state = false; #endif /**************************************************************************** @@ -78,6 +89,73 @@ volatile bool g_rtc_enabled = false; * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: rtc_dumpregs + * + * Description: + * Disable RTC write protection + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_RTC_INFO +static void rtc_dumpregs(FAR const char *msg) +{ + rtcinfo("%s:\n", msg); + rtcinfo(" TSR: %08x\n", getreg32(KINETIS_RTC_TSR)); + rtcinfo(" TPR: %08x\n", getreg32(KINETIS_RTC_TPR)); + rtcinfo(" TAR: %08x\n", getreg32(KINETIS_RTC_TAR)); + rtcinfo(" CR: %08x\n", getreg32(KINETIS_RTC_CR)); + rtcinfo(" SR: %08x\n", getreg32(KINETIS_RTC_SR)); + rtcinfo(" LR: %08x\n", getreg32(KINETIS_RTC_LR)); + rtcinfo(" IER: %08x\n", getreg32(KINETIS_RTC_IER)); +#if defined(KINETIS_RTC_GEN2) + rtcinfo(" TTSR: %08x\n", getreg32(KINETIS_RTC_TTSR)); + rtcinfo(" MER: %08x\n", getreg32(KINETIS_RTC_MER)); + rtcinfo(" MCLR: %08x\n", getreg32(KINETIS_RTC_MCLR)); + rtcinfo(" MCHR: %08x\n", getreg32(KINETIS_RTC_MCHR)); + rtcinfo(" WAR: %08x\n", getreg32(KINETIS_RTC_WAR)); + rtcinfo(" RAR: %08x\n", getreg32(KINETIS_RTC_RAR)); +#endif +} +#else +# define rtc_dumpregs(msg) +#endif + +/**************************************************************************** + * Name: rtc_dumptime + * + * Description: + * Disable RTC write protection + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_RTC_INFO +static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg) +{ + rtcinfo("%s:\n", msg); + rtcinfo(" tm_sec: %08x\n", tp->tm_sec); + rtcinfo(" tm_min: %08x\n", tp->tm_min); + rtcinfo(" tm_hour: %08x\n", tp->tm_hour); + rtcinfo(" tm_mday: %08x\n", tp->tm_mday); + rtcinfo(" tm_mon: %08x\n", tp->tm_mon); + rtcinfo(" tm_year: %08x\n", tp->tm_year); +} +#else +# define rtc_dumptime(tp, msg) +#endif + /**************************************************************************** * Name: kinetis_rtc_interrupt * @@ -96,27 +174,119 @@ volatile bool g_rtc_enabled = false; #if defined(CONFIG_RTC_ALARM) static int kinetis_rtc_interrupt(int irq, void *context) { - if (g_alarmcb != NULL) + uint16_t rtc_sr; + + /* if alarm */ + rtc_sr = getreg32( KINETIS_RTC_SR); + if (rtc_sr & RTC_SR_TAF ) { - /* Alarm callback */ + if (g_alarmcb != NULL) + { + /* Alarm callback */ - g_alarmcb(); - g_alarmcb = NULL; + g_alarmcb(); + g_alarmcb = NULL; + } + } + else + { + /* other interrupts are serious and should leave a turd + * + * RTC_SR_TIF _TOF _MOF + */ + + rtcwarn("unexp int src=0x%x, num=", rtc_sr); } /* Clear pending flags, disable alarm */ - putreg32(0, KINETIS_RTC_TAR); /* unset alarm (resets flags) */ - putreg32(0, KINETIS_RTC_IER); /* disable alarm interrupt */ + putreg32(0, KINETIS_RTC_TAR); /* Unset alarm (resets flags) */ + putreg32(0, KINETIS_RTC_IER); /* Disable alarm interrupt */ return 0; } #endif +/**************************************************************************** + * Name: RTC_Reset + * + * Description: + * Reset the RTC to known state + * + * Input Parameters: + * none + * + * Returned Value: + * none + * + ****************************************************************************/ + +static inline void RTC_Reset(void) +{ + putreg32(( RTC_CR_SWR | getreg32(KINETIS_RTC_CR)),KINETIS_RTC_CR); + putreg32((~RTC_CR_SWR & getreg32(KINETIS_RTC_CR)),KINETIS_RTC_CR); + + /* Set TSR register to 0x1 to avoid the timer invalid (TIF) bit being + * set in the SR register + */ + + putreg32(1,KINETIS_RTC_TSR); +} + /**************************************************************************** * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: up_rtc_irqinit + * + * Description: + * Initialize the hardware RTC irq. +* This only needs to be called once when first used. + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ****************************************************************************/ + +#if defined(CONFIG_RTC_ALARM) +int up_rtc_irq_attach(void) +{ + uint32_t rtc_sr; + + if (!rtc_irq_state) + { + rtc_irq_state=true; + + /* Clear TAF if pending */ + + rtc_sr = getreg32( KINETIS_RTC_SR); + if (rtc_sr & RTC_SR_TAF ) + { + putreg32(0, KINETIS_RTC_TAR); + } + + /* Enable alarm interrupts. + * This will not work if part of up_rtc_initialize() + * as it is called very early in initialization BEFORE the interrupt + * system will be enabled. All interrupts will disabled later when + * the interrupt system is disabled. This must be done later when the + * alarm is first set. + * + * KINETIS_IRQ_RTCS is a separate interrupt for seconds if needed + */ + + irq_attach(KINETIS_IRQ_RTC, kinetis_rtc_interrupt); + up_enable_irq(KINETIS_IRQ_RTC); + } + + return OK; +} +#endif + /**************************************************************************** * Name: up_rtc_initialize * @@ -134,7 +304,8 @@ static int kinetis_rtc_interrupt(int irq, void *context) int up_rtc_initialize(void) { - int regval; + uint32_t regval; + bool rtc_valid = false; /* Enable RTC module */ @@ -142,16 +313,64 @@ int up_rtc_initialize(void) regval |= SIM_SCGC6_RTC; putreg32(regval, KINETIS_SIM_SCGC6); - /* Disable counters (just in case) */ + regval = getreg32(KINETIS_RTC_SR); + if (!(regval & RTC_SR_TIF)) + { +#ifdef KINETIS_RTC_GEN2 + /* Check if the one-time initialization of the RTC has already been + * performed. We can determine this by checking if the magic number + * has been writing to to back-up date register DR0. + */ + + regval = getreg32(KINETIS_RTC_MCLR); + if ((CONFIG_RTC_MAGICL == regval ) && + (CONFIG_RTC_MAGICH == getreg32(KINETIS_RTC_MCHR)) ) +#endif + { + rtc_valid = true; + } + } + + if (rtc_valid) + { + rtcinfo("Do resume\n"); + + /* RTC already set-up, just resume normal operation */ + + rtc_dumpregs("Did resume"); + } + else + { + rtcinfo("Do setup\n"); + RTC_Reset(); + +#ifdef KINETIS_RTC_GEN2 + /* Configure the RTC to be initialized */ + + putreg32(CONFIG_RTC_MAGICL, KINETIS_RTC_MCLR); + putreg32(CONFIG_RTC_MAGICH, KINETIS_RTC_MCHR); +#endif - putreg32(0, KINETIS_RTC_SR); + /* Setup the update mode and supervisor access mode */ - /* Enable oscilator */ - /* capacitance values from teensyduino */ + putreg32((~(RTC_CR_UM|RTC_CR_SUP) & getreg32(KINETIS_RTC_CR)), + KINETIS_RTC_CR); - putreg32(RTC_CR_SC16P | RTC_CR_SC4P | RTC_CR_OSCE, KINETIS_RTC_CR); + /* Disable counters (just in case) */ - /* TODO: delay some time (1024 cycles? would be 30ms) */ + putreg32(0, KINETIS_RTC_SR); + + /* Enable oscilator - must have Vbat else hard fault */ + + putreg32((BOARD_RTC_CAP | RTC_CR_OSCE ), KINETIS_RTC_CR); + + /* TODO - add capability to accurately tune RTC + * This is a per individual board customization and requires + * parameters to be configurable and stored in non-volatile eg flash. + */ + + /* TODO: delay some time (1024 cycles? would be 30ms) */ + } /* Disable interrupts */ @@ -163,17 +382,6 @@ int up_rtc_initialize(void) putreg32(getreg32(KINETIS_RTC_TSR), KINETIS_RTC_TSR); -#if defined(CONFIG_RTC_ALARM) - /* Enable alarm interrupts. REVISIT: This will not work. up_rtc_initialize() - * is called very early in initialization BEFORE the interrupt system will be - * enabled. All interrupts will disabled later when the interrupt system is - * disabled. This must be done later when the alarm is first set. - */ - - irq_attach(KINETIS_IRQ_RTC, kinetis_rtc_interrupt); - up_enable_irq(KINETIS_IRQ_RTC); -#endif - /* Enable counters */ putreg32(RTC_SR_TCE, KINETIS_RTC_SR); @@ -319,12 +527,18 @@ int kinetis_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback) g_alarmcb = callback; + /* ensure irq is attached */ + + up_rtc_irq_attach(); + /* Enable and set RTC alarm */ putreg32(tp->tv_sec, KINETIS_RTC_TAR); /* Set alarm (also resets * flags) */ putreg32(RTC_IER_TAIE, KINETIS_RTC_IER); /* Enable alarm interrupt */ + rtc_dumpregs("set alarmtime"); + return OK; } else diff --git a/arch/arm/src/kinetis/kinetis_rtc_if.h b/arch/arm/src/kinetis/kinetis_rtc_if.h new file mode 100644 index 0000000000000000000000000000000000000000..78dd7774f2e72657f0164c0baaa65d63c99bf6c9 --- /dev/null +++ b/arch/arm/src/kinetis/kinetis_rtc_if.h @@ -0,0 +1,150 @@ +/**************************************************************************** + * arch/arm/src/kinetis/kinetis_rtc_if.h + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Neil Hancock + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + ****************************************************************************/ + +#ifndef __ARCH_ARM_SRC_KINETIS_KINETIS_RTC_IF_H +#define __ARCH_ARM_SRC_KINETIS_KINETIS_RTC_IF_H + +#include + +#include "chip.h" + +/* Kinetis parts all have a simple battery-backed 32bit counter for its RTC + * KINETIS_RTC_GEN2 have + * a Tamper Time seconds - 32bibt + * a MONOTONC seconds which is used is 2*32bit registers + * + */ + +#include "kinetis_alarm.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: KINETIS_rtc_getdatetime_with_subseconds + * + * Description: + * Get the current date and time from the date/time RTC. This interface + * is only supported by the date/time RTC hardware implementation. + * It is used to replace the system timer. It is only used by the RTOS + * during initialization to set up the system time when CONFIG_RTC and + * CONFIG_RTC_DATETIME are selected (and CONFIG_RTC_HIRES is not). + * + * NOTE: Some date/time RTC hardware is capability of sub-second accuracy. + * Thatsub-second accuracy is returned through 'nsec'. + * + * Input Parameters: + * tp - The location to return the high resolution time value. + * nsec - The location to return the subsecond time value. + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ****************************************************************************/ + +#ifdef CONFIG_KINETIS_HAVE_RTC_SUBSECONDS +int KINETIS_rtc_getdatetime_with_subseconds(FAR struct tm *tp, FAR long *nsec); +#endif + +/**************************************************************************** + * Name: KINETIS_rtc_setdatetime + * + * Description: + * Set the RTC to the provided time. RTC implementations which provide + * up_rtc_getdatetime() (CONFIG_RTC_DATETIME is selected) should provide + * this function. + * + * Input Parameters: + * tp - the time to use + * + * Returned Value: + * Zero (OK) on success; a negated errno on failure + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_DATETIME +struct tm; +int kinetis_rtc_setdatetime(FAR const struct tm *tp); +#endif + +/**************************************************************************** + * Name: KINETIS_rtc_lowerhalf + * + * Description: + * Instantiate the RTC lower half driver for the KINETIS. General usage: + * + * #include + * #include "KINETIS_rtc.h> + * + * struct rtc_lowerhalf_s *lower; + * lower = KINETIS_rtc_lowerhalf(); + * rtc_initialize(0, lower); + * + * Input Parameters: + * None + * + * Returned Value: + * On success, a non-NULL RTC lower interface is returned. NULL is + * returned on any failure. + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_DRIVER +FAR struct rtc_lowerhalf_s *kinetis_rtc_lowerhalf(void); +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __ARCH_ARM_SRC_KINETIS_KINETIS_RTC_IF_H */ diff --git a/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c b/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c new file mode 100644 index 0000000000000000000000000000000000000000..961a212b6a8123189986fe1c0a9a1f3b9fe0d94b --- /dev/null +++ b/arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c @@ -0,0 +1,525 @@ +/**************************************************************************** + * arch/arm/src/kinetis/kinetis_rtc_lowerhalf.c + * + * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Updates for kinetis by Neil Hancock + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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. + * + ****************************************************************************/ + +/* REVISIT: This driver is *not* thread-safe! */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "chip.h" +#include "kinetis_rtc_if.h" +#include "kinetis_alarm.h" + +#ifdef CONFIG_RTC_DRIVER + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +#ifdef CONFIG_RTC_ALARM +struct kinetis_cbinfo_s +{ + volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */ + volatile FAR void *priv; /* Private argurment to accompany callback */ +}; +#endif + +/* This is the private type for the RTC state. It must be cast compatible + * with struct rtc_lowerhalf_s. + */ + +struct kinetis_lowerhalf_s +{ + /* This is the contained reference to the read-only, lower-half + * operations vtable (which may lie in FLASH or ROM) + */ + + FAR const struct rtc_ops_s *ops; + + /* Data following is private to this driver and not visible outside of + * this file. + */ + +#ifdef CONFIG_RTC_ALARM + /* Alarm callback information */ + + struct kinetis_cbinfo_s cbinfo; +#endif +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/* Prototypes for static methods in struct rtc_ops_s */ + +static int kinetis_rdtime(FAR struct rtc_lowerhalf_s *lower, + FAR struct rtc_time *rtctime); +static int kinetis_settime(FAR struct rtc_lowerhalf_s *lower, + FAR const struct rtc_time *rtctime); + +#ifdef CONFIG_RTC_ALARM +static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower, + FAR const struct lower_setalarm_s *alarminfo); +static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower, + FAR const struct lower_setrelative_s *alarminfo); +static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, + int alarmid); +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Kinetis RTC driver operations */ + +static const struct rtc_ops_s g_rtc_ops = +{ + .rdtime = kinetis_rdtime, + .settime = kinetis_settime, +#ifdef CONFIG_RTC_ALARM + .setalarm = kinetis_setalarm, + .setrelative = kinetis_setrelative, + .cancelalarm = kinetis_cancelalarm, +#endif +#ifdef CONFIG_RTC_IOCTL + .ioctl = NULL, +#endif +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + .destroy = NULL, +#endif +}; + +/* Kinetis RTC device operations */ + +static struct kinetis_lowerhalf_s g_rtc_lowerhalf = +{ + .ops = &g_rtc_ops, +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: kinetis_alarm_callback + * + * Description: + * This is the function that is called from the RTC driver when the alarm + * goes off. It just invokes the upper half drivers callback. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_ALARM +static void kinetis_alarm_callback(void) +{ + FAR struct kinetis_cbinfo_s *cbinfo = &g_rtc_lowerhalf.cbinfo;/*[0];*/ + + /* Sample and clear the callback information to minimize the window in + * time in which race conditions can occur. + */ + + rtc_alarm_callback_t cb = (rtc_alarm_callback_t)cbinfo->cb; + FAR void *arg = (FAR void *)cbinfo->priv; + + cbinfo->cb = NULL; + cbinfo->priv = NULL; + + /* Perform the callback */ + + if (cb != NULL) + { + cb(arg, 0); + } +} +#endif /* CONFIG_RTC_ALARM */ + +/**************************************************************************** + * Name: kinetis_rdtime + * + * Description: + * Implements the rdtime() method of the RTC driver interface + * + * Input Parameters: + * lower - A reference to RTC lower half driver state structure + * rtctime - The location in which to return the current RTC time. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned + * on any failure. + * + ****************************************************************************/ + +static int kinetis_rdtime(FAR struct rtc_lowerhalf_s *lower, + FAR struct rtc_time *rtctime) +{ +#if defined(CONFIG_RTC_DATETIME) + /* This operation depends on the fact that struct rtc_time is cast + * compatible with struct tm. + */ + + return up_rtc_getdatetime((FAR struct tm *)rtctime); + +#elif defined(CONFIG_RTC_HIRES) + FAR struct timespec ts; + int ret; + + /* Get the higher resolution time */ + + ret = up_rtc_gettime(&ts); + if (ret < 0) + { + goto errout_with_errno; + } + + /* Convert the one second epoch time to a struct tm. This operation + * depends on the fact that struct rtc_time and struct tm are cast + * compatible. + */ + + if (!gmtime_r(&ts.tv_sec, (FAR struct tm *)rtctime)) + { + goto errout_with_errno; + } + + return OK; + +errout_with_errno: + ret = get_errno(); + DEBUGASSERT(ret > 0); + return -ret; + +#else + time_t timer; + + /* The resolution of time is only 1 second */ + + timer = up_rtc_time(); + + /* Convert the one second epoch time to a struct tm */ + + if (!gmtime_r(&timer, (FAR struct tm *)rtctime)) + { + int errcode = get_errno(); + DEBUGASSERT(errcode > 0); + return -errcode; + } + + return OK; +#endif +} + +/**************************************************************************** + * Name: kinetis_settime + * + * Description: + * Implements the settime() method of the RTC driver interface + * + * Input Parameters: + * lower - A reference to RTC lower half driver state structure + * rcttime - The new time to set + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned + * on any failure. + * + ****************************************************************************/ + +static int kinetis_settime(FAR struct rtc_lowerhalf_s *lower, + FAR const struct rtc_time *rtctime) +{ + struct timespec ts; + + /* Convert the struct rtc_time to a time_t. Here we assume that struct + * rtc_time is cast compatible with struct tm. + */ + + ts.tv_sec = mktime((FAR struct tm *)rtctime); + ts.tv_nsec = 0; + + /* Set the time (to one second accuracy) */ + + return up_rtc_settime(&ts); +} + +/**************************************************************************** + * Name: kinetis_setalarm + * + * Description: + * Set a new alarm. This function implements the setalarm() method of the + * RTC driver interface + * + * Input Parameters: + * lower - A reference to RTC lower half driver state structure + * alarminfo - Provided information needed to set the alarm + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned + * on any failure. + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_ALARM +static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower, + FAR const struct lower_setalarm_s *alarminfo) +{ + FAR struct kinetis_lowerhalf_s *priv; + FAR struct kinetis_cbinfo_s *cbinfo; + + struct timespec tp; + + int ret = -EINVAL; + + /* ID0-> Alarm A supported */ + + DEBUGASSERT(lower != NULL && alarminfo != NULL); + priv = (FAR struct kinetis_lowerhalf_s *)lower; + + if (alarminfo->id == RTC_ALARMA ) + { + /* Remember the callback information */ + + cbinfo = &priv->cbinfo; + cbinfo->cb = alarminfo->cb; + cbinfo->priv = alarminfo->priv; + + /* Convert from Julian calendar time to epoch time */ + + tp.tv_sec = mktime((FAR struct tm *)&alarminfo->time) ; + + /* And set the alarm */ + + ret = kinetis_rtc_setalarm(&tp, kinetis_alarm_callback); + if (ret < 0) + { + cbinfo->cb = NULL; + cbinfo->priv = NULL; + } + } + + return ret; +} +#endif + +/**************************************************************************** + * Name: kinetis_setrelative + * + * Description: + * Set a new alarm relative to the current time. This function implements + * the setrelative() method of the RTC driver interface + * + * Input Parameters: + * lower - A reference to RTC lower half driver state structure + * alarminfo - Provided information needed to set the alarm + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned + * on any failure. + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_ALARM +static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower, + FAR const struct lower_setrelative_s *alarminfo) +{ + struct lower_setalarm_s setalarm; +#if defined(CONFIG_RTC_DATETIME) + struct tm time; +#endif + time_t seconds; + struct timespec ts; + int ret = -EINVAL; + + ASSERT(lower != NULL && alarminfo != NULL); + DEBUGASSERT(alarminfo->id == RTC_ALARMA); + + if ((alarminfo->id == RTC_ALARMA ) && + alarminfo->reltime > 0) + { + /* Disable pre-emption while we do this so that we don't have to worry + * about being suspended and working on an old time. + */ + + sched_lock(); + +#if defined(CONFIG_RTC_DATETIME) + /* Get the broken out time and convert to seconds */ + + ret = up_rtc_getdatetime(&time); + if (ret < 0) + { + sched_unlock(); + return ret; + } + + ts.tv_sec = mktime(&time); + ts.tv_nsec = 0; +#else + /* Get the current time in broken out format */ + + ret = up_rtc_gettime(&ts); + if (ret < 0) + { + sched_unlock(); + return ret; + } +#endif + /* Convert to seconds since the epoch */ + + seconds = ts.tv_sec; + + /* Add the seconds offset. Add one to the number of seconds + * because we are unsure of the phase of the timer. + */ + + seconds += (alarminfo->reltime + 1); + + /* And convert the time back to Julian/broken out format */ + + (void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time); + + /* The set the alarm using this absolute time */ + + setalarm.id = alarminfo->id; + setalarm.cb = alarminfo->cb; + setalarm.priv = alarminfo->priv; + + ret = kinetis_setalarm(lower, &setalarm); + + sched_unlock(); + } + + return ret; +} +#endif + +/**************************************************************************** + * Name: kinetis_cancelalarm + * + * Description: + * Cancel the current alarm. This function implements the cancelalarm() + * method of the RTC driver interface + * + * Input Parameters: + * lower - A reference to RTC lower half driver state structure + * alarminfo - Provided information needed to set the alarm + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned + * on any failure. + * + ****************************************************************************/ + +#ifdef CONFIG_RTC_ALARM +static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid) +{ + FAR struct kinetis_lowerhalf_s *priv; + FAR struct kinetis_cbinfo_s *cbinfo; + int ret = -EINVAL; + + DEBUGASSERT(lower != NULL); + DEBUGASSERT(alarmid == RTC_ALARMA); + priv = (FAR struct kinetis_lowerhalf_s *)lower; + + /* ID0-> Alarm A */ + + if (alarmid == RTC_ALARMA) + { + /* Nullify callback information to reduce window for race conditions */ + + cbinfo = &priv->cbinfo; + cbinfo->cb = NULL; + cbinfo->priv = NULL; + + /* Then cancel the alarm */ + + ret = kinetis_rtc_cancelalarm(); + + } + + return ret; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: kinetis_rtc_lowerhalf + * + * Description: + * Instantiate the RTC lower half driver for the Kinetis. General usage: + * + * #include + * #include "kinetis_rtc.h> + * + * struct rtc_lowerhalf_s *lower; + * lower = kinetis_rtc_lowerhalf(); + * rtc_initialize(0, lower); + * + * Input Parameters: + * None + * + * Returned Value: + * On success, a non-NULL RTC lower interface is returned. + * NULL is returned on any failure. + * + ****************************************************************************/ + +FAR struct rtc_lowerhalf_s *kinetis_rtc_lowerhalf(void) +{ + return (FAR struct rtc_lowerhalf_s *)&g_rtc_lowerhalf; +} + +#endif /* CONFIG_RTC_DRIVER */ diff --git a/arch/arm/src/kinetis/kinetis_serial.c b/arch/arm/src/kinetis/kinetis_serial.c index 53fd7e2b4ab32418dd048d393a7ca5dd1c1771c7..94966f72a2727e2cac93ec2098f931a1401e669e 100644 --- a/arch/arm/src/kinetis/kinetis_serial.c +++ b/arch/arm/src/kinetis/kinetis_serial.c @@ -875,7 +875,7 @@ static int up_interrupts(int irq, void *context) else #endif #ifdef CONFIG_KINETIS_UART5 - if (g_uart5priv.irq == irqs) + if (g_uart5priv.irqs == irq) { dev = &g_uart5port; } diff --git a/arch/arm/src/kl/Make.defs b/arch/arm/src/kl/Make.defs index d7712f0983c2a868e54f756ff21d1c2e02cfc830..6af672fd4656fc33c8355e7398b62b4e3a8c4713 100644 --- a/arch/arm/src/kl/Make.defs +++ b/arch/arm/src/kl/Make.defs @@ -70,7 +70,7 @@ CMN_CSRCS += up_dumpnvic.c endif CHIP_ASRCS = -CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c kl_getc.c +CHIP_CSRCS = kl_clockconfig.c kl_gpio.c kl_idle.c kl_irq.c CHIP_CSRCS += kl_lowputc.c kl_serial.c kl_start.c kl_cfmconfig.c ifneq ($(CONFIG_SCHED_TICKLESS),y) diff --git a/arch/arm/src/lpc11xx/Make.defs b/arch/arm/src/lpc11xx/Make.defs index a347d99946db688d542fd0710eff486accc2a8be..d9fcb5e1526d502b979fb38cc6548fe5af44e35a 100644 --- a/arch/arm/src/lpc11xx/Make.defs +++ b/arch/arm/src/lpc11xx/Make.defs @@ -71,7 +71,7 @@ endif CHIP_ASRCS = CHIP_CSRCS = lpc11_clockconfig.c lpc11_gpio.c lpc11_i2c.c lpc11_idle.c -CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_getc.c lpc11_serial.c +CHIP_CSRCS += lpc11_irq.c lpc11_lowputc.c lpc11_serial.c CHIP_CSRCS += lpc11_spi.c lpc11_ssp.c lpc11_start.c # Configuration-dependent LPC11xx files diff --git a/arch/arm/src/lpc11xx/lpc11_getc.h b/arch/arm/src/lpc11xx/lpc11_getc.h deleted file mode 100644 index e00864bfc48b573ef4cb6a97939473b6935b05ac..0000000000000000000000000000000000000000 --- a/arch/arm/src/lpc11xx/lpc11_getc.h +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************************ - * arch/arm/src/lpc11/lpc11_getc.h - * - * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H -#define __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#include "lpc11_serial.h" -#include "chip/lpc11_uart.h" - -#endif /* __ARCH_ARM_SRC_LPC11XX_LPC11_GETC_H */ diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index 20568f0457f7efa62315da17bca90be2222b56dc..dd1652bf18d4dcb9db9fb52b97880d13dc838606 100644 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -136,7 +136,7 @@ # endif /* LPC17_HAVE_BANK1 && LPC17_BANK1_HEAPSIZE */ # else /* !LPC17_BANK0_HEAPSIZE */ - /* We have Bnak 0, but no memory is available for the heap there. + /* We have Bank 0, but no memory is available for the heap there. * Do we have Bank 1? Is any heap memory available in Bank 1? */ diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index d5ff009fd6d87bad32e8ec5cab42fc77e68d9fde..fa9b65a95f5aada65923915789761a0e096d8067 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -52,15 +52,12 @@ #include #include #include +#include #include #include #include #include -#ifdef CONFIG_NET_NOINTS -# include -#endif - #ifdef CONFIG_NET_PKT # include #endif @@ -87,13 +84,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_LPC17_ETHERNET_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_LPC17_ETHERNET_LPWORK) @@ -138,6 +134,8 @@ # define CONFIG_NET_PRIORITY NVIC_SYSH_PRIORITY_DEFAULT #endif +#define PKTBUF_SIZE (MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE) + /* Debug Configuration *****************************************************/ /* Register debug -- can only happen of CONFIG_DEBUG_NET_INFO is selected */ @@ -274,12 +272,10 @@ struct lpc17_driver_s WDOG_ID lp_txpoll; /* TX poll timer */ WDOG_ID lp_txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s lp_txwork; /* TX work continuation */ struct work_s lp_rxwork; /* RX work continuation */ struct work_s lp_pollwork; /* Poll work continuation */ uint32_t status; -#endif /* CONFIG_NET_NOINTS */ /* This holds the information visible to the NuttX networking layer */ @@ -290,6 +286,10 @@ struct lpc17_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer per interface is used */ + +static uint8_t g_pktbuf[PKTBUF_SIZE * CONFIG_LPC17_NINTERFACES]; + /* Array of ethernet driver status structures */ static struct lpc17_driver_s g_ethdrvr[CONFIG_LPC17_NINTERFACES]; @@ -332,26 +332,17 @@ static int lpc17_txpoll(struct net_driver_s *dev); /* Interrupt handling */ static void lpc17_response(struct lpc17_driver_s *priv); -static void lpc17_rxdone_process(struct lpc17_driver_s *priv); -static void lpc17_txdone_process(struct lpc17_driver_s *priv); -#ifdef CONFIG_NET_NOINTS + static void lpc17_txdone_work(FAR void *arg); static void lpc17_rxdone_work(FAR void *arg); -#endif /* CONFIG_NET_NOINTS */ static int lpc17_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void lpc17_txtimeout_process(FAR struct lpc17_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void lpc17_txtimeout_work(FAR void *arg); -#endif /* CONFIG_NET_NOINTS */ static void lpc17_txtimeout_expiry(int argc, uint32_t arg, ...); -static void lpc17_poll_process(FAR struct lpc17_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void lpc17_poll_work(FAR void *arg); -#endif /* CONFIG_NET_NOINTS */ static void lpc17_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ @@ -362,11 +353,9 @@ static void lpc17_ipv6multicast(FAR struct lpc17_driver_s *priv); static int lpc17_ifup(struct net_driver_s *dev); static int lpc17_ifdown(struct net_driver_s *dev); -static void lpc17_txavail_process(FAR struct lpc17_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void lpc17_txavail_work(FAR void *arg); -#endif static int lpc17_txavail(struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static uint32_t lpc17_calcethcrc(const uint8_t *data, size_t length); static int lpc17_addmac(struct net_driver_s *dev, const uint8_t *mac); @@ -654,6 +643,7 @@ static int lpc17_transmit(struct lpc17_driver_s *priv) prodidx = 0; } + lpc17_putreg(prodidx, LPC17_ETH_TXPRODIDX); /* Enable Tx interrupts */ @@ -798,30 +788,40 @@ static void lpc17_response(struct lpc17_driver_s *priv) } /**************************************************************************** - * Function: lpc17_rxdone_process + * Function: lpc17_rxdone_work * * Description: - * An interrupt was received indicating the availability of a new RX packet + * Perform Rx interrupt handling logic outside of the interrupt handler (on + * the work queue thread). * * Parameters: - * priv - Reference to the driver state structure + * arg - The reference to the driver structure (case to void*) * * Returned Value: * None * * Assumptions: - * Global interrupts are disabled by interrupt handling logic. * ****************************************************************************/ -static void lpc17_rxdone_process(struct lpc17_driver_s *priv) +static void lpc17_rxdone_work(FAR void *arg) { - uint32_t *rxstat; - bool fragment; + FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; + irqstate_t flags; + uint32_t *rxstat; + bool fragment; unsigned int prodidx; unsigned int considx; unsigned int pktlen; + DEBUGASSERT(priv); + + /* Perform pending RX work. RX interrupts were disabled prior to + * scheduling this work to prevent work queue overruns. + */ + + net_lock(); + /* Get the current producer and consumer indices */ considx = lpc17_getreg(LPC17_ETH_RXCONSIDX) & ETH_RXCONSIDX_MASK; @@ -844,7 +844,7 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) pktlen = (*rxstat & RXSTAT_INFO_RXSIZE_MASK) - 3; /* Check for errors. NOTE: The DMA engine reports bogus length errors, - * making this a pretty useless check. + * making this a pretty useless (as well as annoying) check. */ if ((*rxstat & RXSTAT_INFO_ERROR) != 0) @@ -1035,37 +1035,55 @@ static void lpc17_rxdone_process(struct lpc17_driver_s *priv) lpc17_putreg(considx, LPC17_ETH_RXCONSIDX); prodidx = lpc17_getreg(LPC17_ETH_RXPRODIDX) & ETH_RXPRODIDX_MASK; } + + net_unlock(); + + /* Re-enable RX interrupts (this must be atomic). Skip this step if the + * lp-txpending TX underrun state is in effect. + */ + + flags = enter_critical_section(); + if (!priv->lp_txpending) + { + priv->lp_inten |= ETH_RXINTS; + lpc17_putreg(priv->lp_inten, LPC17_ETH_INTEN); + } + + leave_critical_section(flags); } + /**************************************************************************** - * Function: lpc17_txdone_process + * Function: lpc17_txdone_work * * Description: - * An interrupt was received indicating that the last TX packet(s) is done + * Perform Tx interrupt handling logic outside of the interrupt handler (on + * the work queue thread). * * Parameters: - * priv - Reference to the driver state structure + * arg - The reference to the driver structure (case to void*) * * Returned Value: * None * - * Assumptions: - * Global interrupts are disabled by interrupt handling logic. - * ****************************************************************************/ -static void lpc17_txdone_process(struct lpc17_driver_s *priv) +static void lpc17_txdone_work(FAR void *arg) { + FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; + /* Verify that the hardware is ready to send another packet. Since a Tx * just completed, this must be the case. */ + DEBUGASSERT(priv); DEBUGASSERT(lpc17_txdesc(priv) == OK); /* Check if there is a pending Tx transfer that was scheduled by Rx handling * while the Tx logic was busy. If so, processing that pending Tx now. */ + net_lock(); if (priv->lp_txpending) { /* Clear the pending condition, send the packet, and restore Rx interrupts */ @@ -1084,73 +1102,9 @@ static void lpc17_txdone_process(struct lpc17_driver_s *priv) { (void)devif_poll(&priv->lp_dev, lpc17_txpoll); } -} -/**************************************************************************** - * Function: lpc17_txdone_work and lpc17_rxdone_work - * - * Description: - * Perform interrupt handling logic outside of the interrupt handler (on - * the work queue thread). - * - * Parameters: - * arg - The reference to the driver structure (case to void*) - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc17_txdone_work(FAR void *arg) -{ - FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; - net_lock_t state; - - DEBUGASSERT(priv); - - /* Perform pending TX work. At this point TX interrupts are disable but - * may be re-enabled again depending on the actions of - * lpc17_txdone_process(). - */ - - state = net_lock(); - lpc17_txdone_process(priv); - net_unlock(state); -} - -static void lpc17_rxdone_work(FAR void *arg) -{ - FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; - irqstate_t flags; - net_lock_t state; - - DEBUGASSERT(priv); - - /* Perform pending RX work. RX interrupts were disabled prior to - * scheduling this work to prevent work queue overruns. - */ - - state = net_lock(); - lpc17_rxdone_process(priv); - net_unlock(state); - - /* Re-enable RX interrupts (this must be atomic). Skip this step if the - * lp-txpending TX underrun state is in effect. - */ - - flags = enter_critical_section(); - if (!priv->lp_txpending) - { - priv->lp_inten |= ETH_RXINTS; - lpc17_putreg(priv->lp_inten, LPC17_ETH_INTEN); - } - - leave_critical_section(flags); + net_unlock(); } -#endif /* CONFIG_NET_NOINTS */ /**************************************************************************** * Function: lpc17_interrupt @@ -1236,7 +1190,7 @@ static int lpc17_interrupt(int irq, void *context) * or Overrun. NOTE: (1) We will still need to call lpc17_rxdone_process * on RX errors to bump the considx over the bad packet. (2) The * DMA engine reports bogus length errors, making this a pretty - * useless check anyway. + * useless (as well as annoying) check anyway. */ if ((status & ETH_INT_RXERR) != 0) @@ -1260,8 +1214,6 @@ static int lpc17_interrupt(int irq, void *context) if ((status & ETH_INT_RXFIN) != 0 || (status & ETH_INT_RXDONE) != 0) { /* We have received at least one new incoming packet. */ - -#ifdef CONFIG_NET_NOINTS /* Disable further TX interrupts for now. TX interrupts will * be re-enabled after the work has been processed. */ @@ -1277,11 +1229,6 @@ static int lpc17_interrupt(int irq, void *context) work_queue(ETHWORK, &priv->lp_rxwork, (worker_t)lpc17_rxdone_work, priv, 0); - -#else /* CONFIG_NET_NOINTS */ - lpc17_rxdone_process(priv); - -#endif /* CONFIG_NET_NOINTS */ } /* Check for Tx events ********************************************/ @@ -1330,7 +1277,6 @@ static int lpc17_interrupt(int irq, void *context) priv->lp_inten &= ~ETH_TXINTS; lpc17_putreg(priv->lp_inten, LPC17_ETH_INTEN); -#ifdef CONFIG_NET_NOINTS /* Cancel any pending TX done work (to prevent overruns and also * to avoid race conditions with the TX timeout work) */ @@ -1350,13 +1296,6 @@ static int lpc17_interrupt(int irq, void *context) work_queue(ETHWORK, &priv->lp_txwork, (worker_t)lpc17_txdone_work, priv, 0); - -#else /* CONFIG_NET_NOINTS */ - /* Perform the TX work at the interrupt level */ - - lpc17_txdone_process(priv); - -#endif /* CONFIG_NET_NOINTS */ } } } @@ -1375,26 +1314,29 @@ static int lpc17_interrupt(int irq, void *context) } /**************************************************************************** - * Function: lpc17_txtimeout_process + * Function: lpc17_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success + * + * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static void lpc17_txtimeout_process(FAR struct lpc17_driver_s *priv) +static void lpc17_txtimeout_work(FAR void *arg) { + FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; + /* Increment statistics and dump debug info */ + net_lock(); NETDEV_TXTIMEOUTS(&priv->lp_dev); if (priv->lp_ifup) { @@ -1408,38 +1350,9 @@ static void lpc17_txtimeout_process(FAR struct lpc17_driver_s *priv) (void)devif_poll(&priv->lp_dev, lpc17_txpoll); } -} -/**************************************************************************** - * Function: lpc17_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc17_txtimeout_work(FAR void *arg) -{ - FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - lpc17_txtimeout_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: lpc17_txtimeout_expiry @@ -1471,7 +1384,6 @@ static void lpc17_txtimeout_expiry(int argc, uint32_t arg, ...) priv->lp_inten &= ~ETH_TXINTS; lpc17_putreg(priv->lp_inten, LPC17_ETH_INTEN); -#ifdef CONFIG_NET_NOINTS /* Is the single TX work structure available? If not, then there is * pending TX work to be done this must be a false alarm TX timeout. */ @@ -1482,33 +1394,28 @@ static void lpc17_txtimeout_expiry(int argc, uint32_t arg, ...) work_queue(ETHWORK, &priv->lp_txwork, lpc17_txtimeout_work, priv, 0); } - -#else - /* Process the timeout now */ - - lpc17_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: lpc17_poll_process + * Function: lpc17_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static void lpc17_poll_process(FAR struct lpc17_driver_s *priv) +static void lpc17_poll_work(FAR void *arg) { + FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; unsigned int prodidx; unsigned int considx; @@ -1516,6 +1423,7 @@ static void lpc17_poll_process(FAR struct lpc17_driver_s *priv) * the TX poll if he are unable to accept another packet for transmission. */ + net_lock(); if (lpc17_txdesc(priv) == OK) { /* If so, update TCP timing states and poll the network layer for new @@ -1537,54 +1445,17 @@ static void lpc17_poll_process(FAR struct lpc17_driver_s *priv) if (considx != prodidx) { -#ifdef CONFIG_NET_NOINTS work_queue(ETHWORK, &priv->lp_rxwork, (worker_t)lpc17_rxdone_work, priv, 0); - -#else /* CONFIG_NET_NOINTS */ - lpc17_rxdone_process(priv); - -#endif /* CONFIG_NET_NOINTS */ } /* Setup the watchdog poll timer again */ (void)wd_start(priv->lp_txpoll, LPC17_WDDELAY, lpc17_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: lpc17_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc17_poll_work(FAR void *arg) -{ - FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - lpc17_poll_process(priv); - net_unlock(state); -} -#endif - - /**************************************************************************** * Function: lpc17_poll_expiry * @@ -1609,7 +1480,6 @@ static void lpc17_poll_expiry(int argc, uint32_t arg, ...) DEBUGASSERT(arg); -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -1628,12 +1498,6 @@ static void lpc17_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->lp_txpoll, LPC17_WDDELAY, lpc17_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - lpc17_poll_process(priv); -#endif } /**************************************************************************** @@ -1925,29 +1789,29 @@ static int lpc17_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: lpc17_txavail_process + * Function: lpc17_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void lpc17_txavail_process(FAR struct lpc17_driver_s *priv) +static void lpc17_txavail_work(FAR void *arg) { - net_lock_t state; + FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; /* Ignore the notification if the interface is not yet up */ - state = net_lock(); + net_lock(); if (priv->lp_ifup) { /* Check if there is room in the hardware to hold another outgoing packet. */ @@ -1960,36 +1824,8 @@ static inline void lpc17_txavail_process(FAR struct lpc17_driver_s *priv) } } - net_unlock(state); -} - -/**************************************************************************** - * Function: lpc17_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc17_txavail_work(FAR void *arg) -{ - FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)arg; - - /* Perform the poll */ - - lpc17_txavail_process(priv); + net_unlock(); } -#endif /**************************************************************************** * Function: lpc17_txavail @@ -2014,7 +1850,6 @@ static int lpc17_txavail(struct net_driver_s *dev) { FAR struct lpc17_driver_s *priv = (FAR struct lpc17_driver_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single poll work structure available? It may not be if there * are pending polling actions and we will have to ignore the Tx * availability action (which is okay because all poll actions have, @@ -2028,13 +1863,6 @@ static int lpc17_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->lp_pollwork, lpc17_txavail_work, priv, 0); } -#else - - /* Perform the out-of-cycle poll now */ - - lpc17_txavail_process(priv); -#endif - return OK; } @@ -3206,6 +3034,7 @@ static inline int lpc17_ethinitialize(int intf) #endif { struct lpc17_driver_s *priv; + uint8_t *pktbuf; uint32_t regval; int ret; int i; @@ -3225,11 +3054,17 @@ static inline int lpc17_ethinitialize(int intf) { (void)lpc17_configgpio(g_enetpins[i]); } + lpc17_showpins(); + /* Select the packet buffer */ + + pktbuf = &g_pktbuf[PKTBUF_SIZE * intf]; + /* Initialize the driver structure */ memset(priv, 0, sizeof(struct lpc17_driver_s)); + priv->lp_dev.d_buf = pktbuf; /* Single packet buffer */ priv->lp_dev.d_ifup = lpc17_ifup; /* I/F down callback */ priv->lp_dev.d_ifdown = lpc17_ifdown; /* I/F up (new IP address) callback */ priv->lp_dev.d_txavail = lpc17_txavail; /* New TX data callback */ @@ -3237,7 +3072,7 @@ static inline int lpc17_ethinitialize(int intf) priv->lp_dev.d_addmac = lpc17_addmac; /* Add multicast MAC address */ priv->lp_dev.d_rmmac = lpc17_rmmac; /* Remove multicast MAC address */ #endif - priv->lp_dev.d_private = (void *)priv; /* Used to recover private state from dev */ + priv->lp_dev.d_private = (void *)priv; /* Used to recover private state from dev */ #if CONFIG_LPC17_NINTERFACES > 1 # error "A mechanism to associate base address an IRQ with an interface is needed" diff --git a/arch/arm/src/lpc17xx/lpc17_sdcard.c b/arch/arm/src/lpc17xx/lpc17_sdcard.c index 532c8ed35d9232a3630048339c25ba46adbaa2e3..b4b555f5dedbeeace377ce35bef1cd3af4372db4 100644 --- a/arch/arm/src/lpc17xx/lpc17_sdcard.c +++ b/arch/arm/src/lpc17xx/lpc17_sdcard.c @@ -2086,6 +2086,7 @@ static int lpc17_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo rlong[2] = getreg32(LPC17_SDCARD_RESP2); rlong[3] = getreg32(LPC17_SDCARD_RESP3); } + return ret; } diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig index c063fd86c7398d4532464d1f0be792c37fa13cac..b597090dca72b545afafc5c0ed597c563d7cb07c 100644 --- a/arch/arm/src/lpc43xx/Kconfig +++ b/arch/arm/src/lpc43xx/Kconfig @@ -269,8 +269,9 @@ config LPC43_SSP1 default n config LPC43_TMR0 - bool "ADC1" + bool "Timer 0" default n + select LPC43_TIMER config LPC43_TMR1 bool "Timer 1" @@ -279,10 +280,17 @@ config LPC43_TMR1 config LPC43_TMR2 bool "Timer 2" default n + select LPC43_TIMER config LPC43_TMR3 bool "Timer 3" default n + select LPC43_TIMER + +config LPC43_TIMER + bool + default n + select ARCH_HAVE_EXTCLK config LPC43_USART0 bool "USART0" diff --git a/arch/arm/src/lpc43xx/Make.defs b/arch/arm/src/lpc43xx/Make.defs index 79ddaa4a0226213a2aa473fb097f75b1742852a0..c0d95a279982438156a4ac445da6e0851db795b0 100644 --- a/arch/arm/src/lpc43xx/Make.defs +++ b/arch/arm/src/lpc43xx/Make.defs @@ -154,6 +154,10 @@ CHIP_CSRCS += lpc43_ssp.c endif endif +ifeq ($(CONFIG_LPC43_TIMER),y) +CHIP_CSRCS += lpc43_timer.c +endif + ifeq ($(CONFIG_LPC43_RIT),y) CHIP_CSRCS += lpc43_rit.c endif @@ -196,4 +200,4 @@ CHIP_CSRCS += lpc43_usb0dev.c endif endif --include chip/spifi/src/Make.defs \ No newline at end of file +-include chip/spifi/src/Make.defs diff --git a/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h index 708ecfa8624c05f05d5485d019e9de28691828c0..23380f60e31f30c7da85e735bff7a86bae837c74 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h @@ -603,23 +603,23 @@ #define PINCONF_QEI_PHA (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_3) #define PINCONF_QEI_PHB (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_2) -#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_13) -#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_8) -#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_0) -#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_6) -#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_10) -#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_9) -#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_4) -#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_10) -#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_5) -#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_11) -#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_6) -#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_12) -#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_7) -#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_11) -#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_12) -#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_13) -#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_14) +#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_13) +#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_8) +#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_0) +#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_6) +#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_10) +#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_9) +#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_10) +#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_5) +#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_11) +#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_6) +#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_12) +#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_7) +#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_11) +#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_12) +#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_13) +#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_14) #define PINCONF_SD_POW_1 (PINCONF_FUNC5|PINCONF_PINSD|PINCONF_PIN_1) #define PINCONF_SD_POW_2 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_5) #define PINCONF_SD_POW_3 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_9) diff --git a/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h index cf3fcd221325321521d584de99d4d509e601b548..fb63978ec3deb5cecbbcc478e0c53ca0e6614c96 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h @@ -603,23 +603,23 @@ #define PINCONF_QEI_PHA (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_3) #define PINCONF_QEI_PHB (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_2) -#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_13) -#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_8) -#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_0) -#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_6) -#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_10) -#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_9) -#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_4) -#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_10) -#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_5) -#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_11) -#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_6) -#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_12) -#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_7) -#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_11) -#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_12) -#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_13) -#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_14) +#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_13) +#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_8) +#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_0) +#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_6) +#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_10) +#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_9) +#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_10) +#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_5) +#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_11) +#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_6) +#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_12) +#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_7) +#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_11) +#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_12) +#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_13) +#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_14) #define PINCONF_SD_POW_1 (PINCONF_FUNC5|PINCONF_PINSD|PINCONF_PIN_1) #define PINCONF_SD_POW_2 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_5) #define PINCONF_SD_POW_3 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_9) diff --git a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h index 41a5d939540821ecaeb11f894aede1747f2aa223..0c9a37a0ff79cb418c96bb7b73090ac793738ae7 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h @@ -603,23 +603,23 @@ #define PINCONF_QEI_PHA (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_3) #define PINCONF_QEI_PHB (PINCONF_FUNC1|PINCONF_PINSA|PINCONF_PIN_2) -#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_13) -#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_8) -#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_0) -#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_6) -#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_10) -#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_9) -#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_4) -#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_10) -#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_5) -#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_11) -#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_6) -#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_12) -#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_7) -#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_11) -#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_12) -#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_13) -#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_14) +#define PINCONF_SD_CD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_13) +#define PINCONF_SD_CD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_8) +#define PINCONF_SD_CLK (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_0) +#define PINCONF_SD_CMD_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_6) +#define PINCONF_SD_CMD_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_10) +#define PINCONF_SD_DAT0_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_9) +#define PINCONF_SD_DAT0_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_SD_DAT1_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_10) +#define PINCONF_SD_DAT1_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_5) +#define PINCONF_SD_DAT2_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_11) +#define PINCONF_SD_DAT2_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_6) +#define PINCONF_SD_DAT3_1 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_12) +#define PINCONF_SD_DAT3_2 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_7) +#define PINCONF_SD_DAT4 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_11) +#define PINCONF_SD_DAT5 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_12) +#define PINCONF_SD_DAT6 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_13) +#define PINCONF_SD_DAT7 (PINCONF_FUNC7|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_14) #define PINCONF_SD_POW_1 (PINCONF_FUNC5|PINCONF_PINSD|PINCONF_PIN_1) #define PINCONF_SD_POW_2 (PINCONF_FUNC7|PINCONF_PINS1|PINCONF_PIN_5) #define PINCONF_SD_POW_3 (PINCONF_FUNC7|PINCONF_PINSC|PINCONF_PIN_9) diff --git a/arch/arm/src/lpc43xx/chip/lpc43_gpdma.h b/arch/arm/src/lpc43xx/chip/lpc43_gpdma.h index 2139e09766f17c545223e04560c080ded3305eb3..e9912534dd584dc4bf1eda4bd18737c26b2b3842 100644 --- a/arch/arm/src/lpc43xx/chip/lpc43_gpdma.h +++ b/arch/arm/src/lpc43xx/chip/lpc43_gpdma.h @@ -70,12 +70,12 @@ #define LPC43_GPDMA_CONTROL_CHOFFSET 0x000c /* DMA Channel Control Register */ #define LPC43_GPDMA_CONFIG_CHOFFSET 0x0010 /* DMA Channel Configuration Register */ -#define LPC43_GPDMA_CHOFFSET(n) (0x0100 ((n) << 5)) +#define LPC43_GPDMA_CHOFFSET(n) (0x0100 + ((n) << 5)) #define LPC43_GPDMA_SRCADDR_OFFSET(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_SRCADDR_CHOFFSET) #define LPC43_GPDMA_DESTADDR_OFFSET(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_DESTADDR_CHOFFSET) #define LPC43_GPDMA_LLI_OFFSET(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_LLI_CHOFFSET) #define LPC43_GPDMA_CONTROL_OFFSET(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_CONTROL_CHOFFSET) -#define LPC43_GPDMA_CONFIG_OFFSET(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_CONFIG_CHOFFSET) +#define LPC43_GPDMA_CONFIG_OFFSET_(n) (LPC43_GPDMA_CHOFFSET(n)+LPC43_GPDMA_CONFIG_CHOFFSET) #define LPC43_GPDMA_SRCADDR0_OFFSET 0x0100 /* DMA Channel 0 Source Address Register */ #define LPC43_GPDMA_DESTADDR0_OFFSET 0x0104 /* DMA Channel 0 Destination Address Register */ @@ -149,7 +149,7 @@ #define LPC43_GPDMA_DESTADDR(n) (LPC43_DMA_BASE+LPC43_GPDMA_DESTADDR_OFFSET(n)) #define LPC43_GPDMA_LLI(n) (LPC43_DMA_BASE+LPC43_GPDMA_LLI_OFFSET(n)) #define LPC43_GPDMA_CONTROL(n) (LPC43_DMA_BASE+LPC43_GPDMA_CONTROL_OFFSET(n)) -#define LPC43_GPDMA_CONFIG(n) (LPC43_DMA_BASE+LPC43_GPDMA_CONFIG_OFFSET(n)) +#define LPC43_GPDMA_CONFIG_(n) (LPC43_DMA_BASE+LPC43_GPDMA_CONFIG_OFFSET_(n)) #define LPC43_GPDMA_SRCADDR0 (LPC43_DMA_BASE+LPC43_GPDMA_SRCADDR0_OFFSET) #define LPC43_GPDMA_DESTADDR0 (LPC43_DMA_BASE+LPC43_GPDMA_DESTADDR0_OFFSET) @@ -203,6 +203,9 @@ /* Common macros for DMA channel and source bit settings */ +#define DMACH_ALL (0xff) +#define LPC43_NDMACH 8 /* Eight DMA channels */ +#define LPC43_NDMAREQ (16) /* The number of DMA requests */ #define GPDMA_CHANNEL(n) (1 << (n)) /* Bits 0-7 correspond to DMA channel 0-7 */ #define GPDMA_SOURCE(n) (1 << (n)) /* Bits 0-15 correspond to DMA source 0-15 */ #define GPDMA_REQUEST(n) (1 << (n)) /* Bits 0-15 correspond to DMA request 0-15 */ diff --git a/arch/arm/src/lpc43xx/chip/lpc43_sdmmc.h b/arch/arm/src/lpc43xx/chip/lpc43_sdmmc.h index 1236d82f31c886e49a05955fb308388b999cd12f..05a51178fb24852294c8290ea145ac081cef7b82 100644 --- a/arch/arm/src/lpc43xx/chip/lpc43_sdmmc.h +++ b/arch/arm/src/lpc43xx/chip/lpc43_sdmmc.h @@ -143,10 +143,11 @@ #define SDMMC_CTRL_CEATAINT (1 << 11) /* Bit 11: CE-ATA device interrupts enabled */ /* Bits 12-15: Reserved */ #define SDMMC_CTRL_CDVA0 (1 << 16) /* Bit 16: Controls SD_VOLT0 pin */ -#define SDMMC_CTRL_CDVA0 (1 << 17) /* Bit 17: Controls SD_VOLT1 pin */ -#define SDMMC_CTRL_CDVA0 (1 << 18) /* Bit 18: Controls SD_VOLT2 pin */ +#define SDMMC_CTRL_CDVA1 (1 << 17) /* Bit 17: Controls SD_VOLT1 pin */ +#define SDMMC_CTRL_CDVA2 (1 << 18) /* Bit 18: Controls SD_VOLT2 pin */ /* Bits 19-23: Reserved */ -#define SDMMC_CTRL_INTDMA (1 << 25) /* Bit 24: SD/MMC DMA use */ + /* Bit 24: Reserved - always write it as 0 */ +#define SDMMC_CTRL_INTDMA (1 << 25) /* Bit 25: SD/MMC DMA use */ /* Bits 26-31: Reserved */ /* Power Enable Register (PWREN) */ diff --git a/arch/arm/src/lpc43xx/chip/lpc43_timer.h b/arch/arm/src/lpc43xx/chip/lpc43_timer.h index 109b8c8b7fad03587f1608b37ca6fb25b8645f68..b62f1352a301a3af3366a8342362f42c0c992241 100644 --- a/arch/arm/src/lpc43xx/chip/lpc43_timer.h +++ b/arch/arm/src/lpc43xx/chip/lpc43_timer.h @@ -42,10 +42,14 @@ #include +#include "chip.h" + /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ +#define TMR_RVALUE_MASK (0xffffffff) + /* Register offsets *****************************************************************/ #define LPC43_TMR_IR_OFFSET 0x0000 /* Interrupt Register */ diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index c96f1a7551134c062afdf66b4338a933279cafb3..6060c9cb2af5b715f3835eeaf831133437d72334 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -53,11 +53,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -87,13 +83,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_LPC43_ETHERNET_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_LPC43_ETHERNET_LPWORK) @@ -164,12 +159,6 @@ #undef CONFIG_LPC43_ETH_ENHANCEDDESC #undef CONFIG_LPC43_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We @@ -530,9 +519,7 @@ struct lpc43_ethmac_s uint8_t fduplex : 1; /* Full (vs. half) duplex */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -605,34 +592,26 @@ static int lpc43_recvframe(FAR struct lpc43_ethmac_s *priv); static void lpc43_receive(FAR struct lpc43_ethmac_s *priv); static void lpc43_freeframe(FAR struct lpc43_ethmac_s *priv); static void lpc43_txdone(FAR struct lpc43_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void lpc43_interrupt_work(FAR void *arg); -#endif static int lpc43_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void lpc43_txtimeout_process(FAR struct lpc43_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void lpc43_txtimeout_work(FAR void *arg); -#endif static void lpc43_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void lpc43_poll_process(FAR struct lpc43_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void lpc43_poll_work(FAR void *arg); -#endif static void lpc43_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int lpc43_ifup(struct net_driver_s *dev); static int lpc43_ifdown(struct net_driver_s *dev); -static inline void lpc43_txavail_process(FAR struct lpc43_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void lpc43_txavail_work(FAR void *arg); -#endif static int lpc43_txavail(struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int lpc43_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); #endif @@ -1906,29 +1885,32 @@ static void lpc43_txdone(FAR struct lpc43_ethmac_s *priv) } /**************************************************************************** - * Function: lpc43_interrupt_process + * Function: lpc43_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void lpc43_interrupt_process(FAR struct lpc43_ethmac_s *priv) +static void lpc43_interrupt_work(FAR void *arg) { + FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; uint32_t dmasr; + DEBUGASSERT(priv); + /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ + net_lock(); dmasr = lpc43_getreg(LPC43_ETH_DMASTAT); /* Mask only enabled interrupts. This depends on the fact that the interrupt @@ -1980,7 +1962,6 @@ static inline void lpc43_interrupt_process(FAR struct lpc43_ethmac_s *priv) /* Handle error interrupt only if CONFIG_DEBUG_NET is eanbled */ #ifdef CONFIG_DEBUG_NET - /* Check if there are pending "abnormal" interrupts */ if ((dmasr & ETH_DMAINT_AIS) != 0) @@ -1997,45 +1978,13 @@ static inline void lpc43_interrupt_process(FAR struct lpc43_ethmac_s *priv) lpc43_putreg(ETH_DMAINT_AIS, LPC43_ETH_DMASTAT); } -#endif -} -/**************************************************************************** - * Function: lpc43_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc43_interrupt_work(FAR void *arg) -{ - FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; - net_lock_t state; - - DEBUGASSERT(priv); - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - lpc43_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts at the NVIC */ up_enable_irq(LPC43M4_IRQ_ETHERNET); } -#endif /**************************************************************************** * Function: lpc43_interrupt @@ -2057,8 +2006,6 @@ static void lpc43_interrupt_work(FAR void *arg) static int lpc43_interrupt(int irq, FAR void *context) { FAR struct lpc43_ethmac_s *priv = &g_lpc43ethmac; - -#ifdef CONFIG_NET_NOINTS uint32_t dmasr; /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ @@ -2094,80 +2041,44 @@ static int lpc43_interrupt(int irq, FAR void *context) work_queue(ETHWORK, &priv->work, lpc43_interrupt_work, priv, 0); } -#else - /* Process the interrupt now */ - - lpc43_interrupt_process(priv); -#endif - return OK; } /**************************************************************************** - * Function: lpc43_txtimeout_process + * Function: lpc43_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void lpc43_txtimeout_process(FAR struct lpc43_ethmac_s *priv) +static void lpc43_txtimeout_work(FAR void *arg) { + FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; + /* Then reset the hardware. Just take the interface down, then back * up again. */ + net_lock(); lpc43_ifdown(&priv->dev); lpc43_ifup(&priv->dev); /* Then poll the network for new XMIT data */ lpc43_dopoll(priv); + net_unlock(); } -/**************************************************************************** - * Function: lpc43_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc43_txtimeout_work(FAR void *arg) -{ - FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - lpc43_txtimeout_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: lpc43_txtimeout_expiry * @@ -2193,7 +2104,6 @@ static void lpc43_txtimeout_expiry(int argc, uint32_t arg, ...) ninfo("Timeout!\n"); -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2212,33 +2122,28 @@ static void lpc43_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, lpc43_txtimeout_work, priv, 0); - -#else - /* Process the timeout now */ - - lpc43_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: lpc43_poll_process + * Function: lpc43_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void lpc43_poll_process(FAR struct lpc43_ethmac_s *priv) +static void lpc43_poll_work(FAR void *arg) { + FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; FAR struct net_driver_s *dev = &priv->dev; /* Check if the next TX descriptor is owned by the Ethernet DMA or CPU. We @@ -2252,6 +2157,7 @@ static inline void lpc43_poll_process(FAR struct lpc43_ethmac_s *priv) * CONFIG_LPC43_ETH_NTXDESC). */ + net_lock(); if ((priv->txhead->tdes0 & ETH_TDES0_OWN) == 0 && priv->txhead->tdes2 == 0) { @@ -2287,39 +2193,9 @@ static inline void lpc43_poll_process(FAR struct lpc43_ethmac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: lpc43_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc43_poll_work(FAR void *arg) -{ - FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - lpc43_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: lpc43_poll_expiry * @@ -2342,7 +2218,6 @@ static void lpc43_poll_expiry(int argc, uint32_t arg, ...) { FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2362,12 +2237,6 @@ static void lpc43_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, (uint32_t)priv); } - -#else - /* Process the interrupt now */ - - lpc43_poll_process(priv); -#endif } /**************************************************************************** @@ -2474,66 +2343,39 @@ static int lpc43_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: lpc43_txavail_process + * Function: lpc43_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * priv - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void lpc43_txavail_process(FAR struct lpc43_ethmac_s *priv) +static void lpc43_txavail_work(FAR void *arg) { - ninfo("ifup: %d\n", priv->ifup); + FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; /* Ignore the notification if the interface is not yet up */ + net_lock(); + ninfo("ifup: %d\n", priv->ifup); if (priv->ifup) { /* Poll for new XMIT data */ lpc43_dopoll(priv); } -} -/**************************************************************************** - * Function: lpc43_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void lpc43_txavail_work(FAR void *arg) -{ - FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - lpc43_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: lpc43_txavail @@ -2558,7 +2400,6 @@ static int lpc43_txavail(struct net_driver_s *dev) { FAR struct lpc43_ethmac_s *priv = (FAR struct lpc43_ethmac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2571,21 +2412,6 @@ static int lpc43_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, lpc43_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - lpc43_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } diff --git a/arch/arm/src/lpc43xx/lpc43_gpdma.c b/arch/arm/src/lpc43xx/lpc43_gpdma.c index d104080a94d2985648cade171046f0217468dcd4..ab2942189cd45708ea6d77ded671d97a3e15ad28 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpdma.c +++ b/arch/arm/src/lpc43xx/lpc43_gpdma.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc43xx/lpc43_gpdma.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,11 +52,218 @@ #include "chip.h" -#include "lpc43_syscon.h" +#include "lpc43_ccu.h" +#include "lpc43_creg.h" #include "lpc43_gpdma.h" #ifdef CONFIG_LPC43_GPDMA +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This structure represents the state of one DMA channel */ + +struct lpc43_dmach_s +{ + uint8_t chn; /* The DMA channel number */ + bool inuse; /* True: The channel is in use */ + bool inprogress; /* True: DMA is in progress on this channel */ + uint16_t nxfrs; /* Number of bytes to transfers */ + dma_callback_t callback; /* DMA completion callback function */ + void *arg; /* Argument to pass to the callback function */ +}; + +/* This structure represents the state of the LPC43 DMA block */ + +struct lpc43_gpdma_s +{ + sem_t exclsem; /* For exclusive access to the DMA channel list */ + + /* This is the state of each DMA channel */ + + struct lpc43_dmach_s dmach[LPC43_NDMACH]; +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* The state of the LPC43 DMA block */ + +static struct lpc43_gpdma_s g_gpdma; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* If the following value is zero, then there is no DMA in progress. This + * value is needed in the IDLE loop to determine if the IDLE loop should + * go into lower power power consumption modes. According to the LPC43xx + * User Manual: "The DMA controller can continue to work in Sleep mode, and + * has access to the peripheral SRAMs and all peripheral registers. The + * flash memory and the Main SRAM are not available in Sleep mode, they are + * disabled in order to save power." + */ + +volatile uint8_t g_dma_inprogress; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lpc43_dmainprogress + * + * Description: + * Another DMA has started. Increment the g_dma_inprogress counter. + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void lpc43_dmainprogress(struct lpc43_dmach_s *dmach) +{ + irqstate_t flags; + + /* Increment the DMA in progress counter */ + + flags = enter_critical_section(); + DEBUGASSERT(!dmach->inprogress && g_dma_inprogress < LPC43_NDMACH); + g_dma_inprogress++; + dmach->inprogress = true; + leave_critical_section(flags); +} + +/**************************************************************************** + * Name: lpc43_dmadone + * + * Description: + * A DMA has completed. Decrement the g_dma_inprogress counter. + * + * This function is called only from lpc43_dmastop which, in turn, will be + * called either by the user directly, by the user indirectly via + * lpc43_dmafree(), or from gpdma_interrupt when the transfer completes. + * + * NOTE: In the first two cases, we must be able to handle the case where + * there is no DMA in progress and gracefully ignore the call. + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void lpc43_dmadone(struct lpc43_dmach_s *dmach) +{ + irqstate_t flags; + + /* Increment the DMA in progress counter */ + + flags = enter_critical_section(); + if (dmach->inprogress) + { + DEBUGASSERT(g_dma_inprogress > 0); + dmach->inprogress = false; + g_dma_inprogress--; + } + + leave_critical_section(flags); +} + +/**************************************************************************** + * Name: gpdma_interrupt + * + * Description: + * The common GPDMA interrupt handler. + * + * Returned Value: + * None + * + ****************************************************************************/ + +static int gpdma_interrupt(int irq, FAR void *context) +{ + struct lpc43_dmach_s *dmach; + uint32_t regval; + uint32_t chbit; + int result; + int i; + + /* Check each DMA channel */ + + for (i = 0; i < LPC43_NDMACH; i++) + { + chbit = GPDMA_CHANNEL((uint32_t)i); + + /* Is there an interrupt pending for this channel? If the bit for + * this channel is set, that indicates that a specific DMA channel + * interrupt request is active. The request can be generated from + * either the error or terminal count interrupt requests. + */ + + regval = getreg32(LPC43_GPDMA_INTSTAT); + if ((regval & chbit) != 0) + { + /* Yes.. Is this channel assigned? Is there a callback function? */ + + dmach = &g_gpdma.dmach[i]; + if (dmach->inuse && dmach->callback) + { + /* Yes.. did an error occur? */ + + regval = getreg32(LPC43_GPDMA_INTERRSTAT); + if ((regval & chbit) != 0) + { + /* Yes.. report error status */ + + result = -EIO; + } + + /* Then this must be a terminal transfer event */ + + else + { + /* Let's make sure it is the terminal transfer event. */ + + regval = getreg32(LPC43_GPDMA_INTTCSTAT); + if ((regval & chbit) != 0) + { + result = OK; + } + + /* This should not happen */ + + else + { + result = -EINVAL; + } + } + + /* Perform the callback */ + + dmach->callback((DMA_HANDLE)dmach, dmach->arg, result); + } + + /* Disable this channel, mask any further interrupts for + * this channel, and clear any pending interrupts. + */ + + lpc43_dmastop((DMA_HANDLE)dmach); + } + } + + return OK; +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -68,12 +275,101 @@ * Initialize the GPDMA subsystem. * * Returned Value: + * Zero on success; A negated errno value on failure. + * + ****************************************************************************/ + +void weak_function up_dmainitialize(void) +{ + uint32_t regval; + int ret; + int i; + + /* Enable clocking to the GPDMA block */ + + regval = getreg32(LPC43_CCU1_M4_DMA_CFG); + regval |= CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_DMA_CFG); + + /* Reset all channel configurations */ + + for (i = 0; i < LPC43_NDMACH; i++) + { + putreg32(0, LPC43_GPDMA_CONFIG_(i)); + } + + /* Clear all DMA interrupts */ + + putreg32(DMACH_ALL, LPC43_GPDMA_INTTCCLEAR); + putreg32(DMACH_ALL, LPC43_GPDMA_INTERRCLR); + + /* Initialize the DMA state structure */ + + sem_init(&g_gpdma.exclsem, 0, 1); + + for (i = 0; i < LPC43_NDMACH; i++) + { + g_gpdma.dmach[i].chn = i; /* Channel number */ + g_gpdma.dmach[i].inuse = false; /* Channel is not in-use */ + } + + /* Attach and enable the common interrupt handler */ + + ret = irq_attach(LPC43M4_IRQ_DMA, gpdma_interrupt); + if (ret == OK) + { + up_enable_irq(LPC43M4_IRQ_DMA); + } + + /* Enable the DMA controller (for little endian operation) */ + + putreg32(GPDMA_CONFIG_ENA, LPC43_GPDMA_CONFIG); +} + +/**************************************************************************** + * Name: lpc43_dmaconfigure + * + * Description: + * Configure a DMA request. Each DMA request may have four different DMA + * request sources. This associates one of the sources with a DMA request. + * + * Returned Value: * None * ****************************************************************************/ -void lpc43_dmainitilaize(void) +void lpc43_dmaconfigure(uint8_t dmarequest, uint8_t dmasrc) { + uint32_t regval; + + DEBUGASSERT(dmarequest < LPC43_NDMAREQ); + + /* Set or clear the DMASEL bit corresponding to the request number */ + + regval = getreg32(LPC43_CREG_DMAMUX); + + switch (dmasrc) + { + case 0: + regval &= ~(3 << dmarequest); + break; + + case 1: + regval &= ~(3 << dmarequest); + regval |= (1 << dmarequest); + break; + + case 2: + regval &= ~(3 << dmarequest); + regval |= (2 << dmarequest); + break; + + case 3: + regval |= (3 << dmarequest); + break; + } + + putreg32(regval, LPC43_CREG_DMAMUX); } /**************************************************************************** @@ -92,7 +388,37 @@ void lpc43_dmainitilaize(void) DMA_HANDLE lpc43_dmachannel(void) { - return NULL; + struct lpc43_dmach_s *dmach = NULL; + int ret; + int i; + + /* Get exclusive access to the GPDMA state structure */ + + do + { + ret = sem_wait(&g_gpdma.exclsem); + DEBUGASSERT(ret == 0 || errno == EINTR); + } + while (ret < 0); + + /* Find an available DMA channel */ + + for (i = 0; i < LPC43_NDMACH; i++) + { + if (!g_gpdma.dmach[i].inuse) + { + /* Found one! */ + + dmach = &g_gpdma.dmach[i]; + g_gpdma.dmach[i].inuse = true; + break; + } + } + + /* Return what we found (or not) */ + + sem_post(&g_gpdma.exclsem); + return (DMA_HANDLE)dmach; } /**************************************************************************** @@ -110,6 +436,19 @@ DMA_HANDLE lpc43_dmachannel(void) void lpc43_dmafree(DMA_HANDLE handle) { + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + + DEBUGASSERT(dmach && dmach->inuse); + + /* Make sure that the DMA channel was properly stopped */ + + lpc43_dmastop(handle); + + /* Mark the channel available. This is an atomic operation and needs no + * special protection. + */ + + dmach->inuse = false; } /**************************************************************************** @@ -123,7 +462,87 @@ void lpc43_dmafree(DMA_HANDLE handle) int lpc43_dmarxsetup(DMA_HANDLE handle, uint32_t control, uint32_t config, uint32_t srcaddr, uint32_t destaddr, size_t nbytes) { - return -ENOSYS; + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + uint32_t chbit; + uint32_t regval; + uint32_t base; + + DEBUGASSERT(dmach && dmach->inuse && nbytes < 4096); + + chbit = GPDMA_CHANNEL((uint32_t)dmach->chn); + base = LPC43_GPDMA_CHANNEL((uint32_t)dmach->chn); + + /* Put the channel in a known state. Zero disables everything */ + + putreg32(0, base + LPC43_GPDMA_CONTROL_CHOFFSET); + putreg32(0, base + LPC43_GPDMA_CONFIG_CHOFFSET); + + /* "Programming a DMA channel + * + * 1. "Choose a free DMA channel with the priority needed. DMA channel 0 + * has the highest priority and DMA channel 7 the lowest priority. + */ + + regval = getreg32(LPC43_GPDMA_ENBLDCHNS); + if ((regval & chbit) != 0) + { + /* There is an active DMA on this channel! */ + + return -EBUSY; + } + + /* 2. "Clear any pending interrupts on the channel to be used by writing + * to the DMACIntTCClear and DMACIntErrClear register. The previous + * channel operation might have left interrupt active. + */ + + putreg32(chbit, LPC43_GPDMA_INTTCCLEAR); + putreg32(chbit, LPC43_GPDMA_INTERRCLR); + + /* 3. "Write the source address into the DMACCxSrcAddr register. */ + + putreg32(srcaddr, base + LPC43_GPDMA_SRCADDR_CHOFFSET); + + /* 4. "Write the destination address into the DMACCxDestAddr register. */ + + putreg32(destaddr, base + LPC43_GPDMA_DESTADDR_CHOFFSET); + + /* 5. "Write the address of the next LLI into the DMACCxLLI register. If + * the transfer comprises of a single packet of data then 0 must be + * written into this register. + */ + + putreg32(0, base + LPC43_GPDMA_LLI_CHOFFSET); + + /* 6. "Write the control information into the DMACCxControl register." + * + * The caller provides all CONTROL register fields except for the transfer + * size which is passed as a separate parameter and for the terminal count + * interrupt enable bit which is controlled by the driver. + */ + + regval = control & ~(GPDMA_CONTROL_XFRSIZE_MASK | GPDMA_CONTROL_IE); + regval |= ((uint32_t)nbytes << GPDMA_CONTROL_XFRSIZE_SHIFT); + putreg32(regval, base + LPC43_GPDMA_CONTROL_CHOFFSET); + + /* Save the number of transfer to perform for lpc43_dmastart */ + + dmach->nxfrs = (uint16_t)nbytes; + + /* 7. "Write the channel configuration information into the DMACCxConfig + * register. If the enable bit is set then the DMA channel is + * automatically enabled." + * + * Only the SRCPER, DSTPER, and FCNTRL fields of the CONFIG register + * are provided by the caller. Little endian is assumed. + */ + + regval = config & (GPDMA_CONFIG_SRCPER_MASK | + GPDMA_CONFIG_DESTPER_MASK | + GPDMA_CONFIG_FCNTRL_MASK); + putreg32(regval, base + LPC43_GPDMA_CONFIG_CHOFFSET); + + return OK; } /**************************************************************************** @@ -136,7 +555,53 @@ int lpc43_dmarxsetup(DMA_HANDLE handle, uint32_t control, uint32_t config, int lpc43_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg) { - return -ENOSYS; + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + uint32_t regval; + uint32_t chbit; + uint32_t base; + + DEBUGASSERT(dmach && dmach->inuse && callback); + + /* Save the callback information */ + + dmach->callback = callback; + dmach->arg = arg; + + /* Increment the count of DMAs in-progress. This count will be + * decremented when lpc43_dmastop() is called, either by the user, + * indirectly via lpc43_dmafree(), or from gpdma_interrupt when the + * transfer completes. + */ + + lpc43_dmainprogress(dmach); + + /* Clear any pending DMA interrupts */ + + chbit = GPDMA_CHANNEL((uint32_t)dmach->chn); + putreg32(chbit, LPC43_GPDMA_INTTCCLEAR); + putreg32(chbit, LPC43_GPDMA_INTERRCLR); + + /* Enable terminal count interrupt. Note that we need to restore the + * number transfers. That is because the value has a different meaning + * when it is read. + */ + + base = LPC43_GPDMA_CHANNEL((uint32_t)dmach->chn); + regval = getreg32(base + LPC43_GPDMA_CONTROL_CHOFFSET); + regval &= ~GPDMA_CONTROL_XFRSIZE_MASK; + regval |= (GPDMA_CONTROL_IE | ((uint32_t)dmach->nxfrs << GPDMA_CONTROL_XFRSIZE_SHIFT)); + putreg32(regval, base + LPC43_GPDMA_CONTROL_CHOFFSET); + + /* Enable the channel and unmask terminal count and error interrupts. + * According to the user manual, zero masks and one unmasks (hence, + * these are really enables). + */ + + regval = getreg32(base + LPC43_GPDMA_CONFIG_CHOFFSET); + regval |= (GPDMA_CONFIG_ENA | GPDMA_CONFIG_IE | GPDMA_CONFIG_ITC); + putreg32(regval, base + LPC43_GPDMA_CONFIG_CHOFFSET); + + return OK; } /**************************************************************************** @@ -147,10 +612,40 @@ int lpc43_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg) * reset and lpc43_dmasetup() must be called before lpc43_dmastart() can be * called again * + * This function will be called either by the user directly, by the user + * indirectly via lpc43_dmafree(), or from gpdma_interrupt when the + * transfer completes. + * ****************************************************************************/ void lpc43_dmastop(DMA_HANDLE handle) { + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + uint32_t regaddr; + uint32_t regval; + uint32_t chbit; + + DEBUGASSERT(dmach && dmach->inuse); + + /* Disable this channel and mask any further interrupts from the channel. + * this channel. The channel is disabled by clearning the channel + * enable bit. Any outstanding data in the FIFOs is lost. + */ + + regaddr = LPC43_GPDMA_CONFIG_((uint32_t)dmach->chn); + regval = getreg32(regaddr); + regval &= ~(GPDMA_CONFIG_ENA | GPDMA_CONFIG_IE | GPDMA_CONFIG_ITC); + putreg32(regval, regaddr); + + /* Clear any pending interrupts for this channel */ + + chbit = GPDMA_CHANNEL((uint32_t)dmach->chn); + putreg32(chbit, LPC43_GPDMA_INTTCCLEAR); + putreg32(chbit, LPC43_GPDMA_INTERRCLR); + + /* Decrement the count of DMAs in progress */ + + lpc43_dmadone(dmach); } /**************************************************************************** @@ -164,6 +659,34 @@ void lpc43_dmastop(DMA_HANDLE handle) #ifdef CONFIG_DEBUG_DMA void lpc43_dmasample(DMA_HANDLE handle, struct lpc43_dmaregs_s *regs) { + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + uint32_t base; + + DEBUGASSERT(dmach); + + /* Sample the global DMA registers */ + + regs->gbl.intst = getreg32(LPC43_GPDMA_INTSTAT); + regs->gbl.inttcstat = getreg32(LPC43_GPDMA_INTTCSTAT); + regs->gbl.interrstat = getreg32(LPC43_GPDMA_INTERRSTAT); + regs->gbl.rawinttcstat = getreg32(LPC43_GPDMA_RAWINTTCSTAT); + regs->gbl.rawinterrstat = getreg32(LPC43_GPDMA_RAWINTERRSTAT); + regs->gbl.enbldchns = getreg32(LPC43_GPDMA_ENBLDCHNS); + regs->gbl.softbreq = getreg32(LPC43_GPDMA_SOFTBREQ); + regs->gbl.softsreq = getreg32(LPC43_GPDMA_SOFTSREQ); + regs->gbl.softlbreq = getreg32(LPC43_GPDMA_SOFTLBREQ); + regs->gbl.softlsreq = getreg32(LPC43_GPDMA_SOFTLSREQ); + regs->gbl.config = getreg32(LPC43_GPDMA_CONFIG); + regs->gbl.sync = getreg32(LPC43_GPDMA_SYNC); + + /* Sample the DMA channel registers */ + + base = LPC43_GPDMA_CHANNEL((uint32_t)dmach->chn); + regs->ch.srcaddr = getreg32(base + LPC43_GPDMA_SRCADDR_CHOFFSET); + regs->ch.destaddr = getreg32(base + LPC43_GPDMA_DESTADDR_CHOFFSET); + regs->ch.lli = getreg32(base + LPC43_GPDMA_LLI_CHOFFSET); + regs->ch.control = getreg32(base + LPC43_GPDMA_CONTROL_CHOFFSET); + regs->ch.config = getreg32(base + LPC43_GPDMA_CONFIG_CHOFFSET); } #endif /* CONFIG_DEBUG_DMA */ @@ -178,6 +701,55 @@ void lpc43_dmasample(DMA_HANDLE handle, struct lpc43_dmaregs_s *regs) #ifdef CONFIG_DEBUG_DMA void lpc43_dmadump(DMA_HANDLE handle, const struct lpc43_dmaregs_s *regs, const char *msg) { + struct lpc43_dmach_s *dmach = (DMA_HANDLE)handle; + uint32_t base; + + DEBUGASSERT(dmach); + + /* Dump the sampled global DMA registers */ + + dmainfo("Global GPDMA Registers: %s\n", msg); + dmainfo(" INTST[%08x]: %08x\n", + LPC43_GPDMA_INTSTAT, regs->gbl.intst); + dmainfo(" INTTCSTAT[%08x]: %08x\n", + LPC43_GPDMA_INTTCSTAT, regs->gbl.inttcstat); + dmainfo(" INTERRSTAT[%08x]: %08x\n", + LPC43_GPDMA_INTERRSTAT, regs->gbl.interrstat); + dmainfo(" RAWINTTCSTAT[%08x]: %08x\n", + LPC43_GPDMA_RAWINTTCSTAT, regs->gbl.rawinttcstat); + dmainfo(" RAWINTERRSTAT[%08x]: %08x\n", + LPC43_GPDMA_RAWINTERRSTAT, regs->gbl.rawinterrstat); + dmainfo(" ENBLDCHNS[%08x]: %08x\n", + LPC43_GPDMA_ENBLDCHNS, regs->gbl.enbldchns); + dmainfo(" SOFTBREQ[%08x]: %08x\n", + LPC43_GPDMA_SOFTBREQ, regs->gbl.softbreq); + dmainfo(" SOFTSREQ[%08x]: %08x\n", + LPC43_GPDMA_SOFTSREQ, regs->gbl.softsreq); + dmainfo(" SOFTLBREQ[%08x]: %08x\n", + LPC43_GPDMA_SOFTLBREQ, regs->gbl.softlbreq); + dmainfo(" SOFTLSREQ[%08x]: %08x\n", + LPC43_GPDMA_SOFTLSREQ, regs->gbl.softlsreq); + dmainfo(" CONFIG[%08x]: %08x\n", + LPC43_GPDMA_CONFIG, regs->gbl.config); + dmainfo(" SYNC[%08x]: %08x\n", + LPC43_GPDMA_SYNC, regs->gbl.sync); + + /* Dump the DMA channel registers */ + + base = LPC43_GPDMA_CHANNEL((uint32_t)dmach->chn); + + dmainfo("Channel GPDMA Registers: %d\n", dmach->chn); + + dmainfo(" SRCADDR[%08x]: %08x\n", + base + LPC43_GPDMA_SRCADDR_CHOFFSET, regs->ch.srcaddr); + dmainfo(" DESTADDR[%08x]: %08x\n", + base + LPC43_GPDMA_DESTADDR_CHOFFSET, regs->ch.destaddr); + dmainfo(" LLI[%08x]: %08x\n", + base + LPC43_GPDMA_LLI_CHOFFSET, regs->ch.lli); + dmainfo(" CONTROL[%08x]: %08x\n", + base + LPC43_GPDMA_CONTROL_CHOFFSET, regs->ch.control); + dmainfo(" CONFIG[%08x]: %08x\n", + base + LPC43_GPDMA_CONFIG_CHOFFSET, regs->ch.config); } #endif /* CONFIG_DEBUG_DMA */ diff --git a/arch/arm/src/lpc43xx/lpc43_timer.c b/arch/arm/src/lpc43xx/lpc43_timer.c new file mode 100644 index 0000000000000000000000000000000000000000..0d8b35c9110b222fc7fe20c1bf3676dae4314ed0 --- /dev/null +++ b/arch/arm/src/lpc43xx/lpc43_timer.c @@ -0,0 +1,771 @@ +/**************************************************************************** + * arch/arm/src/lpc43/lpc43_timer.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Authors: Gregory Nutt + * Alan Carvalho de Assis + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#include "up_arch.h" +#include "lpc43_timer.h" + +#if defined(CONFIG_TIMER) && (defined(CONFIG_LPC43_TMR0) || \ + defined(CONFIG_LPC43_TMR1) || defined(CONFIG_LPC43_TMR2) || \ + defined(CONFIG_LPC43_TMR3) ) + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifndef CONFIG_DEBUG_TIMER_INFO +# undef CONFIG_LPC43_TMR_REGDEBUG +#endif + +/* Clocking *****************************************************************/ + +/* TODO: Allow selection of any of the input clocks */ + +#define TMR_FCLK (BOARD_FCLKOUT_FREQUENCY) +#define TMR_MAXTIMEOUT ((1000000ULL * (1ULL + TMR_RVALUE_MASK)) / TMR_FCLK) + +/**************************************************************************** + * Private Types + ****************************************************************************/ +/* This structure provides the private representation of the "lower-half" + * driver state structure. This structure must be cast-compatible with the + * timer_lowerhalf_s structure. + */ + +struct lpc43_lowerhalf_s +{ + FAR const struct timer_ops_s *ops; /* Lower half operations */ + + /* Private data */ + + uint32_t base; /* Base address of the timer */ + tccb_t callback; /* Current user interrupt callback */ + FAR void *arg; /* Argument passed to the callback function */ + uint32_t timeout; /* The current timeout value (us) */ + uint32_t adjustment; /* time lost due to clock resolution truncation (us) */ + uint32_t clkticks; /* actual clock ticks for current interval */ + bool started; /* The timer has been started */ + uint16_t tmrid; /* Timer id */ +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +/* Register operations ******************************************************/ + +#ifdef CONFIG_LPC43_TMR_REGDEBUG +static uint32_t lpc43_getreg(uint32_t addr); +static void lpc43_putreg(uint32_t val, uint32_t addr); +#else +# define lpc43_getreg(addr) getreg32(addr) +# define lpc43_putreg(val,addr) putreg32(val,addr) +#endif + +/* Interrupt handling *******************************************************/ + +static int lpc43_interrupt(int irq, FAR void *context); + +/* "Lower half" driver methods **********************************************/ + +static int lpc43_start(FAR struct timer_lowerhalf_s *lower); +static int lpc43_stop(FAR struct timer_lowerhalf_s *lower); +static int lpc43_getstatus(FAR struct timer_lowerhalf_s *lower, + FAR struct timer_status_s *status); +static int lpc43_settimeout(FAR struct timer_lowerhalf_s *lower, + uint32_t timeout); +static void lpc43_setcallback(FAR struct timer_lowerhalf_s *lower, + tccb_t callback, FAR void *arg); +static int lpc43_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd, + unsigned long arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* "Lower half" driver methods */ + +static const struct timer_ops_s g_tmrops = +{ + .start = lpc43_start, + .stop = lpc43_stop, + .getstatus = lpc43_getstatus, + .settimeout = lpc43_settimeout, + .setcallback = lpc43_setcallback, + .ioctl = lpc43_ioctl, +}; + +/* "Lower half" driver state */ + +/* TODO - allocating all 6 now, even though we might not need them. + * May want to allocate the right number to not be wasteful. + */ + +static struct lpc43_lowerhalf_s g_tmrdevs[4]; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lpc43_getreg + * + * Description: + * Get the contents of a register + * + ****************************************************************************/ + +#ifdef CONFIG_LPC43_TMR_REGDEBUG +static uint32_t lpc43_getreg(uint32_t addr) +{ + static uint32_t prevaddr = 0; + static uint32_t count = 0; + static uint32_t preval = 0; + + /* Read the value from the register */ + + uint32_t val = getreg32(addr); + + /* Is this the same value that we read from the same registe last time? + * Are we polling the register? If so, suppress some of the output. + */ + + if (addr == prevaddr && val == preval) + { + if (count == 0xffffffff || ++count > 3) + { + if (count == 4) + { + tmrinfo("...\n"); + } + + return val; + } + } + + /* No this is a new address or value */ + + else + { + /* Did we print "..." for the previous value? */ + + if (count > 3) + { + /* Yes.. then show how many times the value repeated */ + + tmrinfo("[repeats %d more times]\n", count-3); + } + + /* Save the new address, value, and count */ + + prevaddr = addr; + preval = val; + count = 1; + } + + /* Show the register value read */ + + tmrinfo("%08lx->%08lx\n", addr, val); + return val; +} +#endif + +/**************************************************************************** + * Name: lpc43_putreg + * + * Description: + * Set the contents of an LPC43 register to a value + * + ****************************************************************************/ + +#ifdef CONFIG_LPC43_TMR_REGDEBUG +static void lpc43_putreg(uint32_t val, uint32_t addr) +{ + /* Show the register value being written */ + + tmrinfo("%08lx<-%08lx\n", addr, val); + + /* Write the value */ + + putreg32(val, addr); +} +#endif + +void tmr_clk_enable(uint16_t tmrid) +{ + uint32_t regval; + + /* Enable Timer 0 */ + + if (tmrid == 0) + { + regval = getreg32(LPC43_CCU1_M4_TIMER0_CFG); + regval |= CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER0_CFG); + } + + /* Enable Timer 1 */ + + if (tmrid == 1) + { + regval = getreg32(LPC43_CCU1_M4_TIMER1_CFG); + regval |= CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER1_CFG); + } + + /* Enable Timer 2 */ + + if (tmrid == 2) + { + regval = getreg32(LPC43_CCU1_M4_TIMER2_CFG); + regval |= CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER2_CFG); + } + + /* Enable Timer 3 */ + + if (tmrid == 3) + { + regval = getreg32(LPC43_CCU1_M4_TIMER3_CFG); + regval |= CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER3_CFG); + } +} + +void tmr_clk_disable(uint16_t tmrid) +{ + uint32_t regval; + + /* Enable Timer 0 */ + + if (tmrid == 0) + { + regval = getreg32(LPC43_CCU1_M4_TIMER0_CFG); + regval &= ~CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER0_CFG); + } + + /* Enable Timer 1 */ + + if (tmrid == 1) + { + regval = getreg32(LPC43_CCU1_M4_TIMER1_CFG); + regval &= ~CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER1_CFG); + } + + /* Enable Timer 2 */ + + if (tmrid == 2) + { + regval = getreg32(LPC43_CCU1_M4_TIMER2_CFG); + regval &= ~CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER2_CFG); + } + + /* Enable Timer 3 */ + + if (tmrid == 3) + { + regval = getreg32(LPC43_CCU1_M4_TIMER3_CFG); + regval &= ~CCU_CLK_CFG_RUN; + putreg32(regval, LPC43_CCU1_M4_TIMER3_CFG); + } +} + +/**************************************************************************** + * Name: lpc43_interrupt + * + * Description: + * TC interrupt + * + * Input Parameters: + * Usual interrupt callback arguments. + * + * Returned Values: + * Always returns OK. + * + ****************************************************************************/ + +static int lpc43_interrupt(int irq, FAR void *context) +{ + uint8_t chan_int = 0x0f; + FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq-LPC43M4_IRQ_TIMER0]; + + tmrinfo("Entry\n"); + DEBUGASSERT((irq >= LPC43M4_IRQ_TIMER0) && (irq <= LPC43M4_IRQ_TIMER3)); + + /* Check if the interrupt is really pending */ + + if ((lpc43_getreg(priv->base + LPC43_TMR_IR_OFFSET) & chan_int) != 0) + { + uint32_t timeout; + + /* Is there a registered callback? If the callback has been + * nullified, the timer will be stopped. + */ + + if (priv->callback && priv->callback(&priv->timeout, priv->arg)) + { + /* Calculate new ticks / dither adjustment */ + + priv->clkticks =((uint64_t)(priv->adjustment + priv->timeout)) * + TMR_FCLK / 1000000; + + /* Set next interval interval. TODO: make sure the interval is not + * so soon it will be missed! + */ + + lpc43_putreg(priv->clkticks, priv->base + LPC43_TMR_PR_OFFSET); + + /* Truncated timeout */ + + timeout = (1000000ULL * priv->clkticks) / TMR_FCLK; + + /* Truncated time to be added to next interval (dither) */ + + priv->adjustment = (priv->adjustment + priv->timeout) - timeout; + } + else + { + /* No callback or the callback returned false.. stop the timer */ + + lpc43_stop((FAR struct timer_lowerhalf_s *)priv); + tmrinfo("Stopped\n"); + } + + /* Clear the interrupts */ + + lpc43_putreg(chan_int, priv->base + LPC43_TMR_IR_OFFSET); + } + + return OK; +} + +/**************************************************************************** + * Name: lpc43_start + * + * Description: + * Start the timer, resetting the time to the current timeout, + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower-half" + * driver state structure. + * + * Returned Values: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int lpc43_start(FAR struct timer_lowerhalf_s *lower) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + uint32_t presc_val; + + tmrinfo("Entry\n"); + DEBUGASSERT(priv); + + if (priv->started) + { + return -EINVAL; + } + + /* Enable timer clock */ + + tmr_clk_enable(priv->tmrid); + + /* Set it to Timer Mode */ + + lpc43_putreg(0, priv->base + LPC43_TMR_CTCR_OFFSET); + + /* Disable the timer */ + + lpc43_putreg(0, priv->base + LPC43_TMR_TCR_OFFSET); + + /* Set prescaler to increase TC each 1 us */ + + presc_val = TMR_FCLK / 1000000; + lpc43_putreg(presc_val - 1, priv->base + LPC43_TMR_PR_OFFSET); + + /* Set MR0 with a large enough initial value */ + + lpc43_putreg(10000000, priv->base + LPC43_TMR_MR0_OFFSET); + + if (priv->callback) + { + /* Enable Match on MR0 generate interrupt and auto-restart */ + + lpc43_putreg(3, priv->base + LPC43_TMR_MCR_OFFSET); + } + + /* Enable the timer */ + + lpc43_putreg(TMR_TCR_EN, priv->base + LPC43_TMR_TCR_OFFSET); + + priv->started = true; + return OK; +} + +/**************************************************************************** + * Name: lpc43_stop + * + * Description: + * Stop the timer + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower-half" + * driver state structure. + * + * Returned Values: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int lpc43_stop(FAR struct timer_lowerhalf_s *lower) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + tmrinfo("Entry\n"); + DEBUGASSERT(priv); + + if (!priv->started) + { + return -EINVAL; + } + + /* Disable timer */ + + lpc43_putreg(0, priv->base + LPC43_TMR_TCR_OFFSET); + + /* Disable interrupt */ + + lpc43_putreg(0, priv->base + LPC43_TMR_MCR_OFFSET); + + /* Disable timer clock */ + + tmr_clk_disable(priv->tmrid); + + priv->started = false; + + return OK; +} + +/**************************************************************************** + * Name: lpc43_getstatus + * + * Description: + * Get the current timer status + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower- + * half" driver state structure. + * status - The location to return the status information. + * + * Returned Values: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int lpc43_getstatus(FAR struct timer_lowerhalf_s *lower, + FAR struct timer_status_s *status) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + uint32_t elapsed; + + tmrinfo("Entry\n"); + DEBUGASSERT(priv); + + /* Return the status bit */ + + status->flags = 0; + if (priv->started) + { + status->flags |= TCFLAGS_ACTIVE; + } + + if (priv->callback) + { + status->flags |= TCFLAGS_HANDLER; + } + + /* Return the actual timeout is milliseconds */ + + status->timeout = priv->timeout; + + /* Get the time remaining until the timer expires (in microseconds) */ + /* TODO - check on the +1 in the time left calculation */ + + elapsed = lpc43_getreg(priv->base + LPC43_TMR_TC_OFFSET); + status->timeleft = ((uint64_t)priv->timeout * elapsed) / + (priv->clkticks + 1); + + tmrinfo(" flags : %08x\n", status->flags); + tmrinfo(" timeout : %d\n", status->timeout); + tmrinfo(" timeleft : %d\n", status->timeleft); + return OK; +} + +/**************************************************************************** + * Name: lpc43_settimeout + * + * Description: + * Set a new timeout value (and reset the timer) + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower + * half" driver state structure. + * timeout - The new timeout value in milliseconds. + * + * Returned Values: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int lpc43_settimeout(FAR struct timer_lowerhalf_s *lower, + uint32_t timeout) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + + DEBUGASSERT(priv); + + if (priv->started) + { + return -EPERM; + } + + tmrinfo("Entry: timeout=%d\n", timeout); + + /* Can this timeout be represented? */ + + if (timeout < 1 || timeout > TMR_MAXTIMEOUT) + { + tmrerr("ERROR: Cannot represent timeout=%lu > %lu\n", + timeout, TMR_MAXTIMEOUT); + return -ERANGE; + } + + /* Intended timeout */ + + priv->timeout = timeout; + + /* Actual clock ticks */ + + priv->clkticks = (((uint64_t)timeout * TMR_FCLK) / 1000000); + + /* Truncated timeout */ + + timeout = (1000000ULL * priv->clkticks) / TMR_FCLK; + + /* Truncated time to be added to next interval (dither) */ + + priv->adjustment = priv->timeout - timeout; + + tmrinfo("fclk=%d clkticks=%d timout=%d, adjustment=%d\n", + TMR_FCLK, priv->clkticks, priv->timeout, priv->adjustment); + + return OK; +} + +/**************************************************************************** + * Name: lpc43_setcallback + * + * Description: + * Call this user provided timeout callback. + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower-half" + * driver state structure. + * newcallback - The new timer expiration function pointer. If this + * function pointer is NULL, then the reset-on-expiration + * behavior is restored, + * + * Returned Values: + * The previous timer expiration function pointer or NULL is there was + * no previous function pointer. + * + ****************************************************************************/ + +static void lpc43_setcallback(FAR struct timer_lowerhalf_s *lower, + tccb_t callback, FAR void *arg) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + irqstate_t flags; + + flags = enter_critical_section(); + + DEBUGASSERT(priv); + tmrinfo("Entry: callback=%p\n", callback); + + /* Save the new callback and its argument */ + + priv->callback = callback; + priv->arg = arg; + + leave_critical_section(flags); +} + +/**************************************************************************** + * Name: lpc43_ioctl + * + * Description: + * Any ioctl commands that are not recognized by the "upper-half" driver + * are forwarded to the lower half driver through this method. + * + * Input Parameters: + * lower - A pointer the publicly visible representation of the "lower-half" + * driver state structure. + * cmd - The ioctl command value + * arg - The optional argument that accompanies the 'cmd'. The + * interpretation of this argument depends on the particular + * command. + * + * Returned Values: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int lpc43_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd, + unsigned long arg) +{ + FAR struct lpc43_lowerhalf_s *priv = (FAR struct lpc43_lowerhalf_s *)lower; + int ret = -ENOTTY; + + DEBUGASSERT(priv); + tmrinfo("Entry: cmd=%d arg=%ld\n", cmd, arg); + UNUSED(priv); + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lpc43_tmrinitialize + * + * Description: + * Initialize the timer. The timer is initialized and + * registers as 'devpath'. + * + * Input Parameters: + * devpath - The full path to the timer. This should be of the form + * /dev/tmr0 + * + * Returned Values: + * None + * + ****************************************************************************/ + +void lpc43_tmrinitialize(FAR const char *devpath, int irq) +{ + FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq-LPC43M4_IRQ_TIMER0]; + + tmrinfo("Entry: devpath=%s\n", devpath); + DEBUGASSERT((irq >= LPC43M4_IRQ_TIMER0) && (irq <= LPC43M4_IRQ_TIMER3)); + + /* Initialize the driver state structure. Here we assume: (1) the state + * structure lies in .bss and was zeroed at reset time. (2) This function + * is only called once so it is never necessary to re-zero the structure. + */ + + switch (irq) + { +#if defined(CONFIG_LPC43_TMR0) + case LPC43M4_IRQ_TIMER0: + priv->base = LPC43_TIMER0_BASE; + priv->tmrid = 0; + tmrinfo("Using: Timer 0"); + break; +#endif + +#if defined(CONFIG_LPC43_TMR1) + case LPC43M4_IRQ_TIMER1: + priv->base = LPC43_TIMER1_BASE; + priv->tmrid = 1; + tmrinfo("Using: Timer 1"); + break; +#endif + +#if defined(CONFIG_LPC43_TMR2) + case LPC43M4_IRQ_TIMER2: + priv->base = LPC43_TIMER2_BASE; + priv->tmrid = 2; + tmrinfo("Using: Timer 2"); + break; +#endif + +#if defined(CONFIG_LPC43_TMR3) + case LPC43M4_IRQ_TIMER3: + priv->base = LPC43_TIMER3_BASE; + priv->tmrid = 3; + tmrinfo("Using: Timer 3"); + break; +#endif + + default: + ASSERT(0); + } + + priv->ops = &g_tmrops; + + (void)irq_attach(irq, lpc43_interrupt); + + /* Enable NVIC interrupt. */ + + up_enable_irq(irq); + + /* Register the timer driver as /dev/timerX */ + + (void)timer_register(devpath, (FAR struct timer_lowerhalf_s *)priv); +} + +#endif /* CONFIG_TIMER && CONFIG_LPC43_TMRx */ diff --git a/arch/arm/src/kl/kl_getc.c b/arch/arm/src/lpc43xx/lpc43_timer.h similarity index 66% rename from arch/arm/src/kl/kl_getc.c rename to arch/arm/src/lpc43xx/lpc43_timer.h index 8b63ec217d6fe8859fc8470d6ffa1c7b03102e0a..194d917c3179d58837af19a93a1d6fc95043f9dd 100644 --- a/arch/arm/src/kl/kl_getc.c +++ b/arch/arm/src/lpc43xx/lpc43_timer.h @@ -1,8 +1,9 @@ /**************************************************************************** - * arch/arm/src/kl/kl_getc.c + * arch/arm/src/sam34/lpc43_tc.h * - * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Authors: Gregory Nutt + * Alan Carvalho de Assis * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,31 +34,34 @@ * ****************************************************************************/ +#ifndef __ARCH_ARM_SRC_LPC43_TMR_H +#define __ARCH_ARM_SRC_LPC43_TMR_H + /**************************************************************************** * Included Files ****************************************************************************/ #include -#include - -#include "up_arch.h" +#include "chip.h" +#include "chip/lpc43_timer.h" +#include "chip/lpc43_ccu.h" -#include "kl_config.h" -#include "kl_getc.h" +#ifdef CONFIG_TIMER /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Select UART parameters for the selected console */ +#ifndef __ASSEMBLY__ -#if defined(CONFIG_UART0_SERIAL_CONSOLE) -# define CONSOLE_BASE KL_UART0_BASE -#elif defined(CONFIG_UART1_SERIAL_CONSOLE) -# define CONSOLE_BASE KL_UART1_BASE -#elif defined(CONFIG_UART2_SERIAL_CONSOLE) -# define CONSOLE_BASE KL_UART2_BASE +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern #endif /**************************************************************************** @@ -65,32 +69,32 @@ ****************************************************************************/ /**************************************************************************** - * Name: up_getc + * Name: lpc43_tmrinitialize * * Description: - * Input one byte from the serial console + * Initialize the timer. The timer is initialized and + * registers as 'devpath. The initial state of the timer is + * disabled. * - * REVIST: If used with the serial driver enabled, then this could - * interfere with the serial driver operations. Serial interrupts should - * be disabled when this function executes in that case. + * Input Parameters: + * devpath - The full path to the timer. This should be of the form + * /dev/timer0 + * irq - irq associated with the timer + * Returned Values: + * None * ****************************************************************************/ -int up_getc(void) -{ - uint8_t ch = 0; - -#if defined HAVE_UART_DEVICE && defined HAVE_SERIAL_CONSOLE - /* Wait while the receiver data buffer is "empty" (RDRF) to assure that - * we have data in the buffer to read. - */ - - while ((getreg8(CONSOLE_BASE + KL_UART_S1_OFFSET) & UART_S1_RDRF) == 0); - - /* Then read a character from the UART data register */ - - ch = getreg8(CONSOLE_BASE + KL_UART_D_OFFSET); +#if defined(CONFIG_LPC43_TMR0) || defined(CONFIG_LPC43_TMR1) || \ + defined(CONFIG_LPC43_TMR2) || defined(CONFIG_LPC43_TMR3) +void lpc43_tmrinitialize(FAR const char *devpath, int irq); #endif - return (int)ch; +#undef EXTERN +#if defined(__cplusplus) } +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* CONFIG_TIMER */ +#endif /* __ARCH_ARM_SRC_LPC43_TMR_H */ diff --git a/arch/arm/src/sam34/Kconfig b/arch/arm/src/sam34/Kconfig index df13714792298360fc88fb6a76937c6225b4eb9d..01194134c2b7594d6c4f5c6a871f035301133644 100644 --- a/arch/arm/src/sam34/Kconfig +++ b/arch/arm/src/sam34/Kconfig @@ -240,6 +240,7 @@ config ARCH_CHIP_SAM3A config ARCH_CHIP_SAM4CM bool default n + select ARCH_HAVE_MULTICPU select ARCH_HAVE_TICKLESS config ARCH_CHIP_SAM4L diff --git a/arch/arm/src/sam34/Make.defs b/arch/arm/src/sam34/Make.defs index dab10fb45e1b45cc1b7f93178819c5b5287f11e8..9b4e75079ad540cdfadb59f8afe29d4e0e432d5d 100644 --- a/arch/arm/src/sam34/Make.defs +++ b/arch/arm/src/sam34/Make.defs @@ -50,13 +50,17 @@ CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_switchcontext.S CMN_ASRCS += up_testset.S vfork.S CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c up_createstack.c -CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_idle.c up_initialize.c +CMN_CSRCS += up_mdelay.c up_udelay.c up_exit.c up_initialize.c CMN_CSRCS += up_initialstate.c up_interruptcontext.c up_memfault.c up_modifyreg8.c CMN_CSRCS += up_modifyreg16.c up_modifyreg32.c up_releasepending.c CMN_CSRCS += up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c CMN_CSRCS += up_sigdeliver.c up_stackframe.c up_unblocktask.c up_usestack.c CMN_CSRCS += up_doirq.c up_hardfault.c up_svcall.c up_vfork.c +ifneq ($(CONFIG_SMP),y) +CMN_CSRCS += up_idle.c +endif + # Configuration-dependent common files ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y) @@ -198,14 +202,22 @@ endif ifeq ($(CONFIG_ARCH_CHIP_SAM4CM),y) ifeq ($(CONFIG_SAM34_TC),y) CHIP_CSRCS += sam4cm_tc.c + ifeq ($(CONFIG_SAM34_ONESHOT),y) CHIP_CSRCS += sam4cm_oneshot.c sam4cm_oneshot_lowerhalf.c -endif +endif # CONFIG_SAM34_ONESHOT + ifeq ($(CONFIG_SAM34_FREERUN),y) CHIP_CSRCS += sam4cm_freerun.c -endif +endif # CONFIG_SAM34_FREERUN + ifeq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += sam4cm_tickless.c -endif -endif -endif +endif # CONFIG_SCHED_TICKLESS +endif # CONFIG_SAM34_TC + +ifeq ($(CONFIG_SMP),y) +CHIP_CSRCS += sam4cm_cpuindex.c sam4cm_cpuidlestack.c +CHIP_CSRCS += sam4cm_cpupause.c sam4cm_cpustart.c sam4cm_idle.c +endif # CONFIG_SMP +endif # CONFIG_ARCH_CHIP_SAM4CM diff --git a/arch/arm/src/sam34/chip/sam4cm_memorymap.h b/arch/arm/src/sam34/chip/sam4cm_memorymap.h index c0b2de041b8bdcbe3cbf544c891de1b3b226b653..d719e268c010a54ed50f5e2d90b1b2ff64f16677 100644 --- a/arch/arm/src/sam34/chip/sam4cm_memorymap.h +++ b/arch/arm/src/sam34/chip/sam4cm_memorymap.h @@ -65,6 +65,7 @@ /* Internal SRAM memory region */ #define SAM_INTSRAM0_BASE 0x20000000 /* For SAM3U compatibility */ +#define SAM_INTSRAM1_BASE 0x20080000 /* 0x20080000-0x200fffff: Internal SRAM 1 */ #define SAM_BBSRAM_BASE 0x22000000 /* 0x22000000-0x23ffffff: 32MB bit-band region */ /* 0x24000000-0x3fffffff: Undefined */ /* Peripherals address region */ diff --git a/arch/arm/src/sam34/chip/sam_pmc.h b/arch/arm/src/sam34/chip/sam_pmc.h index 6514d1f42e433ec1e55021276330afbd159b8e90..d7a75f6b0383d97191e4a9bbe2e75668d78722cd 100644 --- a/arch/arm/src/sam34/chip/sam_pmc.h +++ b/arch/arm/src/sam34/chip/sam_pmc.h @@ -402,10 +402,10 @@ # define PMC_MCKR_CPCSS_SHIFT (16) # define PMC_MCKR_CPCSS_MASK (0x7 << PMC_MCKR_CPCSS_SHIFT) # define PMC_MCKR_CPCSS_SLOW (0 << PMC_MCKR_CPCSS_SHIFT) /* Slow Clock */ -# define PMC_MCKR_CCPSS_MAIN (1 << PMC_MCKR_CPCSS_SHIFT) /* Main Clock */ -# define PMC_MCKR_CCPSS_PLLA (2 << PMC_MCKR_CPCSS_SHIFT) /* PLLA Clock */ -# define PMC_MCKR_CCPSS_PLLB (3 << PMC_MCKR_CPCSS_SHIFT) /* PLLB Clock */ -# define PMC_MCKR_CCPSS_MCK (4 << PMC_MCKR_CPCSS_SHIFT) /* Master Clock */ +# define PMC_MCKR_CPCSS_MAIN (1 << PMC_MCKR_CPCSS_SHIFT) /* Main Clock */ +# define PMC_MCKR_CPCSS_PLLA (2 << PMC_MCKR_CPCSS_SHIFT) /* PLLA Clock */ +# define PMC_MCKR_CPCSS_PLLB (3 << PMC_MCKR_CPCSS_SHIFT) /* PLLB Clock */ +# define PMC_MCKR_CPCSS_MCK (4 << PMC_MCKR_CPCSS_SHIFT) /* Master Clock */ # define PMC_MCKR_CPPRES_SHIFT (20) # define PMC_MCKR_CPPRES_MASK (0xF << PMC_MCKR_CPPRES_SHIFT) # define PMC_MCKR_CPPRES(D) (((D) - 1) << PMC_MCKR_CPPRES_SHIFT) @@ -547,13 +547,14 @@ /* Peripheral Clock Status Register 1 */ #if defined(CONFIG_ARCH_CHIP_SAM3X) || defined(CONFIG_ARCH_CHIP_SAM3X) || \ - defined(CONFIG_ARCH_CHIP_SAM4S) || defined(CONFIG_ARCH_CHIP_SAM4E) + defined(CONFIG_ARCH_CHIP_SAM4S) || defined(CONFIG_ARCH_CHIP_SAM4E) || \ + defined(CONFIG_ARCH_CHIP_SAM4CM) # define PMC_PIDH(n) (1 << ((n) - 32)) # define PMC_PID32 (1 << 0) /* Bit 0: PID32 */ # define PMC_PID33 (1 << 1) /* Bit 1: PID33 */ # define PMC_PID34 (1 << 2) /* Bit 2: PID34 */ # if defined(CONFIG_ARCH_CHIP_SAM3X) || defined(CONFIG_ARCH_CHIP_SAM3X) || \ - defined(CONFIG_ARCH_CHIP_SAM4E) + defined(CONFIG_ARCH_CHIP_SAM4E) || defined(CONFIG_ARCH_CHIP_SAM4CM) # define PMC_PID35 (1 << 3) /* Bit 3: PID35 */ # define PMC_PID36 (1 << 4) /* Bit 4: PID36 */ # define PMC_PID37 (1 << 5) /* Bit 5: PID37 */ diff --git a/arch/arm/src/sam34/sam4cm_cpuidlestack.c b/arch/arm/src/sam34/sam4cm_cpuidlestack.c new file mode 100644 index 0000000000000000000000000000000000000000..411ebfaad77efb449d82af9a9b3ac502aface7a6 --- /dev/null +++ b/arch/arm/src/sam34/sam4cm_cpuidlestack.c @@ -0,0 +1,136 @@ +/**************************************************************************** + * arch/arm/src/sam34/sam4cm_cpuidlestack.c + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include + +#include +#include + +#include "up_internal.h" + +#ifdef CONFIG_SMP + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_idle + * + * Description: + * up_idle() is the logic that will be executed when their is no other + * ready-to-run task. This is processor idle time and will continue until + * some interrupt occurs to cause a context switch from the idle task. + * + * Processing in this state may be processor-specific. e.g., this is where + * power management operations might be performed. + * + ****************************************************************************/ + +void up_idle(void) +{ +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) + /* If the system is idle and there are no timer interrupts, then process + * "fake" timer interrupts. Hopefully, something will wake up. + */ + + sched_process_timer(); +#else + + /* Sleep until an interrupt occurs to save power */ + + asm("WFI"); + +#endif +} + +/**************************************************************************** + * Name: up_cpu_idlestack + * + * Description: + * Allocate a stack for the CPU[n] IDLE task (n > 0) if appropriate and + * setup up stack-related information in the IDLE task's TCB. This + * function is always called before up_cpu_start(). This function is + * only called for the CPU's initial IDLE task; up_create_task is used for + * all normal tasks, pthreads, and kernel threads for all CPUs. + * + * The initial IDLE task is a special case because the CPUs can be started + * in different wans in different environments: + * + * 1. The CPU may already have been started and waiting in a low power + * state for up_cpu_start(). In this case, the IDLE thread's stack + * has already been allocated and is already in use. Here + * up_cpu_idlestack() only has to provide information about the + * already allocated stack. + * + * 2. The CPU may be disabled but started when up_cpu_start() is called. + * In this case, a new stack will need to be created for the IDLE + * thread and this function is then equivalent to: + * + * return up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); + * + * The following TCB fields must be initialized by this function: + * + * - adj_stack_size: Stack size after adjustment for hardware, processor, + * etc. This value is retained only for debug purposes. + * - stack_alloc_ptr: Pointer to allocated stack + * - adj_stack_ptr: Adjusted stack_alloc_ptr for HW. The initial value of + * the stack pointer. + * + * Inputs: + * - cpu: CPU index that indicates which CPU the IDLE task is + * being created for. + * - tcb: The TCB of new CPU IDLE task + * - stack_size: The requested stack size for the IDLE task. At least + * this much must be allocated. This should be + * CONFIG_SMP_STACK_SIZE. + * + ****************************************************************************/ + +int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size) +{ +#if CONFIG_SMP_NCPUS > 1 + (void)up_create_stack(tcb, stack_size, TCB_FLAG_TTYPE_KERNEL); +#endif + return OK; +} + +#endif /* CONFIG_SMP */ diff --git a/configs/compal_e86/src/boot.c b/arch/arm/src/sam34/sam4cm_cpuindex.c similarity index 66% rename from configs/compal_e86/src/boot.c rename to arch/arm/src/sam34/sam4cm_cpuindex.c index 8c214a004c3e3b941894d4ccebf309d77705c4ca..867d36e5c1b5628bf9bdaad2150a319ffea00584 100644 --- a/configs/compal_e86/src/boot.c +++ b/arch/arm/src/sam34/sam4cm_cpuindex.c @@ -1,8 +1,8 @@ /**************************************************************************** - * configs/compal_e86/boot.c + * arch/arm/src/sam34/sam4cm_cpuindex.c * - * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,38 +38,40 @@ ****************************************************************************/ #include -#include +#include +#include + +#include "mpu.h" + +#ifdef CONFIG_SMP /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: board_app_initialize + * Name: up_cpu_index * * Description: - * Perform architecture specific initialization + * Return an index in the range of 0 through (CONFIG_SMP_NCPUS-1) that + * corresponds to the currently executing CPU. * * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. + * None * * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. + * An integer index in the range of 0 through (CONFIG_SMP_NCPUS-1) that + * corresponds to the currently executing CPU. * ****************************************************************************/ -#ifdef CONFIG_LIB_BOARDCTL -int board_app_initialize(uintptr_t arg) +int up_cpu_index(void) { - return 0; + /* MPU is not supported on CM4P1 */ + + return (getreg32(MPU_TYPE) == 0) ? 1 : 0; } -#endif /* CONFIG_LIB_BOARDCTL */ + +#endif /* CONFIG_SMP */ + + diff --git a/arch/arm/src/sam34/sam4cm_cpupause.c b/arch/arm/src/sam34/sam4cm_cpupause.c new file mode 100644 index 0000000000000000000000000000000000000000..9b9d126f252b713c0f4219c304ea8fd72d314d4b --- /dev/null +++ b/arch/arm/src/sam34/sam4cm_cpupause.c @@ -0,0 +1,328 @@ +/**************************************************************************** + * arch/arm/src/sam34/sam4cm_cpupause.c + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include + +#include +#include + +#include "up_arch.h" +#include "sched/sched.h" +#include "up_internal.h" +#include "chip/sam4cm_ipc.h" + +#ifdef CONFIG_SMP + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#if 0 +# define DPRINTF(fmt, args...) _err(fmt, ##args) +#else +# define DPRINTF(fmt, args...) do {} while (0) +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* These spinlocks are used in the SMP configuration in order to implement + * up_cpu_pause(). The protocol for CPUn to pause CPUm is as follows + * + * 1. The up_cpu_pause() implementation on CPUn locks both g_cpu_wait[m] + * and g_cpu_paused[m]. CPUn then waits spinning on g_cpu_paused[m]. + * 2. CPUm receives the interrupt it (1) unlocks g_cpu_paused[m] and + * (2) locks g_cpu_wait[m]. The first unblocks CPUn and the second + * blocks CPUm in the interrupt handler. + * + * When CPUm resumes, CPUn unlocks g_cpu_wait[m] and the interrupt handler + * on CPUm continues. CPUm must, of course, also then unlock g_cpu_wait[m] + * so that it will be ready for the next pause operation. + */ + +static volatile spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS]; +static volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS]; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_cpu_pausereq + * + * Description: + * Return true if a pause request is pending for this CPU. + * + * Input Parameters: + * cpu - The index of the CPU to be queried + * + * Returned Value: + * true = a pause request is pending. + * false = no pasue request is pending. + * + ****************************************************************************/ + +bool up_cpu_pausereq(int cpu) +{ + return spin_islocked(&g_cpu_paused[cpu]); +} + +/**************************************************************************** + * Name: up_cpu_paused + * + * Description: + * Handle a pause request from another CPU. Normally, this logic is + * executed from interrupt handling logic within the architecture-specific + * However, it is sometimes necessary necessary to perform the pending + * pause operation in other contexts where the interrupt cannot be taken + * in order to avoid deadlocks. + * + * This function performs the following operations: + * + * 1. It saves the current task state at the head of the current assigned + * task list. + * 2. It waits on a spinlock, then + * 3. Returns from interrupt, restoring the state of the new task at the + * head of the ready to run list. + * + * Input Parameters: + * cpu - The index of the CPU to be paused + * + * Returned Value: + * On success, OK is returned. Otherwise, a negated errno value indicating + * the nature of the failure is returned. + * + ****************************************************************************/ + +int up_cpu_paused(int cpu) +{ + FAR struct tcb_s *tcb = this_task(); + + /* Update scheduler parameters */ + + sched_suspend_scheduler(tcb); + + /* Save the current context at CURRENT_REGS into the TCB at the head + * of the assigned task list for this CPU. + */ + + up_savestate(tcb->xcp.regs); + + /* Wait for the spinlock to be released */ + + spin_unlock(&g_cpu_paused[cpu]); + spin_lock(&g_cpu_wait[cpu]); + + /* Restore the exception context of the tcb at the (new) head of the + * assigned task list. + */ + + tcb = this_task(); + + /* Reset scheduler parameters */ + + sched_resume_scheduler(tcb); + + /* Then switch contexts. Any necessary address environment changes + * will be made when the interrupt returns. + */ + + up_restorestate(tcb->xcp.regs); + spin_unlock(&g_cpu_wait[cpu]); + + return OK; +} + +/**************************************************************************** + * Name: arm_pause_handler + * + * Description: + * Inter-CPU interrupt handler + * + * Input Parameters: + * Standard interrupt handler inputs + * + * Returned Value: + * Should always return OK + * + ****************************************************************************/ + +int arm_pause_handler(int irq, void *c) +{ + int cpu = up_cpu_index(); + + /* Clear : Pause IRQ */ + /* IPC Interrupt Clear Command Register (write-only) */ + + if (1 == cpu) + { + DPRINTF("CPU0 -> CPU1\n"); + putreg32(0x1, SAM_IPC1_ICCR); + } + else + { + DPRINTF("CPU1 -> CPU0\n"); + putreg32(0x1, SAM_IPC0_ICCR); + } + + /* Check for false alarms. Such false could occur as a consequence of + * some deadlock breaking logic that might have already serviced the SG2 + * interrupt by calling up_cpu_paused. + */ + + if (spin_islocked(&g_cpu_paused[cpu])) + { + return up_cpu_paused(cpu); + } + + return OK; +} + +/**************************************************************************** + * Name: up_cpu_pause + * + * Description: + * Save the state of the current task at the head of the + * g_assignedtasks[cpu] task list and then pause task execution on the + * CPU. + * + * This function is called by the OS when the logic executing on one CPU + * needs to modify the state of the g_assignedtasks[cpu] list for another + * CPU. + * + * Input Parameters: + * cpu - The index of the CPU to be stopped/ + * + * Returned Value: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_cpu_pause(int cpu) +{ + DPRINTF("cpu=%d\n",cpu); + + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); + + /* Take the both spinlocks. The g_cpu_wait spinlock will prevent the SGI2 + * handler from returning until up_cpu_resume() is called; g_cpu_paused + * is a handshake that will prefent this function from returning until + * the CPU is actually paused. + */ + + spin_lock(&g_cpu_wait[cpu]); + spin_lock(&g_cpu_paused[cpu]); + + DEBUGASSERT(spin_islocked(&g_cpu_wait[cpu]) && + spin_islocked(&g_cpu_paused[cpu])); + + /* Execute Pause IRQ to CPU(cpu) */ + /* Set IPC Interrupt (IRQ0) (write-only) */ + + if (cpu == 1) + { + putreg32(0x1, SAM_IPC1_ISCR); + } + else + { + putreg32(0x1, SAM_IPC0_ISCR); + } + + /* Wait for the other CPU to unlock g_cpu_paused meaning that + * it is fully paused and ready for up_cpu_resume(); + */ + + spin_lock(&g_cpu_paused[cpu]); + + spin_unlock(&g_cpu_paused[cpu]); + + /* On successful return g_cpu_wait will be locked, the other CPU will be + * spinninf on g_cpu_wait and will not continue until g_cpu_resume() is + * called. g_cpu_paused will be unlocked in any case. + */ + + return 0; +} + +/**************************************************************************** + * Name: up_cpu_resume + * + * Description: + * Restart the cpu after it was paused via up_cpu_pause(), restoring the + * state of the task at the head of the g_assignedtasks[cpu] list, and + * resume normal tasking. + * + * This function is called after up_cpu_pause in order resume operation of + * the CPU after modifying its g_assignedtasks[cpu] list. + * + * Input Parameters: + * cpu - The index of the CPU being re-started. + * + * Returned Value: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_cpu_resume(int cpu) +{ + DPRINTF("cpu=%d\n",cpu); + + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); + + /* Release the spinlock. Releasing the spinlock will cause the SGI2 + * handler on 'cpu' to continue and return from interrupt to the newly + * established thread. + */ + + DEBUGASSERT(spin_islocked(&g_cpu_wait[cpu]) && + !spin_islocked(&g_cpu_paused[cpu])); + + spin_unlock(&g_cpu_wait[cpu]); + + return 0; +} + +#endif /* CONFIG_SMP */ diff --git a/arch/arm/src/sam34/sam4cm_cpustart.c b/arch/arm/src/sam34/sam4cm_cpustart.c new file mode 100644 index 0000000000000000000000000000000000000000..f8544abf7fcd58c21965b28f416f126f52c092e1 --- /dev/null +++ b/arch/arm/src/sam34/sam4cm_cpustart.c @@ -0,0 +1,244 @@ +/**************************************************************************** + * arch/arm/src/sam34/sam4cm_cpustart.c + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "nvic.h" +#include "up_arch.h" +#include "sched/sched.h" +#include "init/init.h" +#include "up_internal.h" +#include "chip/sam_pmc.h" +#include "chip/sam_rstc.h" +#include "chip/sam4cm_ipc.h" +#include "sam4cm_periphclks.h" + +#ifdef CONFIG_SMP + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#if 0 +# define DPRINTF(fmt, args...) _err(fmt, ##args) +#else +# define DPRINTF(fmt, args...) do {} while (0) +#endif + +#define CPU1_VECTOR_RESETV (SAM_INTSRAM1_BASE) +#define CPU1_VECTOR_ISTACK (SAM_INTSRAM1_BASE + 4) + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +volatile static spinlock_t g_cpu1_boot; +extern int arm_pause_handler(int irq, void *c); + +/**************************************************************************** + * Name: cpu1_boot + * + * Description: + * This is the boot vector for CM4P1 + * + * Input Parameters: + * + * Returned Value: + * + ****************************************************************************/ + +static void cpu1_boot(void) +{ + int cpu; + + /* Disable CMCC1 */ + + putreg32(0, 0x48018008); + while ((getreg32(0x4801800c) & 0x01) != 0); + + cpu = up_cpu_index(); + DPRINTF("cpu = %d\n", cpu); + + if (cpu == 1) + { + /* Use CPU0 vectors */ + + putreg32((uint32_t)&_stext, NVIC_VECTAB); + sam_ipc1_enableclk(); + + /* Clear : write-only */ + + putreg32(0x1, SAM_IPC1_ICCR); + + /* Enable : write-only */ + + putreg32(0x1, SAM_IPC1_IECR); + irq_attach(SAM_IRQ_IPC1, arm_pause_handler); + up_enable_irq(SAM_IRQ_IPC1); + } + + spin_unlock(&g_cpu1_boot); + +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that this CPU has started */ + + sched_note_cpu_started(this_task()); +#endif + + /* Then transfer control to the IDLE task */ + + (void)os_idle_task(0, NULL); +} + +/**************************************************************************** + * Name: up_cpu_start + * + * Description: + * In an SMP configution, only one CPU is initially active (CPU 0). System + * initialization occurs on that single thread. At the completion of the + * initialization of the OS, just before beginning normal multitasking, + * the additional CPUs would be started by calling this function. + * + * Each CPU is provided the entry point to is IDLE task when started. A + * TCB for each CPU's IDLE task has been initialized and placed in the + * CPU's g_assignedtasks[cpu] list. Not stack has been alloced or + * initialized. + * + * The OS initialization logic calls this function repeatedly until each + * CPU has been started, 1 through (CONFIG_SMP_NCPUS-1). + * + * Input Parameters: + * cpu - The index of the CPU being started. This will be a numeric + * value in the range of from one to (CONFIG_SMP_NCPUS-1). (CPU + * 0 is already active) + * + * Returned Value: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +int up_cpu_start(int cpu) +{ + struct tcb_s *tcb = current_task(cpu); + + DPRINTF("cpu=%d\n",cpu); + + if (cpu != 1) + { + return -EINVAL; + } + +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the start event */ + + sched_note_cpu_start(this_task(), cpu); +#endif + + /* Reset coprocessor */ + + putreg32(0x5a000000, SAM_RSTC_CPMR); + + /* Enable Coprocessor Bus Master Clock (write-only) */ + + putreg32(PMC_CPKEY | PMC_CPBMCK, SAM_PMC_SCER); + + /* Enable Coprocessor Clock (write-only) */ + + putreg32(PMC_CPKEY | PMC_CPCK, SAM_PMC_SCER); + + /* Set Coprocessor Clock Prescalar */ + + modifyreg32(SAM_PMC_MCKR, PMC_MCKR_CPPRES_MASK, 0); + + /* Set Coprocessor Clock Source */ + + modifyreg32(SAM_PMC_MCKR, PMC_MCKR_CPCSS_MASK, PMC_MCKR_CPCSS_PLLB); + + /* Unreset coprocessor pheripheral */ + + putreg32(0x5a000010, SAM_RSTC_CPMR); + + /* Enable clock for SRAM1 where CPU1 starts (write-only) */ + + putreg32(PMC_PID42, SAM_PMC_PCER1); + + /* Clear SRAM1 */ + + memset((void *)SAM_INTSRAM1_BASE, 0, 16 * 1024); + + /* Copy initial vectors for CPU1 */ + + putreg32((uint32_t)tcb->adj_stack_ptr, CPU1_VECTOR_RESETV); + putreg32((uint32_t)cpu1_boot, CPU1_VECTOR_ISTACK); + + spin_lock(&g_cpu1_boot); + + /* Unreset coprocessor */ + + putreg32(0x5a000011, SAM_RSTC_CPMR); + + /* IRQ setup CPU1->CPU0 */ + + sam_ipc0_enableclk(); + putreg32(0x1, SAM_IPC0_ICCR); /* clear : write-only */ + putreg32(0x1, SAM_IPC0_IECR); /* enable : write-only */ + irq_attach(SAM_IRQ_IPC0, arm_pause_handler); + up_enable_irq(SAM_IRQ_IPC0); + + spin_lock(&g_cpu1_boot); + + /* CPU1 boot done */ + + spin_unlock(&g_cpu1_boot); + + return 0; +} + +#endif /* CONFIG_SMP */ diff --git a/arch/arm/src/sam34/sam4cm_idle.c b/arch/arm/src/sam34/sam4cm_idle.c new file mode 100644 index 0000000000000000000000000000000000000000..9c3810136cfe096dc68431d67f3e11fca947a17d --- /dev/null +++ b/arch/arm/src/sam34/sam4cm_idle.c @@ -0,0 +1,77 @@ +/**************************************************************************** + * arch/arm/src/sam34/sam4cm_idle.c + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include "up_internal.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_idle + * + * Description: + * up_idle() is the logic that will be executed when their is no other + * ready-to-run task. This is processor idle time and will continue until + * some interrupt occurs to cause a context switch from the idle task. + * + * Processing in this state may be processor-specific. e.g., this is where + * power management operations might be performed. + * + ****************************************************************************/ + +void up_idle(void) +{ +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) + /* If the system is idle and there are no timer interrupts, then process + * "fake" timer interrupts. Hopefully, something will wake up. + */ + + sched_process_timer(); +#else + + /* Sleep until an interrupt occurs to save power */ + + asm("WFI"); + +#endif +} diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index 15e7b1b4ba44e01793012252f0f1f2ccab9526b8..7ce3b0c316516b033a0b8759bb333da1096f8e29 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -64,11 +64,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -101,13 +97,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_SAM34_EMAC_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_SAM34_EMAC_LPWORK) @@ -275,9 +270,7 @@ struct sam_emac_s uint8_t ifup : 1; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -313,7 +306,6 @@ struct sam_emac_s static struct sam_emac_s g_emac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -324,7 +316,6 @@ static struct sam_emac_s g_emac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAM34_EMAC_PREALLOCATE /* Preallocated data */ @@ -388,24 +379,16 @@ static void sam_dopoll(struct sam_emac_s *priv); static int sam_recvframe(struct sam_emac_s *priv); static void sam_receive(struct sam_emac_s *priv); static void sam_txdone(struct sam_emac_s *priv); -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void sam_interrupt_work(FAR void *arg); -#endif static int sam_emac_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txtimeout_work(FAR void *arg); -#endif static void sam_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void sam_poll_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_poll_work(FAR void *arg); -#endif static void sam_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ @@ -413,10 +396,7 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...); static int sam_ifup(struct net_driver_s *dev); static int sam_ifdown(struct net_driver_s *dev); -static inline void sam_txavail_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txavail_work(FAR void *arg); -#endif static int sam_txavail(struct net_driver_s *dev); #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) @@ -467,6 +447,7 @@ static int sam_emac_configure(struct sam_emac_s *priv); /**************************************************************************** * Private Functions ****************************************************************************/ + /**************************************************************************** * Name: sam_checkreg * @@ -1423,25 +1404,25 @@ static void sam_txdone(struct sam_emac_s *priv) } /**************************************************************************** - * Function: sam_interrupt_process + * Function: sam_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) +static void sam_interrupt_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; uint32_t isr; uint32_t rsr; uint32_t tsr; @@ -1450,6 +1431,9 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) uint32_t pending; uint32_t clrbits; + /* Process pending Ethernet interrupts */ + + net_lock(); isr = sam_getreg(priv, SAM_EMAC_ISR); rsr = sam_getreg(priv, SAM_EMAC_RSR); tsr = sam_getreg(priv, SAM_EMAC_TSR); @@ -1605,42 +1589,13 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) nwarn("WARNING: Pause TO!\n"); } #endif -} - -/**************************************************************************** - * Function: sam_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_interrupt_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - state = net_lock(); - sam_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ up_enable_irq(SAM_IRQ_EMAC); } -#endif /**************************************************************************** * Function: sam_emac_interrupt @@ -1663,7 +1618,6 @@ static int sam_emac_interrupt(int irq, void *context) { struct sam_emac_s *priv = &g_emac; -#ifdef CONFIG_NET_NOINTS uint32_t tsr; /* Disable further Ethernet interrupts. Because Ethernet interrupts are @@ -1707,83 +1661,46 @@ static int sam_emac_interrupt(int irq, void *context) /* Schedule to perform the interrupt processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_interrupt_work, priv, 0); - -#else - /* Process the interrupt now */ - - sam_interrupt_process(priv); -#endif - return OK; } /**************************************************************************** - * Function: sam_txtimeout_process + * Function: sam_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv) +static void sam_txtimeout_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + nerr("ERROR: Timeout!\n"); /* Then reset the hardware. Just take the interface down, then back * up again. */ + net_lock(); sam_ifdown(&priv->dev); sam_ifup(&priv->dev); /* Then poll the network for new XMIT data */ sam_dopoll(priv); + net_unlock(); } -/**************************************************************************** - * Function: sam_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txtimeout_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - sam_txtimeout_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_txtimeout_expiry * @@ -1807,7 +1724,6 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -1824,38 +1740,35 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - sam_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: sam_poll_process + * Function: sam_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_poll_process(FAR struct sam_emac_s *priv) +static void sam_poll_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; struct net_driver_s *dev = &priv->dev; /* Check if the there are any free TX descriptors. We cannot perform the * TX poll if we do not have buffering for another packet. */ + net_lock(); if (sam_txfree(priv) > 0) { /* Update TCP timing states and poll the network for new XMIT data. */ @@ -1866,39 +1779,9 @@ static inline void sam_poll_process(FAR struct sam_emac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: sam_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_poll_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_poll_expiry * @@ -1921,7 +1804,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -1940,12 +1822,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - sam_poll_process(priv); -#endif } /**************************************************************************** @@ -2073,66 +1949,40 @@ static int sam_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: sam_txavail_process + * Function: sam_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void sam_txavail_process(FAR struct sam_emac_s *priv) +static void sam_txavail_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ sam_dopoll(priv); } -} -/**************************************************************************** - * Function: sam_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txavail_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: sam_txavail @@ -2157,7 +2007,6 @@ static int sam_txavail(struct net_driver_s *dev) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2170,21 +2019,6 @@ static int sam_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, sam_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - sam_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } @@ -3820,9 +3654,7 @@ void up_netinitialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index 68f1777434725792819d5731686ce8acddcffbc8..0b3286d0cac6ded7967d028eb74f9bbfbb2b946d 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -84,7 +84,11 @@ * CURRENT_REGS for portability. */ +#ifdef CONFIG_SMP +volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS]; +#else volatile uint32_t *g_current_regs[1]; +#endif /* This is the address of the exception vector table (determined by the * linker script). diff --git a/arch/arm/src/sam34/sam_start.c b/arch/arm/src/sam34/sam_start.c index abae1da7615ee1040fe70e7d33fd8d480ce86b1f..71537f1c38b4507c8854eebbe2b4d21264393f11 100644 --- a/arch/arm/src/sam34/sam_start.c +++ b/arch/arm/src/sam34/sam_start.c @@ -241,6 +241,13 @@ void __start(void) const uint32_t *src; uint32_t *dest; +#ifdef CONFIG_SMP + /* Disable CMCC0 */ + + putreg32(0, 0x4007c008); + while ((getreg32(0x4007c00c) & 0x01) != 0); +#endif + #ifdef CONFIG_ARMV7M_STACKCHECK /* Set the stack limit before we attempt to call any functions */ diff --git a/arch/arm/src/sam34/sam_tc.c b/arch/arm/src/sam34/sam_tc.c index 1ddab1c20fa44feabfaf289bc07e2ec8fa48fa3c..4a1b2abf79d6e093ac48e34cf24ea6d9b67ab813 100644 --- a/arch/arm/src/sam34/sam_tc.c +++ b/arch/arm/src/sam34/sam_tc.c @@ -125,7 +125,7 @@ static int sam34_getstatus(FAR struct timer_lowerhalf_s *lower, FAR struct timer_status_s *status); static int sam34_settimeout(FAR struct timer_lowerhalf_s *lower, uint32_t timeout); -static void sam34_sethandler(FAR struct timer_lowerhalf_s *lower, +static void sam34_setcallback(FAR struct timer_lowerhalf_s *lower, tccb_t callback, FAR void *arg); static int sam34_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd, unsigned long arg); @@ -137,12 +137,12 @@ static int sam34_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd, static const struct timer_ops_s g_tcops = { - .start = sam34_start, - .stop = sam34_stop, - .getstatus = sam34_getstatus, - .settimeout = sam34_settimeout, - .sethandler = sam34_sethandler, - .ioctl = sam34_ioctl, + .start = sam34_start, + .stop = sam34_stop, + .getstatus = sam34_getstatus, + .settimeout = sam34_settimeout, + .setcallback = sam34_setcallback, + .ioctl = sam34_ioctl, }; /* "Lower half" driver state */ @@ -513,8 +513,8 @@ static int sam34_settimeout(FAR struct timer_lowerhalf_s *lower, * ****************************************************************************/ -static void sam34_sethandler(FAR struct timer_lowerhalf_s *lower, - tccb_t callback, FAR void *arg) +static void sam34_setcallback(FAR struct timer_lowerhalf_s *lower, + tccb_t callback, FAR void *arg) { FAR struct sam34_lowerhalf_s *priv = (FAR struct sam34_lowerhalf_s *)lower; irqstate_t flags; diff --git a/arch/arm/src/sama5/Kconfig b/arch/arm/src/sama5/Kconfig index 1400aea5c96e4c5a8b30917b94088e55b6d5a71c..d4ccc256be6442af2d271bc9ee5541e90f90b53f 100644 --- a/arch/arm/src/sama5/Kconfig +++ b/arch/arm/src/sama5/Kconfig @@ -1437,6 +1437,26 @@ config SAMA5_GMAC_NBC ---help--- Select to disable receipt of broadcast packets. +choice + prompt "Work queue" + default SAMA5_GMAC_LPWORK if SCHED_LPWORK + default SAMA5_GMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config SAMA5_GMAC_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config SAMA5_GMAC_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + config SAMA5_GMAC_PHYADDR int "PHY address" default 1 @@ -1675,6 +1695,26 @@ config SAMA5_EMACA_NBC ---help--- Select to disable receipt of broadcast packets. +choice + prompt "Work queue" + default SAMA5_EMACA_LPWORK if SCHED_LPWORK + default SAMA5_EMACA_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config SAMA5_EMACA_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config SAMA5_EMACA_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + config SAMA5_EMACA_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/sama5/chip/sam_pwm.h b/arch/arm/src/sama5/chip/sam_pwm.h index aa5ca2ed0ff70f6cb327b825cea9d9f6804c85dc..8aef808f2934904036211211b853d889e317eafc 100644 --- a/arch/arm/src/sama5/chip/sam_pwm.h +++ b/arch/arm/src/sama5/chip/sam_pwm.h @@ -286,6 +286,7 @@ # define PWM_CLK_DIVA(n) ((uint32_t)(n) << PWM_CLK_DIVA_SHIFT) /* CLKA clock = clock selected by PREA / DIVA */ #define PWM_CLK_PREA_SHIFT (8) /* Bits 8-11: CLKA Source Clock Selection */ #define PWM_CLK_PREA_MASK (15 << PWM_CLK_PREA_SHIFT) +# define PWM_CLK_PREA_DIV(n) ((uint32_t)(n) << PWM_CLK_PREA_SHIFT) # define PWM_CLK_PREA_DIV1 (0 << PWM_CLK_PREA_SHIFT) /* MCK */ # define PWM_CLK_PREA_DIV2 (1 << PWM_CLK_PREA_SHIFT) /* MCK/2 */ # define PWM_CLK_PREA_DIV4 (2 << PWM_CLK_PREA_SHIFT) /* MCK/4 */ @@ -298,11 +299,13 @@ # define PWM_CLK_PREA_DIV512 (9 << PWM_CLK_PREA_SHIFT) /* MCK/512 */ # define PWM_CLK_PREA_DIV1024 (10 << PWM_CLK_PREA_SHIFT) /* MCK/1024 */ #define PWM_CLK_DIVB_SHIFT (16) /* Bits 16-23: CLKB Divide Factor */ +#define PWM_CLK_DIVB_MASK (0xff << PWM_CLK_DIVB_SHIFT) # define PWM_CLK_DIVB_OFF (0 << PWM_CLK_DIVB_SHIFT) /* CLKB clock = off */ # define PWM_CLK_DIVB_PREB (1 << PWM_CLK_DIVB_SHIFT) /* CLKB clock = clock selected by PREB */ # define PWM_CLK_DIVB(n) ((uint32_t)(n) << PWM_CLK_DIVB_SHIFT) /* CLKB clock = clock selected by PREB / DIVB */ #define PWM_CLK_PREB_SHIFT (24) /* Bits 24-27: CLKB Source Clock Selection */ #define PWM_CLK_PREB_MASK (15 << PWM_CLK_PREB_SHIFT) +# define PWM_CLK_PREB_DIV(n) ((uint32_t)(n) << PWM_CLK_PREB_SHIFT) # define PWM_CLK_PREB_DIV1 (0 << PWM_CLK_PREB_SHIFT) /* MCK */ # define PWM_CLK_PREB_DIV2 (1 << PWM_CLK_PREB_SHIFT) /* MCK/2 */ # define PWM_CLK_PREB_DIV4 (2 << PWM_CLK_PREB_SHIFT) /* MCK/4 */ diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index 672a3efc7fb780faf69772e656849728560da674..29bd28c5a75df54010dd92087d8bb527b891bd06 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -4,7 +4,7 @@ * 10/100 Base-T Ethernet driver for the SAMA5D3. Denoted as 'A' to * distinguish it from the SAMA5D4 EMAC driver. * - * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -94,6 +95,25 @@ ****************************************************************************/ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required +#else + + /* Select work queue */ + +# if defined(CONFIG_SAMA5_EMACA_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_SAMA5_EMACA_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_SAMA5_EMACA_HPWORK nor CONFIG_SAMA5_EMACA_LPWORK defined +# endif +#endif + /* Number of buffers for RX */ #ifndef CONFIG_SAMA5_EMAC_NRXBUFFERS @@ -255,6 +275,7 @@ struct sam_emac_s uint8_t ifup : 1; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ + struct work_s work; /* For deferring work to the work queue */ /* This holds the information visible to the NuttX network */ @@ -290,7 +311,6 @@ struct sam_emac_s static struct sam_emac_s g_emac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -301,7 +321,6 @@ static struct sam_emac_s g_emac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAMA5_EMACA_PREALLOCATE /* Preallocated data */ @@ -365,17 +384,24 @@ static void sam_dopoll(struct sam_emac_s *priv); static int sam_recvframe(struct sam_emac_s *priv); static void sam_receive(struct sam_emac_s *priv); static void sam_txdone(struct sam_emac_s *priv); + +static void sam_interrupt_work(FAR void *arg); static int sam_emac_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void sam_polltimer(int argc, uint32_t arg, ...); -static void sam_txtimeout(int argc, uint32_t arg, ...); +static void sam_txtimeout_work(FAR void *arg); +static void sam_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void sam_poll_work(FAR void *arg); +static void sam_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int sam_ifup(struct net_driver_s *dev); static int sam_ifdown(struct net_driver_s *dev); + +static void sam_txavail_work(FAR void *arg); static int sam_txavail(struct net_driver_s *dev); #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) @@ -790,7 +816,7 @@ static int sam_transmit(struct sam_emac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout, 1, + (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again @@ -905,7 +931,7 @@ static int sam_txpoll(struct net_driver_s *dev) * * 1. After completion of a transmission (sam_txdone), * 2. When new TX data is available (sam_txavail), and - * 3. After a TX timeout to restart the sending process (sam_txtimeout). + * 3. After a TX timeout to restart the sending process (sam_txtimeout_expiry). * * Parameters: * priv - Reference to the driver state structure @@ -1418,25 +1444,25 @@ static void sam_txdone(struct sam_emac_s *priv) } /**************************************************************************** - * Function: sam_emac_interrupt + * Function: sam_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static int sam_emac_interrupt(int irq, void *context) +static void sam_interrupt_work(FAR void *arg) { - struct sam_emac_s *priv = &g_emac; + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; uint32_t isr; uint32_t rsr; uint32_t tsr; @@ -1445,6 +1471,9 @@ static int sam_emac_interrupt(int irq, void *context) uint32_t pending; uint32_t clrbits; + /* Process pending Ethernet interrupts */ + + net_lock(); isr = sam_getreg(priv, SAM_EMAC_ISR); rsr = sam_getreg(priv, SAM_EMAC_RSR); tsr = sam_getreg(priv, SAM_EMAC_TSR); @@ -1600,51 +1629,120 @@ static int sam_emac_interrupt(int irq, void *context) } #endif + net_unlock(); + + /* Re-enable Ethernet interrupts */ + + up_enable_irq(SAM_IRQ_EMAC); +} + +/**************************************************************************** + * Function: sam_emac_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int sam_emac_interrupt(int irq, void *context) +{ + struct sam_emac_s *priv = &g_emac; + uint32_t tsr; + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(SAM_IRQ_EMAC); + + /* Check for the completion of a transmission. Careful: + * + * ISR:TCOMP is set when a frame has been transmitted. Cleared on read (so + * we cannot read it here). + * TSR:TXCOMP is set when a frame has been transmitted. Cleared by writing a + * one to this bit. + */ + + tsr = sam_getreg(priv, SAM_EMAC_TSR_OFFSET); + if ((tsr & EMAC_TSR_COMP) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be do race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->txtimeout); + + /* Make sure that the TX poll timer is running (if it is already + * running, the following would restart it). This is necessary to + * avoid certain race conditions where the polling sequence can be + * interrupted. + */ + + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + } + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: sam_txtimeout + * Function: sam_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static void sam_txtimeout(int argc, uint32_t arg, ...) +static void sam_txtimeout_work(FAR void *arg) { - struct sam_emac_s *priv = (struct sam_emac_s *)arg; + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; nerr("ERROR: Timeout!\n"); - /* Then reset the hardware. Just take the interface down, then back - * up again. - */ + /* Reset the hardware. Just take the interface down, then back up again. */ + net_lock(); sam_ifdown(&priv->dev); sam_ifup(&priv->dev); /* Then poll the network for new XMIT data */ sam_dopoll(priv); + net_unlock(); } /**************************************************************************** - * Function: sam_polltimer + * Function: sam_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1658,15 +1756,55 @@ static void sam_txtimeout(int argc, uint32_t arg, ...) * ****************************************************************************/ -static void sam_polltimer(int argc, uint32_t arg, ...) +static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) { - struct sam_emac_s *priv = (struct sam_emac_s *)arg; - struct net_driver_s *dev = &priv->dev; + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + up_disable_irq(SAM_IRQ_EMAC); + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: sam_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * Ethernet interrupts are disabled + * + ****************************************************************************/ + +static void sam_poll_work(FAR void *arg) +{ + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + struct net_driver_s *dev = &priv->dev; /* Check if the there are any free TX descriptors. We cannot perform the * TX poll if we do not have buffering for another packet. */ + net_lock(); if (sam_txfree(priv) > 0) { /* Update TCP timing states and poll the network for new XMIT data. */ @@ -1676,7 +1814,50 @@ static void sam_polltimer(int argc, uint32_t arg, ...) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_polltimer, 1, arg); + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + net_unlock(); +} + +/**************************************************************************** + * Function: sam_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void sam_poll_expiry(int argc, uint32_t arg, ...) +{ + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, arg); + } } /**************************************************************************** @@ -1747,7 +1928,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_polltimer, 1, (uint32_t)priv); + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the EMAC interrupt */ @@ -1803,6 +1984,42 @@ static int sam_ifdown(struct net_driver_s *dev) return OK; } +/**************************************************************************** + * Function: sam_txavail_work + * + * Description: + * Perform an out-of-cycle poll on the worker thread. + * + * Parameters: + * arg - Reference to the NuttX driver state structure (cast to void*) + * + * Returned Value: + * None + * + * Assumptions: + * Called on the higher priority worker thread. + * + ****************************************************************************/ + +static void sam_txavail_work(FAR void *arg) +{ + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + + ninfo("ifup: %d\n", priv->ifup); + + /* Ignore the notification if the interface is not yet up */ + + net_lock(); + if (priv->ifup) + { + /* Poll the network for new XMIT data */ + + sam_dopoll(priv); + } + + net_unlock(); +} + /**************************************************************************** * Function: sam_txavail * @@ -1812,7 +2029,7 @@ static int sam_ifdown(struct net_driver_s *dev) * latency. * * Parameters: - * dev - Reference to the NuttX driver state structure + * dev - Reference to the NuttX driver state structure * * Returned Value: * None @@ -1824,27 +2041,20 @@ static int sam_ifdown(struct net_driver_s *dev) static int sam_txavail(struct net_driver_s *dev) { - struct sam_emac_s *priv = (struct sam_emac_s *)dev->d_private; - irqstate_t flags; + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)dev->d_private; - ninfo("ifup: %d\n", priv->ifup); - - /* Disable interrupts because this function may be called from interrupt - * level processing. + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. */ - flags = enter_critical_section(); - - /* Ignore the notification if the interface is not yet up */ - - if (priv->ifup) + if (work_available(&priv->work)) { - /* Poll the network for new XMIT data */ + /* Schedule to serialize the poll on the worker thread. */ - sam_dopoll(priv); + work_queue(ETHWORK, &priv->work, sam_txavail_work, priv, 0); } - leave_critical_section(flags); return OK; } @@ -3486,9 +3696,7 @@ int sam_emac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_emac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 3d9f282ce9688fcadb6f7c9f898a3cbe829e68bf..44b477cb7ba08db0ea5d8884c32e9fb196b0eb4a 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -79,11 +79,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -117,13 +113,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_SAMA5_EMACB_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_SAMA5_EMACB_LPWORK) @@ -418,9 +413,7 @@ struct sam_emac_s uint8_t ifup : 1; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -486,10 +479,8 @@ static void sam_dopoll(struct sam_emac_s *priv); static int sam_recvframe(struct sam_emac_s *priv); static void sam_receive(struct sam_emac_s *priv); static void sam_txdone(struct sam_emac_s *priv); -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void sam_interrupt_work(FAR void *arg); -#endif static int sam_emac_interrupt(struct sam_emac_s *priv); #ifdef CONFIG_SAMA5_EMAC0 static int sam_emac0_interrupt(int irq, void *context); @@ -500,16 +491,10 @@ static int sam_emac1_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txtimeout_work(FAR void *arg); -#endif static void sam_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void sam_poll_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_poll_work(FAR void *arg); -#endif static void sam_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ @@ -517,10 +502,7 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...); static int sam_ifup(struct net_driver_s *dev); static int sam_ifdown(struct net_driver_s *dev); -static inline void sam_txavail_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txavail_work(FAR void *arg); -#endif static int sam_txavail(struct net_driver_s *dev); #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) @@ -710,7 +692,6 @@ static const struct sam_emacattr_s g_emac0_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -721,7 +702,6 @@ static const struct sam_emacattr_s g_emac0_attr = */ static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC0 peripheral state */ @@ -793,7 +773,6 @@ static const struct sam_emacattr_s g_emac1_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -804,7 +783,6 @@ static const struct sam_emacattr_s g_emac1_attr = */ static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC1 peripheral state */ @@ -1834,25 +1812,25 @@ static void sam_txdone(struct sam_emac_s *priv) } /**************************************************************************** - * Function: sam_interrupt_process + * Function: sam_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) +static void sam_interrupt_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; uint32_t isr; uint32_t rsr; uint32_t tsr; @@ -1861,6 +1839,9 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) uint32_t pending; uint32_t clrbits; + /* Process pending Ethernet interrupts */ + + net_lock(); isr = sam_getreg(priv, SAM_EMAC_ISR_OFFSET); rsr = sam_getreg(priv, SAM_EMAC_RSR_OFFSET); tsr = sam_getreg(priv, SAM_EMAC_TSR_OFFSET); @@ -2016,42 +1997,13 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv) nwarn("WARNING: Pause TO!\n"); } #endif -} -/**************************************************************************** - * Function: sam_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_interrupt_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - sam_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ up_enable_irq(priv->attr->irq); } -#endif /**************************************************************************** * Function: sam_emac_interrupt @@ -2071,7 +2023,6 @@ static void sam_interrupt_work(FAR void *arg) static int sam_emac_interrupt(struct sam_emac_s *priv) { -#ifdef CONFIG_NET_NOINTS uint32_t tsr; /* Disable further Ethernet interrupts. Because Ethernet interrupts are @@ -2115,13 +2066,6 @@ static int sam_emac_interrupt(struct sam_emac_s *priv) /* Schedule to perform the interrupt processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_interrupt_work, priv, 0); - -#else - /* Process the interrupt now */ - - sam_interrupt_process(priv); -#endif - return OK; } @@ -2157,70 +2101,40 @@ static int sam_emac1_interrupt(int irq, void *context) #endif /**************************************************************************** - * Function: sam_txtimeout_process + * Function: sam_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv) +static void sam_txtimeout_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + nerr("ERROR: Timeout!\n"); /* Reset the hardware. Just take the interface down, then back up again. */ + net_lock(); sam_ifdown(&priv->dev); sam_ifup(&priv->dev); /* Then poll the network for new XMIT data */ sam_dopoll(priv); + net_unlock(); } -/**************************************************************************** - * Function: sam_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txtimeout_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - sam_txtimeout_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_txtimeout_expiry * @@ -2244,7 +2158,6 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2261,38 +2174,35 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - sam_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: sam_poll_process + * Function: sam_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_poll_process(FAR struct sam_emac_s *priv) +static void sam_poll_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; struct net_driver_s *dev = &priv->dev; /* Check if the there are any free TX descriptors. We cannot perform the * TX poll if we do not have buffering for another packet. */ + net_lock(); if (sam_txfree(priv) > 0) { /* Update TCP timing states and poll the network for new XMIT data. */ @@ -2303,39 +2213,9 @@ static inline void sam_poll_process(FAR struct sam_emac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: sam_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_poll_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_poll_expiry * @@ -2358,7 +2238,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2377,12 +2256,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - sam_poll_process(priv); -#endif } /**************************************************************************** @@ -2518,66 +2391,40 @@ static int sam_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: sam_txavail_process + * Function: sam_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void sam_txavail_process(FAR struct sam_emac_s *priv) +static void sam_txavail_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ sam_dopoll(priv); } -} -/**************************************************************************** - * Function: sam_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txavail_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: sam_txavail @@ -2602,7 +2449,6 @@ static int sam_txavail(struct net_driver_s *dev) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2615,21 +2461,6 @@ static int sam_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, sam_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - sam_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } @@ -4546,9 +4377,7 @@ int sam_emac_initialize(int intf) { struct sam_emac_s *priv; const struct sam_emacattr_s *attr; -#ifdef CONFIG_NET_MULTIBUFFER uint8_t *pktbuf; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) uint8_t phytype; #endif @@ -4559,10 +4388,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac0; attr = &g_emac0_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf0; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMA5_EMAC0_PHY_TYPE; @@ -4575,10 +4401,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac1; attr = &g_emac1_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf1; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMA5_EMAC1_PHY_TYPE; @@ -4595,9 +4418,7 @@ int sam_emac_initialize(int intf) memset(priv, 0, sizeof(struct sam_emac_s)); priv->attr = attr; /* Save the constant attributes */ -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 5442920ee03b31be62ea23bba9a36f9197194215..da6b320d523214e64efae094d105d042ef92f215 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/sama5/sam_gmac.c * - * Copyright (C) 2013-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -91,6 +92,25 @@ ****************************************************************************/ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required +#else + + /* Select work queue */ + +# if defined(CONFIG_SAMA5_GMAC_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_SAMA5_GMAC_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_SAMA5_GMAC_HPWORK nor CONFIG_SAMA5_GMAC_LPWORK defined +# endif +#endif + /* Number of buffer for RX */ #ifndef CONFIG_SAMA5_GMAC_NRXBUFFERS @@ -181,6 +201,7 @@ struct sam_gmac_s uint8_t ifup : 1; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ + struct work_s work; /* For deferring work to the work queue */ /* This holds the information visible to the NuttX network */ @@ -216,7 +237,6 @@ struct sam_gmac_s static struct sam_gmac_s g_gmac; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -227,7 +247,6 @@ static struct sam_gmac_s g_gmac; */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif #ifdef CONFIG_SAMA5_GMAC_PREALLOCATE /* Preallocated data */ @@ -290,17 +309,24 @@ static void sam_dopoll(struct sam_gmac_s *priv); static int sam_recvframe(struct sam_gmac_s *priv); static void sam_receive(struct sam_gmac_s *priv); static void sam_txdone(struct sam_gmac_s *priv); + +static void sam_interrupt_work(FAR void *arg); static int sam_gmac_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void sam_polltimer(int argc, uint32_t arg, ...); -static void sam_txtimeout(int argc, uint32_t arg, ...); +static void sam_txtimeout_work(FAR void *arg); +static void sam_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void sam_poll_work(FAR void *arg); +static void sam_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int sam_ifup(struct net_driver_s *dev); static int sam_ifdown(struct net_driver_s *dev); + +static void sam_txavail_work(FAR void *arg); static int sam_txavail(struct net_driver_s *dev); #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) @@ -722,7 +748,7 @@ static int sam_transmit(struct sam_gmac_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout, 1, + (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, (uint32_t)priv); /* Set d_len to zero meaning that the d_buf[] packet buffer is again @@ -837,7 +863,7 @@ static int sam_txpoll(struct net_driver_s *dev) * * 1. After completion of a transmission (sam_txdone), * 2. When new TX data is available (sam_txavail), and - * 3. After a TX timeout to restart the sending process (sam_txtimeout). + * 3. After a TX timeout to restart the sending process (sam_txtimeout_expiry). * * Parameters: * priv - Reference to the driver state structure @@ -1346,25 +1372,25 @@ static void sam_txdone(struct sam_gmac_s *priv) } /**************************************************************************** - * Function: sam_gmac_interrupt + * Function: sam_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static int sam_gmac_interrupt(int irq, void *context) +static void sam_interrupt_work(FAR void *arg) { - struct sam_gmac_s *priv = &g_gmac; + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; uint32_t isr; uint32_t rsr; uint32_t tsr; @@ -1373,6 +1399,9 @@ static int sam_gmac_interrupt(int irq, void *context) uint32_t pending; uint32_t clrbits; + /* Process pending Ethernet interrupts */ + + net_lock(); isr = sam_getreg(priv, SAM_GMAC_ISR); rsr = sam_getreg(priv, SAM_GMAC_RSR); tsr = sam_getreg(priv, SAM_GMAC_TSR); @@ -1552,51 +1581,120 @@ static int sam_gmac_interrupt(int irq, void *context) } #endif + net_unlock(); + + /* Re-enable Ethernet interrupts */ + + up_enable_irq(SAM_IRQ_GMAC); +} + +/**************************************************************************** + * Function: sam_gmac_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int sam_gmac_interrupt(int irq, void *context) +{ + struct sam_gmac_s *priv = &g_gmac; + uint32_t tsr; + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(SAM_IRQ_GMAC); + + /* Check for the completion of a transmission. Careful: + * + * ISR:TCOMP is set when a frame has been transmitted. Cleared on read (so + * we cannot read it here). + * TSR:TXCOMP is set when a frame has been transmitted. Cleared by writing a + * one to this bit. + */ + + tsr = sam_getreg(priv, SAM_GMAC_TSR_OFFSET); + if ((tsr & GMAC_TSR_TXCOMP) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be do race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->txtimeout); + + /* Make sure that the TX poll timer is running (if it is already + * running, the following would restart it). This is necessary to + * avoid certain race conditions where the polling sequence can be + * interrupted. + */ + + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + } + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: sam_txtimeout + * Function: sam_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static void sam_txtimeout(int argc, uint32_t arg, ...) +static void sam_txtimeout_work(FAR void *arg) { - struct sam_gmac_s *priv = (struct sam_gmac_s *)arg; + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; nerr("ERROR: Timeout!\n"); - /* Then reset the hardware. Just take the interface down, then back - * up again. - */ + /* Reset the hardware. Just take the interface down, then back up again. */ + net_lock(); sam_ifdown(&priv->dev); sam_ifup(&priv->dev); /* Then poll the network for new XMIT data */ sam_dopoll(priv); + net_unlock(); } /**************************************************************************** - * Function: sam_polltimer + * Function: sam_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1610,15 +1708,55 @@ static void sam_txtimeout(int argc, uint32_t arg, ...) * ****************************************************************************/ -static void sam_polltimer(int argc, uint32_t arg, ...) +static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) { - struct sam_gmac_s *priv = (struct sam_gmac_s *)arg; - struct net_driver_s *dev = &priv->dev; + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + up_disable_irq(SAM_IRQ_GMAC); + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: sam_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * Ethernet interrupts are disabled + * + ****************************************************************************/ + +static void sam_poll_work(FAR void *arg) +{ + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; + struct net_driver_s *dev = &priv->dev; /* Check if the there are any free TX descriptors. We cannot perform the * TX poll if we do not have buffering for another packet. */ + net_lock(); if (sam_txfree(priv) > 0) { /* Update TCP timing states and poll the network for new XMIT data. */ @@ -1628,7 +1766,50 @@ static void sam_polltimer(int argc, uint32_t arg, ...) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_polltimer, 1, arg); + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + net_unlock(); +} + +/**************************************************************************** + * Function: sam_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void sam_poll_expiry(int argc, uint32_t arg, ...) +{ + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->work, sam_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, arg); + } } /**************************************************************************** @@ -1702,7 +1883,7 @@ static int sam_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_polltimer, 1, (uint32_t)priv); + (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, (uint32_t)priv); /* Enable the GMAC interrupt */ @@ -1758,6 +1939,42 @@ static int sam_ifdown(struct net_driver_s *dev) return OK; } +/**************************************************************************** + * Function: sam_txavail_work + * + * Description: + * Perform an out-of-cycle poll on the worker thread. + * + * Parameters: + * arg - Reference to the NuttX driver state structure (cast to void*) + * + * Returned Value: + * None + * + * Assumptions: + * Called on the higher priority worker thread. + * + ****************************************************************************/ + +static void sam_txavail_work(FAR void *arg) +{ + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)arg; + + ninfo("ifup: %d\n", priv->ifup); + + /* Ignore the notification if the interface is not yet up */ + + net_lock(); + if (priv->ifup) + { + /* Poll the network for new XMIT data */ + + sam_dopoll(priv); + } + + net_unlock(); +} + /**************************************************************************** * Function: sam_txavail * @@ -1767,7 +1984,7 @@ static int sam_ifdown(struct net_driver_s *dev) * latency. * * Parameters: - * dev - Reference to the NuttX driver state structure + * dev - Reference to the NuttX driver state structure * * Returned Value: * None @@ -1779,27 +1996,20 @@ static int sam_ifdown(struct net_driver_s *dev) static int sam_txavail(struct net_driver_s *dev) { - struct sam_gmac_s *priv = (struct sam_gmac_s *)dev->d_private; - irqstate_t flags; + FAR struct sam_gmac_s *priv = (FAR struct sam_gmac_s *)dev->d_private; - ninfo("ifup: %d\n", priv->ifup); - - /* Disable interrupts because this function may be called from interrupt - * level processing. + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. */ - flags = enter_critical_section(); - - /* Ignore the notification if the interface is not yet up */ - - if (priv->ifup) + if (work_available(&priv->work)) { - /* Poll the network for new XMIT data */ + /* Schedule to serialize the poll on the worker thread. */ - sam_dopoll(priv); + work_queue(ETHWORK, &priv->work, sam_txavail_work, priv, 0); } - leave_critical_section(flags); return OK; } @@ -3558,9 +3768,7 @@ int sam_gmac_initialize(void) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct sam_gmac_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/sama5/sam_pwm.c b/arch/arm/src/sama5/sam_pwm.c index d523da24a1c145da629252ff96ac7d4c66ee7c9a..622d4569b0f09385ea953d3d1723ab7b5f970c0d 100644 --- a/arch/arm/src/sama5/sam_pwm.c +++ b/arch/arm/src/sama5/sam_pwm.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/sama5/sam_pwm.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -82,154 +82,14 @@ # warning CONFIG_PWM_PULSECOUNT no supported by this driver. #endif -/* Are we using CLKA? CLKB? If so, what frequency? Select the prescaler - * value that allows the largest, valid divider value. This may not be - * optimal in all cases, but in general should provide a reasonable frequency - * value. - * - * frequency = MCK / prescaler / div - * - * Pick smallest prescaler such that: - * - * prescaler = MCK / frequency / div < 256 - * - * Then: - * - * div = MCK / prescaler / frequency - * - * Calulcated Values - * - * CLKn_PRE = CLKn prescaler value - * PWM_CLK_PREn = CLKn prescaler register setting - * CLKn_DIV = CLKn divider value - * PWM_CLK_DIVn = CLKn divider register setting - * CLKn_FREQUENCY = Actual resulting CLKn frequency - */ - -#ifdef CONFIG_SAMA5_PWM_CLKA +/* Are we using CLKA? CLKB? If so, at what frequency? */ -# if !defined(CONFIG_SAMA5_PWM_CLKA_FREQUENCY) +#if defined(CONFIG_SAMA5_PWM_CLKA) && !defined(CONFIG_SAMA5_PWM_CLKA_FREQUENCY) # error CONFIG_SAMA5_PWM_CLKA_FREQUENCY is not defined - -# elif (BOARD_MCK_FREQUENCY / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV1 -# define CLKA_PRE 1 - -# elif (BOARD_MCK_FREQUENCY / 2 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV2 -# define CLKA_PRE 2 - -# elif (BOARD_MCK_FREQUENCY / 4 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV4 -# define CLKA_PRE 4 - -# elif (BOARD_MCK_FREQUENCY / 8 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV8 -# define CLKA_PRE 8 - -# elif (BOARD_MCK_FREQUENCY / 16 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV16 -# define CLKA_PRE 16 - -# elif (BOARD_MCK_FREQUENCY / 32 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV32 -# define CLKA_PRE 32 - -# elif (BOARD_MCK_FREQUENCY / 64 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV64 -# define CLKA_PRE 64 - -# elif (BOARD_MCK_FREQUENCY / 128 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV128 -# define CLKA_PRE 128 - -# elif (BOARD_MCK_FREQUENCY / 256 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV256 -# define CLKA_PRE 256 - -# elif (BOARD_MCK_FREQUENCY / 512 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV512 -# define CLKA_PRE 512 - -# elif (BOARD_MCK_FREQUENCY / 1024 / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) < 256 -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV1024 -# define CLKA_PRE 1024 - -# else -# error Cannot realize CONFIG_SAMA5_PWM_CLKA_FREQUENCY -# endif - -# define CLKA_DIV (BOARD_MCK_FREQUENCY / CLKA_PRE / CONFIG_SAMA5_PWM_CLKA_FREQUENCY) -# define CLKA_FREQUENCY (BOARD_MCK_FREQUENCY / CLKA_PRE / CLKA_DIV) -# define CLKA_DIV_BITS PWM_CLK_DIVA(CLKA_DIV) - -#else -# undef CONFIG_SAMA5_PWM_CLKA_FREQUENCY -# define CLKA_PRE_BITS PWM_CLK_PREA_DIV1 -# define CLKA_DIV_BITS PWM_CLK_DIVA_OFF #endif -#ifdef CONFIG_SAMA5_PWM_CLKB - -# if !defined(CONFIG_SAMA5_PWM_CLKB_FREQUENCY) +#if defined(CONFIG_SAMA5_PWM_CLKB) && !defined(CONFIG_SAMA5_PWM_CLKB_FREQUENCY) # error CONFIG_SAMA5_PWM_CLKB_FREQUENCY is not defined - -# elif (BOARD_MCK_FREQUENCY / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV1 -# define CLKB_PRE 1 - -# elif (BOARD_MCK_FREQUENCY / 2 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV2 -# define CLKB_PRE 2 - -# elif (BOARD_MCK_FREQUENCY / 4 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV4 -# define CLKB_PRE 4 - -# elif (BOARD_MCK_FREQUENCY / 8 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV8 -# define CLKB_PRE 8 - -# elif (BOARD_MCK_FREQUENCY / 16 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV16 -# define CLKB_PRE 16 - -# elif (BOARD_MCK_FREQUENCY / 32 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV32 -# define CLKB_PRE 32 - -# elif (BOARD_MCK_FREQUENCY / 64 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV64 -# define CLKB_PRE 64 - -# elif (BOARD_MCK_FREQUENCY / 128 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV128 -# define CLKB_PRE 128 - -# elif (BOARD_MCK_FREQUENCY / 256 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV256 -# define CLKB_PRE 256 - -# elif (BOARD_MCK_FREQUENCY / 512 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV512 -# define CLKB_PRE 512 - -# elif (BOARD_MCK_FREQUENCY / 1024 / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) < 256 -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV1024 -# define CLKB_PRE 1024 - -# else -# error Cannot realize CONFIG_SAMA5_PWM_CLKB_FREQUENCY -# endif - -# define CLKB_DIV (BOARD_MCK_FREQUENCY / CLKB_PRE / CONFIG_SAMA5_PWM_CLKB_FREQUENCY) -# define CLKB_FREQUENCY (BOARD_MCK_FREQUENCY / CLKB_PRE / CLKB_DIV) -# define CLKB_DIV_BITS PWM_CLK_DIVB(CLKB_DIV) - -#else -# undef CONFIG_SAMA5_PWM_CLKB_FREQUENCY -# define CLKB_PRE_BITS PWM_CLK_PREB_DIV1 -# define CLKB_DIV_BITS PWM_CLK_DIVB_OFF #endif #ifdef CONFIG_SAMA5_PWM_CHAN0 @@ -237,27 +97,27 @@ # undef CONFIG_SAMA5_PWM_CHAN0_CLKA # undef CONFIG_SAMA5_PWM_CHAN0_CLKB # if CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 1 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 0 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 0 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 2 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 1 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 1 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 4 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 2 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 2 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 8 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 3 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 3 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 16 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 4 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 4 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 32 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 5 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 5 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 64 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 6 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 6 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 128 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 7 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 7 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 256 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 8 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 8 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 512 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 9 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 9 # elif CONFIG_SAMA5_PWM_CHAN0_MCKDIV == 1024 -# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 = 10 +# define SAMA5_PWM_CHAN0_MCKDIV_LOG2 10 # else # error Unsupported MCK divider value # endif @@ -485,6 +345,11 @@ static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, /* Initialization */ +static unsigned int pwm_clk_prescaler_log2(uint32_t mck, uint32_t fclk); +static unsigned int pwm_clk_divider(uint32_t mck, uint32_t fclk, + unsigned int prelog2); +static uint32_t pwm_clk_frequency(uint32_t mck, unsigned int prelog2, + unsigned int div); static void pwm_resetpins(FAR struct sam_pwm_chan_s *chan); /**************************************************************************** @@ -779,6 +644,7 @@ static uint32_t pwm_getreg(struct sam_pwm_chan_s *chan, int offset) * ****************************************************************************/ +#ifdef CONFIG_DEBUG_PWM_INFO /* Currently only used for debug output */ static uint32_t pwm_chan_getreg(struct sam_pwm_chan_s *chan, int offset) { uintptr_t regaddr; @@ -800,6 +666,7 @@ static uint32_t pwm_chan_getreg(struct sam_pwm_chan_s *chan, int offset) return regval; } +#endif /**************************************************************************** * Name: pwm_putreg @@ -1073,6 +940,11 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, FAR const struct pwm_info_s *info) { FAR struct sam_pwm_chan_s *chan = (FAR struct sam_pwm_chan_s *)dev; +#if defined(CONFIG_SAMA5_PWM_CLKA) || defined(CONFIG_SAMA5_PWM_CLKB) + unsigned int prelog2; + unsigned int div; + uint32_t mck; +#endif uint32_t regval; uint32_t cprd; uint32_t fsrc; @@ -1086,21 +958,35 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, switch (chan->clksrc) { case PWM_CLKSRC_MCK: - regval = PWM_CMR_CPRE_MCKDIV(chan->divlog2); - fsrc = BOARD_MCK_FREQUENCY >> chan->divlog2; + { + regval = PWM_CMR_CPRE_MCKDIV(chan->divlog2); + fsrc = BOARD_MCK_FREQUENCY >> chan->divlog2; + } break; #ifdef CONFIG_SAMA5_PWM_CLKA case PWM_CLKSRC_CLKA: - regval = PWM_CMR_CPRE_CLKA; - fsrc = CLKA_FREQUENCY; + { + regval = pwm_getreg(chan, SAM_PWM_CLK_OFFSET); + prelog2 = (unsigned int)((regval & PWM_CLK_PREA_MASK) >> PWM_CLK_PREA_SHIFT); + div = (unsigned int)((regval & PWM_CLK_DIVA_MASK) >> PWM_CLK_DIVA_SHIFT); + mck = BOARD_MCK_FREQUENCY; + fsrc = pwm_clk_frequency(mck, prelog2, div); + regval = PWM_CMR_CPRE_CLKA; + } break; #endif #ifdef CONFIG_SAMA5_PWM_CLKB case PWM_CLKSRC_CLKB: - regval = PWM_CMR_CPRE_CLKB; - fsrc = CLKB_FREQUENCY; + { + regval = pwm_getreg(chan, SAM_PWM_CLK_OFFSET); + prelog2 = (unsigned int)((regval & PWM_CLK_PREB_MASK) >> PWM_CLK_PREB_SHIFT); + div = (unsigned int)((regval & PWM_CLK_DIVB_MASK) >> PWM_CLK_DIVB_SHIFT); + mck = BOARD_MCK_FREQUENCY; + fsrc = pwm_clk_frequency(mck, prelog2, div); + regval = PWM_CMR_CPRE_CLKB; + } break; #endif @@ -1223,18 +1109,157 @@ static int pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg } /**************************************************************************** - * Name: pwm_ioctl + * Name: pwm_clk_prescaler_log2 + * + * Description: + * Return log2 of the clock prescaler value. The PWM clock divisor + * register fields use this kind of value. The return value of this + * function can be converted into a PWM clock register value or an absolute + * prescaler value by applying the following operations (macros defined in + * chip/sam_pwm.h): + * + * This function selects the prescaler value that allows the largest, valid + * divider value. This may not be optimal in all cases, but in general + * should provide a reasonable frequency value. The frequency is given by: + * + * frequency = MCK / prescaler / div + * + * The divider has a range of 1-255. Pick smallest prescaler such that: + * + * prescaler = MCK / frequency / div < 256 + * + * Example usage given: + * unsigned int prelog2; + * unsigned int prescaler; + * uint32_t regbits; + * + * For clock A: + * prelog2 = pwm_clk_prescaler_log2(BOARD_MCK_FREQUENCY, + * CONFIG_SAMA5_PWM_CLKA_FREQUENCY ) + * regbits = PWM_CLK_PREA_DIV(prelog2); + * prescaler = (1 << prelog2) + * + * For clock B: + * prelog2 = pwm_clk_prescaler_log2(BOARD_MCK_FREQUENCY, + * CONFIG_SAMA5_PWM_CLKB_FREQUENCY ) + * regbits = PWM_CLK_PREB_DIV(prelog2); + * prescaler = (1 << prelog2) + * + * Input parameters: + * mck - The main clock frequency + * fclk - The desired clock A or B frequency + * + * Returned Value: + * The select value of log2(prescaler) in the range 0-10 corresponding to + * the actual prescaler value in the range 1-1024. + * + ****************************************************************************/ + +static unsigned int pwm_clk_prescaler_log2(uint32_t mck, uint32_t fclk) +{ + uint32_t unscaled; + unsigned int prelog2; + + unscaled = mck / fclk; + prelog2 = 0; + + /* Loop, incrementing the log2(prescaler) value. Exit with either: + * + * 1) unscaled < 256 and prelog2 <= 10, or with + * 2) unscaled >= 256 and prelog2 == 10 + */ + + while (unscaled >= 256 && prelog2 < 10) + { + unscaled >>= 1; + prelog2++; + } + + DEBUGASSERT(unscaled < 256); + return prelog2; +} + +/**************************************************************************** + * Name: pwm_clk_divider + * + * Description: + * Given that we have already selected the prescaler value, select the + * divider in the range of 1 through 255. The CLKA/B frequency is + * determined by both the prescaler and divider valuess: + * + * frequency = MCK / prescaler / div + * + * Then: + * + * div = MCK / prescaler / frequency + * + * Input parameters: + * mck - The main clock frequency + * fclk - The desired clock A or B frequency + * prelog2 - The log2(prescaler) value previously selected by + * pwm_prescale_log2(). + * + * Returned Value: + * The select value of log2(prescaler) in the range 0-10 corresponding to + * the actual prescaler value in the range 1-1024. + * + ****************************************************************************/ + +static unsigned int pwm_clk_divider(uint32_t mck, uint32_t fclk, + unsigned int prelog2) +{ + uint32_t div = (mck >> prelog2) / fclk; + + if (div < 1) + { + div = 1; + } + else if (div > 255) + { + div = 255; + } + + return div; +} + +/**************************************************************************** + * Name: pwm_clk_frequency + * + * Description: + * Given that we have already selected the prescaler value and cacluated + * the corresponding divider, the result clock frequency is give by: + * + * frequency = MCK / prescaler / div + * + * Input parameters: + * mck - The main clock frequency + * prelog2 - The log2(prescaler) value previously selected by + * pwm_prescale_log2(). + * div - The divider previously calculated from pwm_clk_divider(). + * + * Returned Value: + * The select value of log2(prescaler) in the range 0-10 corresponding to + * the actual prescaler value in the range 1-1024. + * + ****************************************************************************/ + +static uint32_t pwm_clk_frequency(uint32_t mck, unsigned int prelog2, + unsigned int div) +{ + return (mck >> prelog2) / div; +} + +/**************************************************************************** + * Name: pwm_resetpins * * Description: * Lower-half logic may support platform-specific ioctl commands * * Input parameters: - * dev - A reference to the lower half PWM driver state structure - * cmd - The ioctl command - * arg - The argument accompanying the ioctl command + * chan - A reference to the PWM channel instance * * Returned Value: - * Zero on success; a negated errno value on failure + * None * ****************************************************************************/ @@ -1327,13 +1352,37 @@ FAR struct pwm_lowerhalf_s *sam_pwminitialize(int channel) if (!g_pwm.initialized) { +#if defined(CONFIG_SAMA5_PWM_CLKA) || defined(CONFIG_SAMA5_PWM_CLKB) + uint32_t mck; + unsigned int prelog2; + unsigned int div; +#endif + /* Enable the PWM peripheral clock */ sam_pwm_enableclk(); - /* Set clock A and clock B */ +#if defined(CONFIG_SAMA5_PWM_CLKA) || defined(CONFIG_SAMA5_PWM_CLKB) + mck = BOARD_MCK_FREQUENCY; +#endif +#ifdef CONFIG_SAMA5_PWM_CLKA + /* Set clock A configuration */ + + prelog2 = pwm_clk_prescaler_log2(mck, CONFIG_SAMA5_PWM_CLKA_FREQUENCY); + div = pwm_clk_divider(mck, CONFIG_SAMA5_PWM_CLKA_FREQUENCY, prelog2); + regval = (PWM_CLK_DIVA(div) | PWM_CLK_PREA_DIV(prelog2)); +#else + regval = 0; +#endif + +#ifdef CONFIG_SAMA5_PWM_CLKB + /* Set clock B configuration */ + + prelog2 = pwm_clk_prescaler_log2(mck, CONFIG_SAMA5_PWM_CLKB_FREQUENCY); + div = pwm_clk_divider(mck, CONFIG_SAMA5_PWM_CLKA_FREQUENCY, prelog2); + regval |= (PWM_CLK_DIVB(div) | PWM_CLK_PREB_DIV(prelog2)); +#endif - regval = (CLKA_PRE_BITS | CLKA_DIV_BITS | CLKB_PRE_BITS | CLKB_DIV_BITS); pwm_putreg(chan, SAM_PWM_CLK_OFFSET, regval); /* Disable all PWM interrupts at the PWM peripheral */ diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 2eefdcefa7d73bd8263a5f550426ce722a72a00d..a7ea10c109d41834521f8a660c96fdcd3112f69b 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -69,11 +69,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -107,13 +103,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_SAMV7_EMAC_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_SAMV7_EMAC_LPWORK) @@ -523,9 +518,7 @@ struct sam_emac_s uint8_t ifup : 1; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -588,11 +581,8 @@ static int sam_recvframe(struct sam_emac_s *priv, int qid); static void sam_receive(struct sam_emac_s *priv, int qid); static void sam_txdone(struct sam_emac_s *priv, int qid); static void sam_txerr_interrupt(FAR struct sam_emac_s *priv, int qid); -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv, - int qid); -#ifdef CONFIG_NET_NOINTS + static void sam_interrupt_work(FAR void *arg); -#endif static int sam_emac_interrupt(struct sam_emac_s *priv); #ifdef CONFIG_SAMV7_EMAC0 static int sam_emac0_interrupt(int irq, void *context); @@ -603,16 +593,10 @@ static int sam_emac1_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txtimeout_work(FAR void *arg); -#endif static void sam_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void sam_poll_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_poll_work(FAR void *arg); -#endif static void sam_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ @@ -620,10 +604,7 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...); static int sam_ifup(struct net_driver_s *dev); static int sam_ifdown(struct net_driver_s *dev); -static inline void sam_txavail_process(FAR struct sam_emac_s *priv); -#ifdef CONFIG_NET_NOINTS static void sam_txavail_work(FAR void *arg); -#endif static int sam_txavail(struct net_driver_s *dev); #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) @@ -856,7 +837,6 @@ static const struct sam_emacattr_s g_emac0_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -867,7 +847,6 @@ static const struct sam_emacattr_s g_emac0_attr = */ static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC0 peripheral state */ @@ -939,7 +918,6 @@ static const struct sam_emacattr_s g_emac1_attr = #endif }; -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used * * REVISIT: It might be possible to use this option to send and receive @@ -950,7 +928,6 @@ static const struct sam_emacattr_s g_emac1_attr = */ static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* EMAC1 peripheral state */ @@ -2276,15 +2253,13 @@ static void sam_txerr_interrupt(FAR struct sam_emac_s *priv, int qid) } /**************************************************************************** - * Function: sam_interrupt_process + * Function: sam_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread. * * Parameters: - * priv - Reference to the driver state structure - * quid - Index of the transfer queue that generated the interrupt + * arg - The argument passed when work_queue() was called. * * Returned Value: * None @@ -2294,8 +2269,9 @@ static void sam_txerr_interrupt(FAR struct sam_emac_s *priv, int qid) * ****************************************************************************/ -static inline void sam_interrupt_process(FAR struct sam_emac_s *priv, int qid) +static void sam_interrupt_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; uint32_t isr; uint32_t rsr; uint32_t tsr; @@ -2303,6 +2279,11 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv, int qid) uint32_t regval; uint32_t pending; uint32_t clrbits; + int qid = EMAC_QUEUE_0; /* REVISIT: Currently services on EMAC_QUEUE_0 */ + + /* Process pending Ethernet interrupts */ + + net_lock(); /* Read the interrupt status, RX status, and TX status registers. * NOTE that the interrupt status register is cleared by this read. @@ -2462,51 +2443,22 @@ static inline void sam_interrupt_process(FAR struct sam_emac_s *priv, int qid) ninfo("Pause TO!\n"); } #endif -} - -/**************************************************************************** - * Function: sam_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_interrupt_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - state = net_lock(); - sam_interrupt_process(priv, EMAC_QUEUE_0); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ up_enable_irq(priv->attr->irq); } -#endif /**************************************************************************** * Function: sam_emac_interrupt * * Description: - * Common hardware interrupt handler + * Common hardware interrupt handler. * * Parameters: - * priv - Reference to the EMAC private state structure + * priv - Reference to the EMAC private state structure * * Returned Value: * OK on success @@ -2517,7 +2469,6 @@ static void sam_interrupt_work(FAR void *arg) static int sam_emac_interrupt(struct sam_emac_s *priv) { -#ifdef CONFIG_NET_NOINTS uint32_t tsr; /* Disable further Ethernet interrupts. Because Ethernet interrupts are @@ -2561,13 +2512,6 @@ static int sam_emac_interrupt(struct sam_emac_s *priv) /* Schedule to perform the interrupt processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_interrupt_work, priv, 0); - -#else - /* Process the interrupt now */ - - sam_interrupt_process(priv, EMAC_QUEUE_0); -#endif - return OK; } @@ -2603,28 +2547,29 @@ static int sam_emac1_interrupt(int irq, void *context) #endif /**************************************************************************** - * Function: sam_txtimeout_process + * Function: sam_txtimeout_work * * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv) +static void sam_txtimeout_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + nerr("ERROR: Timeout!\n"); + + net_lock(); NETDEV_TXTIMEOUTS(&priv->dev); /* Reset the hardware. Just take the interface down, then back up again. */ @@ -2635,39 +2580,9 @@ static inline void sam_txtimeout_process(FAR struct sam_emac_s *priv) /* Then poll the network for new XMIT data */ sam_dopoll(priv, EMAC_QUEUE_0); + net_unlock(); } -/**************************************************************************** - * Function: sam_txtimeout_work - * - * Description: - * Perform TX timeout related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txtimeout_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - sam_txtimeout_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_txtimeout_expiry * @@ -2691,7 +2606,6 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2708,38 +2622,35 @@ static void sam_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, sam_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - sam_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: sam_poll_process + * Function: sam_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void sam_poll_process(FAR struct sam_emac_s *priv) +static void sam_poll_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; struct net_driver_s *dev = &priv->dev; /* Check if the there are any free TX descriptors. We cannot perform the * TX poll if we do not have buffering for another packet. */ + net_lock(); if (sam_txfree(priv, EMAC_QUEUE_0) > 0) { /* Update TCP timing states and poll the network for new XMIT data. */ @@ -2750,39 +2661,9 @@ static inline void sam_poll_process(FAR struct sam_emac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: sam_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_poll_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: sam_poll_expiry * @@ -2805,7 +2686,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2824,12 +2704,6 @@ static void sam_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - sam_poll_process(priv); -#endif } /**************************************************************************** @@ -2968,66 +2842,40 @@ static int sam_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: sam_txavail_process + * Function: sam_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void sam_txavail_process(FAR struct sam_emac_s *priv) +static void sam_txavail_work(FAR void *arg) { + FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ sam_dopoll(priv, EMAC_QUEUE_0); } -} -/**************************************************************************** - * Function: sam_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void sam_txavail_work(FAR void *arg) -{ - FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - sam_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: sam_txavail @@ -3052,7 +2900,6 @@ static int sam_txavail(struct net_driver_s *dev) { FAR struct sam_emac_s *priv = (FAR struct sam_emac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -3065,21 +2912,6 @@ static int sam_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, sam_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - sam_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } @@ -5112,9 +4944,7 @@ int sam_emac_initialize(int intf) { struct sam_emac_s *priv; const struct sam_emacattr_s *attr; -#ifdef CONFIG_NET_MULTIBUFFER uint8_t *pktbuf; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) uint8_t phytype; #endif @@ -5125,10 +4955,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac0; attr = &g_emac0_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf0; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMV7_EMAC0_PHY_TYPE; @@ -5141,10 +4968,7 @@ int sam_emac_initialize(int intf) { priv = &g_emac1; attr = &g_emac1_attr; - -#ifdef CONFIG_NET_MULTIBUFFER pktbuf = g_pktbuf1; -#endif #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) phytype = SAMV7_EMAC1_PHY_TYPE; @@ -5161,9 +4985,7 @@ int sam_emac_initialize(int intf) memset(priv, 0, sizeof(struct sam_emac_s)); priv->attr = attr; /* Save the constant attributes */ -#ifdef CONFIG_NET_MULTIBUFFER priv->dev.d_buf = pktbuf; /* Single packet buffer */ -#endif priv->dev.d_ifup = sam_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = sam_ifdown; /* I/F down callback */ priv->dev.d_txavail = sam_txavail; /* New TX data callback */ diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index 49e05f306b9c4e193fabd3ce3baeab236faa83b7..683463be9e615ea3de018ed828ed5b2a6b70f8fd 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -1907,16 +1907,35 @@ static int mcan_del_extfilter(FAR struct sam_mcan_s *priv, int ndx) DEBUGASSERT(priv != NULL && priv->config != NULL); config = priv->config; - DEBUGASSERT(ndx < config->nextfilters); + + /* Check user Parameters */ + + DEBUGASSERT(ndx >= 0 || ndx < config->nextfilters); + + if (ndx < 0 || ndx >= config->nextfilters) + { + return -EINVAL; + } /* Get exclusive excess to the MCAN hardware */ mcan_dev_lock(priv); - /* Release the filter */ - word = ndx >> 5; bit = ndx & 0x1f; + + /* Check if this filter is really assigned */ + + if ((priv->extfilters[word] & (1 << bit)) == 0) + { + /* No, error out */ + + mcan_dev_unlock(priv); + return -ENOENT; + } + + /* Release the filter */ + priv->extfilters[word] &= ~(1 << bit); DEBUGASSERT(priv->nextalloc > 0); @@ -2137,16 +2156,35 @@ static int mcan_del_stdfilter(FAR struct sam_mcan_s *priv, int ndx) DEBUGASSERT(priv != NULL && priv->config != NULL); config = priv->config; - DEBUGASSERT(ndx < config->nstdfilters); + + /* Check Userspace Parameters */ + + DEBUGASSERT(ndx >= 0 || ndx < config->nstdfilters); + + if (ndx < 0 || ndx >= config->nstdfilters) + { + return -EINVAL; + } /* Get exclusive excess to the MCAN hardware */ mcan_dev_lock(priv); - /* Release the filter */ - word = ndx >> 5; bit = ndx & 0x1f; + + /* Check if this filter is really assigned */ + + if ((priv->stdfilters[word] & (1 << bit)) == 0) + { + /* No, error out */ + + mcan_dev_unlock(priv); + return -ENOENT; + } + + /* Release the filter */ + priv->stdfilters[word] &= ~(1 << bit); DEBUGASSERT(priv->nstdalloc > 0); @@ -3388,6 +3426,19 @@ static void mcan_interrupt(FAR struct can_dev_s *dev) { canerr("ERROR: TX %08x\n", pending & MCAN_TXERR_INTS); + /* An Acknowledge-Error will occur if for example the device + * is not connected to the bus. + * + * The CAN-Standard states that the Chip has to retry the + * message forever, which will produce an ACKE every time. + * To prevent this Interrupt-Flooding and the high CPU-Load + * we disable the ACKE here as long we didn't transfer at + * least one message successfully (see MCAN_INT_TC below). + */ + + ie &= ~MCAN_INT_ACKE; + mcan_putreg(priv, SAM_MCAN_IE_OFFSET, ie); + /* Clear the error indications */ mcan_putreg(priv, SAM_MCAN_IR_OFFSET, MCAN_TXERR_INTS); @@ -3441,6 +3492,17 @@ static void mcan_interrupt(FAR struct can_dev_s *dev) if ((pending & MCAN_INT_TC) != 0) { + /* Check if we have disabled the ACKE in the error-handling above + * (see MCAN_TXERR_INTS) to prevent Interrupt-Flooding and + * re-enable the error interrupt here again. + */ + + if ((ie & MCAN_INT_ACKE) == 0) + { + ie |= MCAN_INT_ACKE; + mcan_putreg(priv, SAM_MCAN_IE_OFFSET, ie); + } + /* Clear the pending TX completion interrupt (and all * other TX-related interrupts) */ diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 57165d8ab0f59a8886f37b0e1f3dbb0d308715c0..b6c04586498f2113e048e200f67f75bde040703d 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -1580,6 +1580,10 @@ config STM32_STM32F446 select STM32_HAVE_UART5 select STM32_HAVE_USART6 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM2 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 + select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 select STM32_HAVE_TIM8 @@ -1613,6 +1617,10 @@ config STM32_STM32F469 select STM32_HAVE_UART7 select STM32_HAVE_UART8 select STM32_HAVE_TIM1 + select STM32_HAVE_TIM2 + select STM32_HAVE_TIM3 + select STM32_HAVE_TIM4 + select STM32_HAVE_TIM5 select STM32_HAVE_TIM6 select STM32_HAVE_TIM7 select STM32_HAVE_TIM8 @@ -1632,6 +1640,9 @@ config STM32_STM32F469 select STM32_HAVE_SPI4 select STM32_HAVE_SPI5 select STM32_HAVE_SPI6 + select STM32_HAVE_SAIPLL + select STM32_HAVE_I2SPLL + config STM32_DFU bool "DFU bootloader" diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 5cd35648931b1f97485c93c5f120a269e8b5a2e5..8b10228a3a01ddb18b107fd87d34f30477384f0e 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -110,7 +110,7 @@ CHIP_ASRCS = CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c CHIP_CSRCS += stm32_lsi.c stm32_gpio.c stm32_exti_gpio.c stm32_flash.c -CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c stm32_getc.c +CHIP_CSRCS += stm32_irq.c stm32_dma.c stm32_lowputc.c CHIP_CSRCS += stm32_serial.c stm32_spi.c stm32_sdio.c stm32_tim.c CHIP_CSRCS += stm32_waste.c stm32_ccm.c stm32_uid.c stm32_capture.c diff --git a/arch/arm/src/stm32/chip/stm32_dac.h b/arch/arm/src/stm32/chip/stm32_dac.h index 81a69b71e68f993314cfb0df91b634a329a8e255..61332080eab5d7cdcc44f27d9cc963d8cb4e8ed4 100644 --- a/arch/arm/src/stm32/chip/stm32_dac.h +++ b/arch/arm/src/stm32/chip/stm32_dac.h @@ -51,17 +51,17 @@ #define STM32_DAC_CR_OFFSET 0x0000 /* DAC control register */ #define STM32_DAC_SWTRIGR_OFFSET 0x0004 /* DAC software trigger register */ -#define STM32_DAC_DHR12R1_OFFSET 0x0008 /* DAC channel1 12-bit right-aligned data holding register */ -#define STM32_DAC_DHR12L1_OFFSET 0x000c /* DAC channel1 12-bit left aligned data holding register */ -#define STM32_DAC_DHR8R1_OFFSET 0x0010 /* DAC channel1 8-bit right aligned data holding register */ -#define STM32_DAC_DHR12R2_OFFSET 0x0014 /* DAC channel2 12-bit right aligned data holding register */ -#define STM32_DAC_DHR12L2_OFFSET 0x0018 /* DAC channel2 12-bit left aligned data holding register */ -#define STM32_DAC_DHR8R2_OFFSET 0x001c /* DAC channel2 8-bit right-aligned data holding register */ +#define STM32_DAC_DHR12R1_OFFSET 0x0008 /* DAC channel 1 12-bit right-aligned data holding register */ +#define STM32_DAC_DHR12L1_OFFSET 0x000c /* DAC channel 1 12-bit left aligned data holding register */ +#define STM32_DAC_DHR8R1_OFFSET 0x0010 /* DAC channel 1 8-bit right aligned data holding register */ +#define STM32_DAC_DHR12R2_OFFSET 0x0014 /* DAC channel 2 12-bit right aligned data holding register */ +#define STM32_DAC_DHR12L2_OFFSET 0x0018 /* DAC channel 2 12-bit left aligned data holding register */ +#define STM32_DAC_DHR8R2_OFFSET 0x001c /* DAC channel 2 8-bit right-aligned data holding register */ #define STM32_DAC_DHR12RD_OFFSET 0x0020 /* Dual DAC 12-bit right-aligned data holding register */ #define STM32_DAC_DHR12LD_OFFSET 0x0024 /* DUAL DAC 12-bit left aligned data holding register */ #define STM32_DAC_DHR8RD_OFFSET 0x0028 /* DUAL DAC 8-bit right aligned data holding register */ -#define STM32_DAC_DOR1_OFFSET 0x002c /* DAC channel1 data output register */ -#define STM32_DAC_DOR2_OFFSET 0x0030 /* DAC channel2 data output register */ +#define STM32_DAC_DOR1_OFFSET 0x002c /* DAC channel 1 data output register */ +#define STM32_DAC_DOR2_OFFSET 0x0030 /* DAC channel 2 data output register */ #define STM32_DAC_SR_OFFSET 0x0034 /* DAC status register */ /* Register Addresses ***************************************************************/ @@ -164,10 +164,10 @@ /* These definitions may be used with the full, 32-bit register */ -#define DAC_CR_EN1 (1 << 0) /* Bit 0: DAC channel1 enable */ -#define DAC_CR_BOFF1 (1 << 1) /* Bit 1: DAC channel1 output buffer disable */ -#define DAC_CR_TEN1 (1 << 2) /* Bit 2: DAC channel1 trigger enable */ -#define DAC_CR_TSEL1_SHIFT (3) /* Bits 3-5: DAC channel1 trigger selection */ +#define DAC_CR_EN1 (1 << 0) /* Bit 0: DAC channel 1 enable */ +#define DAC_CR_BOFF1 (1 << 1) /* Bit 1: DAC channel 1 output buffer disable */ +#define DAC_CR_TEN1 (1 << 2) /* Bit 2: DAC channel 1 trigger enable */ +#define DAC_CR_TSEL1_SHIFT (3) /* Bits 3-5: DAC channel 1 trigger selection */ #define DAC_CR_TSEL1_MASK (7 << DAC_CR_TSEL1_SHIFT) # define DAC_CR_TSEL1_TIM6 (0 << DAC_CR_TSEL1_SHIFT) /* Timer 6 TRGO event */ # define DAC_CR_TSEL1_TIM8 (1 << DAC_CR_TSEL1_SHIFT) /* Timer 8 TRGO event */ @@ -177,12 +177,12 @@ # define DAC_CR_TSEL1_TIM4 (5 << DAC_CR_TSEL1_SHIFT) /* Timer 4 TRGO event */ # define DAC_CR_TSEL1_EXT9 (6 << DAC_CR_TSEL1_SHIFT) /* External line9 */ # define DAC_CR_TSEL1_SW (7 << DAC_CR_TSEL1_SHIFT) /* Software trigger */ -#define DAC_CR_WAVE1_SHIFT (6) /* Bits 6-7: DAC channel1 noise/triangle wave generation */enable +#define DAC_CR_WAVE1_SHIFT (6) /* Bits 6-7: DAC channel 1 noise/triangle wave generation */enable #define DAC_CR_WAVE1_MASK (3 << DAC_CR_WAVE1_SHIFT) # define DAC_CR_WAVE1_DISABLED (0 << DAC_CR_WAVE1_SHIFT) /* Wave generation disabled */ # define DAC_CR_WAVE1_NOISE (1 << DAC_CR_WAVE1_SHIFT) /* Noise wave generation enabled */ # define DAC_CR_WAVE1_TRIANGLE (2 << DAC_CR_WAVE1_SHIFT) /* Triangle wave generation enabled */ -#define DAC_CR_MAMP1_SHIFT (8) /* Bits 8-11: DAC channel1 mask/amplitude selector */ +#define DAC_CR_MAMP1_SHIFT (8) /* Bits 8-11: DAC channel 1 mask/amplitude selector */ #define DAC_CR_MAMP1_MASK (15 << DAC_CR_MAMP1_SHIFT) # define DAC_CR_MAMP1_AMP1 (0 << DAC_CR_MAMP1_SHIFT) /* Unmask bit0 of LFSR/triangle amplitude=1 */ # define DAC_CR_MAMP1_AMP3 (1 << DAC_CR_MAMP1_SHIFT) /* Unmask bits[1:0] of LFSR/triangle amplitude=3 */ @@ -196,13 +196,13 @@ # define DAC_CR_MAMP1_AMP1023 (9 << DAC_CR_MAMP1_SHIFT) /* Unmask bits[9:0] of LFSR/triangle amplitude=1023 */ # define DAC_CR_MAMP1_AMP2047 (10 << DAC_CR_MAMP1_SHIFT) /* Unmask bits[10:0] of LFSR/triangle amplitude=2047 */ # define DAC_CR_MAMP1_AMP4095 (11 << DAC_CR_MAMP1_SHIFT) /* Unmask bits[11:0] of LFSR/triangle amplitude=4095 */ -#define DAC_CR_DMAEN1 (1 << 12) /* Bit 12: DAC channel1 DMA enable */ -#define DAC_CR_DMAUDRIE1 (1 << 13) /* Bit 13: DAC channel1 DMA Underrun Interrupt enable */ +#define DAC_CR_DMAEN1 (1 << 12) /* Bit 12: DAC channel 1 DMA enable */ +#define DAC_CR_DMAUDRIE1 (1 << 13) /* Bit 13: DAC channel 1 DMA Underrun Interrupt enable */ -#define DAC_CR_EN2 (1 << 16) /* Bit 16: DAC channel2 enable */ -#define DAC_CR_BOFF2 (1 << 17) /* Bit 17: DAC channel2 output buffer disable */ -#define DAC_CR_TEN2 (1 << 18) /* Bit 18: DAC channel2 trigger enable */ -#define DAC_CR_TSEL2_SHIFT (19) /* Bits 19-21: DAC channel2 trigger selection */ +#define DAC_CR_EN2 (1 << 16) /* Bit 16: DAC channel 2 enable */ +#define DAC_CR_BOFF2 (1 << 17) /* Bit 17: DAC channel 2 output buffer disable */ +#define DAC_CR_TEN2 (1 << 18) /* Bit 18: DAC channel 2 trigger enable */ +#define DAC_CR_TSEL2_SHIFT (19) /* Bits 19-21: DAC channel 2 trigger selection */ #define DAC_CR_TSEL2_MASK (7 << DAC_CR_TSEL2_SHIFT) # define DAC_CR_TSEL2_TIM6 (0 << DAC_CR_TSEL2_SHIFT) /* Timer 6 TRGO event */ # define DAC_CR_TSEL2_TIM8 (1 << DAC_CR_TSEL2_SHIFT) /* Timer 8 TRGO event */ @@ -212,12 +212,12 @@ # define DAC_CR_TSEL2_TIM4 (5 << DAC_CR_TSEL2_SHIFT) /* Timer 4 TRGO event */ # define DAC_CR_TSEL2_EXT9 (6 << DAC_CR_TSEL2_SHIFT) /* External line9 */ # define DAC_CR_TSEL2_SW (7 << DAC_CR_TSEL2_SHIFT) /* Software trigger */ -#define DAC_CR_WAVE2_SHIFT (22) /* Bit 22-23: DAC channel2 noise/triangle wave generation enable */ +#define DAC_CR_WAVE2_SHIFT (22) /* Bit 22-23: DAC channel 2 noise/triangle wave generation enable */ #define DAC_CR_WAVE2_MASK (3 << DAC_CR_WAVE2_SHIFT) # define DAC_CR_WAVE2_DISABLED (0 << DAC_CR_WAVE2_SHIFT) /* Wave generation disabled */ # define DAC_CR_WAVE2_NOISE (1 << DAC_CR_WAVE2_SHIFT) /* Noise wave generation enabled */ # define DAC_CR_WAVE2_TRIANGLE (2 << DAC_CR_WAVE2_SHIFT) /* Triangle wave generation enabled */ -#define DAC_CR_MAMP2_SHIFT (24) /* Bit 24-27: DAC channel2 mask/amplitude selector */ +#define DAC_CR_MAMP2_SHIFT (24) /* Bit 24-27: DAC channel 2 mask/amplitude selector */ #define DAC_CR_MAMP2_MASK (15 << DAC_CR_MAMP2_SHIFT) # define DAC_CR_MAMP2_AMP1 (0 << DAC_CR_MAMP2_SHIFT) /* Unmask bit0 of LFSR/triangle amplitude=1 */ # define DAC_CR_MAMP2_AMP3 (1 << DAC_CR_MAMP2_SHIFT) /* Unmask bits[1:0] of LFSR/triangle amplitude=3 */ @@ -231,24 +231,24 @@ # define DAC_CR_MAMP2_AMP1023 (9 << DAC_CR_MAMP2_SHIFT) /* Unmask bits[9:0] of LFSR/triangle amplitude=1023 */ # define DAC_CR_MAMP2_AMP2047 (10 << DAC_CR_MAMP2_SHIFT) /* Unmask bits[10:0] of LFSR/triangle amplitude=2047 */ # define DAC_CR_MAMP2_AMP4095 (11 << DAC_CR_MAMP2_SHIFT) /* Unmask bits[11:0] of LFSR/triangle amplitude=4095 */ -#define DAC_CR_DMAEN2 (1 << 28) /* Bit 28: DAC channel2 DMA enable */ -#define DAC_CR_DMAUDRIE2 (1 << 29) /* Bits 29: DAC channel2 DMA underrun interrupt enable */ +#define DAC_CR_DMAEN2 (1 << 28) /* Bit 28: DAC channel 2 DMA enable */ +#define DAC_CR_DMAUDRIE2 (1 << 29) /* Bits 29: DAC channel 2 DMA underrun interrupt enable */ /* DAC software trigger register */ #define DAC_SWTRIGR_SWTRIG(n) (1 << ((n)-1)) -#define DAC_SWTRIGR_SWTRIG1 (1 << 0) /* Bit 0: DAC channel1 software trigger */ -#define DAC_SWTRIGR_SWTRIG2 (1 << 1) /* Bit 1: DAC channel2 software trigger */ +#define DAC_SWTRIGR_SWTRIG1 (1 << 0) /* Bit 0: DAC channel 1 software trigger */ +#define DAC_SWTRIGR_SWTRIG2 (1 << 1) /* Bit 1: DAC channel 2 software trigger */ -/* DAC channel1/2 12-bit right-aligned data holding register */ +/* DAC channel 1/2 12-bit right-aligned data holding register */ #define DAC_DHR12R_MASK (0x0fff) -/* DAC channel1/2 12-bit left aligned data holding register */ +/* DAC channel 1/2 12-bit left aligned data holding register */ #define DAC_DHR12L_MASK (0xfff0) -/* DAC channel1/2 8-bit right aligned data holding register */ +/* DAC channel 1/2 8-bit right aligned data holding register */ #define DAC_DHR8R_MASK (0x00ff) @@ -257,9 +257,9 @@ #define DAC_DHR12RD_DACC_SHIFT(n) (1 << (((n)-1) << 4)) #define DAC_DHR12RD_DACC_MASK(n) (0xfff << DAC_DHR12RD_DACC_SHIFT(n)) -#define DAC_DHR12RD_DACC1_SHIFT (0) /* Bits 0-11: DAC channel1 12-bit right-aligned data */ +#define DAC_DHR12RD_DACC1_SHIFT (0) /* Bits 0-11: DAC channel 1 12-bit right-aligned data */ #define DAC_DHR12RD_DACC1_MASK (0xfff << DAC_DHR12RD_DACC2_SHIFT) -#define DAC_DHR12RD_DACC2_SHIFT (16) /* Bits 16-27: DAC channel2 12-bit right-aligned data */ +#define DAC_DHR12RD_DACC2_SHIFT (16) /* Bits 16-27: DAC channel 2 12-bit right-aligned data */ #define DAC_DHR12RD_DACC2_MASK (0xfff << DAC_DHR12RD_DACC2_SHIFT) /* Dual DAC 12-bit left-aligned data holding register */ @@ -267,9 +267,9 @@ #define DAC_DHR12LD_DACC_SHIFT(n) ((1 << (((n)-1) << 4)) + 4) #define DAC_DHR12LD_DACC_MASK(n) (0xfff << DAC_DHR12LD_DACC_SHIFT(n)) -#define DAC_DHR12LD_DACC1_SHIFT (4) /* Bits 4-15: DAC channel1 12-bit left-aligned data */ +#define DAC_DHR12LD_DACC1_SHIFT (4) /* Bits 4-15: DAC channel 1 12-bit left-aligned data */ #define DAC_DHR12LD_DACC1_MASK (0xfff << DAC_DHR12LD_DACC1_SHIFT) -#define DAC_DHR12LD_DACC2_SHIFT (20) /* Bits 20-31: DAC channel2 12-bit left-aligned data */ +#define DAC_DHR12LD_DACC2_SHIFT (20) /* Bits 20-31: DAC channel 2 12-bit left-aligned data */ #define DAC_DHR12LD_DACC2_MASK (0xfff << DAC_DHR12LD_DACC2_SHIFT) /* DUAL DAC 8-bit right aligned data holding register */ @@ -277,19 +277,19 @@ #define DAC_DHR8RD_DACC_SHIFT(n) (1 << (((n)-1) << 3)) #define DAC_DHR8RD_DACC_MASK(n) (0xff << DAC_DHR8RD_DACC_SHIFT(n)) -#define DAC_DHR8RD_DACC1_SHIFT (0) /* Bits 0-7: DAC channel1 8-bit right-aligned data */ +#define DAC_DHR8RD_DACC1_SHIFT (0) /* Bits 0-7: DAC channel 1 8-bit right-aligned data */ #define DAC_DHR8RD_DACC1_MASK (0xff << DAC_DHR8RD_DACC1_SHIFT) -#define DAC_DHR8RD_DACC2_SHIFT (8) /* Bits 8-15: DAC channel2 8-bit right-aligned data */ +#define DAC_DHR8RD_DACC2_SHIFT (8) /* Bits 8-15: DAC channel 2 8-bit right-aligned data */ #define DAC_DHR8RD_DACC2_MASK (0xff << DAC_DHR8RD_DACC2_SHIFT) -/* DAC channel1/2 data output register */ +/* DAC channel 1/2 data output register */ #define DAC_DOR_MASK (0x0fff) /* DAC status register */ #define DAC_SR_DMAUDR(n) ((1 << (((n)-1) << 4)) + 13) -#define DAC_SR_DMAUDR1 (1 << 13) /* Bit 13: DAC channel1 DMA underrun flag */ -#define DAC_SR_DMAUDR2 (1 << 29) /* Bit 29: DAC channel2 DMA underrun flag */ +#define DAC_SR_DMAUDR1 (1 << 13) /* Bit 13: DAC channel 1 DMA underrun flag */ +#define DAC_SR_DMAUDR2 (1 << 29) /* Bit 29: DAC channel 2 DMA underrun flag */ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_DAC_H */ diff --git a/arch/arm/src/stm32/chip/stm32_otgfs.h b/arch/arm/src/stm32/chip/stm32_otgfs.h deleted file mode 100644 index 575214e6482b987f54937e5ab159831174f9aadb..0000000000000000000000000000000000000000 --- a/arch/arm/src/stm32/chip/stm32_otgfs.h +++ /dev/null @@ -1,1018 +0,0 @@ -/**************************************************************************************************** - * arch/arm/src/stm32/chip/stm32_otgfs.h - * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_ARM_SRC_STM32_CHIP_STM32_OTGFS_H -#define __ARCH_ARM_SRC_STM32_CHIP_STM32_OTGFS_H - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include "chip.h" - -/**************************************************************************************************** - * Pre-processor Definitions - ****************************************************************************************************/ -/* General definitions */ - -#define OTGFS_EPTYPE_CTRL (0) /* Control */ -#define OTGFS_EPTYPE_ISOC (1) /* Isochronous */ -#define OTGFS_EPTYPE_BULK (2) /* Bulk */ -#define OTGFS_EPTYPE_INTR (3) /* Interrupt */ - -#define OTGFS_PID_DATA0 (0) -#define OTGFS_PID_DATA2 (1) -#define OTGFS_PID_DATA1 (2) -#define OTGFS_PID_MDATA (3) /* Non-control */ -#define OTGFS_PID_SETUP (3) /* Control */ - -/* Register Offsets *********************************************************************************/ -/* Core global control and status registers */ - -#define STM32_OTGFS_GOTGCTL_OFFSET 0x0000 /* Control and status register */ -#define STM32_OTGFS_GOTGINT_OFFSET 0x0004 /* Interrupt register */ -#define STM32_OTGFS_GAHBCFG_OFFSET 0x0008 /* AHB configuration register */ -#define STM32_OTGFS_GUSBCFG_OFFSET 0x000c /* USB configuration register */ -#define STM32_OTGFS_GRSTCTL_OFFSET 0x0010 /* Reset register */ -#define STM32_OTGFS_GINTSTS_OFFSET 0x0014 /* Core interrupt register */ -#define STM32_OTGFS_GINTMSK_OFFSET 0x0018 /* Interrupt mask register */ -#define STM32_OTGFS_GRXSTSR_OFFSET 0x001c /* Receive status debug read/OTG status read register */ -#define STM32_OTGFS_GRXSTSP_OFFSET 0x0020 /* Receive status debug read/OTG status pop register */ -#define STM32_OTGFS_GRXFSIZ_OFFSET 0x0024 /* Receive FIFO size register */ -#define STM32_OTGFS_HNPTXFSIZ_OFFSET 0x0028 /* Host non-periodic transmit FIFO size register */ -#define STM32_OTGFS_DIEPTXF0_OFFSET 0x0028 /* Endpoint 0 Transmit FIFO size */ -#define STM32_OTGFS_HNPTXSTS_OFFSET 0x002c /* Non-periodic transmit FIFO/queue status register */ -#define STM32_OTGFS_GCCFG_OFFSET 0x0038 /* General core configuration register */ -#define STM32_OTGFS_CID_OFFSET 0x003c /* Core ID register */ -#define STM32_OTGFS_HPTXFSIZ_OFFSET 0x0100 /* Host periodic transmit FIFO size register */ - -#define STM32_OTGFS_DIEPTXF_OFFSET(n) (104+(((n)-1) << 2)) -#define STM32_OTGFS_DIEPTXF1_OFFSET 0x0104 /* Device IN endpoint transmit FIFO1 size register */ -#define STM32_OTGFS_DIEPTXF2_OFFSET 0x0108 /* Device IN endpoint transmit FIFO2 size register */ -#define STM32_OTGFS_DIEPTXF3_OFFSET 0x010c /* Device IN endpoint transmit FIFO3 size register */ - -/* Host-mode control and status registers */ - -#define STM32_OTGFS_HCFG_OFFSET 0x0400 /* Host configuration register */ -#define STM32_OTGFS_HFIR_OFFSET 0x0404 /* Host frame interval register */ -#define STM32_OTGFS_HFNUM_OFFSET 0x0408 /* Host frame number/frame time remaining register */ -#define STM32_OTGFS_HPTXSTS_OFFSET 0x0410 /* Host periodic transmit FIFO/queue status register */ -#define STM32_OTGFS_HAINT_OFFSET 0x0414 /* Host all channels interrupt register */ -#define STM32_OTGFS_HAINTMSK_OFFSET 0x0418 /* Host all channels interrupt mask register */ -#define STM32_OTGFS_HPRT_OFFSET 0x0440 /* Host port control and status register */ - -#define STM32_OTGFS_CHAN_OFFSET(n) (0x500 + ((n) << 5) -#define STM32_OTGFS_HCCHAR_CHOFFSET 0x0000 /* Host channel characteristics register */ -#define STM32_OTGFS_HCINT_CHOFFSET 0x0008 /* Host channel interrupt register */ -#define STM32_OTGFS_HCINTMSK_CHOFFSET 0x000c /* Host channel interrupt mask register */ -#define STM32_OTGFS_HCTSIZ_CHOFFSET 0x0010 /* Host channel interrupt register */ - -#define STM32_OTGFS_HCCHAR_OFFSET(n) (0x500 + ((n) << 5)) -#define STM32_OTGFS_HCCHAR0_OFFSET 0x0500 /* Host channel-0 characteristics register */ -#define STM32_OTGFS_HCCHAR1_OFFSET 0x0520 /* Host channel-1 characteristics register */ -#define STM32_OTGFS_HCCHAR2_OFFSET 0x0540 /* Host channel-2 characteristics register */ -#define STM32_OTGFS_HCCHAR3_OFFSET 0x0560 /* Host channel-3 characteristics register */ -#define STM32_OTGFS_HCCHAR4_OFFSET 0x0580 /* Host channel-4 characteristics register */ -#define STM32_OTGFS_HCCHAR5_OFFSET 0x05a0 /* Host channel-5 characteristics register */ -#define STM32_OTGFS_HCCHAR6_OFFSET 0x05c0 /* Host channel-6 characteristics register */ -#define STM32_OTGFS_HCCHAR7_OFFSET 0x05e0 /* Host channel-7 characteristics register */ - -#define STM32_OTGFS_HCINT_OFFSET(n) (0x508 + ((n) << 5)) -#define STM32_OTGFS_HCINT0_OFFSET 0x0508 /* Host channel-0 interrupt register */ -#define STM32_OTGFS_HCINT1_OFFSET 0x0528 /* Host channel-1 interrupt register */ -#define STM32_OTGFS_HCINT2_OFFSET 0x0548 /* Host channel-2 interrupt register */ -#define STM32_OTGFS_HCINT3_OFFSET 0x0568 /* Host channel-3 interrupt register */ -#define STM32_OTGFS_HCINT4_OFFSET 0x0588 /* Host channel-4 interrupt register */ -#define STM32_OTGFS_HCINT5_OFFSET 0x05a8 /* Host channel-5 interrupt register */ -#define STM32_OTGFS_HCINT6_OFFSET 0x05c8 /* Host channel-6 interrupt register */ -#define STM32_OTGFS_HCINT7_OFFSET 0x05e8 /* Host channel-7 interrupt register */ - -#define STM32_OTGFS_HCINTMSK_OFFSET(n) (0x50c + ((n) << 5)) -#define STM32_OTGFS_HCINTMSK0_OFFSET 0x050c /* Host channel-0 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK1_OFFSET 0x052c /* Host channel-1 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK2_OFFSET 0x054c /* Host channel-2 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK3_OFFSET 0x056c /* Host channel-3 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK4_OFFSET 0x058c /* Host channel-4 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK5_OFFSET 0x05ac /* Host channel-5 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK6_OFFSET 0x05cc /* Host channel-6 interrupt mask register */ -#define STM32_OTGFS_HCINTMSK7_OFFSET 0x05ec /* Host channel-7 interrupt mask register */ - -#define STM32_OTGFS_HCTSIZ_OFFSET(n) (0x510 + ((n) << 5)) -#define STM32_OTGFS_HCTSIZ0_OFFSET 0x0510 /* Host channel-0 interrupt register */ -#define STM32_OTGFS_HCTSIZ1_OFFSET 0x0530 /* Host channel-1 interrupt register */ -#define STM32_OTGFS_HCTSIZ2_OFFSET 0x0550 /* Host channel-2 interrupt register */ -#define STM32_OTGFS_HCTSIZ3_OFFSET 0x0570 /* Host channel-3 interrupt register */ -#define STM32_OTGFS_HCTSIZ4_OFFSET 0x0590 /* Host channel-4 interrupt register */ -#define STM32_OTGFS_HCTSIZ5_OFFSET 0x05b0 /* Host channel-5 interrupt register */ -#define STM32_OTGFS_HCTSIZ6_OFFSET 0x05d0 /* Host channel-6 interrupt register */ -#define STM32_OTGFS_HCTSIZ7_OFFSET 0x05f0 /* Host channel-7 interrupt register */ - -/* Device-mode control and status registers */ - -#define STM32_OTGFS_DCFG_OFFSET 0x0800 /* Device configuration register */ -#define STM32_OTGFS_DCTL_OFFSET 0x0804 /* Device control register */ -#define STM32_OTGFS_DSTS_OFFSET 0x0808 /* Device status register */ -#define STM32_OTGFS_DIEPMSK_OFFSET 0x0810 /* Device IN endpoint common interrupt mask register */ -#define STM32_OTGFS_DOEPMSK_OFFSET 0x0814 /* Device OUT endpoint common interrupt mask register */ -#define STM32_OTGFS_DAINT_OFFSET 0x0818 /* Device all endpoints interrupt register */ -#define STM32_OTGFS_DAINTMSK_OFFSET 0x081c /* All endpoints interrupt mask register */ -#define STM32_OTGFS_DVBUSDIS_OFFSET 0x0828 /* Device VBUS discharge time register */ -#define STM32_OTGFS_DVBUSPULSE_OFFSET 0x082c /* Device VBUS pulsing time register */ -#define STM32_OTGFS_DIEPEMPMSK_OFFSET 0x0834 /* Device IN endpoint FIFO empty interrupt mask register */ - -#define STM32_OTGFS_DIEP_OFFSET(n) (0x0900 + ((n) << 5)) -#define STM32_OTGFS_DIEPCTL_EPOFFSET 0x0000 /* Device endpoint control register */ -#define STM32_OTGFS_DIEPINT_EPOFFSET 0x0008 /* Device endpoint interrupt register */ -#define STM32_OTGFS_DIEPTSIZ_EPOFFSET 0x0010 /* Device IN endpoint transfer size register */ -#define STM32_OTGFS_DTXFSTS_EPOFFSET 0x0018 /* Device IN endpoint transmit FIFO status register */ - -#define STM32_OTGFS_DIEPCTL_OFFSET(n) (0x0900 + ((n) << 5)) -#define STM32_OTGFS_DIEPCTL0_OFFSET 0x0900 /* Device control IN endpoint 0 control register */ -#define STM32_OTGFS_DIEPCTL1_OFFSET 0x0920 /* Device control IN endpoint 2 control register */ -#define STM32_OTGFS_DIEPCTL2_OFFSET 0x0940 /* Device control IN endpoint 3 control register */ -#define STM32_OTGFS_DIEPCTL3_OFFSET 0x0960 /* Device control IN endpoint 4 control register */ - -#define STM32_OTGFS_DIEPINT_OFFSET(n) (0x0908 + ((n) << 5)) -#define STM32_OTGFS_DIEPINT0_OFFSET 0x0908 /* Device endpoint-0 interrupt register */ -#define STM32_OTGFS_DIEPINT1_OFFSET 0x0928 /* Device endpoint-1 interrupt register */ -#define STM32_OTGFS_DIEPINT2_OFFSET 0x0948 /* Device endpoint-2 interrupt register */ -#define STM32_OTGFS_DIEPINT3_OFFSET 0x0968 /* Device endpoint-3 interrupt register */ - -#define STM32_OTGFS_DIEPTSIZ_OFFSET(n) (0x910 + ((n) << 5)) -#define STM32_OTGFS_DIEPTSIZ0_OFFSET 0x0910 /* Device IN endpoint 0 transfer size register */ -#define STM32_OTGFS_DIEPTSIZ1_OFFSET 0x0930 /* Device IN endpoint 1 transfer size register */ -#define STM32_OTGFS_DIEPTSIZ2_OFFSET 0x0950 /* Device IN endpoint 2 transfer size register */ -#define STM32_OTGFS_DIEPTSIZ3_OFFSET 0x0970 /* Device IN endpoint 3 transfer size register */ - -#define STM32_OTGFS_DTXFSTS_OFFSET(n) (0x0918 + ((n) << 5)) -#define STM32_OTGFS_DTXFSTS0_OFFSET 0x0918 /* Device OUT endpoint-0 TxFIFO status register */ -#define STM32_OTGFS_DTXFSTS1_OFFSET 0x0938 /* Device OUT endpoint-1 TxFIFO status register */ -#define STM32_OTGFS_DTXFSTS2_OFFSET 0x0958 /* Device OUT endpoint-2 TxFIFO status register */ -#define STM32_OTGFS_DTXFSTS3_OFFSET 0x0978 /* Device OUT endpoint-3 TxFIFO status register */ - -#define STM32_OTGFS_DOEP_OFFSET(n) (0x0b00 + ((n) << 5)) -#define STM32_OTGFS_DOEPCTL_EPOFFSET 0x0000 /* Device control OUT endpoint 0 control register */ -#define STM32_OTGFS_DOEPINT_EPOFFSET 0x0008 /* Device endpoint-x interrupt register */ - -#define STM32_OTGFS_DOEPCTL_OFFSET(n) (0x0b00 + ((n) << 5)) -#define STM32_OTGFS_DOEPCTL0_OFFSET 0x00b00 /* Device OUT endpoint 0 control register */ -#define STM32_OTGFS_DOEPCTL1_OFFSET 0x00b20 /* Device OUT endpoint 1 control register */ -#define STM32_OTGFS_DOEPCTL2_OFFSET 0x00b40 /* Device OUT endpoint 2 control register */ -#define STM32_OTGFS_DOEPCTL3_OFFSET 0x00b60 /* Device OUT endpoint 3 control register */ - -#define STM32_OTGFS_DOEPINT_OFFSET(n) (0x0b08 + ((n) << 5)) -#define STM32_OTGFS_DOEPINT0_OFFSET 0x00b08 /* Device endpoint-0 interrupt register */ -#define STM32_OTGFS_DOEPINT1_OFFSET 0x00b28 /* Device endpoint-1 interrupt register */ -#define STM32_OTGFS_DOEPINT2_OFFSET 0x00b48 /* Device endpoint-2 interrupt register */ -#define STM32_OTGFS_DOEPINT3_OFFSET 0x00b68 /* Device endpoint-3 interrupt register */ - -#define STM32_OTGFS_DOEPTSIZ_OFFSET(n) (0x0b10 + ((n) << 5)) -#define STM32_OTGFS_DOEPTSIZ0_OFFSET 0x00b10 /* Device OUT endpoint-0 transfer size register */ -#define STM32_OTGFS_DOEPTSIZ1_OFFSET 0x00b30 /* Device OUT endpoint-1 transfer size register */ -#define STM32_OTGFS_DOEPTSIZ2_OFFSET 0x00b50 /* Device OUT endpoint-2 transfer size register */ -#define STM32_OTGFS_DOEPTSIZ3_OFFSET 0x00b70 /* Device OUT endpoint-3 transfer size register */ - -/* Power and clock gating registers */ - -#define STM32_OTGFS_PCGCCTL_OFFSET 0x0e00 /* Power and clock gating control register */ - -/* Data FIFO (DFIFO) access registers */ - -#define STM32_OTGFS_DFIFO_DEP_OFFSET(n) (0x1000 + ((n) << 12)) -#define STM32_OTGFS_DFIFO_HCH_OFFSET(n) (0x1000 + ((n) << 12)) - -#define STM32_OTGFS_DFIFO_DEP0_OFFSET 0x1000 /* 0x1000-0x1ffc Device IN/OUT Endpoint 0 DFIFO Write/Read Access */ -#define STM32_OTGFS_DFIFO_HCH0_OFFSET 0x1000 /* 0x1000-0x1ffc Host OUT/IN Channel 0 DFIFO Read/Write Access */ - -#define STM32_OTGFS_DFIFO_DEP1_OFFSET 0x2000 /* 0x2000-0x2ffc Device IN/OUT Endpoint 1 DFIFO Write/Read Access */ -#define STM32_OTGFS_DFIFO_HCH1_OFFSET 0x2000 /* 0x2000-0x2ffc Host OUT/IN Channel 1 DFIFO Read/Write Access */ - -#define STM32_OTGFS_DFIFO_DEP2_OFFSET 0x3000 /* 0x3000-0x3ffc Device IN/OUT Endpoint 2 DFIFO Write/Read Access */ -#define STM32_OTGFS_DFIFO_HCH2_OFFSET 0x3000 /* 0x3000-0x3ffc Host OUT/IN Channel 2 DFIFO Read/Write Access */ - -#define STM32_OTGFS_DFIFO_DEP3_OFFSET 0x4000 /* 0x4000-0x4ffc Device IN/OUT Endpoint 3 DFIFO Write/Read Access */ -#define STM32_OTGFS_DFIFO_HCH3_OFFSET 0x4000 /* 0x4000-0x4ffc Host OUT/IN Channel 3 DFIFO Read/Write Access */ - -/* Register Addresses *******************************************************************************/ - -#define STM32_OTGFS_GOTGCTL (STM32_OTGFS_BASE+STM32_OTGFS_GOTGCTL_OFFSET) -#define STM32_OTGFS_GOTGINT (STM32_OTGFS_BASE+STM32_OTGFS_GOTGINT_OFFSET) -#define STM32_OTGFS_GAHBCFG (STM32_OTGFS_BASE+STM32_OTGFS_GAHBCFG_OFFSET) -#define STM32_OTGFS_GUSBCFG (STM32_OTGFS_BASE+STM32_OTGFS_GUSBCFG_OFFSET) -#define STM32_OTGFS_GRSTCTL (STM32_OTGFS_BASE+STM32_OTGFS_GRSTCTL_OFFSET) -#define STM32_OTGFS_GINTSTS (STM32_OTGFS_BASE+STM32_OTGFS_GINTSTS_OFFSET) -#define STM32_OTGFS_GINTMSK (STM32_OTGFS_BASE+STM32_OTGFS_GINTMSK_OFFSET) -#define STM32_OTGFS_GRXSTSR (STM32_OTGFS_BASE+STM32_OTGFS_GRXSTSR_OFFSET) -#define STM32_OTGFS_GRXSTSP (STM32_OTGFS_BASE+STM32_OTGFS_GRXSTSP_OFFSET) -#define STM32_OTGFS_GRXFSIZ (STM32_OTGFS_BASE+STM32_OTGFS_GRXFSIZ_OFFSET) -#define STM32_OTGFS_HNPTXFSIZ (STM32_OTGFS_BASE+STM32_OTGFS_HNPTXFSIZ_OFFSET) -#define STM32_OTGFS_DIEPTXF0 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTXF0_OFFSET) -#define STM32_OTGFS_HNPTXSTS (STM32_OTGFS_BASE+STM32_OTGFS_HNPTXSTS_OFFSET) -#define STM32_OTGFS_GCCFG (STM32_OTGFS_BASE+STM32_OTGFS_GCCFG_OFFSET) -#define STM32_OTGFS_CID (STM32_OTGFS_BASE+STM32_OTGFS_CID_OFFSET) -#define STM32_OTGFS_HPTXFSIZ (STM32_OTGFS_BASE+STM32_OTGFS_HPTXFSIZ_OFFSET) - -#define STM32_OTGFS_DIEPTXF(n) (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTXF_OFFSET(n)) -#define STM32_OTGFS_DIEPTXF1 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTXF1_OFFSET) -#define STM32_OTGFS_DIEPTXF2 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTXF2_OFFSET) -#define STM32_OTGFS_DIEPTXF3 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTXF3_OFFSET) - -/* Host-mode control and status registers */ - -#define STM32_OTGFS_HCFG (STM32_OTGFS_BASE+STM32_OTGFS_HCFG_OFFSET) -#define STM32_OTGFS_HFIR (STM32_OTGFS_BASE+STM32_OTGFS_HFIR_OFFSET) -#define STM32_OTGFS_HFNUM (STM32_OTGFS_BASE+STM32_OTGFS_HFNUM_OFFSET) -#define STM32_OTGFS_HPTXSTS (STM32_OTGFS_BASE+STM32_OTGFS_HPTXSTS_OFFSET) -#define STM32_OTGFS_HAINT (STM32_OTGFS_BASE+STM32_OTGFS_HAINT_OFFSET) -#define STM32_OTGFS_HAINTMSK (STM32_OTGFS_BASE+STM32_OTGFS_HAINTMSK_OFFSET) -#define STM32_OTGFS_HPRT (STM32_OTGFS_BASE+STM32_OTGFS_HPRT_OFFSET) - -#define STM32_OTGFS_CHAN(n) (STM32_OTGFS_BASE+STM32_OTGFS_CHAN_OFFSET(n)) - -#define STM32_OTGFS_HCCHAR(n) (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR_OFFSET(n)) -#define STM32_OTGFS_HCCHAR0 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR0_OFFSET) -#define STM32_OTGFS_HCCHAR1 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR1_OFFSET) -#define STM32_OTGFS_HCCHAR2 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR2_OFFSET) -#define STM32_OTGFS_HCCHAR3 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR3_OFFSET) -#define STM32_OTGFS_HCCHAR4 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR4_OFFSET) -#define STM32_OTGFS_HCCHAR5 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR5_OFFSET) -#define STM32_OTGFS_HCCHAR6 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR6_OFFSET) -#define STM32_OTGFS_HCCHAR7 (STM32_OTGFS_BASE+STM32_OTGFS_HCCHAR7_OFFSET) - -#define STM32_OTGFS_HCINT(n) (STM32_OTGFS_BASE+STM32_OTGFS_HCINT_OFFSET(n)) -#define STM32_OTGFS_HCINT0 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT0_OFFSET) -#define STM32_OTGFS_HCINT1 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT1_OFFSET) -#define STM32_OTGFS_HCINT2 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT2_OFFSET) -#define STM32_OTGFS_HCINT3 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT3_OFFSET) -#define STM32_OTGFS_HCINT4 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT4_OFFSET) -#define STM32_OTGFS_HCINT5 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT5_OFFSET) -#define STM32_OTGFS_HCINT6 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT6_OFFSET) -#define STM32_OTGFS_HCINT7 (STM32_OTGFS_BASE+STM32_OTGFS_HCINT7_OFFSET) - -#define STM32_OTGFS_HCINTMSK(n) (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK_OFFSET(n)) -#define STM32_OTGFS_HCINTMSK0 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK0_OFFSET) -#define STM32_OTGFS_HCINTMSK1 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK1_OFFSET) -#define STM32_OTGFS_HCINTMSK2 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK2_OFFSET) -#define STM32_OTGFS_HCINTMSK3 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK3_OFFSET) -#define STM32_OTGFS_HCINTMSK4 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK4_OFFSET) -#define STM32_OTGFS_HCINTMSK5 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK5_OFFSET) -#define STM32_OTGFS_HCINTMSK6 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK6_OFFSET) -#define STM32_OTGFS_HCINTMSK7 (STM32_OTGFS_BASE+STM32_OTGFS_HCINTMSK7_OFFSET)_ - -#define STM32_OTGFS_HCTSIZ(n) (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ_OFFSET(n)) -#define STM32_OTGFS_HCTSIZ0 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ0_OFFSET) -#define STM32_OTGFS_HCTSIZ1 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ1_OFFSET) -#define STM32_OTGFS_HCTSIZ2 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ2_OFFSET) -#define STM32_OTGFS_HCTSIZ3 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ3_OFFSET) -#define STM32_OTGFS_HCTSIZ4 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ4_OFFSET) -#define STM32_OTGFS_HCTSIZ5 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ5_OFFSET) -#define STM32_OTGFS_HCTSIZ6 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ6_OFFSET) -#define STM32_OTGFS_HCTSIZ7 (STM32_OTGFS_BASE+STM32_OTGFS_HCTSIZ7_OFFSET) - -/* Device-mode control and status registers */ - -#define STM32_OTGFS_DCFG (STM32_OTGFS_BASE+STM32_OTGFS_DCFG_OFFSET) -#define STM32_OTGFS_DCTL (STM32_OTGFS_BASE+STM32_OTGFS_DCTL_OFFSET) -#define STM32_OTGFS_DSTS (STM32_OTGFS_BASE+STM32_OTGFS_DSTS_OFFSET) -#define STM32_OTGFS_DIEPMSK (STM32_OTGFS_BASE+STM32_OTGFS_DIEPMSK_OFFSET) -#define STM32_OTGFS_DOEPMSK (STM32_OTGFS_BASE+STM32_OTGFS_DOEPMSK_OFFSET) -#define STM32_OTGFS_DAINT (STM32_OTGFS_BASE+STM32_OTGFS_DAINT_OFFSET) -#define STM32_OTGFS_DAINTMSK (STM32_OTGFS_BASE+STM32_OTGFS_DAINTMSK_OFFSET) -#define STM32_OTGFS_DVBUSDIS (STM32_OTGFS_BASE+STM32_OTGFS_DVBUSDIS_OFFSET) -#define STM32_OTGFS_DVBUSPULSE (STM32_OTGFS_BASE+STM32_OTGFS_DVBUSPULSE_OFFSET) -#define STM32_OTGFS_DIEPEMPMSK (STM32_OTGFS_BASE+STM32_OTGFS_DIEPEMPMSK_OFFSET) - -#define STM32_OTGFS_DIEP(n) (STM32_OTGFS_BASE+STM32_OTGFS_DIEP_OFFSET(n)) - -#define STM32_OTGFS_DIEPCTL(n) (STM32_OTGFS_BASE+STM32_OTGFS_DIEPCTL_OFFSET(n)) -#define STM32_OTGFS_DIEPCTL0 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPCTL0_OFFSET) -#define STM32_OTGFS_DIEPCTL1 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPCTL1_OFFSET) -#define STM32_OTGFS_DIEPCTL2 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPCTL2_OFFSET) -#define STM32_OTGFS_DIEPCTL3 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPCTL3_OFFSET) - -#define STM32_OTGFS_DIEPINT(n) (STM32_OTGFS_BASE+STM32_OTGFS_DIEPINT_OFFSET(n)) -#define STM32_OTGFS_DIEPINT0 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPINT0_OFFSET) -#define STM32_OTGFS_DIEPINT1 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPINT1_OFFSET) -#define STM32_OTGFS_DIEPINT2 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPINT2_OFFSET) -#define STM32_OTGFS_DIEPINT3 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPINT3_OFFSET) - -#define STM32_OTGFS_DIEPTSIZ(n) (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTSIZ_OFFSET(n)) -#define STM32_OTGFS_DIEPTSIZ0 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTSIZ0_OFFSET) -#define STM32_OTGFS_DIEPTSIZ1 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTSIZ1_OFFSET) -#define STM32_OTGFS_DIEPTSIZ2 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTSIZ2_OFFSET) -#define STM32_OTGFS_DIEPTSIZ3 (STM32_OTGFS_BASE+STM32_OTGFS_DIEPTSIZ3_OFFSET) - -#define STM32_OTGFS_DTXFSTS(n) (STM32_OTGFS_BASE+STM32_OTGFS_DTXFSTS_OFFSET(n)) -#define STM32_OTGFS_DTXFSTS0 (STM32_OTGFS_BASE+STM32_OTGFS_DTXFSTS0_OFFSET) -#define STM32_OTGFS_DTXFSTS1 (STM32_OTGFS_BASE+STM32_OTGFS_DTXFSTS1_OFFSET) -#define STM32_OTGFS_DTXFSTS2 (STM32_OTGFS_BASE+STM32_OTGFS_DTXFSTS2_OFFSET) -#define STM32_OTGFS_DTXFSTS3 (STM32_OTGFS_BASE+STM32_OTGFS_DTXFSTS3_OFFSET) - -#define STM32_OTGFS_DOEP(n) (STM32_OTGFS_BASE+STM32_OTGFS_DOEP_OFFSET(n)) - -#define STM32_OTGFS_DOEPCTL(n) (STM32_OTGFS_BASE+STM32_OTGFS_DOEPCTL_OFFSET(n)) -#define STM32_OTGFS_DOEPCTL0 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPCTL0_OFFSET) -#define STM32_OTGFS_DOEPCTL1 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPCTL1_OFFSET) -#define STM32_OTGFS_DOEPCTL2 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPCTL2_OFFSET) -#define STM32_OTGFS_DOEPCTL3 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPCTL3_OFFSET) - -#define STM32_OTGFS_DOEPINT(n) (STM32_OTGFS_BASE+STM32_OTGFS_DOEPINT_OFFSET(n)) -#define STM32_OTGFS_DOEPINT0 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPINT0_OFFSET) -#define STM32_OTGFS_DOEPINT1 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPINT1_OFFSET) -#define STM32_OTGFS_DOEPINT2 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPINT2_OFFSET) -#define STM32_OTGFS_DOEPINT3 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPINT3_OFFSET) - -#define STM32_OTGFS_DOEPTSIZ(n) (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ_OFFSET(n)) -#define STM32_OTGFS_DOEPTSIZ0 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ0_OFFSET) -#define STM32_OTGFS_DOEPTSIZ1 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ1_OFFSET) -#define STM32_OTGFS_DOEPTSIZ2 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ2_OFFSET) -#define STM32_OTGFS_DOEPTSIZ3 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ3_OFFSET) - -/* Power and clock gating registers */ - -#define STM32_OTGFS_PCGCCTL (STM32_OTGFS_BASE+STM32_OTGFS_PCGCCTL_OFFSET) - -/* Data FIFO (DFIFO) access registers */ - -#define STM32_OTGFS_DFIFO_DEP(n) (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP_OFFSET(n)) -#define STM32_OTGFS_DFIFO_HCH(n) (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH_OFFSET(n)) - -#define STM32_OTGFS_DFIFO_DEP0 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP0_OFFSET) -#define STM32_OTGFS_DFIFO_HCH0 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH0_OFFSET) - -#define STM32_OTGFS_DFIFO_DEP1 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP1_OFFSET) -#define STM32_OTGFS_DFIFO_HCH1 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH1_OFFSET) - -#define STM32_OTGFS_DFIFO_DEP2 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP2_OFFSET) -#define STM32_OTGFS_DFIFO_HCH2 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH2_OFFSET) - -#define STM32_OTGFS_DFIFO_DEP3 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP3_OFFSET) -#define STM32_OTGFS_DFIFO_HCH3 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH3_OFFSET) - -/* Register Bitfield Definitions ********************************************************************/ -/* Core global control and status registers */ - -/* Control and status register */ - -#define OTGFS_GOTGCTL_SRQSCS (1 << 0) /* Bit 0: Session request success */ -#define OTGFS_GOTGCTL_SRQ (1 << 1) /* Bit 1: Session request */ - /* Bits 2-72 Reserved, must be kept at reset value */ -#define OTGFS_GOTGCTL_HNGSCS (1 << 8) /* Bit 8: Host negotiation success */ -#define OTGFS_GOTGCTL_HNPRQ (1 << 9) /* Bit 9: HNP request */ -#define OTGFS_GOTGCTL_HSHNPEN (1 << 10) /* Bit 10: host set HNP enable */ -#define OTGFS_GOTGCTL_DHNPEN (1 << 11) /* Bit 11: Device HNP enabled */ - /* Bits 12-15: Reserved, must be kept at reset value */ -#define OTGFS_GOTGCTL_CIDSTS (1 << 16) /* Bit 16: Connector ID status */ -#define OTGFS_GOTGCTL_DBCT (1 << 17) /* Bit 17: Long/short debounce time */ -#define OTGFS_GOTGCTL_ASVLD (1 << 18) /* Bit 18: A-session valid */ -#define OTGFS_GOTGCTL_BSVLD (1 << 19) /* Bit 19: B-session valid */ - /* Bits 20-31: Reserved, must be kept at reset value */ -/* Interrupt register */ - /* Bits 1:0 Reserved, must be kept at reset value */ -#define OTGFS_GOTGINT_SEDET (1 << 2) /* Bit 2: Session end detected */ - /* Bits 3-7: Reserved, must be kept at reset value */ -#define OTGFS_GOTGINT_SRSSCHG (1 << 8) /* Bit 8: Session request success status change */ -#define OTGFS_GOTGINT_HNSSCHG (1 << 9) /* Bit 9: Host negotiation success status change */ - /* Bits 16:10 Reserved, must be kept at reset value */ -#define OTGFS_GOTGINT_HNGDET (1 << 17) /* Bit 17: Host negotiation detected */ -#define OTGFS_GOTGINT_ADTOCHG (1 << 18) /* Bit 18: A-device timeout change */ -#define OTGFS_GOTGINT_DBCDNE (1 << 19) /* Bit 19: Debounce done */ - /* Bits 2-31: Reserved, must be kept at reset value */ - -/* AHB configuration register */ - -#define OTGFS_GAHBCFG_GINTMSK (1 << 0) /* Bit 0: Global interrupt mask */ - /* Bits 1-6: Reserved, must be kept at reset value */ -#define OTGFS_GAHBCFG_TXFELVL (1 << 7) /* Bit 7: TxFIFO empty level */ -#define OTGFS_GAHBCFG_PTXFELVL (1 << 8) /* Bit 8: Periodic TxFIFO empty level */ - /* Bits 20-31: Reserved, must be kept at reset value */ -/* USB configuration register */ - -#define OTGFS_GUSBCFG_TOCAL_SHIFT (0) /* Bits 0-2: FS timeout calibration */ -#define OTGFS_GUSBCFG_TOCAL_MASK (7 << OTGFS_GUSBCFG_TOCAL_SHIFT) - /* Bits 3-5: Reserved, must be kept at reset value */ -#define OTGFS_GUSBCFG_PHYSEL (1 << 6) /* Bit 6: Full Speed serial transceiver select */ - /* Bit 7: Reserved, must be kept at reset value */ -#define OTGFS_GUSBCFG_SRPCAP (1 << 8) /* Bit 8: SRP-capable */ -#define OTGFS_GUSBCFG_HNPCAP (1 << 9) /* Bit 9: HNP-capable */ -#define OTGFS_GUSBCFG_TRDT_SHIFT (10) /* Bits 10-13: USB turnaround time */ -#define OTGFS_GUSBCFG_TRDT_MASK (15 << OTGFS_GUSBCFG_TRDT_SHIFT) -# define OTGFS_GUSBCFG_TRDT(n) ((n) << OTGFS_GUSBCFG_TRDT_SHIFT) - /* Bits 14-28: Reserved, must be kept at reset value */ -#define OTGFS_GUSBCFG_FHMOD (1 << 29) /* Bit 29: Force host mode */ -#define OTGFS_GUSBCFG_FDMOD (1 << 30) /* Bit 30: Force device mode */ -#define OTGFS_GUSBCFG_CTXPKT (1 << 31) /* Bit 31: Corrupt Tx packet */ - /* Bits 20-31: Reserved, must be kept at reset value */ -/* Reset register */ - -#define OTGFS_GRSTCTL_CSRST (1 << 0) /* Bit 0: Core soft reset */ -#define OTGFS_GRSTCTL_HSRST (1 << 1) /* Bit 1: HCLK soft reset */ -#define OTGFS_GRSTCTL_FCRST (1 << 2) /* Bit 2: Host frame counter reset */ - /* Bit 3 Reserved, must be kept at reset value */ -#define OTGFS_GRSTCTL_RXFFLSH (1 << 4) /* Bit 4: RxFIFO flush */ -#define OTGFS_GRSTCTL_TXFFLSH (1 << 5) /* Bit 5: TxFIFO flush */ -#define OTGFS_GRSTCTL_TXFNUM_SHIFT (6) /* Bits 6-10: TxFIFO number */ -#define OTGFS_GRSTCTL_TXFNUM_MASK (31 << OTGFS_GRSTCTL_TXFNUM_SHIFT) -# define OTGFS_GRSTCTL_TXFNUM_HNONPER (0 << OTGFS_GRSTCTL_TXFNUM_SHIFT) /* Non-periodic TxFIFO flush in host mode */ -# define OTGFS_GRSTCTL_TXFNUM_HPER (1 << OTGFS_GRSTCTL_TXFNUM_SHIFT) /* Periodic TxFIFO flush in host mode */ -# define OTGFS_GRSTCTL_TXFNUM_HALL (16 << OTGFS_GRSTCTL_TXFNUM_SHIFT) /* Flush all the transmit FIFOs in host mode.*/ -# define OTGFS_GRSTCTL_TXFNUM_D(n) ((n) << OTGFS_GRSTCTL_TXFNUM_SHIFT) /* TXFIFO n flush in device mode, n=0-15 */ -# define OTGFS_GRSTCTL_TXFNUM_DALL (16 << OTGFS_GRSTCTL_TXFNUM_SHIFT) /* Flush all the transmit FIFOs in device mode.*/ - /* Bits 11-31: Reserved, must be kept at reset value */ -#define OTGFS_GRSTCTL_AHBIDL (1 << 31) /* Bit 31: AHB master idle */ - -/* Core interrupt and Interrupt mask registers */ - -#define OTGFS_GINTSTS_CMOD (1 << 0) /* Bit 0: Current mode of operation */ -# define OTGFS_GINTSTS_DEVMODE (0) -# define OTGFS_GINTSTS_HOSTMODE (OTGFS_GINTSTS_CMOD) -#define OTGFS_GINT_MMIS (1 << 1) /* Bit 1: Mode mismatch interrupt */ -#define OTGFS_GINT_OTG (1 << 2) /* Bit 2: OTG interrupt */ -#define OTGFS_GINT_SOF (1 << 3) /* Bit 3: Start of frame */ -#define OTGFS_GINT_RXFLVL (1 << 4) /* Bit 4: RxFIFO non-empty */ -#define OTGFS_GINT_NPTXFE (1 << 5) /* Bit 5: Non-periodic TxFIFO empty */ -#define OTGFS_GINT_GINAKEFF (1 << 6) /* Bit 6: Global IN non-periodic NAK effective */ -#define OTGFS_GINT_GONAKEFF (1 << 7) /* Bit 7: Global OUT NAK effective */ - /* Bits 8-9: Reserved, must be kept at reset value */ -#define OTGFS_GINT_ESUSP (1 << 10) /* Bit 10: Early suspend */ -#define OTGFS_GINT_USBSUSP (1 << 11) /* Bit 11: USB suspend */ -#define OTGFS_GINT_USBRST (1 << 12) /* Bit 12: USB reset */ -#define OTGFS_GINT_ENUMDNE (1 << 13) /* Bit 13: Enumeration done */ -#define OTGFS_GINT_ISOODRP (1 << 14) /* Bit 14: Isochronous OUT packet dropped interrupt */ -#define OTGFS_GINT_EOPF (1 << 15) /* Bit 15: End of periodic frame interrupt */ - /* Bits 16 Reserved, must be kept at reset value */ -#define OTGFS_GINTMSK_EPMISM (1 << 17) /* Bit 17: Endpoint mismatch interrupt mask */ -#define OTGFS_GINT_IEP (1 << 18) /* Bit 18: IN endpoint interrupt */ -#define OTGFS_GINT_OEP (1 << 19) /* Bit 19: OUT endpoint interrupt */ -#define OTGFS_GINT_IISOIXFR (1 << 20) /* Bit 20: Incomplete isochronous IN transfer */ -#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: Incomplete isochronous OUT transfer (device) */ -#define OTGFS_GINT_IPXFR (1 << 21) /* Bit 21: Incomplete periodic transfer (host) */ - /* Bits 22-23: Reserved, must be kept at reset value */ -#define OTGFS_GINT_HPRT (1 << 24) /* Bit 24: Host port interrupt */ -#define OTGFS_GINT_HC (1 << 25) /* Bit 25: Host channels interrupt */ -#define OTGFS_GINT_PTXFE (1 << 26) /* Bit 26: Periodic TxFIFO empty */ - /* Bit 27 Reserved, must be kept at reset value */ -#define OTGFS_GINT_CIDSCHG (1 << 28) /* Bit 28: Connector ID status change */ -#define OTGFS_GINT_DISC (1 << 29) /* Bit 29: Disconnect detected interrupt */ -#define OTGFS_GINT_SRQ (1 << 30) /* Bit 30: Session request/new session detected interrupt */ -#define OTGFS_GINT_WKUP (1 << 31) /* Bit 31: Resume/remote wakeup detected interrupt */ - -/* Receive status debug read/OTG status read and pop registers (host mode) */ - -#define OTGFS_GRXSTSH_CHNUM_SHIFT (0) /* Bits 0-3: Channel number */ -#define OTGFS_GRXSTSH_CHNUM_MASK (15 << OTGFS_GRXSTSH_CHNUM_SHIFT) -#define OTGFS_GRXSTSH_BCNT_SHIFT (4) /* Bits 4-14: Byte count */ -#define OTGFS_GRXSTSH_BCNT_MASK (0x7ff << OTGFS_GRXSTSH_BCNT_SHIFT) -#define OTGFS_GRXSTSH_DPID_SHIFT (15) /* Bits 15-16: Data PID */ -#define OTGFS_GRXSTSH_DPID_MASK (3 << OTGFS_GRXSTSH_DPID_SHIFT) -# define OTGFS_GRXSTSH_DPID_DATA0 (0 << OTGFS_GRXSTSH_DPID_SHIFT) -# define OTGFS_GRXSTSH_DPID_DATA2 (1 << OTGFS_GRXSTSH_DPID_SHIFT) -# define OTGFS_GRXSTSH_DPID_DATA1 (2 << OTGFS_GRXSTSH_DPID_SHIFT) -# define OTGFS_GRXSTSH_DPID_MDATA (3 << OTGFS_GRXSTSH_DPID_SHIFT) -#define OTGFS_GRXSTSH_PKTSTS_SHIFT (17) /* Bits 17-20: Packet status */ -#define OTGFS_GRXSTSH_PKTSTS_MASK (15 << OTGFS_GRXSTSH_PKTSTS_SHIFT) -# define OTGFS_GRXSTSH_PKTSTS_INRECVD (2 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* IN data packet received */ -# define OTGFS_GRXSTSH_PKTSTS_INDONE (3 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* IN transfer completed */ -# define OTGFS_GRXSTSH_PKTSTS_DTOGERR (5 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* Data toggle error */ -# define OTGFS_GRXSTSH_PKTSTS_HALTED (7 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* Channel halted */ - /* Bits 21-31: Reserved, must be kept at reset value */ -/* Receive status debug read/OTG status read and pop registers (device mode) */ - -#define OTGFS_GRXSTSD_EPNUM_SHIFT (0) /* Bits 0-3: Endpoint number */ -#define OTGFS_GRXSTSD_EPNUM_MASK (15 << OTGFS_GRXSTSD_EPNUM_SHIFT) -#define OTGFS_GRXSTSD_BCNT_SHIFT (4) /* Bits 4-14: Byte count */ -#define OTGFS_GRXSTSD_BCNT_MASK (0x7ff << OTGFS_GRXSTSD_BCNT_SHIFT) -#define OTGFS_GRXSTSD_DPID_SHIFT (15) /* Bits 15-16: Data PID */ -#define OTGFS_GRXSTSD_DPID_MASK (3 << OTGFS_GRXSTSD_DPID_SHIFT) -# define OTGFS_GRXSTSD_DPID_DATA0 (0 << OTGFS_GRXSTSD_DPID_SHIFT) -# define OTGFS_GRXSTSD_DPID_DATA2 (1 << OTGFS_GRXSTSD_DPID_SHIFT) -# define OTGFS_GRXSTSD_DPID_DATA1 (2 << OTGFS_GRXSTSD_DPID_SHIFT) -# define OTGFS_GRXSTSD_DPID_MDATA (3 << OTGFS_GRXSTSD_DPID_SHIFT) -#define OTGFS_GRXSTSD_PKTSTS_SHIFT (17) /* Bits 17-20: Packet status */ -#define OTGFS_GRXSTSD_PKTSTS_MASK (15 << OTGFS_GRXSTSD_PKTSTS_SHIFT) -# define OTGFS_GRXSTSD_PKTSTS_OUTNAK (1 << OTGFS_GRXSTSD_PKTSTS_SHIFT) /* Global OUT NAK */ -# define OTGFS_GRXSTSD_PKTSTS_OUTRECVD (2 << OTGFS_GRXSTSD_PKTSTS_SHIFT) /* OUT data packet received */ -# define OTGFS_GRXSTSD_PKTSTS_OUTDONE (3 << OTGFS_GRXSTSD_PKTSTS_SHIFT) /* OUT transfer completed */ -# define OTGFS_GRXSTSD_PKTSTS_SETUPDONE (4 << OTGFS_GRXSTSD_PKTSTS_SHIFT) /* SETUP transaction completed */ -# define OTGFS_GRXSTSD_PKTSTS_SETUPRECVD (6 << OTGFS_GRXSTSD_PKTSTS_SHIFT) /* SETUP data packet received */ -#define OTGFS_GRXSTSD_FRMNUM_SHIFT (21) /* Bits 21-24: Frame number */ -#define OTGFS_GRXSTSD_FRMNUM_MASK (15 << OTGFS_GRXSTSD_FRMNUM_SHIFT) - /* Bits 25-31: Reserved, must be kept at reset value */ -/* Receive FIFO size register */ - -#define OTGFS_GRXFSIZ_MASK (0xffff) - -/* Host non-periodic transmit FIFO size register */ - -#define OTGFS_HNPTXFSIZ_NPTXFSA_SHIFT (0) /* Bits 0-15: Non-periodic transmit RAM start address */ -#define OTGFS_HNPTXFSIZ_NPTXFSA_MASK (0xffff << OTGFS_HNPTXFSIZ_NPTXFSA_SHIFT) -#define OTGFS_HNPTXFSIZ_NPTXFD_SHIFT (16) /* Bits 16-31: Non-periodic TxFIFO depth */ -#define OTGFS_HNPTXFSIZ_NPTXFD_MASK (0xffff << OTGFS_HNPTXFSIZ_NPTXFD_SHIFT) -# define OTGFS_HNPTXFSIZ_NPTXFD_MIN (16 << OTGFS_HNPTXFSIZ_NPTXFD_SHIFT) -# define OTGFS_HNPTXFSIZ_NPTXFD_MAX (256 << OTGFS_HNPTXFSIZ_NPTXFD_SHIFT) - -/* Endpoint 0 Transmit FIFO size */ - -#define OTGFS_DIEPTXF0_TX0FD_SHIFT (0) /* Bits 0-15: Endpoint 0 transmit RAM start address */ -#define OTGFS_DIEPTXF0_TX0FD_MASK (0xffff << OTGFS_DIEPTXF0_TX0FD_SHIFT) -#define OTGFS_DIEPTXF0_TX0FSA_SHIFT (16) /* Bits 16-31: Endpoint 0 TxFIFO depth */ -#define OTGFS_DIEPTXF0_TX0FSA_MASK (0xffff << OTGFS_DIEPTXF0_TX0FSA_SHIFT) -# define OTGFS_DIEPTXF0_TX0FSA_MIN (16 << OTGFS_DIEPTXF0_TX0FSA_SHIFT) -# define OTGFS_DIEPTXF0_TX0FSA_MAX (256 << OTGFS_DIEPTXF0_TX0FSA_SHIFT) - -/* Non-periodic transmit FIFO/queue status register */ - -#define OTGFS_HNPTXSTS_NPTXFSAV_SHIFT (0) /* Bits 0-15: Non-periodic TxFIFO space available */ -#define OTGFS_HNPTXSTS_NPTXFSAV_MASK (0xffff << OTGFS_HNPTXSTS_NPTXFSAV_SHIFT) -# define OTGFS_HNPTXSTS_NPTXFSAV_FULL (0 << OTGFS_HNPTXSTS_NPTXFSAV_SHIFT) -#define OTGFS_HNPTXSTS_NPTQXSAV_SHIFT (16) /* Bits 16-23: Non-periodic transmit request queue space available */ -#define OTGFS_HNPTXSTS_NPTQXSAV_MASK (0xff << OTGFS_HNPTXSTS_NPTQXSAV_SHIFT) -# define OTGFS_HNPTXSTS_NPTQXSAV_FULL (0 << OTGFS_HNPTXSTS_NPTQXSAV_SHIFT) -#define OTGFS_HNPTXSTS_NPTXQTOP_SHIFT (24) /* Bits 24-30: Top of the non-periodic transmit request queue */ -#define OTGFS_HNPTXSTS_NPTXQTOP_MASK (0x7f << OTGFS_HNPTXSTS_NPTXQTOP_SHIFT) -# define OTGFS_HNPTXSTS_TERMINATE (1 << 24) /* Bit 24: Terminate (last entry for selected channel/endpoint) */ -# define OTGFS_HNPTXSTS_TYPE_SHIFT (25) /* Bits 25-26: Status */ -# define OTGFS_HNPTXSTS_TYPE_MASK (3 << OTGFS_HNPTXSTS_TYPE_SHIFT) -# define OTGFS_HNPTXSTS_TYPE_INOUT (0 << OTGFS_HNPTXSTS_TYPE_SHIFT) /* IN/OUT token */ -# define OTGFS_HNPTXSTS_TYPE_ZLP (1 << OTGFS_HNPTXSTS_TYPE_SHIFT) /* Zero-length transmit packet (device IN/host OUT) */ -# define OTGFS_HNPTXSTS_TYPE_HALT (3 << OTGFS_HNPTXSTS_TYPE_SHIFT) /* Channel halt command */ -# define OTGFS_HNPTXSTS_CHNUM_SHIFT (27) /* Bits 27-30: Channel number */ -# define OTGFS_HNPTXSTS_CHNUM_MASK (15 << OTGFS_HNPTXSTS_CHNUM_SHIFT) -# define OTGFS_HNPTXSTS_EPNUM_SHIFT (27) /* Bits 27-30: Endpoint number */ -# define OTGFS_HNPTXSTS_EPNUM_MASK (15 << OTGFS_HNPTXSTS_EPNUM_SHIFT) - /* Bit 31 Reserved, must be kept at reset value */ -/* General core configuration register */ - /* Bits 15:0 Reserved, must be kept at reset value */ -#define OTGFS_GCCFG_PWRDWN (1 << 16) /* Bit 16: Power down */ - /* Bit 17 Reserved, must be kept at reset value */ -#define OTGFS_GCCFG_VBUSASEN (1 << 18) /* Bit 18: Enable the VBUS sensing A device */ -#define OTGFS_GCCFG_VBUSBSEN (1 << 19) /* Bit 19: Enable the VBUS sensing B device */ -#define OTGFS_GCCFG_SOFOUTEN (1 << 20) /* Bit 20: SOF output enable */ -#define OTGFS_GCCFG_NOVBUSSENS (1 << 21) /* Bit 21: VBUS sensing disable option */ - /* Bits 31:22 Reserved, must be kept at reset value */ -/* Core ID register (32-bit product ID) */ - -/* Host periodic transmit FIFO size register */ - -#define OTGFS_HPTXFSIZ_PTXSA_SHIFT (0) /* Bits 0-15: Host periodic TxFIFO start address */ -#define OTGFS_HPTXFSIZ_PTXSA_MASK (0xffff << OTGFS_HPTXFSIZ_PTXSA_SHIFT) -#define OTGFS_HPTXFSIZ_PTXFD_SHIFT (16) /* Bits 16-31: Host periodic TxFIFO depth */ -#define OTGFS_HPTXFSIZ_PTXFD_MASK (0xffff << OTGFS_HPTXFSIZ_PTXFD_SHIFT) - -/* Device IN endpoint transmit FIFOn size register */ - -#define OTGFS_DIEPTXF_INEPTXSA_SHIFT (0) /* Bits 0-15: IN endpoint FIFOx transmit RAM start address */ -#define OTGFS_DIEPTXF_INEPTXSA_MASK (0xffff << OTGFS_DIEPTXF_INEPTXSA_SHIFT) -#define OTGFS_DIEPTXF_INEPTXFD_SHIFT (16) /* Bits 16-31: IN endpoint TxFIFO depth */ -#define OTGFS_DIEPTXF_INEPTXFD_MASK (0xffff << OTGFS_DIEPTXF_INEPTXFD_SHIFT) -# define OTGFS_DIEPTXF_INEPTXFD_MIN (16 << OTGFS_DIEPTXF_INEPTXFD_MASK) - -/* Host-mode control and status registers */ - -/* Host configuration register */ - -#define OTGFS_HCFG_FSLSPCS_SHIFT (0) /* Bits 0-1: FS/LS PHY clock select */ -#define OTGFS_HCFG_FSLSPCS_MASK (3 << OTGFS_HCFG_FSLSPCS_SHIFT) -# define OTGFS_HCFG_FSLSPCS_FS48MHz (1 << OTGFS_HCFG_FSLSPCS_SHIFT) /* FS host mode, PHY clock is running at 48 MHz */ -# define OTGFS_HCFG_FSLSPCS_LS48MHz (1 << OTGFS_HCFG_FSLSPCS_SHIFT) /* LS host mode, Select 48 MHz PHY clock frequency */ -# define OTGFS_HCFG_FSLSPCS_LS6MHz (2 << OTGFS_HCFG_FSLSPCS_SHIFT) /* LS host mode, Select 6 MHz PHY clock frequency */ -#define OTGFS_HCFG_FSLSS (1 << 2) /* Bit 2: FS- and LS-only support */ - /* Bits 31:3 Reserved, must be kept at reset value */ -/* Host frame interval register */ - -#define OTGFS_HFIR_MASK (0xffff) - -/* Host frame number/frame time remaining register */ - -#define OTGFS_HFNUM_FRNUM_SHIFT (0) /* Bits 0-15: Frame number */ -#define OTGFS_HFNUM_FRNUM_MASK (0xffff << OTGFS_HFNUM_FRNUM_SHIFT) -#define OTGFS_HFNUM_FTREM_SHIFT (16) /* Bits 16-31: Frame time remaining */ -#define OTGFS_HFNUM_FTREM_MASK (0xffff << OTGFS_HFNUM_FTREM_SHIFT) - -/* Host periodic transmit FIFO/queue status register */ - -#define OTGFS_HPTXSTS_PTXFSAVL_SHIFT (0) /* Bits 0-15: Periodic transmit data FIFO space available */ -#define OTGFS_HPTXSTS_PTXFSAVL_MASK (0xffff << OTGFS_HPTXSTS_PTXFSAVL_SHIFT) -# define OTGFS_HPTXSTS_PTXFSAVL_FULL (0 << OTGFS_HPTXSTS_PTXFSAVL_SHIFT) -#define OTGFS_HPTXSTS_PTXQSAV_SHIFT (16) /* Bits 16-23: Periodic transmit request queue space available */ -#define OTGFS_HPTXSTS_PTXQSAV_MASK (0xff << OTGFS_HPTXSTS_PTXQSAV_SHIFT) -# define OTGFS_HPTXSTS_PTXQSAV_FULL (0 << OTGFS_HPTXSTS_PTXQSAV_SHIFT) -#define OTGFS_HPTXSTS_PTXQTOP_SHIFT (24) /* Bits 24-31: Top of the periodic transmit request queue */ -#define OTGFS_HPTXSTS_PTXQTOP_MASK (0x7f << OTGFS_HPTXSTS_PTXQTOP_SHIFT) -# define OTGFS_HPTXSTS_TERMINATE (1 << 24) /* Bit 24: Terminate (last entry for selected channel/endpoint) */ -# define OTGFS_HPTXSTS_TYPE_SHIFT (25) /* Bits 25-26: Type */ -# define OTGFS_HPTXSTS_TYPE_MASK (3 << OTGFS_HPTXSTS_TYPE_SHIFT) -# define OTGFS_HPTXSTS_TYPE_INOUT (0 << OTGFS_HPTXSTS_TYPE_SHIFT) /* IN/OUT token */ -# define OTGFS_HPTXSTS_TYPE_ZLP (1 << OTGFS_HPTXSTS_TYPE_SHIFT) /* Zero-length transmit packet */ -# define OTGFS_HPTXSTS_TYPE_HALT (3 << OTGFS_HPTXSTS_TYPE_SHIFT) /* Disable channel command */ -# define OTGFS_HPTXSTS_EPNUM_SHIFT (27) /* Bits 27-30: Endpoint number */ -# define OTGFS_HPTXSTS_EPNUM_MASK (15 << OTGFS_HPTXSTS_EPNUM_SHIFT) -# define OTGFS_HPTXSTS_CHNUM_SHIFT (27) /* Bits 27-30: Channel number */ -# define OTGFS_HPTXSTS_CHNUM_MASK (15 << OTGFS_HPTXSTS_CHNUM_SHIFT) -# define OTGFS_HPTXSTS_ODD (1 << 24) /* Bit 31: Send in odd (vs even) frame */ - -/* Host all channels interrupt and all channels interrupt mask registers */ - -#define OTGFS_HAINT(n) (1 << (n)) /* Bits 15:0 HAINTM: Channel interrupt */ - -/* Host port control and status register */ - -#define OTGFS_HPRT_PCSTS (1 << 0) /* Bit 0: Port connect status */ -#define OTGFS_HPRT_PCDET (1 << 1) /* Bit 1: Port connect detected */ -#define OTGFS_HPRT_PENA (1 << 2) /* Bit 2: Port enable */ -#define OTGFS_HPRT_PENCHNG (1 << 3) /* Bit 3: Port enable/disable change */ -#define OTGFS_HPRT_POCA (1 << 4) /* Bit 4: Port overcurrent active */ -#define OTGFS_HPRT_POCCHNG (1 << 5) /* Bit 5: Port overcurrent change */ -#define OTGFS_HPRT_PRES (1 << 6) /* Bit 6: Port resume */ -#define OTGFS_HPRT_PSUSP (1 << 7) /* Bit 7: Port suspend */ -#define OTGFS_HPRT_PRST (1 << 8) /* Bit 8: Port reset */ - /* Bit 9: Reserved, must be kept at reset value */ -#define OTGFS_HPRT_PLSTS_SHIFT (10) /* Bits 10-11: Port line status */ -#define OTGFS_HPRT_PLSTS_MASK (3 << OTGFS_HPRT_PLSTS_SHIFT) -# define OTGFS_HPRT_PLSTS_DP (1 << 10) /* Bit 10: Logic level of OTG_FS_FS_DP */ -# define OTGFS_HPRT_PLSTS_DM (1 << 11) /* Bit 11: Logic level of OTG_FS_FS_DM */ -#define OTGFS_HPRT_PPWR (1 << 12) /* Bit 12: Port power */ -#define OTGFS_HPRT_PTCTL_SHIFT (13) /* Bits 13-16: Port test control */ -#define OTGFS_HPRT_PTCTL_MASK (15 << OTGFS_HPRT_PTCTL_SHIFT) -# define OTGFS_HPRT_PTCTL_DISABLED (0 << OTGFS_HPRT_PTCTL_SHIFT) /* Test mode disabled */ -# define OTGFS_HPRT_PTCTL_J (1 << OTGFS_HPRT_PTCTL_SHIFT) /* Test_J mode */ -# define OTGFS_HPRT_PTCTL_L (2 << OTGFS_HPRT_PTCTL_SHIFT) /* Test_K mode */ -# define OTGFS_HPRT_PTCTL_SE0_NAK (3 << OTGFS_HPRT_PTCTL_SHIFT) /* Test_SE0_NAK mode */ -# define OTGFS_HPRT_PTCTL_PACKET (4 << OTGFS_HPRT_PTCTL_SHIFT) /* Test_Packet mode */ -# define OTGFS_HPRT_PTCTL_FORCE (5 << OTGFS_HPRT_PTCTL_SHIFT) /* Test_Force_Enable */ -#define OTGFS_HPRT_PSPD_SHIFT (17) /* Bits 17-18: Port speed */ -#define OTGFS_HPRT_PSPD_MASK (3 << OTGFS_HPRT_PSPD_SHIFT) -# define OTGFS_HPRT_PSPD_FS (1 << OTGFS_HPRT_PSPD_SHIFT) /* Full speed */ -# define OTGFS_HPRT_PSPD_LS (2 << OTGFS_HPRT_PSPD_SHIFT) /* Low speed */ - /* Bits 19-31: Reserved, must be kept at reset value */ - -/* Host channel-n characteristics register */ - -#define OTGFS_HCCHAR_MPSIZ_SHIFT (0) /* Bits 0-10: Maximum packet size */ -#define OTGFS_HCCHAR_MPSIZ_MASK (0x7ff << OTGFS_HCCHAR_MPSIZ_SHIFT) -#define OTGFS_HCCHAR_EPNUM_SHIFT (11) /* Bits 11-14: Endpoint number */ -#define OTGFS_HCCHAR_EPNUM_MASK (15 << OTGFS_HCCHAR_EPNUM_SHIFT) -#define OTGFS_HCCHAR_EPDIR (1 << 15) /* Bit 15: Endpoint direction */ -# define OTGFS_HCCHAR_EPDIR_OUT (0) -# define OTGFS_HCCHAR_EPDIR_IN OTGFS_HCCHAR_EPDIR - /* Bit 16 Reserved, must be kept at reset value */ -#define OTGFS_HCCHAR_LSDEV (1 << 17) /* Bit 17: Low-speed device */ -#define OTGFS_HCCHAR_EPTYP_SHIFT (18) /* Bits 18-19: Endpoint type */ -#define OTGFS_HCCHAR_EPTYP_MASK (3 << OTGFS_HCCHAR_EPTYP_SHIFT) -# define OTGFS_HCCHAR_EPTYP_CTRL (0 << OTGFS_HCCHAR_EPTYP_SHIFT) /* Control */ -# define OTGFS_HCCHAR_EPTYP_ISOC (1 << OTGFS_HCCHAR_EPTYP_SHIFT) /* Isochronous */ -# define OTGFS_HCCHAR_EPTYP_BULK (2 << OTGFS_HCCHAR_EPTYP_SHIFT) /* Bulk */ -# define OTGFS_HCCHAR_EPTYP_INTR (3 << OTGFS_HCCHAR_EPTYP_SHIFT) /* Interrupt */ -#define OTGFS_HCCHAR_MCNT_SHIFT (20) /* Bits 20-21: Multicount */ -#define OTGFS_HCCHAR_MCNT_MASK (3 << OTGFS_HCCHAR_MCNT_SHIFT) -#define OTGFS_HCCHAR_DAD_SHIFT (22) /* Bits 22-28: Device address */ -#define OTGFS_HCCHAR_DAD_MASK (0x7f << OTGFS_HCCHAR_DAD_SHIFT) -#define OTGFS_HCCHAR_ODDFRM (1 << 29) /* Bit 29: Odd frame */ -#define OTGFS_HCCHAR_CHDIS (1 << 30) /* Bit 30: Channel disable */ -#define OTGFS_HCCHAR_CHENA (1 << 31) /* Bit 31: Channel enable */ - -/* Host channel-n interrupt and Host channel-0 interrupt mask registers */ - -#define OTGFS_HCINT_XFRC (1 << 0) /* Bit 0: Transfer completed */ -#define OTGFS_HCINT_CHH (1 << 1) /* Bit 1: Channel halted */ - /* Bit 2: Reserved, must be kept at reset value */ -#define OTGFS_HCINT_STALL (1 << 3) /* Bit 3: STALL response received interrupt */ -#define OTGFS_HCINT_NAK (1 << 4) /* Bit 4: NAK response received interrupt */ -#define OTGFS_HCINT_ACK (1 << 5) /* Bit 5: ACK response received/transmitted interrupt */ -#define OTGFS_HCINT_NYET (1 << 6) /* Bit 6: Response received interrupt */ -#define OTGFS_HCINT_TXERR (1 << 7) /* Bit 7: Transaction error */ -#define OTGFS_HCINT_BBERR (1 << 8) /* Bit 8: Babble error */ -#define OTGFS_HCINT_FRMOR (1 << 9) /* Bit 9: Frame overrun */ -#define OTGFS_HCINT_DTERR (1 << 10) /* Bit 10: Data toggle error */ - /* Bits 11-31 Reserved, must be kept at reset value */ -/* Host channel-n interrupt register */ - -#define OTGFS_HCTSIZ_XFRSIZ_SHIFT (0) /* Bits 0-18: Transfer size */ -#define OTGFS_HCTSIZ_XFRSIZ_MASK (0x7ffff << OTGFS_HCTSIZ_XFRSIZ_SHIFT) -#define OTGFS_HCTSIZ_PKTCNT_SHIFT (19) /* Bits 19-28: Packet count */ -#define OTGFS_HCTSIZ_PKTCNT_MASK (0x3ff << OTGFS_HCTSIZ_PKTCNT_SHIFT) -#define OTGFS_HCTSIZ_DPID_SHIFT (29) /* Bits 29-30: Data PID */ -#define OTGFS_HCTSIZ_DPID_MASK (3 << OTGFS_HCTSIZ_DPID_SHIFT) -# define OTGFS_HCTSIZ_DPID_DATA0 (0 << OTGFS_HCTSIZ_DPID_SHIFT) -# define OTGFS_HCTSIZ_DPID_DATA2 (1 << OTGFS_HCTSIZ_DPID_SHIFT) -# define OTGFS_HCTSIZ_DPID_DATA1 (2 << OTGFS_HCTSIZ_DPID_SHIFT) -# define OTGFS_HCTSIZ_DPID_MDATA (3 << OTGFS_HCTSIZ_DPID_SHIFT) /* Non-control */ -# define OTGFS_HCTSIZ_PID_SETUP (3 << OTGFS_HCTSIZ_DPID_SHIFT) /* Control */ - /* Bit 31 Reserved, must be kept at reset value */ -/* Device-mode control and status registers */ - -/* Device configuration register */ - -#define OTGFS_DCFG_DSPD_SHIFT (0) /* Bits 0-1: Device speed */ -#define OTGFS_DCFG_DSPD_MASK (3 << OTGFS_DCFG_DSPD_SHIFT) -# define OTGFS_DCFG_DSPD_FS (3 << OTGFS_DCFG_DSPD_SHIFT) /* Full speed */ -#define OTGFS_DCFG_NZLSOHSK (1 << 2) /* Bit 2: Non-zero-length status OUT handshake */ - /* Bit 3: Reserved, must be kept at reset value */ -#define OTGFS_DCFG_DAD_SHIFT (4) /* Bits 4-10: Device address */ -#define OTGFS_DCFG_DAD_MASK (0x7f << OTGFS_DCFG_DAD_SHIFT) -#define OTGFS_DCFG_PFIVL_SHIFT (11) /* Bits 11-12: Periodic frame interval */ -#define OTGFS_DCFG_PFIVL_MASK (3 << OTGFS_DCFG_PFIVL_SHIFT) -# define OTGFS_DCFG_PFIVL_80PCT (0 << OTGFS_DCFG_PFIVL_SHIFT) /* 80% of the frame interval */ -# define OTGFS_DCFG_PFIVL_85PCT (1 << OTGFS_DCFG_PFIVL_SHIFT) /* 85% of the frame interval */ -# define OTGFS_DCFG_PFIVL_90PCT (2 << OTGFS_DCFG_PFIVL_SHIFT) /* 90% of the frame interval */ -# define OTGFS_DCFG_PFIVL_95PCT (3 << OTGFS_DCFG_PFIVL_SHIFT) /* 95% of the frame interval */ - /* Bits 13-31 Reserved, must be kept at reset value */ -/* Device control register */ - -#define OTGFS_TESTMODE_DISABLED (0) /* Test mode disabled */ -#define OTGFS_TESTMODE_J (1) /* Test_J mode */ -#define OTGFS_TESTMODE_K (2) /* Test_K mode */ -#define OTGFS_TESTMODE_SE0_NAK (3) /* Test_SE0_NAK mode */ -#define OTGFS_TESTMODE_PACKET (4) /* Test_Packet mode */ -#define OTGFS_TESTMODE_FORCE (5) /* Test_Force_Enable */ - -#define OTGFS_DCTL_RWUSIG (1 << 0) /* Bit 0: Remote wakeup signaling */ -#define OTGFS_DCTL_SDIS (1 << 1) /* Bit 1: Soft disconnect */ -#define OTGFS_DCTL_GINSTS (1 << 2) /* Bit 2: Global IN NAK status */ -#define OTGFS_DCTL_GONSTS (1 << 3) /* Bit 3: Global OUT NAK status */ -#define OTGFS_DCTL_TCTL_SHIFT (4) /* Bits 4-6: Test control */ -#define OTGFS_DCTL_TCTL_MASK (7 << OTGFS_DCTL_TCTL_SHIFT) -# define OTGFS_DCTL_TCTL_DISABLED (0 << OTGFS_DCTL_TCTL_SHIFT) /* Test mode disabled */ -# define OTGFS_DCTL_TCTL_J (1 << OTGFS_DCTL_TCTL_SHIFT) /* Test_J mode */ -# define OTGFS_DCTL_TCTL_K (2 << OTGFS_DCTL_TCTL_SHIFT) /* Test_K mode */ -# define OTGFS_DCTL_TCTL_SE0_NAK (3 << OTGFS_DCTL_TCTL_SHIFT) /* Test_SE0_NAK mode */ -# define OTGFS_DCTL_TCTL_PACKET (4 << OTGFS_DCTL_TCTL_SHIFT) /* Test_Packet mode */ -# define OTGFS_DCTL_TCTL_FORCE (5 << OTGFS_DCTL_TCTL_SHIFT) /* Test_Force_Enable */ -#define OTGFS_DCTL_SGINAK (1 << 7) /* Bit 7: Set global IN NAK */ -#define OTGFS_DCTL_CGINAK (1 << 8) /* Bit 8: Clear global IN NAK */ -#define OTGFS_DCTL_SGONAK (1 << 9) /* Bit 9: Set global OUT NAK */ -#define OTGFS_DCTL_CGONAK (1 << 10) /* Bit 10: Clear global OUT NAK */ -#define OTGFS_DCTL_POPRGDNE (1 << 11) /* Bit 11: Power-on programming done */ - /* Bits 12-31: Reserved, must be kept at reset value */ -/* Device status register */ - -#define OTGFS_DSTS_SUSPSTS (1 << 0) /* Bit 0: Suspend status */ -#define OTGFS_DSTS_ENUMSPD_SHIFT (1) /* Bits 1-2: Enumerated speed */ -#define OTGFS_DSTS_ENUMSPD_MASK (3 << OTGFS_DSTS_ENUMSPD_SHIFT) -# define OTGFS_DSTS_ENUMSPD_FS (3 << OTGFS_DSTS_ENUMSPD_MASK) /* Full speed */ - /* Bits 4-7: Reserved, must be kept at reset value */ -#define OTGFS_DSTS_EERR (1 << 3) /* Bit 3: Erratic error */ -#define OTGFS_DSTS_SOFFN_SHIFT (8) /* Bits 8-21: Frame number of the received SOF */ -#define OTGFS_DSTS_SOFFN_MASK (0x3fff << OTGFS_DSTS_SOFFN_SHIFT) -#define OTGFS_DSTS_SOFFN0 (1 << 8) /* Bits 8: Frame number even/odd bit */ -#define OTGFS_DSTS_SOFFN_EVEN 0 -#define OTGFS_DSTS_SOFFN_ODD OTGFS_DSTS_SOFFN0 - /* Bits 22-31: Reserved, must be kept at reset value */ -/* Device IN endpoint common interrupt mask register */ - -#define OTGFS_DIEPMSK_XFRCM (1 << 0) /* Bit 0: Transfer completed interrupt mask */ -#define OTGFS_DIEPMSK_EPDM (1 << 1) /* Bit 1: Endpoint disabled interrupt mask */ - /* Bit 2: Reserved, must be kept at reset value */ -#define OTGFS_DIEPMSK_TOM (1 << 3) /* Bit 3: Timeout condition mask (Non-isochronous endpoints) */ -#define OTGFS_DIEPMSK_ITTXFEMSK (1 << 4) /* Bit 4: IN token received when TxFIFO empty mask */ -#define OTGFS_DIEPMSK_INEPNMM (1 << 5) /* Bit 5: IN token received with EP mismatch mask */ -#define OTGFS_DIEPMSK_INEPNEM (1 << 6) /* Bit 6: IN endpoint NAK effective mask */ - /* Bits 7-31: Reserved, must be kept at reset value */ -/* Device OUT endpoint common interrupt mask register */ - -#define OTGFS_DOEPMSK_XFRCM (1 << 0) /* Bit 0: Transfer completed interrupt mask */ -#define OTGFS_DOEPMSK_EPDM (1 << 1) /* Bit 1: Endpoint disabled interrupt mask */ - /* Bit 2: Reserved, must be kept at reset value */ -#define OTGFS_DOEPMSK_STUPM (1 << 3) /* Bit 3: SETUP phase done mask */ -#define OTGFS_DOEPMSK_OTEPDM (1 << 4) /* Bit 4: OUT token received when endpoint disabled mask */ - /* Bits 5-31: Reserved, must be kept at reset value */ -/* Device all endpoints interrupt and All endpoints interrupt mask registers */ - -#define OTGFS_DAINT_IEP_SHIFT (0) /* Bits 0-15: IN endpoint interrupt bits */ -#define OTGFS_DAINT_IEP_MASK (0xffff << OTGFS_DAINT_IEP_SHIFT) -# define OTGFS_DAINT_IEP(n) (1 << (n)) -#define OTGFS_DAINT_OEP_SHIFT (16) /* Bits 16-31: OUT endpoint interrupt bits */ -#define OTGFS_DAINT_OEP_MASK (0xffff << OTGFS_DAINT_OEP_SHIFT) -# define OTGFS_DAINT_OEP(n) (1 << ((n)+16)) - -/* Device VBUS discharge time register */ - -#define OTGFS_DVBUSDIS_MASK (0xffff) - -/* Device VBUS pulsing time register */ - -#define OTGFS_DVBUSPULSE_MASK (0xfff) - -/* Device IN endpoint FIFO empty interrupt mask register */ - -#define OTGFS_DIEPEMPMSK(n) (1 << (n)) - -/* Device control IN endpoint 0 control register */ - -#define OTGFS_DIEPCTL0_MPSIZ_SHIFT (0) /* Bits 0-1: Maximum packet size */ -#define OTGFS_DIEPCTL0_MPSIZ_MASK (3 << OTGFS_DIEPCTL0_MPSIZ_SHIFT) -# define OTGFS_DIEPCTL0_MPSIZ_64 (0 << OTGFS_DIEPCTL0_MPSIZ_SHIFT) /* 64 bytes */ -# define OTGFS_DIEPCTL0_MPSIZ_32 (1 << OTGFS_DIEPCTL0_MPSIZ_SHIFT) /* 32 bytes */ -# define OTGFS_DIEPCTL0_MPSIZ_16 (2 << OTGFS_DIEPCTL0_MPSIZ_SHIFT) /* 16 bytes */ -# define OTGFS_DIEPCTL0_MPSIZ_8 (3 << OTGFS_DIEPCTL0_MPSIZ_SHIFT) /* 8 bytes */ - /* Bits 2-14: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL0_USBAEP (1 << 15) /* Bit 15: USB active endpoint */ - /* Bit 16: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL0_NAKSTS (1 << 17) /* Bit 17: NAK status */ -#define OTGFS_DIEPCTL0_EPTYP_SHIFT (18) /* Bits 18-19: Endpoint type */ -#define OTGFS_DIEPCTL0_EPTYP_MASK (3 << OTGFS_DIEPCTL0_EPTYP_SHIFT) -# define OTGFS_DIEPCTL0_EPTYP_CTRL (0 << OTGFS_DIEPCTL0_EPTYP_SHIFT) /* Control (hard-coded) */ - /* Bit 20: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL0_STALL (1 << 21) /* Bit 21: STALL handshake */ -#define OTGFS_DIEPCTL0_TXFNUM_SHIFT (22) /* Bits 22-25: TxFIFO number */ -#define OTGFS_DIEPCTL0_TXFNUM_MASK (15 << OTGFS_DIEPCTL0_TXFNUM_SHIFT) -#define OTGFS_DIEPCTL0_CNAK (1 << 26) /* Bit 26: Clear NAK */ -#define OTGFS_DIEPCTL0_SNAK (1 << 27) /* Bit 27: Set NAK */ - /* Bits 28-29: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL0_EPDIS (1 << 30) /* Bit 30: Endpoint disable */ -#define OTGFS_DIEPCTL0_EPENA (1 << 31) /* Bit 31: Endpoint enable */ - -/* Device control IN endpoint n control register */ - -#define OTGFS_DIEPCTL_MPSIZ_SHIFT (0) /* Bits 0-10: Maximum packet size */ -#define OTGFS_DIEPCTL_MPSIZ_MASK (0x7ff << OTGFS_DIEPCTL_MPSIZ_SHIFT) - /* Bits 11-14: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL_USBAEP (1 << 15) /* Bit 15: USB active endpoint */ -#define OTGFS_DIEPCTL_EONUM (1 << 16) /* Bit 16: Even/odd frame */ -# define OTGFS_DIEPCTL_EVEN (0) -# define OTGFS_DIEPCTL_ODD OTGFS_DIEPCTL_EONUM -# define OTGFS_DIEPCTL_DATA0 (0) -# define OTGFS_DIEPCTL_DATA1 OTGFS_DIEPCTL_EONUM -#define OTGFS_DIEPCTL_NAKSTS (1 << 17) /* Bit 17: NAK status */ -#define OTGFS_DIEPCTL_EPTYP_SHIFT (18) /* Bits 18-19: Endpoint type */ -#define OTGFS_DIEPCTL_EPTYP_MASK (3 << OTGFS_DIEPCTL_EPTYP_SHIFT) -# define OTGFS_DIEPCTL_EPTYP_CTRL (0 << OTGFS_DIEPCTL_EPTYP_SHIFT) /* Control */ -# define OTGFS_DIEPCTL_EPTYP_ISOC (1 << OTGFS_DIEPCTL_EPTYP_SHIFT) /* Isochronous */ -# define OTGFS_DIEPCTL_EPTYP_BULK (2 << OTGFS_DIEPCTL_EPTYP_SHIFT) /* Bulk */ -# define OTGFS_DIEPCTL_EPTYP_INTR (3 << OTGFS_DIEPCTL_EPTYP_SHIFT) /* Interrupt */ - /* Bit 20: Reserved, must be kept at reset value */ -#define OTGFS_DIEPCTL_STALL (1 << 21) /* Bit 21: STALL handshake */ -#define OTGFS_DIEPCTL_TXFNUM_SHIFT (22) /* Bits 22-25: TxFIFO number */ -#define OTGFS_DIEPCTL_TXFNUM_MASK (15 << OTGFS_DIEPCTL_TXFNUM_SHIFT) -#define OTGFS_DIEPCTL_CNAK (1 << 26) /* Bit 26: Clear NAK */ -#define OTGFS_DIEPCTL_SNAK (1 << 27) /* Bit 27: Set NAK */ -#define OTGFS_DIEPCTL_SD0PID (1 << 28) /* Bit 28: Set DATA0 PID (interrupt/bulk) */ -#define OTGFS_DIEPCTL_SEVNFRM (1 << 28) /* Bit 28: Set even frame (isochronous)) */ -#define OTGFS_DIEPCTL_SODDFRM (1 << 29) /* Bit 29: Set odd frame (isochronous) */ -#define OTGFS_DIEPCTL_EPDIS (1 << 30) /* Bit 30: Endpoint disable */ -#define OTGFS_DIEPCTL_EPENA (1 << 31) /* Bit 31: Endpoint enable */ - -/* Device endpoint-n interrupt register */ - -#define OTGFS_DIEPINT_XFRC (1 << 0) /* Bit 0: Transfer completed interrupt */ -#define OTGFS_DIEPINT_EPDISD (1 << 1) /* Bit 1: Endpoint disabled interrupt */ - /* Bit 2: Reserved, must be kept at reset value */ -#define OTGFS_DIEPINT_TOC (1 << 3) /* Bit 3: Timeout condition */ -#define OTGFS_DIEPINT_ITTXFE (1 << 4) /* Bit 4: IN token received when TxFIFO is empty */ - /* Bit 5: Reserved, must be kept at reset value */ -#define OTGFS_DIEPINT_INEPNE (1 << 6) /* Bit 6: IN endpoint NAK effective */ -#define OTGFS_DIEPINT_TXFE (1 << 7) /* Bit 7: Transmit FIFO empty */ - /* Bits 8-31: Reserved, must be kept at reset value */ -/* Device IN endpoint 0 transfer size register */ - -#define OTGFS_DIEPTSIZ0_XFRSIZ_SHIFT (0) /* Bits 0-6: Transfer size */ -#define OTGFS_DIEPTSIZ0_XFRSIZ_MASK (0x7f << OTGFS_DIEPTSIZ0_XFRSIZ_SHIFT) - /* Bits 7-18: Reserved, must be kept at reset value */ -#define OTGFS_DIEPTSIZ0_PKTCNT_SHIFT (19) /* Bits 19-20: Packet count */ -#define OTGFS_DIEPTSIZ0_PKTCNT_MASK (3 << OTGFS_DIEPTSIZ0_PKTCNT_SHIFT) - /* Bits 21-31: Reserved, must be kept at reset value */ -/* Device IN endpoint n transfer size register */ - -#define OTGFS_DIEPTSIZ_XFRSIZ_SHIFT (0) /* Bits 0-18: Transfer size */ -#define OTGFS_DIEPTSIZ_XFRSIZ_MASK (0x7ffff << OTGFS_DIEPTSIZ_XFRSIZ_SHIFT) -#define OTGFS_DIEPTSIZ_PKTCNT_SHIFT (19) /* Bit 19-28: Packet count */ -#define OTGFS_DIEPTSIZ_PKTCNT_MASK (0x3ff << OTGFS_DIEPTSIZ_PKTCNT_SHIFT) -#define OTGFS_DIEPTSIZ_MCNT_SHIFT (29) /* Bits 29-30: Multi count */ -#define OTGFS_DIEPTSIZ_MCNT_MASK (3 << OTGFS_DIEPTSIZ_MCNT_SHIFT) - /* Bit 31: Reserved, must be kept at reset value */ -/* Device OUT endpoint TxFIFO status register */ - -#define OTGFS_DTXFSTS_MASK (0xffff) - -/* Device OUT endpoint 0 control register */ - -#define OTGFS_DOEPCTL0_MPSIZ_SHIFT (0) /* Bits 0-1: Maximum packet size */ -#define OTGFS_DOEPCTL0_MPSIZ_MASK (3 << OTGFS_DOEPCTL0_MPSIZ_SHIFT) -# define OTGFS_DOEPCTL0_MPSIZ_64 (0 << OTGFS_DOEPCTL0_MPSIZ_SHIFT) /* 64 bytes */ -# define OTGFS_DOEPCTL0_MPSIZ_32 (1 << OTGFS_DOEPCTL0_MPSIZ_SHIFT) /* 32 bytes */ -# define OTGFS_DOEPCTL0_MPSIZ_16 (2 << OTGFS_DOEPCTL0_MPSIZ_SHIFT) /* 16 bytes */ -# define OTGFS_DOEPCTL0_MPSIZ_8 (3 << OTGFS_DOEPCTL0_MPSIZ_SHIFT) /* 8 bytes */ - /* Bits 2-14: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL0_USBAEP (1 << 15) /* Bit 15: USB active endpoint */ - /* Bit 16: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL0_NAKSTS (1 << 17) /* Bit 17: NAK status */ -#define OTGFS_DOEPCTL0_EPTYP_SHIFT (18) /* Bits 18-19: Endpoint type */ -#define OTGFS_DOEPCTL0_EPTYP_MASK (3 << OTGFS_DOEPCTL0_EPTYP_SHIFT) -# define OTGFS_DOEPCTL0_EPTYP_CTRL (0 << OTGFS_DOEPCTL0_EPTYP_SHIFT) /* Control (hard-coded) */ -#define OTGFS_DOEPCTL0_SNPM (1 << 20) /* Bit 20: Snoop mode */ -#define OTGFS_DOEPCTL0_STALL (1 << 21) /* Bit 21: STALL handshake */ - /* Bits 22-25: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL0_CNAK (1 << 26) /* Bit 26: Clear NAK */ -#define OTGFS_DOEPCTL0_SNAK (1 << 27) /* Bit 27: Set NAK */ - /* Bits 28-29: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL0_EPDIS (1 << 30) /* Bit 30: Endpoint disable */ -#define OTGFS_DOEPCTL0_EPENA (1 << 31) /* Bit 31: Endpoint enable */ - -/* Device OUT endpoint n control register */ - -#define OTGFS_DOEPCTL_MPSIZ_SHIFT (0) /* Bits 0-10: Maximum packet size */ -#define OTGFS_DOEPCTL_MPSIZ_MASK (0x7ff << OTGFS_DOEPCTL_MPSIZ_SHIFT) - /* Bits 11-14: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL_USBAEP (1 << 15) /* Bit 15: USB active endpoint */ -#define OTGFS_DOEPCTL_DPID (1 << 16) /* Bit 16: Endpoint data PID (interrupt/buld) */ -# define OTGFS_DOEPCTL_DATA0 (0) -# define OTGFS_DOEPCTL_DATA1 OTGFS_DOEPCTL_DPID -#define OTGFS_DOEPCTL_EONUM (1 << 16) /* Bit 16: Even/odd frame (isochronous) */ -# define OTGFS_DOEPCTL_EVEN (0) -# define OTGFS_DOEPCTL_ODD OTGFS_DOEPCTL_EONUM -#define OTGFS_DOEPCTL_NAKSTS (1 << 17) /* Bit 17: NAK status */ -#define OTGFS_DOEPCTL_EPTYP_SHIFT (18) /* Bits 18-19: Endpoint type */ -#define OTGFS_DOEPCTL_EPTYP_MASK (3 << OTGFS_DOEPCTL_EPTYP_SHIFT) -# define OTGFS_DOEPCTL_EPTYP_CTRL (0 << OTGFS_DOEPCTL_EPTYP_SHIFT) /* Control */ -# define OTGFS_DOEPCTL_EPTYP_ISOC (1 << OTGFS_DOEPCTL_EPTYP_SHIFT) /* Isochronous */ -# define OTGFS_DOEPCTL_EPTYP_BULK (2 << OTGFS_DOEPCTL_EPTYP_SHIFT) /* Bulk */ -# define OTGFS_DOEPCTL_EPTYP_INTR (3 << OTGFS_DOEPCTL_EPTYP_SHIFT) /* Interrupt */ -#define OTGFS_DOEPCTL_SNPM (1 << 20) /* Bit 20: Snoop mode */ -#define OTGFS_DOEPCTL_STALL (1 << 21) /* Bit 21: STALL handshake */ - /* Bits 22-25: Reserved, must be kept at reset value */ -#define OTGFS_DOEPCTL_CNAK (1 << 26) /* Bit 26: Clear NAK */ -#define OTGFS_DOEPCTL_SNAK (1 << 27) /* Bit 27: Set NAK */ -#define OTGFS_DOEPCTL_SD0PID (1 << 28) /* Bit 28: Set DATA0 PID (interrupt/bulk) */ -#define OTGFS_DOEPCTL_SEVNFRM (1 << 28) /* Bit 28: Set even frame (isochronous) */ -#define OTGFS_DOEPCTL_SD1PID (1 << 29) /* Bit 29: Set DATA1 PID (interrupt/bulk) */ -#define OTGFS_DOEPCTL_SODDFRM (1 << 29) /* Bit 29: Set odd frame (isochronous */ -#define OTGFS_DOEPCTL_EPDIS (1 << 30) /* Bit 30: Endpoint disable */ -#define OTGFS_DOEPCTL_EPENA (1 << 31) /* Bit 31: Endpoint enable */ - -/* Device endpoint-n interrupt register */ - -#define OTGFS_DOEPINT_XFRC (1 << 0) /* Bit 0: Transfer completed interrupt */ -#define OTGFS_DOEPINT_EPDISD (1 << 1) /* Bit 1: Endpoint disabled interrupt */ - /* Bit 2: Reserved, must be kept at reset value */ -#define OTGFS_DOEPINT_SETUP (1 << 3) /* Bit 3: SETUP phase done */ -#define OTGFS_DOEPINT_OTEPDIS (1 << 4) /* Bit 4: OUT token received when endpoint disabled */ - /* Bit 5: Reserved, must be kept at reset value */ -#define OTGFS_DOEPINT_B2BSTUP (1 << 6) /* Bit 6: Back-to-back SETUP packets received */ - /* Bits 7-31: Reserved, must be kept at reset value */ -/* Device OUT endpoint-0 transfer size register */ - -#define OTGFS_DOEPTSIZ0_XFRSIZ_SHIFT (0) /* Bits 0-6: Transfer size */ -#define OTGFS_DOEPTSIZ0_XFRSIZ_MASK (0x7f << OTGFS_DOEPTSIZ0_XFRSIZ_SHIFT) - /* Bits 7-18: Reserved, must be kept at reset value */ -#define OTGFS_DOEPTSIZ0_PKTCNT (1 << 19) /* Bit 19 PKTCNT: Packet count */ - /* Bits 20-28: Reserved, must be kept at reset value */ -#define OTGFS_DOEPTSIZ0_STUPCNT_SHIFT (29) /* Bits 29-30: SETUP packet count */ -#define OTGFS_DOEPTSIZ0_STUPCNT_MASK (3 << OTGFS_DOEPTSIZ0_STUPCNT_SHIFT) - /* Bit 31: Reserved, must be kept at reset value */ -/* Device OUT endpoint-n transfer size register */ - -#define OTGFS_DOEPTSIZ_XFRSIZ_SHIFT (0) /* Bits 0-18: Transfer size */ -#define OTGFS_DOEPTSIZ_XFRSIZ_MASK (0x7ffff << OTGFS_DOEPTSIZ_XFRSIZ_SHIFT) -#define OTGFS_DOEPTSIZ_PKTCNT_SHIFT (19) /* Bit 19-28: Packet count */ -#define OTGFS_DOEPTSIZ_PKTCNT_MASK (0x3ff << OTGFS_DOEPTSIZ_PKTCNT_SHIFT) -#define OTGFS_DOEPTSIZ_STUPCNT_SHIFT (29) /* Bits 29-30: SETUP packet count */ -#define OTGFS_DOEPTSIZ_STUPCNT_MASK (3 << OTGFS_DOEPTSIZ_STUPCNT_SHIFT) -#define OTGFS_DOEPTSIZ_RXDPID_SHIFT (29) /* Bits 29-30: Received data PID */ -#define OTGFS_DOEPTSIZ_RXDPID_MASK (3 << OTGFS_DOEPTSIZ_RXDPID_SHIFT) -# define OTGFS_DOEPTSIZ_RXDPID_DATA0 (0 << OTGFS_DOEPTSIZ_RXDPID_SHIFT) -# define OTGFS_DOEPTSIZ_RXDPID_DATA2 (1 << OTGFS_DOEPTSIZ_RXDPID_SHIFT) -# define OTGFS_DOEPTSIZ_RXDPID_DATA1 (2 << OTGFS_DOEPTSIZ_RXDPID_SHIFT) -# define OTGFS_DOEPTSIZ_RXDPID_MDATA (3 << OTGFS_DOEPTSIZ_RXDPID_SHIFT) - /* Bit 31: Reserved, must be kept at reset value */ -/* Power and clock gating control register */ - -#define OTGFS_PCGCCTL_STPPCLK (1 << 0) /* Bit 0: Stop PHY clock */ -#define OTGFS_PCGCCTL_GATEHCLK (1 << 1) /* Bit 1: Gate HCLK */ - /* Bits 2-3: Reserved, must be kept at reset value */ -#define OTGFS_PCGCCTL_PHYSUSP (1 << 4) /* Bit 4: PHY Suspended */ - /* Bits 5-31: Reserved, must be kept at reset value */ - -#endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_OTGFS_H */ diff --git a/arch/arm/src/stm32/chip/stm32f102_pinmap.h b/arch/arm/src/stm32/chip/stm32f102_pinmap.h index d2911da8645d6d3cca4c9e39851fd17b58022817..20cecf5b7ccd18c01f97d64b7c0b1915aec5bf32 100644 --- a/arch/arm/src/stm32/chip/stm32f102_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f102_pinmap.h @@ -198,8 +198,8 @@ #define GPIO_USART1_RTS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) #define GPIO_USART1_CK (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN6) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32f103r_pinmap.h b/arch/arm/src/stm32/chip/stm32f103r_pinmap.h index de73b1acb10e304dec845e8c7c45a2e238fc5b02..e654104e0e974e8c70f167816bca13d4849aba5e 100644 --- a/arch/arm/src/stm32/chip/stm32f103r_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f103r_pinmap.h @@ -237,8 +237,8 @@ /* USART */ #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32f103v_pinmap.h b/arch/arm/src/stm32/chip/stm32f103v_pinmap.h index 17492579f73bedfe69f14dae3fb2756562206b2f..c4feb1296129acaa55ab38b7e4b2c36ec92989b6 100644 --- a/arch/arm/src/stm32/chip/stm32f103v_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f103v_pinmap.h @@ -370,8 +370,8 @@ #define GPIO_USART1_RTS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) #define GPIO_USART1_CK (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN6) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN7) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32f103z_pinmap.h b/arch/arm/src/stm32/chip/stm32f103z_pinmap.h index 54b09d233507d5d005f0eacb54168dea1e90df20..993708a5ecf7358e5d09f5a7cb654ba98f9de56c 100644 --- a/arch/arm/src/stm32/chip/stm32f103z_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f103z_pinmap.h @@ -272,8 +272,8 @@ /* USART */ #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32f105r_pinmap.h b/arch/arm/src/stm32/chip/stm32f105r_pinmap.h index ffd3ef35c45d11703629bfafd295d7efc4373586..0f82dc3ffd605f32eec1da183ae47353c9ecd038 100644 --- a/arch/arm/src/stm32/chip/stm32f105r_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f105r_pinmap.h @@ -280,8 +280,8 @@ #define GPIO_USART1_RTS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) #define GPIO_USART1_CK (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32f105v_pinmap.h b/arch/arm/src/stm32/chip/stm32f105v_pinmap.h index 5fd7029e2c1b096f7cb5b7f13a5aa1592c6426f1..7850a3cc359d24859c2ca14bf2fcb90f7cdfd3c4 100644 --- a/arch/arm/src/stm32/chip/stm32f105v_pinmap.h +++ b/arch/arm/src/stm32/chip/stm32f105v_pinmap.h @@ -314,8 +314,8 @@ #define GPIO_USART1_RTS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) #define GPIO_USART1_CK (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) #if defined(CONFIG_STM32_USART1_REMAP) -# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) +# define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN6) +# define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN7) #else # define GPIO_USART1_TX (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) # define GPIO_USART1_RX (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN10) diff --git a/arch/arm/src/stm32/chip/stm32fxxxxx_otgfs.h b/arch/arm/src/stm32/chip/stm32fxxxxx_otgfs.h index 8658aec0a89224069a7993d8f434891907f8a1b8..36606382671aa5ced84bf17aa4cce798ffd98c1c 100644 --- a/arch/arm/src/stm32/chip/stm32fxxxxx_otgfs.h +++ b/arch/arm/src/stm32/chip/stm32fxxxxx_otgfs.h @@ -475,30 +475,40 @@ # define OTGFS_GINTSTS_DEVMODE (0) # define OTGFS_GINTSTS_HOSTMODE (OTGFS_GINTSTS_CMOD) #define OTGFS_GINT_MMIS (1 << 1) /* Bit 1: rc_w1 Mode mismatch interrupt */ -#define OTGFS_GINT_OTG (1 << 2) /* Bit 2: ro OTG interrupt */ +#define OTGFS_GINT_OTG (1 << 2) /* Bit 2: ro OTG interrupt */ #define OTGFS_GINT_SOF (1 << 3) /* Bit 3: rc_w1 Start of frame */ -#define OTGFS_GINT_RXFLVL (1 << 4) /* Bit 4: ro RxFIFO non-empty */ -#define OTGFS_GINT_NPTXFE (1 << 5) /* Bit 5: ro Non-periodic TxFIFO empty */ -#define OTGFS_GINT_GINAKEFF (1 << 6) /* Bit 6: ro Global IN non-periodic NAK effective */ +#define OTGFS_GINT_RXFLVL (1 << 4) /* Bit 4: ro RxFIFO non-empty */ +#define OTGFS_GINT_NPTXFE (1 << 5) /* Bit 5: ro Non-periodic TxFIFO empty */ +#define OTGFS_GINT_GINAKEFF (1 << 6) /* Bit 6: ro Global IN non-periodic NAK effective */ #define OTGFS_GINT_GONAKEFF (1 << 7) /* Bit 7: Global OUT NAK effective */ -#define OTGFS_GINT_RES89 (3 << 8) /* Bits 8-9: Reserved, must be kept at reset value */ +#define OTGFS_GINT_RES89 (3 << 8) /* Bits 8-9: Reserved, must be kept at reset value */ #define OTGFS_GINT_ESUSP (1 << 10) /* Bit 10: rc_w1 Early suspend */ #define OTGFS_GINT_USBSUSP (1 << 11) /* Bit 11: rc_w1 USB suspend */ #define OTGFS_GINT_USBRST (1 << 12) /* Bit 12: rc_w1 USB reset */ #define OTGFS_GINT_ENUMDNE (1 << 13) /* Bit 13: rc_w1 Enumeration done */ #define OTGFS_GINT_ISOODRP (1 << 14) /* Bit 14: rc_w1 Isochronous OUT packet dropped interrupt */ #define OTGFS_GINT_EOPF (1 << 15) /* Bit 15: rc_w1 End of periodic frame interrupt */ -#define OTGFS_GINT_RES16 (1 << 16) /* Bits 16 Reserved, must be kept at reset value */ -#define OTGFS_GINTMSK_EPMISM (1 << 17) /* Bit 17: Reserved in GINT rw Endpoint mismatch interrupt mask */ -#define OTGFS_GINT_IEP (1 << 18) /* Bit 18: ro IN endpoint interrupt */ -#define OTGFS_GINT_OEP (1 << 19) /* Bit 19: ro OUT endpoint interrupt */ -#define OTGFS_GINT_IISOIXFR (1 << 20) /* Bit 20: rc_w1Incomplete isochronous IN transfer */ -#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: rc_w1 Incomplete isochronous OUT transfer */ -#define OTGFS_GINT_RES2223 (3 << 22) /* Bits 22-23: Reserved, must be kept at reset value */ -#define OTGFS_GINT_HPRT (1 << 24) /* Bit 24: ro Host port interrupt */ -#define OTGFS_GINT_HC (1 << 25) /* Bit 25: ro Host channels interrupt */ -#define OTGFS_GINT_PTXFE (1 << 26) /* Bit 26: ro Periodic TxFIFO empty */ +#define OTGFS_GINT_RES16 (1 << 16) /* Bit 16 Reserved, must be kept at reset value */ +#define OTGFS_GINTMSK_EPMISM (1 << 17) /* Bit 17: Reserved in GINT rw Endpoint mismatch interrupt mask */ +#define OTGFS_GINT_IEP (1 << 18) /* Bit 18: ro IN endpoint interrupt */ +#define OTGFS_GINT_OEP (1 << 19) /* Bit 19: ro OUT endpoint interrupt */ +#define OTGFS_GINT_IISOIXFR (1 << 20) /* Bit 20: rc_w1 Incomplete isochronous IN transfer */ +#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: rc_w1 Incomplete isochronous OUT transfer (device) */ +#define OTGFS_GINT_IPXFR (1 << 21) /* Bit 21: Incomplete periodic transfer (host) */ +#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) +# define OTGFS_GINT_RES22 (1 << 22) /* Bits 22: Reserved, must be kept at reset value */ +# define OTGFS_GINT_RSTDET (1 << 23) /* Bits 23: asserted when a reset is detected on the USB in partial */ +#else +# define OTGFS_GINT_RES2223 (3 << 22) /* Bits 22-23: Reserved, must be kept at reset value */ +#endif +#define OTGFS_GINT_HPRT (1 << 24) /* Bit 24: ro Host port interrupt */ +#define OTGFS_GINT_HC (1 << 25) /* Bit 25: ro Host channels interrupt */ +#define OTGFS_GINT_PTXFE (1 << 26) /* Bit 26: ro Periodic TxFIFO empty */ +#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) +#define OTGFS_GINT_LPMINT (1 << 27) /* Bit 27 LPM interrupt */ +#else #define OTGFS_GINT_RES27 (1 << 27) /* Bit 27 Reserved, must be kept at reset value */ +#endif #define OTGFS_GINT_CIDSCHG (1 << 28) /* Bit 28: rc_w1 Connector ID status change */ #define OTGFS_GINT_DISC (1 << 29) /* Bit 29: rc_w1 Disconnect detected interrupt */ #define OTGFS_GINT_SRQ (1 << 30) /* Bit 30: rc_w1 Session request/new session detected interrupt */ diff --git a/arch/arm/src/stm32/stm32.h b/arch/arm/src/stm32/stm32.h index f2304e27350b6a788bfc73416903099b69ec1e3b..6680e81293f0944f42505319ae62cee9f1d3744c 100644 --- a/arch/arm/src/stm32/stm32.h +++ b/arch/arm/src/stm32/stm32.h @@ -78,7 +78,6 @@ #include "stm32_usbdev.h" #include "stm32_wdg.h" #include "stm32_lowputc.h" -#include "stm32_getc.h" #include "stm32_eth.h" #endif /* __ARCH_ARM_SRC_STM32_STM32_H */ diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index a222253af5e04379f842657f6d5587c969a9c2d6..92a3fcdd81005542be945bab459b4053f57a4990 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -295,6 +295,10 @@ # define SRAM1_END 0x20018000 # elif defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) # define SRAM1_END 0x20030000 +# elif defined(CONFIG_STM32_STM32F446) +# define SRAM1_END 0x20020000 +# elif defined(CONFIG_STM32_STM32F469) +# define SRAM1_END 0x20050000 # else # define SRAM1_END 0x20020000 # endif diff --git a/arch/arm/src/stm32/stm32_dac.c b/arch/arm/src/stm32/stm32_dac.c index fdcbaf050a9cd58d7f56f962ee619e5c29fbf62b..796bb81d2136537da93ae6ed38eb361c9fef51f6 100644 --- a/arch/arm/src/stm32/stm32_dac.c +++ b/arch/arm/src/stm32/stm32_dac.c @@ -472,7 +472,7 @@ static struct dac_dev_s g_dac2dev = #endif #ifdef CONFIG_STM32_DAC2 -/* Channel 1 */ +/* Channel 3 */ static struct stm32_chan_s g_dac3priv = { @@ -514,9 +514,18 @@ static struct stm32_dac_s g_dacblock; static inline void stm32_dac_modify_cr(FAR struct stm32_chan_s *chan, uint32_t clearbits, uint32_t setbits) { - uint32_t shift; + unsigned int shift; + + /* DAC1 channels 1 and 2 share the STM32_DAC[1]_CR control register. DAC2 + * channel 1 (and perhaps channel 2) uses the STM32_DAC2_CR control + * register. In either case, bit 0 of the interface number provides the + * correct shift. + * + * Bit 0 = 0: Shift = 0 + * Bit 0 = 1: Shift = 16 + */ - shift = chan->intf * 16; + shift = (chan->intf & 1) << 4; modifyreg32(chan->cr, clearbits << shift, setbits << shift); } diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 635940ac95c9c9cb35a13da752be2c19d3f8cc12..52dcaacd7289a120096b241a18ae71330b394e6e 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_eth.c * - * Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -53,14 +53,11 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include + #if defined(CONFIG_NET_PKT) # include #endif @@ -97,13 +94,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_STM32_ETHMAC_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_STM32_ETHMAC_LPWORK) @@ -207,12 +203,6 @@ #undef CONFIG_STM32_ETH_ENHANCEDDESC #undef CONFIG_STM32_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We @@ -593,9 +583,7 @@ struct stm32_ethmac_s uint8_t fduplex : 1; /* Full (vs. half) duplex */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -668,34 +656,26 @@ static int stm32_recvframe(FAR struct stm32_ethmac_s *priv); static void stm32_receive(FAR struct stm32_ethmac_s *priv); static void stm32_freeframe(FAR struct stm32_ethmac_s *priv); static void stm32_txdone(FAR struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void stm32_interrupt_work(FAR void *arg); -#endif static int stm32_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void stm32_txtimeout_process(FAR struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void stm32_txtimeout_work(FAR void *arg); -#endif static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void stm32_poll_process(FAR struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void stm32_poll_work(FAR void *arg); -#endif static void stm32_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int stm32_ifup(struct net_driver_s *dev); static int stm32_ifdown(struct net_driver_s *dev); -static inline void stm32_txavail_process(FAR struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void stm32_txavail_work(FAR void *arg); -#endif static int stm32_txavail(struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int stm32_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); #endif @@ -1970,27 +1950,33 @@ static void stm32_txdone(FAR struct stm32_ethmac_s *priv) } /**************************************************************************** - * Function: stm32_interrupt_process + * Function: stm32_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void stm32_interrupt_process(FAR struct stm32_ethmac_s *priv) +static void stm32_interrupt_work(FAR void *arg) { + FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; uint32_t dmasr; + DEBUGASSERT(priv); + + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ dmasr = stm32_getreg(STM32_ETH_DMASR); @@ -2062,44 +2048,13 @@ static inline void stm32_interrupt_process(FAR struct stm32_ethmac_s *priv) stm32_putreg(ETH_DMAINT_AIS, STM32_ETH_DMASR); } #endif -} -/**************************************************************************** - * Function: stm32_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_interrupt_work(FAR void *arg) -{ - FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; - net_lock_t state; - - DEBUGASSERT(priv); - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - stm32_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts at the NVIC */ up_enable_irq(STM32_IRQ_ETH); } -#endif /**************************************************************************** * Function: stm32_interrupt @@ -2121,8 +2076,6 @@ static void stm32_interrupt_work(FAR void *arg) static int stm32_interrupt(int irq, FAR void *context) { FAR struct stm32_ethmac_s *priv = &g_stm32ethmac[0]; - -#ifdef CONFIG_NET_NOINTS uint32_t dmasr; /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ @@ -2158,49 +2111,9 @@ static int stm32_interrupt(int irq, FAR void *context) work_queue(ETHWORK, &priv->work, stm32_interrupt_work, priv, 0); } -#else - /* Process the interrupt now */ - - stm32_interrupt_process(priv); -#endif - return OK; } -/**************************************************************************** - * Function: stm32_txtimeout_process - * - * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. - * - * Parameters: - * priv - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static inline void stm32_txtimeout_process(FAR struct stm32_ethmac_s *priv) -{ - /* Then reset the hardware. Just take the interface down, then back - * up again. - */ - - stm32_ifdown(&priv->dev); - stm32_ifup(&priv->dev); - - /* Then poll for new XMIT data */ - - stm32_dopoll(priv); -} - /**************************************************************************** * Function: stm32_txtimeout_work * @@ -2218,19 +2131,21 @@ static inline void stm32_txtimeout_process(FAR struct stm32_ethmac_s *priv) * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void stm32_txtimeout_work(FAR void *arg) { FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; - net_lock_t state; - /* Process pending Ethernet interrupts */ + /* Reset the hardware. Just take the interface down, then back up again. */ - state = net_lock(); - stm32_txtimeout_process(priv); - net_unlock(state); + net_lock(); + stm32_ifdown(&priv->dev); + stm32_ifup(&priv->dev); + + /* Then poll for new XMIT data */ + + stm32_dopoll(priv); + net_unlock(); } -#endif /**************************************************************************** * Function: stm32_txtimeout_expiry @@ -2257,7 +2172,6 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...) nerr("ERROR: Timeout!\n"); -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2276,33 +2190,28 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, stm32_txtimeout_work, priv, 0); - -#else - /* Process the timeout now */ - - stm32_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: stm32_poll_process + * Function: stm32_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void stm32_poll_process(FAR struct stm32_ethmac_s *priv) +static void stm32_poll_work(FAR void *arg) { + FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; FAR struct net_driver_s *dev = &priv->dev; /* Check if the next TX descriptor is owned by the Ethernet DMA or CPU. We @@ -2316,6 +2225,7 @@ static inline void stm32_poll_process(FAR struct stm32_ethmac_s *priv) * CONFIG_STM32_ETH_NTXDESC). */ + net_lock(); if ((priv->txhead->tdes0 & ETH_TDES0_OWN) == 0 && priv->txhead->tdes2 == 0) { @@ -2351,39 +2261,9 @@ static inline void stm32_poll_process(FAR struct stm32_ethmac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: stm32_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_poll_work(FAR void *arg) -{ - FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - stm32_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: stm32_poll_expiry * @@ -2406,7 +2286,6 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) { FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2425,12 +2304,6 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); } - -#else - /* Process the interrupt now */ - - stm32_poll_process(priv); -#endif } /**************************************************************************** @@ -2536,66 +2409,40 @@ static int stm32_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: stm32_txavail_process + * Function: stm32_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * priv - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void stm32_txavail_process(FAR struct stm32_ethmac_s *priv) +static void stm32_txavail_work(FAR void *arg) { + FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ stm32_dopoll(priv); } -} -/**************************************************************************** - * Function: stm32_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_txavail_work(FAR void *arg) -{ - FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - stm32_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: stm32_txavail @@ -2620,7 +2467,6 @@ static int stm32_txavail(struct net_driver_s *dev) { FAR struct stm32_ethmac_s *priv = (FAR struct stm32_ethmac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2633,21 +2479,6 @@ static int stm32_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, stm32_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - stm32_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } diff --git a/arch/arm/src/stm32/stm32_flash.c b/arch/arm/src/stm32/stm32_flash.c index 56aa1f75edcee80a31cd3cda5831748b8ba8c14c..9ac38a19a137f81185880877f823f862a274745a 100644 --- a/arch/arm/src/stm32/stm32_flash.c +++ b/arch/arm/src/stm32/stm32_flash.c @@ -231,12 +231,14 @@ ssize_t up_progmem_erasepage(size_t page) return -EFAULT; } - /* Get flash ready and begin erasing single page */ - +#if !defined(CONFIG_STM32_STM32F40XX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { return -EPERM; } +#endif + + /* Get flash ready and begin erasing single page */ stm32_flash_unlock(); @@ -313,17 +315,19 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count) addr -= STM32_FLASH_BASE; } - if ((addr+count) >= STM32_FLASH_SIZE) + if ((addr+count) > STM32_FLASH_SIZE) { return -EFAULT; } - /* Get flash ready and begin flashing */ - +#if !defined(CONFIG_STM32_STM32F40XX) if (!(getreg32(STM32_RCC_CR) & RCC_CR_HSION)) { return -EPERM; } +#endif + + /* Get flash ready and begin flashing */ stm32_flash_unlock(); diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index c570e6d084fceaca4c7095898b1431d5c68cc73f..2fcbf599f0667f939d9bb7d9df48660598d7c130 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -153,25 +153,50 @@ # error "CONFIG_USBDEV_EP3_TXFIFO_SIZE is out of range" #endif -#define OTGFS_GINT_RESERVED (OTGFS_GINT_RES89 | \ - (OTGFS_GINT_RES16 | OTGFS_GINTMSK_EPMISM) \ - |OTGFS_GINT_RES2223 | \ - OTGFS_GINT_RES27) - -#define OTGFS_GINT_RC_W1 (OTGFS_GINT_MMIS | \ - OTGFS_GINT_SOF | \ - OTGFS_GINT_ESUSP | \ - OTGFS_GINT_USBSUSP | \ - OTGFS_GINT_USBRST | \ - OTGFS_GINT_ENUMDNE | \ - OTGFS_GINT_ISOODRP | \ - OTGFS_GINT_EOPF | \ - OTGFS_GINT_IISOIXFR | \ - OTGFS_GINT_IISOOXFR | \ - OTGFS_GINT_CIDSCHG | \ - OTGFS_GINT_DISC | \ - OTGFS_GINT_SRQ | \ - OTGFS_GINT_WKUP) +#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) +# define OTGFS_GINT_RESETS (OTGFS_GINT_USBRST | OTGFS_GINT_RSTDET) +# define OTGFS_GINT_RESERVED (OTGFS_GINT_RES89 | \ + (OTGFS_GINT_RES16 | OTGFS_GINTMSK_EPMISM) \ + |OTGFS_GINT_RES22) + +# define OTGFS_GINT_RC_W1 (OTGFS_GINT_MMIS | \ + OTGFS_GINT_SOF | \ + OTGFS_GINT_ESUSP | \ + OTGFS_GINT_USBSUSP | \ + OTGFS_GINT_USBRST | \ + OTGFS_GINT_ENUMDNE | \ + OTGFS_GINT_ISOODRP | \ + OTGFS_GINT_EOPF | \ + OTGFS_GINT_IISOIXFR | \ + OTGFS_GINT_IISOOXFR | \ + OTGFS_GINT_RSTDET | \ + OTGFS_GINT_LPMINT | \ + OTGFS_GINT_CIDSCHG | \ + OTGFS_GINT_DISC | \ + OTGFS_GINT_SRQ | \ + OTGFS_GINT_WKUP) +#else +# define OTGFS_GINT_RESETS OTGFS_GINT_USBRST +# define OTGFS_GINT_RESERVED (OTGFS_GINT_RES89 | \ + (OTGFS_GINT_RES16 | OTGFS_GINTMSK_EPMISM) \ + |OTGFS_GINT_RES2223 | \ + OTGFS_GINT_RES27) + +# define OTGFS_GINT_RC_W1 (OTGFS_GINT_MMIS | \ + OTGFS_GINT_SOF | \ + OTGFS_GINT_ESUSP | \ + OTGFS_GINT_USBSUSP | \ + OTGFS_GINT_USBRST | \ + OTGFS_GINT_ENUMDNE | \ + OTGFS_GINT_ISOODRP | \ + OTGFS_GINT_EOPF | \ + OTGFS_GINT_IISOIXFR | \ + OTGFS_GINT_IISOOXFR | \ + OTGFS_GINT_CIDSCHG | \ + OTGFS_GINT_DISC | \ + OTGFS_GINT_SRQ | \ + OTGFS_GINT_WKUP) +#endif /* Debug ***********************************************************************/ /* Trace error codes */ @@ -3517,7 +3542,7 @@ static inline void stm32_otginterrupt(FAR struct stm32_usbdev_s *priv) /* Clear OTG interrupt */ - stm32_putreg(retval, STM32_OTGFS_GOTGINT); + stm32_putreg(regval, STM32_OTGFS_GOTGINT); } #endif @@ -3642,7 +3667,7 @@ static int stm32_usbinterrupt(int irq, FAR void *context) /* USB reset interrupt */ - if ((regval & OTGFS_GINT_USBRST) != 0) + if ((regval & OTGFS_GINT_RESETS) != 0) { usbtrace(TRACE_INTDECODE(STM32_TRACEINTID_DEVRESET), (uint16_t)regval); @@ -5201,9 +5226,9 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) /* Deactivate the power down */ -#if defined(CONFIG_STM32_STM32F446) - /* In the case of the STM32F446 the meaning of the bit has changed to VBUS - * Detection Enable when set +#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) + /* In the case of the STM32F446 or STM32F469 the meaning of the bit + * has changed to VBUS Detection Enable when set */ regval = OTGFS_GCCFG_PWRDWN; @@ -5228,11 +5253,11 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv) stm32_putreg(regval, STM32_OTGFS_GCCFG); up_mdelay(20); - /* For the new OTG controller in the F446 when VBUS sensing is not used we + /* For the new OTG controller in the F446, F469 when VBUS sensing is not used we * need to force the B session valid */ -#if defined(CONFIG_STM32_STM32F446) +#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469) # ifndef CONFIG_USBDEV_VBUSSENSING regval = stm32_getreg(STM32_OTGFS_GOTGCTL); regval |= (OTGFS_GOTGCTL_BVALOEN | OTGFS_GOTGCTL_BVALOVAL); diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index aec4fc37d5a09a5751984178cdaae429ff980433..9dee00ae45cc8ccadbfad7c8fa9e2f26b67f4078 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -139,11 +139,16 @@ /* HCD Setup *******************************************************************/ /* Hardware capabilities */ -#define STM32_NHOST_CHANNELS 12 /* Number of host channels */ +#if defined(CONFIG_STM32_STM32F446) +# define STM32_NHOST_CHANNELS 16 /* Number of host channels */ +# define STM32_MAX_TX_FIFOS 16 /* Max number of TX FIFOs */ +#else +# define STM32_NHOST_CHANNELS 12 /* Number of host channels */ +# define STM32_MAX_TX_FIFOS 12 /* Max number of TX FIFOs */ +#endif #define STM32_MAX_PACKET_SIZE 64 /* Full speed max packet size */ #define STM32_EP0_DEF_PACKET_SIZE 8 /* EP0 default packet size */ #define STM32_EP0_MAX_PACKET_SIZE 64 /* EP0 HS max packet size */ -#define STM32_MAX_TX_FIFOS 12 /* Max number of TX FIFOs */ #define STM32_MAX_PKTCOUNT 256 /* Max packet count */ #define STM32_RETRY_COUNT 3 /* Number of ctrl transfer retries */ diff --git a/arch/arm/src/stm32/stm32_rtcounter.c b/arch/arm/src/stm32/stm32_rtcounter.c index 137e7344a03443876e479be86ea9aed68a09c4d6..1c90be9c14db1b904138d62d34dae3b17b44a422 100644 --- a/arch/arm/src/stm32/stm32_rtcounter.c +++ b/arch/arm/src/stm32/stm32_rtcounter.c @@ -378,13 +378,12 @@ int up_rtc_initialize(void) */ stm32_pwr_enablebkp(true); - - /* Set access to the peripheral, enable the backup domain (BKP) and the lower - * power external 32,768Hz (Low-Speed External, LSE) oscillator. Configure the - * LSE to drive the RTC. - */ - - stm32_rcc_enablelse(); + + /* Select the lower power external 32,768Hz (Low-Speed External, LSE) oscillator + * as RTC Clock Source and enable the Clock */ + + modifyreg16(STM32_RCC_BDCR, RCC_BDCR_RTCSEL_MASK, RCC_BDCR_RTCSEL_LSE); + modifyreg16(STM32_RCC_BDCR, 0, RCC_BDCR_RTCEN); /* TODO: Get state from this function, if everything is * okay and whether it is already enabled (if it was disabled diff --git a/arch/arm/src/stm32/stm32_sdio.c b/arch/arm/src/stm32/stm32_sdio.c index be060c70263e57306e44230171faf41a1a0f4014..58071e84f4673d660d4a415413b2d0f369245ed4 100644 --- a/arch/arm/src/stm32/stm32_sdio.c +++ b/arch/arm/src/stm32/stm32_sdio.c @@ -149,18 +149,27 @@ #define SDIO_CLKCR_RISINGEDGE (0) #define SDIO_CLKCR_FALLINGEDGE SDIO_CLKCR_NEGEDGE +/* Use the default of the rising edge but allow a configuration, + * that does not have the errata, to override the edge the SDIO + * command and data is changed on. + */ + +#if !defined(SDIO_CLKCR_EDGE) +# define SDIO_CLKCR_EDGE SDIO_CLKCR_RISINGEDGE +#endif + /* Mode dependent settings. These depend on clock devisor settings that must * be defined in the board-specific board.h header file: SDIO_INIT_CLKDIV, * SDIO_MMCXFR_CLKDIV, and SDIO_SDXFR_CLKDIV. */ -#define STM32_CLCKCR_INIT (SDIO_INIT_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ +#define STM32_CLCKCR_INIT (SDIO_INIT_CLKDIV | SDIO_CLKCR_EDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLKCR_MMCXFR (SDIO_MMCXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ +#define SDIO_CLKCR_MMCXFR (SDIO_MMCXFR_CLKDIV | SDIO_CLKCR_EDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLCKR_SDXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ +#define SDIO_CLCKR_SDXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_EDGE | \ SDIO_CLKCR_WIDBUS_D1) -#define SDIO_CLCKR_SDWIDEXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_RISINGEDGE | \ +#define SDIO_CLCKR_SDWIDEXFR (SDIO_SDXFR_CLKDIV | SDIO_CLKCR_EDGE | \ SDIO_CLKCR_WIDBUS_D4) /* Timing */ @@ -2200,6 +2209,7 @@ static int stm32_recvlong(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t rlo rlong[2] = getreg32(STM32_SDIO_RESP3); rlong[3] = getreg32(STM32_SDIO_RESP4); } + return ret; } @@ -2564,6 +2574,7 @@ static bool stm32_dmasupported(FAR struct sdio_dev_s *dev) static int stm32_dmapreflight(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t buflen) { +#if !defined(CONFIG_STM32_STM32F40XX) struct stm32_dev_s *priv = (struct stm32_dev_s *)dev; DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0); @@ -2574,6 +2585,7 @@ static int stm32_dmapreflight(FAR struct sdio_dev_s *dev, { return -EINVAL; } +#endif /* DMA must be possible to the buffer */ diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 644c810817ea26380c3bc8f257afd18bfbfc4e03..8f774838da6316c40ca6766ca23041e49e9fa5d3 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/stm32_serial.c * - * Copyright (C) 2009-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014, 2016, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some sanity checks *******************************************************/ /* DMA configuration */ @@ -208,7 +209,7 @@ # error "Unknown STM32 DMA" # endif -/* DMA control words */ +/* DMA control word */ # if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) # define SERIAL_DMA_CONTROL_WORD \ @@ -220,16 +221,6 @@ CONFIG_USART_DMAPRIO | \ DMA_SCR_PBURST_SINGLE | \ DMA_SCR_MBURST_SINGLE) -# ifdef CONFIG_SERIAL_IFLOWCONTROL -# define SERIAL_DMA_IFLOW_CONTROL_WORD \ - (DMA_SCR_DIR_P2M | \ - DMA_SCR_MINC | \ - DMA_SCR_PSIZE_8BITS | \ - DMA_SCR_MSIZE_8BITS | \ - CONFIG_USART_DMAPRIO | \ - DMA_SCR_PBURST_SINGLE | \ - DMA_SCR_MBURST_SINGLE) -# endif # else # define SERIAL_DMA_CONTROL_WORD \ (DMA_CCR_CIRC | \ @@ -237,13 +228,6 @@ DMA_CCR_PSIZE_8BITS | \ DMA_CCR_MSIZE_8BITS | \ CONFIG_USART_DMAPRIO) -# ifdef CONFIG_SERIAL_IFLOWCONTROL -# define SERIAL_DMA_IFLOW_CONTROL_WORD \ - (DMA_CCR_MINC | \ - DMA_CCR_PSIZE_8BITS | \ - DMA_CCR_MSIZE_8BITS | \ - CONFIG_USART_DMAPRIO) -# endif # endif #endif @@ -1608,28 +1592,13 @@ static int up_dma_setup(struct uart_dev_s *dev) priv->rxdma = stm32_dmachannel(priv->rxdma_channel); -#ifdef CONFIG_SERIAL_IFLOWCONTROL - if (priv->iflow) - { - /* Configure for non-circular DMA reception into the RX FIFO */ - - stm32_dmasetup(priv->rxdma, - priv->usartbase + STM32_USART_RDR_OFFSET, - (uint32_t)priv->rxfifo, - RXDMA_BUFFER_SIZE, - SERIAL_DMA_IFLOW_CONTROL_WORD); - } - else -#endif - { - /* Configure for circular DMA reception into the RX FIFO */ + /* Configure for circular DMA reception into the RX fifo */ - stm32_dmasetup(priv->rxdma, - priv->usartbase + STM32_USART_RDR_OFFSET, - (uint32_t)priv->rxfifo, - RXDMA_BUFFER_SIZE, - SERIAL_DMA_CONTROL_WORD); - } + stm32_dmasetup(priv->rxdma, + priv->usartbase + STM32_USART_RDR_OFFSET, + (uint32_t)priv->rxfifo, + RXDMA_BUFFER_SIZE, + SERIAL_DMA_CONTROL_WORD); /* Reset our DMA shadow pointer to match the address just * programmed above. @@ -1643,26 +1612,12 @@ static int up_dma_setup(struct uart_dev_s *dev) regval |= USART_CR3_DMAR; up_serialout(priv, STM32_USART_CR3_OFFSET, regval); -#ifdef CONFIG_SERIAL_IFLOWCONTROL - if (priv->iflow) - { - /* Start the DMA channel, and arrange for callbacks at the full point - * in the FIFO. After buffer gets full, hardware flow-control kicks - * in and DMA transfer is stopped. - */ - - stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, false); - } - else -#endif - { - /* Start the DMA channel, and arrange for callbacks at the half and - * full points in the FIFO. This ensures that we have half a FIFO - * worth of time to claim bytes before they are overwritten. - */ + /* Start the DMA channel, and arrange for callbacks at the half and + * full points in the FIFO. This ensures that we have half a FIFO + * worth of time to claim bytes before they are overwritten. + */ - stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); - } + stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, true); return OK; } @@ -1945,11 +1900,11 @@ static int up_interrupt_common(struct up_dev_s *priv) static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) \ - || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) + || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; #endif -#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) +#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) struct up_dev_s *priv = (struct up_dev_s *)dev->priv; #endif int ret = OK; @@ -2316,9 +2271,9 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, unsigned int nbuffered, bool upper) { struct up_dev_s *priv = (struct up_dev_s *)dev->priv; + uint16_t ie; -#if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && \ - defined(CONFIG_STM32_FLOWCONTROL_BROKEN) +#if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && defined(CONFIG_STM32_FLOWCONTROL_BROKEN) if (priv->iflow && (priv->rts_gpio != 0)) { /* Assert/de-assert nRTS set it high resume/stop sending */ @@ -2346,7 +2301,9 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, * enable Rx interrupts. */ - uart_disablerxint(dev); + ie = priv->ie; + ie &= ~USART_CR1_RXNEIE; + up_restoreusartint(priv, ie); return true; } @@ -2359,7 +2316,7 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev, * received. */ - uart_enablerxint(dev); + up_rxint(dev, true); } } #endif @@ -2391,18 +2348,7 @@ static int up_dma_receive(struct uart_dev_s *dev, unsigned int *status) priv->rxdmanext++; if (priv->rxdmanext == RXDMA_BUFFER_SIZE) { -#ifdef CONFIG_SERIAL_IFLOWCONTROL - if (priv->iflow) - { - /* RX DMA buffer full. RX paused, RTS line pulled up to prevent - * more input data from other end. - */ - } - else -#endif - { - priv->rxdmanext = 0; - } + priv->rxdmanext = 0; } } @@ -2410,40 +2356,6 @@ static int up_dma_receive(struct uart_dev_s *dev, unsigned int *status) } #endif -/**************************************************************************** - * Name: up_dma_reenable - * - * Description: - * Call to re-enable RX DMA. - * - ****************************************************************************/ - -#if defined(SERIAL_HAVE_DMA) && defined(CONFIG_SERIAL_IFLOWCONTROL) -static void up_dma_reenable(struct up_dev_s *priv) -{ - /* Configure for non-circular DMA reception into the RX fifo */ - - stm32_dmasetup(priv->rxdma, - priv->usartbase + STM32_USART_RDR_OFFSET, - (uint32_t)priv->rxfifo, - RXDMA_BUFFER_SIZE, - SERIAL_DMA_IFLOW_CONTROL_WORD); - - /* Reset our DMA shadow pointer to match the address just - * programmed above. - */ - - priv->rxdmanext = 0; - - /* Start the DMA channel, and arrange for callbacks at the full point in - * the FIFO. After buffer gets full, hardware flow-control kicks in and - * DMA transfer is stopped. - */ - - stm32_dmastart(priv->rxdma, up_dma_rxcallback, (void *)priv, false); -} -#endif - /**************************************************************************** * Name: up_dma_rxint * @@ -2466,15 +2378,6 @@ static void up_dma_rxint(struct uart_dev_s *dev, bool enable) */ priv->rxenable = enable; - -#ifdef CONFIG_SERIAL_IFLOWCONTROL - if (priv->iflow && priv->rxenable && (priv->rxdmanext == RXDMA_BUFFER_SIZE)) - { - /* Re-enable RX DMA. */ - - up_dma_reenable(priv); - } -#endif } #endif @@ -2510,14 +2413,10 @@ static bool up_dma_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { struct up_dev_s *priv = (struct up_dev_s *)dev->priv; - #ifdef HAVE_RS485 if (priv->rs485_dir_gpio != 0) - { - stm32_gpiowrite(priv->rs485_dir_gpio, priv->rs485_dir_polarity); - } + stm32_gpiowrite(priv->rs485_dir_gpio, priv->rs485_dir_polarity); #endif - up_serialout(priv, STM32_USART_TDR_OFFSET, (uint32_t)ch); } @@ -2683,16 +2582,6 @@ static void up_dma_rxcallback(DMA_HANDLE handle, uint8_t status, void *arg) if (priv->rxenable && up_dma_rxavailable(&priv->dev)) { uart_recvchars(&priv->dev); - -#ifdef CONFIG_SERIAL_IFLOWCONTROL - if (priv->iflow && priv->rxenable && - (priv->rxdmanext == RXDMA_BUFFER_SIZE)) - { - /* Re-enable RX DMA. */ - - up_dma_reenable(priv); - } -#endif } } #endif @@ -2791,6 +2680,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain, * return non-zero values when reverting back to higher power * consumption modes! * + * ****************************************************************************/ #ifdef CONFIG_PM diff --git a/arch/arm/src/stm32/stm32_usbhost.h b/arch/arm/src/stm32/stm32_usbhost.h index 7c036a8fa614babbc9c93ba3fa0f7e101e45029f..04a64190be921c54094f72ed3f31876025b4f728 100644 --- a/arch/arm/src/stm32/stm32_usbhost.h +++ b/arch/arm/src/stm32/stm32_usbhost.h @@ -46,7 +46,7 @@ #include #include "chip.h" -#include "chip/stm32_otgfs.h" +#include "chip/stm32fxxxxx_otgfs.h" #include "chip/stm32_otghs.h" #if (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS)) && defined(CONFIG_USBHOST) diff --git a/arch/arm/src/stm32/stm32f10xxx_rcc.c b/arch/arm/src/stm32/stm32f10xxx_rcc.c index 736b3ee7ef80a29b221461b6c87e2bf19b60fd34..218e534e22275740666cd383b7459ae05f3a3145 100644 --- a/arch/arm/src/stm32/stm32f10xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f10xxx_rcc.c @@ -756,12 +756,6 @@ static void stm32_stdclockconfig(void) stm32_rcc_enablelsi(); #endif - -#if defined(CONFIG_RTC_LSECLOCK) - /* Low speed external clock source LSE */ - - stm32_rcc_enablelse(); -#endif } #endif @@ -774,6 +768,14 @@ static inline void rcc_enableperipherals(void) rcc_enableahb(); rcc_enableapb2(); rcc_enableapb1(); + +#if defined(CONFIG_RTC_LSECLOCK) + /* Low speed external clock source LSE + * For F1 it requires PWR and BKP from APB1 + */ + + stm32_rcc_enablelse(); +#endif } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index 347d8a3d62b71a6a98713d9a7f0ee6efc7d65eb9..adda863ccaee96969f0ad2c8936bc77007e3cb8a 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -95,10 +95,10 @@ static inline void rcc_reset(void) putreg32(0x00000000, STM32_RCC_CFGR); - /* Reset HSION, HSEON, CSSON and PLLON bits */ + /* Reset HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); + regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -619,11 +619,6 @@ static void stm32_stdclockconfig(void) volatile int32_t timeout; #ifdef STM32_BOARD_USEHSI - /* Enable Internal High-Speed Clock (HSI) */ - - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_HSION; /* Enable HSI */ - putreg32(regval, STM32_RCC_CR); /* Wait until the HSI is ready (or until a timeout elapsed) */ @@ -725,7 +720,7 @@ static void stm32_stdclockconfig(void) #else /* if STM32_BOARD_USEHSE */ | RCC_PLLCFG_PLLSRC_HSE #endif -#if defined(CONFIG_STM32_STM32F446) +#if defined(STM32_PLLCFG_PLLR) | STM32_PLLCFG_PLLR #endif ); @@ -743,7 +738,9 @@ static void stm32_stdclockconfig(void) { } -#if defined(CONFIG_STM32_STM32F429) || defined(CONFIG_STM32_STM32F446) +#if defined(CONFIG_STM32_STM32F429) || defined(CONFIG_STM32_STM32F446) || \ + defined(CONFIG_STM32_STM32F469) + /* Enable the Over-drive to extend the clock frequency to 180 Mhz */ regval = getreg32(STM32_PWR_CR); @@ -783,12 +780,12 @@ static void stm32_stdclockconfig(void) { } -#if defined(CONFIG_STM32_LTDC) || \ - (defined(CONFIG_STM32_STM32F446) && defined(CONFIG_STM32_SAIPLL)) +#if defined(CONFIG_STM32_LTDC) || defined(CONFIG_STM32_SAIPLL) + /* Configure PLLSAI */ regval = getreg32(STM32_RCC_PLLSAICFGR); -#if defined(CONFIG_STM32_STM32F446) +# if defined(CONFIG_STM32_STM32F446) regval &= ~(RCC_PLLSAICFGR_PLLSAIM_MASK | RCC_PLLSAICFGR_PLLSAIN_MASK | RCC_PLLSAICFGR_PLLSAIP_MASK @@ -797,35 +794,64 @@ static void stm32_stdclockconfig(void) | STM32_RCC_PLLSAICFGR_PLLSAIN | STM32_RCC_PLLSAICFGR_PLLSAIP | STM32_RCC_PLLSAICFGR_PLLSAIQ); -#else +# elif defined(CONFIG_STM32_STM32F469) regval &= ~(RCC_PLLSAICFGR_PLLSAIN_MASK - | RCC_PLLSAICFGR_PLLSAIR_MASK - | RCC_PLLSAICFGR_PLLSAIQ_MASK); + | RCC_PLLSAICFGR_PLLSAIP_MASK + | RCC_PLLSAICFGR_PLLSAIQ_MASK + | RCC_PLLSAICFGR_PLLSAIR_MASK); regval |= (STM32_RCC_PLLSAICFGR_PLLSAIN - | STM32_RCC_PLLSAICFGR_PLLSAIR - | STM32_RCC_PLLSAICFGR_PLLSAIQ); -#endif + | STM32_RCC_PLLSAICFGR_PLLSAIP + | STM32_RCC_PLLSAICFGR_PLLSAIQ + | STM32_RCC_PLLSAICFGR_PLLSAIR); +# else + regval &= ~(RCC_PLLSAICFGR_PLLSAIN_MASK + | RCC_PLLSAICFGR_PLLSAIQ_MASK + | RCC_PLLSAICFGR_PLLSAIR_MASK); + regval |= (STM32_RCC_PLLSAICFGR_PLLSAIN + | STM32_RCC_PLLSAICFGR_PLLSAIQ + | STM32_RCC_PLLSAICFGR_PLLSAIR); +# endif putreg32(regval, STM32_RCC_PLLSAICFGR); regval = getreg32(STM32_RCC_DCKCFGR); -#if defined(CONFIG_STM32_STM32F446) +# if defined(CONFIG_STM32_STM32F446) regval &= ~(RCC_DCKCFGR_PLLI2SDIVQ_MASK - | RCC_DCKCFGR_PLLSAIDIVQ_MASK - | RCC_DCKCFGR_SAI1SRC_MASK - | RCC_DCKCFGR_SAI2SRC_MASK - | RCC_DCKCFGR_I2S1SRC_MASK - | RCC_DCKCFGR_I2S2SRC_MASK); + | RCC_DCKCFGR_PLLSAIDIVQ_MASK + | RCC_DCKCFGR_SAI1SRC_MASK + | RCC_DCKCFGR_SAI2SRC_MASK + | RCC_DCKCFGR_TIMPRE + | RCC_DCKCFGR_I2S1SRC_MASK + | RCC_DCKCFGR_I2S2SRC_MASK); regval |= (STM32_RCC_DCKCFGR_PLLI2SDIVQ - | STM32_RCC_DCKCFGR_PLLSAIDIVQ - | STM32_RCC_DCKCFGR_SAI1SRC - | STM32_RCC_DCKCFGR_SAI2SRC - | STM32_RCC_DCKCFGR_TIMPRE - | STM32_RCC_DCKCFGR_I2S1SRC - | STM32_RCC_DCKCFGR_I2S2SRC); -#else + | STM32_RCC_DCKCFGR_PLLSAIDIVQ + | STM32_RCC_DCKCFGR_SAI1SRC + | STM32_RCC_DCKCFGR_SAI2SRC + | STM32_RCC_DCKCFGR_TIMPRE + | STM32_RCC_DCKCFGR_I2S1SRC + | STM32_RCC_DCKCFGR_I2S2SRC); +# elif defined(CONFIG_STM32_STM32F469) + regval &= ~(RCC_DCKCFGR_PLLI2SDIVQ_MASK + | RCC_DCKCFGR_PLLSAIDIVQ_MASK + | RCC_DCKCFGR_PLLSAIDIVR_MASK + | RCC_DCKCFGR_SAI1ASRC_MASK + | RCC_DCKCFGR_SAI1BSRC_MASK + | RCC_DCKCFGR_TIMPRE + | RCC_DCKCFGR_48MSEL_MASK + | RCC_DCKCFGR_SDMMCSEL_MASK + | RCC_DCKCFGR_DSISEL_MASK); + regval |= (STM32_RCC_DCKCFGR_PLLI2SDIVQ + | STM32_RCC_DCKCFGR_PLLSAIDIVQ + | STM32_RCC_DCKCFGR_PLLSAIDIVR + | STM32_RCC_DCKCFGR_SAI1ASRC + | STM32_RCC_DCKCFGR_SAI1BSRC + | STM32_RCC_DCKCFGR_TIMPRE + | STM32_RCC_DCKCFGR_48MSEL + | STM32_RCC_DCKCFGR_SDMMCSEL + | STM32_RCC_DCKCFGR_DSISEL); +# else regval &= ~RCC_DCKCFGR_PLLSAIDIVR_MASK; regval |= STM32_RCC_DCKCFGR_PLLSAIDIVR; -#endif +# endif putreg32(regval, STM32_RCC_DCKCFGR); /* Enable PLLSAI */ @@ -841,34 +867,54 @@ static void stm32_stdclockconfig(void) } #endif -#if defined(CONFIG_STM32_STM32F446) && defined(CONFIG_STM32_I2SPLL) +#if defined(CONFIG_STM32_I2SPLL) + /* Configure PLLI2S */ regval = getreg32(STM32_RCC_PLLI2SCFGR); + +# if defined(CONFIG_STM32_STM32F446) + regval &= ~(RCC_PLLI2SCFGR_PLLI2SM_MASK - | RCC_PLLI2SCFGR_PLLI2SN_MASK - | RCC_PLLI2SCFGR_PLLI2SP_MASK - | RCC_PLLI2SCFGR_PLLI2SQ_MASK); + | RCC_PLLI2SCFGR_PLLI2SN_MASK + | RCC_PLLI2SCFGR_PLLI2SP_MASK + | RCC_PLLI2SCFGR_PLLI2SQ_MASK + | RCC_PLLI2SCFGR_PLLI2SR_MASK); regval |= (STM32_RCC_PLLI2SCFGR_PLLI2SM - | STM32_RCC_PLLI2SCFGR_PLLI2SN - | STM32_RCC_PLLI2SCFGR_PLLI2SP - | STM32_RCC_PLLI2SCFGR_PLLI2SQ - | STM32_RCC_PLLI2SCFGR_PLLI2SR); + | STM32_RCC_PLLI2SCFGR_PLLI2SN + | STM32_RCC_PLLI2SCFGR_PLLI2SP + | STM32_RCC_PLLI2SCFGR_PLLI2SQ + | STM32_RCC_PLLI2SCFGR_PLLI2SR); + +# elif defined(CONFIG_STM32_STM32F469) + + regval &= ~(RCC_PLLI2SCFGR_PLLI2SN_MASK + | RCC_PLLI2SCFGR_PLLI2SQ_MASK + | RCC_PLLI2SCFGR_PLLI2SR_MASK); + regval |= (STM32_RCC_PLLI2SCFGR_PLLI2SN + | STM32_RCC_PLLI2SCFGR_PLLI2SQ + | STM32_RCC_PLLI2SCFGR_PLLI2SR); +# endif + putreg32(regval, STM32_RCC_PLLI2SCFGR); +# if defined(STM32_RCC_DCKCFGR2) + regval = getreg32(STM32_RCC_DCKCFGR2); + regval &= ~(RCC_DCKCFGR2_FMPI2C1SEL_MASK - | RCC_DCKCFGR2_CECSEL_MASK - | RCC_DCKCFGR2_CK48MSEL_MASK - | RCC_DCKCFGR2_SDIOSEL_MASK - | RCC_DCKCFGR2_SPDIFRXSEL_MASK); + | RCC_DCKCFGR2_CECSEL_MASK + | RCC_DCKCFGR2_CK48MSEL_MASK + | RCC_DCKCFGR2_SDIOSEL_MASK + | RCC_DCKCFGR2_SPDIFRXSEL_MASK); regval |= (STM32_RCC_DCKCFGR2_FMPI2C1SEL - | STM32_RCC_DCKCFGR2_CECSEL - | STM32_RCC_DCKCFGR2_CK48MSEL - | STM32_RCC_DCKCFGR2_SDIOSEL - | STM32_RCC_DCKCFGR2_SPDIFRXSEL); + | STM32_RCC_DCKCFGR2_CECSEL + | STM32_RCC_DCKCFGR2_CK48MSEL + | STM32_RCC_DCKCFGR2_SDIOSEL + | STM32_RCC_DCKCFGR2_SPDIFRXSEL); putreg32(regval, STM32_RCC_DCKCFGR2); +# endif /* Enable PLLI2S */ diff --git a/arch/arm/src/stm32f7/chip/stm32f76xx77xx_pinmap.h b/arch/arm/src/stm32f7/chip/stm32f76xx77xx_pinmap.h index 6054d7024296c102614c881f2ed5396f51d43ab4..c5d1b50a16cb35c93b47b965af4ec7450655f42f 100644 --- a/arch/arm/src/stm32f7/chip/stm32f76xx77xx_pinmap.h +++ b/arch/arm/src/stm32f7/chip/stm32f76xx77xx_pinmap.h @@ -997,7 +997,7 @@ #define GPIO_SPI2_SCK_3 (GPIO_ALT|GPIO_AF5|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN13) #define GPIO_SPI2_SCK_4 (GPIO_ALT|GPIO_AF5|GPIO_SPEED_50MHz|GPIO_PORTD|GPIO_PIN3) #define GPIO_SPI2_SCK_5 (GPIO_ALT|GPIO_AF5|GPIO_SPEED_50MHz|GPIO_PORTI|GPIO_PIN1) -#define GPIO_SPI2_SCK_6 (GPIO_ALT|GPIO_AF5|GPIO_SPEED_50MHz|GPIO_PORTIA|GPIO_PIN12) +#define GPIO_SPI2_SCK_6 (GPIO_ALT|GPIO_AF5|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN12) #define GPIO_SPI3_MISO_1 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN4) #define GPIO_SPI3_MISO_2 (GPIO_ALT|GPIO_AF6|GPIO_SPEED_50MHz|GPIO_PORTC|GPIO_PIN11) diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index eccf15b348f0545ae3da83c5f1d3ddf5037a111a..b84e8511ac80f23a1d4ab262ab3418f360a0f4db 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32f7/stm32_ethernet.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,14 +52,11 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include + #if defined(CONFIG_NET_PKT) # include #endif @@ -98,13 +95,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_STM32F7_ETHMAC_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_STM32F7_ETHMAC_LPWORK) @@ -194,12 +190,6 @@ #undef CONFIG_STM32F7_ETH_ENHANCEDDESC #undef CONFIG_STM32F7_ETH_HWCHECKSUM -/* Ethernet buffer sizes, number of buffers, and number of descriptors */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER is required" -#endif - /* Add 4 to the configured buffer size to account for the 2 byte checksum * memory needed at the end of the maximum size packet. Buffer sizes must * be an even multiple of 4, 8, or 16 bytes (depending on buswidth). We @@ -617,9 +607,7 @@ struct stm32_ethmac_s uint8_t intf; /* Ethernet interface number */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -711,35 +699,26 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv); static void stm32_receive(struct stm32_ethmac_s *priv); static void stm32_freeframe(struct stm32_ethmac_s *priv); static void stm32_txdone(struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void stm32_interrupt_work(void *arg); -#endif static int stm32_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static inline void stm32_txtimeout_process(struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void stm32_txtimeout_work(void *arg); -#endif static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void stm32_poll_process(struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void stm32_poll_work(void *arg); -#endif static void stm32_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int stm32_ifup(struct net_driver_s *dev); static int stm32_ifdown(struct net_driver_s *dev); -static int stm32_ifdown(struct net_driver_s *dev); -static inline void stm32_txavail_process(struct stm32_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void stm32_txavail_work(void *arg); -#endif static int stm32_txavail(struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int stm32_addmac(struct net_driver_s *dev, const uint8_t *mac); #endif @@ -2084,27 +2063,33 @@ static void stm32_txdone(struct stm32_ethmac_s *priv) } /**************************************************************************** - * Function: stm32_interrupt_process + * Function: stm32_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void stm32_interrupt_process(struct stm32_ethmac_s *priv) +static void stm32_interrupt_work(void *arg) { + struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; uint32_t dmasr; + DEBUGASSERT(priv); + + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ dmasr = stm32_getreg(STM32_ETH_DMASR); @@ -2175,44 +2160,13 @@ static inline void stm32_interrupt_process(struct stm32_ethmac_s *priv) stm32_putreg(ETH_DMAINT_AIS, STM32_ETH_DMASR); } #endif -} - -/**************************************************************************** - * Function: stm32_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_interrupt_work(void *arg) -{ - struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; - net_lock_t state; - - DEBUGASSERT(priv); - /* Process pending Ethernet interrupts */ - - state = net_lock(); - stm32_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts at the NVIC */ up_enable_irq(STM32_IRQ_ETH); } -#endif /**************************************************************************** * Function: stm32_interrupt @@ -2234,8 +2188,6 @@ static void stm32_interrupt_work(void *arg) static int stm32_interrupt(int irq, void *context) { struct stm32_ethmac_s *priv = &g_stm32ethmac[0]; - -#ifdef CONFIG_NET_NOINTS uint32_t dmasr; /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ @@ -2271,49 +2223,9 @@ static int stm32_interrupt(int irq, void *context) work_queue(ETHWORK, &priv->work, stm32_interrupt_work, priv, 0); } -#else - /* Process the interrupt now */ - - stm32_interrupt_process(priv); -#endif - return OK; } -/**************************************************************************** - * Function: stm32_txtimeout_process - * - * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. - * - * Parameters: - * priv - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static inline void stm32_txtimeout_process(struct stm32_ethmac_s *priv) -{ - /* Then reset the hardware. Just take the interface down, then back - * up again. - */ - - stm32_ifdown(&priv->dev); - stm32_ifup(&priv->dev); - - /* Then poll for new XMIT data */ - - stm32_dopoll(priv); -} - /**************************************************************************** * Function: stm32_txtimeout_work * @@ -2331,19 +2243,21 @@ static inline void stm32_txtimeout_process(struct stm32_ethmac_s *priv) * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void stm32_txtimeout_work(void *arg) { struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; - net_lock_t state; - /* Process pending Ethernet interrupts */ + /* Reset the hardware. Just take the interface down, then back up again. */ - state = net_lock(); - stm32_txtimeout_process(priv); - net_unlock(state); + net_lock(); + stm32_ifdown(&priv->dev); + stm32_ifup(&priv->dev); + + /* Then poll for new XMIT data */ + + stm32_dopoll(priv); + net_unlock(); } -#endif /**************************************************************************** * Function: stm32_txtimeout_expiry @@ -2370,7 +2284,6 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...) nerr("ERROR: Timeout!\n"); -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2389,33 +2302,28 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, stm32_txtimeout_work, priv, 0); - -#else - /* Process the timeout now */ - - stm32_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: stm32_poll_process + * Function: stm32_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void stm32_poll_process(struct stm32_ethmac_s *priv) +static void stm32_poll_work(void *arg) { + struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; struct net_driver_s *dev = &priv->dev; /* Check if the next TX descriptor is owned by the Ethernet DMA or CPU. We @@ -2429,6 +2337,7 @@ static inline void stm32_poll_process(struct stm32_ethmac_s *priv) * CONFIG_STM32F7_ETH_NTXDESC). */ + net_lock(); if ((priv->txhead->tdes0 & ETH_TDES0_OWN) == 0 && priv->txhead->tdes2 == 0) { @@ -2464,39 +2373,9 @@ static inline void stm32_poll_process(struct stm32_ethmac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + net_unlock(); } -/**************************************************************************** - * Function: stm32_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_poll_work(void *arg) -{ - struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - stm32_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: stm32_poll_expiry * @@ -2519,7 +2398,6 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) { struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2538,12 +2416,6 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, (uint32_t)priv); } - -#else - /* Process the interrupt now */ - - stm32_poll_process(priv); -#endif } /**************************************************************************** @@ -2649,28 +2521,31 @@ static int stm32_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: stm32_txavail_process + * Function: stm32_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * priv - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void stm32_txavail_process(struct stm32_ethmac_s *priv) +static void stm32_txavail_work(void *arg) { + struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ @@ -2678,39 +2553,9 @@ static inline void stm32_txavail_process(struct stm32_ethmac_s *priv) stm32_dopoll(priv); } + net_unlock(); } -/**************************************************************************** - * Function: stm32_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void stm32_txavail_work(void *arg) -{ - struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - stm32_txavail_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: stm32_txavail * @@ -2734,7 +2579,6 @@ static int stm32_txavail(struct net_driver_s *dev) { struct stm32_ethmac_s *priv = (struct stm32_ethmac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2747,21 +2591,6 @@ static int stm32_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, stm32_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - stm32_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c b/arch/arm/src/stm32f7/stm32_sdmmc.c index 52e7ef38788399803d7fa4456df62680002f90b7..2df98c10a94d9ae44d1b25bb7f8fb4435406af48 100644 --- a/arch/arm/src/stm32f7/stm32_sdmmc.c +++ b/arch/arm/src/stm32f7/stm32_sdmmc.c @@ -154,7 +154,16 @@ /* Friendly CLKCR bit re-definitions ****************************************/ #define STM32_CLKCR_RISINGEDGE (0) -#define STM32_CLKCR_FALLINGEDGE STM32_CLKCR_NEGEDGE +#define STM32_CLKCR_FALLINGEDGE STM32_SDMMC_CLKCR_NEGEDGE + +/* Use the default of the rising edge but allow a configuration, + * that does not have the errata, to override the edge the SDIO + * command and data is changed on. + */ + +#if !defined(STM32_SDMMC_CLKCR_EDGE) +# define STM32_SDMMC_CLKCR_EDGE STM32_CLKCR_RISINGEDGE +#endif /* Mode dependent settings. These depend on clock divisor settings that must * be defined in the board-specific board.h header file: STM32_SDMMC_INIT_CLKDIV, @@ -162,16 +171,16 @@ */ #define STM32_CLCKCR_INIT (STM32_SDMMC_INIT_CLKDIV | \ - STM32_CLKCR_RISINGEDGE | \ + STM32_SDMMC_CLKCR_EDGE | \ STM32_SDMMC_CLKCR_WIDBUS_D1) #define STM32_SDMMC_CLKCR_MMCXFR (STM32_SDMMC_MMCXFR_CLKDIV | \ - STM32_CLKCR_RISINGEDGE | \ + STM32_SDMMC_CLKCR_EDGE | \ STM32_SDMMC_CLKCR_WIDBUS_D1) #define STM32_SDMMC_CLCKR_SDXFR (STM32_SDMMC_SDXFR_CLKDIV | \ - STM32_CLKCR_RISINGEDGE | \ + STM32_SDMMC_CLKCR_EDGE | \ STM32_SDMMC_CLKCR_WIDBUS_D1) #define STM32_SDMMC_CLCKR_SDWIDEXFR (STM32_SDMMC_SDXFR_CLKDIV | \ - STM32_CLKCR_RISINGEDGE | \ + STM32_SDMMC_CLKCR_EDGE | \ STM32_SDMMC_CLKCR_WIDBUS_D4) /* Timing */ diff --git a/arch/arm/src/stm32l4/Kconfig b/arch/arm/src/stm32l4/Kconfig index 6995a514218d4850a7445559bfac052ce219dda0..9f8d6cbda11e3fb3157e1f0b13e4ff536bf1d1cc 100644 --- a/arch/arm/src/stm32l4/Kconfig +++ b/arch/arm/src/stm32l4/Kconfig @@ -44,6 +44,8 @@ config STM32L4_STM32L476XX select ARCH_HAVE_DPFPU # REVISIT select ARMV7M_HAVE_ITCM select ARMV7M_HAVE_DTCM + select STM32L4_HAVE_USART1 + select STM32L4_HAVE_USART2 select STM32L4_HAVE_USART3 select STM32L4_HAVE_UART4 select STM32L4_HAVE_UART5 @@ -55,6 +57,8 @@ config STM32L4_STM32L486XX select ARCH_HAVE_DPFPU # REVISIT select ARMV7M_HAVE_ITCM select ARMV7M_HAVE_DTCM + select STM32L4_HAVE_USART1 + select STM32L4_HAVE_USART2 select STM32L4_HAVE_USART3 select STM32L4_HAVE_UART4 select STM32L4_HAVE_UART5 @@ -408,15 +412,17 @@ config STM32L4_SPI3 config STM32L4_USART1 bool "USART1" default n - select USART1_SERIALDRIVER + depends on STM32L4_HAVE_USART1 select ARCH_HAVE_SERIAL_TERMIOS + select USART1_SERIALDRIVER select STM32L4_USART config STM32L4_USART2 bool "USART2" default n - select USART2_SERIALDRIVER + depends on STM32L4_HAVE_USART2 select ARCH_HAVE_SERIAL_TERMIOS + select USART2_SERIALDRIVER select STM32L4_USART config STM32L4_USART3 @@ -2517,6 +2523,14 @@ config STM32L4_DAC_DMA_BUFFER_SIZE endmenu +config STM32L4_HAVE_USART1 + bool + default n + +config STM32L4_HAVE_USART2 + bool + default n + config STM32L4_HAVE_USART3 bool default n diff --git a/arch/arm/src/stm32l4/chip/stm32l4x6xx_rcc.h b/arch/arm/src/stm32l4/chip/stm32l4x6xx_rcc.h index 0b184230b4b688ff851e991f90d605eb4f69d859..c56e59c81168e63f6b219600d87b69d4cc0aa81d 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4x6xx_rcc.h +++ b/arch/arm/src/stm32l4/chip/stm32l4x6xx_rcc.h @@ -381,6 +381,7 @@ /* AHB2 peripheral reset register */ +#define RCC_AHB1ENR_GPIOEN(port) (1 << port) #define RCC_AHB2RSTR_GPIOARST (1 << 0) /* Bit 0: IO port A reset */ #define RCC_AHB2RSTR_GPIOBRST (1 << 1) /* Bit 1: IO port B reset */ #define RCC_AHB2RSTR_GPIOCRST (1 << 2) /* Bit 2: IO port C reset */ diff --git a/arch/arm/src/stm32l4/stm32l4_dumpgpio.c b/arch/arm/src/stm32l4/stm32l4_dumpgpio.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c0eabb206c99c5f5d814b1293116b333a31077a5 100644 --- a/arch/arm/src/stm32l4/stm32l4_dumpgpio.c +++ b/arch/arm/src/stm32l4/stm32l4_dumpgpio.c @@ -0,0 +1,153 @@ +/**************************************************************************** + * arch/arm/src/stm32l4/stm32l4_dumpgpio.c + * + * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. + * Author: Sebastien Lorquet + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +/* Output debug info even if debug output is not selected. */ + +#undef CONFIG_DEBUG_INFO +#define CONFIG_DEBUG_INFO 1 + +#include +#include + +#include + +#include "up_arch.h" +#include "chip.h" +#include "stm32l4_gpio.h" +#include "stm32l4_rcc.h" + +#ifdef CONFIG_DEBUG_FEATURES + +/**************************************************************************** + * Private Data + ****************************************************************************/ +/* Port letters for prettier debug output */ + +static const char g_portchar[STM32L4_NPORTS] = +{ +#if STM32L4_NPORTS > 11 +# error "Additional support required for this number of GPIOs" +#elif STM32L4_NPORTS > 10 + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K' +#elif STM32L4_NPORTS > 9 + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' +#elif STM32L4_NPORTS > 8 + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I' +#elif STM32L4_NPORTS > 7 + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' +#elif STM32L4_NPORTS > 6 + 'A', 'B', 'C', 'D', 'E', 'F', 'G' +#elif STM32L4_NPORTS > 5 + 'A', 'B', 'C', 'D', 'E', 'F' +#elif STM32L4_NPORTS > 4 + 'A', 'B', 'C', 'D', 'E' +#elif STM32L4_NPORTS > 3 + 'A', 'B', 'C', 'D' +#elif STM32L4_NPORTS > 2 + 'A', 'B', 'C' +#elif STM32L4_NPORTS > 1 + 'A', 'B' +#elif STM32L4_NPORTS > 0 + 'A' +#else +# error "Bad number of GPIOs" +#endif +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: stm32l4_dumpgpio + * + * Description: + * Dump all GPIO registers associated with the provided base address + * + ****************************************************************************/ + +int stm32l4_dumpgpio(uint32_t pinset, const char *msg) +{ + irqstate_t flags; + uint32_t base; + unsigned int port; + + /* Get the base address associated with the GPIO port */ + + port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; + base = g_gpiobase[port]; + + /* The following requires exclusive access to the GPIO registers */ + + flags = enter_critical_section(); + + DEBUGASSERT(port < STM32L4_NPORTS); + + _info("GPIO%c pinset: %08x base: %08x -- %s\n", + g_portchar[port], pinset, base, msg); + + if ((getreg32(STM32L4_RCC_AHB1ENR) & RCC_AHB1ENR_GPIOEN(port)) != 0) + { + _info(" MODE: %08x OTYPE: %04x OSPEED: %08x PUPDR: %08x\n", + getreg32(base + STM32L4_GPIO_MODER_OFFSET), + getreg32(base + STM32L4_GPIO_OTYPER_OFFSET), + getreg32(base + STM32L4_GPIO_OSPEED_OFFSET), + getreg32(base + STM32L4_GPIO_PUPDR_OFFSET)); + _info(" IDR: %04x ODR: %04x BSRR: %08x LCKR: %04x\n", + getreg32(base + STM32L4_GPIO_IDR_OFFSET), + getreg32(base + STM32L4_GPIO_ODR_OFFSET), + getreg32(base + STM32L4_GPIO_BSRR_OFFSET), + getreg32(base + STM32L4_GPIO_LCKR_OFFSET)); + _info(" AFRH: %08x AFRL: %08x\n", + getreg32(base + STM32L4_GPIO_AFRH_OFFSET), + getreg32(base + STM32L4_GPIO_AFRL_OFFSET)); + } + else + { + _info(" GPIO%c not enabled: AHB1ENR: %08x\n", + g_portchar[port], getreg32(STM32L4_RCC_AHB1ENR)); + } + + leave_critical_section(flags); + return OK; +} + +#endif /* CONFIG_DEBUG_FEATURES */ diff --git a/arch/arm/src/stm32l4/stm32l4_serial.c b/arch/arm/src/stm32l4/stm32l4_serial.c index 8e4b8d3bee9a27de082c0f831c036c16fbac8e87..dfef76a9b104216298ab2aab03e407c53f34b43b 100644 --- a/arch/arm/src/stm32l4/stm32l4_serial.c +++ b/arch/arm/src/stm32l4/stm32l4_serial.c @@ -731,7 +731,7 @@ static struct stm32l4_serial_s g_uart5priv = /* This table lets us iterate over the configured USARTs */ -FAR static struct stm32l4_serial_s * const uart_devs[STM32L4_NUSART] = +FAR static struct stm32l4_serial_s * const uart_devs[STM32L4_NUSART+STM32L4_NUART] = { #ifdef CONFIG_STM32L4_USART1 [0] = &g_usart1priv, @@ -2407,7 +2407,7 @@ void up_earlyserialinit(void) /* Disable all USART interrupts */ - for (i = 0; i < STM32L4_NUSART; i++) + for (i = 0; i < STM32L4_NUSART+STM32L4_NUART; i++) { if (uart_devs[i]) { @@ -2476,7 +2476,7 @@ void up_serialinit(void) strcpy(devname, "/dev/ttySx"); - for (i = 0; i < STM32L4_NUSART; i++) + for (i = 0; i < STM32L4_NUSART+STM32L4_NUART; i++) { /* Don't create a device for non-configured ports. */ diff --git a/arch/arm/src/stm32l4/stm32l4_uart.h b/arch/arm/src/stm32l4/stm32l4_uart.h index 24fc9bd31367ad7243dd20cd29f363784c1a58a2..e66302d8e4d7bd7affa36d8a9b5f1326e8de7385 100644 --- a/arch/arm/src/stm32l4/stm32l4_uart.h +++ b/arch/arm/src/stm32l4/stm32l4_uart.h @@ -57,19 +57,19 @@ * device. */ -#if STM32L4_NUSART < 5 || !defined(CONFIG_STM32L4_HAVE_UART5) +#if !defined(CONFIG_STM32L4_HAVE_UART5) # undef CONFIG_STM32L4_UART5 #endif -#if STM32L4_NUSART < 4 || !defined(CONFIG_STM32L4_HAVE_UART4) +#if !defined(CONFIG_STM32L4_HAVE_UART4) # undef CONFIG_STM32L4_UART4 #endif -#if STM32L4_NUSART < 3 || !defined(CONFIG_STM32L4_HAVE_USART3) +#if !defined(CONFIG_STM32L4_HAVE_USART3) # undef CONFIG_STM32L4_USART3 #endif -#if STM32L4_NUSART < 2 +#if !defined(CONFIG_STM32L4_HAVE_USART2) # undef CONFIG_STM32L4_USART2 #endif -#if STM32L4_NUSART < 1 +#if !defined(CONFIG_STM32L4_HAVE_USART1) # undef CONFIG_STM32L4_USART1 #endif diff --git a/arch/arm/src/tiva/Kconfig b/arch/arm/src/tiva/Kconfig index 78a7ae07f170d9c1ec6a16fa85939521a41f0021..fb82d1fb5a3b0b8b89f1a4b46554d4c276e3d850 100644 --- a/arch/arm/src/tiva/Kconfig +++ b/arch/arm/src/tiva/Kconfig @@ -911,6 +911,26 @@ config TIVA_BADCRC ---help--- Set to enable bad CRC rejection. +choice + prompt "Work queue" + default LM3S_ETHERNET_LPWORK if SCHED_LPWORK + default LM3S_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config LM3S_ETHERNET_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config LM3S_ETHERNET_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + config TIVA_DUMPPACKET bool "Dump Packets" default n @@ -1119,6 +1139,7 @@ config TIVA_ETHERNET_LPWORK depends on SCHED_LPWORK endchoice # Work queue + config TIVA_ETHERNET_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/tiva/chip/tiva_pwm.h b/arch/arm/src/tiva/chip/tiva_pwm.h index f0af47a66965b78d25ac266a474a265b3f0bf33d..05e2302f3595db740af4f645dfb718c3a1d6bc0b 100644 --- a/arch/arm/src/tiva/chip/tiva_pwm.h +++ b/arch/arm/src/tiva/chip/tiva_pwm.h @@ -107,6 +107,23 @@ #define CC_PWMDIV_64 (0x5) /* (Value) Divided by 64 */ #define TIVA_PWMn_CTL_ENABLE (0) /* (Bit) PWM Block Enable */ +#define CTL_DISABLE (0) /* (Value) Disable */ #define CTL_ENABLE (1) /* (Value) Enable */ +#define INTEN_GEN3 (3) /* (Bit) Enable PWM GEN3 Interrupt */ +#define INTEN_GEN2 (2) /* (Bit) Enable PWM GEN2 Interrupt */ +#define INTEN_GEN1 (1) /* (Bit) Enable PWM GEN1 Interrupt */ +#define INTEN_GEN0 (0) /* (Bit) Enable PWM GEN0 Interrupt */ +#define INT_DISABLE (0) /* (Value) Disable */ +#define INT_ENABLE (1) /* (Value) Enable */ + +#define INTCMPBD (5) /* (Bit) Interrupt for Counter=PWMnCMPB Down */ +#define INTCMPBU (4) /* (Bit) Interrupt for Counter=PWMnCMPB Up */ +#define INTCMPAD (3) /* (Bit) Interrupt for Counter=PWMnCMPA Down */ +#define INTCMPAU (2) /* (Bit) Interrupt for Counter=PWMnCMPA Up */ +#define INTCNTLOAD (1) /* (Bit) Interrupt for Counter=PWMnLOAD */ +#define INTCNTZERO (0) /* (Bit) Interrupt for Counter=0 */ +#define INT_CLR (0) /* (Value) Bit Clear */ +#define INT_SET (1) /* (Value) Bit Set */ + #endif /* __ARCH_ARM_SRC_TIVA_CHIP_TIVA_PWM_H */ diff --git a/arch/arm/src/tiva/lm3s_ethernet.c b/arch/arm/src/tiva/lm3s_ethernet.c index cbdf0dac530efab025bb515f37701b6783785241..bfe8f2669d9c2ee63687dfe55c078d723c4967f5 100644 --- a/arch/arm/src/tiva/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm3s_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/tiva/lm3s_ethernet.c * - * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,8 @@ #include #include #include +#include + #include #include #include @@ -71,6 +73,25 @@ * Pre-processor Definitions ****************************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_LM3S_ETHERNET_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_LM3S_ETHERNET_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_LM3S_ETHERNET_HPWORK nor CONFIG_LM3S_ETHERNET_LPWORK defined +# endif +#endif + /* Half duplex can be forced if CONFIG_TIVA_ETHHDUPLEX is defined. */ #ifdef CONFIG_TIVA_ETHHDUPLEX @@ -181,6 +202,7 @@ struct tiva_driver_s bool ld_bifup; /* true:ifup false:ifdown */ WDOG_ID ld_txpoll; /* TX poll timer */ WDOG_ID ld_txtimeout; /* TX timeout timer */ + struct work_s ld_work; /* For deferring work to the work queue */ /* This holds the information visible to the NuttX network */ @@ -191,11 +213,9 @@ struct tiva_driver_s * Private Data ****************************************************************************/ -#ifdef CONFIG_NET_MULTIBUFFER /* A single packet buffer is used */ static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /* Ethernet peripheral state */ @@ -229,21 +249,29 @@ static int tiva_txpoll(struct net_driver_s *dev); static void tiva_receive(struct tiva_driver_s *priv); static void tiva_txdone(struct tiva_driver_s *priv); -static int tiva_interrupt(int irq, FAR void *context); + +static void tiva_interrupt_work(void *arg); +static int tiva_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void tiva_polltimer(int argc, uint32_t arg, ...); -static void tiva_txtimeout(int argc, uint32_t arg, ...); +static void tiva_txtimeout_work(void *arg); +static void tiva_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void tiva_poll_work(void *arg); +static void tiva_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int tiva_ifup(struct net_driver_s *dev); static int tiva_ifdown(struct net_driver_s *dev); + +static void tiva_txavail_work(void *arg); static int tiva_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP -static int tiva_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); -static int tiva_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); +static int tiva_addmac(struct net_driver_s *dev, const uint8_t *mac); +static int tiva_rmmac(struct net_driver_s *dev, const uint8_t *mac); #endif /**************************************************************************** @@ -549,7 +577,8 @@ static int tiva_transmit(struct tiva_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->ld_txtimeout, TIVA_TXTIMEOUT, tiva_txtimeout, 1, (uint32_t)priv); + (void)wd_start(priv->ld_txtimeout, TIVA_TXTIMEOUT, + tiva_txtimeout_expiry, 1, (uint32_t)priv); ret = OK; } @@ -915,32 +944,30 @@ static void tiva_txdone(struct tiva_driver_s *priv) } /**************************************************************************** - * Function: tiva_interrupt + * Function: tiva_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static int tiva_interrupt(int irq, FAR void *context) +static void tiva_interrupt_work(void *arg) { - register struct tiva_driver_s *priv; + struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; uint32_t ris; -#if TIVA_NETHCONTROLLERS > 1 -# error "A mechanism to associate and interface with an IRQ is needed" -#else - priv = &g_lm3sdev[0]; -#endif + /* Process pending Ethernet interrupts */ + + net_lock(); /* Read the raw interrupt status register */ @@ -997,37 +1024,109 @@ static int tiva_interrupt(int irq, FAR void *context) tiva_txdone(priv); } - /* Enable Ethernet interrupts (perhaps excluding the TX done interrupt if - * there are no pending transmissions). + net_unlock(); + + /* Re-enable Ethernet interrupts */ + +#if TIVA_NETHCONTROLLERS > 1 + up_disable_irq(priv->irq); +#else + up_disable_irq(TIVA_IRQ_ETHCON); +#endif +} + +/**************************************************************************** + * Function: tiva_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int tiva_interrupt(int irq, void *context) +{ + struct tiva_driver_s *priv; + uint32_t ris; + +#if TIVA_NETHCONTROLLERS > 1 +# error "A mechanism to associate and interface with an IRQ is needed" +#else + priv = &g_lm3sdev[0]; +#endif + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. */ +#if TIVA_NETHCONTROLLERS > 1 + up_disable_irq(priv->irq); +#else + up_disable_irq(TIVA_IRQ_ETHCON); +#endif + + /* Read the raw interrupt status register (masking out any disabled + * interrupts). + */ + + ris = tiva_ethin(priv, TIVA_MAC_RIS_OFFSET); + ris &= tiva_ethin(priv, TIVA_MAC_IM_OFFSET); + + /* Is this an Tx interrupt (meaning that the Tx FIFO is empty)? */ + + if ((ris & MAC_RIS_TXEMP) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be do race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->ld_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->ld_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->ld_work, tiva_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: tiva_txtimeout + * Function: tiva_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static void tiva_txtimeout(int argc, uint32_t arg, ...) +static void tiva_txtimeout_work(void *arg) { struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; /* Increment statistics */ + net_lock(); nerr("ERROR: Tx timeout\n"); NETDEV_TXTIMEOUTS(&priv->ld_dev); @@ -1040,13 +1139,15 @@ static void tiva_txtimeout(int argc, uint32_t arg, ...) /* Then poll the network for new XMIT data */ (void)devif_poll(&priv->ld_dev, tiva_txpoll); + net_unlock(); } /**************************************************************************** - * Function: tiva_polltimer + * Function: tiva_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1056,10 +1157,54 @@ static void tiva_txtimeout(int argc, uint32_t arg, ...) * None * * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void tiva_txtimeout_expiry(int argc, wdparm_t arg, ...) +{ + struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + +#if TIVA_NETHCONTROLLERS > 1 + up_disable_irq(priv->irq); +#else + up_disable_irq(TIVA_IRQ_ETHCON); +#endif + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->ld_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->ld_work, tiva_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: tiva_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. * ****************************************************************************/ -static void tiva_polltimer(int argc, uint32_t arg, ...) +static void tiva_poll_work(void *arg) { struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; @@ -1071,15 +1216,63 @@ static void tiva_polltimer(int argc, uint32_t arg, ...) * inaccuracies. */ + net_lock(); if ((tiva_ethin(priv, TIVA_MAC_TR_OFFSET) & MAC_TR_NEWTX) == 0) { - /* If so, update TCP timing states and poll the network for new XMIT data */ + /* If so, update TCP timing states and poll the network for new XMIT + * data. + */ (void)devif_timer(&priv->ld_dev, tiva_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_polltimer, 1, arg); + (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, + 1, priv); + } + + net_unlock(); +} + +/**************************************************************************** + * Function: tiva_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void tiva_poll_expiry(int argc, wdparm_t arg, ...) +{ + struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->ld_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->ld_work, tiva_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, 1, arg); } } @@ -1232,7 +1425,7 @@ static int tiva_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_polltimer, 1, (uint32_t)priv); + (void)wd_start(priv->ld_txpoll, TIVA_WDDELAY, tiva_poll_expiry, 1, (uint32_t)priv); priv->ld_bifup = true; leave_critical_section(flags); @@ -1323,28 +1516,25 @@ static int tiva_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: tiva_txavail + * Function: tiva_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int tiva_txavail(struct net_driver_s *dev) +static void tiva_txavail_work(void *arg) { - struct tiva_driver_s *priv = (struct tiva_driver_s *)dev->d_private; - irqstate_t flags; + struct tiva_driver_s *priv = (struct tiva_driver_s *)arg; /* Ignore the notification if the interface is not yet up or if the Tx FIFO * hardware is not available at this time. The NEWTX bit initiates an @@ -1354,7 +1544,7 @@ static int tiva_txavail(struct net_driver_s *dev) * will occur at that time. */ - flags = enter_critical_section(); + net_lock(); if (priv->ld_bifup && (tiva_ethin(priv, TIVA_MAC_TR_OFFSET) & MAC_TR_NEWTX) == 0) { /* If the interface is up and we can use the Tx FIFO, then poll the network @@ -1364,7 +1554,44 @@ static int tiva_txavail(struct net_driver_s *dev) (void)devif_poll(&priv->ld_dev, tiva_txpoll); } - leave_critical_section(flags); + net_unlock(); +} + +/**************************************************************************** + * Function: tiva_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int tiva_txavail(struct net_driver_s *dev) +{ + struct tiva_driver_s *priv = (struct tiva_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->ld_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->ld_work, tiva_txavail_work, priv, 0); + } + return OK; } @@ -1387,9 +1614,9 @@ static int tiva_txavail(struct net_driver_s *dev) ****************************************************************************/ #ifdef CONFIG_NET_IGMP -static int tiva_addmac(struct net_driver_s *dev, FAR const uint8_t *mac) +static int tiva_addmac(struct net_driver_s *dev, const uint8_t *mac) { - FAR struct tiva_driver_s *priv = (FAR struct tiva_driver_s *)dev->d_private; + struct tiva_driver_s *priv = (struct tiva_driver_s *)dev->d_private; /* Add the MAC address to the hardware multicast routing table */ @@ -1417,9 +1644,9 @@ static int tiva_addmac(struct net_driver_s *dev, FAR const uint8_t *mac) ****************************************************************************/ #ifdef CONFIG_NET_IGMP -static int tiva_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) +static int tiva_rmmac(struct net_driver_s *dev, const uint8_t *mac) { - FAR struct tiva_driver_s *priv = (FAR struct tiva_driver_s *)dev->d_private; + struct tiva_driver_s *priv = (struct tiva_driver_s *)dev->d_private; /* Add the MAC address to the hardware multicast routing table */ @@ -1472,9 +1699,7 @@ static inline int tiva_ethinitialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct tiva_driver_s)); -#ifdef CONFIG_NET_MULTIBUFFER priv->ld_dev.d_buf = g_pktbuf; /* Single packet buffer */ -#endif priv->ld_dev.d_ifup = tiva_ifup; /* I/F down callback */ priv->ld_dev.d_ifdown = tiva_ifdown; /* I/F up (new IP address) callback */ priv->ld_dev.d_txavail = tiva_txavail; /* New TX data callback */ diff --git a/arch/arm/src/tiva/tiva_pwm.c b/arch/arm/src/tiva/tiva_pwm.c index b5032aeb21dfb73c8130edcdd60ff6a8f5b1e3f8..73b86349b330ca4026095a23edb604b6c95e317b 100644 --- a/arch/arm/src/tiva/tiva_pwm.c +++ b/arch/arm/src/tiva/tiva_pwm.c @@ -85,21 +85,57 @@ struct tiva_pwm_chan_s uint8_t generator_id; uintptr_t generator_base; uint8_t channel_id; +#ifdef CONFIG_PWM_PULSECOUNT + bool inited; + uint8_t irq; + uint32_t count; + uint32_t cur_count; + FAR void *handle; +#endif }; /************************************************************************************ * Private Function Prototypes ************************************************************************************/ +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN0) +static int tiva_pwm_gen0_interrupt(int irq, FAR void *context); +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN2) +static int tiva_pwm_gen1_interrupt(int irq, FAR void *context); +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN4) +static int tiva_pwm_gen2_interrupt(int irq, FAR void *context); +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN6) +static int tiva_pwm_gen3_interrupt(int irq, FAR void *context); +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && \ + (defined(CONFIG_TIVA_PWM0_CHAN0) || defined(CONFIG_TIVA_PWM0_CHAN2) || \ + defined(CONFIG_TIVA_PWM0_CHAN4) || defined(CONFIG_TIVA_PWM0_CHAN6)) +static int tiva_pwm_interrupt(struct tiva_pwm_chan_s *chan); +#endif + static inline void tiva_pwm_putreg(struct tiva_pwm_chan_s *chan, unsigned int offset, uint32_t regval); static inline uint32_t tiva_pwm_getreg(struct tiva_pwm_chan_s *chan, unsigned int offset); +static inline int tiva_pwm_timer(FAR struct tiva_pwm_chan_s *chan, + FAR const struct pwm_info_s *info); static int tiva_pwm_setup(FAR struct pwm_lowerhalf_s *dev); static int tiva_pwm_shutdown(FAR struct pwm_lowerhalf_s *dev); +#ifdef CONFIG_PWM_PULSECOUNT +static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, + FAR const struct pwm_info_s *info, FAR void *handle); +#else static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, FAR const struct pwm_info_s *info); +#endif static int tiva_pwm_stop(FAR struct pwm_lowerhalf_s *dev); static int tiva_pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, int cmd, unsigned long arg); @@ -108,7 +144,7 @@ static int tiva_pwm_ioctl(FAR struct pwm_lowerhalf_s *dev, * Private Data ************************************************************************************/ -static uint32_t g_pwm_freq = 15000000; +static uint32_t g_pwm_freq = 1875000; static uint32_t g_pwm_counter = (1 << 16); static const struct pwm_ops_s g_pwm_ops = @@ -129,6 +165,13 @@ static struct tiva_pwm_chan_s g_pwm_chan0 = .generator_id = 0, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 0, .channel_id = 0, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN0, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -141,6 +184,13 @@ static struct tiva_pwm_chan_s g_pwm_chan1 = .generator_id = 0, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 0, .channel_id = 1, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN0, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -153,6 +203,13 @@ static struct tiva_pwm_chan_s g_pwm_chan2 = .generator_id = 1, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 1, .channel_id = 2, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN1, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -165,6 +222,13 @@ static struct tiva_pwm_chan_s g_pwm_chan3 = .generator_id = 1, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 1, .channel_id = 3, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN1, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -177,6 +241,13 @@ static struct tiva_pwm_chan_s g_pwm_chan4 = .generator_id = 2, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 2, .channel_id = 4, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN2, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -189,6 +260,13 @@ static struct tiva_pwm_chan_s g_pwm_chan5 = .generator_id = 2, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 2, .channel_id = 5, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN2, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -198,9 +276,16 @@ static struct tiva_pwm_chan_s g_pwm_chan6 = .ops = &g_pwm_ops, .controller_id = 0, .controller_base = TIVA_PWM0_BASE, - .generator_id = 3, + .generator_id = 3, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 3, .channel_id = 6, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN3, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -213,6 +298,13 @@ static struct tiva_pwm_chan_s g_pwm_chan7 = .generator_id = 3, .generator_base = TIVA_PWM0_BASE + TIVA_PWMn_BASE + TIVA_PWMn_INTERVAL * 3, .channel_id = 7, +#ifdef CONFIG_PWM_PULSECOUNT + .inited = false, + .irq = TIVA_IRQ_PWM0_GEN3, + .count = 0, + .cur_count = 0, + .handle = NULL, +#endif }; #endif @@ -220,6 +312,76 @@ static struct tiva_pwm_chan_s g_pwm_chan7 = * Private Functions ************************************************************************************/ +/************************************************************************************ + * Name: tiva_pwm_gen[n]_interrupt + * + * Description: + * Pulse count interrupt handlers for PWM[n] + * + ************************************************************************************/ + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN0) +static int tiva_pwm_gen0_interrupt(int irq, FAR void *context) +{ + return tiva_pwm_interrupt(&g_pwm_chan0); +} +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN2) +static int tiva_pwm_gen1_interrupt(int irq, FAR void *context) +{ + return tiva_pwm_interrupt(&g_pwm_chan2); +} +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN4) +static int tiva_pwm_gen2_interrupt(int irq, FAR void *context) +{ + return tiva_pwm_interrupt(&g_pwm_chan4); +} +#endif + +#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_TIVA_PWM0_CHAN6) +static int tiva_pwm_gen3_interrupt(int irq, FAR void *context) +{ + return tiva_pwm_interrupt(&g_pwm_chan6); +} +#endif + +/************************************************************************************ + * Name: tiva_pwm_interrupt + * + * Description: + * Common pulse count interrupt handler. + * + ************************************************************************************/ + +#if defined(CONFIG_PWM_PULSECOUNT) && \ + (defined(CONFIG_TIVA_PWM0_CHAN0) || defined(CONFIG_TIVA_PWM0_CHAN2) || \ + defined(CONFIG_TIVA_PWM0_CHAN4) || defined(CONFIG_TIVA_PWM0_CHAN6)) +static int tiva_pwm_interrupt(struct tiva_pwm_chan_s *chan) +{ + /* Clear interrupt */ + + tiva_pwm_putreg(chan, TIVA_PWMn_ISC_OFFSET, INT_SET << INTCMPAD); + + /* Count down current pulse count */ + + chan->cur_count--; + + /* Disable PWM generator and reload current pulse count */ + + if (chan->cur_count == 0) + { + tiva_pwm_putreg(chan, TIVA_PWMn_CTL_OFFSET, CTL_DISABLE << TIVA_PWMn_CTL_ENABLE); + chan->cur_count = chan->count; + pwm_expired(chan->handle); + } + + return 0; +} +#endif + /************************************************************************************ * Name: tiva_pwm_getreg * @@ -251,7 +413,7 @@ static inline void tiva_pwm_putreg(struct tiva_pwm_chan_s *chan, } /**************************************************************************** - * Name: pwm_setup + * Name: tiva_pwm_setup * * Description: * This method is called when the driver is opened. The lower half driver @@ -288,7 +450,7 @@ static int tiva_pwm_setup(FAR struct pwm_lowerhalf_s *dev) } /**************************************************************************** - * Name: pwm_shutdown + * Name: tiva_pwm_shutdown * * Description: * This method is called when the driver is closed. The lower half driver @@ -320,7 +482,7 @@ static int tiva_pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) } /**************************************************************************** - * Name: pwm_start + * Name: tiva_pwm_start * * Description: * (Re-)initialize the timer resources and start the pulsed output @@ -328,33 +490,117 @@ static int tiva_pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) * Input parameters: * dev - A reference to the lower half PWM driver state structure * info - A reference to the characteristics of the pulsed output + * handle - This is the handle that was provided to the lower-half + * start() method. * * Returned Value: * Zero on success; a negated errno value on failure * ****************************************************************************/ +#ifdef CONFIG_PWM_PULSECOUNT +static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, + FAR const struct pwm_info_s *info, FAR void *handle) +{ + FAR struct tiva_pwm_chan_s *chan = (FAR struct tiva_pwm_chan_s *)dev; + pwminfo("start PWM for channel %d\n", chan->channel_id); + + /* Save the handle */ + + chan->handle = handle; + + /* Load pulse count and current pulse count + * + * Workaround: + * Count should be add 1 for the first time + */ + + chan->count = info->count; + chan->cur_count = info->count; + + if (!chan->inited) + { + chan->count++; + chan->cur_count++; + chan->inited = true; + } + + /* Count 0 means to generate indefinite number of pulses */ + + if (info->count == 0) + { + pwm_expired(chan->handle); + + /* Disable interrupt */ + + uint32_t enable = getreg32(chan->controller_base + TIVA_PWM_INTEN_OFFSET); + enable &= ~(INT_ENABLE << chan->generator_id); + putreg32(enable, chan->controller_base + TIVA_PWM_INTEN_OFFSET); + } + else + { + /* Enable interrupt */ + + uint32_t enable = getreg32(chan->controller_base + TIVA_PWM_INTEN_OFFSET); + enable |= (INT_ENABLE << chan->generator_id); + putreg32(enable, chan->controller_base + TIVA_PWM_INTEN_OFFSET); + } + + /* Start the timer */ + + return tiva_pwm_timer(chan, info); +} +#else static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, FAR const struct pwm_info_s *info) { FAR struct tiva_pwm_chan_s *chan = (FAR struct tiva_pwm_chan_s *)dev; pwminfo("start PWM for channel %d\n", chan->channel_id); + /* Start the timer */ + + return tiva_pwm_timer(chan, info); +} +#endif + +/**************************************************************************** + * Name: tiva_pwm_timer + * + * Description: + * Configure PWM registers and start the PWM timer + * + * Input parameters: + * dev - A reference to the lower half PWM driver state structure + * info - A reference to the characteristics of the pulsed output + * + * Returned Value: + * Zero on success; a negated errno value on failure + * + ****************************************************************************/ + +static inline int tiva_pwm_timer(FAR struct tiva_pwm_chan_s *chan, + FAR const struct pwm_info_s *info) +{ uint16_t duty = info->duty; uint32_t frequency = info->frequency; + pwminfo("> frequency = %d\n", frequency); + pwminfo("> duty = %d\n", duty); + /* Configure PWM countdown mode (refer to TM4C1294NC 23.4.6) */ tiva_pwm_putreg(chan, TIVA_PWMn_CTL_OFFSET, 0); if (chan->channel_id % 2 == 0) { tiva_pwm_putreg(chan, TIVA_PWMn_GENA_OFFSET, - GENx_LOW << TIVA_PWMn_GENx_ACTCMPAD | GENx_HIGH << TIVA_PWMn_GENx_ACTLOAD); + GENx_LOW << TIVA_PWMn_GENx_ACTCMPAD | + GENx_HIGH << TIVA_PWMn_GENx_ACTLOAD); } else { tiva_pwm_putreg(chan, TIVA_PWMn_GENB_OFFSET, - GENx_LOW << TIVA_PWMn_GENx_ACTCMPBD | GENx_HIGH << TIVA_PWMn_GENx_ACTLOAD); + GENx_LOW << TIVA_PWMn_GENx_ACTCMPBD | + GENx_HIGH << TIVA_PWMn_GENx_ACTLOAD); } /* Set the PWM period (refer to TM4C1294NC 23.4.7) */ @@ -363,7 +609,7 @@ static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, uint32_t pwm_max_freq = g_pwm_freq; uint32_t load = (uint32_t)(g_pwm_freq / frequency); - pwminfo("channel %d: load = %u (%08x)\n", chan->channel_id, load, load); + pwminfo("> load = %u (%08x)\n", load, load); if (load >= g_pwm_counter || load < 1) { @@ -383,7 +629,7 @@ static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, uint32_t comp = (uint32_t)((1 - (float)duty / g_pwm_counter) * load); comp = (duty == 0) ? (comp - 1) : (comp); - pwminfo("channel %d: comp = %u (%08x)\n", chan->channel_id, comp, comp); + pwminfo("> comp = %u (%08x)\n", comp, comp); if (chan->channel_id % 2 == 0) { @@ -408,7 +654,7 @@ static int tiva_pwm_start(FAR struct pwm_lowerhalf_s *dev, } /**************************************************************************** - * Name: pwm_stop + * Name: tiva_pwm_stop * * Description: * Stop the pulsed output and reset the timer resources @@ -441,7 +687,7 @@ static int tiva_pwm_stop(FAR struct pwm_lowerhalf_s *dev) } /**************************************************************************** - * Name: pwm_ioctl + * Name: tiva_pwm_ioctl * * Description: * Lower-half logic may support platform-specific ioctl commands @@ -550,11 +796,12 @@ FAR struct pwm_lowerhalf_s *tiva_pwm_initialize(int channel) return NULL; } - pwminfo("channel %d: channel_id=%d, ", channel, chan->channel_id); - pwminfo("controller_id=%d, controller_base=%08x, ", - chan->controller_id, chan->controller_base); - pwminfo("generator_id=%d, generator_base=%08x\n", - chan->generator_id, chan->generator_base); + pwminfo("channel %d:\n", channel); + pwminfo("> channel_id = %d\n", chan->channel_id); + pwminfo("> controller_id = %d\n", chan->controller_id); + pwminfo("> controller_base = %08x\n", chan->controller_base); + pwminfo("> generator_id = %d\n", chan->generator_id); + pwminfo("> generator_base = %08x\n", chan->generator_base); /* Enable PWM controller (refer to TM4C1294NC 23.4.1) */ @@ -564,14 +811,55 @@ FAR struct pwm_lowerhalf_s *tiva_pwm_initialize(int channel) /* Configure PWM Clock Configuration (refer to TM4C1294NC 23.4.5) * - * On TM4C1294NC, configure the PWM clock source as 15MHz (the system - * clock 120MHz divided by 8) + * On TM4C1294NC, configure the PWM clock source as 1.875MHz (the system + * clock 120MHz divided by 64) * * TODO: need an algorithm to choose the best divider and load value combo. */ - putreg32(CC_USEPWM << TIVA_PWM_CC_USEPWM | CC_PWMDIV_8 << TIVA_PWM_CC_PWMDIV, + putreg32(CC_USEPWM << TIVA_PWM_CC_USEPWM | CC_PWMDIV_64 << TIVA_PWM_CC_PWMDIV, chan->controller_base + TIVA_PWM_CC); +#ifdef CONFIG_PWM_PULSECOUNT + + /* Enable interrupt INTCMPAD mode */ + + tiva_pwm_putreg(chan, TIVA_PWMn_INTEN_OFFSET, INT_SET << INTCMPAD); + + /* Attach IRQ handler and enable interrupt*/ + + switch (chan->channel_id) + { +#ifdef CONFIG_TIVA_PWM0_CHAN0 + case 0: + irq_attach(chan->irq, tiva_pwm_gen0_interrupt); + up_enable_irq(chan->irq); + break; +#endif + +#ifdef CONFIG_TIVA_PWM0_CHAN2 + case 2: + irq_attach(chan->irq, tiva_pwm_gen1_interrupt); + up_enable_irq(chan->irq); + break; +#endif + +#ifdef CONFIG_TIVA_PWM0_CHAN4 + case 4: + irq_attach(chan->irq, tiva_pwm_gen2_interrupt); + up_enable_irq(chan->irq); + break; +#endif + +#ifdef CONFIG_TIVA_PWM0_CHAN6 + case 6: + irq_attach(chan->irq, tiva_pwm_gen3_interrupt); + up_enable_irq(chan->irq); + break; +#endif + } + +#endif + return (FAR struct pwm_lowerhalf_s *)chan; } diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 3882a95db334b63b49ab5b7bee7771f45dda6ce7..a04854879d621bc75dcb1c0753e646f0c3bdb212 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -53,11 +53,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -102,13 +98,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#endif +#else -/* Select work queue */ + /* Select work queue */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_TIVA_ETHERNET_HPWORK) # define ETHWORK HPWORK # elif defined(CONFIG_TIVA_ETHERNET_LPWORK) @@ -219,10 +214,6 @@ /* Ethernet buffer sizes, number of buffers, and number of descriptors */ -#ifndef CONFIG_NET_MULTIBUFFER -# error CONFIG_NET_MULTIBUFFER is required -#endif - #ifndef CONFIG_TIVA_EMAC_NRXDESC # define CONFIG_TIVA_EMAC_NRXDESC 8 #endif @@ -635,9 +626,7 @@ struct tiva_ethmac_s uint8_t fduplex : 1; /* Full (vs. half) duplex */ WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif #ifdef CONFIG_TIVA_PHY_INTERRUPTS xcpt_t handler; /* Attached PHY interrupt handler */ #endif @@ -713,35 +702,26 @@ static int tiva_recvframe(FAR struct tiva_ethmac_s *priv); static void tiva_receive(FAR struct tiva_ethmac_s *priv); static void tiva_freeframe(FAR struct tiva_ethmac_s *priv); static void tiva_txdone(FAR struct tiva_ethmac_s *priv); -static inline void tiva_interrupt_process(FAR struct tiva_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void tiva_interrupt_work(FAR void *arg); -#endif static int tiva_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void tiva_txtimeout_process(FAR struct tiva_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void tiva_txtimeout_work(FAR void *arg); -#endif static void tiva_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void tiva_poll_process(FAR struct tiva_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS static void tiva_poll_work(FAR void *arg); -#endif static void tiva_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int tiva_ifup(struct net_driver_s *dev); static int tiva_ifdown(struct net_driver_s *dev); -static inline void tiva_txavail_process(FAR struct tiva_ethmac_s *priv); -#ifdef CONFIG_NET_NOINTS + static void tiva_txavail_work(FAR void *arg); -#endif static int tiva_txavail(struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int tiva_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); #endif @@ -1998,27 +1978,33 @@ static void tiva_txdone(FAR struct tiva_ethmac_s *priv) } /**************************************************************************** - * Function: tiva_interrupt_process + * Function: tiva_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void tiva_interrupt_process(FAR struct tiva_ethmac_s *priv) +static void tiva_interrupt_work(FAR void *arg) { + FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; uint32_t dmaris; + DEBUGASSERT(priv); + + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Get the DMA interrupt status bits (no MAC interrupts are expected) */ dmaris = tiva_getreg(TIVA_EMAC_DMARIS); @@ -2090,44 +2076,13 @@ static inline void tiva_interrupt_process(FAR struct tiva_ethmac_s *priv) tiva_putreg(EMAC_DMAINT_AIS, TIVA_EMAC_DMARIS); } #endif -} - -/**************************************************************************** - * Function: tiva_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void tiva_interrupt_work(FAR void *arg) -{ - FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; - net_lock_t state; - - DEBUGASSERT(priv); - - /* Process pending Ethernet interrupts */ - state = net_lock(); - tiva_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts at the NVIC */ up_enable_irq(TIVA_IRQ_ETHCON); } -#endif /**************************************************************************** * Function: tiva_interrupt @@ -2149,8 +2104,6 @@ static void tiva_interrupt_work(FAR void *arg) static int tiva_interrupt(int irq, FAR void *context) { FAR struct tiva_ethmac_s *priv = &g_tiva_ethmac[0]; - -#ifdef CONFIG_NET_NOINTS uint32_t dmaris; /* Get the raw interrupt status. */ @@ -2186,12 +2139,6 @@ static int tiva_interrupt(int irq, FAR void *context) work_queue(ETHWORK, &priv->work, tiva_interrupt_work, priv, 0); } -#else - /* Process the interrupt now */ - - tiva_interrupt_process(priv); -#endif - #ifdef CONFIG_TIVA_PHY_INTERRUPTS /* Check for pending PHY interrupts */ @@ -2213,38 +2160,6 @@ static int tiva_interrupt(int irq, FAR void *context) return OK; } -/**************************************************************************** - * Function: tiva_txtimeout_process - * - * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. - * - * Parameters: - * priv - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static inline void tiva_txtimeout_process(FAR struct tiva_ethmac_s *priv) -{ - /* Reset the hardware. Just take the interface down, then back up again. */ - - tiva_ifdown(&priv->dev); - tiva_ifup(&priv->dev); - - /* Then poll the network for new XMIT data */ - - tiva_dopoll(priv); -} - /**************************************************************************** * Function: tiva_txtimeout_work * @@ -2262,19 +2177,21 @@ static inline void tiva_txtimeout_process(FAR struct tiva_ethmac_s *priv) * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void tiva_txtimeout_work(FAR void *arg) { FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; - net_lock_t state; - /* Process pending Ethernet interrupts */ + /* Reset the hardware. Just take the interface down, then back up again. */ + + net_lock(); + tiva_ifdown(&priv->dev); + tiva_ifup(&priv->dev); + + /* Then poll the network for new XMIT data */ - state = net_lock(); - tiva_txtimeout_process(priv); - net_unlock(state); + tiva_dopoll(priv); + net_unlock(); } -#endif /**************************************************************************** * Function: tiva_txtimeout_expiry @@ -2301,7 +2218,6 @@ static void tiva_txtimeout_expiry(int argc, uint32_t arg, ...) nerr("ERROR: Timeout!\n"); -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -2320,33 +2236,28 @@ static void tiva_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(ETHWORK, &priv->work, tiva_txtimeout_work, priv, 0); - -#else - /* Process the timeout now */ - - tiva_txtimeout_process(priv); -#endif } /**************************************************************************** - * Function: tiva_poll_process + * Function: tiva_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void tiva_poll_process(FAR struct tiva_ethmac_s *priv) +static void tiva_poll_work(FAR void *arg) { + FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; FAR struct net_driver_s *dev = &priv->dev; /* Check if the next TX descriptor is owned by the Ethernet DMA or CPU. We @@ -2360,6 +2271,7 @@ static inline void tiva_poll_process(FAR struct tiva_ethmac_s *priv) * CONFIG_TIVA_EMAC_NTXDESC). */ + net_lock(); if ((priv->txhead->tdes0 & EMAC_TDES0_OWN) == 0 && priv->txhead->tdes2 == 0) { @@ -2395,39 +2307,9 @@ static inline void tiva_poll_process(FAR struct tiva_ethmac_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, 1, (uint32_t)priv); + net_unlock(); } -/**************************************************************************** - * Function: tiva_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void tiva_poll_work(FAR void *arg) -{ - FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - tiva_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: tiva_poll_expiry * @@ -2450,7 +2332,6 @@ static void tiva_poll_expiry(int argc, uint32_t arg, ...) { FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -2469,12 +2350,6 @@ static void tiva_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, 1, (uint32_t)priv); } - -#else - /* Process the interrupt now */ - - tiva_poll_process(priv); -#endif } /**************************************************************************** @@ -2580,66 +2455,40 @@ static int tiva_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: tiva_txavail_process + * Function: tiva_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * priv - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void tiva_txavail_process(FAR struct tiva_ethmac_s *priv) +static void tiva_txavail_work(FAR void *arg) { + FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; + ninfo("ifup: %d\n", priv->ifup); /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->ifup) { /* Poll the network for new XMIT data */ tiva_dopoll(priv); } -} -/**************************************************************************** - * Function: tiva_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void tiva_txavail_work(FAR void *arg) -{ - FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - tiva_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: tiva_txavail @@ -2664,7 +2513,6 @@ static int tiva_txavail(struct net_driver_s *dev) { FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -2677,21 +2525,6 @@ static int tiva_txavail(struct net_driver_s *dev) work_queue(ETHWORK, &priv->work, tiva_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - tiva_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } diff --git a/arch/avr/src/avr/Kconfig b/arch/avr/src/avr/Kconfig index 496529f32c8a9bffb8b30c1ae6672c397a0b5679..2ddfa4e1949b2170148c83d1b097bcb7fe8f037c 100644 --- a/arch/avr/src/avr/Kconfig +++ b/arch/avr/src/avr/Kconfig @@ -8,13 +8,13 @@ comment "AVR Configuration Options" choice prompt "Toolchain" - default AVR_WINAVR_TOOLCHAIN if HOST_WINDOWS + default AVR_WINAVR_TOOLCHAIN if TOOLCHAIN_WINDOWS default AVR_BUILDROOT_TOOLCHAIN if HOST_LINUX default AVR_CROSSPACK_TOOLCHAIN if HOST_OSX config AVR_WINAVR_TOOLCHAIN bool "WinAVR" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- For Cygwin development environment on Windows machines, you can use WinAVR: http://sourceforge.net/projects/winavr/files/ @@ -29,7 +29,7 @@ config AVR_WINAVR_TOOLCHAIN config AVR_ATMEL_AVR_TOOLCHAIN bool "Atmel AVR Toolchain" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- Atmel provides GNU Toolchain for AVR development. It can be obtained by installing Atmel Studio 6 and later or @@ -55,7 +55,6 @@ config AVR_CROSSPACK_TOOLCHAIN config AVR_BUILDROOT_TOOLCHAIN bool "Buildroot" - depends on HOST_LINUX || HOST_WINDOWS ---help--- There is a DIY buildroot version for the AVR boards here: http://sourceforge.net/projects/nuttx/files/buildroot/. See diff --git a/arch/avr/src/avr32/Kconfig b/arch/avr/src/avr32/Kconfig index 14d5c0f33b48365e846075fe2e1b1c7e31fae657..05a056b6984744d4d63a02e4076519cd7a40f3e5 100644 --- a/arch/avr/src/avr32/Kconfig +++ b/arch/avr/src/avr32/Kconfig @@ -8,12 +8,12 @@ comment "AVR32 Configuration Options" choice prompt "Toolchain" - default AVR32_AVRTOOLSW if HOST_WINDOWS + default AVR32_AVRTOOLSW if TOOLCHAIN_WINDOWS default AVR32_AVRTOOLSL if HOST_LINUX config AVR32_AVRTOOLSW bool "AVR tools for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config AVR32_AVRTOOLSL bool "AVR tools for Linux" diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 4b77c358b232c1542f388790315648feb2e4776f..d816ad1d9f751fae846f8b6bfdfd6d015e157e82 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/common/up_exit.c * - * Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,10 +41,11 @@ #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -140,11 +141,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index 098b8681dbb85489d490828836a2c60c74b4c987..54d9a2c45c22836279bb7375bb3ded12de26da2b 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/common/up_exit.c * - * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,10 +41,11 @@ #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -140,11 +141,11 @@ void _exit(int status) { struct tcb_s* tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/hc/src/m9s12/m9s12_ethernet.c b/arch/hc/src/m9s12/m9s12_ethernet.c index fe2656e97a94c72ae3d81899cd9db5750890a473..3a85446e6dc4304b8602b2563bc9a9416ab3b00d 100644 --- a/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/arch/hc/src/m9s12/m9s12_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/m9s12/m9s12_ethernet.c * - * Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,12 @@ struct emac_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structure */ + static struct emac_driver_s g_emac[CONFIG_HCS12_NINTERFACES]; /**************************************************************************** @@ -756,6 +762,7 @@ int emac_initialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct emac_driver_s)); + priv->d_dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->d_dev.d_ifup = emac_ifup; /* I/F down callback */ priv->d_dev.d_ifdown = emac_ifdown; /* I/F up (new IP address) callback */ priv->d_dev.d_txavail = emac_txavail; /* New TX data callback */ @@ -767,8 +774,8 @@ int emac_initialize(int intf) /* Create a watchdog for timing polling for and timing of transmisstions */ - priv->d_txpoll = wd_create(); /* Create periodic poll timer */ - priv->d_txtimeout = wd_create(); /* Create TX timeout timer */ + priv->d_txpoll = wd_create(); /* Create periodic poll timer */ + priv->d_txtimeout = wd_create(); /* Create TX timeout timer */ /* Put the interface in the down state. This usually amounts to resetting * the device and/or calling emac_ifdown(). diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index af9a79a0e7589cc62f1c97cc7f3c2c635ad1064c..1962c698e0aa99ae5d365b775ef8ec5111552e8f 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/common/up_exit.c * - * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,11 @@ #include #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -142,11 +143,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/mips/src/mips32/Kconfig b/arch/mips/src/mips32/Kconfig index 228c28557f4b78eb970ab0da071940fff0fdac3c..5363ecbd543d85bc6967146eacf2c345c78716a3 100644 --- a/arch/mips/src/mips32/Kconfig +++ b/arch/mips/src/mips32/Kconfig @@ -8,8 +8,8 @@ comment "MIPS32 Configuration Options" choice prompt "Toolchain Selection" - default MIPS32_TOOLCHAIN_MICROCHIPW_LITE if HOST_WINDOWS - default MIPS32_TOOLCHAIN_GNU_ELF if !HOST_WINDOWS + default MIPS32_TOOLCHAIN_MICROCHIPW_LITE if TOOLCHAIN_WINDOWS + default MIPS32_TOOLCHAIN_GNU_ELF if !TOOLCHAIN_WINDOWS config MIPS32_TOOLCHAIN_GNU_ELF bool "Generic GNU ELF toolchain" @@ -31,15 +31,15 @@ config MIPS32_TOOLCHAIN_MICROCHIPL_LITE config MIPS32_TOOLCHAIN_MICROCHIPW_XC32 bool "Microchip XC32 toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config MIPS32_TOOLCHAIN_MICROCHIPW bool "Microchip C32 toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config MIPS32_TOOLCHAIN_MICROCHIPW_LITE bool "Microchip C32 toolchain under Windows (Lite edition)" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config MIPS32_TOOLCHAIN_MICROCHIPOPENL bool "microchipOpen toolchain under Linux" @@ -47,7 +47,7 @@ config MIPS32_TOOLCHAIN_MICROCHIPOPENL config MIPS32_TOOLCHAIN_PINGUINOW bool "Pinguino mips-elf toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS config MIPS32_TOOLCHAIN_PINGUINOL bool "Pinguino mips-elf toolchain under OS X or Linux" diff --git a/arch/mips/src/pic32mx/Kconfig b/arch/mips/src/pic32mx/Kconfig index 366c50fdf5e888a975c145c5f1804ba5c8127c45..52dd77456678bb4c441c87b8f0dffd25b862cb31 100644 --- a/arch/mips/src/pic32mx/Kconfig +++ b/arch/mips/src/pic32mx/Kconfig @@ -1094,13 +1094,6 @@ config NET_WOL ---help--- Enable Wake-up on LAN (not fully implemented). -config NET_REGDEBUG - bool "Register level debug" - default n - depends on PIC32MX_ETHERNET && DEBUG_NET_INFO - ---help--- - Enabled low level register debug. Also needs CONFIG_DEBUG_FEATURES. - config NET_HASH bool "Hash" default n @@ -1116,6 +1109,33 @@ config PIC32MX_MULTICAST Enable receipt of multicast (and unicast) frames. Automatically set if NET_IGMP is selected. +choice + prompt "Work queue" + default PIC32MX_ETHERNET_LPWORK if SCHED_LPWORK + default PIC32MX_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config PIC32MX_ETHERNET_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config PIC32MX_ETHERNET_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + +config NET_REGDEBUG + bool "Register level debug" + default n + depends on PIC32MX_ETHERNET && DEBUG_NET_INFO + ---help--- + Enabled low level register debug. Also needs CONFIG_DEBUG_FEATURES. + endmenu menu "Device Configuration 0 (DEVCFG0)" diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index 8a1bc0848288f407c672380ecba6079c37e16651..3515635f22018028b16a0bf3cf08c07da5842fb6 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,25 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_PIC32MX_ETHERNET_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_PIC32MX_ETHERNET_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_PIC32MX_ETHERNET_HPWORK nor CONFIG_PIC32MX_ETHERNET_LPWORK defined +# endif +#endif + /* CONFIG_PIC32MX_NINTERFACES determines the number of physical interfaces * that will be supported -- unless it is more than actually supported by the * hardware! @@ -102,12 +122,6 @@ # define CONFIG_PIC32MX_NINTERFACES 1 #endif -/* CONFIG_NET_MULTIBUFFER is required */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER=y is required" -#endif - /* If IGMP is enabled, then accept multi-cast frames. */ #if defined(CONFIG_NET_IGMP) && !defined(CONFIG_PIC32MX_MULTICAST) @@ -307,6 +321,7 @@ struct pic32mx_driver_s uint32_t pd_inten; /* Shadow copy of INTEN register */ WDOG_ID pd_txpoll; /* TX poll timer */ WDOG_ID pd_txtimeout; /* TX timeout timer */ + struct work_s pd_work; /* For deferring work to the work queue */ sq_queue_t pd_freebuffers; /* The free buffer list */ @@ -378,18 +393,26 @@ static void pic32mx_timerpoll(struct pic32mx_driver_s *priv); static void pic32mx_response(struct pic32mx_driver_s *priv); static void pic32mx_rxdone(struct pic32mx_driver_s *priv); static void pic32mx_txdone(struct pic32mx_driver_s *priv); + +static void pic32mx_interrupt_work(void *arg); static int pic32mx_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void pic32mx_polltimer(int argc, uint32_t arg, ...); -static void pic32mx_txtimeout(int argc, uint32_t arg, ...); +static void pic32mx_txtimeout_work(void *arg); +static void pic32mx_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void pic32mx_poll_work(void *arg); +static void pic32mx_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int pic32mx_ifup(struct net_driver_s *dev); static int pic32mx_ifdown(struct net_driver_s *dev); + +static void pic32mx_txavail_work(void *arg); static int pic32mx_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP static int pic32mx_addmac(struct net_driver_s *dev, const uint8_t *mac); static int pic32mx_rmmac(struct net_driver_s *dev, const uint8_t *mac); @@ -1061,8 +1084,8 @@ static int pic32mx_transmit(struct pic32mx_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->pd_txtimeout, PIC32MX_TXTIMEOUT, pic32mx_txtimeout, - 1, (uint32_t)priv); + (void)wd_start(priv->pd_txtimeout, PIC32MX_TXTIMEOUT, + pic32mx_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1640,32 +1663,30 @@ static void pic32mx_txdone(struct pic32mx_driver_s *priv) } /**************************************************************************** - * Function: pic32mx_interrupt + * Function: pic32mx_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static int pic32mx_interrupt(int irq, void *context) +static void pic32mx_interrupt_work(void *arg) { - register struct pic32mx_driver_s *priv; + struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; uint32_t status; -#if CONFIG_PIC32MX_NINTERFACES > 1 -# error "A mechanism to associate and interface with an IRQ is needed" -#else - priv = &g_ethdrvr[0]; -#endif + /* Process pending Ethernet interrupts */ + + net_lock(); /* Get the interrupt status (zero means no interrupts pending). */ @@ -1795,45 +1816,115 @@ static int pic32mx_interrupt(int irq, void *context) * (ETHCON1:0) bit to decrement the BUFCNT counter. Writing a 0 or a * 1 has no effect. */ - } /* Clear the pending interrupt */ -# if CONFIG_PIC32MX_NINTERFACES > 1 +#if CONFIG_PIC32MX_NINTERFACES > 1 up_clrpend_irq(priv->pd_irqsrc); -# else +#else up_clrpend_irq(PIC32MX_IRQSRC_ETH); -# endif +#endif + net_unlock(); + + /* Re-enable Ethernet interrupts */ + +#if CONFIG_PIC32MX_NINTERFACES > 1 + up_enable_irq(priv->pd_irqsrc); +#else + up_enable_irq(PIC32MX_IRQSRC_ETH); +#endif +} +/**************************************************************************** + * Function: pic32mx_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int pic32mx_interrupt(int irq, void *context) +{ + struct pic32mx_driver_s *priv; + uint32_t status; + +#if CONFIG_PIC32MX_NINTERFACES > 1 +# error "A mechanism to associate an interface with an IRQ is needed" +#else + priv = &g_ethdrvr[0]; +#endif + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + +#if CONFIG_PIC32MX_NINTERFACES > 1 + up_disable_irq(priv->pd_irqsrc); +#else + up_disable_irq(PIC32MX_IRQSRC_ETH); +#endif + + /* Get the interrupt status (zero means no interrupts pending). */ + + status = pic32mx_getreg(PIC32MX_ETH_IRQ); + + /* Determine if a TX transfer just completed */ + + if ((status & ETH_INT_TXDONE) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be no race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->pd_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(HPWORK, &priv->pd_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mx_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: pic32mx_txtimeout + * Function: pic32mx_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * The network is locked. * ****************************************************************************/ -static void pic32mx_txtimeout(int argc, uint32_t arg, ...) +static void pic32mx_txtimeout_work(void *arg) { struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; /* Increment statistics and dump debug info */ + net_lock(); NETDEV_TXTIMEOUTS(&priv->pd_dev); if (priv->pd_ifup) { @@ -1843,19 +1934,22 @@ static void pic32mx_txtimeout(int argc, uint32_t arg, ...) (void)pic32mx_ifup(&priv->pd_dev); - /* Then poll the network for new XMIT data (We are guaranteed to have a free - * buffer here). + /* Then poll the network for new XMIT data (We are guaranteed to have + * a free buffer here). */ pic32mx_poll(priv); } + + net_unlock(); } /**************************************************************************** - * Function: pic32mx_polltimer + * Function: pic32mx_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1869,7 +1963,50 @@ static void pic32mx_txtimeout(int argc, uint32_t arg, ...) * ****************************************************************************/ -static void pic32mx_polltimer(int argc, uint32_t arg, ...) +static void pic32mx_txtimeout_expiry(int argc, wdparm_t arg, ...) +{ + struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + +#if CONFIG_PIC32MX_NINTERFACES > 1 + up_disable_irq(priv->pd_irqsrc); +#else + up_disable_irq(PIC32MX_IRQSRC_ETH); +#endif + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->pd_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mx_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: pic32mx_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void pic32mx_poll_work(void *arg) { struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; @@ -1877,6 +2014,7 @@ static void pic32mx_polltimer(int argc, uint32_t arg, ...) * poll if we are unable to accept another packet for transmission. */ + net_lock(); if (pic32mx_txdesc(priv) != NULL) { /* If so, update TCP timing states and poll the network for new XMIT data. Hmmm.. @@ -1889,7 +2027,52 @@ static void pic32mx_polltimer(int argc, uint32_t arg, ...) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_polltimer, 1, arg); + (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, + 1, priv); + net_unlock(); +} + +/**************************************************************************** + * Function: pic32mx_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void pic32mx_poll_expiry(int argc, wdparm_t arg, ...) +{ + struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->pd_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mx_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, + 1, arg); + } } /**************************************************************************** @@ -2181,12 +2364,13 @@ static int pic32mx_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_polltimer, 1, + (void)wd_start(priv->pd_txpoll, PIC32MX_WDDELAY, pic32mx_poll_expiry, 1, (uint32_t)priv); /* Finally, enable the Ethernet interrupt at the interrupt controller */ priv->pd_ifup = true; + #if CONFIG_PIC32MX_NINTERFACES > 1 up_enable_irq(priv->pd_irqsrc); #else @@ -2239,37 +2423,29 @@ static int pic32mx_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: pic32mx_txavail + * Function: pic32mx_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int pic32mx_txavail(struct net_driver_s *dev) +static void pic32mx_txavail_work(void *arg) { - struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)dev->d_private; - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); + struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)arg; /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->pd_ifup) { /* Check if the next Tx descriptor is available. */ @@ -2284,7 +2460,44 @@ static int pic32mx_txavail(struct net_driver_s *dev) } } - leave_critical_section(flags); + net_unlock(); +} + +/**************************************************************************** + * Function: pic32mx_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int pic32mx_txavail(struct net_driver_s *dev) +{ + struct pic32mx_driver_s *priv = (struct pic32mx_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->pd_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mx_txavail_work, priv, 0); + } + return OK; } diff --git a/arch/mips/src/pic32mz/Kconfig b/arch/mips/src/pic32mz/Kconfig index 70dcf7d0766ae550acede9a4138a7d3b063a9c9b..0ea6cfeae4d58c6ec1246dcf2226be90615355ca 100644 --- a/arch/mips/src/pic32mz/Kconfig +++ b/arch/mips/src/pic32mz/Kconfig @@ -265,7 +265,7 @@ config PIC32MZ_CTMU bool "Charge Time Measurement Unit (CMTU)" default n -endmenu # PIC32MX Peripheral Support +endmenu # PIC32MZ Peripheral Support menuconfig PIC32MZ_GPIOIRQ bool "GPIO Interrupt Support" @@ -397,13 +397,6 @@ config NET_WOL ---help--- Enable Wake-up on LAN (not fully implemented). -config NET_REGDEBUG - bool "Register level debug" - default n - depends on PIC32MZ_ETHERNET && DEBUG_NET_INFO - ---help--- - Enabled low level register debug. Also needs CONFIG_DEBUG_FEATURES. - config NET_HASH bool "Hash" default n @@ -419,6 +412,33 @@ config PIC32MZ_MULTICAST Enable receipt of multicast (and unicast) frames. Automatically set if NET_IGMP is selected. +choice + prompt "Work queue" + default PIC32MZ_ETHERNET_LPWORK if SCHED_LPWORK + default PIC32MZ_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config PIC32MZ_ETHERNET_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config PIC32MZ_ETHERNET_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + +config NET_REGDEBUG + bool "Register level debug" + default n + depends on PIC32MZ_ETHERNET && DEBUG_NET_INFO + ---help--- + Enabled low level register debug. Also needs CONFIG_DEBUG_FEATURES. + endmenu # PIC32MZ PHY/Ethernet device driver settings menu "Device Configuration 0 (DEVCFG0)" diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index b2df36544972d2e940a298fcaa20c648b3d86042..7eb5c4d54cf970724d07602ba2091ed871ec6180 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,25 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_PIC32MZ_ETHERNET_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_PIC32MZ_ETHERNET_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_PIC32MZ_ETHERNET_HPWORK nor CONFIG_PIC32MZ_ETHERNET_LPWORK defined +# endif +#endif + /* CONFIG_PIC32MZ_NINTERFACES determines the number of physical interfaces * that will be supported -- unless it is more than actually supported by the * hardware! @@ -102,12 +122,6 @@ # define CONFIG_PIC32MZ_NINTERFACES 1 #endif -/* CONFIG_NET_MULTIBUFFER is required */ - -#ifndef CONFIG_NET_MULTIBUFFER -# error "CONFIG_NET_MULTIBUFFER=y is required" -#endif - /* If IGMP is enabled, then accept multi-cast frames. */ #if defined(CONFIG_NET_IGMP) && !defined(CONFIG_PIC32MZ_MULTICAST) @@ -334,6 +348,7 @@ struct pic32mz_driver_s uint32_t pd_inten; /* Shadow copy of INTEN register */ WDOG_ID pd_txpoll; /* TX poll timer */ WDOG_ID pd_txtimeout; /* TX timeout timer */ + struct work_s pd_work; /* For deferring work to the work queue */ sq_queue_t pd_freebuffers; /* The free buffer list */ @@ -405,18 +420,26 @@ static void pic32mz_timerpoll(struct pic32mz_driver_s *priv); static void pic32mz_response(struct pic32mz_driver_s *priv); static void pic32mz_rxdone(struct pic32mz_driver_s *priv); static void pic32mz_txdone(struct pic32mz_driver_s *priv); + +static void pic32mz_interrupt_work(void *arg); static int pic32mz_interrupt(int irq, void *context); /* Watchdog timer expirations */ -static void pic32mz_polltimer(int argc, uint32_t arg, ...); -static void pic32mz_txtimeout(int argc, uint32_t arg, ...); +static void pic32mz_txtimeout_work(void *arg); +static void pic32mz_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void pic32mz_poll_work(void *arg); +static void pic32mz_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int pic32mz_ifup(struct net_driver_s *dev); static int pic32mz_ifdown(struct net_driver_s *dev); + +static void pic32mz_txavail_work(void *arg); static int pic32mz_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP static int pic32mz_addmac(struct net_driver_s *dev, const uint8_t *mac); static int pic32mz_rmmac(struct net_driver_s *dev, const uint8_t *mac); @@ -1088,7 +1111,7 @@ static int pic32mz_transmit(struct pic32mz_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->pd_txtimeout, PIC32MZ_TXTIMEOUT, pic32mz_txtimeout, + (void)wd_start(priv->pd_txtimeout, PIC32MZ_TXTIMEOUT, pic32mz_txtimeout_expiry, 1, (uint32_t)priv); return OK; @@ -1667,32 +1690,30 @@ static void pic32mz_txdone(struct pic32mz_driver_s *priv) } /**************************************************************************** - * Function: pic32mz_interrupt + * Function: pic32mz_interrupt_work * * Description: - * Hardware interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static int pic32mz_interrupt(int irq, void *context) +static void pic32mz_interrupt_work(void *arg) { - register struct pic32mz_driver_s *priv; + struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; uint32_t status; -#if CONFIG_PIC32MZ_NINTERFACES > 1 -# error "A mechanism to associate and interface with an IRQ is needed" -#else - priv = &g_ethdrvr[0]; -#endif + /* Process pending Ethernet interrupts */ + + net_lock(); /* Get the interrupt status (zero means no interrupts pending). */ @@ -1822,45 +1843,115 @@ static int pic32mz_interrupt(int irq, void *context) * (ETHCON1:0) bit to decrement the BUFCNT counter. Writing a 0 or a * 1 has no effect. */ - } /* Clear the pending interrupt */ -# if CONFIG_PIC32MZ_NINTERFACES > 1 +#if CONFIG_PIC32MZ_NINTERFACES > 1 up_clrpend_irq(priv->pd_irqsrc); -# else +#else up_clrpend_irq(PIC32MZ_IRQ_ETH); -# endif +#endif + net_unlock(); + /* Re-enable Ethernet interrupts */ + +#if CONFIG_PIC32MZ_NINTERFACES > 1 + up_enable_irq(priv->pd_irqsrc); +#else + up_enable_irq(PIC32MZ_IRQ_ETH); +#endif +} + +/**************************************************************************** + * Function: pic32mz_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int pic32mz_interrupt(int irq, void *context) +{ + struct pic32mz_driver_s *priv; + uint32_t status; + +#if CONFIG_PIC32MZ_NINTERFACES > 1 +# error "A mechanism to associate an interface with an IRQ is needed" +#else + priv = &g_ethdrvr[0]; +#endif + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + +#if CONFIG_PIC32MZ_NINTERFACES > 1 + up_disable_irq(priv->pd_irqsrc); +#else + up_disable_irq(PIC32MZ_IRQ_ETH); +#endif + + /* Get the interrupt status (zero means no interrupts pending). */ + + status = pic32mz_getreg(PIC32MZ_ETH_IRQ); + + /* Determine if a TX transfer just completed */ + + if ((status & ETH_INT_TXDONE) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be no race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->pd_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(HPWORK, &priv->pd_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mz_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: pic32mz_txtimeout + * Function: pic32mz_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: - * Global interrupts are disabled by the watchdog logic. + * The network is locked. * ****************************************************************************/ -static void pic32mz_txtimeout(int argc, uint32_t arg, ...) +static void pic32mz_txtimeout_work(void *arg) { struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; /* Increment statistics and dump debug info */ + net_lock(); NETDEV_TXTIMEOUTS(&priv->pd_dev); if (priv->pd_ifup) { @@ -1876,13 +1967,16 @@ static void pic32mz_txtimeout(int argc, uint32_t arg, ...) pic32mz_poll(priv); } + + net_unlock(); } /**************************************************************************** - * Function: pic32mz_polltimer + * Function: pic32mz_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1896,7 +1990,50 @@ static void pic32mz_txtimeout(int argc, uint32_t arg, ...) * ****************************************************************************/ -static void pic32mz_polltimer(int argc, uint32_t arg, ...) +static void pic32mz_txtimeout_expiry(int argc, wdparm_t arg, ...) +{ + struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + +#if CONFIG_PIC32MZ_NINTERFACES > 1 + up_disable_irq(priv->pd_irqsrc); +#else + up_disable_irq(PIC32MZ_IRQ_ETH); +#endif + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->pd_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mz_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: pic32mz_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void pic32mz_poll_work(void *arg) { struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; @@ -1904,11 +2041,12 @@ static void pic32mz_polltimer(int argc, uint32_t arg, ...) * poll if we are unable to accept another packet for transmission. */ + net_lock(); if (pic32mz_txdesc(priv) != NULL) { - /* If so, update TCP timing states and poll the network for new XMIT data. Hmmm.. - * might be bug here. Does this mean if there is a transmit in progress, - * we will missing TCP time state updates? + /* If so, update TCP timing states and poll the network for new XMIT + * data. Hmmm.. might be bug here. Does this mean if there is a + * transmit in progress, we will missing TCP time state updates? */ pic32mz_timerpoll(priv); @@ -1916,7 +2054,51 @@ static void pic32mz_polltimer(int argc, uint32_t arg, ...) /* Setup the watchdog poll timer again */ - (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_polltimer, 1, arg); + (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, + 1, priv); + net_unlock(); +} + +/**************************************************************************** + * Function: pic32mz_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void pic32mz_poll_expiry(int argc, wdparm_t arg, ...) +{ + struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->pd_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mz_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, 1, arg); + } } /**************************************************************************** @@ -2213,17 +2395,19 @@ static int pic32mz_ifup(struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_polltimer, 1, + (void)wd_start(priv->pd_txpoll, PIC32MZ_WDDELAY, pic32mz_poll_expiry, 1, (uint32_t)priv); /* Finally, enable the Ethernet interrupt at the interrupt controller */ priv->pd_ifup = true; + #if CONFIG_PIC32MZ_NINTERFACES > 1 up_enable_irq(priv->pd_irqsrc); #else up_enable_irq(PIC32MZ_IRQ_ETH); #endif + return OK; } @@ -2271,37 +2455,29 @@ static int pic32mz_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: pic32mz_txavail + * Function: pic32mz_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int pic32mz_txavail(struct net_driver_s *dev) +static void pic32mz_txavail_work(void *arg) { - struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)dev->d_private; - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); + struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)arg; /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->pd_ifup) { /* Check if the next Tx descriptor is available. */ @@ -2316,7 +2492,44 @@ static int pic32mz_txavail(struct net_driver_s *dev) } } - leave_critical_section(flags); + net_unlock(); +} + +/**************************************************************************** + * Function: pic32mz_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int pic32mz_txavail(struct net_driver_s *dev) +{ + struct pic32mz_driver_s *priv = (struct pic32mz_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->pd_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->pd_work, pic32mz_txavail_work, priv, 0); + } + return OK; } @@ -2800,6 +3013,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) nerr("ERROR: No PHY detected\n"); return -ENODEV; } + ninfo("phyaddr: %d\n", phyaddr); /* Save the discovered PHY device address */ @@ -2813,6 +3027,7 @@ static inline int pic32mz_phyinit(struct pic32mz_driver_s *priv) { return ret; } + pic32mz_showmii(phyaddr, "After reset"); /* Set the MII/RMII operation mode. This usually requires access to a diff --git a/arch/misoc/Kconfig b/arch/misoc/Kconfig index 615b741c52be943496e56e76f2694b113152b3e4..eee7005c38ee9017cbeb7638756f8f4e84d4b2a5 100644 --- a/arch/misoc/Kconfig +++ b/arch/misoc/Kconfig @@ -43,6 +43,13 @@ config MISOC_UART1 select ARCH_HAVE_UART1 select MISOC_UART +config MISOC_ETHERNET + bool "Ethernet" + default n + select NETDEVICES + select ARCH_HAVE_PHY + select ARCH_HAVE_NETDEV_STATISTICS + endmenu # MISOC Peripheral Support config MISOC_UART diff --git a/arch/misoc/include/lm32/irq.h b/arch/misoc/include/lm32/irq.h index 2e5e51e83a633623f9d1dc6224574ed0e0d0c0a1..57512bba8840d1ff75beedf304abe3439ed1e0e7 100644 --- a/arch/misoc/include/lm32/irq.h +++ b/arch/misoc/include/lm32/irq.h @@ -195,11 +195,44 @@ struct xcptcontext { +#ifndef CONFIG_DISABLE_SIGNALS + /* The following function pointer is non-NULL if there are pending signals + * to be processed. + */ + + void *sigdeliver; /* Actual type is sig_deliver_t */ + + /* These additional register save locations are used to implement the + * signal delivery trampoline. + */ + + uint32_t saved_epc; /* Trampoline PC */ + uint32_t saved_int_ctx; /* Interrupt context with interrupts disabled. */ + +# ifdef CONFIG_BUILD_KERNEL + /* This is the saved address to use when returning from a user-space + * signal handler. + */ + + uint32_t sigreturn; + +# endif +#endif + +#ifdef CONFIG_BUILD_KERNEL + /* The following array holds information needed to return from each nested + * system call. + */ + + uint8_t nsyscalls; + struct xcpt_syscall_s syscall[CONFIG_SYS_NNEST]; + +#endif + /* Register save area */ uint32_t regs[XCPTCONTEXT_REGS]; }; #endif /* __ASSEMBLY__ */ - #endif /* __ARCH_MISOC_INCLUDE_LM32_IRQ_H */ diff --git a/arch/misoc/src/common/misoc.h b/arch/misoc/src/common/misoc.h index 4726759ea58de5210081780a43ed3686b2cf20e7..ab99f6aca259854a04ddcd66b1b2ad2e32758a2a 100644 --- a/arch/misoc/src/common/misoc.h +++ b/arch/misoc/src/common/misoc.h @@ -63,6 +63,26 @@ #ifndef __ASSEMBLY__ +/**************************************************************************** + * Name: misoc_timer_initialize + * + * Description: + * Initialize and start the system timer. + * + ****************************************************************************/ + +void misoc_timer_initialize(void); + +/**************************************************************************** + * Name: flush_cpu_dcache + * + * Description: + * flush cpu cache Data cache + * + ****************************************************************************/ + +void flush_cpu_dcache(void); + /**************************************************************************** * Name: up_serialinit * @@ -74,6 +94,16 @@ void misoc_serial_initialize(void); +/**************************************************************************** + * Name: up_net_initialize + * + * Description: + * Register Network + * + ****************************************************************************/ + +int misoc_net_initialize(int intf); + /**************************************************************************** * Name: misoc_puts * @@ -116,5 +146,25 @@ void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits); void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits); void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits); +/**************************************************************************** + * Name: misoc_flush_dcache + * + * Description: + * Flush the data cache of the cpu + * + ****************************************************************************/ + +void misoc_flush_dcache(void); + +/**************************************************************************** + * Name: misoc_flush_icache + * + * Description: + * Flush the instruction cache of the cpu + * + ****************************************************************************/ + +void misoc_flush_icache(void); + #endif /* __ASSEMBLY__ */ #endif /* __ARCH_MISOC_SRC_COMMON_MISOC_H */ diff --git a/libc/stdio/lib_lowinstream.c b/arch/misoc/src/common/misoc_flushcache.c similarity index 69% rename from libc/stdio/lib_lowinstream.c rename to arch/misoc/src/common/misoc_flushcache.c index ad3231784d5cb82e6fb42c858cccf5fef3d21a2c..655ba8ab3587f5427da0e6073956441c80e1fd87 100644 --- a/libc/stdio/lib_lowinstream.c +++ b/arch/misoc/src/common/misoc_flushcache.c @@ -1,8 +1,9 @@ /**************************************************************************** - * libc/stdio/lib_lowinstream.c + * arch/misoc/src/common/misoc_flushcache.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt + * Author: Ramtin Amin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,65 +39,43 @@ ****************************************************************************/ #include - -#include -#include -#include - #include +#include "misoc.h" -#include "libc.h" - -#ifdef CONFIG_ARCH_LOWGETC +#ifdef CONFIG_ARCH_CHIP_LM32 +#include "lm32.h" +#endif /**************************************************************************** - * Private Functions + * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: lowinstream_getc + * Name: misoc_flush_dcache + * + * Description: + * Flush the data cache of the cpu + * ****************************************************************************/ -static int lowinstream_getc(FAR struct lib_instream_s *this) +void misoc_flush_dcache() { - int ret; - - DEBUGASSERT(this); - - /* Get the next character from the incoming stream */ - - ret = up_getc(ch); - if (ret != EOF) - { - this->nget++; - } - - return ret; +#ifdef CONFIG_ARCH_CHIP_LM32 + lm32_flush_dcache(); +#endif } /**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lib_lowinstream + * Name: misoc_flush_icache * * Description: - * Initializes a stream for use with low-level, architecture-specific I/O. - * - * Input parameters: - * stream - User allocated, uninitialized instance of struct - * lib_lowinstream_s to be initialized. - * - * Returned Value: - * None (User allocated instance initialized). + * Flush the instruction cache of the cpu * ****************************************************************************/ -void lib_lowinstream(FAR struct lib_instream_s *stream) +void misoc_flush_icache() { - stream->get = lowinstream_getc; - stream->nget = 0; +#ifdef CONFIG_ARCH_CHIP_LM32 + lm32_flush_icache(); +#endif } - -#endif /* CONFIG_ARCH_LOWGETC */ diff --git a/arch/misoc/src/common/misoc_net.c b/arch/misoc/src/common/misoc_net.c new file mode 100644 index 0000000000000000000000000000000000000000..85d6e60bbf235cb25ff348fab4b31f1dcc506282 --- /dev/null +++ b/arch/misoc/src/common/misoc_net.c @@ -0,0 +1,1228 @@ +/**************************************************************************** + * arch/misoc/src/commong/misoc_net_net.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Ramtin Amin + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 +#if defined(CONFIG_NET) && defined(CONFIG_MISOC_ETHERNET) + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "chip.h" +#include "hw/flags.h" +#include "hw/ethmac_mem.h" +#include "misoc.h" + +#ifdef CONFIG_NET_PKT +# include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* If processing is not done at the interrupt level, then high priority + * work queue support is required. + */ + +#if !defined(CONFIG_SCHED_HPWORK) + /* REVISIT: The low priority work queue would be preferred if it is avaiable */ + +# error High priority work queue support is required +#endif + +/* CONFIG_MISOC_NET_NINTERFACES determines the number of physical interfaces + * that will be supported. + */ + +#ifndef CONFIG_MISOC_NET_NINTERFACES +# define CONFIG_MISOC_NET_NINTERFACES 1 +#endif + +/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per second */ + +#define MISOC_NET_WDDELAY (1*CLK_TCK) + +/* TX timeout = 1 minute */ + +#define MISOC_NET_TXTIMEOUT (60*CLK_TCK) + +/* This is a helper pointer for accessing the contents of the Ethernet header */ + +#define BUF ((struct eth_hdr_s *)priv->misoc_net_dev.d_buf) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* The misoc_net_driver_s encapsulates all state information for a single hardware + * interface + */ + +struct misoc_net_driver_s +{ + bool misoc_net_bifup; /* true:ifup false:ifdown */ + WDOG_ID misoc_net_txpoll; /* TX poll timer */ + WDOG_ID misoc_net_txtimeout; /* TX timeout timer */ + struct work_s misoc_net_work; /* For deferring work to the work queue */ + + uint8_t *rx0_buf; /* 2 RX and 2 TX buffer */ + uint8_t *rx1_buf; + uint8_t *tx0_buf; + uint8_t *tx1_buf; + + uint8_t *tx_buf; + + + uint8_t tx_slot; /* The slot from which we send packet (tx0/tx1) */ + + /* This holds the information visible to the NuttX network */ + + struct net_driver_s misoc_net_dev; /* Interface understood by the network */ +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structur */ + +static struct misoc_net_driver_s g_misoc_net[CONFIG_MISOC_NET_NINTERFACES]; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/* Common TX logic */ + +static int misoc_net_transmit(FAR struct misoc_net_driver_s *priv); +static int misoc_net_txpoll(FAR struct net_driver_s *dev); + +/* Interrupt handling */ + +static void misoc_net_receive(FAR struct misoc_net_driver_s *priv); +static void misoc_net_txdone(FAR struct misoc_net_driver_s *priv); + +static void misoc_net_interrupt_work(FAR void *arg); +static int misoc_net_interrupt(int irq, FAR void *context); + +/* Watchdog timer expirations */ + +static void misoc_net_txtimeout_work(FAR void *arg); +static void misoc_net_txtimeout_expiry(int argc, wdparm_t arg, ...); + +static void misoc_net_poll_work(FAR void *arg); +static void misoc_net_poll_expiry(int argc, wdparm_t arg, ...); + +/* NuttX callback functions */ + +static int misoc_net_ifup(FAR struct net_driver_s *dev); +static int misoc_net_ifdown(FAR struct net_driver_s *dev); + +static void misoc_net_txavail_work(FAR void *arg); +static int misoc_net_txavail(FAR struct net_driver_s *dev); + +#if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) +static int misoc_net_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); +#ifdef CONFIG_NET_IGMP +static int misoc_net_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); +#endif +#ifdef CONFIG_NET_ICMPv6 +static void misoc_net_ipv6multicast(FAR struct misoc_net_driver_s *priv); +#endif +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: misoc_net_transmit + * + * Description: + * Start hardware transmission. Called either from the txdone interrupt + * handling or from watchdog based polling. + * + * Parameters: + * priv - Reference to the driver state structure + * + * Returned Value: + * OK on success; a negated errno on failure + * + * Assumptions: + * May or may not be called from an interrupt handler. In either case, + * the network is locked. + * + ****************************************************************************/ + +static int misoc_net_transmit(FAR struct misoc_net_driver_s *priv) +{ + /* Verify that the hardware is ready to send another packet. If we get + * here, then we are committed to sending a packet; Higher level logic + * must have assured that there is no transmission in progress. + */ + + /* Increment statistics */ + + NETDEV_TXPACKETS(priv->misoc_net_dev); + + /* Send the packet: address=priv->misoc_net_dev.d_buf, + * length=priv->misoc_net_dev.d_len + * + * NOTE: This memcpy could be avoided by setting tx_buf + * to the d_buf pointer and setting d_buf to an alternate + * buffer. Some additional buffer management logic would + * be required. + */ + + memcpy(priv->tx_buf, priv->misoc_net_dev.d_buf, + priv->misoc_net_dev.d_len); + + /* Choose the slot on which we write */ + + ethmac_sram_reader_slot_write(priv->tx_slot); + + /* Write the len */ + + if (priv->misoc_net_dev.d_len < 60) + { + ethmac_sram_reader_length_write(60); + } + else + { + ethmac_sram_reader_length_write(priv->misoc_net_dev.d_len); + } + + /* Trigger the writing */ + + ethmac_sram_reader_start_write(1); + + /* switch tx slot */ + + priv->tx_slot = (priv->tx_slot+1)%2; + if (priv->tx_slot) + { + priv->tx_buf = priv->tx1_buf; + } + else + { + priv->tx_buf = priv->tx0_buf; + } + + /* Enable Tx interrupts */ + + ethmac_sram_reader_ev_enable_write(1); + + /* Setup the TX timeout watchdog (perhaps restarting the timer) */ + + (void)wd_start(priv->misoc_net_txtimeout, MISOC_NET_TXTIMEOUT, + misoc_net_txtimeout_expiry, 1, (wdparm_t)priv); + return OK; +} + +/**************************************************************************** + * Function: misoc_net_txpoll + * + * Description: + * The transmitter is available, check if the network has any outgoing + * packets ready to send. This is a callback from devif_poll(). + * devif_poll() may be called: + * + * 1. When the preceding TX packet send is complete, + * 2. When the preceding TX packet send timesout and the interface is reset + * 3. During normal TX polling + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * OK on success; a negated errno on failure + * + * Assumptions: + * May or may not be called from an interrupt handler. In either case, + * the network is locked. + * + ****************************************************************************/ + +static int misoc_net_txpoll(FAR struct net_driver_s *dev) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + + /* If the polling resulted in data that should be sent out on the network, + * the field d_len is set to a value > 0. + */ + + if (priv->misoc_net_dev.d_len > 0) + { + /* Look up the destination MAC address and add it to the Ethernet + * header. + */ + +#ifdef CONFIG_NET_IPv4 +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->misoc_net_dev.d_flags)) +#endif + { + arp_out(&priv->misoc_net_dev); + } +#endif /* CONFIG_NET_IPv4 */ + +#ifdef CONFIG_NET_IPv6 +#ifdef CONFIG_NET_IPv4 + else +#endif + { + neighbor_out(&priv->misoc_net_dev); + } +#endif /* CONFIG_NET_IPv6 */ + + /* Send the packet */ + + misoc_net_transmit(priv); + + /* Check if there is room in the device to hold another packet. If not, + * return a non-zero value to terminate the poll. + */ + } + + /* If zero is returned, the polling will continue until all connections have + * been examined. + */ + + return 0; +} + +/**************************************************************************** + * Function: misoc_net_receive + * + * Description: + * An interrupt was received indicating the availability of a new RX packet + * + * Parameters: + * priv - Reference to the driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void misoc_net_receive(FAR struct misoc_net_driver_s *priv) +{ + uint8_t rxslot; + uint32_t rxlen; + + do + { + /* Check for errors and update statistics */ + + /* Check if the packet is a valid size for the network buffer + * configuration. + */ + + /* Find rx slot */ + + rxslot = ethmac_sram_writer_slot_read(); + + /* Get rx len */ + + rxlen = ethmac_sram_writer_length_read(); + + /* Copy the data data from the hardware to priv->misoc_net_dev.d_buf. Set + * amount of data in priv->misoc_net_dev.d_len + * + * NOTE: These memcpy's could be avoided by simply setting the d_buf + * pointer to the rx*_buf containing the received data. Some additional + * buffer management logic would also be required. + */ + + misoc_flush_dcache(); + + if (rxslot) + { + memcpy(priv->misoc_net_dev.d_buf, priv->rx1_buf, rxlen); + } + else + { + memcpy(priv->misoc_net_dev.d_buf, priv->rx0_buf, rxlen); + } + + /* Clear event pending */ + + ethmac_sram_writer_ev_pending_write(1); + + priv->misoc_net_dev.d_len = rxlen; + +#ifdef CONFIG_NET_PKT + /* When packet sockets are enabled, feed the frame into the packet tap */ + + pkt_input(&priv->misoc_net_dev); +#endif + + /* We only accept IP packets of the configured type and ARP packets */ + +#ifdef CONFIG_NET_IPv4 + if (BUF->type == HTONS(ETHTYPE_IP)) + { + ninfo("IPv4 frame\n"); + NETDEV_RXIPV4(&priv->misoc_net_dev); + + /* Handle ARP on input then give the IPv4 packet to the network + * layer + */ + + arp_ipin(&priv->misoc_net_dev); + ipv4_input(&priv->misoc_net_dev); + + /* If the above function invocation resulted in data that should be + * sent out on the network, the field d_len will set to a value > 0. + */ + + if (priv->misoc_net_dev.d_len > 0) + { + /* Update the Ethernet header with the correct MAC address */ + +#ifdef CONFIG_NET_IPv6 + if (IFF_IS_IPv4(priv->misoc_net_dev.d_flags)) +#endif + { + arp_out(&priv->misoc_net_dev); + } +#ifdef CONFIG_NET_IPv6 + else + { + neighbor_out(&kel->misoc_net_dev); + } +#endif + + /* And send the packet */ + + misoc_net_transmit(priv); + } + } + else +#endif +#ifdef CONFIG_NET_IPv6 + if (BUF->type == HTONS(ETHTYPE_IP6)) + { + ninfo("Iv6 frame\n"); + NETDEV_RXIPV6(&priv->misoc_net_dev); + + /* Give the IPv6 packet to the network layer */ + + ipv6_input(&priv->misoc_net_dev); + + /* If the above function invocation resulted in data that should be + * sent out on the network, the field d_len will set to a value > 0. + */ + + if (priv->misoc_net_dev.d_len > 0) + { + /* Update the Ethernet header with the correct MAC address */ + +#ifdef CONFIG_NET_IPv4 + if (IFF_IS_IPv4(priv->misoc_net_dev.d_flags)) + { + arp_out(&priv->misoc_net_dev); + } + else +#endif +#ifdef CONFIG_NET_IPv6 + { + neighbor_out(&priv->misoc_net_dev); + } +#endif + + /* And send the packet */ + + misoc_net_transmit(priv); + } + } + else +#endif +#ifdef CONFIG_NET_ARP + if (BUF->type == htons(ETHTYPE_ARP)) + { + arp_arpin(&priv->misoc_net_dev); + NETDEV_RXARP(&priv->misoc_net_dev); + + /* If the above function invocation resulted in data that should be + * sent out on the network, the field d_len will set to a value > 0. + */ + + if (priv->misoc_net_dev.d_len > 0) + { + misoc_net_transmit(priv); + } + } +#endif + else + { + NETDEV_RXDROPPED(&priv->misoc_net_dev); + } + } + while (ethmac_sram_writer_ev_pending_read() & ETHMAC_EV_SRAM_WRITER); +} + +/**************************************************************************** + * Function: misoc_net_txdone + * + * Description: + * An interrupt was received indicating that the last TX packet(s) is done + * + * Parameters: + * priv - Reference to the driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void misoc_net_txdone(FAR struct misoc_net_driver_s *priv) +{ + /* Check for errors and update statistics */ + + NETDEV_TXDONE(priv->misoc_net_dev); + + /* Check if there are pending transmissions */ + + /* If no further transmissions are pending, then cancel the TX timeout and + * disable further Tx interrupts. + */ + + wd_cancel(priv->misoc_net_txtimeout); + + /* Then make sure that the TX poll timer is running (if it is already + * running, the following would restart it). This is necessary to + * avoid certain race conditions where the polling sequence can be + * interrupted. + */ + + (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, + misoc_net_poll_expiry, 1, (wdparm_t)priv); + + /* And disable further TX interrupts. */ + + ethmac_sram_reader_ev_enable_write(0); + + /* In any event, poll the network for new TX data */ + + (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); +} + +/**************************************************************************** + * Function: misoc_net_interrupt_work + * + * Description: + * Perform interrupt related work from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() was called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void misoc_net_interrupt_work(FAR void *arg) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Process pending Ethernet interrupts */ + + net_lock(); + + /* Check if we received an incoming packet, if so, call misoc_net_receive() */ + + if (ethmac_sram_writer_ev_pending_read() & ETHMAC_EV_SRAM_WRITER) + { + misoc_net_receive(priv); + } + + /* Check if a packet transmission just completed. If so, call misoc_net_txdone. + * This may disable further Tx interrupts if there are no pending + * transmissions. + */ + + if (ethmac_sram_reader_ev_pending_read() & ETHMAC_EV_SRAM_READER) + { + misoc_net_txdone(priv); + ethmac_sram_reader_ev_pending_write(1); + } + + net_unlock(); + + /* Re-enable Ethernet interrupts */ + + up_enable_irq(ETHMAC_INTERRUPT); +} + +/**************************************************************************** + * Function: misoc_net_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int misoc_net_interrupt(int irq, FAR void *context) +{ + FAR struct misoc_net_driver_s *priv = &g_misoc_net[0]; + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + /* TODO: Determine if a TX transfer just completed */ + + if (ethmac_sram_reader_ev_pending_read() & ETHMAC_EV_SRAM_READER) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be do race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->misoc_net_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(HPWORK, &priv->misoc_net_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(HPWORK, &priv->misoc_net_work, misoc_net_interrupt_work, priv, 0); + return OK; +} + +/**************************************************************************** + * Function: misoc_net_txtimeout_work + * + * Description: + * Perform TX timeout related work from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void misoc_net_txtimeout_work(FAR void *arg) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Increment statistics and dump debug info */ + + net_lock(); + NETDEV_TXTIMEOUTS(priv->misoc_net_dev); + + /* Then reset the hardware */ + + /* Then poll the network for new XMIT data */ + + (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); + net_unlock(); +} + +/**************************************************************************** + * Function: misoc_net_txtimeout_expiry + * + * Description: + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void misoc_net_txtimeout_expiry(int argc, wdparm_t arg, ...) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + //up_disable_irq(ETHMAC_INTERRUPT); + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(HPWORK, &priv->misoc_net_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(HPWORK, &priv->misoc_net_work, misoc_net_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: misoc_net_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void misoc_net_poll_work(FAR void *arg) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Perform the poll */ + + net_lock(); + + /* Check if there is room in the send another TX packet. We cannot perform + * the TX poll if he are unable to accept another packet for transmission. + */ + + /* If so, update TCP timing states and poll the network for new XMIT data. + * Hmmm.. might be bug here. Does this mean if there is a transmit in + * progress, we will missing TCP time state updates? + */ + + (void)devif_timer(&priv->misoc_net_dev, misoc_net_txpoll); + + /* Setup the watchdog poll timer again */ + + (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, misoc_net_poll_expiry, 1, + (wdparm_t)priv); + + net_unlock(); +} + +/**************************************************************************** + * Function: misoc_net_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void misoc_net_poll_expiry(int argc, wdparm_t arg, ...) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->misoc_net_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(HPWORK, &priv->misoc_net_work, misoc_net_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, + misoc_net_poll_expiry, 1, arg); + } +} + +/**************************************************************************** + * Function: misoc_net_ifup + * + * Description: + * NuttX Callback: Bring up the Ethernet interface when an IP address is + * provided + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * + ****************************************************************************/ + +static int misoc_net_ifup(FAR struct net_driver_s *dev) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + +#ifdef CONFIG_NET_IPv4 + ninfo("Bringing up: %d.%d.%d.%d\n", + dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, + (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); +#endif +#ifdef CONFIG_NET_IPv6 + ninfo("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", + dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2], + dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5], + dev->d_ipv6addr[6], dev->d_ipv6addr[7]); +#endif + + /* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */ + + /* Instantiate the MAC address from priv->misoc_net_dev.d_mac.ether_addr_octet */ + +#ifdef CONFIG_NET_ICMPv6 + /* Set up IPv6 multicast address filtering */ + + misoc_net_ipv6multicast(priv); +#endif + + /* Set and activate a timer process */ + + (void)wd_start(priv->misoc_net_txpoll, MISOC_NET_WDDELAY, misoc_net_poll_expiry, 1, + (wdparm_t)priv); + + priv->misoc_net_bifup = true; + up_enable_irq(ETHMAC_INTERRUPT); + + /* Enable the RX Event Handler */ + + ethmac_sram_writer_ev_enable_write(1); + return OK; +} + +/**************************************************************************** + * Function: misoc_net_ifdown + * + * Description: + * NuttX Callback: Stop the interface. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * + ****************************************************************************/ + +static int misoc_net_ifdown(FAR struct net_driver_s *dev) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + irqstate_t flags; + + /* Disable the Ethernet interrupt */ + + flags = enter_critical_section(); + up_disable_irq(ETHMAC_INTERRUPT); + + /* Cancel the TX poll timer and TX timeout timers */ + + wd_cancel(priv->misoc_net_txpoll); + wd_cancel(priv->misoc_net_txtimeout); + + /* Put the EMAC in its reset, non-operational state. This should be + * a known configuration that will guarantee the misoc_net_ifup() always + * successfully brings the interface back up. + */ + + /* Mark the device "down" */ + + priv->misoc_net_bifup = false; + leave_critical_section(flags); + return OK; +} + +/**************************************************************************** + * Function: misoc_net_txavail_work + * + * Description: + * Perform an out-of-cycle poll on the worker thread. + * + * Parameters: + * arg - Reference to the NuttX driver state structure (cast to void*) + * + * Returned Value: + * None + * + * Assumptions: + * Called on the higher priority worker thread. + * + ****************************************************************************/ + +static void misoc_net_txavail_work(FAR void *arg) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)arg; + + /* Ignore the notification if the interface is not yet up */ + + net_lock(); + if (priv->misoc_net_bifup) + { + /* Check if there is room in the hardware to hold another outgoing packet. */ + + if (!ethmac_sram_reader_ready_read()) + { + /* If so, then poll the network for new XMIT data */ + + (void)devif_poll(&priv->misoc_net_dev, misoc_net_txpoll); + } + } + + net_unlock(); +} + +/**************************************************************************** + * Function: misoc_net_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int misoc_net_txavail(FAR struct net_driver_s *dev) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->misoc_net_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(HPWORK, &priv->misoc_net_work, misoc_net_txavail_work, priv, 0); + } + + return OK; +} + +/**************************************************************************** + * Function: misoc_net_addmac + * + * Description: + * NuttX Callback: Add the specified MAC address to the hardware multicast + * address filtering + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * mac - The MAC address to be added + * + * Returned Value: + * None + * + * Assumptions: + * + ****************************************************************************/ + +#if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) +static int misoc_net_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + + /* Add the MAC address to the hardware multicast routing table */ + + return OK; +} +#endif + +/**************************************************************************** + * Function: misoc_net_rmmac + * + * Description: + * NuttX Callback: Remove the specified MAC address from the hardware multicast + * address filtering + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * mac - The MAC address to be removed + * + * Returned Value: + * None + * + * Assumptions: + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IGMP +static int misoc_net_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac) +{ + FAR struct misoc_net_driver_s *priv = (FAR struct misoc_net_driver_s *)dev->d_private; + + /* Add the MAC address to the hardware multicast routing table */ + + return OK; +} +#endif + +/**************************************************************************** + * Function: misoc_net_ipv6multicast + * + * Description: + * Configure the IPv6 multicast MAC address. + * + * Parameters: + * priv - A reference to the private driver state structure + * + * Returned Value: + * OK on success; Negated errno on failure. + * + * Assumptions: + * + ****************************************************************************/ + +#ifdef CONFIG_NET_ICMPv6 +static void misoc_net_ipv6multicast(FAR struct misoc_net_driver_s *priv) +{ + FAR struct net_driver_s *dev; + uint16_t tmp16; + uint8_t mac[6]; + + /* For ICMPv6, we need to add the IPv6 multicast address + * + * For IPv6 multicast addresses, the Ethernet MAC is derived by + * the four low-order octets OR'ed with the MAC 33:33:00:00:00:00, + * so for example the IPv6 address FF02:DEAD:BEEF::1:3 would map + * to the Ethernet MAC address 33:33:00:01:00:03. + * + * NOTES: This appears correct for the ICMPv6 Router Solicitation + * Message, but the ICMPv6 Neighbor Solicitation message seems to + * use 33:33:ff:01:00:03. + */ + + mac[0] = 0x33; + mac[1] = 0x33; + + dev = &priv->dev; + tmp16 = dev->d_ipv6addr[6]; + mac[2] = 0xff; + mac[3] = tmp16 >> 8; + + tmp16 = dev->d_ipv6addr[7]; + mac[4] = tmp16 & 0xff; + mac[5] = tmp16 >> 8; + + ninfo("IPv6 Multicast: %02x:%02x:%02x:%02x:%02x:%02x\n", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + + (void)misoc_net_addmac(dev, mac); + +#ifdef CONFIG_NET_ICMPv6_AUTOCONF + /* Add the IPv6 all link-local nodes Ethernet address. This is the + * address that we expect to receive ICMPv6 Router Advertisement + * packets. + */ + + (void)misoc_net_addmac(dev, g_ipv6_ethallnodes.ether_addr_octet); + +#endif /* CONFIG_NET_ICMPv6_AUTOCONF */ +#ifdef CONFIG_NET_ICMPv6_ROUTER + /* Add the IPv6 all link-local routers Ethernet address. This is the + * address that we expect to receive ICMPv6 Router Solicitation + * packets. + */ + + (void)misoc_net_addmac(dev, g_ipv6_ethallrouters.ether_addr_octet); + +#endif /* CONFIG_NET_ICMPv6_ROUTER */ +} +#endif /* CONFIG_NET_ICMPv6 */ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: misoc_net_initialize + * + * Description: + * Initialize the Ethernet controller and driver + * + * Parameters: + * intf - In the case where there are multiple EMACs, this value + * identifies which EMAC is to be initialized. + * + * Returned Value: + * OK on success; Negated errno on failure. + * + * Assumptions: + * + ****************************************************************************/ + +int misoc_net_initialize(int intf) +{ + FAR struct misoc_net_driver_s *priv; + + /* Get the interface structure associated with this interface number. */ + + DEBUGASSERT(intf < CONFIG_MISOC_NET_NINTERFACES); + priv = &g_misoc_net[intf]; + + /* Check if a Ethernet chip is recognized at its I/O base */ + + /* Attach the IRQ to the driver */ + + if (irq_attach(ETHMAC_INTERRUPT, misoc_net_interrupt)) + { + /* We could not attach the ISR to the interrupt */ + + return -EAGAIN; + } + + /* clear pending int */ + + ethmac_sram_writer_ev_pending_write(1); + ethmac_sram_reader_ev_pending_write(1); + + /* Initialize the driver structure */ + + memset(priv, 0, sizeof(struct misoc_net_driver_s)); + priv->rx0_buf = (uint8_t *)ETHMAC_RX0_BASE; + priv->rx1_buf = (uint8_t *)ETHMAC_RX1_BASE; + priv->tx0_buf = (uint8_t *)ETHMAC_TX0_BASE; + priv->tx1_buf = (uint8_t *)ETHMAC_TX1_BASE; + priv->tx_buf = priv->tx0_buf; + priv->tx_slot=0; + + priv->misoc_net_dev.d_buf = g_pktbuf; /* Single packet buffer */ + priv->misoc_net_dev.d_ifup = misoc_net_ifup; /* I/F up (new IP address) callback */ + priv->misoc_net_dev.d_ifdown = misoc_net_ifdown; /* I/F down callback */ + priv->misoc_net_dev.d_txavail = misoc_net_txavail; /* New TX data callback */ +#ifdef CONFIG_NET_IGMP + priv->misoc_net_dev.d_addmac = misoc_net_addmac; /* Add multicast MAC address */ + priv->misoc_net_dev.d_rmmac = misoc_net_rmmac; /* Remove multicast MAC address */ +#endif + priv->misoc_net_dev.d_private = (FAR void *)g_misoc_net; /* Used to recover private state from dev */ + + /* Create a watchdog for timing polling for and timing of transmisstions */ + + priv->misoc_net_txpoll = wd_create(); /* Create periodic poll timer */ + priv->misoc_net_txtimeout = wd_create(); /* Create TX timeout timer */ + + /* Put the interface in the down state. This usually amounts to resetting + * the device and/or calling misoc_net_ifdown(). + */ + + /* Read the MAC address from the hardware into + * priv->misoc_net_dev.d_mac.ether_addr_octet + */ + + /* Register the device with the OS so that socket IOCTLs can be performed */ + + (void)netdev_register(&priv->misoc_net_dev, NET_LL_ETHERNET); + return OK; +} + +#endif /* CONFIG_NET && CONFIG_MISOC_NET_ETHERNET */ diff --git a/arch/misoc/src/common/misoc_serial.c b/arch/misoc/src/common/misoc_serial.c index 9b15ba8e120b8d49f5dc16a3699a01ab3278a357..c9b1f838639e4130d90763d277cfe4be479faafe 100644 --- a/arch/misoc/src/common/misoc_serial.c +++ b/arch/misoc/src/common/misoc_serial.c @@ -205,13 +205,13 @@ static char g_uart1txbuffer[CONFIG_UART1_TXBUFSIZE]; static struct misoc_dev_s g_uart1priv = { - .uartbase = CSR_UART_BASE, - .irq = UART_INTERRUPT, - .rxtx_addr = CSR_UART_RXTX_ADDR, - .rxempty_addr = CSR_UART_RXEMPTY_ADDR, - .txfull_addr = CSR_UART_TXFULL_ADDR, - .ev_status_addr = CSR_UART_EV_STATUS_ADDR, - .ev_pending_addr = CSR_UART_EV_PENDING_ADDR, + .uartbase = CSR_UART_BASE, + .irq = UART_INTERRUPT, + .rxtx_addr = CSR_UART_RXTX_ADDR, + .rxempty_addr = CSR_UART_RXEMPTY_ADDR, + .txfull_addr = CSR_UART_TXFULL_ADDR, + .ev_status_addr = CSR_UART_EV_STATUS_ADDR, + .ev_pending_addr = CSR_UART_EV_PENDING_ADDR, .ev_enable_addr = CSR_UART_EV_ENABLE_ADDR, }; @@ -312,16 +312,9 @@ static void misoc_shutdown(struct uart_dev_s *dev) static int misoc_attach(struct uart_dev_s *dev) { struct misoc_dev_s *priv = (struct misoc_dev_s *)dev->priv; - uint32_t im; - irq_attach(priv->irq, misoc_uart_interrupt); - - /* enable interrupt */ - /* TODO: move that somewhere proper ! */ - - im = irq_getmask(); - im |= (1 << UART_INTERRUPT); - irq_setmask(im); + (void)irq_attach(priv->irq, misoc_uart_interrupt); + up_enable_irq(priv->irq); return OK; } @@ -339,14 +332,8 @@ static int misoc_attach(struct uart_dev_s *dev) static void misoc_detach(struct uart_dev_s *dev) { struct misoc_dev_s *priv = (struct misoc_dev_s *)dev->priv; - uint32_t im; - - /* TODO: move that somewhere proper */ - - im = irq_getmask(); - im &= ~(1 << UART_INTERRUPT); - irq_setmask(im); + up_disable_irq(priv->irq); irq_detach(priv->irq); } diff --git a/arch/misoc/src/common/misoc_timerisr.c b/arch/misoc/src/common/misoc_timerisr.c new file mode 100644 index 0000000000000000000000000000000000000000..3de69520bed83e4415513a06a718bc7a6e629d2c --- /dev/null +++ b/arch/misoc/src/common/misoc_timerisr.c @@ -0,0 +1,151 @@ +/**************************************************************************** + * arch/risc-v/src/nr5m100/nr5_timerisr.c + * + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Modified for MISOC: + * + * Copyright (C) 2016 Ramtin Amin. All rights reserved. + * Author: Ramtin Amin + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include + +#include +#include +#include +#include + +#include "chip.h" +#include "misoc.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* The desired timer interrupt frequency is provided by the definition + * CLOCKS_PER_SEC (see include/time.h). CLOCKS_PER_SEC defines the desired + * number of system clock ticks per second. That value is a user + * configurable setting based on CONFIG_USEC_PER_TICK. It defaults to 100 + * (100 ticks per second = 10 MS interval). + * + * Given the timer input frequency (Finput). The timer correct reload + * value is: + * + * reload = Finput / CLOCKS_PER_SEC + */ + +#define SYSTICK_RELOAD ((SYSTEM_CLOCK_FREQUENCY / CLOCKS_PER_SEC) - 1) + +/* The size of the reload field is 30 bits. Verify that the reload value + * will fit in the reload register. + */ + +#if SYSTICK_RELOAD > 0x3fffffff +# error SYSTICK_RELOAD exceeds the range of the RELOAD register +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Function: up_timerisr + * + * Description: + * The timer ISR will perform a variety of services for various portions + * of the systems. + * + ****************************************************************************/ + +int up_timerisr(int irq, void *context) +{ + /* Clear event pending */ + + timer0_ev_pending_write(timer0_ev_pending_read()); + + /* Process timer interrupt */ + + sched_process_timer(); + return 0; +} + +/**************************************************************************** + * Function: up_timer_initialize + * + * Description: + * This function is called during start-up to initialize + * the timer interrupt. + * + ****************************************************************************/ + +void misoc_timer_initialize(void) +{ + /* Clear event pending */ + + timer0_ev_pending_write(timer0_ev_pending_read()); + + /* Disable timer*/ + + timer0_en_write(0); + + /* Setup the timer reload register to generate interrupts at the rate of + * CLOCKS_PER_SEC. + */ + + timer0_reload_write(SYSTICK_RELOAD); + timer0_load_write(SYSTICK_RELOAD); + + /* Enable timer */ + + timer0_en_write(1); + + /* Attach the timer interrupt vector */ + + (void)irq_attach(TIMER0_INTERRUPT, up_timerisr); + + /* And enable the timer interrupt */ + + up_enable_irq(TIMER0_INTERRUPT); + + /* Enable IRQ of the timer core */ + + timer0_ev_enable_write(1); +} diff --git a/arch/misoc/src/lm32/Kconfig b/arch/misoc/src/lm32/Kconfig index b9178978e75aa84537854b6f0ff0e001890cb12e..c10407ef28b9b3da6c13e928e8b7978e6d548554 100644 --- a/arch/misoc/src/lm32/Kconfig +++ b/arch/misoc/src/lm32/Kconfig @@ -7,8 +7,8 @@ if ARCH_CHIP_LM32 choice prompt "Toolchain Selection" - default LM32_TOOLCHAIN_GNUW if HOST_WINDOWS - default LM32_TOOLCHAIN_GNUL if !HOST_WINDOWS + default LM32_TOOLCHAIN_GNUW if TOOLCHAIN_WINDOWS + default LM32_TOOLCHAIN_GNUL if !TOOLCHAIN_WINDOWS config LM32_TOOLCHAIN_BUILDROOT bool "Buildroot (Cygwin or Linux)" @@ -22,7 +22,7 @@ config LM32_TOOLCHAIN_GNUL config LM32_TOOLCHAIN_GNUW bool "Generic GNU toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 4.5 or newer) configured for lm32-elf-. diff --git a/arch/misoc/src/lm32/Make.defs b/arch/misoc/src/lm32/Make.defs index 9c0768b2a4f25204720e987d049cfbc1288700ce..a2ea84d61c82d05e30e76928baeac2821768ffa4 100644 --- a/arch/misoc/src/lm32/Make.defs +++ b/arch/misoc/src/lm32/Make.defs @@ -39,7 +39,8 @@ HEAD_ASRC = lm32_vectors.S CMN_ASRCS = CMN_CSRCS = misoc_lowputs.c misoc_serial.c misoc_mdelay.c CMN_CSRCS += misoc_modifyreg8.c misoc_modifyreg16.c misoc_modifyreg32.c -CMN_CSRCS += misoc_puts.c misoc_udelay.c +CMN_CSRCS += misoc_puts.c misoc_udelay.c misoc_timerisr.c misoc_net.c +CMN_CSRCS += misoc_flushcache.c CHIP_ASRCS = lm32_syscall.S @@ -49,3 +50,5 @@ CHIP_CSRCS += lm32_doirq.c lm32_dumpstate.c lm32_exit.c lm32_idle.c CHIP_CSRCS += lm32_initialize.c lm32_initialstate.c lm32_interruptcontext.c CHIP_CSRCS += lm32_irq.c lm32_releasepending.c lm32_releasestack.c CHIP_CSRCS += lm32_stackframe.c lm32_swint.c lm32_unblocktask.c +CHIP_CSRCS += lm32_reprioritizertr.c lm32_schedulesigaction.c lm32_sigdeliver.c +CHIP_CSRCS += lm32_flushcache.c \ No newline at end of file diff --git a/arch/misoc/src/lm32/lm32.h b/arch/misoc/src/lm32/lm32.h index eac1fe76516008fe1ea3b3e32d8df8a0f12fafc0..a09bcfec47cdee83a8cda725631a4729d12618e1 100644 --- a/arch/misoc/src/lm32/lm32.h +++ b/arch/misoc/src/lm32/lm32.h @@ -57,16 +57,17 @@ * logic. */ -#define STACK_COLOR 0xdeadbeef -#define INTSTACK_COLOR 0xdeadbeef -#define HEAP_COLOR 'h' +#define STACK_COLOR 0xdeadbeef +#define INTSTACK_COLOR 0xdeadbeef +#define HEAP_COLOR 'h' /* In the LM32 model, the state is copied from the stack to the TCB, but * only a referenced is passed to get the state from the TCB. */ -#define up_savestate(regs) lm32_copystate(regs, (uint32_t*)g_current_regs) -#define up_restorestate(regs) (g_current_regs = regs) +#define up_savestate(regs) lm32_copystate(regs, (uint32_t*)g_current_regs) +#define up_copystate(rega,regb) lm32_copystate(rega, regb) +#define up_restorestate(regs) (g_current_regs = regs) /* Determine which (if any) console driver to use. If a console is enabled * and no other console device is specified, then a serial console is @@ -148,6 +149,11 @@ void lm32_timer_initialize(void); void lm32_sigdeliver(void); +/* Cache flushing ***********************************************************/ + +void lm32_flush_dcache(void); +void lm32_flush_icache(void); + /* Debug ********************************************************************/ void lm32_dumpstate(void); diff --git a/arch/misoc/src/lm32/lm32_exit.c b/arch/misoc/src/lm32/lm32_exit.c index a5f0cd3743395ee4beac046f37ed9d1ed81d260a..f6cf75f6f4d9ae0aa4e983333771650e5bfe4341 100644 --- a/arch/misoc/src/lm32/lm32_exit.c +++ b/arch/misoc/src/lm32/lm32_exit.c @@ -1,9 +1,9 @@ /**************************************************************************** * arch/misoc/src/lm32/lm32_exit.c * - * Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt - * Ramtin Amin + * Ramtin Amin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,8 +42,9 @@ #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT # include #endif @@ -139,11 +140,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/misoc/src/lm32/lm32_flushcache.c b/arch/misoc/src/lm32/lm32_flushcache.c new file mode 100644 index 0000000000000000000000000000000000000000..8d1d653a6b56717a7e75fa2938a11b85c4bf6da7 --- /dev/null +++ b/arch/misoc/src/lm32/lm32_flushcache.c @@ -0,0 +1,86 @@ +/**************************************************************************** + * arch/misoc/src/lm32/lm32_flushcache.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Ramtin Amin + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 +#include + +#include "chip.h" +#include "lm32.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lm32_flush_dcache + * + * Description: + * Flush the data cache of the cpu + * + ****************************************************************************/ + +void lm32_flush_dcache(void) +{ + asm volatile( + "wcsr DCC, r0\n" + "nop\n" + "nop\n" + "nop\n" + "nop\n" + ); +} + +/**************************************************************************** + * Name: lm32_flush_icache + * + * Description: + * Flush the instruction cache of the cpu + * + ****************************************************************************/ + +void lm32_flush_icache(void) +{ + asm volatile( + "wcsr ICC, r0\n" + "nop\n" + "nop\n" + "nop\n" + "nop\n" + ); +} diff --git a/arch/misoc/src/lm32/lm32_initialize.c b/arch/misoc/src/lm32/lm32_initialize.c index 23e6e8fc1f092c69ac0679d34e805b61a32fca1d..1c4323215af1e0f9f5f518bee2d350dee1ceeb64 100644 --- a/arch/misoc/src/lm32/lm32_initialize.c +++ b/arch/misoc/src/lm32/lm32_initialize.c @@ -72,7 +72,14 @@ void up_initialize(void) /* Initialize the serial driver */ -#warning REVISIT: Here you should all misoc_serial_initialize(). That initializes the entire serial driver, a part of the operation is the uart initialization. - misoc_serial_initialize(); + + /* Initialize the system timer */ + + misoc_timer_initialize(); + + /* Initialize the network cores */ + + misoc_net_initialize(0); + } diff --git a/arch/misoc/src/lm32/lm32_initialstate.c b/arch/misoc/src/lm32/lm32_initialstate.c index 6064e186c84ead0f8dab35e9783ce126e7b4082b..f46d2aaf07b476136dc8c0fd9f1d043a41397679 100644 --- a/arch/misoc/src/lm32/lm32_initialstate.c +++ b/arch/misoc/src/lm32/lm32_initialstate.c @@ -101,7 +101,7 @@ void up_initial_state(struct tcb_s *tcb) /* Initial state of IE: Interrupts enabled */ - xcp->regs[REG_INT_CTX] = 1; + xcp->regs[REG_INT_CTX] = 2; /* If this task is running PIC, then set the PIC base register to the * address of the allocated D-Space region. diff --git a/arch/misoc/src/lm32/lm32_reprioritizertr.c b/arch/misoc/src/lm32/lm32_reprioritizertr.c new file mode 100644 index 0000000000000000000000000000000000000000..e6b42611018b928e66eca1b246c1489d6710f721 --- /dev/null +++ b/arch/misoc/src/lm32/lm32_reprioritizertr.c @@ -0,0 +1,203 @@ +/**************************************************************************** + * arch/misoc/src/lm32/lm32_reprioritizertr.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include + +#include +#include + +#include "sched/sched.h" +#include "group/group.h" +#include "lm32.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_reprioritize_rtr + * + * Description: + * Called when the priority of a running or + * ready-to-run task changes and the reprioritization will + * cause a context switch. Two cases: + * + * 1) The priority of the currently running task drops and the next + * task in the ready to run list has priority. + * 2) An idle, ready to run task's priority has been raised above the + * the priority of the current, running task and it now has the + * priority. + * + * Inputs: + * tcb: The TCB of the task that has been reprioritized + * priority: The new task priority + * + ****************************************************************************/ + +void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) +{ + /* Verify that the caller is sane */ + + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE +#if SCHED_PRIORITY_MIN > 0 + || priority < SCHED_PRIORITY_MIN +#endif +#if SCHED_PRIORITY_MAX < UINT8_MAX + || priority > SCHED_PRIORITY_MAX +#endif + ) + { + PANIC(); + } + else + { + struct tcb_s *rtcb = this_task(); + bool switch_needed; + + sinfo("TCB=%p PRI=%d\n", tcb, priority); + + /* Remove the tcb task from the ready-to-run list. + * sched_removereadytorun will return true if we just + * remove the head of the ready to run list. + */ + + switch_needed = sched_removereadytorun(tcb); + + /* Setup up the new task priority */ + + tcb->sched_priority = (uint8_t)priority; + + /* Return the task to the specified blocked task list. + * sched_addreadytorun will return true if the task was + * added to the new list. We will need to perform a context + * switch only if the EXCLUSIVE or of the two calls is non-zero + * (i.e., one and only one the calls changes the head of the + * ready-to-run list). + */ + + switch_needed ^= sched_addreadytorun(tcb); + + /* Now, perform the context switch if one is needed */ + + if (switch_needed) + { + /* If we are going to do a context switch, then now is the right + * time to add any pending tasks back into the ready-to-run list. + * task list now + */ + + if (g_pendingtasks.head) + { + sched_mergepending(); + } + + /* Update scheduler parameters */ + + sched_suspend_scheduler(rtcb); + + /* Are we in an interrupt handler? */ + + if (g_current_regs) + { + /* Yes, then we have to do things differently. + * Just copy the g_current_regs into the OLD rtcb. + */ + + up_savestate(rtcb->xcp.regs); + + /* Restore the exception context of the rtcb at the (new) head + * of the ready-to-run task list. + */ + + rtcb = this_task(); + + /* Update scheduler parameters */ + + sched_resume_scheduler(rtcb); + + /* Then switch contexts. Any necessary address environment + * changes will be made when the interrupt returns. + */ + + up_restorestate(rtcb->xcp.regs); + } + + /* No, then we will need to perform the user context switch */ + + else + { + /* Switch context to the context of the task at the head of the + * ready to run list. + */ + + struct tcb_s *nexttcb = this_task(); + +#ifdef CONFIG_ARCH_ADDRENV + /* Make sure that the address environment for the previously + * running task is closed down gracefully (data caches dump, + * MMU flushed) and set up the address environment for the new + * thread at the head of the ready-to-run list. + */ + + (void)group_addrenv(nexttcb); +#endif + /* Update scheduler parameters */ + + sched_resume_scheduler(nexttcb); + + /* Then switch contexts */ + + up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + + /* up_switchcontext forces a context switch to the task at the + * head of the ready-to-run list. It does not 'return' in the + * normal sense. When it does return, it is because the blocked + * task is again ready to run and has execution priority. + */ + } + } + } +} diff --git a/arch/misoc/src/lm32/lm32_schedulesigaction.c b/arch/misoc/src/lm32/lm32_schedulesigaction.c new file mode 100644 index 0000000000000000000000000000000000000000..d72e68cf64c2dc6c2f0cb11a0fddb2c80b26b79e --- /dev/null +++ b/arch/misoc/src/lm32/lm32_schedulesigaction.c @@ -0,0 +1,206 @@ +/**************************************************************************** + * arch/misoc/src/lm32/lm32_schedulesigaction.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Modified for MISOC: + * + * Copyright (C) 2016 Ramtin Amin. All rights reserved. + * Author: Ramtin Amin + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include + +#include +#include +#include + +#include "sched/sched.h" +#include "lm32.h" + +#ifndef CONFIG_DISABLE_SIGNALS + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_schedule_sigaction + * + * Description: + * This function is called by the OS when one or more + * signal handling actions have been queued for execution. + * The architecture specific code must configure things so + * that the 'igdeliver' callback is executed on the thread + * specified by 'tcb' as soon as possible. + * + * This function may be called from interrupt handling logic. + * + * This operation should not cause the task to be unblocked + * nor should it cause any immediate execution of sigdeliver. + * Typically, a few cases need to be considered: + * + * (1) This function may be called from an interrupt handler + * During interrupt processing, all xcptcontext structures + * should be valid for all tasks. That structure should + * be modified to invoke sigdeliver() either on return + * from (this) interrupt or on some subsequent context + * switch to the recipient task. + * (2) If not in an interrupt handler and the tcb is NOT + * the currently executing task, then again just modify + * the saved xcptcontext structure for the recipient + * task so it will invoke sigdeliver when that task is + * later resumed. + * (3) If not in an interrupt handler and the tcb IS the + * currently executing task -- just call the signal + * handler now. + * + ****************************************************************************/ + +void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) +{ + irqstate_t flags; + + sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + + /* Make sure that interrupts are disabled */ + + flags = enter_critical_section(); + + /* Refuse to handle nested signal actions */ + + if (!tcb->xcp.sigdeliver) + { + /* First, handle some special cases when the signal is + * being delivered to the currently executing task. + */ + + sinfo("rtcb=0x%p g_current_regs=0x%p\n", + this_task(), g_current_regs); + + if (tcb == this_task()) + { + /* CASE 1: We are not in an interrupt handler and + * a task is signalling itself for some reason. + */ + + if (!g_current_regs) + { + /* In this case just deliver the signal now. */ + + sigdeliver(tcb); + } + + /* CASE 2: We are in an interrupt handler AND the + * interrupted task is the same as the one that + * must receive the signal, then we will have to modify + * the return state as well as the state in the TCB. + * + * Hmmm... there looks like a latent bug here: The following + * logic would fail in the strange case where we are in an + * interrupt handler, the thread is signalling itself, but + * a context switch to another task has occurred so that + * g_current_regs does not refer to the thread of this_task()! + */ + + else + { + /* Save the return EPC and STATUS registers. These will be + * restored by the signal trampoline after the signals have + * been delivered. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_epc = g_current_regs[REG_EPC]; + + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + g_current_regs[REG_EPC] = (uint32_t)lm32_sigdeliver; + g_current_regs[REG_INT_CTX] = 0; + + + /* And make sure that the saved context in the TCB + * is the same as the interrupt return context. + */ + + up_savestate(tcb->xcp.regs); + + sinfo("PC/STATUS Saved: %08x/%08x New: %08x/%08x\n", + tcb->xcp.saved_epc, tcb->xcp.saved_status, + g_current_regs[REG_EPC], g_current_regs[REG_STATUS]); + } + } + + /* Otherwise, we are (1) signaling a task is not running + * from an interrupt handler or (2) we are not in an + * interrupt handler and the running task is signalling + * some non-running task. + */ + + else + { + /* Save the return EPC and STATUS registers. These will be + * restored by the signal trampoline after the signals have + * been delivered. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_epc = tcb->xcp.regs[REG_EPC]; + tcb->xcp.saved_int_ctx = tcb->xcp.regs[REG_INT_CTX]; + + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + tcb->xcp.regs[REG_EPC] = (uint32_t)lm32_sigdeliver; + tcb->xcp.regs[REG_INT_CTX] = 0; + + sinfo("PC/STATUS Saved: %08x/%08x New: %08x/%08x\n", + tcb->xcp.saved_epc, tcb->xcp.saved_status, + tcb->xcp.regs[REG_EPC], tcb->xcp.regs[REG_STATUS]); + } + } + + leave_critical_section(flags); +} + +#endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/misoc/src/lm32/lm32_sigdeliver.c b/arch/misoc/src/lm32/lm32_sigdeliver.c new file mode 100644 index 0000000000000000000000000000000000000000..f8896914697b3e41fce636d977fb0e6e53197557 --- /dev/null +++ b/arch/misoc/src/lm32/lm32_sigdeliver.c @@ -0,0 +1,136 @@ +/**************************************************************************** + * arch/misoc/src/lm32/lm32_sigdeliver.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "sched/sched.h" +#include "lm32.h" + +#ifndef CONFIG_DISABLE_SIGNALS + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lm32_sigdeliver + * + * Description: + * This is the a signal handling trampoline. When a signal action was + * posted. The task context was mucked with and forced to branch to this + * location with interrupts disabled. + * + ****************************************************************************/ + +void lm32_sigdeliver(void) +{ + struct tcb_s *rtcb = this_task(); + uint32_t regs[XCPTCONTEXT_REGS]; + sig_deliver_t sigdeliver; + + /* Save the errno. This must be preserved throughout the signal handling + * so that the user code final gets the correct errno value (probably + * EINTR). + */ + + int saved_errno = rtcb->pterrno; + + board_autoled_on(LED_SIGNAL); + + sinfo("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n", + rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head); + ASSERT(rtcb->xcp.sigdeliver != NULL); + + /* Save the real return state on the stack. */ + + up_copystate(regs, rtcb->xcp.regs); + regs[REG_EPC] = rtcb->xcp.saved_epc; + regs[REG_INT_CTX] = rtcb->xcp.saved_int_ctx; + + /* Get a local copy of the sigdeliver function pointer. We do this so that + * we can nullify the sigdeliver function pointer in the TCB and accept + * more signal deliveries while processing the current pending signals. + */ + + sigdeliver = rtcb->xcp.sigdeliver; + rtcb->xcp.sigdeliver = NULL; + + /* Then restore the task interrupt state */ + + up_irq_restore((irqstate_t)regs[REG_INT_CTX]); + + /* Deliver the signals */ + + sigdeliver(rtcb); + + /* Output any debug messages BEFORE restoring errno (because they may + * alter errno), then disable interrupts again and restore the original + * errno that is needed by the user logic (it is probably EINTR). + */ + + sinfo("Resuming EPC: %08x INT_CTX: %08x\n", regs[REG_EPC], regs[REG_INT_CTX]); + + (void)up_irq_save(); + rtcb->pterrno = saved_errno; + + /* Then restore the correct state for this thread of + * execution. + */ + + board_autoled_off(LED_SIGNAL); + up_fullcontextrestore(regs); + + /* up_fullcontextrestore() should not return but could if the software + * interrupts are disabled. + */ + + PANIC(); +} + +#endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/misoc/src/lm32/lm32_vectors.S b/arch/misoc/src/lm32/lm32_vectors.S index 4cc83a3919735b3cf1b4ec75eb3d3d7ae3871a86..45407f0db7dddb30e52d2760eccf80e1bda0365d 100644 --- a/arch/misoc/src/lm32/lm32_vectors.S +++ b/arch/misoc/src/lm32/lm32_vectors.S @@ -208,7 +208,6 @@ _do_reset: sw (sp+REG_X23), r23 sw (sp+REG_X24), r24 sw (sp+REG_X25), r25 - sw (sp+REG_GP), r26 sw (sp+REG_FP), r27 @@ -217,7 +216,7 @@ _do_reset: addi r1, sp, 136 sw (sp+REG_SP), r1 - /* reg RA done later */ + /* Reg RA done later */ sw (sp+REG_EA), r30 sw (sp+REG_BA), r31 @@ -235,6 +234,10 @@ _do_reset: /* The 2nd argument is the regs pointer */ addi r2, sp, 0 + + /* Move sp away from X0 */ + + addi sp, sp, -4 ret .restore_all_and_eret: diff --git a/arch/renesas/src/common/up_exit.c b/arch/renesas/src/common/up_exit.c index f565d3d3d4390bab6d8c272d5747f3d9693073c2..ed61c7c299fe163914ab542ad07e991cbb025de7 100644 --- a/arch/renesas/src/common/up_exit.c +++ b/arch/renesas/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/renesas/src/=common/up_exit.c * - * Copyright (C) 2008-2009, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,9 +43,9 @@ #include #include - +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -141,11 +141,11 @@ void _exit(int status) { struct tcb_s* tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/rgmp/Kconfig b/arch/rgmp/Kconfig deleted file mode 100644 index 690f88e6145f028ed9fcbefcbfeb5b61e4096021..0000000000000000000000000000000000000000 --- a/arch/rgmp/Kconfig +++ /dev/null @@ -1,46 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -if ARCH_RGMP -comment "RGMP Configuration Options" - -choice - prompt "RGMP Architecture" - default RGMP_SUBARCH_X86 - -config RGMP_SUBARCH_ARM - bool "ARM" - ---help--- - RGMP ARM architecture" - -config RGMP_SUBARCH_X86 - bool "x86" - ---help--- - RGMP x86 architecture" - -endchoice # RGMP Architecture - -config RGMP_SUBARCH - string - default "arm" if RGMP_SUBARCH_ARM - default "x86" if RGMP_SUBARCH_X86 - -menu "x86 Peripheral Selections" - depends on RGMP_SUBARCH_X86 - -config COM1 - bool "COM1" - -config COM2 - bool "COM1" - -config COM3 - bool "COM1" - -config COM4 - bool "COM1" - -endmenu # x86 Peripheral Selections -endif # ARCH_RGMP diff --git a/arch/rgmp/include/.gitignore b/arch/rgmp/include/.gitignore deleted file mode 100644 index e6460c4a67846d5801c3600ce961277e3644f647..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/board -/chip - diff --git a/arch/rgmp/include/arch.h b/arch/rgmp/include/arch.h deleted file mode 100644 index af99356ea16a79422950d68cc4cb4abd7f58e494..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/arch.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/arch.h - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __RGMP_ARCH_ARCH_H -#define __RGMP_ARCH_ARCH_H - -#include - -#ifndef __ASSEMBLY__ - -#include - -struct up_wait { - struct up_wait *next; - struct tcb_s *task; -}; - -extern struct tcb_s *current_task; - -void up_sigentry(void); - -int up_register_bridge(char *name, int size); -int up_unregister_bridge(char *name); - -#endif /* !__ASSEMBLY__ */ - -#endif diff --git a/arch/rgmp/include/inttypes.h b/arch/rgmp/include/inttypes.h deleted file mode 100644 index 4d3d40aef2ef791fd0685969821a55f718fff594..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/inttypes.h +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/inttypes.h - * - * Copyright (C) 2016 Omni Hoverboards Inc. All rights reserved. - * Author: Paul Alexander Patience - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_INTTYPES_H -#define __ARCH_RGMP_INCLUDE_INTTYPES_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define PRId8 "d" -#define PRId16 "d" -#define PRId32 "d" -#define PRId64 "lld" - -#define PRIdLEAST8 "d" -#define PRIdLEAST16 "d" -#define PRIdLEAST32 "d" -#define PRIdLEAST64 "lld" - -#define PRIdFAST8 "d" -#define PRIdFAST16 "d" -#define PRIdFAST32 "d" -#define PRIdFAST64 "lld" - -#define PRIdMAX "lld" -#define PRIdPTR "d" - -#define PRIi8 "i" -#define PRIi16 "i" -#define PRIi32 "i" -#define PRIi64 "lli" - -#define PRIiLEAST8 "i" -#define PRIiLEAST16 "i" -#define PRIiLEAST32 "i" -#define PRIiLEAST64 "lli" - -#define PRIiFAST8 "i" -#define PRIiFAST16 "i" -#define PRIiFAST32 "i" -#define PRIiFAST64 "lli" - -#define PRIiMAX "lli" -#define PRIiPTR "i" - -#define PRIo8 "o" -#define PRIo16 "o" -#define PRIo32 "o" -#define PRIo64 "llo" - -#define PRIoLEAST8 "o" -#define PRIoLEAST16 "o" -#define PRIoLEAST32 "o" -#define PRIoLEAST64 "llo" - -#define PRIoFAST8 "o" -#define PRIoFAST16 "o" -#define PRIoFAST32 "o" -#define PRIoFAST64 "llo" - -#define PRIoMAX "llo" -#define PRIoPTR "o" - -#define PRIu8 "u" -#define PRIu16 "u" -#define PRIu32 "u" -#define PRIu64 "llu" - -#define PRIuLEAST8 "u" -#define PRIuLEAST16 "u" -#define PRIuLEAST32 "u" -#define PRIuLEAST64 "llu" - -#define PRIuFAST8 "u" -#define PRIuFAST16 "u" -#define PRIuFAST32 "u" -#define PRIuFAST64 "llu" - -#define PRIuMAX "llu" -#define PRIuPTR "u" - -#define PRIx8 "x" -#define PRIx16 "x" -#define PRIx32 "x" -#define PRIx64 "llx" - -#define PRIxLEAST8 "x" -#define PRIxLEAST16 "x" -#define PRIxLEAST32 "x" -#define PRIxLEAST64 "llx" - -#define PRIxFAST8 "x" -#define PRIxFAST16 "x" -#define PRIxFAST32 "x" -#define PRIxFAST64 "llx" - -#define PRIxMAX "llx" -#define PRIxPTR "x" - -#define PRIX8 "X" -#define PRIX16 "X" -#define PRIX32 "X" -#define PRIX64 "llX" - -#define PRIXLEAST8 "X" -#define PRIXLEAST16 "X" -#define PRIXLEAST32 "X" -#define PRIXLEAST64 "llX" - -#define PRIXFAST8 "X" -#define PRIXFAST16 "X" -#define PRIXFAST32 "X" -#define PRIXFAST64 "llX" - -#define PRIXMAX "llX" -#define PRIXPTR "X" - -#define SCNd8 "hhd" -#define SCNd16 "hd" -#define SCNd32 "d" -#define SCNd64 "lld" - -#define SCNdLEAST8 "hhd" -#define SCNdLEAST16 "hd" -#define SCNdLEAST32 "d" -#define SCNdLEAST64 "lld" - -#define SCNdFAST8 "hhd" -#define SCNdFAST16 "hd" -#define SCNdFAST32 "d" -#define SCNdFAST64 "lld" - -#define SCNdMAX "lld" -#define SCNdPTR "d" - -#define SCNi8 "hhi" -#define SCNi16 "hi" -#define SCNi32 "i" -#define SCNi64 "lli" - -#define SCNiLEAST8 "hhi" -#define SCNiLEAST16 "hi" -#define SCNiLEAST32 "i" -#define SCNiLEAST64 "lli" - -#define SCNiFAST8 "hhi" -#define SCNiFAST16 "hi" -#define SCNiFAST32 "i" -#define SCNiFAST64 "lli" - -#define SCNiMAX "lli" -#define SCNiPTR "i" - -#define SCNo8 "hho" -#define SCNo16 "ho" -#define SCNo32 "o" -#define SCNo64 "llo" - -#define SCNoLEAST8 "hho" -#define SCNoLEAST16 "ho" -#define SCNoLEAST32 "o" -#define SCNoLEAST64 "llo" - -#define SCNoFAST8 "hho" -#define SCNoFAST16 "ho" -#define SCNoFAST32 "o" -#define SCNoFAST64 "llo" - -#define SCNoMAX "llo" -#define SCNoPTR "o" - -#define SCNu8 "hhu" -#define SCNu16 "hu" -#define SCNu32 "u" -#define SCNu64 "llu" - -#define SCNuLEAST8 "hhu" -#define SCNuLEAST16 "hu" -#define SCNuLEAST32 "u" -#define SCNuLEAST64 "llu" - -#define SCNuFAST8 "hhu" -#define SCNuFAST16 "hu" -#define SCNuFAST32 "u" -#define SCNuFAST64 "llu" - -#define SCNuMAX "llu" -#define SCNuPTR "u" - -#define SCNx8 "hhx" -#define SCNx16 "hx" -#define SCNx32 "x" -#define SCNx64 "llx" - -#define SCNxLEAST8 "hhx" -#define SCNxLEAST16 "hx" -#define SCNxLEAST32 "x" -#define SCNxLEAST64 "llx" - -#define SCNxFAST8 "hhx" -#define SCNxFAST16 "hx" -#define SCNxFAST32 "x" -#define SCNxFAST64 "llx" - -#define SCNxMAX "llx" -#define SCNxPTR "x" - -#endif /* __ARCH_RGMP_INCLUDE_INTTYPES_H */ diff --git a/arch/rgmp/include/irq.h b/arch/rgmp/include/irq.h deleted file mode 100644 index b4c4f37d2d03741bdfd1023b8c3ad35a0cbf6271..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/irq.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/irq.h - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_IRQ_H -#define __ARCH_RGMP_INCLUDE_IRQ_H - -#define NR_IRQS 0 - -#ifndef __ASSEMBLY__ - -#include - -#include -#include - -struct xcptcontext -{ - struct rgmp_context ctx; - - /* For signal using */ - - unsigned int save_eip; - unsigned int save_eflags; - void *sigdeliver; -}; - -void push_xcptcontext(struct xcptcontext *xcp); -void pop_xcptcontext(struct xcptcontext *xcp); - -extern int nest_irq; - -/* Name: up_irq_save, up_irq_restore, and friends. - * - * NOTE: This function should never be called from application code and, - * as a general rule unless you really know what you are doing, this - * function should not be called directly from operation system code either: - * Typically, the wrapper functions, enter_critical_section() and - * leave_critical section(), are probably what you really want. - */ - -static inline irqstate_t up_irq_save(void) -{ - unsigned long flags; - local_irq_save(flags); - return flags; -} - -static inline void up_irq_restore(irqstate_t flags) -{ - local_irq_restore(flags); -} - -#endif /* !__ASSEMBLY__ */ - -#endif diff --git a/arch/rgmp/include/limits.h b/arch/rgmp/include/limits.h deleted file mode 100644 index a17af23d99c5f55eb18ca12686f5c21732fa3d3b..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/limits.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/limits.h - * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_LIMITS_H -#define __ARCH_RGMP_INCLUDE_LIMITS_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CHAR_BIT 8 -#define SCHAR_MIN (-SCHAR_MAX - 1) -#define SCHAR_MAX 127 -#define UCHAR_MAX 255 - -/* These could be different on machines where char is unsigned */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MIN 0 -#define CHAR_MAX UCHAR_MAX -#else -#define CHAR_MIN SCHAR_MIN -#define CHAR_MAX SCHAR_MAX -#endif - -#define SHRT_MIN (-SHRT_MAX - 1) -#define SHRT_MAX 32767 -#define USHRT_MAX 65535U - -#define INT_MIN (-INT_MAX - 1) -#define INT_MAX 2147483647 -#define UINT_MAX 4294967295U - -/* These change on 32-bit and 64-bit platforms */ - -#define LONG_MIN (-LONG_MAX - 1) -#define LONG_MAX 2147483647L -#define ULONG_MAX 4294967295UL - -#define LLONG_MIN (-LLONG_MAX - 1) -#define LLONG_MAX 9223372036854775807LL -#define ULLONG_MAX 18446744073709551615ULL - -/* A pointer is 4 bytes */ - -#define PTR_MIN (-PTR_MAX - 1) -#define PTR_MAX 2147483647 -#define UPTR_MAX 4294967295U - -#endif /* __ARCH_RGMP_INCLUDE_LIMITS_H */ diff --git a/arch/rgmp/include/math.h b/arch/rgmp/include/math.h deleted file mode 100644 index e042ba4a3c50c30105d660229360df5c8f286dfe..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/math.h +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/math.h - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_MATH_H -#define __ARCH_RGMP_INCLUDE_MATH_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -#include - -// following functions are not implemented by RGMP math library -// don't use them -// declared here for cmath - -/* General Functions ********************************************************/ - -float ceilf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double ceil (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double ceill (long double x); -#endif - -float floorf(float x); -#ifdef CONFIG_HAVE_DOUBLE -//double floor (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double floorl(long double x); -#endif - -float fabsf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double fabs (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double fabsl (long double x); -#endif - -float modff (float x, float *iptr); -#ifdef CONFIG_HAVE_DOUBLE -//double modf (double x, double *iptr); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double modfl (long double x, long double *iptr); -#endif - -float fmodf (float x, float div); -#ifdef CONFIG_HAVE_DOUBLE -//double fmod (double x, double div); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double fmodl (long double x, long double div); -#endif - -/* Exponential and Logarithmic Functions ************************************/ - -float powf (float b, float e); -#ifdef CONFIG_HAVE_DOUBLE -//double pow (double b, double e); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double powl (long double b, long double e); -#endif - -float expf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double exp (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double expl (long double x); -#endif - -float logf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double log (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double logl (long double x); -#endif - -float log10f(float x); -#ifdef CONFIG_HAVE_DOUBLE -//double log10 (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double log10l(long double x); -#endif - -float log2f (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double log2 (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double log2l (long double x); -#endif - -float sqrtf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double sqrt (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double sqrtl (long double x); -#endif - -float ldexpf(float x, int n); -#ifdef CONFIG_HAVE_DOUBLE -double ldexp (double x, int n); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double ldexpl(long double x, int n); -#endif - -float frexpf(float x, int *exp); -#ifdef CONFIG_HAVE_DOUBLE -double frexp (double x, int *exp); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double frexpl(long double x, int *exp); -#endif - -/* Trigonometric Functions **************************************************/ - -float sinf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double sin (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double sinl (long double x); -#endif - -float cosf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double cos (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double cosl (long double x); -#endif - -float tanf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double tan (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double tanl (long double x); -#endif - -float asinf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double asin (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double asinl (long double x); -#endif - -float acosf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double acos (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double acosl (long double x); -#endif - -float atanf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double atan (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double atanl (long double x); -#endif - -float atan2f(float y, float x); -#ifdef CONFIG_HAVE_DOUBLE -//double atan2 (double y, double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double atan2l(long double y, long double x); -#endif - -float sinhf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double sinh (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double sinhl (long double x); -#endif - -float coshf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double cosh (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double coshl (long double x); -#endif - -float tanhf (float x); -#ifdef CONFIG_HAVE_DOUBLE -//double tanh (double x); -#endif -#ifdef CONFIG_HAVE_LONG_DOUBLE -long double tanhl (long double x); -#endif - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __ARCH_RGMP_INCLUDE_MATH_H */ diff --git a/arch/rgmp/include/stdbool.h b/arch/rgmp/include/stdbool.h deleted file mode 100644 index eb1bee1adb82a3597c09bcc59eae33a02c534083..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/stdbool.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/stdbool.h - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_STDBOOL_H -#define __ARCH_RGMP_INCLUDE_STDBOOL_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* bool, true, and false must be provided as macros so that they can be - * redefined by the application if necessary. - * - * NOTE: Under C99 'bool' is required to be defined to be the intrinsic type - * _Bool. However, in this NuttX context, we need backward compatibility - * to pre-C99 standards where _Bool is not an intrinsic type. Hence, we - * use _Bool8 as the underlying type. - */ - -#define true 1 -#define false 0 - -#define __bool_true_false_are_defined 1 - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* A byte is the smallest address memory element (at least in architectures - * that do not support bit banding). The requirement is only that type _Bool - * be large enough to hold the values 0 and 1. We select uint8_t to minimize - * the RAM footprint of the executable. - * - * NOTE: We can't actually define the type _Bool here. Under C99 _Bool is - * an intrinsic type and cannot be the target of a typedef. However, in this - * NuttX context, we also need backward compatibility to pre-C99 standards - * where _Bool is not an intrinsic type. We work around this by using _Bool8 - * as the underlying type. - */ - -typedef uint8_t _Bool8; - -#endif /* __ARCH_RGMP_INCLUDE_STDBOOL_H */ diff --git a/arch/rgmp/include/stdint.h b/arch/rgmp/include/stdint.h deleted file mode 100644 index 07b9ffdeeb2d5d45e94daca6f34dc84ee1a27b33..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/stdint.h +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/stdint.h - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_STDINTL_H -#define __ARCH_RGMP_INCLUDE_STDINTL_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Limits of exact-width integer types */ - -#define INT8_MIN 0x80 -#define INT8_MAX 0x7f -#define UINT8_MAX 0xff - -#define INT16_MIN 0x8000 -#define INT16_MAX 0x7fff -#define UINT16_MAX 0xffff - -#ifdef __INT64_DEFINED -# define INT24_MIN 0x800000 -# define INT24_MAX 0x7fffff -# define UINT24_MAX 0xffffff -#endif - -#define INT32_MIN 0x80000000 -#define INT32_MAX 0x7fffffff -#define UINT32_MAX 0xffffffff - -#ifdef __INT64_DEFINED -# define INT64_MIN 0x8000000000000000 -# define INT64_MAX 0x7fffffffffffffff -# define UINT64_MAX 0xffffffffffffffff -#endif - -/* Limits of minimum-width integer types */ - -#define INT8_LEASTN_MIN 0x80 -#define INT8_LEASTN_MAX 0x7f -#define UINT8_LEASTN_MAX 0xff - -#define INT16_LEASTN_MIN 0x8000 -#define INT16_LEASTN_MAX 0x7fff -#define UINT16_LEASTN_MAX 0xffff - -#ifdef __INT64_DEFINED -# define INT24_LEASTN_MIN 0x800000 -# define INT24_LEASTN_MAX 0x7fffff -# define UINT24_LEASTN_MAX 0xffffff -#endif - -#define INT32_LEASTN_MIN 0x80000000 -#define INT32_LEASTN_MAX 0x7fffffff -#define UINT32_LEASTN_MAX 0xffffffff - -#ifdef __INT64_DEFINED -# define INT64_LEASTN_MIN 0x8000000000000000 -# define INT64_LEASTN_MAX 0x7fffffffffffffff -# define UINT64_LEASTN_MAX 0xffffffffffffffff -#endif - -/* Limits of fastest minimum-width integer types */ - -#define INT8_FASTN_MIN 0x80 -#define INT8_FASTN_MAX 0x7f -#define UINT8_FASTN_MAX 0xff - -#define INT16_FASTN_MIN 0x8000 -#define INT16_FASTN_MAX 0x7fff -#define UINT16_FASTN_MAX 0xffff - -#ifdef __INT64_DEFINED -# define INT24_FASTN_MIN 0x800000 -# define INT24_FASTN_MAX 0x7fffff -# define UINT24_FASTN_MAX 0xffffff -#endif - -#define INT32_FASTN_MIN 0x80000000 -#define INT32_FASTN_MAX 0x7fffffff -#define UINT32_FASTN_MAX 0xffffffff - -#ifdef __INT64_DEFINED -# define INT64_FASTN_MIN 0x8000000000000000 -# define INT64_FASTN_MAX 0x7fffffffffffffff -# define UINT64_FASTN_MAX 0xffffffffffffffff -#endif - -/* Limits of integer types capable of holding object pointers */ - -#define INTPTR_MIN PTR_MIN -#define INTPTR_MAX PTR_MIN -#define UINTPTR_MAX UPTR_MAX - -/* Limits of greatest-width integer types */ - -#ifdef __INT64_DEFINED -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX - -# define UINTMAX_MIN UINT64_MIN -# define UINTMAX_MAX UINT64_MAX -#else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX - -# define UINTMAX_MIN UINT32_MIN -# define UINTMAX_MAX UINT32_MAX -#endif - -/* Macros for minimum-width integer constant expressions */ - -#if 0 /* REVISIT: Depends on architecture specific implementation */ -#define INT8_C(x) x -#define INT16_C(x) x -#define INT32_C(x) x ## L -#define INT64_C(x) x ## LL - -#define UINT8_C(x) x -#define UINT16_C(x) x -#define UINT32_C(x) x ## UL -#define UINT64_C(x) x ## ULL -#endif - -/* Macros for greatest-width integer constant expressions - -#ifdef CONFIG_HAVE_LONG_LONG -# define INTMAX_C(x) x ## LL -# define UINTMAX_C(x) x ## ULL -#else -# define INTMAX_C(x) x ## L -# define UINTMAX_C(x) x ## UL -#endif - -/* Limits of Other Integer Types */ - -#if 0 -# define PTRDIFF_MIN -# define PTRDIFF_MAX -#endif - -#ifdef CONFIG_SMALL_MEMORY -# define SIZE_MAX 0xffff -#else -# define SIZE_MAX 0xffffffff -#endif - -#if 0 -# define WCHAR_MIN -# define WCHAR_MAX - -# define WINT_MIN -# define WINT_MAX -#endif - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* Exact-width integer types. NOTE that these types are defined in - * architecture-specific logic with leading underscore character. This file - * typedef's these to the final name without the underscore character. This - * roundabout way of doings things allows the stdint.h to be removed from the - * include/ directory in the event that the user prefers to use the definitions - * provided by their toolchain header files. - */ - -#include - -/* Minimum-width integer types */ - -typedef _int8_t int_least8_t; -typedef _uint8_t uint_least8_t; - -typedef _int16_t int_least16_t; -typedef _uint16_t uint_least16_t; - -#ifdef __INT24_DEFINED -typedef _int24_t int_least24_t; -typedef _uint24_t uint_least24_t; -#else -typedef _int32_t int_least24_t; -typedef _uint32_t uint_least24_t; -#endif - -typedef _int32_t int_least32_t; -typedef _uint32_t uint_least32_t; - -#ifdef __INT64_DEFINED -typedef _int64_t int_least64_t; -typedef _uint64_t uint_least64_t; -#endif - -/* Fastest minimum-width integer types */ - -typedef _int8_t int_fast8_t; -typedef _uint8_t uint_fast8_t; - -typedef int int_fast16_t; -typedef unsigned int uint_fast16_t; - -#ifdef __INT24_DEFINED -typedef _int24_t int_fast24_t; -typedef _uint24_t uint_fast24_t; -#else -typedef _int32_t int_fast24_t; -typedef _uint32_t uint_fast24_t; -#endif - -typedef _int32_t int_fast32_t; -typedef _uint32_t uint_fast32_t; - -#ifdef __INT64_DEFINED -typedef _int64_t int_fast64_t; -typedef _uint64_t uint_fast64_t; -#endif - -/* Integer types capable of holding object pointers */ - -#ifndef CONFIG_ARCH_RGMP -typedef _intptr_t intptr_t; -typedef _uintptr_t uintptr_t; -#endif - -/* Greatest-width integer types */ - -#ifdef __INT64_DEFINED -typedef _int64_t intmax_t; -typedef _uint64_t uintmax_t; -#else -typedef _int32_t intmax_t; -typedef _uint32_t uintmax_t; -#endif - -#endif /* __ARCH_RGMP_INCLUDE_STDINTL_H */ diff --git a/arch/rgmp/include/types.h b/arch/rgmp/include/types.h deleted file mode 100644 index 1f515cb70c6ae4be41f911ed7f439f36cb5f96de..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/types.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/types.h - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -/* This file should never be included directed but, rather, - * only indirectly through sys/types.h - */ - -#ifndef __ARCH_RGMP_INCLUDE_TYPES_H -#define __ARCH_RGMP_INCLUDE_TYPES_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Type Declarations - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -/* These are the sizes of the standard integer types. NOTE that these type - * names have a leading underscore character. This file will be included - * (indirectly) by include/stdint.h and typedef'ed to the final name without - * the underscore character. This roundabout way of doings things allows - * the stdint.h to be removed from the include/ directory in the event that - * the user prefers to use the definitions provided by their toolchain header - * files - */ - -typedef char _int8_t; -typedef unsigned char _uint8_t; - -typedef short _int16_t; -typedef unsigned short _uint16_t; - -typedef int _int32_t; -typedef unsigned int _uint32_t; - -typedef long long _int64_t; -typedef unsigned long long _uint64_t; -#define __INT64_DEFINED - -/* A pointer is 4 bytes */ - -typedef unsigned int _intptr_t; -typedef unsigned int _uintptr_t; - -/* This is the size of the interrupt state save returned by - * up_irq_save() - */ - -typedef unsigned int irqstate_t; - -#endif /* __ASSEMBLY__ */ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#endif /* __ARCH_RGMP_INCLUDE_TYPES_H */ diff --git a/arch/rgmp/include/x86/arch/com.h b/arch/rgmp/include/x86/arch/com.h deleted file mode 100644 index 89df901bb3cfd66737eb79d906488ad03c7f128f..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/x86/arch/com.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/com.h - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __ARCH_RGMP_INCLUDE_COM_H -#define __ARCH_RGMP_INCLUDE_COM_H - -#define COM_SET_BAUD 1 -#define COM_SET_PARITY 2 -#define COM_NO_PARITY 0 -#define COM_ODD_PARITY 1 -#define COM_EVEN_PARITY 3 -#define COM_SET_STOPBITS 3 -#define COM_ONE_STOPBITS 0 -#define COM_TWO_STOPBITS 1 -#define COM_SET_BITS 4 -#define COM_8_BITS 3 -#define COM_7_BITS 2 -#define COM_6_BITS 1 -#define COM_5_BITS 0 - - -#endif diff --git a/arch/rgmp/include/x86/arch/subarch/arch.h b/arch/rgmp/include/x86/arch/subarch/arch.h deleted file mode 100644 index b88cb34155c37963d22e366ecbcda86fdf525ae9..0000000000000000000000000000000000000000 --- a/arch/rgmp/include/x86/arch/subarch/arch.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - * arch/rgmp/include/x86/arch/subarch/arch.h - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __RGMP_ARCH_SUBARCH_ARCH_H -#define __RGMP_ARCH_SUBARCH_ARCH_H - -#ifndef __ASSEMBLY__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - -static inline void up_mdelay(uint32_t msec) -{ - hpet_ndelay(msec*1000000); -} - -static inline void up_udelay(uint32_t usec) -{ - hpet_ndelay(usec*1000); -} - -#ifdef __cplusplus -} -#endif - -#endif /* !__ASSEMBLY__ */ - -#endif diff --git a/arch/rgmp/src/.gitignore b/arch/rgmp/src/.gitignore deleted file mode 100644 index 8d209f76a44efca7364cb9ee0735d799d36f432f..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.depend -/Make.dep -/board -/chip diff --git a/arch/rgmp/src/Makefile b/arch/rgmp/src/Makefile deleted file mode 100644 index 4fe3bbfbfd97782b1eb9413f13c3ca2d41d56d1f..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/Makefile +++ /dev/null @@ -1,116 +0,0 @@ -############################################################################ -# arch/rgmp/src/Makefile -# -# Copyright (C) 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - --include $(TOPDIR)/Make.defs -include $(CONFIG_RGMP_SUBARCH)/Make.defs - -RGMP_ARCH_ASRCS := $(addprefix $(CONFIG_RGMP_SUBARCH)/,$(RGMP_ARCH_ASRCS)) -RGMP_ARCH_CSRCS := $(addprefix $(CONFIG_RGMP_SUBARCH)/,$(RGMP_ARCH_CSRCS)) - -CPPFLAGS += -I$(TOPDIR)/sched -I$(TOPDIR)/fs $(EXTRADEFINES) -CFLAGS += -I$(TOPDIR)/sched -I$(TOPDIR)/fs $(EXTRADEFINES) -CXXFLAGS += -I$(TOPDIR)/sched -I$(TOPDIR)/fs $(EXTRADEFINES) - -ASRCS = $(RGMP_ARCH_ASRCS) -CSRCS = nuttx.c cxx.c $(RGMP_ARCH_CSRCS) -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -LINKSRCS = rgmp.c bridge.c -LINKOBJS = $(LINKSRCS:.c=$(OBJEXT)) - -# Override in Make.defs if linker is not 'ld' - -LDSTARTGROUP ?= --start-group -LDENDGROUP ?= --end-group - -LDFLAGS += -T$(RGMPLKSCPT) -LDLIBS = $(patsubst %.a,%,$(patsubst lib%,-l%,$(LINKLIBS))) -LIBPATHS += -L"$(TOPDIR)/lib" -L$(RGMPLIBDIR) -LDLIBS += -lrgmp $(shell "$(CC)" -print-libgcc-file-name) - -all: libarch$(LIBEXT) - -.PHONY: clean distclean depend - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# The architecture-specific library - -libarch$(LIBEXT): $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) - -# Generate the final NuttX binary by linking the host-specific objects with the NuttX -# specific objects (with munged names) - -nuttx$(EXEEXT): $(LINKOBJS) - @echo "LD: nuttx$(EXEEXT)" - @$(LD) $(LDFLAGS) $(LIBPATHS) $(LINKOBJS) $(LDSTARTGROUP) $(LDLIBS) $(EXTRA_LIBS) $(LDENDGROUP) -o $(TOPDIR)/$@ - @$(OBJDUMP) -S $(TOPDIR)/$@ > $(TOPDIR)/nuttx.asm - @$(NM) -n $(TOPDIR)/$@ > $(TOPDIR)/nuttx.sym - @$(OBJCOPY) -S -O binary $(TOPDIR)/$@ nuttx.img - @cp nuttx.img $(TOPDIR)/kernel.img - -# This is part of the top-level export target - -expport_startup: - -# Dependencies - -.depend: Makefile $(SRCS) $(LINKSRCS) - @$(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) $(LINKSRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, "$(TOPDIR)/arch/rgmp/src/x86/*.o") - $(call DELFILE, "$(TOPDIR)/kernel.img") - $(call DELFILE, nuttx.img) - $(call DELFILE, libarch$(LIBEXT)) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep diff --git a/arch/rgmp/src/arm/Make.defs b/arch/rgmp/src/arm/Make.defs deleted file mode 100644 index e21b046e8933a4f20f3f43a1062c22871ca804aa..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/arm/Make.defs +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# rgmp/arm/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Author: Yu Qiang -# -# This file is a part of NuttX: -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# -# -# 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. -# 3. Neither the name Gregory Nutt nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -RGMP_ARCH_ASRCS = sigentry.S -RGMP_ARCH_CSRCS = arch_nuttx.c diff --git a/arch/rgmp/src/arm/arch_nuttx.c b/arch/rgmp/src/arm/arch_nuttx.c deleted file mode 100644 index dd737946d9d146ca883bd4c86141de358bcff6ad..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/arm/arch_nuttx.c +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/arm/arch_nuttx.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include - -#include -#include - -void nuttx_arch_init(void) -{ -} - -void nuttx_arch_exit(void) -{ -} - -void up_initial_state(struct tcb_s *tcb) -{ - struct Trapframe *tf; - - if (tcb->pid != 0) - { - tf = (struct Trapframe *)tcb->adj_stack_ptr-1; - memset(tf, 0, sizeof(struct Trapframe)); - tf->tf_cpsr = SVC_MOD; - tf->tf_pc = (uint32_t)tcb->start; - tcb->xcp.tf = tf; - } -} - -void push_xcptcontext(struct xcptcontext *xcp) -{ - xcp->save_eip = xcp->tf->tf_pc; - xcp->save_eflags = xcp->tf->tf_cpsr; - - // set interrupts disabled - - xcp->tf->tf_pc = (uint32_t)up_sigentry; - xcp->tf->tf_cpsr |= CPSR_IF; -} - -void pop_xcptcontext(struct xcptcontext *xcp) -{ - xcp->tf->tf_pc = xcp->save_eip; - xcp->tf->tf_cpsr = xcp->save_eflags; -} - -void raise(void) -{ - -} - diff --git a/arch/rgmp/src/bridge.c b/arch/rgmp/src/bridge.c deleted file mode 100644 index 320019ba9f2f907cc171cb087dcea5f060351b2e..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/bridge.c +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/bridge.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include -#include -#include "inode/inode.h" -#include -#include -#include -#include -#include -#include - -struct bridge -{ - struct rgmp_bridge *b; - sem_t rd_lock; - sem_t wr_lock; -}; - -static ssize_t up_bridge_read(struct file *filep, char *buffer, size_t len) -{ - ssize_t ret; - struct bridge *b = filep->f_inode->i_private; - - sem_wait(&b->rd_lock); - ret = rgmp_bridge_read(b->b, buffer, len, 0); - sem_post(&b->rd_lock); - return ret; -} - -static ssize_t up_bridge_write(struct file *filep, const char *buffer, size_t len) -{ - ssize_t ret; - struct bridge *b = filep->f_inode->i_private; - - sem_wait(&b->wr_lock); - ret = rgmp_bridge_write(b->b, (char *)buffer, len, 0); - sem_post(&b->wr_lock); - return ret; -} - -static int up_bridge_open(struct file *filep) -{ - return 0; -} - -static int up_bridge_close(struct file *filep) -{ - return 0; -} - -static const struct file_operations up_bridge_fops = -{ - .read = up_bridge_read, - .write = up_bridge_write, - .open = up_bridge_open, - .close = up_bridge_close, -}; - -int rtos_bridge_init(struct rgmp_bridge *b) -{ - int errcode; - struct bridge *bridge; - char path[30] = {'/', 'd', 'e', 'v', '/'}; - - if ((bridge = kmm_malloc(sizeof(*bridge))) == NULL) - goto err0; - - bridge->b = b; - if ((errcode = sem_init(&bridge->rd_lock, 0, 1)) == ERROR) - goto err1; - - if ((errcode = sem_init(&bridge->wr_lock, 0, 1)) == ERROR) - goto err1; - - // make rgmp_bridge0 to be the console - - if (strcmp(b->vdev->name, "rgmp_bridge0") == 0) - strlcpy(path + 5, "console", 25); - else - strlcpy(path + 5, b->vdev->name, 25); - - if ((errcode = register_driver(path, &up_bridge_fops, 0666, bridge)) == ERROR) - { - cprintf("NuttX: register bridge %s fail\n", b->vdev->name); - goto err1; - } - - return 0; - -err1: - kmm_free(bridge); -err0: - return -1; -} diff --git a/arch/rgmp/src/cxx.c b/arch/rgmp/src/cxx.c deleted file mode 100644 index 8dfc6a697bf4803deec01fc204215644df02b259..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/cxx.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -int stderr = 2; - -void __stack_chk_fail_local(void) -{ - panic("stack check fail\n"); -} - -int __sprintf_chk(char *str, int flag, size_t strlen, const char *format) -{ - return snprintf(str, strlen, format); -} - -int dl_iterate_phdr(void* arg1, void* arg2) -{ - return -1; -} diff --git a/arch/rgmp/src/nuttx.c b/arch/rgmp/src/nuttx.c deleted file mode 100644 index 07faf590fd79b342bf7becd7c1ef46fa55a06838..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/nuttx.c +++ /dev/null @@ -1,751 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/nuttx.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "task/task.h" -#include "sched/sched.h" -#include "group/group.h" - -struct tcb_s *current_task = NULL; - -/* This function is called in non-interrupt context - * to switch tasks. - * Assumption: global interrupt is disabled. - */ - -static inline void up_switchcontext(struct tcb_s *ctcb, struct tcb_s *ntcb) -{ - // do nothing if two tasks are the same - - if (ctcb == ntcb) - return; - - // this function can not be called in interrupt - - if (up_interrupt_context()) { - panic("%s: try to switch context in interrupt\n", __func__); - } - - // start switch - - current_task = ntcb; - rgmp_context_switch(ctcb ? &ctcb->xcp.ctx : NULL, &ntcb->xcp.ctx); -} - -void up_initialize(void) -{ - extern pidhash_t g_pidhash[]; - extern void vdev_init(void); - extern void nuttx_arch_init(void); - - /* Initialize the current_task to g_idletcb */ - - current_task = g_pidhash[PIDHASH(0)].tcb; - - /* OS memory alloc system is ready */ - - use_os_kmalloc = 1; - - /* rgmp vdev init */ - - vdev_init(); - - nuttx_arch_init(); - -#ifdef CONFIG_PM - /* Initialize the power management subsystem. This MCU-specific function - * must be called *very* early in the initialization sequence *before* any - * other device drivers are initialized (since they may attempt to register - * with the power management subsystem). - */ - - up_pminitialize(); -#endif - -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) - /* Register the master pseudo-terminal multiplexor device */ - - (void)ptmx_register(); -#endif - - /* Early initialization of the system logging device. Some SYSLOG channel - * can be initialized early in the initialization sequence because they - * depend on only minimal OS initialization. - */ - - syslog_initialize(SYSLOG_INIT_EARLY); - - /* Register devices */ - -#if CONFIG_NFILE_DESCRIPTORS > 0 - -#if defined(CONFIG_DEV_NULL) - devnull_register(); /* Standard /dev/null */ -#endif - -#if defined(CONFIG_DEV_RANDOM) - devrandom_register(); /* Standard /dev/random */ -#endif - -#if defined(CONFIG_DEV_URANDOM) - devurandom_register(); /* Standard /dev/urandom */ -#endif - -#if defined(CONFIG_DEV_ZERO) - devzero_register(); /* Standard /dev/zero */ -#endif - -#if defined(CONFIG_DEV_LOOP) - loop_register(); /* Standard /dev/loop */ -#endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ - -#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ - defined(CONFIG_DRIVER_NOTE) - note_register(); /* Non-standard /dev/note */ -#endif - -#if defined(CONFIG_CRYPTO) - /* Initialize the HW crypto and /dev/crypto */ - - up_cryptoinitialize(); -#endif - -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) - devcrypto_register(); -#endif - - /* Enable interrupt */ - - local_irq_enable(); -} - -void up_idle(void) -{ - arch_hlt(); -} - -void up_allocate_heap(void **heap_start, size_t *heap_size) -{ - void *boot_freemem = boot_alloc(0, sizeof(int)); - *heap_start = boot_freemem; - *heap_size = KERNBASE + kmem_size - (uint32_t)boot_freemem; -} - -int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype) -{ - uint32_t *stack_alloc_ptr; - int ret = ERROR; - size_t *adj_stack_ptr; - - /* Move up to next even word boundary if necessary */ - - size_t adj_stack_size = (stack_size + 3) & ~3; - size_t adj_stack_words = adj_stack_size >> 2; - - /* Allocate the memory for the stack */ - -#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) - /* Use the kernel allocator if this is a kernel thread */ - - if (ttype == TCB_FLAG_TTYPE_KERNEL) { - stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); - } else -#endif - { - stack_alloc_ptr = (uint32_t*)kumm_malloc(adj_stack_size); - } - if (stack_alloc_ptr) { - /* This is the address of the last word in the allocation */ - - adj_stack_ptr = &stack_alloc_ptr[adj_stack_words - 1]; - - /* Save the values in the TCB */ - - tcb->adj_stack_size = adj_stack_size; - tcb->stack_alloc_ptr = stack_alloc_ptr; - tcb->adj_stack_ptr = (void *)((unsigned int)adj_stack_ptr & ~7); - ret = OK; - } - return ret; -} - -int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) -{ - /* Move up to next even word boundary if necessary */ - - size_t adj_stack_size = stack_size & ~3; - size_t adj_stack_words = adj_stack_size >> 2; - - /* This is the address of the last word in the allocation */ - - size_t *adj_stack_ptr = &((size_t*)stack)[adj_stack_words - 1]; - - /* Save the values in the TCB */ - - tcb->adj_stack_size = adj_stack_size; - tcb->stack_alloc_ptr = stack; - tcb->adj_stack_ptr = (void *)((unsigned int)adj_stack_ptr & ~7); - return OK; -} - -FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size) -{ - uintptr_t topaddr; - - /* Align the frame_size */ - - frame_size = (frame_size + 3) & ~3; - - /* Is there already a stack allocated? Is it big enough? */ - - if (!tcb->stack_alloc_ptr || tcb->adj_stack_size <= frame_size) { - return NULL; - } - - /* Save the adjusted stack values in the struct tcb_s */ - - topaddr = (uintptr_t)tcb->adj_stack_ptr - frame_size; - tcb->adj_stack_ptr = (FAR void *)topaddr; - tcb->adj_stack_size -= frame_size; - - /* Reset the initial state */ - - up_initial_state(tcb); - - /* And return a pointer to the allocated memory region */ - - return (FAR void *)(topaddr + sizeof(uint32_t)); -} - -void up_release_stack(struct tcb_s *dtcb, uint8_t ttype) -{ - /* Is there a stack allocated? */ - - if (dtcb->stack_alloc_ptr) { -#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) - /* Use the kernel allocator if this is a kernel thread */ - - if (ttype == TCB_FLAG_TTYPE_KERNEL) { - kmm_free(dtcb->stack_alloc_ptr); - } else -#endif - { - /* Use the user-space allocator if this is a task or pthread */ - - kumm_free(dtcb->stack_alloc_ptr); - } - } - - /* Mark the stack freed */ - - dtcb->stack_alloc_ptr = NULL; - dtcb->adj_stack_size = 0; - dtcb->adj_stack_ptr = NULL; -} - -/**************************************************************************** - * Name: up_block_task - * - * Description: - * The currently executing task at the head of - * the ready to run list must be stopped. Save its context - * and move it to the inactive list specified by task_state. - * - * This function is called only from the NuttX scheduling - * logic. Interrupts will always be disabled when this - * function is called. - * - * Inputs: - * tcb: Refers to a task in the ready-to-run list (normally - * the task at the head of the list). It most be - * stopped, its context saved and moved into one of the - * waiting task lists. It it was the task at the head - * of the ready-to-run list, then a context to the new - * ready to run task must be performed. - * task_state: Specifies which waiting task list should be - * hold the blocked task TCB. - * - ****************************************************************************/ - -void up_block_task(struct tcb_s *tcb, tstate_t task_state) -{ - /* Verify that the context switch can be performed */ - - if ((tcb->task_state < FIRST_READY_TO_RUN_STATE) || - (tcb->task_state > LAST_READY_TO_RUN_STATE)) - { - _warn("%s: task sched error\n", __func__); - return; - } - else - { - struct tcb_s *rtcb = current_task; - bool switch_needed; - - /* Remove the tcb task from the ready-to-run list. If we - * are blocking the task at the head of the task list (the - * most likely case), then a context switch to the next - * ready-to-run task is needed. In this case, it should - * also be true that rtcb == tcb. - */ - - switch_needed = sched_removereadytorun(tcb); - - /* Add the task to the specified blocked task list */ - - sched_addblocked(tcb, (tstate_t)task_state); - - /* Now, perform the context switch if one is needed */ - - if (switch_needed) - { - struct tcb_s *nexttcb; - - /* Update scheduler parameters */ - - sched_suspend_scheduler(rtcb); - - /* this part should not be executed in interrupt context */ - - if (up_interrupt_context()) - { - panic("%s: %d\n", __func__, __LINE__); - } - - /* If there are any pending tasks, then add them to the ready-to-run - * task list now. It should be the up_realease_pending() called from - * sched_unlock() to do this for disable preemption. But it block - * itself, so it's OK. - */ - - if (g_pendingtasks.head) - { - _warn("Disable preemption failed for task block itself\n"); - sched_mergepending(); - } - - nexttcb = this_task(); - -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - (void)group_addrenv(nexttcb); -#endif - /* Reset scheduler parameters */ - - sched_resume_scheduler(nexttcb); - - /* context switch */ - - up_switchcontext(rtcb, nexttcb); - } - } -} - -/**************************************************************************** - * Name: up_unblock_task - * - * Description: - * A task is currently in an inactive task list - * but has been prepped to execute. Move the TCB to the - * ready-to-run list, restore its context, and start execution. - * - * Inputs: - * tcb: Refers to the tcb to be unblocked. This tcb is - * in one of the waiting tasks lists. It must be moved to - * the ready-to-run list and, if it is the highest priority - * ready to run taks, executed. - * - ****************************************************************************/ - -void up_unblock_task(struct tcb_s *tcb) -{ - /* Verify that the context switch can be performed */ - - if ((tcb->task_state < FIRST_BLOCKED_STATE) || - (tcb->task_state > LAST_BLOCKED_STATE)) - { - _warn("%s: task sched error\n", __func__); - return; - } - else - { - struct tcb_s *rtcb = current_task; - - /* Remove the task from the blocked task list */ - - sched_removeblocked(tcb); - - /* Add the task in the correct location in the prioritized - * ready-to-run task list. - */ - - if (sched_addreadytorun(tcb) && !up_interrupt_context()) - { - /* The currently active task has changed! */ - /* Update scheduler parameters */ - - sched_suspend_scheduler(rtcb); - - /* Are we in an interrupt handler? */ - - struct tcb_s *nexttcb = this_task(); - -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - - (void)group_addrenv(nexttcb); -#endif - /* Update scheduler parameters */ - - sched_resume_scheduler(nexttcb); - - /* context switch */ - - up_switchcontext(rtcb, nexttcb); - } - } -} - -/* This function is called from sched_unlock() which will check not - * in interrupt context and disable interrupt. - */ - -void up_release_pending(void) -{ - struct tcb_s *rtcb = current_task; - - /* Merge the g_pendingtasks list into the ready-to-run task list */ - - if (sched_mergepending()) - { - struct tcb_s *nexttcb = this_task(); - - /* The currently active task has changed! We will need to switch - * contexts. - * - * Update scheduler parameters. - */ - - sched_suspend_scheduler(rtcb); - -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - (void)group_addrenv(nexttcb); -#endif - /* Update scheduler parameters */ - - sched_resume_scheduler(nexttcb); - - /* context switch */ - - up_switchcontext(rtcb, nexttcb); - } -} - -void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) -{ - /* Verify that the caller is sane */ - - if (tcb->task_state < FIRST_READY_TO_RUN_STATE || - tcb->task_state > LAST_READY_TO_RUN_STATE -#if SCHED_PRIORITY_MIN > UINT8_MIN - || priority < SCHED_PRIORITY_MIN -#endif -#if SCHED_PRIORITY_MAX < UINT8_MAX - || priority > SCHED_PRIORITY_MAX -#endif - ) - { - _warn("%s: task sched error\n", __func__); - return; - } - else - { - struct tcb_s *rtcb = current_task; - bool switch_needed; - - /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just - * remove the head of the ready to run list. - */ - - switch_needed = sched_removereadytorun(tcb); - - /* Setup up the new task priority */ - - tcb->sched_priority = (uint8_t)priority; - - /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was - * added to the new list. We will need to perform a context - * switch only if the EXCLUSIVE or of the two calls is non-zero - * (i.e., one and only one the calls changes the head of the - * ready-to-run list). - */ - - switch_needed ^= sched_addreadytorun(tcb); - - /* Now, perform the context switch if one is needed */ - - if (switch_needed && !up_interrupt_context()) - { - struct tcb_s *nexttcb; - - /* If there are any pending tasks, then add them to the ready-to-run - * task list now. It should be the up_realease_pending() called from - * sched_unlock() to do this for disable preemption. But it block - * itself, so it's OK. - */ - - if (g_pendingtasks.head) - { - _warn("Disable preemption failed for reprioritize task\n"); - sched_mergepending(); - } - - /* Update scheduler parameters */ - - sched_suspend_scheduler(rtcb); - - /* Get the TCB of the new task to run */ - - nexttcb = this_task(); - -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - (void)group_addrenv(nexttcb); -#endif - /* Update scheduler parameters */ - - sched_resume_scheduler(nexttcb); - - /* context switch */ - - up_switchcontext(rtcb, nexttcb); - } - } -} - -void _exit(int status) -{ - struct tcb_s* tcb; - - /* Destroy the task at the head of the ready to run list. */ - - (void)task_exit(); - - /* Now, perform the context switch to the new ready-to-run task at the - * head of the list. - */ - - tcb = this_task(); - -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously running - * task is closed down gracefully (data caches dump, MMU flushed) and - * set up the address environment for the new thread at the head of - * the ready-to-run list. - */ - - (void)group_addrenv(tcb); -#endif - - /* Then switch contexts */ - - up_switchcontext(NULL, tcb); -} - -void up_assert(const uint8_t *filename, int line) -{ - fprintf(stderr, "Assertion failed at file:%s line: %d\n", filename, line); - -#ifdef CONFIG_BOARD_CRASHDUMP - board_crashdump(up_getsp(), this_task(), filename, line); -#endif - - // in interrupt context or idle task means kernel error - // which will stop the OS - // if in user space just terminate the task - if (up_interrupt_context() || current_task->pid == 0) { - panic("%s: %d\n", __func__, __LINE__); - } - else { - exit(EXIT_FAILURE); - } -} - -#ifndef CONFIG_DISABLE_SIGNALS - -void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) -{ - /* Refuse to handle nested signal actions */ - if (!tcb->xcp.sigdeliver) { - int flags; - - /* Make sure that interrupts are disabled */ - local_irq_save(flags); - - // First, handle some special cases when the signal is - // being delivered to the currently executing task. - if (tcb == current_task) { - // CASE 1: We are not in an interrupt handler and - // a task is signalling itself for some reason. - if (!up_interrupt_context()) { - // In this case just deliver the signal now. - sigdeliver(tcb); - } - // CASE 2: We are in an interrupt handler AND the - // interrupted task is the same as the one that - // must receive the signal. - else { - tcb->xcp.sigdeliver = sigdeliver; - } - } - - // Otherwise, we are (1) signaling a task is not running - // from an interrupt handler or (2) we are not in an - // interrupt handler and the running task is signalling - // some non-running task. - else { - tcb->xcp.sigdeliver = sigdeliver; - push_xcptcontext(&tcb->xcp); - } - - local_irq_restore(flags); - } -} - -#endif /* !CONFIG_DISABLE_SIGNALS */ - - -bool up_interrupt_context(void) -{ - if (nest_irq) - return true; - return false; -} - -#ifndef CONFIG_ARCH_NOINTC -void up_disable_irq(int irq) -{ - -} - -void up_enable_irq(int irq) -{ - -} -#endif - -#ifdef CONFIG_ARCH_IRQPRIO -int up_prioritize_irq(int irq, int priority) -{ - -} -#endif - -void up_sigdeliver(struct Trapframe *tf) -{ - sig_deliver_t sigdeliver; - - pop_xcptcontext(¤t_task->xcp); - sigdeliver = current_task->xcp.sigdeliver; - current_task->xcp.sigdeliver = NULL; - local_irq_enable(); - sigdeliver(current_task); - local_irq_disable(); -} - -#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) - -void up_cxxinitialize(void) -{ - rgmp_cxx_init(); -} - -#endif - - - - - - - - diff --git a/arch/rgmp/src/rgmp.c b/arch/rgmp/src/rgmp.c deleted file mode 100644 index 104591752d046582808c9b89821a63a834b6da0e..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/rgmp.c +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/rgmp.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -int nest_irq = 0; - -// The default time is 10ms -// REVISIT: tick time is given by CONFIG_USEC_PER_TICK. MSEC_PER_TICK may -// be zero. - -#ifdef MSEC_PER_TICK -const unsigned int rtos_tick_time = MSEC_PER_TICK; -#else -const unsigned int rtos_tick_time = 10; -#endif - -void rtos_entry(void) -{ - os_start(); -} - -void *rtos_get_page(void) -{ - return memalign(PTMEMSIZE, PTMEMSIZE); -} - -void rtos_free_page(void *page) -{ - free(page); -} - -void *rtos_kmalloc(int size) -{ - return kmm_malloc(size); -} - -void rtos_kfree(void *addr) -{ - kmm_free(addr); -} - -/* The interrupt can be nested. The pair of rtos_enter_interrupt() - * and rtos_exit_interrupt() make sure the context switch is - * performed only in the last IRQ exit. - */ - -void rtos_enter_interrupt(void) -{ - nest_irq++; -} - -void rtos_exit_interrupt(void) -{ - local_irq_disable(); - nest_irq--; - if (!nest_irq) - { - struct tcb_s *rtcb = current_task; - struct tcb_s *ntcb; - - if (rtcb->xcp.sigdeliver) - { - rtcb->xcp.ctx.tf = g_current_regs; - push_xcptcontext(&rtcb->xcp); - } - - ntcb = this_task(); - - /* Switch needed */ - - if (rtcb != ntcb) - { - rtcb->xcp.ctx.tf = g_current_regs; - current_task = ntcb; - rgmp_switch_to(&ntcb->xcp.ctx); - } - } -} - -void rtos_timer_isr(void *data) -{ - sched_process_timer(); -} - -/* RTOS semaphore operation */ - -int rtos_sem_init(struct semaphore *sem, int val) -{ - if ((sem->sem = kmm_malloc(sizeof(sem_t))) == NULL) - return -1; - return sem_init(sem->sem, 0, val); -} - -int rtos_sem_up(struct semaphore *sem) -{ - return sem_post(sem->sem); -} - -int rtos_sem_down(struct semaphore *sem) -{ - return sem_wait(sem->sem); -} - -void rtos_stop_running(void) -{ - extern void nuttx_arch_exit(void); - - local_irq_disable(); - - nuttx_arch_exit(); - - while (1) - { - arch_hlt(); - } -} - -int rtos_vnet_init(struct rgmp_vnet *vnet) -{ - extern int vnet_init(struct rgmp_vnet *vnet); - - return vnet_init(vnet); -} diff --git a/arch/rgmp/src/x86/Make.defs b/arch/rgmp/src/x86/Make.defs deleted file mode 100644 index fcf3180d82f1cbc0f6042224791040115dcb020d..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/x86/Make.defs +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# rgmp/x86/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Author: Yu Qiang -# -# This file is a part of NuttX: -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# -# -# 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. -# 3. Neither the name Gregory Nutt nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -RGMP_ARCH_ASRCS = sigentry.S -RGMP_ARCH_CSRCS = com.c arch_nuttx.c diff --git a/arch/rgmp/src/x86/arch_nuttx.c b/arch/rgmp/src/x86/arch_nuttx.c deleted file mode 100644 index 32f919cd78439bb3d8a5c54ddd8485650611ba8a..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/x86/arch_nuttx.c +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/x86/arch_nuttx.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include - -#include -#include - -void nuttx_arch_init(void) -{ - extern void e1000_mod_init(void); - extern void up_serialinit(void); - - // setup COM device - up_serialinit(); - -#ifdef CONFIG_NET_E1000 - // setup e1000 - e1000_mod_init(); -#endif -} - -void nuttx_arch_exit(void) -{ - extern void e1000_mod_exit(void); - -#ifdef CONFIG_NET_E1000 - e1000_mod_exit(); -#endif -} - -void up_initial_state(struct tcb_s *tcb) -{ - struct Trapframe *tf; - - if (tcb->pid) - { - tf = (struct Trapframe *)tcb->adj_stack_ptr - 1; - rgmp_setup_context(&tcb->xcp.ctx, tf, tcb->start, 1); - } - else - { - rgmp_setup_context(&tcb->xcp.ctx, NULL, NULL, 0); - } -} - -void push_xcptcontext(struct xcptcontext *xcp) -{ - xcp->save_eip = xcp->ctx.tf->tf_eip; - xcp->save_eflags = xcp->ctx.tf->tf_eflags; - - // set up signal entry with interrupts disabled - - xcp->ctx.tf->tf_eip = (uint32_t)up_sigentry; - xcp->ctx.tf->tf_eflags = 0; -} - -void pop_xcptcontext(struct xcptcontext *xcp) -{ - xcp->ctx.tf->tf_eip = xcp->save_eip; - xcp->ctx.tf->tf_eflags = xcp->save_eflags; -} - diff --git a/arch/rgmp/src/x86/com.c b/arch/rgmp/src/x86/com.c deleted file mode 100644 index 8c8d076cc05f72eb19da90c0769246514a6acf7c..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/x86/com.c +++ /dev/null @@ -1,667 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/x86/com.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. - * Authors: Yu Qiang - * Gregory Nutt - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define COM1 0x3F8 -#define COM2 0x2f8 -#define COM3 0x3e8 -#define COM4 0x2e8 - -#define COM_RX 0 // In: Receive buffer (DLAB=0) -#define COM_DLL 0 // Out: Divisor Latch Low (DLAB=1) -#define COM_TX 0 // Out: Transmit buffer (DLAB=0) -#define COM_DLM 1 // Out: Divisor Latch High (DLAB=1) -#define COM_IER 1 // Out: Interrupt Enable Register -#define COM_IER_TEI 0x02 // Enable transmit buffer empty interrupt -#define COM_IER_RDI 0x01 // Enable receiver data interrupt -#define COM_IIR 2 // In: Interrupt ID Register -#define COM_FCR 2 // Out: FIFO Control Register -#define COM_LCR 3 // Out: Line Control Register -#define COM_LCR_DLAB 0x80 // Divisor latch access bit -#define COM_LCR_WLEN8 0x03 // Wordlength: 8 bits -#define COM_MCR 4 // Out: Modem Control Register -#define COM_MCR_RTS 0x02 // RTS complement -#define COM_MCR_DTR 0x01 // DTR complement -#define COM_MCR_OUT2 0x08 // Out2 complement -#define COM_LSR 5 // In: Line Status Register -#define COM_LSR_DATA 0x01 // Data available -#define COM_LSR_ETR 0x20 // buffer has space -#define COM_LSR_EDR 0x40 // buffer empty - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -#ifndef CONFIG_COM_RXBUFSIZE -#define CONFIG_COM_RXBUFSIZE 64 -#endif - -#ifndef CONFIG_COM_TXBUFSIZE -#define CONFIG_COM_TXBUFSIZE 64 -#endif - -struct up_dev_s -{ - unsigned int base; /* Base address of COM registers */ - unsigned int baud; /* Configured baud */ - int irq; /* IRQ associated with this COM */ - struct irq_action action; - union { - uint8_t val; - struct { - unsigned bits : 2; /* 3=8 bits, 2=7 bits, 1=6 bits, 0=5 bits */ - unsigned stopbits : 1; /* 0=1 stop bit, 1=2 stop bits */ - unsigned parity : 3; /* xx0=none, 001=odd, 011=even */ - unsigned ebreak : 1; - unsigned dlab : 1; - } sep; - } lcr; - char rxbuff[CONFIG_COM_RXBUFSIZE]; /* receive buffer */ - char txbuff[CONFIG_COM_TXBUFSIZE]; /* transmit buffer */ -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static irqreturn_t up_com_int_handler(int irq, void *dev_id); -static int up_ioctl(struct file *filep, int cmd, unsigned long arg); -static int up_receive(struct uart_dev_s *dev, unsigned int *status); -static void up_rxint(struct uart_dev_s *dev, bool enable); -static bool up_rxavailable(struct uart_dev_s *dev); -static void up_send(struct uart_dev_s *dev, int ch); -static void up_txint(struct uart_dev_s *dev, bool enable); -static bool up_txready(struct uart_dev_s *dev); -static bool up_txempty(struct uart_dev_s *dev); - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static struct uart_ops_s g_com_ops = -{ - .setup = up_setup, - .shutdown = up_shutdown, - .attach = up_attach, - .detach = up_detach, - .ioctl = up_ioctl, - .receive = up_receive, - .rxint = up_rxint, - .rxavailable = up_rxavailable, -#ifdef CONFIG_SERIAL_IFLOWCONTROL - .rxflowcontrol = NULL, -#endif - .send = up_send, - .txint = up_txint, - .txready = up_txready, - .txempty = up_txempty, -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_alloc_com - ****************************************************************************/ - -static uart_dev_t *up_alloc_com(unsigned int base, int irq) -{ - uart_dev_t *dev; - struct up_dev_s *priv; - - priv = kmm_zalloc(sizeof(struct up_dev_s)); - if (priv == NULL) - { - goto err0; - } - - dev = kmm_zalloc(sizeof(uart_dev_t)); - if (dev == NULL) - { - goto err1; - } - - priv->base = base; - priv->irq = irq; - priv->baud = 115200; - priv->lcr.val = 0; - priv->lcr.sep.parity = 0; - priv->lcr.sep.bits = 3; - priv->lcr.sep.stopbits = 0; - priv->action.handler = up_com_int_handler; - priv->action.dev_id = dev; - - dev->recv.size = CONFIG_COM_RXBUFSIZE; - dev->recv.buffer = priv->rxbuff; - dev->xmit.size = CONFIG_COM_TXBUFSIZE; - dev->xmit.buffer = priv->txbuff; - dev->ops = &g_com_ops; - dev->priv = priv; - - return dev; - -err1: - kmm_free(priv); -err0: - return NULL; -} - -/**************************************************************************** - * Name: up_alloc_com - ****************************************************************************/ - -static inline void up_free_com(uart_dev_t *com) -{ - kmm_free(com->priv); - kmm_free(com); -} - -/**************************************************************************** - * Name: up_setup - * - * Description: - * Configure the UART baud, bits, parity, fifos, etc. This - * method is called the first time that the serial port is - * opened. - * - ****************************************************************************/ - -static int up_setup(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = dev->priv; - uint16_t base = priv->base; - union { - uint16_t val; - struct { - uint8_t low; - uint8_t high; - } sep; - } data; - - // clear and disable FIFO - - outb(base+COM_FCR, 1); - outb(base+COM_FCR, 3); - outb(base+COM_FCR, 0); - - // Clear any preexisting overrun indications and interrupts - // Serial port doesn't exist if COM_LSR returns 0xFF - - inb(base+COM_LSR); - inb(base+COM_IIR); - inb(base+COM_RX); - if (inb(base+COM_LSR) == 0xff) - { - _err("ERROR: COM %d does not exist\n", base); - return -1; - } - - // Set speed; requires DLAB latch - - outb(base+COM_LCR, COM_LCR_DLAB); - data.val = 115200 / priv->baud; - outb(base+COM_DLL, data.sep.low); - outb(base+COM_DLM, data.sep.high); - - // set data bits, stop bit, parity; turn off DLAB latch - - outb(base+COM_LCR, priv->lcr.val); - - // OUT2 must be set to enable interrupt - - outb(base+COM_MCR, COM_MCR_OUT2); - - // setup FIFO - - outb(base+COM_FCR, 1); - - // disable COM interrupts - - outb(base+COM_IER, 0); - return OK; -} - -/**************************************************************************** - * Name: up_shutdown - * - * Description: - * Disable the UART. This method is called when the serial port is closed - * - ****************************************************************************/ - -static void up_shutdown(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = dev->priv; - uint16_t base = priv->base; - - // disable COM interrupts - outb(base+COM_IER, 0); -} - -/**************************************************************************** - * Name: up_attach - * - * Description: - * Configure the UART to operation in interrupt driven mode. This method is - * called when the serial port is opened. Normally, this is just after the - * the setup() method is called, however, the serial console may operate in - * a non-interrupt driven mode during the boot phase. - * - * RX and TX interrupts are not enabled when by the attach method (unless the - * hardware supports multiple levels of interrupt enabling). The RX and TX - * interrupts are not enabled until the txint() and rxint() methods are called. - * - ****************************************************************************/ - -static int up_attach(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = dev->priv; - int errcode; - - errcode = rgmp_request_irq(priv->irq, &priv->action, 0); - - return errcode; -} - -/**************************************************************************** - * Name: up_detach - * - * Description: - * Detach UART interrupts. This method is called when the serial port is - * closed normally just before the shutdown method is called. The exception is - * the serial console which is never shutdown. - * - ****************************************************************************/ - -static void up_detach(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = dev->priv; - - rgmp_free_irq(priv->irq, &priv->action); -} - -/**************************************************************************** - * Name: up_com_int_handler - * - * Description: - * This is the UART interrupt handler. It will be invoked - * when an interrupt received on the 'irq' It should call - * uart_transmitchars or uart_receivechar to perform the - * appropriate data transfers. The interrupt handling logic\ - * must be able to map the 'irq' number into the approprite - * uart_dev_s structure in order to call these functions. - * - ****************************************************************************/ - -static irqreturn_t up_com_int_handler(int irq, void *dev_id) -{ - struct uart_dev_s *dev = dev_id; - struct up_dev_s *priv = dev->priv; - uint16_t base = priv->base; - //uint8_t cause = inb(base+COM_IIR); - uint8_t state = inb(base+COM_LSR); - - if (state & COM_LSR_DATA) - uart_recvchars(dev); - - if (state & COM_LSR_ETR) - uart_xmitchars(dev); - - return IRQ_HANDLED; -} - -/**************************************************************************** - * Name: up_ioctl - * - * Description: - * All ioctl calls will be routed through this method - * - ****************************************************************************/ - -static int up_ioctl(struct file *filep, int cmd, unsigned long arg) -{ - struct inode *inode = filep->f_inode; - struct uart_dev_s *dev = inode->i_private; - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - - switch (cmd) { - case COM_SET_BAUD: - priv->baud = arg; - break; - case COM_SET_PARITY: - priv->lcr.sep.parity = arg; - break; - case COM_SET_STOPBITS: - priv->lcr.sep.stopbits = arg; - break; - case COM_SET_BITS: - priv->lcr.sep.bits = arg; - break; - default: - return ERROR; - } - - if (up_setup(dev) != OK) - return ERROR; - - up_rxint(dev, 1); - - return OK; -} - -/**************************************************************************** - * Name: up_receive - * - * Description: - * Called (usually) from the interrupt level to receive one character from - * the UART. Error bits associated with the receipt are provided in the - * the return 'status'. - * - ****************************************************************************/ - -static int up_receive(struct uart_dev_s *dev, unsigned int *status) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - - return inb(base+COM_RX); -} - -/**************************************************************************** - * Name: up_rxint - * - * Description: - * Call to enable or disable RX interrupts - * - ****************************************************************************/ - -static void up_rxint(struct uart_dev_s *dev, bool enable) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - uint8_t ier; - - ier = inb(base+COM_IER); - if (enable) - ier |= COM_IER_RDI; - else - ier &= ~COM_IER_RDI; - outb(base+COM_IER, ier); -} - -/**************************************************************************** - * Name: up_rxavailable - * - * Description: - * Return true if the receive fifo is not empty - * - ****************************************************************************/ - -static bool up_rxavailable(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - - return inb(base+COM_LSR) & COM_LSR_DATA; -} - -/**************************************************************************** - * Name: up_send - * - * Description: - * This method will send one byte on the UART - * - ****************************************************************************/ - -static void up_send(struct uart_dev_s *dev, int ch) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - - outb(base+COM_TX, ch); -} - -/**************************************************************************** - * Name: up_txint - * - * Description: - * Call to enable or disable TX interrupts - * - ****************************************************************************/ - -static void up_txint(struct uart_dev_s *dev, bool enable) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - irqstate_t flags; - uint8_t ier; - - flags = enter_critical_section(); - ier = inb(base+COM_IER); - if (enable) { - ier |= COM_IER_TEI; - outb(base+COM_IER, ier); - - /* Fake a TX interrupt here by just calling uart_xmitchars() with - * interrupts disabled (note this may recurse). - */ - - uart_xmitchars(dev); - } - else { - ier &= ~COM_IER_TEI; - outb(base+COM_IER, ier); - } - - leave_critical_section(flags); -} - -/**************************************************************************** - * Name: up_txready - * - * Description: - * Return true if the tranmsit fifo is not full - * - ****************************************************************************/ - -static bool up_txready(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - - return inb(base+COM_LSR) & COM_LSR_ETR; -} - -/**************************************************************************** - * Name: up_txempty - * - * Description: - * Return true if the transmit fifo is empty - * - ****************************************************************************/ - -static bool up_txempty(struct uart_dev_s *dev) -{ - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16_t base = priv->base; - - return inb(base+COM_LSR) & COM_LSR_EDR; -} - -/**************************************************************************** - * Public Funtions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_serialinit - * - * Description: - * Performs the low level UART initialization early in - * debug so that the serial console will be available - * during bootup. This must be called before up_serialinit. - * - ****************************************************************************/ - -void up_earlyserialinit(void) -{ - -} - -/**************************************************************************** - * Name: up_serialinit - * - * Description: - * Register serial console and serial ports. This assumes - * that up_earlyserialinit was called previously. - * - ****************************************************************************/ - -void up_serialinit(void) -{ - uart_dev_t *dev; - int errcode; - -#ifdef CONFIG_COM1 - dev = up_alloc_com(COM1, 4); - if (dev == NULL) - { - _err("ERROR: alloc com1 fail\n"); - } - else - { - errcode = uart_register("/dev/ttyS0", dev); - if (errcode) - { - _err("ERROR: register com1 fail\n"); - } - } -#endif -#ifdef CONFIG_COM2 - dev = up_alloc_com(COM2, 3); - if (dev == NULL) - { - _err("ERROR: alloc com2 fail\n"); - } - else - { - errcode = uart_register("/dev/ttyS1", dev); - if (errcode) - { - _err("ERROR: register com2 fail\n"); - } - } -#endif -#ifdef CONFIG_COM3 - dev = up_alloc_com(COM3, 4); - if (dev == NULL) - { - _err("ERROR: alloc com3 fail\n"); - } - else - { - errcode = uart_register("/dev/ttyS2", dev); - if (errcode) - { - _err("ERROR: register com3 fail\n"); - } - } -#endif -#ifdef CONFIG_COM4 - dev = up_alloc_com(COM4, 3); - if (dev == NULL) - { - _err("ERROR: alloc com4 fail\n"); - } - else - { - errcode = uart_register("/dev/ttyS3", dev); - if (errcode) - { - _err("ERROR: register com4 fail\n"); - } - } -#endif -} - -/**************************************************************************** - * Name: up_putc - * - * Description: - * Provide priority, low-level access to support OS debug - * writes - * - ****************************************************************************/ -extern void cons_putc(int c); - -int up_putc(int ch) -{ - cons_putc(ch); - return ch; -} - diff --git a/arch/rgmp/src/x86/sigentry.S b/arch/rgmp/src/x86/sigentry.S deleted file mode 100644 index 77214e8114a58a94fb22ba469d558e049b3e9245..0000000000000000000000000000000000000000 --- a/arch/rgmp/src/x86/sigentry.S +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * arch/rgmp/src/x86/sigentry.S - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - - .globl up_sigentry -up_sigentry: - subl $172, %esp # 172 is the size of Trapframe without cross ring part - pushl %esp - movl %esp, %eax - call up_sigdeliver - addl $8, %esp # skip parameter and tf_curregs - frstor 0(%esp) - addl $108, %esp - popal - popl %es - popl %ds - addl $0x8, %esp # trapno and errcode - iret - - \ No newline at end of file diff --git a/arch/risc-v/src/common/up_exit.c b/arch/risc-v/src/common/up_exit.c index 4345f03f22e31e7aefa86c23baf1c2c57099e63e..3dcbd69f29250dfd39799429ddfb2b3f29b16fe7 100644 --- a/arch/risc-v/src/common/up_exit.c +++ b/arch/risc-v/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/risc-v/src/common/up_exit.c * - * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,11 @@ #include #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -142,11 +143,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/risc-v/src/rv32im/Kconfig b/arch/risc-v/src/rv32im/Kconfig index 9bc4b560f52eddc6c0d681b9da5848601df33db5..e1607047b0fb56205794d9f72f1de969320b5ee2 100644 --- a/arch/risc-v/src/rv32im/Kconfig +++ b/arch/risc-v/src/rv32im/Kconfig @@ -7,8 +7,8 @@ comment "RV32IM Configuration Options" choice prompt "Toolchain Selection" - default RV32IM_TOOLCHAIN_GNU_RVGW if HOST_WINDOWS - default RV32IM_TOOLCHAIN_GNU_RVGL if !HOST_WINDOWS + default RV32IM_TOOLCHAIN_GNU_RVGW if TOOLCHAIN_WINDOWS + default RV32IM_TOOLCHAIN_GNU_RVGL if !TOOLCHAIN_WINDOWS config RV32IM_TOOLCHAIN_GNU_RVGL bool "Generic GNU RVG toolchain under Linux (or other POSIX environment)" @@ -18,7 +18,7 @@ config RV32IM_TOOLCHAIN_GNU_RVGL config RV32IM_TOOLCHAIN_GNU_RVGW bool "Generic GNU RVG toolchain under Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS ---help--- This option should work for any modern GNU toolchain (GCC 5.2 or newer) configured for riscv32-unknown-elf. diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig index 975d0449a5b6d44f9e89e529a13b80e248b4f617..5168c7796eb0a24bf2efd1cfc043007d4d33314d 100644 --- a/arch/sim/Kconfig +++ b/arch/sim/Kconfig @@ -37,7 +37,7 @@ config SIM_CYGWIN_DECORATED default n depends on WINDOWS_CYGWIN ---help--- - Older versions of Cygwin toolsdecorated C symbol names by adding an + Older versions of Cygwin tools decorated C symbol names by adding an underscore to the beginning of the symbol name. Newer versions of Cygwin do not seem to do this. diff --git a/arch/sim/include/spinlock.h b/arch/sim/include/spinlock.h index 350bf24b33ea1c957ca3f106ce038b5bfc130c67..85333276b12cbe4edf8977bf290674292b21c816 100644 --- a/arch/sim/include/spinlock.h +++ b/arch/sim/include/spinlock.h @@ -46,6 +46,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Must match definitions in up_testset.c */ #define SP_UNLOCKED false /* The Un-locked state */ diff --git a/arch/sim/src/nuttx-names.dat b/arch/sim/src/nuttx-names.dat index 759743be5348a5450f65d814738774a060183db4..f1373f1d9c18f822fddf25d6d51cae46fb603202 100644 --- a/arch/sim/src/nuttx-names.dat +++ b/arch/sim/src/nuttx-names.dat @@ -62,7 +62,10 @@ pthread_mutex_init NXpthread_mutex_init pthread_mutex_lock NXpthread_mutex_lock pthread_mutex_unlock NXpthread_mutex_unlock pthread_setspecific NXpthread_setspecific +pthread_setcancelstate NXpthread_setcancelstate +pthread_setcanceltype NXpthread_setcanceltype pthread_sigmask NXpthread_sigmask +pthread_testcancel NXpthread_testcancel pthread_yield NXpthread_yield ptsname NXptsname ptsname_r NXptsname_r diff --git a/arch/sim/src/up_idle.c b/arch/sim/src/up_idle.c index 2e218b319dfece58e31cd42addc9a437fac0edef..1912bf755cc7304e5677b04aed54f3c0afd56434 100644 --- a/arch/sim/src/up_idle.c +++ b/arch/sim/src/up_idle.c @@ -105,7 +105,7 @@ void up_idle(void) * should not matter which, however. */ - static volatile spinlock_t lock = SP_UNLOCKED; + static volatile spinlock_t lock SP_SECTION = SP_UNLOCKED; /* The one that gets the lock is the one that executes the IDLE operations */ diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index 658ec0539bc19c31be0216f3505501fb9a3c56b1..7ca32a479ea876c9e0e83db98c27e83ce6e30b68 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -52,7 +52,7 @@ # include # ifdef CONFIG_SMP # include -# include +# include # endif #endif @@ -199,6 +199,25 @@ extern volatile int g_eventloop; extern volatile int g_uart_data_available; #endif +#ifdef CONFIG_SMP +/* These spinlocks are used in the SMP configuration in order to implement + * up_cpu_pause(). The protocol for CPUn to pause CPUm is as follows + * + * 1. The up_cpu_pause() implementation on CPUn locks both g_cpu_wait[m] + * and g_cpu_paused[m]. CPUn then waits spinning on g_cpu_paused[m]. + * 2. CPUm receives the interrupt it (1) unlocks g_cpu_paused[m] and + * (2) locks g_cpu_wait[m]. The first unblocks CPUn and the second + * blocks CPUm in the interrupt handler. + * + * When CPUm resumes, CPUn unlocks g_cpu_wait[m] and the interrupt handler + * on CPUm continues. CPUm must, of course, also then unlock g_cpu_wait[m] + * so that it will be ready for the next pause operation. + */ + +volatile spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS] SP_SECTION; +volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS] SP_SECTION; +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/arch/sim/src/up_netdriver.c b/arch/sim/src/up_netdriver.c index 1e7ef5345cf64cede285ad22f5bd4132961ffc2c..d9c12ae3397fe86405d2d966cf805b233b1faea0 100644 --- a/arch/sim/src/up_netdriver.c +++ b/arch/sim/src/up_netdriver.c @@ -78,15 +78,18 @@ struct timer uint32_t start; }; -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ static struct timer g_periodic_timer; + +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Ethernet peripheral state */ + static struct net_driver_s g_sim_dev; /**************************************************************************** @@ -340,6 +343,7 @@ int netdriver_init(void) /* Set callbacks */ + g_sim_dev.d_buf = g_pktbuf; /* Single packet buffer */ g_sim_dev.d_ifup = netdriver_ifup; g_sim_dev.d_ifdown = netdriver_ifdown; diff --git a/arch/sim/src/up_simsmp.c b/arch/sim/src/up_simsmp.c index 7ff5cdb6d0d5e9e4956929bcda36a9ba00f1b9df..8a1469976d4d5a9fa6f54a693a7564c15b7f75a9 100644 --- a/arch/sim/src/up_simsmp.c +++ b/arch/sim/src/up_simsmp.c @@ -78,16 +78,30 @@ struct sim_cpuinfo_s static pthread_key_t g_cpukey; static pthread_t g_sim_cputhread[CONFIG_SMP_NCPUS]; -static volatile unsigned char g_sim_cpupaused[CONFIG_SMP_NCPUS]; -static volatile spinlock_t g_sim_cpuwait[CONFIG_SMP_NCPUS]; + +/* These spinlocks are used in the SMP configuration in order to implement + * up_cpu_pause(). The protocol for CPUn to pause CPUm is as follows + * + * 1. The up_cpu_pause() implementation on CPUn locks both g_cpu_wait[m] + * and g_cpu_paused[m]. CPUn then waits spinning on g_cpu_paused[m]. + * 2. CPUm receives the interrupt it (1) unlocks g_cpu_paused[m] and + * (2) locks g_cpu_wait[m]. The first unblocks CPUn and the second + * blocks CPUm in the interrupt handler. + * + * When CPUm resumes, CPUn unlocks g_cpu_wait[m] and the interrupt handler + * on CPUm continues. CPUm must, of course, also then unlock g_cpu_wait[m] + * so that it will be ready for the next pause operation. + */ + +volatile spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS]; +volatile spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS]; /**************************************************************************** * NuttX domain function prototypes ****************************************************************************/ void os_start(void) __attribute__ ((noreturn)); -void sim_cpu_pause(int cpu, volatile spinlock_t *wait, - volatile unsigned char *paused); +void up_cpu_paused(int cpu); void sim_smp_hook(void); /**************************************************************************** @@ -222,9 +236,7 @@ static void sim_handle_signal(int signo, siginfo_t *info, void *context) { int cpu = (int)((uintptr_t)pthread_getspecific(g_cpukey)); - /* We need to perform the actual tasking operations in the NuttX domain */ - - sim_cpu_pause(cpu, &g_sim_cpuwait[cpu], &g_sim_cpupaused[cpu]); + (void)up_cpu_paused(cpu); } /**************************************************************************** @@ -446,7 +458,8 @@ int up_cpu_pause(int cpu) { /* Take the spinlock that will prevent the CPU thread from running */ - g_sim_cpuwait[cpu] = SP_LOCKED; + g_cpu_wait[cpu] = SP_LOCKED; + g_cpu_paused[cpu] = SP_LOCKED; /* Signal the CPU thread */ @@ -454,7 +467,7 @@ int up_cpu_pause(int cpu) /* Spin, waiting for the thread to pause */ - while (!g_sim_cpupaused[cpu]) + while (g_cpu_paused[cpu] != 0) { pthread_yield(); } @@ -485,6 +498,6 @@ int up_cpu_resume(int cpu) { /* Release the spinlock that will alloc the CPU thread to continue */ - g_sim_cpuwait[cpu] = SP_UNLOCKED; + g_cpu_wait[cpu] = SP_UNLOCKED; return 0; } diff --git a/arch/sim/src/up_smpsignal.c b/arch/sim/src/up_smpsignal.c index f921c7f3b4969ae6ea7b169988616ebce422383c..5b5c761a07197ba0f780f71bae49a49b35cecf60 100644 --- a/arch/sim/src/up_smpsignal.c +++ b/arch/sim/src/up_smpsignal.c @@ -52,26 +52,53 @@ ****************************************************************************/ /**************************************************************************** - * Name: sim_cpu_pause + * Name: up_cpu_pausereq * * Description: - * This is the SIGUSR1 signal handling logic. It implements the core - * logic of up_cpu_pause() on the thread of execution the simulated CPU. - * This is the part of the implementation that must be performed in the - * NuttX vs. the host domain. + * Return true if a pause request is pending for this CPU. * * Input Parameters: - * cpu - The CPU being paused. - * wait - Spinlock to wait on to be un-paused - * paused - A boolean to set when we are in the paused state. + * cpu - The index of the CPU to be queried * * Returned Value: - * None + * true = a pause request is pending. + * false = no pasue request is pending. * ****************************************************************************/ -void sim_cpu_pause(int cpu, volatile spinlock_t *wait, - volatile unsigned char *paused) +bool up_cpu_pausereq(int cpu) +{ + return spin_islocked(&g_cpu_paused[cpu]); +} + +/**************************************************************************** + * Name: up_cpu_paused + * + * Description: + * Handle a pause request from another CPU. Normally, this logic is + * executed from interrupt handling logic within the architecture-specific + * However, it is sometimes necessary necessary to perform the pending + * pause operation in other contexts where the interrupt cannot be taken + * in order to avoid deadlocks. + * + * This function performs the following operations: + * + * 1. It saves the current task state at the head of the current assigned + * task list. + * 2. It waits on a spinlock, then + * 3. Returns from interrupt, restoring the state of the new task at the + * head of the ready to run list. + * + * Input Parameters: + * cpu - The index of the CPU to be paused + * + * Returned Value: + * On success, OK is returned. Otherwise, a negated errno value indicating + * the nature of the failure is returned. + * + ****************************************************************************/ + +int up_cpu_paused(int cpu) { struct tcb_s *rtcb = current_task(cpu); @@ -86,16 +113,18 @@ void sim_cpu_pause(int cpu, volatile spinlock_t *wait, if (up_setjmp(rtcb->xcp.regs) == 0) { - /* Indicate that we are in the paused state */ + /* Unlock the g_cpu_paused spinlock to indicate that we are in the + * paused state + */ - *paused = 1; + spin_unlock(&g_cpu_paused[cpu]); /* Spin until we are asked to resume. When we resume, we need to * inicate that we are not longer paused. */ - spin_lock(wait); - *paused = 0; + spin_lock(&g_cpu_wait[cpu]); + spin_unlock(&g_cpu_wait[cpu]); /* While we were paused, logic on a different CPU probably changed * the task as that head of the assigned task list. So now we need @@ -125,7 +154,8 @@ void sim_cpu_pause(int cpu, volatile spinlock_t *wait, up_longjmp(rtcb->xcp.regs, 1); } + + return OK; } #endif /* CONFIG_SMP */ - diff --git a/arch/x86/include/i486/arch.h b/arch/x86/include/i486/arch.h index 1994e3fda3ceee6c394ded91216e600bbf06bb04..44207e98d4007eaa7be39ff4a0fca6281296cc73 100644 --- a/arch/x86/include/i486/arch.h +++ b/arch/x86/include/i486/arch.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/include/i486/arch.h * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -317,7 +317,7 @@ /* This structure defines one segment */ -struct gdt_entry_s +begin_packed_struct struct gdt_entry_s { uint16_t lowlimit; /* The lower 16 bits of the limit */ uint16_t lowbase; /* The lower 16 bits of the base */ @@ -325,17 +325,17 @@ struct gdt_entry_s uint8_t access; /* Access flags, determine ring segment can be used in */ uint8_t granularity; uint8_t hibase; /* The last 8 bits of the base */ -} packed_struct; +} end_packed_struct; /* This structure refers to the array of GDT entries, and is in the format * required by the lgdt instruction. */ -struct gdt_ptr_s +begin_packed_struct struct gdt_ptr_s { uint16_t limit; /* The upper 16 bits of all selector limits */ uint32_t base; /* The address of the first GDT entry */ -} packed_struct; +} end_packed_struct; /* IDT data structures ****************************************************** * @@ -344,24 +344,24 @@ struct gdt_ptr_s * processor to determine the correct response to interrupts and exceptions. */ -struct idt_entry_s +begin_packed_struct struct idt_entry_s { uint16_t lobase; /* Lower 16-bits of vector address for interrupt */ uint16_t sel; /* Kernel segment selector */ uint8_t zero; /* This must always be zero */ uint8_t flags; /* (See documentation) */ uint16_t hibase; /* Upper 16-bits of vector address for interrupt */ -} packed_struct; +} end_packed_struct; /* A struct describing a pointer to an array of interrupt handlers. This is * in a format suitable for giving to 'lidt'. */ -struct idt_ptr_s +begin_packed_struct struct idt_ptr_s { uint16_t limit; uint32_t base; /* The address of the first GDT entry */ -} packed_struct; +} end_packed_struct; /**************************************************************************** * Inline functions diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index 5ebeba07c3b2fa79abac0fa951cbb77a534a11aa..66399be6db10186bd07bb8472bbaa7b7c617eb89 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_exit.c * - * Copyright (C) 2011, 2013-2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013-2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,10 +41,11 @@ #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -140,11 +141,11 @@ void _exit(int status) { struct tcb_s* tcb; - /* Disable interrupts. They will be restored when the next - * task is started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 5c051980e68100ddc254638cdf2ae4348cd123b8..b00d8f0d235a1fafe6bc6bf06ebf1f1effd00b02 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -22,6 +22,10 @@ config ARCH_CHIP_ESP32 of two CPUs is symmetric, meaning they use the same addresses to access the same memory. + The two CPUs are named "PRO_CPU" and "APP_CPU" (for "protocol" and + "application"), however for most purposes the two CPUs are + interchangeable. + endchoice # XTENSA chip selection config ARCH_FAMILY_LX6 diff --git a/arch/xtensa/include/esp32/irq.h b/arch/xtensa/include/esp32/irq.h index 4c8e6c47ca5d812ee624496862fb4d7454337797..6c0373856ddc01a13dd5e63126110e119b7c74a6 100644 --- a/arch/xtensa/include/esp32/irq.h +++ b/arch/xtensa/include/esp32/irq.h @@ -378,7 +378,7 @@ #define ESP32_CPUINT_NEDGEPERIPHS 4 #define EPS32_CPUINT_EDGESET 0x50400400 -#define ESP32_CPUINT_NNMIPERIPHS 4 +#define ESP32_CPUINT_NNMIPERIPHS 1 #define EPS32_CPUINT_NMISET 0x00004000 #define ESP32_CPUINT_TIMER0 6 @@ -388,11 +388,12 @@ #define ESP32_CPUINT_TIMER2 16 #define ESP32_CPUINT_SOFTWARE1 29 -#define ESP32_CPUINT_NINTERNAL 5 +#define ESP32_CPUINT_NINTERNAL 6 -#define ESP32_CPUINT_MAX 31 -#define EPS32_CPUINT_PERIPHSET 0xdffe6f3f -#define EPS32_CPUINT_INTERNALSET 0x200180c0 +#define ESP32_NCPUINTS 32 +#define ESP32_CPUINT_MAX (ESP32_NCPUINTS - 1) +#define EPS32_CPUINT_PERIPHSET 0xdffe773f +#define EPS32_CPUINT_INTERNALSET 0x200188c0 /* Priority 1: 0-10, 12-13, 17-18 (15) * Priority 2: 19-21 (3) diff --git a/arch/xtensa/include/irq.h b/arch/xtensa/include/irq.h index 0e8f7c33b01af80c53cd9be35d43e4ec0639bf6c..aee6625ddeacf2473bf298776dab16199c04f2e3 100644 --- a/arch/xtensa/include/irq.h +++ b/arch/xtensa/include/irq.h @@ -108,20 +108,21 @@ # define REG_LBEG (_REG_LOOPS_START + 0) # define REG_LEND (_REG_LOOPS_START + 1) # define REG_LCOUNT (_REG_LOOPS_START + 2) -# define _REG_CALL0_START (_REG_LOOPS_START + 3) +# define _REG_WINDOW_TMPS (_REG_LOOPS_START + 3) #else -# define _REG_CALL0_START _REG_LOOPS_START +# define _REG_WINDOW_TMPS _REG_LOOPS_START #endif #ifndef __XTENSA_CALL0_ABI__ - /* Temporary space for saving stuff during window spill */ + /* Temporary space for saving stuff during window spill. + * REVISIT: I don't think that we need so many temporaries. + */ -# define REG_TMP0 (_REG_CALL0_START + 0) -# define REG_TMP1 (_REG_CALL0_START + 1) -# define REG_TMP2 (_REG_CALL0_START + 2) -# define _REG_OVLY_START (_REG_CALL0_START + 3) +# define REG_TMP0 (_REG_WINDOW_TMPS + 0) +# define REG_TMP1 (_REG_WINDOW_TMPS + 1) +# define _REG_OVLY_START (_REG_WINDOW_TMPS + 2) #else -# define _REG_OVLY_START _REG_CALL0_START +# define _REG_OVLY_START _REG_WINDOW_TMPS #endif #ifdef CONFIG_XTENSA_USE_OVLY diff --git a/arch/xtensa/include/xtensa/xtensa_coproc.h b/arch/xtensa/include/xtensa/xtensa_coproc.h index 547944470340f57da4dd2d390b770fc877b8d5ef..26829a7a3a43257f798bdb770b85160a264792ff 100644 --- a/arch/xtensa/include/xtensa/xtensa_coproc.h +++ b/arch/xtensa/include/xtensa/xtensa_coproc.h @@ -153,7 +153,8 @@ static inline uint32_t xtensa_get_cpenable(void) __asm__ __volatile__ ( - "rsr %0, CPENABLE" : "=r"(cpenable) + "\trsr %0, CPENABLE\n" + : "=r"(cpenable) ); return cpenable; @@ -165,7 +166,9 @@ static inline void xtensa_set_cpenable(uint32_t cpenable) { __asm__ __volatile__ ( - "wsr %0, PS" : : "r"(cpenable) + "\twsr %0, CPENABLE\n" + "\trsync\n" + : : "r"(cpenable) ); } diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h index 422ec0b96fb04939af50977fb1faa853675e6a6e..133903d19411f3ff358f92eea3cd21ddf2f14ff4 100644 --- a/arch/xtensa/src/common/xtensa.h +++ b/arch/xtensa/src/common/xtensa.h @@ -104,10 +104,30 @@ /* Check if an interrupt stack size is configured */ -#ifndef CONFIG_ARCH_INTERRUPTSTACK -# define CONFIG_ARCH_INTERRUPTSTACK 0 +#define HAVE_INTERRUPTSTACK 1 + +#if !defined(CONFIG_ARCH_INTERRUPTSTACK) +# define CONFIG_ARCH_INTERRUPTSTACK 0 +# undef HAVE_INTERRUPTSTACK +#elif CONFIG_ARCH_INTERRUPTSTACK < 16 +# warning CONFIG_ARCH_INTERRUPTSTACK is to small +# undef HAVE_INTERRUPTSTACK #endif +#define INTERRUPTSTACK_SIZE ((CONFIG_ARCH_INTERRUPTSTACK + 15) & ~15) +#define INTERRUPT_STACKWORDS (INTERRUPTSTACK_SIZE >> 2) + +/* An IDLE thread stack size for CPU0 must be defined */ + +#if !defined(CONFIG_IDLETHREAD_STACKSIZE) +# error CONFIG_IDLETHREAD_STACKSIZE is not defined +#elif CONFIG_IDLETHREAD_STACKSIZE < 16 +# error CONFIG_IDLETHREAD_STACKSIZE is to small +#endif + +#define IDLETHREAD_STACKSIZE ((CONFIG_IDLETHREAD_STACKSIZE + 15) & ~15) +#define IDLETHREAD_STACKWORDS (IDLETHREAD_STACKSIZE >> 2) + /* Used for stack usage measurements */ #define STACK_COLOR 0xdeadbeef @@ -180,12 +200,16 @@ extern volatile uint32_t *g_current_regs[1]; #endif -/* Address of the saved user stack pointer */ +#ifdef HAVE_INTERRUPTSTACK +/* The (optional) interrupt stack */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 -extern void g_intstackbase; +extern uint32_t g_intstack[INTERRUPT_STACKWORDS]; #endif +/* Address of the CPU0 IDLE thread */ + +extern uint32_t g_idlestack[IDLETHREAD_STACKWORDS]; + /* These 'addresses' of these values are setup by the linker script. They are * not actual uint32_t storage locations! They are only used meaningfully in the * following way: @@ -266,7 +290,7 @@ void xtensa_coproc_disable(struct xtensa_cpstate_s *cpstate, int cpset); /* IRQs */ -uint32_t *xtensa_int_decode(uint32_t *regs); +uint32_t *xtensa_int_decode(uint32_t cpuints, uint32_t *regs); uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs); uint32_t xtensa_enable_cpuint(uint32_t *shadow, uint32_t intmask); uint32_t xtensa_disable_cpuint(uint32_t *shadow, uint32_t intmask); @@ -293,7 +317,8 @@ void xtensa_coproc_restorestate(struct xtensa_cpstate_s *cpstate); /* Signals */ -void xtensa_sigdeliver(void); +void _xtensa_sig_trampoline(void); +void xtensa_sig_deliver(void); /* Chip-specific functions **************************************************/ /* Chip specific functions defined in arch/xtensa/src/ */ diff --git a/arch/xtensa/src/common/xtensa_abi.h b/arch/xtensa/src/common/xtensa_abi.h index 63e53f26c5d0a87d0edc2f48b9a5340e1e54d9b2..db5ab5d55217c4c4505fcce7483238e2c60f0f93 100644 --- a/arch/xtensa/src/common/xtensa_abi.h +++ b/arch/xtensa/src/common/xtensa_abi.h @@ -58,6 +58,27 @@ * CALL8, or CALL12 instructions to save 4, 8, or 12 live registers. Calls * to routines that use a2..a7 for parameters may use only CALL8 or CALL12. * + * Arguments are passed in both registers and memory. The first six incoming + * arguments are stored in registers a2 through a7, and additional arguments + * are stored on the stack starting at the current stack pointer a1. Because + * Xtensa uses register windows that rotate during a function call, outgoing + * arguments that will become the incoming arguments must be stored to + * different register numbers. Depending on the call instruction and, thus, + * the rotation of the register window, the arguments are passed starting + * starting with register a(2+N), where N is the size of the window rotation. + * Therefore, the first argument in case of a call4 instruction is placed into + * a6, and for a call8 instruction into a10. Large arguments (8-bytes) are + * always passed in an even/odd register pair even if that means to omit a + * register for alignment. The return values are stored in a2 through a7. + * + * return addr stack ptr arg0, arg1, arg2, arg3, arg4, arg5 + * ----------- --------- ---------------------------------- + * a0 a1 a2, a3, a4, a5, a6, a7 + * + * call4 a4 a5 a6, a7, a8, a9, a10, a11 + * call8 a8 a9 a10, a11, a12, a13, a14, a15 + * call12 a12 a13 a14, a15 --- --- --- --- + * * The stack pointer SP should only be modified by ENTRY and MOVSP * instructions (except for initialization and restoration). If some other * instruction modifies SP, any values in the register-spill area will not diff --git a/arch/xtensa/src/common/xtensa_checkstack.c b/arch/xtensa/src/common/xtensa_checkstack.c new file mode 100644 index 0000000000000000000000000000000000000000..4853513905721cc9b8242c6eb550ed6cc28ec9a7 --- /dev/null +++ b/arch/xtensa/src/common/xtensa_checkstack.c @@ -0,0 +1,214 @@ +/**************************************************************************** + * arch/xtensa/src/common/xtensa_checkstack.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "xtensa.h" +#include "sched/sched.h" + +#ifdef CONFIG_STACK_COLORATION + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static size_t do_stackcheck(uintptr_t alloc, size_t size); + +/**************************************************************************** + * Name: do_stackcheck + * + * Description: + * Determine (approximately) how much stack has been used be searching the + * stack memory for a high water mark. That is, the deepest level of the + * stack that clobbered some recognizable marker in the stack memory. + * + * Input Parameters: + * alloc - Allocation base address of the stack + * size - The size of the stack in bytes + * + * Returned value: + * The estimated amount of stack space used. + * + ****************************************************************************/ + +static size_t do_stackcheck(uintptr_t alloc, size_t size) +{ + FAR uintptr_t start; + FAR uintptr_t end; + FAR uint32_t *ptr; + size_t mark; + + if (size == 0) + { + return 0; + } + + /* Get aligned addresses of the top and bottom of the stack */ + +#ifdef CONFIG_TLS + /* Skip over the TLS data structure at the bottom of the stack */ + + DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); + start = alloc + sizeof(struct tls_info_s); +#else + start = alloc & ~3; +#endif + end = (alloc + size + 3) & ~3; + + /* Get the adjusted size based on the top and bottom of the stack */ + + size = end - start; + + /* The Xtensa CPUs use a push-down stack: the stack grows toward lower + * addresses in memory. We need to start at the lowest address in the + * stack memory allocation and search to higher addresses. The first word + * we encounter that does not have the magic value is the high water mark. + */ + + for (ptr = (FAR uint32_t *)start, mark = (size >> 2); + *ptr == STACK_COLOR && mark > 0; + ptr++, mark--); + + /* If the stack is completely used, then this might mean that the stack + * overflowed from above (meaning that the stack is too small), or may + * have been overwritten from below meaning that some other stack or data + * structure overflowed. + * + * If you see returned values saying that the entire stack is being used + * then enable the following logic to see it there are unused areas in the + * middle of the stack. + */ + +#if 0 + if (mark + 16 > nwords) + { + int i; + int j; + + ptr = (FAR uint32_t *)start; + for (i = 0; i < size; i += 4*64) + { + for (j = 0; j < 64; j++) + { + int ch; + if (*ptr++ == STACK_COLOR) + { + ch = '.'; + } + else + { + ch = 'X'; + } + + up_putc(ch); + } + + up_putc('\n'); + } + } +#endif + + /* Return our guess about how much stack space was used */ + + return mark << 2; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_check_stack and friends + * + * Description: + * Determine (approximately) how much stack has been used be searching the + * stack memory for a high water mark. That is, the deepest level of the + * stack that clobbered some recognizable marker in the stack memory. + * + * Input Parameters: + * None + * + * Returned value: + * The estimated amount of stack space used. + * + ****************************************************************************/ + +size_t up_check_tcbstack(FAR struct tcb_s *tcb) +{ + return do_stackcheck((uintptr_t)tcb->stack_alloc_ptr, tcb->adj_stack_size); +} + +ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb) +{ + return (ssize_t)tcb->adj_stack_size - (ssize_t)up_check_tcbstack(tcb); +} + +size_t up_check_stack(void) +{ + return up_check_tcbstack(this_task()); +} + +ssize_t up_check_stack_remain(void) +{ + return up_check_tcbstack_remain(this_task()); +} + +#if CONFIG_ARCH_INTERRUPTSTACK > 3 +size_t up_check_intstack(void) +{ + return do_stackcheck((uintptr_t)&g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)); +} + +size_t up_check_intstack_remain(void) +{ + return (CONFIG_ARCH_INTERRUPTSTACK & ~3) - up_check_intstack(); +} +#endif + +#endif /* CONFIG_STACK_COLORATION */ diff --git a/arch/xtensa/src/common/xtensa_context.S b/arch/xtensa/src/common/xtensa_context.S index 8d9462e5a60d323312395e00e4dee5c13e3f376e..aa0306cb5a25451e18d6b7384890b794203d37de 100644 --- a/arch/xtensa/src/common/xtensa_context.S +++ b/arch/xtensa/src/common/xtensa_context.S @@ -116,7 +116,6 @@ _xtensa_context_save: - s32i a2, a2, (4 * REG_A2) s32i a3, a2, (4 * REG_A3) s32i a4, a2, (4 * REG_A4) s32i a5, a2, (4 * REG_A5) @@ -146,22 +145,13 @@ _xtensa_context_save: s32i a3, a2, (4 * REG_LCOUNT) #endif -#ifndef __XTENSA_CALL0_ABI__ - mov a9, a0 /* Preserve ret addr */ -#endif - #ifndef __XTENSA_CALL0_ABI__ /* To spill the reg windows, temp. need pre-interrupt stack ptr and - * a4-15. Need to save a9,12,13 temporarily (in frame temps) and - * recover originals. Interrupts need to be disabled below - * XCHAL_EXCM_LEVEL and window overflow and underflow exceptions - * disabled (assured by PS.EXCM == 1). + * a4-15. Interrupts need to be disabled below XCHAL_EXCM_LEVEL and + * window overflow and underflow exceptions disabled (assured by + * PS.EXCM == 1). */ - s32i a12, a2, (4 * REG_TMP0) /* Temp. save stuff in stack frame */ - s32i a13, a2, (4 * REG_TMP1) - s32i a9, a2, (4 * REG_TMP2) - #ifdef CONFIG_XTENSA_USE_OVLY /* Save the overlay state if we are supporting overlays. Since we just * saved three registers, we can conveniently use them here. Note that @@ -171,17 +161,16 @@ _xtensa_context_save: #error Overly support is not implemented #endif - l32i a12, a2, (4 * REG_A12) /* Recover original a9,12,13 */ - l32i a13, a2, (4 * REG_A13) - l32i a9, a2, (4 * REG_A9) - -#warning REVISIT: The following is probably not correct due to changes in registers - addi sp, sp, (4 * XCPTCONTEXT_SIZE) /* Restore the interruptee's SP */ - call0 _xtensa_window_spill /* Preserves only a4,5,8,9,12,13 */ - addi sp, sp, -(4 * XCPTCONTEXT_SIZE) - l32i a12, sp, (4 * REG_TMP0) /* Recover stuff from stack frame */ - l32i a13, sp, (4 * REG_TMP1) - l32i a9, sp, (4 * REG_TMP2) + s32i a0, a2, (4 * REG_TMP0) /* Save return address */ + s32i sp, a2, (4 * REG_TMP1) /* Save current stack pointer */ + wsr a2, EXCSAVE_1 /* Preserve register save area */ + + l32i sp, a2, (4 * REG_A1) /* Restore the interruptee's SP */ + call0 _xtensa_window_spill /* Preserves only a4-a5, a8-a9, a12-a13 */ + + rsr a2, EXCSAVE_1 /* Save interruptee's a0 */ + l32i a0, a2, (4 * REG_TMP0) /* Save return address */ + l32i sp, a2, (4 * REG_TMP1) /* Save current stack pointer */ #endif ret @@ -193,13 +182,11 @@ _xtensa_context_save: * * Description: * - * NOTE: MUST BE CALLED ONLY BY 'CALL0' INSTRUCTION! - * * This functions implements the moral equivalent of setjmp(). It is * called from user code (with interrupts disabled) to save the current * state of the running thread. This function always returns zero. * However, it sets the saved value of the return address (A2) to 1. - * If the thread is restarted via _xtensa_contest_restore or + * If the thread is s via _xtensa_context_restore or * xtensa_context_restore, it will appear as a second return from * xtensa_context_save but with the returned value of 1 to distinguish * the two cases. @@ -217,6 +204,24 @@ _xtensa_context_save: * Assumptions: * - Interrupts are disabled. * + ****************************************************************************/ + +#ifdef __XTENSA_CALL0_ABI__ + +/**************************************************************************** + * Name: xtensa_context_save: + * + * Description: + * This implementation of xtensa_context_save for the case of the CALL0 ABI + * + * Input State: + * a0 = The return value to the caller. + * a2 = The address of the register state state structure + * + * Return state: + * a0 = The return value to the caller. + * a2, a12-a15 preserved as at entry + * ****************************************************************************/ .global xtensa_context_save @@ -227,30 +232,185 @@ _xtensa_context_save: .align 4 xtensa_context_save: + ENTRY(16) - /* Set up for call to _xtensa_context_save() */ + /* Set up for (potential) call to _xtensa_context_save() */ - rsr a12, PS /* Save callee's PS */ - s32i a12, a2, (4 * REG_PS) + s32i a3, a2, (4 * REG_A3) /* Get scratch register */ + rsr a3, PS /* Save callee's PS */ + s32i a3, a2, (4 * REG_PS) s32i a0, a2, (4 * REG_PC) /* Save Return address as PC */ s32i a0, a2, (4 * REG_A0) /* Save callee's a0 */ s32i sp, a2, (4 * REG_A1) /* Save callee's SP */ - movi a12, 1 /* Set saved A2 to 1 */ - s32i a12, a2, (4 * REG_A2) + movi a3, 1 /* Set saved A2 to 1 */ + s32i a3, a2, (4 * REG_A2) - /* Save the rest of the processor state */ + /* Save the rest of the processor state. For the CALL0 ABI, we can user + * _xtensa_context_save(), Otherwise we duplicate the context save here + * to avoid the window spill. + */ + l32i r3, a2, (4 * REG_A3) /* Recover original a3 */ call0 _xtensa_context_save /* Save full register state */ /* Recover the return address and return zero */ l32i a0, a2, (4 * REG_A0) /* Recover return addess */ movi a2, 0 /* Return zero */ + RET(16) + + .size xtensa_context_save, . - xtensa_context_save +#endif +/**************************************************************************** + * This implementation of xtensa_context_save for the case of the window ABI. + * This case is more complex. For the Window ABI, there is a "hook" that + * performs the low level state state. xtensa_context_save() is a simply + * trampoline function that performs the window oeprations in that + * configuration. + ****************************************************************************/ + +#ifndef __XTENSA_CALL0_ABI__ + +/**************************************************************************** + * Name: _xtensa_save_hook: + * + * Input State: + * True return value has already been saved + * a0 = The return value into xtensa_context_save() + * a2 = The address of the register state state structure + * + * Return state: + * a0, a3 modified. + * Other values as on entry + * Returned value is in a3 (non-stanadard) + * + ****************************************************************************/ + + .type _xtensa_save_hook, @function + + .align 4 + .literal_position + .align 4 + +_xtensa_save_hook: + + /* Save the return value of 1 that will be used when returning from a + * context switch. NOTE that the returned value from this function is + * expected in a3 (not the usual a2). This also frees up a3 for a use + * as a scratch register. + */ + + movi a3, 1 /* Set saved a3 to 1 */ + s32i a3, a2, (4 * REG_A3) + + /* Save the rest of the processor state. + * + * REVISIT: We could save a lot here. It should not be necessary to + * preserve all of these registers. The ABI permits volatile, callee- + * saved, registers to be clobbered on function calls. We save the + * whole tamale here mostly for debug purposes. + * + * NOTE that a3 was saved above. The true a0 return value was saved + * in xtensa_context_save. The a0 value saved below is the return into + * xtensa_context_save. + */ + + rsr a3, PS /* Save callee's PS */ + s32i a3, a2, (4 * REG_PS) + s32i a0, a2, (4 * REG_PC) /* Save Return address as PC */ + + s32i sp, a2, (4 * REG_A1) /* Save callee's SP */ + s32i a2, a2, (4 * REG_A2) + s32i a4, a2, (4 * REG_A4) /* Save remaining registers */ + s32i a5, a2, (4 * REG_A5) + s32i a6, a2, (4 * REG_A6) + s32i a7, a2, (4 * REG_A7) + s32i a8, a2, (4 * REG_A8) + s32i a9, a2, (4 * REG_A9) + s32i a10, a2, (4 * REG_A10) + s32i a11, a2, (4 * REG_A11) + + /* Call0 ABI callee-saved regs a12-15 */ + + s32i a12, a2, (4 * REG_A12) + s32i a13, a2, (4 * REG_A13) + s32i a14, a2, (4 * REG_A14) + s32i a15, a2, (4 * REG_A15) + + rsr a3, SAR + s32i a3, a2, (4 * REG_SAR) + +#ifdef XCHAL_HAVE_LOOPS + rsr a3, LBEG + s32i a3, a2, (4 * REG_LBEG) + rsr a3, LEND + s32i a3, a2, (4 * REG_LEND) + rsr a3, LCOUNT + s32i a3, a2, (4 * REG_LCOUNT) +#endif + + /* NOTE that the returned value is through a3 */ + + movi a3, 0 /* Return zero, no context switch */ ret + .size _xtensa_save_hook, . - _xtensa_save_hook + +/**************************************************************************** + * Name: xtensa_context_save: + * + * Description: + * This is the implementation of xtensa_context_save for the case of the + * window ABI. In the window ABI configuration, xtensa_context_save is a + * thin "trampoline" layer. It performs the ENTRY window operations on + * entry and the exit. A call0 is used to force the retun from the context + * switch to the window return within this trampoline. + * + * Input State: + * a0 = The true return value to the caller. + * a2 = The address of the register state state structure + * + * Return state: + * a0, a2, and a3 modified. + * Returned value is in a2 + * + ****************************************************************************/ + + .global xtensa_context_save + .type xtensa_context_save, @function + + .align 4 + .literal_position + .align 4 + +xtensa_context_save: + ENTRY(16) + + /* Save the true return address in the register save structure (a0). */ + + s32i a0, a2, (4 * REG_A0) /* Save true return address (a0) */ + + /* Then perform the actual state save in _xtensa_save_hook. The saved + * EPC will be set to the return from this function then we will do the + * RET(16) window fix-up. + */ + + call0 _xtensa_save_hook /* Save full register state */ + + /* a0 and a2 will be automatically restored in the context switch case + * with a3=1. In the non-context switch return with a2=0, a2 will still + * be valid, but we have to restore a0 ourself. The following should + * work in either case. + */ + + l32i a0, a2, (4 * REG_A0) /* Recover the true return address (a0) */ + mov a2, a3 /* Move a3 to the correct register for return */ + RET(16) + .size xtensa_context_save, . - xtensa_context_save +#endif /**************************************************************************** * Name: _xtensa_context_restore @@ -273,12 +433,13 @@ xtensa_context_save: * * Exit conditions: * - A0 = Return address in caller. - * - Other registers are restored as detailed above (including A1 and A2). + * - Other registers are restored as detailed above + * - A2 is preserved * ****************************************************************************/ .global _xtensa_context_restore - .type _xtensa_context_restore,@function + .type xtensa_context_restore,@function .align 4 .literal_position @@ -287,12 +448,12 @@ xtensa_context_save: _xtensa_context_restore: #ifdef XCHAL_HAVE_LOOPS - l32i a2, a2, (4 * REG_LBEG) - l32i a3, a2, (4 * REG_LEND) - wsr a2, LBEG - l32i a2, a2, (4 * REG_LCOUNT) - wsr a3, LEND - wsr a2, LCOUNT + l32i a3, a2, (4 * REG_LBEG) + l32i a4, a2, (4 * REG_LEND) + wsr a3, LBEG + l32i a3, a2, (4 * REG_LCOUNT) + wsr a4, LEND + wsr a3, LCOUNT #endif #ifdef CONFIG_XTENSA_USE_OVLY @@ -326,10 +487,6 @@ _xtensa_context_restore: l32i a14, a2, (4 * REG_A14) l32i a15, a2, (4 * REG_A15) - /* Finally, restore A2 with the correct value */ - - l32i a2, a2, (4 * REG_A2) - ret .size _xtensa_context_restore, . - _xtensa_context_restore @@ -339,8 +496,6 @@ _xtensa_context_restore: * * Description: * - * NOTE: MUST BE CALLED ONLY BY 'CALL0' INSTRUCTION! - * * This functions implements the moral equivalent of longjmp(). It is * called from user code (with interrupts disabled) to restor the current * state of the running thread. This function always appears to be a @@ -372,8 +527,40 @@ _xtensa_context_restore: .align 4 xtensa_context_restore: + ENTRY(16) + +#ifndef __XTENSA_CALL0_ABI__ + /* Force a spill of the live registers of the thread that has been + * suspended. + * + * _xtensa_window_spill return state: + * a2, a3: clobbered + * a4,a5,a8,a9,a12,a13: preserved + * a6,a7,a10,a11,a14,a15 clobbered if they were part of window(s) + * to be spilled, otherwise they are the same as on entry + * loop registers: Perserved + * SAR: clobbered + * + * We need to preserve only a2 for _xtensa_context_restore + */ - /* Restore the processor state */ + mov a4, a2 /* Save a2 in a preserved register */ + rsr a5, PS /* Save PS in preserved register */ + + movi a3, ~(PS_WOE_MASK | PS_INTLEVEL_MASK) + and a2, a5, a3 /* Clear WOE, INTLEVEL */ + addi a2, a2, XCHAL_EXCM_LEVEL /* Set INTLEVEL = XCHAL_EXCM_LEVEL */ + wsr a2, PS /* Apply to PS */ + rsync + + call0 _xtensa_window_spill + wsr a5, PS /* Restore PS */ + rsync + + mov a2, a4 /* Recover a2 */ +#endif + + /* Restore the processor state for the newly started thread */ call0 _xtensa_context_restore /* Restore full register state */ @@ -382,10 +569,15 @@ xtensa_context_restore: l32i a0, a2, (4 * REG_PS) /* Restore PS */ wsr a0, PS l32i a0, a2, (4 * REG_PC) /* Set up for RFE */ - rsr a0, EPC + wsr a0, EPC_1 l32i a0, a2, (4 * REG_A0) /* Restore a0 */ l32i a2, a2, (4 * REG_A2) /* Restore A2 */ + /* Return from exception. RFE returns from either the UserExceptionVector + * or the KernelExceptionVector. RFE sets PS.EXCM back to 0, and then + * jumps to the address in EPC[1]. PS.UM and PS.WOE are left unchanged. + */ + rfe /* And return from "exception" */ .size xtensa_context_restore, . - xtensa_context_restore diff --git a/arch/xtensa/src/common/xtensa_coproc.S b/arch/xtensa/src/common/xtensa_coproc.S index 8b01063bf3bfa6dceeb23531c467b607e26edd19..6af4849ceeabf2b58136ab30cd36ed248575d976 100644 --- a/arch/xtensa/src/common/xtensa_coproc.S +++ b/arch/xtensa/src/common/xtensa_coproc.S @@ -225,28 +225,35 @@ xtensa_coproc_savestate: #ifdef __XTENSA_CALL0_ABI__ /* Need to preserve a8-11. _xtensa_coproc_savestate modifies a2-a7, - * a13-a15. So no registers need be saved. + * a13-a15. a12-a15 are callee saved registers so a13-a14 must be + * preserved. */ ENTRY(16) + s32i a13, sp, LOCAL_OFFSET(1) /* Save clobbered registers */ + s32i a14, sp, LOCAL_OFFSET(2) + s32i a15, sp, LOCAL_OFFSET(3) /* Call _xtensa_coproc_savestate() with A2=address of co-processor * save area. */ call0 _xtensa_coproc_savestate + + /* Restore a13-15 and return */ + + l32i a13, sp, LOCAL_OFFSET(1) /* Restore clobbered registers */ + l32i a14, sp, LOCAL_OFFSET(2) + l32i a15, sp, LOCAL_OFFSET(3) RET(16) #else - /* Need to preserve a8-15. _xtensa_coproc_savestate modifies a2-a7, - * a13-a15. So only a13-a15 need be preserved. + * a13-a15. So a13-a15 may need to be preserved. */ - ENTRY(16) - s32i a13, sp, LOCAL_OFFSET(1) - s32i a14, sp, LOCAL_OFFSET(2) - s32i a15, sp, LOCAL_OFFSET(3) + ENTRY(32 /*16*/) /* REVISIT: Why 32? */ + s32i a0, sp, LOCAL_OFFSET(1) /* Save return address */ /* Call _xtensa_coproc_savestate() with A2=address of co-processor * save area. @@ -254,13 +261,10 @@ xtensa_coproc_savestate: call0 _xtensa_coproc_savestate - /* Restore a13-15 and return */ - - l32i a13, sp, LOCAL_OFFSET(1) - l32i a14, sp, LOCAL_OFFSET(2) - l32i a15, sp, LOCAL_OFFSET(3) + /* Restore a0 and return */ - RET(16) + l32i a0, sp, LOCAL_OFFSET(1) /* Recover return address */ + RET(32 /*16*/) /* REVISIT: Why 32? */ #endif @@ -420,42 +424,46 @@ xtensa_coproc_restorestate: #ifdef __XTENSA_CALL0_ABI__ /* Need to preserve a8-11. _xtensa_coproc_restorestate modifies a2-a7, - * a13-a15. So no registers need be saved. + * a13-a15. a12-a15 are callee saved registers so a13-a14 must be + * preserved. */ ENTRY(16) + s32i a13, sp, LOCAL_OFFSET(1) /* Save clobbered values */ + s32i a14, sp, LOCAL_OFFSET(2) + s32i a15, sp, LOCAL_OFFSET(3) /* Call _xtensa_coproc_restorestate() with A2=address of co-processor - * save area. + * save area. Registers a0, a2-a7, a13-a15 have been trashed. */ call0 _xtensa_coproc_restorestate + + /* Restore a13-a15 and return */ + + l32i a13, sp, LOCAL_OFFSET(1) /* Restore clobbered registers */ + l32i a14, sp, LOCAL_OFFSET(2) + l32i a15, sp, LOCAL_OFFSET(3) RET(16) #else - /* Need to preserve a8-15. _xtensa_coproc_savestate modifies a2-a7, - * a13-a15. So only a13-a15 need be preserved. + * a13-a15. So a13-a15 may need to be preserved. */ - ENTRY(16) - s32i a13, sp, LOCAL_OFFSET(1) - s32i a14, sp, LOCAL_OFFSET(2) - s32i a15, sp, LOCAL_OFFSET(3) + ENTRY(32 /*16*/) /* REVISIT: Why 32? */ + s32i a0, sp, LOCAL_OFFSET(1) /* Save return address */ /* Call _xtensa_coproc_restorestate() with A2=address of co-processor - * save area. + * save area. Registers a0, a2-a7, a13-a15 have been trashed. */ call0 _xtensa_coproc_restorestate - /* Restore a13-15 and return */ - - l32i a13, sp, LOCAL_OFFSET(1) - l32i a14, sp, LOCAL_OFFSET(2) - l32i a15, sp, LOCAL_OFFSET(3) + /* Restore a0 and return */ - RET(16) + l32i a0, sp, LOCAL_OFFSET(1) /* Recover return address */ + RET(32 /*16*/) /* REVISIT: Why 32? */ #endif diff --git a/arch/xtensa/src/common/xtensa_cpuint.S b/arch/xtensa/src/common/xtensa_cpuint.S index 6ea46d71d4130dc7a0a1436b70b370bc7115e66a..9c7e28260b562670cdb961bb3fe30bd5b970a74f 100644 --- a/arch/xtensa/src/common/xtensa_cpuint.S +++ b/arch/xtensa/src/common/xtensa_cpuint.S @@ -40,6 +40,8 @@ #include #include +#include "xtensa_abi.h" + #if XCHAL_HAVE_INTERRUPTS /**************************************************************************** @@ -69,6 +71,7 @@ .align 4 xtensa_enable_cpuint: + ENTRY(16) movi a4, 0 xsr a4, INTENABLE /* Disables all interrupts */ @@ -80,7 +83,7 @@ xtensa_enable_cpuint: wsr a5, INTENABLE /* Set CPU INTENABLE to shadow */ mov a3, a4 /* Return previous shadow content */ - ret + RET(16) .size xtensa_enable_cpuint, . - xtensa_enable_cpuint @@ -107,6 +110,7 @@ xtensa_enable_cpuint: .align 4 xtensa_disable_cpuint: + ENTRY(16) movi a4, 0 xsr a4, INTENABLE /* Disables all interrupts */ @@ -119,7 +123,7 @@ xtensa_disable_cpuint: wsr a5, INTENABLE /* Set CPU INTENABLE to shadow */ mov a3, a4 /* Return previous shadow content */ - ret + RET(16) .size xtensa_disable_cpuint, . - xtensa_disable_cpuint diff --git a/arch/xtensa/src/common/xtensa_cpupause.c b/arch/xtensa/src/common/xtensa_cpupause.c index 46bac69bbd6a507191be4a05b101a153a315327b..370054d5c746661e2f5261df8597f493f9f3b65f 100644 --- a/arch/xtensa/src/common/xtensa_cpupause.c +++ b/arch/xtensa/src/common/xtensa_cpupause.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "xtensa.h" #include "sched/sched.h" @@ -54,44 +55,75 @@ * Private Data ****************************************************************************/ -static spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS]; -static spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS]; +static spinlock_t g_cpu_wait[CONFIG_SMP_NCPUS] SP_SECTION; +static spinlock_t g_cpu_paused[CONFIG_SMP_NCPUS] SP_SECTION; /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: xtensa_pause_handler + * Name: up_cpu_pausereq * * Description: - * This is the handler for CPU_INTCODE_PAUSE CPU interrupt. This - * implements up_cpu_pause() by performing the following operations: + * Return true if a pause request is pending for this CPU. * - * 1. The current task state at the head of the current assigned task - * list was saved when the interrupt was entered. - * 2. This function simply waits on a spinlock, then returns. - * 3. Upon return, the interrupt exit logic will restore the state of - * the new task at the head of the ready to run list. + * Input Parameters: + * cpu - The index of the CPU to be queried + * + * Returned Value: + * true = a pause request is pending. + * false = no pasue request is pending. + * + ****************************************************************************/ + +bool up_cpu_pausereq(int cpu) +{ + return spin_islocked(&g_cpu_paused[cpu]); +} + +/**************************************************************************** + * Name: up_cpu_paused + * + * Description: + * Handle a pause request from another CPU. Normally, this logic is + * executed from interrupt handling logic within the architecture-specific + * However, it is sometimes necessary necessary to perform the pending + * pause operation in other contexts where the interrupt cannot be taken + * in order to avoid deadlocks. + * + * This function performs the following operations: + * + * 1. It saves the current task state at the head of the current assigned + * task list. + * 2. It waits on a spinlock, then + * 3. Returns from interrupt, restoring the state of the new task at the + * head of the ready to run list. * * Input Parameters: - * None + * cpu - The index of the CPU to be paused * * Returned Value: - * None + * On success, OK is returned. Otherwise, a negated errno value indicating + * the nature of the failure is returned. * ****************************************************************************/ -void xtensa_pause_handler(void) +int up_cpu_paused(int cpu) { FAR struct tcb_s *otcb = this_task(); FAR struct tcb_s *ntcb; - int cpu = up_cpu_index(); /* Update scheduler parameters */ sched_suspend_scheduler(otcb); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that we are paused */ + + sched_note_cpu_paused(otcb); +#endif + /* Copy the CURRENT_REGS into the OLD TCB (otcb). The co-processor state * will be saved as part of the return from xtensa_irq_dispatch(). */ @@ -109,6 +141,12 @@ void xtensa_pause_handler(void) ntcb = this_task(); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that we have resumed */ + + sched_note_cpu_resumed(ntcb); +#endif + /* Reset scheduler parameters */ sched_resume_scheduler(ntcb); @@ -126,6 +164,33 @@ void xtensa_pause_handler(void) } spin_unlock(&g_cpu_wait[cpu]); + return OK; +} + +/**************************************************************************** + * Name: xtensa_pause_handler + * + * Description: + * This is the handler for CPU_INTCODE_PAUSE CPU interrupt. This + * implements up_cpu_pause() by performing the following operations: + * + * 1. The current task state at the head of the current assigned task + * list was saved when the interrupt was entered. + * 2. This function simply waits on a spinlock, then returns. + * 3. Upon return, the interrupt exit logic will restore the state of + * the new task at the head of the ready to run list. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void xtensa_pause_handler(void) +{ + (void)up_cpu_paused(up_cpu_index()); } /**************************************************************************** @@ -152,6 +217,12 @@ int up_cpu_pause(int cpu) { int ret; +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the pause event */ + + sched_note_cpu_pause(this_task(), cpu); +#endif + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); /* Take the both spinlocks. The g_cpu_wait spinlock will prevent the SGI2 @@ -215,6 +286,12 @@ int up_cpu_pause(int cpu) int up_cpu_resume(int cpu) { +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the resume event */ + + sched_note_cpu_resume(this_task(), cpu); +#endif + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); /* Release the spinlock. Releasing the spinlock will cause the SGI2 diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index 975993af62c67730ff4ebd408507a76ee1ca74dc..ce2808162de4af4cd7d345799e1f3e0afe1a8563 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -78,6 +78,42 @@ static inline uint32_t xtensa_getsp(void) return sp; } +/**************************************************************************** + * Name: up_taskdump + ****************************************************************************/ + +#ifdef CONFIG_STACK_COLORATION +static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg) +{ + /* Dump interesting properties of this task */ + +#if CONFIG_TASK_NAME_SIZE > 0 + _alert("%s: PID=%d Stack Used=%lu of %lu\n", + tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb), + (unsigned long)tcb->adj_stack_size); +#else + _alert("PID: %d Stack Used=%lu of %lu\n", + tcb->pid, (unsigned long)up_check_tcbstack(tcb), + (unsigned long)tcb->adj_stack_size); +#endif +} +#endif + +/**************************************************************************** + * Name: up_showtasks + ****************************************************************************/ + +#ifdef CONFIG_STACK_COLORATION +static inline void up_showtasks(void) +{ + /* Dump interesting properties of each task in the crash environment */ + + sched_foreach(up_taskdump, NULL); +} +#else +# define up_showtasks() +#endif + /**************************************************************************** * Name: xtensa_stackdump ****************************************************************************/ @@ -130,9 +166,8 @@ static inline void xtensa_registerdump(void) (unsigned long)regs[REG_LCOUNT]); #endif #ifndef __XTENSA_CALL0_ABI__ - _alert(" TMP0: %08lx TMP1: %08lx TMP2: %08lx\n", - (unsigned long)regs[REG_TMP0], (unsigned long)regs[REG_TMP1], - (unsigned long)regs[REG_TMP2]); + _alert(" TMP0: %08lx TMP1: %08lx\n", + (unsigned long)regs[REG_TMP0], (unsigned long)regs[REG_TMP1]); #endif } } @@ -151,7 +186,7 @@ void xtensa_dumpstate(void) uint32_t sp = xtensa_getsp(); uint32_t ustackbase; uint32_t ustacksize; -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#ifdef HAVE_INTERRUPTSTACK uint32_t istackbase; uint32_t istacksize; #endif @@ -166,14 +201,8 @@ void xtensa_dumpstate(void) if (rtcb->pid == 0) { -#warning REVISIT: Need top of IDLE stack -#if 0 - ustackbase = g_idle_topstack - 4; - ustacksize = CONFIG_IDLETHREAD_STACKSIZE; -#else - ustackbase = sp + 128; - ustacksize = 128; -#endif + ustackbase = (uint32_t)&g_idlestack[IDLETHREAD_STACKWORDS-1]; + ustacksize = IDLETHREAD_STACKSIZE; } else { @@ -184,9 +213,9 @@ void xtensa_dumpstate(void) /* Get the limits on the interrupt stack memory */ #warning REVISIT interrupt stack -#if CONFIG_ARCH_INTERRUPTSTACK > 3 - istackbase = (uint32_t)&g_intstackbase; - istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4; +#ifdef HAVE_INTERRUPTSTACK + istackbase = (uint32_t)&g_intstack[INTERRUPT_STACKWORDS-1]; + istacksize = INTERRUPTSTACK_SIZE; /* Show interrupt stack info */ @@ -194,6 +223,9 @@ void xtensa_dumpstate(void) _alert("IRQ stack:\n"); _alert(" base: %08x\n", istackbase); _alert(" size: %08x\n", istacksize); +#ifdef CONFIG_STACK_COLORATION + _alert(" used: %08x\n", up_check_intstack()); +#endif /* Does the current stack pointer lie within the interrupt * stack? @@ -209,7 +241,7 @@ void xtensa_dumpstate(void) * at the base of the interrupt stack. */ - sp = g_intstackbase; + sp = &g_instack[INTERRUPTSTACK_SIZE - sizeof(uint32_t)]; _alert("sp: %08x\n", sp); } @@ -218,10 +250,16 @@ void xtensa_dumpstate(void) _alert("User stack:\n"); _alert(" base: %08x\n", ustackbase); _alert(" size: %08x\n", ustacksize); +#ifdef CONFIG_STACK_COLORATION + _alert(" used: %08x\n", up_check_tcbstack(rtcb)); +#endif #else _alert("sp: %08x\n", sp); _alert("stack base: %08x\n", ustackbase); _alert("stack size: %08x\n", ustacksize); +#ifdef CONFIG_STACK_COLORATION + _alert("stack used: %08x\n", up_check_tcbstack(rtcb)); +#endif #endif /* Dump the user stack if the stack pointer lies within the allocated user @@ -230,7 +268,7 @@ void xtensa_dumpstate(void) if (sp > ustackbase || sp <= ustackbase - ustacksize) { -#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4 +#ifdef HAVE_INTERRUPTSTACK _alert("ERROR: Stack pointer is not within allocated stack\n"); #endif } @@ -242,6 +280,10 @@ void xtensa_dumpstate(void) /* Then dump the registers (if available) */ xtensa_registerdump(); + + /* Dump the state of all tasks (if available) */ + + up_showtasks(); } #endif /* CONFIG_ARCH_STACKDUMP */ diff --git a/arch/xtensa/src/common/xtensa_exit.c b/arch/xtensa/src/common/xtensa_exit.c index e65369016281b3ef6aba425babd46db484aaec4f..7cb12c360fa9ae986533e3c16f35bcac058c371e 100644 --- a/arch/xtensa/src/common/xtensa_exit.c +++ b/arch/xtensa/src/common/xtensa_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/xtensa/src/common/xtensa_exit.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,11 @@ #include #include #include -#include +#include +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "task/task.h" @@ -142,11 +143,11 @@ void _exit(int status) { struct tcb_s *tcb; - /* Disable interrupts. They will be restored when the next task is - * started. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", this_task()); diff --git a/arch/xtensa/src/common/xtensa_int_handlers.S b/arch/xtensa/src/common/xtensa_int_handlers.S index 0cf3c2f129e939ec6541fb3f8800f60899d09192..f84992d2127bee883322b8458f04a82e0ceb7a58 100644 --- a/arch/xtensa/src/common/xtensa_int_handlers.S +++ b/arch/xtensa/src/common/xtensa_int_handlers.S @@ -63,6 +63,7 @@ #include #include +#include "xtensa.h" #include "xtensa_abi.h" #include "chip_macros.h" #include "xtensa_timer.h" @@ -125,37 +126,25 @@ * a consequence of context switching. */ - mov a12, sp /* a12 = address of save area */ - -._xtensa_dispatch_level&level&: + mov a12, sp /* Address of save area */ +#ifdef __XTENSA_CALL0_ABI__ /* Get mask of pending, enabled interrupts at this level into a2. */ rsr a2, INTENABLE rsr a3, INTERRUPT movi a4, \mask and a2, a2, a3 - and a2, a2, a4 - beqz a2, 5f /* Nothing to do */ - - /* If multiple bits are set then MSB has highest priority. */ - - extract_msb a4, a2 /* a4 = MSB of a2, a2 trashed */ - - movi a3, XT_TIMER_INTEN /* a3 = timer interrupt bit */ - wsr a4, INTCLEAR /* Clear sw or edge-triggered interrupt */ - beq a3, a4, 4f /* If timer interrupt then skip table */ + and a2, a2, a4 /* a2 = Set of pending, enabled interrupts for this level */ + beqz a2, 1f /* Nothing to do */ /* Call xtensa_int_decode with, passing that address of the register save * area as a parameter (A2). */ - mov a2, a12 /* Argument: Top of stack = register save area */ -#ifdef __XTENSA_CALL0_ABI__ + /* Argument 1: Set of CPU interrupt to dispatch */ + mov a3, sp /* Argument 2: Top of stack = register save area */ call0 xtensa_int_decode /* Call xtensa_int_decode */ -#else - call4 xtensa_int_decode /* Call xtensa_int_decode */ -#endif /* On return from xtensa_int_decode, a2 will contain the address of the new * register save area. Usually this would be the same as the current SP. @@ -163,55 +152,38 @@ * register save area. This may or may not reside on a stack. */ - beq a2, a12, 3f /* If timer interrupt then skip table */ - - /* Switch stacks */ - mov a12, a2 /* Switch to the save area of the new thread */ - l32i a2, a12, (4 * REG_A1) /* Retrieve stack ptr and replace */ - addi sp, a2, -(4 * XCPTCONTEXT_SIZE) - -3: - j ._xtensa_dispatch_level&level& /* Check for more interrupts */ -4: +#else + /* Get mask of pending, enabled interrupts at this level into a2. */ - .ifeq XT_TIMER_INTPRI - \level + rsr a6, INTENABLE + rsr a2, INTERRUPT + movi a3, \mask + and a6, a6, a2 + and a6, a6, a3 /* a6 = Set of pending, enabled interrupts for this level */ + beqz a6, 1f /* Nothing to do */ - /* Interrupt handler for the NuttX system timer if at this level. - * We'll be reading the interrupt state again after this call - * so no need to preserve any registers except a7 (pointer to - * state save area). + /* Call xtensa_int_decode with, passing that address of the register save + * area as a parameter (A2). */ - movi a2, XTENSA_IRQ_TIMER&level& /* Argument 1: IRQ number */ - mov a3, a12 /* Argument 2: Top of stack = register save area */ -#ifdef __XTENSA_CALL0_ABI__ - call0 xtensa_irq_dispatch /* Call xtensa_int_decode */ -#else - call4 xtensa_irq_dispatch /* Call xtensa_int_decode */ -#endif + /* Argument 1: Set of CPU interrupt to dispatch */ + mov a7, sp /* Argument 2: Top of stack = register save area */ + call4 xtensa_int_decode /* Call xtensa_int_decode */ - /* On return from xtensa_irq_dispatch, A2 will contain the address of the new + /* On return from xtensa_int_decode, a6 will contain the address of the new * register save area. Usually this would be the same as the current SP. - * But in the event of a context switch, A2 will instead refer to the TCB - * register save area. + * But in the event of a context switch, a2 will instead refer to the TCB + * register save area. This may or may not reside on a stack. */ - beq a2, a12, 5f /* If timer interrupt then skip table */ - - /* Switch stacks */ - - mov a12, a2 /* Switch to the save area of the new thread */ - l32i a2, a12, (4 * REG_A1) /* Retrieve stack ptr and replace */ - addi sp, a2, -(4 * XCPTCONTEXT_SIZE) - .endif - - j ._xtensa_dispatch_level&level& /* Check for more interrupts */ + mov a12, a6 /* Switch to the save area of the new thread */ +#endif -5: - /* done */ + /* Done */ +1: .endm /**************************************************************************** @@ -270,6 +242,7 @@ .section HANDLER_SECTION, "ax" .type _xtensa_level1_handler, @function + .global _xtensa_level1_handler .align 4 _xtensa_level1_handler: @@ -306,24 +279,25 @@ _xtensa_level1_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, PS - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_1 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ - rsync /* Ensure EPS and EPC written */ - - /* Return from interrupt. RFI restores the PS from EPS_1 and jumps to - * the address in EPC_1. + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ + rsync /* Ensure PS and EPC written */ + + /* Return from exception. RFE returns from either the UserExceptionVector + * or the KernelExceptionVector. RFE sets PS.EXCM back to 0, and then + * jumps to the address in EPC[1]. PS.UM and PS.WOE are left unchanged. */ - rfi 1 + rfe /* And return from "exception" */ /**************************************************************************** * MEDIUM PRIORITY (LEVEL 2+) INTERRUPT LOW LEVEL HANDLERS. @@ -354,6 +328,7 @@ _xtensa_level1_handler: #if XCHAL_EXCM_LEVEL >= 2 .section HANDLER_SECTION, "ax" .type _xtensa_level2_handler, @function + .global _xtensa_level2_handler .align 4 _xtensa_level2_handler: @@ -390,17 +365,17 @@ _xtensa_level2_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, EPS_2 - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_2 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ /* Return from interrupt. RFI restores the PS from EPS_2 and jumps to @@ -414,6 +389,7 @@ _xtensa_level2_handler: #if XCHAL_EXCM_LEVEL >= 3 .section HANDLER_SECTION, "ax" .type _xtensa_level3_handler, @function + .global _xtensa_level3_handler .align 4 _xtensa_level3_handler: @@ -450,17 +426,17 @@ _xtensa_level3_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, EPS_3 - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_3 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ /* Return from interrupt. RFI restores the PS from EPS_3 and jumps to @@ -474,6 +450,7 @@ _xtensa_level3_handler: #if XCHAL_EXCM_LEVEL >= 4 .section HANDLER_SECTION, "ax" .type _xtensa_level4_handler, @function + .global _xtensa_level4_handler .align 4 _xtensa_level4_handler: @@ -510,17 +487,17 @@ _xtensa_level4_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (presevers a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, EPS_4 - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_4 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ /* Return from interrupt. RFI restores the PS from EPS_4 and jumps to @@ -534,6 +511,7 @@ _xtensa_level4_handler: #if XCHAL_EXCM_LEVEL >= 5 .section HANDLER_SECTION, "ax" .type _xtensa_level5_handler, @function + .global _xtensa_level5_handler .align 4 _xtensa_level5_handler: @@ -570,17 +548,17 @@ _xtensa_level5_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, EPS_5 - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_5 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ /* Return from interrupt. RFI restores the PS from EPS_5 and jumps to @@ -594,6 +572,7 @@ _xtensa_level5_handler: #if XCHAL_EXCM_LEVEL >= 6 .section HANDLER_SECTION, "ax" .type _xtensa_level6_handler, @function + .global _xtensa_level6_handler .align 4 _xtensa_level6_handler: @@ -630,17 +609,17 @@ _xtensa_level6_handler: /* Restore registers in preparation to return from interrupt */ mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, EPS_6 - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_6 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ /* Return from interrupt. RFI restores the PS from EPS_6 and jumps to @@ -690,6 +669,7 @@ _xtensa_level6_handler: #if XCHAL_INT_NLEVELS >=2 && XCHAL_EXCM_LEVEL < 2 && XCHAL_DEBUGLEVEL !=2 .section HANDLER_SECTION, "ax" .type _xtensa_level2_handler, @function + .global _xtensa_level2_handler .align 4 _xtensa_level2_handler: @@ -723,6 +703,7 @@ _xtensa_level2_handler: #if XCHAL_INT_NLEVELS >=3 && XCHAL_EXCM_LEVEL < 3 && XCHAL_DEBUGLEVEL !=3 .section HANDLER_SECTION, "ax" .type _xtensa_level3_handler, @function + .global _xtensa_level3_handler .align 4 _xtensa_level3_handler: @@ -758,6 +739,7 @@ _xtensa_level3_handler: #if XCHAL_INT_NLEVELS >=4 && XCHAL_EXCM_LEVEL < 4 && XCHAL_DEBUGLEVEL !=4 .section HANDLER_SECTION, "ax" .type _xtensa_level4_handler, @function + .global _xtensa_level4_handler .align 4 _xtensa_level4_handler: @@ -793,6 +775,7 @@ _xtensa_level4_handler: #if XCHAL_INT_NLEVELS >=5 && XCHAL_EXCM_LEVEL < 5 && XCHAL_DEBUGLEVEL !=5 .section HANDLER_SECTION, "ax" .type _xtensa_level5_handler, @function + .global _xtensa_level5_handler .align 4 _xtensa_level5_handler: @@ -828,6 +811,7 @@ _xtensa_level5_handler: #if XCHAL_INT_NLEVELS >=6 && XCHAL_EXCM_LEVEL < 6 && XCHAL_DEBUGLEVEL !=6 .section HANDLER_SECTION, "ax" .type _xtensa_level6_handler, @function + .global _xtensa_level6_handler .align 4 _xtensa_level6_handler: diff --git a/arch/xtensa/src/common/xtensa_irqdispatch.c b/arch/xtensa/src/common/xtensa_irqdispatch.c index 2f05eab152acfd9f52301e4c32657e5066508c03..813846e76e860696bac9dd7c4e5ce01060a03cfa 100644 --- a/arch/xtensa/src/common/xtensa_irqdispatch.c +++ b/arch/xtensa/src/common/xtensa_irqdispatch.c @@ -99,14 +99,14 @@ uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs) if (regs != CURRENT_REGS) { #if XCHAL_CP_NUM > 0 - /* If an interrupt level context switch has occurred, then save the - * co-processor state in in the suspended thread's co-processor save - * area. - * - * NOTE 1. The state of the co-processor has not been altered and - * still represents the to-be-suspended thread. - * NOTE 2. We saved a reference TCB of the original thread on entry. - */ + /* If an interrupt level context switch has occurred, then save the + * co-processor state in in the suspended thread's co-processor save + * area. + * + * NOTE 1. The state of the co-processor has not been altered and + * still represents the to-be-suspended thread. + * NOTE 2. We saved a reference TCB of the original thread on entry. + */ xtensa_coproc_savestate(&tcb->xcp.cpstate); diff --git a/arch/xtensa/src/common/xtensa_panic.S b/arch/xtensa/src/common/xtensa_panic.S index e24acc12fa421f43f68ccd14d387d692d3ef9c22..c526eab6d4fa41544a1481729f77a9f99885aabb 100644 --- a/arch/xtensa/src/common/xtensa_panic.S +++ b/arch/xtensa/src/common/xtensa_panic.S @@ -59,10 +59,13 @@ ****************************************************************************/ #include + #include #include #include +#include "chip_macros.h" + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -95,6 +98,10 @@ .align 4 _xtensa_panic: + /* Save the exception code */ + + wsr a2, EXCSAVE_1 + /* Save rest of interrupt context (A2=address of state save area on * stack. */ @@ -111,17 +118,25 @@ _xtensa_panic: /* Set up PS for C, reenable hi-pri interrupts, and clear EXCM. */ +#ifdef __XTENSA_CALL0_ABI__ + movi a0, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM +#else movi a0, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE +#endif + wsr a0, PS /* Call C panic handler: Arg1 (A2) = Exception code; Arg 2 (A3) = start * of the register save area. */ - mov a3, sp #ifdef __XTENSA_CALL0_ABI__ + rsr a2, EXCSAVE_1 + mov a3, sp call0 xtensa_panic /* Call xtensa_panic. Should not return */ #else + rsr a6, EXCSAVE_1 + mov a7, sp call4 xtensa_panic /* Call xtensa_panic. Should not return */ #endif diff --git a/arch/xtensa/src/common/xtensa_schedsigaction.c b/arch/xtensa/src/common/xtensa_schedsigaction.c index db0f5fa9c35e1eb9d9ee161a54968bcd8054115c..2dd39913351909eadf1a93a5a0c0c4c363b40f5b 100644 --- a/arch/xtensa/src/common/xtensa_schedsigaction.c +++ b/arch/xtensa/src/common/xtensa_schedsigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/xtensa/src/common/arm_schedulesigaction.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,6 +49,8 @@ #include "sched/sched.h" #include "xtensa.h" +#include "irq/irq.h" + #ifndef CONFIG_DISABLE_SIGNALS /**************************************************************************** @@ -88,6 +90,7 @@ * ****************************************************************************/ +#ifndef CONFIG_SMP void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) { irqstate_t flags; @@ -135,26 +138,25 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) else { - /* Save the return lr and cpsr and one scratch register - * These will be restored by the signal trampoline after - * the signals have been delivered. + /* Save the return pc and ps. These will be restored by the + * signal trampoline after the signals have been delivered. * * NOTE: that hi-priority interrupts are not disabled. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; - tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; /* Then set up to vector to the trampoline with interrupts * disabled */ - CURRENT_REGS[REG_PC] = (uint32_t)xtensa_sigdeliver; + CURRENT_REGS[REG_PC] = (uint32_t)_xtensa_sig_trampoline; #ifdef __XTENSA_CALL0_ABI__ - CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); + CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); #else - CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); + CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); #endif /* And make sure that the saved context in the TCB is the same @@ -172,29 +174,208 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) else { - /* Save the return lr and cpsr and one scratch register. These - * will be restored by the signal trampoline after the signals - * have been delivered. + /* Save the return pc and ps. These will be restored by the + * signal trampoline after the signals have been delivered. + * + * NOTE: that hi-priority interrupts are not disabled. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline; +#ifdef __XTENSA_CALL0_ABI__ + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); +#else + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); +#endif + } + } + + leave_critical_section(flags); +} +#endif /* !CONFIG_SMP */ + +#ifdef CONFIG_SMP +void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) +{ + irqstate_t flags; + int cpu; + int me; + + sinfo("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver); + + /* Make sure that interrupts are disabled */ + + flags = enter_critical_section(); + + /* Refuse to handle nested signal actions */ + + if (!tcb->xcp.sigdeliver) + { + /* First, handle some special cases when the signal is being delivered + * to task that is currently executing on any CPU. + */ + + sinfo("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS); + + if (tcb->task_state == TSTATE_TASK_RUNNING) + { + me = this_cpu(); + cpu = tcb->cpu; + + /* CASE 1: We are not in an interrupt handler and a task is + * signalling itself for some reason. + */ + + if (cpu == me && !CURRENT_REGS) + { + /* In this case just deliver the signal now. */ + + sigdeliver(tcb); + } + + /* CASE 2: The task that needs to receive the signal is running. + * This could happen if the task is running on another CPU OR if + * we are in an interrupt handler and the task is running on this + * CPU. In the former case, we will have to PAUSE the other CPU + * first. But in either case, we will have to modify the return + * state as well as the state in the TCB. + * + * Hmmm... there looks like a latent bug here: The following logic + * would fail in the strange case where we are in an interrupt + * handler, the thread is signalling itself, but a context switch + * to another task has occurred so that CURRENT_REGS does not + * refer to the thread of this_task()! + */ + + else + { + /* If we signalling a task running on the other CPU, we have + * to PAUSE the other CPU. + */ + + if (cpu != me) + { + up_cpu_pause(cpu); + } + + /* Save the return pc and ps. These will be restored by the + * signal trampoline after the signals have been delivered. + * + * NOTE: that hi-priority interrupts are not disabled. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. + */ + + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; + + /* Handle a possible race condition where the TCB was suspended + * just before we paused the other CPU. The critical section + * established above will prevent new threads from running on + * that CPU, but it will not guarantee that the running thread + * did not suspend itself (allowing any threads "assigned" to + * the CPU to run). + */ + + if (tcb->task_state != TSTATE_TASK_RUNNING) + { + tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline; +#ifdef __XTENSA_CALL0_ABI__ + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); +#else + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); +#endif + } + else + { + /* Then set up to vector to the trampoline with interrupts + * disabled + */ + + CURRENT_REGS[REG_PC] = (uint32_t)_xtensa_sig_trampoline; +#ifdef __XTENSA_CALL0_ABI__ + CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); +#else + CURRENT_REGS[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); +#endif + /* In an SMP configuration, the interrupt disable logic also + * involves spinlocks that are configured per the TCB irqcount + * field. This is logically equivalent to enter_critical_section(). + * The matching call to leave_critical_section() will be + * performed in up_sigdeliver(). + */ + + spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); + + /* And make sure that the saved context in the TCB is the same + * as the interrupt return context. + */ + + xtensa_savestate(tcb->xcp.regs); + } + + /* RESUME the other CPU if it was PAUSED */ + + if (cpu != me) + { + up_cpu_resume(cpu); + } + } + } + + /* Otherwise, we are (1) signaling a task is not running from an + * interrupt handler or (2) we are not in an interrupt handler and the + * running task is signalling some other non-running task. + */ + + else + { + /* Save the return pc and ps. These will be restored by the + * signal trampoline after the signals have been delivered. + * + * NOTE: that hi-priority interrupts are not disabled. + */ + + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = CURRENT_REGS[REG_PC]; + tcb->xcp.saved_ps = CURRENT_REGS[REG_PS]; + + /* Increment the IRQ lock count so that when the task is restarted, + * it will hold the IRQ spinlock. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = tcb->xcp.regs[REG_PC]; - tcb->xcp.saved_ps = tcb->xcp.regs[REG_PS]; + DEBUGASSERT(tcb->irqcount < INT16_MAX); + tcb->irqcount++; /* Then set up to vector to the trampoline with interrupts * disabled */ - tcb->xcp.regs[REG_PC] = (uint32_t)xtensa_sigdeliver; + tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline; #ifdef __XTENSA_CALL0_ABI__ - tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM); #else - tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); + tcb->xcp.regs[REG_PS] = (uint32_t)(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE); #endif } } leave_critical_section(flags); } +#endif /* CONFIG_SMP */ #endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/arch/xtensa/src/common/xtensa_sigdeliver.c b/arch/xtensa/src/common/xtensa_sigdeliver.c index ce4344192881b10225718bbe7bacc354a46db1c7..ec6e6c56ddfcea6ee0dac8fd92432ac8f82f8959 100644 --- a/arch/xtensa/src/common/xtensa_sigdeliver.c +++ b/arch/xtensa/src/common/xtensa_sigdeliver.c @@ -58,7 +58,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: xtensa_sigdeliver + * Name: xtensa_sig_deliver * * Description: * This is the a signal handling trampoline. When a signal action was @@ -67,7 +67,7 @@ * ****************************************************************************/ -void xtensa_sigdeliver(void) +void xtensa_sig_deliver(void) { struct tcb_s *rtcb = this_task(); uint32_t regs[XCPTCONTEXT_REGS]; diff --git a/arch/xtensa/src/common/xtensa_sigtramp.S b/arch/xtensa/src/common/xtensa_sigtramp.S new file mode 100644 index 0000000000000000000000000000000000000000..cf91a302aa171a36fcdc2a15cb4732a4724dd41f --- /dev/null +++ b/arch/xtensa/src/common/xtensa_sigtramp.S @@ -0,0 +1,83 @@ +/**************************************************************************** + * arch/xtensa/src/common/xtensa_sigtramp.S + * + * Adapted from use in NuttX by: + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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. + * + ****************************************************************************/ + + .file "xtensa_sigtramp.S" + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "xtensa_abi.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: _xtensa_sig_trampoline + * + * Description: + * Just sets up a proper window call to xtensa_sig_deliver(). We get + * here via a context switch setup in up_schedule_signaction. Which + * re-vectors the context switch to this location. + * + * Here we just call xtensa_sig_deliver() using the proper ABI. NOTE + * that this function cannot return and depends on the fact that + * xtensa_sig_deliver() does not return. + * + * + ****************************************************************************/ + + .text + .global _xtensa_sig_trampoline + .type _xtensa_sig_trampoline, @function + .align 4 + +_xtensa_sig_trampoline: + ENTRY(16) /* REVISIT: This should not be here */ + +#ifdef __XTENSA_CALL0_ABI__ + cali0 xtensa_sig_deliver /* Call xtensa_sig_deliver */ +#else + call4 xtensa_sig_deliver /* Call xtensa_sig_deliver */ +#endif + +1: j 1b /* xtensa_sig_deliver does not return */ + + .size _xtensa_sig_trampoline, . - _xtensa_sig_trampoline diff --git a/arch/xtensa/src/common/xtensa_user_handler.S b/arch/xtensa/src/common/xtensa_user_handler.S index fc789ccb5a38e4c48dc51618137945d5da91d426..39c9eb1c7f96c7a58dd416bccb39430fe8524eac 100644 --- a/arch/xtensa/src/common/xtensa_user_handler.S +++ b/arch/xtensa/src/common/xtensa_user_handler.S @@ -59,10 +59,13 @@ ****************************************************************************/ #include + #include #include #include +#include "chip_macros.h" + /**************************************************************************** * Assembly Language Macros ****************************************************************************/ @@ -158,6 +161,7 @@ _xtensa_to_coproc_handler: ****************************************************************************/ .type _xtensa_user_handler, @function + .global _xtensa_user_handler .align 4 _xtensa_user_handler: @@ -225,12 +229,13 @@ _xtensa_user_handler: * beginning of the register save area. */ +#ifdef __XTENSA_CALL0_ABI__ rsr a2, EXCCAUSE /* Argument 1 (a2) = EXCCAUSE */ mov a3, sp /* Argument 2 (a2) = pointer to register save area */ - -#ifdef __XTENSA_CALL0_ABI__ calx0 xtensa_user /* Call xtensa_user */ #else + rsr a6, EXCCAUSE /* Argument 1 (a2) = EXCCAUSE */ + mov a7, sp /* Argument 2 (a2) = pointer to register save area */ call4 xtensa_user /* Call xtensa_user */ #endif @@ -254,6 +259,7 @@ _xtensa_user_handler: .section HANDLER_SECTION, "ax" .type _xtensa_syscall_handler, @function .align 4 + _xtensa_syscall_handler: /* Allocate stack frame and save A0, A1, and PS */ @@ -323,54 +329,52 @@ _xtensa_syscall_handler: ps_setup 1 a0 /* Dispatch the sycall as with other interrupts. */ - /* At this point, sp holds the pointer to the register save area. That, - * however, may change as a consequence of context switching. - */ mov a12, sp /* a12 = address of register save area */ - movi a2, XTENSA_IRQ_SYSCALL /* Argument 1: IRQ number */ - mov a3, a12 /* Argument 2: Top of stack = register save area */ + #ifdef __XTENSA_CALL0_ABI__ + movi a2, XTENSA_IRQ_SYSCALL /* Argument 1: IRQ number */ + mov a3, sp /* Argument 2: Top of stack = register save area */ call0 xtensa_irq_dispatch /* Call xtensa_int_decode */ -#else - call4 xtensa_irq_dispatch /* Call xtensa_int_decode */ -#endif - /* On return from xtensa_irq_dispatch, A2 will contain the address of the new + /* On return from xtensa_irq_dispatch, a2 will contain the address of the new * register save area. Usually this would be the same as the current SP. * But in the event of a context switch, A2 will instead refer to the TCB * register save area. */ - beq a2, a12, 2f /* If timer interrupt then skip table */ - - /* Switch stacks */ +#else + movi a6, XTENSA_IRQ_SYSCALL /* Argument 1: IRQ number */ + mov a7, sp /* Argument 2: Top of stack = register save area */ + call4 xtensa_irq_dispatch /* Call xtensa_int_decode */ - mov a12, a2 /* Switch to the save area of the new thread */ - l32i a2, a12, (4 * REG_A1) /* Retrieve stack ptr and replace */ - addi sp, a2, -(4 * XCPTCONTEXT_SIZE) + /* On return from xtensa_irq_dispatch, a5 will contain the address of the new + * register save area. Usually this would be the same as the current SP. + * But in the event of a context switch, A2 will instead refer to the TCB + * register save area. + */ -2: + mov a2, a6 /* Switch to the new register save area */ +#endif /* Restore registers in preparation to return from interrupt */ - mov a2, a12 /* a2 = address of new state save area */ - call0 _xtensa_context_restore + call0 _xtensa_context_restore /* (Preserves a2) */ /* Restore only level-specific regs (the rest were already restored) */ - l32i a0, sp, (4 * REG_PS) /* Retrieve interruptee's PS */ + l32i a0, a2, (4 * REG_PS) /* Retrieve interruptee's PS */ wsr a0, PS - l32i a0, sp, (4 * REG_PC) /* Retrieve interruptee's PC */ + l32i a0, a2, (4 * REG_PC) /* Retrieve interruptee's PC */ wsr a0, EPC_1 - l32i a0, sp, (4 * REG_A0) /* Retrieve interruptee's A0 */ - l32i a2, sp, (4 * REG_A2) /* Retrieve interruptee's A2 */ - l32i sp, sp, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a0, a2, (4 * REG_A0) /* Retrieve interruptee's A0 */ + l32i sp, a2, (4 * REG_A1) /* Remove interrupt stack frame */ + l32i a2, a2, (4 * REG_A2) /* Retrieve interruptee's A2 */ rsync /* Ensure EPS and EPC written */ - /* Return from exception. RFE returns from either the UserExceptionVector - * or the KernelExceptionVector. RFE sets PS.EXCM back to 0 and then jumps - * to the address in EPC[1]. + /* Return from exception. RFE returns from either the UserExceptionVector + * or the KernelExceptionVector. RFE sets PS.EXCM back to 0, and then + * jumps to the address in EPC[1]. PS.UM and PS.WOE are left unchanged. */ rfe @@ -463,12 +467,13 @@ _xtensa_coproc_handler: * beginning of the register save area. */ +#ifdef __XTENSA_CALL0_ABI__ rsr a2, EXCCAUSE /* Argument 1 (a2) = EXCCAUSE */ mov a3, sp /* Argument 2 (a2) = pointer to register save area */ - -#ifdef __XTENSA_CALL0_ABI__ calx0 xtensa_user /* Call xtensa_user */ #else + rsr a6, EXCCAUSE /* Argument 1 (a2) = EXCCAUSE */ + mov a7, sp /* Argument 2 (a2) = pointer to register save area */ call4 xtensa_user /* Call xtensa_user */ #endif diff --git a/arch/xtensa/src/common/xtensa_vectors.S b/arch/xtensa/src/common/xtensa_vectors.S index 726824f058025933e93996f7ec68f9707c1786b1..9dfc4869f671a924fa749737f860ea81326e1c2b 100644 --- a/arch/xtensa/src/common/xtensa_vectors.S +++ b/arch/xtensa/src/common/xtensa_vectors.S @@ -42,6 +42,7 @@ #include #include +#include "xtensa.h" #include "xtensa_abi.h" /**************************************************************************** @@ -74,7 +75,7 @@ _xtensa_level2_vector: /* Never returns here - call0 is used as a jump */ - .end literal_prefix + .end literal_prefix .size _xtensa_level2_vector, . - _xtensa_level2_vector #endif @@ -93,7 +94,7 @@ _xtensa_level3_vector: /* Never returns here - call0 is used as a jump */ - .end literal_prefix + .end literal_prefix .size _xtensa_level3_vector, . - _xtensa_level3_vector #endif @@ -112,7 +113,7 @@ _xtensa_level4_vector: /* Never returns here - call0 is used as a jump */ - .end literal_prefix + .end literal_prefix .size _xtensa_level5_vector, . - _xtensa_level5_vector #endif @@ -131,8 +132,8 @@ _xtensa_level5_vector: /* Never returns here - call0 is used as a jump */ - .size _xtensa_level5_vector, . - _xtensa_level5_vector - .end literal_prefix + .size _xtensa_level5_vector, . - _xtensa_level5_vector + .end literal_prefix #endif #if XCHAL_EXCM_LEVEL >= 6 @@ -202,7 +203,7 @@ _xtensa_nmi_vector: s32i a0, sp, (4 * REG_A0) s32i a2, sp, (4 * REG_A2) - movi a2, XTENSA_NMI_EXCEPTION /* Address of state save on stack */ + movi a2, XTENSA_NMI_EXCEPTION /* Argument 1: Error code */ call0 _xtensa_panic /* Does not return */ #else @@ -226,10 +227,10 @@ _xtensa_nmi_vector: ****************************************************************************/ #if XCHAL_HAVE_DEBUG - .begin literal_prefix .debug_exception_vector - .section .debug_exception_vector.text, "ax" - .global _debug_exception_vector - .align 4 + .begin literal_prefix .debug_exception_vector + .section .debug_exception_vector.text, "ax" + .global _debug_exception_vector + .align 4 _debug_exception_vector: @@ -244,7 +245,7 @@ _debug_exception_vector: s32i a0, sp, (4 * REG_A0) s32i a2, sp, (4 * REG_A2) - movi a2, XTENSA_DEBUG_EXCEPTION /* Address of state save on stack */ + movi a2, XTENSA_DEBUG_EXCEPTION /* Argument 1: Error code */ call0 _xtensa_panic /* Does not return */ .end literal_prefix @@ -261,10 +262,10 @@ _debug_exception_vector: ****************************************************************************/ #ifdef XCHAL_DOUBLEEXC_VECTOR_VADDR - .begin literal_prefix .double_exception_vector - .section .double_exception_vector.text, "ax" - .global _double_exception_vector - .align 4 + .begin literal_prefix .double_exception_vector + .section .double_exception_vector.text, "ax" + .global _double_exception_vector + .align 4 _double_exception_vector: @@ -279,14 +280,19 @@ _double_exception_vector: s32i a0, sp, (4 * REG_PS) rsr a0, DEPC /* Save interruptee's PC */ s32i a0, sp, (4 * REG_PC) - rsr a0, EXCSAVE_1 /* Save interruptee's a0 -- REVISIT */ + rsr a0, EXCSAVE /* Save interruptee's a0 -- REVISIT */ s32i a0, sp, (4 * REG_A0) + rsr a0, EXCCAUSE /* Save the EXCCAUSE register */ + s32i a0, sp, (4 * REG_EXCCAUSE) + rsr a0, EXCVADDR /* Save the EXCVADDR register */ + s32i a0, sp, (4 * REG_EXCVADDR) + s32i a2, sp, (4 * REG_A2) - movi a2, XTENSA_DOUBLE_EXCEPTION /* Address of state save on stack */ + movi a2, XTENSA_DOUBLE_EXCEPTION /* Argument 1: Error code */ call0 _xtensa_panic /* Does not return */ - .end literal_prefix + .end literal_prefix #endif /* XCHAL_DOUBLEEXC_VECTOR_VADDR */ @@ -298,10 +304,10 @@ _double_exception_vector: * ****************************************************************************/ - .begin literal_prefix .kernel_exception_vector - .section .kernel_exception_vector.text, "ax" - .global _kernel_exception_vector - .align 4 + .begin literal_prefix .kernel_exception_vector + .section .kernel_exception_vector.text, "ax" + .global _kernel_exception_vector + .align 4 _kernel_exception_vector: @@ -320,7 +326,7 @@ _kernel_exception_vector: s32i a0, sp, (4 * REG_A0) s32i a2, sp, (4 * REG_A2) - movi a2, XTENSA_KERNEL_EXCEPTION /* Address of state save on stack */ + movi a2, XTENSA_KERNEL_EXCEPTION /* Argument 1: Error code */ call0 _xtensa_panic /* Does not return */ .end literal_prefix @@ -333,15 +339,15 @@ _kernel_exception_vector: * ****************************************************************************/ - .begin literal_prefix .user_exception_vector - .section .user_exception_vector.text, "ax" - .global _user_exception_vector - .type _user_exception_vector, @function - .align 4 + .begin literal_prefix .user_exception_vector + .section .user_exception_vector.text, "ax" + .global _user_exception_vector + .type _user_exception_vector, @function + .align 4 _user_exception_vector: wsr a0, EXCSAVE_1 /* Preserve a0 */ - call0 xtensa_user_handler /* And jump to user exception handler */ + call0 _xtensa_user_handler /* And jump to user exception handler */ .end literal_prefix diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs index 39a67813c66c38c1ca56945df3a0811e5b1c9aaf..bda6c738ff4085aaff882466ac5479193b5d6837 100644 --- a/arch/xtensa/src/esp32/Make.defs +++ b/arch/xtensa/src/esp32/Make.defs @@ -35,14 +35,14 @@ # The start-up, "head", file. May be either a .S or a .c file. -HEAD_ASRC = -HEAD_CSRC = esp32_start.c +HEAD_ASRC = xtensa_vectors.S xtensa_window_vector.S xtensa_windowspill.S +HEAD_ASRC += xtensa_int_handlers.S xtensa_user_handler.S +HEAD_CSRC = esp32_start.c # Common XTENSA files (arch/xtensa/src/common) -CMN_ASRCS = xtensa_context.S xtensa_coproc.S xtensa_cpuint.S -CMN_ASRCS += xtensa_int_handlers.S xtensa_panic.S xtensa_user_handler.S -CMN_ASRCS += xtensa_vectors.S xtensa_windowspill.S +CMN_ASRCS = xtensa_context.S xtensa_coproc.S xtensa_cpuint.S xtensa_panic.S +CMN_ASRCS += xtensa_sigtramp.S CMN_CSRCS = xtensa_assert.c xtensa_blocktask.c xtensa_copystate.c CMN_CSRCS += xtensa_cpenable.c xtensa_createstack.c xtensa_exit.c xtensa_idle.c @@ -68,6 +68,11 @@ ifeq ($(CONFIG_SMP),y) CMN_CSRCS += xtensa_cpupause.c endif +ifeq ($(CONFIG_STACK_COLORATION),y) + CMN_CSRCS += xtensa_checkstack.c +endif + + # Use of common/xtensa_etherstub.c is deprecated. The preferred mechanism # is to use CONFIG_NETDEV_LATEINIT=y to suppress the call to # up_netinitialize() in xtensa_initialize.c. Then this stub would not be @@ -89,7 +94,7 @@ CHIP_CSRCS += esp32_timerisr.c # Configuration-dependent ESP32 files ifeq ($(CONFIG_SMP),y) -CHIP_ASRCS = esp32_cpuhead.S esp32_cpuindex.S +CHIP_ASRCS = esp32_cpuindex.S CMN_CSRCS += esp32_cpuidlestack.c esp32_cpustart.c esp32_intercpu_interrupt.c endif diff --git a/arch/xtensa/src/esp32/esp32_cpuidlestack.c b/arch/xtensa/src/esp32/esp32_cpuidlestack.c index 7b2e90364e95b38daf0e05c71137ad55e80eb79b..ea475b79b3f6f21036565f6730bd32d29e9a6acb 100644 --- a/arch/xtensa/src/esp32/esp32_cpuidlestack.c +++ b/arch/xtensa/src/esp32/esp32_cpuidlestack.c @@ -36,6 +36,16 @@ #ifdef CONFIG_SMP +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* Address of the CPU0 IDLE thread */ + +uint32_t g_cpu1_idlestack[CPU1_IDLETHREAD_STACKWORDS] + __attribute__((aligned(16) section(".noinit"))); + + /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_cpuindex.S b/arch/xtensa/src/esp32/esp32_cpuindex.S index f62eed120205f784cf9ba65f87f26b8735b033c4..0a9abc27fd80a6878f92bb9085f0d9da09f51d6a 100644 --- a/arch/xtensa/src/esp32/esp32_cpuindex.S +++ b/arch/xtensa/src/esp32/esp32_cpuindex.S @@ -39,6 +39,7 @@ * Included Files ****************************************************************************/ +#include "xtensa_abi.h" #include "chip_macros.h" /**************************************************************************** @@ -71,6 +72,8 @@ .type up_cpu_index, @function up_cpu_index: + ENTRY(16) getcoreid a2 - ret + RET(16) + .size up_cpu_index, . - up_cpu_index diff --git a/arch/xtensa/src/esp32/esp32_cpuint.c b/arch/xtensa/src/esp32/esp32_cpuint.c index 7d62e6bd771d1e4bc686eee40ec5e9f5665fea89..8d43741ac035aa5552df8c73236cee072936ee3e 100644 --- a/arch/xtensa/src/esp32/esp32_cpuint.c +++ b/arch/xtensa/src/esp32/esp32_cpuint.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -52,6 +53,8 @@ #include "esp32_cpuint.h" #include "xtensa.h" +#include "sched/sched.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -147,6 +150,17 @@ #define ESP32_MAX_PRIORITY 5 #define ESP32_PRIO_INDEX(p) ((p) - ESP32_MIN_PRIORITY) +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* Maps a CPU interrupt to the IRQ of the attached peripheral interrupt */ + +uint8_t g_cpu0_intmap[ESP32_NCPUINTS]; +#ifdef CONFIG_SMP +uint8_t g_cpu1_intmap[ESP32_NCPUINTS]; +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -156,18 +170,19 @@ */ #ifdef CONFIG_SMP - static uint32_t g_intenable[CONFIG_SMP_NCPUS]; - #else - static uint32_t g_intenable[1]; - #endif -/* Bitsets for free, unallocated CPU interrupts */ +/* Bitsets for free, unallocated CPU interrupts available to peripheral + * devices. + */ -static uint32_t g_free_cpuints = 0xffffffff; +static uint32_t g_cpu0_freeints = EPS32_CPUINT_PERIPHSET; +#ifdef CONFIG_SMP +static uint32_t g_cpu1_freeints = EPS32_CPUINT_PERIPHSET; +#endif /* Bitsets for each interrupt priority 1-5 */ @@ -184,11 +199,27 @@ static const uint32_t g_priority[5] = * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: xtensa_disable_all + ****************************************************************************/ + +static inline void xtensa_disable_all(void) +{ + __asm__ __volatile__ + ( + "movi a2, 0\n" + "xsr a2, INTENABLE\n" + : : : "a2" + ); +} + /**************************************************************************** * Name: esp32_alloc_cpuint * * Description: - * Allocate a CPU interrupt + * Allocate a CPU interrupt for a peripheral device. This function will + * not allocate any of the pre-allocated CPU interrupts for internal + * devices. * * Input Parameters: * intmask - mask of candidate CPU interrupts. The CPU interrupt will be @@ -205,6 +236,7 @@ static const uint32_t g_priority[5] = int esp32_alloc_cpuint(uint32_t intmask) { irqstate_t flags; + uint32_t *freeints; uint32_t bitmask; uint32_t intset; int cpuint; @@ -216,7 +248,18 @@ int esp32_alloc_cpuint(uint32_t intmask) flags = enter_critical_section(); - intset = g_free_cpuints & intmask; +#ifdef CONFIG_SMP + if (this_cpu() != 0) + { + freeints = &g_cpu1_freeints; + } + else +#endif + { + freeints = &g_cpu0_freeints; + } + + intset = *freeints & intmask; if (intset != 0) { /* Skip over initial unavailable CPU interrupts quickly in groups @@ -224,7 +267,7 @@ int esp32_alloc_cpuint(uint32_t intmask) */ for (cpuint = 0, bitmask = 0xff; - cpuint <= ESP32_CPUINT_MAX; + cpuint <= ESP32_CPUINT_MAX && (intset & bitmask) == 0; cpuint += 8, bitmask <<= 8); /* Search for an unallocated CPU interrupt number in the remaining @@ -242,7 +285,7 @@ int esp32_alloc_cpuint(uint32_t intmask) { /* Got it! */ - g_free_cpuints &= ~bitmask; + *freeints &= ~bitmask; ret = cpuint; break; } @@ -257,6 +300,94 @@ int esp32_alloc_cpuint(uint32_t intmask) * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: esp32_cpuint_initialize + * + * Description: + * Initialize CPU interrupts + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) is returned on success; A negated errno value is returned on + * any failre. + * + ****************************************************************************/ + +int esp32_cpuint_initialize(void) +{ + uintptr_t regaddr; + uint8_t *intmap; +#ifdef CONFIG_SMP + int cpu; +#endif + int i; + +#ifdef CONFIG_SMP + /* Which CPU are we initializing */ + + cpu = up_cpu_index(); + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS); +#endif + + /* Disable all CPU interrupts on this CPU */ + + xtensa_disable_all(); + + /* Detach all peripheral sources PRO CPU interrupts */ + + for (i = 0; i < ESP32_NPERIPHERALS; i++) + { +#ifdef CONFIG_SMP + if (cpu != 0) + { + regaddr = DPORT_APP_MAP_REGADDR(i); + } + else +#endif + { + regaddr = DPORT_PRO_MAP_REGADDR(i); + } + + putreg32(NO_CPUINT, regaddr); + } + + /* Initialize CPU interrupt-to-IRQ mapping table */ + +#ifdef CONFIG_SMP + if (cpu != 0) + { + intmap = g_cpu1_intmap; + } + else +#endif + { + intmap = g_cpu0_intmap; + } + + /* Indiate that no peripheral interrupts are assigned to CPU interrupts */ + + memset(intmap, CPUINT_UNASSIGNED, ESP32_NCPUINTS); + + /* Special case the 6 internal interrupts. + * + * CPU interrupt bit IRQ number + * --------------------------- --------------------- + * ESP32_CPUINT_TIMER0 6 XTENSA_IRQ_TIMER0 0 + * SP32_CPUINT_SOFTWARE0 7 Not yet defined + * ESP32_CPUINT_PROFILING 11 Not yet defined + * ESP32_CPUINT_TIMER1 15 XTENSA_IRQ_TIMER1 1 + * ESP32_CPUINT_TIMER2 16 XTENSA_IRQ_TIMER2 2 + * ESP32_CPUINT_SOFTWARE1 29 Not yet defined + */ + + intmap[ESP32_CPUINT_TIMER0] = XTENSA_IRQ_TIMER0; + intmap[ESP32_CPUINT_TIMER1] = XTENSA_IRQ_TIMER1; + intmap[ESP32_CPUINT_TIMER2] = XTENSA_IRQ_TIMER2; + return OK; +} + /**************************************************************************** * Name: up_disable_irq * @@ -327,7 +458,7 @@ int esp32_alloc_levelint(int priority) uint32_t intmask; DEBUGASSERT(priority >= ESP32_MIN_PRIORITY && - priority <= ESP32_MAX_PRIORITY) + priority <= ESP32_MAX_PRIORITY); /* Check if there are any level CPU interrupts available at the requested * interrupt priority. @@ -359,7 +490,7 @@ int esp32_alloc_edgeint(int priority) uint32_t intmask; DEBUGASSERT(priority >= ESP32_MIN_PRIORITY && - priority <= ESP32_MAX_PRIORITY) + priority <= ESP32_MAX_PRIORITY); /* Check if there are any edge CPU interrupts available at the requested * interrupt priority. @@ -386,6 +517,7 @@ int esp32_alloc_edgeint(int priority) void esp32_free_cpuint(int cpuint) { irqstate_t flags; + uint32_t *freeints; uint32_t bitmask; DEBUGASSERT(cpuint >= 0 && cpuint < ESP32_CPUINT_NEDGEPERIPHS); @@ -394,8 +526,20 @@ void esp32_free_cpuint(int cpuint) bitmask = (1ul << cpuint); flags = enter_critical_section(); - DEBUGASSERT((g_free_cpuints & bitmask) == 0); - g_free_cpuints |= bitmask; + +#ifdef CONFIG_SMP + if (this_cpu() != 0) + { + freeints = &g_cpu1_freeints; + } + else +#endif + { + freeints = &g_cpu0_freeints; + } + + DEBUGASSERT((*freeints & bitmask) == 0); + *freeints |= bitmask; leave_critical_section(flags); } @@ -407,8 +551,10 @@ void esp32_free_cpuint(int cpuint) * * Input Parameters: * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU - * periphid - The peripheral number from ira.h to be assigned. + * periphid - The peripheral number from ira.h to be assigned to + * a CPU interrupt. * cpuint - The CPU interrupt to receive the peripheral interrupt + * assignment. * * Returned Value: * None @@ -418,6 +564,7 @@ void esp32_free_cpuint(int cpuint) void esp32_attach_peripheral(int cpu, int periphid, int cpuint) { uintptr_t regaddr; + uint8_t *intmap; DEBUGASSERT(periphid >= 0 && periphid < ESP32_NPERIPHERALS); DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX); @@ -427,13 +574,18 @@ void esp32_attach_peripheral(int cpu, int periphid, int cpuint) if (cpu != 0) { regaddr = DPORT_APP_MAP_REGADDR(periphid); + intmap = g_cpu1_intmap; } else #endif { regaddr = DPORT_PRO_MAP_REGADDR(periphid); + intmap = g_cpu0_intmap; } + DEBUGASSERT(intmap[cpuint] == CPUINT_UNASSIGNED); + intmap[cpuint] = periphid + XTENSA_IRQ_FIRSTPERIPH; + putreg32(cpuint, regaddr); } @@ -444,17 +596,21 @@ void esp32_attach_peripheral(int cpu, int periphid, int cpuint) * Detach a peripheral interupt from a CPU interrupt. * * Input Parameters: - * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU - * periphid - The peripheral number from ira.h to be assigned. + * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU + * periphid - The peripheral number from irq.h to be detached from the + * CPU interrupt. + * cpuint - The CPU interrupt from which the peripheral interrupt will + * be detached. * * Returned Value: * None * ****************************************************************************/ -void esp32_detach_peripheral(int cpu, int periphid) +void esp32_detach_peripheral(int cpu, int periphid, int cpuint) { uintptr_t regaddr; + uint8_t *intmap; DEBUGASSERT(periphid >= 0 && periphid < ESP32_NPERIPHERALS); #ifdef CONFIG_SMP @@ -463,12 +619,17 @@ void esp32_detach_peripheral(int cpu, int periphid) if (cpu != 0) { regaddr = DPORT_APP_MAP_REGADDR(periphid); + intmap = g_cpu1_intmap; } else #endif { regaddr = DPORT_PRO_MAP_REGADDR(periphid); + intmap = g_cpu0_intmap; } + DEBUGASSERT(intmap[cpuint] != CPUINT_UNASSIGNED); + intmap[cpuint] = CPUINT_UNASSIGNED; + putreg32(NO_CPUINT, regaddr); } diff --git a/arch/xtensa/src/esp32/esp32_cpuint.h b/arch/xtensa/src/esp32/esp32_cpuint.h index a3b599cf54203dde35ece8991c7119412454beab..0132ce807185b6ab1a7015031cfac168ff055bd9 100644 --- a/arch/xtensa/src/esp32/esp32_cpuint.h +++ b/arch/xtensa/src/esp32/esp32_cpuint.h @@ -42,10 +42,46 @@ #include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define CPUINT_UNASSIGNED 0xff /* No peripheral assigned to this CPU interrupt */ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* Maps a CPU interrupt to the IRQ of the attached peripheral interrupt */ + +extern uint8_t g_cpu0_intmap[ESP32_NCPUINTS]; +#ifdef CONFIG_SMP +extern uint8_t g_cpu1_intmap[ESP32_NCPUINTS]; +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ +/**************************************************************************** + * Name: esp32_cpuint_initialize + * + * Description: + * Initialize CPU interrupts + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) is returned on success; A negated errno value is returned on + * any failre. + * + ****************************************************************************/ + +int esp32_cpuint_initialize(void); + /**************************************************************************** * Name: esp32_alloc_levelint * @@ -108,8 +144,10 @@ void esp32_free_cpuint(int cpuint); * * Input Parameters: * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU - * periphid - The peripheral number from ira.h to be attached. + * periphid - The peripheral number from ira.h to be assigned to + * a CPU interrupt. * cpuint - The CPU interrupt to receive the peripheral interrupt + * assignment. * * Returned Value: * None @@ -125,14 +163,17 @@ void esp32_attach_peripheral(int cpu, int periphid, int cpuint); * Detach a peripheral interupt from a CPU interrupt. * * Input Parameters: - * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU - * periphid - The peripheral number from ira.h to be detached. + * cpu - The CPU to receive the interrupt 0=PRO CPU 1=APP CPU + * periphid - The peripheral number from irq.h to be detached from the + * CPU interrupt. + * cpuint - The CPU interrupt from which the peripheral interrupt will + * be detached. * * Returned Value: * None * ****************************************************************************/ -void esp32_detach_peripheral(int cpu, int periphid); +void esp32_detach_peripheral(int cpu, int periphid, int cpuint); #endif /* __ARCH_XTENSA_SRC_ESP32_ESP32_CPUINT_H */ diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c index 3a603579b6f1d7482e1ba5ff1d9449cbe501e335..1efb25b567c31f91a629f0043c5696c52698b947 100644 --- a/arch/xtensa/src/esp32/esp32_cpustart.c +++ b/arch/xtensa/src/esp32/esp32_cpustart.c @@ -41,31 +41,38 @@ #include #include -#include +#include #include #include #include -#include +#include +#include #include "sched/sched.h" #include "xtensa.h" #include "chip/esp32_dport.h" +#include "chip/esp32_rtccntl.h" #include "esp32_region.h" #include "esp32_cpuint.h" #include "esp32_smp.h" #ifdef CONFIG_SMP -#warning REVISIT Need ets_set_appcpu_boot_addr() prototype -void ets_set_appcpu_boot_addr(uint32_t); - /**************************************************************************** * Private Data ****************************************************************************/ static volatile bool g_appcpu_started; -static sem_t g_appcpu_interlock; +static volatile spinlock_t g_appcpu_interlock SP_SECTION; + +/**************************************************************************** + * ROM function prototypes + ****************************************************************************/ + +void Cache_Flush(int cpu); +void Cache_Read_Enable(int cpu); +void ets_set_appcpu_boot_addr(uint32_t start); /**************************************************************************** * Private Functions @@ -87,20 +94,6 @@ static inline void xtensa_registerdump(FAR struct tcb_s *tcb) # define xtensa_registerdump(tcb) #endif -/**************************************************************************** - * Name: xtensa_disable_all - ****************************************************************************/ - -static inline void xtensa_disable_all(void) -{ - __asm__ __volatile__ - ( - "movi a2, 0\n" - "xsr a2, INTENABLE\n" - : : : "a2" - ); -} - /**************************************************************************** * Name: xtensa_attach_fromcpu0_interrupt ****************************************************************************/ @@ -135,36 +128,68 @@ static inline void xtensa_attach_fromcpu0_interrupt(void) ****************************************************************************/ /**************************************************************************** - * Name: xtensa_start_handler + * Name: xtensa_appcpu_start * * Description: - * This is the handler for SGI1. This handler simply returns from the - * interrupt, restoring the state of the new task at the head of the ready - * to run list. + * This is the entry point used with the APP CPU was started via + * up_cpu_start(). The actually start-up logic in in ROM and we boot up + * in C code. * * Input Parameters: - * Standard interrupt handling + * None * * Returned Value: - * Zero on success; a negated errno value on failure. + * None, does not return * ****************************************************************************/ -int xtensa_start_handler(int irq, FAR void *context) +void xtensa_appcpu_start(void) { - FAR struct tcb_s *tcb; - int i; + FAR struct tcb_s *tcb = this_task(); + register uint32_t sp; + +#ifdef CONFIG_STACK_COLORATION + { + register uint32_t *ptr; + register int i; + + /* If stack debug is enabled, then fill the stack with a recognizable value + * that we can use later to test for high water marks. + */ + + for (i = 0, ptr = (uint32_t *)tcb->stack_alloc_ptr; + i < tcb->adj_stack_size; + i += sizeof(uint32_t)) + { + *ptr++ = STACK_COLOR; + } + } +#endif + + /* Move to the stack assigned to us by up_smp_start immediately. Although + * we were give a stack pointer at start-up, we don't know where that stack + * pointer is positioned respect to our memory map. The only safe option + * is to switch to a well-known IDLE thread stack. + */ + + sp = (uint32_t)tcb->adj_stack_ptr; + __asm__ __volatile__("mov sp, %0\n" : : "r"(sp)); sinfo("CPU%d Started\n", up_cpu_index()); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify that this CPU has started */ + + sched_note_cpu_started(tcb); +#endif + /* Handle interlock*/ g_appcpu_started = true; - sem_post(&g_appcpu_interlock); + spin_unlock(&g_appcpu_interlock); /* Reset scheduler parameters */ - tcb = this_task(); sched_resume_scheduler(tcb); /* Move CPU0 exception vectors to IRAM */ @@ -175,9 +200,9 @@ int xtensa_start_handler(int irq, FAR void *context) esp32_region_protection(); - /* Disable all PRO CPU interrupts */ + /* Initialize CPU interrupts */ - xtensa_disable_all(); + (void)esp32_cpuint_initialize(); /* Attach and emable internal interrupts */ @@ -187,13 +212,6 @@ int xtensa_start_handler(int irq, FAR void *context) xtensa_attach_fromcpu0_interrupt(); #endif - /* Detach all peripheral sources APP CPU interrupts */ - - for (i = 0; i < ESP32_NPERIPHERALS; i++) - { - esp32_detach_peripheral(1, i);; - } - #if 0 /* Does it make since to have co-processors enabled on the IDLE thread? */ #if XTENSA_CP_ALLSET != 0 /* Set initial co-processor state */ @@ -218,7 +236,6 @@ int xtensa_start_handler(int irq, FAR void *context) */ xtensa_context_restore(tcb->xcp.regs); - return OK; } /**************************************************************************** @@ -255,18 +272,39 @@ int up_cpu_start(int cpu) if (!g_appcpu_started) { uint32_t regval; - int ret; /* Start CPU1 */ sinfo("Starting CPU%d\n", cpu); +#ifdef CONFIG_SCHED_INSTRUMENTATION + /* Notify of the start event */ + + sched_note_cpu_start(this_task(), cpu); +#endif + /* The waitsem semaphore is used for signaling and, hence, should not * have priority inheritance enabled. */ - sem_init(&g_appcpu_interlock, 0, 0); - sem_setprotocol(&g_appcpu_interlock, SEM_PRIO_NONE); + spin_initialize(&g_appcpu_interlock, SP_LOCKED); + + /* Flush and enable I-cache for APP CPU */ + + Cache_Flush(cpu); + Cache_Read_Enable(cpu); + + /* Unstall the APP CPU */ + + regval = getreg32(RTC_CNTL_SW_CPU_STALL_REG); + regval &= ~RTC_CNTL_SW_STALL_APPCPU_C1_M; + putreg32(regval, RTC_CNTL_SW_CPU_STALL_REG); + + regval = getreg32(RTC_CNTL_OPTIONS0_REG); + regval &= ~RTC_CNTL_SW_STALL_APPCPU_C0_M; + putreg32(regval, RTC_CNTL_OPTIONS0_REG); + + /* Enable clock gating for the APP CPU */ regval = getreg32(DPORT_APPCPU_CTRL_B_REG); regval |= DPORT_APPCPU_CLKGATE_EN; @@ -276,6 +314,8 @@ int up_cpu_start(int cpu) regval &= ~DPORT_APPCPU_RUNSTALL; putreg32(regval, DPORT_APPCPU_CTRL_C_REG); + /* Reset the APP CPU */ + regval = getreg32(DPORT_APPCPU_CTRL_A_REG); regval |= DPORT_APPCPU_RESETTING; putreg32(regval, DPORT_APPCPU_CTRL_A_REG); @@ -286,20 +326,12 @@ int up_cpu_start(int cpu) /* Set the CPU1 start address */ - ets_set_appcpu_boot_addr((uint32_t)__cpu1_start); - - /* And way for the initial task to run on CPU1 */ + ets_set_appcpu_boot_addr((uint32_t)xtensa_appcpu_start); - while (!g_appcpu_started) - { - ret = sem_wait(&g_appcpu_interlock); - if (ret < 0) - { - DEBUGASSERT(errno == EINTR); - } - } + /* And wait for the initial task to run on CPU1 */ - sem_destroy(&g_appcpu_interlock); + spin_lock(&g_appcpu_interlock); + DEBUGASSERT(g_appcpu_started); } return OK; diff --git a/arch/xtensa/src/esp32/esp32_intdecode.c b/arch/xtensa/src/esp32/esp32_intdecode.c index 675c5327e663b91cf306c5b3f90c8d6e55aab31c..0bc4041524699de8ee791918f55d0b4d2066c50b 100644 --- a/arch/xtensa/src/esp32/esp32_intdecode.c +++ b/arch/xtensa/src/esp32/esp32_intdecode.c @@ -39,29 +39,32 @@ #include -#include -#include +#include +#include + +#include +#include -#include "chip/esp32_dport.h" #include "xtensa.h" +#include "esp32_cpuint.h" /**************************************************************************** - * Private Data + * Private Functions ****************************************************************************/ -static const uint8_t g_baseirq[3] = -{ - ESP32_IRQ_SREG0, - ESP32_IRQ_SREG1, - ESP32_IRQ_SREG2 -}; +/**************************************************************************** + * Name: xtensa_intclear + ****************************************************************************/ -static const uint8_t g_nirqs[3] = +static inline void xtensa_intclear(uint32_t mask) { - ESP32_NIRQS_SREG0, - ESP32_NIRQS_SREG1, - ESP32_NIRQS_SREG2 -}; + __asm__ __volatile__ + ( + "movi a2, 0\n" + "wsr %0, INTCLEAR\n" + : "=r"(mask) : : + ); +} /**************************************************************************** * Public Functions @@ -75,80 +78,74 @@ static const uint8_t g_nirqs[3] = * handling to the registered interrupt handler via xtensa_irq_dispatch(). * * Input Parameters: - * regs - Saves processor state on the stack + * cpuints - Set of pending interrupts valid for this level + * regs - Saves processor state on the stack * * Returned Value: - * Normally the same vale as regs is returned. But, in the event of an + * Normally the same value as regs is returned. But, in the event of an * interrupt level context switch, the returned value will, instead point * to the saved processor state in the TCB of the newly started task. * ****************************************************************************/ -uint32_t *xtensa_int_decode(uint32_t *regs) +uint32_t *xtensa_int_decode(uint32_t cpuints, uint32_t *regs) { - uintptr_t regaddr; - uint32_t regval; + uint8_t *intmap; uint32_t mask; - int regndx; int bit; - int baseirq; - int nirqs; - #ifdef CONFIG_SMP int cpu; +#endif - /* Select PRO or APP interrupt status registers */ +#ifdef CONFIG_SMP + /* Select PRO or APP CPU interrupt mapping table */ cpu = up_cpu_index(); - if (cpu == 0) + if (cpu != 0) { - regaddr = DPORT_PRO_INTR_STATUS_0_REG; + intmap = g_cpu1_intmap; } else #endif { - regaddr = DPORT_APP_INTR_STATUS_0_REG; + intmap = g_cpu0_intmap; } - /* Process each pending interrupt in each of the three interrupt status - * registers. - */ + /* Skip over zero bits, eight at a time */ - for (regndx = 0; regndx < 3; regndx++) - { - /* Fetch the next register status register */ + for (bit = 0, mask = 0xff; + bit < ESP32_NCPUINTS && (cpuints & mask) == 0; + bit += 8, mask <<= 8); - regval = getreg32(regaddr); - regaddr += sizeof(uint32_t); + /* Process each pending CPU interrupt */ - /* Set up the search */ + for (; bit < ESP32_NCPUINTS && cpuints != 0; bit++) + { + mask = (1 << bit); + if ((cpuints & mask) != 0) + { + /* Extract the IRQ number from the mapping table */ - baseirq = g_baseirq[regndx]; - nirqs = g_nirqs[regndx]; + uint8_t irq = intmap[bit]; + DEBUGASSERT(irq != CPUINT_UNASSIGNED); - /* Decode and dispatch each pending bit in the interrupt status - * register. - */ + /* Clear software or edge-triggered interrupt */ - for (bit = 0; regval != 0 && bit < nirqs; bit++) - { - /* Check if this interrupt is pending */ + xtensa_intclear(mask); - mask = (1 << bit); - if ((regval & mask) != 0) - { - /* Yes.. Dispatch the interrupt. Note that regs may be - * altered in the case of an interrupt level context switch. - */ + /* Dispatch the CPU interrupt. + * + * NOTE that regs may be altered in the case of an interrupt + * level context switch. + */ - regs = xtensa_irq_dispatch(baseirq + bit, regs); + regs = xtensa_irq_dispatch((int)irq, regs); - /* Clear this bit in the sampled status register so that - * perhaps we can exit this loop sooner. - */ + /* Clear the bit in the pending interrupt so that perhaps + * we can exit the look early. + */ - regval &= ~mask; - } + cpuints &= ~mask; } } diff --git a/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c b/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c index 66ae7bac06f7ac5ca95136816214e523399a8ea1..01bac85b0cb6df3ff4ad7532019d419aaf52e426 100644 --- a/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c +++ b/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c @@ -41,7 +41,6 @@ #include #include -#include #include #include @@ -59,11 +58,11 @@ /* Single parameter passed with the inter-CPU interrupt */ -static volatile uint8_t g_intcode[CONFIG_SMP_NCPUS]; +static volatile uint8_t g_intcode[CONFIG_SMP_NCPUS] SP_SECTION; /* Spinlock protects parameter array */ -static volatile spinlock_t g_intercpu_spin[CONFIG_SMP_NCPUS] = +static volatile spinlock_t g_intercpu_spin[CONFIG_SMP_NCPUS] SP_SECTION = { SP_UNLOCKED, SP_UNLOCKED }; @@ -86,7 +85,7 @@ static int esp32_fromcpu_interrupt(int fromcpu) int intcode; int tocpu; - DEBUGASSERT(regs != NULL); + DEBUGASSERT((unsigned)fromcpu < CONFIG_SMP_NCPUS); /* Clear the interrupt from the other CPU */ @@ -155,14 +154,8 @@ int xtensa_intercpu_interrupt(int tocpu, int intcode) { int fromcpu; - DEBUGASSERT((unsigned)cpu < CONFIG_SMP_NCPUS && - (unsigned)incode <= UINT8_MAX); - - /* Disable context switching so that some other thread does not attempt to - * take the spinlock on the same CPU. - */ - - sched_lock(); + DEBUGASSERT((unsigned)tocpu < CONFIG_SMP_NCPUS && + (unsigned)intcode <= UINT8_MAX); /* Make sure that each inter-cpu event is atomic. The spinlock should * only be locked if we just completed sending an interrupt to this @@ -195,7 +188,6 @@ int xtensa_intercpu_interrupt(int tocpu, int intcode) putreg32(DPORT_CPU_INTR_FROM_CPU_1, DPORT_CPU_INTR_FROM_CPU_1_REG); } - sched_unlock(); return OK; } diff --git a/arch/xtensa/src/esp32/esp32_irq.c b/arch/xtensa/src/esp32/esp32_irq.c index 4c1d15008f3599924b033cb7256af3a9fda35eaf..11c43a4a1cee433c537ee15ab505922925a1f778 100644 --- a/arch/xtensa/src/esp32/esp32_irq.c +++ b/arch/xtensa/src/esp32/esp32_irq.c @@ -98,20 +98,6 @@ static void esp32_irq_dump(const char *msg, int irq) # define esp32_irq_dump(msg, irq) #endif -/**************************************************************************** - * Name: xtensa_disable_all - ****************************************************************************/ - -static inline void xtensa_disable_all(void) -{ - __asm__ __volatile__ - ( - "movi a2, 0\n" - "xsr a2, INTENABLE\n" - : : : "a2" - ); -} - /**************************************************************************** * Name: xtensa_attach_fromcpu1_interrupt ****************************************************************************/ @@ -151,20 +137,11 @@ static inline void xtensa_attach_fromcpu1_interrupt(void) void xtensa_irq_initialize(void) { - int i; - - /* Disable all PRO CPU interrupts */ - - xtensa_disable_all(); - - /* Detach all peripheral sources PRO CPU interrupts */ + /* Initialize CPU interrupts */ - for (i = 0; i < ESP32_NPERIPHERALS; i++) - { - esp32_detach_peripheral(0, i); - } + (void)esp32_cpuint_initialize(); -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 +#if defined(CONFIG_STACK_COLORATION) && defined(HAVE_INTERRUPTSTACK) /* Colorize the interrupt stack for debug purposes */ #warning Missing logic @@ -187,7 +164,7 @@ void xtensa_irq_initialize(void) #endif #ifndef CONFIG_SUPPRESS_INTERRUPTS - /* And finally, enable interrupts */ + /* And finally, enable interrupts. Also clears PS.EXCM */ up_irq_enable(); #endif diff --git a/arch/xtensa/src/esp32/esp32_serial.c b/arch/xtensa/src/esp32/esp32_serial.c index f48b06e304f40ec5d8b691a289b7d8515b22012e..3226895de7db154cf88eb409f775a8293fb47efe 100644 --- a/arch/xtensa/src/esp32/esp32_serial.c +++ b/arch/xtensa/src/esp32/esp32_serial.c @@ -146,7 +146,7 @@ struct esp32_config_s { - const uint32_t uartbase; /* Base address of UART registers */ + const uint32_t uartbase; /* Base address of UART registers */ xcpt_t handler; /* Interrupt handler */ uint8_t periph; /* UART peripheral ID */ uint8_t irq; /* IRQ number assigned to the peripheral */ @@ -455,8 +455,8 @@ static void esp32_disableallints(struct esp32_dev_s *priv, uint32_t *intena) static int esp32_setup(struct uart_dev_s *dev) { - struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; #ifndef CONFIG_SUPPRESS_UART_CONFIG + struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; uint32_t clkdiv; uint32_t regval; uint32_t conf0; @@ -586,6 +586,19 @@ static int esp32_setup(struct uart_dev_s *dev) static void esp32_shutdown(struct uart_dev_s *dev) { struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; + uint32_t status; + + /* Wait for outgoing FIFO to clear. The ROM bootloader does not flush + * the FIFO before handing over to user code, so some of this output is + * not currently seen when the UART is reconfigured in early stages of + * startup. + */ + + do + { + status = esp32_serialin(priv, UART_STATUS_OFFSET); + } + while ((status & UART_TXFIFO_CNT_M) != 0); /* Disable all UART interrupts */ @@ -642,7 +655,9 @@ static int esp32_attach(struct uart_dev_s *dev) priv->cpuint = esp32_alloc_levelint(1); if (priv->cpuint < 0) { - ret = priv->cpuint; + /* Failed to allocate a CPU interrupt of this type */ + + return priv->cpuint; } /* Set up to receive peripheral interrupts on the current CPU */ @@ -701,7 +716,7 @@ static void esp32_detach(struct uart_dev_s *dev) cpu = 0; #endif - esp32_detach_peripheral(cpu, priv->config->periph); + esp32_detach_peripheral(cpu, priv->config->periph, priv->cpuint); /* And release the CPU interrupt */ @@ -725,6 +740,8 @@ static int esp32_interrupt(struct uart_dev_s *dev) struct esp32_dev_s *priv; uint32_t regval; uint32_t status; + uint32_t enabled; + unsigned int nfifo; int passes; bool handled; @@ -741,28 +758,48 @@ static int esp32_interrupt(struct uart_dev_s *dev) handled = false; priv->status = esp32_serialin(priv, UART_INT_RAW_OFFSET); status = esp32_serialin(priv, UART_STATUS_OFFSET); + enabled = esp32_serialin(priv, UART_INT_ENA_OFFSET); /* Clear pending interrupts */ - regval = (UART_RXFIFO_FULL_INT_CLR_S | UART_FRM_ERR_INT_CLR_S | - UART_RXFIFO_TOUT_INT_CLR_S | UART_TX_DONE_INT_CLR_S | - UART_TXFIFO_EMPTY_INT_CLR_S); + regval = (UART_RXFIFO_FULL_INT_CLR | UART_FRM_ERR_INT_CLR | + UART_RXFIFO_TOUT_INT_CLR | UART_TX_DONE_INT_CLR | + UART_TXFIFO_EMPTY_INT_CLR); esp32_serialout(priv, UART_INT_CLR_OFFSET, regval); - if ((status & UART_RXFIFO_CNT_M) > 0) - { - /* Received data in the RXFIFO ... process incoming bytes */ + /* Are Rx interrupts enabled? The upper layer may hold off Rx input + * by disabling the Rx interrupts if there is no place to saved the + * data, possibly resulting in an overrun error. + */ - uart_recvchars(dev); - handled = true; - } + if ((enabled & (UART_RXFIFO_FULL_INT_ENA | UART_RXFIFO_TOUT_INT_ENA)) != 0) + { + /* Is there any data waiting in the Rx FIFO? */ - if ((status & UART_TXFIFO_CNT_M) < 0x7f) - { - /* The TXFIFO is not full ... process outgoing bytes */ + nfifo = (status & UART_RXFIFO_CNT_M) >> UART_RXFIFO_CNT_S; + if (nfifo > 0) + { + /* Received data in the RXFIFO! ... Process incoming bytes */ + + uart_recvchars(dev); + handled = true; + } + } - uart_xmitchars(dev); - handled = true; + /* Are Tx interrupts enabled? The upper layer will disable Tx interrupts + * when it has nothing to send. + */ + + if ((enabled & (UART_TX_DONE_INT_ENA | UART_TXFIFO_EMPTY_INT_ENA)) != 0) + { + nfifo = (status & UART_TXFIFO_CNT_M) >> UART_TXFIFO_CNT_S; + if (nfifo < 0x7f) + { + /* The TXFIFO is not full ... process outgoing bytes */ + + uart_xmitchars(dev); + handled = true; + } } } @@ -1032,8 +1069,11 @@ static int esp32_receive(struct uart_dev_s *dev, unsigned int *status) static void esp32_rxint(struct uart_dev_s *dev, bool enable) { struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; + irqstate_t flags; int regval; + flags = enter_critical_section(); + if (enable) { /* Receive an interrupt when their is anything in the Rx data register (or an Rx @@ -1042,8 +1082,8 @@ static void esp32_rxint(struct uart_dev_s *dev, bool enable) #ifndef CONFIG_SUPPRESS_SERIAL_INTS regval = esp32_serialin(priv, UART_INT_ENA_OFFSET); - regval |= (UART_RXFIFO_FULL_INT_CLR_S | UART_FRM_ERR_INT_CLR_S | - UART_RXFIFO_TOUT_INT_CLR_S); + regval |= (UART_RXFIFO_FULL_INT_ENA | UART_FRM_ERR_INT_ENA | + UART_RXFIFO_TOUT_INT_ENA); esp32_serialout(priv, UART_INT_ENA_OFFSET, regval); #endif } @@ -1051,10 +1091,13 @@ static void esp32_rxint(struct uart_dev_s *dev, bool enable) { /* Disable the RX interrupts */ - esp32_serialout(priv, UART_INT_CLR_OFFSET, - (UART_RXFIFO_FULL_INT_CLR_S | UART_FRM_ERR_INT_CLR_S | - UART_RXFIFO_TOUT_INT_CLR_S)); + regval = esp32_serialin(priv, UART_INT_ENA_OFFSET); + regval &= ~(UART_RXFIFO_FULL_INT_ENA | UART_FRM_ERR_INT_ENA | + UART_RXFIFO_TOUT_INT_ENA); + esp32_serialout(priv, UART_INT_ENA_OFFSET, regval); } + + leave_critical_section(flags); } /**************************************************************************** @@ -1099,20 +1142,19 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable) { struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv; irqstate_t flags; + int regval; flags = enter_critical_section(); if (enable) { - uint32_t regval; - /* Set to receive an interrupt when the TX holding register register * is empty */ #ifndef CONFIG_SUPPRESS_SERIAL_INTS regval = esp32_serialin(priv, UART_INT_ENA_OFFSET); - regval |= (UART_TX_DONE_INT_ENA_S | UART_TXFIFO_EMPTY_INT_ENA_S); + regval |= (UART_TX_DONE_INT_ENA | UART_TXFIFO_EMPTY_INT_ENA); esp32_serialout(priv, UART_INT_ENA_OFFSET, regval); /* Fake a TX interrupt here by just calling uart_xmitchars() with @@ -1126,8 +1168,9 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable) { /* Disable the TX interrupt */ - esp32_serialout(priv, UART_INT_CLR_OFFSET, - (UART_TX_DONE_INT_CLR_S | UART_TXFIFO_EMPTY_INT_CLR_S)); + regval = esp32_serialin(priv, UART_INT_ENA_OFFSET); + regval &= ~(UART_TX_DONE_INT_ENA | UART_TXFIFO_EMPTY_INT_ENA); + esp32_serialout(priv, UART_INT_ENA_OFFSET, regval); } leave_critical_section(flags); @@ -1253,7 +1296,7 @@ int up_putc(int ch) /* Add CR */ while(!esp32_txready(&CONSOLE_DEV)); - esp32_send(&CONSOLE_DEV, 'r'); + esp32_send(&CONSOLE_DEV, '\r'); } while(!esp32_txready(&CONSOLE_DEV)); diff --git a/arch/xtensa/src/esp32/esp32_smp.h b/arch/xtensa/src/esp32/esp32_smp.h index 22d934e7a6b75544758b675ac32f7800ed644294..7418a2e06069a6d7d163f070dd32b8f847445858 100644 --- a/arch/xtensa/src/esp32/esp32_smp.h +++ b/arch/xtensa/src/esp32/esp32_smp.h @@ -44,6 +44,20 @@ #ifdef CONFIG_SMP +/**************************************************************************** + * Pre-procesor Definitions + ****************************************************************************/ + +/* An IDLE thread stack size for CPU0 must be defined */ + +#if !defined(CONFIG_SMP_IDLETHREAD_STACKSIZE) +# error CONFIG_SMP_IDLETHREAD_STACKSIZE is not defined +#elif CONFIG_SMP_IDLETHREAD_STACKSIZE < 16 +# error CONFIG_SMP_IDLETHREAD_STACKSIZE is to small +#endif + +#define CPU1_IDLETHREAD_STACKSIZE ((CONFIG_SMP_IDLETHREAD_STACKSIZE + 15) & ~15) +#define CPU1_IDLETHREAD_STACKWORDS (CPU1_IDLETHREAD_STACKSIZE >> 2) /**************************************************************************** * Public Data @@ -51,8 +65,7 @@ /* This is the CPU1 IDLE stack */ -#define CPU1_IDLETHREAD_STACKSIZE (CONFIG_SMP_IDLETHREAD_STACKSIZE & ~15) -extern uint32_t g_cpu1_idlestack[CPU1_IDLETHREAD_STACKSIZE / 34]; +extern uint32_t g_cpu1_idlestack[CPU1_IDLETHREAD_STACKWORDS]; /**************************************************************************** * Public Functions diff --git a/arch/xtensa/src/esp32/esp32_start.c b/arch/xtensa/src/esp32/esp32_start.c index a468e83a9c8cae44fa058a37dc2c0fc50b957290..b0d9a5844394f4a40e8f895f5c3ff432aa4b1d33 100644 --- a/arch/xtensa/src/esp32/esp32_start.c +++ b/arch/xtensa/src/esp32/esp32_start.c @@ -33,14 +33,25 @@ #include #include +#include +#include "xtensa.h" #include "xtensa_attr.h" + #include "chip/esp32_dport.h" #include "chip/esp32_rtccntl.h" #include "esp32_clockconfig.h" #include "esp32_region.h" #include "esp32_start.h" -#include "xtensa.h" + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* Address of the CPU0 IDLE thread */ + +uint32_t g_idlestack[IDLETHREAD_STACKWORDS] + __attribute__((aligned(16) section(".noinit"))); /**************************************************************************** * Public Functions @@ -62,6 +73,7 @@ void IRAM_ATTR __start(void) { uint32_t regval; + uint32_t sp; /* Kill the watchdog timer */ @@ -73,6 +85,39 @@ void IRAM_ATTR __start(void) regval &= ~(1 << 14); putreg32(regval, 0x6001f048); + /* Make sure that normal interrupts are disabled. This is really only an + * issue when we are started in un-usual ways (such as from IRAM). In this + * case, we can at least defer some unexpected interrupts left over from the + * last program execution. + */ + + up_irq_disable(); + +#ifdef CONFIG_STACK_COLORATION + { + register uint32_t *ptr; + register int i; + + /* If stack debug is enabled, then fill the stack with a recognizable value + * that we can use later to test for high water marks. + */ + + for (i = 0, ptr = g_idlestack; i < IDLETHREAD_STACKWORDS; i++) + { + *ptr++ = STACK_COLOR; + } + } +#endif + + /* Move the stack to a known location. Although we were give a stack + * pointer at start-up, we don't know where that stack pointer is positioned + * respect to our memory map. The only safe option is to switch to a well- + * known IDLE thread stack. + */ + + sp = (uint32_t)g_idlestack + IDLETHREAD_STACKSIZE; + __asm__ __volatile__("mov sp, %0\n" : : "r"(sp)); + /* Make page 0 access raise an exception */ esp32_region_protection(); @@ -108,4 +153,5 @@ void IRAM_ATTR __start(void) /* Bring up NuttX */ os_start(); + for(; ; ); /* Should not return */ } diff --git a/arch/xtensa/src/esp32/esp32_timerisr.c b/arch/xtensa/src/esp32/esp32_timerisr.c index 90ba8ecaae6a5f913d44ea582b64a5293df71a24..09653a582f3c91da654a88f2c0e3ccfe6f0941bd 100644 --- a/arch/xtensa/src/esp32/esp32_timerisr.c +++ b/arch/xtensa/src/esp32/esp32_timerisr.c @@ -170,20 +170,15 @@ static int esp32_timerisr(int irq, uint32_t *regs) void xtensa_timer_initialize(void) { - uint64_t divisor; + uint32_t divisor; uint32_t count; /* Configured the timer0 as the system timer. * - * divisor = BOARD_CLOCK_FREQUENCY / ticks_per_sec - * = BOARD_CLOCK_FREQUENCY / (ticks_per_usec * 1000000) - * = (1000000 * BOARD_CLOCK_FREQUENCY) / ticks_per_usec - * - * A long long calculation is used to preserve accuracy in all cases. + * divisor = BOARD_CLOCK_FREQUENCY / ticks_per_sec */ - divisor = (1000000ull * (uint64_t)BOARD_CLOCK_FREQUENCY) / CONFIG_USEC_PER_TICK; - DEBUGASSERT(divisor <= UINT32_MAX) + divisor = BOARD_CLOCK_FREQUENCY / CLOCKS_PER_SEC; g_tick_divisor = divisor; /* Set up periodic timer */ diff --git a/arch/xtensa/src/lx6/Kconfig b/arch/xtensa/src/lx6/Kconfig index 073954b7d6b493cbb0e97616b79318f2949f1c4c..9edff0ce33e3ce836ef494a9e6aedec8a319d8e8 100644 --- a/arch/xtensa/src/lx6/Kconfig +++ b/arch/xtensa/src/lx6/Kconfig @@ -5,27 +5,4 @@ if ARCH_CHIP_LX6 -choice - prompt "LX6 implementation" - default ARCH_CHIP_ESP32 - -config ARCH_CHIP_ESP32 - bool "Expressif ESP32" - ---help--- - The ESP32 is a dual-core system with two Harvard Architecture Xtensa - LX6 CPUs. All embedded memory, external memory and peripherals are - located on the data bus and/or the instruction bus of these CPUs. - With some minor exceptions the address mapping of two CPUs is - symmetric, meaning they use the same addresses to access the same - memory. Multiple peripherals in the system can access embedded - memory via DMA. - - The two CPUs are named "PRO_CPU" and "APP_CPU" (for "protocol" and - "application"), however for most purposes the two CPUs are - interchangeable. - -endchoice # LX6 implementation - -source arch/xtensa/src/esp32/Kconfig - endif # ARCH_CHIP_LX6 diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c index 0fbb210ea034596d1923716ec584bd36384edbba..b142e6be2150cecc789f7d76f3de516898d124bc 100644 --- a/arch/z16/src/common/up_exit.c +++ b/arch/z16/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z16/src/common/up_exit.c * - * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,9 +43,9 @@ #include #include - +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "chip/chip.h" @@ -141,11 +141,11 @@ void _exit(int status) { FAR struct tcb_s* tcb; - /* Disable interrupts. Interrupts will remain disabled until - * the new task is resumed below. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index 7df1610845bea2ec499d9dd086b3ae9336b01ebd..bb65dbd77792a6ba3dc2b3dcacffae7cf383d4d2 100644 --- a/arch/z80/src/common/up_exit.c +++ b/arch/z80/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/common/up_exit.c * - * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,9 +44,9 @@ #include #include - +#include #ifdef CONFIG_DUMP_ON_EXIT -#include +# include #endif #include "chip/chip.h" @@ -143,11 +143,11 @@ void _exit(int status) { FAR struct tcb_s* tcb; - /* Disable interrupts. Interrupts will remain disabled until - * the new task is resumed below. + /* Make sure that we are in a critical section with local interrupts. + * The IRQ state will be restored when the next task is started. */ - (void)up_irq_save(); + (void)enter_critical_section(); sinfo("TCB=%p exiting\n", tcb); diff --git a/arch/z80/src/ez80/Kconfig b/arch/z80/src/ez80/Kconfig index 7529e2c7adc79f5704b166f3817611ed8613620b..759160a512f72289b947df285b05e6e9cda26dec 100644 --- a/arch/z80/src/ez80/Kconfig +++ b/arch/z80/src/ez80/Kconfig @@ -117,6 +117,26 @@ config ARCH_MCFILTER ---help--- Enables multicast MAC address filtering (not fully implemented) +choice + prompt "Work queue" + default EZ80_EMAC_LPWORK if SCHED_LPWORK + default EZ80_EMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config EZ80_EMAC_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config EZ80_EMAC_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + endif # EZ80_EMAC config ARCH_TIMERHOOK diff --git a/arch/z80/src/ez80/Make.defs b/arch/z80/src/ez80/Make.defs index 7e79e19d657b2854fe71e1ca3d05e89b24018e0f..5b4defd8e78247228be8ddef4e006a20d5ee6034 100644 --- a/arch/z80/src/ez80/Make.defs +++ b/arch/z80/src/ez80/Make.defs @@ -44,7 +44,7 @@ CMN_CSRCS += up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c CMN_CSRCS += up_mdelay.c up_stackframe.c up_udelay.c up_usestack.c CMN_CSRCS += up_puts.c -CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_up_irq_save.asm +CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm CHIP_ASRCS += ez80_saveusercontext.asm ez80_restorecontext.asm ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) CHIP_ASRCS += ez80f91_init.asm diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index d4e56bf04f9ba58b0a2eaa30e6746ef54d68cd96..71f1c4ee9c6e281c7e698eb592df2d53f742b45b 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_emac.c * - * Copyright (C) 2009-2010, 2012, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2012, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,25 @@ /* Configuration ************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_EZ80_EMAC_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_EZ80_EMAC_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_EZ80_EMAC_HPWORK nor CONFIG_EZ80_EMAC_LPWORK defined +# endif +#endif + #ifndef CONFIG_EZ80_RAMADDR # define CONFIG_EZ80_RAMADDR EZ80_EMACSRAM #endif @@ -321,6 +341,10 @@ struct ez80emac_driver_s WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txtimeout; /* TX timeout timer */ + struct work_s txwork; /* For deferring Tx-related work to the work queue */ + struct work_s rxwork; /* For deferring Rx-related work to the work queue */ + struct work_s syswork; /* For deferring system work to the work queue */ + #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_DEBUG_NET) struct ez80mac_statistics_s stat; #endif @@ -334,6 +358,10 @@ struct ez80emac_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + /* There is only a single instance of driver private data (because there is * only one EMAC interface. */ @@ -371,20 +399,31 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv); /* Interrupt handling */ +static void ez80emac_txinterrupt_work(FAR void *arg); static int ez80emac_txinterrupt(int irq, FAR void *context); + +static void ez80emac_rxinterrupt_work(FAR void *arg); static int ez80emac_rxinterrupt(int irq, FAR void *context); + +static void ez80emac_sysinterrupt_work(FAR void *arg); static int ez80emac_sysinterrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static void ez80emac_polltimer(int argc, uint32_t arg, ...); -static void ez80emac_txtimeout(int argc, uint32_t arg, ...); +static void ez80emac_txtimeout_work(FAR void *arg); +static void ez80emac_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void ez80emac_poll_work(FAR void *arg); +static void ez80emac_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int ez80emac_ifup(struct net_driver_s *dev); static int ez80emac_ifdown(struct net_driver_s *dev); + +static void ez80emac_txavail_work(FAR void *arg); static int ez80emac_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP static int ez80emac_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); static int ez80emac_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); @@ -1047,7 +1086,8 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(priv->txtimeout, EMAC_TXTIMEOUT, ez80emac_txtimeout, 1, (uint32_t)priv); + (void)wd_start(priv->txtimeout, EMAC_TXTIMEOUT, + ez80emac_txtimeout_expiry, 1, (uint32_t)priv); return OK; } @@ -1410,27 +1450,33 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv) } /**************************************************************************** - * Function: ez80emac_txinterrupt + * Function: ez80emac_txinterrupt_work * * Description: - * Process Rx-related interrupt events + * Perform Tx interrupt related work from the worker thread * * Parameters: - * priv - Driver data instance - * istat - Snapshot of ISTAT register containing Rx events to provess + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success + * + * Assumptions: + * The network is locked. * ****************************************************************************/ -static int ez80emac_txinterrupt(int irq, FAR void *context) +static void ez80emac_txinterrupt_work(FAR void *arg) { - FAR struct ez80emac_driver_s *priv = &g_emac; + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; FAR struct ez80emac_desc_s *txhead = priv->txhead; uint8_t regval; uint8_t istat; + /* Process pending Ethernet Tx interrupts */ + + net_lock(); + /* EMAC Tx interrupts: * * EMAC_ISTAT_TXDONE - Bit 0: 1=Transmit done interrupt @@ -1511,29 +1557,88 @@ static int ez80emac_txinterrupt(int irq, FAR void *context) wd_cancel(priv->txtimeout); } + net_unlock(); + + /* Re-enable Ethernet Tx interrupts */ + + up_enable_irq(EZ80_EMACRX_IRQ); +} + +/**************************************************************************** + * Function: ez80emac_txinterrupt + * + * Description: + * Process Tx-related interrupt events + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int ez80emac_txinterrupt(int irq, FAR void *context) +{ + FAR struct ez80emac_driver_s *priv = &g_emac; + uint8_t istat; + + /* Disable further Ethernet Tx interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(EZ80_EMACTX_IRQ); + + /* Determine if a TX transfer just completed */ + + istat = inp(EZ80_EMAC_ISTAT); + if ((istat & EMAC_ISTAT_TXDONE) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be no race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->txtimeout); + } + + /* Schedule to perform the Tx interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->txwork, ez80emac_txinterrupt_work, priv, 0); + return OK; } /**************************************************************************** - * Function: ez80emac_rxinterrupt + * Function: ez80emac_rxinterrupt_work * * Description: - * Process Rx-related interrupt events + * Perform Rx interrupt related work from the worker thread * * Parameters: - * priv - Driver data instance - * istat - Snapshot of ISTAT register containing Rx events to provess + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success + * + * Assumptions: + * The network is locked. * ****************************************************************************/ -static int ez80emac_rxinterrupt(int irq, FAR void *context) +static void ez80emac_rxinterrupt_work(FAR void *arg) { - FAR struct ez80emac_driver_s *priv = &g_emac; + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; uint8_t istat; + /* Process pending Ethernet Rx interrupts */ + + net_lock(); + /* EMAC Rx interrupts: * * EMAC_ISTAT_RXDONE - Bit 3: 1=Receive done interrupt @@ -1554,14 +1659,18 @@ static int ez80emac_rxinterrupt(int irq, FAR void *context) /* Process any RX packets pending the RX buffer */ (void)ez80emac_receive(priv); - return OK; + net_unlock(); + + /* Re-enable Ethernet Rx interrupts */ + + up_enable_irq(EZ80_EMACRX_IRQ); } /**************************************************************************** - * Function: ez80emac_sysinterrupt + * Function: ez80emac_rxinterrupt * * Description: - * Hardware interrupt handler + * Process Rx-related interrupt events * * Parameters: * irq - Number of the IRQ that generated the interrupt @@ -1574,12 +1683,50 @@ static int ez80emac_rxinterrupt(int irq, FAR void *context) * ****************************************************************************/ -static int ez80emac_sysinterrupt(int irq, FAR void *context) +static int ez80emac_rxinterrupt(int irq, FAR void *context) { FAR struct ez80emac_driver_s *priv = &g_emac; + + /* Disable further Ethernet Rx interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(EZ80_EMACRX_IRQ); + + /* Schedule to perform the Rx interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->rxwork, ez80emac_rxinterrupt_work, priv, 0); + return OK; +} + +/**************************************************************************** + * Function: ez80emac_sysinterrupt_work + * + * Description: + * Perform system interrupt related work from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() was called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void ez80emac_sysinterrupt_work(FAR void *arg) +{ + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; uint8_t events; uint8_t istat; + /* Process pending system interrupts */ + + net_lock(); + /* EMAC system interrupts : * * EMAC_ISTAT_TXFSMERR - Bit 7: 1=Transmit state machine error interrupt @@ -1632,32 +1779,78 @@ static int ez80emac_sysinterrupt(int irq, FAR void *context) EMAC_STAT(priv, rx_errors); EMAC_STAT(priv, rx_ovrerrors); } + + net_unlock(); + + /* Re-enable Ethernet system interrupts */ + + up_enable_irq(EZ80_EMACSYS_IRQ); +} + +/**************************************************************************** + * Function: ez80emac_sysinterrupt + * + * Description: + * System interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int ez80emac_sysinterrupt(int irq, FAR void *context) +{ + FAR struct ez80emac_driver_s *priv = &g_emac; + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(EZ80_EMACSYS_IRQ); + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->syswork); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->syswork, ez80emac_sysinterrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: ez80emac_txtimeout + * Function: ez80emac_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static void ez80emac_txtimeout(int argc, uint32_t arg, ...) +static void ez80emac_txtimeout_work(FAR void *arg) { FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; irqstate_t flags; + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Increment statistics and dump debug info */ EMAC_STAT(priv, tx_errors); @@ -1673,13 +1866,15 @@ static void ez80emac_txtimeout(int argc, uint32_t arg, ...) /* Then poll the network for new XMIT data */ (void)devif_poll(&priv->dev, ez80emac_txpoll); + net_unlock(); } /**************************************************************************** - * Function: ez80emac_polltimer + * Function: ez80emac_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1689,20 +1884,104 @@ static void ez80emac_txtimeout(int argc, uint32_t arg, ...) * None * * Assumptions: + * Global interrupts are disabled by the watchdog logic. * ****************************************************************************/ -static void ez80emac_polltimer(int argc, uint32_t arg, ...) +static void ez80emac_txtimeout_expiry(int argc, wdparm_t arg, ...) { - struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)arg; + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; + + /* Disable further Ethernet Tx interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + up_disable_irq(EZ80_EMACTX_IRQ); + + /* Cancel any pending poll or Tx interrupt work. This will have no + * effect on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->txwork); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->txwork, ez80emac_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: ez80emac_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. + * + ****************************************************************************/ + +static void ez80emac_poll_work(FAR void *arg) +{ + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; /* Poll the network for new XMIT data */ + net_lock(); (void)devif_timer(&priv->dev, ez80emac_txpoll); /* Setup the watchdog poll timer again */ - (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_polltimer, 1, arg); + (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, 1, priv); + net_unlock(); +} + +/**************************************************************************** + * Function: ez80emac_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void ez80emac_poll_expiry(int argc, wdparm_t arg, ...) +{ + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->syswork)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->syswork, ez80emac_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, 1, arg); + } } /**************************************************************************** @@ -1788,7 +2067,8 @@ static int ez80emac_ifup(FAR struct net_driver_s *dev) /* Set and activate a timer process */ - (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_polltimer, 1, (uint32_t)priv); + (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_poll_expiry, + 1, (uint32_t)priv); /* Enable the Ethernet interrupts */ @@ -1851,36 +2131,31 @@ static int ez80emac_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: ez80emac_txavail + * Function: ez80emac_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int ez80emac_txavail(struct net_driver_s *dev) +static void ez80emac_txavail_work(FAR void *arg) { - struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)dev->d_private; - irqstate_t flags; - - flags = enter_critical_section(); + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->bifup) { - /* Check if there is room in the hardware to hold another outgoing packet. */ /* If so, then poll the network for new XMIT data */ @@ -1888,7 +2163,44 @@ static int ez80emac_txavail(struct net_driver_s *dev) (void)devif_poll(&priv->dev, ez80emac_txpoll); } - leave_critical_section(flags); + net_unlock(); +} + +/**************************************************************************** + * Function: ez80emac_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int ez80emac_txavail(FAR struct net_driver_s *dev) +{ + FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->syswork)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->syswork, ez80emac_txavail_work, priv, 0); + } + return OK; } @@ -2224,6 +2536,7 @@ int up_netinitialize(void) /* Initialize the driver structure */ memset(&g_emac, 0, sizeof(struct ez80emac_driver_s)); + priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->dev.d_ifup = ez80emac_ifup; /* I/F down callback */ priv->dev.d_ifdown = ez80emac_ifdown; /* I/F up (new IP address) callback */ priv->dev.d_txavail = ez80emac_txavail; /* New TX data callback */ diff --git a/arch/z80/src/ez80/ez80_irqsave.asm b/arch/z80/src/ez80/ez80_irqsave.asm index de3ad4a6e23bc08f1b55855b3c4fb8adedbde9a4..25edb630df39eca68d0caf9bb3a6a62c9fd78cd3 100644 --- a/arch/z80/src/ez80/ez80_irqsave.asm +++ b/arch/z80/src/ez80/ez80_irqsave.asm @@ -1,5 +1,5 @@ ;************************************************************************** -; arch/z80/src/ez80/ez80_up_irq_save.asm +; arch/z80/src/ez80/ez80_irqsave.asm ; ; Copyright (C) 2008 Gregory Nutt. All rights reserved. ; Author: Gregory Nutt diff --git a/arch/z80/src/z180/Kconfig b/arch/z80/src/z180/Kconfig index ce26721f761d2cea412e88f828219868ee76dfcf..f2359d4694e3f63076a0f5f68397d97e38c19562 100644 --- a/arch/z80/src/z180/Kconfig +++ b/arch/z80/src/z180/Kconfig @@ -7,8 +7,8 @@ if ARCH_CHIP_Z180 choice prompt "Toolchain Selection" - default Z180_TOOLCHAIN_SDCCW if HOST_WINDOWS - default Z180_TOOLCHAIN_SDCCL if !HOST_WINDOWS + default Z180_TOOLCHAIN_SDCCW if TOOLCHAIN_WINDOWS + default Z180_TOOLCHAIN_SDCCL if !TOOLCHAIN_WINDOWS config Z180_TOOLCHAIN_SDCCL bool "SDCC for Linux, MAC OSX, or Cygwin" @@ -16,7 +16,7 @@ config Z180_TOOLCHAIN_SDCCL config Z180_TOOLCHAIN_SDCCW bool "SDCC for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS endchoice diff --git a/arch/z80/src/z80/Kconfig b/arch/z80/src/z80/Kconfig index 7a05eb08ef75b377d3e5ab3e0467fc1aa4733b05..46b9f8c08a1eb30c6e60c8e89f00eb7b4708772e 100644 --- a/arch/z80/src/z80/Kconfig +++ b/arch/z80/src/z80/Kconfig @@ -7,8 +7,8 @@ if ARCH_CHIP_Z80 choice prompt "Toolchain Selection" - default Z80_TOOLCHAIN_SDCCW if HOST_WINDOWS - default Z80_TOOLCHAIN_SDCCL if !HOST_WINDOWS + default Z80_TOOLCHAIN_SDCCW if TOOLCHAIN_WINDOWS + default Z80_TOOLCHAIN_SDCCL if !TOOLCHAIN_WINDOWS config Z80_TOOLCHAIN_SDCCL bool "SDCC for Linux, MAC OSX, or Cygwin" @@ -16,7 +16,7 @@ config Z80_TOOLCHAIN_SDCCL config Z80_TOOLCHAIN_SDCCW bool "SDCC for Windows" - depends on HOST_WINDOWS + depends on TOOLCHAIN_WINDOWS endchoice diff --git a/configs/Board.mk b/configs/Board.mk index 11f0ed4dc23bf94b60b3564b89f1db8989729e18..680b37ebcb2f5149ca6d25390984bc796d7a173b 100644 --- a/configs/Board.mk +++ b/configs/Board.mk @@ -43,6 +43,7 @@ else AOBJS = $(ASRCS:$(ASMEXT)=$(OBJEXT)) endif COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) @@ -108,17 +109,23 @@ $(AOBJS): %$(OBJEXT): %$(ASMEXT) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -libboard$(LIBEXT): $(OBJS) +$(CXXOBJS) $(LINKOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +libboard$(LIBEXT): $(OBJS) $(CXXOBJS) $(Q) $(AR) $@ # Create an empty archive ifneq ($(OBJS),) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $@, $(OBJS) $(CXXOBJS)) endif -.depend: Makefile $(SRCS) +.depend: Makefile $(SRCS) $(CXXSRCS) ifneq ($(ZDSVERSION),) $(Q) $(MKDEP) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep else $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep +endif +ifneq ($(CXXSRCS),) + $(Q) $(MKDEP) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep endif $(Q) touch $@ diff --git a/configs/Kconfig b/configs/Kconfig index 21a4becacc19cf2c7619af8ad9e858212003f641..396b5e1414e2a41a53910588a4f4e5e9c097e1a0 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -70,32 +70,6 @@ config ARCH_BOARD_CLOUDCTRL Small network relay development board. Based on the Shenzhou IV development board design. -config ARCH_BOARD_COMPALE86 - bool "Compal e86 phone" - depends on ARCH_CHIP_CALYPSO - ---help--- - This configuration enables board support for Compal e86 phone. - This port derives from the Compal E88 port and was provided by Craig - Comstock. - -config ARCH_BOARD_COMPALE88 - bool "Compal e88 phone" - depends on ARCH_CHIP_CALYPSO - ---help--- - This configuration enables board support for compal e88 phone. - This ports is based on patches contributed by Denis Carikli for both the - compal e99 and e88. The patches were made by Alan Carvalho de Assis and - Denis Carikli using the Stefan Richter's Osmocom-bb patches. - -config ARCH_BOARD_COMPALE99 - bool "Compal e99 phone" - depends on ARCH_CHIP_CALYPSO - ---help--- - This configuration enables board support for compal e88 and e99 phones. - This port is based on patches contributed by Denis Carikli for both the - compal e99 and e88. The patches were made by Alan Carvalho de Assis and - Denis Carikli using the Stefan Richter's Osmocom-bb patches. - config ARCH_BOARD_DEMOS92S12NEC64 bool "Freescale DMO9S12NE64 board" depends on ARCH_CHIP_MCS92S12NEC64 @@ -568,6 +542,17 @@ config ARCH_BOARD_OLIMEX_STM32P207 toolchain under Linux or Cygwin. See the http://www.olimex.com for further information. This board features the STMicro STM32F207ZE MCU +config ARCH_BOARD_OLIMEX_STM32P407 + bool "Olimex STM32 P407 board" + depends on ARCH_CHIP_STM32F407ZG + select ARCH_HAVE_LEDS + select ARCH_HAVE_BUTTONS + select ARCH_HAVE_IRQBUTTONS + ---help--- + This port uses the Olimex STM32 P407 board and a GNU arm-nuttx-elf + toolchain under Linux or Cygwin. See the http://www.olimex.com for + further information. This board features the STMicro STM32F407ZG MCU + config ARCH_BOARD_OLIMEXINO_STM32 bool "Olimexino STM32 board" depends on ARCH_CHIP_STM32F103RB @@ -677,13 +662,6 @@ config ARCH_BOARD_PIC32MZ_STARTERKIT See www.microchip.com for further information. -config ARCH_BOARD_PIRELLI_DPL10 - bool "Pirelli DPL10 phone" - depends on ARCH_CHIP_CALYPSO - ---help--- - This directory contains the board support for Pirelli dpl10 phones. The - additions were made by Craig Comstock (with help form Alan Carvalho de Assis). - config ARCH_BOARD_NR5M100_NEXYS4 bool "NEXT RISC-V NR5M100 on Nexys-4 board" depends on ARCH_CHIP_NR5M100 @@ -761,19 +739,6 @@ config ARCH_BOARD_QEMU_I486 Port of NuttX to QEMU in i486 mode. This port will also run on real i486 hardwared (Google the Bifferboard). -config ARCH_BOARD_RGMP - bool "RGMP" - depends on ARCH_RGMP - ---help--- - RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project for - running GPOS and RTOS simultaneously on multi-processor platforms. You can - port your favorite RTOS to RGMP together with an unmodified Linux to form a - hybrid operating system. This makes your application able to use both RTOS - and GPOS features. - - See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further information - about RGMP. - config ARCH_BOARD_SABRE_6QUAD bool "NXP/Freescale i.MX6 Sabre-6Quad board" depends on ARCH_CHIP_IMX6_6QUAD @@ -865,6 +830,12 @@ config ARCH_BOARD_SAM3UEK ---help--- The port of NuttX to the Atmel SAM3U-EK development board. +config ARCH_BOARD_SAM4CMP_DB + bool "Atmel SAM4CMP-DB development board" + depends on ARCH_CHIP_ATSAM4CMP16B + ---help--- + The port of NuttX to the Atmel SAM4CMP-DB development board. + config ARCH_BOARD_SAM4EEK bool "Atmel SAM4E-EK development board" depends on ARCH_CHIP_ATSAM4E16E @@ -1393,9 +1364,6 @@ config ARCH_BOARD default "bambino-200e" if ARCH_BOARD_BAMBINO_200E default "c5471evm" if ARCH_BOARD_C5471EVM default "cloudctrl" if ARCH_BOARD_CLOUDCTRL - default "compal_e86" if ARCH_BOARD_COMPALE86 - default "compal_e88" if ARCH_BOARD_COMPALE88 - default "compal_e99" if ARCH_BOARD_COMPALE99 default "demo9s12ne64" if ARCH_BOARD_DEMOS92S12NEC64 default "dk-tm4c129x" if ARCH_BOARD_DK_TM4C129X default "ea3131" if ARCH_BOARD_EA3131 @@ -1445,6 +1413,7 @@ config ARCH_BOARD default "olimex-stm32-e407" if ARCH_BOARD_OLIMEX_STM32E407 default "olimex-stm32-p107" if ARCH_BOARD_OLIMEX_STM32P107 default "olimex-stm32-p207" if ARCH_BOARD_OLIMEX_STM32P207 + default "olimex-stm32-p407" if ARCH_BOARD_OLIMEX_STM32P407 default "olimex-strp711" if ARCH_BOARD_OLIMEX_STRP711 default "olimexino-stm32" if ARCH_BOARD_OLIMEXINO_STM32 default "open1788" if ARCH_BOARD_OPEN1788 @@ -1454,13 +1423,11 @@ config ARCH_BOARD default "pic32mx-starterkit" if ARCH_BOARD_PIC32MX_STARTERKIT default "pic32mx7mmb" if ARCH_BOARD_PIC32MX7MMB default "pic32mz-starterkit" if ARCH_BOARD_PIC32MZ_STARTERKIT - default "pirelli_dpl10" if ARCH_BOARD_PIRELLI_DPL10 default "nucleo-144" if ARCH_BOARD_NUCLEO_144 default "nucleo-f303re" if ARCH_BOARD_NUCLEO_F303RE default "nucleo-f4x1re" if ARCH_BOARD_NUCLEO_F401RE || ARCH_BOARD_NUCLEO_F411RE default "nucleo-l476rg" if ARCH_BOARD_NUCLEO_L476RG default "qemu-i486" if ARCH_BOARD_QEMU_I486 - default "rgmp" if ARCH_BOARD_RGMP default "sabre-6quad" if ARCH_BOARD_SABRE_6QUAD default "sama5d2-xult" if ARCH_BOARD_SAMA5D2_XULT default "sama5d3x-ek" if ARCH_BOARD_SAMA5D3X_EK @@ -1470,6 +1437,7 @@ config ARCH_BOARD default "samd21-xplained" if ARCH_BOARD_SAMD21_XPLAINED default "saml21-xplained" if ARCH_BOARD_SAML21_XPLAINED default "sam3u-ek" if ARCH_BOARD_SAM3UEK + default "sam4cmp-db" if ARCH_BOARD_SAM4CMP_DB default "sam4e-ek" if ARCH_BOARD_SAM4EEK default "sam4l-xplained" if ARCH_BOARD_SAM4L_XPLAINED default "sam4s-xplained" if ARCH_BOARD_SAM4S_XPLAINED @@ -1574,15 +1542,6 @@ endif if ARCH_BOARD_CLOUDCTRL source "configs/cloudctrl/Kconfig" endif -if ARCH_BOARD_COMPALE86 -source "configs/compal_e86/Kconfig" -endif -if ARCH_BOARD_COMPALE88 -source "configs/compal_e88/Kconfig" -endif -if ARCH_BOARD_COMPALE99 -source "configs/compal_e99/Kconfig" -endif if ARCH_BOARD_DEMOS92S12NEC64 source "configs/demo9s12ne64/Kconfig" endif @@ -1730,6 +1689,9 @@ endif if ARCH_BOARD_OLIMEX_STM32P207 source "configs/olimex-stm32-p207/Kconfig" endif +if ARCH_BOARD_OLIMEX_STM32P407 +source "configs/olimex-stm32-p407/Kconfig" +endif if ARCH_BOARD_OLIMEX_STRP711 source "configs/olimex-strp711/Kconfig" endif @@ -1754,9 +1716,6 @@ endif if ARCH_BOARD_PIC32MZ_STARTERKIT source "configs/pic32mz-starterkit/Kconfig" endif -if ARCH_BOARD_PIRELLI_DPL10 -source "configs/pirelli_dpl10/Kconfig" -endif if ARCH_BOARD_NUCLEO_144 source "configs/nucleo-144/Kconfig" endif @@ -1772,9 +1731,6 @@ endif if ARCH_BOARD_QEMU_I486 source "configs/qemu-i486/Kconfig" endif -if ARCH_BOARD_RGMP -source "configs/rgmp/Kconfig" -endif if ARCH_BOARD_SABRE_6QUAD source "configs/sabre-6quad/Kconfig" endif @@ -1802,6 +1758,9 @@ endif if ARCH_BOARD_SAM3UEK source "configs/sam3u-ek/Kconfig" endif +if ARCH_BOARD_SAM4CMP_DB +source "configs/sam4cmp-db/Kconfig" +endif if ARCH_BOARD_SAM4EEK source "configs/sam4e-ek/Kconfig" endif @@ -2036,31 +1995,6 @@ config BOARDCTL_TSCTEST specific logic must provide board_tsc_setup() and board_tsc_teardown() interfaces. -config BOARDCTL_ADCTEST - bool "Enable ADC test interfaces" - default n - ---help--- - Enables support for the BOARDIOC_ADCTEST_SETUP boardctl() command. - Architecture specific logic must provide board_adc_setup() - interface. - -config BOARDCTL_PWMTEST - bool "Enable PWM test interfaces" - default n - ---help--- - Enables support for the BOARDIOC_PWMTEST_SETUP boardctl() command. - Architecture specific logic must provide board_pwm_setup() - interface. - -config BOARDCTL_CANINIT - bool "Enable CAN initialize interface" - default n - depends on CAN - ---help--- - Enables support for the BOARDIOC_CAN_INITIALIZE boardctl() command. - Architecture specific logic must provide board_can_initialize() - interface. - config BOARDCTL_GRAPHICS bool "Enable custom graphics initialization interfaces" default n diff --git a/configs/Makefile b/configs/Makefile index 68a5fad87fe9f2a7ac47908a1f3c709abb8b45bc..f430e137e885fb1ee055c1a91b49ae98e1c71a86 100644 --- a/configs/Makefile +++ b/configs/Makefile @@ -66,6 +66,7 @@ BOARD_INSTALLED = $(if $(wildcard $(BOARD_DIR)$(DELIM)Makefile),y,) CONFIG_ASRCS = CONFIG_CSRCS = +CONFIG_CXXSRCS = # boardctl support @@ -79,6 +80,9 @@ AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = $(CONFIG_CSRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXSRCS = $(CONFIG_CXXSRCS) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) @@ -93,12 +97,18 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN): $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +$(BIN): $(OBJS) $(CXXOBJS) + $(call ARCHIVE, $@, $(OBJS) $(CXXOBJS)) -.depend: Makefile $(SRCS) +.depend: Makefile $(SRCS) $(CXXSRCS) ifneq ($(SRCS),) $(Q) $(MKDEP) --dep-path . "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep +endif +ifneq ($(CXXSRCS),) + $(Q) $(MKDEP) --dep-path . "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >>Make.dep endif $(Q) touch $@ diff --git a/configs/README.txt b/configs/README.txt index de1342ced27afc08b0a85d22ae77fcbc6a67aba6..80c0270ba26ce8514bc4241374fd44ebf0ac1723 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -206,13 +206,6 @@ configs/cloudctrl board. Based on the Shenzhou IV development board design. It is based on the STM32F107VC MCU. -configs/compal_e86, compal_e88 and compal_e99 - These directories contain the board support for compal e86, e88 and e99 phones. - These ports are based on patches contributed by Denis Carikli for both the - compal e99 and e88. The patches were made by Alan Carvalho de Assis and - Denis Carikli using the Stefan Richter's Osmocom-bb patches. The variant - for the e86 was submitted by Craig Comstock. - configs/demo9s12ne64 Freescale DMO9S12NE64 board based on the MC9S12NE64 hcs12 cpu. This port uses the m9s12x GCC toolchain. STATUS: (Still) under development; it @@ -467,6 +460,11 @@ configs/olimex-stm32-p207 toolchain under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p207.html for further information. Contributed by Martin Lederhilger. +configs/olimex-stm32-p407 + This port uses the Olimex STM32-P407 board (STM32F407ZG) and a GNU arm-nuttx-elf + toolchain under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p407.html + for further information. + configs/olimexino-stm32 This port uses the Olimexino STM32 board (STM32F103RBT6) and a GNU arm-nuttx-elf toolchain* under Linux or Cygwin. See the http://www.olimex.com for further\ @@ -531,7 +529,6 @@ configs/pic32mx7mmb Mikroelektronika PIC32MX7 Multimedia Board (MMB). See http://www.mikroe.com/ for further information. -configs/pirelli_dpl10 configs/pic32mz-starterkit This directory contains the port of NuttX to the Microchip PIC32MZ Embedded Connectivity (EC) Starter Kit. There are two configurations of @@ -544,24 +541,10 @@ configs/pic32mz-starterkit See www.microchip.com for further information. - This directory contains the board support for Pirelli "Discus" DP-L10 phones. - It is a variant of the compal_e88 config with the small changes for the - differences in the board. - configs/qemu-i486 Port of NuttX to QEMU in i486 mode. This port will also run on real i486 hardwared (Google the Bifferboard). -configs/rgmp - RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project for - running GPOS and RTOS simultaneously on multi-processor platforms. You can - port your favorite RTOS to RGMP together with an unmodified Linux to form a - hybrid operating system. This makes your application able to use both RTOS - and GPOS features. - - See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further - information about RGMP. - configs/nr5m100-nexys4 Port of NuttX to RISC-V platform on IQ-Analog NR5M100 RISC-V FPGA platform. @@ -610,6 +593,9 @@ configs/samd21-xplained configs/sam3u-ek The port of NuttX to the Atmel SAM3U-EK development board. +configs/sam4cmp-db + The port of NuttX to the Atmel SAM4CMP-DB development board. + configs/sam4e-ek The port of NuttX to the Atmel SAM4E-EK development board. This board features the SAM4E16 MCU running at up to 120MHz. diff --git a/configs/amber/hello/defconfig b/configs/amber/hello/defconfig index cbad0a8ece7a1a867a73e1e11666540b2b228997..2dc6a34254a53ef615eb5aaff98a7c0a4b6c2b7f 100644 --- a/configs/amber/hello/defconfig +++ b/configs/amber/hello/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -234,7 +233,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -413,7 +411,6 @@ CONFIG_EXAMPLES_HELLO=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/arduino-due/nsh/defconfig b/configs/arduino-due/nsh/defconfig index 4aa125358a12537ee76b3acd04aef484999f986e..bc43e12c289c7ff9d7b63680d66c8135029c5797 100644 --- a/configs/arduino-due/nsh/defconfig +++ b/configs/arduino-due/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -502,7 +500,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -736,7 +733,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/arduino-mega2560/hello/defconfig b/configs/arduino-mega2560/hello/defconfig index 67cb895808b44cd55f3055ec554fe5839f0922c3..95e74bd6c9b906994453ed6f586447c7108a7323 100644 --- a/configs/arduino-mega2560/hello/defconfig +++ b/configs/arduino-mega2560/hello/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -297,7 +296,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -510,7 +508,6 @@ CONFIG_EXAMPLES_HELLO=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/arduino-mega2560/nsh/defconfig b/configs/arduino-mega2560/nsh/defconfig index 81605c97eba65e1d2be12f4258795423c6c89c5b..40cfb5458a2e8e8e228a685f0cf4a13241a644e3 100644 --- a/configs/arduino-mega2560/nsh/defconfig +++ b/configs/arduino-mega2560/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -305,7 +304,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -519,7 +517,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/avr32dev1/nsh/defconfig b/configs/avr32dev1/nsh/defconfig index d0ff348be0c8483be64d0a47e86d634d3498b06c..5e2bffbca87f132b04572aa2d3f0c8711341561a 100644 --- a/configs/avr32dev1/nsh/defconfig +++ b/configs/avr32dev1/nsh/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -272,7 +271,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -463,7 +461,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/avr32dev1/ostest/defconfig b/configs/avr32dev1/ostest/defconfig index dd8088c35a1e057586b7b6657104c897b88cbe5d..600c0191aa2951a338bf69d0cc9b6ac623ba0f1f 100644 --- a/configs/avr32dev1/ostest/defconfig +++ b/configs/avr32dev1/ostest/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -271,7 +270,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -456,7 +454,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/bambino-200e/include/board.h b/configs/bambino-200e/include/board.h index d84320a8d3bbdfcb7101e353e63926ab1ee02172..9f33f9aea7270ffd214145dd94cb222be86dd8de 100644 --- a/configs/bambino-200e/include/board.h +++ b/configs/bambino-200e/include/board.h @@ -57,12 +57,11 @@ * here because the including C file may not have that file in its include * path. * - * The Xplorer board has four crystals on board: + * The Bambino-200e board has three crystals on board: * * Y1 - RTC 32.768 MHz oscillator input, - * Y2 - 24.576 MHz input to the UDA 1380 audio codec, - * Y3 - 12.000 MHz LPC43xx crystal oscillator input - * Y4 - 50 MHz input for Ethernet + * Y2 - 12.000 MHz LPC43xx crystal oscillator input + * Y3 - 25 MHz input for Ethernet KSZ8031 PHY */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency (Y3) */ diff --git a/configs/bambino-200e/nsh/defconfig b/configs/bambino-200e/nsh/defconfig index 1593440d4b66bf072501d9e797d5e07a745ca166..729e7fdc658d77307c97b9d6eb587ce1763ae2be 100644 --- a/configs/bambino-200e/nsh/defconfig +++ b/configs/bambino-200e/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -209,10 +207,11 @@ CONFIG_LPC43_BOOT_SPIFI=y # CONFIG_LPC43_SPIFI is not set # CONFIG_LPC43_SSP0 is not set # CONFIG_LPC43_SSP1 is not set -# CONFIG_LPC43_TMR0 is not set +CONFIG_LPC43_TMR0=y # CONFIG_LPC43_TMR1 is not set # CONFIG_LPC43_TMR2 is not set # CONFIG_LPC43_TMR3 is not set +CONFIG_LPC43_TIMER=y # CONFIG_LPC43_USART0 is not set CONFIG_LPC43_UART1=y # CONFIG_LPC43_USART2 is not set @@ -262,7 +261,7 @@ CONFIG_ARCH_HAVE_VFORK=y # CONFIG_ARCH_HAVE_MMU is not set CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set +CONFIG_ARCH_HAVE_EXTCLK=y # CONFIG_ARCH_HAVE_POWEROFF is not set CONFIG_ARCH_HAVE_RESET=y # CONFIG_ARCH_USE_MPU is not set @@ -329,8 +328,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -350,6 +347,7 @@ CONFIG_DISABLE_OS_API=y CONFIG_ARCH_HAVE_TICKLESS=y # CONFIG_SCHED_TICKLESS is not set CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEMTICK_EXTCLK is not set # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set # CONFIG_ARCH_HAVE_TIMEKEEPING is not set @@ -466,7 +464,7 @@ CONFIG_DEV_NULL=y # # Timer Driver Support # -# CONFIG_TIMER is not set +CONFIG_TIMER=y # CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set @@ -503,7 +501,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -797,7 +794,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -809,6 +805,14 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set +CONFIG_EXAMPLES_TIMER=y +CONFIG_EXAMPLE_TIMER_DEVNAME="/dev/timer0" +CONFIG_EXAMPLE_TIMER_INTERVAL=1000000 +CONFIG_EXAMPLE_TIMER_DELAY=100000 +CONFIG_EXAMPLE_TIMER_NSAMPLES=20 +CONFIG_EXAMPLES_TIMER_APPNAME="timer" +CONFIG_EXAMPLES_TIMER_STACKSIZE=2048 +CONFIG_EXAMPLES_TIMER_PRIORITY=100 # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set diff --git a/configs/bambino-200e/src/Makefile b/configs/bambino-200e/src/Makefile index fa49acd10417c5fc7cd7710d648b0d94f0c6d4a3..bb34f2be40dbedebb02dd5afd0cc30a0bd5b4b7a 100644 --- a/configs/bambino-200e/src/Makefile +++ b/configs/bambino-200e/src/Makefile @@ -57,6 +57,10 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += lpc43_buttons.c endif +ifeq ($(CONFIG_TIMER),y) +CSRCS += lpc43_timer.c +endif + ifeq ($(CONFIG_USBMSC),y) CSRCS += lpc43_usbmsc.c endif diff --git a/configs/bambino-200e/src/bambino-200e.h b/configs/bambino-200e/src/bambino-200e.h index 2ec6d17479e4461c8b2801153d8e8846ca87fb81..9a0b85680141c4144b513716407c2ad9b0b83dff 100644 --- a/configs/bambino-200e/src/bambino-200e.h +++ b/configs/bambino-200e/src/bambino-200e.h @@ -123,5 +123,19 @@ void weak_function lpc43_sspdev_initialize(void); +/************************************************************************************ + * Name: lpc43xx_timerinitialize() + * + * Description: + * Perform architecture-specific initialization of the timer hardware. + * + ************************************************************************************/ + +#ifdef CONFIG_TIMER +int lpc43_timerinitialize(void); +#else +# define lpc43_timerinitialize() (0) +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H */ diff --git a/configs/bambino-200e/src/lpc43_appinit.c b/configs/bambino-200e/src/lpc43_appinit.c index eae609cf2e0c1249aeccd4cfdd259317c900fd4a..785c28758bc811317b47f190e55694de515b10dc 100644 --- a/configs/bambino-200e/src/lpc43_appinit.c +++ b/configs/bambino-200e/src/lpc43_appinit.c @@ -58,6 +58,8 @@ # endif #endif +#include "bambino-200e.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -162,5 +164,13 @@ int board_app_initialize(uintptr_t arg) { /* Initialize the SPIFI block device */ - return nsh_spifi_initialize(); + (void)nsh_spifi_initialize(); + +#ifdef CONFIG_TIMER + /* Registers the timers */ + + lpc43_timerinitialize(); +#endif + + return 0; } diff --git a/arch/arm/src/stm32/stm32_getc.c b/configs/bambino-200e/src/lpc43_timer.c similarity index 56% rename from arch/arm/src/stm32/stm32_getc.c rename to configs/bambino-200e/src/lpc43_timer.c index de9020bab40cab8fd0a06dcaba3011ed72d7c847..2efe5b236621cbc2bb0bbfb4f0cb782541d8e653 100644 --- a/arch/arm/src/stm32/stm32_getc.c +++ b/configs/bambino-200e/src/lpc43_timer.c @@ -1,8 +1,9 @@ /**************************************************************************** - * arch/arm/src/stm32/stm32_getc.c + * configs/bambino-200e/src/lpc43_timer.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt + * Bob Doiron * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,45 +39,48 @@ ****************************************************************************/ #include +#include +#include -#include +#include +#include +#include +#include +#include -#include - -#include "up_internal.h" -#include "up_arch.h" +#include +#include +#include +#include -#include "chip.h" +#include +#include "lpc43_timer.h" -#include "stm32.h" -#include "stm32_rcc.h" -#include "stm32_gpio.h" -#include "stm32_uart.h" +#ifdef CONFIG_TIMER /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ + +#if !(defined(CONFIG_LPC43_TMR0) || defined(CONFIG_LPC43_TMR1) || defined(CONFIG_LPC43_TMR2) \ + || defined(CONFIG_LPC43_TMR3) ) +# warning "CONFIG_LPC43_TMRx must be defined" +#endif -/* Select U[S]ART console base address */ - -#ifdef HAVE_CONSOLE -# if defined(CONFIG_USART1_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_USART1_BASE -# elif defined(CONFIG_USART2_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_USART2_BASE -# elif defined(CONFIG_USART3_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_USART3_BASE -# elif defined(CONFIG_UART4_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_UART4_BASE -# elif defined(CONFIG_UART5_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_UART5_BASE -# elif defined(CONFIG_USART6_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_USART6_BASE -# elif defined(CONFIG_UART7_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_UART7_BASE -# elif defined(CONFIG_UART8_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_UART8_BASE -# endif +/* Select the path to the registered watchdog timer device */ + +#ifndef CONFIG_TIMER0_DEVPATH +# define CONFIG_TIMER0_DEVPATH "/dev/timer0" +#endif +#ifndef CONFIG_TIMER1_DEVPATH +# define CONFIG_TIMER1_DEVPATH "/dev/timer1" +#endif +#ifndef CONFIG_TIMER2_DEVPATH +# define CONFIG_TIMER2_DEVPATH "/dev/timer2" +#endif +#ifndef CONFIG_TIMER3_DEVPATH +# define CONFIG_TIMER3_DEVPATH "/dev/timer3" #endif /**************************************************************************** @@ -84,38 +88,38 @@ ****************************************************************************/ /**************************************************************************** - * Name: up_getc + * Name: lpc43_timerinitialize() * * Description: - * Read one byte from the serial console - * - * REVIST: If used with the serial driver enabled, then this could - * interfere with the serial driver operations. Serial interrupts should - * be disabled when this function executes in that case. + * Perform architecture-specific initialization of the timer hardware. * ****************************************************************************/ -int up_getc(void) +int lpc43_timerinitialize(void) { - uint32_t ch = 0; - -#ifdef HAVE_CONSOLE - /* While there is any error, read and discard bytes to clear the errors */ + /* Initialize and register the timer devices */ - while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_SR_OFFSET) & - (USART_SR_ORE | USART_SR_NE | USART_SR_FE | USART_SR_PE)) != 0) - { - (void)getreg32(STM32_CONSOLE_BASE + STM32_USART_RDR_OFFSET); - } - - /* Wait until the RX data register has a character to be read */ +#if defined(CONFIG_LPC43_TMR0) + tmrinfo("Initializing %s...\n", CONFIG_TIMER0_DEVPATH); + lpc43_tmrinitialize(CONFIG_TIMER0_DEVPATH, LPC43M4_IRQ_TIMER0); +#endif - while ((getreg32(STM32_CONSOLE_BASE + STM32_USART_SR_OFFSET) & USART_SR_RXNE) == 0); +#if defined(CONFIG_LPC43_TMR1) + tmrinfo("Initializing %s...\n", CONFIG_TIMER1_DEVPATH); + lpc43_tmrinitialize(CONFIG_TIMER1_DEVPATH, LPC43M4_IRQ_TIMER1); +#endif - /* Then read the character */ +#if defined(CONFIG_LPC43_TMR2) + tmrinfo("Initializing %s...\n", CONFIG_TIMER2_DEVPATH); + lpc43_tmrinitialize(CONFIG_TIMER2_DEVPATH, LPC43M4_IRQ_TIMER2); +#endif - ch = getreg32(STM32_CONSOLE_BASE + STM32_USART_RDR_OFFSET); -#endif /* HAVE_CONSOLE */ +#if defined(CONFIG_LPC43_TMR3) + tmrinfo("Initializing %s...\n", CONFIG_TIMER3_DEVPATH); + lpc43_tmrinitialize(CONFIG_TIMER3_DEVPATH, LPC43M4_IRQ_TIMER3); +#endif - return (int)ch; + return OK; } + +#endif /* CONFIG_TIMER */ diff --git a/configs/boardctl.c b/configs/boardctl.c index 749056d82a51b4431dedfa1976b7198b2371ec14..d5810699cc99ebd3f67d4306d082ad05d1ffb094 100644 --- a/configs/boardctl.c +++ b/configs/boardctl.c @@ -48,6 +48,7 @@ #include #include #include +#include #ifdef CONFIG_BOARDCTL_USBDEVCTRL # include @@ -381,6 +382,21 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #endif +#ifdef CONFIG_NX_MULTIUSER + /* CMD: BOARDIOC_NX_START + * DESCRIPTION: Start the NX servier + * ARG: None + * CONFIGURATION: CONFIG_NX_MULTIUSER + * DEPENDENCIES: Base graphics logic provides nx_start() + */ + + case BOARDIOC_NX_START: + { + ret = nx_start(); + } + break; +#endif + #ifdef CONFIG_BOARDCTL_TSCTEST /* CMD: BOARDIOC_TSCTEST_SETUP * DESCRIPTION: Touchscreen controller test configuration @@ -410,58 +426,13 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #endif -#ifdef CONFIG_BOARDCTL_ADCTEST - /* CMD: BOARDIOC_ADCTEST_SETUP - * DESCRIPTION: ADC controller test configuration - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_ADCTEST - * DEPENDENCIES: Board logic must provide board_adc_setup() - */ - - case BOARDIOC_ADCTEST_SETUP: - { - ret = board_adc_setup(); - } - break; -#endif - -#ifdef CONFIG_BOARDCTL_PWMTEST - /* CMD: BOARDIOC_PWMTEST_SETUP - * DESCRIPTION: PWM controller test configuration - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_PWMTEST - * DEPENDENCIES: Board logic must provide board_pwm_setup() - */ - - case BOARDIOC_PWMTEST_SETUP: - { - ret = board_pwm_setup(); - } - break; -#endif - -#ifdef CONFIG_BOARDCTL_CANINIT - /* CMD: BOARDIOC_CAN_INITIALIZE - * DESCRIPTION: CAN device initialization - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_CANINIT - * DEPENDENCIES: Board logic must provide board_can_initialize() - */ - - case BOARDIOC_CAN_INITIALIZE: - { - ret = board_can_initialize(); - } - break; -#endif - #ifdef CONFIG_BOARDCTL_GRAPHICS /* CMD: BOARDIOC_GRAPHICS_SETUP * DESCRIPTION: Configure graphics that require special initialization * procedures * ARG: A pointer to an instance of struct boardioc_graphics_s * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_GRAPHICS - * DEPENDENCIES: Board logic must provide board_adc_setup() + * DEPENDENCIES: Board logic must provide board_graphics_setup() */ case BOARDIOC_GRAPHICS_SETUP: diff --git a/configs/c5471evm/httpd/defconfig b/configs/c5471evm/httpd/defconfig index 4d735ee6e2f1d1ea39ebdf57670852dad102f64f..c388a368c89091f973bdf707efd3658766415d16 100644 --- a/configs/c5471evm/httpd/defconfig +++ b/configs/c5471evm/httpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set CONFIG_ARCH_CHIP_C5471=y -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -168,6 +166,7 @@ CONFIG_C5471_PHY_LU3X31T_T64=y CONFIG_C5471_AUTONEGOTIATION=y # CONFIG_C5471_BASET100 is not set # CONFIG_C5471_BASET10 is not set +CONFIG_C5471_HPWORK=y # # Architecture Options @@ -313,6 +312,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -321,13 +321,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -409,7 +413,6 @@ CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -472,13 +475,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -723,7 +724,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/c5471evm/nettest/defconfig b/configs/c5471evm/nettest/defconfig index e16e8056264e23a87f516442ca69fd6ae972afd1..729f8df76ea5743a9f34cf3789a9386a4333fb4d 100644 --- a/configs/c5471evm/nettest/defconfig +++ b/configs/c5471evm/nettest/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set CONFIG_ARCH_CHIP_C5471=y -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -168,6 +166,7 @@ CONFIG_C5471_PHY_LU3X31T_T64=y CONFIG_C5471_AUTONEGOTIATION=y # CONFIG_C5471_BASET100 is not set # CONFIG_C5471_BASET10 is not set +CONFIG_C5471_HPWORK=y # # Architecture Options @@ -307,6 +306,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -314,13 +314,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -402,7 +406,6 @@ CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -465,13 +468,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -729,7 +730,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/c5471evm/nsh/defconfig b/configs/c5471evm/nsh/defconfig index e61a16c8f102c6e5202ac03bccd5f6289540b06b..a7d595285fa4e6c39859b162065a0e09d1eb90a1 100644 --- a/configs/c5471evm/nsh/defconfig +++ b/configs/c5471evm/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set CONFIG_ARCH_CHIP_C5471=y -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -168,6 +166,7 @@ CONFIG_C5471_PHY_LU3X31T_T64=y CONFIG_C5471_AUTONEGOTIATION=y # CONFIG_C5471_BASET100 is not set # CONFIG_C5471_BASET10 is not set +CONFIG_C5471_HPWORK=y # # Architecture Options @@ -313,6 +312,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -321,13 +321,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -410,7 +414,6 @@ CONFIG_NETDEV_TELNET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -473,13 +476,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -737,7 +738,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/cc3200-launchpad/nsh/defconfig b/configs/cc3200-launchpad/nsh/defconfig index 377ac04c427891247e6844e8a7f7d5d33de30764..1de3eee3e2e03fdff42cc57b224661b75d33ce31 100644 --- a/configs/cc3200-launchpad/nsh/defconfig +++ b/configs/cc3200-launchpad/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -463,7 +461,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -707,7 +704,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/cloudctrl/nsh/defconfig b/configs/cloudctrl/nsh/defconfig index 2b7a0009232b090b53a9a493316d7c2f997f96bc..6da8937d15157d717c4b1850e63990ef219397c1 100644 --- a/configs/cloudctrl/nsh/defconfig +++ b/configs/cloudctrl/nsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -594,8 +592,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -812,10 +808,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -839,7 +834,6 @@ CONFIG_ETH0_PHY_DM9161=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -917,13 +911,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1220,7 +1212,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/cloudctrl/src/cloudctrl.h b/configs/cloudctrl/src/cloudctrl.h index 44042435af10cda898c53e0ad50c074677d2d2c1..57f1847d8506b587ad7d5279ac7e5477496614ab 100644 --- a/configs/cloudctrl/src/cloudctrl.h +++ b/configs/cloudctrl/src/cloudctrl.h @@ -1,8 +1,7 @@ /**************************************************************************************************** * configs/cloudctrl/src/cloudctrl.h - * arch/arm/src/board/cloudctrl.n * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Darcy Gong * @@ -255,6 +254,18 @@ void weak_function stm32_usbinitialize(void); int stm32_usbhost_initialize(void); #endif +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + /**************************************************************************** * Name: stm32_sdinitialize * diff --git a/configs/cloudctrl/src/stm32_adc.c b/configs/cloudctrl/src/stm32_adc.c index 346100b7828c997c2640aedd29ff4693c7f8abb5..ba798386d049c5c7f011cf69b6df18235cff0093 100644 --- a/configs/cloudctrl/src/stm32_adc.c +++ b/configs/cloudctrl/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/cloudctrl/src/stm32_adc.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Darcy Gong * @@ -105,24 +105,19 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; //{10, 8, 9}; static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC12_IN10}; //{GPIO_ADC12_IN10, GPIO_ADC12_IN8, GPIO_ADC12_IN9}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/cloudctrl/src/stm32_appinit.c b/configs/cloudctrl/src/stm32_appinit.c index cc772b5add3c68542b83152031fa26c8ca6c017c..c628bd142ac4d553dde71faf1d9560edf7588767 100644 --- a/configs/cloudctrl/src/stm32_appinit.c +++ b/configs/cloudctrl/src/stm32_appinit.c @@ -127,9 +127,7 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_USBHOST) || defined(HAVE_W25) int ret; -#endif /* Initialize and register the W25 FLASH file system. */ @@ -156,5 +154,17 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + return ret; + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/compal_e86/README.txt b/configs/compal_e86/README.txt deleted file mode 100644 index 704f2b6b70ef163f238b2b7cd0dee80274fc642c..0000000000000000000000000000000000000000 --- a/configs/compal_e86/README.txt +++ /dev/null @@ -1,70 +0,0 @@ -compal_e86 -========== - -This directory contains the board support for compal e86 phones. This port -is tested on the following phone: - -* motorola c139 (compal e86) with flash configuration - -This port is based on patches contributed by Denis Carikli for both the -compal e99 and e88. At the time of initial check-in, the following phones -were tested: - -* motorolla c155 (compal e99) with the compalram and highram configuration -* motorolla W220 (compal e88) -* The openmoko freerunner baseband(compal e88) - -The patches were made by Alan Carvalho de Assis and Denis Carikli using -the Stefan Richter's patches that can be found here: - -http://cgit.osmocom.org/cgit/nuttx-bb/log/?h=lputt%2Ftesting - -Osmocom-BB Dependencies and Sercomm -=================================== - -The build environment assumes that you have the osmocom-bb project -directory at same level as the nuttx project: - - |- nuttx - |- apps - `- osmocom-bb - -If you attempt to build this configuration without osmocom-bb, and that -you added support for sercomm in your configuration(CONFIG_SERCOMM_CONSOLE=y) -you will get compilation errors in drivers/sercomm due to header files that -are needed from the osmocom-bb directory. - -By default, NuttX will not use sercomm (HDLC protocol) to communicate with -the host system. Sercomm is the transport used by osmocom-bb that runs on top -of serial. See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed -the usage of nuttx with sercomm. - -Running NuttX From Flash -======================== - -Flash layout: - -0x00000 - 0x02000 - original compal loader -0x02000 - 0x10000 - simple binary to jump to 0x10000 (jumper.e86loader.bin) -0x10000 - ??? - NuttX binary (nuttx.bin) - -Using osmocon/osmoload, retrieve the compal loader, flash it and the -jumper.e86loader.bin as well as nuttx.bin. - -The jumper app is a modified version of the menu app in osmocom-bb, branch -jolly/menu. The app disabled irqs (setup by compal loader?) and jumps to -0x10000. This app is submitted as a patch to osmocom-bb mailing list. - -Loading NuttX (highram) -======================= - -The osmocom-bb wiki describes how to load NuttX. See -http://bb.osmocom.org/trac/wiki/nuttx-bb for detailed information. -The way that nuttx is loaded depends on the configuration (highram/compalram) -and phone: - -o compalram is for the ramloader(for phone having a bootloader on flash) -o highram is for phones having the romloader(if the phone has a bootrom) - or for loading in the ram trough a special loader(loaded first on ram - by talking to the ramloader) when having a ramloader(which can only - load 64k). diff --git a/configs/compal_e86/include/board.h b/configs/compal_e86/include/board.h deleted file mode 100644 index 00c96bf6f5698510de7a7281df49324ad2acc928..0000000000000000000000000000000000000000 --- a/configs/compal_e86/include/board.h +++ /dev/null @@ -1,6 +0,0 @@ -/**************************************************************************** - * configs/nsh_highram/include/board.h - * - * Supposed to be empty - * - ****************************************************************************/ diff --git a/configs/compal_e86/nsh_highram/Make.defs b/configs/compal_e86/nsh_highram/Make.defs deleted file mode 100644 index c06a6821b16cbde4da3b9ab9dbb8434c53e06aa3..0000000000000000000000000000000000000000 --- a/configs/compal_e86/nsh_highram/Make.defs +++ /dev/null @@ -1,140 +0,0 @@ -############################################################################ -# configs/compal_e86/nsh_highram/Make.defs -# -# Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs - -ifeq ($(CONFIG_BOOT_RUNFROMFLASH),y) - LDSCRIPT = flash.ld -else - LDSCRIPT = highram.ld -endif - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh - ARCHINCLUDES = -I. -I "${shell cygpath -w $(OSMODIR)/src/shared/libosmocore/include}" -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -I "${shell cygpath -w $(OSMODIR)/src/shared/libosmocore/include}" -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" - -ifeq ("${CONFIG_SERCOMM_CONSOLE}","y") - OSMODIR = "${shell cygpath -w $(TOPDIR)/../../osmocom-bb}" - EXTRA_LIBS = "${shell cygpath -w $(OSMODIR)/src/target/firmware/comm/libcomm.a}" \ - "${shell cygpath -w $(OSMODIR)/src/shared/libosmocore/build-target/src/.libs/libosmocore.a}" \ - "${shell cygpath -w $(OSMODIR)/src/target/firmware/calypso/libcalypso.a}" \ - "${shell cygpath -w $(OSMODIR)/src/target/firmware/comm/libcomm.a}" -endif -else - # Linux/Cygwin-native toolchain - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHINCLUDES = -I. -I$(OSMODIR)/src/shared/libosmocore/include -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -I$(OSMODIR)/src/shared/libosmocore/include -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) - -ifeq ("${CONFIG_SERCOMM_CONSOLE}","y") - OSMODIR = $(TOPDIR)/../../osmocom-bb - EXTRA_LIBS = $(OSMODIR)/src/target/firmware/comm/libcomm.a \ - $(OSMODIR)/src/shared/libosmocore/build-target/src/.libs/libosmocore.a \ - $(OSMODIR)/src/target/firmware/calypso/libcalypso.a \ - $(OSMODIR)/src/target/firmware/comm/libcomm.a - # ^^^ Stupid hack! Why do I have to put it twice??? -endif -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ifeq ($(ARCHCCMAJOR),4) - ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin -else - ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - LDFLAGS += -g -endif - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = diff --git a/configs/compal_e86/scripts/flash.ld b/configs/compal_e86/scripts/flash.ld deleted file mode 100644 index 73c72f00cee957189b68d35e81f732caefdaa2b0..0000000000000000000000000000000000000000 --- a/configs/compal_e86/scripts/flash.ld +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Linker script for flashed applications on the Compal E86 - * - * This script creates a binary that can be linked at 0xFFFF, starting - * with the second flash page. This is what a phone application or - * pure layer1 device uses. - * - * XXX: interrupts? - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -MEMORY -{ - LOADR (rx) : ORIGIN = 0x00000000, LENGTH = 0x10000 - /* 4 MBytes of external flash memory (minus loader) */ - FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 0x3F0000 - /* 256 kBytes of internal zero-waitstate sram */ - IRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x040000 - /* 256 kBytes of external slow sram */ - ERAM (rw) : ORIGIN = 0x01000000, LENGTH = 0x040000 -} -SECTIONS -{ - /* entrypoint */ - .text.start : { - PROVIDE(_start = .); - KEEP(*(.text.start)) - *(.text.start) - } > FLASH - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > IRAM AT> FLASH - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - .text : { - _stext = ABSOLUTE(.) ; - /* regular code */ - *(.text*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - _etext = ABSOLUTE(.) ; - } > FLASH - PROVIDE(_text_start = ADDR(.text)); - PROVIDE(_text_end = ADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > FLASH - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > FLASH - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - .rodata : { - *(.rodata*) - _eronly = ABSOLUTE(.) ; - } > FLASH - PROVIDE(_rodata_start = ADDR(.rodata)); - PROVIDE(_rodata_end = ADDR(.rodata) + SIZEOF(.rodata)); - - /* pic offset tables */ - .got : { - . = ALIGN(4); - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - . = ALIGN(4); - } > FLASH - PROVIDE(_got_start = ADDR(.got)); - PROVIDE(_got_end = ADDR(.got) + SIZEOF(.got)); - - /* reserved ram */ - .compal.reservedram 0x800000 (NOLOAD) : { - . = 0xff; - } > IRAM - - /* initialized data */ - .data : AT (LOADADDR(.got) + SIZEOF(.got)) { - . = ALIGN(4); - _sdata = ABSOLUTE(.); - *(.data) - _edata = ABSOLUTE(.); - . = ALIGN(4); - } > IRAM - PROVIDE(__data_start = LOADADDR(.data)); - PROVIDE(__data_end = LOADADDR(.data) + SIZEOF(.data)); - PROVIDE(_data_start = ADDR(.data)); - PROVIDE(_data_end = ADDR(.data) + SIZEOF(.data)); - - /* ram code */ - .ramtext : AT (LOADADDR(.data) + SIZEOF(.data)) { - . = ALIGN(4); - *(.ramtext) - . = ALIGN(4); - } > IRAM - PROVIDE(__ramtext_start = LOADADDR(.ramtext)); - PROVIDE(__ramtext_end = LOADADDR(.ramtext) + SIZEOF(.ramtext)); - PROVIDE(_ramtext_start = ADDR(.ramtext)); - PROVIDE(_ramtext_end = ADDR(.ramtext) + SIZEOF(.ramtext)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - . = ALIGN(4); - } > IRAM - PROVIDE(__bss_start = ADDR(.bss)); - PROVIDE(__bss_end = ADDR(.bss) + SIZEOF(.bss)); - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/compal_e86/scripts/highram.ld b/configs/compal_e86/scripts/highram.ld deleted file mode 100644 index 429ef2b502580493dd255fd7f7b155007a4291ba..0000000000000000000000000000000000000000 --- a/configs/compal_e86/scripts/highram.ld +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Linker script for running from internal SRAM on Compal phones - * - * This script is tailored specifically to the requirements imposed - * on us by the Compal bootloader. - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(__start) -MEMORY -{ - -/* E86 stacked flash 32mbit flash, 4mbit sram, DBB internal 256kb SRAM */ - /* 0x800000-0x87ffff */ /* bump up because we have 32mbit instead of 16mbit */ - /* compal-loaded binary: our text, initialized data */ - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00040000 - /* compal-loaded binary: our unitialized data, stacks, heap */ - IRAM (rw) : ORIGIN = 0x00860000, LENGTH = 0x00020000 - -/* E88 NOR flash 16mbits, SRAM 256 kb, DBB has 256kb internal SRAM */ - /* 0x800000-0x83ffff */ - /* compal-loaded binary: our text, initialized data */ -/* - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00010000 -*/ - /* compal-loaded binary: our unitialized data, stacks, heap */ -/* - IRAM (rw) : ORIGIN = 0x00830000, LENGTH = 0x00010000 -*/ -} -SECTIONS -{ - . = 0x800000; - - /* romloader data section, contains passthru interrupt vectors */ - .compal.loader (NOLOAD) : { . = 0x100; } > LRAM - - /* image signature (prepended by osmocon according to phone type) */ - .compal.header (NOLOAD) : { . = 4; } > LRAM - - /* initialization code */ - . = ALIGN(4); - .text.start : { - PROVIDE(__start = .); - KEEP(*(.text.start)) - *(.text.start) - } > TRAM - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > LRAM - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - . = ALIGN(4); - .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) : - AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) { - /* regular code */ - *(.text*) - /* always-in-ram code */ - *(.ramtext*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - . = ALIGN(4); - } > TRAM - PROVIDE(_text_start = LOADADDR(.text)); - PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - . = ALIGN(4); - .rodata : { - *(.rodata*) - } > TRAM - PROVIDE(_rodata_start = LOADADDR(.rodata)); - PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata)); - - /* initialized data */ - . = ALIGN(4); - .data : { - *(.data) - } > TRAM - PROVIDE(_data_start = LOADADDR(.data)); - PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data)); - - /* pic offset tables */ - . = ALIGN(4); - .got : { - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - } > TRAM - PROVIDE(_got_start = LOADADDR(.got)); - PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - __bss_start = .; - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - } > IRAM - . = ALIGN(4); - __bss_end = .; - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/compal_e88/Kconfig b/configs/compal_e88/Kconfig deleted file mode 100644 index f72f3c094ce4c8f031445c514c343376e4e79e75..0000000000000000000000000000000000000000 --- a/configs/compal_e88/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# diff --git a/configs/compal_e88/README.txt b/configs/compal_e88/README.txt deleted file mode 100644 index 1dfefc74669d6f331a03652c1a6504ccbb11bafb..0000000000000000000000000000000000000000 --- a/configs/compal_e88/README.txt +++ /dev/null @@ -1,52 +0,0 @@ -compal_e88 -========== - -This directory contains the board support for compal e88 phones. - -This port is based on patches contributed by Denis Carikli for both the -compal e99 and e88. At the time of initial check-in, the following phones -were tested: - -* Motorola c155 (compal e99) with the compalram and highram configuration -* Motorola W220 (compal e88) -* The openmoko freerunner baseband(compal e88) - -The patches were made by Alan Carvalho de Assis and Denis Carikli using -the Stefan Richter's patches that can be found here: - -http://cgit.osmocom.org/cgit/nuttx-bb/log/?h=lputt%2Ftesting - -Osmocom-BB Dependencies and Sercomm -=================================== - -The build environment assumes that you have the osmocom-bb project -directory at same level as the nuttx project: - - |- nuttx - |- apps - `- osmocom-bb - -If you attempt to build this configuration without osmocom-bb, and that -you added support for sercomm in your configuration(CONFIG_SERCOMM_CONSOLE=y) -you will get compilation errors in drivers/sercomm due to header files that -are needed from the osmocom-bb directory. - -By default, NuttX will not use sercomm (HDLC protocol) to communicate with -the host system. Sercomm is the transport used by osmocom-bb that runs on top -of serial. See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed -the usage of nuttx with sercomm. - -Loading NuttX -============= - -The osmocom-bb wiki describes how to load NuttX. See -http://bb.osmocom.org/trac/wiki/nuttx-bb for detailed information. -The way that nuttx is loaded depends on the configuration (highram/compalram) -and phone: - -o compalram is for the ramloader(for phone having a bootloader on flash) -o highram is for phones having the romloader(if the phone has a bootrom) - or for loading in the ram trough a special loader(loaded first on ram - by talking to the ramloader) when having a ramloader(which can only - load 64k). - diff --git a/configs/compal_e88/include/board.h b/configs/compal_e88/include/board.h deleted file mode 100644 index 5855614184f903ced3811fc4d695d505df80d09c..0000000000000000000000000000000000000000 --- a/configs/compal_e88/include/board.h +++ /dev/null @@ -1,6 +0,0 @@ -/**************************************************************************** - * arch/board.h - * - * Supposed to be empty - * - ****************************************************************************/ diff --git a/configs/compal_e88/nsh_highram/defconfig b/configs/compal_e88/nsh_highram/defconfig deleted file mode 100644 index 36fe799d21966fca5b887161961be9871aef9a55..0000000000000000000000000000000000000000 --- a/configs/compal_e88/nsh_highram/defconfig +++ /dev/null @@ -1,812 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -CONFIG_DEBUG_ALERT=y -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -CONFIG_ARCH_CHIP_CALYPSO=y -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_KL is not set -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -CONFIG_ARCH_ARM7TDMI=y -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -# CONFIG_ARCH_CORTEXM0 is not set -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="arm" -CONFIG_ARCH_CHIP="calypso" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -# CONFIG_ARCH_LOWVECTORS is not set - -# -# ARM Configuration Options -# -# CONFIG_ARM_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARM_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y -# CONFIG_ARM_TOOLCHAIN_GNU_OABI is not set -CONFIG_UART_IRDA_BAUD=115200 -CONFIG_UART_IRDA_PARITY=0 -CONFIG_UART_IRDA_BITS=8 -CONFIG_UART_IRDA_2STOP=0 -CONFIG_UART_IRDA_RXBUFSIZE=256 -CONFIG_UART_IRDA_TXBUFSIZE=256 -CONFIG_UART_MODEM_BAUD=115200 -CONFIG_UART_MODEM_PARITY=0 -CONFIG_UART_MODEM_BITS=8 -CONFIG_UART_MODEM_2STOP=0 -CONFIG_UART_MODEM_RXBUFSIZE=256 -CONFIG_UART_MODEM_TXBUFSIZE=256 - -# -# Calypso Configuration Options -# - -# -# Modem UART Configuration -# -# CONFIG_UART_MODEM_HWFLOWCONTROL is not set - -# -# IrDA UART Configuration -# -# CONFIG_UART_IRDA_HWFLOWCONTROL is not set -# CONFIG_USE_SERCOMM_CONSOLE is not set -# CONFIG_SERIAL_MODEM_CONSOLE is not set -# CONFIG_SERIAL_IRDA_CONSOLE is not set -CONFIG_SERIAL_CONSOLE_NONE=y - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -CONFIG_ARCH_HAVE_POWEROFF=y -# CONFIG_ARCH_HAVE_RESET is not set -CONFIG_ARCH_STACKDUMP=y -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=1250 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -# CONFIG_BOOT_RUNFROMFLASH is not set -CONFIG_BOOT_RUNFROMISRAM=y -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0 -CONFIG_RAM_SIZE=8650752 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -# CONFIG_ARCH_BOARD_COMPALE86 is not set -CONFIG_ARCH_BOARD_COMPALE88=y -# CONFIG_ARCH_BOARD_COMPALE99 is not set -# CONFIG_ARCH_BOARD_PIRELLI_DPL10 is not set -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="compal_e88" - -# -# Common Board Options -# -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_POWEROFF=y -# CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -# CONFIG_BOARDCTL_GRAPHICS is not set -# CONFIG_BOARDCTL_IOCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y -# CONFIG_DISABLE_ENVIRON is not set - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=13 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=1 -CONFIG_PREALLOC_TIMERS=8 - -# -# Tasks and Scheduling -# -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=200 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=16 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Pthread Options -# -# CONFIG_MUTEX_TYPES is not set -CONFIG_NPTHREAD_KEYS=4 - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -CONFIG_DEV_CONSOLE=y -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 -# CONFIG_MODULE is not set - -# -# Work queue support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set -# CONFIG_SCHED_LPWORK is not set - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=4096 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -# CONFIG_LCD is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -CONFIG_OTHER_UART_SERIALDRIVER=y -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_OTHER_SERIAL_CONSOLE=y -# CONFIG_NO_SERIAL_CONSOLE is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -CONFIG_SYSLOG_SERIAL_CONSOLE=y -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_CONSOLE=y -# CONFIG_SYSLOG_NONE is not set -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_FS_AUTOMOUNTER is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_TMPFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_HAVE_HEAP2=y -CONFIG_HEAP2_BASE=0x00000000 -CONFIG_HEAP2_SIZE=0 -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -CONFIG_BUILTIN=y -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_LIBM is not set -# CONFIG_NOPRINTF_FIELDWIDTH is not set -# CONFIG_LIBC_FLOATINGPOINT is not set -CONFIG_LIBC_LONG_LONG=y -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_LIBC_LOCALTIME is not set -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# -CONFIG_BUILTIN_PROXY_STACKSIZE=1024 - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_HELLO_PRIORITY=100 -CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=64 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_CMDPARMS is not set -CONFIG_NSH_MAXARGUMENTS=6 -# CONFIG_NSH_ARGCAT is not set -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_BUILTIN_APPS=y - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_BASENAME is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_DIRNAME is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_POWEROFF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -CONFIG_NSH_DISABLE_SHUTDOWN=y -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNAME is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CMDOPT_DF_H=y -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=512 - -# -# Scripting Support -# -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/compal_e88/nsh_highram/setenv.sh b/configs/compal_e88/nsh_highram/setenv.sh deleted file mode 100755 index 0693ede0ac2b7bec0b349fdaf26d6d84bb48388c..0000000000000000000000000000000000000000 --- a/configs/compal_e88/nsh_highram/setenv.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# c5471evm/nsh/setenv.sh -# -# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -WD=`pwd` -export BUILDROOT_BIN=${WD}/../buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/compal_e88/scripts/ld.script b/configs/compal_e88/scripts/ld.script deleted file mode 100644 index 35fa847284ed8c02d05d01a5f97086e817f08f69..0000000000000000000000000000000000000000 --- a/configs/compal_e88/scripts/ld.script +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Linker script for running from internal SRAM on Compal phones - * - * This script is tailored specifically to the requirements imposed - * on us by the Compal bootloader. - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(__start) -MEMORY -{ - /* 0x800000-0x83ffff */ - /* compal-loaded binary: our text, initialized data */ - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00010000 - /* compal-loaded binary: our unitialized data, stacks, heap */ - IRAM (rw) : ORIGIN = 0x00830000, LENGTH = 0x00010000 -} -SECTIONS -{ - . = 0x800000; - - /* romloader data section, contains passthru interrupt vectors */ - .compal.loader (NOLOAD) : { . = 0x100; } > LRAM - - /* image signature (prepended by osmocon according to phone type) */ - .compal.header (NOLOAD) : { . = 4; } > LRAM - - /* initialization code */ - . = ALIGN(4); - .text.start : { - PROVIDE(__start = .); - KEEP(*(.text.start)) - *(.text.start) - } > TRAM - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > LRAM - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - . = ALIGN(4); - .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) : - AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) { - /* regular code */ - *(.text*) - /* always-in-ram code */ - *(.ramtext*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - . = ALIGN(4); - } > TRAM - PROVIDE(_text_start = LOADADDR(.text)); - PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - . = ALIGN(4); - .rodata : { - *(.rodata*) - } > TRAM - PROVIDE(_rodata_start = LOADADDR(.rodata)); - PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata)); - - /* initialized data */ - . = ALIGN(4); - .data : { - *(.data) - } > TRAM - PROVIDE(_data_start = LOADADDR(.data)); - PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data)); - - /* pic offset tables */ - . = ALIGN(4); - .got : { - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - } > TRAM - PROVIDE(_got_start = LOADADDR(.got)); - PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - __bss_start = .; - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - } > IRAM - . = ALIGN(4); - __bss_end = .; - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/compal_e88/src/.gitignore b/configs/compal_e88/src/.gitignore deleted file mode 100644 index 726d936e1e3390cc875a1fa5681e3c3988fe3c8b..0000000000000000000000000000000000000000 --- a/configs/compal_e88/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.depend -/Make.dep diff --git a/configs/compal_e99/Kconfig b/configs/compal_e99/Kconfig deleted file mode 100644 index e7d03fb148dff931b8a693a6a780192a594f8195..0000000000000000000000000000000000000000 --- a/configs/compal_e99/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -if ARCH_BOARD_COMPALE99 - -config COMPALE99_LCD_SSD1783 - bool "SSD1783 LCD support" - default y - select LCD - -endif diff --git a/configs/compal_e99/README.txt b/configs/compal_e99/README.txt deleted file mode 100644 index 646cdcf59cbcce2447ce30baa09ae035cd2f127e..0000000000000000000000000000000000000000 --- a/configs/compal_e99/README.txt +++ /dev/null @@ -1,81 +0,0 @@ -compal_e99 -========== - -This directory contains the board support for compal e99 phones. - -This port is based on patches contributed by Denis Carikli for both the -compal e99 and e88. At the time of initial check-in, the following phones -were tested: - -* Motorola c155 (compal e99) with the compalram and highram configuration -* Motorola W220 (compal e88) -* The openmoko freerunner baseband(compal e88) - -The patches were made by Alan Carvalho de Assis and Denis Carikli using -the Stefan Richter's patches that can be found here: - -http://cgit.osmocom.org/cgit/nuttx-bb/log/?h=lputt%2Ftesting - -Osmocom-BB Dependencies and Sercomm -=================================== - -The build environment assumes that you have the osmocom-bb project -directory at same level as the nuttx project: - - |- nuttx - |- apps - `- osmocom-bb - -If you attempt to build this configuration without osmocom-bb, and that -you added support for sercomm in your configuration(CONFIG_SERCOMM_CONSOLE=y) -you will get compilation errors in drivers/sercomm due to header files that -are needed from the osmocom-bb directory. - -By default, NuttX will not use sercomm (HDLC protocol) to communicate with -the host system. Sercomm is the transport used by osmocom-bb that runs on top -of serial. See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed -the usage of nuttx with sercomm. - -Loading NuttX -============= - -The osmocom-bb wiki describes how to load NuttX. See -http://bb.osmocom.org/trac/wiki/nuttx-bb for detailed information. -The way that nuttx is loaded depends on the configuration (highram/compalram) -and phone: - -o compalram is for the ramloader(for phone having a bootloader on flash) -o highram is for phones having the romloader(if the phone has a bootrom) - or for loading in the ram trough a special loader(loaded first on ram - by talking to the ramloader) when having a ramloader(which can only - load 64k). - -Configurations -============== - - 1. Each Compal E99 configuration is maintained in a sub-directory and - can be selected as follow: - - cd tools - ./configure.sh compal_e99/ - cd - - . ./setenv.sh - - Where is one of the configuration sub-directories under - nuttx/configs/compal_e99. - - 2. These configurations use the mconf-based configuration tool. To - change a configurations using that tool, you should: - - a. Build and install the kconfig-mconf tool. See nuttx/README.txt - see additional README.txt files in the NuttX tools repository. - - b. Execute 'make menuconfig' in nuttx/ in order to start the - reconfiguration process. - - 3. By default, all configurations assume the NuttX Buildroot toolchain - under Linux (should work under Windows with Cygwin as well). This - is easily reconfigured: - - CONFIG_HOST_LINUX=y - CONFIG_ARM_TOOLCHAIN_BUILDROOT=y diff --git a/configs/compal_e99/include/board.h b/configs/compal_e99/include/board.h deleted file mode 100644 index 5855614184f903ced3811fc4d695d505df80d09c..0000000000000000000000000000000000000000 --- a/configs/compal_e99/include/board.h +++ /dev/null @@ -1,6 +0,0 @@ -/**************************************************************************** - * arch/board.h - * - * Supposed to be empty - * - ****************************************************************************/ diff --git a/configs/compal_e99/nsh_compalram/Make.defs b/configs/compal_e99/nsh_compalram/Make.defs deleted file mode 100644 index ce04422ec83a1186bfa1b5fa4fdae7ea9772d872..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_compalram/Make.defs +++ /dev/null @@ -1,125 +0,0 @@ -############################################################################ -# configs/c5471evm/nsh/Make.defs -# -# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/compalram.ld}" -else - # Linux/Cygwin-native toolchain - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/compalram.ld -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(ARCHCCMAJOR),4) -ifneq ($(HOSTOS),Cygwin) - OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment -endif -endif - -ifeq ("${CONFIG_DEBUG_FEATURES}","y") - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ifeq ($(ARCHCCMAJOR),4) - ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -else - ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ - -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \ - -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif -ifeq ($(CONFIG_DEBUG_FEATURES),y) - LDFLAGS += -g -endif - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = diff --git a/configs/compal_e99/nsh_compalram/defconfig b/configs/compal_e99/nsh_compalram/defconfig deleted file mode 100644 index 919de8f67d9b1df8fda7a8a35182eb589a686582..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_compalram/defconfig +++ /dev/null @@ -1,845 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -CONFIG_DEBUG_ALERT=y -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -CONFIG_ARCH_CHIP_CALYPSO=y -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_KL is not set -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -CONFIG_ARCH_ARM7TDMI=y -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -# CONFIG_ARCH_CORTEXM0 is not set -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="arm" -CONFIG_ARCH_CHIP="calypso" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -# CONFIG_ARCH_LOWVECTORS is not set - -# -# ARM Configuration Options -# -CONFIG_ARM_TOOLCHAIN_BUILDROOT=y -# CONFIG_ARM_TOOLCHAIN_CODESOURCERYL is not set -# CONFIG_ARM_TOOLCHAIN_GNU_EABIL is not set -# CONFIG_ARM_TOOLCHAIN_GNU_OABI is not set -# CONFIG_ARM_OABI_TOOLCHAIN is not set -CONFIG_UART_IRDA_BAUD=115200 -CONFIG_UART_IRDA_PARITY=0 -CONFIG_UART_IRDA_BITS=8 -CONFIG_UART_IRDA_2STOP=0 -CONFIG_UART_IRDA_RXBUFSIZE=256 -CONFIG_UART_IRDA_TXBUFSIZE=256 -CONFIG_UART_MODEM_BAUD=115200 -CONFIG_UART_MODEM_PARITY=0 -CONFIG_UART_MODEM_BITS=8 -CONFIG_UART_MODEM_2STOP=0 -CONFIG_UART_MODEM_RXBUFSIZE=256 -CONFIG_UART_MODEM_TXBUFSIZE=256 - -# -# Calypso Configuration Options -# - -# -# Modem UART Configuration -# -# CONFIG_UART_MODEM_HWFLOWCONTROL is not set - -# -# IrDA UART Configuration -# -# CONFIG_UART_IRDA_HWFLOWCONTROL is not set -# CONFIG_USE_SERCOMM_CONSOLE is not set -# CONFIG_SERIAL_MODEM_CONSOLE is not set -# CONFIG_SERIAL_IRDA_CONSOLE is not set -CONFIG_SERIAL_CONSOLE_NONE=y - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -CONFIG_ARCH_HAVE_POWEROFF=y -# CONFIG_ARCH_HAVE_RESET is not set -CONFIG_ARCH_STACKDUMP=y -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=1250 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -# CONFIG_BOOT_RUNFROMFLASH is not set -CONFIG_BOOT_RUNFROMISRAM=y -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0 -CONFIG_RAM_SIZE=8650752 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -# CONFIG_ARCH_BOARD_COMPALE86 is not set -# CONFIG_ARCH_BOARD_COMPALE88 is not set -CONFIG_ARCH_BOARD_COMPALE99=y -# CONFIG_ARCH_BOARD_PIRELLI_DPL10 is not set -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="compal_e99" - -# -# Common Board Options -# -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -CONFIG_COMPALE99_LCD_SSD1783=y -CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_POWEROFF=y -# CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -# CONFIG_BOARDCTL_GRAPHICS is not set -# CONFIG_BOARDCTL_IOCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y -# CONFIG_DISABLE_ENVIRON is not set - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=13 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=1 -CONFIG_PREALLOC_TIMERS=8 - -# -# Tasks and Scheduling -# -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=200 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=16 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Pthread Options -# -# CONFIG_MUTEX_TYPES is not set -CONFIG_NPTHREAD_KEYS=4 - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -CONFIG_DEV_CONSOLE=y -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 -# CONFIG_MODULE is not set - -# -# Work queue support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set -# CONFIG_SCHED_LPWORK is not set - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=4096 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -CONFIG_LCD=y - -# -# Common Graphic LCD Settings -# -# CONFIG_LCD_CONSOLE is not set -# CONFIG_LCD_NOGETRUN is not set -CONFIG_LCD_MAXCONTRAST=63 -CONFIG_LCD_MAXPOWER=1 - -# -# Graphic LCD Devices -# -# CONFIG_LCD_P14201 is not set -# CONFIG_LCD_NOKIA6100 is not set -# CONFIG_LCD_MIO283QT2 is not set -# CONFIG_LCD_MIO283QT9A is not set -# CONFIG_LCD_UG9664HSWAG01 is not set -# CONFIG_LCD_UG2864HSWEG01 is not set -# CONFIG_LCD_UG2832HSWEG04 is not set -# CONFIG_LCD_SSD1351 is not set -# CONFIG_LCD_ST7565 is not set -# CONFIG_LCD_ST7567 is not set -# CONFIG_LCD_UG2864AMBAG01 is not set -# CONFIG_LCD_SSD1289 is not set -# CONFIG_LCD_SHARP_MEMLCD is not set -CONFIG_LCD_LANDSCAPE=y -# CONFIG_LCD_PORTRAIT is not set -# CONFIG_LCD_RPORTRAIT is not set -# CONFIG_LCD_RLANDSCAPE is not set -# CONFIG_LCD_ILI9341 is not set -# CONFIG_LCD_RA8875 is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -CONFIG_OTHER_UART_SERIALDRIVER=y -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_OTHER_SERIAL_CONSOLE=y -# CONFIG_NO_SERIAL_CONSOLE is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -CONFIG_SYSLOG_SERIAL_CONSOLE=y -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_CONSOLE=y -# CONFIG_SYSLOG_NONE is not set -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_FS_AUTOMOUNTER is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_TMPFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=2 -CONFIG_ARCH_HAVE_HEAP2=y -CONFIG_HEAP2_BASE=0x01000000 -CONFIG_HEAP2_SIZE=2097152 -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -CONFIG_BUILTIN=y -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_LIBM is not set -# CONFIG_NOPRINTF_FIELDWIDTH is not set -# CONFIG_LIBC_FLOATINGPOINT is not set -CONFIG_LIBC_LONG_LONG=y -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_LIBC_LOCALTIME is not set -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# -CONFIG_BUILTIN_PROXY_STACKSIZE=1024 - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_HELLO_PRIORITY=100 -CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=64 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_MAXARGUMENTS=6 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_BUILTIN_APPS=y - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_BASENAME is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_DIRNAME is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_POWEROFF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -CONFIG_NSH_DISABLE_SHUTDOWN=y -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNAME is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CMDOPT_DF_H=y -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 - -# -# Scripting Support -# -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/compal_e99/nsh_compalram/setenv.sh b/configs/compal_e99/nsh_compalram/setenv.sh deleted file mode 100755 index 16a2fe30fa842bb35b3a985e57bb4947ca1ec31f..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_compalram/setenv.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# c5471evm/nsh/setenv.sh -# -# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$_" = "$0" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -WD=`pwd` -if [ ! -x "setenv.sh" ]; then - echo "This script must be executed from the top-level NuttX build directory" - exit 1 -fi - -if [ -z "${PATH_ORIG}" ]; then - export PATH_ORIG="${PATH}" -fi - -# This is the Cygwin path to the location where I installed the CodeSourcery -# toolchain under windows. You will also have to edit this if you install -# the CodeSourcery toolchain in any other location -# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" - -# This is the Cygwin path to the location where I build the buildroot -# toolchain. -export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" - -# Add the path to the toolchain to the PATH varialble -export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" - -echo "PATH : ${PATH}" diff --git a/configs/compal_e99/nsh_highram/Make.defs b/configs/compal_e99/nsh_highram/Make.defs deleted file mode 100644 index 7eaac99e8bbe5337af304659eca785794736fa94..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_highram/Make.defs +++ /dev/null @@ -1,125 +0,0 @@ -############################################################################ -# configs/c5471evm/nsh/Make.defs -# -# Copyright (C) 2007, 2008, 2011, 2014 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/highram.ld}" -else - # Linux/Cygwin-native toolchain - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/highram.ld -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(ARCHCCMAJOR),4) -ifneq ($(HOSTOS),Cygwin) - OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment -endif -endif - -ifeq ("${CONFIG_DEBUG_FEATURES}","y") - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ifeq ($(ARCHCCMAJOR),4) - ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -else - ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ - -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld \ - -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif -ifeq ($(CONFIG_DEBUG_FEATURES),y) - LDFLAGS += -g -endif - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = diff --git a/configs/compal_e99/nsh_highram/defconfig b/configs/compal_e99/nsh_highram/defconfig deleted file mode 100644 index 282935437276a9b68ed34dc74ea07de7dbebd1bd..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_highram/defconfig +++ /dev/null @@ -1,986 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -CONFIG_DEBUG_ALERT=y -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -CONFIG_ARCH_CHIP_CALYPSO=y -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_KL is not set -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -CONFIG_ARCH_ARM7TDMI=y -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -# CONFIG_ARCH_CORTEXM0 is not set -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="arm" -CONFIG_ARCH_CHIP="calypso" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -# CONFIG_ARCH_LOWVECTORS is not set - -# -# ARM Configuration Options -# -# CONFIG_ARM_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARM_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y -# CONFIG_ARM_TOOLCHAIN_GNU_OABI is not set -CONFIG_UART_IRDA_BAUD=115200 -CONFIG_UART_IRDA_PARITY=0 -CONFIG_UART_IRDA_BITS=8 -CONFIG_UART_IRDA_2STOP=0 -CONFIG_UART_IRDA_RXBUFSIZE=256 -CONFIG_UART_IRDA_TXBUFSIZE=256 -CONFIG_UART_MODEM_BAUD=115200 -CONFIG_UART_MODEM_PARITY=0 -CONFIG_UART_MODEM_BITS=8 -CONFIG_UART_MODEM_2STOP=0 -CONFIG_UART_MODEM_RXBUFSIZE=256 -CONFIG_UART_MODEM_TXBUFSIZE=256 - -# -# Calypso Configuration Options -# - -# -# Modem UART Configuration -# -# CONFIG_UART_MODEM_HWFLOWCONTROL is not set - -# -# IrDA UART Configuration -# -# CONFIG_UART_IRDA_HWFLOWCONTROL is not set -# CONFIG_USE_SERCOMM_CONSOLE is not set -# CONFIG_SERIAL_MODEM_CONSOLE is not set -# CONFIG_SERIAL_IRDA_CONSOLE is not set -CONFIG_SERIAL_CONSOLE_NONE=y - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -CONFIG_ARCH_HAVE_POWEROFF=y -# CONFIG_ARCH_HAVE_RESET is not set -CONFIG_ARCH_STACKDUMP=y -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=1250 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -# CONFIG_BOOT_RUNFROMFLASH is not set -CONFIG_BOOT_RUNFROMISRAM=y -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0 -CONFIG_RAM_SIZE=8650752 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -# CONFIG_ARCH_BOARD_COMPALE86 is not set -# CONFIG_ARCH_BOARD_COMPALE88 is not set -CONFIG_ARCH_BOARD_COMPALE99=y -# CONFIG_ARCH_BOARD_PIRELLI_DPL10 is not set -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="compal_e99" - -# -# Common Board Options -# -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -CONFIG_COMPALE99_LCD_SSD1783=y -CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_POWEROFF=y -# CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -# CONFIG_BOARDCTL_GRAPHICS is not set -# CONFIG_BOARDCTL_IOCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y -# CONFIG_DISABLE_ENVIRON is not set - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=13 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=1 -CONFIG_PREALLOC_TIMERS=8 - -# -# Tasks and Scheduling -# -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=200 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=16 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Pthread Options -# -# CONFIG_MUTEX_TYPES is not set -CONFIG_NPTHREAD_KEYS=4 - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -CONFIG_DEV_CONSOLE=y -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 -# CONFIG_MODULE is not set - -# -# Work queue support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set -# CONFIG_SCHED_LPWORK is not set - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=4096 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -CONFIG_LCD=y - -# -# Common Graphic LCD Settings -# -# CONFIG_LCD_CONSOLE is not set -CONFIG_LCD_NOGETRUN=y -CONFIG_LCD_MAXCONTRAST=63 -CONFIG_LCD_MAXPOWER=1 - -# -# Graphic LCD Devices -# -# CONFIG_LCD_P14201 is not set -# CONFIG_LCD_NOKIA6100 is not set -# CONFIG_LCD_MIO283QT2 is not set -# CONFIG_LCD_MIO283QT9A is not set -# CONFIG_LCD_UG9664HSWAG01 is not set -# CONFIG_LCD_UG2864HSWEG01 is not set -# CONFIG_LCD_UG2832HSWEG04 is not set -# CONFIG_LCD_SSD1351 is not set -# CONFIG_LCD_ST7565 is not set -# CONFIG_LCD_ST7567 is not set -# CONFIG_LCD_UG2864AMBAG01 is not set -# CONFIG_LCD_SSD1289 is not set -# CONFIG_LCD_SHARP_MEMLCD is not set -CONFIG_LCD_LANDSCAPE=y -# CONFIG_LCD_PORTRAIT is not set -# CONFIG_LCD_RPORTRAIT is not set -# CONFIG_LCD_RLANDSCAPE is not set -# CONFIG_LCD_ILI9341 is not set -# CONFIG_LCD_RA8875 is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -CONFIG_OTHER_UART_SERIALDRIVER=y -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_OTHER_SERIAL_CONSOLE=y -# CONFIG_NO_SERIAL_CONSOLE is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -CONFIG_SYSLOG_SERIAL_CONSOLE=y -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_CONSOLE=y -# CONFIG_SYSLOG_NONE is not set -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_FS_AUTOMOUNTER is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_TMPFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -CONFIG_NX=y -CONFIG_NX_LCDDRIVER=y -CONFIG_NX_NPLANES=1 -CONFIG_NX_BGCOLOR=0x0 -CONFIG_NX_WRITEONLY=y -# CONFIG_NX_UPDATE is not set - -# -# Supported Pixel Depths -# -CONFIG_NX_DISABLE_1BPP=y -CONFIG_NX_DISABLE_2BPP=y -CONFIG_NX_DISABLE_4BPP=y -CONFIG_NX_DISABLE_8BPP=y -# CONFIG_NX_DISABLE_16BPP is not set -CONFIG_NX_DISABLE_24BPP=y -CONFIG_NX_DISABLE_32BPP=y -CONFIG_NX_PACKEDMSFIRST=y - -# -# Input Devices -# -# CONFIG_NX_XYINPUT is not set -CONFIG_NX_XYINPUT_NONE=y -# CONFIG_NX_XYINPUT_MOUSE is not set -# CONFIG_NX_XYINPUT_TOUCHSCREEN is not set -CONFIG_NX_KBD=y - -# -# Framed Window Borders -# -CONFIG_NXTK_BORDERWIDTH=4 -CONFIG_NXTK_DEFAULT_BORDERCOLORS=y -# CONFIG_NXTK_AUTORAISE is not set - -# -# Font Selections -# -CONFIG_NXFONTS_CHARBITS=7 -# CONFIG_NXFONT_MONO5X8 is not set -CONFIG_NXFONT_SANS17X22=y -# CONFIG_NXFONT_SANS20X26 is not set -# CONFIG_NXFONT_SANS23X27 is not set -# CONFIG_NXFONT_SANS22X29 is not set -# CONFIG_NXFONT_SANS28X37 is not set -# CONFIG_NXFONT_SANS39X48 is not set -# CONFIG_NXFONT_SANS17X23B is not set -# CONFIG_NXFONT_SANS20X27B is not set -# CONFIG_NXFONT_SANS22X29B is not set -# CONFIG_NXFONT_SANS28X37B is not set -# CONFIG_NXFONT_SANS40X49B is not set -# CONFIG_NXFONT_SERIF22X29 is not set -# CONFIG_NXFONT_SERIF29X37 is not set -# CONFIG_NXFONT_SERIF38X48 is not set -# CONFIG_NXFONT_SERIF22X28B is not set -# CONFIG_NXFONT_SERIF27X38B is not set -# CONFIG_NXFONT_SERIF38X49B is not set -# CONFIG_NXFONT_PIXEL_UNICODE is not set -# CONFIG_NXFONT_PIXEL_LCD_MACHINE is not set -# CONFIG_NXFONT_X11_MISC_FIXED_4X6 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_5X7 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_5X8 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X9 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X10 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X12 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X13 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X13B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_6X13O is not set -# CONFIG_NXFONT_X11_MISC_FIXED_7X13 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_7X13B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_7X13O is not set -# CONFIG_NXFONT_X11_MISC_FIXED_7X14 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_7X14B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_8X13 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_8X13B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_8X13O is not set -# CONFIG_NXFONT_X11_MISC_FIXED_9X15 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_9X15B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set -# CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set -# CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set -# CONFIG_NXTERM is not set - -# -# NX Multi-user only options -# -# CONFIG_NX_MULTIUSER is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=2 -CONFIG_ARCH_HAVE_HEAP2=y -CONFIG_HEAP2_BASE=0x01000000 -CONFIG_HEAP2_SIZE=2097152 -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -CONFIG_BUILTIN=y -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_LIBM is not set -# CONFIG_NOPRINTF_FIELDWIDTH is not set -# CONFIG_LIBC_FLOATINGPOINT is not set -CONFIG_LIBC_LONG_LONG=y -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_LIBC_LOCALTIME is not set -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# -CONFIG_BUILTIN_PROXY_STACKSIZE=1024 - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -CONFIG_EXAMPLES_KEYPADTEST=y -CONFIG_EXAMPLES_KEYPAD_DEVNAME="/dev/keypad" -# CONFIG_EXAMPLES_KEYPADTEST_ENCODED is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -CONFIG_EXAMPLES_NXHELLO=y -CONFIG_EXAMPLES_NXHELLO_VPLANE=0 -CONFIG_EXAMPLES_NXHELLO_DEVNO=0 -CONFIG_EXAMPLES_NXHELLO_BPP=16 - -# -# Example Color Configuration -# -CONFIG_EXAMPLES_NXHELLO_DEFAULT_COLORS=y - -# -# Example Font Configuration -# -CONFIG_EXAMPLES_NXHELLO_DEFAULT_FONT=y -# CONFIG_EXAMPLES_NXHELLO_EXTERNINIT is not set -CONFIG_EXAMPLES_NXIMAGE=y -CONFIG_EXAMPLES_NXIMAGE_VPLANE=0 -CONFIG_EXAMPLES_NXIMAGE_DEVNO=0 -CONFIG_EXAMPLES_NXIMAGE_BPP=16 -# CONFIG_EXAMPLES_NXIMAGE_GREYSCALE is not set -CONFIG_EXAMPLES_NXIMAGE_XSCALEp5=y -CONFIG_EXAMPLES_NXIMAGE_XSCALE1p0=y -# CONFIG_EXAMPLES_NXIMAGE_XSCALE1p5 is not set -# CONFIG_EXAMPLES_NXIMAGE_XSCALE2p0 is not set -CONFIG_EXAMPLES_NXIMAGE_YSCALEp5=y -CONFIG_EXAMPLES_NXIMAGE_YSCALE1p0=y -# CONFIG_EXAMPLES_NXIMAGE_YSCALE1p5 is not set -# CONFIG_EXAMPLES_NXIMAGE_YSCALE2p0 is not set -CONFIG_EXAMPLES_NXLINES=y -CONFIG_EXAMPLES_NXLINES_VPLANE=0 -CONFIG_EXAMPLES_NXLINES_DEVNO=0 -CONFIG_EXAMPLES_NXLINES_DEFAULT_COLORS=y -CONFIG_EXAMPLES_NXLINES_LINEWIDTH=4 -CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=2 -CONFIG_EXAMPLES_NXLINES_BPP=16 -# CONFIG_EXAMPLES_NXLINES_EXTERNINIT is not set -# CONFIG_EXAMPLES_NXTERM is not set -CONFIG_EXAMPLES_NXTEXT=y - -# -# Basic Configuration of the example -# -CONFIG_EXAMPLES_NXTEXT_VPLANE=0 -CONFIG_EXAMPLES_NXTEXT_DEVNO=0 -CONFIG_EXAMPLES_NXTEXT_BPP=16 -CONFIG_EXAMPLES_NXTEXT_BMCACHE=128 -CONFIG_EXAMPLES_NXTEXT_GLCACHE=16 - -# -# Example Color Configuration -# -CONFIG_EXAMPLES_NXTEXT_DEFAULT_COLORS=y - -# -# Example Font Configuration -# -# CONFIG_EXAMPLES_NXTEXT_DEFAULT_FONT is not set -CONFIG_EXAMPLES_NXTEXT_BGFONTID=14 -CONFIG_EXAMPLES_NXTEXT_PUFONTID=0 -# CONFIG_EXAMPLES_NXTEXT_EXTERNINIT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=64 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_MAXARGUMENTS=6 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_BUILTIN_APPS=y - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_BASENAME is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_DIRNAME is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_POWEROFF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -CONFIG_NSH_DISABLE_SHUTDOWN=y -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNAME is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CMDOPT_DF_H=y -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 - -# -# Scripting Support -# -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/compal_e99/nsh_highram/setenv.sh b/configs/compal_e99/nsh_highram/setenv.sh deleted file mode 100755 index 16a2fe30fa842bb35b3a985e57bb4947ca1ec31f..0000000000000000000000000000000000000000 --- a/configs/compal_e99/nsh_highram/setenv.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# c5471evm/nsh/setenv.sh -# -# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$_" = "$0" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -WD=`pwd` -if [ ! -x "setenv.sh" ]; then - echo "This script must be executed from the top-level NuttX build directory" - exit 1 -fi - -if [ -z "${PATH_ORIG}" ]; then - export PATH_ORIG="${PATH}" -fi - -# This is the Cygwin path to the location where I installed the CodeSourcery -# toolchain under windows. You will also have to edit this if you install -# the CodeSourcery toolchain in any other location -# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" -# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" - -# This is the Cygwin path to the location where I build the buildroot -# toolchain. -export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" - -# Add the path to the toolchain to the PATH varialble -export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" - -echo "PATH : ${PATH}" diff --git a/configs/compal_e99/scripts/compalram.ld b/configs/compal_e99/scripts/compalram.ld deleted file mode 100644 index 52554ddacbd796006bd074458c1cd7debec1e1f6..0000000000000000000000000000000000000000 --- a/configs/compal_e99/scripts/compalram.ld +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Linker script for running from internal SRAM on Compal phones - * - * This script is tailored specifically to the requirements imposed - * on us by the Compal bootloader. - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(__start) -MEMORY -{ - /* compal-loaded binary: our text, initialized data */ - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - /* compal-loaded binary: our unitialized data, stacks, heap */ - IRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00020000 -} -SECTIONS -{ - . = 0x800000; - - /* romloader data section, contains passthru interrupt vectors */ - .compal.loader (NOLOAD) : { . = 0x100; } > LRAM - - /* image signature (prepended by osmocon according to phone type) */ - .compal.header (NOLOAD) : { . = 4; } > LRAM - - /* initialization code */ - . = ALIGN(4); - .text.start : { - PROVIDE(__start = .); - KEEP(*(.text.start)) - *(.text.start) - } > LRAM - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > LRAM - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - . = ALIGN(4); - .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) : - AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) { - /* regular code */ - *(.text*) - /* always-in-ram code */ - *(.ramtext*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - . = ALIGN(4); - } > LRAM - PROVIDE(_text_start = LOADADDR(.text)); - PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > LRAM - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > LRAM - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - . = ALIGN(4); - .rodata : { - *(.rodata*) - } > LRAM - PROVIDE(_rodata_start = LOADADDR(.rodata)); - PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata)); - - /* initialized data */ - . = ALIGN(4); - .data : { - *(.data) - } > LRAM - PROVIDE(_data_start = LOADADDR(.data)); - PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data)); - - /* pic offset tables */ - . = ALIGN(4); - .got : { - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - } > LRAM - PROVIDE(_got_start = LOADADDR(.got)); - PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - __bss_start = .; - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - } > IRAM - . = ALIGN(4); - __bss_end = .; - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/compal_e99/scripts/highram.ld b/configs/compal_e99/scripts/highram.ld deleted file mode 100644 index db72f251aa26cca2f27c9257ee797195715016b2..0000000000000000000000000000000000000000 --- a/configs/compal_e99/scripts/highram.ld +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Linker script for running from internal SRAM on Compal phones - * - * This script is tailored specifically to the requirements imposed - * on us by the Compal bootloader. - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(__start) -MEMORY -{ - /* 0x800000-0xa00000 */ - /* compal-loaded binary: our text, initialized data */ - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - TRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x0001d000 - /* compal-loaded binary: our unitialized data, stacks, heap */ - IRAM (rw) : ORIGIN = 0x0083d000, LENGTH = 0x00002000 -} -SECTIONS -{ - . = 0x800000; - - /* romloader data section, contains passthru interrupt vectors */ - .compal.loader (NOLOAD) : { . = 0x100; } > LRAM - - /* image signature (prepended by osmocon according to phone type) */ - .compal.header (NOLOAD) : { . = 4; } > LRAM - - /* initialization code */ - . = ALIGN(4); - .text.start : { - PROVIDE(__start = .); - KEEP(*(.text.start)) - *(.text.start) - } > TRAM - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > LRAM - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - . = ALIGN(4); - .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) : - AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) { - /* regular code */ - *(.text*) - /* always-in-ram code */ - *(.ramtext*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - . = ALIGN(4); - } > TRAM - PROVIDE(_text_start = LOADADDR(.text)); - PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > TRAM - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - . = ALIGN(4); - .rodata : { - *(.rodata*) - } > TRAM - PROVIDE(_rodata_start = LOADADDR(.rodata)); - PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata)); - - /* initialized data */ - . = ALIGN(4); - .data : { - *(.data) - } > TRAM - PROVIDE(_data_start = LOADADDR(.data)); - PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data)); - - /* pic offset tables */ - . = ALIGN(4); - .got : { - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - } > TRAM - PROVIDE(_got_start = LOADADDR(.got)); - PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - __bss_start = .; - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - } > IRAM - . = ALIGN(4); - __bss_end = .; - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/compal_e99/src/.gitignore b/configs/compal_e99/src/.gitignore deleted file mode 100644 index 726d936e1e3390cc875a1fa5681e3c3988fe3c8b..0000000000000000000000000000000000000000 --- a/configs/compal_e99/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.depend -/Make.dep diff --git a/configs/compal_e99/src/Makefile b/configs/compal_e99/src/Makefile deleted file mode 100644 index c2ad1cc7769a060f256f740dc2f64982393d96b9..0000000000000000000000000000000000000000 --- a/configs/compal_e99/src/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# configs/compal_e99/src/Makefile -# -# Copyright (C) 2007, 2008, 2015 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Copyright (C) 2011 Stefan Richter. All rights reserved. -# Author: Stefan Richter -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - --include $(TOPDIR)/Make.defs - -ASRCS = -CSRCS = boot.c ssd1783.c - -include $(TOPDIR)/configs/Board.mk diff --git a/configs/compal_e99/src/ssd1783.c b/configs/compal_e99/src/ssd1783.c deleted file mode 100644 index 75725fc9204ba713058e846c136cce20039fd6f3..0000000000000000000000000000000000000000 --- a/configs/compal_e99/src/ssd1783.c +++ /dev/null @@ -1,542 +0,0 @@ -/************************************************************************************ - * nuttx/configs/compal_e99/src/ssd1783.c - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * Laurent Latil - * Denis 'GNUtoo' Carikli - * Alan Carvalho de Assis - * - * This driver for SSD1783 used part of SSD1783 driver developed by - * Christian Vogel for Osmocom-BB and relicensed - * to BSD with permission from author. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "up_arch.h" -#include "ssd1783.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Color depth and format */ - -#define LCD_BPP 16 -#define LCD_COLORFMT FB_FMT_RGB16_555 - -/* Display Resolution */ - -#define LCD_XRES 98 -#define LCD_YRES 67 - -/* This should be put elsewhere */ - -#ifdef __CC_ARM /* ARM Compiler */ -#define lcd_inline static __inline -#elif defined (__ICCARM__) /* for IAR Compiler */ -#define lcd_inline inline -#elif defined (__GNUC__) /* GNU GCC Compiler */ -#define lcd_inline static __inline -#else -#define lcd_inline static -#endif - -static void lcd_clear(void); -static void fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p); - -/* LCD Data Transfer Methods */ -int lcd_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, - size_t npixels); -int lcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, - size_t npixels); - -/* LCD Configuration */ -static int lcd_getvideoinfo(FAR struct lcd_dev_s *dev, - FAR struct fb_videoinfo_s *vinfo); -static int lcd_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, - FAR struct lcd_planeinfo_s *pinfo); - -/* LCD RGB Mapping */ -#ifdef CONFIG_FB_CMAP -# error "RGB color mapping not supported by this driver" -#endif - -/* Cursor Controls */ -#ifdef CONFIG_FB_HWCURSOR -# error "Cursor control not supported by this driver" -#endif - -/* LCD Specific Controls */ -static int lcd_getpower(struct lcd_dev_s *dev); -static int lcd_setpower(struct lcd_dev_s *dev, int power); -static int lcd_getcontrast(struct lcd_dev_s *dev); -static int lcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast); - -/* Initialization (LCD ctrl / backlight) */ -static inline void lcd_initialize(void); - -/************************************************************************************** - * Private Data - **************************************************************************************/ - -/* This is working memory allocated by the LCD driver for each LCD device - * and for each color plane. This memory will hold one raster line of data. - * The size of the allocated run buffer must therefore be at least - * (bpp * xres / 8). Actual alignment of the buffer must conform to the - * bitwidth of the underlying pixel type. - * - * If there are multiple planes, they may share the same working buffer - * because different planes will not be operate on concurrently. However, - * if there are multiple LCD devices, they must each have unique run buffers. - */ - -static uint16_t g_runbuffer[LCD_XRES]; - -/* This structure describes the overall LCD video controller */ - -static const struct fb_videoinfo_s g_videoinfo = -{ - .fmt = LCD_COLORFMT, /* Color format: RGB16-565: RRRR RGGG GGGB BBBB */ - .xres = LCD_XRES, /* Horizontal resolution in pixel columns */ - .yres = LCD_YRES, /* Vertical resolutiSend a command list to the LCD panelon in pixel rows */ - .nplanes = 1, /* Number of color planes supported */ -}; - -/* This is the standard, NuttX Plane information object */ - -static const struct lcd_planeinfo_s g_planeinfo = -{ - .putrun = lcd_putrun, /* Put a run into LCD memory */ -// .getrun = lcd_getrun, /* Get a run from LCD memory */ - .buffer = (uint8_t*) g_runbuffer, /* Run scratch buffer */ - .bpp = LCD_BPP, /* Bits-per-pixel */ -}; - -/* This is the standard, NuttX LCD driver object */ - -static struct ssd1783_dev_s g_lcddev = -{ - .dev = - { - /* LCD Configuration */ - - .getvideoinfo = lcd_getvideoinfo, - .getplaneinfo = lcd_getplaneinfo, - -/* LCD RGB Mapping -- Not supported */ -/* Cursor Controls -- Not supported */ - -/* LCD Specific Controls */ - .getpower = lcd_getpower, - .setpower = lcd_setpower, -// .getcontrast = lcd_getcontrast, -// .setcontrast = lcd_setcontrast, - }, - .power=0 -}; - -/* we trust gcc to move this expensive bitshifting out of - * the loops in the drawing funtcions - */ - -static uint8_t rgb_to_pixel(uint16_t color) -{ - uint8_t ret; - - ret = (FB_COLOR_TO_R(color) & 0xe0); /* 765 = RRR */ - ret |= (FB_COLOR_TO_G(color) & 0xe0) >> 3; /* 432 = GGG */ - ret |= (FB_COLOR_TO_B(color) & 0xc0) >> 6; /* 10 = BB */ - - return ret; -} - -/* somehow the palette is messed up, RRR seems to have the - * bits reversed! R0 R1 R2 G G G B B ---> R2 R1 R0 G G G B B - */ - -uint8_t fix_rrr(uint8_t v) -{ - return (v & 0x5f) | (v & 0x80) >> 2 | (v & 0x20) << 2; -} - - -lcd_inline void write_data(uint16_t datain) -{ - uint16_t dataout = 0x0100 | fix_rrr(rgb_to_pixel(datain)); - uwire_xfer(SSD1783_DEV_ID,SSD1783_UWIRE_BITLEN,&dataout, NULL); -} - -static void fb_ssd1783_send_cmdlist(const struct ssd1783_cmdlist *p) -{ - int i=0; - - while (p->is_cmd != END) - { - uint16_t sendcmd = p->data; - if (p->is_cmd == DATA) - { - sendcmd |= 0x0100; /* 9th bit is cmd/data flag */ - } - - uwire_xfer(SSD1783_DEV_ID, SSD1783_UWIRE_BITLEN, &sendcmd, NULL); - p++; - i++; - } -} - -static void lcd_write_prepare(unsigned int x1, unsigned int x2, unsigned int y1, unsigned int y2) -{; - DEBUGASSERT( (x1 < x2 )&& (y1 < y2)); - struct ssd1783_cmdlist prepare_disp_write_cmds[] = { - { CMD, 0x15 }, /* set column address */ - { DATA, x1 }, - { DATA, x2 }, - { CMD, 0x75 }, /* set page address (Y) */ - { DATA, y1 }, - { DATA, y2 }, - { CMD, 0x5c }, /* enter write display ram mode */ - { END, 0x00 } - }; - - _info("x1:%d, x2:%d, y1:%d, y2:%d\n",x1, x2,y1, y2); - fb_ssd1783_send_cmdlist(prepare_disp_write_cmds); -} - -/************************************************************************************** - * Name: lcd_putrun - * - * Description: - * This method can be used to write a partial raster line to the LCD: - * - * row - Starting row to write to (range: 0 <= row < yres) - * col - Starting column to write to (range: 0 <= col <= xres-npixels) - * buffer - The buffer containing the run to be written to the LCD - * npixels - The number of pixels to write to the LCD - * (range: 0 < npixels <= xres-col) - * - **************************************************************************************/ - -int lcd_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, - size_t npixels) -{ - int i; - FAR const uint16_t *src = (FAR const uint16_t*) buffer; - - /* Buffer must be provided and aligned to a 16-bit address boundary */ - DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0); - - - /* Write the run to GRAM. */ - lcd_write_prepare(col,col+npixels, row,row+1); - - for (i = 0; i < npixels; i++) - { - write_data(*src++); - } - fb_ssd1783_send_cmdlist(nop); - - return OK; -} - -/************************************************************************************** - * Name: lcd_getrun - * - * Description: - * This method can be used to read a partial raster line from the LCD: - * - * row - Starting row to read from (range: 0 <= row < yres) - * col - Starting column to read read (range: 0 <= col <= xres-npixels) - * buffer - The buffer in which to return the run read from the LCD - * npixels - The number of pixels to read from the LCD - * (range: 0 < npixels <= xres-col) - * - **************************************************************************************/ - -int lcd_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, - size_t npixels) -{ - ginfo("Not implemented\n"); - return -ENOSYS; -} - -/************************************************************************************** - * Name: lcd_getvideoinfo - * - * Description: - * Get information about the LCD video controller configuration. - * - **************************************************************************************/ - -static int lcd_getvideoinfo(FAR struct lcd_dev_s *dev, - FAR struct fb_videoinfo_s *vinfo) -{ - DEBUGASSERT(dev && vinfo);ginfo("fmt: %d xres: %d yres: %d nplanes: %d\n", - g_videoinfo.fmt, g_videoinfo.xres, g_videoinfo.yres, g_videoinfo.nplanes); - memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s)); - return OK; -} - -/************************************************************************************** - * Name: lcd_getplaneinfo - * - * Description: - * Get information about the configuration of each LCD color plane. - * - **************************************************************************************/ - -static int lcd_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, - FAR struct lcd_planeinfo_s *pinfo) -{ - DEBUGASSERT(dev && pinfo && planeno == 0);ginfo("planeno: %d bpp: %d\n", planeno, g_planeinfo.bpp); - memcpy(pinfo, &g_planeinfo, sizeof(struct lcd_planeinfo_s)); - return OK; -} - -/************************************************************************************** - * Name: lcd_getpower - * - * Description: - * Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: full on). On - * backlit LCDs, this setting may correspond to the backlight setting. - * - **************************************************************************************/ - -static int lcd_getpower(struct lcd_dev_s *dev) -{ - ginfo("power: %d\n", 0); - return g_lcddev.power; -} - -/************************************************************************************** - * Name: lcd_setpower - * - * Description: - * Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: full on). - * Used here to set pwm duty on timer used for backlight. - * - **************************************************************************************/ - -static int lcd_setpower(struct lcd_dev_s *dev, int power) -{ - uint16_t reg; - - if (g_lcddev.power == power) { - return OK; - } - - ginfo("power: %d\n", power); - DEBUGASSERT(power <= CONFIG_LCD_MAXPOWER); - - /* Set new power level */ - reg = getreg16(ASIC_CONF_REG); - if (power) - { - reg = getreg16(ASIC_CONF_REG); - /* LCD Set I/O(3) / SA0 to I/O(3) mode */ - reg &= ~( (1 << 12) | (1 << 10) | (1 << 7) | (1 << 1)) ; - /* don't set function pins to I2C Mode, C155 uses UWire */ - /* TWL3025: Set SPI+RIF RX clock to rising edge */ - reg |= (1 << 13) | (1 << 14); - putreg16(reg, ASIC_CONF_REG); - - /* LCD Set I/O(3) to output mode and enable C155 backlight (IO1) */ - /* FIXME: Put the display backlight control to backlight.c */ - reg = getreg16(IO_CNTL_REG); - reg &= ~( (1 << 3) | (1 << 1)); - putreg16(reg, IO_CNTL_REG); - - /* LCD Set I/O(3) output low */ - reg = getreg16(ARMIO_LATCH_OUT); - reg &= ~(1 << 3); - reg |= (1 << 1); - putreg16(reg, ARMIO_LATCH_OUT); - } - else - { - ginfo("powering LCD off...\n"); - /* Switch pin from PWL to LT */ - reg &= ~ASCONF_PWL_ENA; - putreg8(reg, ASIC_CONF_REG); - /* Disable pwl */ - putreg8(0x00, PWL_REG(PWL_CTRL)); - } - return OK; -} - - -/************************************************************************************** - * Name: lcd_getcontrast - * - * Description: - * Get the current contrast setting (0-CONFIG_LCD_MAXCONTRAST). - * - **************************************************************************************/ - -static int lcd_getcontrast(struct lcd_dev_s *dev) -{ - ginfo("Not implemented\n"); - return -ENOSYS; -} - -/************************************************************************************** - * Name: lcd_setcontrast - * - * Description: - * Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST). - * - **************************************************************************************/ - -static int lcd_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) -{ - ginfo("Not implemented\n"); - return -ENOSYS; -} - -/************************************************************************************** - * Name: lcd_lcdinitialize - * - * Description: - * Set LCD panel contrast (0-CONFIG_LCD_MAXCONTRAST). - * - **************************************************************************************/ -static inline void lcd_initialize(void) -{ - ginfo("%s: initializing LCD.\n",__FUNCTION__); - calypso_reset_set(RESET_EXT, 0); - usleep(5000); - uwire_init(); - usleep(5000); - fb_ssd1783_send_cmdlist(ssd1783_initdata); -} - -/************************************************************************************** - * Public Functions - **************************************************************************************/ - - -/************************************************************************************** - * Name: board_lcd_initialize - * - * Description: - * Initialize the LCD video hardware. The initial state of the LCD is fully - * initialized, display memory cleared, and the LCD ready to use, but with the power - * setting at 0 (full off). - * - **************************************************************************************/ - -int board_lcd_initialize(void) -{ - ginfo("Initializing\n"); - - lcd_initialize(); - - /* Clear the display */ - lcd_clear(); - - return OK; -} - -/************************************************************************************** - * Name: board_lcd_getdev - * - * Description: - * Return a a reference to the LCD object for the specified LCD. This allows support - * for multiple LCD devices. - * - **************************************************************************************/ - -FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) -{ - DEBUGASSERT(lcddev == 0); - return &g_lcddev.dev; -} - - -/************************************************************************************** - * Name: board_lcd_uninitialize - * - * Description: - * Un-initialize the LCD support - * - **************************************************************************************/ - -void board_lcd_uninitialize(void) -{ - lcd_setpower(&g_lcddev.dev, 0); -} - -/************************************************************************************** - * Name: lcd_clear - * - * Description: - * Fill the LCD ctrl memory with given color - * - **************************************************************************************/ - -void lcd_clear() -{ - struct ssd1783_cmdlist prepare_disp_write_cmds[] = - { - { CMD, 0x8E }, - { DATA, 0x00 }, - { DATA, 0x00 }, - { DATA, LCD_XRES }, - { DATA, LCD_YRES }, - { END, 0x00 } - }; - - struct ssd1783_cmdlist nop_command[] = - { - { CMD, 0x25 }, // NOP command - { END, 0x00 } - }; - - fb_ssd1783_send_cmdlist(prepare_disp_write_cmds); - fb_ssd1783_send_cmdlist(nop_command); -} diff --git a/configs/compal_e99/src/ssd1783.h b/configs/compal_e99/src/ssd1783.h deleted file mode 100644 index 50ec44925909b81b61924e45f279bffaa0608dfa..0000000000000000000000000000000000000000 --- a/configs/compal_e99/src/ssd1783.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef SSD1783_H_ -#define SSD1783_H_ - -#include - -#define FB_COLOR_TO_R(v) (((v)>>16) & 0xff) -#define FB_COLOR_TO_G(v) (((v)>> 8) & 0xff) -#define FB_COLOR_TO_B(v) ( (v) & 0xff) - -#define SSD1783_UWIRE_BITLEN 9 -#define SSD1783_DEV_ID 0 - -#define ARMIO_LATCH_OUT 0xfffe4802 -#define IO_CNTL_REG 0xfffe4804 -#define ASIC_CONF_REG 0xfffef008 - -#define ASCONF_PWL_ENA (1 << 4) - -/* begin backlight.c */ -#define BASE_ADDR_PWL 0xfffe8000 -#define PWL_REG(m) (BASE_ADDR_PWL + (m)) - -enum pwl_reg { - PWL_LEVEL = 0, - PWL_CTRL = 1, -}; - -enum ssd1783_cmdflag { CMD, DATA, END }; - -struct ssd1783_cmdlist { - enum ssd1783_cmdflag is_cmd:8; /* 1: is a command, 0: is data, 2: end marker! */ - uint8_t data; /* 8 bit to send to LC display */ -} __attribute__((packed)); - -static const struct ssd1783_cmdlist nop[] = { - { CMD, 0x25 }, // NOP command - { END, 0x00 } -}; - -static const struct ssd1783_cmdlist -ssd1783_initdata[] = { - { CMD, 0xD1 }, /* CMD set internal oscillator on */ - { CMD, 0x94 }, /* CMD leave sleep mode */ - { CMD, 0xbb }, /* CMD Set COM Output Scan Direction: */ - { DATA, 0x01 }, /* DATA: 01: COM0-79, then COM159-80 */ -/* -------- DIFFERENT FROM ORIGINAL CODE: -------------- */ -/* we use 8bit per pixel packed RGB 332 */ - { CMD, 0xbc }, /* CMD Set Data Output Scan Direction */ - { DATA, 0x00 }, /* DATA: column scan, normal rotation, normal display */ - { DATA, 0x00 }, /* DATA: RGB color arrangement R G B R G B ... */ -/*-->*/ { DATA, 0x01 }, /* DATA: 8 bit per pixel mode MSB LSB */ -/* --------- /DIFFERENT ---------- */ - { CMD, 0xce }, /* CMD Set 256 Color Look Up Table LUT */ - { DATA, 0x00 }, /* DATA red 000 */ - { DATA, 0x03 }, /* DATA red 001 */ - { DATA, 0x05 }, /* DATA red 010 */ - { DATA, 0x07 }, /* DATA red 011 */ - { DATA, 0x09 }, /* DATA red 100 */ - { DATA, 0x0b }, /* DATA red 101 */ - { DATA, 0x0d }, /* DATA red 110 */ - { DATA, 0x0f }, /* DATA red 111 */ - { DATA, 0x00 }, /* DATA green 000 */ - { DATA, 0x03 }, /* DATA green 001 */ - { DATA, 0x05 }, /* DATA green 010 */ - { DATA, 0x07 }, /* DATA green 011 */ - { DATA, 0x09 }, /* DATA green 100 */ - { DATA, 0x0b }, /* DATA green 101 */ - { DATA, 0x0d }, /* DATA green 110 */ - { DATA, 0x0f }, /* DATA green 111 */ - { DATA, 0x00 }, /* DATA blue 00 */ - { DATA, 0x05 }, /* DATA blue 01 */ - { DATA, 0x0a }, /* DATA blue 10 */ - { DATA, 0x0f }, /* DATA blue 11 */ - { CMD, 0xca }, /* CMD Set Display Control - Driver Duty Selection */ - { DATA, 0xff }, // can't find description of the values in the original - { DATA, 0x10 }, // display/ssd1783.c in my datasheet :-( - { DATA, 0x01 }, // - { CMD, 0xab }, /* CMD Set Scroll Start */ - { DATA, 0x00 }, /* DATA: Starting address at block 0 */ - { CMD, 0x20 }, /* CMD Set power control register */ - { DATA, 0x0b }, /* DATA: booster 6x, reference gen. & int regulator */ - { CMD, 0x81 }, /* CMD Contrast Lvl & Int. Regul. Resistor Ratio */ - { DATA, 0x29 }, /* DATA: contrast = 0x29 */ - { DATA, 0x05 }, /* DATA: 0x05 = 0b101 -> 1+R2/R1 = 11.37 */ - { CMD, 0xa7 }, /* CMD Invert Display */ - { CMD, 0x82 }, /* CMD Set Temperature Compensation Coefficient */ - { DATA, 0x00 }, /* DATA: Gradient is -0.10 % / degC */ - { CMD, 0xfb }, /* CMD Set Biasing Ratio */ - { DATA, 0x03 }, /* DATA: 1/10 bias */ - { CMD, 0xf2 }, /* CMD Set Frame Frequency and N-line inversion */ - { DATA, 0x08 }, /* DATA: 75 Hz (POR) */ - { DATA, 0x06 }, /* DATA: n-line inversion: 6 lines */ - { CMD, 0xf7 }, /* CMD Select PWM/FRC Select Full Col./8col mode */ - { DATA, 0x28 }, /* DATA: always 0x28 */ - { DATA, 0x8c }, /* DATA: 4bit PWM + 2 bit FRC */ - { DATA, 0x05 }, /* DATA: full color mode */ - { CMD, 0xaf }, /* CMD Display On */ - { END, 0x00 }, /* MARKER: end of list */ -}; - -struct ssd1783_dev_s -{ - /* Publicly visible device structure */ - struct lcd_dev_s dev; - - /* Private LCD-specific information follows */ - uint8_t power; /* Current power setting */ -}; - -#endif /* SSD1783_H_ */ diff --git a/configs/demo9s12ne64/ostest/defconfig b/configs/demo9s12ne64/ostest/defconfig index 42c0db51c7b86005a1072617de90b314b8636c25..c5f77d58a5f4ea8e7eddcbc238d1aba5e48c504f 100644 --- a/configs/demo9s12ne64/ostest/defconfig +++ b/configs/demo9s12ne64/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set CONFIG_ARCH_HC=y # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -243,7 +242,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -412,7 +410,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/dk-tm4c129x/README.txt b/configs/dk-tm4c129x/README.txt index 138e69cd3e8c12113efb3c1fff0ce75484923e59..bf81eb4f73bfc3328dc943c1949f208ecd2b9a34 100644 --- a/configs/dk-tm4c129x/README.txt +++ b/configs/dk-tm4c129x/README.txt @@ -226,9 +226,7 @@ Networking Support Networking Support CONFIG_NET=y : Enable Neworking CONFIG_NET_ETHERNET=y : Support Ethernet data link - CONFIG_NET_NOINTS=y : Should operative at non-interrupt level CONFIG_NET_SOCKOPTS=y : Enable socket operations - CONFIG_NET_MULTIBUFFER=y : Multi-packet buffer option required CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU CONFIG_NET_ARP=y : Enable ARP diff --git a/configs/dk-tm4c129x/ipv6/defconfig b/configs/dk-tm4c129x/ipv6/defconfig index 31725598d3722cea79c23c1c4bcab3c435357641..83644a89c477414fbfabcee62ca2e7462a860f11 100644 --- a/configs/dk-tm4c129x/ipv6/defconfig +++ b/configs/dk-tm4c129x/ipv6/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -368,8 +366,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -566,10 +562,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_ARCH_PHY_INTERRUPT=y # CONFIG_PIPES is not set # CONFIG_PM is not set @@ -601,7 +596,6 @@ CONFIG_LM75_I2C_FREQUENCY=100000 # CONFIG_VEML6070 is not set # CONFIG_XEN1210 is not set # CONFIG_ZEROCROSS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -678,13 +672,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -920,7 +912,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -956,7 +947,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/dk-tm4c129x/nsh/defconfig b/configs/dk-tm4c129x/nsh/defconfig index 86d440f9e45649953f81011c71663a28bc33e1f4..c9a9edac93a490fb54599193ae970031cdfa2317 100644 --- a/configs/dk-tm4c129x/nsh/defconfig +++ b/configs/dk-tm4c129x/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -368,8 +366,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -568,10 +564,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_ARCH_PHY_INTERRUPT=y # CONFIG_PIPES is not set # CONFIG_PM is not set @@ -603,7 +598,6 @@ CONFIG_LM75_I2C_FREQUENCY=100000 # CONFIG_VEML6070 is not set # CONFIG_XEN1210 is not set # CONFIG_ZEROCROSS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -680,13 +674,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -930,7 +922,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -966,7 +957,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ea3131/nsh/defconfig b/configs/ea3131/nsh/defconfig index 3d086897d1e60d4c2087daffad7639f93acc5322..b98a0b0c962f7d9bbfb2d346988e888840e058c7 100644 --- a/configs/ea3131/nsh/defconfig +++ b/configs/ea3131/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -258,8 +256,6 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -422,7 +418,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -661,7 +656,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ea3131/pgnsh/defconfig b/configs/ea3131/pgnsh/defconfig index 923ad083f16d5d71cfe6f633fcedd4609c1036c5..8bb8ce290389d986428ef2f839b74a8a53f27890 100644 --- a/configs/ea3131/pgnsh/defconfig +++ b/configs/ea3131/pgnsh/defconfig @@ -67,7 +67,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -280,8 +278,6 @@ CONFIG_EA3131_PAGING_SPIPORT=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -498,7 +494,6 @@ CONFIG_M25P_MEMORY_TYPE=0x20 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -737,7 +732,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ea3131/usbserial/defconfig b/configs/ea3131/usbserial/defconfig index 069331dd50972d2cd870f78779763fa9fdf53746..cf79f1ff54da5bedc960ad56c25753d58bf9b615 100644 --- a/configs/ea3131/usbserial/defconfig +++ b/configs/ea3131/usbserial/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -266,8 +264,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -435,7 +431,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y CONFIG_SERIAL_REMOVABLE=y @@ -697,7 +692,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ea3152/ostest/defconfig b/configs/ea3152/ostest/defconfig index ee7349d7cb46f040241a946ddd4252bd55b3c663..5222be557c716bc075d7634388ff835a9fae6637 100644 --- a/configs/ea3152/ostest/defconfig +++ b/configs/ea3152/ostest/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -415,7 +413,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -639,7 +636,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/eagle100/httpd/defconfig b/configs/eagle100/httpd/defconfig index 970592833478e60a4484ce168c5d35afaed1ce4f..10e1481b202fe3bd200e054f218eb5ecda12deed 100644 --- a/configs/eagle100/httpd/defconfig +++ b/configs/eagle100/httpd/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -258,6 +256,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set CONFIG_TIVA_BOARDMAC=y @@ -415,6 +414,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -423,13 +423,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -522,15 +526,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -606,13 +607,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -857,7 +856,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/eagle100/nettest/defconfig b/configs/eagle100/nettest/defconfig index 5d908c3893c0198950057c7cc0aec75d4306fcc9..2b2d08c871f7db7f113534e13059a9a2e838a5e3 100644 --- a/configs/eagle100/nettest/defconfig +++ b/configs/eagle100/nettest/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -258,6 +256,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set CONFIG_TIVA_BOARDMAC=y @@ -409,6 +408,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -416,13 +416,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -514,15 +518,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -598,13 +599,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -862,7 +861,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/eagle100/nsh/defconfig b/configs/eagle100/nsh/defconfig index 3551825edb6b3df256e15595bdaf84e5d4e38fd1..31736a4493b3d5cdcd4ce4694df194f7d70e02ca 100644 --- a/configs/eagle100/nsh/defconfig +++ b/configs/eagle100/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -258,6 +256,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set CONFIG_TIVA_BOARDMAC=y @@ -346,8 +345,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -422,6 +419,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -430,6 +428,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -441,8 +440,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -555,15 +557,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -640,13 +639,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -926,7 +923,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/eagle100/nxflat/defconfig b/configs/eagle100/nxflat/defconfig index 26d9a50f20ae0de23bc1c0678844708b712e5830..1d55be1648ad83e9b1a45aad55e2201cabec35c7 100644 --- a/configs/eagle100/nxflat/defconfig +++ b/configs/eagle100/nxflat/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -485,7 +483,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -711,7 +708,6 @@ CONFIG_EXAMPLES_NXFLAT=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/eagle100/thttpd/defconfig b/configs/eagle100/thttpd/defconfig index 7b2287eaf1250decc543551d07a04afbf8d96aa9..e0e7a25e9f0d54a5718375ae12bd0ed78bf820aa 100644 --- a/configs/eagle100/thttpd/defconfig +++ b/configs/eagle100/thttpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -251,6 +249,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set CONFIG_TIVA_BOARDMAC=y @@ -402,6 +401,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -409,13 +409,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -507,10 +511,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_PIPES=y CONFIG_DEV_PIPE_MAXSIZE=1024 CONFIG_DEV_PIPE_SIZE=1024 @@ -518,7 +520,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -594,13 +595,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -859,7 +858,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index 4a0b9d4bec054c21d93527606036bdabaa84b36f..4c7b62ce8bebb7181b0f74767c6b385096581115 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set CONFIG_ARCH_CHIP_EFM32=y # CONFIG_ARCH_CHIP_IMX1 is not set @@ -459,7 +457,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -666,7 +663,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/efm32gg-stk3700/nsh/defconfig b/configs/efm32gg-stk3700/nsh/defconfig index 1de3b218cdb7b54b3e2ea6ce38656cf763c676fe..db3dbf7aa9051e75f13ab5e8115672bc4c649469 100644 --- a/configs/efm32gg-stk3700/nsh/defconfig +++ b/configs/efm32gg-stk3700/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set CONFIG_ARCH_CHIP_EFM32=y # CONFIG_ARCH_CHIP_IMX1 is not set @@ -459,7 +457,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -666,7 +663,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ekk-lm3s9b96/nsh/defconfig b/configs/ekk-lm3s9b96/nsh/defconfig index d1f6d9bf570f43ada5a0b4d653a861a7b89fc4a9..cca7bc60c5b2fa62d698307c7b6831e0357c1a57 100644 --- a/configs/ekk-lm3s9b96/nsh/defconfig +++ b/configs/ekk-lm3s9b96/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -253,6 +251,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set # CONFIG_TIVA_BOARDMAC is not set @@ -335,8 +334,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -411,6 +408,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -419,6 +417,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -430,8 +429,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -544,15 +546,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -629,13 +628,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -916,7 +913,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/esp32-core/Kconfig b/configs/esp32-core/Kconfig index 3f73b4052a2a2279a9d3e393bee6b25f7d87070d..79656051e9965e14bde320f818269935cb435032 100644 --- a/configs/esp32-core/Kconfig +++ b/configs/esp32-core/Kconfig @@ -23,8 +23,19 @@ config ESP32CORE_RUN_IRAM ---help--- The default configuration is set up run from IRAM. However, the current (2016-11-14) OpenOCD for ESP32 does not support writing to - FLASH. This option sets up the liner scripts to support execution + FLASH. This option sets up the linker scripts to support execution from IRAM. In this case, OpenOCD can be used to load directly into IRAM. + At this stage the nuttx image is small enough to be entirely memory- + resident. Once board support is more mature you can add flash cache + mapping code to run from SPI flash after initial boot. There are at + least two possible approaches you could take: You can add the flash + cache mapping code into nuttx directly, so it is self-contained - + early nuttx initialisation runs from IRAM and enables flash cache, + and then off you go. Or you can use the esp-idf software bootloader + and partition table scheme and have nuttx be an esp-idf "app" which + allows interoperability with the esp-idf system but makes you + reliant on the esp-idf design for these parts. Both are possible. + endif # ARCH_BOARD_ESP32CORE diff --git a/configs/esp32-core/README.txt b/configs/esp32-core/README.txt index 0688c2aad7518d81e48f9ef8a99d7e728199032e..674fab89956153bd063b39ba3465fe346f8d2e92 100644 --- a/configs/esp32-core/README.txt +++ b/configs/esp32-core/README.txt @@ -172,6 +172,9 @@ Serial Console UART0 is, by default, the serial console. It connects to the on-board CP2102 converter and is available on the USB connector USB CON8 (J1). + It will show up as /dev/ttypUSB[n] where [n] will probably be 0 (is it 1 + on my PC because I have a another device at ttyUSB0). + Buttons and LEDs ================ @@ -201,7 +204,16 @@ SMP CONFIG_SPINLOCK=y CONFIG_SMP=y CONFIG_SMP_NCPUS=2 - CONFIG_SMP_IDLETHREAD_STACKSIZE=2048 + CONFIG_SMP_IDLETHREAD_STACKSIZE=3072 + + Debug Tip: During debug session, OpenOCD may mysteriously switch from one + CPU to another. This behavior can be eliminated by uncommenting one of the + following in scripts/esp32.cfg + + # Only configure the PRO CPU + #set ESP32_ONLYCPU 1 + # Only configure the APP CPU + #set ESP32_ONLYCPU 2 Open Issues: @@ -446,7 +458,7 @@ OpenOCD for the ESP32 To FLASH an ELF via the command line is a two step process, something like this: - esptool.py --chip esp32 elf2image --flash_mode dio --flash_size 4MB -o ./nuttx.bin nuttx.elf + esptool.py --chip esp32 elf2image --flash_mode dio --flash_size 4MB -o ./nuttx.bin nuttx esptool.py --chip esp32 --port COMx write_flash 0x1000 bootloader.bin 0x4000 partition_table.bin 0x10000 nuttx.bin The first step converts an ELF image into an ESP32-compatible binary @@ -465,10 +477,17 @@ OpenOCD for the ESP32 See https://github.com/espressif/esp-idf/tree/master/components/bootloader and https://github.com/espressif/esp-idf/tree/master/components/partition_table. - Running from IRAM - ----------------- - Running from IRAM is a good debug option. You should be able to load the ELF directly via JTAG in this case, and you may not need the bootloader. The one "gotcha" for needing the bootloader is disabling the initial watchdog, there is code in bootloader_start.c that does this. + Running from IRAM with OpenOCD + ------------------------------ + Running from IRAM is a good debug option. You should be able to load the + ELF directly via JTAG in this case, and you may not need the bootloader. + NuttX supports a configuration option, CONFIG_ESP32CORE_RUN_IRAM, that may be + selected for execution from IRAM. This option simply selects the correct + linker script for IRAM execution. + + Skipping the Secondary Bootloader + --------------------------------- It is possible to skip the secondary bootloader and run out of IRAM using only the primary bootloader if your application of small enough (< 128KiB code, <180KiB data), then you can simplify initial bring-up by avoiding second stage @@ -481,10 +500,6 @@ OpenOCD for the ESP32 2. Use "esptool.py" utility found in ESP-IDF to convert application .elf file into binary format which can be loaded by first stage bootloader. - NuttX supports a configuration option, CONFIG_ESP32CORE_RUN_IRAM, that may be - selected for execution from IRAM. This option simply selects the correct - linker script for IRAM execution. - Again you would need to link the ELF file and convert it to binary format suitable for flashing into the board. The command should to convert ELF file to binary image looks as follows: @@ -506,6 +521,58 @@ OpenOCD for the ESP32 would I be able to run directly out of IRAM without a bootloader? That might be a simpler bring-up. + Sample OpenOCD Debug Steps + -------------------------- + I did the initial bring-up using the IRAM configuration and OpenOCD. Here + is a synopsis of my debug steps: + + configs/esp32-core/nsh with + + CONFIG_DEBUG_ASSERTIONS=y + CONFIG_DEBUG_FEATURES=y + CONFIG_DEBUG_SYMBOLS=y + CONFIG_ESP32CORE_RUN_IRAM=y + + I also made this change which will eliminate all attempts to re-configure + serial. It will just use the serial settings as they were left by the + bootloader: + + diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h + index 422ec0b..8707d7c 100644 + --- a/arch/xtensa/src/common/xtensa.h + +++ b/arch/xtensa/src/common/xtensa.h + @@ -60,7 +60,7 @@ + #undef CONFIG_SUPPRESS_INTERRUPTS /* DEFINED: Do not enable interrupts */ + #undef CONFIG_SUPPRESS_TIMER_INTS /* DEFINED: No timer */ + #undef CONFIG_SUPPRESS_SERIAL_INTS /* DEFINED: Console will poll */ + -#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfigure UART */ + +#define CONFIG_SUPPRESS_UART_CONFIG 1 /* DEFINED: Do not reconfigure UART */ + #define CONFIG_SUPPRESS_CLOCK_CONFIG 1 /* DEFINED: Do not reconfigure clocking */ + #undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */ + + Start OpenOCD: + + cd ../openocde-esp32 + cp ../nuttx/configs/esp32-core/scripts/esp32.cfg . + sudo ./src/openocd -s ./tcl/ -f tcl/interface/ftdi/olimex-arm-usb-ocd.cfg -f ./esp32.cfg + + Start GDB and load code: + + cd ../nuttx + xtensa-esp32-elf-gdb -ex 'target remote localhost:3333' nuttx + (gdb) load nuttx + (gdb) mon reg pc [value report by load for entry point] + (gdb) s + + Single stepping works fine for me as do breakpoints: + + Breakpoint 1, xtensa_timer_initialize () at chip/esp32_timerisr.c:172 + 72 { + (gdb) n + esp32.cpu0: Target halted, pc=0x400835BF + 187 g_tick_divisor = divisor; + (gdb) ... + Configurations ============== @@ -575,12 +642,69 @@ NOTES: NOTES: + 1. Uses the CP2102 USB/Serial converter for the serial console. + + 2. I have only tested this in IRAM with UART reconfiguration disabled. + See "Sample Debug Steps". In that case, NuttX is started via GDB. + It has, however, been reported to me that this configuration also + runs when written to address 0x1000 of FLASH with the esptool.py + (as described above). Then NuttX is started via the second level + bootloader. I cannot vouch for that since I have never tried it. + + 3. There are open clocking issues. Currently clock configuration + logic is disabled because I don't have the technical information + to provide that logic -- hopefully that is coming. As a + consequence, whatever clock setup was left when NuttX started is + used. For the case of execution out of IRAM with GDB, the + settings in configs/esp32-core/include/board.h work. To check + the timing, I use a stop watch and: + + nsh> sleep 60 + + If the timing is correct in the board.h header file, the value + timed with the stop watch should be about 60 seconds. If not, + change the frequency in the board.h header file. + smp: Another NSH configuration, similar to nsh, but also enables - SMP operation. + SMP operation. It differs from the nsh configuration only in these + addtional settings: + + SMP is enabled: + + CONFIG_SMP=y + CONFIG_SMP_IDLETHREAD_STACKSIZE=3072 + CONFIG_SMP_NCPUS=2 + CONFIG_SPINLOCK=y + + The apps/examples/smp test is included: + + CONFIG_EXAMPLES_SMP=y + CONFIG_EXAMPLES_SMP_NBARRIER_THREADS=8 + CONFIG_EXAMPLES_SMP_PRIORITY=100 + CONFIG_EXAMPLES_SMP_STACKSIZE=2048 + + NOTES: + 1. See NOTES for the nsh configuration. + + ostest: + + This is the NuttX test at apps/examples/ostest that is run against all new + architecture ports to assure a correct implementation of the OS. The default + version is for a single CPU but can be modified for an SMP test by adding: + + CONFIG_SMP=y + CONFIG_SMP_IDLETHREAD_STACKSIZE=2048 + CONFIG_SMP_NCPUS=2 + CONFIG_SPINLOCK=y NOTES: + 1. See NOTES for the nsh configuration. + 2. 2016-12-23: Test appears to be fully functional in the single CPU mode. + 3. 2016-12-24: But when SMP is enabled, there is a consistent, repeatable + crash in the waitpid() test. At the time of the crash, there is + extensive memory corruption and a user exception occurrs (cause=28). Things to Do ============ @@ -616,3 +740,25 @@ Things to Do 5. See SMP-related issues above 6. See OpenOCD for the ESP32 above + + 7. Currently will not boot unless serial port initialization is disabled. + This will use the serial port settings as left by the preceding + bootloader: + + diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h + index 422ec0b..8707d7c 100644 + --- a/arch/xtensa/src/common/xtensa.h + +++ b/arch/xtensa/src/common/xtensa.h + @@ -60,7 +60,7 @@ + #undef CONFIG_SUPPRESS_INTERRUPTS /* DEFINED: Do not enable interrupts */ + #undef CONFIG_SUPPRESS_TIMER_INTS /* DEFINED: No timer */ + #undef CONFIG_SUPPRESS_SERIAL_INTS /* DEFINED: Console will poll */ + -#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfigure UART */ + +#define CONFIG_SUPPRESS_UART_CONFIG 1 /* DEFINED: Do not reconfigure UART */ + #define CONFIG_SUPPRESS_CLOCK_CONFIG 1 /* DEFINED: Do not reconfigure clocking */ + #undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */ + + I have not debugged this in detail, but this appears to be an issue with the + impelentation of esp32_configgpio() and/or gpio_matrix_out() when called from + the setup logic in arch/xtensa/src/esp32/esp32_serial.c. I am not inclined + to invest a lot in driver debug until the clock configuration is finalized. diff --git a/configs/esp32-core/include/board.h b/configs/esp32-core/include/board.h index e3b2e85a87ec7ef5d77e1e2da76c210c5906d87c..45e3d109af2d3f52c39e098f671926d4866a33c0 100644 --- a/configs/esp32-core/include/board.h +++ b/configs/esp32-core/include/board.h @@ -50,11 +50,20 @@ #endif /* Clock reconfiguration is currently disabled, so the CPU will be running - * at the XTAL frequency. + * at the XTAL frequency or at two times the XTAL frequency, depending upon + * how we load the code: + * + * - If we load the code into FLASH at address 0x1000 where it is started by + * the second level bootloader, then the frequency is the crystal + * frequency. + * - If we load the code into IRAM after the second level bootloader has run + * this frequency will be twice the crystal frequency. + * + * Don't ask me for an explanation. */ -#if 0 -# define BOARD_CLOCK_FREQUENCY 80000000 +#ifdef CONFIG_ESP32CORE_RUN_IRAM +# define BOARD_CLOCK_FREQUENCY (2 * BOARD_XTAL_FREQUENCY) #else # define BOARD_CLOCK_FREQUENCY BOARD_XTAL_FREQUENCY #endif diff --git a/configs/esp32-core/nsh/defconfig b/configs/esp32-core/nsh/defconfig index 18cdefc0be1a6621517e19a8f9e40ccbbea4019b..5eba1f4980e8cbbfc4390fc01523af398ed28040 100644 --- a/configs/esp32-core/nsh/defconfig +++ b/configs/esp32-core/nsh/defconfig @@ -8,14 +8,10 @@ # # CONFIG_EXPERIMENTAL is not set # CONFIG_DEFAULT_SMALL is not set -# CONFIG_HOST_LINUX is not set +CONFIG_HOST_LINUX=y # CONFIG_HOST_OSX is not set -CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set -CONFIG_WINDOWS_CYGWIN=y -# CONFIG_WINDOWS_MSYS is not set -# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -51,8 +47,9 @@ CONFIG_DEBUG_ALERT=y # CONFIG_ARCH_HAVE_STACKCHECK is not set # CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_DEBUG_SYMBOLS is not set -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y # CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set CONFIG_DEBUG_FULLOPT=y # @@ -63,7 +60,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -78,6 +74,10 @@ CONFIG_ARCH_CHIP_ESP32=y CONFIG_ARCH_FAMILY_LX6=y # CONFIG_XTENSA_USE_OVLY is not set CONFIG_XTENSA_CP_INITSET=0x0001 + +# +# ESP32 Peripheral Selection +# CONFIG_ESP32_UART=y # CONFIG_ESP32_SPI2 is not set # CONFIG_XTENSA_TIMER1 is not set @@ -85,24 +85,20 @@ CONFIG_ESP32_UART=y CONFIG_ESP32_UART0=y # CONFIG_ESP32_UART1 is not set # CONFIG_ESP32_UART2 is not set -CONFIG_ESP32_BT_RESERVE_DRAM=0 -CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 -CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 -# CONFIG_ESP32_GPIO_IRQ is not set -CONFIG_ESP32_UART0_TXPIN=0 -CONFIG_ESP32_UART0_RXPIN=0 - -# -# ESP32 Peripheral Selection -# # # Memory Configuration # +CONFIG_ESP32_BT_RESERVE_DRAM=0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +# CONFIG_ESP32_GPIO_IRQ is not set # # UART configuration # +CONFIG_ESP32_UART0_TXPIN=0 +CONFIG_ESP32_UART0_RXPIN=0 # # Architecture Options @@ -175,7 +171,11 @@ CONFIG_ESP32CORE_XTAL_40MZ=y # CONFIG_ESP32CORE_XTAL_26MHz is not set # CONFIG_ESP32CORE_RUN_IRAM is not set # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -206,6 +206,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y @@ -223,6 +224,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -355,7 +358,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -538,6 +540,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # CONFIG_ARCH_HAVE_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -600,10 +604,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXHELLO is not set # CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set @@ -613,7 +617,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -626,6 +629,7 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -747,6 +751,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -764,7 +769,7 @@ CONFIG_NSH_FILEIOSIZE=512 # CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set +CONFIG_NSH_ARCHINIT=y # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set diff --git a/configs/lpcxpresso-lpc1115/minnsh/Make.defs b/configs/esp32-core/ostest/Make.defs similarity index 77% rename from configs/lpcxpresso-lpc1115/minnsh/Make.defs rename to configs/esp32-core/ostest/Make.defs index 5024dbe9ca5bb29065aca2ac828843f10e6b2456..6361bd33c43e847ce65aeb0929cfa6fdb2a9b34f 100644 --- a/configs/lpcxpresso-lpc1115/minnsh/Make.defs +++ b/configs/esp32-core/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ -# configs/lpcxpresso-lpc1115/minnsh/Make.defs +# configs/esp32-core/ostest/Make.defs # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -35,20 +35,35 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/armv6-m/Toolchain.defs +include ${TOPDIR}/arch/xtensa/src/lx6/Toolchain.defs -LDSCRIPT = ld.script +LDSCRIPT1 = $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/esp32_out.ld +LDSCRIPT3 = $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/esp32_rom.ld +LDSCRIPT4 = $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/esp32_peripherals.ld + +ifeq ($(CONFIG_ESP32CORE_RUN_IRAM),y) + LDSCRIPT2 = $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/esp32_iram.ld +else + LDSCRIPT2 = $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/esp32_flash.ld +endif ifeq ($(WINTOOL),y) # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mkwindeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" + ARCHSCRIPT = -T "${shell cygpath -w $(LDSCRIPT1)}" + ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT2)}" + ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT3)}" + ARCHSCRIPT += -T "${shell cygpath -w $(LDSCRIPT4)}" else # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + ARCHSCRIPT = -T$(LDSCRIPT1) -T$(LDSCRIPT2) -T$(LDSCRIPT3) -T$(LDSCRIPT4) endif CC = $(CROSSDEV)gcc @@ -60,9 +75,6 @@ NM = $(ARCROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ARCHOPTIMIZATION = -g endif @@ -71,12 +83,12 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y) ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti +ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -MMD -MP +ARCHCXXFLAGS = $(ARCHCFLAGS) -fno-exceptions -fcheck-new -fno-rtti ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 +ARCHPICFLAGS = -fpic CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) @@ -94,9 +106,7 @@ OBJEXT = .o LIBEXT = .a EXEEXT = -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif +LDFLAGS += -nostartfiles -nodefaultlibs ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif @@ -106,18 +116,4 @@ HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe HOSTLDFLAGS = -ifeq ($(CONFIG_HOST_WINDOWS),y) - HOSTEXEEXT = .exe -else - HOSTEXEEXT = -endif -ifeq ($(WINTOOL),y) - # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh -else - # Linux/Cygwin-native host tools - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) -endif diff --git a/configs/pirelli_dpl10/nsh_highram/defconfig b/configs/esp32-core/ostest/defconfig similarity index 62% rename from configs/pirelli_dpl10/nsh_highram/defconfig rename to configs/esp32-core/ostest/defconfig index 37b1fb1ffdaded2ea01138cc1d6bdfa02104e50a..4dfe49cf9ed91b25c5fdd35f2b5b3184bdbcf2b1 100644 --- a/configs/pirelli_dpl10/nsh_highram/defconfig +++ b/configs/esp32-core/ostest/defconfig @@ -24,7 +24,7 @@ CONFIG_BUILD_FLAT=y # Binary Output Formats # # CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set +CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y # CONFIG_UBOOT_UIMAGE is not set @@ -44,8 +44,7 @@ CONFIG_RAW_BINARY=y # CONFIG_DEBUG_ALERT=y # CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set +# CONFIG_ARCH_HAVE_STACKCHECK is not set # CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_DEBUG_SYMBOLS is not set CONFIG_ARCH_HAVE_CUSTOMOPT=y @@ -56,115 +55,50 @@ CONFIG_DEBUG_FULLOPT=y # # System Type # -CONFIG_ARCH_ARM=y +# CONFIG_ARCH_ARM is not set # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +CONFIG_ARCH_XTENSA=y # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -CONFIG_ARCH_CHIP_CALYPSO=y -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_KL is not set -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -CONFIG_ARCH_ARM7TDMI=y -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -# CONFIG_ARCH_CORTEXM0 is not set -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="arm" -CONFIG_ARCH_CHIP="calypso" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -# CONFIG_ARCH_LOWVECTORS is not set - -# -# ARM Configuration Options -# -CONFIG_ARM_TOOLCHAIN_BUILDROOT=y -# CONFIG_ARM_TOOLCHAIN_CODESOURCERYL is not set -# CONFIG_ARM_TOOLCHAIN_GNU_EABIL is not set -# CONFIG_ARM_TOOLCHAIN_GNU_OABI is not set -CONFIG_ARM_OABI_TOOLCHAIN=y -CONFIG_UART_IRDA_BAUD=115200 -CONFIG_UART_IRDA_PARITY=0 -CONFIG_UART_IRDA_BITS=8 -CONFIG_UART_IRDA_2STOP=0 -CONFIG_UART_IRDA_RXBUFSIZE=256 -CONFIG_UART_IRDA_TXBUFSIZE=256 -CONFIG_UART_MODEM_BAUD=115200 -CONFIG_UART_MODEM_PARITY=0 -CONFIG_UART_MODEM_BITS=8 -CONFIG_UART_MODEM_2STOP=0 -CONFIG_UART_MODEM_RXBUFSIZE=256 -CONFIG_UART_MODEM_TXBUFSIZE=256 - -# -# Calypso Configuration Options -# - -# -# Modem UART Configuration -# -# CONFIG_UART_MODEM_HWFLOWCONTROL is not set - -# -# IrDA UART Configuration -# -# CONFIG_UART_IRDA_HWFLOWCONTROL is not set -# CONFIG_USE_SERCOMM_CONSOLE is not set -# CONFIG_SERIAL_MODEM_CONSOLE is not set -CONFIG_SERIAL_IRDA_CONSOLE=y -# CONFIG_SERIAL_CONSOLE_NONE is not set +CONFIG_ARCH="xtensa" +CONFIG_ARCH_CHIP="esp32" +# CONFIG_SERIAL_TERMIOS is not set +CONFIG_ARCH_CHIP_ESP32=y +CONFIG_ARCH_FAMILY_LX6=y +# CONFIG_XTENSA_USE_OVLY is not set +CONFIG_XTENSA_CP_INITSET=0x0001 + +# +# ESP32 Peripheral Selection +# +CONFIG_ESP32_UART=y +# CONFIG_ESP32_SPI2 is not set +# CONFIG_XTENSA_TIMER1 is not set +# CONFIG_XTENSA_TIMER2 is not set +CONFIG_ESP32_UART0=y +# CONFIG_ESP32_UART1 is not set +# CONFIG_ESP32_UART2 is not set + +# +# Memory Configuration +# +CONFIG_ESP32_BT_RESERVE_DRAM=0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +# CONFIG_ESP32_GPIO_IRQ is not set + +# +# UART configuration +# +CONFIG_ESP32_UART0_TXPIN=0 +CONFIG_ESP32_UART0_RXPIN=0 # # Architecture Options @@ -177,13 +111,13 @@ CONFIG_SERIAL_IRDA_CONSOLE=y # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y +CONFIG_ARCH_HAVE_MULTICPU=y +# CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set # CONFIG_ARCH_NAND_HWECC is not set # CONFIG_ARCH_HAVE_EXTCLK is not set -CONFIG_ARCH_HAVE_POWEROFF=y +# CONFIG_ARCH_HAVE_POWEROFF is not set # CONFIG_ARCH_HAVE_RESET is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set @@ -194,56 +128,52 @@ CONFIG_ARCH_STACKDUMP=y # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=1250 +CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set # # Interrupt options # -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 +# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set # CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set # # Boot options # # CONFIG_BOOT_RUNFROMEXTSRAM is not set -# CONFIG_BOOT_RUNFROMFLASH is not set -CONFIG_BOOT_RUNFROMISRAM=y +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set # CONFIG_BOOT_RUNFROMSDRAM is not set # CONFIG_BOOT_COPYTORAM is not set # # Boot Memory Configuration # -CONFIG_RAM_START=0x00800000 -CONFIG_RAM_SIZE=262144 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=114688 # CONFIG_ARCH_HAVE_SDRAM is not set # # Board Selection # -# CONFIG_ARCH_BOARD_COMPALE86 is not set -# CONFIG_ARCH_BOARD_COMPALE88 is not set -# CONFIG_ARCH_BOARD_COMPALE99 is not set -CONFIG_ARCH_BOARD_PIRELLI_DPL10=y +CONFIG_ARCH_BOARD_ESP32CORE=y # CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="pirelli_dpl10" +CONFIG_ARCH_BOARD="esp32-core" # # Common Board Options # -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +CONFIG_ESP32CORE_XTAL_40MZ=y +# CONFIG_ESP32CORE_XTAL_26MHz is not set +# CONFIG_ESP32CORE_RUN_IRAM is not set +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_POWEROFF=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -254,7 +184,7 @@ CONFIG_DISABLE_OS_API=y # CONFIG_DISABLE_POSIX_TIMERS is not set # CONFIG_DISABLE_PTHREAD is not set # CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y +# CONFIG_DISABLE_MQUEUE is not set # CONFIG_DISABLE_ENVIRON is not set # @@ -263,34 +193,39 @@ CONFIG_DISABLE_MQUEUE=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=13 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=1 -CONFIG_PREALLOC_TIMERS=8 +CONFIG_START_YEAR=2011 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=6 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=16 +CONFIG_WDOG_INTRESERVE=4 +CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_USER_ENTRYPOINT="ostest_main" CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 +CONFIG_TASK_NAME_SIZE=31 CONFIG_MAX_TASKS=16 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_WAITPID=y # # Pthread Options # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -325,6 +260,12 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 # CONFIG_MODULE is not set # @@ -337,7 +278,7 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_IDLETHREAD_STACKSIZE=3072 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 @@ -349,6 +290,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -364,21 +306,24 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -386,7 +331,12 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -408,14 +358,13 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set # CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set +CONFIG_UART0_SERIALDRIVER=y # CONFIG_UART1_SERIALDRIVER is not set # CONFIG_UART2_SERIALDRIVER is not set # CONFIG_UART3_SERIALDRIVER is not set @@ -435,18 +384,35 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_USART6_SERIALDRIVER is not set # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set -CONFIG_OTHER_UART_SERIALDRIVER=y +# CONFIG_OTHER_UART_SERIALDRIVER is not set CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set +CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_OTHER_SERIAL_CONSOLE=y +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=256 +CONFIG_UART0_TXBUFSIZE=256 +CONFIG_UART0_BAUD=115200 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 +# CONFIG_UART0_IFLOWCONTROL is not set +# CONFIG_UART0_OFLOWCONTROL is not set +# CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -460,6 +426,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -483,9 +450,10 @@ CONFIG_SYSLOG_CONSOLE=y # CONFIG_DISABLE_MOUNTPOINT is not set # CONFIG_FS_AUTOMOUNTER is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set +CONFIG_FS_READABLE=y # CONFIG_FS_WRITABLE is not set # CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set # CONFIG_FS_FAT is not set # CONFIG_FS_NXFFS is not set @@ -493,7 +461,15 @@ CONFIG_SYSLOG_CONSOLE=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set # CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set +CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set + +# +# Exclude individual procfs entries +# +# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set +# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set +# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set # CONFIG_FS_UNIONFS is not set # @@ -505,10 +481,8 @@ CONFIG_SYSLOG_CONSOLE=y # Memory Management # # CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_HAVE_HEAP2=y -CONFIG_HEAP2_BASE=0x00000000 -CONFIG_HEAP2_SIZE=0 +CONFIG_MM_REGIONS=2 +# CONFIG_ARCH_HAVE_HEAP2 is not set # CONFIG_GRAN is not set # @@ -538,7 +512,7 @@ CONFIG_BUILTIN=y # # Standard C Library Options # -CONFIG_STDIO_BUFFER_SIZE=1024 +CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 CONFIG_LIB_HOMEDIR="/" @@ -547,6 +521,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -563,9 +539,11 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set +# CONFIG_ARCH_HAVE_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set +# CONFIG_NETDB_HOSTFILE is not set # # Non-standard Library Support @@ -573,12 +551,20 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support # # CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set # # Application Configuration @@ -596,16 +582,16 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set +# CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_HELLO_PRIORITY=100 -CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set @@ -615,7 +601,7 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NSH is not set # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set @@ -624,20 +610,24 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_OSTEST=y +CONFIG_EXAMPLES_OSTEST_LOOPS=10 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=6114 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set @@ -652,6 +642,7 @@ CONFIG_EXAMPLES_NSH=y # File System Utilities # # CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set # # GPS Utilities @@ -667,8 +658,10 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -688,100 +681,7 @@ CONFIG_EXAMPLES_NSH=y # # NSH Library # -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=64 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_MAXARGUMENTS=6 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_BUILTIN_APPS=y - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_BASENAME is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_DIRNAME is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_POWEROFF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -CONFIG_NSH_DISABLE_SHUTDOWN=y -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNAME is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -# CONFIG_NSH_CMDOPT_DF_H is not set -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 - -# -# Scripting Support -# -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set +# CONFIG_NSH_LIBRARY is not set # # NxWidgets/NxWM @@ -798,16 +698,17 @@ CONFIG_NSH_CONSOLE=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y +# CONFIG_READLINE_HAVE_EXTMATCH is not set CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/pirelli_dpl10/nsh_highram/setenv.sh b/configs/esp32-core/ostest/setenv.sh old mode 100755 new mode 100644 similarity index 73% rename from configs/pirelli_dpl10/nsh_highram/setenv.sh rename to configs/esp32-core/ostest/setenv.sh index 56d2c4cf94e0c2411f645114703d850f376618bb..5c52d03081862ff7b086c633ab59a3238482afeb --- a/configs/pirelli_dpl10/nsh_highram/setenv.sh +++ b/configs/esp32-core/ostest/setenv.sh @@ -1,8 +1,8 @@ #!/bin/bash -# configs/pirelli_dpl10/nsh/setenv.sh +# configs/esp32-core/ostest/setenv.sh # -# Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -47,16 +47,11 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# This is the Cygwin path to the location where I installed the CodeSourcery -# toolchain under windows. You will also have to edit this if you install -# the CodeSourcery toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# This is the path to the location where I installed the Expressif crosstools-NG +# toolchaing +export TOOLCHAIN_BIN="/home/patacongo/projects/nuttx/crosstool-NG/builds/xtensa-esp32-elf/bin" -# This is the Cygwin path to the location where I build the buildroot -# toolchain. -export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" - -# Add the path to the toolchain to the PATH varialble +# Add the path to the toolchain to the PATH variable export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/configs/esp32-core/scripts/esp32.cfg b/configs/esp32-core/scripts/esp32.cfg index 0bd581f40a03623bde8bf569a81d45729ea5b24b..a9f94d37dc8cd0ea80c183f5d9e7a47d30077bc4 100644 --- a/configs/esp32-core/scripts/esp32.cfg +++ b/configs/esp32-core/scripts/esp32.cfg @@ -44,8 +44,6 @@ source [find target/esp32.cfg] # voltage greatly. # Enable this for 1.8V SPI flash -esp108 flashbootstrap 1.8 +# esp108 flashbootstrap 1.8 # Enable this for 3.3V SPI flash -#esp108 flashbootstrap 3.3 - - +esp108 flashbootstrap 3.3 diff --git a/configs/esp32-core/scripts/esp32_flash.ld b/configs/esp32-core/scripts/esp32_flash.ld index 5a1ffe056223a05f1cc565d3e55564ae2223c1a9..e11f2f954a7bdc4e7df48505a6aa93d2e2e99e11 100644 --- a/configs/esp32-core/scripts/esp32_flash.ld +++ b/configs/esp32-core/scripts/esp32_flash.ld @@ -19,25 +19,25 @@ SECTIONS /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */ . = 0x0; - KEEP(*(.window_vectors.text)); + KEEP (*(.window_vectors.text)); . = 0x180; - KEEP(*(.xtensa_level2_vector.text)); + KEEP (*(.xtensa_level2_vector.text)); . = 0x1c0; - KEEP(*(.xtensa_level3_vector.text)); + KEEP (*(.xtensa_level3_vector.text)); . = 0x200; - KEEP(*(.xtensa_level4_vector.text)); + KEEP (*(.xtensa_level4_vector.text)); . = 0x240; - KEEP(*(.xtensa_level5_vector.text)); + KEEP (*(.xtensa_level5_vector.text)); . = 0x280; - KEEP(*(.debug_exception_vector.text)); + KEEP (*(.debug_exception_vector.text)); . = 0x2c0; - KEEP(*(.nmi_vector.text)); + KEEP (*(.nmi_vector.text)); . = 0x300; - KEEP(*(.kernel_exception_vector.text)); + KEEP (*(.kernel_exception_vector.text)); . = 0x340; - KEEP(*(.user_exception_vector.text)); + KEEP (*(.user_exception_vector.text)); . = 0x3c0; - KEEP(*(.double_exception_vector.text)); + KEEP (*(.double_exception_vector.text)); . = 0x400; *(.*_vector.literal) @@ -78,7 +78,7 @@ SECTIONS *(.sbss2.*) *(.gnu.linkonce.sb2.*) *(.dynbss) - KEEP(*(.bss)) + KEEP (*(.bss)) *(.bss.*) *(.share.mem) *(.gnu.linkonce.b.*) @@ -96,17 +96,17 @@ SECTIONS /* .data initialized on power-up in ROMed configurations. */ _sdata = ABSOLUTE(.); - KEEP(*(.data)) - KEEP(*(.data.*)) - KEEP(*(.gnu.linkonce.d.*)) - KEEP(*(.data1)) - KEEP(*(.sdata)) - KEEP(*(.sdata.*)) - KEEP(*(.gnu.linkonce.s.*)) - KEEP(*(.sdata2)) - KEEP(*(.sdata2.*)) - KEEP(*(.gnu.linkonce.s2.*)) - KEEP(*(.jcr)) + KEEP (*(.data)) + KEEP (*(.data.*)) + KEEP (*(.gnu.linkonce.d.*)) + KEEP (*(.data1)) + KEEP (*(.sdata)) + KEEP (*(.sdata.*)) + KEEP (*(.gnu.linkonce.s.*)) + KEEP (*(.sdata2)) + KEEP (*(.sdata2.*)) + KEEP (*(.gnu.linkonce.s2.*)) + KEEP (*(.jcr)) *(.dram1 .dram1.*) _edata = ABSOLUTE(.); . = ALIGN(4); diff --git a/configs/esp32-core/scripts/esp32_iram.ld b/configs/esp32-core/scripts/esp32_iram.ld index 605ea54e5a3c6e137c4d42f0a2f286ed2a918f7b..2df0a5355aa03ef570f4ac54f37f2ede0f7be2d4 100644 --- a/configs/esp32-core/scripts/esp32_iram.ld +++ b/configs/esp32-core/scripts/esp32_iram.ld @@ -19,25 +19,25 @@ SECTIONS /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */ . = 0x0; - KEEP(*(.window_vectors.text)); + KEEP (*(.window_vectors.text)); . = 0x180; - KEEP(*(.xtensa_level2_vector.text)); + KEEP (*(.xtensa_level2_vector.text)); . = 0x1c0; - KEEP(*(.xtensa_level3_vector.text)); + KEEP (*(.xtensa_level3_vector.text)); . = 0x200; - KEEP(*(.xtensa_level4_vector.text)); + KEEP (*(.xtensa_level4_vector.text)); . = 0x240; - KEEP(*(.xtensa_level5_vector.text)); + KEEP (*(.xtensa_level5_vector.text)); . = 0x280; - KEEP(*(.debug_exception_vector.text)); + KEEP (*(.debug_exception_vector.text)); . = 0x2c0; - KEEP(*(.nmi_vector.text)); + KEEP (*(.nmi_vector.text)); . = 0x300; - KEEP(*(.kernel_exception_vector.text)); + KEEP (*(.kernel_exception_vector.text)); . = 0x340; - KEEP(*(.user_exception_vector.text)); + KEEP (*(.user_exception_vector.text)); . = 0x3c0; - KEEP(*(.double_exception_vector.text)); + KEEP (*(.double_exception_vector.text)); . = 0x400; *(.*_vector.literal) @@ -89,7 +89,7 @@ SECTIONS *(.sbss2.*) *(.gnu.linkonce.sb2.*) *(.dynbss) - KEEP(*(.bss)) + KEEP (*(.bss)) *(.bss.*) *(.share.mem) *(.gnu.linkonce.b.*) @@ -107,17 +107,17 @@ SECTIONS /* .data initialized on power-up in ROMed configurations. */ _sdata = ABSOLUTE(.); - KEEP(*(.data)) - KEEP(*(.data.*)) - KEEP(*(.gnu.linkonce.d.*)) - KEEP(*(.data1)) - KEEP(*(.sdata)) - KEEP(*(.sdata.*)) - KEEP(*(.gnu.linkonce.s.*)) - KEEP(*(.sdata2)) - KEEP(*(.sdata2.*)) - KEEP(*(.gnu.linkonce.s2.*)) - KEEP(*(.jcr)) + KEEP (*(.data)) + KEEP (*(.data.*)) + KEEP (*(.gnu.linkonce.d.*)) + KEEP (*(.data1)) + KEEP (*(.sdata)) + KEEP (*(.sdata.*)) + KEEP (*(.gnu.linkonce.s.*)) + KEEP (*(.sdata2)) + KEEP (*(.sdata2.*)) + KEEP (*(.gnu.linkonce.s2.*)) + KEEP (*(.jcr)) *(.dram1 .dram1.*) _edata = ABSOLUTE(.); . = ALIGN(4); @@ -173,10 +173,6 @@ SECTIONS _sheap = ABSOLUTE(.); } >dram0_0_seg - .flash.rodata : - { - } >drom0_0_seg - .rtc.text : { . = ALIGN(4); diff --git a/configs/esp32-core/smp/defconfig b/configs/esp32-core/smp/defconfig index d9641480ce916e1b8c66a89b7a05794b07090b0f..56422d52b101683eaab1d2d2d93736301fcb2822 100644 --- a/configs/esp32-core/smp/defconfig +++ b/configs/esp32-core/smp/defconfig @@ -8,14 +8,10 @@ # # CONFIG_EXPERIMENTAL is not set # CONFIG_DEFAULT_SMALL is not set -# CONFIG_HOST_LINUX is not set +CONFIG_HOST_LINUX=y # CONFIG_HOST_OSX is not set -CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set -CONFIG_WINDOWS_CYGWIN=y -# CONFIG_WINDOWS_MSYS is not set -# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -51,8 +47,9 @@ CONFIG_DEBUG_ALERT=y # CONFIG_ARCH_HAVE_STACKCHECK is not set # CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_DEBUG_SYMBOLS is not set -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y # CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set CONFIG_DEBUG_FULLOPT=y # @@ -63,7 +60,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -78,6 +74,10 @@ CONFIG_ARCH_CHIP_ESP32=y CONFIG_ARCH_FAMILY_LX6=y # CONFIG_XTENSA_USE_OVLY is not set CONFIG_XTENSA_CP_INITSET=0x0001 + +# +# ESP32 Peripheral Selection +# CONFIG_ESP32_UART=y # CONFIG_ESP32_SPI2 is not set # CONFIG_XTENSA_TIMER1 is not set @@ -85,24 +85,20 @@ CONFIG_ESP32_UART=y CONFIG_ESP32_UART0=y # CONFIG_ESP32_UART1 is not set # CONFIG_ESP32_UART2 is not set -CONFIG_ESP32_BT_RESERVE_DRAM=0 -CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 -CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 -# CONFIG_ESP32_GPIO_IRQ is not set -CONFIG_ESP32_UART0_TXPIN=0 -CONFIG_ESP32_UART0_RXPIN=0 - -# -# ESP32 Peripheral Selection -# # # Memory Configuration # +CONFIG_ESP32_BT_RESERVE_DRAM=0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +# CONFIG_ESP32_GPIO_IRQ is not set # # UART configuration # +CONFIG_ESP32_UART0_TXPIN=0 +CONFIG_ESP32_UART0_RXPIN=0 # # Architecture Options @@ -175,7 +171,11 @@ CONFIG_ESP32CORE_XTAL_40MZ=y # CONFIG_ESP32CORE_XTAL_26MHz is not set # CONFIG_ESP32CORE_RUN_IRAM is not set # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -226,6 +226,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -358,7 +360,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -541,6 +542,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # CONFIG_ARCH_HAVE_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -603,10 +606,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXHELLO is not set # CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set @@ -616,7 +619,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -632,6 +634,7 @@ CONFIG_EXAMPLES_SMP_STACKSIZE=2048 # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -753,6 +756,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -770,7 +774,7 @@ CONFIG_NSH_FILEIOSIZE=512 # CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set +CONFIG_NSH_ARCHINIT=y # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set diff --git a/configs/esp32-core/src/Makefile b/configs/esp32-core/src/Makefile index 2e23d2db4b6f7041ebd7dc7ba989be244e16741d..46ed73e5c3ec30550966df469bdaba1b3a4fc2dd 100644 --- a/configs/esp32-core/src/Makefile +++ b/configs/esp32-core/src/Makefile @@ -42,7 +42,7 @@ ASRCS = CSRCS = esp32_boot.c esp32_bringup.c ifeq ($(CONFIG_LIB_BOARDCTL),y) -CONFIG_CSRCS += esp32_appinit.c +CSRCS += esp32_appinit.c endif SCRIPTIN = $(SCRIPTDIR)$(DELIM)esp32.template diff --git a/configs/esp32-core/src/esp32_appinit.c b/configs/esp32-core/src/esp32_appinit.c index b352aa2fd268eb485e7b126572450fc7f2822382..ff8d1eb9570beed26fb0136ed5ea7e689bd68cd8 100644 --- a/configs/esp32-core/src/esp32_appinit.c +++ b/configs/esp32-core/src/esp32_appinit.c @@ -42,7 +42,7 @@ #include #include -#include "esp32_core.h" +#include "esp32-core.h" #ifdef CONFIG_LIB_BOARDCTL diff --git a/configs/esp32-core/src/esp32_bringup.c b/configs/esp32-core/src/esp32_bringup.c index 0267217785b2250c65ef2760a1464d19dc8f5f1e..b5121b2a4dde0f400cb347fcd10da6b25d7dd172 100644 --- a/configs/esp32-core/src/esp32_bringup.c +++ b/configs/esp32-core/src/esp32_bringup.c @@ -38,7 +38,11 @@ ****************************************************************************/ #include + #include +#include +#include + #include "esp32-core.h" /**************************************************************************** @@ -65,5 +69,23 @@ int esp32_bringup(void) { + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + + /* If we got here then perhaps not all initialization was successful, but + * at least enough succeeded to bring-up NSH with perhaps reduced + * capabilities. + */ + + UNUSED(ret); return OK; } diff --git a/configs/ez80f910200kitg/ostest/defconfig b/configs/ez80f910200kitg/ostest/defconfig index 37192e23e0792f23dec3c8c1e780bbf34e421ff0..4a79e9765ab55c2fe122ab60036e4cc19e97314c 100644 --- a/configs/ez80f910200kitg/ostest/defconfig +++ b/configs/ez80f910200kitg/ostest/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -370,7 +369,6 @@ CONFIG_MMCSD_HAVECARDDETECT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -597,7 +595,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ez80f910200zco/dhcpd/defconfig b/configs/ez80f910200zco/dhcpd/defconfig index 9a740baa64f059cd29b1d80e8c741a6c769a44a6..d48a15c6f25ed4fa9bd97bf7580f033ec88e66a9 100644 --- a/configs/ez80f910200zco/dhcpd/defconfig +++ b/configs/ez80f910200zco/dhcpd/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -149,6 +148,7 @@ CONFIG_EZ80_NRXPKTBUFS=64 CONFIG_EZ80_MDCDIV=0 CONFIG_EZ80_TXPOLLTIMERMS=10 # CONFIG_ARCH_MCFILTER is not set +CONFIG_EZ80_EMAC_HPWORK=y CONFIG_ARCH_TIMERHOOK=y # @@ -290,6 +290,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -297,13 +298,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -394,10 +399,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -421,7 +424,6 @@ CONFIG_ETH0_PHY_AM79C874=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -497,13 +499,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -750,7 +750,6 @@ CONFIG_EXAMPLES_DHCPD_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ez80f910200zco/httpd/defconfig b/configs/ez80f910200zco/httpd/defconfig index 60fb2abeb9935f9345b8350780d54c3ebab22c3c..7ef42bdffa48231ab09d2aa73a7ed5513a684a82 100644 --- a/configs/ez80f910200zco/httpd/defconfig +++ b/configs/ez80f910200zco/httpd/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -149,6 +148,7 @@ CONFIG_EZ80_NRXPKTBUFS=64 CONFIG_EZ80_MDCDIV=0 CONFIG_EZ80_TXPOLLTIMERMS=10 # CONFIG_ARCH_MCFILTER is not set +CONFIG_EZ80_EMAC_HPWORK=y CONFIG_ARCH_TIMERHOOK=y # @@ -296,6 +296,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +305,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -403,10 +408,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -430,7 +433,6 @@ CONFIG_ETH0_PHY_AM79C874=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -506,13 +508,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -759,7 +759,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ez80f910200zco/nettest/defconfig b/configs/ez80f910200zco/nettest/defconfig index 446c99cbb845ff9a6b11c4479456b2fe6f65c2eb..e9b3d8c54ff214a6e227f9cca2327f08ab8ae6ce 100644 --- a/configs/ez80f910200zco/nettest/defconfig +++ b/configs/ez80f910200zco/nettest/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -149,6 +148,7 @@ CONFIG_EZ80_NRXPKTBUFS=64 CONFIG_EZ80_MDCDIV=0 CONFIG_EZ80_TXPOLLTIMERMS=10 # CONFIG_ARCH_MCFILTER is not set +CONFIG_EZ80_EMAC_HPWORK=y CONFIG_ARCH_TIMERHOOK=y # @@ -290,6 +290,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -297,13 +298,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -395,10 +400,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -422,7 +425,6 @@ CONFIG_ETH0_PHY_AM79C874=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -498,13 +500,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -764,7 +764,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ez80f910200zco/nsh/defconfig b/configs/ez80f910200zco/nsh/defconfig index 20c5d5e5e4657f26885acd751ef00f8d741ec68f..72a9774dd9b2bf1cb00f53a88cb16a26f1cfb385 100644 --- a/configs/ez80f910200zco/nsh/defconfig +++ b/configs/ez80f910200zco/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -149,6 +148,7 @@ CONFIG_EZ80_NRXPKTBUFS=64 CONFIG_EZ80_MDCDIV=0 CONFIG_EZ80_TXPOLLTIMERMS=10 # CONFIG_ARCH_MCFILTER is not set +CONFIG_EZ80_EMAC_HPWORK=y CONFIG_ARCH_TIMERHOOK=y # @@ -296,6 +296,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +305,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -405,10 +410,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -432,7 +435,6 @@ CONFIG_ETH0_PHY_AM79C874=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -509,13 +511,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -785,7 +785,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ez80f910200zco/poll/defconfig b/configs/ez80f910200zco/poll/defconfig index 3a6fea2c6c929385183e13e1a318191a2981744d..b806a20f74880a0096b1797ab962bd0524c6c00a 100644 --- a/configs/ez80f910200zco/poll/defconfig +++ b/configs/ez80f910200zco/poll/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -149,6 +148,7 @@ CONFIG_EZ80_NRXPKTBUFS=64 CONFIG_EZ80_MDCDIV=0 CONFIG_EZ80_TXPOLLTIMERMS=10 # CONFIG_ARCH_MCFILTER is not set +CONFIG_EZ80_EMAC_HPWORK=y CONFIG_ARCH_TIMERHOOK=y # @@ -296,6 +296,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +305,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -402,10 +407,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -432,7 +435,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -508,13 +510,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -768,7 +768,6 @@ CONFIG_EXAMPLES_POLL_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/fire-stm32v2/nsh/defconfig b/configs/fire-stm32v2/nsh/defconfig index 56b6462675d452b00799ea3b74ed56cda434e65c..4abebec236a36a2aefb2454431826d0b3a3fa36f 100644 --- a/configs/fire-stm32v2/nsh/defconfig +++ b/configs/fire-stm32v2/nsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -603,8 +601,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -839,15 +835,13 @@ CONFIG_ENC28J60_HPWORK=y # CONFIG_ENC28J60_HALFDUPPLEX is not set # CONFIG_ENC28J60_DUMPPACKET is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -973,13 +967,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1267,7 +1259,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/freedom-k64f/README.txt b/configs/freedom-k64f/README.txt index 2c6666a7e65d1eebe3b51361859aade1cd069fa5..3ea647ad580239f8e64ba1218ba4ad20bbce138e 100644 --- a/configs/freedom-k64f/README.txt +++ b/configs/freedom-k64f/README.txt @@ -193,9 +193,7 @@ Networking Support Networking Support CONFIG_NET=y : Enable Neworking CONFIG_NET_ETHERNET=y : Support Ethernet data link - CONFIG_NET_NOINTS=y : Should operative at non-interrupt level CONFIG_NET_SOCKOPTS=y : Enable socket operations - CONFIG_NET_MULTIBUFFER=y : Multi-packet buffer option required CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU CONFIG_NET_ARP=y : Enable ARP diff --git a/configs/freedom-k64f/netnsh/defconfig b/configs/freedom-k64f/netnsh/defconfig index 7303dda872938a9bad9f0dc9f65c46e3a02a9220..a16d6eae3f5df0a903d955f024658956b4c86735 100644 --- a/configs/freedom-k64f/netnsh/defconfig +++ b/configs/freedom-k64f/netnsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -346,8 +344,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -542,10 +538,9 @@ CONFIG_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -569,7 +564,6 @@ CONFIG_ETH0_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -646,13 +640,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -952,7 +944,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/freedom-k64f/nsh/defconfig b/configs/freedom-k64f/nsh/defconfig index 660add23d5b8bd3c3a779268d6fb15ad2d885191..d32846b6427fab61e878e608aca69c654acddfdf 100644 --- a/configs/freedom-k64f/nsh/defconfig +++ b/configs/freedom-k64f/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -336,8 +334,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -CONFIG_BOARDCTL_PWMTEST=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -516,7 +512,6 @@ CONFIG_SDIO_BLOCKSETUP=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -771,7 +766,6 @@ CONFIG_EXAMPLES_PWM_FREQUENCY=100 CONFIG_EXAMPLES_PWM_DURATION=5 CONFIG_EXAMPLES_PWM_DUTYPCT=50 # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/freedom-k64f/src/freedom-k64f.h b/configs/freedom-k64f/src/freedom-k64f.h index 0e0af54f96762d1ed510309cf92b2a93e051497c..40f788d7cd208543a6296cd0b61c7c2dda31111b 100644 --- a/configs/freedom-k64f/src/freedom-k64f.h +++ b/configs/freedom-k64f/src/freedom-k64f.h @@ -3,6 +3,7 @@ * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt + * Updated: Neil Hancock * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,6 +59,10 @@ #define HAVE_AUTOMOUNTER 1 #define HAVE_USBDEV 1 +#if defined(CONFIG_KINETIS_RTC) +#define HAVE_RTC_DRIVER 1 +#endif + /* Automount procfs */ #if !defined(CONFIG_FS_PROCFS) @@ -340,5 +345,17 @@ void k64_automount_initialize(void); void k64_automount_event(bool inserted); #endif +/************************************************************************************ + * Name: k64_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int k64_pwm_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_FREEDOM_K64F_SRC_FREEDOM_K64F_H */ diff --git a/configs/freedom-k64f/src/k64_bringup.c b/configs/freedom-k64f/src/k64_bringup.c index b307c7038ecb0c002a0f6dd7cb2bab882cee3f40..78bba052f4ca4a8e3818fa8f9f20392064c05ed8 100644 --- a/configs/freedom-k64f/src/k64_bringup.c +++ b/configs/freedom-k64f/src/k64_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/freedom-k64f/src/k64_bringup.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,11 @@ #include #include +#ifdef HAVE_RTC_DRIVER +# include +# include "kinetis_alarm.h" +#endif + #include "freedom-k64f.h" #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE) @@ -64,6 +69,9 @@ int k64_bringup(void) { int ret; +#ifdef HAVE_RTC_DRIVER + FAR struct rtc_lowerhalf_s *lower; +#endif #ifdef HAVE_PROC /* Mount the proc filesystem */ @@ -86,13 +94,12 @@ int k64_bringup(void) ret = k64_sdhc_initialize(); if (ret < 0) { - mcerr("ERROR: k64_sdhc_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: k64_sdhc_initialize() failed: %d\n", ret); } #ifdef CONFIG_FRDMK64F_SDHC_MOUNT else { - /* REVISIT: A delay seems to be required here or the mount will fail. */ /* Mount the volume on HSMCI0 */ ret = mount(CONFIG_FRDMK64F_SDHC_MOUNT_BLKDEV, @@ -102,20 +109,55 @@ int k64_bringup(void) if (ret < 0) { - mcerr("ERROR: Failed to mount %s: %d\n", - CONFIG_FRDMK64F_SDHC_MOUNT_MOUNTPOINT, errno); + syslog(LOG_ERR,"ERROR: Failed to mount %s: %d\n", + CONFIG_FRDMK64F_SDHC_MOUNT_MOUNTPOINT, errno); } } #endif /* CONFIG_FRDMK64F_SDHC_MOUNT */ #endif /* HAVE_MMCSD */ +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = k64_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: k64_pwm_setup() failed: %d\n", ret); + } +#endif + #ifdef HAVE_AUTOMOUNTER /* Initialize the auto-mounter */ k64_automount_initialize(); #endif +#ifdef HAVE_RTC_DRIVER + /* Instantiate the KINETIS lower-half RTC driver */ + + lower = kinetis_rtc_lowerhalf(); + if (!lower) + { + syslog(LOG_ERR, + "ERROR: Failed to instantiate the RTC lower-half driver\n"); + } + else + { + /* Bind the lower half driver and register the combined RTC driver + * as /dev/rtc0 + */ + + ret = rtc_initialize(0, lower); + if (ret < 0) + { + syslog(LOG_ERR, + "ERROR: Failed to bind/register the RTC driver: %d\n", + ret); + } + } +#endif + UNUSED(ret); return OK; } diff --git a/configs/freedom-k64f/src/k64_pwm.c b/configs/freedom-k64f/src/k64_pwm.c index 2434974122ac1ac2eaed412cd8446306c62d2184..547c19fb17ccbdc7e6bac85ace48fca5aa4d041d 100644 --- a/configs/freedom-k64f/src/k64_pwm.c +++ b/configs/freedom-k64f/src/k64_pwm.c @@ -60,15 +60,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: k64_pwm_setup * * Description: - * All Kinetis K architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int k64_pwm_setup(void) { FAR struct pwm_lowerhalf_s *pwm; static bool initialized = false; diff --git a/configs/freedom-kl25z/README.txt b/configs/freedom-kl25z/README.txt index a4a806dd4822e9302ac44c592ec1e8bcd3d3bf5c..b5114b4d43c466b36624dc4fe230786af8330bbf 100644 --- a/configs/freedom-kl25z/README.txt +++ b/configs/freedom-kl25z/README.txt @@ -294,98 +294,6 @@ instead of configure.sh: Where is one of the following: - minnsh: - ------ - - This is a experiment to see just how small we can get a usable NSH - configuration. This configuration has far fewer features than the nsh - configuration but is also a fraction of the size. - - 2016-06-21: - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 12282 196 736 13214 339e nuttx - - This minnsh configuration is a "proof-of-concept" and not very usable in - its current state. This configuration was created by disabling - everything possible INCLUDING file system support. Without file system - support, NuttX is pretty much crippled. Here are some of the - consequences of disabling the file system: - - - All features that depend on the file system are lost: device drivers, - mountpoints, message queues, named semaphores. - - - Without device drivers, you cannot interact with the RTOS using POSIX - interfaces. You would have to work with NuttX as with those other - tiny RTOSs: As a scheduler and a callable hardare abstraction layer - (HAL). - - - You cannot use any of the NuttX upper half device drivers since they - depend on the pseudo-file system and device nodes. You can, of - course, continue to use the lower half drivers either directly. Or, - perhaps, you could write some custom minnsh upper half drivers that - do not depend on a file system and expose a HAL interface. - - There is a special version of readline() the NSH uses when there is no - file system. It uses a special up_putc() to write data to the console - and a special function up_getc() to read data from the console. - - - The current up_getc() implementationsa are a kludge. They are - analogous to the up_putc() implementations: They directly poll the - hardware for serial availability, locking up all lower priority tasks - in the entire system while they poll. So a version of NSH that uses - up_getc() essentially blocks the system until a character is received. - - This, of course, could be fixed by creating a special, upper half - implementation of the interrupt-driven serial lower half (like - stm32_serial) that just supports single character console I/O - (perhaps called up_putc and up_getc?). The NSH could wait for serial - input without blocking the system. But then that would increase the - footprint too. - - So although the minnsh configurations are a good starting point for - making things small, they not are really very practical. Why might - you want a NuttX minnsh solution? Perhaps you have software that runs - on a family of chips including some very tiny MCUs. Then perhaps having - the RTOS compatibility would justify the loss of functionality? - - You can re-enable the file system and (true) serial console with - these settings: - - Enable the file system: - CONFIG_NFILE_DESCRIPTORS=5 - CONFIG_NFILE_STREAMS=5 - - Enable the console device: - CONFIG_DEV_CONSOLE=y - - Disable most new NSH commands. Some like 'ls' are really mandatory - with a file system: - CONFIG_NSH_DISABLE_xxx=y - - Enable the upper half serial driver: - CONFIG_SERIAL=y - CONFIG_STANDARD_SERIAL=y - - Enable the USART1 serial driver: - CONFIG_STM32_USART1=y - CONFIG_STM32_USART1_SERIALDRIVER=y - CONFIG_USART1_SERIAL_CONSOLE=y - - CONFIG_USART1_2STOP=0 - CONFIG_USART1_BAUD=115200 - CONFIG_USART1_BITS=8 - CONFIG_USART1_PARITY=0 - CONFIG_USART1_RXBUFSIZE=16 - CONFIG_USART1_TXBUFSIZE=16 - - With these changes, NSH should behave better and we preserve the device - driver interface. But this result in a total size increase of about - 7KB: That is about 5KB of additional OS support for the file system and - serial console PLUS about 2KB for the 'ls' command logic (including OS - support for opendir(), readdir(), closedir(), stat(), and probably other - things). - nsh: --- Configures the NuttShell (nsh) located at apps/examples/nsh. The diff --git a/configs/freedom-kl25z/minnsh/Make.defs b/configs/freedom-kl25z/minnsh/Make.defs deleted file mode 100644 index 453b86e4cfa7886b5f569edab76e6cd576376b16..0000000000000000000000000000000000000000 --- a/configs/freedom-kl25z/minnsh/Make.defs +++ /dev/null @@ -1,124 +0,0 @@ -############################################################################ -# configs/freedom-kl25z/minnsh/Make.defs -# -# Copyright (C) 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/armv6-m/Toolchain.defs - -LDSCRIPT = ld.script - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" -else - # Linux/Cygwin-native toolchain - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(ARCROSSDEV)ar rcs -NM = $(ARCROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - LDFLAGS += -g -endif - - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = -ifeq ($(CONFIG_HOST_WINDOWS),y) - HOSTEXEEXT = .exe -else - HOSTEXEEXT = -endif - -ifeq ($(WINTOOL),y) - # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh -else - # Linux/Cygwin-native host tools - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) -endif - diff --git a/configs/freedom-kl25z/minnsh/defconfig b/configs/freedom-kl25z/minnsh/defconfig deleted file mode 100644 index 89935cad023bc6ced325547d60218e1a5df5c950..0000000000000000000000000000000000000000 --- a/configs/freedom-kl25z/minnsh/defconfig +++ /dev/null @@ -1,801 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_DEFAULT_SMALL=y -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -CONFIG_MOTOROLA_SREC=y -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_ALERT is not set -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -CONFIG_ARCH_CHIP_KL=y -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -# CONFIG_ARCH_ARM7TDMI is not set -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -CONFIG_ARCH_CORTEXM0=y -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="armv6-m" -CONFIG_ARCH_CHIP="kl" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -CONFIG_ARCH_HAVE_CMNVECTOR=y -# CONFIG_ARMV7M_CMNVECTOR is not set -# CONFIG_ARMV7M_LAZYFPU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set - -# -# ARMV6M Configuration Options -# -# CONFIG_ARMV6M_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODEREDL is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV6M_TOOLCHAIN_GNU_EABIL=y -# CONFIG_KL_GPIOIRQ is not set - -# -# Kinetis Configuration Options -# -# CONFIG_ARCH_CHIP_MKL25Z64 is not set -CONFIG_ARCH_CHIP_MKL25Z128=y -# CONFIG_ARCH_CHIP_MKL26Z128 is not set -CONFIG_ARCH_FAMILY_KL2X=y - -# -# Kinetis Peripheral Support -# -# CONFIG_KL_TRACE is not set -# CONFIG_KL_FLEXBUS is not set -CONFIG_KL_UART0=y -# CONFIG_KL_UART1 is not set -# CONFIG_KL_UART2 is not set -# CONFIG_KL_FLEXCAN0 is not set -# CONFIG_KL_FLEXCAN1 is not set -CONFIG_KL_SPI0=y -CONFIG_KL_SPI1=y -# CONFIG_KL_SPI2 is not set -# CONFIG_KL_I2C0 is not set -# CONFIG_KL_I2C1 is not set -# CONFIG_KL_I2S is not set -# CONFIG_KL_DAC0 is not set -# CONFIG_KL_DAC1 is not set -# CONFIG_KL_ADC0 is not set -# CONFIG_KL_ADC1 is not set -# CONFIG_KL_CMP is not set -# CONFIG_KL_VREF is not set -# CONFIG_KL_TPM0 is not set -# CONFIG_KL_TPM1 is not set -# CONFIG_KL_TPM2 is not set -# CONFIG_KL_LPTIMER is not set -# CONFIG_KL_RTC is not set -# CONFIG_KL_EWM is not set -# CONFIG_KL_CMT is not set -# CONFIG_KL_USBOTG is not set -# CONFIG_KL_USBDCD is not set -# CONFIG_KL_LLWU is not set -# CONFIG_KL_TSI is not set -# CONFIG_KL_FTFL is not set -# CONFIG_KL_DMA is not set -# CONFIG_KL_CRC is not set -# CONFIG_KL_PDB is not set -# CONFIG_KL_PIT is not set -CONFIG_KL_SYSTICK_CORECLK=y -# CONFIG_KL_SYSTICK_CORECLK_DIV16 is not set - -# -# Kinetis GPIO Interrupt Configuration -# - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -CONFIG_ARCH_HAVE_IRQPRIO=y -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -# CONFIG_ARCH_HAVE_POWEROFF is not set -CONFIG_ARCH_HAVE_RESET=y -# CONFIG_ARCH_IRQPRIO is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=2988 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=0 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x1FFFF000 -CONFIG_RAM_SIZE=16384 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_FREEDOM_KL25Z=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="freedom-kl25z" - -# -# Common Board Options -# -CONFIG_ARCH_HAVE_LEDS=y -CONFIG_ARCH_LEDS=y -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -# CONFIG_LIB_BOARDCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2013 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=26 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 - -# -# Tasks and Scheduling -# -# CONFIG_SPINLOCK is not set -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=8 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -# CONFIG_DEV_CONSOLE is not set -CONFIG_FDCLONE_DISABLE=y -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=0 -CONFIG_NFILE_STREAMS=0 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -# CONFIG_MODULE is not set - -# -# Work queue support -# - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1536 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1536 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -# CONFIG_DEV_NULL is not set -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -# CONFIG_LCD is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_USERLED is not set -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -CONFIG_UART0_SERIALDRIVER=y -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -# CONFIG_OTHER_UART_SERIALDRIVER is not set -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_UART0_SERIAL_CONSOLE=y -# CONFIG_OTHER_SERIAL_CONSOLE is not set -# CONFIG_NO_SERIAL_CONSOLE is not set - -# -# UART0 Configuration -# -CONFIG_UART0_RXBUFSIZE=256 -CONFIG_UART0_TXBUFSIZE=256 -CONFIG_UART0_BAUD=115200 -CONFIG_UART0_BITS=8 -CONFIG_UART0_PARITY=0 -CONFIG_UART0_2STOP=0 -# CONFIG_UART0_IFLOWCONTROL is not set -# CONFIG_UART0_OFLOWCONTROL is not set -# CONFIG_UART0_DMA is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -# CONFIG_SYSLOG_SERIAL_CONSOLE is not set -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_NONE=y -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -CONFIG_MM_SMALL=y -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# -# CONFIG_WIRELESS is not set - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=0 -# CONFIG_LIBM is not set -CONFIG_NOPRINTF_FIELDWIDTH=y -# CONFIG_LIBC_FLOATINGPOINT is not set -# CONFIG_LIBC_LONG_LONG is not set -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=80 -CONFIG_NSH_DISABLE_SEMICOLON=y -CONFIG_NSH_MAXARGUMENTS=6 -# CONFIG_NSH_ARGCAT is not set -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set - -# -# Disable Individual commands -# -CONFIG_NSH_DISABLE_ADDROUTE=y -CONFIG_NSH_DISABLE_BASENAME=y -# CONFIG_NSH_DISABLE_CAT is not set -CONFIG_NSH_DISABLE_CD=y -CONFIG_NSH_DISABLE_CP=y -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DF=y -CONFIG_NSH_DISABLE_DELROUTE=y -CONFIG_NSH_DISABLE_DIRNAME=y -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -CONFIG_NSH_DISABLE_GET=y -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -CONFIG_NSH_DISABLE_IFCONFIG=y -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -CONFIG_NSH_DISABLE_MKDIR=y -# CONFIG_NSH_DISABLE_MKFIFO is not set -CONFIG_NSH_DISABLE_MKRD=y -# CONFIG_NSH_DISABLE_MH is not set -CONFIG_NSH_DISABLE_MOUNT=y -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_PS is not set -CONFIG_NSH_DISABLE_PUT=y -# CONFIG_NSH_DISABLE_PWD is not set -CONFIG_NSH_DISABLE_RM=y -CONFIG_NSH_DISABLE_RMDIR=y -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -CONFIG_NSH_DISABLE_TIME=y -# CONFIG_NSH_DISABLE_TEST is not set -CONFIG_NSH_DISABLE_UMOUNT=y -CONFIG_NSH_DISABLE_UNAME=y -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_NSH_DISABLE_WGET=y -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CODECS_BUFSIZE=128 -# CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_NSH_FILEIOSIZE=64 - -# -# Scripting Support -# -CONFIG_NSH_DISABLESCRIPT=y - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/freedom-kl25z/minnsh/setenv.sh b/configs/freedom-kl25z/minnsh/setenv.sh deleted file mode 100755 index 2541df62fdff3075633bb56a85ca3806e1decc48..0000000000000000000000000000000000000000 --- a/configs/freedom-kl25z/minnsh/setenv.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# configs/freedom-kl25z/minnsh/setenv.sh -# -# Copyright (C) 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$_" = "$0" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -WD=`pwd` -if [ ! -x "setenv.sh" ]; then - echo "This script must be executed from the top-level NuttX build directory" - exit 1 -fi - -if [ -z "${PATH_ORIG}" ]; then - export PATH_ORIG="${PATH}" -fi - -# This is the Cygwin path to the location where I installed the RIDE -# toolchain under windows. You will also have to edit this if you install -# the RIDE toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin" - -# This is the Cygwin path to the location where I installed the CodeSourcery -# toolchain under windows. You will also have to edit this if you install -# the CodeSourcery toolchain in any other location -#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" - -# These are the Cygwin paths to the locations where I installed the Atollic -# toolchain under windows. You will also have to edit this if you install -# the Atollic toolchain in any other location. /usr/bin is added before -# the Atollic bin path because there is are binaries named gcc.exe and g++.exe -# at those locations as well. -#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" -#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" - -# This is the Cygwin path to the location where I build the buildroot -# toolchain. -export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" - -# Add the path to the toolchain to the PATH varialble -export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" - -echo "PATH : ${PATH}" diff --git a/configs/freedom-kl25z/nsh/defconfig b/configs/freedom-kl25z/nsh/defconfig index c313a38f01fafface810637be4170361c6f71cf8..4ce766e4e741b171cea1e10b416de3013742deea 100644 --- a/configs/freedom-kl25z/nsh/defconfig +++ b/configs/freedom-kl25z/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -268,8 +266,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -CONFIG_BOARDCTL_PWMTEST=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -432,7 +428,6 @@ CONFIG_PWM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -662,7 +657,6 @@ CONFIG_EXAMPLES_PWM_FREQUENCY=100 CONFIG_EXAMPLES_PWM_DURATION=5 CONFIG_EXAMPLES_PWM_DUTYPCT=50 # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/freedom-kl25z/src/freedom-kl25z.h b/configs/freedom-kl25z/src/freedom-kl25z.h index ca5ce242d818d510d1d50b77fb15741672eb9e6d..8c7c9f00928b1e164da3e7f06f834aba71324bc2 100644 --- a/configs/freedom-kl25z/src/freedom-kl25z.h +++ b/configs/freedom-kl25z/src/freedom-kl25z.h @@ -1,8 +1,7 @@ /**************************************************************************************************** * configs/freedom-kl25z/src/freedom-kl25z.h - * arch/arm/src/board/freedom-kl25z.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -137,6 +136,17 @@ void weak_function kl_usbinitialize(void); void kl_led_initialize(void); #endif +/************************************************************************************ + * Name: kl_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int kl_pwm_setup(void); +#endif #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */ diff --git a/configs/freedom-kl25z/src/kl_appinit.c b/configs/freedom-kl25z/src/kl_appinit.c index 1f0d218ece2fae59a780b7b1835f14c22be855e7..ef425471dd53c1984e376910876cbaecc90dc475 100644 --- a/configs/freedom-kl25z/src/kl_appinit.c +++ b/configs/freedom-kl25z/src/kl_appinit.c @@ -45,11 +45,9 @@ #include -#ifdef CONFIG_LIB_BOARDCTL +#include "freedom-kl25z.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ +#ifdef CONFIG_LIB_BOARDCTL /**************************************************************************** * Public Functions @@ -80,15 +78,27 @@ int board_app_initialize(uintptr_t arg) { -#if defined(CONFIG_SENSORS_ADXL345) int ret; + #if defined(CONFIG_SENSORS_ADXL345) ret = adxl345_archinitialize(0); if (ret < 0) { - _err("ERROR: adxl345_archinitialize failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: adxl345_archinitialize failed: %d\n", ret); } #endif + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = kl_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: k64_pwm_setup() failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/freedom-kl25z/src/kl_pwm.c b/configs/freedom-kl25z/src/kl_pwm.c index 1db53f5a267271a366af450cb187814ee9e050b5..6f43a06daaa3864a1eb9c7b6f202b840d57f599b 100644 --- a/configs/freedom-kl25z/src/kl_pwm.c +++ b/configs/freedom-kl25z/src/kl_pwm.c @@ -75,15 +75,14 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: kl_pwm_setup * * Description: - * All Kinetis KL architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int kl_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/freedom-kl26z/README.txt b/configs/freedom-kl26z/README.txt index 55f593c7d07cf5c681e4ad3e2b4ceeb76f89af16..6237f71ad9f9ec1518e7ebf9ff0894da25176975 100644 --- a/configs/freedom-kl26z/README.txt +++ b/configs/freedom-kl26z/README.txt @@ -272,93 +272,6 @@ instead of configure.sh: Where is one of the following: - minnsh: - ------ - - This is a experiment to see just how small we can get a usable NSH - configuration. This configuration has far fewer features than the nsh - configuration but is also a fraction of the size. - - This minnsh configuration is a "proof-of-concept" and not very usable in - its current state. This configuration was created by disabling - everything possible INCLUDING file system support. Without file system - support, NuttX is pretty much crippled. Here are some of the - consequences of disabling the file system: - - - All features that depend on the file system are lost: device drivers, - mountpoints, message queues, named semaphores. - - - Without device drivers, you cannot interact with the RTOS using POSIX - interfaces. You would have to work with NuttX as with those other - tiny RTOSs: As a scheduler and a callable hardare abstraction layer - (HAL). - - - You cannot use any of the NuttX upper half device drivers since they - depend on the pseudo-file system and device nodes. You can, of - course, continue to use the lower half drivers either directly. Or, - perhaps, you could write some custom minnsh upper half drivers that - do not depend on a file system and expose a HAL interface. - - There is a special version of readline() the NSH uses when there is no - file system. It uses a special up_putc() to write data to the console - and a special function up_getc() to read data from the console. - - - The current up_getc() implementationsa are a kludge. They are - analogous to the up_putc() implementations: They directly poll the - hardware for serial availability, locking up all lower priority tasks - in the entire system while they poll. So a version of NSH that uses - up_getc() essentially blocks the system until a character is received. - - This, of course, could be fixed by creating a special, upper half - implementation of the interrupt-driven serial lower half (like - stm32_serial) that just supports single character console I/O - (perhaps called up_putc and up_getc?). The NSH could wait for serial - input without blocking the system. But then that would increase the - footprint too. - - So although the minnsh configurations are a good starting point for - making things small, they not are really very practical. Why might - you want a NuttX minnsh solution? Perhaps you have software that runs - on a family of chips including some very tiny MCUs. Then perhaps having - the RTOS compatibility would justify the loss of functionality? - - You can re-enable the file system and (true) serial console with - these settings: - - Enable the file system: - CONFIG_NFILE_DESCRIPTORS=5 - CONFIG_NFILE_STREAMS=5 - - Enable the console device: - CONFIG_DEV_CONSOLE=y - - Disable most new NSH commands. Some like 'ls' are really mandatory - with a file system: - CONFIG_NSH_DISABLE_xxx=y - - Enable the upper half serial driver: - CONFIG_SERIAL=y - CONFIG_STANDARD_SERIAL=y - - Enable the USART1 serial driver: - CONFIG_STM32_USART1=y - CONFIG_STM32_USART1_SERIALDRIVER=y - CONFIG_USART1_SERIAL_CONSOLE=y - - CONFIG_USART1_2STOP=0 - CONFIG_USART1_BAUD=115200 - CONFIG_USART1_BITS=8 - CONFIG_USART1_PARITY=0 - CONFIG_USART1_RXBUFSIZE=16 - CONFIG_USART1_TXBUFSIZE=16 - - With these changes, NSH should behave better and we preserve the device - driver interface. But this result in a total size increase of about - 7KB: That is about 5KB of additional OS support for the file system and - serial console PLUS about 2KB for the 'ls' command logic (including OS - support for opendir(), readdir(), closedir(), stat(), and probably other - things). - nsh: --- Configures the NuttShell (nsh) located at apps/examples/nsh. The diff --git a/configs/freedom-kl26z/minnsh/Make.defs b/configs/freedom-kl26z/minnsh/Make.defs deleted file mode 100644 index 380541961dc0b32a9f32f1711594c92d0089c256..0000000000000000000000000000000000000000 --- a/configs/freedom-kl26z/minnsh/Make.defs +++ /dev/null @@ -1,124 +0,0 @@ -############################################################################ -# configs/freedom-kl26z/minnsh/Make.defs -# -# Copyright (C) 2015 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/armv6-m/Toolchain.defs - -LDSCRIPT = ld.script - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" -else - # Linux/Cygwin-native toolchain - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(ARCROSSDEV)ar rcs -NM = $(ARCROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - LDFLAGS += -g -endif - - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = -ifeq ($(CONFIG_HOST_WINDOWS),y) - HOSTEXEEXT = .exe -else - HOSTEXEEXT = -endif - -ifeq ($(WINTOOL),y) - # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh -else - # Linux/Cygwin-native host tools - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) -endif - diff --git a/configs/freedom-kl26z/minnsh/defconfig b/configs/freedom-kl26z/minnsh/defconfig deleted file mode 100644 index 8852ec343bbf4eec4c09b78d9b09ba181e7e4642..0000000000000000000000000000000000000000 --- a/configs/freedom-kl26z/minnsh/defconfig +++ /dev/null @@ -1,801 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_DEFAULT_SMALL=y -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -CONFIG_MOTOROLA_SREC=y -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_ALERT is not set -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -CONFIG_ARCH_CHIP_KL=y -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -# CONFIG_ARCH_CHIP_LPC11XX is not set -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -# CONFIG_ARCH_ARM7TDMI is not set -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -CONFIG_ARCH_CORTEXM0=y -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="armv6-m" -CONFIG_ARCH_CHIP="kl" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -CONFIG_ARCH_HAVE_CMNVECTOR=y -# CONFIG_ARMV7M_CMNVECTOR is not set -# CONFIG_ARMV7M_LAZYFPU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set - -# -# ARMV6M Configuration Options -# -# CONFIG_ARMV6M_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODEREDL is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV6M_TOOLCHAIN_GNU_EABIL=y -# CONFIG_KL_GPIOIRQ is not set - -# -# Kinetis Configuration Options -# -# CONFIG_ARCH_CHIP_MKL25Z64 is not set -# CONFIG_ARCH_CHIP_MKL25Z128 is not set -CONFIG_ARCH_CHIP_MKL26Z128=y -CONFIG_ARCH_FAMILY_KL2X=y - -# -# Kinetis Peripheral Support -# -# CONFIG_KL_TRACE is not set -# CONFIG_KL_FLEXBUS is not set -CONFIG_KL_UART0=y -# CONFIG_KL_UART1 is not set -# CONFIG_KL_UART2 is not set -# CONFIG_KL_FLEXCAN0 is not set -# CONFIG_KL_FLEXCAN1 is not set -CONFIG_KL_SPI0=y -CONFIG_KL_SPI1=y -# CONFIG_KL_SPI2 is not set -# CONFIG_KL_I2C0 is not set -# CONFIG_KL_I2C1 is not set -# CONFIG_KL_I2S is not set -# CONFIG_KL_DAC0 is not set -# CONFIG_KL_DAC1 is not set -# CONFIG_KL_ADC0 is not set -# CONFIG_KL_ADC1 is not set -# CONFIG_KL_CMP is not set -# CONFIG_KL_VREF is not set -# CONFIG_KL_TPM0 is not set -# CONFIG_KL_TPM1 is not set -# CONFIG_KL_TPM2 is not set -# CONFIG_KL_LPTIMER is not set -# CONFIG_KL_RTC is not set -# CONFIG_KL_EWM is not set -# CONFIG_KL_CMT is not set -# CONFIG_KL_USBOTG is not set -# CONFIG_KL_USBDCD is not set -# CONFIG_KL_LLWU is not set -# CONFIG_KL_TSI is not set -# CONFIG_KL_FTFL is not set -# CONFIG_KL_DMA is not set -# CONFIG_KL_CRC is not set -# CONFIG_KL_PDB is not set -# CONFIG_KL_PIT is not set -CONFIG_KL_SYSTICK_CORECLK=y -# CONFIG_KL_SYSTICK_CORECLK_DIV16 is not set - -# -# Kinetis GPIO Interrupt Configuration -# - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -CONFIG_ARCH_HAVE_IRQPRIO=y -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -# CONFIG_ARCH_HAVE_POWEROFF is not set -CONFIG_ARCH_HAVE_RESET=y -# CONFIG_ARCH_IRQPRIO is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=2988 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=0 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x1FFFF000 -CONFIG_RAM_SIZE=16384 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_FREEDOM_KL26Z=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="freedom-kl26z" - -# -# Common Board Options -# -CONFIG_ARCH_HAVE_LEDS=y -CONFIG_ARCH_LEDS=y -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -# CONFIG_LIB_BOARDCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2013 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=26 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 - -# -# Tasks and Scheduling -# -# CONFIG_SPINLOCK is not set -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=8 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -# CONFIG_DEV_CONSOLE is not set -CONFIG_FDCLONE_DISABLE=y -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=0 -CONFIG_NFILE_STREAMS=0 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -# CONFIG_MODULE is not set - -# -# Work queue support -# - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1536 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1536 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -# CONFIG_DEV_NULL is not set -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -# CONFIG_LCD is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_USERLED is not set -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -CONFIG_UART0_SERIALDRIVER=y -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -# CONFIG_OTHER_UART_SERIALDRIVER is not set -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_UART0_SERIAL_CONSOLE=y -# CONFIG_OTHER_SERIAL_CONSOLE is not set -# CONFIG_NO_SERIAL_CONSOLE is not set - -# -# UART0 Configuration -# -CONFIG_UART0_RXBUFSIZE=256 -CONFIG_UART0_TXBUFSIZE=256 -CONFIG_UART0_BAUD=115200 -CONFIG_UART0_BITS=8 -CONFIG_UART0_PARITY=0 -CONFIG_UART0_2STOP=0 -# CONFIG_UART0_IFLOWCONTROL is not set -# CONFIG_UART0_OFLOWCONTROL is not set -# CONFIG_UART0_DMA is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -# CONFIG_SYSLOG_SERIAL_CONSOLE is not set -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_NONE=y -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -CONFIG_MM_SMALL=y -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# -# CONFIG_WIRELESS is not set - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=0 -# CONFIG_LIBM is not set -CONFIG_NOPRINTF_FIELDWIDTH=y -# CONFIG_LIBC_FLOATINGPOINT is not set -# CONFIG_LIBC_LONG_LONG is not set -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=80 -CONFIG_NSH_DISABLE_SEMICOLON=y -CONFIG_NSH_MAXARGUMENTS=6 -# CONFIG_NSH_ARGCAT is not set -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set - -# -# Disable Individual commands -# -CONFIG_NSH_DISABLE_ADDROUTE=y -CONFIG_NSH_DISABLE_BASENAME=y -# CONFIG_NSH_DISABLE_CAT is not set -CONFIG_NSH_DISABLE_CD=y -CONFIG_NSH_DISABLE_CP=y -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DF=y -CONFIG_NSH_DISABLE_DELROUTE=y -CONFIG_NSH_DISABLE_DIRNAME=y -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -CONFIG_NSH_DISABLE_GET=y -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -CONFIG_NSH_DISABLE_IFCONFIG=y -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -CONFIG_NSH_DISABLE_MKDIR=y -# CONFIG_NSH_DISABLE_MKFIFO is not set -CONFIG_NSH_DISABLE_MKRD=y -# CONFIG_NSH_DISABLE_MH is not set -CONFIG_NSH_DISABLE_MOUNT=y -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_PS is not set -CONFIG_NSH_DISABLE_PUT=y -# CONFIG_NSH_DISABLE_PWD is not set -CONFIG_NSH_DISABLE_RM=y -CONFIG_NSH_DISABLE_RMDIR=y -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -CONFIG_NSH_DISABLE_TIME=y -# CONFIG_NSH_DISABLE_TEST is not set -CONFIG_NSH_DISABLE_UMOUNT=y -CONFIG_NSH_DISABLE_UNAME=y -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_NSH_DISABLE_WGET=y -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CODECS_BUFSIZE=128 -# CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_NSH_FILEIOSIZE=64 - -# -# Scripting Support -# -CONFIG_NSH_DISABLESCRIPT=y - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/freedom-kl26z/nsh/defconfig b/configs/freedom-kl26z/nsh/defconfig index 73010ec82437a9e087b8b0d3749a58312fa2c44d..34ecf777454d5be9951e671368cc492529bb0936 100644 --- a/configs/freedom-kl26z/nsh/defconfig +++ b/configs/freedom-kl26z/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -268,8 +266,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -CONFIG_BOARDCTL_PWMTEST=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -426,7 +422,6 @@ CONFIG_PWM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -654,7 +649,6 @@ CONFIG_EXAMPLES_PWM_FREQUENCY=100 CONFIG_EXAMPLES_PWM_DURATION=5 CONFIG_EXAMPLES_PWM_DUTYPCT=50 # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/freedom-kl26z/src/freedom-kl26z.h b/configs/freedom-kl26z/src/freedom-kl26z.h index 053101db5b92447d8819687bb23e1b0cf71ac804..e1207149792f458005d1943d9a1e1ab33c50055d 100644 --- a/configs/freedom-kl26z/src/freedom-kl26z.h +++ b/configs/freedom-kl26z/src/freedom-kl26z.h @@ -136,5 +136,17 @@ void weak_function kl_usbinitialize(void); void kl_led_initialize(void); #endif +/************************************************************************************ + * Name: kl_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int kl_pwm_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H */ diff --git a/configs/freedom-kl26z/src/kl_appinit.c b/configs/freedom-kl26z/src/kl_appinit.c index 96ac70a0617e389ba9dee0d328221869b7d1f797..6b6550c91551ade28a87ee0165615ebb540da5c7 100644 --- a/configs/freedom-kl26z/src/kl_appinit.c +++ b/configs/freedom-kl26z/src/kl_appinit.c @@ -40,14 +40,13 @@ #include #include +#include #include -#ifdef CONFIG_LIB_BOARDCTL +#include "freedom-kl26z.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ +#ifdef CONFIG_LIB_BOARDCTL /**************************************************************************** * Public Functions @@ -78,6 +77,19 @@ int board_app_initialize(uintptr_t arg) { + int ret; + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = kl_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: kl_pwm_setup() failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/freedom-kl26z/src/kl_boardinitialize.c b/configs/freedom-kl26z/src/kl_boardinitialize.c index 3a3be5190a275536694f15c73a20505efafc030b..f976a86727e7e1506885fb26489b762016d85d2b 100644 --- a/configs/freedom-kl26z/src/kl_boardinitialize.c +++ b/configs/freedom-kl26z/src/kl_boardinitialize.c @@ -47,14 +47,6 @@ #include "up_arch.h" #include "freedom-kl26z.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/freedom-kl26z/src/kl_pwm.c b/configs/freedom-kl26z/src/kl_pwm.c index cb5b6af3f8a0c748b685f31c91a1c61ab2bc0928..d256e2281eada38b7005687d8b42744946c51540 100644 --- a/configs/freedom-kl26z/src/kl_pwm.c +++ b/configs/freedom-kl26z/src/kl_pwm.c @@ -66,24 +66,19 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: kl_pwm_setup * * Description: - * All Kinetis KL architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int kl_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/hymini-stm32v/README.txt b/configs/hymini-stm32v/README.txt index e6643aaed34b1b214d9513f0e4452f2df7e3eb26..7fec3b1562ca1d10fad8bedbf2ba146e5a6bdc87 100644 --- a/configs/hymini-stm32v/README.txt +++ b/configs/hymini-stm32v/README.txt @@ -561,14 +561,6 @@ can be selected as follow: Where is one of the following: - buttons: - -------- - - Uses apps/examples/buttons to exercise HY-MiniSTM32V buttons and - button interrupts. - - CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GNU EABI toolchain - nsh and nsh2: ------------ Configure the NuttShell (nsh) located at examples/nsh. @@ -599,7 +591,6 @@ Where is one of the following: Built-in None apps/examples/nx Apps apps/examples/nxhello apps/system/usbmsc (4) - apps/examples/buttons apps/examples/nximage =========== ======================= ================================ diff --git a/configs/hymini-stm32v/buttons/setenv.sh b/configs/hymini-stm32v/buttons/setenv.sh deleted file mode 100755 index df0dba3180365deafc6e9f48a4aa6326eb3c9667..0000000000000000000000000000000000000000 --- a/configs/hymini-stm32v/buttons/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# configs/hymini-stm32v/buttons/setenv.sh -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - -WD=`pwd` -export RIDE_BIN="/cygdrive/c/Program Files/Raisonance/Ride/arm-gcc/bin" -export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:${RIDE_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" - -echo "PATH : ${PATH}" diff --git a/configs/hymini-stm32v/nsh/defconfig b/configs/hymini-stm32v/nsh/defconfig index 1278418787c555319080f8a797360e1244454f9f..54662444e9002cf0ac7f035c2b4f62c34678e891 100644 --- a/configs/hymini-stm32v/nsh/defconfig +++ b/configs/hymini-stm32v/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -554,8 +552,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -744,7 +740,6 @@ CONFIG_SDIO_PREFLIGHT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -980,7 +975,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/hymini-stm32v/nsh2/defconfig b/configs/hymini-stm32v/nsh2/defconfig index 79ee362dc149bc7019dd9e8cbfd86e516b3204ed..6998b185dc0b5451597d6be2ee846794c866c7e4 100644 --- a/configs/hymini-stm32v/nsh2/defconfig +++ b/configs/hymini-stm32v/nsh2/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -352,6 +352,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -467,6 +473,9 @@ CONFIG_STM32_USART1_SERIALDRIVER=y CONFIG_SDIO_DMAPRIO=0x00001000 CONFIG_STM32_HAVE_RTC_COUNTER=y # CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set +CONFIG_RTC_LSECLOCK=y +# CONFIG_RTC_LSICLOCK is not set +# CONFIG_RTC_HSECLOCK is not set # # USB FS Host Configuration @@ -570,8 +579,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -595,9 +602,6 @@ CONFIG_USEC_PER_TICK=10000 # CONFIG_CLOCK_MONOTONIC is not set CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2016 -CONFIG_START_MONTH=7 -CONFIG_START_DAY=28 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=8 CONFIG_WDOG_INTRESERVE=1 @@ -707,14 +711,14 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -726,7 +730,12 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # # CONFIG_TIMER is not set # CONFIG_ONESHOT is not set -# CONFIG_RTC is not set +CONFIG_RTC=y +# CONFIG_RTC_DATETIME is not set +# CONFIG_RTC_HIRES is not set +# CONFIG_RTC_ALARM is not set +# CONFIG_RTC_DRIVER is not set +# CONFIG_RTC_EXTERNAL is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set @@ -828,7 +837,6 @@ CONFIG_SDIO_PREFLIGHT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1170,20 +1178,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="Key A" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Key B" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1251,7 +1247,6 @@ CONFIG_EXAMPLES_NXIMAGE_YSCALE1p0=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/hymini-stm32v/usbmsc/defconfig b/configs/hymini-stm32v/usbmsc/defconfig index a9bf81df95d745506a626be6cf11d04cae28e946..9d5759bf6cd1a868ebc3726500c09de5006f0f56 100644 --- a/configs/hymini-stm32v/usbmsc/defconfig +++ b/configs/hymini-stm32v/usbmsc/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -559,8 +557,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -750,7 +746,6 @@ CONFIG_SDIO_PREFLIGHT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1033,7 +1028,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/hymini-stm32v/usbnsh/defconfig b/configs/hymini-stm32v/usbnsh/defconfig index 1c7d14202fd09b1fb5dd58b3e583126431dd7c3a..2d2497ca471a865d9289c1e83568f12ae9fd5a22 100644 --- a/configs/hymini-stm32v/usbnsh/defconfig +++ b/configs/hymini-stm32v/usbnsh/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -350,6 +350,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -548,8 +554,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -684,6 +688,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -727,7 +733,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -967,20 +972,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="Key A" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Key B" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1012,7 +1005,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/hymini-stm32v/usbserial/defconfig b/configs/hymini-stm32v/usbserial/defconfig index eb86d3a7e525d66d957947497125da083b248438..13be18558cd1b3e89717e99d5f2a320dc50261f9 100644 --- a/configs/hymini-stm32v/usbserial/defconfig +++ b/configs/hymini-stm32v/usbserial/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -550,8 +548,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -724,7 +720,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -996,7 +991,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/kwikstik-k40/ostest/defconfig b/configs/kwikstik-k40/ostest/defconfig index f80657b514cd284f16969404555f282bd736826e..4ea31a1c0f7a53be276a63339fb961248537e63a 100644 --- a/configs/kwikstik-k40/ostest/defconfig +++ b/configs/kwikstik-k40/ostest/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -465,7 +463,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -688,7 +685,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/launchxl-tms57004/nsh/defconfig b/configs/launchxl-tms57004/nsh/defconfig index c52311e79a24b63d6fa0d37c31093e8253f27a69..d59a2f60f5b1a2d6c10b6001215214660b1faf97 100644 --- a/configs/launchxl-tms57004/nsh/defconfig +++ b/configs/launchxl-tms57004/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -254,8 +252,6 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -437,7 +433,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -687,7 +682,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lincoln60/netnsh/defconfig b/configs/lincoln60/netnsh/defconfig index 6875687ca8ff3d450060513521c6274363d2932b..8e9cdf53c6c5681df0cff21e9b4fc7150c4f699b 100644 --- a/configs/lincoln60/netnsh/defconfig +++ b/configs/lincoln60/netnsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -298,7 +296,7 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x10000000 -CONFIG_RAM_SIZE=65536 +CONFIG_RAM_SIZE=32768 # CONFIG_ARCH_HAVE_SDRAM is not set # @@ -325,8 +323,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -521,10 +517,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -548,7 +543,6 @@ CONFIG_ETH0_PHY_KSZ8041=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -625,13 +619,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -915,7 +907,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lincoln60/nsh/defconfig b/configs/lincoln60/nsh/defconfig index 524b76aec81eba8d8da7bf3e7b72a23b474ef35a..31e8eae34ac28d67f3f2c1bea03faeae33cef0ef 100644 --- a/configs/lincoln60/nsh/defconfig +++ b/configs/lincoln60/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -275,7 +273,7 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x10000000 -CONFIG_RAM_SIZE=65536 +CONFIG_RAM_SIZE=32768 # CONFIG_ARCH_HAVE_SDRAM is not set # @@ -302,8 +300,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -466,7 +462,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -704,7 +699,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lincoln60/thttpd-binfs/defconfig b/configs/lincoln60/thttpd-binfs/defconfig index 4d54e205603f04e26c7d470354f8015d0eeb2b28..f1d8ab9bbfc35a48bcb61d8960527d1860585e4f 100644 --- a/configs/lincoln60/thttpd-binfs/defconfig +++ b/configs/lincoln60/thttpd-binfs/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -298,7 +296,7 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x10000000 -CONFIG_RAM_SIZE=65536 +CONFIG_RAM_SIZE=32768 # CONFIG_ARCH_HAVE_SDRAM is not set # @@ -498,10 +496,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -528,7 +525,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -604,13 +600,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -878,7 +872,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/lm3s6432-s2e/nsh/defconfig b/configs/lm3s6432-s2e/nsh/defconfig index 16f56238eeaaaeca02389f91d391f220a454e0ab..6212b42fab1bde2193d7ab6cbcc9514b24e32848 100644 --- a/configs/lm3s6432-s2e/nsh/defconfig +++ b/configs/lm3s6432-s2e/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -248,6 +246,7 @@ CONFIG_TIVA_GPIOB_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set CONFIG_TIVA_BOARDMAC=y @@ -330,8 +329,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -406,6 +403,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -414,6 +412,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -425,8 +424,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -521,15 +523,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -620,13 +619,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -895,7 +892,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lm3s6965-ek/discover/defconfig b/configs/lm3s6965-ek/discover/defconfig index 6604cf2e5cc8e7039b9a2b18e62521baa59f6a4f..265299c608e9b18c53fe088fe7d85af491daea77 100644 --- a/configs/lm3s6965-ek/discover/defconfig +++ b/configs/lm3s6965-ek/discover/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -252,6 +250,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set # CONFIG_TIVA_BOARDMAC is not set @@ -340,8 +339,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -416,6 +413,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -424,6 +422,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -435,8 +434,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -549,15 +551,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -634,13 +633,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -920,7 +917,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lm3s6965-ek/nsh/defconfig b/configs/lm3s6965-ek/nsh/defconfig index 6604cf2e5cc8e7039b9a2b18e62521baa59f6a4f..265299c608e9b18c53fe088fe7d85af491daea77 100644 --- a/configs/lm3s6965-ek/nsh/defconfig +++ b/configs/lm3s6965-ek/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -252,6 +250,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set # CONFIG_TIVA_BOARDMAC is not set @@ -340,8 +339,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -416,6 +413,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -424,6 +422,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -435,8 +434,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -549,15 +551,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -634,13 +633,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -920,7 +917,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lm3s6965-ek/nx/defconfig b/configs/lm3s6965-ek/nx/defconfig index a11d8d14927840f26c14288228cd376a43679e7c..fdc5c9c6328d6f72123059a2c713112fa6adc2a6 100644 --- a/configs/lm3s6965-ek/nx/defconfig +++ b/configs/lm3s6965-ek/nx/defconfig @@ -60,10 +60,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -73,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,12 +319,11 @@ CONFIG_ARCH_LEDS=y # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -343,6 +343,7 @@ CONFIG_DISABLE_ENVIRON=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2010 CONFIG_START_MONTH=5 @@ -435,6 +436,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -450,21 +452,24 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y CONFIG_SPI_CMDDATA=y # CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -472,7 +477,12 @@ CONFIG_SPI_CMDDATA=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -499,6 +509,7 @@ CONFIG_P14201_FRAMEBUFFER=y # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -530,7 +541,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -580,9 +590,12 @@ CONFIG_UART0_2STOP=0 # CONFIG_UART0_IFLOWCONTROL is not set # CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -596,6 +609,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -762,6 +776,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -787,6 +803,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -805,9 +822,9 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -847,12 +864,10 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -890,6 +905,7 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -926,13 +942,14 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/lm3s6965-ek/tcpecho/defconfig b/configs/lm3s6965-ek/tcpecho/defconfig index 69824a4a7cad2e05153afe17fd7556add8cd4d05..96af39bd22153439c51563556dd085706b85a719 100644 --- a/configs/lm3s6965-ek/tcpecho/defconfig +++ b/configs/lm3s6965-ek/tcpecho/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -251,6 +249,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set # CONFIG_TIVA_BOARDMAC is not set @@ -403,6 +402,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -411,6 +411,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -422,8 +423,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -518,15 +522,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -604,13 +605,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=650 CONFIG_NET_ETH_TCP_RECVWNDO=624 CONFIG_NET_GUARDSIZE=2 @@ -890,7 +889,6 @@ CONFIG_NETDB_DNSSERVER_NOADDR=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lm3s8962-ek/nsh/defconfig b/configs/lm3s8962-ek/nsh/defconfig index d4c79ab20e606882e955d94e78860e738fbd1bbd..d834d65af4a72a9e05c29b29f9346cf4d25c80d3 100644 --- a/configs/lm3s8962-ek/nsh/defconfig +++ b/configs/lm3s8962-ek/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -262,6 +260,7 @@ CONFIG_TIVA_GPIOG_IRQS=y # CONFIG_TIVA_PROMISCUOUS is not set # CONFIG_TIVA_TIMESTAMP is not set # CONFIG_TIVA_BADCRC is not set +CONFIG_LM3S_ETHERNET_HPWORK=y # CONFIG_TIVA_DUMPPACKET is not set # CONFIG_TIVA_BOARDMAC is not set @@ -350,8 +349,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -426,6 +423,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -434,6 +432,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -445,8 +444,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -559,15 +561,12 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -644,13 +643,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -930,7 +927,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lm3s8962-ek/nx/defconfig b/configs/lm3s8962-ek/nx/defconfig index 1dc355b04f068c63f1304743587d7ec6ffaff0bf..92d68b951ce8a113ccdd36e1a0353639cb7f347c 100644 --- a/configs/lm3s8962-ek/nx/defconfig +++ b/configs/lm3s8962-ek/nx/defconfig @@ -64,10 +64,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -77,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -328,12 +329,11 @@ CONFIG_ARCH_LEDS=y # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -353,6 +353,7 @@ CONFIG_DISABLE_ENVIRON=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2010 CONFIG_START_MONTH=5 @@ -445,6 +446,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -460,21 +462,24 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y CONFIG_SPI_CMDDATA=y # CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -482,7 +487,12 @@ CONFIG_SPI_CMDDATA=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -509,6 +519,7 @@ CONFIG_P14201_FRAMEBUFFER=y # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -540,7 +551,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -590,9 +600,12 @@ CONFIG_UART0_2STOP=0 # CONFIG_UART0_IFLOWCONTROL is not set # CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -606,6 +619,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -772,6 +786,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -797,6 +813,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -815,9 +832,9 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -857,12 +874,10 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -900,6 +915,7 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -936,13 +952,14 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/lm4f120-launchpad/nsh/defconfig b/configs/lm4f120-launchpad/nsh/defconfig index d94d6182509237119303a97ce9839f41916cf7d9..759d63075b9221665b0f1429c8cde875ff6e20fe 100644 --- a/configs/lm4f120-launchpad/nsh/defconfig +++ b/configs/lm4f120-launchpad/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -494,7 +492,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -727,7 +724,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpc4330-xplorer/nsh/defconfig b/configs/lpc4330-xplorer/nsh/defconfig index 43d7da3c855334bd755b2c31209e1482a5fc29f2..6d0df578a250fb49bccb00c776ba2f6e961d136a 100644 --- a/configs/lpc4330-xplorer/nsh/defconfig +++ b/configs/lpc4330-xplorer/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,8 +316,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -484,7 +480,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -724,7 +719,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpc4337-ws/nsh/defconfig b/configs/lpc4337-ws/nsh/defconfig index e643242d3ce3344a45a651a8683d1a423349bd32..a462d6a1e4a15fee96e2170e10a04dea4c7eaf65 100644 --- a/configs/lpc4337-ws/nsh/defconfig +++ b/configs/lpc4337-ws/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -316,8 +314,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -503,7 +499,6 @@ CONFIG_ADC_FIFOSIZE=8 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -789,7 +784,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpc4337-ws/src/lpc4337-ws.h b/configs/lpc4337-ws/src/lpc4337-ws.h index 7c31fe745be40ff22e22a2bfe3d902d9ad94b20d..d5c11a35b9062250cf02b1f5f876619341137ccc 100644 --- a/configs/lpc4337-ws/src/lpc4337-ws.h +++ b/configs/lpc4337-ws/src/lpc4337-ws.h @@ -67,6 +67,17 @@ * Public Functions ****************************************************************************/ -#endif /* __ASSEMBLY__ */ +/************************************************************************************ + * Name: lpc43_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_LPC43_ADC0 +int lpc43_adc_setup(void); #endif +#endif /* __ASSEMBLY__ */ +#endif diff --git a/configs/lpc4337-ws/src/lpc43_adc.c b/configs/lpc4337-ws/src/lpc43_adc.c index c1cb491f61a12c07d70dd2c5fad4f43b402d969d..e54ca29ea5e9232e27f7500b4f75f65e4f856df1 100644 --- a/configs/lpc4337-ws/src/lpc43_adc.c +++ b/configs/lpc4337-ws/src/lpc43_adc.c @@ -63,15 +63,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: lpc43_adc_setup * * Description: - * All LPC43 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int lpc43_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/lpc4337-ws/src/lpc43_appinit.c b/configs/lpc4337-ws/src/lpc43_appinit.c index 3ae071fe122881407c1151e114cd2dde583d92bd..8f9a07499246d7277b945b3a4240e1faa3e605ce 100644 --- a/configs/lpc4337-ws/src/lpc43_appinit.c +++ b/configs/lpc4337-ws/src/lpc43_appinit.c @@ -46,8 +46,9 @@ #include #include -#include "lpc43_i2c.h" #include "chip.h" +#include "lpc43_i2c.h" +#include "lpc4337-ws.h" /**************************************************************************** * Private Functions @@ -135,8 +136,22 @@ static void lpc43_i2ctool(void) int board_app_initialize(uintptr_t arg) { + int ret; + /* Register I2C drivers on behalf of the I2C tool */ lpc43_i2ctool(); + +#ifdef CONFIG_LPC43_ADC0 + /* Initialize ADC and register the ADC driver. */ + + ret = lpc43_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpc43_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/lpc4357-evb/nsh/defconfig b/configs/lpc4357-evb/nsh/defconfig index 475a16e1cdc7c1868246a781a1766d30f426b84b..fda9ffd04cc1fa23708d22b5dfcd43791a699be0 100644 --- a/configs/lpc4357-evb/nsh/defconfig +++ b/configs/lpc4357-evb/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -310,8 +308,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -476,7 +472,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -716,7 +711,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpc4370-link2/nsh/defconfig b/configs/lpc4370-link2/nsh/defconfig index f6a52ca1fe3fb9de7269105f201c6101bfb21d95..605c8168850182262da5152f283bb346ee085cd9 100644 --- a/configs/lpc4370-link2/nsh/defconfig +++ b/configs/lpc4370-link2/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,8 +316,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -500,7 +496,6 @@ CONFIG_SPI=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -785,7 +780,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpc4370-link2/src/lpc4370-link2.h b/configs/lpc4370-link2/src/lpc4370-link2.h index 887d5b94f4935faf78f704c6ee2f6af4c8846d93..52c3083d13ca101d44e024918656cacd650f2a50 100644 --- a/configs/lpc4370-link2/src/lpc4370-link2.h +++ b/configs/lpc4370-link2/src/lpc4370-link2.h @@ -1,7 +1,7 @@ /**************************************************************************** * configs/lpc4370-link2/src/lpc4370-link2.h * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -99,8 +99,28 @@ * Public Functions ****************************************************************************/ +/************************************************************************************ + * Name: board_spifi_initialize + * + * Description: + * Initialize SPIFI. + * + ************************************************************************************/ + void board_spifi_initialize(void); +/************************************************************************************ + * Name: lpc43_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int lpc43_adc_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_LPC4370_LINK2_SRC_LPC3257_LINK2_H */ diff --git a/configs/lpc4370-link2/src/lpc43_adc.c b/configs/lpc4370-link2/src/lpc43_adc.c index def52a5748142c002e1c89677b19e384d1c102a4..0a350e5713a899b6ac4abb615dbe536e1e673e8e 100644 --- a/configs/lpc4370-link2/src/lpc43_adc.c +++ b/configs/lpc4370-link2/src/lpc43_adc.c @@ -6,7 +6,7 @@ * * Based on configs/stm3220g-eval/src/lpc43_adc.c * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,15 +63,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: lpc43_adc_setup * * Description: - * All LPC43 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int lpc43_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/lpc4370-link2/src/lpc43_appinit.c b/configs/lpc4370-link2/src/lpc43_appinit.c index 8493fb391d63a70902403f8a4e4e582aaefb3b72..ceda373a43c33d0ab87e238d45f4eadc28111404 100644 --- a/configs/lpc4370-link2/src/lpc43_appinit.c +++ b/configs/lpc4370-link2/src/lpc43_appinit.c @@ -135,8 +135,22 @@ static void lpc43_i2ctool(void) int board_app_initialize(uintptr_t arg) { + int ret; + /* Register I2C drivers on behalf of the I2C tool */ lpc43_i2ctool(); + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = lpc43_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpc43_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/lpcxpresso-lpc1115/README.txt b/configs/lpcxpresso-lpc1115/README.txt index bfe29dc6d50d5e3a7f114d0a54b5a9f30f331ada..168bed5198ddb94a138c157943b0c14ea7bcca0b 100644 --- a/configs/lpcxpresso-lpc1115/README.txt +++ b/configs/lpcxpresso-lpc1115/README.txt @@ -680,144 +680,6 @@ selected as follow: Where is one of the following: - minnsh: - ------ - - This is a experiment to see just how small we can get a usable NSH - configuration. This configuration has far fewer features than the nsh - configuration but is also a fraction of the size. - - This minnsh configuration is a "proof-of-concept" and not very usable in - its current state. This configuration was created by disabling - everything possible INCLUDING file system support. Without file system - support, NuttX is pretty much crippled. Here are some of the - consequences of disabling the file system: - - - All features that depend on the file system are lost: device drivers, - mountpoints, message queues, named semaphores. - - - Without device drivers, you cannot interact with the RTOS using POSIX - interfaces. You would have to work with NuttX as with those other - tiny RTOSs: As a scheduler and a callable hardare abstraction layer - (HAL). - - - You cannot use any of the NuttX upper half device drivers since they - depend on the pseudo-file system and device nodes. You can, of - course, continue to use the lower half drivers either directly. Or, - perhaps, you could write some custom minnsh upper half drivers that - do not depend on a file system and expose a HAL interface. - - There is a special version of readline() the NSH uses when there is no - file system. It uses a special up_putc() to write data to the console - and a special function up_getc() to read data from the console. - - - The current up_getc() implementationsa are a kludge. They are - analogous to the up_putc() implementations: They directly poll the - hardware for serial availability, locking up all lower priority tasks - in the entire system while they poll. So a version of NSH that uses - up_getc() essentially blocks the system until a character is received. - - This, of course, could be fixed by creating a special, upper half - implementation of the interrupt-driven serial lower half (like - stm32_serial) that just supports single character console I/O - (perhaps called up_putc and up_getc?). The NSH could wait for serial - input without blocking the system. But then that would increase the - footprint too. - - So although the minnsh configurations are a good starting point for - making things small, they not are really very practical. Why might - you want a NuttX minnsh solution? Perhaps you have software that runs - on a family of chips including some very tiny MCUs. Then perhaps having - the RTOS compatibility would justify the loss of functionality? - - You can re-enable the file system and (true) serial console with - these settings: - - Enable the file system: - CONFIG_NFILE_DESCRIPTORS=5 - CONFIG_NFILE_STREAMS=5 - - Enable the console device: - CONFIG_DEV_CONSOLE=y - - Disable most new NSH commands. Some like 'ls' are really mandatory - with a file system: - CONFIG_NSH_DISABLE_xxx=y - - Enable the upper half serial driver: - CONFIG_SERIAL=y - CONFIG_STANDARD_SERIAL=y - - Enable the USART1 serial driver: - CONFIG_STM32_USART1=y - CONFIG_STM32_USART1_SERIALDRIVER=y - CONFIG_USART1_SERIAL_CONSOLE=y - - CONFIG_USART1_2STOP=0 - CONFIG_USART1_BAUD=115200 - CONFIG_USART1_BITS=8 - CONFIG_USART1_PARITY=0 - CONFIG_USART1_RXBUFSIZE=16 - CONFIG_USART1_TXBUFSIZE=16 - - With these changes, NSH should behave better and we preserve the device - driver interface. But this result in a total size increase of about - 7KB: That is about 5KB of additional OS support for the file system and - serial console PLUS about 2KB for the 'ls' command logic (including OS - support for opendir(), readdir(), closedir(), stat(), and probably other - things). - - STATUS: - 2015-6-10 - The nuttx.bin minnsh firmware file size: - - $ ls -l nuttx.bin - -rwxr-xr-x 1 alan alan 13859 Jun 10 08:54 nuttx.bin - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 12818 193 704 13715 3593 nuttx - - This is serial console output (and input) : - - NuttShell (NSH) - nsh> ls /dev - nsh: ls: command not found - - No filesystem, no "ls" command :-) - - nsh> ? - help usage: help [-v] [] - - ? exec free mb mw xd - echo exit help mh ps - nsh> free - total used free largest - Mem: 6464 1816 4648 4648 - - nsh> echo "NuttX is magic!" - NuttX is magic! - nsh> - - Replace NSH with apps/examples/hello: - - $ ls -l nuttx.bin - -rwxr-xr-x 1 alan alan 9318 Jun 10 09:02 nuttx.bin - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 8277 193 704 9174 23d6 nuttx - - Some additional commits from Alan reduce this FLASH size by - about another kilobyte. That changes: (1) disable stack - dumping on assertions,and (2) make some FLASH data structures - smaller. - - Almost 2Kb of the remaining size was due to some arithmetic - "long long" (64 bits) operations drawn from libgcc.a. - Alan changed vsprintf to make "long long" support optional. - This change reduced the NuttX kernel to less than 8KiB! - nsh: --- diff --git a/configs/lpcxpresso-lpc1115/minnsh/defconfig b/configs/lpcxpresso-lpc1115/minnsh/defconfig deleted file mode 100644 index dbae4a0abc924764151e01d3d795c65349487ba4..0000000000000000000000000000000000000000 --- a/configs/lpcxpresso-lpc1115/minnsh/defconfig +++ /dev/null @@ -1,769 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -CONFIG_DEFAULT_SMALL=y -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -CONFIG_BUILD_FLAT=y -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set -# CONFIG_ARCH_DEBUG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_ALERT is not set -# CONFIG_DEBUG_FEATURES is not set -CONFIG_ARCH_HAVE_STACKCHECK=y -# CONFIG_STACK_COLORATION is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="arm" - -# -# ARM Options -# -# CONFIG_ARCH_CHIP_A1X is not set -# CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set -# CONFIG_ARCH_CHIP_DM320 is not set -# CONFIG_ARCH_CHIP_EFM32 is not set -# CONFIG_ARCH_CHIP_IMX1 is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_KINETIS is not set -# CONFIG_ARCH_CHIP_KL is not set -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_TIVA is not set -CONFIG_ARCH_CHIP_LPC11XX=y -# CONFIG_ARCH_CHIP_LPC17XX is not set -# CONFIG_ARCH_CHIP_LPC214X is not set -# CONFIG_ARCH_CHIP_LPC2378 is not set -# CONFIG_ARCH_CHIP_LPC31XX is not set -# CONFIG_ARCH_CHIP_LPC43XX is not set -# CONFIG_ARCH_CHIP_NUC1XX is not set -# CONFIG_ARCH_CHIP_SAMA5 is not set -# CONFIG_ARCH_CHIP_SAMD is not set -# CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set -# CONFIG_ARCH_CHIP_SAMV7 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_STM32F7 is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_STR71X is not set -# CONFIG_ARCH_CHIP_TMS570 is not set -# CONFIG_ARCH_CHIP_MOXART is not set -# CONFIG_ARCH_ARM7TDMI is not set -# CONFIG_ARCH_ARM926EJS is not set -# CONFIG_ARCH_ARM920T is not set -CONFIG_ARCH_CORTEXM0=y -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXA5 is not set -# CONFIG_ARCH_CORTEXA8 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -# CONFIG_ARCH_CORTEXR4F is not set -# CONFIG_ARCH_CORTEXR5 is not set -# CONFIG_ARCH_CORTEX5F is not set -# CONFIG_ARCH_CORTEXR7 is not set -# CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="armv6-m" -CONFIG_ARCH_CHIP="lpc11xx" -# CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set -CONFIG_ARCH_HAVE_CMNVECTOR=y -# CONFIG_ARMV7M_CMNVECTOR is not set -# CONFIG_ARMV7M_LAZYFPU is not set -# CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_DPFPU is not set -# CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set - -# -# ARMV6M Configuration Options -# -# CONFIG_ARMV6M_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODEREDL is not set -# CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV6M_TOOLCHAIN_GNU_EABIL=y -# CONFIG_LPC11_GPIOIRQ is not set - -# -# LPC11xx Configuration Options -# -# CONFIG_ARCH_CHIP_LPC1114 is not set -CONFIG_ARCH_CHIP_LPC1115=y -CONFIG_ARCH_FAMILY_LPC111X=y - -# -# LPC11xx Peripheral Support -# -CONFIG_LPC11_INTRCOSC=y -# CONFIG_LPC11_MAINOSC is not set -CONFIG_LPC11_SYSTICK_CORECLK=y -# CONFIG_LPC11_SYSTICK_CORECLK_DIV16 is not set -CONFIG_LPC11_PLL=y -CONFIG_LPC11_UART0=y -# CONFIG_LPC11_CAN0 is not set -# CONFIG_LPC11_SPI is not set -# CONFIG_LPC11_SSP0 is not set -# CONFIG_LPC11_SSP1 is not set -# CONFIG_LPC11_I2C0 is not set -# CONFIG_LPC11_TMR0 is not set -# CONFIG_LPC11_TMR1 is not set -# CONFIG_LPC11_WDT is not set -# CONFIG_LPC11_ADC is not set -# CONFIG_LPC11_FLASH is not set - -# -# Serial driver options -# -# CONFIG_SERIAL_TERMIOS is not set - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -CONFIG_ARCH_HAVE_IRQPRIO=y -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -# CONFIG_ARCH_HAVE_ADDRENV is not set -# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set -CONFIG_ARCH_HAVE_VFORK=y -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -# CONFIG_ARCH_HAVE_POWEROFF is not set -CONFIG_ARCH_HAVE_RESET=y -# CONFIG_ARCH_IRQPRIO is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=2988 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=0 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x10000000 -CONFIG_RAM_SIZE=8192 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_LPCXPRESSO_LPC1115=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="lpcxpresso-lpc1115" - -# -# Common Board Options -# -CONFIG_ARCH_HAVE_LEDS=y -CONFIG_ARCH_LEDS=y -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# -# CONFIG_LIB_BOARDCTL is not set - -# -# RTOS Features -# -CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y - -# -# Clocks and Timers -# -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -# CONFIG_CLOCK_MONOTONIC is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2013 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=26 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 - -# -# Tasks and Scheduling -# -# CONFIG_INIT_NONE is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=4 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set - -# -# Files and I/O -# -# CONFIG_DEV_CONSOLE is not set -CONFIG_FDCLONE_DISABLE=y -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=0 -CONFIG_NFILE_STREAMS=0 -CONFIG_NAME_MAX=32 -# CONFIG_PRIORITY_INHERITANCE is not set - -# -# RTOS hooks -# -# CONFIG_BOARD_INITIALIZE is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -# CONFIG_MODULE is not set - -# -# Work queue support -# - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=1536 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1536 -# CONFIG_LIB_SYSCALL is not set - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -# CONFIG_DEV_NULL is not set -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set - -# -# Buffering -# -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set - -# -# Timer Driver Support -# -# CONFIG_TIMER is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_IOEXPANDER is not set - -# -# LCD Driver Support -# -# CONFIG_LCD is not set -# CONFIG_SLCD is not set - -# -# LED Support -# -# CONFIG_USERLED is not set -# CONFIG_RGBLED is not set -# CONFIG_PCA9635PW is not set -# CONFIG_NCP5623C is not set -# CONFIG_MMCSD is not set -# CONFIG_MODEM is not set -# CONFIG_MTD is not set -# CONFIG_EEPROM is not set -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -CONFIG_UART0_SERIALDRIVER=y -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set -# CONFIG_OTHER_UART_SERIALDRIVER is not set -CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_UART0_SERIAL_CONSOLE=y -# CONFIG_OTHER_SERIAL_CONSOLE is not set -# CONFIG_NO_SERIAL_CONSOLE is not set - -# -# UART0 Configuration -# -CONFIG_UART0_RXBUFSIZE=64 -CONFIG_UART0_TXBUFSIZE=64 -CONFIG_UART0_BAUD=115200 -CONFIG_UART0_BITS=8 -CONFIG_UART0_PARITY=0 -CONFIG_UART0_2STOP=0 -# CONFIG_UART0_IFLOWCONTROL is not set -# CONFIG_UART0_OFLOWCONTROL is not set -# CONFIG_UART0_DMA is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging -# -# CONFIG_ARCH_SYSLOG is not set -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_INTBUFFER is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -# CONFIG_SYSLOG_SERIAL_CONSOLE is not set -# CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_NONE=y -# CONFIG_SYSLOG_FILE is not set - -# -# Networking Support -# -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set - -# -# Crypto API -# -# CONFIG_CRYPTO is not set - -# -# File Systems -# - -# -# File system configuration -# -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_PROCFS is not set -# CONFIG_FS_UNIONFS is not set - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -CONFIG_MM_SMALL=y -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Wireless Support -# - -# -# Binary Loader -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=0 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=0 -# CONFIG_LIBM is not set -CONFIG_NOPRINTF_FIELDWIDTH=y -# CONFIG_LIBC_FLOATINGPOINT is not set -# CONFIG_LIBC_LONG_LONG is not set -# CONFIG_LIBC_IOCTL_VARIADIC is not set -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -# CONFIG_TIME_EXTENDED is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set -CONFIG_ARCH_HAVE_TLS=y -# CONFIG_TLS is not set -# CONFIG_LIBC_NETDB is not set - -# -# Non-standard Library Support -# -# CONFIG_LIB_CRC64_FAST is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# CAN Utilities -# - -# -# Examples -# -# CONFIG_EXAMPLES_CHAT is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_MEDIA is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_PPPD is not set -# CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERIALBLASTER is not set -# CONFIG_EXAMPLES_SERIALRX is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WEBSERVER is not set - -# -# File System Utilities -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# GPS Utilities -# -# CONFIG_GPSUTILS_MINMEA_LIB is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set -# CONFIG_GRAPHICS_TRAVELER is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_MICROPYTHON is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# Network Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_ESP8266 is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -# CONFIG_NSH_MOTD is not set - -# -# Command Line Configuration -# -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set -CONFIG_NSH_LINELEN=80 -CONFIG_NSH_DISABLE_SEMICOLON=y -CONFIG_NSH_MAXARGUMENTS=6 -# CONFIG_NSH_ARGCAT is not set -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set - -# -# Disable Individual commands -# -CONFIG_NSH_DISABLE_ADDROUTE=y -CONFIG_NSH_DISABLE_BASENAME=y -# CONFIG_NSH_DISABLE_CAT is not set -CONFIG_NSH_DISABLE_CD=y -CONFIG_NSH_DISABLE_CP=y -# CONFIG_NSH_DISABLE_CMP is not set -CONFIG_NSH_DISABLE_DATE=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DF=y -CONFIG_NSH_DISABLE_DELROUTE=y -CONFIG_NSH_DISABLE_DIRNAME=y -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -CONFIG_NSH_DISABLE_GET=y -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -CONFIG_NSH_DISABLE_IFCONFIG=y -CONFIG_NSH_DISABLE_IFUPDOWN=y -# CONFIG_NSH_DISABLE_KILL is not set -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_LOSMART=y -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -CONFIG_NSH_DISABLE_MKDIR=y -# CONFIG_NSH_DISABLE_MKFIFO is not set -CONFIG_NSH_DISABLE_MKRD=y -# CONFIG_NSH_DISABLE_MH is not set -CONFIG_NSH_DISABLE_MOUNT=y -CONFIG_NSH_DISABLE_MV=y -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_PS is not set -CONFIG_NSH_DISABLE_PUT=y -# CONFIG_NSH_DISABLE_PWD is not set -CONFIG_NSH_DISABLE_RM=y -CONFIG_NSH_DISABLE_RMDIR=y -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -CONFIG_NSH_DISABLE_TIME=y -# CONFIG_NSH_DISABLE_TEST is not set -CONFIG_NSH_DISABLE_UMOUNT=y -CONFIG_NSH_DISABLE_UNAME=y -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_NSH_DISABLE_WGET=y -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CODECS_BUFSIZE=128 -# CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_NSH_FILEIOSIZE=64 - -# -# Scripting Support -# -CONFIG_NSH_DISABLESCRIPT=y - -# -# Console Configuration -# -CONFIG_NSH_CONSOLE=y -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_LOGIN is not set -# CONFIG_NSH_CONSOLE_LOGIN is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_SYSTEM_HEXED is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_SYSTEM_RAMTEST is not set -CONFIG_READLINE_HAVE_EXTMATCH=y -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y -# CONFIG_READLINE_TABCOMPLETION is not set -# CONFIG_READLINE_CMD_HISTORY is not set -# CONFIG_SYSTEM_SUDOKU is not set -# CONFIG_SYSTEM_UBLOXMODEM is not set -# CONFIG_SYSTEM_VI is not set -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/lpcxpresso-lpc1115/nsh/defconfig b/configs/lpcxpresso-lpc1115/nsh/defconfig index 4853dd1d67b06ab6c740b4a7f831463f778c05ac..8a66a48cc740251450e88e425392b9d425e746b4 100644 --- a/configs/lpcxpresso-lpc1115/nsh/defconfig +++ b/configs/lpcxpresso-lpc1115/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -396,7 +394,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -619,7 +616,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/configs/lpcxpresso-lpc1768/dhcpd/defconfig index da0cb8af8ccd990f87e22f136c9ff3ba8c59e985..380604febfaf64fc749310c5511c4f802719afdf 100644 --- a/configs/lpcxpresso-lpc1768/dhcpd/defconfig +++ b/configs/lpcxpresso-lpc1768/dhcpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -489,10 +487,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -516,7 +513,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -593,13 +589,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -844,7 +838,6 @@ CONFIG_EXAMPLES_DHCPD_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpcxpresso-lpc1768/nsh/defconfig b/configs/lpcxpresso-lpc1768/nsh/defconfig index 1cf8e78fbb7156f55f46ae404e69c91a7023ba9d..fdbc186bc74a65a41d15123f5ffd2625c47071c5 100644 --- a/configs/lpcxpresso-lpc1768/nsh/defconfig +++ b/configs/lpcxpresso-lpc1768/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -317,8 +315,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -561,10 +557,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -588,7 +583,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -665,13 +659,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -951,7 +943,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/lpcxpresso-lpc1768/nx/defconfig b/configs/lpcxpresso-lpc1768/nx/defconfig index 5cf05e397d732425d05cd2f26cbe2fce06a8fcf3..bb99255c2dfb55f221590340d22257516ad3e8b8 100644 --- a/configs/lpcxpresso-lpc1768/nx/defconfig +++ b/configs/lpcxpresso-lpc1768/nx/defconfig @@ -60,10 +60,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -73,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -144,7 +145,6 @@ CONFIG_ARMV7M_TOOLCHAIN_CODEREDL=y # CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set # CONFIG_ARMV7M_HAVE_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set -# CONFIG_LPC17_GPIOIRQ is not set # CONFIG_SERIAL_TERMIOS is not set # @@ -219,6 +219,7 @@ CONFIG_LPC17_SSP1=y # # Serial driver options # +# CONFIG_LPC17_GPIOIRQ is not set # # Architecture Options @@ -297,12 +298,11 @@ CONFIG_ARCH_LEDS=y # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -322,6 +322,7 @@ CONFIG_DISABLE_ENVIRON=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2011 CONFIG_START_MONTH=4 @@ -414,6 +415,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -429,21 +431,23 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set # CONFIG_SPI_EXCHANGE is not set CONFIG_SPI_CMDDATA=y # CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -451,7 +455,12 @@ CONFIG_SPI_CMDDATA=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -478,6 +487,7 @@ CONFIG_UG9664HSWAG01_SPIMODE=0 CONFIG_UG9664HSWAG01_FREQUENCY=3500000 CONFIG_UG9664HSWAG01_NINTERFACES=1 CONFIG_UG9664HSWAG01_POWER=y +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -509,7 +519,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -559,9 +568,12 @@ CONFIG_UART3_2STOP=0 # CONFIG_UART3_IFLOWCONTROL is not set # CONFIG_UART3_OFLOWCONTROL is not set # CONFIG_UART3_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -575,6 +587,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -741,6 +754,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -766,6 +781,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -784,9 +800,9 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -826,12 +842,10 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -869,6 +883,7 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -905,13 +920,14 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/lpcxpresso-lpc1768/src/Makefile b/configs/lpcxpresso-lpc1768/src/Makefile index c7a44a8284fb3e2e7d4e4927c4629c8bbec35402..24441d8eb35def475f5b26df7955d92a29ae6420 100644 --- a/configs/lpcxpresso-lpc1768/src/Makefile +++ b/configs/lpcxpresso-lpc1768/src/Makefile @@ -36,7 +36,15 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = lpc17_boot.c lpc17_leds.c lpc17_ssp.c lpc17_adc.c lpc17_dac.c lpc17_pwm.c +CSRCS = lpc17_boot.c lpc17_leds.c lpc17_ssp.c lpc17_dac.c + +ifeq ($(CONFIG_PWM),y) +CSRCS += lpc17_pwm.c +endif + +ifeq ($(CONFIG_ADC),y) +CSRCS += lpc17_adc.c +endif ifeq ($(CONFIG_LIB_BOARDCTL),y) CSRCS += lpc17_appinit.c diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_adc.c b/configs/lpcxpresso-lpc1768/src/lpc17_adc.c index b7d1b6ddb98f632c23538000510e1fd8e47a7d5b..e76f67ff20edaaeb814e7a15aab45d6dedae2438 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_adc.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_adc.c @@ -6,7 +6,7 @@ * * Based on configs/stm3220g-eval/src/lpc17_adc.c * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -59,32 +59,19 @@ #ifdef CONFIG_ADC -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: lpcxpresso_adc_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int lpcxpresso_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_appinit.c b/configs/lpcxpresso-lpc1768/src/lpc17_appinit.c index 0aefdd37d44148669dd045243c7dab830d0e2a9c..d922e61963fa01547a798cf395a3df69f8c5f729 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_appinit.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_appinit.c @@ -139,9 +139,10 @@ int board_app_initialize(uintptr_t arg) { + int ret; + #ifdef NSH_HAVEMMCSD FAR struct spi_dev_s *ssp; - int ret; /* Get the SSP port */ @@ -169,5 +170,27 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); #endif + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = lpcexpresso_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpcexpresso_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = lpcxpresso_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpcxpresso_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c b/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c index 5aec1613c1404d7dfd5ba99231b022b40be2df2e..27f122c27b07c9f050fa10796931ed09f5f87c94 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_pwm.c @@ -64,24 +64,19 @@ FAR struct pwm_lowerhalf_s *lpc17_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer); -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: lpcexpresso_pwm_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int lpcexpresso_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h b/configs/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h index 8b853a5df3c8cf5d3419c2734eb8ddf7cbd0dcdf..ecde0db1213f43377dd1a9b2c5e269476fb35a5a 100644 --- a/configs/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h +++ b/configs/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h + * configs/lpcxpresso-lpcxpresso68/src/lpcxpresso-lpcxpresso68.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -140,8 +140,8 @@ * SD Signal Pin Pin * --- ----------- ----- -------- * CS PIO1_11* 55 P2.2 (See LPCXPRESSO_SD_CS) - * DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/lpc17_ssp.h) - * DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/lpc17_ssp.h) + * DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/lpcxpresso_ssp.h) + * DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/lpcxpresso_ssp.h) * CLK PIO2_11-SCK 7 P0.9 SCK1 (See GPIO_SSP1_SCK in board.h) * CD PIO2_10 52 P2.11 (See LPCXPRESSO_SD_CD) */ @@ -230,6 +230,30 @@ void weak_function lpcxpresso_sspdev_initialize(void); +/************************************************************************************ + * Name: lpcexpresso_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int lpcexpresso_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: lpcxpresso_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int lpcxpresso_adc_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_H */ diff --git a/configs/lpcxpresso-lpc1768/thttpd/defconfig b/configs/lpcxpresso-lpc1768/thttpd/defconfig index d227462fbf19576923aa70540cc1d5da765950a3..0020d90dbfc101afe8fb157470fa60f08ba15d16 100644 --- a/configs/lpcxpresso-lpc1768/thttpd/defconfig +++ b/configs/lpcxpresso-lpc1768/thttpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -490,10 +488,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -520,7 +517,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -596,13 +592,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -861,7 +855,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/lpcxpresso-lpc1768/usbmsc/defconfig b/configs/lpcxpresso-lpc1768/usbmsc/defconfig index ec43ec9a66f70e1d6ac352f98929aca2860fc303..608efd1c81bb50d43d7685527a7a6d8369fed6ba 100644 --- a/configs/lpcxpresso-lpc1768/usbmsc/defconfig +++ b/configs/lpcxpresso-lpc1768/usbmsc/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -313,8 +311,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -496,7 +492,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -763,7 +758,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/maple/nsh/defconfig b/configs/maple/nsh/defconfig index 68678b4a89d786359ed5548da87d10b33738ac69..3a9c485155fae93fbdb67eb3e937e2c0e47df978 100644 --- a/configs/maple/nsh/defconfig +++ b/configs/maple/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -706,7 +704,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -965,7 +962,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/maple/nx/defconfig b/configs/maple/nx/defconfig index ec0a3a53adfce8e001b9c07a394a8e5d19e1e825..9936c99c3d1e59a63af996553f071d0fdbceb4e4 100644 --- a/configs/maple/nx/defconfig +++ b/configs/maple/nx/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -349,6 +350,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set # CONFIG_STM32_HAVE_DAC1 is not set @@ -570,8 +577,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -702,14 +707,14 @@ CONFIG_I2C=y # CONFIG_I2C_TRACE is not set # CONFIG_I2C_DRIVER is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set CONFIG_SPI_HWFEATURES=y -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y CONFIG_SPI_BITORDER=y # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -720,6 +725,7 @@ CONFIG_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_TIMERS_CS2100CP is not set @@ -756,6 +762,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -792,7 +799,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y CONFIG_SERIAL_CONSOLE=y @@ -889,6 +895,7 @@ CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" CONFIG_HAVE_USBTRACE=y # CONFIG_USBMONITOR is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1074,6 +1081,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set # CONFIG_LIBC_LONG_LONG is not set # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=2 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1124,6 +1133,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1178,7 +1189,6 @@ CONFIG_EXAMPLES_NXHELLO_DEFAULT_FONT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1217,6 +1227,7 @@ CONFIG_EXAMPLES_NXHELLO_DEFAULT_FONT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1287,6 +1298,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1362,6 +1374,7 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/maple/usbnsh/defconfig b/configs/maple/usbnsh/defconfig index 8340e5872260fa101c2f8c6c5214371f6f27fccf..1a0485d7dc2e6b2840110a57e5ef7d5c38e80408 100644 --- a/configs/maple/usbnsh/defconfig +++ b/configs/maple/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -545,8 +543,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -720,7 +716,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y CONFIG_SERIAL_CONSOLE=y @@ -997,7 +992,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mbed/hidkbd/defconfig b/configs/mbed/hidkbd/defconfig index 0b1188bcbd005d2972af086ebe094c0433cc3506..749e51ef049e68c53d6f3a12821db9ec0fd514ab 100644 --- a/configs/mbed/hidkbd/defconfig +++ b/configs/mbed/hidkbd/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -478,7 +476,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -726,7 +723,6 @@ CONFIG_EXAMPLES_HIDKBD_DEVNAME="/dev/kbda" # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mbed/nsh/defconfig b/configs/mbed/nsh/defconfig index a1237556ce0878d8765eca0a4c7248b5535127b4..e58d828f5eae8ea853fb24adc773a2ce9de30e43 100644 --- a/configs/mbed/nsh/defconfig +++ b/configs/mbed/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -305,8 +303,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -518,7 +514,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -756,7 +751,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mbed/src/Makefile b/configs/mbed/src/Makefile index 1bd5a3e33cd09ab5692d2b149849a6a053b0f387..6a93bdb0918ec2e7fa4d9f0d5b29b049a27bd676 100644 --- a/configs/mbed/src/Makefile +++ b/configs/mbed/src/Makefile @@ -36,15 +36,24 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = lpc17_boot.c lpc17_leds.c lpc17_adc.c lpc17_dac.c lpc17_pwm.c +CSRCS = lpc17_boot.c lpc17_leds.c lpc17_dac.c ifeq ($(CONFIG_LIB_BOARDCTL),y) CSRCS += lpc17_appinit.c endif + ifeq ($(CONFIG_USBMSC),y) CSRCS += lpc17_usbmsc.c endif +ifeq ($(CONFIG_PWM),y) +CSRCS += lpc17_pwm.c +endif + +ifeq ($(CONFIG_ADC),y) +CSRCS += lpc17_adc.c +endif + ifeq ($(CONFIG_EXAMPLES_HIDKBD),y) CSRCS += lpc17_hidkbd.c endif diff --git a/configs/mbed/src/lpc17_adc.c b/configs/mbed/src/lpc17_adc.c index 4cc9b6ad8da62ac9345967fb2c088a7ca2d24844..059e63de000d93423bcc11f0812fda83b48c62ba 100644 --- a/configs/mbed/src/lpc17_adc.c +++ b/configs/mbed/src/lpc17_adc.c @@ -8,7 +8,7 @@ * * Based on configs/lpc1720g-eval/src/lpc17_adc.c * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -61,32 +61,19 @@ #ifdef CONFIG_ADC -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: mbed_adc_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int mbed_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/mbed/src/lpc17_appinit.c b/configs/mbed/src/lpc17_appinit.c index f70e811f3bb68d94d2e7f92ef136cd1e2730c6d0..f371ab764b2da0807dc4b27a75e3e8b6c211547b 100644 --- a/configs/mbed/src/lpc17_appinit.c +++ b/configs/mbed/src/lpc17_appinit.c @@ -47,6 +47,8 @@ #include #include +#include "mbed.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -97,5 +99,28 @@ int board_app_initialize(uintptr_t arg) { + int ret; + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = mbed_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: mbed_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = mbed_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: mbed_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/mbed/src/lpc17_pwm.c b/configs/mbed/src/lpc17_pwm.c index 5b312bd71b3fe93be50b7bf2e5b4f16b57a5c13f..6ed91a0c20d6c844bd2951293964994a9357a31e 100644 --- a/configs/mbed/src/lpc17_pwm.c +++ b/configs/mbed/src/lpc17_pwm.c @@ -3,7 +3,7 @@ * * Based on onfigs/lpcexpresso-lpc1768/lpc17_pwm.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -66,24 +66,19 @@ FAR struct pwm_lowerhalf_s *lpc17_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer); -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: mbed_pwm_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int mbed_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/mbed/src/mbed.h b/configs/mbed/src/mbed.h index 938372b7801f31176bff8d99e049043746d8af1b..5978e5d17c297189c57294f7a84f2327af6a8532 100644 --- a/configs/mbed/src/mbed.h +++ b/configs/mbed/src/mbed.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/mbed/src/mbed.h * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -88,6 +88,30 @@ void weak_function mbed_sspdev_initialize(void); +/************************************************************************************ + * Name: mbed_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int mbed_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: mbed_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int mbed_adc_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_MBED_SRC_MBED_H */ diff --git a/configs/mcu123-lpc214x/composite/defconfig b/configs/mcu123-lpc214x/composite/defconfig index 2ec8c826ccb0ddb2a593c7d007785ef75ace76c1..cffe65a216a13d2f7be9add4b9c5069c8a3daa01 100644 --- a/configs/mcu123-lpc214x/composite/defconfig +++ b/configs/mcu123-lpc214x/composite/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -250,8 +248,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -433,7 +429,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -751,7 +746,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mcu123-lpc214x/nsh/defconfig b/configs/mcu123-lpc214x/nsh/defconfig index 029eb95dc79292f371cd3eb1fc6197239b3624b4..16148fb70afd9ea847ce75e6a23850c127a9e39c 100644 --- a/configs/mcu123-lpc214x/nsh/defconfig +++ b/configs/mcu123-lpc214x/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -243,8 +241,6 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -426,7 +422,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -679,7 +674,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mcu123-lpc214x/usbmsc/defconfig b/configs/mcu123-lpc214x/usbmsc/defconfig index 83450481f8f592bd1a69788e464a15537a0749b6..902c2e9593335a5d1ef2c20aa722c7cf22ee1bca 100644 --- a/configs/mcu123-lpc214x/usbmsc/defconfig +++ b/configs/mcu123-lpc214x/usbmsc/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -250,8 +248,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -433,7 +429,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -716,7 +711,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mcu123-lpc214x/usbserial/defconfig b/configs/mcu123-lpc214x/usbserial/defconfig index 09fd06afceb29233fcec6e3144286565af09d1f0..d6293bc0cc331e6aff5994b4a5c13aac5f6fb783 100644 --- a/configs/mcu123-lpc214x/usbserial/defconfig +++ b/configs/mcu123-lpc214x/usbserial/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -249,8 +247,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -413,7 +409,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -683,7 +678,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/micropendous3/hello/defconfig b/configs/micropendous3/hello/defconfig index 4b37ae8ecf996c2e306f06e6db6625f9d55991c5..c11817790ba92af09a08c87847d2c18652f01c2f 100644 --- a/configs/micropendous3/hello/defconfig +++ b/configs/micropendous3/hello/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -242,7 +241,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -421,7 +419,6 @@ CONFIG_EXAMPLES_HELLO=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/mikroe-stm32f4/Kconfig b/configs/mikroe-stm32f4/Kconfig index 836f13cf2b11e11f2b13a3647074fed740066013..00a5e41ee4744b0f04a42f368a6e3e59a9a12f4c 100644 --- a/configs/mikroe-stm32f4/Kconfig +++ b/configs/mikroe-stm32f4/Kconfig @@ -76,6 +76,11 @@ config MIKROE_RAMMTD_SIZE ---help--- Sets the size of static RAM allocation for the SMART RAM device +config MIKROE_QETIMER + int "Timer to use with QE encoder" + default 3 + depends on QENCODER + config PM_ALARM_SEC int "PM_STANDBY delay (seconds)" default 15 diff --git a/configs/mikroe-stm32f4/fulldemo/defconfig b/configs/mikroe-stm32f4/fulldemo/defconfig index d57290807febfe475809c7b8fb11fec471cd4707..70a3dd4e1256fc6865427860ff8475426776dfae 100644 --- a/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/configs/mikroe-stm32f4/fulldemo/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -350,6 +351,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -595,8 +602,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -628,6 +633,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -644,6 +650,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -685,8 +693,8 @@ CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options # -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_PREALLOC_MQ_MSGS=32 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -732,14 +740,14 @@ CONFIG_RAMDISK=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set CONFIG_SPI_CALLBACK=y # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -750,6 +758,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set CONFIG_RTC=y CONFIG_RTC_DATETIME=y CONFIG_RTC_ALARM=y @@ -804,6 +813,7 @@ CONFIG_LCD_MAXPOWER=1 CONFIG_LCD_MIO283QT2=y # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -871,6 +881,7 @@ CONFIG_M25P_SPIFREQUENCY=20000000 CONFIG_M25P_MANUFACTURER=0x1C CONFIG_M25P_MEMORY_TYPE=0x31 CONFIG_M25P_SUBSECTOR_ERASE=y +# CONFIG_MTD_MX25L is not set # CONFIG_MTD_S25FL1 is not set # CONFIG_MTD_N25QXXX is not set CONFIG_MTD_SMART=y @@ -893,7 +904,6 @@ CONFIG_MTD_SMART_WEAR_LEVEL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -987,6 +997,7 @@ CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1136,13 +1147,14 @@ CONFIG_NXFONT_SERIF22X28B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=128 CONFIG_NXTERM_CACHESIZE=16 CONFIG_NXTERM_LINESEPARATION=0 @@ -1162,7 +1174,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1241,6 +1256,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1262,6 +1279,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1302,6 +1321,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1328,8 +1348,6 @@ CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_NULL is not set CONFIG_EXAMPLES_NX=y -CONFIG_EXAMPLES_NX_VPLANE=0 -CONFIG_EXAMPLES_NX_DEVNO=0 CONFIG_EXAMPLES_NX_DEFAULT_COLORS=y CONFIG_EXAMPLES_NX_DEFAULT_FONT=y CONFIG_EXAMPLES_NX_BPP=16 @@ -1358,7 +1376,6 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -1408,6 +1425,7 @@ CONFIG_FSUTILS_MKSMARTFS=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1480,6 +1498,7 @@ CONFIG_NSH_DISABLE_IFUPDOWN=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1504,6 +1523,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1549,10 +1569,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=2048 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1646,7 +1663,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -1781,6 +1798,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/mikroe-stm32f4/kostest/defconfig b/configs/mikroe-stm32f4/kostest/defconfig index 639bfafc1ad7aa681131b95a41330f7e3e210ec4..e8740c395b3cb78c8c4bd75503e9e05d9164827c 100644 --- a/configs/mikroe-stm32f4/kostest/defconfig +++ b/configs/mikroe-stm32f4/kostest/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -79,7 +78,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -597,8 +595,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -849,7 +845,6 @@ CONFIG_MTD_SMART_WEAR_LEVEL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1152,7 +1147,6 @@ CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mikroe-stm32f4/nsh/defconfig b/configs/mikroe-stm32f4/nsh/defconfig index fde82bf7ebd450b03af5d264d360920906af0cb4..bd189e13d9083c85f31e407587cab79885a28701 100644 --- a/configs/mikroe-stm32f4/nsh/defconfig +++ b/configs/mikroe-stm32f4/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -578,8 +576,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -816,7 +812,6 @@ CONFIG_MTD_SMART_WEAR_LEVEL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_SERIAL_REMOVABLE is not set CONFIG_SERIAL_CONSOLE=y @@ -1080,7 +1075,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/mikroe-stm32f4/nx/defconfig b/configs/mikroe-stm32f4/nx/defconfig index e766cd139b70bb47a6c542ec61b3daba5388dde1..51f178871d3538d7501214d24be8c96490e85569 100644 --- a/configs/mikroe-stm32f4/nx/defconfig +++ b/configs/mikroe-stm32f4/nx/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -349,6 +350,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -546,8 +553,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -678,6 +683,8 @@ CONFIG_DISABLE_POLL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -685,6 +692,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -719,6 +727,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set CONFIG_LCD_MIO283QT2=y # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -749,12 +758,12 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -945,6 +954,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1003,6 +1014,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1045,7 +1057,6 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1084,6 +1095,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1154,6 +1166,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1223,6 +1236,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/mikroe-stm32f4/nxlines/defconfig b/configs/mikroe-stm32f4/nxlines/defconfig index 762e07fd5aeccbafafa027763a360e036d7481bb..f0c6adcfea72a99e4b056150b768af169d38eaac 100644 --- a/configs/mikroe-stm32f4/nxlines/defconfig +++ b/configs/mikroe-stm32f4/nxlines/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -546,8 +544,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -749,7 +745,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -1047,7 +1042,6 @@ CONFIG_EXAMPLES_NXLINES_BPP=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mikroe-stm32f4/nxtext/defconfig b/configs/mikroe-stm32f4/nxtext/defconfig index e178ae9af5fff62ae79edbae1a4bb5f19fceadb9..52933714d66f5831547db105dee8e4d57e88a395 100644 --- a/configs/mikroe-stm32f4/nxtext/defconfig +++ b/configs/mikroe-stm32f4/nxtext/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -349,6 +350,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -546,8 +553,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -678,6 +683,8 @@ CONFIG_DISABLE_POLL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -685,6 +692,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -719,6 +727,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set CONFIG_LCD_MIO283QT2=y # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -749,12 +758,12 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -945,6 +954,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1002,6 +1013,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1056,7 +1068,6 @@ CONFIG_EXAMPLES_NXTEXT_DEFAULT_FONT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1095,6 +1106,7 @@ CONFIG_EXAMPLES_NXTEXT_DEFAULT_FONT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1165,6 +1177,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1233,6 +1246,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/mikroe-stm32f4/src/mikroe-stm32f4.h b/configs/mikroe-stm32f4/src/mikroe-stm32f4.h index 473d0a61fbcd9ed897522d02a8fdc6887207776c..be7b4edc17d8c54890b17391b73cc87105436ba5 100644 --- a/configs/mikroe-stm32f4/src/mikroe-stm32f4.h +++ b/configs/mikroe-stm32f4/src/mikroe-stm32f4.h @@ -1,7 +1,7 @@ /**************************************************************************************************** * configs/mikroe-stm32f4/src/mikroe-stm32f4.h * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -227,6 +227,18 @@ void weak_function stm32_spidev_initialize(void); void weak_function stm32_usbinitialize(void); #endif +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + /**************************************************************************************************** * Name: stm32_usbhost_initialize * @@ -240,6 +252,18 @@ void weak_function stm32_usbinitialize(void); # error "The Mikroe-STM32F4 board does not support HOST OTG, only device!" #endif +/**************************************************************************** + * Name: stm32_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32_qencoder_initialize(FAR const char *devpath, int timer); +#endif + /**************************************************************************************************** * Name: stm32_lcdinitialize * diff --git a/configs/mikroe-stm32f4/src/stm32_appinit.c b/configs/mikroe-stm32f4/src/stm32_appinit.c index 5cb5d176651753be1c62104edd1c79ffee42d77c..f42b6bc917343eae297cc29ddfbab0f1b7ba1d9f 100644 --- a/configs/mikroe-stm32f4/src/stm32_appinit.c +++ b/configs/mikroe-stm32f4/src/stm32_appinit.c @@ -180,11 +180,7 @@ int board_app_initialize(uintptr_t arg) FAR struct spi_dev_s *spi; FAR struct mtd_dev_s *mtd; #endif -#if defined(NSH_HAVEMMCSD) || defined(HAVE_USBHOST) || \ - defined(HAVE_USBMONITOR) || defined(CONFIG_LCD_MIO283QT2) || \ - defined(CONFIG_LCD_MIO283QT9A) - int ret; -#endif + int ret = OK; /* Configure SPI-based devices */ @@ -354,6 +350,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + #if defined(CONFIG_LCD_MIO283QT2) || defined(CONFIG_LCD_MIO283QT9A) /* Configure the TFT LCD module */ @@ -367,13 +373,24 @@ int board_app_initialize(uintptr_t arg) #endif - /* Configure the Audio sub-system if enabled and bind it to SPI 3 */ +#ifdef CONFIG_QENCODER + /* Initialize and register the qencoder driver */ + + ret = stm32_qencoder_initialize("/dev/qe0", CONFIG_MIKROE_QETIMER); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif #ifdef CONFIG_AUDIO + /* Configure the Audio sub-system if enabled and bind it to SPI 3 */ up_vs1053initialize(spi); - #endif - return OK; + return ret; } diff --git a/configs/mikroe-stm32f4/src/stm32_pwm.c b/configs/mikroe-stm32f4/src/stm32_pwm.c index 39ac1f2b6ce09b9e71dd70c107bba31dd64e95dd..2ef8d6c9e63444204b82611ec66d708a79a9491f 100644 --- a/configs/mikroe-stm32f4/src/stm32_pwm.c +++ b/configs/mikroe-stm32f4/src/stm32_pwm.c @@ -58,9 +58,9 @@ /* Configuration *******************************************************************/ /* PWM * - * The mikroe_stm32f4 has no real on-board PWM devices, but the board can be configured to output - * a pulse train using TIM4 CH2. This pin is used by FSMC is connect to CN5 just for this - * purpose: + * The mikroe_stm32f4 has no real on-board PWM devices, but the board can be + * configured to output a pulse train using TIM4 CH2. This pin is used by FSMC is + * connected to CN5 just for this purpose: * * PD13 FSMC_A18 / MC_TIM4_CH2OUT pin 33 (EnB) * @@ -85,27 +85,21 @@ # undef HAVE_PWM #endif -#ifdef HAVE_PWM - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { +#ifdef HAVE_PWM static bool initialized = false; struct pwm_lowerhalf_s *pwm; int ret; @@ -138,6 +132,8 @@ int board_pwm_setup(void) } return OK; +#else + return -ENODEV; +#endif } -#endif /* HAVE_PWM */ diff --git a/configs/mikroe-stm32f4/src/stm32_qencoder.c b/configs/mikroe-stm32f4/src/stm32_qencoder.c index 33855fbaf5ca7c45aba3014b611410eb1eeccaac..43b45729e8fe39313ab3043329e5450819bcc64d 100644 --- a/configs/mikroe-stm32f4/src/stm32_qencoder.c +++ b/configs/mikroe-stm32f4/src/stm32_qencoder.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/mikroe_stm32f4/src/stm32_qencoder.c * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,83 +50,12 @@ #include "stm32_qencoder.h" #include "mikroe-stm32f4.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32_TIMn_QE). - */ - -#ifndef CONFIG_STM32_TIM1 -# undef CONFIG_STM32_TIM1_QE -#endif -#ifndef CONFIG_STM32_TIM2 -# undef CONFIG_STM32_TIM2_QE -#endif -#ifndef CONFIG_STM32_TIM3 -# undef CONFIG_STM32_TIM3_QE -#endif -#ifndef CONFIG_STM32_TIM4 -# undef CONFIG_STM32_TIM4_QE -#endif -#ifndef CONFIG_STM32_TIM5 -# undef CONFIG_STM32_TIM5_QE -#endif -#ifndef CONFIG_STM32_TIM8 -# undef CONFIG_STM32_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: qe_devinit + * Name: stm32_qencoder_initialize * * Description: * All STM32 architectures must provide the following interface to work with @@ -134,29 +63,20 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } #endif /* HAVE_QENCODER */ diff --git a/configs/mikroe-stm32f4/usbnsh/defconfig b/configs/mikroe-stm32f4/usbnsh/defconfig index d33f84fee3711840b82c33e3d74a217c4b1dfc66..6ebceb9c459676692a5facbea3cb73031301af75 100644 --- a/configs/mikroe-stm32f4/usbnsh/defconfig +++ b/configs/mikroe-stm32f4/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -581,8 +579,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -824,7 +820,6 @@ CONFIG_MTD_SMART_WEAR_LEVEL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1128,7 +1123,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/mirtoo/nsh/defconfig b/configs/mirtoo/nsh/defconfig index 125afec3bbd914cfe06cf028c1dbf23b39a94574..3630f0f2232a6e5ac49b816cce7387e96be9398e 100644 --- a/configs/mirtoo/nsh/defconfig +++ b/configs/mirtoo/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -500,7 +499,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -718,7 +716,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/mirtoo/nxffs/defconfig b/configs/mirtoo/nxffs/defconfig index 3ec96c7bca1386d93b4808c05b601ceefbc9c39b..627d0b9e7aac925a2e35f1d866ce766f932965c9 100644 --- a/configs/mirtoo/nxffs/defconfig +++ b/configs/mirtoo/nxffs/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -342,8 +341,6 @@ CONFIG_MIRTOO_RELEASE=2 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -543,7 +540,6 @@ CONFIG_SST25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -779,7 +775,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/misoc/README.txt b/configs/misoc/README.txt index 2bb07dc6993c250020d574c1f79fe51feb1dc850..a241aba6b6a741e1f1a621fb1563f518fc2e9260 100644 --- a/configs/misoc/README.txt +++ b/configs/misoc/README.txt @@ -63,3 +63,19 @@ Buildroot Toolchain CONFIG_LM3S_TOOLCHAIN_BUILDROOT=y +configs/misoc/include/generated +=============================== + + In order to build this configuration, you must provide the + configs/misoc/include/generated directory. It contains the generated + Misoc files and may be a symbolic link. The base configurtion will NOT + build without this directory! + + There is a sample generated directory at configs/misoc/include/generated-sample. + If you want to do a test build without generating the architecture, then + you can simply link this sample directory like: + + $ ln -s configs/misoc/include/generated-sample configs/misoc/include/generated + + That should permit a test build. + diff --git a/configs/misoc/hello/defconfig b/configs/misoc/hello/defconfig index dddddfd3ee91eadd68b703f85447a29262733ff5..a9a5dfc138453ef6982fb673f46ef21b62e3ca2b 100644 --- a/configs/misoc/hello/defconfig +++ b/configs/misoc/hello/defconfig @@ -59,6 +59,7 @@ CONFIG_DEBUG_FEATURES=y # CONFIG_DEBUG_GRAPHICS is not set # CONFIG_DEBUG_LIB is not set # CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_NET is not set # CONFIG_DEBUG_SCHED is not set # @@ -87,7 +88,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set CONFIG_ARCH_MISOC=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -105,6 +105,7 @@ CONFIG_ARCH_CHIP_LM32=y # CONFIG_MISOC_HAVE_UART1=y CONFIG_MISOC_UART1=y +CONFIG_MISOC_ETHERNET=y CONFIG_MISOC_UART=y CONFIG_MISOC_UART_RX_BUF_SIZE=64 CONFIG_MISOC_UART_TX_BUF_SIZE=64 @@ -131,7 +132,7 @@ CONFIG_LM32_TOOLCHAIN_GNUL=y # CONFIG_ARCH_HAVE_POWEROFF is not set # CONFIG_ARCH_HAVE_RESET is not set CONFIG_ARCH_STACKDUMP=y -# CONFIG_ENDIAN_BIG is not set +CONFIG_ENDIAN_BIG=y # CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set # CONFIG_ARCH_HAVE_RAMVECTORS is not set @@ -162,7 +163,7 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x40000000 -CONFIG_RAM_SIZE=524288 +CONFIG_RAM_SIZE=67108864 # CONFIG_ARCH_HAVE_SDRAM is not set # @@ -178,6 +179,7 @@ CONFIG_ARCH_BOARD_CUSTOM_DIR="/configs/misoc/" CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y # CONFIG_BOARD_CUSTOM_LEDS is not set # CONFIG_BOARD_CUSTOM_BUTTONS is not set +# CONFIG_BOARD_CUSTOM_INTERRUPT is not set # # Common Board Options @@ -193,11 +195,11 @@ CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y # RTOS Features # CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set # # Clocks and Timers @@ -211,9 +213,9 @@ CONFIG_START_YEAR=2011 CONFIG_START_MONTH=6 CONFIG_START_DAY=16 CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 +CONFIG_PREALLOC_WDOGS=8 +CONFIG_WDOG_INTRESERVE=1 +CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling @@ -221,13 +223,19 @@ CONFIG_PREALLOC_TIMERS=0 # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="hello_main" -CONFIG_RR_INTERVAL=0 +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=4 +CONFIG_MAX_TASKS=16 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# +# CONFIG_MUTEX_TYPES is not set +CONFIG_NPTHREAD_KEYS=4 # # Performance Monitoring @@ -254,25 +262,47 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=32 +CONFIG_MQ_MAXMSGSIZE=32 # CONFIG_MODULE is not set # # Work queue support # +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 +# CONFIG_SCHED_LPWORK is not set # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=512 -CONFIG_USERMAIN_STACKSIZE=512 +CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 +CONFIG_PTHREAD_STACK_DEFAULT=2048 # CONFIG_LIB_SYSCALL is not set # # Device Drivers # -CONFIG_DISABLE_POLL=y +# CONFIG_DISABLE_POLL is not set CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_DEV_URANDOM is not set @@ -331,11 +361,52 @@ CONFIG_DEV_NULL=y # CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set +CONFIG_NETDEVICES=y + +# +# General Ethernet MAC Driver Options +# +# CONFIG_NETDEV_LOOPBACK is not set +CONFIG_NETDEV_TELNET=y +CONFIG_TELNET_RXBUFFER_SIZE=256 +CONFIG_TELNET_TXBUFFER_SIZE=256 +# CONFIG_NETDEV_MULTINIC is not set +CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y +# CONFIG_NETDEV_LATEINIT is not set +# CONFIG_NET_DUMPPACKET is not set + +# +# External Ethernet MAC Device Support +# +# CONFIG_NET_DM90x0 is not set +# CONFIG_ENC28J60 is not set +# CONFIG_ENCX24J600 is not set +# CONFIG_NET_SLIP is not set +# CONFIG_NET_FTMAC100 is not set + +# +# External Ethernet PHY Device Support +# +# CONFIG_ARCH_PHY_INTERRUPT is not set +CONFIG_ETH0_PHY_NONE=y +# CONFIG_ETH0_PHY_AM79C874 is not set +# CONFIG_ETH0_PHY_KS8721 is not set +# CONFIG_ETH0_PHY_KSZ8041 is not set +# CONFIG_ETH0_PHY_KSZ8051 is not set +# CONFIG_ETH0_PHY_KSZ8061 is not set +# CONFIG_ETH0_PHY_KSZ8081 is not set +# CONFIG_ETH0_PHY_KSZ90x1 is not set +# CONFIG_ETH0_PHY_DP83848C is not set +# CONFIG_ETH0_PHY_LAN8720 is not set +# CONFIG_ETH0_PHY_LAN8740 is not set +# CONFIG_ETH0_PHY_LAN8740A is not set +# CONFIG_ETH0_PHY_LAN8742A is not set +# CONFIG_ETH0_PHY_DM9161 is not set +# CONFIG_NETDEV_PHY_DEBUG is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -410,9 +481,115 @@ CONFIG_SYSLOG_CONSOLE=y # # Networking Support # -# CONFIG_ARCH_HAVE_NET is not set -# CONFIG_ARCH_HAVE_PHY is not set -# CONFIG_NET is not set +CONFIG_ARCH_HAVE_NET=y +CONFIG_ARCH_HAVE_PHY=y +CONFIG_NET=y +# CONFIG_NET_PROMISCUOUS is not set + +# +# Driver buffer configuration +# +CONFIG_NET_ETH_MTU=1400 +CONFIG_NET_ETH_TCP_RECVWNDO=742 +CONFIG_NET_GUARDSIZE=648 + +# +# Data link support +# +# CONFIG_NET_MULTILINK is not set +CONFIG_NET_ETHERNET=y +# CONFIG_NET_LOOPBACK is not set +# CONFIG_NET_TUN is not set + +# +# Network Device Operations +# +# CONFIG_NETDEV_PHY_IOCTL is not set + +# +# Internet Protocol Selection +# +CONFIG_NET_IPv4=y +# CONFIG_NET_IPv6 is not set + +# +# Socket Support +# +CONFIG_NSOCKET_DESCRIPTORS=8 +CONFIG_NET_NACTIVESOCKETS=16 +CONFIG_NET_SOCKOPTS=y +# CONFIG_NET_SOLINGER is not set + +# +# Raw Socket Support +# +# CONFIG_NET_PKT is not set + +# +# TCP/IP Networking +# +CONFIG_NET_TCP=y +# CONFIG_NET_TCPURGDATA is not set +CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_MAX_LISTENPORTS=40 +CONFIG_NET_TCP_READAHEAD=y +CONFIG_NET_TCP_WRITE_BUFFERS=y +CONFIG_NET_TCP_NWRBCHAINS=8 +# CONFIG_NET_TCP_WRBUFFER_DEBUG is not set +CONFIG_NET_TCP_RECVDELAY=0 +# CONFIG_NET_TCPBACKLOG is not set +# CONFIG_NET_SENDFILE is not set + +# +# UDP Networking +# +CONFIG_NET_UDP=y +CONFIG_NET_UDP_CHECKSUMS=y +CONFIG_NET_UDP_CONNS=8 +CONFIG_NET_BROADCAST=y +# CONFIG_NET_RXAVAIL is not set +CONFIG_NET_UDP_READAHEAD=y + +# +# ICMP Networking Support +# +CONFIG_NET_ICMP=y +CONFIG_NET_ICMP_PING=y + +# +# IGMPv2 Client Support +# +# CONFIG_NET_IGMP is not set + +# +# ARP Configuration +# +CONFIG_NET_ARP=y +CONFIG_NET_ARPTAB_SIZE=16 +CONFIG_NET_ARP_MAXAGE=120 +CONFIG_NET_ARP_IPIN=y +CONFIG_NET_ARP_SEND=y +CONFIG_ARP_SEND_MAXTRIES=5 +CONFIG_ARP_SEND_DELAYMSEC=20 + +# +# Network I/O Buffer Support +# +CONFIG_NET_IOB=y +CONFIG_IOB_NBUFFERS=24 +CONFIG_IOB_BUFSIZE=196 +CONFIG_IOB_NCHAINS=8 +CONFIG_IOB_THROTTLE=8 +# CONFIG_IOB_DEBUG is not set +# CONFIG_NET_ARCH_INCR32 is not set +# CONFIG_NET_ARCH_CHKSUM is not set +# CONFIG_NET_STATISTICS is not set + +# +# Routing Table Configuration +# +# CONFIG_NET_ROUTE is not set +CONFIG_NET_HOSTNAME="nuttx" # # Crypto API @@ -431,7 +608,9 @@ CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y # CONFIG_FS_READABLE is not set # CONFIG_FS_WRITABLE is not set # CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set +# CONFIG_FS_BINFS is not set # CONFIG_FS_PROCFS is not set # CONFIG_FS_UNIONFS is not set @@ -461,9 +640,10 @@ CONFIG_MM_REGIONS=1 # Binary Loader # # CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set -# CONFIG_BUILTIN is not set +CONFIG_BUILTIN=y # CONFIG_PIC is not set # CONFIG_SYMTAB_ORDEREDBYNAME is not set @@ -474,13 +654,14 @@ CONFIG_MM_REGIONS=1 # # Standard C Library Options # -CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=0 +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set # CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set -# CONFIG_LIBC_LONG_LONG is not set +CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set # CONFIG_LIBC_WCHAR is not set # CONFIG_LIBC_LOCALE is not set @@ -495,12 +676,21 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set # CONFIG_TIME_EXTENDED is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # CONFIG_ARCH_HAVE_TLS is not set -# CONFIG_LIBC_NETDB is not set +CONFIG_LIBC_NETDB=y +CONFIG_NETDB_DNSCLIENT=y +CONFIG_NETDB_DNSCLIENT_ENTRIES=8 +CONFIG_NETDB_DNSCLIENT_NAMESIZE=32 +CONFIG_NETDB_DNSCLIENT_LIFESEC=3600 +CONFIG_NETDB_DNSCLIENT_MAXRESPONSE=96 +# CONFIG_NETDB_DNSSERVER_NOADDR is not set +CONFIG_NETDB_DNSSERVER_IPv4=y +CONFIG_NETDB_DNSSERVER_IPv4ADDR=0x08080808 # # Non-standard Library Support @@ -514,12 +704,24 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # Basic CXX Support # # CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set +CONFIG_HAVE_CXX=y +# CONFIG_HAVE_CXXINITIALIZE is not set +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set # # Application Configuration # +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + # # CAN Utilities # @@ -530,13 +732,16 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_DISCOVER is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_PRIORITY=100 CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 +# CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set @@ -545,8 +750,22 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set +CONFIG_EXAMPLES_NETTEST=y +# CONFIG_EXAMPLES_NETTEST_SERVER is not set +CONFIG_EXAMPLES_NETTEST_PERFORMANCE=y +CONFIG_EXAMPLES_NETTEST_IPv4=y +CONFIG_EXAMPLES_NETTEST_INIT=y +CONFIG_EXAMPLES_NETTEST_NOMAC=y + +# +# IPv4 addresses +# +CONFIG_EXAMPLES_NETTEST_IPADDR=0xc0a80132 +CONFIG_EXAMPLES_NETTEST_DRIPADDR=0xc0a80101 +CONFIG_EXAMPLES_NETTEST_NETMASK=0xffffff00 +CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8023b # CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set +CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set @@ -555,27 +774,47 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_OSTEST=y +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMP is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set +CONFIG_EXAMPLES_TCPECHO=y +CONFIG_EXAMPLES_TCPECHO_PORT=80 +CONFIG_EXAMPLES_TCPECHO_BACKLOG=8 +CONFIG_EXAMPLES_TCPECHO_NCONN=8 +CONFIG_EXAMPLES_TELNETD=y +CONFIG_EXAMPLES_TELNETD_NOMAC=y +CONFIG_EXAMPLES_TELNETD_IPADDR=0xc0a80132 +CONFIG_EXAMPLES_TELNETD_DRIPADDR=0xc0a80101 +CONFIG_EXAMPLES_TELNETD_NETMASK=0xffffff00 +CONFIG_EXAMPLES_TELNETD_DAEMONPRIO=100 +CONFIG_EXAMPLES_TELNETD_DAEMONSTACKSIZE=2048 +CONFIG_EXAMPLES_TELNETD_CLIENTPRIO=100 +CONFIG_EXAMPLES_TELNETD_CLIENTSTACKSIZE=2048 # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UDPBLASTER is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set +# CONFIG_EXAMPLES_XMLRPC is not set # # File System Utilities @@ -609,16 +848,162 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # # Network Utilities # +# CONFIG_NETUTILS_CHAT is not set # CONFIG_NETUTILS_CODECS is not set +CONFIG_NETUTILS_DHCPC=y +# CONFIG_NETUTILS_DHCPD is not set +CONFIG_NETUTILS_DISCOVER=y +CONFIG_DISCOVER_STACK_SIZE=1024 +CONFIG_DISCOVER_PRIORITY=50 +CONFIG_DISCOVER_PORT=96 +CONFIG_DISCOVER_INTERFACE="eth0" +CONFIG_DISCOVER_DEVICE_CLASS=0xff +CONFIG_DISCOVER_DESCR="NuttX" # CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set # CONFIG_NETUTILS_JSON is not set +CONFIG_NETUTILS_NETLIB=y +# CONFIG_NETUTILS_NTPCLIENT is not set +# CONFIG_NETUTILS_PPPD is not set # CONFIG_NETUTILS_SMTP is not set +CONFIG_NETUTILS_TELNETD=y +# CONFIG_NETUTILS_TFTPC is not set +CONFIG_NETUTILS_WEBCLIENT=y +CONFIG_NSH_WGET_USERAGENT="NuttX/6.xx.x (; http://www.nuttx.org/)" +CONFIG_WEBCLIENT_TIMEOUT=10 +# CONFIG_NETUTILS_WEBSERVER is not set +# CONFIG_NETUTILS_XMLRPC is not set # # NSH Library # -# CONFIG_NSH_LIBRARY is not set +CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set + +# +# Command Line Configuration +# +# CONFIG_NSH_READLINE is not set +CONFIG_NSH_CLE=y +CONFIG_NSH_LINELEN=80 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_MAXARGUMENTS=6 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_ADDROUTE is not set +# CONFIG_NSH_DISABLE_ARP is not set +# CONFIG_NSH_DISABLE_BASENAME is not set +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set +CONFIG_NSH_DISABLE_DATE=y +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set +# CONFIG_NSH_DISABLE_DIRNAME is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +CONFIG_NSH_DISABLE_IFCONFIG=y +CONFIG_NSH_DISABLE_IFUPDOWN=y +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +CONFIG_NSH_DISABLE_LOSMART=y +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSLOOKUP is not set +CONFIG_NSH_DISABLE_PRINTF=y +CONFIG_NSH_DISABLE_PS=y +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNAME is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 + +# +# Configure Command Options +# +CONFIG_NSH_CMDOPT_DF_H=y +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y +CONFIG_NSH_FILEIOSIZE=1024 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +# CONFIG_NSH_ARCHINIT is not set + +# +# Networking Configuration +# +CONFIG_NSH_NETINIT=y +CONFIG_NSH_NETINIT_THREAD=y +CONFIG_NSH_NETINIT_THREAD_STACKSIZE=1568 +CONFIG_NSH_NETINIT_THREAD_PRIORITY=80 +CONFIG_NSH_NETINIT_DEBUG=y + +# +# IP Address Configuration +# +# CONFIG_NSH_DHCPC is not set + +# +# IPv4 Addresses +# +CONFIG_NSH_IPADDR=0xc0a80132 +CONFIG_NSH_DRIPADDR=0xc0a80101 +CONFIG_NSH_NETMASK=0xffffff00 +# CONFIG_NSH_DNS is not set +CONFIG_NSH_NOMAC=y +CONFIG_NSH_SWMAC=y +CONFIG_NSH_MACADDR=0x00e0deadbeef +CONFIG_NSH_MAX_ROUNDTRIP=20 + +# +# Telnet Configuration +# +# CONFIG_NSH_TELNET is not set +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -632,16 +1017,22 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # # System Libraries and NSH Add-Ons # -# CONFIG_SYSTEM_CLE is not set +CONFIG_SYSTEM_CLE=y +CONFIG_SYSTEM_CLE_DEBUGLEVEL=0 # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set # CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set +# CONFIG_SYSTEM_NETDB is not set # CONFIG_SYSTEM_RAMTEST is not set -# CONFIG_READLINE_HAVE_EXTMATCH is not set -# CONFIG_SYSTEM_READLINE is not set +CONFIG_READLINE_HAVE_EXTMATCH=y +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y +# CONFIG_READLINE_TABCOMPLETION is not set +# CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set # CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set diff --git a/configs/misoc/include/.gitignore b/configs/misoc/include/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e324eac91fcfd938429689afbe359bc9fcfcc913 --- /dev/null +++ b/configs/misoc/include/.gitignore @@ -0,0 +1 @@ +/generated diff --git a/configs/misoc/include/generated-sample/csr.h b/configs/misoc/include/generated-sample/csr.h new file mode 100644 index 0000000000000000000000000000000000000000..e58b0e0bf4fe1c6b73dc52ea0c32fa293d4b3b00 --- /dev/null +++ b/configs/misoc/include/generated-sample/csr.h @@ -0,0 +1,653 @@ +#ifndef __GENERATED_CSR_H +#define __GENERATED_CSR_H +#include + +/* ddrphy */ +#define CSR_DDRPHY_BASE 0xe0008800 +#define CSR_DDRPHY_DLY_SEL_ADDR 0xe0008800 +#define CSR_DDRPHY_DLY_SEL_SIZE 1 +static inline unsigned char ddrphy_dly_sel_read(void) { + unsigned char r = MMPTR(0xe0008800); + return r; +} +static inline void ddrphy_dly_sel_write(unsigned char value) { + MMPTR(0xe0008800) = value; +} +#define CSR_DDRPHY_RDLY_DQ_RST_ADDR 0xe0008804 +#define CSR_DDRPHY_RDLY_DQ_RST_SIZE 1 +static inline unsigned char ddrphy_rdly_dq_rst_read(void) { + unsigned char r = MMPTR(0xe0008804); + return r; +} +static inline void ddrphy_rdly_dq_rst_write(unsigned char value) { + MMPTR(0xe0008804) = value; +} +#define CSR_DDRPHY_RDLY_DQ_INC_ADDR 0xe0008808 +#define CSR_DDRPHY_RDLY_DQ_INC_SIZE 1 +static inline unsigned char ddrphy_rdly_dq_inc_read(void) { + unsigned char r = MMPTR(0xe0008808); + return r; +} +static inline void ddrphy_rdly_dq_inc_write(unsigned char value) { + MMPTR(0xe0008808) = value; +} +#define CSR_DDRPHY_RDLY_DQ_BITSLIP_ADDR 0xe000880c +#define CSR_DDRPHY_RDLY_DQ_BITSLIP_SIZE 1 +static inline unsigned char ddrphy_rdly_dq_bitslip_read(void) { + unsigned char r = MMPTR(0xe000880c); + return r; +} +static inline void ddrphy_rdly_dq_bitslip_write(unsigned char value) { + MMPTR(0xe000880c) = value; +} + +/* ethmac */ +#define CSR_ETHMAC_BASE 0xe000f800 +#define CSR_ETHMAC_SRAM_WRITER_SLOT_ADDR 0xe000f800 +#define CSR_ETHMAC_SRAM_WRITER_SLOT_SIZE 1 +static inline unsigned char ethmac_sram_writer_slot_read(void) { + unsigned char r = MMPTR(0xe000f800); + return r; +} +#define CSR_ETHMAC_SRAM_WRITER_LENGTH_ADDR 0xe000f804 +#define CSR_ETHMAC_SRAM_WRITER_LENGTH_SIZE 4 +static inline unsigned int ethmac_sram_writer_length_read(void) { + unsigned int r = MMPTR(0xe000f804); + r <<= 8; + r |= MMPTR(0xe000f808); + r <<= 8; + r |= MMPTR(0xe000f80c); + r <<= 8; + r |= MMPTR(0xe000f810); + return r; +} +#define CSR_ETHMAC_SRAM_WRITER_EV_STATUS_ADDR 0xe000f814 +#define CSR_ETHMAC_SRAM_WRITER_EV_STATUS_SIZE 1 +static inline unsigned char ethmac_sram_writer_ev_status_read(void) { + unsigned char r = MMPTR(0xe000f814); + return r; +} +static inline void ethmac_sram_writer_ev_status_write(unsigned char value) { + MMPTR(0xe000f814) = value; +} +#define CSR_ETHMAC_SRAM_WRITER_EV_PENDING_ADDR 0xe000f818 +#define CSR_ETHMAC_SRAM_WRITER_EV_PENDING_SIZE 1 +static inline unsigned char ethmac_sram_writer_ev_pending_read(void) { + unsigned char r = MMPTR(0xe000f818); + return r; +} +static inline void ethmac_sram_writer_ev_pending_write(unsigned char value) { + MMPTR(0xe000f818) = value; +} +#define CSR_ETHMAC_SRAM_WRITER_EV_ENABLE_ADDR 0xe000f81c +#define CSR_ETHMAC_SRAM_WRITER_EV_ENABLE_SIZE 1 +static inline unsigned char ethmac_sram_writer_ev_enable_read(void) { + unsigned char r = MMPTR(0xe000f81c); + return r; +} +static inline void ethmac_sram_writer_ev_enable_write(unsigned char value) { + MMPTR(0xe000f81c) = value; +} +#define CSR_ETHMAC_SRAM_READER_START_ADDR 0xe000f820 +#define CSR_ETHMAC_SRAM_READER_START_SIZE 1 +static inline unsigned char ethmac_sram_reader_start_read(void) { + unsigned char r = MMPTR(0xe000f820); + return r; +} +static inline void ethmac_sram_reader_start_write(unsigned char value) { + MMPTR(0xe000f820) = value; +} +#define CSR_ETHMAC_SRAM_READER_READY_ADDR 0xe000f824 +#define CSR_ETHMAC_SRAM_READER_READY_SIZE 1 +static inline unsigned char ethmac_sram_reader_ready_read(void) { + unsigned char r = MMPTR(0xe000f824); + return r; +} +#define CSR_ETHMAC_SRAM_READER_SLOT_ADDR 0xe000f828 +#define CSR_ETHMAC_SRAM_READER_SLOT_SIZE 1 +static inline unsigned char ethmac_sram_reader_slot_read(void) { + unsigned char r = MMPTR(0xe000f828); + return r; +} +static inline void ethmac_sram_reader_slot_write(unsigned char value) { + MMPTR(0xe000f828) = value; +} +#define CSR_ETHMAC_SRAM_READER_LENGTH_ADDR 0xe000f82c +#define CSR_ETHMAC_SRAM_READER_LENGTH_SIZE 2 +static inline unsigned short int ethmac_sram_reader_length_read(void) { + unsigned short int r = MMPTR(0xe000f82c); + r <<= 8; + r |= MMPTR(0xe000f830); + return r; +} +static inline void ethmac_sram_reader_length_write(unsigned short int value) { + MMPTR(0xe000f82c) = value >> 8; + MMPTR(0xe000f830) = value; +} +#define CSR_ETHMAC_SRAM_READER_EV_STATUS_ADDR 0xe000f834 +#define CSR_ETHMAC_SRAM_READER_EV_STATUS_SIZE 1 +static inline unsigned char ethmac_sram_reader_ev_status_read(void) { + unsigned char r = MMPTR(0xe000f834); + return r; +} +static inline void ethmac_sram_reader_ev_status_write(unsigned char value) { + MMPTR(0xe000f834) = value; +} +#define CSR_ETHMAC_SRAM_READER_EV_PENDING_ADDR 0xe000f838 +#define CSR_ETHMAC_SRAM_READER_EV_PENDING_SIZE 1 +static inline unsigned char ethmac_sram_reader_ev_pending_read(void) { + unsigned char r = MMPTR(0xe000f838); + return r; +} +static inline void ethmac_sram_reader_ev_pending_write(unsigned char value) { + MMPTR(0xe000f838) = value; +} +#define CSR_ETHMAC_SRAM_READER_EV_ENABLE_ADDR 0xe000f83c +#define CSR_ETHMAC_SRAM_READER_EV_ENABLE_SIZE 1 +static inline unsigned char ethmac_sram_reader_ev_enable_read(void) { + unsigned char r = MMPTR(0xe000f83c); + return r; +} +static inline void ethmac_sram_reader_ev_enable_write(unsigned char value) { + MMPTR(0xe000f83c) = value; +} +#define CSR_ETHMAC_PREAMBLE_CRC_ADDR 0xe000f840 +#define CSR_ETHMAC_PREAMBLE_CRC_SIZE 1 +static inline unsigned char ethmac_preamble_crc_read(void) { + unsigned char r = MMPTR(0xe000f840); + return r; +} + +/* ethphy */ +#define CSR_ETHPHY_BASE 0xe000f000 +#define CSR_ETHPHY_CRG_RESET_ADDR 0xe000f000 +#define CSR_ETHPHY_CRG_RESET_SIZE 1 +static inline unsigned char ethphy_crg_reset_read(void) { + unsigned char r = MMPTR(0xe000f000); + return r; +} +static inline void ethphy_crg_reset_write(unsigned char value) { + MMPTR(0xe000f000) = value; +} +#define CSR_ETHPHY_MDIO_W_ADDR 0xe000f004 +#define CSR_ETHPHY_MDIO_W_SIZE 1 +static inline unsigned char ethphy_mdio_w_read(void) { + unsigned char r = MMPTR(0xe000f004); + return r; +} +static inline void ethphy_mdio_w_write(unsigned char value) { + MMPTR(0xe000f004) = value; +} +#define CSR_ETHPHY_MDIO_R_ADDR 0xe000f008 +#define CSR_ETHPHY_MDIO_R_SIZE 1 +static inline unsigned char ethphy_mdio_r_read(void) { + unsigned char r = MMPTR(0xe000f008); + return r; +} + +/* sdram */ +#define CSR_SDRAM_BASE 0xe0004000 +#define CSR_SDRAM_DFII_CONTROL_ADDR 0xe0004000 +#define CSR_SDRAM_DFII_CONTROL_SIZE 1 +static inline unsigned char sdram_dfii_control_read(void) { + unsigned char r = MMPTR(0xe0004000); + return r; +} +static inline void sdram_dfii_control_write(unsigned char value) { + MMPTR(0xe0004000) = value; +} +#define CSR_SDRAM_DFII_PI0_COMMAND_ADDR 0xe0004004 +#define CSR_SDRAM_DFII_PI0_COMMAND_SIZE 1 +static inline unsigned char sdram_dfii_pi0_command_read(void) { + unsigned char r = MMPTR(0xe0004004); + return r; +} +static inline void sdram_dfii_pi0_command_write(unsigned char value) { + MMPTR(0xe0004004) = value; +} +#define CSR_SDRAM_DFII_PI0_COMMAND_ISSUE_ADDR 0xe0004008 +#define CSR_SDRAM_DFII_PI0_COMMAND_ISSUE_SIZE 1 +static inline unsigned char sdram_dfii_pi0_command_issue_read(void) { + unsigned char r = MMPTR(0xe0004008); + return r; +} +static inline void sdram_dfii_pi0_command_issue_write(unsigned char value) { + MMPTR(0xe0004008) = value; +} +#define CSR_SDRAM_DFII_PI0_ADDRESS_ADDR 0xe000400c +#define CSR_SDRAM_DFII_PI0_ADDRESS_SIZE 2 +static inline unsigned short int sdram_dfii_pi0_address_read(void) { + unsigned short int r = MMPTR(0xe000400c); + r <<= 8; + r |= MMPTR(0xe0004010); + return r; +} +static inline void sdram_dfii_pi0_address_write(unsigned short int value) { + MMPTR(0xe000400c) = value >> 8; + MMPTR(0xe0004010) = value; +} +#define CSR_SDRAM_DFII_PI0_BADDRESS_ADDR 0xe0004014 +#define CSR_SDRAM_DFII_PI0_BADDRESS_SIZE 1 +static inline unsigned char sdram_dfii_pi0_baddress_read(void) { + unsigned char r = MMPTR(0xe0004014); + return r; +} +static inline void sdram_dfii_pi0_baddress_write(unsigned char value) { + MMPTR(0xe0004014) = value; +} +#define CSR_SDRAM_DFII_PI0_WRDATA_ADDR 0xe0004018 +#define CSR_SDRAM_DFII_PI0_WRDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi0_wrdata_read(void) { + unsigned int r = MMPTR(0xe0004018); + r <<= 8; + r |= MMPTR(0xe000401c); + r <<= 8; + r |= MMPTR(0xe0004020); + r <<= 8; + r |= MMPTR(0xe0004024); + return r; +} +static inline void sdram_dfii_pi0_wrdata_write(unsigned int value) { + MMPTR(0xe0004018) = value >> 24; + MMPTR(0xe000401c) = value >> 16; + MMPTR(0xe0004020) = value >> 8; + MMPTR(0xe0004024) = value; +} +#define CSR_SDRAM_DFII_PI0_RDDATA_ADDR 0xe0004028 +#define CSR_SDRAM_DFII_PI0_RDDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi0_rddata_read(void) { + unsigned int r = MMPTR(0xe0004028); + r <<= 8; + r |= MMPTR(0xe000402c); + r <<= 8; + r |= MMPTR(0xe0004030); + r <<= 8; + r |= MMPTR(0xe0004034); + return r; +} +#define CSR_SDRAM_DFII_PI1_COMMAND_ADDR 0xe0004038 +#define CSR_SDRAM_DFII_PI1_COMMAND_SIZE 1 +static inline unsigned char sdram_dfii_pi1_command_read(void) { + unsigned char r = MMPTR(0xe0004038); + return r; +} +static inline void sdram_dfii_pi1_command_write(unsigned char value) { + MMPTR(0xe0004038) = value; +} +#define CSR_SDRAM_DFII_PI1_COMMAND_ISSUE_ADDR 0xe000403c +#define CSR_SDRAM_DFII_PI1_COMMAND_ISSUE_SIZE 1 +static inline unsigned char sdram_dfii_pi1_command_issue_read(void) { + unsigned char r = MMPTR(0xe000403c); + return r; +} +static inline void sdram_dfii_pi1_command_issue_write(unsigned char value) { + MMPTR(0xe000403c) = value; +} +#define CSR_SDRAM_DFII_PI1_ADDRESS_ADDR 0xe0004040 +#define CSR_SDRAM_DFII_PI1_ADDRESS_SIZE 2 +static inline unsigned short int sdram_dfii_pi1_address_read(void) { + unsigned short int r = MMPTR(0xe0004040); + r <<= 8; + r |= MMPTR(0xe0004044); + return r; +} +static inline void sdram_dfii_pi1_address_write(unsigned short int value) { + MMPTR(0xe0004040) = value >> 8; + MMPTR(0xe0004044) = value; +} +#define CSR_SDRAM_DFII_PI1_BADDRESS_ADDR 0xe0004048 +#define CSR_SDRAM_DFII_PI1_BADDRESS_SIZE 1 +static inline unsigned char sdram_dfii_pi1_baddress_read(void) { + unsigned char r = MMPTR(0xe0004048); + return r; +} +static inline void sdram_dfii_pi1_baddress_write(unsigned char value) { + MMPTR(0xe0004048) = value; +} +#define CSR_SDRAM_DFII_PI1_WRDATA_ADDR 0xe000404c +#define CSR_SDRAM_DFII_PI1_WRDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi1_wrdata_read(void) { + unsigned int r = MMPTR(0xe000404c); + r <<= 8; + r |= MMPTR(0xe0004050); + r <<= 8; + r |= MMPTR(0xe0004054); + r <<= 8; + r |= MMPTR(0xe0004058); + return r; +} +static inline void sdram_dfii_pi1_wrdata_write(unsigned int value) { + MMPTR(0xe000404c) = value >> 24; + MMPTR(0xe0004050) = value >> 16; + MMPTR(0xe0004054) = value >> 8; + MMPTR(0xe0004058) = value; +} +#define CSR_SDRAM_DFII_PI1_RDDATA_ADDR 0xe000405c +#define CSR_SDRAM_DFII_PI1_RDDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi1_rddata_read(void) { + unsigned int r = MMPTR(0xe000405c); + r <<= 8; + r |= MMPTR(0xe0004060); + r <<= 8; + r |= MMPTR(0xe0004064); + r <<= 8; + r |= MMPTR(0xe0004068); + return r; +} +#define CSR_SDRAM_DFII_PI2_COMMAND_ADDR 0xe000406c +#define CSR_SDRAM_DFII_PI2_COMMAND_SIZE 1 +static inline unsigned char sdram_dfii_pi2_command_read(void) { + unsigned char r = MMPTR(0xe000406c); + return r; +} +static inline void sdram_dfii_pi2_command_write(unsigned char value) { + MMPTR(0xe000406c) = value; +} +#define CSR_SDRAM_DFII_PI2_COMMAND_ISSUE_ADDR 0xe0004070 +#define CSR_SDRAM_DFII_PI2_COMMAND_ISSUE_SIZE 1 +static inline unsigned char sdram_dfii_pi2_command_issue_read(void) { + unsigned char r = MMPTR(0xe0004070); + return r; +} +static inline void sdram_dfii_pi2_command_issue_write(unsigned char value) { + MMPTR(0xe0004070) = value; +} +#define CSR_SDRAM_DFII_PI2_ADDRESS_ADDR 0xe0004074 +#define CSR_SDRAM_DFII_PI2_ADDRESS_SIZE 2 +static inline unsigned short int sdram_dfii_pi2_address_read(void) { + unsigned short int r = MMPTR(0xe0004074); + r <<= 8; + r |= MMPTR(0xe0004078); + return r; +} +static inline void sdram_dfii_pi2_address_write(unsigned short int value) { + MMPTR(0xe0004074) = value >> 8; + MMPTR(0xe0004078) = value; +} +#define CSR_SDRAM_DFII_PI2_BADDRESS_ADDR 0xe000407c +#define CSR_SDRAM_DFII_PI2_BADDRESS_SIZE 1 +static inline unsigned char sdram_dfii_pi2_baddress_read(void) { + unsigned char r = MMPTR(0xe000407c); + return r; +} +static inline void sdram_dfii_pi2_baddress_write(unsigned char value) { + MMPTR(0xe000407c) = value; +} +#define CSR_SDRAM_DFII_PI2_WRDATA_ADDR 0xe0004080 +#define CSR_SDRAM_DFII_PI2_WRDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi2_wrdata_read(void) { + unsigned int r = MMPTR(0xe0004080); + r <<= 8; + r |= MMPTR(0xe0004084); + r <<= 8; + r |= MMPTR(0xe0004088); + r <<= 8; + r |= MMPTR(0xe000408c); + return r; +} +static inline void sdram_dfii_pi2_wrdata_write(unsigned int value) { + MMPTR(0xe0004080) = value >> 24; + MMPTR(0xe0004084) = value >> 16; + MMPTR(0xe0004088) = value >> 8; + MMPTR(0xe000408c) = value; +} +#define CSR_SDRAM_DFII_PI2_RDDATA_ADDR 0xe0004090 +#define CSR_SDRAM_DFII_PI2_RDDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi2_rddata_read(void) { + unsigned int r = MMPTR(0xe0004090); + r <<= 8; + r |= MMPTR(0xe0004094); + r <<= 8; + r |= MMPTR(0xe0004098); + r <<= 8; + r |= MMPTR(0xe000409c); + return r; +} +#define CSR_SDRAM_DFII_PI3_COMMAND_ADDR 0xe00040a0 +#define CSR_SDRAM_DFII_PI3_COMMAND_SIZE 1 +static inline unsigned char sdram_dfii_pi3_command_read(void) { + unsigned char r = MMPTR(0xe00040a0); + return r; +} +static inline void sdram_dfii_pi3_command_write(unsigned char value) { + MMPTR(0xe00040a0) = value; +} +#define CSR_SDRAM_DFII_PI3_COMMAND_ISSUE_ADDR 0xe00040a4 +#define CSR_SDRAM_DFII_PI3_COMMAND_ISSUE_SIZE 1 +static inline unsigned char sdram_dfii_pi3_command_issue_read(void) { + unsigned char r = MMPTR(0xe00040a4); + return r; +} +static inline void sdram_dfii_pi3_command_issue_write(unsigned char value) { + MMPTR(0xe00040a4) = value; +} +#define CSR_SDRAM_DFII_PI3_ADDRESS_ADDR 0xe00040a8 +#define CSR_SDRAM_DFII_PI3_ADDRESS_SIZE 2 +static inline unsigned short int sdram_dfii_pi3_address_read(void) { + unsigned short int r = MMPTR(0xe00040a8); + r <<= 8; + r |= MMPTR(0xe00040ac); + return r; +} +static inline void sdram_dfii_pi3_address_write(unsigned short int value) { + MMPTR(0xe00040a8) = value >> 8; + MMPTR(0xe00040ac) = value; +} +#define CSR_SDRAM_DFII_PI3_BADDRESS_ADDR 0xe00040b0 +#define CSR_SDRAM_DFII_PI3_BADDRESS_SIZE 1 +static inline unsigned char sdram_dfii_pi3_baddress_read(void) { + unsigned char r = MMPTR(0xe00040b0); + return r; +} +static inline void sdram_dfii_pi3_baddress_write(unsigned char value) { + MMPTR(0xe00040b0) = value; +} +#define CSR_SDRAM_DFII_PI3_WRDATA_ADDR 0xe00040b4 +#define CSR_SDRAM_DFII_PI3_WRDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi3_wrdata_read(void) { + unsigned int r = MMPTR(0xe00040b4); + r <<= 8; + r |= MMPTR(0xe00040b8); + r <<= 8; + r |= MMPTR(0xe00040bc); + r <<= 8; + r |= MMPTR(0xe00040c0); + return r; +} +static inline void sdram_dfii_pi3_wrdata_write(unsigned int value) { + MMPTR(0xe00040b4) = value >> 24; + MMPTR(0xe00040b8) = value >> 16; + MMPTR(0xe00040bc) = value >> 8; + MMPTR(0xe00040c0) = value; +} +#define CSR_SDRAM_DFII_PI3_RDDATA_ADDR 0xe00040c4 +#define CSR_SDRAM_DFII_PI3_RDDATA_SIZE 4 +static inline unsigned int sdram_dfii_pi3_rddata_read(void) { + unsigned int r = MMPTR(0xe00040c4); + r <<= 8; + r |= MMPTR(0xe00040c8); + r <<= 8; + r |= MMPTR(0xe00040cc); + r <<= 8; + r |= MMPTR(0xe00040d0); + return r; +} + +/* timer0 */ +#define CSR_TIMER0_BASE 0xe0002000 +#define CSR_TIMER0_LOAD_ADDR 0xe0002000 +#define CSR_TIMER0_LOAD_SIZE 4 +static inline unsigned int timer0_load_read(void) { + unsigned int r = MMPTR(0xe0002000); + r <<= 8; + r |= MMPTR(0xe0002004); + r <<= 8; + r |= MMPTR(0xe0002008); + r <<= 8; + r |= MMPTR(0xe000200c); + return r; +} +static inline void timer0_load_write(unsigned int value) { + MMPTR(0xe0002000) = value >> 24; + MMPTR(0xe0002004) = value >> 16; + MMPTR(0xe0002008) = value >> 8; + MMPTR(0xe000200c) = value; +} +#define CSR_TIMER0_RELOAD_ADDR 0xe0002010 +#define CSR_TIMER0_RELOAD_SIZE 4 +static inline unsigned int timer0_reload_read(void) { + unsigned int r = MMPTR(0xe0002010); + r <<= 8; + r |= MMPTR(0xe0002014); + r <<= 8; + r |= MMPTR(0xe0002018); + r <<= 8; + r |= MMPTR(0xe000201c); + return r; +} +static inline void timer0_reload_write(unsigned int value) { + MMPTR(0xe0002010) = value >> 24; + MMPTR(0xe0002014) = value >> 16; + MMPTR(0xe0002018) = value >> 8; + MMPTR(0xe000201c) = value; +} +#define CSR_TIMER0_EN_ADDR 0xe0002020 +#define CSR_TIMER0_EN_SIZE 1 +static inline unsigned char timer0_en_read(void) { + unsigned char r = MMPTR(0xe0002020); + return r; +} +static inline void timer0_en_write(unsigned char value) { + MMPTR(0xe0002020) = value; +} +#define CSR_TIMER0_UPDATE_VALUE_ADDR 0xe0002024 +#define CSR_TIMER0_UPDATE_VALUE_SIZE 1 +static inline unsigned char timer0_update_value_read(void) { + unsigned char r = MMPTR(0xe0002024); + return r; +} +static inline void timer0_update_value_write(unsigned char value) { + MMPTR(0xe0002024) = value; +} +#define CSR_TIMER0_VALUE_ADDR 0xe0002028 +#define CSR_TIMER0_VALUE_SIZE 4 +static inline unsigned int timer0_value_read(void) { + unsigned int r = MMPTR(0xe0002028); + r <<= 8; + r |= MMPTR(0xe000202c); + r <<= 8; + r |= MMPTR(0xe0002030); + r <<= 8; + r |= MMPTR(0xe0002034); + return r; +} +#define CSR_TIMER0_EV_STATUS_ADDR 0xe0002038 +#define CSR_TIMER0_EV_STATUS_SIZE 1 +static inline unsigned char timer0_ev_status_read(void) { + unsigned char r = MMPTR(0xe0002038); + return r; +} +static inline void timer0_ev_status_write(unsigned char value) { + MMPTR(0xe0002038) = value; +} +#define CSR_TIMER0_EV_PENDING_ADDR 0xe000203c +#define CSR_TIMER0_EV_PENDING_SIZE 1 +static inline unsigned char timer0_ev_pending_read(void) { + unsigned char r = MMPTR(0xe000203c); + return r; +} +static inline void timer0_ev_pending_write(unsigned char value) { + MMPTR(0xe000203c) = value; +} +#define CSR_TIMER0_EV_ENABLE_ADDR 0xe0002040 +#define CSR_TIMER0_EV_ENABLE_SIZE 1 +static inline unsigned char timer0_ev_enable_read(void) { + unsigned char r = MMPTR(0xe0002040); + return r; +} +static inline void timer0_ev_enable_write(unsigned char value) { + MMPTR(0xe0002040) = value; +} + +/* uart */ +#define CSR_UART_BASE 0xe0001000 +#define CSR_UART_RXTX_ADDR 0xe0001000 +#define CSR_UART_RXTX_SIZE 1 +static inline unsigned char uart_rxtx_read(void) { + unsigned char r = MMPTR(0xe0001000); + return r; +} +static inline void uart_rxtx_write(unsigned char value) { + MMPTR(0xe0001000) = value; +} +#define CSR_UART_TXFULL_ADDR 0xe0001004 +#define CSR_UART_TXFULL_SIZE 1 +static inline unsigned char uart_txfull_read(void) { + unsigned char r = MMPTR(0xe0001004); + return r; +} +#define CSR_UART_RXEMPTY_ADDR 0xe0001008 +#define CSR_UART_RXEMPTY_SIZE 1 +static inline unsigned char uart_rxempty_read(void) { + unsigned char r = MMPTR(0xe0001008); + return r; +} +#define CSR_UART_EV_STATUS_ADDR 0xe000100c +#define CSR_UART_EV_STATUS_SIZE 1 +static inline unsigned char uart_ev_status_read(void) { + unsigned char r = MMPTR(0xe000100c); + return r; +} +static inline void uart_ev_status_write(unsigned char value) { + MMPTR(0xe000100c) = value; +} +#define CSR_UART_EV_PENDING_ADDR 0xe0001010 +#define CSR_UART_EV_PENDING_SIZE 1 +static inline unsigned char uart_ev_pending_read(void) { + unsigned char r = MMPTR(0xe0001010); + return r; +} +static inline void uart_ev_pending_write(unsigned char value) { + MMPTR(0xe0001010) = value; +} +#define CSR_UART_EV_ENABLE_ADDR 0xe0001014 +#define CSR_UART_EV_ENABLE_SIZE 1 +static inline unsigned char uart_ev_enable_read(void) { + unsigned char r = MMPTR(0xe0001014); + return r; +} +static inline void uart_ev_enable_write(unsigned char value) { + MMPTR(0xe0001014) = value; +} + +/* uart_phy */ +#define CSR_UART_PHY_BASE 0xe0000800 +#define CSR_UART_PHY_TUNING_WORD_ADDR 0xe0000800 +#define CSR_UART_PHY_TUNING_WORD_SIZE 4 +static inline unsigned int uart_phy_tuning_word_read(void) { + unsigned int r = MMPTR(0xe0000800); + r <<= 8; + r |= MMPTR(0xe0000804); + r <<= 8; + r |= MMPTR(0xe0000808); + r <<= 8; + r |= MMPTR(0xe000080c); + return r; +} +static inline void uart_phy_tuning_word_write(unsigned int value) { + MMPTR(0xe0000800) = value >> 24; + MMPTR(0xe0000804) = value >> 16; + MMPTR(0xe0000808) = value >> 8; + MMPTR(0xe000080c) = value; +} + +/* constants */ +#define UART_INTERRUPT 0 +#define TIMER0_INTERRUPT 1 +#define ETHMAC_INTERRUPT 2 +#define SYSTEM_CLOCK_FREQUENCY 100000000 +#define A7DDRPHY_BITSLIP 2 +#define A7DDRPHY_DELAY 6 +#define L2_SIZE 8192 + +#endif diff --git a/configs/misoc/include/generated/mem.h b/configs/misoc/include/generated-sample/mem.h similarity index 59% rename from configs/misoc/include/generated/mem.h rename to configs/misoc/include/generated-sample/mem.h index 7b6839d2a940a3922014fc957550dfef9756daad..f4a9c9c6435dc6cf8f6b410716c4c64b1cb45585 100644 --- a/configs/misoc/include/generated/mem.h +++ b/configs/misoc/include/generated-sample/mem.h @@ -5,9 +5,12 @@ #define ROM_SIZE 0x00008000 #define SRAM_BASE 0x10000000 -#define SRAM_SIZE 0x00001000 +#define SRAM_SIZE 0x00008000 #define MAIN_RAM_BASE 0x40000000 -#define MAIN_RAM_SIZE 0x00800000 +#define MAIN_RAM_SIZE 0x10000000 + +#define ETHMAC_BASE 0xb0000000 +#define ETHMAC_SIZE 0x00002000 #endif diff --git a/configs/misoc/include/generated/output_format.ld b/configs/misoc/include/generated-sample/output_format.ld similarity index 100% rename from configs/misoc/include/generated/output_format.ld rename to configs/misoc/include/generated-sample/output_format.ld diff --git a/configs/misoc/include/generated-sample/regions.ld b/configs/misoc/include/generated-sample/regions.ld new file mode 100644 index 0000000000000000000000000000000000000000..1708c3a309a8d9982d9021c815c1ef9cc25a15f5 --- /dev/null +++ b/configs/misoc/include/generated-sample/regions.ld @@ -0,0 +1,6 @@ +MEMORY { + rom : ORIGIN = 0x00000000, LENGTH = 0x00008000 + sram : ORIGIN = 0x10000000, LENGTH = 0x00008000 + main_ram : ORIGIN = 0x40000000, LENGTH = 0x10000000 + ethmac : ORIGIN = 0xb0000000, LENGTH = 0x00002000 +} diff --git a/configs/misoc/include/generated-sample/sdram_phy.h b/configs/misoc/include/generated-sample/sdram_phy.h new file mode 100644 index 0000000000000000000000000000000000000000..646cf7009ade1c6543f7155ecd3dc0ac4e0e863e --- /dev/null +++ b/configs/misoc/include/generated-sample/sdram_phy.h @@ -0,0 +1,102 @@ +#ifndef __GENERATED_SDRAM_PHY_H +#define __GENERATED_SDRAM_PHY_H +#include +#include +#include + +#define DFII_NPHASES 4 + +static void cdelay(int i); + +static void command_p0(int cmd) +{ + sdram_dfii_pi0_command_write(cmd); + sdram_dfii_pi0_command_issue_write(1); +} +static void command_p1(int cmd) +{ + sdram_dfii_pi1_command_write(cmd); + sdram_dfii_pi1_command_issue_write(1); +} +static void command_p2(int cmd) +{ + sdram_dfii_pi2_command_write(cmd); + sdram_dfii_pi2_command_issue_write(1); +} +static void command_p3(int cmd) +{ + sdram_dfii_pi3_command_write(cmd); + sdram_dfii_pi3_command_issue_write(1); +} + + +#define sdram_dfii_pird_address_write(X) sdram_dfii_pi0_address_write(X) +#define sdram_dfii_piwr_address_write(X) sdram_dfii_pi2_address_write(X) + +#define sdram_dfii_pird_baddress_write(X) sdram_dfii_pi0_baddress_write(X) +#define sdram_dfii_piwr_baddress_write(X) sdram_dfii_pi2_baddress_write(X) + +#define command_prd(X) command_p0(X) +#define command_pwr(X) command_p2(X) + +#define DFII_PIX_DATA_SIZE CSR_SDRAM_DFII_PI0_WRDATA_SIZE + +const unsigned int sdram_dfii_pix_wrdata_addr[4] = { + CSR_SDRAM_DFII_PI0_WRDATA_ADDR, + CSR_SDRAM_DFII_PI1_WRDATA_ADDR, + CSR_SDRAM_DFII_PI2_WRDATA_ADDR, + CSR_SDRAM_DFII_PI3_WRDATA_ADDR +}; + +const unsigned int sdram_dfii_pix_rddata_addr[4] = { + CSR_SDRAM_DFII_PI0_RDDATA_ADDR, + CSR_SDRAM_DFII_PI1_RDDATA_ADDR, + CSR_SDRAM_DFII_PI2_RDDATA_ADDR, + CSR_SDRAM_DFII_PI3_RDDATA_ADDR +}; + +#define DDR3_MR1 6 + +static void init_sequence(void) +{ + /* Release reset */ + sdram_dfii_pi0_address_write(0x0); + sdram_dfii_pi0_baddress_write(0); + sdram_dfii_control_write(DFII_CONTROL_ODT|DFII_CONTROL_RESET_N); + cdelay(50000); + + /* Bring CKE high */ + sdram_dfii_pi0_address_write(0x0); + sdram_dfii_pi0_baddress_write(0); + sdram_dfii_control_write(DFII_CONTROL_CKE|DFII_CONTROL_ODT|DFII_CONTROL_RESET_N); + cdelay(10000); + + /* Load Mode Register 2 */ + sdram_dfii_pi0_address_write(0x408); + sdram_dfii_pi0_baddress_write(2); + command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); + + /* Load Mode Register 3 */ + sdram_dfii_pi0_address_write(0x0); + sdram_dfii_pi0_baddress_write(3); + command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); + + /* Load Mode Register 1 */ + sdram_dfii_pi0_address_write(0x6); + sdram_dfii_pi0_baddress_write(1); + command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); + + /* Load Mode Register 0, CL=7, BL=8 */ + sdram_dfii_pi0_address_write(0x930); + sdram_dfii_pi0_baddress_write(0); + command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); + cdelay(200); + + /* ZQ Calibration */ + sdram_dfii_pi0_address_write(0x400); + sdram_dfii_pi0_baddress_write(0); + command_p0(DFII_COMMAND_WE|DFII_COMMAND_CS); + cdelay(200); + +} +#endif diff --git a/configs/misoc/include/generated/variables.mak b/configs/misoc/include/generated-sample/variables.mak similarity index 86% rename from configs/misoc/include/generated/variables.mak rename to configs/misoc/include/generated-sample/variables.mak index a5e6478ad4e93c5edc0a588548b07e8d3f298b77..2bd0474215a834e9f0bc993b508757933098d818 100644 --- a/configs/misoc/include/generated/variables.mak +++ b/configs/misoc/include/generated-sample/variables.mak @@ -4,7 +4,7 @@ CPUFLAGS=-mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-exten CPUENDIANNESS=big CLANG=0 SOC_DIRECTORY=/usr/local/lib/python3.5/dist-packages/litex-0.1-py3.5.egg/litex/soc -BUILDINC_DIRECTORY=/home/lenovo/fpga/litex/litex/boards/targets/soc_basesoc_papilio_pro/software/include +BUILDINC_DIRECTORY=/home/lenovo/fpga/arty-soc/build/software/include LIBBASE_DIRECTORY=/usr/local/lib/python3.5/dist-packages/litex-0.1-py3.5.egg/litex/soc/software/libbase LIBCOMPILER_RT_DIRECTORY=/usr/local/lib/python3.5/dist-packages/litex-0.1-py3.5.egg/litex/soc/software/libcompiler_rt LIBNET_DIRECTORY=/usr/local/lib/python3.5/dist-packages/litex-0.1-py3.5.egg/litex/soc/software/libnet diff --git a/configs/misoc/include/generated/csr.h b/configs/misoc/include/generated/csr.h deleted file mode 100644 index abfa8b39cdc8d492bb4992c3fbe356de9bb2bebd..0000000000000000000000000000000000000000 --- a/configs/misoc/include/generated/csr.h +++ /dev/null @@ -1,250 +0,0 @@ -#ifndef __GENERATED_CSR_H -#define __GENERATED_CSR_H -#include - -/* sdram */ -#define CSR_SDRAM_BASE 0xe0004000 -#define CSR_SDRAM_DFII_CONTROL_ADDR 0xe0004000 -#define CSR_SDRAM_DFII_CONTROL_SIZE 1 -static inline unsigned char sdram_dfii_control_read(void) { - unsigned char r = MMPTR(0xe0004000); - return r; -} -static inline void sdram_dfii_control_write(unsigned char value) { - MMPTR(0xe0004000) = value; -} -#define CSR_SDRAM_DFII_PI0_COMMAND_ADDR 0xe0004004 -#define CSR_SDRAM_DFII_PI0_COMMAND_SIZE 1 -static inline unsigned char sdram_dfii_pi0_command_read(void) { - unsigned char r = MMPTR(0xe0004004); - return r; -} -static inline void sdram_dfii_pi0_command_write(unsigned char value) { - MMPTR(0xe0004004) = value; -} -#define CSR_SDRAM_DFII_PI0_COMMAND_ISSUE_ADDR 0xe0004008 -#define CSR_SDRAM_DFII_PI0_COMMAND_ISSUE_SIZE 1 -static inline unsigned char sdram_dfii_pi0_command_issue_read(void) { - unsigned char r = MMPTR(0xe0004008); - return r; -} -static inline void sdram_dfii_pi0_command_issue_write(unsigned char value) { - MMPTR(0xe0004008) = value; -} -#define CSR_SDRAM_DFII_PI0_ADDRESS_ADDR 0xe000400c -#define CSR_SDRAM_DFII_PI0_ADDRESS_SIZE 2 -static inline unsigned short int sdram_dfii_pi0_address_read(void) { - unsigned short int r = MMPTR(0xe000400c); - r <<= 8; - r |= MMPTR(0xe0004010); - return r; -} -static inline void sdram_dfii_pi0_address_write(unsigned short int value) { - MMPTR(0xe000400c) = value >> 8; - MMPTR(0xe0004010) = value; -} -#define CSR_SDRAM_DFII_PI0_BADDRESS_ADDR 0xe0004014 -#define CSR_SDRAM_DFII_PI0_BADDRESS_SIZE 1 -static inline unsigned char sdram_dfii_pi0_baddress_read(void) { - unsigned char r = MMPTR(0xe0004014); - return r; -} -static inline void sdram_dfii_pi0_baddress_write(unsigned char value) { - MMPTR(0xe0004014) = value; -} -#define CSR_SDRAM_DFII_PI0_WRDATA_ADDR 0xe0004018 -#define CSR_SDRAM_DFII_PI0_WRDATA_SIZE 2 -static inline unsigned short int sdram_dfii_pi0_wrdata_read(void) { - unsigned short int r = MMPTR(0xe0004018); - r <<= 8; - r |= MMPTR(0xe000401c); - return r; -} -static inline void sdram_dfii_pi0_wrdata_write(unsigned short int value) { - MMPTR(0xe0004018) = value >> 8; - MMPTR(0xe000401c) = value; -} -#define CSR_SDRAM_DFII_PI0_RDDATA_ADDR 0xe0004020 -#define CSR_SDRAM_DFII_PI0_RDDATA_SIZE 2 -static inline unsigned short int sdram_dfii_pi0_rddata_read(void) { - unsigned short int r = MMPTR(0xe0004020); - r <<= 8; - r |= MMPTR(0xe0004024); - return r; -} - -/* timer0 */ -#define CSR_TIMER0_BASE 0xe0002000 -#define CSR_TIMER0_LOAD_ADDR 0xe0002000 -#define CSR_TIMER0_LOAD_SIZE 4 -static inline unsigned int timer0_load_read(void) { - unsigned int r = MMPTR(0xe0002000); - r <<= 8; - r |= MMPTR(0xe0002004); - r <<= 8; - r |= MMPTR(0xe0002008); - r <<= 8; - r |= MMPTR(0xe000200c); - return r; -} -static inline void timer0_load_write(unsigned int value) { - MMPTR(0xe0002000) = value >> 24; - MMPTR(0xe0002004) = value >> 16; - MMPTR(0xe0002008) = value >> 8; - MMPTR(0xe000200c) = value; -} -#define CSR_TIMER0_RELOAD_ADDR 0xe0002010 -#define CSR_TIMER0_RELOAD_SIZE 4 -static inline unsigned int timer0_reload_read(void) { - unsigned int r = MMPTR(0xe0002010); - r <<= 8; - r |= MMPTR(0xe0002014); - r <<= 8; - r |= MMPTR(0xe0002018); - r <<= 8; - r |= MMPTR(0xe000201c); - return r; -} -static inline void timer0_reload_write(unsigned int value) { - MMPTR(0xe0002010) = value >> 24; - MMPTR(0xe0002014) = value >> 16; - MMPTR(0xe0002018) = value >> 8; - MMPTR(0xe000201c) = value; -} -#define CSR_TIMER0_EN_ADDR 0xe0002020 -#define CSR_TIMER0_EN_SIZE 1 -static inline unsigned char timer0_en_read(void) { - unsigned char r = MMPTR(0xe0002020); - return r; -} -static inline void timer0_en_write(unsigned char value) { - MMPTR(0xe0002020) = value; -} -#define CSR_TIMER0_UPDATE_VALUE_ADDR 0xe0002024 -#define CSR_TIMER0_UPDATE_VALUE_SIZE 1 -static inline unsigned char timer0_update_value_read(void) { - unsigned char r = MMPTR(0xe0002024); - return r; -} -static inline void timer0_update_value_write(unsigned char value) { - MMPTR(0xe0002024) = value; -} -#define CSR_TIMER0_VALUE_ADDR 0xe0002028 -#define CSR_TIMER0_VALUE_SIZE 4 -static inline unsigned int timer0_value_read(void) { - unsigned int r = MMPTR(0xe0002028); - r <<= 8; - r |= MMPTR(0xe000202c); - r <<= 8; - r |= MMPTR(0xe0002030); - r <<= 8; - r |= MMPTR(0xe0002034); - return r; -} -#define CSR_TIMER0_EV_STATUS_ADDR 0xe0002038 -#define CSR_TIMER0_EV_STATUS_SIZE 1 -static inline unsigned char timer0_ev_status_read(void) { - unsigned char r = MMPTR(0xe0002038); - return r; -} -static inline void timer0_ev_status_write(unsigned char value) { - MMPTR(0xe0002038) = value; -} -#define CSR_TIMER0_EV_PENDING_ADDR 0xe000203c -#define CSR_TIMER0_EV_PENDING_SIZE 1 -static inline unsigned char timer0_ev_pending_read(void) { - unsigned char r = MMPTR(0xe000203c); - return r; -} -static inline void timer0_ev_pending_write(unsigned char value) { - MMPTR(0xe000203c) = value; -} -#define CSR_TIMER0_EV_ENABLE_ADDR 0xe0002040 -#define CSR_TIMER0_EV_ENABLE_SIZE 1 -static inline unsigned char timer0_ev_enable_read(void) { - unsigned char r = MMPTR(0xe0002040); - return r; -} -static inline void timer0_ev_enable_write(unsigned char value) { - MMPTR(0xe0002040) = value; -} - -/* uart */ -#define CSR_UART_BASE 0xe0001000 -#define CSR_UART_RXTX_ADDR 0xe0001000 -#define CSR_UART_RXTX_SIZE 1 -static inline unsigned char uart_rxtx_read(void) { - unsigned char r = MMPTR(0xe0001000); - return r; -} -static inline void uart_rxtx_write(unsigned char value) { - MMPTR(0xe0001000) = value; -} -#define CSR_UART_TXFULL_ADDR 0xe0001004 -#define CSR_UART_TXFULL_SIZE 1 -static inline unsigned char uart_txfull_read(void) { - unsigned char r = MMPTR(0xe0001004); - return r; -} -#define CSR_UART_RXEMPTY_ADDR 0xe0001008 -#define CSR_UART_RXEMPTY_SIZE 1 -static inline unsigned char uart_rxempty_read(void) { - unsigned char r = MMPTR(0xe0001008); - return r; -} -#define CSR_UART_EV_STATUS_ADDR 0xe000100c -#define CSR_UART_EV_STATUS_SIZE 1 -static inline unsigned char uart_ev_status_read(void) { - unsigned char r = MMPTR(0xe000100c); - return r; -} -static inline void uart_ev_status_write(unsigned char value) { - MMPTR(0xe000100c) = value; -} -#define CSR_UART_EV_PENDING_ADDR 0xe0001010 -#define CSR_UART_EV_PENDING_SIZE 1 -static inline unsigned char uart_ev_pending_read(void) { - unsigned char r = MMPTR(0xe0001010); - return r; -} -static inline void uart_ev_pending_write(unsigned char value) { - MMPTR(0xe0001010) = value; -} -#define CSR_UART_EV_ENABLE_ADDR 0xe0001014 -#define CSR_UART_EV_ENABLE_SIZE 1 -static inline unsigned char uart_ev_enable_read(void) { - unsigned char r = MMPTR(0xe0001014); - return r; -} -static inline void uart_ev_enable_write(unsigned char value) { - MMPTR(0xe0001014) = value; -} - -/* uart_phy */ -#define CSR_UART_PHY_BASE 0xe0000800 -#define CSR_UART_PHY_TUNING_WORD_ADDR 0xe0000800 -#define CSR_UART_PHY_TUNING_WORD_SIZE 4 -static inline unsigned int uart_phy_tuning_word_read(void) { - unsigned int r = MMPTR(0xe0000800); - r <<= 8; - r |= MMPTR(0xe0000804); - r <<= 8; - r |= MMPTR(0xe0000808); - r <<= 8; - r |= MMPTR(0xe000080c); - return r; -} -static inline void uart_phy_tuning_word_write(unsigned int value) { - MMPTR(0xe0000800) = value >> 24; - MMPTR(0xe0000804) = value >> 16; - MMPTR(0xe0000808) = value >> 8; - MMPTR(0xe000080c) = value; -} - -/* constants */ -#define UART_INTERRUPT 0 -#define TIMER0_INTERRUPT 1 -#define SYSTEM_CLOCK_FREQUENCY 80000000 -#define L2_SIZE 8192 - -#endif diff --git a/configs/misoc/include/generated/regions.ld b/configs/misoc/include/generated/regions.ld deleted file mode 100644 index eb3a45be98b5d7e3926b32b9cfb1b436c9bb8163..0000000000000000000000000000000000000000 --- a/configs/misoc/include/generated/regions.ld +++ /dev/null @@ -1,5 +0,0 @@ -MEMORY { - rom : ORIGIN = 0x00000000, LENGTH = 0x00008000 - sram : ORIGIN = 0x10000000, LENGTH = 0x00001000 - main_ram : ORIGIN = 0x40000000, LENGTH = 0x00800000 -} diff --git a/configs/misoc/include/generated/sdram_phy.h b/configs/misoc/include/generated/sdram_phy.h deleted file mode 100644 index 9fa49eec22cf1a6353aff3ebfe3901811970475b..0000000000000000000000000000000000000000 --- a/configs/misoc/include/generated/sdram_phy.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef __GENERATED_SDRAM_PHY_H -#define __GENERATED_SDRAM_PHY_H -#include -#include -#include - -#define DFII_NPHASES 1 - -static void cdelay(int i); - -static void command_p0(int cmd) -{ - sdram_dfii_pi0_command_write(cmd); - sdram_dfii_pi0_command_issue_write(1); -} - - -#define sdram_dfii_pird_address_write(X) sdram_dfii_pi0_address_write(X) -#define sdram_dfii_piwr_address_write(X) sdram_dfii_pi0_address_write(X) - -#define sdram_dfii_pird_baddress_write(X) sdram_dfii_pi0_baddress_write(X) -#define sdram_dfii_piwr_baddress_write(X) sdram_dfii_pi0_baddress_write(X) - -#define command_prd(X) command_p0(X) -#define command_pwr(X) command_p0(X) - -#define DFII_PIX_DATA_SIZE CSR_SDRAM_DFII_PI0_WRDATA_SIZE - -const unsigned int sdram_dfii_pix_wrdata_addr[1] = { - CSR_SDRAM_DFII_PI0_WRDATA_ADDR -}; - -const unsigned int sdram_dfii_pix_rddata_addr[1] = { - CSR_SDRAM_DFII_PI0_RDDATA_ADDR -}; - -static void init_sequence(void) -{ - /* Bring CKE high */ - sdram_dfii_pi0_address_write(0x0); - sdram_dfii_pi0_baddress_write(0); - sdram_dfii_control_write(DFII_CONTROL_CKE|DFII_CONTROL_ODT|DFII_CONTROL_RESET_N); - cdelay(20000); - - /* Precharge All */ - sdram_dfii_pi0_address_write(0x400); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_WE|DFII_COMMAND_CS); - - /* Load Mode Register / Reset DLL, CL=2, BL=1 */ - sdram_dfii_pi0_address_write(0x120); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); - cdelay(200); - - /* Precharge All */ - sdram_dfii_pi0_address_write(0x400); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_WE|DFII_COMMAND_CS); - - /* Auto Refresh */ - sdram_dfii_pi0_address_write(0x0); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_CS); - cdelay(4); - - /* Auto Refresh */ - sdram_dfii_pi0_address_write(0x0); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_CS); - cdelay(4); - - /* Load Mode Register / CL=2, BL=1 */ - sdram_dfii_pi0_address_write(0x20); - sdram_dfii_pi0_baddress_write(0); - command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); - cdelay(200); - -} -#endif diff --git a/configs/misoc/nsh/defconfig b/configs/misoc/nsh/defconfig index 71aea364a7e1b9869dd7ce428325718ec510593c..75cf732f6798c17145e2fe8813f657f6f7969810 100644 --- a/configs/misoc/nsh/defconfig +++ b/configs/misoc/nsh/defconfig @@ -87,7 +87,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set CONFIG_ARCH_MISOC=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -335,7 +334,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -566,7 +564,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/moteino-mega/hello/defconfig b/configs/moteino-mega/hello/defconfig index 089bec4099d7bd38883fe94e51e7b91044bb6a86..ffadd04745bf155e270d8e408ec2e03524a8c2b2 100644 --- a/configs/moteino-mega/hello/defconfig +++ b/configs/moteino-mega/hello/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -270,7 +269,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -478,7 +476,6 @@ CONFIG_EXAMPLES_HELLO=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/moteino-mega/nsh/defconfig b/configs/moteino-mega/nsh/defconfig index 83a2446ef46cbc3f631656c560ea1b4df46a181f..c3021fcbf75514a4b14c7714f2e9bde278c0ab84 100644 --- a/configs/moteino-mega/nsh/defconfig +++ b/configs/moteino-mega/nsh/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -278,7 +277,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -489,7 +487,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/moxa/nsh/defconfig b/configs/moxa/nsh/defconfig index 3b7043c04ee4ab77db162e4c9b66a7a0614c3a80..fd951b047a153f2b460432b73076bf296cd8a0ad 100644 --- a/configs/moxa/nsh/defconfig +++ b/configs/moxa/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -218,8 +216,6 @@ CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_RESET=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -418,7 +414,7 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_CS89x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set CONFIG_NET_FTMAC100=y CONFIG_FTMAC100_BASE=0x90900000 @@ -427,12 +423,10 @@ CONFIG_FTMAC100_RX_DESC=64 CONFIG_FTMAC100_TX_DESC=32 CONFIG_FTMAC100_MAC0_ENV_ADDR=0x80000050 CONFIG_FTMAC100_HPWORK=y -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -516,13 +510,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=1500 CONFIG_NET_ETH_TCP_RECVWNDO=1536 CONFIG_NET_GUARDSIZE=2 @@ -800,7 +792,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/mx1ads/ostest/defconfig b/configs/mx1ads/ostest/defconfig index a370cb04354d6dedab4dba4eaddbd55eb2722cd4..04225dad730af60649e182dc13b4be1c09c01d73 100644 --- a/configs/mx1ads/ostest/defconfig +++ b/configs/mx1ads/ostest/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set CONFIG_ARCH_CHIP_IMX1=y @@ -392,7 +390,6 @@ CONFIG_SPI=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -619,7 +616,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ne64badge/ostest/defconfig b/configs/ne64badge/ostest/defconfig index 6d75dbaf0be49f65fcd0632c45d2ea557b65bbea..2986223f0cd34b4ae5a940dbcb5316dbb7640344 100644 --- a/configs/ne64badge/ostest/defconfig +++ b/configs/ne64badge/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set CONFIG_ARCH_HC=y # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -243,7 +242,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -412,7 +410,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/nr5m100-nexys4/nsh/defconfig b/configs/nr5m100-nexys4/nsh/defconfig index bfd3fc4fc2e182d86eb49c03f29aee71698c5949..e2b6c7f66dbbd3b51098daae5da1c1bc0d8e116a 100644 --- a/configs/nr5m100-nexys4/nsh/defconfig +++ b/configs/nr5m100-nexys4/nsh/defconfig @@ -59,7 +59,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_RISCV=y # CONFIG_ARCH_SIM is not set @@ -180,8 +179,6 @@ CONFIG_ARCH_BOARD="nr5m100-nexys4" CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -351,7 +348,6 @@ CONFIG_DEV_ZERO=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -615,7 +611,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ntosd-dm320/nettest/defconfig b/configs/ntosd-dm320/nettest/defconfig index a9ee527115de48456a16c707475c87db3d226308..e1f95fe831e92de7d867a166c391ac7113ed0604 100644 --- a/configs/ntosd-dm320/nettest/defconfig +++ b/configs/ntosd-dm320/nettest/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -290,6 +288,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -297,13 +296,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -405,17 +408,15 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -506,13 +507,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -771,7 +770,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ntosd-dm320/nsh/defconfig b/configs/ntosd-dm320/nsh/defconfig index 845e806b36eadc7fe4846ea7f198fe1b66bf9d44..39868b6085dfbaa3a692f78219cd47b3f7d40814 100644 --- a/configs/ntosd-dm320/nsh/defconfig +++ b/configs/ntosd-dm320/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -296,6 +294,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +303,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -421,17 +424,15 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -522,13 +523,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -809,7 +808,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/ntosd-dm320/poll/defconfig b/configs/ntosd-dm320/poll/defconfig index 5b357b8182df3373aaa84d9a04cad9ba4ebde7a2..16cd6306ee3ed42c9c747f7677ebadaa868a56ea 100644 --- a/configs/ntosd-dm320/poll/defconfig +++ b/configs/ntosd-dm320/poll/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -296,6 +294,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +303,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -412,12 +415,11 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_PIPES=y CONFIG_DEV_PIPE_MAXSIZE=1024 CONFIG_DEV_PIPE_SIZE=1024 @@ -425,7 +427,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -517,13 +518,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -777,7 +776,6 @@ CONFIG_EXAMPLES_POLL_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ntosd-dm320/thttpd/defconfig b/configs/ntosd-dm320/thttpd/defconfig index 991f4c18753d0ad424476c5521856afc95b905fa..5b9439f577e10dfc16ddd5a88efb717b38c4d261 100644 --- a/configs/ntosd-dm320/thttpd/defconfig +++ b/configs/ntosd-dm320/thttpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -290,6 +288,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -297,13 +296,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -405,12 +408,11 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_PIPES=y CONFIG_DEV_PIPE_MAXSIZE=1024 CONFIG_DEV_PIPE_SIZE=1024 @@ -418,7 +420,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -510,13 +511,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -777,7 +776,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/ntosd-dm320/udp/defconfig b/configs/ntosd-dm320/udp/defconfig index 6fe1d2e373e9a356e1bd76fa06fd1dd72befceff..430d9c3d54ffa1419afeca59bf1aa68d0e1c3533 100644 --- a/configs/ntosd-dm320/udp/defconfig +++ b/configs/ntosd-dm320/udp/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -290,6 +288,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -297,13 +296,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -404,17 +407,15 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -505,13 +506,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -754,7 +753,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/ntosd-dm320/webserver/defconfig b/configs/ntosd-dm320/webserver/defconfig index 789fc76a73f91765a127f0356e8155f39c4c27b9..5b9e96f8f25026b1635567b9cea9dac4396af454 100644 --- a/configs/ntosd-dm320/webserver/defconfig +++ b/configs/ntosd-dm320/webserver/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set CONFIG_ARCH_CHIP_DM320=y # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -296,6 +294,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -304,13 +303,17 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -412,17 +415,15 @@ CONFIG_DM9X_MODE_AUTO=y # CONFIG_DM9X_MODE_10MFD is not set # CONFIG_DM9X_MODE_100MHD is not set # CONFIG_DM9X_MODE_100MFD is not set +CONFIG_DM9X_HPWORK=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -513,13 +514,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -766,7 +765,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-144/f746-evalos/defconfig b/configs/nucleo-144/f746-evalos/defconfig index 6af63a32b897011c848c75c7ec7ab59de7157dcb..3372db8d0051d696762686ac9d19ca580e829f4a 100644 --- a/configs/nucleo-144/f746-evalos/defconfig +++ b/configs/nucleo-144/f746-evalos/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -441,8 +439,6 @@ CONFIG_NUCLEO_CONSOLE_VIRTUAL=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -632,7 +628,6 @@ CONFIG_USERLED_LOWER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -886,7 +881,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-144/f746-nsh/defconfig b/configs/nucleo-144/f746-nsh/defconfig index 5bbd175b7219c8a5ef531c3f50104d975b63ce2d..d034bff8ac9496d821a4c2f512f55cda9f31f7d0 100644 --- a/configs/nucleo-144/f746-nsh/defconfig +++ b/configs/nucleo-144/f746-nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -618,7 +616,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -865,7 +862,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-144/f767-evalos/defconfig b/configs/nucleo-144/f767-evalos/defconfig index 62ae169e460e89cc755d05e6769dbb9640339dac..bae0a8f84b92f38745f3bb56e44b76d873708f7d 100644 --- a/configs/nucleo-144/f767-evalos/defconfig +++ b/configs/nucleo-144/f767-evalos/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -445,8 +443,6 @@ CONFIG_NUCLEO_CONSOLE_VIRTUAL=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -636,7 +632,6 @@ CONFIG_USERLED_LOWER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -890,7 +885,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-144/f767-nsh/defconfig b/configs/nucleo-144/f767-nsh/defconfig index f69821ac7ab390a5d50fa30292a986b73dad1e9f..36e14b00937b2ab47acb713b1828e6a907b7e101 100644 --- a/configs/nucleo-144/f767-nsh/defconfig +++ b/configs/nucleo-144/f767-nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -622,7 +620,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -869,7 +866,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-144/src/Makefile b/configs/nucleo-144/src/Makefile index 846122801bb07ebee028cf57839ae6d9e6200b2d..52068fbe354f291d35c773818e572e329a107af1 100644 --- a/configs/nucleo-144/src/Makefile +++ b/configs/nucleo-144/src/Makefile @@ -56,6 +56,7 @@ endif ifeq ($(CONFIG_SPI),y) CSRCS += stm32_spi.c endif + ifeq ($(CONFIG_ADC),y) CSRCS += stm32_adc.c endif diff --git a/configs/nucleo-144/src/nucleo-144.h b/configs/nucleo-144/src/nucleo-144.h index 9b0e25cb4cd89d247542f82eae93e007f23694ba..b12dbead8b0cc212a18fda9e932610d78819f63d 100644 --- a/configs/nucleo-144/src/nucleo-144.h +++ b/configs/nucleo-144/src/nucleo-144.h @@ -244,18 +244,6 @@ void stm32_dma_alloc_init(void); int stm32_dma_alloc_init(void); #endif -/**************************************************************************** - * Name: stm32_adc_initialize - * - * Description: - * Called at application startup time to initialize the ADC functionality. - * - ****************************************************************************/ - -#ifdef CONFIG_ADC -int board_adc_initialize(void); -#endif - /**************************************************************************** * Name: stm32_sdio_initialize * @@ -281,6 +269,18 @@ int stm32_sdio_initialize(void); void stm32_usbinitialize(void); #endif +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + /************************************************************************************ * Name: stm32_bbsram_int ************************************************************************************/ diff --git a/configs/nucleo-144/src/stm32_adc.c b/configs/nucleo-144/src/stm32_adc.c index f185335a7a104462de6463d683e81edb8e468bc0..5a26723f5e7d0ff1ad9d45c233cbffca043b0a8f 100644 --- a/configs/nucleo-144/src/stm32_adc.c +++ b/configs/nucleo-144/src/stm32_adc.c @@ -112,28 +112,14 @@ static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN3}; ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) -{ - return board_adc_initialize(); -} - -/************************************************************************************ - * Name: stm32_adc_initialize - * - * Description: - * Called at application startup time to initialize the ADC functionality. - * - ************************************************************************************/ - -int board_adc_initialize(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32F7_ADC1 static bool initialized = false; diff --git a/configs/nucleo-144/src/stm32_appinitialize.c b/configs/nucleo-144/src/stm32_appinitialize.c index 837048b5a1a8ab431c8bdc91656ddf343bc51d59..86febc3e851c6000b51a3bb3d0a925db246fc7d3 100644 --- a/configs/nucleo-144/src/stm32_appinitialize.c +++ b/configs/nucleo-144/src/stm32_appinitialize.c @@ -102,6 +102,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_STM32F7_BBSRAM /* Initialize battery-backed RAM */ diff --git a/configs/nucleo-f303re/adc/defconfig b/configs/nucleo-f303re/adc/defconfig index 4b67445407139f3b25a6b8e78f2d492feb9feabb..4fb368517ac1fa2c7d7c5e4361e7c5345ed914f4 100644 --- a/configs/nucleo-f303re/adc/defconfig +++ b/configs/nucleo-f303re/adc/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -543,8 +541,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -727,7 +723,6 @@ CONFIG_ADC_FIFOSIZE=8 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -884,7 +879,6 @@ CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_NSAMPLES=0 CONFIG_EXAMPLES_ADC_GROUPSIZE=4 CONFIG_EXAMPLES_ADC_SWTRIG=y -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -918,7 +912,6 @@ CONFIG_EXAMPLES_ADC_SWTRIG=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f303re/can/defconfig b/configs/nucleo-f303re/can/defconfig index 3450575cbffe816c12e8dcf0c60301cde91fcf97..883c9c366811ce95a454eb181cab1dc0eb4c4077 100644 --- a/configs/nucleo-f303re/can/defconfig +++ b/configs/nucleo-f303re/can/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -546,9 +544,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -729,7 +724,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -882,7 +876,6 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set CONFIG_EXAMPLES_CAN=y CONFIG_EXAMPLES_CAN_DEVPATH="/dev/can0" @@ -921,7 +914,6 @@ CONFIG_EXAMPLES_CAN_READWRITE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f303re/hello/defconfig b/configs/nucleo-f303re/hello/defconfig index 9c434786e3a36a6c9c23da17c730f19f9e395ec6..dffa050525ef59f1c7f94ced699e4b8b68114000 100644 --- a/configs/nucleo-f303re/hello/defconfig +++ b/configs/nucleo-f303re/hello/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -728,7 +726,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -931,7 +928,6 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -967,7 +963,6 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f303re/nxlines/defconfig b/configs/nucleo-f303re/nxlines/defconfig index 6eb9debcdb09f0880cf1cb806fae71ac8c146ab2..84d948c10221d67a0e6abb87919054297715b3ed 100644 --- a/configs/nucleo-f303re/nxlines/defconfig +++ b/configs/nucleo-f303re/nxlines/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -545,9 +543,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -# CONFIG_BOARDCTL_CANINIT is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -793,7 +788,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -1036,7 +1030,6 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CCTYPE is not set @@ -1079,7 +1072,6 @@ CONFIG_EXAMPLES_NXLINES_EXTERNINIT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f303re/pwm/defconfig b/configs/nucleo-f303re/pwm/defconfig index 0e54eba6eb2b55f72b6650fce6cbd311716f9352..ca70a10f72478442d9628b4969f1f6263c5ef63d 100644 --- a/configs/nucleo-f303re/pwm/defconfig +++ b/configs/nucleo-f303re/pwm/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -547,8 +545,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -CONFIG_BOARDCTL_PWMTEST=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -727,7 +723,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -889,7 +884,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -931,7 +925,6 @@ CONFIG_EXAMPLES_PWM_DUTYPCT2=50 CONFIG_EXAMPLES_PWM_CHANNEL2=2 # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f303re/serialrx/defconfig b/configs/nucleo-f303re/serialrx/defconfig index 19c06fd3fa3f4879676c6559752840f7813463f7..17f8c5f5e290c5c68a69d992d78b1a497ca508d0 100644 --- a/configs/nucleo-f303re/serialrx/defconfig +++ b/configs/nucleo-f303re/serialrx/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -550,8 +548,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -731,7 +727,6 @@ CONFIG_ADC_FIFOSIZE=8 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_SERIAL_REMOVABLE is not set # CONFIG_SERIAL_CONSOLE is not set @@ -961,7 +956,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set CONFIG_EXAMPLES_SERIALRX=y diff --git a/configs/nucleo-f303re/src/nucleo-f303re.h b/configs/nucleo-f303re/src/nucleo-f303re.h index 8d9d21d2273630e0549cbd23f7dc7a95d40d8c35..e11495f5f151437efce03975ab336fe790f8ece2 100644 --- a/configs/nucleo-f303re/src/nucleo-f303re.h +++ b/configs/nucleo-f303re/src/nucleo-f303re.h @@ -167,4 +167,40 @@ int stm32_timer_driver_setup(FAR const char *devpath, int timer); int stm32_dac_setup(void); #endif +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + #endif /* __CONFIGS_NUCLEO_F303RE_SRC_NUCLEO_F303RE_H */ diff --git a/configs/nucleo-f303re/src/stm32_adc.c b/configs/nucleo-f303re/src/stm32_adc.c index 10183458ec4711c399eea87d292b0d7f2786ec2c..04014c4fe8180b1ad9177ffd9849552a5389f978 100644 --- a/configs/nucleo-f303re/src/stm32_adc.c +++ b/configs/nucleo-f303re/src/stm32_adc.c @@ -320,85 +320,74 @@ static const uint32_t g_pinlist2[1] = * Public Functions ****************************************************************************/ -/**************************************************************************** - * Name: board_adc_setup +/************************************************************************************ + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work - * with examples/adc. + * Initialize ADC and register the ADC driver. * - ****************************************************************************/ + ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { - static bool initialized = false; FAR struct adc_dev_s *adc; int ret; int i; - /* Check if we have already initialized */ - - if (!initialized) { - - /* DEV1 */ - /* Configure the pins as analog inputs for the selected channels */ + /* DEV1 */ + /* Configure the pins as analog inputs for the selected channels */ - for (i = 0; i < DEV1_NCHANNELS; i++) - { - stm32_configgpio(g_pinlist1[i]); - } + for (i = 0; i < DEV1_NCHANNELS; i++) + { + stm32_configgpio(g_pinlist1[i]); + } - /* Call stm32_adcinitialize() to get an instance of the ADC interface */ + /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - adc = stm32_adcinitialize(DEV1_PORT, g_chanlist1, DEV1_NCHANNELS); - if (adc == NULL) - { - aerr("ERROR: Failed to get ADC interface 1\n"); - return -ENODEV; - } + adc = stm32_adcinitialize(DEV1_PORT, g_chanlist1, DEV1_NCHANNELS); + if (adc == NULL) + { + aerr("ERROR: Failed to get ADC interface 1\n"); + return -ENODEV; + } - /* Register the ADC driver at "/dev/adc0" */ + /* Register the ADC driver at "/dev/adc0" */ - ret = adc_register("/dev/adc0", adc); - if (ret < 0) - { - aerr("ERROR: adc_register /dev/adc0 failed: %d\n", ret); - return ret; - } + ret = adc_register("/dev/adc0", adc); + if (ret < 0) + { + aerr("ERROR: adc_register /dev/adc0 failed: %d\n", ret); + return ret; + } #ifdef DEV2_PORT - /* DEV2 */ - /* Configure the pins as analog inputs for the selected channels */ + /* DEV2 */ + /* Configure the pins as analog inputs for the selected channels */ - for (i = 0; i < DEV2_NCHANNELS; i++) - { - stm32_configgpio(g_pinlist2[i]); - } - - /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - - adc = stm32_adcinitialize(DEV2_PORT, g_chanlist2, DEV2_NCHANNELS); - if (adc == NULL) - { - aerr("ERROR: Failed to get ADC interface 2\n"); - return -ENODEV; - } + for (i = 0; i < DEV2_NCHANNELS; i++) + { + stm32_configgpio(g_pinlist2[i]); + } - /* Register the ADC driver at "/dev/adc1" */ + /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - ret = adc_register("/dev/adc1", adc); - if (ret < 0) - { - aerr("ERROR: adc_register /dev/adc1 failed: %d\n", ret); - return ret; - } -#endif + adc = stm32_adcinitialize(DEV2_PORT, g_chanlist2, DEV2_NCHANNELS); + if (adc == NULL) + { + aerr("ERROR: Failed to get ADC interface 2\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the ADC driver at "/dev/adc1" */ - initialized = true; + ret = adc_register("/dev/adc1", adc); + if (ret < 0) + { + aerr("ERROR: adc_register /dev/adc1 failed: %d\n", ret); + return ret; } +#endif return OK; } diff --git a/configs/nucleo-f303re/src/stm32_appinitialize.c b/configs/nucleo-f303re/src/stm32_appinitialize.c index 7157606edbb876314203fb5ea09a7d312de846ca..621488c57f1882d3149ef7f6ae9d2685ccc1c61c 100644 --- a/configs/nucleo-f303re/src/stm32_appinitialize.c +++ b/configs/nucleo-f303re/src/stm32_appinitialize.c @@ -95,9 +95,7 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_LEDS) || defined(HAVE_DAC) int ret; -#endif #ifdef HAVE_LEDS /* Register the LED driver */ @@ -110,6 +108,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + /* Contrairement à l'ADC, il n'y a pas de BOARDIOC_DAC_SETUP spécifique. Il * faut le faire ici */ @@ -123,5 +131,26 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/nucleo-f303re/src/stm32_can.c b/configs/nucleo-f303re/src/stm32_can.c index ec689b3e91798f23199f36e848f19cb69b325751..e1f1a2d713536bcc20e609406a4c433fba3adba7 100644 --- a/configs/nucleo-f303re/src/stm32_can.c +++ b/configs/nucleo-f303re/src/stm32_can.c @@ -45,60 +45,52 @@ #include #include -#include #include #include "stm32.h" -#if defined(CONFIG_CAN) && defined(CONFIG_STM32_CAN1) +#ifdef CONFIG_CAN /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work - * with examples/can. + * Initialize CAN and register the CAN device * ****************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#ifdef CONFIG_STM32_CAN1 struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(1); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(1); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/nucleo-f303re/src/stm32_pwm.c b/configs/nucleo-f303re/src/stm32_pwm.c index 7ab25eac4d9b1aeb1362cfb82fb7366c1068deb0..ae46bc7057dd244fcd319b25e1a8fe9559d50cb9 100644 --- a/configs/nucleo-f303re/src/stm32_pwm.c +++ b/configs/nucleo-f303re/src/stm32_pwm.c @@ -57,16 +57,15 @@ * Public Functions ****************************************************************************/ -/**************************************************************************** - * Name: board_pwm_setup +/************************************************************************************ + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work - * with examples/pwm. + * Initialize PWM and register the PWM device. * - ****************************************************************************/ + ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/nucleo-f303re/uavcan/defconfig b/configs/nucleo-f303re/uavcan/defconfig index 944984f2d5244e0af96e0f634db7fb91af715492..21ffa461650adba39baa4223066b5707346c695a 100644 --- a/configs/nucleo-f303re/uavcan/defconfig +++ b/configs/nucleo-f303re/uavcan/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -706,7 +704,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -895,7 +892,6 @@ CONFIG_LIBUAVCAN_INIT_RETRIES=0 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -931,7 +927,6 @@ CONFIG_LIBUAVCAN_INIT_RETRIES=0 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f4x1re/Kconfig b/configs/nucleo-f4x1re/Kconfig index 6449f5b673c0589ba10b7a2f007de4d8d9cbe9f4..27e172d8418b5c105ff4dd87b3a343178e2bb994 100644 --- a/configs/nucleo-f4x1re/Kconfig +++ b/configs/nucleo-f4x1re/Kconfig @@ -5,6 +5,11 @@ if ARCH_BOARD_NUCLEO_F401RE +config NUCLEO_F401RE_QETIMER + int "Timer to use with QE encoder" + default 3 + depends on QENCODER + config NUCLEO_F401RE_AJOY_MINBUTTONS bool "Minimal Joystick Buttons" default n if !STM32_USART1 diff --git a/configs/nucleo-f4x1re/f401-nsh/defconfig b/configs/nucleo-f4x1re/f401-nsh/defconfig index ab3b2df490995a8d79cc5dbaaf67938df42d5cea..5973a284e187c73c99ffec9fccf6f62c28c546e4 100644 --- a/configs/nucleo-f4x1re/f401-nsh/defconfig +++ b/configs/nucleo-f4x1re/f401-nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -725,7 +723,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -972,7 +969,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f4x1re/f411-nsh/defconfig b/configs/nucleo-f4x1re/f411-nsh/defconfig index b0a9f0e526a92bfeb64c209c5afdf192b5d6ad1d..a1fafd77d5220899c3284a4b76f98e5572db9247 100644 --- a/configs/nucleo-f4x1re/f411-nsh/defconfig +++ b/configs/nucleo-f4x1re/f411-nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -727,7 +725,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -974,7 +971,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h index 21e5f7b09d28ba8edc70837a51ee1ce0040b8d3f..c3d1a62ea053568b881a057b450390f9bf7a7c88 100644 --- a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h +++ b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/nucleo-f4x1re/src/nucleo-f4x1re.h * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Authors: Frank Bennett * Gregory Nutt * @@ -309,15 +309,27 @@ void stm32_spidev_initialize(void); void stm32_usbinitialize(void); /************************************************************************************ - * Name: board_adc_initialize + * Name: stm32_adc_setup * * Description: - * Initialize and register the ADC driver(s) + * Initialize ADC and register the ADC driver. * ************************************************************************************/ #ifdef CONFIG_ADC -int board_adc_initialize(void); +int stm32_adc_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32_qencoder_initialize(FAR const char *devpath, int timer); #endif /**************************************************************************** diff --git a/configs/nucleo-f4x1re/src/stm32_adc.c b/configs/nucleo-f4x1re/src/stm32_adc.c index 3b55e7ef7d1c855b01561dac0fc380f6224dfcff..e4fb1c7f6e609aa28e236639ddfae9b2aa5b7367 100644 --- a/configs/nucleo-f4x1re/src/stm32_adc.c +++ b/configs/nucleo-f4x1re/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/nucleo-f4x1re/src/stm32_adc.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -71,7 +71,6 @@ ************************************************************************************/ /* Identifying number of each ADC channel. */ -#ifdef CONFIG_STM32_ADC1 #ifdef CONFIG_AJOYSTICK #ifdef CONFIG_ADC_DMA /* The Itead analog joystick gets inputs on ADC_IN0 and ADC_IN1 */ @@ -95,87 +94,51 @@ static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN0}; #endif /* CONFIG_ADC_DMA */ #endif /* CONFIG_AJOYSTICK */ -#endif /* CONFIG_STM32_ADC1*/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_initialize + * Name: stm32_adc_setup * * Description: - * Initialize and register the ADC driver + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_initialize(void) +int stm32_adc_setup(void) { - static bool initialized = false; struct adc_dev_s *adc; int ret; int i; - /* Check if we have already initialized */ + /* Configure the pins as analog inputs for the selected channels */ - if (!initialized) + for (i = 0; i < ADC1_NCHANNELS; i++) { -#ifdef CONFIG_STM32_ADC1 - /* Configure the pins as analog inputs for the selected channels */ - - for (i = 0; i < ADC1_NCHANNELS; i++) - { - stm32_configgpio(g_adc1_pinlist[i]); - } - - /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - - adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); - if (adc == NULL) - { - aerr("ERROR: Failed to get ADC interface\n"); - return -ENODEV; - } - - /* Register the ADC driver at "/dev/adc0" */ - - ret = adc_register("/dev/adc0", adc); - if (ret < 0) - { - aerr("ERROR: adc_register failed: %d\n", ret); - return ret; - } -#endif - /* Now we are initialized */ + stm32_configgpio(g_adc1_pinlist[i]); + } + + /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - initialized = true; + adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); + if (adc == NULL) + { + aerr("ERROR: Failed to get ADC interface\n"); + return -ENODEV; } - return OK; -} + /* Register the ADC driver at "/dev/adc0" */ -/************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ + ret = adc_register("/dev/adc0", adc); + if (ret < 0) + { + aerr("ERROR: adc_register failed: %d\n", ret); + return ret; + } -#ifdef CONFIG_EXAMPLES_ADC -int board_adc_setup(void) -{ -#ifdef CONFIG_SAMA5_ADC - return board_adc_initialize(); -#else - return -ENOSYS; -#endif + return OK; } -#endif /* CONFIG_EXAMPLES_ADC */ #endif /* CONFIG_STM32_ADC1 */ diff --git a/configs/nucleo-f4x1re/src/stm32_ajoystick.c b/configs/nucleo-f4x1re/src/stm32_ajoystick.c index a40f08f4b0340ad52c6a1c943d816c6c2ab9560f..7bc30b1d6761d03f2e2cb8aa58c2d59fda1168fe 100644 --- a/configs/nucleo-f4x1re/src/stm32_ajoystick.c +++ b/configs/nucleo-f4x1re/src/stm32_ajoystick.c @@ -456,15 +456,7 @@ int board_ajoy_initialize(void) iinfo("Initialize ADC driver: /dev/adc0\n"); - /* Initialize ADC. We will need this to read the ADC inputs */ - - ret = board_adc_initialize(); - if (ret < 0) - { - ierr("ERROR: board_adc_initialize() failed: %d\n", ret); - return ret; - } - + /* NOTE: The ADC driver was initialized earlier in the bring-up sequence. */ /* Open the ADC driver for reading. */ fd = open("/dev/adc0", O_RDONLY); diff --git a/configs/nucleo-f4x1re/src/stm32_appinit.c b/configs/nucleo-f4x1re/src/stm32_appinit.c index 97cbc4ffc48c6c02d60eb1528cc65b425ad66432..5845ad169f31f2044caa2a4caf33a468bd4a4be8 100644 --- a/configs/nucleo-f4x1re/src/stm32_appinit.c +++ b/configs/nucleo-f4x1re/src/stm32_appinit.c @@ -55,18 +55,6 @@ #include "nucleo-f4x1re.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -112,9 +100,7 @@ void up_netinitialize(void) int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_MMCSD) || defined(CONFIG_AJOYSTICK) - int ret; -#endif + int ret = OK; /* Configure CPU load estimation */ @@ -153,6 +139,29 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "[boot] Initialized SDIO\n"); #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_QENCODER + /* Initialize and register the qencoder driver */ + + ret = stm32_qencoder_initialize("/dev/qe0", CONFIG_NUCLEO_F401RE_QETIMER); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + #ifdef CONFIG_AJOYSTICK /* Initialize and register the joystick driver */ @@ -166,5 +175,5 @@ int board_app_initialize(uintptr_t arg) } #endif - return OK; + return ret; } diff --git a/configs/nucleo-f4x1re/src/stm32_qencoder.c b/configs/nucleo-f4x1re/src/stm32_qencoder.c index 6d72932844012d7b35970d14baa27773e5ed4cbb..bac52a803e4086bf6314dc976ac259b070ef0839 100644 --- a/configs/nucleo-f4x1re/src/stm32_qencoder.c +++ b/configs/nucleo-f4x1re/src/stm32_qencoder.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32f4discovery/src/stm32_qencoder.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,79 +50,12 @@ #include "stm32_qencoder.h" #include "nucleo-f4x1re.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32_TIMn_QE). - */ - -#ifndef CONFIG_STM32_TIM1 -# undef CONFIG_STM32_TIM1_QE -#endif -#ifndef CONFIG_STM32_TIM2 -# undef CONFIG_STM32_TIM2_QE -#endif -#ifndef CONFIG_STM32_TIM3 -# undef CONFIG_STM32_TIM3_QE -#endif -#ifndef CONFIG_STM32_TIM4 -# undef CONFIG_STM32_TIM4_QE -#endif -#ifndef CONFIG_STM32_TIM5 -# undef CONFIG_STM32_TIM5_QE -#endif -#ifndef CONFIG_STM32_TIM8 -# undef CONFIG_STM32_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: qe_devinit + * Name: stm32_qencoder_initialize * * Description: * All STM32 architectures must provide the following interface to work with @@ -130,29 +63,20 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } #endif /* HAVE_QENCODER */ diff --git a/configs/nucleo-l476rg/include/board.h b/configs/nucleo-l476rg/include/board.h index 103f5a2e00c178ec21df266e6da2756adab60a38..490e5af96895e403b33b5b3004c0ac62271b8918 100644 --- a/configs/nucleo-l476rg/include/board.h +++ b/configs/nucleo-l476rg/include/board.h @@ -102,6 +102,9 @@ #define GPIO_USART2_RTS GPIO_USART2_RTS_2 #define GPIO_USART2_CTS GPIO_USART2_CTS_2 +#define GPIO_UART4_RX GPIO_UART4_RX_1 /* PA1 */ +#define GPIO_UART4_TX GPIO_UART4_TX_1 /* PA0 */ + /* I2C * * The optional _GPIO configurations allow the I2C driver to manually diff --git a/configs/nucleo-l476rg/nsh/defconfig b/configs/nucleo-l476rg/nsh/defconfig index 0fda36c2ed2ab3824c2a956e0fb1a6ac86dd9c1a..c8b4ec6900519c83f7a661e1c2f28b63259dd8e1 100644 --- a/configs/nucleo-l476rg/nsh/defconfig +++ b/configs/nucleo-l476rg/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -370,8 +368,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -560,7 +556,6 @@ CONFIG_RTC_IOCTL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -820,7 +815,6 @@ CONFIG_EXAMPLES_MAXSAMPLES=64 CONFIG_EXAMPLES_NSAMPLES=8 # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/nucleo-l476rg/src/nucleo-l476rg.h b/configs/nucleo-l476rg/src/nucleo-l476rg.h index 50151a3fe5a0e16c09bf4fe696df9369bbd0a199..e82283b177c3e79b48fc4ffe07b1e566086ff992 100644 --- a/configs/nucleo-l476rg/src/nucleo-l476rg.h +++ b/configs/nucleo-l476rg/src/nucleo-l476rg.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/nucleo-l476rg/src/nucleo-l476rg.h * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Authors: Frank Bennett * Gregory Nutt * Sebastien Lorquet @@ -328,15 +328,27 @@ void stm32_spiinitialize(void); void stm32_usbinitialize(void); /************************************************************************************ - * Name: board_adc_initialize + * Name: stm32_pwm_setup * * Description: - * Initialize and register the ADC driver(s) + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. * ************************************************************************************/ #ifdef CONFIG_ADC -int board_adc_initialize(void); +int stm32_adc_setup(void); #endif /**************************************************************************** @@ -363,4 +375,16 @@ int board_ajoy_initialize(void); int board_timer_driver_initialize(FAR const char *devpath, int timer); #endif +/**************************************************************************** + * Name: stm32l4_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32l4_qencoder_initialize(FAR const char *devpath, int timer); +#endif + #endif /* __CONFIGS_NUCLEO_L476RG_SRC_NUCLEO_L476RG_H */ diff --git a/configs/nucleo-l476rg/src/stm32_adc.c b/configs/nucleo-l476rg/src/stm32_adc.c index 77ed219a312752603b8b96216111c7e13f98db6a..7ca4b18ab032d2eaa43998f9dbed93aa85398537 100644 --- a/configs/nucleo-l476rg/src/stm32_adc.c +++ b/configs/nucleo-l476rg/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/nucleo-l476rg/src/stm32_adc.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -71,7 +71,6 @@ ************************************************************************************/ /* Identifying number of each ADC channel. */ -#ifdef CONFIG_STM32_ADC1 #ifdef CONFIG_AJOYSTICK #ifdef CONFIG_ADC_DMA /* The Itead analog joystick gets inputs on ADC_IN0 and ADC_IN1 */ @@ -95,7 +94,6 @@ static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN0}; #endif /* CONFIG_ADC_DMA */ #endif /* CONFIG_AJOYSTICK */ -#endif /* CONFIG_STM32_ADC1*/ /************************************************************************************ * Private Functions @@ -106,76 +104,45 @@ static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN0}; ************************************************************************************/ /************************************************************************************ - * Name: board_adc_initialize + * Name: stm32_adc_setup * * Description: - * Initialize and register the ADC driver + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_initialize(void) +int stm32_adc_setup(void) { - static bool initialized = false; struct adc_dev_s *adc; int ret; int i; - /* Check if we have already initialized */ + /* Configure the pins as analog inputs for the selected channels */ - if (!initialized) + for (i = 0; i < ADC1_NCHANNELS; i++) { -#ifdef CONFIG_STM32_ADC1 - /* Configure the pins as analog inputs for the selected channels */ - - for (i = 0; i < ADC1_NCHANNELS; i++) - { - stm32_configgpio(g_adc1_pinlist[i]); - } - - /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - - adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); - if (adc == NULL) - { - aerr("ERROR: Failed to get ADC interface\n"); - return -ENODEV; - } - - /* Register the ADC driver at "/dev/adc0" */ - - ret = adc_register("/dev/adc0", adc); - if (ret < 0) - { - aerr("ERROR: adc_register failed: %d\n", ret); - return ret; - } -#endif - /* Now we are initialized */ + stm32_configgpio(g_adc1_pinlist[i]); + } + + /* Call stm32_adcinitialize() to get an instance of the ADC interface */ - initialized = true; + adc = stm32_adcinitialize(1, g_adc1_chanlist, ADC1_NCHANNELS); + if (adc == NULL) + { + aerr("ERROR: Failed to get ADC interface\n"); + return -ENODEV; } - return OK; -} + /* Register the ADC driver at "/dev/adc0" */ -/************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ + ret = adc_register("/dev/adc0", adc); + if (ret < 0) + { + aerr("ERROR: adc_register failed: %d\n", ret); + return ret; + } -#ifdef CONFIG_EXAMPLES_ADC -int board_adc_setup(void) -{ -#ifdef CONFIG_SAMA5_ADC - return board_adc_initialize(); -#else - return -ENOSYS; -#endif + return OK; } -#endif /* CONFIG_EXAMPLES_ADC */ #endif /* CONFIG_STM32_ADC1 */ diff --git a/configs/nucleo-l476rg/src/stm32_ajoystick.c b/configs/nucleo-l476rg/src/stm32_ajoystick.c index 71a61ef417ab970c5847ca5b57ef3def44555cb0..1fc72b5629cbdf73276003fb67f852e434db696b 100644 --- a/configs/nucleo-l476rg/src/stm32_ajoystick.c +++ b/configs/nucleo-l476rg/src/stm32_ajoystick.c @@ -455,15 +455,7 @@ int board_ajoy_initialize(void) iinfo("Initialize ADC driver: /dev/adc0\n"); - /* Initialize ADC. We will need this to read the ADC inputs */ - - ret = board_adc_initialize(); - if (ret < 0) - { - ierr("ERROR: board_adc_initialize() failed: %d\n", ret); - return ret; - } - + /* NOTE: The ADC driver was initialized earlier in the bring-up sequence. */ /* Open the ADC driver for reading. */ fd = open("/dev/adc0", O_RDONLY); diff --git a/configs/nucleo-l476rg/src/stm32_appinit.c b/configs/nucleo-l476rg/src/stm32_appinit.c index bb134ee6aa3745ddf02b6c0299c2bb02f88b3580..41b54976ae472ce237dbd4a20b7cd5402f722416 100644 --- a/configs/nucleo-l476rg/src/stm32_appinit.c +++ b/configs/nucleo-l476rg/src/stm32_appinit.c @@ -111,14 +111,18 @@ int board_app_initialize(uintptr_t arg) { #ifdef HAVE_RTC_DRIVER FAR struct rtc_lowerhalf_s *rtclower; +#endif +#ifdef CONFIG_QENCODER + int index; + char buf[9]; #endif int ret; (void)ret; +#ifdef CONFIG_SCHED_INSTRUMENTATION /* Configure CPU load estimation */ -#ifdef CONFIG_SCHED_INSTRUMENTATION cpuload_initialize_once(); #endif @@ -192,6 +196,26 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "[boot] Initialized SDIO\n"); #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_AJOYSTICK /* Initialize and register the joystick driver */ @@ -218,6 +242,87 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_QENCODER + + /* Initialize and register the qencoder driver */ + + index = 0; + +#ifdef CONFIG_STM32L4_TIM1_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 1); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#ifdef CONFIG_STM32L4_TIM2_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 2); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#ifdef CONFIG_STM32L4_TIM3_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 3); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#ifdef CONFIG_STM32L4_TIM4_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 4); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#ifdef CONFIG_STM32L4_TIM5_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 5); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#ifdef CONFIG_STM32L4_TIM8_QE + sprintf(buf, "/dev/qe%d", index++); + ret = stm32l4_qencoder_initialize(buf, 8); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + +#endif + + UNUSED(ret); return OK; } diff --git a/configs/nucleo-l476rg/src/stm32_pwm.c b/configs/nucleo-l476rg/src/stm32_pwm.c index f5c00a1a64e7354b91cca1b84d590f64209ea978..3db43caacf9d142d7da69c7b46b6234f03c0dd34 100644 --- a/configs/nucleo-l476rg/src/stm32_pwm.c +++ b/configs/nucleo-l476rg/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/nucleo-l476rg/src/stm32_pwm.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Copyright (C) 2016 Sebastien Lorquet. All rights reserved. @@ -68,24 +68,19 @@ #ifdef CONFIG_PWM -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32L4 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/nucleo-l476rg/src/stm32_qencoder.c b/configs/nucleo-l476rg/src/stm32_qencoder.c index 308b6744770eee4e0be96a4a089fb8c8454d09a0..d12f077ef07881d221b9be784325f517406770b1 100644 --- a/configs/nucleo-l476rg/src/stm32_qencoder.c +++ b/configs/nucleo-l476rg/src/stm32_qencoder.c @@ -53,73 +53,6 @@ #include "stm32l4_qencoder.h" #include "nucleo-l476rg.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32L4_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32L4_TIMn_QE). - */ - -#ifndef CONFIG_STM32L4_TIM1 -# undef CONFIG_STM32L4_TIM1_QE -#endif -#ifndef CONFIG_STM32L4_TIM2 -# undef CONFIG_STM32L4_TIM2_QE -#endif -#ifndef CONFIG_STM32L4_TIM3 -# undef CONFIG_STM32L4_TIM3_QE -#endif -#ifndef CONFIG_STM32L4_TIM4 -# undef CONFIG_STM32L4_TIM4_QE -#endif -#ifndef CONFIG_STM32L4_TIM5 -# undef CONFIG_STM32L4_TIM5_QE -#endif -#ifndef CONFIG_STM32L4_TIM8 -# undef CONFIG_STM32L4_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32L4_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32L4_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32L4_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32L4_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32L4_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32L4_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32L4_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -133,29 +66,18 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32l4_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32l4_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32l4_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32l4_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } - -#endif /* HAVE_QENCODER */ diff --git a/configs/nutiny-nuc120/nsh/defconfig b/configs/nutiny-nuc120/nsh/defconfig index c6bfab727de8a48887fc09a85093d780a3d0f124..a8d566fcc0ead91a0ec9073e6f4f9dcdc3e95267 100644 --- a/configs/nutiny-nuc120/nsh/defconfig +++ b/configs/nutiny-nuc120/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -446,7 +444,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -660,7 +657,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-efm32g880f128-stk/nsh/defconfig b/configs/olimex-efm32g880f128-stk/nsh/defconfig index bd9a59637f26cb85de11f35fd3d108915f03c544..284ccdf97a14a7e36f27466c39b929d7d52c42cd 100644 --- a/configs/olimex-efm32g880f128-stk/nsh/defconfig +++ b/configs/olimex-efm32g880f128-stk/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set CONFIG_ARCH_CHIP_EFM32=y # CONFIG_ARCH_CHIP_IMX1 is not set @@ -452,7 +450,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -659,7 +656,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc-h3131/nsh/defconfig b/configs/olimex-lpc-h3131/nsh/defconfig index 273eab0bdfb268a16197a108ca6e26d7b06c2afe..589cbe3c03c8ebcc8d8b8c4f0bdf8d6c89794d22 100644 --- a/configs/olimex-lpc-h3131/nsh/defconfig +++ b/configs/olimex-lpc-h3131/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -256,8 +254,6 @@ CONFIG_NSH_MMCSDMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -420,7 +416,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -660,7 +655,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/ftpc/defconfig b/configs/olimex-lpc1766stk/ftpc/defconfig index bae7aac56bf255c4bb493d66124eeca71f28b737..fc0d118c62d187d38fe44fd158a986ac6a151241 100644 --- a/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/configs/olimex-lpc1766stk/ftpc/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -317,8 +315,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -527,10 +523,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -554,7 +549,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -632,13 +626,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=550 CONFIG_NET_GUARDSIZE=2 @@ -928,7 +920,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/hidkbd/defconfig b/configs/olimex-lpc1766stk/hidkbd/defconfig index 56f0f473569e93eb3f4c4043533e62ab337f6981..f052dbade620a4092586254700e926bc6729376b 100644 --- a/configs/olimex-lpc1766stk/hidkbd/defconfig +++ b/configs/olimex-lpc1766stk/hidkbd/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -503,7 +501,6 @@ CONFIG_MMCSD_NSLOTS=1 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -753,7 +750,6 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/hidmouse/defconfig b/configs/olimex-lpc1766stk/hidmouse/defconfig index 31bc8639516bccaa86c3d802b744021f12ae4db4..a87a47d09e0e41ea294bb672b79b7121846dda14 100644 --- a/configs/olimex-lpc1766stk/hidmouse/defconfig +++ b/configs/olimex-lpc1766stk/hidmouse/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -329,8 +327,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -522,7 +518,6 @@ CONFIG_NETDEV_TELNET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -621,13 +616,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -917,7 +910,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/nettest/defconfig b/configs/olimex-lpc1766stk/nettest/defconfig index 2b676ed87274408db930ee34ff82926fb9ff8cf4..187301717f920150e52058ca96f3d3ea3fb81fa7 100644 --- a/configs/olimex-lpc1766stk/nettest/defconfig +++ b/configs/olimex-lpc1766stk/nettest/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -491,10 +489,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -518,7 +515,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -594,13 +590,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -859,7 +853,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/nsh/defconfig b/configs/olimex-lpc1766stk/nsh/defconfig index 1a67e4f8a69bed1222d176581e8a2d64008ece82..061eb4cd36ee16553967b8905ef4cdd5bbdbd15d 100644 --- a/configs/olimex-lpc1766stk/nsh/defconfig +++ b/configs/olimex-lpc1766stk/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,8 +316,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -530,10 +526,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -557,7 +551,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -634,13 +627,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -778,7 +769,16 @@ CONFIG_FAT_MAXFNAME=32 # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set # CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set +CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set + +# +# Exclude individual procfs entries +# +# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set +# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set +# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set +# CONFIG_FS_PROCFS_EXCLUDE_NET is not set # CONFIG_FS_UNIONFS is not set # @@ -852,6 +852,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set CONFIG_NETDB_DNSCLIENT=y @@ -930,7 +931,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1046,7 +1046,7 @@ CONFIG_NSH_DISABLE_DATE=y # CONFIG_NSH_DISABLE_HELP is not set # CONFIG_NSH_DISABLE_HEXDUMP is not set # CONFIG_NSH_DISABLE_IFCONFIG is not set -CONFIG_NSH_DISABLE_IFUPDOWN=y +# CONFIG_NSH_DISABLE_IFUPDOWN is not set # CONFIG_NSH_DISABLE_KILL is not set # CONFIG_NSH_DISABLE_LOSETUP is not set CONFIG_NSH_DISABLE_LOSMART=y @@ -1088,6 +1088,7 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 # CONFIG_NSH_CMDOPT_DF_H is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set +CONFIG_NSH_PROC_MOUNTPOINT="/proc" CONFIG_NSH_FILEIOSIZE=512 # diff --git a/configs/olimex-lpc1766stk/nx/defconfig b/configs/olimex-lpc1766stk/nx/defconfig index a05a645c5f4f8df1d8240751f7cd60284e74eb53..498cc7c0044f82235f92f3b6b6ab7d6ebb871dcc 100644 --- a/configs/olimex-lpc1766stk/nx/defconfig +++ b/configs/olimex-lpc1766stk/nx/defconfig @@ -64,10 +64,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -77,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -153,7 +154,6 @@ CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y # CONFIG_ARMV7M_OABI_TOOLCHAIN is not set # CONFIG_ARMV7M_HAVE_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set -# CONFIG_LPC17_GPIOIRQ is not set # CONFIG_SERIAL_TERMIOS is not set # @@ -228,6 +228,7 @@ CONFIG_LPC17_SSP0=y # # Serial driver options # +# CONFIG_LPC17_GPIOIRQ is not set # # Architecture Options @@ -306,12 +307,11 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -331,6 +331,7 @@ CONFIG_DISABLE_ENVIRON=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2010 CONFIG_START_MONTH=12 @@ -423,6 +424,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -438,12 +440,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -451,7 +457,12 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -486,6 +497,7 @@ CONFIG_NOKIA6100_ML=0 CONFIG_NOKIA6100_RGBORD=0 # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -517,7 +529,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -567,9 +578,12 @@ CONFIG_UART0_2STOP=0 # CONFIG_UART0_IFLOWCONTROL is not set # CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -583,6 +597,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -749,6 +764,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -774,6 +791,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -792,9 +810,10 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -834,12 +853,10 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -877,6 +894,7 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -913,13 +931,14 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/olimex-lpc1766stk/slip-httpd/defconfig b/configs/olimex-lpc1766stk/slip-httpd/defconfig index 006083964e927d3be5b7fa704252828b69ba856b..6ccd8a93a4a7bd138ca4ae2233da0fc503eda07b 100644 --- a/configs/olimex-lpc1766stk/slip-httpd/defconfig +++ b/configs/olimex-lpc1766stk/slip-httpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -467,7 +465,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -559,13 +556,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_SLIP_MTU=296 CONFIG_NET_SLIP_TCP_RECVWNDO=256 CONFIG_NET_GUARDSIZE=2 @@ -823,7 +818,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/olimex-lpc1766stk/src/lpc1766stk.h b/configs/olimex-lpc1766stk/src/lpc1766stk.h index da5a6da689cc52a530e6269fd0d91f8605020159..e591862819a519056e9d5fd33a16ad6f8b225082 100644 --- a/configs/olimex-lpc1766stk/src/lpc1766stk.h +++ b/configs/olimex-lpc1766stk/src/lpc1766stk.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimex-lpc1766stk/src/lpc1766stk.h * - * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -260,6 +260,18 @@ void weak_function lpc1766stk_sspdev_initialize(void); +/************************************************************************************ + * Name: lpc1766stk_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ************************************************************************************/ + +#ifdef CONFIG_CAN +int lpc1766stk_can_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H */ diff --git a/configs/olimex-lpc1766stk/src/lpc17_appinit.c b/configs/olimex-lpc1766stk/src/lpc17_appinit.c index a8176afa25e6844e1bd57b1057178ffb0d4d9e09..e3aa02bd456d844e4a64e2bf202a1804d7ae8012 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_appinit.c +++ b/configs/olimex-lpc1766stk/src/lpc17_appinit.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -348,12 +349,38 @@ int board_app_initialize(uintptr_t arg) /* Initialize SPI-based microSD */ ret = nsh_sdinitialize(); - if (ret == OK) + if (ret < 0) { - /* Initialize USB host */ + syslog(LOG_ERR, "ERROR: Failed to initialize SPI-based SD card: %d\n", ret); + } + + /* Initialize USB host */ - ret = nsh_usbhostinitialize(); + ret = nsh_usbhostinitialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); } +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = lpc1766stk_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpc1766stk_can_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + return ret; } diff --git a/configs/olimex-lpc1766stk/src/lpc17_can.c b/configs/olimex-lpc1766stk/src/lpc17_can.c index afb1ff47a0c21ca858061e295e9f1be9564d5c0c..a9e1b68c883deee8b2823c1ebe166a0f35e6ac70 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_can.c +++ b/configs/olimex-lpc1766stk/src/lpc17_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/solimex-lpc1766stk/src/lpc17_can.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include "lpc17_can.h" #include "lpc1766stk.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_LPC17_CAN1) || defined(CONFIG_LPC17_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -78,48 +78,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: lpc1766stk_can_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int lpc1766stk_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_LPC17_CAN1) || defined(CONFIG_LPC17_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call lpc17_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = lpc17_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call lpc17_caninitialize() to get an instance of the CAN interface */ - - can = lpc17_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_LPC17_CAN1 || CONFIG_LPC17_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-lpc1766stk/thttpd-binfs/defconfig b/configs/olimex-lpc1766stk/thttpd-binfs/defconfig index cb2b172f2bad049897e434cb8dda2929af9e0a3b..ee3023b5077531d003199277c04c63e6df3551e4 100644 --- a/configs/olimex-lpc1766stk/thttpd-binfs/defconfig +++ b/configs/olimex-lpc1766stk/thttpd-binfs/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -498,10 +496,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -528,7 +525,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -604,13 +600,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -875,7 +869,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig b/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig index e82d0807e5b3b85490409d1939aef86228d4c5dc..9a9f86908287a5998f1459b541b6357a9ac197aa 100644 --- a/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig +++ b/configs/olimex-lpc1766stk/thttpd-nxflat/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -491,10 +489,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -521,7 +518,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -597,13 +593,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -863,7 +857,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/olimex-lpc1766stk/usbmsc/defconfig b/configs/olimex-lpc1766stk/usbmsc/defconfig index 6aaa47e1651a73de92ba39cf0af851184375aabb..be389ce94048f1b7172dae384620c8dd846e229a 100644 --- a/configs/olimex-lpc1766stk/usbmsc/defconfig +++ b/configs/olimex-lpc1766stk/usbmsc/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -314,8 +312,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -497,7 +493,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -764,7 +759,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/usbserial/defconfig b/configs/olimex-lpc1766stk/usbserial/defconfig index 9aaabe2fcb8552b112fe62fa93ea921890d578ca..3941c38d2cecfa23ce304105f54489084be9df62 100644 --- a/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/configs/olimex-lpc1766stk/usbserial/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -314,8 +312,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -478,7 +474,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -734,7 +729,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc1766stk/zmodem/defconfig b/configs/olimex-lpc1766stk/zmodem/defconfig index 4540805469db374042a58f5e720f082e596cb488..7eca8a61a9acc115be99fdb4ca88df46898d0177 100644 --- a/configs/olimex-lpc1766stk/zmodem/defconfig +++ b/configs/olimex-lpc1766stk/zmodem/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -319,8 +317,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -531,10 +527,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -558,7 +553,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -649,13 +643,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -945,7 +937,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-lpc2378/nsh/defconfig b/configs/olimex-lpc2378/nsh/defconfig index b7496343ace2cd1665cfbf7d085a5a8e8386fb21..f5592ef7c92d42d5a0fcea2337fe9b39d4c9406b 100644 --- a/configs/olimex-lpc2378/nsh/defconfig +++ b/configs/olimex-lpc2378/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -390,7 +388,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -632,7 +629,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/discover/defconfig b/configs/olimex-stm32-e407/discover/defconfig index ee655a6e3fe04506290ac9d379b9be1b47d25ddf..d4f6b116be50cbd7619602b9fb1d655b9c392fc9 100644 --- a/configs/olimex-stm32-e407/discover/defconfig +++ b/configs/olimex-stm32-e407/discover/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -501,6 +499,7 @@ CONFIG_STM32_RMII=y # CONFIG_STM32_RMII_MCO1 is not set # CONFIG_STM32_RMII_MCO2 is not set CONFIG_STM32_RMII_EXTCLK=y +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -673,6 +672,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -681,6 +681,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -692,8 +693,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -794,10 +798,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -821,7 +823,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -899,13 +900,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1154,7 +1153,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1196,7 +1194,6 @@ CONFIG_EXAMPLES_DISCOVER_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/netnsh/defconfig b/configs/olimex-stm32-e407/netnsh/defconfig index 3e13c92c6dcb3af804b162996ed8733c76e85455..5d71e695ec723b6c6ce9b0d763671818d725793c 100644 --- a/configs/olimex-stm32-e407/netnsh/defconfig +++ b/configs/olimex-stm32-e407/netnsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -501,6 +499,7 @@ CONFIG_STM32_RMII=y # CONFIG_STM32_RMII_MCO1 is not set # CONFIG_STM32_RMII_MCO2 is not set CONFIG_STM32_RMII_EXTCLK=y +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -673,6 +672,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -681,6 +681,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -692,8 +693,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -796,10 +800,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -823,7 +825,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -901,13 +902,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1156,7 +1155,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1195,7 +1193,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/nsh/defconfig b/configs/olimex-stm32-e407/nsh/defconfig index 8b39910a0b1f48dec6fc38d5a02cf5f39ab42600..e65e8838115d2461cc7bc8339f3972a76004fca7 100644 --- a/configs/olimex-stm32-e407/nsh/defconfig +++ b/configs/olimex-stm32-e407/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -739,7 +737,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -998,7 +995,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/src/olimex-stm32-e407.h b/configs/olimex-stm32-e407/src/olimex-stm32-e407.h index cc3eff460dddb076f6d6d304f1cd5b401927de69..e941de636b0e084a9cc9b2aae29574cc16acd76c 100644 --- a/configs/olimex-stm32-e407/src/olimex-stm32-e407.h +++ b/configs/olimex-stm32-e407/src/olimex-stm32-e407.h @@ -221,40 +221,40 @@ void weak_function stm32_usbinitialize(void); #endif -/**************************************************************************** - * Name: stm32_sdio_initialize +/************************************************************************************ + * Name: stm32_adc_setup * * Description: - * Initialize SDIO-based MMC/SD card support + * Initialize ADC and register the ADC driver. * - ****************************************************************************/ + ************************************************************************************/ -#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_STM32_SDIO) -int stm32_sdio_initialize(void); +#ifdef CONFIG_ADC +int stm32_adc_setup(void); #endif /**************************************************************************** - * Name: stm32_adc_initialize + * Name: stm32_sdio_initialize * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize SDIO-based MMC/SD card support * ****************************************************************************/ -#ifdef CONFIG_ADC -int stm32_adc_initialize(void); +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_STM32_SDIO) +int stm32_sdio_initialize(void); #endif /**************************************************************************** - * Name: stm32_can_initialize + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * ****************************************************************************/ -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) -int stm32_can_initialize(void); +#ifdef CONFIG_CAN +int stm32_can_setup(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/configs/olimex-stm32-e407/src/stm32_adc.c b/configs/olimex-stm32-e407/src/stm32_adc.c index 98ff8b85f3c33e3ece8b350aa8c23bdcfbf9a30e..c8b9682a12d9486c3d93ef324640c87f15b56751 100644 --- a/configs/olimex-stm32-e407/src/stm32_adc.c +++ b/configs/olimex-stm32-e407/src/stm32_adc.c @@ -114,28 +114,14 @@ static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN1}; ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) -{ - return stm32_adc_initialize(); -} - -/************************************************************************************ - * Name: stm32_adc_initialize - * - * Description: - * Called at application startup time to initialize the ADC functionality. - * - ************************************************************************************/ - -int stm32_adc_initialize(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/olimex-stm32-e407/src/stm32_appinit.c b/configs/olimex-stm32-e407/src/stm32_appinit.c index c7715a95b2af5e0c506701bb23e5a71ed1492887..672d6a7561e305e9c1e38d7d03f71ebfcb17465f 100644 --- a/configs/olimex-stm32-e407/src/stm32_appinit.c +++ b/configs/olimex-stm32-e407/src/stm32_appinit.c @@ -180,32 +180,29 @@ static void stm32_i2ctool(void) int board_app_initialize(uintptr_t arg) { -#if defined(CONFIG_CAN) || defined(CONFIG_ADC) int ret; -#endif /* Register I2C drivers on behalf of the I2C tool */ stm32_i2ctool(); - #ifdef CONFIG_CAN - /* Configure on-board CAN if CAN support has been selected. */ + /* Initialize CAN and register the CAN driver. */ - ret = stm32_can_initialize(); - if (ret != OK) + ret = stm32_can_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); } #endif #ifdef CONFIG_ADC - /* Configure on-board ADCs if ADC support has been selected. */ + /* Initialize ADC and register the ADC driver. */ - ret = stm32_adc_initialize(); - if (ret != OK) + ret = stm32_adc_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); } #endif @@ -232,5 +229,6 @@ int board_app_initialize(uintptr_t arg) } #endif + UNUSED(ret); return OK; } diff --git a/configs/olimex-stm32-e407/src/stm32_can.c b/configs/olimex-stm32-e407/src/stm32_can.c index 42def42a81bbafde9c6dc3ea91ad1b43dd7171ea..b5c7bce8bcbd900b6b3164dcb5777904891ed148 100644 --- a/configs/olimex-stm32-e407/src/stm32_can.c +++ b/configs/olimex-stm32-e407/src/stm32_can.c @@ -41,13 +41,15 @@ #include #include + #include #include + #include "stm32.h" #include "stm32_can.h" #include "olimex-stm32-e407.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -69,62 +71,42 @@ * Public Functions ************************************************************************************/ -/************************************************************************************ - * Name: board_can_initialize - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int board_can_initialize(void) -{ - return stm32_can_initialize(); -} - -/************************************************************************************ - * Name: stm32_can_initialize +/**************************************************************************** + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ -int stm32_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - candbg("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - candbg("ERROR: can_register failed: %d\n", ret); - return ret; - } + candbg("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + candbg("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-stm32-e407/telnetd/defconfig b/configs/olimex-stm32-e407/telnetd/defconfig index 5e3a351669bf7db4f331de0f5a5cc8a588536ca6..f5410d63917045e201c765aa71e10221d6f8e259 100644 --- a/configs/olimex-stm32-e407/telnetd/defconfig +++ b/configs/olimex-stm32-e407/telnetd/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -501,6 +499,7 @@ CONFIG_STM32_RMII=y # CONFIG_STM32_RMII_MCO1 is not set # CONFIG_STM32_RMII_MCO2 is not set CONFIG_STM32_RMII_EXTCLK=y +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -673,6 +672,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -681,6 +681,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -692,8 +693,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -796,10 +800,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -823,7 +825,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -901,13 +902,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1156,7 +1155,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1194,7 +1192,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/usbnsh/defconfig b/configs/olimex-stm32-e407/usbnsh/defconfig index d25ff45f354641f2d58fe239fa8fba091fd647f0..2f62bb28037b6be8f28f3584cba12c5a3ccd59c3 100644 --- a/configs/olimex-stm32-e407/usbnsh/defconfig +++ b/configs/olimex-stm32-e407/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -573,8 +571,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -758,7 +754,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1057,7 +1052,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-e407/webserver/defconfig b/configs/olimex-stm32-e407/webserver/defconfig index 7ab0ac66f89136c272268530e96c481bd8ee1f8f..5066117e880fc30d19865a586f49f76e4ee7f53c 100644 --- a/configs/olimex-stm32-e407/webserver/defconfig +++ b/configs/olimex-stm32-e407/webserver/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -501,6 +499,7 @@ CONFIG_STM32_RMII=y # CONFIG_STM32_RMII_MCO1 is not set # CONFIG_STM32_RMII_MCO2 is not set CONFIG_STM32_RMII_EXTCLK=y +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -673,6 +672,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -681,6 +681,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -692,8 +693,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -794,10 +798,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -821,7 +823,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -899,13 +900,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1154,7 +1153,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1192,7 +1190,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-h405/src/olimex-stm32-h405.h b/configs/olimex-stm32-h405/src/olimex-stm32-h405.h index 0ae22a4e2af9c649f353da43749dbdb5db7b0e9c..d0e40d135dd8db83125e0c43e53de37e18890e95 100644 --- a/configs/olimex-stm32-h405/src/olimex-stm32-h405.h +++ b/configs/olimex-stm32-h405/src/olimex-stm32-h405.h @@ -89,27 +89,27 @@ void weak_function stm32_usbinitialize(void); #endif /************************************************************************************ - * Name: stm32_adc_initialize + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ #ifdef CONFIG_ADC -int stm32_adc_initialize(void); +int stm32_adc_setup(void); #endif -/************************************************************************************ - * Name: stm32_can_initialize +/**************************************************************************** + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) -int stm32_can_initialize(void); +#ifdef CONFIG_CAN +int stm32_can_setup(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/configs/olimex-stm32-h405/src/stm32_adc.c b/configs/olimex-stm32-h405/src/stm32_adc.c index f7cee47b8b86fb6c0342a780269c75201565522e..137ebf9561b4f6de8cfb97b9b2945edd76c82f61 100644 --- a/configs/olimex-stm32-h405/src/stm32_adc.c +++ b/configs/olimex-stm32-h405/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimex-stm32-h405/src/stm32_adc.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -105,37 +105,19 @@ static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN1};/*, GPIO_ADC GPIO_ADC1_IN13, GPIO_ADC1_IN15};*/ #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ - -int board_adc_setup(void) -{ - return stm32_adc_initialize(); -} - -/************************************************************************************ - * Name: stm32_adc_initialize + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int stm32_adc_initialize(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/olimex-stm32-h405/src/stm32_appinit.c b/configs/olimex-stm32-h405/src/stm32_appinit.c index ed8b8fe846b34fa6509b222082b137415b1e7c12..d94f29d31b30aa5f4b7390edf07e3e8dc3caf8a9 100644 --- a/configs/olimex-stm32-h405/src/stm32_appinit.c +++ b/configs/olimex-stm32-h405/src/stm32_appinit.c @@ -103,29 +103,28 @@ int board_app_initialize(uintptr_t arg) { -#if defined(CONFIG_CAN) || defined(CONFIG_ADC) int ret; -#endif -#ifdef CONFIG_CAN - /* Configure on-board CAN if CAN support has been selected. */ +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ - ret = stm32_can_initialize(); - if (ret != OK) + ret = stm32_adc_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); } #endif -#ifdef CONFIG_ADC - /* Configure on-board ADCs if ADC support has been selected. */ +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ - ret = stm32_adc_initialize(); - if (ret != OK) + ret = stm32_can_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); } #endif + UNUSED(ret); return OK; } diff --git a/configs/olimex-stm32-h405/src/stm32_boot.c b/configs/olimex-stm32-h405/src/stm32_boot.c index 7332b8a4ef13999e574c136b86cb155bf45709c8..bc4792fc09e0a936eac34a02cfa2128bdd6e3d22 100644 --- a/configs/olimex-stm32-h405/src/stm32_boot.c +++ b/configs/olimex-stm32-h405/src/stm32_boot.c @@ -47,14 +47,6 @@ #include "olimex-stm32-h405.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-h405/src/stm32_can.c b/configs/olimex-stm32-h405/src/stm32_can.c index 62c94a0b19b3a28d7d51ce70f7664b8255b81b9d..6f361af9406f640dc0fce0150d0c9b022969a45a 100644 --- a/configs/olimex-stm32-h405/src/stm32_can.c +++ b/configs/olimex-stm32-h405/src/stm32_can.c @@ -41,13 +41,16 @@ #include #include + #include + #include + #include "stm32.h" #include "stm32_can.h" #include "olimex-stm32-h405.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -70,61 +73,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - return stm32_can_initialize(); -} - -/**************************************************************************************************** - * Name: stm32_can_initialize - * - * Description: - * Called at application startup time to initialize the CAN functionality. - * - ****************************************************************************************************/ - -int stm32_can_initialize(void) -{ - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-stm32-h405/usbnsh/defconfig b/configs/olimex-stm32-h405/usbnsh/defconfig index a0deb7cb54e2bf7cca258d2151f2e8396ad2b71d..623dc403e6b105f899f75f2ad3f22b17bf41b799 100644 --- a/configs/olimex-stm32-h405/usbnsh/defconfig +++ b/configs/olimex-stm32-h405/usbnsh/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -357,6 +357,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -593,9 +599,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -737,6 +740,8 @@ CONFIG_CAN_NPENDINGRTR=4 CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -787,7 +792,6 @@ CONFIG_ADC_FIFOSIZE=8 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1045,19 +1049,6 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=4 # CONFIG_EXAMPLES_ADC_SWTRIG is not set -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="BUT" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set CONFIG_EXAMPLES_CAN=y CONFIG_EXAMPLES_CAN_DEVPATH="/dev/can0" @@ -1065,6 +1056,7 @@ CONFIG_EXAMPLES_CAN_NMSGS=32 # CONFIG_EXAMPLES_CAN_READ is not set # CONFIG_EXAMPLES_CAN_WRITE is not set CONFIG_EXAMPLES_CAN_READWRITE=y +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1099,7 +1091,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-h407/nsh/defconfig b/configs/olimex-stm32-h407/nsh/defconfig index fd02c40d665329ae8714f63998d0519ead963d59..f6134cc73c87e8fe96e2d57447a61d6b339ebf8f 100644 --- a/configs/olimex-stm32-h407/nsh/defconfig +++ b/configs/olimex-stm32-h407/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -749,7 +747,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1005,7 +1002,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-h407/src/olimex-stm32-h407.h b/configs/olimex-stm32-h407/src/olimex-stm32-h407.h index 6687ef897a7e0b1dd8f3aa9be9f1479fe4e74ffd..c2df0a8678466571c14c7a51b26ae501138d8b03 100644 --- a/configs/olimex-stm32-h407/src/olimex-stm32-h407.h +++ b/configs/olimex-stm32-h407/src/olimex-stm32-h407.h @@ -254,28 +254,28 @@ int stm32_sdio_initialize(void); void weak_function stm32_usbinitialize(void); #endif -/**************************************************************************** - * Name: stm32_adc_initialize +/************************************************************************************ + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * - ****************************************************************************/ + ************************************************************************************/ #ifdef CONFIG_ADC -int stm32_adc_initialize(void); +int stm32_adc_setup(void); #endif /**************************************************************************** - * Name: stm32_can_initialize + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * ****************************************************************************/ -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) -int stm32_can_initialize(void); +#ifdef CONFIG_CAN +int stm32_can_setup(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/configs/olimex-stm32-h407/src/stm32_adc.c b/configs/olimex-stm32-h407/src/stm32_adc.c index 9fa020954c53cf6d285e69121f93cc98a4b314e2..9282080a6bfa11e1002437d2f13055e7e09ed930 100644 --- a/configs/olimex-stm32-h407/src/stm32_adc.c +++ b/configs/olimex-stm32-h407/src/stm32_adc.c @@ -105,37 +105,19 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = {1}; static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN1}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ - -int board_adc_setup(void) -{ - return stm32_adc_initialize(); -} - -/************************************************************************************ - * Name: stm32_adc_initialize + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int stm32_adc_initialize(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/olimex-stm32-h407/src/stm32_appinit.c b/configs/olimex-stm32-h407/src/stm32_appinit.c index d87ae0670ab9cc8c353432ed78ed254b1cc0e130..f461c2f193312b51d8af7104b69d30cccc229545 100644 --- a/configs/olimex-stm32-h407/src/stm32_appinit.c +++ b/configs/olimex-stm32-h407/src/stm32_appinit.c @@ -59,10 +59,6 @@ #ifdef CONFIG_LIB_BOARDCTL -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/olimex-stm32-h407/src/stm32_bringup.c b/configs/olimex-stm32-h407/src/stm32_bringup.c index 73e29d5037f02d750b67e381f88b0e7ec4167b88..621e6c1cca63b9a6fa6db2f87c0082b0d3f5d828 100644 --- a/configs/olimex-stm32-h407/src/stm32_bringup.c +++ b/configs/olimex-stm32-h407/src/stm32_bringup.c @@ -94,32 +94,25 @@ int stm32_bringup(void) #ifdef HAVE_RTC_DRIVER FAR struct rtc_lowerhalf_s *lower; #endif -#if defined(CONFIG_CAN) || defined(CONFIG_ADC) || defined(HAVE_SDIO) || \ - defined(HAVE_RTC_DRIVER) int ret; -#endif #ifdef CONFIG_CAN - /* Configure on-board CAN if CAN support has been selected. */ + /* Initialize CAN and register the CAN driver. */ - ret = stm32_can_initialize(); - if (ret != OK) + ret = stm32_can_setup(); + if (ret < 0) { - syslog(LOG_ERR, - "ERROR: Failed to initialize CAN: %d\n", - ret); + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); } #endif #ifdef CONFIG_ADC - /* Configure on-board ADCs if ADC support has been selected. */ + /* Initialize ADC and register the ADC driver. */ - ret = stm32_adc_initialize(); - if (ret != OK) + ret = stm32_adc_setup(); + if (ret < 0) { - syslog(LOG_ERR, - "ERROR: Failed to initialize ADC: %d\n", - ret); + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); } #endif @@ -186,5 +179,6 @@ int stm32_bringup(void) } #endif + UNUSED(ret); return OK; } diff --git a/configs/olimex-stm32-h407/src/stm32_can.c b/configs/olimex-stm32-h407/src/stm32_can.c index ec7f2d39ab3d86aa898a838cad3912050dae9d8e..b482342e61789e3ef202aff706d23e6f148b7306 100644 --- a/configs/olimex-stm32-h407/src/stm32_can.c +++ b/configs/olimex-stm32-h407/src/stm32_can.c @@ -41,13 +41,15 @@ #include #include + #include #include + #include "stm32.h" #include "stm32_can.h" #include "olimex-stm32-h407.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -70,61 +72,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int board_can_initialize(void) -{ - return stm32_can_initialize(); -} - -/************************************************************************************ - * Name: stm32_can_initialize + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int stm32_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index 210607d9884df4beb8ba0ced3ed2f095c7b4690d..a35f6c8abd158428ec040c89a22ebb3eeffb645e 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -802,10 +800,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -829,7 +826,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -907,13 +903,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=650 CONFIG_NET_ETH_TCP_RECVWNDO=624 CONFIG_NET_GUARDSIZE=2 @@ -1189,7 +1183,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-p107/src/Makefile b/configs/olimex-stm32-p107/src/Makefile index 9d4acd1697858e20cc01ec763899bb5f7dc37d7a..a68b6db8ba0fc4c60d0f6a066814295d44d48073 100644 --- a/configs/olimex-stm32-p107/src/Makefile +++ b/configs/olimex-stm32-p107/src/Makefile @@ -38,6 +38,10 @@ ASRCS = CSRCS = stm32_boot.c stm32_spi.c +ifeq ($(CONFIG_LIB_BOARDCTL),y) +CSRCS += stm32_appinit.c +endif + ifeq ($(CONFIG_CAN),y) CSRCS += stm32_can.c endif diff --git a/configs/olimex-stm32-p107/src/olimex-stm32-p107.h b/configs/olimex-stm32-p107/src/olimex-stm32-p107.h index 4b4b2240e909c02c472e8c7cfc64fbc072a9992f..813cc251d82c4c0a1453f26fb36765760374db37 100644 --- a/configs/olimex-stm32-p107/src/olimex-stm32-p107.h +++ b/configs/olimex-stm32-p107/src/olimex-stm32-p107.h @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + #ifndef __CONFIGS_OLIMEX_STM32_P107_SRC_H #define __CONFIGS_OLIMEX_STM32_P107_SRC_H @@ -84,5 +85,17 @@ void weak_function stm32_spidev_initialize(void); +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_OLIMEX_STM32_P107_SRC_H */ diff --git a/configs/compal_e88/src/boot.c b/configs/olimex-stm32-p107/src/stm32_appinit.c similarity index 77% rename from configs/compal_e88/src/boot.c rename to configs/olimex-stm32-p107/src/stm32_appinit.c index a3c68292275d6025a66a5b57c8981b34dcb7f413..af7736d2ca1ae6eb71050fd809f5e9e23a3a94b9 100644 --- a/configs/compal_e88/src/boot.c +++ b/configs/olimex-stm32-p107/src/stm32_appinit.c @@ -1,8 +1,8 @@ /**************************************************************************** - * configs/compal_e88/boot.c + * configs/olimex-stm32-p107/src/stm32_appinit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,8 +38,18 @@ ****************************************************************************/ #include + +#include +#include +#include + #include +#include "stm32.h" +#include "olimex-stm32-p107.h" + +#ifdef CONFIG_LIB_BOARDCTL + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -48,7 +58,14 @@ * Name: board_app_initialize * * Description: - * Perform architecture specific initialization + * Perform application specific initialization. This function is never + * called directly from application code, but only indirectly via the + * (non-standard) boardctl() interface using the command BOARDIOC_INIT. + * + * CONFIG_LIB_BOARDCTL=y: + * If CONFIG_NSH_ARCHINITIALIZE=y: + * Called from the NSH library (or other application) + * Otherse, assumed to be called from some other application. * * Input Parameters: * arg - The boardctl() argument is passed to the board_app_initialize() @@ -67,9 +84,22 @@ * ****************************************************************************/ -#ifdef CONFIG_LIB_BOARDCTL int board_app_initialize(uintptr_t arg) { - return 0; + int ret; + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); + return OK; } + #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/configs/olimex-stm32-p107/src/stm32_boot.c b/configs/olimex-stm32-p107/src/stm32_boot.c index c1ae4152a83bb0fa48bd69187af1f537a70fc070..090a45f1c51ba429ad478d8066cce9a5d7950d2c 100644 --- a/configs/olimex-stm32-p107/src/stm32_boot.c +++ b/configs/olimex-stm32-p107/src/stm32_boot.c @@ -44,14 +44,6 @@ #include "up_arch.h" #include "olimex-stm32-p107.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -78,5 +70,4 @@ void stm32_boardinitialize(void) stm32_spidev_initialize(); } #endif - } diff --git a/configs/olimex-stm32-p107/src/stm32_can.c b/configs/olimex-stm32-p107/src/stm32_can.c index 2687c08f9c3a6dc83567c0cc5b2d3e82b072722a..9889f836b2201de7fa4a2c2c4611c7d730ee4446 100644 --- a/configs/olimex-stm32-p107/src/stm32_can.c +++ b/configs/olimex-stm32-p107/src/stm32_can.c @@ -51,7 +51,7 @@ #include "stm32.h" #include "stm32_can.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -59,55 +59,57 @@ /* Configuration ********************************************************************/ /* The STM32F107VC supports CAN1 and CAN2 */ -#define CAN_PORT 1 +#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) +# warning "Both CAN1 and CAN2 are enabled. Only CAN1 is used." +# undef CONFIG_STM32_CAN2 +#endif + +#ifdef CONFIG_STM32_CAN1 +# define CAN_PORT 1 +#else +# define CAN_PORT 2 +#endif /************************************************************************************ * Public Functions ************************************************************************************/ -/************************************************************************************ - * Name: board_can_initialize +/**************************************************************************** + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-stm32-p207/nsh/defconfig b/configs/olimex-stm32-p207/nsh/defconfig index caa647b50d61dff9069d0c1833ac460f13a582db..5bb065a98b0a301b2aa2afc3ccb008321ab44caf 100644 --- a/configs/olimex-stm32-p207/nsh/defconfig +++ b/configs/olimex-stm32-p207/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -627,9 +625,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set -# CONFIG_BOARDCTL_CANINIT is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -836,10 +831,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -863,7 +857,6 @@ CONFIG_ETH0_PHY_KS8721=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -951,13 +944,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1211,19 +1202,6 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=1 # CONFIG_EXAMPLES_ADC_SWTRIG is not set -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=6 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=7 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="Button 0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CCTYPE is not set @@ -1263,7 +1241,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-stm32-p207/src/olimex-stm32-p207.h b/configs/olimex-stm32-p207/src/olimex-stm32-p207.h index 21f0d8ecfdd4eb45df0b08a9b5bc75c70fc935e3..04d7c558a3963001ba4c1409b7fc8abc8c9d6801 100644 --- a/configs/olimex-stm32-p207/src/olimex-stm32-p207.h +++ b/configs/olimex-stm32-p207/src/olimex-stm32-p207.h @@ -125,27 +125,27 @@ int stm32_usbhost_initialize(void); #endif /************************************************************************************ - * Name: stm32_adc_initialize + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ #ifdef CONFIG_ADC -int stm32_adc_initialize(void); +int stm32_adc_setup(void); #endif -/************************************************************************************ - * Name: stm32_can_initialize +/**************************************************************************** + * Name: stm32_can_setup * * Description: - * Called at application startup time to initialize the CAN functionality. + * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) -int stm32_can_initialize(void); +#ifdef CONFIG_CAN +int stm32_can_setup(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/configs/olimex-stm32-p207/src/stm32_adc.c b/configs/olimex-stm32-p207/src/stm32_adc.c index 75a451176ab39934306fd43b01d8213c083beec5..ef7858ccbbe3cb3d88f97d92b13940a9ae5b5659 100644 --- a/configs/olimex-stm32-p207/src/stm32_adc.c +++ b/configs/olimex-stm32-p207/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimex-stm32-p207/src/stm32_adc.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -97,37 +97,19 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN10}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ - -int board_adc_setup(void) -{ - return stm32_adc_initialize(); -} - -/************************************************************************************ - * Name: stm32_adc_initialize + * Name: stm32_adc_setup * * Description: - * Called at application startup time to initialize the ADC functionality. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int stm32_adc_initialize(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/olimex-stm32-p207/src/stm32_appinit.c b/configs/olimex-stm32-p207/src/stm32_appinit.c index fa3fce23f291384c345639fb32f22b4daf421734..fc22cc5affb294f6184930e2d315921e72550d14 100644 --- a/configs/olimex-stm32-p207/src/stm32_appinit.c +++ b/configs/olimex-stm32-p207/src/stm32_appinit.c @@ -132,27 +132,25 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || defined(CONFIG_ADC) int ret; -#endif -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) - /* Configure on-board CAN if CAN support has been selected. */ +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ - ret = stm32_can_initialize(); - if (ret != OK) + ret = stm32_can_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); } #endif #ifdef CONFIG_ADC - /* Configure on-board ADCs if ADC support has been selected. */ + /* Initialize ADC and register the ADC driver. */ - ret = stm32_adc_initialize(); - if (ret != OK) + ret = stm32_adc_setup(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret); + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); } #endif @@ -179,5 +177,6 @@ int board_app_initialize(uintptr_t arg) } #endif + UNUSED(ret); return OK; } diff --git a/configs/olimex-stm32-p207/src/stm32_can.c b/configs/olimex-stm32-p207/src/stm32_can.c index b05dcb244612b44081b930b944ccf5c3970f0b29..ab20e9fcb90a785a11fcce5dc240807f46f40861 100644 --- a/configs/olimex-stm32-p207/src/stm32_can.c +++ b/configs/olimex-stm32-p207/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimex-stm32-p207/src/stm32_can.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,13 +41,15 @@ #include #include + #include #include + #include "stm32.h" #include "stm32_can.h" #include "olimex-stm32-p207.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -70,61 +72,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) -{ - return stm32_can_initialize(); -} - -/**************************************************************************************************** - * Name: stm32_can_initialize - * - * Description: - * Called at application startup time to initialize the CAN functionality. - * - ****************************************************************************************************/ - -int stm32_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/compal_e86/Kconfig b/configs/olimex-stm32-p407/Kconfig similarity index 77% rename from configs/compal_e86/Kconfig rename to configs/olimex-stm32-p407/Kconfig index f72f3c094ce4c8f031445c514c343376e4e79e75..439485f15e39609a6acd69209c8ac1453d6b79a0 100644 --- a/configs/compal_e86/Kconfig +++ b/configs/olimex-stm32-p407/Kconfig @@ -2,3 +2,7 @@ # For a description of the syntax of this configuration file, # see the file kconfig-language.txt in the NuttX tools repository. # + +if ARCH_BOARD_OLIMEX_STM32P407 + +endif diff --git a/configs/olimex-stm32-p407/README.txt b/configs/olimex-stm32-p407/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..7ddf756213c61ba5df6d8990d85615989eb91a56 --- /dev/null +++ b/configs/olimex-stm32-p407/README.txt @@ -0,0 +1,45 @@ +README +====== + +The NuttX configuration for the Olimex STM32-P407 is derives more or less +directly from the Olimex STM32-P207 board support. The P207 and P407 seem +to share the same board design. Other code comes from the STM3240G board +support (which has the same crystal and clocking) and from the STM32 F4 +Discovery (which has the same STM32 part) + +Note that CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is enabled so +that the JTAG connection is not disconnected by the idle loop. + +The following peripherals are enabled in this configuration. + + - LEDs: show the sytem status + + - Buttons: TAMPER-button, WKUP-button, J1-Joystick (consists of RIGHT-, + UP-, LEFT-, DOWN-, and CENTER-button). Built in app + 'buttons' works. + + - ADC: ADC1 samples the red trim potentiometer AN_TR + Built in app 'adc' works. + + - USB-FS-OTG: enabled but not really tested, since there is only a + USB-A-connector (host) connected to the full speed µC inputs. + The other connector (device) is connected to the high speed µC + inputs, but it seems that NuttX has currently no driver + for it. + + - CAN: Built in app 'can' works, but apart from that not really tested. + + - Ethernet: Ping to other station on the network works. + +STATUS: + +2016-12-21: This board configuration was ported from the Olimex STM32 P207 + port. Note that none of the above features have been verified. USB, CAN, + ADC, and Ethernet are disabled in the base NSH configuration until they + can be verified. These features should be functional but may required + some tweaks due to the different clock configurations. The Olimex STM32 + P207 nsh/defconfig would be a good starting place for restoring these + feature configurations. + + CCM memory is not included in the heap (CONFIG_STM32_CCMEXCLUDE=y) because + it does no suport DMA, leaving only 128KiB for program usage. diff --git a/configs/olimex-stm32-p407/include/board.h b/configs/olimex-stm32-p407/include/board.h new file mode 100644 index 0000000000000000000000000000000000000000..6bc7e8b345e3cde5458cb442e107a2a3128dc583 --- /dev/null +++ b/configs/olimex-stm32-p407/include/board.h @@ -0,0 +1,315 @@ +/************************************************************************************ + * configs/olimex-stm32-p407/include/board.h + * + * Copyright (C) 2009, 2012, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __CONFIGS_OLIMEX_STM32_P407_INCLUDE_BOARD_H +#define __CONFIGS_OLIMEX_STM32_P407_INCLUDE_BOARD_H 1 + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#ifndef __ASSEMBLY__ +# include +#endif +#include "stm32_rcc.h" +#include "stm32.h" + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Clocking *************************************************************************/ + +/* HSI - 16 MHz RC factory-trimmed + * LSI - 32 KHz RC (30-60KHz, uncalibrated) + * HSE - On-board crystal frequency is 25MHz + * LSE - 32.768 kHz + */ + +#define STM32_BOARD_XTAL 25000000ul + +#define STM32_HSI_FREQUENCY 16000000ul +#define STM32_LSI_FREQUENCY 32000 +#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL +#define STM32_LSE_FREQUENCY 32768 + +/* Main PLL Configuration. + * + * PLL source is HSE + * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN + * = (25,000,000 / 25) * 336 + * = 336,000,000 + * SYSCLK = PLL_VCO / PLLP + * = 336,000,000 / 2 = 168,000,000 + * USB OTG FS, SDIO and RNG Clock + * = PLL_VCO / PLLQ + * = 48,000,000 + */ + +#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(25) +#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) +#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 +#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) + +#define STM32_SYSCLK_FREQUENCY 168000000ul + +/* AHB clock (HCLK) is SYSCLK (168MHz) */ + +#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ +#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY +#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ + +/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ + +#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ +#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) + +/* Timers driven from APB1 will be twice PCLK1 */ + +#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) +#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) + +/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ + +#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ +#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) + +/* Timers driven from APB2 will be twice PCLK2 */ + +#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) +#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) + +/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx + * otherwise frequency is 2xAPBx. + * Note: TIM1,8 are on APB2, others on APB1 + */ + +#define BOARD_TIM1_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM2_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM3_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM4_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM5_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM6_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM7_FREQUENCY STM32_HCLK_FREQUENCY +#define BOARD_TIM8_FREQUENCY STM32_HCLK_FREQUENCY + +/* SDIO dividers. Note that slower clocking is required when DMA is disabled + * in order to avoid RX overrun/TX underrun errors due to delayed responses + * to service FIFOs in interrupt driven mode. These values have not been + * tuned!!! + * + * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz + */ + +#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) + +/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz + * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz + */ + +#ifdef CONFIG_SDIO_DMA +# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) +#else +# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) +#endif + +/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz + * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz + */ + +#ifdef CONFIG_SDIO_DMA +# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) +#else +# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) +#endif + +/* LED definitions ******************************************************************/ +/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any + * way. The following definitions are used to access individual LEDs. + */ + +/* LED index values for use with board_userled() */ + +#define BOARD_LED1 0 +#define BOARD_LED2 1 +#define BOARD_LED3 2 +#define BOARD_LED4 3 +#define BOARD_NLEDS 4 + +#define BOARD_LED_GREEN1 BOARD_LED1 +#define BOARD_LED_YELLOW BOARD_LED2 +#define BOARD_LED_RED BOARD_LED3 +#define BOARD_LED_GREEN2 BOARD_LED4 + +/* LED bits for use with board_userled_all() */ + +#define BOARD_LED1_BIT (1 << BOARD_LED1) +#define BOARD_LED2_BIT (1 << BOARD_LED2) +#define BOARD_LED3_BIT (1 << BOARD_LED3) +#define BOARD_LED4_BIT (1 << BOARD_LED4) + +/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on board the + * Olimex STM32-P407. The following definitions describe how NuttX controls the LEDs: + */ + +#define LED_STARTED 0 /* LED1 */ +#define LED_HEAPALLOCATE 1 /* LED2 */ +#define LED_IRQSENABLED 2 /* LED1 + LED2 */ +#define LED_STACKCREATED 3 /* LED3 */ +#define LED_INIRQ 4 /* LED1 + LED3 */ +#define LED_SIGNAL 5 /* LED2 + LED3 */ +#define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ +#define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ + +/* Button definitions ***************************************************************/ +/* The Olimex STM32-P407 supports seven buttons: */ + +#define BUTTON_TAMPER 0 +#define BUTTON_WKUP 1 +#define BUTTON_RIGHT 2 +#define BUTTON_UP 3 +#define BUTTON_LEFT 4 +#define BUTTON_DOWN 5 +#define BUTTON_CENTER 6 + +#define NUM_BUTTONS 7 + +#define BUTTON_TAMPER_BIT (1 << BUTTON_TAMPER) +#define BUTTON_WKUP_BIT (1 << BUTTON_WKUP) +#define BUTTON_RIGHT_BIT (1 << BUTTON_RIGHT) +#define BUTTON_UP_BIT (1 << BUTTON_UP) +#define BUTTON_LEFT_BIT (1 << BUTTON_LEFT) +#define BUTTON_DOWN_BIT (1 << BUTTON_DOWN) +#define BUTTON_CENTER_BIT (1 << BUTTON_CENTER) + +/* Alternate function pin selections ************************************************/ + +/* USART3: */ + +#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ +#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ +#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ +#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ + +/* CAN: */ + +#define GPIO_CAN1_RX GPIO_CAN1_RX_2 /* PB8 */ +#define GPIO_CAN1_TX GPIO_CAN1_TX_2 /* PB9 */ + +/* Ethernet: + * + * - PA2 is ETH_MDIO + * - PC1 is ETH_MDC + * - PB5 is ETH_PPS_OUT - NC (not connected) + * - PA0 is ETH_MII_CRS - NC + * - PA3 is ETH_MII_COL - NC + * - PB10 is ETH_MII_RX_ER - NC + * - PB0 is ETH_MII_RXD2 - NC + * - PH7 is ETH_MII_RXD3 - NC + * - PC3 is ETH_MII_TX_CLK - NC + * - PC2 is ETH_MII_TXD2 - NC + * - PB8 is ETH_MII_TXD3 - NC + * - PA1 is ETH_MII_RX_CLK/ETH_RMII_REF_CLK + * - PA7 is ETH_MII_RX_DV/ETH_RMII_CRS_DV + * - PC4 is ETH_MII_RXD0/ETH_RMII_RXD0 + * - PC5 is ETH_MII_RXD1/ETH_RMII_RXD1 + * - PB11 is ETH_MII_TX_EN/ETH_RMII_TX_EN + * - PG13 is ETH_MII_TXD0/ETH_RMII_TXD0 + * - PG14 is ETH_MII_TXD1/ETH_RMII_TXD1 + */ + +#define GPIO_ETH_PPS_OUT GPIO_ETH_PPS_OUT_1 +#define GPIO_ETH_MII_CRS GPIO_ETH_MII_CRS_1 +#define GPIO_ETH_MII_COL GPIO_ETH_MII_COL_1 +#define GPIO_ETH_MII_RX_ER GPIO_ETH_MII_RX_ER_1 +#define GPIO_ETH_MII_RXD2 GPIO_ETH_MII_RXD2_1 +#define GPIO_ETH_MII_RXD3 GPIO_ETH_MII_RXD3_1 +#define GPIO_ETH_MII_TXD3 GPIO_ETH_MII_TXD3_1 +#define GPIO_ETH_MII_TX_EN GPIO_ETH_MII_TX_EN_2 +#define GPIO_ETH_MII_TXD0 GPIO_ETH_MII_TXD0_2 +#define GPIO_ETH_MII_TXD1 GPIO_ETH_MII_TXD1_2 +#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 +#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 +#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2 + +/************************************************************************************ + * Public Data + ************************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ +/************************************************************************************ + * Name: stm32_boardinitialize + * + * Description: + * All STM32 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void stm32_boardinitialize(void); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_OLIMEX_STM32_P407_INCLUDE_BOARD_H */ diff --git a/configs/stm3210e-eval/buttons/Make.defs b/configs/olimex-stm32-p407/nsh/Make.defs similarity index 96% rename from configs/stm3210e-eval/buttons/Make.defs rename to configs/olimex-stm32-p407/nsh/Make.defs index a0f63802978a2e38481918063882e5fbe574892b..d27844c30b2bb06a5533dbe3bbffd334ee18b101 100644 --- a/configs/stm3210e-eval/buttons/Make.defs +++ b/configs/olimex-stm32-p407/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/stm3210e-eval/buttons/Make.defs +# configs/olimex-stm32-p407/nsh/Make.defs # # Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -37,11 +37,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs -ifeq ($(CONFIG_STM32_DFU),y) - LDSCRIPT = ld.script.dfu -else - LDSCRIPT = ld.script -endif +LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains @@ -94,7 +90,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections LDNXFLATFLAGS = -e main -s 2048 ASMEXT = .S @@ -109,9 +105,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif - HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe HOSTLDFLAGS = - diff --git a/configs/hymini-stm32v/buttons/defconfig b/configs/olimex-stm32-p407/nsh/defconfig similarity index 77% rename from configs/hymini-stm32v/buttons/defconfig rename to configs/olimex-stm32-p407/nsh/defconfig index c314821a14b3c1885b462e056396ce7bb8a92dbe..21dacf69cea93577dcc3d8074ce2b5be680b894e 100644 --- a/configs/hymini-stm32v/buttons/defconfig +++ b/configs/olimex-stm32-p407/nsh/defconfig @@ -24,7 +24,7 @@ CONFIG_BUILD_FLAT=y # Binary Output Formats # # CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set +CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y # CONFIG_UBOOT_UIMAGE is not set @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -106,8 +106,8 @@ CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_ARM926EJS is not set # CONFIG_ARCH_ARM920T is not set # CONFIG_ARCH_CORTEXM0 is not set -CONFIG_ARCH_CORTEXM3=y -# CONFIG_ARCH_CORTEXM4 is not set +# CONFIG_ARCH_CORTEXM3 is not set +CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXM7 is not set # CONFIG_ARCH_CORTEXA5 is not set # CONFIG_ARCH_CORTEXA8 is not set @@ -126,8 +126,9 @@ CONFIG_ARM_TOOLCHAIN_GNU=y CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set # CONFIG_ARMV7M_LAZYFPU is not set -# CONFIG_ARCH_HAVE_FPU is not set +CONFIG_ARCH_HAVE_FPU=y # CONFIG_ARCH_HAVE_DPFPU is not set +CONFIG_ARCH_FPU=y # CONFIG_ARCH_HAVE_TRUSTZONE is not set CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARM_MPU is not set @@ -140,10 +141,11 @@ CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARMV7M_HAVE_ITCM is not set # CONFIG_ARMV7M_HAVE_DTCM is not set # CONFIG_ARMV7M_TOOLCHAIN_IARL is not set -# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y # CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set # CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set +# CONFIG_ARMV7M_OABI_TOOLCHAIN is not set CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARMV7M_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set @@ -198,7 +200,7 @@ CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARCH_CHIP_STM32F103RG is not set # CONFIG_ARCH_CHIP_STM32F103V8 is not set # CONFIG_ARCH_CHIP_STM32F103VB is not set -CONFIG_ARCH_CHIP_STM32F103VC=y +# CONFIG_ARCH_CHIP_STM32F103VC is not set # CONFIG_ARCH_CHIP_STM32F103VE is not set # CONFIG_ARCH_CHIP_STM32F103ZE is not set # CONFIG_ARCH_CHIP_STM32F105VB is not set @@ -254,7 +256,7 @@ CONFIG_ARCH_CHIP_STM32F103VC=y # CONFIG_ARCH_CHIP_STM32F407VE is not set # CONFIG_ARCH_CHIP_STM32F407VG is not set # CONFIG_ARCH_CHIP_STM32F407ZE is not set -# CONFIG_ARCH_CHIP_STM32F407ZG is not set +CONFIG_ARCH_CHIP_STM32F407ZG=y # CONFIG_ARCH_CHIP_STM32F407IE is not set # CONFIG_ARCH_CHIP_STM32F407IG is not set # CONFIG_ARCH_CHIP_STM32F427V is not set @@ -286,12 +288,12 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_FLASH_CONFIG_I is not set # CONFIG_STM32_STM32L15XX is not set # CONFIG_STM32_ENERGYLITE is not set -CONFIG_STM32_STM32F10XX=y +# CONFIG_STM32_STM32F10XX is not set # CONFIG_STM32_VALUELINE is not set # CONFIG_STM32_CONNECTIVITYLINE is not set -CONFIG_STM32_PERFORMANCELINE=y +# CONFIG_STM32_PERFORMANCELINE is not set # CONFIG_STM32_USBACCESSLINE is not set -CONFIG_STM32_HIGHDENSITY=y +# CONFIG_STM32_HIGHDENSITY is not set # CONFIG_STM32_MEDIUMDENSITY is not set # CONFIG_STM32_LOWDENSITY is not set # CONFIG_STM32_STM32F20XX is not set @@ -301,11 +303,11 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F302 is not set # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +CONFIG_STM32_STM32F40XX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set -# CONFIG_STM32_STM32F407 is not set +CONFIG_STM32_STM32F407=y # CONFIG_STM32_STM32F427 is not set # CONFIG_STM32_STM32F429 is not set # CONFIG_STM32_STM32F446 is not set @@ -315,31 +317,31 @@ CONFIG_STM32_HIGHDENSITY=y # # STM32 Peripheral Support # -# CONFIG_STM32_HAVE_CCM is not set -CONFIG_STM32_HAVE_USBDEV=y -# CONFIG_STM32_HAVE_OTGFS is not set +CONFIG_STM32_HAVE_CCM=y +# CONFIG_STM32_HAVE_USBDEV is not set +CONFIG_STM32_HAVE_OTGFS=y CONFIG_STM32_HAVE_FSMC=y # CONFIG_STM32_HAVE_LTDC is not set CONFIG_STM32_HAVE_USART3=y CONFIG_STM32_HAVE_UART4=y CONFIG_STM32_HAVE_UART5=y -# CONFIG_STM32_HAVE_USART6 is not set +CONFIG_STM32_HAVE_USART6=y # CONFIG_STM32_HAVE_UART7 is not set # CONFIG_STM32_HAVE_UART8 is not set CONFIG_STM32_HAVE_TIM1=y -# CONFIG_STM32_HAVE_TIM2 is not set +CONFIG_STM32_HAVE_TIM2=y CONFIG_STM32_HAVE_TIM3=y CONFIG_STM32_HAVE_TIM4=y CONFIG_STM32_HAVE_TIM5=y CONFIG_STM32_HAVE_TIM6=y CONFIG_STM32_HAVE_TIM7=y CONFIG_STM32_HAVE_TIM8=y -# CONFIG_STM32_HAVE_TIM9 is not set -# CONFIG_STM32_HAVE_TIM10 is not set -# CONFIG_STM32_HAVE_TIM11 is not set -# CONFIG_STM32_HAVE_TIM12 is not set -# CONFIG_STM32_HAVE_TIM13 is not set -# CONFIG_STM32_HAVE_TIM14 is not set +CONFIG_STM32_HAVE_TIM9=y +CONFIG_STM32_HAVE_TIM10=y +CONFIG_STM32_HAVE_TIM11=y +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y # CONFIG_STM32_HAVE_TIM15 is not set # CONFIG_STM32_HAVE_TIM16 is not set # CONFIG_STM32_HAVE_TIM17 is not set @@ -350,14 +352,20 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y -# CONFIG_STM32_HAVE_CAN2 is not set +CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y CONFIG_STM32_HAVE_DAC2=y -# CONFIG_STM32_HAVE_RNG is not set -# CONFIG_STM32_HAVE_ETHMAC is not set +CONFIG_STM32_HAVE_RNG=y +CONFIG_STM32_HAVE_ETHMAC=y CONFIG_STM32_HAVE_I2C2=y -# CONFIG_STM32_HAVE_I2C3 is not set +CONFIG_STM32_HAVE_I2C3=y CONFIG_STM32_HAVE_SPI2=y CONFIG_STM32_HAVE_SPI3=y # CONFIG_STM32_HAVE_SPI4 is not set @@ -368,21 +376,32 @@ CONFIG_STM32_HAVE_SPI3=y # CONFIG_STM32_ADC1 is not set # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set -# CONFIG_STM32_BKP is not set +# CONFIG_STM32_BKPSRAM is not set # CONFIG_STM32_CAN1 is not set +# CONFIG_STM32_CAN2 is not set +# CONFIG_STM32_CCMDATARAM is not set # CONFIG_STM32_CRC is not set +# CONFIG_STM32_CRYP is not set # CONFIG_STM32_DMA1 is not set # CONFIG_STM32_DMA2 is not set # CONFIG_STM32_DAC1 is not set # CONFIG_STM32_DAC2 is not set +# CONFIG_STM32_DCMI is not set +# CONFIG_STM32_ETHMAC is not set # CONFIG_STM32_FSMC is not set +# CONFIG_STM32_HASH is not set # CONFIG_STM32_I2C1 is not set # CONFIG_STM32_I2C2 is not set +# CONFIG_STM32_I2C3 is not set +# CONFIG_STM32_OTGFS is not set +# CONFIG_STM32_OTGHS is not set CONFIG_STM32_PWR=y +# CONFIG_STM32_RNG is not set # CONFIG_STM32_SDIO is not set # CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set +CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM1 is not set # CONFIG_STM32_TIM2 is not set # CONFIG_STM32_TIM3 is not set @@ -391,12 +410,18 @@ CONFIG_STM32_PWR=y # CONFIG_STM32_TIM6 is not set # CONFIG_STM32_TIM7 is not set # CONFIG_STM32_TIM8 is not set -CONFIG_STM32_USART1=y +# CONFIG_STM32_TIM9 is not set +# CONFIG_STM32_TIM10 is not set +# CONFIG_STM32_TIM11 is not set +# CONFIG_STM32_TIM12 is not set +# CONFIG_STM32_TIM13 is not set +# CONFIG_STM32_TIM14 is not set +# CONFIG_STM32_USART1 is not set # CONFIG_STM32_USART2 is not set -# CONFIG_STM32_USART3 is not set +CONFIG_STM32_USART3=y # CONFIG_STM32_UART4 is not set # CONFIG_STM32_UART5 is not set -# CONFIG_STM32_USB is not set +# CONFIG_STM32_USART6 is not set # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set # CONFIG_STM32_NOEXT_VECTORS is not set @@ -404,14 +429,15 @@ CONFIG_STM32_USART1=y # # Alternate Pin Mapping # -# CONFIG_STM32_USART1_REMAP is not set -CONFIG_STM32_JTAG_DISABLE=y +# CONFIG_STM32_FLASH_PREFETCH is not set +# CONFIG_STM32_JTAG_DISABLE is not set # CONFIG_STM32_JTAG_FULL_ENABLE is not set # CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set -# CONFIG_STM32_JTAG_SW_ENABLE is not set -# CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is not set +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_STM32_FORCEPOWER is not set # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set +CONFIG_STM32_CCMEXCLUDE=y # # Timer Configuration @@ -419,10 +445,17 @@ CONFIG_STM32_JTAG_DISABLE=y # CONFIG_STM32_ONESHOT is not set # CONFIG_STM32_FREERUN is not set # CONFIG_STM32_TIM1_CAP is not set +# CONFIG_STM32_TIM2_CAP is not set # CONFIG_STM32_TIM3_CAP is not set # CONFIG_STM32_TIM4_CAP is not set # CONFIG_STM32_TIM5_CAP is not set # CONFIG_STM32_TIM8_CAP is not set +# CONFIG_STM32_TIM9_CAP is not set +# CONFIG_STM32_TIM10_CAP is not set +# CONFIG_STM32_TIM11_CAP is not set +# CONFIG_STM32_TIM12_CAP is not set +# CONFIG_STM32_TIM13_CAP is not set +# CONFIG_STM32_TIM14_CAP is not set CONFIG_STM32_USART=y CONFIG_STM32_SERIALDRIVER=y @@ -433,9 +466,9 @@ CONFIG_STM32_SERIALDRIVER=y # # U[S]ART Device Configuration # -CONFIG_STM32_USART1_SERIALDRIVER=y -# CONFIG_STM32_USART1_1WIREDRIVER is not set -# CONFIG_USART1_RS485 is not set +CONFIG_STM32_USART3_SERIALDRIVER=y +# CONFIG_STM32_USART3_1WIREDRIVER is not set +# CONFIG_USART3_RS485 is not set # # Serial Driver Configuration @@ -444,7 +477,7 @@ CONFIG_STM32_USART1_SERIALDRIVER=y # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set # CONFIG_STM32_USART_SINGLEWIRE is not set -CONFIG_STM32_HAVE_RTC_COUNTER=y +# CONFIG_STM32_HAVE_RTC_COUNTER is not set # CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set # @@ -494,7 +527,7 @@ CONFIG_ARCH_HAVE_RAMVECTORS=y # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=5483 +CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set # @@ -518,16 +551,17 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x20000000 -CONFIG_RAM_SIZE=49152 +CONFIG_RAM_SIZE=131072 # CONFIG_ARCH_HAVE_SDRAM is not set # # Board Selection # -CONFIG_ARCH_BOARD_HYMINI_STM32V=y -# CONFIG_ARCH_BOARD_VIEWTOOL_STM32F107 is not set +# CONFIG_ARCH_BOARD_OLIMEX_STM32H407 is not set +# CONFIG_ARCH_BOARD_OLIMEX_STM32E407 is not set +CONFIG_ARCH_BOARD_OLIMEX_STM32P407=y # CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="hymini-stm32v" +CONFIG_ARCH_BOARD="olimex-stm32-p407" # # Common Board Options @@ -543,7 +577,12 @@ CONFIG_ARCH_IRQBUTTONS=y # Board-Specific Options # # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -565,20 +604,22 @@ CONFIG_USEC_PER_TICK=10000 # CONFIG_CLOCK_MONOTONIC is not set CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2011 -CONFIG_START_MONTH=7 -CONFIG_START_DAY=5 +CONFIG_START_YEAR=2013 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 +CONFIG_PREALLOC_WDOGS=8 +CONFIG_WDOG_INTRESERVE=1 CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y -CONFIG_USER_ENTRYPOINT="archbuttons_main" +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set CONFIG_TASK_NAME_SIZE=0 @@ -591,6 +632,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -613,7 +656,8 @@ CONFIG_NAME_MAX=32 # # RTOS hooks # -# CONFIG_BOARD_INITIALIZE is not set +CONFIG_BOARD_INITIALIZE=y +# CONFIG_BOARD_INITTHREAD is not set # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set @@ -642,7 +686,7 @@ CONFIG_SCHED_WORKQUEUE=y CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPERIOD=50000 -CONFIG_SCHED_HPWORKSTACKSIZE=1024 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -676,6 +720,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -719,7 +765,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -738,9 +783,9 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SCI0_SERIALDRIVER is not set # CONFIG_SCI1_SERIALDRIVER is not set # CONFIG_USART0_SERIALDRIVER is not set -CONFIG_USART1_SERIALDRIVER=y +# CONFIG_USART1_SERIALDRIVER is not set # CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set +CONFIG_USART3_SERIALDRIVER=y # CONFIG_USART4_SERIALDRIVER is not set # CONFIG_USART5_SERIALDRIVER is not set # CONFIG_USART6_SERIALDRIVER is not set @@ -753,22 +798,22 @@ CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y -CONFIG_USART1_SERIAL_CONSOLE=y +CONFIG_USART3_SERIAL_CONSOLE=y # CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set # -# USART1 Configuration +# USART3 Configuration # -CONFIG_USART1_RXBUFSIZE=256 -CONFIG_USART1_TXBUFSIZE=256 -CONFIG_USART1_BAUD=115200 -CONFIG_USART1_BITS=8 -CONFIG_USART1_PARITY=0 -CONFIG_USART1_2STOP=0 -# CONFIG_USART1_IFLOWCONTROL is not set -# CONFIG_USART1_OFLOWCONTROL is not set -# CONFIG_USART1_DMA is not set +CONFIG_USART3_RXBUFSIZE=256 +CONFIG_USART3_TXBUFSIZE=256 +CONFIG_USART3_BAUD=115200 +CONFIG_USART3_BITS=8 +CONFIG_USART3_PARITY=0 +CONFIG_USART3_2STOP=0 +# CONFIG_USART3_IFLOWCONTROL is not set +# CONFIG_USART3_OFLOWCONTROL is not set +# CONFIG_USART3_DMA is not set # CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -822,6 +867,7 @@ CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_ROMFS is not set # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set # CONFIG_FS_PROCFS is not set # CONFIG_FS_UNIONFS is not set @@ -850,9 +896,13 @@ CONFIG_MM_REGIONS=1 # # Binary Loader # -CONFIG_BINFMT_DISABLE=y +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +CONFIG_BUILTIN=y # CONFIG_PIC is not set -CONFIG_SYMTAB_ORDEREDBYNAME=y +# CONFIG_SYMTAB_ORDEREDBYNAME is not set # # Library Routines @@ -877,6 +927,7 @@ CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_LF is not set # CONFIG_EOL_IS_BOTH_CRLF is not set CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set @@ -889,6 +940,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -903,12 +956,24 @@ CONFIG_ARCH_HAVE_TLS=y # Basic CXX Support # # CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set # # Application Configuration # +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + # # CAN Utilities # @@ -916,27 +981,17 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="Key A" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Key B" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set @@ -946,7 +1001,8 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set +CONFIG_EXAMPLES_NSH=y +CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set @@ -961,18 +1017,19 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -1018,7 +1075,100 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # # NSH Library # -# CONFIG_NSH_LIBRARY is not set +CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set + +# +# Command Line Configuration +# +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=64 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=6 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_ADDROUTE is not set +# CONFIG_NSH_DISABLE_BASENAME is not set +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set +CONFIG_NSH_DISABLE_DATE=y +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set +# CONFIG_NSH_DISABLE_DIRNAME is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +CONFIG_NSH_DISABLE_GET=y +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +CONFIG_NSH_DISABLE_IFUPDOWN=y +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +CONFIG_NSH_DISABLE_LOSMART=y +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set +# CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y +# CONFIG_NSH_DISABLE_PS is not set +CONFIG_NSH_DISABLE_PUT=y +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNAME is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +CONFIG_NSH_DISABLE_WGET=y +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 + +# +# Configure Command Options +# +# CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y +CONFIG_NSH_FILEIOSIZE=512 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +# CONFIG_NSH_ARCHINIT is not set +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -1039,11 +1189,13 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set -# CONFIG_READLINE_HAVE_EXTMATCH is not set +CONFIG_READLINE_HAVE_EXTMATCH=y CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y +# CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set # CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set diff --git a/configs/lpcxpresso-lpc1115/minnsh/setenv.sh b/configs/olimex-stm32-p407/nsh/setenv.sh old mode 100755 new mode 100644 similarity index 76% rename from configs/lpcxpresso-lpc1115/minnsh/setenv.sh rename to configs/olimex-stm32-p407/nsh/setenv.sh index f47c395c1c7af2ca884c6fc1a0c23e3282bb3836..196f907e5e79d779b62b86d663e42a91752cd726 --- a/configs/lpcxpresso-lpc1115/minnsh/setenv.sh +++ b/configs/olimex-stm32-p407/nsh/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/lpcxpresso-lpc1115/minnsh/setenv.sh +# configs/olimex-stm32-p407/nsh/setenv.sh # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2009 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -32,14 +32,20 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi # This is the Cygwin path to the location where I installed the CodeSourcery # toolchain under windows. You will also have to edit this if you install @@ -56,11 +62,13 @@ export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 # You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/ #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/devkitARM/bin" -# This is the default install location for Code Red on Linux -# export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin" - -# This is the Cygwin path to the LPCXpresso 3.6 install location under Windows -#export TOOLCHAIN_BIN="/cygdrive/c/nxp/lpcxpresso_3.6/Tools/bin" +# These are the Cygwin paths to the locations where I installed the Atollic +# toolchain under windows. You will also have to edit this if you install +# the Atollic toolchain in any other location. /usr/bin is added before +# the Atollic bin path because there is are binaries named gcc.exe and g++.exe +# at those locations as well. +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" +#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" # This is the Cygwin path to the location where I build the buildroot # toolchain. diff --git a/configs/olimex-stm32-p407/scripts/ld.script b/configs/olimex-stm32-p407/scripts/ld.script new file mode 100644 index 0000000000000000000000000000000000000000..5132280a203c9032526d3dde8facf3af3c921f6e --- /dev/null +++ b/configs/olimex-stm32-p407/scripts/ld.script @@ -0,0 +1,121 @@ +/**************************************************************************** + * configs/olimex-stm32-p407/scripts/ld.script + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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. + * + ****************************************************************************/ + +/* The STM32F407VG has 1024Kb of FLASH beginning at address 0x0800:0000 and + * 192Kb of SRAM. SRAM is split up into three blocks: + * + * 1) 112Kb of SRAM beginning at address 0x2000:0000 + * 2) 16Kb of SRAM beginning at address 0x2001:c000 + * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 + * + * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 + * where the code expects to begin execution by jumping to the entry point in + * the 0x0800:0000 address range. + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K +} + +OUTPUT_ARCH(arm) +ENTRY(_stext) +SECTIONS +{ + .text : { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > flash + + .init_section : { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > flash + + .ARM.extab : { + *(.ARM.extab*) + } > flash + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } > flash + __exidx_end = ABSOLUTE(.); + + _eronly = ABSOLUTE(.); + + .data : { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/configs/compal_e88/src/Makefile b/configs/olimex-stm32-p407/src/Makefile similarity index 77% rename from configs/compal_e88/src/Makefile rename to configs/olimex-stm32-p407/src/Makefile index e4703f9a0a835bd1f45ef308f5627b619820033d..fa543389eb4d9a06c50e186dcb527dc94eca8fda 100644 --- a/configs/compal_e88/src/Makefile +++ b/configs/olimex-stm32-p407/src/Makefile @@ -1,12 +1,9 @@ ############################################################################ -# configs/compal_e88/src/Makefile +# configs/olimex-stm32-p407/src/Makefile # -# Copyright (C) 2007, 2008, 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # -# Copyright (C) 2011 Stefan Richter. All rights reserved. -# Author: Stefan Richter -# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -39,6 +36,32 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = boot.c +CSRCS = stm32_boot.c stm32_bringup.c + +ifeq ($(CONFIG_ARCH_LEDS),y) +CSRCS += stm32_autoleds.c +else +CSRCS += stm32_userleds.c +endif + +ifeq ($(CONFIG_ARCH_BUTTONS),y) +CSRCS += stm32_buttons.c +endif + +ifeq ($(CONFIG_STM32_OTGFS),y) +CSRCS += stm32_usb.c +endif + +ifeq ($(CONFIG_LIB_BOARDCTL),y) +CSRCS += stm32_appinit.c +endif + +ifeq ($(CONFIG_ADC),y) +CSRCS += stm32_adc.c +endif + +ifeq ($(CONFIG_CAN),y) +CSRCS += stm32_can.c +endif include $(TOPDIR)/configs/Board.mk diff --git a/configs/olimex-stm32-p407/src/olimex-stm32-p407.h b/configs/olimex-stm32-p407/src/olimex-stm32-p407.h new file mode 100644 index 0000000000000000000000000000000000000000..3ba7d536acccae2cc5462e493b83d0440473d2f3 --- /dev/null +++ b/configs/olimex-stm32-p407/src/olimex-stm32-p407.h @@ -0,0 +1,207 @@ +/**************************************************************************** + * configs/olimex-stm32-p107/src/olimex-stm32-p407.h + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Derives from a file of a similar name for the Olimex STM32 P207: + * + * Copyright (C) 2013 Max Holtzberg. All rights reserved. + * Author: Max Holtzberg + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __CONFIGS_OLIMEX_STM32_P407_SRC_H +#define __CONFIGS_OLIMEX_STM32_P407_SRC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Configuration ************************************************************/ + +#define HAVE_USBDEV 1 +#define HAVE_USBHOST 1 +#define HAVE_USBMONITOR 1 + +/* Can't support USB host or device features if USB OTG FS is not enabled */ + +#ifndef CONFIG_STM32_OTGFS +# undef HAVE_USBDEV +# undef HAVE_USBHOST +# undef HAVE_USBMONITOR +#endif + +/* Can't support USB device monitor if USB device is not enabled */ + +#ifndef CONFIG_USBDEV +# undef HAVE_USBDEV +# undef HAVE_USBMONITOR +#endif + +/* Can't support USB host is USB host is not enabled */ + +#ifndef CONFIG_USBHOST +# undef HAVE_USBHOST +#endif + +/* Check if we should enable the USB monitor before starting NSH */ + +#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR) +# undef HAVE_USBMONITOR +#endif + + +/* Olimex-STM32-P407 GPIOs **************************************************/ +/* LEDs */ + +#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN6) +#define GPIO_LED2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN7) +#define GPIO_LED3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN8) +#define GPIO_LED4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9) + +/* BUTTONS -- NOTE that all have EXTI interrupts configured */ + +#define MIN_IRQBUTTON BUTTON_TAMPER +#define MAX_IRQBUTTON BUTTON_CENTER +#define NUM_IRQBUTTONS 7 + +#define GPIO_BTN_TAMPER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTC|GPIO_PIN13) +#define GPIO_BTN_WKUP (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTA|GPIO_PIN0) +#define GPIO_BTN_RIGHT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN6) +#define GPIO_BTN_UP (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN7) +#define GPIO_BTN_LEFT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN11) +#define GPIO_BTN_DOWN (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN8) +#define GPIO_BTN_CENTER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN15) + +/* USB OTG FS + * + * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) + * PC2 OTG_FS_PowerSwitchOn + * PB10 OTG_FS_Overcurrent + */ + +#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN9) +#define GPIO_OTGFS_PWRON (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN2) + +#ifdef CONFIG_USBHOST +# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN10) + +#else +# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTB|GPIO_PIN10) +#endif + +#ifndef __ASSEMBLY__ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_bringup + * + * Description: + * Perform architecture-specific initialization + * + * CONFIG_BOARD_INITIALIZE=y : + * Called from board_initialize(). + * + * CONFIG_BOARD_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y : + * Called from the NSH library + * + ************************************************************************************/ + +int stm32_bringup(void); + +/************************************************************************************ + * Name: stm32_usb_configure + * + * Description: + * Called from stm32_boardinitialize very early in inialization to setup USB-related + * GPIO pins for the STM32F4Discovery board. + * + ************************************************************************************/ + +#ifdef CONFIG_STM32_OTGFS +void weak_function stm32_usb_configure(void); +#endif + +/************************************************************************************ + * Name: stm32_usbhost_setup + * + * Description: + * Called at application startup time to initialize the USB host functionality. + * This function will start a thread that will monitor for device connection/ + * disconnection events. + * + ************************************************************************************/ + +#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST) +int stm32_usbhost_setup(void); +#endif + +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_OLIMEX_STM32_P407_SRC_H */ diff --git a/configs/olimex-stm32-p407/src/stm32_adc.c b/configs/olimex-stm32-p407/src/stm32_adc.c new file mode 100644 index 0000000000000000000000000000000000000000..ec5af2576fa83f483e2445c72259adf197046c8b --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_adc.c @@ -0,0 +1,161 @@ +/************************************************************************************ + * configs/olimex-stm32-p407/src/stm32_adc.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include + +#include +#include +#include + +#include "chip.h" +#include "stm32_adc.h" +#include "olimex-stm32-p407.h" + +#ifdef CONFIG_ADC + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Configuration ********************************************************************/ +/* Up to 3 ADC interfaces are supported */ + +#if STM32_NADC < 3 +# undef CONFIG_STM32_ADC3 +#endif + +#if STM32_NADC < 2 +# undef CONFIG_STM32_ADC2 +#endif + +#if STM32_NADC < 1 +# undef CONFIG_STM32_ADC1 +#endif + +#if defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2) || defined(CONFIG_STM32_ADC3) +#ifndef CONFIG_STM32_ADC1 +# warning "Channel information only available for ADC1" +#endif + +/* The number of ADC channels in the conversion list */ + +#define ADC1_NCHANNELS 1 + +/************************************************************************************ + * Private Data + ************************************************************************************/ +/* The Olimex STM32-P407 has a 10 Kohm potentiometer AN_TR connected to PC0 + * ADC123_IN10 + */ + +/* Identifying number of each ADC channel: Variable Resistor. */ + +#ifdef CONFIG_STM32_ADC1 +static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; + +/* Configurations of pins used byte each ADC channels */ + +static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN10}; +#endif + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +int stm32_adc_setup(void) +{ +#ifdef CONFIG_STM32_ADC1 + static bool initialized = false; + struct adc_dev_s *adc; + int ret; + int i; + + /* Check if we have already initialized */ + + if (!initialized) + { + /* Configure the pins as analog inputs for the selected channels */ + + for (i = 0; i < ADC1_NCHANNELS; i++) + { + stm32_configgpio(g_pinlist[i]); + } + + /* Call stm32_adcinitialize() to get an instance of the ADC interface */ + + adc = stm32_adcinitialize(1, g_chanlist, ADC1_NCHANNELS); + if (adc == NULL) + { + aerr("ERROR: Failed to get ADC interface\n"); + return -ENODEV; + } + + /* Register the ADC driver at "/dev/adc0" */ + + ret = adc_register("/dev/adc0", adc); + if (ret < 0) + { + aerr("ERROR: adc_register failed: %d\n", ret); + return ret; + } + + /* Now we are initialized */ + + initialized = true; + } + + return OK; +#else + return -ENOSYS; +#endif +} + +#endif /* CONFIG_STM32_ADC1 || CONFIG_STM32_ADC2 || CONFIG_STM32_ADC3 */ +#endif /* CONFIG_ADC */ diff --git a/configs/compal_e99/src/boot.c b/configs/olimex-stm32-p407/src/stm32_appinit.c similarity index 80% rename from configs/compal_e99/src/boot.c rename to configs/olimex-stm32-p407/src/stm32_appinit.c index 8bc7061daf3806c20430c0b39bb69dca26569202..a0a6d02d0f10030fe772fde348b512d3f79104a7 100644 --- a/configs/compal_e99/src/boot.c +++ b/configs/olimex-stm32-p407/src/stm32_appinit.c @@ -1,8 +1,8 @@ /**************************************************************************** - * configs/compal_e99/boot.c + * config/olimex-stm32-p407/src/stm32_appinit.c * - * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,8 +38,16 @@ ****************************************************************************/ #include + +#include +#include + #include +#include "olimex-stm32-p407.h" + +#ifdef CONFIG_LIB_BOARDCTL + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -48,7 +56,16 @@ * Name: board_app_initialize * * Description: - * Perform architecture specific initialization + * Perform application specific initialization. This function is never + * called directly from application code, but only indirectly via the + * (non-standard) boardctl() interface using the command BOARDIOC_INIT. + * + * CONFIG_LIB_BOARDCTL=y : + * Called from the NSH library + * + * CONFIG_BOARD_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, && + * CONFIG_LIB_BOARDCTL=n : + * Called from board_initialize(). * * Input Parameters: * arg - The boardctl() argument is passed to the board_app_initialize() @@ -67,9 +84,15 @@ * ****************************************************************************/ -#ifdef CONFIG_LIB_BOARDCTL int board_app_initialize(uintptr_t arg) { - return 0; + /* Did we already initialize via board_initialize()? */ + +#ifndef CONFIG_BOARD_INITIALIZE + return stm32_bringup(); +#else + return OK; +#endif } + #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/configs/olimex-stm32-p407/src/stm32_autoleds.c b/configs/olimex-stm32-p407/src/stm32_autoleds.c new file mode 100644 index 0000000000000000000000000000000000000000..200c827012f5572abe6f11c39bd6c8c37fd1ce87 --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_autoleds.c @@ -0,0 +1,172 @@ +/**************************************************************************** + * configs/olimex-stm32-p407/src/stm32_autoleds.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include + +#include +#include + +#include "stm32.h" +#include "olimex-stm32-p407.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* The following definitions map the encoded LED setting to GPIO settings */ + +#define LED_STARTED_BITS (BOARD_LED1_BIT) +#define LED_HEAPALLOCATE_BITS (BOARD_LED2_BIT) +#define LED_IRQSENABLED_BITS (BOARD_LED1_BIT | BOARD_LED2_BIT) +#define LED_STACKCREATED_BITS (BOARD_LED3_BIT) +#define LED_INIRQ_BITS (BOARD_LED1_BIT | BOARD_LED3_BIT) +#define LED_SIGNAL_BITS (BOARD_LED2_BIT | BOARD_LED3_BIT) +#define LED_ASSERTION_BITS (BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT) +#define LED_PANIC_BITS (BOARD_LED4_BIT) + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const unsigned int g_ledbits[8] = +{ + LED_STARTED_BITS, + LED_HEAPALLOCATE_BITS, + LED_IRQSENABLED_BITS, + LED_STACKCREATED_BITS, + LED_INIRQ_BITS, + LED_SIGNAL_BITS, + LED_ASSERTION_BITS, + LED_PANIC_BITS +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static inline void led_clrbits(unsigned int clrbits) +{ + if ((clrbits & BOARD_LED1_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED1, false); + } + + if ((clrbits & BOARD_LED2_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED2, false); + } + + if ((clrbits & BOARD_LED3_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED3, false); + } + + if ((clrbits & BOARD_LED4_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED4, false); + } +} + +static inline void led_setbits(unsigned int setbits) +{ + if ((setbits & BOARD_LED1_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED1, true); + } + + if ((setbits & BOARD_LED2_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED2, true); + } + + if ((setbits & BOARD_LED3_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED3, true); + } + + if ((setbits & BOARD_LED4_BIT) != 0) + { + stm32_gpiowrite(GPIO_LED4, true); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_autoled_initialize + ****************************************************************************/ + +void board_autoled_initialize(void) +{ + /* Configure LED1-4 GPIOs for output */ + + stm32_configgpio(GPIO_LED1); + stm32_configgpio(GPIO_LED2); + stm32_configgpio(GPIO_LED3); + stm32_configgpio(GPIO_LED4); +} + +/**************************************************************************** + * Name: board_autoled_on + ****************************************************************************/ + +void board_autoled_on(int led) +{ + led_clrbits(BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT | BOARD_LED4_BIT); + led_setbits(g_ledbits[led]); +} + +/**************************************************************************** + * Name: board_autoled_off + ****************************************************************************/ + +void board_autoled_off(int led) +{ + led_clrbits(g_ledbits[led]); +} + +#endif /* CONFIG_ARCH_LEDS */ diff --git a/configs/olimex-stm32-p407/src/stm32_boot.c b/configs/olimex-stm32-p407/src/stm32_boot.c new file mode 100644 index 0000000000000000000000000000000000000000..220455fef015f5b5f57d257a0a4c2686b5b74b8b --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_boot.c @@ -0,0 +1,112 @@ +/************************************************************************************ + * configs/olimex-stm32-p407/src/stm32_boot.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include + +#include +#include +#include + +#include "olimex-stm32-p407.h" + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_boardinitialize + * + * Description: + * All STM32 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void stm32_boardinitialize(void) +{ + /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) + * disabled, and 3) the weak function stm32_usb_configure() has been brought + * into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also + * selected. + */ + +#ifdef CONFIG_STM32_OTGFS + if (stm32_usb_configure) + { + stm32_usb_configure(); + } +#endif + + /* Configure on-board LEDs if LED support has been selected. */ + +#ifdef CONFIG_ARCH_LEDS + board_autoled_initialize(); +#endif + + /* Configure on-board BUTTONs if BUTTON support has been selected. */ + +#ifdef CONFIG_ARCH_BUTTONS + board_button_initialize(); +#endif +} + +/**************************************************************************** + * Name: board_initialize + * + * Description: + * If CONFIG_BOARD_INITIALIZE is selected, then an additional + * initialization call will be performed in the boot-up sequence to a + * function called board_initialize(). board_initialize() will be + * called immediately after up_initialize() is called and just before the + * initial application is started. This additional initialization phase + * may be used, for example, to initialize board-specific device drivers. + * + ****************************************************************************/ + +#ifdef CONFIG_BOARD_INITIALIZE +void board_initialize(void) +{ + /* Perform board-specific initialization here if so configured */ + + (void)stm32_bringup(); +} +#endif diff --git a/configs/olimex-stm32-p407/src/stm32_bringup.c b/configs/olimex-stm32-p407/src/stm32_bringup.c new file mode 100644 index 0000000000000000000000000000000000000000..3e626b6cddf47655d9bae5f5e230ab067d5b6fa5 --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_bringup.c @@ -0,0 +1,138 @@ +/**************************************************************************** + * config/olimex-stm32-p407/src/stm32_bringup.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include + +#include + +#ifdef CONFIG_USBMONITOR +# include +#endif + +#ifdef CONFIG_STM32_OTGFS +# include "stm32_usbhost.h" +#endif + +#include "stm32.h" +#include "olimex-stm32-p407.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: stm32_bringup + * + * Description: + * Perform architecture-specific initialization + * + * CONFIG_BOARD_INITIALIZE=y : + * Called from board_initialize(). + * + * CONFIG_BOARD_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : + * Called from the NSH library + * + ****************************************************************************/ + +int stm32_bringup(void) +{ + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef HAVE_USBHOST + /* Initialize USB host operation. stm32_usbhost_setup() starts a thread + * will monitor for USB connection and disconnection events. + */ + + ret = stm32_usbhost_setup(); + if (ret != OK) + { + syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); + return ret; + } +#endif + +#ifdef HAVE_USBMONITOR + /* Start the USB Monitor */ + + ret = usbmonitor_start(); + if (ret != OK) + { + syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret); + } +#endif + + UNUSED(ret); + return OK; +} diff --git a/configs/olimex-stm32-p407/src/stm32_buttons.c b/configs/olimex-stm32-p407/src/stm32_buttons.c new file mode 100644 index 0000000000000000000000000000000000000000..94580ec5a1c992b097e7892ab9f554fc5501d362 --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_buttons.c @@ -0,0 +1,194 @@ +/**************************************************************************** + * configs/olimex-stm32-p407/src/stm32_buttons.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include + +#include +#include +#include + +#include "olimex-stm32-p407.h" + +#ifdef CONFIG_ARCH_BUTTONS + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/* Pin configuration for each STM32F4 Discovery button. This array is indexed by + * the BUTTON_* definitions in board.h + */ + +static const uint32_t g_buttons[NUM_BUTTONS] = +{ + GPIO_BTN_TAMPER, + GPIO_BTN_WKUP, + GPIO_BTN_RIGHT, + GPIO_BTN_UP, + GPIO_BTN_LEFT, + GPIO_BTN_DOWN, + GPIO_BTN_CENTER +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_button_initialize + * + * Description: + * board_button_initialize() must be called to initialize button resources. After + * that, board_buttons() may be called to collect the current state of all + * buttons or board_button_irq() may be called to register button interrupt + * handlers. + * + ****************************************************************************/ + +void board_button_initialize(void) +{ + int i; + + /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are + * configured for all pins. + */ + + for (i = 0; i < NUM_BUTTONS; i++) + { + stm32_configgpio(g_buttons[i]); + } +} + +/**************************************************************************** + * Name: board_buttons + ****************************************************************************/ + +uint8_t board_buttons(void) +{ + uint8_t ret = 0; + + /* Check that state of each key */ + + if (!stm32_gpioread(g_buttons[BUTTON_TAMPER])) + { + ret |= BUTTON_TAMPER_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_WKUP])) + { + ret |= BUTTON_WKUP_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_RIGHT])) + { + ret |= BUTTON_RIGHT_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_UP])) + { + ret |= BUTTON_UP_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_LEFT])) + { + ret |= BUTTON_LEFT_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_DOWN])) + { + ret |= BUTTON_DOWN_BIT; + } + + if (stm32_gpioread(g_buttons[BUTTON_CENTER])) + { + ret |= BUTTON_CENTER_BIT; + } + + return ret; +} + +/************************************************************************************ + * Button support. + * + * Description: + * board_button_initialize() must be called to initialize button resources. After + * that, board_buttons() may be called to collect the current state of all + * buttons or board_button_irq() may be called to register button interrupt + * handlers. + * + * After board_button_initialize() has been called, board_buttons() may be called to + * collect the state of all buttons. board_buttons() returns an 8-bit bit set + * with each bit associated with a button. See the BUTTON_*_BIT + * definitions in board.h for the meaning of each bit. + * + * board_button_irq() may be called to register an interrupt handler that will + * be called when a button is depressed or released. The ID value is a + * button enumeration value that uniquely identifies a button resource. See the + * BUTTON_* definitions in board.h for the meaning of enumeration + * value. The previous interrupt handler address is returned (so that it may + * restored, if so desired). + * + ************************************************************************************/ + +#ifdef CONFIG_ARCH_IRQBUTTONS +xcpt_t board_button_irq(int id, xcpt_t irqhandler) +{ + xcpt_t oldhandler = NULL; + + /* The following should be atomic */ + + if (id >= MIN_IRQBUTTON && id <= MAX_IRQBUTTON) + { + oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler); + } + + return oldhandler; +} +#endif +#endif /* CONFIG_ARCH_BUTTONS */ diff --git a/arch/arm/src/calypso/calypso_heap.c b/configs/olimex-stm32-p407/src/stm32_can.c similarity index 57% rename from arch/arm/src/calypso/calypso_heap.c rename to configs/olimex-stm32-p407/src/stm32_can.c index 697e05a8f5e39e1ac8b8f5f9ce9f074464e2e242..763df54e78a708af4b9b71e3a342a3cb5edd0c40 100644 --- a/arch/arm/src/calypso/calypso_heap.c +++ b/configs/olimex-stm32-p407/src/stm32_can.c @@ -1,12 +1,8 @@ -/**************************************************************************** - * arch/arm/src/calypso/calypso_heap.c - * Initialize memory interfaces of Calypso MCU +/************************************************************************************ + * configs/olimex-stm32-p407/src/stm32_can.c * - * (C) 2010 by Harald Welte - * (C) 2011 Stefan Richter - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,67 +31,82 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ****************************************************************************/ + ************************************************************************************/ -/**************************************************************************** +/************************************************************************************ * Included Files - ****************************************************************************/ + ************************************************************************************/ #include -#include -#include +#include #include -#include +#include #include -#include -#include +#include "stm32.h" +#include "stm32_can.h" +#include "olimex-stm32-p407.h" -#include "up_arch.h" -#include "up_internal.h" +#ifdef CONFIG_CAN -/**************************************************************************** +/************************************************************************************ * Pre-processor Definitions - ****************************************************************************/ + ************************************************************************************/ +/* Configuration ********************************************************************/ + +#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) +# warning "Both CAN1 and CAN2 are enabled. Only CAN1 is connected." +# undef CONFIG_STM32_CAN2 +#endif -/**************************************************************************** +#ifdef CONFIG_STM32_CAN1 +# define CAN_PORT 1 +#else +# define CAN_PORT 2 +#endif + +/************************************************************************************ * Public Functions - ****************************************************************************/ + ************************************************************************************/ -/**************************************************************************** - * Name: up_addregion +/************************************************************************************ + * Name: stm32_can_setup * * Description: - * This function is called right after basics are initialized and right - * before IRQ system setup. + * Initialize CAN and register the CAN device * - ****************************************************************************/ + ************************************************************************************/ -#if CONFIG_MM_REGIONS > 1 -void up_addregion(void) +int stm32_can_setup(void) { -#ifdef CONFIG_ARCH_BOARD_COMPALE99 - /* Disable watchdog in first non-common function */ - wdog_enable(0); +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) + struct can_dev_s *can; + int ret; + + /* Call stm32_caninitialize() to get an instance of the CAN interface */ + + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) + { + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } + + /* Register the CAN driver at "/dev/can0" */ + + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; + } + + return OK; +#else + return -ENODEV; #endif - /* XXX: change to initialization of extern memory with save defaults */ - /* Configure memory interface */ - calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1); - calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1); - calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0); - - /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */ - calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2); - - /* Configure the RHEA bridge with some sane default values */ - calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0); - - kmm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); } -#endif + +#endif /* CONFIG_CAN */ diff --git a/configs/olimex-stm32-p407/src/stm32_usb.c b/configs/olimex-stm32-p407/src/stm32_usb.c new file mode 100644 index 0000000000000000000000000000000000000000..e6340dcc50f8caafead7732b04ee0d9e5af8a988 --- /dev/null +++ b/configs/olimex-stm32-p407/src/stm32_usb.c @@ -0,0 +1,318 @@ +/************************************************************************************ + * configs/olimex-stm32-p407/src/stm32_usb.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "stm32.h" +#include "stm32_otgfs.h" +#include "olimex-stm32-p407.h" + +#ifdef CONFIG_STM32_OTGFS + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +#if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST) +# define HAVE_USB 1 +#else +# warning "CONFIG_STM32_OTGFS is enabled but neither CONFIG_USBDEV nor CONFIG_USBHOST" +# undef HAVE_USB +#endif + +#ifndef CONFIG_USBHOST_DEFPRIO +# define CONFIG_USBHOST_DEFPRIO 50 +#endif + +#ifndef CONFIG_USBHOST_STACKSIZE +# ifdef CONFIG_USBHOST_HUB +# define CONFIG_USBHOST_STACKSIZE 1536 +# else +# define CONFIG_USBHOST_STACKSIZE 1024 +# endif +#endif + +/************************************************************************************ + * Private Data + ************************************************************************************/ + +#ifdef CONFIG_USBHOST +static struct usbhost_connection_s *g_usbconn; +#endif + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: usbhost_waiter + * + * Description: + * Wait for USB devices to be connected. + * + ************************************************************************************/ + +#ifdef CONFIG_USBHOST +static int usbhost_waiter(int argc, char *argv[]) +{ + struct usbhost_hubport_s *hport; + + uinfo("Running\n"); + for (;;) + { + /* Wait for the device to change state */ + + DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport)); + uinfo("%s\n", hport->connected ? "connected" : "disconnected"); + + /* Did we just become connected? */ + + if (hport->connected) + { + /* Yes.. enumerate the newly connected device */ + + (void)CONN_ENUMERATE(g_usbconn, hport); + } + } + + /* Keep the compiler from complaining */ + + return 0; +} +#endif + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_usbdev_setup + * + * Description: + * Called from stm32_usbdev_setup very early in inialization to setup USB-related + * GPIO pins for the STM32F4Discovery board. + * + ************************************************************************************/ + +void stm32_usbdev_setup(void) +{ + /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ + + /* Configure the OTG FS VBUS sensing GPIO, and Power On GPIOs */ + +#ifdef CONFIG_STM32_OTGFS + stm32_configgpio(GPIO_OTGFS_VBUS); + stm32_configgpio(GPIO_OTGFS_PWRON); + stm32_configgpio(GPIO_OTGFS_OVER); +#endif +} + +/*********************************************************************************** + * Name: stm32_usbhost_setup + * + * Description: + * Called at application startup time to initialize the USB host functionality. + * This function will start a thread that will monitor for device + * connection/disconnection events. + * + ***********************************************************************************/ + +#ifdef CONFIG_USBHOST +int stm32_usbhost_setup(void) +{ + int pid; +#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || defined(CONFIG_USBHOST_CDCACM) + int ret; +#endif + + /* First, register all of the class drivers needed to support the drivers + * that we care about: + */ + + uinfo("Register class drivers\n"); + +#ifdef CONFIG_USBHOST_HUB + /* Initialize USB hub class support */ + + ret = usbhost_hub_initialize(); + if (ret < 0) + { + uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_USBHOST_MSC + /* Register the USB host Mass Storage Class */ + + ret = usbhost_msc_initialize(); + if (ret != OK) + { + uerr("ERROR: Failed to register the mass storage class: %d\n", ret); + } +#endif + +#ifdef CONFIG_USBHOST_CDCACM + /* Register the CDC/ACM serial class */ + + ret = usbhost_cdcacm_initialize(); + if (ret != OK) + { + uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + } +#endif + + /* Then get an instance of the USB host interface */ + + uinfo("Initialize USB host\n"); + g_usbconn = stm32_otgfshost_initialize(0); + if (g_usbconn) + { + /* Start a thread to handle device connection. */ + + uinfo("Start usbhost_waiter\n"); + + pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, + CONFIG_USBHOST_STACKSIZE, + (main_t)usbhost_waiter, (FAR char * const *)NULL); + return pid < 0 ? -ENOEXEC : OK; + } + + return -ENODEV; +} +#endif + +/************************************************************************************ + * Name: stm32_setup_overcurrent + * + * Description: + * Setup to receive an interrupt-level callback if an overcurrent condition is + * detected. + * + * Input Parameter: + * handler - New overcurrent interrupt handler + * + * Returned value: + * Old overcurrent interrupt handler + * + ************************************************************************************/ + +#ifdef CONFIG_USBHOST +xcpt_t stm32_setup_overcurrent(xcpt_t handler) +{ + return stm32_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler); +} +#endif + +/*********************************************************************************** + * Name: stm32_usbhost_vbusdrive + * + * Description: + * Enable/disable driving of VBUS 5V output. This function must be provided be + * each platform that implements the STM32 OTG FS host interface + * + * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump + * or, if 5 V are available on the application board, a basic power switch, must + * be added externally to drive the 5 V VBUS line. The external charge pump can + * be driven by any GPIO output. When the application decides to power on VBUS + * using the chosen GPIO, it must also set the port power bit in the host port + * control and status register (PPWR bit in OTG_FS_HPRT). + * + * "The application uses this field to control power to this port, and the core + * clears this bit on an overcurrent condition." + * + * Input Parameters: + * iface - For future growth to handle multiple USB host interface. Should be zero. + * enable - true: enable VBUS power; false: disable VBUS power + * + * Returned Value: + * None + * + ***********************************************************************************/ + +#ifdef CONFIG_USBHOST +void stm32_usbhost_vbusdrive(int iface, bool enable) +{ + DEBUGASSERT(iface == 0); + + if (enable) + { + /* Enable the Power Switch by driving the enable pin low */ + + stm32_gpiowrite(GPIO_OTGFS_PWRON, false); + } + else + { + /* Disable the Power Switch by driving the enable pin high */ + + stm32_gpiowrite(GPIO_OTGFS_PWRON, true); + } +} +#endif + +/************************************************************************************ + * Name: stm32_usbsuspend + * + * Description: + * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is + * used. This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, etc. + * while the USB is suspended. + * + ************************************************************************************/ + +#ifdef CONFIG_USBDEV +void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) +{ + uinfo("resume: %d\n", resume); +} +#endif + +#endif /* CONFIG_STM32_OTGFS */ diff --git a/arch/arm/src/calypso/calypso_lowputc.S b/configs/olimex-stm32-p407/src/stm32_userleds.c similarity index 62% rename from arch/arm/src/calypso/calypso_lowputc.S rename to configs/olimex-stm32-p407/src/stm32_userleds.c index 5556b3baca956f135b3d956f10c43c62c9933b59..d044d386e484508b599ef4acb6fa7a575d9718eb 100644 --- a/arch/arm/src/calypso/calypso_lowputc.S +++ b/configs/olimex-stm32-p407/src/stm32_userleds.c @@ -1,11 +1,7 @@ -/************************************************************************** - * calypso/calypso_lowputc.S +/**************************************************************************** + * configs/olimex-stm32-p407/src/stm32_userleds.c * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter - * - * based on: c5471/c5471_lowputc.S - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -35,99 +31,85 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Included Files - **************************************************************************/ + ****************************************************************************/ #include -#include "chip.h" -#include "up_arch.h" -#include "up_internal.h" +#include +#include +#include +#include +#include "stm32.h" +#include "olimex-stm32-p407.h" -/************************************************************************** - * Pre-processor Definitions - **************************************************************************/ +#ifndef CONFIG_ARCH_LEDS -/************************************************************************** - * Private Types - **************************************************************************/ +/**************************************************************************** + * Private Data + ****************************************************************************/ +/* This array maps an LED number to GPIO pin configuration */ -/************************************************************************** - * Private Function Prototypes - **************************************************************************/ +static uint32_t g_ledcfg[BOARD_NLEDS] = +{ + GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4 +}; -/************************************************************************** - * Public Data - **************************************************************************/ +/**************************************************************************** + * Private Function Protototypes + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Data - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Private Functions - **************************************************************************/ + ****************************************************************************/ -/************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************/ - -/************************************************************************** - * Name: up_lowputc - **************************************************************************/ - -/* This assembly language version has the advantage that it can does not - * require a C stack and uses only r0-r1. Hence it can be used during - * early boot phases. - */ - - .text - .global up_lowputc - .type up_lowputc, function -up_lowputc: - /* On entry, r0 holds the character to be printed */ - -#ifdef CONFIG_SERIAL_IRDA_CONSOLE - ldr r2, =UART_IRDA_BASE /* r2=IRDA UART base */ -#else - ldr r2, =UART_MODEM_BASE /* r2=Modem UART base */ -#endif - - /* Poll bit 0 of the UART_SSR register. When the bit - * is clear, the TX FIFO is no longer full - */ - -1: ldrb r1, [r2, #UART_SSR_OFFS] - tst r1, #UART_SSR_TXFULL - bne 1b - - /* Send the character by writing it into the UART_THR - * register. - */ - - strb r0, [r2, #UART_THR_OFFS] - - /* Wait for the tranmsit holding regiser (THR) to be - * emptied. This is detemined when bit 6 of the LSR - * is set. - */ - -2: ldrb r1, [r2, #UART_LSR_OFFS] - tst r1, #0x00000020 - beq 2b - - /* If the character that we just sent was a linefeed, - * then send a carriage return as well. - */ - - teq r0, #'\n' - moveq r0, #'\r' - beq 1b - - /* And return */ - - mov pc, lr - + ****************************************************************************/ + +/**************************************************************************** + * Name: board_userled_initialize + ****************************************************************************/ + +void board_userled_initialize(void) +{ + /* Configure LED1-4 GPIOs for output */ + + stm32_configgpio(GPIO_LED1); + stm32_configgpio(GPIO_LED2); + stm32_configgpio(GPIO_LED3); + stm32_configgpio(GPIO_LED4); +} + +/**************************************************************************** + * Name: board_userled + ****************************************************************************/ + +void board_userled(int led, bool ledon) +{ + if ((unsigned)led < BOARD_NLEDS) + { + stm32_gpiowrite(g_ledcfg[led], ledon); + } +} + +/**************************************************************************** + * Name: board_userled_all + ****************************************************************************/ + +void board_userled_all(uint8_t ledset) +{ + stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0); + stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) != 0); + stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) != 0); + stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) != 0); +} + +#endif /* !CONFIG_ARCH_LEDS */ diff --git a/configs/olimex-strp711/nettest/defconfig b/configs/olimex-strp711/nettest/defconfig index 631f41fc69d4c705d7221cf36b206c60d579fee4..838239291fd3fe9bb9a0376cf922b83c53c75cb5 100644 --- a/configs/olimex-strp711/nettest/defconfig +++ b/configs/olimex-strp711/nettest/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -455,15 +453,13 @@ CONFIG_ENC28J60_HPWORK=y # CONFIG_ENC28J60_HALFDUPPLEX is not set # CONFIG_ENC28J60_DUMPPACKET is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -553,13 +549,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -772,7 +766,6 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -820,7 +813,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimex-strp711/nsh/defconfig b/configs/olimex-strp711/nsh/defconfig index 6f9794a23e0d360e705f1b190afe47079e521468..d889a22c2e72c9ccc74dfa656edac735d23eec3d 100644 --- a/configs/olimex-strp711/nsh/defconfig +++ b/configs/olimex-strp711/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -253,8 +251,6 @@ CONFIG_NSH_MMCSDSPIPORTNO=1 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -436,7 +432,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -689,7 +684,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimexino-stm32/can/defconfig b/configs/olimexino-stm32/can/defconfig index df3acfc4e96bee79d624978b747945b3126a78dc..93c56baffeb14f7d370bab6b26c6094c063a39ff 100644 --- a/configs/olimexino-stm32/can/defconfig +++ b/configs/olimexino-stm32/can/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -589,9 +587,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -787,7 +782,6 @@ CONFIG_ANALOG=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1056,7 +1050,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimexino-stm32/composite/defconfig b/configs/olimexino-stm32/composite/defconfig index fcb7a0c8d7ff49aa47ca6edc2f6e72d5f91f7b33..8bf9ffffa718b6e18b1f1a95f99f5679bec2e246 100644 --- a/configs/olimexino-stm32/composite/defconfig +++ b/configs/olimexino-stm32/composite/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -350,6 +350,12 @@ CONFIG_STM32_HAVE_ADC1_DMA=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set # CONFIG_STM32_HAVE_DAC1 is not set @@ -590,8 +596,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -717,14 +721,14 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -789,7 +793,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1101,20 +1104,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=768 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="BOOT 0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1151,7 +1142,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimexino-stm32/nsh/defconfig b/configs/olimexino-stm32/nsh/defconfig index 8b9fd359f988cef31494be86391a0942a84af8bf..10da4dcdbdefe93e8507cea3244cadb63721641c 100644 --- a/configs/olimexino-stm32/nsh/defconfig +++ b/configs/olimexino-stm32/nsh/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -350,6 +350,12 @@ CONFIG_STM32_HAVE_ADC1_DMA=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set # CONFIG_STM32_HAVE_DAC1 is not set @@ -589,8 +595,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -716,14 +720,14 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -788,7 +792,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1030,20 +1033,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=768 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="BOOT 0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1080,7 +1071,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimexino-stm32/smallnsh/defconfig b/configs/olimexino-stm32/smallnsh/defconfig index 6bbd1478c68b48c78fe6a6ef9cc2bc4b341748dd..fd206bba4553eb7bc4d8b6a7fffcc5a2d2f4160a 100644 --- a/configs/olimexino-stm32/smallnsh/defconfig +++ b/configs/olimexino-stm32/smallnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -570,9 +568,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -765,7 +760,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1020,7 +1014,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/olimexino-stm32/src/olimexino-stm32.h b/configs/olimexino-stm32/src/olimexino-stm32.h index df496c98943db273d467361e1e4f879ee8c34ac7..987c55c00f76913a038456726c5c67b43d5b0797 100644 --- a/configs/olimexino-stm32/src/olimexino-stm32.h +++ b/configs/olimexino-stm32/src/olimexino-stm32.h @@ -200,18 +200,6 @@ void stm32_usb_set_pwr_callback(xcpt_t pwr_changed_handler); void stm32_led_initialize(void); #endif -/************************************************************************************ - * Name: stm32_can_initialize - * - * Description: - * Called at application startup time to initialize the CAN functionality. - * - ************************************************************************************/ - -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) -int stm32_can_initialize(void); -#endif - /**************************************************************************** * Name: board_usbmsc_initialize * @@ -228,5 +216,17 @@ int stm32_can_initialize(void); int board_usbmsc_initialize(int port); #endif +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_OLIMEXINO_STM32_SRC_OLIMEXINO_STM32_H */ diff --git a/configs/olimexino-stm32/src/stm32_appinit.c b/configs/olimexino-stm32/src/stm32_appinit.c index c0e50597f7ffceac60145edd0b99b9f02610c910..4fdc6a1c689f69544a9c6fb60e7f057448cb1039 100644 --- a/configs/olimexino-stm32/src/stm32_appinit.c +++ b/configs/olimexino-stm32/src/stm32_appinit.c @@ -105,5 +105,16 @@ int board_app_initialize(uintptr_t arg) #endif #endif +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return ret; } diff --git a/configs/olimexino-stm32/src/stm32_can.c b/configs/olimexino-stm32/src/stm32_can.c index c03a1c8d266ec5e577f987431fc1b3e7151b1a86..862def8094da20df7273222349c546f078367dd2 100644 --- a/configs/olimexino-stm32/src/stm32_can.c +++ b/configs/olimexino-stm32/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimexino-stm32/src/stm32_can.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * David Sidrane * @@ -48,13 +48,12 @@ #include "chip.h" #include "up_arch.h" - -#include "olimexino-stm32.h" - #include "stm32.h" #include "stm32_can.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#include "olimexino-stm32.h" + +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -62,55 +61,57 @@ /* Configuration ********************************************************************/ /* The STM32F107VC supports CAN1 and CAN2 */ -#define CAN_PORT 1 +#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) +# warning "Both CAN1 and CAN2 are enabled. Only CAN1 is connected." +# undef CONFIG_STM32_CAN2 +#endif + +#ifdef CONFIG_STM32_CAN1 +# define CAN_PORT 1 +#else +# define CAN_PORT 2 +#endif /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/olimexino-stm32/tiny/defconfig b/configs/olimexino-stm32/tiny/defconfig index 9a5dc1b90185783365201a8c728b84946ce68ddc..5940eb260cc25f847afb111dbfb5952688c49367 100644 --- a/configs/olimexino-stm32/tiny/defconfig +++ b/configs/olimexino-stm32/tiny/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -570,9 +568,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -770,7 +765,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -1017,7 +1011,6 @@ CONFIG_EXAMPLES_CAN_READWRITE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/open1788/README.txt b/configs/open1788/README.txt index b7419b33aad354aa8da95d53edd20b80748750e9..b8604d6346a03fd63df4e51e75774f68f3b3169c 100644 --- a/configs/open1788/README.txt +++ b/configs/open1788/README.txt @@ -467,32 +467,6 @@ CONFIGURATION CONFIG_DEBUG_INFO=y CONFIG_DEBUG_INPUT=y - 7. The button test (apps/examples/buttons) can be built-in by adding - the following options. See apps/examples/README.txt for further - information about the button test. - - System Type: - CONFIG_LPC17_GPIOIRQ=y - - Board Selection: - CONFIG_ARCH_BUTTONS=y - CONFIG_ARCH_IRQBUTTONS=y - - Application Configuration: - CONFIG_EXAMPLES_BUTTONS=y - CONFIG_EXAMPLES_BUTTONS_MIN=0 - CONFIG_EXAMPLES_BUTTONS_MAX=7 - CONFIG_EXAMPLES_IRQBUTTONS_MIN=1 - CONFIG_EXAMPLES_IRQBUTTONS_MAX=7 - CONFIG_EXAMPLES_BUTTONS_NAME0="USER1" - CONFIG_EXAMPLES_BUTTONS_NAME1="USER2" - CONFIG_EXAMPLES_BUTTONS_NAME2="USER3" - CONFIG_EXAMPLES_BUTTONS_NAME3="JOYSTICK_A" - CONFIG_EXAMPLES_BUTTONS_NAME4="JOYSTICK_B" - CONFIG_EXAMPLES_BUTTONS_NAME5="JOYSTICK_C" - CONFIG_EXAMPLES_BUTTONS_NAME6="JOYSTICK_D" - CONFIG_EXAMPLES_BUTTONS_NAME7="JOYSTICK_CTR" - nxlines ------- Configures the graphics example located at examples/nsh. This diff --git a/configs/open1788/knsh/defconfig b/configs/open1788/knsh/defconfig index 3bb6dfcf450d9cb5e7219d43f8ecb3ba20d7828d..c304ff0464141d2b557b5e37bfde6b06937a7952 100644 --- a/configs/open1788/knsh/defconfig +++ b/configs/open1788/knsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -496,7 +494,6 @@ CONFIG_PIPES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -736,7 +733,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/open1788/nsh/defconfig b/configs/open1788/nsh/defconfig index e620dc37677dc07ce954e8023989cfdbba47d244..2f155a49d00ef6133b3aa4cec13b5fe684970be6 100644 --- a/configs/open1788/nsh/defconfig +++ b/configs/open1788/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -314,8 +312,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -494,7 +490,6 @@ CONFIG_PIPES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -739,7 +734,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/open1788/nxlines/defconfig b/configs/open1788/nxlines/defconfig index b44db1d026110632515035210ba64899473ef7c8..5abe3e6aa0e909db69d09abbdf56e081c2226c7d 100644 --- a/configs/open1788/nxlines/defconfig +++ b/configs/open1788/nxlines/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -524,7 +522,6 @@ CONFIG_PIPES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -862,7 +859,6 @@ CONFIG_EXAMPLES_NXLINES_BPP=32 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/p112/ostest/defconfig b/configs/p112/ostest/defconfig index c1da999fc3b6a9b0dc71e423456263b2e9f46040..56ea350bf42f7d493f7d9c28b40b1a6e69a84c8e 100644 --- a/configs/p112/ostest/defconfig +++ b/configs/p112/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -272,7 +271,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -411,7 +409,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/pcblogic-pic32mx/nsh/defconfig b/configs/pcblogic-pic32mx/nsh/defconfig index 2b4c87ba8c9c10248359cd7bf3e0dc6be9ab63ed..8b93eb5cc4474ab2259f661198740e16ef8b1e80 100644 --- a/configs/pcblogic-pic32mx/nsh/defconfig +++ b/configs/pcblogic-pic32mx/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -496,7 +495,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -728,7 +726,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pcduino-a10/nsh/defconfig b/configs/pcduino-a10/nsh/defconfig index 03bdbbcf0f2a74e6d53d6a3d3740ed0a9fdb0efd..db630aab6d5d636e10c0f3bd61c704a236b25c7b 100644 --- a/configs/pcduino-a10/nsh/defconfig +++ b/configs/pcduino-a10/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # CONFIG_ARCH_CHIP_A1X=y # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -476,7 +474,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -728,7 +725,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pic32mx-starterkit/nsh/defconfig b/configs/pic32mx-starterkit/nsh/defconfig index 0bef836bff754fe1728c2868dc23f2c127745a80..780f215091622febc0c7f42a3133dbfbce1d7122 100644 --- a/configs/pic32mx-starterkit/nsh/defconfig +++ b/configs/pic32mx-starterkit/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -336,8 +335,6 @@ CONFIG_ARCH_LEDS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -542,7 +539,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -785,7 +781,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pic32mx-starterkit/nsh2/defconfig b/configs/pic32mx-starterkit/nsh2/defconfig index ec259a462bfc7056bda1b7454feb82b2a42cbc81..1de3487770415be05c9ec1e4b4364f0fa0460275 100644 --- a/configs/pic32mx-starterkit/nsh2/defconfig +++ b/configs/pic32mx-starterkit/nsh2/defconfig @@ -64,7 +64,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -247,6 +246,7 @@ CONFIG_PIC32MX_T1PRIO=16 # PIC32MX PHY/Ethernet device driver settings # # CONFIG_PIC32MX_MULTICAST is not set +CONFIG_PIC32MX_ETHERNET_HPWORK=y # # Device Configuration 0 (DEVCFG0) @@ -347,8 +347,6 @@ CONFIG_ARCH_LEDS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -423,6 +421,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -431,6 +430,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -442,8 +442,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -575,10 +578,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -602,7 +603,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -670,13 +670,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -962,7 +960,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pic32mx7mmb/nsh/defconfig b/configs/pic32mx7mmb/nsh/defconfig index 716e0a9e8bd01c9a428ad59d5466792b8b985bd2..7b0660e986240be4ec42d2941b01ed35201aad98 100644 --- a/configs/pic32mx7mmb/nsh/defconfig +++ b/configs/pic32mx7mmb/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -255,6 +254,7 @@ CONFIG_PIC32MX_USBPRIO=16 # PIC32MX PHY/Ethernet device driver settings # # CONFIG_PIC32MX_MULTICAST is not set +CONFIG_PIC32MX_ETHERNET_HPWORK=y # # Device Configuration 0 (DEVCFG0) @@ -356,8 +356,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -432,6 +430,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -440,6 +439,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -451,8 +451,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -594,10 +597,8 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -621,7 +622,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -733,13 +733,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1025,7 +1023,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pic32mz-starterkit/nsh/defconfig b/configs/pic32mz-starterkit/nsh/defconfig index 9bfa572e1601e905f9e0aff48c9a2980bd96b203..b64f33c2627aa3cea16fb02d1fdc7e8601f8818d 100644 --- a/configs/pic32mz-starterkit/nsh/defconfig +++ b/configs/pic32mz-starterkit/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -263,8 +262,6 @@ CONFIG_ARCH_HAVE_BUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -469,7 +466,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -712,7 +708,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/pirelli_dpl10/README.txt b/configs/pirelli_dpl10/README.txt deleted file mode 100644 index e9f0204df5118d4b51bb79535b99b0e52c085481..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/README.txt +++ /dev/null @@ -1,363 +0,0 @@ -pirelli_dpl10 -============= - - This directory contains the board support for Pirelli "Discus" DP-L10 - phones. - -Contents -======== - - * History - * Hardware - * Osmocom-BB Dependencies and Sercomm - * Loading NuttX - * Memory Map - * USB Serial Console - * NuttX OABI "buildroot" Toolchain - * Generic OABI Toolchain - * Configurations - -History -======= - This port is a variant of the compal_e88 configuration with the small - change of enabling the IrDA serial console: - - - CONFIG_SERIAL_IRDA_CONSOLE=y - - This port is based on patches contributed by Denis Carikli for both the - compal e99 and e88. At the time of initial check-in, the following phones - were tested: - - - Pirelli DPL-10 nsh_highram loaded via romload in osmocon - - The patches were made by Alan Carvalho de Assis and Denis Carikli using - the Stefan Richter's patches that can be found here: - - http://cgit.osmocom.org/cgit/nuttx-bb/log/?h=lputt%2Ftesting - -Hardware -======== - - * CPU/DBB: TI Calypso (D751992AZHH) - - See http://bb.osmocom.org/trac/wiki/Hardware/Calypso - - * ABB: TI Iota (TWL3014) - - Analog baseband chip. See http://bb.osmocom.org/trac/wiki/Iota - - * GSM Transceiver: TI Rita (TRF6151) - - GSM Transceiver. See http://bb.osmocom.org/trac/wiki/Rita - - * PA: SKY77328-13 - - Quad-band GSM/GPRS: See http://www.skyworksinc.com/Product.aspx?ProductID=434 - - * Flash/SRAM: Spansion S71PL129NC0 128MBit/64MBit - - Combined FLASH and SDRAM: - FLASH: 128Mbit - SDRAM: 64Mbit - - * Wifi: Marvell 88W8385 802.11 MAC - Marvell 88W8015 802.11b/g transceiver - - * Winbond W56940 ringtone chip - - * Sunplus SPCA552E multimedia controller - - Multimedia processor: integrates CMOS sensor interface, DSC processor, JPEG - codec engine, LCM interface and other peripherals. - - I have not yet been able to find a data sheet for this chip. I believe that - it will be critical to develop drivers for the display. - - * LSI-65194A1 ASIC (seems to be a DSP for VoIP en-/decoding) - - * Silabs CP2102 USB UART (connected to UART_IRDA of the Calypso) - -Osmocom-BB Dependencies and Sercomm -=================================== - - Sercomm is an HDLC protocol used to communicate between a Calypso phone - and the host PC. By default, NuttX will not use sercomm (HDLC protocol) to - communicate with the host system. Sercomm is the transport used by - osmocom-bb that runs on top of serial. See - http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed the usage of nuttx - with sercomm. - - If you build with sercomm, you must add support for sercomm in your - configuration (CONFIG_SERCOMM_CONSOLE=y). In this case, the build - environment assumes that you have the osmocom-bb project directory at same - level as the nuttx project: - - |- nuttx - |- apps - `- osmocom-bb - - If you attempt to build a sercomm-enaled configuration without osmocom-bb, - you will get compilation errors in drivers/sercomm due to header files that - are needed from the osmocom-bb directory. - -Loading NuttX -============= - - General - ------- - The osmocom-bb wiki describes how to load NuttX. See - http://bb.osmocom.org/trac/wiki/nuttx-bb for detailed information. - The way that nuttx is loaded depends on the configuration (highram/compalram) - and phone: - - - compalram is for the ramloader(for phone having a bootloader on flash) - - highram is for phones having the romloader(if the phone has a bootrom) - or for loading in the ram trough a special loader(loaded first on ram - by talking to the ramloader) when having a ramloader(which can only - load 64k). - - The Pirelli USB Serial Interface - -------------------------------- - The Pirelli phone is epecially easy to use because you just use the - supplied USB cable. The phone already has an integrated Silabs CP210x - USB-UART, which is supported by Linux. No need for a T191 cable. - - Most of the phones seem to use USB vid:pid 0489:e003, which is mainline - since Linux 2.6.36. You can do the following for Kernels < 2.6.36: - - # modprobe -v cp210x - # echo "0489 e003" > /sys/bus/usb-serial/drivers/cp210x/new_id - - Loading NuttX - ------------- - Here's how I load NuttX into the phone: - - - Take out the battery - - Plug in the USB adapter into the phone then the computer - - Start osmocon like: osmocon -p /dev/ttyUSB0 -m romload nuttx.bin - - Put the battery back in - - This works most of the time. Sometimes I have to take out and put in - the battery a few times or re-start the whole set of steps but it's - generally quite reliable. - -Memory Map -========= - - Internal SRAM and ROM - --------------------- - Calypso has 256KB of internal SRAM (0x800000-0x83ffff, although some of - this is, I believe, actually ROM). Only this internal SRAM is used by - these configurations. The internal SRAM is broken up into two logical - banks. - - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - HRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00020000 - - Code can be loaded by the CalypsoBootloader only into HRAM beginning at - address 0x00820000 and, hence, is restricted to 128KB (including then - non-loaded sections: Uninitialized data and the NuttX heap). - - SDRAM and NOR FLASH - ------------------- - SDRAM is provided by a Flash/SRAM: Spansion S71PL129NC0 part that provices - 128MBit (16MB) of FLASH and 64MBit (8MB) of SDRAM. - - * SDRAM - - The Pirelli DP-L10 has 8MB of SDRAM beginning at address 0x01000000. - This DRAM appears to be initialized by the Pirelli ROM loader and is - ready for use with no further initialization required. - - * NOR FLASH - - The 16MB FLASH is at address 0x00000000. - -USB Serial Console -================== - - These configurations are set up to use the Calypso IrDA UART as the serial - port. On the Pirelli phone, this port connects to the built-in USB-serial - adaptor so that that NuttX serial console will be available on your PC as - a USB serial device. You should see something this using 'dmesg' when you - plug the Pirelli phone into a PC running Linux: - - usb 5-2: new full speed USB device number 3 using uhci_hcd - usb 5-2: New USB device found, idVendor=0489, idProduct=e003 - usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 - usb 5-2: Product: DP-L10 - usb 5-2: Manufacturer: Silicon Labs - usb 5-2: SerialNumber: 0001 - usbcore: registered new interface driver usbserial - USB Serial support registered for generic - usbcore: registered new interface driver usbserial_generic - usbserial: USB Serial Driver core - USB Serial support registered for cp210x - cp210x 5-2:1.0: cp210x converter detected - usb 5-2: reset full speed USB device number 3 using uhci_hcd - usb 5-2: cp210x converter now attached to ttyUSB0 - usbcore: registered new interface driver cp210x - cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver - - - Before you use this port to communicate with Nuttx, make sure that osmocon is - no longer running. Then start a serial terminal such as minicom on your host - PC. Configure the serial terminal so that it uses: - - Port: /dev/ttyUSB0 - Baud: 115,200 8N1 - -JTAG and Alternative Serial Console -=================================== - -JTAG - All JTAG lines, as well as the second uart (UART_MODEM), go to the - unpopulated connector next to the display connector. NOTE: You have - to disassemble the phone to get to this connector. - - - --- --------------------------- - PIN SIGNAL - --- --------------------------- - 1 Vcc - 2 RX_MODEM - 3 TESTRSTz (Iota) - 4 TDI - 5 TMS - 6 TCK - 7 TX_MODEM - 8 TDO - 9 N/C - 10 GND - 11 N/C - 12 N/C - --- --------------------------- - -JTAG Apapter: - - ------- ----------- --------------- -------------------------------------- - JTAG 20-PIN DESCRIPTION NOTES - SIGNAL CONNECTOR - ------- ----------- --------------- -------------------------------------- - Vcc 1, 2 Vcc - nTRST 3 Reset Connect this pin to the (active - low) reset input of the target MCU. - Some JTAG adapters driver nTRST (high - and low). Others can can configure - nTRST as open collector (only drive - low). - GND 4, 6, 8, Ground - 10, 12, 14, - 16, 20 - TDI 5 JTAG Test Data Use 10K-100K Ohm pull-up resistor to - Input VCC - TMS 7 JTAG Test Mode Use 10K-100K Ohm pull-up resistor to - Select VCC - TCK 9 Clock into the Use 10K-100K Ohm pull-down resistor to - core GND - RTCK 11 Return clock Some JTAG adapters have adaptive clocking - using an RTCK signal. - DBGSEL 11 Debug Select Some devices have special pins that - enable the JTAG interface. For example, - on the NXP LPC2129 the signal RTCK must - be driven low during RESET to enable the - JTAG interface. - TDO 13 JTAG Test Data Use 10K-100K Ohm pull-up resistor to VCC - Output - DBGRQ 17 N/C - DGBACK 19 N/C - ISP ?? ISP Most NXP MCU's have an ISP pin which - (when pulled low) can be used to cause - the MCU to enter a bootloader on reset. - Use 10K-100K Ohm pull up resistor. - ------- ----------- --------------- -------------------------------------- - -NuttX OABI "buildroot" Toolchain -================================ - - A GNU GCC-based toolchain is assumed. The files */setenv.sh should - be modified to point to the correct path to the ARM GCC toolchain (if - different from the default in your PATH variable). - - If you have no ARMtoolchain, one can be downloaded from the NuttX - Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/). - This GNU toolchain builds and executes in the Linux or Cygwin environment. - - 1. You must have already configured Nuttx in /nuttx. - - cd tools - ./configure.sh pirelli_dpl10/ - - 2. Download the latest buildroot package into - - 3. unpack the buildroot tarball. The resulting directory may - have versioning information on it like buildroot-x.y.z. If so, - rename /buildroot-x.y.z to /buildroot. - - 4. cd /buildroot - - 5. cp configs/arm7tdmi-defconfig-4.3.3 .config - - 6. make oldconfig - - 7. make - - 8. Edit setenv.h, if necessary, so that the PATH variable includes - the path to the newly built binaries. - - See the file configs/README.txt in the buildroot source tree. That has more - details PLUS some special instructions that you will need to follow if you are - building a Cortex-M3 toolchain for Cygwin under Windows. - -Generic OABI Toolchain -====================== - - The NuttX OABI toolchain is selected with: - - CONFIG_ARM_TOOLCHAIN_BUILDROOT=y - CONFIG_ARM_OABI_TOOLCHAIN=y - - In most cases, OsmocomBB is built with a different OABI toolchain with a - prefix of arm-elf-. To use that toolchain, change the configuration as - follows: - - CONFIG_ARM_TOOLCHAIN_GNU_OABI=y - -Configurations -============== - - nsh: - --- - Configures the NuttShell (nsh) located at apps/examples/nsh. - - NOTES: - - 1. This configuration uses the mconf-based configuration tool. To - change this configuration using that tool, you should: - - a. Build and install the kconfig-mconf tool. See nuttx/README.txt - see additional README.txt files in the NuttX tools repository. - - b. Execute 'make menuconfig' in nuttx/ in order to start the - reconfiguration process. - - 2. This configuration enables the serial interface on IrDA UART which - will appears as a USB serial device. - - CONFIG_SERIAL_IRDA_CONSOLE=y - - 3. By default, this configuration uses the CodeSourcery toolchain - for Windows and builds under Cygwin (or probably MSYS). That - can easily be reconfigured, of course. - - CONFIG_HOST_LINUX=y : Builds under Linux - CONFIG_ARM_TOOLCHAIN_BUILDROOT=y : NuttX buildroot OABI toolchain - CONFIG_ARM_OABI_TOOLCHAIN=y - - You can switch to use the generic arm-elf- GCC toolchain by - setting: - - CONFIG_ARM_TOOLCHAIN_GNU_OABI=y : General arm-elf- toolchain - - 4. Support for builtin applications is enabled. A builtin 'poweroff' - command is supported. diff --git a/configs/pirelli_dpl10/include/board.h b/configs/pirelli_dpl10/include/board.h deleted file mode 100644 index 1426ea73247306f8a9432c18fd677263a766edaa..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/include/board.h +++ /dev/null @@ -1,6 +0,0 @@ -/**************************************************************************** - * configs/pirelli_dpl10/include/board.h - * - * Supposed to be empty - * - ****************************************************************************/ diff --git a/configs/pirelli_dpl10/nsh_highram/Make.defs b/configs/pirelli_dpl10/nsh_highram/Make.defs deleted file mode 100644 index 6adb17f5a6f4cc9524081b37a3c49ebbb035b002..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/nsh_highram/Make.defs +++ /dev/null @@ -1,131 +0,0 @@ -############################################################################ -# configs/pirelli_dpl10/nsh/Make.defs -# -# Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs - -LDSCRIPT = highram.ld - -ifeq ($(WINTOOL),y) - # Windows-native toolchains - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" -else - # Linux/Cygwin-native toolchain - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) -endif - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(ARCROSSDEV)ar rcs -NM = $(ARCROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} -ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -g -endif - -ifneq ($(CONFIG_DEBUG_NOOPT),y) - ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -endif - -ARCHCFLAGS = -fno-builtin -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 - -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections -LDNXFLATFLAGS = -e main -s 2048 - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a -EXEEXT = - -ifneq ($(CROSSDEV),arm-nuttx-elf-) - LDFLAGS += -nostartfiles -nodefaultlibs -endif -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - LDFLAGS += -g -endif - -ifeq ("${CONFIG_SERCOMM_CONSOLE}","y") -OSMODIR = $(TOPDIR)/../../osmocom-bb -EXTRA_LIBS = $(OSMODIR)/src/target/firmware/comm/libcomm.a \ - $(OSMODIR)/src/shared/libosmocore/build-target/src/.libs/libosmocore.a \ - $(OSMODIR)/src/target/firmware/calypso/libcalypso.a \ - $(OSMODIR)/src/target/firmware/comm/libcomm.a - # ^^^ Stupid hack! Why do I have to put it twice??? -endif - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe -HOSTLDFLAGS = -ifeq ($(CONFIG_HOST_WINDOWS),y) - HOSTEXEEXT = .exe -else - HOSTEXEEXT = -endif - -ifeq ($(WINTOOL),y) - # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh -else - # Linux/Cygwin-native host tools - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) -endif diff --git a/configs/pirelli_dpl10/scripts/highram.ld b/configs/pirelli_dpl10/scripts/highram.ld deleted file mode 100644 index f20a5f89c2a1af0df6828e794e30b7d7f56521ca..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/scripts/highram.ld +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Linker script for running from internal SRAM on Pirelli DP-L10 phones - * - * This script is tailored specifically to the requirements imposed - * on us by the CalypsoRomloader in the Pirelli rom. - * - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(__start) - -MEMORY -{ - /* 0x00800000-0x0082000: Low RAM. Used only for exception vectors */ - - LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00020000 - - /* 0x00820000-0x0084000: High RAM. The CalypsoRomloader loads binary to - * address 0x00820000 */ - - HRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00020000 -} - -SECTIONS -{ - . = 0x800000; - - /* romloader data section, contains passthru interrupt vectors */ - .compal.loader (NOLOAD) : { . = 0x100; } > LRAM - - /* image signature (prepended by osmocon according to phone type) */ - .compal.header (NOLOAD) : { . = 4; } > LRAM - - /* initialization code */ - . = ALIGN(4); - .text.start : { - PROVIDE(__start = .); - KEEP(*(.text.start)) - *(.text.start) - } > HRAM - - /* exception vectors from 0x80001c to 0x800034 */ - .text.exceptions 0x80001c : AT (LOADADDR(.text.start) + SIZEOF(.text.start)) { - KEEP(*(.text.exceptions)) - * (.text.exceptions) - . = ALIGN(4); - } > LRAM - PROVIDE(_exceptions = LOADADDR(.text.exceptions)); - - /* code */ - . = ALIGN(4); - .text (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) : - AT (LOADADDR(.text.exceptions) + SIZEOF(.text.exceptions)) { - /* regular code */ - *(.text*) - /* always-in-ram code */ - *(.ramtext*) - /* gcc voodoo */ - *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) - . = ALIGN(4); - } > HRAM - PROVIDE(_text_start = LOADADDR(.text)); - PROVIDE(_text_end = LOADADDR(.text) + SIZEOF(.text)); - - /* constructor pointers */ - .ctors : { - /* ctor count */ - LONG(SIZEOF(.ctors) / 4 - 2) - /* ctor pointers */ - KEEP(*(SORT(.ctors))) - /* end of list */ - LONG(0) - } > HRAM - PROVIDE(_ctor_start = LOADADDR(.ctors)); - PROVIDE(_ctor_end = LOADADDR(.ctors) + SIZEOF(.ctors)); - - /* destructor pointers */ - .dtors : { - /* dtor count */ - LONG(SIZEOF(.dtors) / 4 - 2) - /* dtor pointers */ - KEEP(*(SORT(.dtors))) - /* end of list */ - LONG(0) - } > HRAM - PROVIDE(_dtor_start = LOADADDR(.dtors)); - PROVIDE(_dtor_end = LOADADDR(.dtors) + SIZEOF(.dtors)); - - /* read-only data */ - . = ALIGN(4); - .rodata : { - *(.rodata*) - } > HRAM - PROVIDE(_rodata_start = LOADADDR(.rodata)); - PROVIDE(_rodata_end = LOADADDR(.rodata) + SIZEOF(.rodata)); - - /* initialized data */ - . = ALIGN(4); - .data : { - *(.data) - } > HRAM - PROVIDE(_data_start = LOADADDR(.data)); - PROVIDE(_data_end = LOADADDR(.data) + SIZEOF(.data)); - - /* pic offset tables */ - . = ALIGN(4); - .got : { - *(.got) - *(.got.plt) *(.igot.plt) *(.got) *(.igot) - } > HRAM - PROVIDE(_got_start = LOADADDR(.got)); - PROVIDE(_got_end = LOADADDR(.got) + SIZEOF(.got)); - - /* uninitialized data */ - .bss (NOLOAD) : { - . = ALIGN(4); - __bss_start = .; - _sbss = ABSOLUTE(.); - *(.bss) - _ebss = ABSOLUTE(.); - } > HRAM - . = ALIGN(4); - __bss_end = .; - PROVIDE(_bss_start = __bss_start); - PROVIDE(_bss_end = __bss_end); - - /* end of image */ - . = ALIGN(4); - _end = .; - PROVIDE(end = .); -} diff --git a/configs/pirelli_dpl10/src/.gitignore b/configs/pirelli_dpl10/src/.gitignore deleted file mode 100644 index 726d936e1e3390cc875a1fa5681e3c3988fe3c8b..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.depend -/Make.dep diff --git a/configs/pirelli_dpl10/src/Makefile b/configs/pirelli_dpl10/src/Makefile deleted file mode 100644 index 4026b5fb1c9091d35816679c3561379697ff2f3f..0000000000000000000000000000000000000000 --- a/configs/pirelli_dpl10/src/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# configs/pirelli_dpl10/src/Makefile -# -# Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Copyright (C) 2011 Stefan Richter. All rights reserved. -# Author: Stefan Richter -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - --include $(TOPDIR)/Make.defs - -ASRCS = -CSRCS = boot.c - -include $(TOPDIR)/configs/Board.mk diff --git a/configs/qemu-i486/nsh/defconfig b/configs/qemu-i486/nsh/defconfig index 5389669288151c5d3c5684004052d48c9b2ca489..dc240aa19a384ad03bdc50a06cfa1c88e82c3363 100644 --- a/configs/qemu-i486/nsh/defconfig +++ b/configs/qemu-i486/nsh/defconfig @@ -54,7 +54,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set CONFIG_ARCH_X86=y @@ -239,7 +238,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_16550_UART=y @@ -457,7 +455,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/qemu-i486/ostest/defconfig b/configs/qemu-i486/ostest/defconfig index a637ac91645704998f5f82364f0de1fdf32a9ef1..b205650b6c41bb9492512a5ee25b2ef5aae0a629 100644 --- a/configs/qemu-i486/ostest/defconfig +++ b/configs/qemu-i486/ostest/defconfig @@ -54,7 +54,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set CONFIG_ARCH_X86=y @@ -238,7 +237,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -439,7 +437,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/rgmp/Kconfig b/configs/rgmp/Kconfig deleted file mode 100644 index ba62632ecbe0b57dd6e60fcedcb6fba49fb3e38a..0000000000000000000000000000000000000000 --- a/configs/rgmp/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -if ARCH_BOARD_RGMP - -endif # ARCH_BOARD_RGMP diff --git a/configs/rgmp/README.txt b/configs/rgmp/README.txt deleted file mode 100644 index ac92ef91a48ec995cdcc15754b5d84d6413923cb..0000000000000000000000000000000000000000 --- a/configs/rgmp/README.txt +++ /dev/null @@ -1,90 +0,0 @@ -RGMP README File -================ - -RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project for -running GPOS and RTOS simultaneously on multi-processor platforms. You can -port your favorite RTOS to RGMP together with an unmodified Linux to form a -hybrid operating system. This makes your application able to use both RTOS -and GPOS features. - -See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further -information about RGMP. - -The updated build instructions can be found at: -http://rgmp.sourceforge.net/wiki/index.php/Documentation - -Ubuntu Build Instructions --------------------------- -Build requirements: - * x86 PC: - Ubuntu 10.04, 10.10 or 11.04 - * OMAP4430 pandaboard: - Ubuntu 11.04 - -Run requirements: - * multi-processor x86 PC: - Ubuntu 10.04, 10.10 or 11.04 - * OMAP4430 pandaboard: - Ubuntu 11.04 - -1. Download RGMP from the following URL: - - http://rgmp.sourceforge.net/wiki/index.php/Download - - You should choose a right verion of RGMP compatible with this NuttX release. - Extract the tar file: - - $ tar -xjvf rgmp-.tar.bz2 - -2. Get Linux kernel header: - - $ sudo apt-get install linux-headers-$(uname -r) - -3. Build and install RGMP: - - $ cd - $ ./configure - $ make - $ sudo make install - $ sudo /usr/rgmp/setup - $ exit - -4. Configure NuttX. For example, for the RGMP x86 NSH configuration, do the - following: - - $ cd - $ cd tools - $ ./configure.sh rgmp/x86/nsh - $ cd .. - -5. Build NuttX. Get the binary image at /kernel.img. - - $ cd - $ make - -6. Run NuttX in RGMP: - - $ cd - $ su - $ rgmp_run - - -Other Linux OS Build Instruction --------------------------------------- -Requirements: - * multi-processor x86 PC - running Linux kernel 2.6.32, 2.6.35 or 2.6.38 - * OMAP4430 pandaboard - running Linux kernel 2.6.38 - -1. Get your running Linux kernel header under /usr/src/linux-headers-$(uname -r) - directory. - -2. Following the Ubuntu steps begin at 3. - -Note: You can configure the RGMP to find Linux kernel header in a different - place and install RGMP to a different place. See information printed - by the following instruction: - - $ cd - $ ./configure -h diff --git a/configs/rgmp/arm/default/Make.defs b/configs/rgmp/arm/default/Make.defs deleted file mode 100644 index ef6dcbbb3d4967cafc84add52df57d4ed5894be2..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/default/Make.defs +++ /dev/null @@ -1,96 +0,0 @@ -############################################################################ -# configs/rgmp/default/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -fno-omit-frame-pointer \ - -marm -march=armv7-a -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHDEFINES = -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/arm -ARCHSCRIPT = - -CROSSDEV = -CC = $(CROSSDEV)gcc -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = - - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/arm/default/defconfig b/configs/rgmp/arm/default/defconfig deleted file mode 100644 index d5234fe746b40309002aa771dab9845d3519250e..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/default/defconfig +++ /dev/null @@ -1,660 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -# CONFIG_DEBUG_NOOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -CONFIG_RGMP_SUBARCH_ARM=y -# CONFIG_RGMP_SUBARCH_X86 is not set -CONFIG_RGMP_SUBARCH="arm" - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="rgmp_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -# CONFIG_NET_BROADCAST is not set -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=16 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -# CONFIG_LIBC_FLOATINGPOINT is not set -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -# CONFIG_ARCH_STRCHR is not set -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -CONFIG_EXAMPLES_RGMP=y -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -# CONFIG_NETUTILS_TFTPC is not set -# CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_NETLIB is not set -# CONFIG_NETUTILS_WEBCLIENT is not set -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -# CONFIG_NSH_LIBRARY is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -# CONFIG_SYSTEM_READLINE is not set - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/arm/default/setenv.sh b/configs/rgmp/arm/default/setenv.sh deleted file mode 100755 index bfb02549bd4817af97a105e83286aff6683c57af..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/default/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/default/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/rgmp/arm/nsh/Make.defs b/configs/rgmp/arm/nsh/Make.defs deleted file mode 100644 index 3361618528b105d832790d73dc98897643b90c01..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/nsh/Make.defs +++ /dev/null @@ -1,96 +0,0 @@ -############################################################################ -# configs/rgmp/nsh/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -fno-omit-frame-pointer \ - -marm -march=armv7-a -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHDEFINES = -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/arm -ARCHSCRIPT = - -CROSSDEV = -CC = $(CROSSDEV)gcc -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = - - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/arm/nsh/defconfig b/configs/rgmp/arm/nsh/defconfig deleted file mode 100644 index 0d907f5dcc778c1c612d63e2bbc56f36b2cd3f83..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/nsh/defconfig +++ /dev/null @@ -1,769 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_INFO is not set - -# -# Subsystem Debug Options -# -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_BINFMT is not set -# CONFIG_DEBUG_GRAPHICS is not set -# CONFIG_DEBUG_IRQ is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_GPIO is not set -# CONFIG_DEBUG_AUDIO is not set -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_FULLOPT is not set - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -CONFIG_RGMP_SUBARCH_ARM=y -# CONFIG_RGMP_SUBARCH_X86 is not set -CONFIG_RGMP_SUBARCH="arm" - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set -# CONFIG_NET_DUMPPACKET is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -CONFIG_NET_BROADCAST=y -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=8 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -# CONFIG_LIBC_FLOATINGPOINT is not set -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -# CONFIG_ARCH_STRCHR is not set -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -# CONFIG_NETUTILS_CODECS is not set -CONFIG_NETUTILS_DHCPC=y -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -CONFIG_LIBC_NETDB=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=4 -CONFIG_NETDB_DNSCLIENT_MAXRESPONSE=96 -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -CONFIG_NETUTILS_TFTPC=y -# CONFIG_NETUTILS_THTTPD is not set -CONFIG_NETUTILS_NETLIB=y -CONFIG_NETUTILS_WEBCLIENT=y -CONFIG_NSH_WGET_USERAGENT="NuttX/6.xx.x (; http://www.nuttx.org/)" -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PING is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CMDOPT_DF_H=y -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 -CONFIG_NSH_LINELEN=40 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_TMPDIR="/tmp" -CONFIG_NSH_MAXARGUMENTS=6 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_CONSOLE=y - -# -# USB Trace Support -# -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_DHCPC is not set -CONFIG_NSH_IPADDR=0xc0a80a02 -CONFIG_NSH_DRIPADDR=0xc0a80a01 -CONFIG_NSH_NETMASK=0xffffff00 -# CONFIG_NSH_DNS is not set -# CONFIG_NSH_NOMAC is not set -CONFIG_NSH_MAX_ROUNDTRIP=20 - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/arm/nsh/setenv.sh b/configs/rgmp/arm/nsh/setenv.sh deleted file mode 100755 index b2180473be88bd929e3b09fd39ed6b7574196298..0000000000000000000000000000000000000000 --- a/configs/rgmp/arm/nsh/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/nsh/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/rgmp/include/stdarg.h b/configs/rgmp/include/stdarg.h deleted file mode 100644 index b748243d155f26e4e54ab596a82d6a5c07898b9d..0000000000000000000000000000000000000000 --- a/configs/rgmp/include/stdarg.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _CONFIG_RGMP_STDARG_H -#define _CONFIG_RGMP_STDARG_H - - -#include - - -#endif diff --git a/configs/rgmp/x86/cxxtest/Make.defs b/configs/rgmp/x86/cxxtest/Make.defs deleted file mode 100644 index b8ab2328bab244e3dd179a864fba0f8bc6efe1b9..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/cxxtest/Make.defs +++ /dev/null @@ -1,107 +0,0 @@ -#################################################################################### -# configs/rgmp/default/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -#ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHCXXFLAGS = -fno-builtin -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -D__RGMP_KERNEL__ -D__RTOS_KERNEL__ -D__SHARE_KERNEL__ -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 - -ARCHXXDEFINES = -ARCHXXINCLUDES = -I$(TOPDIR)/include/cxx -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 \ - -I$(TOPDIR)/include/uClibc++ - -CROSSDEV = -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) \ - $(ARCHXXDEFINES) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) \ - -pipe -nodefaultlibs -nostdinc++ -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = $(shell $(CC) -print-file-name=libsupc++.a) \ - $(shell $(CC) -print-file-name=libgcc_eh.a) - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/x86/cxxtest/defconfig b/configs/rgmp/x86/cxxtest/defconfig deleted file mode 100644 index f103710ecfd86ff4399a18fbc419ff36c11f08ee..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/cxxtest/defconfig +++ /dev/null @@ -1,701 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -CONFIG_DEBUG_INFO=y - -# -# Subsystem Debug Options -# -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_BINFMT is not set -# CONFIG_DEBUG_GRAPHICS is not set -# CONFIG_DEBUG_IRQ is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_GPIO is not set -# CONFIG_DEBUG_AUDIO is not set -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_FULLOPT is not set - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -# CONFIG_RGMP_SUBARCH_ARM is not set -CONFIG_RGMP_SUBARCH_X86=y -CONFIG_RGMP_SUBARCH="x86" - -# -# x86 Peripheral Selections -# -CONFIG_COM1=y -CONFIG_COM2=y -# CONFIG_COM3 is not set -# CONFIG_COM4 is not set - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="cxxtest_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set -# CONFIG_NET_DUMPPACKET is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -# CONFIG_NET_BROADCAST is not set -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=16 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -CONFIG_ARCH_STRCHR=y -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -# CONFIG_CXX_NEWLONG is not set - -# -# uClibc++ Standard C++ Library -# -CONFIG_UCLIBCXX=y -CONFIG_UCLIBCXX_EXCEPTION=y -CONFIG_UCLIBCXX_IOSTREAM_BUFSIZE=32 -CONFIG_UCLIBCXX_HAVE_LIBSUPCXX=y - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -CONFIG_EXAMPLES_CXXTEST=y -CONFIG_EXAMPLES_CXXTEST_CXXINITIALIZE=y -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -# CONFIG_NETUTILS_TFTPC is not set -# CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_NETLIB is not set -# CONFIG_NETUTILS_WEBCLIENT is not set -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -# CONFIG_NSH_LIBRARY is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -# CONFIG_SYSTEM_READLINE is not set - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/x86/cxxtest/setenv.sh b/configs/rgmp/x86/cxxtest/setenv.sh deleted file mode 100755 index a6a533e477cc29970cdc716f5fb7c581020b9dd8..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/cxxtest/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/default/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/rgmp/x86/default/Make.defs b/configs/rgmp/x86/default/Make.defs deleted file mode 100644 index 2fed4fdcf867522b020a057875affe75d39b2ce2..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/default/Make.defs +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################ -# configs/rgmp/default/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHDEFINES = -D__RGMP_KERNEL__ -D__RTOS_KERNEL__ -D__SHARE_KERNEL__ -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 -ARCHSCRIPT = - -CROSSDEV = -CC = $(CROSSDEV)gcc -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = - - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/x86/default/defconfig b/configs/rgmp/x86/default/defconfig deleted file mode 100644 index ac4dc3c6321067890cb4492ded3e13bd7191f4bb..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/default/defconfig +++ /dev/null @@ -1,668 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_FULLOPT is not set - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -# CONFIG_RGMP_SUBARCH_ARM is not set -CONFIG_RGMP_SUBARCH_X86=y -CONFIG_RGMP_SUBARCH="x86" - -# -# x86 Peripheral Selections -# -CONFIG_COM1=y -CONFIG_COM2=y -# CONFIG_COM3 is not set -# CONFIG_COM4 is not set - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="rgmp_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -# CONFIG_NET_BROADCAST is not set -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=16 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -CONFIG_ARCH_STRCHR=y -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -CONFIG_EXAMPLES_RGMP=y -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -# CONFIG_NETUTILS_TFTPC is not set -# CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_NETLIB is not set -# CONFIG_NETUTILS_WEBCLIENT is not set -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -# CONFIG_NSH_LIBRARY is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -# CONFIG_SYSTEM_READLINE is not set - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/x86/default/setenv.sh b/configs/rgmp/x86/default/setenv.sh deleted file mode 100755 index bfb02549bd4817af97a105e83286aff6683c57af..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/default/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/default/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/rgmp/x86/helloxx/Make.defs b/configs/rgmp/x86/helloxx/Make.defs deleted file mode 100644 index 440c85913590b68a5143780e687ed18251592ae0..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/helloxx/Make.defs +++ /dev/null @@ -1,105 +0,0 @@ -#################################################################################### -# configs/rgmp/default/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHWARNINGSXX = -Wall -Wshadow -Wundef -ARCHDEFINES = -D__RGMP_KERNEL__ -D__RTOS_KERNEL__ -D__SHARE_KERNEL__ -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 - -ARCHXXINCLUDES = -I$(TOPDIR)/include/cxx -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 \ - -I$(TOPDIR)/include/uClibc++ - -CROSSDEV = -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) \ - $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -nodefaultlibs \ - -nostdinc++ -CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = $(shell $(CC) -print-file-name=libsupc++.a) \ - $(shell $(CC) -print-file-name=libgcc_eh.a) - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/x86/helloxx/defconfig b/configs/rgmp/x86/helloxx/defconfig deleted file mode 100644 index f911ae8c270a8e45fcabdb6527291ffb0d486b9d..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/helloxx/defconfig +++ /dev/null @@ -1,698 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -CONFIG_DEBUG_INFO=y - -# -# Subsystem Debug Options -# -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_BINFMT is not set -# CONFIG_DEBUG_GRAPHICS is not set -# CONFIG_DEBUG_IRQ is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_GPIO is not set -# CONFIG_DEBUG_AUDIO is not set -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_FULLOPT is not set - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -# CONFIG_RGMP_SUBARCH_ARM is not set -CONFIG_RGMP_SUBARCH_X86=y -CONFIG_RGMP_SUBARCH="x86" - -# -# x86 Peripheral Selections -# -CONFIG_COM1=y -CONFIG_COM2=y -# CONFIG_COM3 is not set -# CONFIG_COM4 is not set - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="helloxx_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set -# CONFIG_NET_DUMPPACKET is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -# CONFIG_NET_BROADCAST is not set -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=16 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -CONFIG_ARCH_STRCHR=y -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -# CONFIG_CXX_NEWLONG is not set - -# -# uClibc++ Standard C++ Library -# -# CONFIG_UCLIBCXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CXXTEST is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -CONFIG_EXAMPLES_HELLOXX=y -CONFIG_EXAMPLES_HELLOXX_CXXINITIALIZE=y -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -# CONFIG_EXAMPLES_NSH is not set -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -# CONFIG_NETUTILS_CODECS is not set -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -# CONFIG_NETUTILS_TFTPC is not set -# CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_NETLIB is not set -# CONFIG_NETUTILS_WEBCLIENT is not set -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -# CONFIG_NSH_LIBRARY is not set - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -# CONFIG_SYSTEM_READLINE is not set - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/x86/helloxx/setenv.sh b/configs/rgmp/x86/helloxx/setenv.sh deleted file mode 100755 index a6a533e477cc29970cdc716f5fb7c581020b9dd8..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/helloxx/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/default/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/rgmp/x86/nsh/Make.defs b/configs/rgmp/x86/nsh/Make.defs deleted file mode 100644 index fb81d4f577afce6eabef0e7475942befa3245061..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/nsh/Make.defs +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################ -# configs/rgmp/nsh/Make.defs -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# -############################################################################ - -include ${TOPDIR}/.config -include ${TOPDIR}/tools/Config.mk - -RGMPLIBDIR := $(RGMP_INST_DIR)/lib -RGMPINCDIR := $(RGMP_INST_DIR)/include -RGMPLKSCPT := $(RGMP_INST_DIR)/etc/rgmp.ld - -HOSTOS = ${shell uname -o} - -ifeq ($(CONFIG_DEBUG_SYMBOLS),y) - ARCHOPTIMIZATION = -O2 -gstabs -else - ARCHOPTIMIZATION = -O2 -endif - -ARCHCPUFLAGS = -fno-builtin -nostdinc -fno-stack-protector -ARCHPICFLAGS = -fpic -ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -ARCHDEFINES = -D__RGMP_KERNEL__ -D__RTOS_KERNEL__ -D__SHARE_KERNEL__ -ARCHINCLUDES = -I. -isystem $(TOPDIR)/include -I$(RGMPINCDIR) \ - -I$(TOPDIR)/configs/rgmp/include -I$(TOPDIR)/arch/rgmp/include/x86 -ARCHSCRIPT = - -CROSSDEV = -CC = $(CROSSDEV)gcc -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ - -ASMEXT = .S -OBJEXT = .o -LIBEXT = .a - -ifeq ($(HOSTOS),Cygwin) - EXEEXT = .exe -else - EXEEXT = -endif - -LDFLAGS += -nostdlib -EXTRA_LIBS = - - -MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) - -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe -HOSTLDFLAGS = diff --git a/configs/rgmp/x86/nsh/defconfig b/configs/rgmp/x86/nsh/defconfig deleted file mode 100644 index 73534eae29d5bf5466a66ad90678a435a56cb165..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/nsh/defconfig +++ /dev/null @@ -1,782 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Nuttx/ Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set - -# -# Build Configuration -# -# CONFIG_APPS_DIR="../apps" -# CONFIG_BUILD_2PASS is not set - -# -# Binary Output Formats -# -# CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set -# CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set - -# -# Customize Header Files -# -CONFIG_ARCH_STDINT_H=y -CONFIG_ARCH_STDBOOL_H=y -CONFIG_ARCH_MATH_H=y -# CONFIG_ARCH_FLOAT_H is not set -# CONFIG_ARCH_STDARG_H is not set - -# -# Debug Options -# -# CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_STACKCHECK is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_INFO is not set - -# -# Subsystem Debug Options -# -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_NET is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_BINFMT is not set -# CONFIG_DEBUG_GRAPHICS is not set -# CONFIG_DEBUG_IRQ is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_GPIO is not set -# CONFIG_DEBUG_AUDIO is not set -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_ARCH_HAVE_CUSTOMOPT is not set -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_FULLOPT is not set - -# -# System Type -# -# CONFIG_ARCH_ARM is not set -# CONFIG_ARCH_AVR is not set -# CONFIG_ARCH_HC is not set -# CONFIG_ARCH_MIPS is not set -CONFIG_ARCH_RGMP=y -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SIM is not set -# CONFIG_ARCH_X86 is not set -# CONFIG_ARCH_Z16 is not set -# CONFIG_ARCH_Z80 is not set -CONFIG_ARCH="rgmp" - -# -# RGMP Configuration Options -# -# CONFIG_RGMP_SUBARCH_ARM is not set -CONFIG_RGMP_SUBARCH_X86=y -CONFIG_RGMP_SUBARCH="x86" - -# -# x86 Peripheral Selections -# -CONFIG_COM1=y -CONFIG_COM2=y -# CONFIG_COM3 is not set -# CONFIG_COM4 is not set - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_ARCH_HAVE_VFORK is not set -# CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_STACKDUMP is not set -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=5000 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -# CONFIG_ARCH_HAVE_INTERRUPTSTACK is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -CONFIG_BOOT_RUNFROMFLASH=y -# CONFIG_BOOT_RUNFROMISRAM is not set -# CONFIG_BOOT_RUNFROMSDRAM is not set -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x0 -CONFIG_RAM_SIZE=0 -# CONFIG_ARCH_HAVE_SDRAM is not set - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RGMP=y -# CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="rgmp" - -# -# Common Board Options -# -CONFIG_NSH_MMCSDMINOR=0 - -# -# Board-Specific Options -# - -# -# RTOS Features -# -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=1000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=31 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=27 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_POSIX_TIMERS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_DISABLE_SIGNALS is not set -# CONFIG_DISABLE_MQUEUE is not set -# CONFIG_DISABLE_ENVIRON is not set - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCONDTIMEDOUT=16 - -# -# Sizes of configurable things (0 disables) -# -CONFIG_MAX_TASKS=64 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=32 -CONFIG_NFILE_STREAMS=16 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=32 -CONFIG_WDOG_INTRESERVE=4 -CONFIG_PREALLOC_TIMERS=8 - -# -# Stack and heap information -# -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_USERMAIN_STACKSIZE=4096 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=8192 - -# -# Device Drivers -# -CONFIG_DISABLE_POLL=y -CONFIG_DEV_NULL=y -# CONFIG_DEV_ZERO is not set -# CONFIG_DEV_LOOP is not set -# CONFIG_RAMDISK is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set -# CONFIG_SPI is not set -# CONFIG_I2S is not set -# CONFIG_RTC is not set -# CONFIG_WATCHDOG is not set -# CONFIG_ANALOG is not set -# CONFIG_AUDIO_DEVICES is not set -# CONFIG_VIDEO_DEVICES is not set -# CONFIG_BCH is not set -# CONFIG_INPUT is not set -# CONFIG_LCD is not set -# CONFIG_MMCSD is not set -# CONFIG_MTD is not set -CONFIG_NETDEVICES=y - -# -# General Ethernet MAC Driver Options -# -# CONFIG_NETDEV_MULTINIC is not set -# CONFIG_NET_DUMPPACKET is not set - -# -# External Ethernet MAC Device Support -# -# CONFIG_NET_DM90x0 is not set -# CONFIG_ENC28J60 is not set -# CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set -# CONFIG_NET_SLIP is not set -CONFIG_NET_VNET=y -CONFIG_VNET_NINTERFACES=1 -# CONFIG_PIPES is not set -# CONFIG_PM is not set -# CONFIG_POWER is not set -# CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_16550_UART is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -# CONFIG_SCI0_SERIALDRIVER is not set -# CONFIG_SCI1_SERIALDRIVER is not set -# CONFIG_USART0_SERIALDRIVER is not set -# CONFIG_USART1_SERIALDRIVER is not set -# CONFIG_USART2_SERIALDRIVER is not set -# CONFIG_USART3_SERIALDRIVER is not set -# CONFIG_USART4_SERIALDRIVER is not set -# CONFIG_USART5_SERIALDRIVER is not set -# CONFIG_USART6_SERIALDRIVER is not set -# CONFIG_USART7_SERIALDRIVER is not set -# CONFIG_USART8_SERIALDRIVER is not set - -# -# USART Configuration -# -# CONFIG_MCU_SERIAL is not set -# CONFIG_STANDARD_SERIAL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# - -# -# System Logging -# -# CONFIG_RAMLOG is not set - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -# CONFIG_NET_NOINTS is not set -CONFIG_NET_IPv4=y -# CONFIG_NET_MULTIBUFFER is not set -# CONFIG_NET_PROMISCUOUS is not set -CONFIG_NSOCKET_DESCRIPTORS=5 -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOCKOPTS=y -# CONFIG_NET_SOLINGER is not set -CONFIG_NET_ETH_MTU=1514 -# CONFIG_NET_TCPURGDATA is not set - -# -# TCP/IP Networking -# -CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_TCP_READAHEAD=y -# CONFIG_NET_TCP_WRITE_BUFFERS is not set -CONFIG_NET_TCP_RECVDELAY=0 -# CONFIG_NET_TCPBACKLOG is not set -# CONFIG_NET_TCP_SPLIT is not set -# CONFIG_NET_SENDFILE is not set - -# -# UDP Networking -# -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_CONNS=8 -CONFIG_NET_BROADCAST=y -# CONFIG_NET_RXAVAIL is not set -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_PING=y -# CONFIG_NET_IGMP is not set -CONFIG_NET_STATISTICS=y -CONFIG_NET_ETH_TCP_RECVWNDO=1460 -CONFIG_NET_ARPTAB_SIZE=8 -# CONFIG_NET_ARP_IPIN is not set -CONFIG_NET_IOB=y -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_BUFSIZE=196 -CONFIG_IOB_NCHAINS=8 -CONFIG_IOB_THROTTLE=0 - -# -# Routing Table Configuration -# -# CONFIG_NET_ROUTE is not set -CONFIG_NET_ETHERNET=y - -# -# File Systems -# - -# -# File system configuration -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set -# CONFIG_FS_RAMMAP is not set -# CONFIG_FS_FAT is not set -# CONFIG_NFS is not set -# CONFIG_FS_NXFFS is not set -# CONFIG_FS_ROMFS is not set -# CONFIG_FS_SMARTFS is not set -# CONFIG_FS_PROCFS is not set - -# -# System Logging -# - - -# -# Graphics Support -# -# CONFIG_NX is not set - -# -# Memory Management -# -# CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set -# CONFIG_GRAN is not set - -# -# Audio Support -# -# CONFIG_AUDIO is not set - -# -# Binary Formats -# -# CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set -# CONFIG_NXFLAT is not set -# CONFIG_ELF is not set -# CONFIG_BUILTIN is not set -# CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set - -# -# Library Routines -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -# CONFIG_NOPRINTF_FIELDWIDTH is not set -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -# CONFIG_LIBC_EXECFUNCS is not set -CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 -CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 -# CONFIG_LIBC_STRERROR is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_ARCH_ROMGETC is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -CONFIG_ARCH_MEMCPY=y -CONFIG_ARCH_MEMCMP=y -CONFIG_ARCH_MEMMOVE=y -CONFIG_ARCH_MEMSET=y -CONFIG_ARCH_STRCHR=y -CONFIG_ARCH_STRCMP=y -CONFIG_ARCH_STRCPY=y -CONFIG_ARCH_STRNCPY=y -CONFIG_ARCH_STRLEN=y -CONFIG_ARCH_STRNLEN=y -# CONFIG_ARCH_BZERO is not set - -# -# Non-standard Library Support -# -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_LIB_KBDCODEC is not set -# CONFIG_LIB_SLCDCODEC is not set - -# -# Basic CXX Support -# -# CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set - -# -# Application Configuration -# - -# -# Built-In Applications -# - -# -# Examples -# -# CONFIG_EXAMPLES_BUTTONS is not set -# CONFIG_EXAMPLES_CAN is not set -# CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_DHCPD is not set -# CONFIG_EXAMPLES_ELF is not set -# CONFIG_EXAMPLES_FTPC is not set -# CONFIG_EXAMPLES_FTPD is not set -# CONFIG_EXAMPLES_HELLO is not set -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set -# CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set -# CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set -# CONFIG_EXAMPLES_MM is not set -# CONFIG_EXAMPLES_MODBUS is not set -# CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NETTEST is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set -CONFIG_EXAMPLES_NSH=y -# CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set -# CONFIG_EXAMPLES_NXFFS is not set -# CONFIG_EXAMPLES_NXFLAT is not set -# CONFIG_EXAMPLES_NXHELLO is not set -# CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NXLINES is not set -# CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set -# CONFIG_EXAMPLES_ROMFS is not set -# CONFIG_EXAMPLES_SENDMAIL is not set -# CONFIG_EXAMPLES_SERLOOP is not set -# CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_TCPECHO is not set -# CONFIG_EXAMPLES_TELNETD is not set -# CONFIG_EXAMPLES_THTTPD is not set -# CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_DISCOVER is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set -# CONFIG_EXAMPLES_USBTERM is not set -# CONFIG_EXAMPLES_WATCHDOG is not set -# CONFIG_EXAMPLES_WGET is not set - -# -# Graphics Support -# -# CONFIG_TIFF is not set - -# -# Interpreters -# -# CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set - -# -# Network Utilities -# - -# -# Networking Utilities -# -CONFIG_NETUTILS_CODECS=y -# CONFIG_CODECS_BASE64 is not set -# CONFIG_CODECS_HASH_MD5 is not set -# CONFIG_CODECS_URLCODE is not set -# CONFIG_CODECS_URLCODE_NEWMEMORY is not set -# CONFIG_CODECS_AVR_URLCODE is not set -CONFIG_NETUTILS_DHCPC=y -# CONFIG_NETUTILS_DHCPD is not set -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_JSON is not set -CONFIG_LIBC_NETDB=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=4 -CONFIG_NETDB_DNSCLIENT_MAXRESPONSE=96 -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_NETUTILS_TELNETD is not set -CONFIG_NETUTILS_TFTPC=y -# CONFIG_NETUTILS_THTTPD is not set -CONFIG_NETUTILS_NETLIB=y -CONFIG_NETUTILS_WEBCLIENT=y -CONFIG_NSH_WGET_USERAGENT="NuttX/6.xx.x (; http://www.nuttx.org/)" -# CONFIG_NETUTILS_WEBSERVER is not set -# CONFIG_NETUTILS_DISCOVER is not set -# CONFIG_NETUTILS_XMLRPC is not set - -# -# FreeModBus -# -# CONFIG_MODBUS is not set - -# -# NSH Library -# -CONFIG_NSH_LIBRARY=y -CONFIG_NSH_READLINE=y -# CONFIG_NSH_CLE is not set - -# -# Disable Individual commands -# -# CONFIG_NSH_DISABLE_ADDROUTE is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DELROUTE is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MB is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MH is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PING is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SH is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set - -# -# Configure Command Options -# -CONFIG_NSH_CMDOPT_DF_H=y -CONFIG_NSH_CODECS_BUFSIZE=128 -CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 -CONFIG_NSH_LINELEN=40 -# CONFIG_NSH_DISABLE_SEMICOLON is not set -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_TMPDIR="/tmp" -CONFIG_NSH_MAXARGUMENTS=6 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLEBG is not set -CONFIG_NSH_CONSOLE=y - -# -# USB Trace Support -# -# CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set -# CONFIG_NSH_DHCPC is not set -CONFIG_NSH_IPADDR=0xc0a80a02 -CONFIG_NSH_DRIPADDR=0xc0a80a01 -CONFIG_NSH_NETMASK=0xffffff00 -# CONFIG_NSH_DNS is not set -# CONFIG_NSH_NOMAC is not set -CONFIG_NSH_MAX_ROUNDTRIP=20 - -# -# NxWidgets/NxWM -# - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set - -# -# System Libraries and NSH Add-Ons -# - -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - -# -# Custom Free Memory Command -# -# CONFIG_SYSTEM_FREE is not set - -# -# I2C tool -# - -# -# INI File Parser -# -# CONFIG_FSUTILS_INIFILE is not set - -# -# FLASH Program Installation -# -# CONFIG_SYSTEM_INSTALL is not set - -# -# FLASH Erase-all Command -# - -# -# NxPlayer media player library / command Line -# -# CONFIG_SYSTEM_NXPLAYER is not set - -# -# RAM test -# -# CONFIG_SYSTEM_RAMTEST is not set - -# -# readline() -# -CONFIG_SYSTEM_READLINE=y -CONFIG_READLINE_ECHO=y - -# -# Power Off -# -# CONFIG_SYSTEM_POWEROFF is not set - -# -# RAMTRON -# - -# -# SD Card -# - -# -# Sysinfo -# - -# -# USB Monitor -# - -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - -# -# VI Work-Alike Editor -# -# CONFIG_SYSTEM_VI is not set - -# -# Stack Monitor -# - -# -# USB Mass Storage Device Commands -# - -# -# Zmodem Commands -# -# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/rgmp/x86/nsh/setenv.sh b/configs/rgmp/x86/nsh/setenv.sh deleted file mode 100755 index b2180473be88bd929e3b09fd39ed6b7574196298..0000000000000000000000000000000000000000 --- a/configs/rgmp/x86/nsh/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# config/rgmp/nsh/setenv.sh -# -# Copyright (C) 2011 Yu Qiang. All rights reserved. -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Authors: Yu Qiang -# Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - -#export NUTTX_BIN= -#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG} - -echo "PATH : ${PATH}" diff --git a/configs/sabre-6quad/README.txt b/configs/sabre-6quad/README.txt index 02e6acb6ec81fb1734d6a19e63eae8f4c49d0e4d..a9703e5a28be81e7dad0fca292c0cd1ab5bb49bd 100644 --- a/configs/sabre-6quad/README.txt +++ b/configs/sabre-6quad/README.txt @@ -101,6 +101,26 @@ Status +if (up_cpu_index() == 0) return 17; // REMOVE ME +2016-11-26: With regard to SMP, the major issue is cache coherency. I added + some special build logic to move spinlock data into the separate, non- + cached section. That gives an improvement in performance but there are + still hangs. These, I have determined, are to other kinds of cache + coherency problems. Semaphores, message queues, etc. basically all + shared data must be made coherent. + + I also added some SCU controls that should enable cache consistency for SMP + CPUs, but I don't think I have that working right yet. See the SMP section + below for more information. + +2016-11-28: SMP is unusable until the SCU cache coherency logic is fixed. + I do not know how to do that now. + +2016-12-01: I committed a completely untest SPI driver. This was taken + directly from the i.MX1 and is most certainly not ready for use yet. + +2016-12-07: Just a note to remind myself. The PL310 L2 cache has *not* + yet been enbled. + Platform Features ================= @@ -482,9 +502,6 @@ The i.MX6 6Quad has 4 CPUs. Support is included for testing an SMP configuration. That configuration is still not yet ready for usage but can be enabled with the following configuration settings: - Build Setup: - CONFIG_EXPERIMENTAL=y - RTOS Features -> Tasks and Scheduling CONFIG_SPINLOCK=y CONFIG_SMP=y @@ -495,73 +512,64 @@ Open Issues: 1. Currently all device interrupts are handled on CPU0 only. Critical sections will attempt to disable interrupts but will now disable interrupts only on the current - CPU (which may not be CPU0). There is a spinlock to prohibit entrance into these critical sections in interrupt handlers of other CPUs. + CPU (which may not be CPU0). There is a spinlock to prohibit entrance into these + critical sections in interrupt handlers of other CPUs. When the critical section is used to lock a resource that is also used by interupt handling, the interrupt handling logic must also take the spinlock. This will cause the interrupt handlers on other CPUs to spin until - leave_critical_section() is called. More verification is needed, however. - -2. Cache Concurency. This is a complex problem. There is logic in place now to - clean CPU0 D-cache before starting a new CPU and for invalidating the D-Cache - when the new CPU is started. REVISIT: Seems that this should not be necessary. - If the Shareable bit set in the MMU mappings and my understanding is that this - should keep cache coherency at least within a cluster. I need to study more - how the inner and outer shareable attribute works to control cacheing - - But there may are many, many more such cache coherency issues if I cannot find - a systematic way to manage cache coherency. - - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dht0008a/CJABEHDA.html - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/CEGDBEJE.html - - Try: - - --- mmu.h.orig 2016-05-20 13:09:34.773462000 -0600 - +++ mmu.h 2016-05-20 13:03:13.261978100 -0600 - @@ -572,8 +572,14 @@ - - #define MMU_ROMFLAGS (PMD_TYPE_SECT | PMD_SECT_AP_R1 | PMD_CACHEABLE | \ - PMD_SECT_DOM(0)) - -#define MMU_MEMFLAGS (PMD_TYPE_SECT | PMD_SECT_AP_RW1 | PMD_CACHEABLE | \ - +#ifdef CONFIG_SMP - + - +# define MMU_MEMFLAGS (PMD_TYPE_SECT | PMD_SECT_AP_RW1 | PMD_CACHEABLE | \ - + PMD_SECT_S | PMD_SECT_DOM(0)) - +#else - +# define MMU_MEMFLAGS (PMD_TYPE_SECT | PMD_SECT_AP_RW1 | PMD_CACHEABLE | \ - PMD_SECT_DOM(0)) - +#endif - #define MMU_IOFLAGS (PMD_TYPE_SECT | PMD_SECT_AP_RW1 | PMD_DEVICE | \ - PMD_SECT_DOM(0) | PMD_SECT_XN) - #define MMU_STRONGLY_ORDERED (PMD_TYPE_SECT | PMD_SECT_AP_RW1 | \ - - Another alternative would be to place all spinlocks in a non-cachable memory - region. That is problem what will have to be done. - - This is a VERIFIED PROBLEM: I have seen cases where CPU0 sets a spinlock=1 then - tries to lock the spinlock. CPU0 will wait in this case until CPU1 unlocks the - spinlock. Most of this happens correctly; I can see that CPU1 does set the - spinlock=0, but CPU0 never sees the change and spins forever. That is surely - a consequence of cache issues. - - This was observed between up_cpu_pause() and arm_pause_handler() with the - spinlock "g_cpu_paused[cpu]". CPU1 correctly sets g_cpu_paused[cpu] to zero - but CPU0 never sees the change. - -3. Caching probabaly interferes with spinlocks as they are currently implemented. - Waiting on a cached copy of the spinlock may result in a hang or a failure to - wait. - - Should all spinlocks go into a special "strongly ordered" memory region? - - Update: Cache inconsistencies seem to be the root cause of all current SMP - issues. - -5. Assertions. On a fatal assertions, other CPUs need to be stopped. The SCR, - however, only supports disabling CPUs 1 through 3. Perhaps if the assertion - occurs on CPUn, n > 0, then it should use and SGI to perform the assertion - on CPU0 always. From CPU0, CPU1-3 can be disabled. + leave_critical_section() is called. More verification is needed. + +2. Cache Concurency. Cache coherency in SMP configurations is managed by the + MPCore snoop control unit (SCU). But I don't think I have the set up + correctly yet. + + Currently cache inconsistencies appear to be the root cause of all current SMP + issues. SMP works as expected if the caches are disabled, but otherwise there + are problems (usually hangs): + + This will disable the caches: + +diff --git a/arch/arm/src/armv7-a/arm_head.S b/arch/arm/src/armv7-a/arm_head.S +index 27c2a5b..2a6274c 100644 +--- a/arch/arm/src/armv7-a/arm_head.S ++++ b/arch/arm/src/armv7-a/arm_head.S +@@ -454,6 +454,7 @@ __start: + * after SMP cache coherency has been setup. + */ + ++#if 0 // REMOVE ME + #if !defined(CPU_DCACHE_DISABLE) && !defined(CONFIG_SMP) + /* Dcache enable + * +@@ -471,6 +472,7 @@ __start: + + orr r0, r0, #(SCTLR_I) + #endif ++#endif // REMOVE ME + + #ifdef CPU_ALIGNMENT_TRAP + /* Alignment abort enable +diff --git a/arch/arm/src/armv7-a/arm_scu.c b/arch/arm/src/armv7-a/arm_scu.c +index eedf179..1db2092 100644 +--- a/arch/arm/src/armv7-a/arm_scu.c ++++ b/arch/arm/src/armv7-a/arm_scu.c +@@ -156,6 +156,7 @@ static inline void arm_set_actlr(uint32_t actlr) + + void arm_enable_smp(int cpu) + { ++#if 0 // REMOVE ME + uint32_t regval; + + /* Handle actions unique to CPU0 which comes up first */ +@@ -222,6 +223,7 @@ void arm_enable_smp(int cpu) + regval = arm_get_sctlr(); + regval |= SCTLR_C; + arm_set_sctlr(regval); ++#endif // REMOVE ME + } + + #endif Configurations ============== @@ -652,7 +660,6 @@ Configuration sub-directories Device Drivers: CONFIG_RAMLOG - smp --- This is a configuration of testing the SMP configuration. It is diff --git a/configs/sabre-6quad/nsh/defconfig b/configs/sabre-6quad/nsh/defconfig index dfc9ef8d6f4a7cce5da278f4d0a854e85340c983..41a976f71439d17aed82838e56cd338de9fd9a6e 100644 --- a/configs/sabre-6quad/nsh/defconfig +++ b/configs/sabre-6quad/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -271,8 +269,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -452,7 +448,6 @@ CONFIG_DEV_ZERO=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -685,7 +680,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -722,7 +716,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sabre-6quad/scripts/dramboot.ld b/configs/sabre-6quad/scripts/dramboot.ld index f1134bcc926c23f12a5d115d3c686d1439cab021..a5d696c5ce061aea9c92fce7dd210d547341e63c 100644 --- a/configs/sabre-6quad/scripts/dramboot.ld +++ b/configs/sabre-6quad/scripts/dramboot.ld @@ -123,6 +123,7 @@ SECTIONS } > ddr3 /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } diff --git a/configs/sabre-6quad/smp/defconfig b/configs/sabre-6quad/smp/defconfig index 23afd07fe969ac41662b98842b2c57978f394b81..d470592436e8cbfe6dcb80fe5ee1285875fd2c0a 100644 --- a/configs/sabre-6quad/smp/defconfig +++ b/configs/sabre-6quad/smp/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -274,8 +272,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -319,7 +315,7 @@ CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set CONFIG_TASK_NAME_SIZE=31 -CONFIG_MAX_TASKS=16 +CONFIG_MAX_TASKS=32 # CONFIG_SCHED_HAVE_PARENT is not set CONFIG_SCHED_WAITPID=y @@ -328,6 +324,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -458,7 +456,6 @@ CONFIG_DEV_ZERO=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -652,6 +649,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -692,7 +691,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -729,7 +727,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -737,7 +734,10 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set # CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMP is not set +CONFIG_EXAMPLES_SMP=y +CONFIG_EXAMPLES_SMP_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_SMP_PRIORITY=100 +CONFIG_EXAMPLES_SMP_STACKSIZE=2048 # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set @@ -865,6 +865,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" diff --git a/configs/sabre-6quad/src/imx_boardinit.c b/configs/sabre-6quad/src/imx_boardinit.c index f67592caf87ec1587ad62b2219c52a04653bd96c..80dbc589a1bb56c8848b9fc5314f613cc8304366 100644 --- a/configs/sabre-6quad/src/imx_boardinit.c +++ b/configs/sabre-6quad/src/imx_boardinit.c @@ -62,14 +62,40 @@ * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: imx_memory_initialize + * + * Description: + * All i.MX6 architectures must provide the following entry point. This + * entry point is called early in the initialization before memory has + * been configured. This board-specific function is responsible for + * configuring any on-board memories. + * + * Logic in imx_memory_initialize must be careful to avoid using any + * global variables because those will be uninitialized at the time this + * function is called. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void imx_memory_initialize(void) +{ + /* SDRAM was initialized by a bootloader in the supported configurations. */ +} + /**************************************************************************** * Name: imx_board_initialize * * Description: * All i.MX6 architectures must provide the following entry point. This - * entry point is called early in the initialization -- after all memory - * has been configured and mapped but before any devices have been - * initialized. + * entry point is called in the initialization phase -- after + * imx_memory_initialize and after all memory has been configured and + * mapped but before any devices have been initialized. * * Input Parameters: * None diff --git a/configs/sabre-6quad/src/imx_bringup.c b/configs/sabre-6quad/src/imx_bringup.c index 13f1742c15407eac29a65a6bbe1b8da343356adf..6c3f4949ba26834c6ab1ac7f8653bc4d19c4da19 100644 --- a/configs/sabre-6quad/src/imx_bringup.c +++ b/configs/sabre-6quad/src/imx_bringup.c @@ -40,7 +40,8 @@ #include #include -#include +#include +#include #include "sabre-6quad.h" @@ -58,5 +59,18 @@ int imx_bringup(void) { + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/sam3u-ek/knsh/defconfig b/configs/sam3u-ek/knsh/defconfig index a28be4c76b1246eb92b6c962acfcf966a35fe604..23349ef9a84d4f3d2d9dfe31b71c63ce7f199a4b 100644 --- a/configs/sam3u-ek/knsh/defconfig +++ b/configs/sam3u-ek/knsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -513,7 +511,6 @@ CONFIG_MMCSD_NSLOTS=1 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -752,7 +749,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sam3u-ek/nsh/defconfig b/configs/sam3u-ek/nsh/defconfig index 293d0a2ad1f5bb689cf4015b2bdaf36e301b1fbe..0de76352604b4d95512b50d2e7f10b2d72f27fce 100644 --- a/configs/sam3u-ek/nsh/defconfig +++ b/configs/sam3u-ek/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -336,8 +334,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -500,7 +496,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -744,7 +739,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sam3u-ek/nx/defconfig b/configs/sam3u-ek/nx/defconfig index 14c3f405f4a8b83fa950c1e78593a851052868ad..87b7722e880646725fe46b51bb51db6f65388591 100644 --- a/configs/sam3u-ek/nx/defconfig +++ b/configs/sam3u-ek/nx/defconfig @@ -60,10 +60,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -73,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -331,6 +332,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set # CONFIG_LIB_BOARDCTL is not set # @@ -349,6 +351,7 @@ CONFIG_DISABLE_ENVIRON=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2010 CONFIG_START_MONTH=4 @@ -441,6 +444,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -456,12 +460,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -469,7 +477,12 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -491,6 +504,7 @@ CONFIG_LCD_MAXPOWER=31 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -522,7 +536,6 @@ CONFIG_LCD_PORTRAIT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -572,9 +585,12 @@ CONFIG_UART0_2STOP=0 # CONFIG_UART0_IFLOWCONTROL is not set # CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -588,6 +604,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -751,6 +768,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -776,6 +795,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -795,9 +815,9 @@ CONFIG_ARCH_HAVE_TLS=y # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -836,12 +856,10 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -878,6 +896,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -914,13 +933,14 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sam3u-ek/nxwm/defconfig b/configs/sam3u-ek/nxwm/defconfig index 1aa256be23914adbd1ef92b25f2a993b07c5d32d..6a703bbd9510d815842f0d4808f88e156a143308 100644 --- a/configs/sam3u-ek/nxwm/defconfig +++ b/configs/sam3u-ek/nxwm/defconfig @@ -60,10 +60,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -73,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -334,17 +335,15 @@ CONFIG_ARCH_HAVE_BUTTONS=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_HAVE_IRQBUTTONS=y # CONFIG_ARCH_IRQBUTTONS is not set -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -364,6 +363,7 @@ CONFIG_DISABLE_OS_API=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2013 CONFIG_START_MONTH=6 @@ -376,6 +376,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -392,6 +393,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -434,7 +437,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -462,6 +465,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=1024 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -477,21 +481,24 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -516,7 +523,12 @@ CONFIG_ADS7843E_THRESHY=39 # CONFIG_BUTTONS is not set # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -539,6 +551,7 @@ CONFIG_LCD_MAXPOWER=31 # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -570,7 +583,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -620,9 +632,12 @@ CONFIG_UART0_2STOP=0 # CONFIG_UART0_IFLOWCONTROL is not set # CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -636,6 +651,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -756,13 +772,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=325 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -782,7 +799,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -828,6 +848,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -846,6 +868,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -854,6 +878,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -880,9 +905,9 @@ CONFIG_CXX_NEWLONG=y # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -911,12 +936,10 @@ CONFIG_CXX_NEWLONG=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -954,6 +977,7 @@ CONFIG_CXX_NEWLONG=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1018,12 +1042,12 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_LS is not set # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1040,11 +1064,13 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_FILEIOSIZE=512 @@ -1075,10 +1101,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=1596 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=1596 @@ -1172,7 +1195,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -1253,7 +1276,7 @@ CONFIG_NXWM_HEXCALCULATOR_FONTID=5 # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -1263,6 +1286,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/pirelli_dpl10/Kconfig b/configs/sam4cmp-db/Kconfig similarity index 80% rename from configs/pirelli_dpl10/Kconfig rename to configs/sam4cmp-db/Kconfig index f72f3c094ce4c8f031445c514c343376e4e79e75..9080dfce40d0defb3136c79fbc87a69b4affc074 100644 --- a/configs/pirelli_dpl10/Kconfig +++ b/configs/sam4cmp-db/Kconfig @@ -2,3 +2,6 @@ # For a description of the syntax of this configuration file, # see the file kconfig-language.txt in the NuttX tools repository. # + +if ARCH_BOARD_SAM4CMP_DB +endif diff --git a/configs/sam4cmp-db/README.txt b/configs/sam4cmp-db/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..efe90a669077e28d83339cd8efa6dd223f4a4eef --- /dev/null +++ b/configs/sam4cmp-db/README.txt @@ -0,0 +1,28 @@ +README +^^^^^^ + +README for NuttX port to the SAM4CMP-DB board. + + http://www.atmel.com/tools/SAM4CMP-DB.aspx + +The board is intended to test NuttX SMP features for dual Cortex-M4. + + +Settings +^^^^^^^^ +1. Both CPUs are running at 92.160MHz with PLLB. +2. Serial console can be used via on-board USB-UART (115200/8/N/1) +3. Interrupt handlers such as timer and UART are handled on CPU0 +4. Both CPUs share internal SRAM0 (128KB) +5. SRAM1 is used to boot CPU1. +6. Cache controllers are disabled because of no snooping features. + +Status +^^^^^^ +Currently SMP freature works on the board but is not stable. + +1. "nsh> sleep 1 &" works without crash. +2. "nsh> smp " sometimes works but some assertions might happen. +3. "nsh> ostest " causes deadlocks during the test. + + diff --git a/configs/sam4cmp-db/include/board.h b/configs/sam4cmp-db/include/board.h new file mode 100644 index 0000000000000000000000000000000000000000..1339e6ec670dc725add60ea45d8e51bd1402d6af --- /dev/null +++ b/configs/sam4cmp-db/include/board.h @@ -0,0 +1,178 @@ +/************************************************************************************ + * configs/sam4cmp-db/include/board.h + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __CONFIGS_SAM4CMP_DB_INCLUDE_BOARD_H +#define __CONFIGS_SAM4CMP_DB_INCLUDE_BOARD_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#ifndef __ASSEMBLY__ +# include +#endif + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Clocking *************************************************************************/ +/* After power-on reset, the sam3u device is running on a 4MHz internal RC. These + * definitions will configure clocking with MCK = 48MHz, PLLA = 96, and CPU=120MHz. + */ + +/* Main oscillator register settings */ + +#define BOARD_CKGR_MOR_MOSCXTST (63 << PMC_CKGR_MOR_MOSCXTST_SHIFT) /* Start-up Time */ + +/* PLLA configuration: + * + * Source: 12MHz crystall at 12MHz + * PLLdiv: 10 + * PLLmul: 1 (bypassed) + * Fpll: (12MHz * 10) / 1 = 120MHz + */ + +#define BOARD_MAINOSC_FREQUENCY (8192000) +#define BOARD_CKGR_PLLAR_MUL (9 << PMC_CKGR_PLLAR_MUL_SHIFT) +#define BOARD_CKGR_PLLAR_DIV PMC_CKGR_PLLAR_DIV_BYPASS +#define BOARD_CKGR_PLLAR_COUNT (63 << PMC_CKGR_PLLAR_COUNT_SHIFT) +#define BOARD_PLLA_FREQUENCY (10*BOARD_MAINOSC_FREQUENCY) + +/* PLLB configuration + * + * Source: MAIN clock (i.e. 8.192MHz) + * PLLdiv: 4 + * PLLmul: 45 + * Fpll: (8.192MHz * (44+1) / 4 = 92.120 MHz + */ + +#define BOARD_CKGR_PLLBR_SRCB (0 << PMC_CKGR_PLLBR_SRCB_SHIFT) +#define BOARD_CKGR_PLLBR_DIV (4 << PMC_CKGR_PLLBR_DIV_SHIFT) +#define BOARD_CKGR_PLLBR_MUL (44 << PMC_CKGR_PLLBR_MUL_SHIFT) +#define BOARD_CKGR_PLLBR_COUNT (63 << PMC_CKGR_PLLBR_COUNT_SHIFT) +#define BOARD_PLLB_FREQUENCY (92160000) + + +/* PMC master clock register settings */ + +#define BOARD_PMC_MCKR_CSS PMC_MCKR_CSS_PLLB +#define BOARD_PMC_MCKR_PRES PMC_MCKR_PRES_DIV1 +#define BOARD_MCK_FREQUENCY (BOARD_PLLB_FREQUENCY/1) +#define BOARD_CPU_FREQUENCY (BOARD_PLLB_FREQUENCY/1) + +/* USB UTMI PLL start-up time */ + +#define BOARD_CKGR_UCKR_UPLLCOUNT (3 << PMC_CKGR_UCKR_UPLLCOUNT_SHIFT) + +/* FLASH wait states: + * + * DC Characteristics + * + * Parameter Min Typ Max + * ---------------------- ----- ----- ---- + * Vddcore DC Supply Core 1.08V 1.2V 1.32V + * Vvddio DC Supply I/Os 1.62V 3.3V 3.6V + * + * Wait Maximum + * Vddcore Vvddio States Frequency (MHz) + * ------- ---------- ------ --------------- + * 1.08V 1.62-3.6V 0 16 + * " " " "-" " 1 33 + * " " " "-" " 2 50 + * " " " "-" " 3 67 + * " " " "-" " 4 84 + * " " " "-" " 5 100 + * 1.08V 2.7-3.6V 0 20 + * " " " "-" " 1 40 + * " " " "-" " 2 60 + * " " " "-" " 3 80 + * " " " "-" " 4 100 + * 1.2V 1.62-3.6V 0 17 + * " " " "-" " 1 34 + * " " " "-" " 2 52 + * " " " "-" " 3 69 + * " " " "-" " 4 87 + * " " " "-" " 5 104 + * " " " "-" " 6 121 + * 1.2V 2.7-3.6V 0 21 + * " " " "-" " 1 42 + * " " " "-" " 2 63 + * " " " "-" " 3 84 + * " " " "-" " 4 105 + * " " " "-" " 5 123 << SELECTION + */ + +#define BOARD_FWS 5 + +/************************************************************************************ + * Public Data + ************************************************************************************/ + +#ifndef __ASSEMBLY__ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ +/************************************************************************************ + * Name: sam_boardinitialize + * + * Description: + * All SAM3U architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void sam_boardinitialize(void); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_SAM4CMP_DB_INCLUDE_BOARD_H */ diff --git a/configs/hymini-stm32v/buttons/Make.defs b/configs/sam4cmp-db/nsh/Make.defs similarity index 93% rename from configs/hymini-stm32v/buttons/Make.defs rename to configs/sam4cmp-db/nsh/Make.defs index 8a2b9857ab32d81bdccc1c986075a3b573ff9ed4..60acde6e28e7f5846ec8d7d71677e6945730ab0f 100644 --- a/configs/hymini-stm32v/buttons/Make.defs +++ b/configs/sam4cmp-db/nsh/Make.defs @@ -1,8 +1,8 @@ ############################################################################ -# configs/hymini-stm32v/buttons/Make.defs +# configs/sam4cmp-db/nsh/Make.defs # -# Copyright (C) 2011, 2012 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. +# Author: Masayuki Ishikawa # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -37,12 +37,6 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs -ifeq ($(CONFIG_STM32_DFU),y) - LDSCRIPT = ld.script.dfu -else - LDSCRIPT = ld.script -endif - ifeq ($(WINTOOL),y) # Windows-native toolchains DIRLINK = $(TOPDIR)/tools/copydir.sh @@ -50,13 +44,13 @@ ifeq ($(WINTOOL),y) MKDEP = $(TOPDIR)/tools/mkwindeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}" else # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script endif CC = $(CROSSDEV)gcc diff --git a/configs/compal_e86/nsh_highram/defconfig b/configs/sam4cmp-db/nsh/defconfig similarity index 66% rename from configs/compal_e86/nsh_highram/defconfig rename to configs/sam4cmp-db/nsh/defconfig index 0eb2bee40dfd948ca71e364f46b1a7497628e208..118b123cef12afc46c06efcd47227b246bb6f6ce 100644 --- a/configs/compal_e86/nsh_highram/defconfig +++ b/configs/sam4cmp-db/nsh/defconfig @@ -6,7 +6,7 @@ # # Build Setup # -# CONFIG_EXPERIMENTAL is not set +CONFIG_EXPERIMENTAL=y # CONFIG_DEFAULT_SMALL is not set CONFIG_HOST_LINUX=y # CONFIG_HOST_OSX is not set @@ -43,15 +43,44 @@ CONFIG_RAW_BINARY=y # Debug Options # CONFIG_DEBUG_ALERT=y -# CONFIG_DEBUG_FEATURES is not set +CONFIG_DEBUG_FEATURES=y + +# +# Debug SYSLOG Output Controls +# +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_WARN=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_ASSERTIONS=y + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_GRAPHICS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set + +# +# OS Function Debug Options +# +# CONFIG_DEBUG_IRQ is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_GPIO is not set +# CONFIG_DEBUG_TIMER is not set CONFIG_ARCH_HAVE_STACKCHECK=y # CONFIG_STACK_COLORATION is not set # CONFIG_ARCH_HAVE_HEAPCHECK is not set -# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_DEBUG_SYMBOLS=y CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set +CONFIG_DEBUG_NOOPT=y # CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y +# CONFIG_DEBUG_FULLOPT is not set # # System Type @@ -60,10 +89,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -73,7 +104,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -CONFIG_ARCH_CHIP_CALYPSO=y # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -92,7 +122,7 @@ CONFIG_ARCH_CHIP_CALYPSO=y # CONFIG_ARCH_CHIP_SAMA5 is not set # CONFIG_ARCH_CHIP_SAMD is not set # CONFIG_ARCH_CHIP_SAML is not set -# CONFIG_ARCH_CHIP_SAM34 is not set +CONFIG_ARCH_CHIP_SAM34=y # CONFIG_ARCH_CHIP_SAMV7 is not set # CONFIG_ARCH_CHIP_STM32 is not set # CONFIG_ARCH_CHIP_STM32F7 is not set @@ -100,12 +130,12 @@ CONFIG_ARCH_CHIP_CALYPSO=y # CONFIG_ARCH_CHIP_STR71X is not set # CONFIG_ARCH_CHIP_TMS570 is not set # CONFIG_ARCH_CHIP_MOXART is not set -CONFIG_ARCH_ARM7TDMI=y +# CONFIG_ARCH_ARM7TDMI is not set # CONFIG_ARCH_ARM926EJS is not set # CONFIG_ARCH_ARM920T is not set # CONFIG_ARCH_CORTEXM0 is not set # CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set +CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXM7 is not set # CONFIG_ARCH_CORTEXA5 is not set # CONFIG_ARCH_CORTEXA8 is not set @@ -116,54 +146,125 @@ CONFIG_ARCH_ARM7TDMI=y # CONFIG_ARCH_CORTEX5F is not set # CONFIG_ARCH_CORTEXR7 is not set # CONFIG_ARCH_CORTEXR7F is not set -CONFIG_ARCH_FAMILY="arm" -CONFIG_ARCH_CHIP="calypso" +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="sam34" # CONFIG_ARM_TOOLCHAIN_IAR is not set -# CONFIG_ARM_TOOLCHAIN_GNU is not set +CONFIG_ARM_TOOLCHAIN_GNU=y +# CONFIG_ARMV7M_USEBASEPRI is not set +CONFIG_ARCH_HAVE_CMNVECTOR=y +# CONFIG_ARMV7M_CMNVECTOR is not set +# CONFIG_ARMV7M_LAZYFPU is not set # CONFIG_ARCH_HAVE_FPU is not set # CONFIG_ARCH_HAVE_DPFPU is not set # CONFIG_ARCH_HAVE_TRUSTZONE is not set -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -# CONFIG_ARCH_LOWVECTORS is not set - -# -# ARM Configuration Options -# -# CONFIG_ARM_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARM_TOOLCHAIN_CODESOURCERYL is not set -CONFIG_ARM_TOOLCHAIN_GNU_EABIL=y -# CONFIG_ARM_TOOLCHAIN_GNU_OABI is not set -CONFIG_UART_IRDA_BAUD=115200 -CONFIG_UART_IRDA_PARITY=0 -CONFIG_UART_IRDA_BITS=8 -CONFIG_UART_IRDA_2STOP=0 -CONFIG_UART_IRDA_RXBUFSIZE=256 -CONFIG_UART_IRDA_TXBUFSIZE=256 -CONFIG_UART_MODEM_BAUD=115200 -CONFIG_UART_MODEM_PARITY=0 -CONFIG_UART_MODEM_BITS=8 -CONFIG_UART_MODEM_2STOP=0 -CONFIG_UART_MODEM_RXBUFSIZE=256 -CONFIG_UART_MODEM_TXBUFSIZE=256 - -# -# Calypso Configuration Options -# - -# -# Modem UART Configuration -# -# CONFIG_UART_MODEM_HWFLOWCONTROL is not set - -# -# IrDA UART Configuration -# -# CONFIG_UART_IRDA_HWFLOWCONTROL is not set -# CONFIG_USE_SERCOMM_CONSOLE is not set -# CONFIG_SERIAL_MODEM_CONSOLE is not set -# CONFIG_SERIAL_IRDA_CONSOLE is not set -CONFIG_SERIAL_CONSOLE_NONE=y +CONFIG_ARM_HAVE_MPU_UNIFIED=y +# CONFIG_ARM_MPU is not set +# CONFIG_DEBUG_HARDFAULT is not set + +# +# ARMV7M Configuration Options +# +# CONFIG_ARMV7M_HAVE_ICACHE is not set +# CONFIG_ARMV7M_HAVE_DCACHE is not set +# CONFIG_ARMV7M_HAVE_ITCM is not set +# CONFIG_ARMV7M_HAVE_DTCM is not set +# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y +CONFIG_ARMV7M_HAVE_STACKCHECK=y +# CONFIG_ARMV7M_STACKCHECK is not set +# CONFIG_ARMV7M_ITMSYSLOG is not set +# CONFIG_SERIAL_TERMIOS is not set + +# +# AT91SAM3/4 Configuration Options +# +# CONFIG_ARCH_CHIP_ATSAM3U4E is not set +# CONFIG_ARCH_CHIP_ATSAM3U4C is not set +# CONFIG_ARCH_CHIP_ATSAM3U2E is not set +# CONFIG_ARCH_CHIP_ATSAM3U2C is not set +# CONFIG_ARCH_CHIP_ATSAM3U1E is not set +# CONFIG_ARCH_CHIP_ATSAM3U1C is not set +# CONFIG_ARCH_CHIP_ATSAM3X8E is not set +# CONFIG_ARCH_CHIP_ATSAM3X8C is not set +# CONFIG_ARCH_CHIP_ATSAM3X4E is not set +# CONFIG_ARCH_CHIP_ATSAM3X4C is not set +# CONFIG_ARCH_CHIP_ATSAM3A8C is not set +# CONFIG_ARCH_CHIP_ATSAM3A4C is not set +CONFIG_ARCH_CHIP_ATSAM4CMP16B=y +# CONFIG_ARCH_CHIP_ATSAM4LC2C is not set +# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set +# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set +# CONFIG_ARCH_CHIP_ATSAM4LC4C is not set +# CONFIG_ARCH_CHIP_ATSAM4LC4B is not set +# CONFIG_ARCH_CHIP_ATSAM4LC4A is not set +# CONFIG_ARCH_CHIP_ATSAM4LS2C is not set +# CONFIG_ARCH_CHIP_ATSAM4LS2B is not set +# CONFIG_ARCH_CHIP_ATSAM4LS2A is not set +# CONFIG_ARCH_CHIP_ATSAM4LS4C is not set +# CONFIG_ARCH_CHIP_ATSAM4LS4B is not set +# CONFIG_ARCH_CHIP_ATSAM4LS4A is not set +# CONFIG_ARCH_CHIP_ATSAM4SD32C is not set +# CONFIG_ARCH_CHIP_ATSAM4SD32B is not set +# CONFIG_ARCH_CHIP_ATSAM4SD16C is not set +# CONFIG_ARCH_CHIP_ATSAM4SD16B is not set +# CONFIG_ARCH_CHIP_ATSAM4SA16C is not set +# CONFIG_ARCH_CHIP_ATSAM4SA16B is not set +# CONFIG_ARCH_CHIP_ATSAM4S16C is not set +# CONFIG_ARCH_CHIP_ATSAM4S16B is not set +# CONFIG_ARCH_CHIP_ATSAM4S8C is not set +# CONFIG_ARCH_CHIP_ATSAM4S8B is not set +# CONFIG_ARCH_CHIP_ATSAM4E16E is not set +# CONFIG_ARCH_CHIP_ATSAM4E16C is not set +# CONFIG_ARCH_CHIP_ATSAM4E8E is not set +# CONFIG_ARCH_CHIP_ATSAM4E8C is not set +# CONFIG_ARCH_CHIP_SAM3U is not set +# CONFIG_ARCH_CHIP_SAM3X is not set +# CONFIG_ARCH_CHIP_SAM3A is not set +CONFIG_ARCH_CHIP_SAM4CM=y +# CONFIG_ARCH_CHIP_SAM4L is not set +# CONFIG_ARCH_CHIP_SAM4E is not set +# CONFIG_ARCH_CHIP_SAM4S is not set + +# +# AT91SAM3/4 Peripheral Support +# +# CONFIG_SAM34_ADC12B is not set +# CONFIG_SAM34_AES is not set +# CONFIG_SAM34_DMAC1 is not set +# CONFIG_SAM34_SLCDC is not set +# CONFIG_SAM34_SPI0 is not set +# CONFIG_SAM34_TC0 is not set +# CONFIG_SAM34_TC1 is not set +# CONFIG_SAM34_TWI is not set +# CONFIG_SAM34_TWIM is not set +# CONFIG_SAM34_TWIS is not set +# CONFIG_SAM34_TWIM0 is not set +# CONFIG_SAM34_TWIS0 is not set +# CONFIG_SAM34_TWIM1 is not set +# CONFIG_SAM34_TWIS1 is not set +CONFIG_SAM34_UART0=y +# CONFIG_SAM34_UART1 is not set +# CONFIG_SAM34_USART0 is not set +# CONFIG_SAM34_USART1 is not set +# CONFIG_SAM34_USART2 is not set +# CONFIG_SAM34_USART3 is not set +# CONFIG_SAM34_WDT is not set + +# +# AT91SAM3/4 External Memory Configuration +# + +# +# AT91SAM3/4 GPIO Interrupt Configuration +# +# CONFIG_SAM34_HAVE_GPIOD_IRQ is not set +# CONFIG_SAM34_HAVE_GPIOE_IRQ is not set +# CONFIG_SAM34_HAVE_GPIOF_IRQ is not set +# CONFIG_SAM34_GPIO_IRQ is not set +# CONFIG_SAM34_TC is not set # # Architecture Options @@ -171,37 +272,42 @@ CONFIG_SERIAL_CONSOLE_NONE=y # CONFIG_ARCH_NOINTC is not set # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set -# CONFIG_ARCH_HAVE_IRQPRIO is not set +CONFIG_ARCH_HAVE_IRQPRIO=y # CONFIG_ARCH_L2CACHE is not set # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set -# CONFIG_ARCH_HAVE_MULTICPU is not set +CONFIG_ARCH_HAVE_MULTICPU=y CONFIG_ARCH_HAVE_VFORK=y # CONFIG_ARCH_HAVE_MMU is not set -# CONFIG_ARCH_HAVE_MPU is not set +CONFIG_ARCH_HAVE_MPU=y # CONFIG_ARCH_NAND_HWECC is not set # CONFIG_ARCH_HAVE_EXTCLK is not set -CONFIG_ARCH_HAVE_POWEROFF=y -# CONFIG_ARCH_HAVE_RESET is not set +# CONFIG_ARCH_HAVE_POWEROFF is not set +CONFIG_ARCH_HAVE_RESET=y +# CONFIG_ARCH_USE_MPU is not set +# CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set +CONFIG_ARCH_HAVE_RAMFUNCS=y +CONFIG_ARCH_RAMFUNCS=y +CONFIG_ARCH_HAVE_RAMVECTORS=y +# CONFIG_ARCH_RAMVECTORS is not set # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=1250 +CONFIG_BOARD_LOOPSPERMSEC=6124 # CONFIG_ARCH_CALIBRATION is not set # # Interrupt options # CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set +CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set # # Boot options @@ -215,34 +321,29 @@ CONFIG_BOOT_RUNFROMFLASH=y # # Boot Memory Configuration # -CONFIG_RAM_START=0 -CONFIG_RAM_SIZE=8650752 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=131072 # CONFIG_ARCH_HAVE_SDRAM is not set # # Board Selection # -CONFIG_ARCH_BOARD_COMPALE86=y -# CONFIG_ARCH_BOARD_COMPALE88 is not set -# CONFIG_ARCH_BOARD_COMPALE99 is not set -# CONFIG_ARCH_BOARD_PIRELLI_DPL10 is not set +CONFIG_ARCH_BOARD_SAM4CMP_DB=y # CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="compal_e86" +CONFIG_ARCH_BOARD="sam4cmp-db" # # Common Board Options # -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_POWEROFF=y +# CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -253,37 +354,44 @@ CONFIG_DISABLE_OS_API=y # CONFIG_DISABLE_POSIX_TIMERS is not set # CONFIG_DISABLE_PTHREAD is not set # CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y -# CONFIG_DISABLE_ENVIRON is not set +# CONFIG_DISABLE_MQUEUE is not set +CONFIG_DISABLE_ENVIRON=y # # Clocks and Timers # +CONFIG_ARCH_HAVE_TICKLESS=y +# CONFIG_SCHED_TICKLESS is not set CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2007 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=13 -CONFIG_MAX_WDOGPARMS=4 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=1 -CONFIG_PREALLOC_TIMERS=8 +CONFIG_START_YEAR=2013 +CONFIG_START_MONTH=6 +CONFIG_START_DAY=12 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=0 +CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +CONFIG_SPINLOCK=y +CONFIG_SMP=y +CONFIG_SMP_NCPUS=2 +CONFIG_SMP_IDLETHREAD_STACKSIZE=2048 # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=200 +CONFIG_RR_INTERVAL=0 # CONFIG_SCHED_SPORADIC is not set -CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=16 +CONFIG_TASK_NAME_SIZE=24 +CONFIG_MAX_TASKS=32 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_WAITPID=y # # Pthread Options @@ -324,6 +432,12 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 # CONFIG_MODULE is not set # @@ -336,7 +450,7 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 @@ -348,6 +462,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -362,22 +477,17 @@ CONFIG_DEV_NULL=y # CONFIG_PWM is not set # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set -CONFIG_SPI=y -# CONFIG_SPI_SLAVE is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_HWFEATURES is not set -# CONFIG_SPI_CRCGENERATION is not set -# CONFIG_SPI_CS_CONTROL is not set -# CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -385,7 +495,12 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -407,14 +522,13 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set # CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set +CONFIG_UART0_SERIALDRIVER=y # CONFIG_UART1_SERIALDRIVER is not set # CONFIG_UART2_SERIALDRIVER is not set # CONFIG_UART3_SERIALDRIVER is not set @@ -434,18 +548,36 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_USART6_SERIALDRIVER is not set # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set -CONFIG_OTHER_UART_SERIALDRIVER=y +# CONFIG_OTHER_UART_SERIALDRIVER is not set CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set +CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set -# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set -CONFIG_OTHER_SERIAL_CONSOLE=y +# CONFIG_SERIAL_TIOCSERGSTRUCT is not set +CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=256 +CONFIG_UART0_TXBUFSIZE=256 +CONFIG_UART0_BAUD=115200 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 +# CONFIG_UART0_IFLOWCONTROL is not set +# CONFIG_UART0_OFLOWCONTROL is not set +# CONFIG_UART0_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -459,6 +591,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -482,9 +615,10 @@ CONFIG_SYSLOG_CONSOLE=y # CONFIG_DISABLE_MOUNTPOINT is not set # CONFIG_FS_AUTOMOUNTER is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set +CONFIG_FS_READABLE=y # CONFIG_FS_WRITABLE is not set # CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set # CONFIG_FS_FAT is not set # CONFIG_FS_NXFFS is not set @@ -492,7 +626,15 @@ CONFIG_SYSLOG_CONSOLE=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set # CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set +CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set + +# +# Exclude individual procfs entries +# +# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set +# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set +# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set # CONFIG_FS_UNIONFS is not set # @@ -505,9 +647,7 @@ CONFIG_SYSLOG_CONSOLE=y # # CONFIG_MM_SMALL is not set CONFIG_MM_REGIONS=1 -CONFIG_ARCH_HAVE_HEAP2=y -CONFIG_HEAP2_BASE=0x00000000 -CONFIG_HEAP2_SIZE=0 +# CONFIG_ARCH_HAVE_HEAP2 is not set # CONFIG_GRAN is not set # @@ -518,12 +658,12 @@ CONFIG_HEAP2_SIZE=0 # # Wireless Support # +# CONFIG_WIRELESS is not set # # Binary Loader # # CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set CONFIG_BUILTIN=y @@ -537,15 +677,16 @@ CONFIG_BUILTIN=y # # Standard C Library Options # -CONFIG_STDIO_BUFFER_SIZE=1024 +CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set # CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -557,14 +698,16 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set CONFIG_ARCH_LOWPUTC=y -# CONFIG_LIBC_LOCALTIME is not set # CONFIG_TIME_EXTENDED is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set +# CONFIG_NETDB_HOSTFILE is not set # # Non-standard Library Support @@ -572,6 +715,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -595,16 +739,14 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_HELLO_PRIORITY=100 -CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 +# CONFIG_EXAMPLES_HELLO is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set @@ -623,13 +765,18 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set -# CONFIG_EXAMPLES_OSTEST is not set +CONFIG_EXAMPLES_OSTEST=y +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -637,7 +784,10 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set # CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMP is not set +CONFIG_EXAMPLES_SMP=y +CONFIG_EXAMPLES_SMP_NBARRIER_THREADS=8 +CONFIG_EXAMPLES_SMP_PRIORITY=100 +CONFIG_EXAMPLES_SMP_STACKSIZE=2048 # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set @@ -651,6 +801,7 @@ CONFIG_EXAMPLES_NSH=y # File System Utilities # # CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set # # GPS Utilities @@ -666,8 +817,10 @@ CONFIG_EXAMPLES_NSH=y # # Interpreters # +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -733,13 +886,12 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_LS is not set # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set -# CONFIG_NSH_DISABLE_POWEROFF is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -747,7 +899,6 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_RMDIR is not set # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set -CONFIG_NSH_DISABLE_SHUTDOWN=y # CONFIG_NSH_DISABLE_SLEEP is not set # CONFIG_NSH_DISABLE_TIME is not set # CONFIG_NSH_DISABLE_TEST is not set @@ -757,6 +908,7 @@ CONFIG_NSH_DISABLE_SHUTDOWN=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options @@ -764,7 +916,8 @@ CONFIG_NSH_DISABLE_SHUTDOWN=y # CONFIG_NSH_CMDOPT_DF_H is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y -CONFIG_NSH_FILEIOSIZE=1024 +CONFIG_NSH_PROC_MOUNTPOINT="/proc" +CONFIG_NSH_FILEIOSIZE=512 # # Scripting Support @@ -778,7 +931,7 @@ CONFIG_NSH_FILEIOSIZE=1024 # CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set +CONFIG_NSH_ARCHINIT=y # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set @@ -797,7 +950,7 @@ CONFIG_NSH_CONSOLE=y # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -807,6 +960,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/compal_e86/nsh_highram/setenv.sh b/configs/sam4cmp-db/nsh/setenv.sh old mode 100755 new mode 100644 similarity index 95% rename from configs/compal_e86/nsh_highram/setenv.sh rename to configs/sam4cmp-db/nsh/setenv.sh index 3828a56504e381563a1178342b2bba3ec9b43494..651b20b30810d6181fc56bc141cb355e5f83161b --- a/configs/compal_e86/nsh_highram/setenv.sh +++ b/configs/sam4cmp-db/nsh/setenv.sh @@ -1,8 +1,8 @@ #!/bin/bash -# compal_e86/nsh_highram/setenv.sh +# configs/sam4cmp-db/nsh/setenv.sh # -# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. +# Author: Masayuki Ishikawa # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,7 +31,6 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # - if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 diff --git a/configs/sam4cmp-db/scripts/ld.script b/configs/sam4cmp-db/scripts/ld.script new file mode 100644 index 0000000000000000000000000000000000000000..d82568f84f9817731538829ac1cef97c49b15a17 --- /dev/null +++ b/configs/sam4cmp-db/scripts/ld.script @@ -0,0 +1,121 @@ +/**************************************************************************** + * configs/sam4cmp-db/scripts/ld.script + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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. + * + ****************************************************************************/ + +/* The ATSAM4CM has 1MB of FLASH beginning at address 0x0100:0000 and + * 128KB of SRAM beginning at address 0x2000:0000 + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0x01000000, LENGTH = 1024K + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K +} + +OUTPUT_ARCH(arm) +ENTRY(_stext) +SECTIONS +{ + .text : { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > flash + + .init_section : { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > flash + + .ARM.extab : { + *(.ARM.extab*) + } >flash + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } >flash + __exidx_end = ABSOLUTE(.); + + .data : { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + _eronly = LOADADDR(.data); + + .ramfunc ALIGN(4): { + _sramfuncs = ABSOLUTE(.); + *(.ramfunc .ramfunc.*) + _eramfuncs = ABSOLUTE(.); + } > sram AT > flash + + _framfuncs = LOADADDR(.ramfunc); + + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/configs/compal_e86/src/Makefile b/configs/sam4cmp-db/src/Makefile similarity index 84% rename from configs/compal_e86/src/Makefile rename to configs/sam4cmp-db/src/Makefile index b8f7e5dc8a3dac898e5f93e241abb36c6d60bf76..1dd2e0485ce9dc19245b2abf9053a63844310858 100644 --- a/configs/compal_e86/src/Makefile +++ b/configs/sam4cmp-db/src/Makefile @@ -1,11 +1,8 @@ ############################################################################ -# configs/compal_e86/src/Makefile +# configs/sam4cmp-db/src/Makefile # -# Copyright (C) 2007, 2008, 2013, 2015 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Copyright (C) 2011 Stefan Richter. All rights reserved. -# Author: Stefan Richter +# Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. +# Author: Masayuki Ishikawa # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -39,6 +36,12 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = boot.c +CSRCS = sam_boot.c + +ifeq ($(CONFIG_LIB_BOARDCTL),y) +CSRCS += sam_appinit.c sam_bringup.c +else ifeq ($(CONFIG_BOARD_INITIALIZE),y) +CSRCS += sam_bringup.c +endif include $(TOPDIR)/configs/Board.mk diff --git a/configs/sam4cmp-db/src/sam4cmp-db.h b/configs/sam4cmp-db/src/sam4cmp-db.h new file mode 100644 index 0000000000000000000000000000000000000000..9fab435d5af7ad18d42d3642aebbe50b55a44144 --- /dev/null +++ b/configs/sam4cmp-db/src/sam4cmp-db.h @@ -0,0 +1,80 @@ +/************************************************************************************ + * configs/sam4cmp-db/src/sam4cmp-db.h + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __CONFIGS_SAM4CMP_DB_SRC_SAM4CMP_DB_H +#define __CONFIGS_SAM4CMP_DB_SRC_SAM4CMP_DB_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#include + +#include + +#include +#include + +#include "chip/sam_pinmap.h" + +/************************************************************************************ + * Public Types + ************************************************************************************/ + +/************************************************************************************ + * Public data + ************************************************************************************/ + +#ifndef __ASSEMBLY__ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: sam_bringup + * + * Description: + * Bring up board features + * + ************************************************************************************/ + +#if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE) +int sam_bringup(void); +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_SAM4CMP_DB_SRC_SAM4CMP_DB_H */ diff --git a/configs/pirelli_dpl10/src/boot.c b/configs/sam4cmp-db/src/sam_appinit.c similarity index 92% rename from configs/pirelli_dpl10/src/boot.c rename to configs/sam4cmp-db/src/sam_appinit.c index 38d1fe8ac2b33463a7deab02517033a996ff242f..6bab1d575194e8c226d376fedfef3b3a2522a795 100644 --- a/configs/pirelli_dpl10/src/boot.c +++ b/configs/sam4cmp-db/src/sam_appinit.c @@ -1,8 +1,8 @@ /**************************************************************************** - * configs/pirelli_dpl10/boot.c + * config/sam4cmp-db/src/sam_appinit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,8 +38,13 @@ ****************************************************************************/ #include + #include +#include "sam4cmp-db.h" + +#ifdef CONFIG_LIB_BOARDCTL + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -69,9 +74,15 @@ * ****************************************************************************/ -#ifdef CONFIG_LIB_BOARDCTL int board_app_initialize(uintptr_t arg) { - return 0; +#ifndef CONFIG_BOARD_INITIALIZE + /* Perform board initialization */ + + return sam_bringup(); +#else + return OK; +#endif } + #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/configs/sam4cmp-db/src/sam_boot.c b/configs/sam4cmp-db/src/sam_boot.c new file mode 100644 index 0000000000000000000000000000000000000000..f883f0add6daadd6ba5c7debbd91867ca98af92e --- /dev/null +++ b/configs/sam4cmp-db/src/sam_boot.c @@ -0,0 +1,86 @@ +/************************************************************************************ + * configs/sam4cmp-db/src/sam_boot.c + * + * Copyright (C) 2016 Masayuki Ishikawa. All rights reserved. + * Author: Masayuki Ishikawa + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include + +#include + +#include "sam4cmp-db.h" + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: sam_boardinitialize + * + * Description: + * All SAM3/4 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void sam_boardinitialize(void) +{ +} + +/**************************************************************************** + * Name: board_initialize + * + * Description: + * If CONFIG_BOARD_INITIALIZE is selected, then an additional + * initialization call will be performed in the boot-up sequence to a + * function called board_initialize(). board_initialize() will be + * called immediately after up_intitialize() is called and just before the + * initial application is started. This additional initialization phase + * may be used, for example, to initialize board-specific device drivers. + * + ****************************************************************************/ + +#ifdef CONFIG_BOARD_INITIALIZE +void board_initialize(void) +{ + /* Perform board initialization */ + + (void)sam_bringup(); +} +#endif /* CONFIG_BOARD_INITIALIZE */ diff --git a/configs/sam4cmp-db/src/sam_bringup.c b/configs/sam4cmp-db/src/sam_bringup.c new file mode 100644 index 0000000000000000000000000000000000000000..fbfe1a4106ddd9bc5bdad81acb6f52fd48b475e1 --- /dev/null +++ b/configs/sam4cmp-db/src/sam_bringup.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * config/sam4cmp-db/src/sam_bringup.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include + +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: sam_bringup + * + * Description: + * Bring up board features + * + ****************************************************************************/ + +int sam_bringup(void) +{ + int ret; + +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); + } +#endif + + /* If we got here then perhaps not all initialization was successful, but + * at least enough succeeded to bring-up NSH with perhaps reduced + * capabilities. + */ + + UNUSED(ret); + return OK; +} diff --git a/configs/sam4e-ek/nsh/defconfig b/configs/sam4e-ek/nsh/defconfig index ed3f03c24b006a0ae7f40f25396c034c3cfb67ca..fa0dcfdf16931bd71a5b381a0a6de56a62ff8eb4 100644 --- a/configs/sam4e-ek/nsh/defconfig +++ b/configs/sam4e-ek/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -384,8 +382,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -620,10 +616,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -647,7 +642,6 @@ CONFIG_ETH0_PHY_KSZ8051=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -738,13 +732,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -999,7 +991,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1036,7 +1027,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sam4e-ek/nxwm/defconfig b/configs/sam4e-ek/nxwm/defconfig index 3d8dd79bb02dc3b2a0e9400a6ade7066600c3ef1..f322abe329bcfdecb53bb838acd7e2a24efc797f 100644 --- a/configs/sam4e-ek/nxwm/defconfig +++ b/configs/sam4e-ek/nxwm/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -396,8 +394,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -425,6 +421,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -442,6 +439,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -485,7 +484,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -679,10 +678,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -706,7 +703,6 @@ CONFIG_ETH0_PHY_KSZ8051=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -797,13 +793,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1029,13 +1023,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=396 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1055,7 +1050,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1123,6 +1121,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set CONFIG_NETDB_DNSCLIENT=y @@ -1171,7 +1170,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1211,7 +1209,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1366,6 +1363,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1429,10 +1427,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=1596 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=1596 @@ -1527,7 +1522,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sam4e-ek/usbnsh/defconfig b/configs/sam4e-ek/usbnsh/defconfig index b96a1ca08a76c9a935eb4df19d68ce0a875c490b..4a65eb790bcce9ced167657d12927855883bcf15 100644 --- a/configs/sam4e-ek/usbnsh/defconfig +++ b/configs/sam4e-ek/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -294,6 +292,7 @@ CONFIG_SAM34_EMAC_PHYSR_100HD=0x2 CONFIG_SAM34_EMAC_PHYSR_10FD=0x5 CONFIG_SAM34_EMAC_PHYSR_100FD=0x6 CONFIG_SAM34_EMAC_ISETH0=y +CONFIG_SAM34_EMAC_HPWORK=y # # AT91SAM3/4 USB Full Speed Device Controller driver (DCD) options @@ -389,8 +388,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -465,6 +462,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -473,6 +471,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -484,8 +483,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -620,10 +622,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -647,7 +647,6 @@ CONFIG_ETH0_PHY_KSZ8051=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -778,13 +777,11 @@ CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1036,7 +1033,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1073,7 +1069,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sam4l-xplained/nsh/defconfig b/configs/sam4l-xplained/nsh/defconfig index ad60bc8a5f1b244fb7ad03e0ce5908b1b730d025..a4d744bbf5df8f3361362eb037f0e81d74e76d7c 100644 --- a/configs/sam4l-xplained/nsh/defconfig +++ b/configs/sam4l-xplained/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -516,7 +514,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -757,7 +754,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sam4s-xplained-pro/TODO.txt b/configs/sam4s-xplained-pro/TODO.txt deleted file mode 100644 index 5c1a088abdf6f46b5deb6fd987bd41fbae825135..0000000000000000000000000000000000000000 --- a/configs/sam4s-xplained-pro/TODO.txt +++ /dev/null @@ -1,56 +0,0 @@ - - implement flash driver - - see arch/arm/src/stm32/stm32_flash.c and related - - both banks could be mapped with care taken not to erase the active code. - - perhaps the MPU could block code corruption? - - - once implemented, the free() cmd replacement can show flash information. - - - Seen crashes when running serial ports below 921600 - - - COM34 (UART1, ttyS1) runs the smoothest with 'serialblaster' test... - the other two (UART0, USART1) seem to stutter... - - - created a cpuhog test. Each instance takes a semaphore, burns cpu for 6ms and then releases - the sem to exercises semaphores passing and a busy cpu. The first two instances become a - producer/consumer pair using a pipe (FIFO) to exercise the fileio data passing. - -> no crashes with 8 instances running. (No MMU, No BASEPRI) - -> no crashes with 8 instances running. (MMU + BASEPRI) - -> not however that the serial ports are very finicky with BASEPRI enabled! - This setup sends single charactes for each produced or consumed block, - and doesn't seem to have any issues: - NuttShell (NSH) - nsh> cpuhog > /dev/ttyS1 & - cpuhog [5:50] - nsh> cpuhog > /dev/ttyS2 & - cpuhog [7:50] - nsh> cpuhog & - cpuhog [8:50] - nsh> cpuhog 2 - cpuhog & - cpuhog [9:50] - nsh> cpuhog 3 - cpuhog & - cpuhog [10:50] - nsh> cpuhog 4 - cpuhog & - cpuhog [11:50] - nsh> cpuhog 5 - - nsh> cpuhog & - cpuhog [12:50] - nsh> cpuhog 6 - - nsh> cpuhog & - cpuhog [13:50] - nsh> cpuhog 7 - - - USB serial not quite stable when pushing lots of data - - - UARTs don't use DMA. We may need this for high baudrates. - - Inbound hardware flow control requires dma. - -Current Test: - -40mA: 120Mhz (240 MHz PLL) with SDCard mounted, UART0+UART1+USART1 enabled, USB Device availible (but nothing plugged in) -37.8mA: 120Mhz (120 MHz PLL) with SDCard mounted, UART0+UART1+USART1 enabled -16.9mA: "" with WFI added to up_idle() diff --git a/configs/sam4s-xplained-pro/nsh/defconfig b/configs/sam4s-xplained-pro/nsh/defconfig index 45fbddf1c5617e883b130e4e783d6edf666910f6..bd98575c00c2fa00886b98cd517de199db0ebf92 100644 --- a/configs/sam4s-xplained-pro/nsh/defconfig +++ b/configs/sam4s-xplained-pro/nsh/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -369,16 +370,12 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y # Board-Specific Options # CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR=0 -CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH="/dev/rtt0" -CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH="/dev/tc0" # CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -399,6 +396,7 @@ CONFIG_USEC_PER_TICK=10000 CONFIG_SYSTEMTICK_EXTCLK=y # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set CONFIG_JULIAN_TIME=y CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=32 @@ -431,6 +429,8 @@ CONFIG_NPTHREAD_KEYS=4 CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_EXTCLK=y CONFIG_SCHED_CPULOAD_TICKSPERSEC=222 +# CONFIG_CPULOAD_ONESHOT is not set +CONFIG_CPULOAD_ONESHOT_ENTROPY=6 CONFIG_SCHED_CPULOAD_TIMECONSTANT=2 # CONFIG_SCHED_INSTRUMENTATION is not set @@ -513,12 +513,16 @@ CONFIG_DEV_ZERO=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # -CONFIG_TIMER=y +# CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set CONFIG_RTC=y # CONFIG_RTC_DATETIME is not set CONFIG_RTC_HIRES=y @@ -576,7 +580,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -699,6 +702,7 @@ CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -812,6 +816,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -872,6 +878,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set CONFIG_EXAMPLES_CPUHOG=y @@ -909,8 +917,8 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set CONFIG_EXAMPLES_SERIALBLASTER=y CONFIG_EXAMPLES_SERIALBLASTER_STACKSIZE=2048 @@ -932,7 +940,6 @@ CONFIG_EXAMPLES_SERIALRX_PRINTHEX=y # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set -# CONFIG_EXAMPLES_TIMER is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set @@ -962,6 +969,7 @@ CONFIG_EXAMPLES_SERIALRX_PRINTHEX=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1034,6 +1042,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1106,6 +1115,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sam4s-xplained-pro/src/Makefile b/configs/sam4s-xplained-pro/src/Makefile index 62b5b37250360012b8e2655c67318fb92d2816ef..e46e7c7eea92a2b90e2c6540b86f3ab08143053e 100644 --- a/configs/sam4s-xplained-pro/src/Makefile +++ b/configs/sam4s-xplained-pro/src/Makefile @@ -64,8 +64,4 @@ ifeq ($(CONFIG_SAM34_WDT),y) CSRCS += sam_wdt.c endif -ifeq ($(CONFIG_TIMER),y) -CSRCS += sam_tc.c -endif - include $(TOPDIR)/configs/Board.mk diff --git a/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h b/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h index 081e8f73f290891937430bcea773d22a83c1bc11..d995541bbbd65553adbff01bf2bc4fec776957f3 100644 --- a/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h +++ b/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h @@ -215,20 +215,6 @@ bool sam_writeprotected(int slotno); # define sam_writeprotected(slotno) (false) #endif -/************************************************************************************ - * Name: sam_timerinitialize() - * - * Description: - * Perform architecture-specific initialization of the timer hardware. - * - ************************************************************************************/ - -#ifdef CONFIG_TIMER -int sam_timerinitialize(void); -#else -# define sam_timerinitialize() (0) -#endif - /**************************************************************************** * Name: sam_watchdog_initialize() * diff --git a/configs/sam4s-xplained-pro/src/sam_appinit.c b/configs/sam4s-xplained-pro/src/sam_appinit.c index 7ac7f1587c4f1f9e4aac24703204e1e11be85ba8..6cb0cabe9120d60cfadac2a8e636c0be8bc6b969 100644 --- a/configs/sam4s-xplained-pro/src/sam_appinit.c +++ b/configs/sam4s-xplained-pro/src/sam_appinit.c @@ -59,20 +59,12 @@ # include #endif -#ifdef CONFIG_TIMER -# include -#endif - #ifdef CONFIG_USBMONITOR # include #endif #include "sam4s-xplained-pro.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/sam4s-xplained-pro/src/sam_boot.c b/configs/sam4s-xplained-pro/src/sam_boot.c index ce7ae2fad3a293a93fd76f55fa37d680ba9af309..54767ee59c33ff268f3287b78a2a8b3d2cf88736 100644 --- a/configs/sam4s-xplained-pro/src/sam_boot.c +++ b/configs/sam4s-xplained-pro/src/sam_boot.c @@ -42,19 +42,10 @@ #include #include -#include #include #include "sam4s-xplained-pro.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -91,6 +82,7 @@ void sam_boardinitialize(void) * may be used, for example, to initialize board-specific device drivers. * ****************************************************************************/ + #ifdef CONFIG_BOARD_INITIALIZE void board_initialize(void) { @@ -105,12 +97,5 @@ void board_initialize(void) sam_led_initialize(); #endif - -#ifdef CONFIG_TIMER - /* Registers the timers and starts any async processes (which may include the scheduler) */ - - sam_timerinitialize(); -#endif - } #endif /* CONFIG_BOARD_INITIALIZE */ diff --git a/configs/sam4s-xplained-pro/src/sam_tc.c b/configs/sam4s-xplained-pro/src/sam_tc.c deleted file mode 100644 index f00fd42c04279eef4d7312157eceb54b547384cc..0000000000000000000000000000000000000000 --- a/configs/sam4s-xplained-pro/src/sam_tc.c +++ /dev/null @@ -1,288 +0,0 @@ -/**************************************************************************** - * configs/sam4s-xplained-pro/src/sam_tc.c - * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * Bob Doiron - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include "sam_lowputc.h" -#include "sam_tc.h" -#include "sam_rtt.h" - -#ifdef CONFIG_TIMER - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Configuration ************************************************************/ - -#if !(defined(CONFIG_SAM34_TC0) || defined(CONFIG_SAM34_TC1) || defined(CONFIG_SAM34_TC2) \ - || defined(CONFIG_SAM34_TC3) || defined(CONFIG_SAM34_TC4) || defined(CONFIG_SAM34_RTT) ) -# warning "CONFIG_SAM34_TCx or CONFIG_SAM34_RTT must be defined" -#endif - -/* Select the path to the registered watchdog timer device */ - -#ifndef CONFIG_TIMER0_DEVPATH -# define CONFIG_TIMER0_DEVPATH "/dev/tc0" -#endif -#ifndef CONFIG_TIMER1_DEVPATH -# define CONFIG_TIMER1_DEVPATH "/dev/tc1" -#endif -#ifndef CONFIG_TIMER2_DEVPATH -# define CONFIG_TIMER2_DEVPATH "/dev/tc2" -#endif -#ifndef CONFIG_TIMER3_DEVPATH -# define CONFIG_TIMER3_DEVPATH "/dev/tc3" -#endif -#ifndef CONFIG_TIMER4_DEVPATH -# define CONFIG_TIMER4_DEVPATH "/dev/tc4" -#endif -#ifndef CONFIG_TIMER5_DEVPATH -# define CONFIG_TIMER5_DEVPATH "/dev/tc5" -#endif -#ifndef CONFIG_RTT_DEVPATH -# define CONFIG_RTT_DEVPATH "/dev/rtt0" -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -#if defined(CONFIG_SYSTEMTICK_EXTCLK) && !defined(CONFIG_SUPPRESS_INTERRUPTS) && \ - !defined(CONFIG_SUPPRESS_TIMER_INTS) - -static bool systemtick(FAR uint32_t *next_interval_us) -{ - sched_process_timer(); - return true; // reload, no change to interval -} - -#endif /* CONFIG_SYSTEMTICK_EXTCLK && !CONFIG_SUPPRESS_INTERRUPTS && !CONFIG_SUPPRESS_TIMER_INTS */ - -#if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK) - -static bool calc_cpuload(FAR uint32_t *next_interval_us) -{ - sched_process_cpuload(); - return TRUE; /* Reload, no change to interval */ -} - -#endif /* CONFIG_SCHED_CPULOAD && CONFIG_SCHED_CPULOAD_EXTCLK */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: sam_timerinitialize() - * - * Description: - * Perform architecture-specific initialization of the timer hardware. - * - ****************************************************************************/ - -int sam_timerinitialize(void) -{ - int fd; - int ret; - - /* Initialize and register the timer devices */ - -#if defined(CONFIG_SAM34_TC0) - tmrinfo("Initializing %s...\n", CONFIG_TIMER0_DEVPATH); - sam_tcinitialize(CONFIG_TIMER0_DEVPATH, SAM_IRQ_TC0); -#endif - -#if defined(CONFIG_SAM34_TC1) - tmrinfo("Initializing %s...\n", CONFIG_TIMER1_DEVPATH); - sam_tcinitialize(CONFIG_TIMER1_DEVPATH, SAM_IRQ_TC1); -#endif - -#if defined(CONFIG_SAM34_TC2) - tmrinfo("Initializing %s...\n", CONFIG_TIMER2_DEVPATH); - sam_tcinitialize(CONFIG_TIMER2_DEVPATH, SAM_IRQ_TC2); -#endif - -#if defined(CONFIG_SAM34_TC3) - tmrinfo("Initializing %s...\n", CONFIG_TIMER3_DEVPATH); - sam_tcinitialize(CONFIG_TIMER3_DEVPATH, SAM_IRQ_TC3); -#endif - -#if defined(CONFIG_SAM34_TC4) - tmrinfo("Initializing %s...\n", CONFIG_TIMER4_DEVPATH); - sam_tcinitialize(CONFIG_TIMER4_DEVPATH, SAM_IRQ_TC4); -#endif - -#if defined(CONFIG_SAM34_TC5) - tmrinfo("Initializing %s...\n", CONFIG_TIMER5_DEVPATH); - sam_tcinitialize(CONFIG_TIMER5_DEVPATH, SAM_IRQ_TC5); -#endif - -#if defined(CONFIG_SAM34_RTT) - tmrinfo("Initializing %s...\n", CONFIG_RTT_DEVPATH); - sam_rttinitialize(CONFIG_RTT_DEVPATH); -#endif - -#if defined(CONFIG_SYSTEMTICK_EXTCLK) && !defined(CONFIG_SUPPRESS_INTERRUPTS) && \ - !defined(CONFIG_SUPPRESS_TIMER_INTS) - /* System Timer Initialization */ - - tmrinfo("Opening %s\n", CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH); - - fd = open(CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH, O_RDONLY); - if (fd < 0) - { - tmrerr("ERROR: open %s failed: %d\n", - CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH, errno); - goto errout; - } - - /* Set the timeout */ - - tmrinfo("Interval = %d us.\n", (unsigned long)USEC_PER_TICK); - ret = ioctl(fd, TCIOC_SETTIMEOUT, (unsigned long)USEC_PER_TICK); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); - goto errout_with_dev; - } - - /* install user callback */ - { - struct timer_sethandler_s tccb; - tccb.newhandler = systemtick; - tccb.oldhandler = NULL; - - ret = ioctl(fd, TCIOC_SETHANDLER, (unsigned long)&tccb); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); - goto errout_with_dev; - } - } - - /* Start the timer */ - - tmrinfo("Starting.\n"); - ret = ioctl(fd, TCIOC_START, 0); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_START) failed: %d\n", errno); - goto errout_with_dev; - } -#endif - -#if defined(CONFIG_SCHED_CPULOAD) && defined(CONFIG_SCHED_CPULOAD_EXTCLK) - /* CPU Load initialization */ - - tmrinfo("Opening %s\n", CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH); - - fd = open(CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH, O_RDONLY); - if (fd < 0) - { - tmrerr("ERROR: open %s failed: %d\n", - CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH, errno); - goto errout; - } - - /* Set the timeout */ - - tmrinfo("Interval = %d us.\n", (unsigned long)1000000 / CONFIG_SCHED_CPULOAD_TICKSPERSEC); - - ret = ioctl(fd, TCIOC_SETTIMEOUT, - (unsigned long)1000000 / CONFIG_SCHED_CPULOAD_TICKSPERSEC); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_SETTIMEOUT) failed: %d\n", errno); - goto errout_with_dev; - } - - /* Install user callback */ - - { - struct timer_sethandler_s tccb; - tccb.newhandler = calc_cpuload; - tccb.oldhandler = NULL; - - ret = ioctl(fd, TCIOC_SETHANDLER, (unsigned long)&tccb); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_SETHANDLER) failed: %d\n", errno); - goto errout_with_dev; - } - } - - /* Start the timer */ - - tmrinfo("Starting.\n"); - ret = ioctl(fd, TCIOC_START, 0); - if (ret < 0) - { - tmrerr("ERROR: ioctl(TCIOC_START) failed: %d\n", errno); - goto errout_with_dev; - } -#endif - - goto success; -errout_with_dev: - close(fd); -errout: - return ERROR; - -success: - return OK; - -} - -#endif /* CONFIG_TIMER */ diff --git a/configs/sam4s-xplained/nsh/defconfig b/configs/sam4s-xplained/nsh/defconfig index d997c7c35285bb5d7d6f29ee257b57c70cbaad4a..5120854680eb08fbd3f2ee7cfd92fed11c91774d 100644 --- a/configs/sam4s-xplained/nsh/defconfig +++ b/configs/sam4s-xplained/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -496,7 +494,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -731,7 +728,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d2-xult/nsh/defconfig b/configs/sama5d2-xult/nsh/defconfig index 43d37d1d979410a8de22a1aee35a2ddca10d6905..bfd5cf964a2bd97ffce04c36c903e7f8d0d76534 100644 --- a/configs/sama5d2-xult/nsh/defconfig +++ b/configs/sama5d2-xult/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -407,8 +405,6 @@ CONFIG_SAMA5D2XULT_528MHZ=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -581,7 +577,6 @@ CONFIG_RTC_DATETIME=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -904,7 +899,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3-xplained/bridge/defconfig b/configs/sama5d3-xplained/bridge/defconfig index fe883173cf101352d4e2b4d1986f456f90f46854..ca9a6b5b224cfa896492cce53c3202567f96aa51 100644 --- a/configs/sama5d3-xplained/bridge/defconfig +++ b/configs/sama5d3-xplained/bridge/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -280,6 +278,7 @@ CONFIG_SAMA5_GMAC_NRXBUFFERS=16 CONFIG_SAMA5_GMAC_NTXBUFFERS=8 # CONFIG_SAMA5_GMAC_PREALLOCATE is not set # CONFIG_SAMA5_GMAC_NBC is not set +CONFIG_SAMA5_GMAC_HPWORK=y CONFIG_SAMA5_GMAC_PHYADDR=1 # CONFIG_SAMA5_GMAC_PHYINIT is not set CONFIG_SAMA5_GMAC_AUTONEG=y @@ -303,6 +302,7 @@ CONFIG_SAMA5_EMAC_PHYSR_10FD=0x5 CONFIG_SAMA5_EMAC_PHYSR_100FD=0x6 # CONFIG_SAMA5_EMACA_PREALLOCATE is not set # CONFIG_SAMA5_EMACA_NBC is not set +CONFIG_SAMA5_EMACA_HPWORK=y # CONFIG_SAMA5_EMAC_ISETH0 is not set CONFIG_SAMA5_GMAC_ISETH0=y @@ -482,6 +482,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -490,6 +491,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -501,8 +503,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -593,10 +598,8 @@ CONFIG_NETDEV_MULTINIC=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -630,7 +633,6 @@ CONFIG_ETH1_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -694,13 +696,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -1014,7 +1014,6 @@ CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY=100 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3-xplained/nsh/defconfig b/configs/sama5d3-xplained/nsh/defconfig index 8e7517c7c9f03a33b0d087a29bafb40be3440db2..8646ca8b0328f3160d0cf52e68919ab2d609083b 100644 --- a/configs/sama5d3-xplained/nsh/defconfig +++ b/configs/sama5d3-xplained/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -534,7 +532,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -780,7 +777,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3-xplained/src/sam_adc.c b/configs/sama5d3-xplained/src/sam_adc.c index 797dbe182e1321d0130c37d639b7427542aff30d..9ef01d875ec2ab3987b050807eec9d058b955d01 100644 --- a/configs/sama5d3-xplained/src/sam_adc.c +++ b/configs/sama5d3-xplained/src/sam_adc.c @@ -48,32 +48,21 @@ #include "sam_adc.h" #include "sama5d3-xplained.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ +#ifdef CONFIG_SAMA5_ADC /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_initialize + * Name: sam_adc_setup * * Description: - * Initialize and register the ADC driver + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -#ifdef CONFIG_SAMA5_ADC -int board_adc_initialize(void) +int sam_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; @@ -108,24 +97,5 @@ int board_adc_initialize(void) return OK; } -#endif /* CONFIG_ADC */ -/************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All SAMA5 architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ - -#ifdef CONFIG_EXAMPLES_ADC -int board_adc_setup(void) -{ -#ifdef CONFIG_SAMA5_ADC - return board_adc_initialize(); -#else - return -ENOSYS; -#endif -} -#endif /* CONFIG_EXAMPLES_ADC */ +#endif /* CONFIG_ADC */ diff --git a/configs/sama5d3-xplained/src/sam_ajoystick.c b/configs/sama5d3-xplained/src/sam_ajoystick.c index 7ff2f021957bf51feba1781afbab3580b17aa623..a4712eabf85a330054d8a5bd85d10b73c5d0cc10 100644 --- a/configs/sama5d3-xplained/src/sam_ajoystick.c +++ b/configs/sama5d3-xplained/src/sam_ajoystick.c @@ -406,15 +406,7 @@ int sam_ajoy_initialization(void) int fd; int i; - /* Initialize ADC. We will need this to read the ADC inputs */ - - ret = board_adc_initialize(); - if (ret < 0) - { - ierr("ERROR: board_adc_initialize() failed: %d\n", ret); - return ret; - } - + /* NOTE: The ADC driver was initialized earlier in the bring-up sequence. */ /* Open the ADC driver for reading. */ fd = open("/dev/adc0", O_RDONLY); diff --git a/configs/sama5d3-xplained/src/sam_appinit.c b/configs/sama5d3-xplained/src/sam_appinit.c index 34073c9f17707ef91493f0eb10e1750eb749a9a5..ad5d8146f8655caa7591379edbc266aaca4e0c03 100644 --- a/configs/sama5d3-xplained/src/sam_appinit.c +++ b/configs/sama5d3-xplained/src/sam_appinit.c @@ -85,11 +85,7 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ - defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || \\ - defined(CONFIG_AJOYSTICK) || defined(CONFIG_FS_PROCFS) int ret; -#endif #ifdef HAVE_NAND /* Initialize the NAND driver */ @@ -162,6 +158,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = sam_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_adc_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_AJOYSTICK /* Initialize and register the joystick driver */ @@ -175,6 +181,27 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = sam_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_pwm_setup() failed: %d\n", ret); + return ret; + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = sam_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_can_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ @@ -184,8 +211,10 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n", SAMA5_PROCFS_MOUNTPOINT, ret); + return ret; } #endif + UNUSED(ret); return OK; } diff --git a/configs/sama5d3-xplained/src/sam_can.c b/configs/sama5d3-xplained/src/sam_can.c index 76b12f3b1459205123dfff9dbb0be2e78e36203d..cbd76837d8b9fdb70c0f65342a18456dd2da3f8a 100644 --- a/configs/sama5d3-xplained/src/sam_can.c +++ b/configs/sama5d3-xplained/src/sam_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3-xplained/src/sam_can.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include "sam_can.h" #include "sama5d3-xplained.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -74,48 +74,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: sam_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int sam_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = sam_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = sam_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; - } + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; + } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_SAMA5_CAN0 || CONFIG_SAMA5_CAN1) */ +#endif /* CONFIG_CAN */ diff --git a/configs/sama5d3-xplained/src/sam_pwm.c b/configs/sama5d3-xplained/src/sam_pwm.c index a6acea54d85752918c887ab7d1efa86d5115053f..bbb6b054174a07ed8a231d846381f86ed6352ae2 100644 --- a/configs/sama5d3-xplained/src/sam_pwm.c +++ b/configs/sama5d3-xplained/src/sam_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3-xplained/src/sam_pwm.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -107,24 +107,19 @@ #if defined(CONFIG_PWM) && defined(CONFIG_SAMA5_PWM) -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: sam_pwm_setup * * Description: - * All SAMA5 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int sam_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/sama5d3-xplained/src/sama5d3-xplained.h b/configs/sama5d3-xplained/src/sama5d3-xplained.h index 66e1231a4c03c39f1aaf5dcdf68a8d495a6fadf7..40de794377d436d893ca2ee13283761a42640833 100644 --- a/configs/sama5d3-xplained/src/sama5d3-xplained.h +++ b/configs/sama5d3-xplained/src/sama5d3-xplained.h @@ -725,41 +725,66 @@ bool sam_writeprotected(int slotno); void weak_function sam_usbinitialize(void); #endif -/**************************************************************************************************** +/************************************************************************************ * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. This function will - * start a thread that will monitor for device connection/disconnection events. + * Called at application startup time to initialize the USB host functionality. + * This function will start a thread that will monitor for device connection/ + * disconnection events. * - ****************************************************************************************************/ + ************************************************************************************/ #ifdef HAVE_USBHOST int sam_usbhost_initialize(void); #endif /************************************************************************************ - * Name: sam_netinitialize + * Name: sam_pwm_setup * * Description: - * Configure board resources to support networking. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -#ifdef HAVE_NETWORK -void weak_function sam_netinitialize(void); +#ifdef CONFIG_PWM +int sam_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: sam_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int sam_adc_setup(void); #endif /************************************************************************************ - * Name: board_adc_initialize + * Name: sam_can_setup * * Description: - * Initialize and register the ADC driver + * Initialize CAN and register the CAN device * ************************************************************************************/ -#ifdef CONFIG_SAMA5_ADC -int board_adc_initialize(void); +#ifdef CONFIG_CAN +int sam_can_setup(void); +#endif + +/************************************************************************************ + * Name: sam_netinitialize + * + * Description: + * Configure board resources to support networking. + * + ************************************************************************************/ + +#ifdef HAVE_NETWORK +void weak_function sam_netinitialize(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/configs/sama5d3x-ek/demo/defconfig b/configs/sama5d3x-ek/demo/defconfig index e31ab7c06870fd68f22e5e49005bc23308471b45..b0e5384d27d35e4137340019c9b91ebe49cd8857 100644 --- a/configs/sama5d3x-ek/demo/defconfig +++ b/configs/sama5d3x-ek/demo/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -435,8 +433,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -662,7 +658,6 @@ CONFIG_AT25_SPIFREQUENCY=10000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -976,7 +971,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/hello/defconfig b/configs/sama5d3x-ek/hello/defconfig index e6685267cfc7eb0fed026be3cde9b4edbaa90a61..d4ab5620205d5c3424f76d6bc23cc511d4720142 100644 --- a/configs/sama5d3x-ek/hello/defconfig +++ b/configs/sama5d3x-ek/hello/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -515,7 +513,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -736,7 +733,6 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/norboot/defconfig b/configs/sama5d3x-ek/norboot/defconfig index f2549c68024a8ddbc24378e6042bc69123789405..11eedfe99aaccf39f49a4bb2fbb09b506236481e 100644 --- a/configs/sama5d3x-ek/norboot/defconfig +++ b/configs/sama5d3x-ek/norboot/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -529,7 +527,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -750,7 +747,6 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/nsh/defconfig b/configs/sama5d3x-ek/nsh/defconfig index 9ed0736276fe936cb71fc6065b1be3478fdb5af8..b3140774afeaab78e5d34b598dee4a3bfa7db02a 100644 --- a/configs/sama5d3x-ek/nsh/defconfig +++ b/configs/sama5d3x-ek/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -533,7 +531,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -793,7 +790,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/nx/defconfig b/configs/sama5d3x-ek/nx/defconfig index 54bf3ccefa11a9f6dece81258c22938ed46b8205..b67a145dfcfb850cb652748ea74953092a27c9ef 100644 --- a/configs/sama5d3x-ek/nx/defconfig +++ b/configs/sama5d3x-ek/nx/defconfig @@ -64,10 +64,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -77,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -411,6 +412,7 @@ CONFIG_SAMA5D3xEK_MT47H128M16RT=y # CONFIG_SAMA5D3xEK_MT47H64M16HR is not set # CONFIG_SAMA5D3xEK_NOREDLED is not set # CONFIG_SAMA5D3xEK_SLOWCLOCK is not set +# CONFIG_BOARD_CRASHDUMP is not set # CONFIG_LIB_BOARDCTL is not set # @@ -431,6 +433,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2013 CONFIG_START_MONTH=8 @@ -523,6 +526,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -538,12 +542,16 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -551,7 +559,12 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -574,7 +587,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -624,9 +636,12 @@ CONFIG_USART1_2STOP=0 # CONFIG_USART1_IFLOWCONTROL is not set # CONFIG_USART1_OFLOWCONTROL is not set # CONFIG_USART1_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -640,6 +655,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -811,6 +827,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -836,6 +854,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -866,9 +885,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -903,12 +923,10 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -945,6 +963,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -982,7 +1001,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -992,6 +1011,7 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sama5d3x-ek/nxplayer/defconfig b/configs/sama5d3x-ek/nxplayer/defconfig index 02ceea85b992c437619ccd0bbcaf12a8dd09dca9..00b2d5479dd3f9c4bac4d7b9fe1027a6f7e76543 100644 --- a/configs/sama5d3x-ek/nxplayer/defconfig +++ b/configs/sama5d3x-ek/nxplayer/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -432,8 +430,6 @@ CONFIG_SAMA5D3xEK_WM8904_SRCMAIN=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -632,7 +628,6 @@ CONFIG_SDIO_BLOCKSETUP=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -925,7 +920,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/nxwm/defconfig b/configs/sama5d3x-ek/nxwm/defconfig index d041a397079fa638b1bdf41c92e0863ee64d779e..a3048551bdf89301381b00aa24ea4f4ac1083fa9 100644 --- a/configs/sama5d3x-ek/nxwm/defconfig +++ b/configs/sama5d3x-ek/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -64,10 +66,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -77,7 +81,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -429,7 +432,6 @@ CONFIG_ARCH_LEDS=y CONFIG_ARCH_HAVE_BUTTONS=y # CONFIG_ARCH_BUTTONS is not set CONFIG_ARCH_HAVE_IRQBUTTONS=y -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options @@ -442,11 +444,10 @@ CONFIG_SAMA5D3xEK_MT47H128M16RT=y # CONFIG_SAMA5D3xEK_NOREDLED is not set CONFIG_SAMA5D3xEK_TSD_DEVMINOR=0 # CONFIG_SAMA5D3xEK_SLOWCLOCK is not set +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -468,6 +469,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2013 CONFIG_START_MONTH=10 @@ -480,6 +482,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -496,6 +499,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -538,7 +543,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -566,6 +571,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=1024 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -581,12 +587,16 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set CONFIG_ANALOG=y @@ -609,7 +619,12 @@ CONFIG_INPUT=y # CONFIG_BUTTONS is not set # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -632,7 +647,6 @@ CONFIG_INPUT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -682,9 +696,12 @@ CONFIG_USART1_2STOP=0 # CONFIG_USART1_IFLOWCONTROL is not set # CONFIG_USART1_OFLOWCONTROL is not set # CONFIG_USART1_DMA is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -698,6 +715,7 @@ CONFIG_SYSLOG_SERIAL_CONSOLE=y CONFIG_SYSLOG_CONSOLE=y # CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -827,13 +845,14 @@ CONFIG_NXFONT_SANS28X37B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=640 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -853,7 +872,11 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DISPLAYNO=0 +CONFIG_NXSTART_VPLANE=0 # # Memory Management @@ -900,6 +923,8 @@ CONFIG_LIBM=y CONFIG_LIBC_FLOATINGPOINT=y CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -918,6 +943,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -927,6 +954,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -958,9 +986,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Examples # # CONFIG_EXAMPLES_ADC is not set +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -988,12 +1017,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1033,6 +1060,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1098,12 +1126,12 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_LS is not set # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1120,11 +1148,13 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -1156,10 +1186,7 @@ CONFIG_NXWIDGETS=y # # CONFIG_NXWIDGETS_FLICKERFREE is not set # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_VPLANE=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=1596 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=1596 @@ -1254,7 +1281,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=6 CONFIG_NXWM_STARTWINDOW_VSPACING=8 CONFIG_NXWM_STARTWINDOW_HSPACING=8 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -1341,7 +1368,7 @@ CONFIG_NXWM_HEXCALCULATOR_FONTID=6 # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -1351,6 +1378,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sama5d3x-ek/ov2640/defconfig b/configs/sama5d3x-ek/ov2640/defconfig index b0fa78067861645408b8c40885c0b294f6eae66b..c0d64cc771a59be41547eeb64cb02eff713f9524 100644 --- a/configs/sama5d3x-ek/ov2640/defconfig +++ b/configs/sama5d3x-ek/ov2640/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -600,7 +598,6 @@ CONFIG_OV2640_SVGA_RESOLUTION=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -819,7 +816,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d3x-ek/src/Makefile b/configs/sama5d3x-ek/src/Makefile index 86fd69cd020587853285a7ea9f8d30aa87801bc8..45cbfd26b465b0232254cd4f76137c24e7ae7fba 100644 --- a/configs/sama5d3x-ek/src/Makefile +++ b/configs/sama5d3x-ek/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/sama5d3x-ek/src/Makefile # -# Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. +# Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/sama5d3x-ek/src/sam_adc.c b/configs/sama5d3x-ek/src/sam_adc.c index 2600ffd09887b64c9245e94151f737bf5afe0db6..50982fb41c9f767835c6fb2a5d6ba7e98358a7cc 100644 --- a/configs/sama5d3x-ek/src/sam_adc.c +++ b/configs/sama5d3x-ek/src/sam_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3x-ek/src/sam_adc.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,33 +50,19 @@ #ifdef CONFIG_ADC -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: sam_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int sam_adc_setup(void) { #ifdef CONFIG_SAMA5_ADC static bool initialized = false; diff --git a/configs/sama5d3x-ek/src/sam_appinit.c b/configs/sama5d3x-ek/src/sam_appinit.c index b3fb39f67605b33fd3b042b63c7a2b5257e78f29..f352bcdf974275f9305a0e90040d5c88661e0355 100644 --- a/configs/sama5d3x-ek/src/sam_appinit.c +++ b/configs/sama5d3x-ek/src/sam_appinit.c @@ -89,11 +89,7 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_AT24) || \ - defined(HAVE_HSMCI) || defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) ||\ - defined(HAVE_WM8904) || defined(CONFIG_FS_PROCFS) int ret; -#endif #ifdef HAVE_NAND /* Initialize the NAND driver */ @@ -188,6 +184,36 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = sam_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = sam_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = sam_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_can_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_FS_PROCFS /* Mount the procfs file system */ @@ -199,5 +225,6 @@ int board_app_initialize(uintptr_t arg) } #endif + UNUSED(ret); return OK; } diff --git a/configs/sama5d3x-ek/src/sam_can.c b/configs/sama5d3x-ek/src/sam_can.c index f483e30dd0cfdc6cdc9d64c021a2c65beee6faef..4fc441f11010b99407bcdaae8e466149bb4ade0f 100644 --- a/configs/sama5d3x-ek/src/sam_can.c +++ b/configs/sama5d3x-ek/src/sam_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3x-ek/src/sam_can.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include "sam_can.h" #include "sama5d3x-ek.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -74,48 +74,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: sam_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int sam_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_SAMA5_CAN0) || defined(CONFIG_SAMA5_CAN1) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = sam_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = sam_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_SAMA5_CAN0 || CONFIG_SAMA5_CAN1) */ +#endif /* CONFIG_CAN */ diff --git a/configs/sama5d3x-ek/src/sam_pwm.c b/configs/sama5d3x-ek/src/sam_pwm.c index 8cc1642e71a54443868d4cc4993fca2f49844568..0d422586bfbacec76a07588f16e4ba66624d384e 100644 --- a/configs/sama5d3x-ek/src/sam_pwm.c +++ b/configs/sama5d3x-ek/src/sam_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3x-ek/src/sam_pwm.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -107,24 +107,19 @@ #if defined(CONFIG_PWM) && defined(CONFIG_SAMA5_PWM) -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: sam_pwm_setup * * Description: - * All SAMA5 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int sam_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/sama5d3x-ek/src/sama5d3x-ek.h b/configs/sama5d3x-ek/src/sama5d3x-ek.h index 6521211395740220040ee7ef8bcc3b5289c1adb9..51647349a25cb99a7e32e1610a18f3661cba5001 100644 --- a/configs/sama5d3x-ek/src/sama5d3x-ek.h +++ b/configs/sama5d3x-ek/src/sama5d3x-ek.h @@ -807,14 +807,15 @@ bool sam_writeprotected(int slotno); void weak_function sam_usbinitialize(void); #endif -/**************************************************************************************************** +/************************************************************************************ * Name: stm32_usbhost_initialize * * Description: - * Called at application startup time to initialize the USB host functionality. This function will - * start a thread that will monitor for device connection/disconnection events. + * Called at application startup time to initialize the USB host functionality. + * This function will start a thread that will monitor for device connection/ + * disconnection events. * - ****************************************************************************************************/ + ************************************************************************************/ #ifdef HAVE_USBHOST int sam_usbhost_initialize(void); @@ -832,7 +833,43 @@ int sam_usbhost_initialize(void); void weak_function sam_netinitialize(void); #endif -/**************************************************************************** +/************************************************************************************ + * Name: sam_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int sam_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: sam_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int sam_adc_setup(void); +#endif + +/************************************************************************************ + * Name: sam_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ************************************************************************************/ + +#ifdef CONFIG_CAN +int sam_can_setup(void); +#endif + +/************************************************************************************ * Name: sam_wm8904_initialize * * Description: @@ -847,7 +884,7 @@ void weak_function sam_netinitialize(void); * Zero is returned on success. Otherwise, a negated errno value is * returned to indicate the nature of the failure. * - ****************************************************************************/ + ************************************************************************************/ #ifdef HAVE_WM8904 int sam_wm8904_initialize(int minor); diff --git a/configs/sama5d4-ek/at25boot/defconfig b/configs/sama5d4-ek/at25boot/defconfig index c42d478750211efb64013836c709aa9209a44273..57b32544cd3c1df71a34ebe801ef5a4eb0fc986b 100644 --- a/configs/sama5d4-ek/at25boot/defconfig +++ b/configs/sama5d4-ek/at25boot/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -599,7 +597,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -851,7 +848,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d4-ek/bridge/defconfig b/configs/sama5d4-ek/bridge/defconfig index 2fe78fac246ce0ed20492d3f847922516077391d..d723f2415082e296eae8adcae632f65ba36912ca 100644 --- a/configs/sama5d4-ek/bridge/defconfig +++ b/configs/sama5d4-ek/bridge/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -319,6 +317,7 @@ CONFIG_SAMA5_EMAC1_PHYSR_10FD=0x5 CONFIG_SAMA5_EMAC1_PHYSR_100FD=0x6 # CONFIG_SAMA5_EMACB_PREALLOCATE is not set # CONFIG_SAMA5_EMACB_NBC is not set +CONFIG_SAMA5_EMACB_HPWORK=y CONFIG_SAMA5_EMAC0_ISETH0=y # CONFIG_SAMA5_EMAC1_ISETH0 is not set @@ -501,6 +500,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -509,6 +509,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -520,8 +521,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -612,10 +616,8 @@ CONFIG_NETDEV_MULTINIC=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -649,7 +651,6 @@ CONFIG_ETH1_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -727,13 +728,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -1047,7 +1046,6 @@ CONFIG_EXAMPLES_BRIDGE_NET2_PRIORITY=100 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d4-ek/dramboot/defconfig b/configs/sama5d4-ek/dramboot/defconfig index 4b0fa6cebb439467848c75d60c9342291c73f4c2..8ca250d5d3f163d8ab6e4ad148f924d9478fcea8 100644 --- a/configs/sama5d4-ek/dramboot/defconfig +++ b/configs/sama5d4-ek/dramboot/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -551,7 +549,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -803,7 +800,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d4-ek/elf/defconfig b/configs/sama5d4-ek/elf/defconfig index 09ac89d5c76a8eecce50f2e9ae720d5d0157526b..7382750412061521cc52c4a7831dd9bc26cded78 100644 --- a/configs/sama5d4-ek/elf/defconfig +++ b/configs/sama5d4-ek/elf/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -578,7 +576,6 @@ CONFIG_AUDIO_DEVICES=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -852,7 +849,6 @@ CONFIG_EXAMPLES_ELF_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sama5d4-ek/ipv6/defconfig b/configs/sama5d4-ek/ipv6/defconfig index c60fca08436d741e43c41f8939dcb0be2df1ba2f..434147e369635750efeb13af0a73c014c1deac76 100644 --- a/configs/sama5d4-ek/ipv6/defconfig +++ b/configs/sama5d4-ek/ipv6/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -526,8 +524,6 @@ CONFIG_SAMA5D4EK_WM8904_SRCMAIN=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -765,10 +761,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -792,7 +787,6 @@ CONFIG_ETH0_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -910,13 +904,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=562 CONFIG_NET_GUARDSIZE=2 @@ -1298,19 +1290,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="PB_USER" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1359,7 +1338,6 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sama5d4-ek/knsh/defconfig b/configs/sama5d4-ek/knsh/defconfig index e1acee79ecc2cc13d5b1ed9463eeb4b8f1b2a7cf..feeeb88157ab71d6223ed405b5b0d40a618e6cdf 100644 --- a/configs/sama5d4-ek/knsh/defconfig +++ b/configs/sama5d4-ek/knsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -607,7 +605,6 @@ CONFIG_SDIO_BLOCKSETUP=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -903,7 +900,6 @@ CONFIG_EXAMPLES_NSH_PROGNAME="init" # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d4-ek/knsh/defconfig.ROMFS b/configs/sama5d4-ek/knsh/defconfig.ROMFS index 47724cd6dc9e9a306212f27bdd1f28c88657b043..047303d132b9c608dcaae3d91dd67f1bda7f8c26 100644 --- a/configs/sama5d4-ek/knsh/defconfig.ROMFS +++ b/configs/sama5d4-ek/knsh/defconfig.ROMFS @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_IMX1 is not set # CONFIG_ARCH_CHIP_KINETIS is not set @@ -483,7 +481,6 @@ CONFIG_RTC_DATETIME=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -742,7 +739,6 @@ CONFIG_EXAMPLES_NSH_PROGNAME="init" # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set # CONFIG_EXAMPLES_RANDOM is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sama5d4-ek/nsh/defconfig b/configs/sama5d4-ek/nsh/defconfig index 446b2d3dfd8bb866ec160110db78657d7ef21e2c..a169aa669cd4cf89213c04194142472e093414cf 100644 --- a/configs/sama5d4-ek/nsh/defconfig +++ b/configs/sama5d4-ek/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -526,8 +524,6 @@ CONFIG_SAMA5D4EK_WM8904_SRCMAIN=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -767,10 +763,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -794,7 +789,6 @@ CONFIG_ETH0_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -912,13 +906,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=562 CONFIG_NET_GUARDSIZE=2 @@ -1309,19 +1301,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="PB_USER" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1370,7 +1349,6 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index 907dd01ff8112a40efdbaa4c300f0bf676b57b18..2c59ec0fa6aae0c56adabe19a0e7ac574c04406d 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,7 +67,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +81,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -497,8 +497,6 @@ CONFIG_SAMA5D4EK_MXT_DEVMINOR=0 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -530,6 +528,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -547,6 +546,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -590,7 +591,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -736,10 +737,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -763,7 +762,6 @@ CONFIG_ETH0_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -881,13 +879,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=562 CONFIG_NET_GUARDSIZE=2 @@ -1121,13 +1117,14 @@ CONFIG_NXFONT_SANS28X37B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=640 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1147,7 +1144,11 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DISPLAYNO=0 +CONFIG_NXSTART_VPLANE=0 # # Memory Management @@ -1249,6 +1250,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set CONFIG_NETDB_DNSCLIENT=y @@ -1297,19 +1299,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="PB_USER" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1349,7 +1338,6 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -1510,6 +1498,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -1590,10 +1579,7 @@ CONFIG_NXWIDGETS=y # # CONFIG_NXWIDGETS_FLICKERFREE is not set # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_VPLANE=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=1596 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=1596 @@ -1688,7 +1674,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=6 CONFIG_NXWM_STARTWINDOW_VSPACING=8 CONFIG_NXWM_STARTWINDOW_HSPACING=8 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/sama5d4-ek/ramtest/defconfig b/configs/sama5d4-ek/ramtest/defconfig index dd96d28c1ff40c3c5eff73b63ecb9ff2b0dce4aa..e76da62faa1ae898dce62d1c55ce91b77e1f9b21 100644 --- a/configs/sama5d4-ek/ramtest/defconfig +++ b/configs/sama5d4-ek/ramtest/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -551,7 +549,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -811,7 +808,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sama5d4-ek/src/sam_adc.c b/configs/sama5d4-ek/src/sam_adc.c index 762caccd20259b89e01f6f599aae8db15a825209..031eb6673d503a4c972ef5371e69d3a66999b412 100644 --- a/configs/sama5d4-ek/src/sam_adc.c +++ b/configs/sama5d4-ek/src/sam_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d4-ek/src/sam_adc.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,32 +50,19 @@ #ifdef CONFIG_ADC -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: sam_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int sam_adc_setup(void) { #ifdef CONFIG_SAMA5_ADC static bool initialized = false; diff --git a/configs/sama5d4-ek/src/sam_bringup.c b/configs/sama5d4-ek/src/sam_bringup.c index 3aaccd3244af2c2c61cdc5830409e587611f7831..5669b17fc78fcefcbf4ef00a9e4ee4f55a080c17 100644 --- a/configs/sama5d4-ek/src/sam_bringup.c +++ b/configs/sama5d4-ek/src/sam_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/sama5d4-ek/src/sam_bringup.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -146,12 +146,7 @@ static void sam_i2ctool(void) int sam_bringup(void) { -#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ - defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || defined(HAVE_WM8904) || \ - defined(HAVE_AUTOMOUNTER) || defined(HAVE_ELF) || defined(HAVE_ROMFS) || \ - defined(CONFIG_FS_PROCFS) int ret; -#endif /* Register I2C drivers on behalf of the I2C tool */ @@ -293,6 +288,26 @@ int sam_bringup(void) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = sam_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = sam_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_adc_setup failed: %d\n", ret); + } +#endif + #ifdef HAVE_WM8904 /* Configure WM8904 audio */ @@ -340,5 +355,6 @@ int sam_bringup(void) * capabilities. */ + UNUSED(ret); return OK; } diff --git a/configs/sama5d4-ek/src/sam_pwm.c b/configs/sama5d4-ek/src/sam_pwm.c index ebae4ce11b8efe5f646e9e49373a6df7ccdc1992..a3ad6760a77740b1dd40481b9772175abdb4a0c1 100644 --- a/configs/sama5d4-ek/src/sam_pwm.c +++ b/configs/sama5d4-ek/src/sam_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d4-ek/src/sam_pwm.c * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -107,24 +107,19 @@ #if defined(CONFIG_PWM) && defined(CONFIG_SAMA5_PWM) -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: sam_pwm_setup * * Description: - * All SAMA5 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int sam_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/sama5d4-ek/src/sama5d4-ek.h b/configs/sama5d4-ek/src/sama5d4-ek.h index ed7ff6bd2b352e589e7f972a8d229aed5f176b10..4bf4031976f252a7985a67f3bb22128aa9a29d3f 100644 --- a/configs/sama5d4-ek/src/sama5d4-ek.h +++ b/configs/sama5d4-ek/src/sama5d4-ek.h @@ -1073,6 +1073,30 @@ void weak_function sam_usbinitialize(void); int sam_usbhost_initialize(void); #endif +/************************************************************************************ + * Name: sam_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int sam_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: sam_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int sam_adc_setup(void); +#endif + /************************************************************************************ * Name: sam_netinitialize * diff --git a/configs/samd20-xplained/nsh/defconfig b/configs/samd20-xplained/nsh/defconfig index 66cdfec15759121b84cf1e0d1bee0b9767a9f399..a91d464767f40bb6e5673a10a52b1402bab4ed35 100644 --- a/configs/samd20-xplained/nsh/defconfig +++ b/configs/samd20-xplained/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -478,7 +476,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -733,7 +730,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samd21-xplained/nsh/defconfig b/configs/samd21-xplained/nsh/defconfig index aff0c4e55960ee5c1042fe5a3d8fcc05cae41c4b..3181a18cfe6852d254821503395bb6c46d7ad534 100644 --- a/configs/samd21-xplained/nsh/defconfig +++ b/configs/samd21-xplained/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -476,7 +474,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -731,7 +728,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/same70-xplained/README.txt b/configs/same70-xplained/README.txt index 6f84f024fa64f1f71711af3d1446d50f2a6797b5..c95eef6e1bdc28d5488e78af13ba4a5d9988cbc0 100644 --- a/configs/same70-xplained/README.txt +++ b/configs/same70-xplained/README.txt @@ -388,7 +388,6 @@ Selecting the GMAC peripheral Networking Support CONFIG_NET=y : Enable Neworking - CONFIG_NET_NOINTS=y : Use the work queue, not interrupts for processing CONFIG_NET_SOCKOPTS=y : Enable socket operations CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU @@ -733,10 +732,6 @@ MCAN1 Loopback Test CONFIG_SAMV7_MCAN1_TXFIFOQ_SIZE=8 # There are 8 queue elements CONFIG_SAMV7_MCAN1_TXEVENTFIFO_SIZE=0 # The event FIFO is not used - Board Selection - CONFIG_LIB_BOARDCTL=y # Needed for CAN initialization - CONFIG_BOARDCTL_CANINIT=y # Enabled CAN initialization - Enabling the CAN Loopback Test ------------------------------ Application Configuration -> Examples -> CAN Example @@ -1363,36 +1358,7 @@ Configuration sub-directories RAMTest: Address-in-address test: 70000000 2097152 nsh> - 5. The button test at apps/examples/buttons is included in the - configuration. This configuration illustrates (1) use of the buttons - on the evaluation board, and (2) the use of PIO interrupts. Example - usage: - - NuttShell (NSH) NuttX-7.8 - nsh> help - help usage: help [-v] [] - ... - Builtin Apps: - buttons - nsh> buttons 3 - maxbuttons: 3 - Attached handler at 4078f7 to button 0 [SW0], oldhandler:0 - Attached handler at 4078e9 to button 1 [SW1], oldhandler:0 - IRQ:125 Button 1:SW1 SET:00: - SW1 released - IRQ:125 Button 1:SW1 SET:02: - SW1 depressed - IRQ:125 Button 1:SW1 SET:00: - SW1 released - IRQ:90 Button 0:SW0 SET:01: - SW0 depressed - IRQ:90 Button 0:SW0 SET:00: - SW0 released - IRQ:125 Button 1:SW1 SET:02: - SW1 depressed - nsh> - - 6. TWI/I2C + 5. TWI/I2C TWIHS0 is enabled in this configuration. The SAM E70 Xplained supports one device on the one on-board I2C device on the TWIHS0 bus: @@ -1464,11 +1430,11 @@ Configuration sub-directories 0x5f are the addresses of the AT24 EEPROM (I am not sure what the other address, 0x37, is as this writing). - 7. TWIHS0 is also used to support 256 byte non-volatile storage for + 6. TWIHS0 is also used to support 256 byte non-volatile storage for configuration data using the MTD configuration as described above under the heading, "MTD Configuration Data". - 8. Support for HSMCI is built-in by default. The SAME70-XPLD provides + 7. Support for HSMCI is built-in by default. The SAME70-XPLD provides one full-size SD memory card slot. Refer to the section entitled "SD card" for configuration-related information. @@ -1477,7 +1443,7 @@ Configuration sub-directories The auto-mounter is not enabled. See the section above entitled "Auto-Mounter". - 9. Performance-related Configuration settings: + 8. Performance-related Configuration settings: CONFIG_ARMV7M_ICACHE=y : Instruction cache is enabled CONFIG_ARMV7M_DCACHE=y : Data cache is enabled diff --git a/configs/same70-xplained/netnsh/defconfig b/configs/same70-xplained/netnsh/defconfig index 70c8117a63d7127187e6b88fd8b4b9b960c505b2..c2d2a2401b37f4b05890068dfcc3bb8139636aac 100644 --- a/configs/same70-xplained/netnsh/defconfig +++ b/configs/same70-xplained/netnsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -400,8 +398,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -666,10 +662,9 @@ CONFIG_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -693,7 +688,6 @@ CONFIG_ETH0_PHY_KSZ8081=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -770,13 +764,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1041,19 +1033,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="SW0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1090,7 +1069,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/same70-xplained/nsh/defconfig b/configs/same70-xplained/nsh/defconfig index 183961eacf08604e379712fd04ba186bb2f0bfd8..c8dc02ad826173e8aaacfd27acb3a69864204a30 100644 --- a/configs/same70-xplained/nsh/defconfig +++ b/configs/same70-xplained/nsh/defconfig @@ -64,11 +64,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -383,8 +383,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -525,15 +523,15 @@ CONFIG_I2C=y # CONFIG_I2C_TRACE is not set CONFIG_I2C_DRIVER=y CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y # CONFIG_SPI_CS_CONTROL is not set -# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set # CONFIG_SPI_BITBANG is not set @@ -633,7 +631,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -860,20 +857,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=0 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=0 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="SW0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Button 1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -906,7 +891,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/same70-xplained/src/sam_bringup.c b/configs/same70-xplained/src/sam_bringup.c index 9a84f3228ea0c32c261c3bacfbfc0ce1322c7591..4b41c93674ffeb6871eeaa58aa2c22e178a7cd14 100644 --- a/configs/same70-xplained/src/sam_bringup.c +++ b/configs/same70-xplained/src/sam_bringup.c @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -97,14 +98,14 @@ static void sam_i2c_register(int bus) i2c = sam_i2cbus_initialize(bus); if (i2c == NULL) { - _err("ERROR: Failed to get I2C%d interface\n", bus); + syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - _err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n", bus, ret); sam_i2cbus_uninitialize(i2c); } } @@ -169,7 +170,7 @@ int sam_bringup(void) ret = sam_emac0_setmac(); if (ret < 0) { - _err("ERROR: sam_emac0_setmac() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: sam_emac0_setmac() failed: %d\n", ret); } #endif @@ -179,8 +180,8 @@ int sam_bringup(void) ret = mount(NULL, SAME70_PROCFS_MOUNTPOINT, "procfs", 0, NULL); if (ret < 0) { - _err("ERROR: Failed to mount procfs at %s: %d\n", - SAME70_PROCFS_MOUNTPOINT, ret); + syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n", + SAME70_PROCFS_MOUNTPOINT, ret); } #endif @@ -192,7 +193,7 @@ int sam_bringup(void) ret = sam_at24config(); if (ret < 0) { - _err("ERROR: sam_at24config() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: sam_at24config() failed: %d\n", ret); } #endif @@ -202,8 +203,8 @@ int sam_bringup(void) ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR); if (ret < 0) { - _err("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", - HSMCI0_SLOTNO, HSMCI0_MINOR, ret); + syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", + HSMCI0_SLOTNO, HSMCI0_MINOR, ret); } #ifdef CONFIG_SAME70XPLAINED_HSMCI0_MOUNT @@ -219,8 +220,8 @@ int sam_bringup(void) if (ret < 0) { - _err("ERROR: Failed to mount %s: %d\n", - CONFIG_SAME70XPLAINED_HSMCI0_MOUNT_MOUNTPOINT, errno); + syslog(LOG_ERR, "ERROR: Failed to mount %s: %d\n", + CONFIG_SAME70XPLAINED_HSMCI0_MOUNT_MOUNTPOINT, errno); } } @@ -241,7 +242,7 @@ int sam_bringup(void) CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_SECTSIZE); if (ret < 0) { - _err("ERROR: romdisk_register failed: %d\n", -ret); + syslog(LOG_ERR, "ERROR: romdisk_register failed: %d\n", -ret); } else { @@ -252,9 +253,9 @@ int sam_bringup(void) "romfs", MS_RDONLY, NULL); if (ret < 0) { - _err("ERROR: mount(%s,%s,romfs) failed: %d\n", - CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_DEVNAME, - CONFIG_SAME70XPLAINED_ROMFS_MOUNT_MOUNTPOINT, errno); + syslog(LOG_ERR, "ERROR: mount(%s,%s,romfs) failed: %d\n", + CONFIG_SAME70XPLAINED_ROMFS_ROMDISK_DEVNAME, + CONFIG_SAME70XPLAINED_ROMFS_MOUNT_MOUNTPOINT, errno); } } #endif @@ -269,7 +270,7 @@ int sam_bringup(void) mtd = progmem_initialize(); if (!mtd) { - _err("ERROR: progmem_initialize failed\n"); + syslog(LOG_ERR, "ERROR: progmem_initialize failed\n"); } /* Use the FTL layer to wrap the MTD driver as a block driver */ @@ -277,7 +278,7 @@ int sam_bringup(void) ret = ftl_initialize(PROGMEM_MTD_MINOR, mtd); if (ret < 0) { - _err("ERROR: Failed to initialize the FTL layer: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", ret); return ret; } @@ -291,7 +292,7 @@ int sam_bringup(void) ret = bchdev_register(blockdev, chardev, false); if (ret < 0) { - _err("ERROR: bchdev_register %s failed: %d\n", chardev, ret); + syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n", chardev, ret); return ret; } #endif @@ -304,7 +305,7 @@ int sam_bringup(void) ret = sam_usbhost_initialize(); if (ret != OK) { - _err("ERROR: Failed to initialize USB host: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); } #endif @@ -314,18 +315,28 @@ int sam_bringup(void) ret = usbmonitor_start(); if (ret != OK) { - _err("ERROR: Failed to start the USB monitor: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to start the USB monitor: %d\n", ret); + } +#endif + +#ifdef CONFIG_SAMV7_MCAN + /* Initialize CAN and register the CAN driver. */ + + ret = sam_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_can_setup failed: %d\n", ret); } #endif #ifdef HAVE_ELF /* Initialize the ELF binary loader */ - _err("Initializing the ELF binary loader\n"); + syslog(LOG_ERR, "Initializing the ELF binary loader\n"); ret = elf_initialize(); if (ret < 0) { - _err("ERROR: Initialization of the ELF loader failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: Initialization of the ELF loader failed: %d\n", ret); } #endif @@ -333,7 +344,7 @@ int sam_bringup(void) ret = sam_dacdev_initialize(); if (ret < 0) { - _err("ERROR: Initialization of the DAC module failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: Initialization of the DAC module failed: %d\n", ret); } #endif diff --git a/configs/same70-xplained/src/sam_mcan.c b/configs/same70-xplained/src/sam_mcan.c index 2c5301c3a1c53d944aa7a3328cfbca7591f14ed7..5a96930a6393f6dd7aa7b86241cdab5034da4217 100644 --- a/configs/same70-xplained/src/sam_mcan.c +++ b/configs/same70-xplained/src/sam_mcan.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/same70-xplainedk/src/sam_mcan.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include "sam_mcan.h" #include "same70-xplained.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_SAMV7_MCAN0) || defined(CONFIG_SAMV7_MCAN1)) +#ifdef CONFIG_SAMV7_MCAN /************************************************************************************ * Pre-processor Definitions @@ -72,48 +72,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: sam_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int sam_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_SAMV7_MCAN0) || defined(CONFIG_SAMV7_MCAN1) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = sam_mcan_initialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = sam_mcan_initialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_SAMV7_MCAN0 || CONFIG_SAMV7_MCAN1) */ +#endif /* CONFIG_SAMV7_MCAN */ diff --git a/configs/same70-xplained/src/same70-xplained.h b/configs/same70-xplained/src/same70-xplained.h index 117c6a68933f9a39361836846664275c87a1d846..ed0e98e15644770cd9144c76d7e0b9e17b901a6b 100644 --- a/configs/same70-xplained/src/same70-xplained.h +++ b/configs/same70-xplained/src/same70-xplained.h @@ -400,6 +400,18 @@ int sam_hsmci_initialize(int slot, int minor); void sam_usbinitialize(void); #endif +/**************************************************************************** + * Name: sam_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_SAMV7_MCAN +int sam_can_setup(void); +#endif + /************************************************************************************ * Name: sam_netinitialize * diff --git a/configs/saml21-xplained/nsh/defconfig b/configs/saml21-xplained/nsh/defconfig index 6fab4a5a01658295b9cbfce272562c64403c9d83..9d487c68b007e1c78c929124318a364b80c4a044 100644 --- a/configs/saml21-xplained/nsh/defconfig +++ b/configs/saml21-xplained/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -464,7 +462,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -719,7 +716,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/README.txt b/configs/samv71-xult/README.txt index d51f23dfe173e9d94e826a30f0675bda1549eb11..2452746a0ed6ad591aba1a900070fa3ea8fddd24 100644 --- a/configs/samv71-xult/README.txt +++ b/configs/samv71-xult/README.txt @@ -704,7 +704,6 @@ Selecting the GMAC peripheral Networking Support CONFIG_NET=y : Enable Neworking - CONFIG_NET_NOINTS=y : Use the work queue, not interrupts for processing CONFIG_NET_SOCKOPTS=y : Enable socket operations CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU @@ -1323,10 +1322,6 @@ MCAN1 Loopback Test CONFIG_SAMV7_MCAN1_TXFIFOQ_SIZE=8 # There are 8 queue elements CONFIG_SAMV7_MCAN1_TXEVENTFIFO_SIZE=0 # The event FIFO is not used - Board Selection - CONFIG_LIB_BOARDCTL=y # Needed for CAN initialization - CONFIG_BOARDCTL_CANINIT=y # Enabled CAN initialization - Enabling the CAN Loopback Test ------------------------------ Application Configuration -> Examples -> CAN Example @@ -2053,36 +2048,7 @@ Configuration sub-directories RAMTest: Address-in-address test: 70000000 2097152 nsh> - 5. The button test at apps/examples/buttons is included in the - configuration. This configuration illustrates (1) use of the buttons - on the evaluation board, and (2) the use of PIO interrupts. Example - usage: - - NuttShell (NSH) NuttX-7.8 - nsh> help - help usage: help [-v] [] - ... - Builtin Apps: - buttons - nsh> buttons 3 - maxbuttons: 3 - Attached handler at 4078f7 to button 0 [SW0], oldhandler:0 - Attached handler at 4078e9 to button 1 [SW1], oldhandler:0 - IRQ:125 Button 1:SW1 SET:00: - SW1 released - IRQ:125 Button 1:SW1 SET:02: - SW1 depressed - IRQ:125 Button 1:SW1 SET:00: - SW1 released - IRQ:90 Button 0:SW0 SET:01: - SW0 depressed - IRQ:90 Button 0:SW0 SET:00: - SW0 released - IRQ:125 Button 1:SW1 SET:02: - SW1 depressed - nsh> - - 6. TWI/I2C + 5. TWI/I2C TWIHS0 is enabled in this configuration. The SAM V71 Xplained Ultra supports two devices on the one on-board I2C device on the TWIHS0 bus: @@ -2159,11 +2125,11 @@ Configuration sub-directories the AT2 EEPROM (I am not sure what the other address, 0x37, is as this writing). - 7. TWIHS0 is also used to support 256 byte non-volatile storage for + 6. TWIHS0 is also used to support 256 byte non-volatile storage for configuration data using the MTD configuration as described above under the heading, "MTD Configuration Data". - 8. Support for HSMCI is built-in by default. The SAMV71-XULT provides + 7. Support for HSMCI is built-in by default. The SAMV71-XULT provides one full-size SD memory card slot. Refer to the section entitled "SD card" for configuration-related information. @@ -2172,7 +2138,7 @@ Configuration sub-directories The auto-mounter is not enabled. See the section above entitled "Auto-Mounter". - 9. Performance-related Configuration settings: + 8. Performance-related Configuration settings: CONFIG_ARMV7M_ICACHE=y : Instruction cache is enabled CONFIG_ARMV7M_DCACHE=y : Data cache is enabled diff --git a/configs/samv71-xult/knsh/defconfig b/configs/samv71-xult/knsh/defconfig index 7d66836b5a92b8ba3ed75c62c5b91b9af90cdca0..2c7189db7cb3001b036a50f84578787b1382af9d 100644 --- a/configs/samv71-xult/knsh/defconfig +++ b/configs/samv71-xult/knsh/defconfig @@ -69,7 +69,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -82,7 +81,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -389,8 +387,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -638,7 +634,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -890,7 +885,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/module/defconfig b/configs/samv71-xult/module/defconfig index 98dd0cf6bf14345ae29dafc06a0601b6e693adfb..f4e7afb959e6ece10ed77f7982145311864e0c48 100644 --- a/configs/samv71-xult/module/defconfig +++ b/configs/samv71-xult/module/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -363,8 +361,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_OS_SYMTAB=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -546,7 +542,6 @@ CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -809,7 +804,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/samv71-xult/mxtxplnd/defconfig b/configs/samv71-xult/mxtxplnd/defconfig index 3ce521bbfb0dd676c56fe8ef26dcc58efc4ba34b..49cbf5f29ff1e149ef1689cb007db984eb6f628c 100644 --- a/configs/samv71-xult/mxtxplnd/defconfig +++ b/configs/samv71-xult/mxtxplnd/defconfig @@ -64,11 +64,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -384,8 +384,6 @@ CONFIG_SAMV71XULT_LCD_BGCOLOR=0x00 CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -526,15 +524,15 @@ CONFIG_I2C=y # CONFIG_I2C_TRACE is not set CONFIG_I2C_DRIVER=y CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y # CONFIG_SPI_CS_CONTROL is not set -# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set # CONFIG_SPI_BITBANG is not set @@ -677,7 +675,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -990,20 +987,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="SW0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="SW1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1044,7 +1029,6 @@ CONFIG_EXAMPLES_NXLINES_BPP=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/netnsh/defconfig b/configs/samv71-xult/netnsh/defconfig index 4cdc68ea2820c0a2a120160d3cabac76fb9190ef..37be93f688ec2966bbf04f7666553fbb84a217fe 100644 --- a/configs/samv71-xult/netnsh/defconfig +++ b/configs/samv71-xult/netnsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -403,8 +401,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -669,10 +665,9 @@ CONFIG_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -696,7 +691,6 @@ CONFIG_ETH0_PHY_KSZ8061=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -773,13 +767,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1045,19 +1037,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="SW0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="SW1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1094,7 +1073,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/nsh/defconfig b/configs/samv71-xult/nsh/defconfig index a35e82a9b8669fa202559f2ddb386de94b6643c2..e10517c26cf5a183ba49fab041222945efb31f2a 100644 --- a/configs/samv71-xult/nsh/defconfig +++ b/configs/samv71-xult/nsh/defconfig @@ -64,7 +64,7 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -79,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -387,8 +386,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -637,7 +634,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -864,19 +860,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=1 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=1 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="SW0" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="SW1" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Button 2" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Button 3" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Button 4" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -911,7 +894,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/nxwm/defconfig b/configs/samv71-xult/nxwm/defconfig index 033561fc581796825ef843b8f3c35c0c4eeed6e3..ee918e393557e0a20baceed4140759892ec50068 100644 --- a/configs/samv71-xult/nxwm/defconfig +++ b/configs/samv71-xult/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -64,10 +66,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -77,7 +81,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -195,6 +198,7 @@ CONFIG_ARCH_CHIP_SAMV71Q=y # CONFIG_ARCH_CHIP_SAMV71J is not set # CONFIG_SAMV7_MCAN is not set CONFIG_SAMV7_HAVE_MCAN1=y +# CONFIG_SAMV7_DAC is not set CONFIG_SAMV7_HAVE_DAC1=y CONFIG_SAMV7_HAVE_EBI=y # CONFIG_SAMV7_EMAC is not set @@ -382,8 +386,6 @@ CONFIG_SAMV71XULT_LCD_BGCOLOR=0x95fa CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -418,6 +420,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -435,6 +438,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -527,15 +532,15 @@ CONFIG_I2C=y # CONFIG_I2C_TRACE is not set CONFIG_I2C_DRIVER=y CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y # CONFIG_SPI_CS_CONTROL is not set -# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set # CONFIG_SPI_BITBANG is not set @@ -545,6 +550,7 @@ CONFIG_ARCH_HAVE_SPI_CS_CONTROL=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_TIMERS_CS2100CP is not set @@ -592,6 +598,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set # CONFIG_LCD_UG9664HSWAG01 is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -661,6 +668,7 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_IS25XP is not set # CONFIG_MTD_M25P is not set +# CONFIG_MTD_MX25L is not set # CONFIG_MTD_S25FL1 is not set # CONFIG_MTD_N25QXXX is not set # CONFIG_MTD_SMART is not set @@ -675,7 +683,6 @@ CONFIG_AT25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -730,6 +737,7 @@ CONFIG_USART0_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -872,13 +880,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=396 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -898,7 +907,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -944,6 +956,8 @@ CONFIG_LIBM=y CONFIG_LIBC_FLOATINGPOINT=y CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -964,6 +978,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1005,6 +1021,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1040,7 +1057,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1082,6 +1098,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1153,6 +1170,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1176,6 +1194,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1206,10 +1225,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=2048 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1305,7 +1321,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -1409,6 +1425,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/samv71-xult/src/sam_bringup.c b/configs/samv71-xult/src/sam_bringup.c index 3999c0ab24a82e89841980a6481ee867408c1560..b24cfc96432f036d7dbcc05367cdf16f837ad67d 100644 --- a/configs/samv71-xult/src/sam_bringup.c +++ b/configs/samv71-xult/src/sam_bringup.c @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -120,14 +121,15 @@ static void sam_i2c_register(int bus) i2c = sam_i2cbus_initialize(bus); if (i2c == NULL) { - _err("ERROR: Failed to get I2C%d interface\n", bus); + syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus); } else { ret = i2c_register(i2c, bus); if (ret < 0) { - _err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n", + bus, ret); sam_i2cbus_uninitialize(i2c); } } @@ -198,7 +200,8 @@ int sam_bringup(void) ret = userled_lower_initialize(LED_DRIVER_PATH); if (ret < 0) { - _err("ERROR: userled_lower_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", + ret); } #endif @@ -208,7 +211,8 @@ int sam_bringup(void) i2c = sam_i2cbus_initialize(PCF85263_TWI_BUS); if (i2c == NULL) { - _err("ERROR: sam_i2cbus_initialize(%d) failed\n", PCF85263_TWI_BUS); + syslog(LOG_ERR, "ERROR: sam_i2cbus_initialize(%d) failed\n", + PCF85263_TWI_BUS); } else { @@ -217,7 +221,8 @@ int sam_bringup(void) ret = pcf85263_rtc_initialize(i2c); if (ret < 0) { - _err("ERROR: pcf85263_rtc_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: pcf85263_rtc_initialize() failed: %d\n", + ret); } else { @@ -233,7 +238,8 @@ int sam_bringup(void) i2c = sam_i2cbus_initialize(DSXXXX_TWI_BUS); if (i2c == NULL) { - _err("ERROR: sam_i2cbus_initialize(%d) failed\n", DSXXXX_TWI_BUS); + syslog(LOG_ERR, "ERROR: sam_i2cbus_initialize(%d) failed\n", + DSXXXX_TWI_BUS); } else { @@ -242,7 +248,8 @@ int sam_bringup(void) ret = dsxxxx_rtc_initialize(i2c); if (ret < 0) { - _err("ERROR: dsxxxx_rtc_initialize() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: dsxxxx_rtc_initialize() failed: %d\n", + ret); } else { @@ -253,6 +260,16 @@ int sam_bringup(void) } #endif +#ifdef CONFIG_SAMV7_MCAN + /* Initialize CAN and register the CAN driver. */ + + ret = sam_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: sam_can_setup failed: %d\n", ret); + } +#endif + #ifdef HAVE_MACADDR /* Read the Ethernet MAC address from the AT24 FLASH and configure the * Ethernet driver with that address. @@ -261,7 +278,7 @@ int sam_bringup(void) ret = sam_emac0_setmac(); if (ret < 0) { - _err("ERROR: sam_emac0_setmac() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: sam_emac0_setmac() failed: %d\n", ret); } #endif @@ -271,8 +288,8 @@ int sam_bringup(void) ret = mount(NULL, SAMV71_PROCFS_MOUNTPOINT, "procfs", 0, NULL); if (ret < 0) { - _err("ERROR: Failed to mount procfs at %s: %d\n", - SAMV71_PROCFS_MOUNTPOINT, ret); + syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n", + SAMV71_PROCFS_MOUNTPOINT, ret); } #endif @@ -284,7 +301,7 @@ int sam_bringup(void) ret = sam_at24config(); if (ret < 0) { - _err("ERROR: sam_at24config() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: sam_at24config() failed: %d\n", ret); } #endif @@ -294,8 +311,8 @@ int sam_bringup(void) ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR); if (ret < 0) { - _err("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", - HSMCI0_SLOTNO, HSMCI0_MINOR, ret); + syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", + HSMCI0_SLOTNO, HSMCI0_MINOR, ret); } #ifdef CONFIG_SAMV71XULT_HSMCI0_MOUNT @@ -311,8 +328,8 @@ int sam_bringup(void) if (ret < 0) { - _err("ERROR: Failed to mount %s: %d\n", - CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT, errno); + syslog(LOG_ERR, "ERROR: Failed to mount %s: %d\n", + CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT, errno); } } @@ -333,7 +350,7 @@ int sam_bringup(void) CONFIG_SAMV71XULT_ROMFS_ROMDISK_SECTSIZE); if (ret < 0) { - _err("ERROR: romdisk_register failed: %d\n", -ret); + syslog(LOG_ERR, "ERROR: romdisk_register failed: %d\n", -ret); } else { @@ -344,9 +361,9 @@ int sam_bringup(void) "romfs", MS_RDONLY, NULL); if (ret < 0) { - _err("ERROR: mount(%s,%s,romfs) failed: %d\n", - CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME, - CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT, errno); + syslog(LOG_ERR, "ERROR: mount(%s,%s,romfs) failed: %d\n", + CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME, + CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT, errno); } } #endif @@ -357,7 +374,7 @@ int sam_bringup(void) qspi = sam_qspi_initialize(0); if (!qspi) { - _err("ERROR: sam_qspi_initialize failed\n"); + syslog(LOG_ERR, "ERROR: sam_qspi_initialize failed\n"); } else { @@ -368,7 +385,7 @@ int sam_bringup(void) mtd = s25fl1_initialize(qspi, true); if (!mtd) { - _err("ERROR: s25fl1_initialize failed\n"); + syslog(LOG_ERR, "ERROR: s25fl1_initialize failed\n"); } #ifdef HAVE_S25FL1_SMARTFS @@ -377,7 +394,7 @@ int sam_bringup(void) ret = smart_initialize(S25FL1_SMART_MINOR, mtd, NULL); if (ret != OK) { - _err("ERROR: Failed to initialize SmartFS: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize SmartFS: %d\n", ret); } #elif defined(HAVE_S25FL1_NXFFS) @@ -386,7 +403,7 @@ int sam_bringup(void) ret = nxffs_initialize(mtd); if (ret < 0) { - _err("ERROR: NXFFS initialization failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: NXFFS initialization failed: %d\n", ret); } /* Mount the file system at /mnt/s25fl1 */ @@ -394,7 +411,8 @@ int sam_bringup(void) ret = mount(NULL, "/mnt/s25fl1", "nxffs", 0, NULL); if (ret < 0) { - _err("ERROR: Failed to mount the NXFFS volume: %d\n", errno); + syslog(LOG_ERR, "ERROR: Failed to mount the NXFFS volume: %d\n", + errno); return ret; } @@ -404,7 +422,8 @@ int sam_bringup(void) ret = ftl_initialize(S25FL1_MTD_MINOR, mtd); if (ret < 0) { - _err("ERROR: Failed to initialize the FTL layer: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", + ret); return ret; } @@ -418,7 +437,8 @@ int sam_bringup(void) ret = bchdev_register(blockdev, chardev, false); if (ret < 0) { - _err("ERROR: bchdev_register %s failed: %d\n", chardev, ret); + syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n", + chardev, ret); return ret; } #endif @@ -435,7 +455,7 @@ int sam_bringup(void) mtd = progmem_initialize(); if (!mtd) { - _err("ERROR: progmem_initialize failed\n"); + syslog(LOG_ERR, "ERROR: progmem_initialize failed\n"); } /* Use the FTL layer to wrap the MTD driver as a block driver */ @@ -443,7 +463,8 @@ int sam_bringup(void) ret = ftl_initialize(PROGMEM_MTD_MINOR, mtd); if (ret < 0) { - _err("ERROR: Failed to initialize the FTL layer: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", + ret); return ret; } @@ -457,7 +478,8 @@ int sam_bringup(void) ret = bchdev_register(blockdev, chardev, false); if (ret < 0) { - _err("ERROR: bchdev_register %s failed: %d\n", chardev, ret); + syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n", + chardev, ret); return ret; } #endif @@ -470,7 +492,7 @@ int sam_bringup(void) ret = sam_usbhost_initialize(); if (ret != OK) { - _err("ERROR: Failed to initialize USB host: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); } #endif @@ -480,7 +502,7 @@ int sam_bringup(void) ret = usbmonitor_start(); if (ret != OK) { - _err("ERROR: Failed to start the USB monitor: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to start the USB monitor: %d\n", ret); } #endif @@ -490,7 +512,8 @@ int sam_bringup(void) ret = sam_wm8904_initialize(0); if (ret != OK) { - _err("ERROR: Failed to initialize WM8904 audio: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize WM8904 audio: %d\n", + ret); } #endif @@ -500,18 +523,22 @@ int sam_bringup(void) ret = sam_audio_null_initialize(0); if (ret != OK) { - _err("ERROR: Failed to initialize the NULL audio device: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to initialize the NULL audio device: %d\n", + ret); } #endif #ifdef HAVE_ELF /* Initialize the ELF binary loader */ - _err("Initializing the ELF binary loader\n"); + syslog(LOG_ERR, "Initializing the ELF binary loader\n"); ret = elf_initialize(); if (ret < 0) { - _err("ERROR: Initialization of the ELF loader failed: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Initialization of the ELF loader failed: %d\n", + ret); } #endif diff --git a/configs/samv71-xult/src/sam_mcan.c b/configs/samv71-xult/src/sam_mcan.c index bb28cbb9b017840f502e4d2beaab75e958ef7a6e..f17d9ccb20eded781420c5eca6d881e45ebaa0d7 100644 --- a/configs/samv71-xult/src/sam_mcan.c +++ b/configs/samv71-xult/src/sam_mcan.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/samv71-xultk/src/sam_mcan.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include "sam_mcan.h" #include "samv71-xult.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_SAMV7_MCAN0) || defined(CONFIG_SAMV7_MCAN1)) +#ifdef CONFIG_SAMV7_MCAN /************************************************************************************ * Pre-processor Definitions @@ -72,48 +72,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: sam_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int sam_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_SAMV7_MCAN0) || defined(CONFIG_SAMV7_MCAN1) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = sam_mcan_initialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = sam_mcan_initialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_SAMV7_MCAN0 || CONFIG_SAMV7_MCAN1) */ +#endif /* CONFIG_SAMV7_MCAN */ diff --git a/configs/samv71-xult/src/samv71-xult.h b/configs/samv71-xult/src/samv71-xult.h index 21884b7191f499ef3d823cafe5739575868f251c..f635ff361c5a9726f07f16a5f6cf9f8d2ecb0950 100644 --- a/configs/samv71-xult/src/samv71-xult.h +++ b/configs/samv71-xult/src/samv71-xult.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/samv71-xult/src/samv71-xult.h * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -597,6 +597,18 @@ int sam_bringup(void); void sam_spidev_initialize(void); #endif +/************************************************************************************ + * Name: sam_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ************************************************************************************/ + +#ifdef CONFIG_SAMV7_MCAN +int sam_can_setup(void); +#endif + /************************************************************************************ * Name: sam_hsmci_initialize * diff --git a/configs/samv71-xult/vnc/defconfig b/configs/samv71-xult/vnc/defconfig index c956688f1c1eeb809cc22e44532c7ca29e040e68..d01ad46b86e713270c0f793df0b291071c68c856 100644 --- a/configs/samv71-xult/vnc/defconfig +++ b/configs/samv71-xult/vnc/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +79,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -402,8 +400,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -670,10 +666,9 @@ CONFIG_NETDEV_STATISTICS=y # CONFIG_NET_CS89x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -697,7 +692,6 @@ CONFIG_ETH0_PHY_KSZ8061=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -774,13 +768,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1137,7 +1129,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1185,7 +1176,6 @@ CONFIG_EXAMPLES_NXIMAGE_YSCALE1p0=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/samv71-xult/vnxwm/defconfig b/configs/samv71-xult/vnxwm/defconfig index c5f417361a6f4aa3aa2d53598677e1b6ea7a622a..be62fb374d289b8337053b16e69094b9258136e4 100644 --- a/configs/samv71-xult/vnxwm/defconfig +++ b/configs/samv71-xult/vnxwm/defconfig @@ -12,8 +12,10 @@ CONFIG_EXPERIMENTAL=y # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,7 +67,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -80,7 +81,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -402,8 +402,6 @@ CONFIG_ARCH_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -456,6 +454,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -673,10 +673,8 @@ CONFIG_NETDEV_STATISTICS=y # CONFIG_NET_CS89x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -700,7 +698,6 @@ CONFIG_ETH0_PHY_KSZ8061=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -777,13 +774,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1015,13 +1010,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=8 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=396 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1041,7 +1037,11 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DISPLAYNO=0 +CONFIG_NXSTART_VPLANE=0 CONFIG_VNCSERVER=y # CONFIG_VNCSERVER_PROTO3p3 is not set CONFIG_VNCSERVER_PROTO3p8=y @@ -1128,6 +1128,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set @@ -1168,7 +1169,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1206,7 +1206,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1355,6 +1354,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -1418,10 +1418,7 @@ CONFIG_NXWIDGETS=y # # CONFIG_NXWIDGETS_FLICKERFREE is not set # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_VPLANE=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=2048 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1517,7 +1514,7 @@ CONFIG_NXWM_TOOLBAR_FONTID=5 CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/shenzhou/nsh/defconfig b/configs/shenzhou/nsh/defconfig index 1e440b536dbd14cee6e4f9bce938c7c888dac807..aa0359c9dbc95f75b3321b742f67cb8efb882134 100644 --- a/configs/shenzhou/nsh/defconfig +++ b/configs/shenzhou/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -482,6 +480,7 @@ CONFIG_STM32_PHYSR_100FD=0x8000 CONFIG_STM32_RMII=y CONFIG_STM32_RMII_MCO=y # CONFIG_STM32_RMII_EXTCLK is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -585,8 +584,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -660,6 +657,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -668,6 +666,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -679,8 +678,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -798,10 +800,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -825,7 +825,6 @@ CONFIG_ETH0_PHY_DM9161=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -902,13 +901,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1205,7 +1202,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/shenzhou/nxwm/defconfig b/configs/shenzhou/nxwm/defconfig index c785575fd721342e3420e1f826e1335fa7ed4080..497b396529be8ae08b44ed8ba99c5d90cc294cc5 100644 --- a/configs/shenzhou/nxwm/defconfig +++ b/configs/shenzhou/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -66,7 +68,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -607,8 +607,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -643,6 +641,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -659,6 +658,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -701,7 +702,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -866,10 +867,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -893,7 +892,6 @@ CONFIG_ETH0_PHY_DM9161=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -970,13 +968,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1195,13 +1191,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=325 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1221,7 +1218,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1287,6 +1287,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y CONFIG_NETDB_DNSCLIENT=y CONFIG_NETDB_DNSCLIENT_ENTRIES=4 @@ -1366,7 +1367,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1515,6 +1515,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_FILEIOSIZE=512 @@ -1578,10 +1579,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=1596 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=1596 @@ -1675,7 +1673,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/shenzhou/src/shenzhou.h b/configs/shenzhou/src/shenzhou.h index c66f333361b97197fcfd5b98cf633026c167478b..68fb63d1020afd888736a7c85b752386b8b1cbc3 100644 --- a/configs/shenzhou/src/shenzhou.h +++ b/configs/shenzhou/src/shenzhou.h @@ -1,7 +1,7 @@ /**************************************************************************************************** * configs/shenzhou/src/shenzhou.h * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -448,6 +448,30 @@ void weak_function stm32_usbinitialize(void); int stm32_usbhost_initialize(void); #endif +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /**************************************************************************** * Name: stm32_sdinitialize * diff --git a/configs/shenzhou/src/stm32_adc.c b/configs/shenzhou/src/stm32_adc.c index 0b61b68f8e5f8570697d508139efe90ab58b8776..3e185bcdf5afd3d49de6f681cf616a8ab50a72c2 100644 --- a/configs/shenzhou/src/stm32_adc.c +++ b/configs/shenzhou/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/shenzhou/src/stm32_adc.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -104,24 +104,19 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; //{10, 8, 9}; static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC12_IN10}; //{GPIO_ADC12_IN10, GPIO_ADC12_IN8, GPIO_ADC12_IN9}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/shenzhou/src/stm32_appinit.c b/configs/shenzhou/src/stm32_appinit.c index 9b18c80d5d3b7452cf1cf37a11dd144a22492571..2bfb40a59f360ffc61a6c5005ee2e3e622a78ccc 100644 --- a/configs/shenzhou/src/stm32_appinit.c +++ b/configs/shenzhou/src/stm32_appinit.c @@ -165,9 +165,7 @@ int board_app_initialize(uintptr_t arg) { -#if defined(HAVE_MMCSD) || defined(HAVE_USBHOST) || defined(HAVE_W25) int ret; -#endif /* Initialize and register the W25 FLASH file system. */ @@ -206,5 +204,26 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/shenzhou/src/stm32_can.c b/configs/shenzhou/src/stm32_can.c index bc6472bef78d6b59a998a4cd050371c0f1fb435b..6a08cc1fc0fa427bb2cdff64b97fd66be44fc381 100644 --- a/configs/shenzhou/src/stm32_can.c +++ b/configs/shenzhou/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/shenzhou/src/stm32_can.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ #include "stm32_can.h" #include "shenzhou.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -60,55 +60,57 @@ /* Configuration ********************************************************************/ /* The STM32F107VC supports CAN1 and CAN2 */ -#define CAN_PORT 1 +#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) +# warning "Both CAN1 and CAN2 are enabled. Only CAN1 is connected." +# undef CONFIG_STM32_CAN2 +#endif + +#ifdef CONFIG_STM32_CAN1 +# define CAN_PORT 1 +#else +# define CAN_PORT 2 +#endif /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/shenzhou/thttpd/defconfig b/configs/shenzhou/thttpd/defconfig index d5f58ab0b015782a50ef29292375418146d76f89..fcd1ac40744569bc1c9369f43576dec0347202de 100644 --- a/configs/shenzhou/thttpd/defconfig +++ b/configs/shenzhou/thttpd/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -483,6 +481,7 @@ CONFIG_STM32_PHYSR_100FD=0x8000 CONFIG_STM32_RMII=y CONFIG_STM32_RMII_MCO=y # CONFIG_STM32_RMII_EXTCLK is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -586,8 +585,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -661,6 +658,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -669,6 +667,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -680,8 +679,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -825,10 +827,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -855,7 +855,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -933,13 +932,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=768 CONFIG_NET_ETH_TCP_RECVWNDO=742 CONFIG_NET_GUARDSIZE=2 @@ -1238,7 +1235,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/bas/defconfig b/configs/sim/bas/defconfig index ef4da76d6b97410265ebe3e9cb9c24234eea1ead..71c6bf6659358fef5c3f0cd28222473ad1e051a5 100644 --- a/configs/sim/bas/defconfig +++ b/configs/sim/bas/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -148,8 +147,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -301,7 +298,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -535,7 +531,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/configdata/defconfig b/configs/sim/configdata/defconfig index ac5eeef6fe44557271af3c1b227de699ae95ed64..c46b145c614c3e1bbeb4bc308593dbbd76a28771 100644 --- a/configs/sim/configdata/defconfig +++ b/configs/sim/configdata/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -328,7 +327,6 @@ CONFIG_RAMMTD_FLASHSIM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -573,7 +571,6 @@ CONFIG_EXAMPLES_NXFFS_NLOOPS=100 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/cxxtest/defconfig b/configs/sim/cxxtest/defconfig index 06d8f83aa6226ff8bafda7bbb474dd96a764236e..de26a571acfee92ff7255fdb9e30b8dc89a8f432 100644 --- a/configs/sim/cxxtest/defconfig +++ b/configs/sim/cxxtest/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -316,7 +315,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -544,7 +542,6 @@ CONFIG_EXAMPLES_CXXTEST=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/minibasic/defconfig b/configs/sim/minibasic/defconfig index 0e1519ffc0e8bd48ce7a85d9a9814f9811995f68..edeba61d18fb028af3a873891087a9787944bf3e 100644 --- a/configs/sim/minibasic/defconfig +++ b/configs/sim/minibasic/defconfig @@ -84,7 +84,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -180,8 +179,6 @@ CONFIG_BOARDCTL_POWEROFF=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -355,7 +352,6 @@ CONFIG_DEV_LOOP=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -601,7 +597,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/mount/defconfig b/configs/sim/mount/defconfig index a205f783f5653c15adee9d50d232bb31130ca1eb..9af8bfff48c1a3ec5da27184fd9750d7fd49ee02 100644 --- a/configs/sim/mount/defconfig +++ b/configs/sim/mount/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -315,7 +314,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -543,7 +541,6 @@ CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0" # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/mtdpart/defconfig b/configs/sim/mtdpart/defconfig index 04568d5ca1af7fa212aa6cd640da8aa3261f3f95..b5944473332c33528db2bcbb9dcfd146531814cb 100644 --- a/configs/sim/mtdpart/defconfig +++ b/configs/sim/mtdpart/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -326,7 +325,6 @@ CONFIG_RAMMTD_FLASHSIM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -555,7 +553,6 @@ CONFIG_EXAMPLES_MTDPART_NPARTITIONS=3 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/mtdrwb/defconfig b/configs/sim/mtdrwb/defconfig index c14345962ef7849025214e9d0d9a802e18af894e..3716ffcb22b4c7d264d5d9371ed98b576bcf420e 100644 --- a/configs/sim/mtdrwb/defconfig +++ b/configs/sim/mtdrwb/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -358,7 +357,6 @@ CONFIG_RAMMTD_FLASHSIM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -588,7 +586,6 @@ CONFIG_EXAMPLES_MTDRWB_NEBLOCKS=32 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/nettest/defconfig b/configs/sim/nettest/defconfig index 2cd4f87f85a81ef52b415cb9553ba0f42428580f..09df2684d6303e80b308d5ea0d7be55df524fc92 100644 --- a/configs/sim/nettest/defconfig +++ b/configs/sim/nettest/defconfig @@ -59,7 +59,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y @@ -328,7 +327,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -389,13 +387,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -674,7 +670,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8006a # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/nsh/defconfig b/configs/sim/nsh/defconfig index 5cfed7a9695f92d79eef268e19754609eca62c81..26c5503422ae6504667be45338a500fb14cbb59a 100644 --- a/configs/sim/nsh/defconfig +++ b/configs/sim/nsh/defconfig @@ -16,7 +16,7 @@ CONFIG_HOST_LINUX=y # # Build Configuration # -# CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="y" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set @@ -42,9 +42,10 @@ CONFIG_BUILD_FLAT=y # # Debug Options # +# CONFIG_DEBUG_ALERT is not set # CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_ARCH_HAVE_STACKCHECK is not set +# CONFIG_ARCH_HAVE_HEAPCHECK is not set CONFIG_DEBUG_SYMBOLS=y # CONFIG_ARCH_HAVE_CUSTOMOPT is not set CONFIG_DEBUG_NOOPT=y @@ -57,10 +58,12 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -78,6 +81,7 @@ CONFIG_SIM_NET_HOST_ROUTE=y # CONFIG_SIM_NET_BRIDGE is not set # CONFIG_SIM_FRAMEBUFFER is not set # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -142,18 +146,16 @@ CONFIG_ARCH_BOARD="sim" # # Common Board Options # -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_POWEROFF=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -175,6 +177,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=6 @@ -187,6 +190,7 @@ CONFIG_PREALLOC_TIMERS=8 # # Tasks and Scheduling # +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -270,6 +274,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y CONFIG_DEV_ZERO=y +# CONFIG_DEV_URANDOM is not set CONFIG_DEV_LOOP=y # @@ -285,12 +290,16 @@ CONFIG_DEV_LOOP=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -298,7 +307,12 @@ CONFIG_DEV_LOOP=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# # CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set # # LCD Driver Support @@ -311,6 +325,7 @@ CONFIG_DEV_LOOP=y # # CONFIG_RGBLED is not set # CONFIG_PCA9635PW is not set +# CONFIG_NCP5623C is not set # CONFIG_MMCSD is not set # CONFIG_MODEM is not set # CONFIG_MTD is not set @@ -319,9 +334,10 @@ CONFIG_DEV_LOOP=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_SERIAL_REMOVABLE is not set +CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set # CONFIG_UART_SERIALDRIVER is not set # CONFIG_UART0_SERIALDRIVER is not set @@ -351,19 +367,26 @@ CONFIG_SERIAL=y # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging # +# CONFIG_ARCH_SYSLOG is not set # CONFIG_RAMLOG is not set -# CONFIG_CONSOLE_SYSLOG is not set +# CONFIG_SYSLOG_INTBUFFER is not set +# CONFIG_SYSLOG_TIMESTAMP is not set +CONFIG_SYSLOG_SERIAL_CONSOLE=y +# CONFIG_SYSLOG_CHAR is not set +CONFIG_SYSLOG_CONSOLE=y +# CONFIG_SYSLOG_NONE is not set +# CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -417,11 +440,6 @@ CONFIG_FS_PROCFS=y # CONFIG_FS_UNIONFS is not set # CONFIG_FS_HOSTFS is not set -# -# System Logging -# -# CONFIG_SYSLOG_TIMESTAMP is not set - # # Graphics Support # @@ -472,6 +490,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -501,8 +521,10 @@ CONFIG_ARCH_HAVE_TLS=y # # Non-standard Library Support # +# CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -526,9 +548,9 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FSTEST is not set @@ -557,11 +579,10 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -612,6 +633,7 @@ CONFIG_FSUTILS_PASSWD_KEY4=0x9abcdef0 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -681,13 +703,13 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set # CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set # CONFIG_NSH_DISABLE_POWEROFF is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -705,6 +727,7 @@ CONFIG_NSH_DISABLE_SHUTDOWN=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options @@ -764,7 +787,7 @@ CONFIG_NSH_LOGIN_FAILCOUNT=3 # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_FREE is not set -# CONFIG_LIB_HEX2BIN is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -777,6 +800,8 @@ CONFIG_READLINE_MAX_EXTCMDS=64 # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set # CONFIG_SYSTEM_SYMTAB is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/nsh2/defconfig b/configs/sim/nsh2/defconfig index c4f2dd0060dd40d5dea980083fba3a56badc26b6..3101ea4785d1e67ae9cbb8f06df14e1a3f0229cd 100644 --- a/configs/sim/nsh2/defconfig +++ b/configs/sim/nsh2/defconfig @@ -37,13 +37,15 @@ CONFIG_BUILD_FLAT=y # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set # CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set # # Debug Options # +# CONFIG_DEBUG_ALERT is not set # CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_ARCH_HAVE_STACKCHECK is not set +# CONFIG_ARCH_HAVE_HEAPCHECK is not set CONFIG_DEBUG_SYMBOLS=y # CONFIG_ARCH_HAVE_CUSTOMOPT is not set CONFIG_DEBUG_NOOPT=y @@ -56,10 +58,12 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -73,6 +77,8 @@ CONFIG_HOST_X86_64=y CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_SIM_X8664_MICROSOFT is not set # CONFIG_SIM_WALLTIME is not set +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set CONFIG_SIM_FRAMEBUFFER=y CONFIG_SIM_X11FB=y # CONFIG_SIM_X11NOSHM is not set @@ -84,6 +90,7 @@ CONFIG_SIM_TOUCHSCREEN=y # CONFIG_SIM_NOINPUT is not set # CONFIG_SIM_TCNWAITERS is not set # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -96,6 +103,7 @@ CONFIG_SIM_TOUCHSCREEN=y # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set @@ -147,18 +155,16 @@ CONFIG_ARCH_BOARD="sim" # # Common Board Options # -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR=0x007b68ee +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -180,6 +186,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2011 CONFIG_START_MONTH=10 @@ -192,6 +199,7 @@ CONFIG_PREALLOC_TIMERS=8 # # Tasks and Scheduling # +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -242,9 +250,10 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +# CONFIG_MODULE is not set # -# Work Queue Support +# Work queue support # # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_HPWORK is not set @@ -265,6 +274,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -280,12 +290,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -302,17 +316,37 @@ CONFIG_INPUT=y # CONFIG_BUTTONS is not set # CONFIG_DJOYSTICK is not set # CONFIG_AJOYSTICK is not set + +# +# IO Expander/GPIO Support +# +# CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set + +# +# LCD Driver Support +# # CONFIG_LCD is not set +# CONFIG_SLCD is not set + +# +# LED Support +# +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set +# CONFIG_NCP5623C is not set # CONFIG_MMCSD is not set +# CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_SERIAL_REMOVABLE is not set +CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set # CONFIG_UART_SERIALDRIVER is not set # CONFIG_UART0_SERIALDRIVER is not set @@ -336,29 +370,32 @@ CONFIG_SERIAL=y # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set - -# -# USART Configuration -# # CONFIG_MCU_SERIAL is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging # +# CONFIG_ARCH_SYSLOG is not set # CONFIG_RAMLOG is not set -# CONFIG_CONSOLE_SYSLOG is not set +# CONFIG_SYSLOG_INTBUFFER is not set +# CONFIG_SYSLOG_TIMESTAMP is not set +CONFIG_SYSLOG_SERIAL_CONSOLE=y +# CONFIG_SYSLOG_CHAR is not set +CONFIG_SYSLOG_CONSOLE=y +# CONFIG_SYSLOG_NONE is not set +# CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -391,13 +428,16 @@ CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_MAXFNAME=32 # CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set # CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set # CONFIG_FS_NXFFS is not set CONFIG_FS_ROMFS=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set # CONFIG_FS_BINFS is not set CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set # # Exclude individual procfs entries @@ -408,11 +448,6 @@ CONFIG_FS_PROCFS=y # CONFIG_FS_UNIONFS is not set # CONFIG_FS_HOSTFS is not set -# -# System Logging -# -# CONFIG_SYSLOG_TIMESTAMP is not set - # # Graphics Support # @@ -421,6 +456,7 @@ CONFIG_NX_NPLANES=1 CONFIG_NX_BGCOLOR=0x0 # CONFIG_NX_ANTIALIASING is not set # CONFIG_NX_WRITEONLY is not set +# CONFIG_NX_UPDATE is not set # # Supported Pixel Depths @@ -516,6 +552,10 @@ CONFIG_MM_REGIONS=1 # # CONFIG_AUDIO is not set +# +# Wireless Support +# + # # Binary Loader # @@ -543,6 +583,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -561,14 +603,18 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set # # Non-standard Library Support # +# CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -599,8 +645,9 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set +# CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -609,10 +656,10 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_HELLO is not set # CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_MEDIA is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set @@ -629,7 +676,6 @@ CONFIG_EXAMPLES_NX_BPP=32 # CONFIG_EXAMPLES_NX_RAWWINDOWS is not set CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_NX_EXTERNINIT is not set -# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXFFS is not set CONFIG_EXAMPLES_NXHELLO=y CONFIG_EXAMPLES_NXHELLO_VPLANE=0 @@ -656,21 +702,23 @@ CONFIG_EXAMPLES_NXLINES_LINEWIDTH=16 CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=4 CONFIG_EXAMPLES_NXLINES_BPP=32 # CONFIG_EXAMPLES_NXLINES_EXTERNINIT is not set +# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set +# CONFIG_EXAMPLES_RGBLED is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set -# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set +# CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_THTTPD is not set @@ -680,15 +728,22 @@ CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" # CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y -# CONFIG_EXAMPLES_WEBSERVER is not set # CONFIG_EXAMPLES_UNIONFS is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WEBSERVER is not set # # File System Utilities # +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set # # Graphics Support @@ -701,8 +756,9 @@ CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y # # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set +# CONFIG_INTERPRETERS_PCODE is not set # # FreeModBus @@ -713,6 +769,7 @@ CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set @@ -721,6 +778,7 @@ CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y # NSH Library # CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set # # Command Line Configuration @@ -766,12 +824,12 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set # CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -780,6 +838,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set # CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set # CONFIG_NSH_DISABLE_TEST is not set # CONFIG_NSH_DISABLE_UMOUNT is not set # CONFIG_NSH_DISABLE_UNAME is not set @@ -787,6 +846,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options @@ -823,6 +883,8 @@ CONFIG_NSH_FATMOUNTPT="/tmp" CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set CONFIG_NSH_ARCHINIT=y +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -837,13 +899,12 @@ CONFIG_NSH_ARCHINIT=y # # System Libraries and NSH Add-Ons # -# CONFIG_SYSTEM_FREE is not set # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_SYSTEM_FREE is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set +# CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set CONFIG_READLINE_HAVE_EXTMATCH=y CONFIG_SYSTEM_READLINE=y @@ -851,5 +912,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig index 24a778de8c405ef141cb53a9edbdfaba5588fa05..c596a93fa579d8616f83a33e03d453bdec0a96ab 100644 --- a/configs/sim/nx/defconfig +++ b/configs/sim/nx/defconfig @@ -58,10 +58,12 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -83,6 +85,7 @@ CONFIG_SIM_FBHEIGHT=240 CONFIG_SIM_FBWIDTH=480 CONFIG_SIM_FBBPP=8 # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -172,6 +175,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=11 @@ -184,6 +188,7 @@ CONFIG_PREALLOC_TIMERS=8 # # Tasks and Scheduling # +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -264,6 +269,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -279,12 +285,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -319,7 +329,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -353,10 +362,12 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -533,6 +544,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -577,9 +590,9 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -612,12 +625,10 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -654,6 +665,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -697,6 +709,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/nx11/defconfig b/configs/sim/nx11/defconfig index 92ffa0a4ac6168d7d1c6deb327656e752034ea63..f6c56ac9ae9e802f62f37bfa4aae370344d81e39 100644 --- a/configs/sim/nx11/defconfig +++ b/configs/sim/nx11/defconfig @@ -58,10 +58,12 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -84,6 +86,7 @@ CONFIG_SIM_FBHEIGHT=240 CONFIG_SIM_FBWIDTH=480 CONFIG_SIM_FBBPP=32 # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -173,6 +176,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=11 @@ -185,6 +189,7 @@ CONFIG_PREALLOC_TIMERS=8 # # Tasks and Scheduling # +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -265,6 +270,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -280,12 +286,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -320,7 +330,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -354,10 +363,12 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -535,6 +546,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -579,9 +592,9 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -614,12 +627,10 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -656,6 +667,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -699,6 +711,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/nxffs/defconfig b/configs/sim/nxffs/defconfig index 97f2b992ae4b00d1cd915d2eb2f1eb6ee24cb906..fb70a4df9b8b96105d65962d78c550716937d081 100644 --- a/configs/sim/nxffs/defconfig +++ b/configs/sim/nxffs/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -297,7 +296,6 @@ CONFIG_RAMMTD_FLASHSIM=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -528,7 +526,6 @@ CONFIG_EXAMPLES_NXFFS_NLOOPS=100 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/nxlines/defconfig b/configs/sim/nxlines/defconfig index 70431cb06d51795b55ee9f5dcdd11dc841303bc7..c80c0efaa912d1e4d9067fe60b69332852849649 100644 --- a/configs/sim/nxlines/defconfig +++ b/configs/sim/nxlines/defconfig @@ -60,7 +60,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -157,8 +156,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -308,7 +305,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -640,7 +636,6 @@ CONFIG_EXAMPLES_NXLINES_BPP=32 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/nxwm/defconfig b/configs/sim/nxwm/defconfig index 68ad7121475fc7e3cf5bfda513b60f8688c565b9..f632f4d74774feee48fc96bec151dd7c514b3944 100644 --- a/configs/sim/nxwm/defconfig +++ b/configs/sim/nxwm/defconfig @@ -37,13 +37,15 @@ CONFIG_BUILD_FLAT=y # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set # CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set # # Debug Options # +# CONFIG_DEBUG_ALERT is not set # CONFIG_DEBUG_FEATURES is not set -# CONFIG_ARCH_HAVE_HEAPCHECK is not set # CONFIG_ARCH_HAVE_STACKCHECK is not set +# CONFIG_ARCH_HAVE_HEAPCHECK is not set CONFIG_DEBUG_SYMBOLS=y # CONFIG_ARCH_HAVE_CUSTOMOPT is not set CONFIG_DEBUG_NOOPT=y @@ -56,10 +58,12 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -73,6 +77,8 @@ CONFIG_HOST_X86_64=y CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_SIM_X8664_MICROSOFT is not set # CONFIG_SIM_WALLTIME is not set +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set CONFIG_SIM_FRAMEBUFFER=y CONFIG_SIM_X11FB=y # CONFIG_SIM_X11NOSHM is not set @@ -80,6 +86,7 @@ CONFIG_SIM_FBHEIGHT=240 CONFIG_SIM_FBWIDTH=480 CONFIG_SIM_FBBPP=32 # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -92,6 +99,7 @@ CONFIG_SIM_FBBPP=32 # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set @@ -143,17 +151,15 @@ CONFIG_ARCH_BOARD="sim" # # Common Board Options # -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +# CONFIG_BOARD_CRASHDUMP is not set CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -175,6 +181,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2012 CONFIG_START_MONTH=5 @@ -187,6 +194,8 @@ CONFIG_PREALLOC_TIMERS=8 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set +# CONFIG_SMP is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -203,6 +212,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -230,6 +241,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_ATEXIT is not set CONFIG_SCHED_ONEXIT=y CONFIG_SCHED_ONEXIT_MAX=1 +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -244,10 +256,11 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 +# CONFIG_MODULE is not set # -# Work Queue Support +# Work queue support # CONFIG_SCHED_WORKQUEUE=y CONFIG_SCHED_HPWORK=y @@ -271,6 +284,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -286,12 +300,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -299,17 +317,37 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set + +# +# IO Expander/GPIO Support +# +# CONFIG_IOEXPANDER is not set +# CONFIG_DEV_GPIO is not set + +# +# LCD Driver Support +# # CONFIG_LCD is not set +# CONFIG_SLCD is not set + +# +# LED Support +# +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set +# CONFIG_NCP5623C is not set # CONFIG_MMCSD is not set +# CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_SERIAL_REMOVABLE is not set +CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set # CONFIG_UART_SERIALDRIVER is not set # CONFIG_UART0_SERIALDRIVER is not set @@ -333,29 +371,32 @@ CONFIG_SERIAL=y # CONFIG_USART7_SERIALDRIVER is not set # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set - -# -# USART Configuration -# # CONFIG_MCU_SERIAL is not set # CONFIG_STANDARD_SERIAL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set +# CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set - -# -# System Logging Device Options -# +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging # +# CONFIG_ARCH_SYSLOG is not set # CONFIG_RAMLOG is not set -# CONFIG_CONSOLE_SYSLOG is not set +# CONFIG_SYSLOG_INTBUFFER is not set +# CONFIG_SYSLOG_TIMESTAMP is not set +CONFIG_SYSLOG_SERIAL_CONSOLE=y +# CONFIG_SYSLOG_CHAR is not set +CONFIG_SYSLOG_CONSOLE=y +# CONFIG_SYSLOG_NONE is not set +# CONFIG_SYSLOG_FILE is not set +# CONFIG_SYSLOG_CHARDEV is not set # # Networking Support @@ -389,12 +430,15 @@ CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_MAXFNAME=32 # CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set # CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set # CONFIG_FS_NXFFS is not set CONFIG_FS_ROMFS=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set # # Exclude individual procfs entries @@ -405,11 +449,6 @@ CONFIG_FS_PROCFS=y # CONFIG_FS_UNIONFS is not set # CONFIG_FS_HOSTFS is not set -# -# System Logging -# -# CONFIG_SYSLOG_TIMESTAMP is not set - # # Graphics Support # @@ -418,6 +457,7 @@ CONFIG_NX_NPLANES=1 CONFIG_NX_BGCOLOR=0x0 # CONFIG_NX_ANTIALIASING is not set # CONFIG_NX_WRITEONLY is not set +# CONFIG_NX_UPDATE is not set # # Supported Pixel Depths @@ -493,13 +533,14 @@ CONFIG_NXFONT_SANS28X37B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=32 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=256 CONFIG_NXTERM_CACHESIZE=16 CONFIG_NXTERM_LINESEPARATION=0 @@ -519,7 +560,11 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DISPLAYNO=0 +CONFIG_NXSTART_VPLANE=0 # # Memory Management @@ -534,6 +579,10 @@ CONFIG_MM_REGIONS=1 # # CONFIG_AUDIO is not set +# +# Wireless Support +# + # # Binary Loader # @@ -561,6 +610,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -579,14 +630,20 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set # # Non-standard Library Support # +# CONFIG_LIB_CRC64_FAST is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set +# CONFIG_LIB_HEX2BIN is not set # # Basic CXX Support @@ -612,8 +669,9 @@ CONFIG_HAVE_CXX=y # # Examples # +# CONFIG_EXAMPLES_CCTYPE is not set +# CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set @@ -622,10 +680,10 @@ CONFIG_HAVE_CXX=y # CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_HELLO is not set # CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set -# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_MEDIA is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set @@ -634,19 +692,18 @@ CONFIG_HAVE_CXX=y # CONFIG_EXAMPLES_NSH is not set # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXHELLO is not set # CONFIG_EXAMPLES_NXIMAGE is not set # CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set -# CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set +# CONFIG_EXAMPLES_RGBLED is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -654,20 +711,28 @@ CONFIG_HAVE_CXX=y # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set -# CONFIG_EXAMPLES_WEBSERVER is not set # CONFIG_EXAMPLES_UNIONFS is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set +# CONFIG_EXAMPLES_WEBSERVER is not set # # File System Utilities # +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set # # Graphics Support @@ -680,8 +745,9 @@ CONFIG_HAVE_CXX=y # # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set -# CONFIG_INTERPRETERS_PCODE is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set +# CONFIG_INTERPRETERS_PCODE is not set # # FreeModBus @@ -692,6 +758,7 @@ CONFIG_HAVE_CXX=y # Network Utilities # # CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set # CONFIG_NETUTILS_JSON is not set # CONFIG_NETUTILS_SMTP is not set @@ -700,6 +767,7 @@ CONFIG_HAVE_CXX=y # NSH Library # CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set # # Command Line Configuration @@ -744,12 +812,12 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MB is not set # CONFIG_NSH_DISABLE_MKDIR is not set # CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set # CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -758,6 +826,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set # CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set # CONFIG_NSH_DISABLE_TEST is not set # CONFIG_NSH_DISABLE_UMOUNT is not set # CONFIG_NSH_DISABLE_UNAME is not set @@ -765,11 +834,13 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_USLEEP is not set # CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_PROC_MOUNTPOINT="/proc" @@ -801,6 +872,8 @@ CONFIG_NSH_FATMOUNTPT="/tmp" CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set CONFIG_NSH_ARCHINIT=y +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -812,10 +885,7 @@ CONFIG_NXWIDGETS=y # # CONFIG_NXWIDGETS_FLICKERFREE is not set # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_VPLANE=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=16384 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=8192 @@ -825,6 +895,7 @@ CONFIG_NXWIDGETS_LISTENERSTACK=8192 # NXWidget Configuration # CONFIG_NXWIDGETS_BPP=32 +# CONFIG_NXWIDGETS_GREYSCALE is not set CONFIG_NXWIDGETS_SIZEOFCHAR=1 # @@ -908,7 +979,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -965,13 +1036,12 @@ CONFIG_NXWM_CALIBRATION_LISTENERSTACK=2048 # # System Libraries and NSH Add-Ons # -# CONFIG_SYSTEM_FREE is not set # CONFIG_SYSTEM_CLE is not set # CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_INSTALL is not set -# CONFIG_LIB_HEX2BIN is not set -# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_SYSTEM_FREE is not set +# CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set +# CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set CONFIG_READLINE_HAVE_EXTMATCH=y CONFIG_SYSTEM_READLINE=y @@ -979,5 +1049,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/ostest/defconfig b/configs/sim/ostest/defconfig index 182af156ed550118ca1b425f2a8cc06a1ee3127f..e3570e04813036d36e5105339092143a9e0700a1 100644 --- a/configs/sim/ostest/defconfig +++ b/configs/sim/ostest/defconfig @@ -59,7 +59,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y @@ -328,7 +327,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -554,7 +552,6 @@ CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/pashello/defconfig b/configs/sim/pashello/defconfig index 8ffba0da3511b6121e75543e76020dc92765cc4e..b64438c27ed5ec8c97521e7f34929afaa31bfc8a 100644 --- a/configs/sim/pashello/defconfig +++ b/configs/sim/pashello/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -289,7 +288,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -508,7 +506,6 @@ CONFIG_EXAMPLES_PASHELLO_STRSTACKSIZE=128 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/touchscreen/defconfig b/configs/sim/touchscreen/defconfig index 5795b1c649a29288ac24611406f4bbb228ebad48..66e90503f56aca993f98baddb8922d6f0444191f 100644 --- a/configs/sim/touchscreen/defconfig +++ b/configs/sim/touchscreen/defconfig @@ -58,7 +58,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -162,8 +161,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_POWEROFF is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -341,7 +338,6 @@ CONFIG_INPUT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -633,7 +629,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sim/traveler/defconfig b/configs/sim/traveler/defconfig index 7ed85fbdbcde5f21c0366604ef521da44301cc94..3a6a75c03c9c9f383490c1a2775e9c87ad0eb63b 100644 --- a/configs/sim/traveler/defconfig +++ b/configs/sim/traveler/defconfig @@ -58,10 +58,12 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="sim" @@ -87,6 +89,7 @@ CONFIG_SIM_FBBPP=32 CONFIG_SIM_AJOYSTICK=y # CONFIG_SIM_NOINPUT is not set # CONFIG_SIM_SPIFLASH is not set +# CONFIG_SIM_QSPIFLASH is not set # # Architecture Options @@ -176,6 +179,7 @@ CONFIG_ARCH_HAVE_TICKLESS=y CONFIG_USEC_PER_TICK=10000 # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_ARCH_HAVE_TIMEKEEPING is not set # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2008 CONFIG_START_MONTH=11 @@ -271,6 +275,7 @@ CONFIG_PTHREAD_STACK_DEFAULT=8192 CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set +# CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set # @@ -286,12 +291,16 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +# CONFIG_ARCH_HAVE_SPI_BITORDER is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -335,7 +344,6 @@ CONFIG_AJOYSTICK=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -369,10 +377,12 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set # CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +# CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -472,6 +482,8 @@ CONFIG_LIBM=y CONFIG_LIBC_FLOATINGPOINT=y CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -518,9 +530,9 @@ CONFIG_ARCH_HAVE_TLS=y # Examples # # CONFIG_EXAMPLES_AJOYSTICK is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set -# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -546,12 +558,10 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_PCA9635 is not set -# CONFIG_EXAMPLES_PIPE is not set -# CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set +# CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -620,6 +630,7 @@ CONFIG_GRAPHICS_TRAVELER_DEBUG_LEVEL=0 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -663,6 +674,7 @@ CONFIG_GRAPHICS_TRAVELER_DEBUG_LEVEL=0 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/udgram/defconfig b/configs/sim/udgram/defconfig index fa768fa7c2a24f6004de218a7f539416d45f90e0..856d330290a459c1afaf53608db994d5258996ed 100644 --- a/configs/sim/udgram/defconfig +++ b/configs/sim/udgram/defconfig @@ -59,7 +59,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y @@ -157,8 +156,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -342,7 +339,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -403,13 +399,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_GUARDSIZE=2 # @@ -674,7 +668,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/unionfs/defconfig b/configs/sim/unionfs/defconfig index 1ccf413c9549ae38c1370d5bec4c33c8d26cc1ce..0fea09b8d34ed15e2a821b75e185a6f5b99e20ac 100644 --- a/configs/sim/unionfs/defconfig +++ b/configs/sim/unionfs/defconfig @@ -56,7 +56,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set CONFIG_ARCH_SIM=y # CONFIG_ARCH_X86 is not set @@ -148,8 +147,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -301,7 +298,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -534,7 +530,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/sim/ustream/defconfig b/configs/sim/ustream/defconfig index 0e9b3b7e707037fdb6cffac2ac0f46ba88dfbc95..e356f4bbac74e882a6879bb749ff059d04a06af7 100644 --- a/configs/sim/ustream/defconfig +++ b/configs/sim/ustream/defconfig @@ -59,7 +59,6 @@ CONFIG_DEBUG_NOOPT=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set CONFIG_ARCH_SIM=y @@ -157,8 +156,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_APP_SYMTAB is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -342,7 +339,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -403,13 +399,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_GUARDSIZE=2 # @@ -674,7 +668,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/skp16c26/ostest/defconfig b/configs/skp16c26/ostest/defconfig index 0efb93d2a2c343c8346f1c85666e5bdd647ed727..61814e3a1c05675e51f808c147627b8f64687dec 100644 --- a/configs/skp16c26/ostest/defconfig +++ b/configs/skp16c26/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set CONFIG_ARCH_RENESAS=y # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -254,7 +253,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -424,7 +422,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/spark/composite/defconfig b/configs/spark/composite/defconfig index 490744f4298722a8c42f5c5a0709d721f0a2946a..d192166cefb5161393ed7ae729fb780eefe46fe9 100644 --- a/configs/spark/composite/defconfig +++ b/configs/spark/composite/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -558,8 +556,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -777,7 +773,6 @@ CONFIG_SST25_SECTOR512=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1121,7 +1116,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/spark/nsh/defconfig b/configs/spark/nsh/defconfig index a32b364ed24a487a94c6976e16c2848a3202ac0c..5f8d3daac62603b3e2c8a89792f6d1e67c31a628 100644 --- a/configs/spark/nsh/defconfig +++ b/configs/spark/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -558,8 +556,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_USBDEVCTRL is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -777,7 +773,6 @@ CONFIG_SST25_SECTOR512=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1121,7 +1116,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/spark/usbmsc/defconfig b/configs/spark/usbmsc/defconfig index 9ac901f2a1bb16a04e074f8f0cf83e80f0e11fa4..dfd2fda659764e232d680866004b9e1a357540a7 100644 --- a/configs/spark/usbmsc/defconfig +++ b/configs/spark/usbmsc/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -558,8 +556,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -777,7 +773,6 @@ CONFIG_SST25_SECTOR512=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1086,7 +1081,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/spark/usbnsh/defconfig b/configs/spark/usbnsh/defconfig index 328bf6670dff31527f75c52a386a2710749ca93d..9af591a0f595c53ffbb9add67824a8c52e631cec 100644 --- a/configs/spark/usbnsh/defconfig +++ b/configs/spark/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -557,8 +555,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -778,7 +774,6 @@ CONFIG_SST25_SPIFREQUENCY=20000000 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1065,7 +1060,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/spark/usbserial/defconfig b/configs/spark/usbserial/defconfig index da3d0c5e5dbac53dcb41cce2da04c2481c89cb5d..2bbed930a3b6da4981bc262948b65dde418d174d 100644 --- a/configs/spark/usbserial/defconfig +++ b/configs/spark/usbserial/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -558,8 +556,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -782,7 +778,6 @@ CONFIG_SST25_SECTOR512=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1096,7 +1091,6 @@ CONFIG_EXAMPLES_CC3000BASIC=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index 1e70b125b5450e324553bf20fc10b55cf239c4eb..050276b5bbc433ff15c44fc3e843c446775a0dc9 100644 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -705,14 +705,6 @@ can be selected as follow: Where is one of the following: - buttons: - -------- - - Uses apps/examples/buttons to exercise STM3210E-EVAL buttons and - button interrupts. - - CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows - composite --------- diff --git a/configs/stm3210e-eval/buttons/setenv.sh b/configs/stm3210e-eval/buttons/setenv.sh deleted file mode 100755 index 2bdf5367426a09a0164591203cc9bb7cd50197f1..0000000000000000000000000000000000000000 --- a/configs/stm3210e-eval/buttons/setenv.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# configs/stm3210e-eval/buttons/setenv.sh -# -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# 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. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# 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 OWNER 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. -# - -if [ "$(basename $0)" = "setenv.sh" ] ; then - echo "You must source this script, not run it!" 1>&2 - exit 1 -fi - -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - -WD=`pwd` -export RIDE_BIN="/cygdrive/c/Program Files/Raisonance/Ride/arm-gcc/bin" -export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:${RIDE_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" - -echo "PATH : ${PATH}" diff --git a/configs/stm3210e-eval/composite/defconfig b/configs/stm3210e-eval/composite/defconfig index 44e2d6e39d057840791daa952f6ed72f0ba7a48f..751ffdc37ac0d6ce4e444566c4f29fb7a0e168fe 100644 --- a/configs/stm3210e-eval/composite/defconfig +++ b/configs/stm3210e-eval/composite/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,10 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -359,6 +362,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -571,8 +580,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -607,6 +614,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -623,6 +631,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -708,6 +718,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -715,6 +727,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -778,6 +791,7 @@ CONFIG_MTD=y # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_IS25XP is not set # CONFIG_MTD_M25P is not set +# CONFIG_MTD_MX25L is not set # CONFIG_MTD_S25FL1 is not set # CONFIG_MTD_N25QXXX is not set # CONFIG_MTD_SMART is not set @@ -792,7 +806,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -931,6 +944,7 @@ CONFIG_USBMSC_SCSI_STACKSIZE=2048 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1030,6 +1044,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1050,6 +1066,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1078,6 +1096,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1110,7 +1130,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1151,6 +1170,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1207,6 +1227,7 @@ CONFIG_SYSTEM_COMPOSITE_BUFSIZE=256 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_USBMSC is not set # CONFIG_SYSTEM_VI is not set diff --git a/configs/stm3210e-eval/nsh/defconfig b/configs/stm3210e-eval/nsh/defconfig index 0621482063bf833ce077465f98222ab05eefcd60..f75f2d476508cc9092d64a9ca7e20a9a9269735e 100644 --- a/configs/stm3210e-eval/nsh/defconfig +++ b/configs/stm3210e-eval/nsh/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,10 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -360,6 +363,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -572,8 +581,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_USBDEVCTRL is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -608,6 +615,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -624,6 +632,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -709,6 +719,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -716,6 +728,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -779,6 +792,7 @@ CONFIG_MTD=y # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_IS25XP is not set # CONFIG_MTD_M25P is not set +# CONFIG_MTD_MX25L is not set # CONFIG_MTD_S25FL1 is not set # CONFIG_MTD_N25QXXX is not set # CONFIG_MTD_SMART is not set @@ -793,7 +807,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -882,6 +895,7 @@ CONFIG_USBDEV_MAXPOWER=100 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -987,6 +1001,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1007,6 +1023,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1035,6 +1053,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1067,7 +1087,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1108,6 +1127,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1178,6 +1198,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1201,6 +1222,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1246,6 +1268,7 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig index b0e7ea89b89271cdb30232ae96db65458c31d75a..8b04d1856875e31f1f5537daaa8bd0365803d3b5 100644 --- a/configs/stm3210e-eval/nsh2/defconfig +++ b/configs/stm3210e-eval/nsh2/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,10 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -359,6 +362,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -588,8 +597,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -624,6 +631,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -640,6 +648,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -730,6 +740,8 @@ CONFIG_I2C_POLLED=y # CONFIG_I2C_TRACE is not set CONFIG_I2C_DRIVER=y # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -737,6 +749,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_TIMERS_CS2100CP is not set @@ -772,6 +785,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -831,6 +845,7 @@ CONFIG_MTD=y # CONFIG_MTD_AT45DB is not set # CONFIG_MTD_IS25XP is not set # CONFIG_MTD_M25P is not set +# CONFIG_MTD_MX25L is not set # CONFIG_MTD_S25FL1 is not set # CONFIG_MTD_N25QXXX is not set # CONFIG_MTD_SMART is not set @@ -845,7 +860,6 @@ CONFIG_MTD=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -949,6 +963,7 @@ CONFIG_USBMSC_SCSI_STACKSIZE=2048 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1094,6 +1109,7 @@ CONFIG_NXFONT_SANS28X37B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set # CONFIG_NXTERM is not set # @@ -1145,6 +1161,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1165,6 +1183,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1198,6 +1218,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1262,7 +1284,6 @@ CONFIG_EXAMPLES_NXHELLO_FONTID=6 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1304,6 +1325,7 @@ CONFIG_EXAMPLES_NXHELLO_FONTID=6 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1375,6 +1397,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1398,6 +1421,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1451,6 +1475,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set CONFIG_SYSTEM_USBMSC=y CONFIG_SYSTEM_USBMSC_NLUNS=1 diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 65752da1c0262d63936939c648e09f092c95cc71..fbb33c5d03ef23919c0a73d89a70b13a376d3736 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,10 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -357,6 +360,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -609,6 +618,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -625,6 +635,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -710,6 +722,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -717,6 +731,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -751,6 +766,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -782,7 +798,6 @@ CONFIG_LCD_RPORTRAIT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -870,6 +885,7 @@ CONFIG_USBDEV_MAXPOWER=100 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1001,6 +1017,7 @@ CONFIG_NXFONT_SANS23X27=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set # CONFIG_NXTERM is not set # @@ -1050,6 +1067,8 @@ CONFIG_NUNGET_CHARS=2 # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1067,6 +1086,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -1094,6 +1115,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1139,7 +1162,6 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1176,6 +1198,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1219,6 +1242,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm3210e-eval/nxterm/defconfig b/configs/stm3210e-eval/nxterm/defconfig index fc61e8932b4e6042ba018a692617790ddb8c56c3..db426d6de6bb6793ec3ef2fb3efb15b6169b2176 100644 --- a/configs/stm3210e-eval/nxterm/defconfig +++ b/configs/stm3210e-eval/nxterm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,10 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -357,6 +360,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -568,8 +577,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -604,6 +611,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -620,6 +628,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -661,7 +671,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=8 -CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -705,6 +715,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -712,6 +724,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -746,6 +759,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -777,7 +791,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -846,6 +859,7 @@ CONFIG_USART2_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -984,13 +998,14 @@ CONFIG_NXFONT_SANS23X27=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=256 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1010,7 +1025,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1056,6 +1074,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1074,6 +1094,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -1106,6 +1128,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1138,7 +1162,6 @@ CONFIG_EXAMPLES_NXTERM=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1177,6 +1200,7 @@ CONFIG_EXAMPLES_NXTERM=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1247,6 +1271,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1269,6 +1294,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1314,6 +1340,7 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm3210e-eval/pm/defconfig b/configs/stm3210e-eval/pm/defconfig index 957c9a57a1ce5f383e0e4f03b488e50435f94291..345e5fe6ddfccbf8f4723bdbc6dfeecc5337ca33 100644 --- a/configs/stm3210e-eval/pm/defconfig +++ b/configs/stm3210e-eval/pm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -65,11 +67,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -79,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -358,6 +360,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -589,8 +597,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -622,6 +628,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -638,6 +645,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -723,6 +732,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -822,7 +833,6 @@ CONFIG_PM_SLEEPEXIT_THRESH=2 CONFIG_PM_SLEEPENTER_COUNT=70 # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1030,6 +1040,7 @@ CONFIG_NXFONT_SANS28X37B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set # CONFIG_NXTERM is not set # @@ -1101,6 +1112,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -1133,8 +1146,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1198,7 +1211,6 @@ CONFIG_EXAMPLES_NXHELLO_FONTID=6 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1331,6 +1343,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 diff --git a/configs/stm3210e-eval/src/stm3210e-eval.h b/configs/stm3210e-eval/src/stm3210e-eval.h index aa129bf9ce7ca5a65409a0093a725371fd50131b..1426785854c56cff86c73e8b7f3f93ddf5fde588 100644 --- a/configs/stm3210e-eval/src/stm3210e-eval.h +++ b/configs/stm3210e-eval/src/stm3210e-eval.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3210e_eval/src/stm3210e-eval.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -192,6 +192,30 @@ void weak_function stm32_spidev_initialize(void); void weak_function stm32_usbinitialize(void); +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /************************************************************************************ * Name: stm32_extcontextsave * diff --git a/configs/stm3210e-eval/src/stm32_adc.c b/configs/stm3210e-eval/src/stm32_adc.c index a0c5b87fa36a7df0c72b4259b0ab7e4b9bd916b2..bb92bf9e93170370eb18f58fecdda0a363388279 100644 --- a/configs/stm3210e-eval/src/stm32_adc.c +++ b/configs/stm3210e-eval/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3210e-eval/src/stm32_adc.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -95,24 +95,19 @@ static const uint8_t g_chanlist[ADC1_NCHANNELS] = {14}; static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC1_IN14}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC1 static bool initialized = false; diff --git a/configs/stm3210e-eval/src/stm32_appinit.c b/configs/stm3210e-eval/src/stm32_appinit.c index 10d617c0dac0cfa482b22714d59caa1291e78889..0b4a1c52c2da7b71298c2e760a8f581b5496e517 100644 --- a/configs/stm3210e-eval/src/stm32_appinit.c +++ b/configs/stm3210e-eval/src/stm32_appinit.c @@ -206,9 +206,7 @@ int board_app_initialize(uintptr_t arg) #ifdef NSH_HAVEMMCSD FAR struct sdio_dev_s *sdio; #endif -#if defined(NSH_HAVEMMCSD) || defined(CONFIG_DJOYSTICK) int ret; -#endif /* Register I2C drivers on behalf of the I2C tool */ @@ -286,6 +284,26 @@ int board_app_initialize(uintptr_t arg) sdio_mediachange(sdio, true); #endif +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + #ifdef CONFIG_DJOYSTICK /* Initialize and register the joystick driver */ @@ -299,5 +317,6 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Successfully registered the joystick driver\n"); #endif + UNUSED(ret); return OK; } diff --git a/configs/stm3210e-eval/src/stm32_can.c b/configs/stm3210e-eval/src/stm32_can.c index 284e6098c0cd0c18949040578037dd8f1778dbba..06e24930ea61083da405d0b5cc4e9670e412858f 100644 --- a/configs/stm3210e-eval/src/stm32_can.c +++ b/configs/stm3210e-eval/src/stm32_can.c @@ -52,7 +52,7 @@ #include "stm32_can.h" #include "stm3210e-eval.h" -#if defined(CONFIG_CAN) && defined(CONFIG_STM32_CAN1) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -67,48 +67,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#ifdef CONFIG_STM32_CAN1 struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/stm3210e-eval/usbmsc/defconfig b/configs/stm3210e-eval/usbmsc/defconfig index 9695318a73c4963112b7a3a23d859e54194745d1..cf41ae7d520be226faf1590c4a1ee0c05510063e 100644 --- a/configs/stm3210e-eval/usbmsc/defconfig +++ b/configs/stm3210e-eval/usbmsc/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -352,6 +353,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -564,8 +571,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -600,6 +605,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -616,6 +622,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -701,6 +709,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -708,6 +718,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -755,7 +766,6 @@ CONFIG_SDIO_PREFLIGHT=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -859,6 +869,7 @@ CONFIG_USBMSC_SCSI_STACKSIZE=2048 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -958,6 +969,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -978,6 +991,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1006,6 +1021,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1038,7 +1055,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1078,6 +1094,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1121,6 +1138,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set CONFIG_SYSTEM_USBMSC=y CONFIG_SYSTEM_USBMSC_NLUNS=1 diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index f90c876dd3b60709023d16293ef8b86f5a03a156..be949fc73f307c1ad929aa396f629a3163eee35d 100644 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -61,10 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -350,6 +351,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -556,8 +563,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -592,6 +597,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -608,6 +614,8 @@ CONFIG_MAX_TASKS=16 # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -688,6 +696,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -695,6 +705,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -730,7 +741,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -833,6 +843,7 @@ CONFIG_PL2303_PRODUCTSTR="USBdev Serial" # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -926,6 +937,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -944,6 +957,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -971,6 +986,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1002,7 +1019,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1041,6 +1057,7 @@ CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1084,6 +1101,7 @@ CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512 # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm3220g-eval/dhcpd/defconfig b/configs/stm3220g-eval/dhcpd/defconfig index b574b0fde2fda9faad05fd330dc9163d1bef6f12..79a0512054e28eb30c4804c98784c2efad53efd9 100644 --- a/configs/stm3220g-eval/dhcpd/defconfig +++ b/configs/stm3220g-eval/dhcpd/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -502,6 +500,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -666,6 +665,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -673,13 +673,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -770,10 +774,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -797,7 +799,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -874,13 +875,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -1135,7 +1134,6 @@ CONFIG_EXAMPLES_DHCPD_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3220g-eval/ide/nsh/iar/libc.ewp b/configs/stm3220g-eval/ide/nsh/iar/libc.ewp index db57f8d8b93b3cd33d2328896827015e4bea2d0e..15e9c88df48e1f2aa04eb5361912591434ad3a09 100644 --- a/configs/stm3220g-eval/ide/nsh/iar/libc.ewp +++ b/configs/stm3220g-eval/ide/nsh/iar/libc.ewp @@ -2313,9 +2313,6 @@ $PROJ_DIR$/../../../../../libc/stdio/lib_memsostream.c - - $PROJ_DIR$/../../../../../libc/stdio/lib_lowinstream.c - $PROJ_DIR$/../../../../../libc/stdio/lib_lowoutstream.c diff --git a/configs/stm3220g-eval/ide/nsh/uvision/libc.uvproj b/configs/stm3220g-eval/ide/nsh/uvision/libc.uvproj index 31ee6e86a52c05f524c626d65fb714df32b41a19..90ecb7c9c133efc1eaa0e29119a6c19977ea46b9 100644 --- a/configs/stm3220g-eval/ide/nsh/uvision/libc.uvproj +++ b/configs/stm3220g-eval/ide/nsh/uvision/libc.uvproj @@ -953,11 +953,6 @@ 1 ../../../../../libc/stdio/lib_memsostream.c - - lib_lowinstream.c - 1 - ../../../../../libc/stdio/lib_lowinstream.c - lib_lowoutstream.c 1 diff --git a/configs/stm3220g-eval/nettest/defconfig b/configs/stm3220g-eval/nettest/defconfig index ad9239d239f4d5d661d71173d50692168062d8ae..41df74c7591907997b17f259b6a18c6ebca3f0df 100644 --- a/configs/stm3220g-eval/nettest/defconfig +++ b/configs/stm3220g-eval/nettest/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -502,6 +500,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -666,6 +665,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -673,13 +673,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -771,10 +775,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -798,7 +800,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -874,13 +875,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1148,7 +1147,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3220g-eval/nsh/defconfig b/configs/stm3220g-eval/nsh/defconfig index dcda24726680b465280baaa423d663538b6999b6..29cbdf4d71420f7b27ea203b8b13a62ca9727363 100644 --- a/configs/stm3220g-eval/nsh/defconfig +++ b/configs/stm3220g-eval/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -510,6 +508,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -677,6 +676,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -685,6 +685,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -696,8 +697,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -837,10 +841,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -864,7 +866,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -941,13 +942,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1246,7 +1245,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3220g-eval/nsh2/defconfig b/configs/stm3220g-eval/nsh2/defconfig index 923e1dbda15b8ab5b6dcbb19900e578c1ea5bfb5..277d815547ec1102cc8ccf0828b06442f89dcbd8 100644 --- a/configs/stm3220g-eval/nsh2/defconfig +++ b/configs/stm3220g-eval/nsh2/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -604,8 +602,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -851,10 +847,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -878,7 +873,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_SERIAL_REMOVABLE is not set # CONFIG_SERIAL_CONSOLE is not set @@ -942,13 +936,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1246,7 +1238,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3220g-eval/nxwm/defconfig b/configs/stm3220g-eval/nxwm/defconfig index 9ddc3d2f301abd74ca717a0cbb1dae1d423808e6..c8a491bb6ee340cab31226c42e4c3eccb8e721c0 100644 --- a/configs/stm3220g-eval/nxwm/defconfig +++ b/configs/stm3220g-eval/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -66,7 +68,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -623,8 +623,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -656,6 +654,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -672,6 +671,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -714,7 +715,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -887,10 +888,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -914,7 +913,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -991,13 +989,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1223,13 +1219,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=325 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1249,7 +1246,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1317,6 +1317,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set # CONFIG_NETDB_DNSCLIENT is not set @@ -1392,7 +1393,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1544,6 +1544,7 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_FILEIOSIZE=512 @@ -1606,10 +1607,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=2048 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1708,7 +1706,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm3220g-eval/src/stm3220g-eval.h b/configs/stm3220g-eval/src/stm3220g-eval.h index d00b0e8eaeae444b0599b946e12090d0c1af0f28..1e3087109f491931c8a3bd93bceffb8958f69801 100644 --- a/configs/stm3220g-eval/src/stm3220g-eval.h +++ b/configs/stm3220g-eval/src/stm3220g-eval.h @@ -1,7 +1,7 @@ /**************************************************************************************************** * configs/stm3220g_eval/src/stm3220g.h * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -249,6 +249,42 @@ void weak_function stm32_usbinitialize(void); int stm32_usbhost_initialize(void); #endif +/**************************************************************************************************** + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ****************************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/**************************************************************************************************** + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ****************************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /**************************************************************************************************** * Name: stm32_extmemgpios * diff --git a/configs/stm3220g-eval/src/stm32_adc.c b/configs/stm3220g-eval/src/stm32_adc.c index 9db71d0bd06fd3b118d3049b3b98572c761b76e1..e020101a01fb1246a8b05207a2a9723a2aefe9f4 100644 --- a/configs/stm3220g-eval/src/stm32_adc.c +++ b/configs/stm3220g-eval/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3220g-eval/src/stm32_adc.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -99,24 +99,19 @@ static const uint8_t g_chanlist[ADC3_NCHANNELS] = {7}; static const uint32_t g_pinlist[ADC3_NCHANNELS] = {GPIO_ADC3_IN7}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC3 static bool initialized = false; diff --git a/configs/stm3220g-eval/src/stm32_appinit.c b/configs/stm3220g-eval/src/stm32_appinit.c index 93ed87e3c4b932750ac57752fba73957fbcb40e4..0fd45e4a6e5570003b85c15d7f670b3b58b11850 100644 --- a/configs/stm3220g-eval/src/stm32_appinit.c +++ b/configs/stm3220g-eval/src/stm32_appinit.c @@ -219,9 +219,7 @@ int board_app_initialize(uintptr_t arg) #ifdef HAVE_MMCSD FAR struct sdio_dev_s *sdio; #endif -#if defined(HAVE_MMCSD) || defined (HAVE_USBHOST) int ret; -#endif /* Register I2C drivers on behalf of the I2C tool */ @@ -294,5 +292,36 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/stm3220g-eval/src/stm32_can.c b/configs/stm3220g-eval/src/stm32_can.c index 5115a7b7d9af67f2b55ca0a65ff17c774ab364e2..e362ad95c5bfa4db1f90c42625eb9dc144fe5a98 100644 --- a/configs/stm3220g-eval/src/stm32_can.c +++ b/configs/stm3220g-eval/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3220g-eval/src/stm32_can.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ #include "stm32_can.h" #include "stm3220g-eval.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -75,48 +75,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/stm3220g-eval/src/stm32_pwm.c b/configs/stm3220g-eval/src/stm32_pwm.c index e689794d57682478ae107aa64451505d1b922e9c..3063d1621ea3ff3b5404158446d4410ee09df731 100644 --- a/configs/stm3220g-eval/src/stm32_pwm.c +++ b/configs/stm3220g-eval/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3220g-eval/src/stm32_pwm.c * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,24 +65,19 @@ #ifdef CONFIG_PWM -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/stm3220g-eval/telnetd/defconfig b/configs/stm3220g-eval/telnetd/defconfig index 2bb72cf565e3ad6ae32866c6ab2943d09c931941..c096d97f0ea2229fbf705035eb047a834d88ddb9 100644 --- a/configs/stm3220g-eval/telnetd/defconfig +++ b/configs/stm3220g-eval/telnetd/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -502,6 +500,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -666,6 +665,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -673,13 +673,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -773,10 +777,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -800,7 +802,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -876,13 +877,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1137,7 +1136,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index 091fc9537293c799869a866fbd923ac1e8f988ba..9144444845b942b17c5bcf358b7d848194b637ff 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -506,6 +504,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -670,6 +669,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -677,13 +677,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -774,10 +778,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -801,7 +803,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -878,13 +879,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_GUARDSIZE=2 @@ -1139,7 +1138,6 @@ CONFIG_EXAMPLES_DHCPD_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/discover/defconfig b/configs/stm3240g-eval/discover/defconfig index 22b2acdc048c51d1ce79292d139355d3627ad020..f51ac02cc14842dbe268b0135d7ee52351213de7 100644 --- a/configs/stm3240g-eval/discover/defconfig +++ b/configs/stm3240g-eval/discover/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -509,6 +507,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -679,6 +678,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -687,6 +687,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -698,8 +699,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -797,10 +801,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -824,7 +826,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -901,13 +902,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=650 CONFIG_NET_ETH_TCP_RECVWNDO=624 CONFIG_NET_GUARDSIZE=2 @@ -1203,7 +1202,6 @@ CONFIG_EXAMPLES_DISCOVER_NETMASK=0xffffff00 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/knxwm/defconfig b/configs/stm3240g-eval/knxwm/defconfig index a8f21ca59373068080cc8a749fd2d1825eb52bb6..f3db5debcdef93667627daaf0960fddf40d2f1b4 100644 --- a/configs/stm3240g-eval/knxwm/defconfig +++ b/configs/stm3240g-eval/knxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -70,10 +72,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -83,7 +87,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -365,6 +368,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -608,8 +617,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -641,6 +648,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -657,6 +665,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -699,7 +709,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -750,6 +760,8 @@ CONFIG_I2C_POLLED=y # CONFIG_I2C_TRACE is not set # CONFIG_I2C_DRIVER is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -757,6 +769,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set CONFIG_RTC=y CONFIG_RTC_DATETIME=y # CONFIG_RTC_ALARM is not set @@ -817,6 +830,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -848,7 +862,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -903,6 +916,7 @@ CONFIG_USART3_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1047,6 +1061,7 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set # CONFIG_NXTERM is not set # @@ -1056,7 +1071,6 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -CONFIG_NX_NXSTART=y # CONFIG_NXSTART_EXTERNINIT is not set CONFIG_NXSTART_SERVERPRIO=110 CONFIG_NXSTART_SERVERSTACK=1596 @@ -1107,6 +1121,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1127,6 +1143,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -1166,6 +1184,8 @@ CONFIG_CXX_NEWLONG=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1200,7 +1220,6 @@ CONFIG_CXX_NEWLONG=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1240,6 +1259,7 @@ CONFIG_CXX_NEWLONG=y # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1271,7 +1291,6 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1370,7 +1389,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 @@ -1455,6 +1474,7 @@ CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index 12c440b6246284142612017e5671f43d915ebd51..6ada35147503c19a680d8521fb83060f078b785f 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -506,6 +504,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -670,6 +669,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -677,13 +677,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -775,10 +779,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -802,7 +804,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -878,13 +879,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1152,7 +1151,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index d4d84d24c204e6a54120419a476a3c17df489c80..52a2e2b6ae660cbc79449e5047b3bd4ea10276fa 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -522,6 +520,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -689,6 +688,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -697,6 +697,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -708,8 +709,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -815,10 +819,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -842,7 +844,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -919,13 +920,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1224,7 +1223,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index 64d4a78045ecca7bde10a6aa7ea53590828812f8..e9d10d9490ef1bb031cd070460ff67078ff9e234 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -608,8 +606,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -855,10 +851,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -882,7 +877,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_SERIAL_REMOVABLE is not set # CONFIG_SERIAL_CONSOLE is not set @@ -946,13 +940,11 @@ CONFIG_RAMLOG_SYSLOG=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1250,7 +1242,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/nxterm/defconfig b/configs/stm3240g-eval/nxterm/defconfig index 4226d88dc0e411810874e895bb834a4fd6e6ad58..83acbfb10d5e76b17d7afb788042417e2cb50253 100644 --- a/configs/stm3240g-eval/nxterm/defconfig +++ b/configs/stm3240g-eval/nxterm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -66,7 +68,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -523,6 +523,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -622,7 +623,12 @@ CONFIG_STM3240G_LCD_RDSHIFT=5 # CONFIG_STM3240G_ILI9320_DISABLE is not set # CONFIG_STM3240G_ILI9325_DISABLE is not set # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -652,6 +658,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -668,6 +675,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -694,6 +703,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -702,19 +712,23 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=8 -CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -849,10 +863,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -876,7 +888,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -953,13 +964,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1179,13 +1188,14 @@ CONFIG_NXFONT_SANS23X27=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=256 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1205,7 +1215,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1273,6 +1286,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y CONFIG_NETDB_DNSCLIENT=y CONFIG_NETDB_DNSCLIENT_ENTRIES=4 @@ -1357,7 +1371,6 @@ CONFIG_EXAMPLES_NXTERM=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1372,6 +1385,7 @@ CONFIG_EXAMPLES_NXTERM=y # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_UDP is not set # CONFIG_EXAMPLES_UDPBLASTER is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -1507,6 +1521,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index 5b3f4a223dabcf2af5fcc5b6bb9ef1cc700a1cdd..fe9544fa15e09a751e4c9575e151918a3c6fd3a8 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -12,8 +12,10 @@ # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +CONFIG_TOOLCHAIN_WINDOWS=y # CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_UBUNTU is not set # CONFIG_WINDOWS_MSYS is not set # CONFIG_WINDOWS_OTHER is not set @@ -66,7 +68,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -627,8 +627,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_TSCTEST=y -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -660,6 +658,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -676,6 +675,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -718,7 +719,7 @@ CONFIG_SIG_SIGWORK=17 # POSIX Message Queue Options # CONFIG_PREALLOC_MQ_MSGS=32 -CONFIG_MQ_MAXMSGSIZE=48 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # @@ -884,10 +885,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -911,7 +910,6 @@ CONFIG_ETH0_PHY_NONE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -988,13 +986,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1220,13 +1216,14 @@ CONFIG_NXFONT_SANS22X29B=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set CONFIG_NXTERM=y # # NxTerm Output Text/Graphics Options # CONFIG_NXTERM_BPP=16 -CONFIG_NXTERM_CURSORCHAR=137 +CONFIG_NXTERM_CURSORCHAR=95 CONFIG_NXTERM_MXCHARS=325 CONFIG_NXTERM_CACHESIZE=32 CONFIG_NXTERM_LINESEPARATION=0 @@ -1246,7 +1243,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1314,6 +1314,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set CONFIG_NETDB_DNSCLIENT=y @@ -1396,7 +1397,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1548,6 +1548,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # # CONFIG_NSH_CMDOPT_DF_H is not set +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set CONFIG_NSH_FILEIOSIZE=512 @@ -1611,10 +1612,7 @@ CONFIG_NXWIDGETS=y # CONFIG_NXWIDGETS_FLICKERFREE=y # CONFIG_NXWIDGETS_EXTERNINIT is not set -CONFIG_NXWIDGETS_DEVNO=0 CONFIG_NXWIDGET_SERVERINIT=y -CONFIG_NXWIDGETS_SERVERPRIO=110 -CONFIG_NXWIDGETS_SERVERSTACK=2048 CONFIG_NXWIDGETS_CLIENTPRIO=100 CONFIG_NXWIDGETS_LISTENERPRIO=100 CONFIG_NXWIDGETS_LISTENERSTACK=2048 @@ -1713,7 +1711,7 @@ CONFIG_NXWM_TASKBAR_LEFT=y CONFIG_NXWM_STARTWINDOW_VSPACING=4 CONFIG_NXWM_STARTWINDOW_HSPACING=4 # CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set -CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm" +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" CONFIG_NXWM_STARTWINDOW_MXMSGS=32 CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 CONFIG_NXWM_STARTWINDOW_PRIO=100 diff --git a/configs/stm3240g-eval/src/stm3240g-eval.h b/configs/stm3240g-eval/src/stm3240g-eval.h index 696d29e6a5e9e63bace133082626be1bcd3bd1c1..f645db52f256fd7cc0299a364e478c38197f6468 100644 --- a/configs/stm3240g-eval/src/stm3240g-eval.h +++ b/configs/stm3240g-eval/src/stm3240g-eval.h @@ -1,7 +1,7 @@ /**************************************************************************************************** * configs/stm3240g_eval/src/stm3240g_eval.h * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -262,6 +262,42 @@ int stm32_usbhost_initialize(void); void stm32_led_initialize(void); #endif +/**************************************************************************************************** + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ****************************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/**************************************************************************************************** + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ****************************************************************************************************/ + +#ifdef CONFIG_ADC +int stm32_adc_setup(void); +#endif + +/**************************************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /**************************************************************************************************** * Name: stm32_extmemgpios * diff --git a/configs/stm3240g-eval/src/stm32_adc.c b/configs/stm3240g-eval/src/stm32_adc.c index 1d7879704333dc36cebf6b532c0aa47cdaf083ec..82a5531edb00ad387981e829b39090752809e37c 100644 --- a/configs/stm3240g-eval/src/stm32_adc.c +++ b/configs/stm3240g-eval/src/stm32_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3240g-eval/src/stm32_adc.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -99,24 +99,19 @@ static const uint8_t g_chanlist[ADC3_NCHANNELS] = {7}; static const uint32_t g_pinlist[ADC3_NCHANNELS] = {GPIO_ADC3_IN7}; #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: stm32_adc_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { #ifdef CONFIG_STM32_ADC3 static bool initialized = false; diff --git a/configs/stm3240g-eval/src/stm32_appinit.c b/configs/stm3240g-eval/src/stm32_appinit.c index 7523030be2503d6e8427c0d013135e595d2641eb..e2e18f961c702176cf3299eb805db5b3b858b402 100644 --- a/configs/stm3240g-eval/src/stm32_appinit.c +++ b/configs/stm3240g-eval/src/stm32_appinit.c @@ -240,9 +240,7 @@ int board_app_initialize(uintptr_t arg) #ifdef HAVE_MMCSD FAR struct sdio_dev_s *sdio; #endif -#if defined(HAVE_MMCSD) || defined(HAVE_USBHOST) || defined(HAVE_RTC_DRIVER) int ret; -#endif /* Register I2C drivers on behalf of the I2C tool */ @@ -345,5 +343,36 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/stm3240g-eval/src/stm32_boot.c b/configs/stm3240g-eval/src/stm32_boot.c index bfab437e4ab9f6f2c8209676c2ef441aca44abfe..61daf3d2d702535229f2fd92580ede526888db58 100644 --- a/configs/stm3240g-eval/src/stm32_boot.c +++ b/configs/stm3240g-eval/src/stm32_boot.c @@ -49,11 +49,11 @@ * Pre-processor Definitions ************************************************************************************/ /* Configuration ********************************************************************/ -/* Should we initialize the NX server? This is done for NxWidgets (CONFIG_NXWIDGETS=y) - * if nx_start() is available (CONFIG_NX_NXSTART=y) and if the NxWidget::CNxServer - * class expects the RTOS to do the NX initialization (CONFIG_NXWIDGET_SERVERINIT=n). - * This combination of settings is normally only used in the kernel build mode - * (CONFIG_BUILD_PROTECTED) when NxWidgets is unable to initialize NX from user-space. +/* Should we initialize the NX server using nx_start? This is done for NxWidgets + * (CONFIG_NXWIDGETS=y) and if the NxWidget::CNxServer class expects the RTOS do the + * the NX initialization (CONFIG_NXWIDGET_SERVERINIT=n). This combination of + * settings is normally only used in the kernel build mode* (CONFIG_BUILD_PROTECTED) + * when NxWidgets is unable to initialize NX from user-space. */ #undef HAVE_NXSTART @@ -62,17 +62,9 @@ # undef CONFIG_NX_START #endif -#if defined(CONFIG_NXWIDGETS) -# if defined(CONFIG_NX_NXSTART) -# if !defined(CONFIG_NXWIDGET_SERVERINIT) -# define HAVE_NXSTART -# include -# endif -# else -# if !defined(CONFIG_NXWIDGET_SERVERINIT) && defined(CONFIG_BUILD_PROTECTED) -# error CONFIG_NX_NXSTART=y is needed -# endif -# endif +#if defined(CONFIG_NXWIDGETS) && !defined(CONFIG_NXWIDGET_SERVERINIT) +# define HAVE_NXSTART +# include #endif /* Should we initialize the touchscreen for the NxWM (CONFIG_NXWM=y)? This diff --git a/configs/stm3240g-eval/src/stm32_can.c b/configs/stm3240g-eval/src/stm32_can.c index 75e138fd206014f166c93bf12c213d0e4dee71bc..3ebae0dfa3482cfd5f5f9faac25108216ea6c2cb 100644 --- a/configs/stm3240g-eval/src/stm32_can.c +++ b/configs/stm3240g-eval/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3240g-eval/src/stm32_can.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ #include "stm32_can.h" #include "stm3240g-eval.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -75,48 +75,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/stm3240g-eval/src/stm32_pwm.c b/configs/stm3240g-eval/src/stm32_pwm.c index a565995d429f0937d0c77241a2fb0c0dbb8f0dc8..e4085ee117eca87cadcb218fa59cee18ec48640f 100644 --- a/configs/stm3240g-eval/src/stm32_pwm.c +++ b/configs/stm3240g-eval/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm3240g-eval/src/stm32_pwm.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,24 +65,19 @@ #ifdef CONFIG_PWM -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index abdbc56841c0030c88de03cb8f48392b898f288e..23d37a397068a5c9b47395ede50f140dd35a5795 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -506,6 +504,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -670,6 +669,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -677,13 +677,17 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGWORK=17 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -777,10 +781,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -804,7 +806,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -880,13 +881,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1141,7 +1140,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/webserver/defconfig b/configs/stm3240g-eval/webserver/defconfig index 31a294000e05c81432d253ac880b0483c7ec5961..98c8514cafa01055b5cff3ac033028f86a0ce979 100644 --- a/configs/stm3240g-eval/webserver/defconfig +++ b/configs/stm3240g-eval/webserver/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -514,6 +512,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -681,6 +680,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -689,6 +689,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -700,8 +701,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -836,10 +840,8 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -863,7 +865,6 @@ CONFIG_ETH0_PHY_NONE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -940,13 +941,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1243,7 +1242,6 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm3240g-eval/xmlrpc/defconfig b/configs/stm3240g-eval/xmlrpc/defconfig index 84f733db9339aebdb80e6305f51251c01283512d..c305c0cc1897b5e63b228bdb84733e65e7d465d2 100644 --- a/configs/stm3240g-eval/xmlrpc/defconfig +++ b/configs/stm3240g-eval/xmlrpc/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -509,6 +507,7 @@ CONFIG_STM32_PHYSR_100MBPS=0x0000 CONFIG_STM32_PHYSR_MODE=0x0004 CONFIG_STM32_PHYSR_FULLDUPLEX=0x0004 # CONFIG_STM32_ETH_PTP is not set +CONFIG_STM32_ETHMAC_HPWORK=y # # USB FS Host Configuration @@ -674,6 +673,7 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -682,6 +682,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # POSIX Message Queue Options @@ -693,8 +694,11 @@ CONFIG_MQ_MAXMSGSIZE=32 # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=224 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -792,10 +796,8 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -819,7 +821,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -897,13 +898,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=650 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1195,7 +1194,6 @@ CONFIG_HAVE_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32_tiny/nsh/defconfig b/configs/stm32_tiny/nsh/defconfig index 8b9c4c1d86e864bac3fc69e27de0ed4d071721b8..4c75ba7ed63f685920e44fb69bcf76c1a0dcd5ff 100644 --- a/configs/stm32_tiny/nsh/defconfig +++ b/configs/stm32_tiny/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -547,8 +545,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -732,7 +728,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -978,7 +973,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32_tiny/src/stm32_appinit.c b/configs/stm32_tiny/src/stm32_appinit.c index 4b590de5d539a5bb0ce22a23457d63f3fa21d458..d9152f5ddf5562049aae39f9a12a86336cec0f84 100644 --- a/configs/stm32_tiny/src/stm32_appinit.c +++ b/configs/stm32_tiny/src/stm32_appinit.c @@ -80,6 +80,18 @@ int board_app_initialize(uintptr_t arg) { +#ifdef CONFIG_PWM + int ret; + + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + #if defined(CONFIG_WL_NRF24L01) syslog(LOG_INFO, "Register the nRF24L01 module"); stm32_wlinitialize(); diff --git a/configs/stm32_tiny/src/stm32_pwm.c b/configs/stm32_tiny/src/stm32_pwm.c index 675e9d0c1508f0b6128591abf39bbb21062ec321..86fb75cdfd1e97e7c8d4d6be6df4f73f3b634068 100644 --- a/configs/stm32_tiny/src/stm32_pwm.c +++ b/configs/stm32_tiny/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32_tiny/src/stm32_pwm.c * - * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,24 +63,19 @@ #ifdef CONFIG_PWM -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/stm32_tiny/src/stm32_tiny.h b/configs/stm32_tiny/src/stm32_tiny.h index daadcf2605c8551eb294680862a8969a8b8d0ecc..5a75d25d9fce7452d9419695b097ff76c46f2155 100644 --- a/configs/stm32_tiny/src/stm32_tiny.h +++ b/configs/stm32_tiny/src/stm32_tiny.h @@ -121,7 +121,7 @@ * ************************************************************************************/ -extern void stm32_spidev_initialize(void); +void stm32_spidev_initialize(void); /************************************************************************************ * Name: stm32_usbinitialize @@ -131,7 +131,19 @@ extern void stm32_spidev_initialize(void); * ************************************************************************************/ -extern void stm32_usbinitialize(void); +void stm32_usbinitialize(void); + +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif /************************************************************************************ * Name: stm32_wlinitialize @@ -141,7 +153,7 @@ extern void stm32_usbinitialize(void); * ************************************************************************************/ -extern void stm32_wlinitialize(void); +void stm32_wlinitialize(void); #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_HYMINI_STM32V_H */ diff --git a/configs/stm32_tiny/usbnsh/defconfig b/configs/stm32_tiny/usbnsh/defconfig index 03de8a4dd1e76c55fda46c5f8553e09a58e8c446..ddc34f64d22bdcefcb862f8a86903dc9800d3f21 100644 --- a/configs/stm32_tiny/usbnsh/defconfig +++ b/configs/stm32_tiny/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -541,8 +539,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -710,7 +706,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y CONFIG_SERIAL_CONSOLE=y @@ -987,7 +982,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32butterfly2/nsh/defconfig b/configs/stm32butterfly2/nsh/defconfig index 76318ef95cd3536db99b9697fe5ae669505512dd..ed2275d4a7921e6febe9d7f9c9a2e8e26685f1b0 100644 --- a/configs/stm32butterfly2/nsh/defconfig +++ b/configs/stm32butterfly2/nsh/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -354,6 +354,12 @@ CONFIG_STM32_HAVE_ADC2=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -568,8 +574,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -589,7 +593,7 @@ CONFIG_CLOCK_MONOTONIC=y CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=0 +CONFIG_START_MONTH=1 CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=8 @@ -702,14 +706,14 @@ CONFIG_RAMDISK=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set CONFIG_SPI_CALLBACK=y # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -773,7 +777,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1024,10 +1027,8 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=4 CONFIG_EXAMPLES_ADC_SWTRIG=y -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=4 # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1067,7 +1068,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32butterfly2/nshnet/defconfig b/configs/stm32butterfly2/nshnet/defconfig index fe385454a680fb182385c074f2075f97fea06269..43d0054ecdbed882d7dd1c03dd6f6753116d5e74 100644 --- a/configs/stm32butterfly2/nshnet/defconfig +++ b/configs/stm32butterfly2/nshnet/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -584,8 +582,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -802,10 +798,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -832,7 +827,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -944,13 +938,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=1500 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1212,9 +1204,6 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=4 CONFIG_EXAMPLES_ADC_SWTRIG=y -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=4 # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1257,7 +1246,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32butterfly2/nshusbdev/defconfig b/configs/stm32butterfly2/nshusbdev/defconfig index e9ca79f09d511e475e1d014810a6617265b35319..602e06337559bb579cbb0872d83a319c33661e10 100644 --- a/configs/stm32butterfly2/nshusbdev/defconfig +++ b/configs/stm32butterfly2/nshusbdev/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -351,6 +351,12 @@ CONFIG_STM32_HAVE_ADC2=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -561,8 +567,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -582,7 +586,7 @@ CONFIG_CLOCK_MONOTONIC=y CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=0 +CONFIG_START_MONTH=1 CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=8 @@ -695,14 +699,14 @@ CONFIG_RAMDISK=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set CONFIG_SPI_CALLBACK=y # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -766,7 +770,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1033,10 +1036,8 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=4 CONFIG_EXAMPLES_ADC_SWTRIG=y -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=4 # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1073,7 +1074,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32butterfly2/nshusbhost/defconfig b/configs/stm32butterfly2/nshusbhost/defconfig index 76318ef95cd3536db99b9697fe5ae669505512dd..ed2275d4a7921e6febe9d7f9c9a2e8e26685f1b0 100644 --- a/configs/stm32butterfly2/nshusbhost/defconfig +++ b/configs/stm32butterfly2/nshusbhost/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -354,6 +354,12 @@ CONFIG_STM32_HAVE_ADC2=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -568,8 +574,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -CONFIG_BOARDCTL_ADCTEST=y -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -589,7 +593,7 @@ CONFIG_CLOCK_MONOTONIC=y CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=1970 -CONFIG_START_MONTH=0 +CONFIG_START_MONTH=1 CONFIG_START_DAY=1 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=8 @@ -702,14 +706,14 @@ CONFIG_RAMDISK=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set CONFIG_SPI_CALLBACK=y # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -773,7 +777,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1024,10 +1027,8 @@ CONFIG_EXAMPLES_ADC=y CONFIG_EXAMPLES_ADC_DEVPATH="/dev/adc0" CONFIG_EXAMPLES_ADC_GROUPSIZE=4 CONFIG_EXAMPLES_ADC_SWTRIG=y -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=4 # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1067,7 +1068,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32butterfly2/src/stm32_adc.c b/configs/stm32butterfly2/src/stm32_adc.c index b75a4f01f275b726ee78a5740d010d0e5dc18d9e..eaac1722e715d01c73b26e273705db5935c59014 100644 --- a/configs/stm32butterfly2/src/stm32_adc.c +++ b/configs/stm32butterfly2/src/stm32_adc.c @@ -46,14 +46,15 @@ * Public Functions ****************************************************************************/ -/***************************************************************************** - * Name: board_adc_setup +/************************************************************************************ + * Name: stm32_adc_setup * * Description: - * Function initializes channel 1 of adc1 and registers device as /dev/adc0 - ****************************************************************************/ + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ -int board_adc_setup(void) +int stm32_adc_setup(void) { static bool initialized = false; uint8_t channel[1] = {10}; diff --git a/configs/stm32butterfly2/src/stm32_boot.c b/configs/stm32butterfly2/src/stm32_boot.c index e77a6edffc719c723d6f744fb1a91e8743dd48b3..f42e7a7fd7f788d120d89e38cc0133e965ad8e35 100644 --- a/configs/stm32butterfly2/src/stm32_boot.c +++ b/configs/stm32butterfly2/src/stm32_boot.c @@ -72,23 +72,36 @@ void stm32_boardinitialize(void) int board_app_initialize(uintptr_t arg) { - int rv = 0; + int ret = 0; #ifdef CONFIG_MMCSD - if ((rv = stm32_mmcsd_initialize(CONFIG_NSH_MMCSDMINOR)) < 0) + ret = stm32_mmcsd_initialize(CONFIG_NSH_MMCSDMINOR); + if (ret < 0) { - syslog(LOG_ERR, "Failed to initialize SD slot %d: %d\n"); - return rv; + syslog(LOG_ERR, "Failed to initialize SD slot %d: %d\n", ret); + return ret; } #endif #ifdef CONFIG_USBHOST - if ((rv = stm32_usbhost_initialize()) < 0) + ret = stm32_usbhost_initialize(); + if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", rv); - return rv; + syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); + return ret; } #endif - return rv; +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = stm32_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); + return ret; } diff --git a/configs/stm32butterfly2/src/stm32_butterfly2.h b/configs/stm32butterfly2/src/stm32_butterfly2.h index d291a426a39fedd259f432bbe85af791e048d028..b309939d0d52dccd46bd9ff136bce9dd7117792f 100644 --- a/configs/stm32butterfly2/src/stm32_butterfly2.h +++ b/configs/stm32butterfly2/src/stm32_butterfly2.h @@ -127,5 +127,19 @@ int stm32_usbhost_initialize(void); static inline int stm32_usbhost_initialize(void) { return 0; } #endif +/************************************************************************************ + * Name: stm32_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_STM32_ADC +int stm32_adc_setup(void); +#else +static inline int stm32_adc_setup(void) { return 0; } +#endif + #endif /* __CONFIGS_STM32_BUTTERFLY2_SRC_STM32_BUTTERFLY2_H */ diff --git a/configs/stm32f103-minimum/README.txt b/configs/stm32f103-minimum/README.txt index 112182b032c78fef83d8e70baa9689e0537f7bba..08d359f66a3e91449e782ccf4f67e9f47384eaeb 100644 --- a/configs/stm32f103-minimum/README.txt +++ b/configs/stm32f103-minimum/README.txt @@ -421,140 +421,6 @@ instead of configure.sh: Where is one of the following: - minnsh: - ------ - - This is a experiment to see just how small we can get a usable NSH - configuration. This configuration has far fewer features than the nsh - configuration but is also a fraction of the size. - - This minnsh configuration is a "proof-of-concept" and not very usable in - its current state. This configuration was created by disabling - everything possible INCLUDING file system support. Without file system - support, NuttX is pretty much crippled. Here are some of the - consequences of disabling the file system: - - - All features that depend on the file system are lost: device drivers, - mountpoints, message queues, named semaphores. - - - Without device drivers, you cannot interact with the RTOS using POSIX - interfaces. You would have to work with NuttX as with those other - tiny RTOSs: As a scheduler and a callable hardare abstraction layer - (HAL). - - - You cannot use any of the NuttX upper half device drivers since they - depend on the pseudo-file system and device nodes. You can, of - course, continue to use the lower half drivers either directly. Or, - perhaps, you could write some custom minnsh upper half drivers that - do not depend on a file system and expose a HAL interface. - - There is a special version of readline() the NSH uses when there is no - file system. It uses a special up_putc() to write data to the console - and a special function up_getc() to read data from the console. - - - The current up_getc() implementationsa are a kludge. They are - analogous to the up_putc() implementations: They directly poll the - hardware for serial availability, locking up all lower priority tasks - in the entire system while they poll. So a version of NSH that uses - up_getc() essentially blocks the system until a character is received. - - This, of course, could be fixed by creating a special, upper half - implementation of the interrupt-driven serial lower half (like - stm32_serial) that just supports single character console I/O - (perhaps called up_putc and up_getc?). The NSH could wait for serial - input without blocking the system. But then that would increase the - footprint too. - - So although the minnsh configurations are a good starting point for - making things small, they not are really very practical. Why might - you want a NuttX minnsh solution? Perhaps you have software that runs - on a family of chips including some very tiny MCUs. Then perhaps having - the RTOS compatibility would justify the loss of functionality? - - STATUS: - 2016-06-03: Using that config I got this: - - $ ls -l nuttx.bin - -rwxr-xr-x 1 alan alan 12543 Jun 3 17:58 nuttx.bin - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 12542 1 816 13359 342f nuttx - - And this is free command from NuttX shell: - - NuttShell (NSH) - nsh> free - total used free largest - Mem: 18624 2328 16296 16296 - nsh> - - 2016-06-07: As another experiment, I tried enabling just (1) the file - system, (2) the console device, and (3) the upper half serial driver in - the minnsh configuration. With these changes, NSH should behave better - and we preserve the device driver interface. I made the following - configuration changes: - - Enable the file system: - CONFIG_NFILE_DESCRIPTORS=5 - CONFIG_NFILE_STREAMS=5 - - Enable the console device: - CONFIG_DEV_CONSOLE=y - - Disable most new NSH commands. Some like 'ls' are really mandatory - with a file system: - CONFIG_NSH_DISABLE_xxx=y - - Enable the upper half serial driver: - CONFIG_SERIAL=y - CONFIG_STANDARD_SERIAL=y - - Enable the USART1 serial driver: - CONFIG_STM32_USART1=y - CONFIG_STM32_USART1_SERIALDRIVER=y - CONFIG_USART1_SERIAL_CONSOLE=y - - CONFIG_USART1_2STOP=0 - CONFIG_USART1_BAUD=115200 - CONFIG_USART1_BITS=8 - CONFIG_USART1_PARITY=0 - CONFIG_USART1_RXBUFSIZE=16 - CONFIG_USART1_TXBUFSIZE=16 - - The resulting code was bigger as expected: - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 19853 88 876 20817 5151 nuttx - - I am sure that other things that could be disabled were also drawn into - the build, so perhaps this could be reduced. This amounts to a size - increase of around 7KB. - - One major part of this size increase is due to the addition of the NSH - 'ls' command. Now, if I disable the 'ls' command, I get: - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 17804 80 864 18748 493c nuttx - - Or an increase of only 5.1 KB. This, of course, not only excludes the - 'ls' command logic, but also the things that were drawn into the link - when 'ls' was enabled: opendir(), readdir(), closedir(), stat(), and - probably other things. - - So I think we can say that the cost of the file system and true serial - console device was about 5 KB (primarily OS support) and the cost of - the NSH 'ls' command (including OS support) is about 2KB. - - 2016-06-21: Just checking the size after some big system changes: The - size of the base configuration has actually dropped by a few bytes: - - $ arm-none-eabi-size nuttx - text data bss dec hex filename - 12526 4 816 13346 3422 nuttx - nsh: --- Configures the NuttShell (nsh) located at apps/examples/nsh. This @@ -568,6 +434,13 @@ Where is one of the following: LCD you need to connect PA5 (SPI1 CLK) to SCK; PA7 (SPI1 MOSI) to SDA; PA4 to CS; PA3 to RST; PA2 to RS. + nrf24: + --------- + This is a config example to test the nrf24 terminal example. You will need + two stm32f103-minimum board each one with a nRF24L01 module connected this + way: connect PB1 to nRF24 CE pin; PA4 to CSN; PA5 (SPI1 CLK) to SCK; PA7 + (SPI1 MOSI) to MOSI; PA6 (SPI1 MISO) to MISO; PA0 to IRQ. + usbnsh: ------- diff --git a/configs/stm32f103-minimum/audio_tone/defconfig b/configs/stm32f103-minimum/audio_tone/defconfig index 4089a1842e2c3ca999db39f6f4f1f997b9b5d566..993a61286b6d801480bf369d4332a607cf806f25 100644 --- a/configs/stm32f103-minimum/audio_tone/defconfig +++ b/configs/stm32f103-minimum/audio_tone/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -553,8 +551,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -733,7 +729,6 @@ CONFIG_AUDIO_TONE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1004,7 +999,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PWM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/buttons/defconfig b/configs/stm32f103-minimum/buttons/defconfig index b9acf84dced9ce36a65ae78ffbb67383c0290f08..a37eab30f76fd4a2a8e660e8b654450199129e97 100644 --- a/configs/stm32f103-minimum/buttons/defconfig +++ b/configs/stm32f103-minimum/buttons/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -543,8 +541,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -730,7 +726,6 @@ CONFIG_BUTTONS_NPOLLWAITERS=2 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -937,7 +932,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set CONFIG_EXAMPLES_BUTTONS=y CONFIG_EXAMPLES_BUTTONS_PRIORITY=100 CONFIG_EXAMPLES_BUTTONS_STACKSIZE=2048 @@ -975,7 +969,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/jlx12864g/defconfig b/configs/stm32f103-minimum/jlx12864g/defconfig index ac1ee07d2bbd4a1d6680669d24d283d6f810f539..b9ff3e625f8500ae73fc81972104108fdde01de3 100644 --- a/configs/stm32f103-minimum/jlx12864g/defconfig +++ b/configs/stm32f103-minimum/jlx12864g/defconfig @@ -16,7 +16,7 @@ CONFIG_HOST_LINUX=y # # Build Configuration # -CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="../apps" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set @@ -96,10 +96,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -109,7 +111,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -385,6 +386,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set # CONFIG_STM32_HAVE_DAC1 is not set @@ -574,6 +581,9 @@ CONFIG_ARCH_BOARD="stm32f103-minimum" # CONFIG_ARCH_HAVE_LEDS=y CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_ARCH_HAVE_IRQBUTTONS=y # # Board-Specific Options @@ -583,8 +593,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -715,14 +723,14 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y CONFIG_SPI_CMDDATA=y # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -807,7 +815,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -864,6 +871,7 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1050,6 +1058,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set # CONFIG_LIBC_LONG_LONG is not set # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1100,6 +1110,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -1119,6 +1131,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set CONFIG_EXAMPLES_NXHELLO=y CONFIG_EXAMPLES_NXHELLO_VPLANE=0 @@ -1136,13 +1149,16 @@ CONFIG_EXAMPLES_NXHELLO_DEFAULT_COLORS=y CONFIG_EXAMPLES_NXHELLO_DEFAULT_FONT=y # CONFIG_EXAMPLES_NXHELLO_EXTERNINIT is not set # CONFIG_EXAMPLES_NXIMAGE is not set -# CONFIG_EXAMPLES_NX is not set CONFIG_EXAMPLES_NXLINES=y CONFIG_EXAMPLES_NXLINES_VPLANE=0 CONFIG_EXAMPLES_NXLINES_DEVNO=0 # CONFIG_EXAMPLES_NXLINES_DEFAULT_COLORS is not set +CONFIG_EXAMPLES_NXLINES_BGCOLOR=0x00 CONFIG_EXAMPLES_NXLINES_LINEWIDTH=2 +CONFIG_EXAMPLES_NXLINES_LINECOLOR=0x00 CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=2 +CONFIG_EXAMPLES_NXLINES_BORDERCOLOR=0x00 +CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR=0x00 CONFIG_EXAMPLES_NXLINES_BPP=1 # CONFIG_EXAMPLES_NXLINES_EXTERNINIT is not set # CONFIG_EXAMPLES_NXTERM is not set @@ -1173,7 +1189,6 @@ CONFIG_EXAMPLES_NXTEXT_DEFAULT_FONT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1284,6 +1299,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set diff --git a/configs/stm32f103-minimum/minnsh/Make.defs b/configs/stm32f103-minimum/nrf24/Make.defs similarity index 97% rename from configs/stm32f103-minimum/minnsh/Make.defs rename to configs/stm32f103-minimum/nrf24/Make.defs index 8d3d47830537e30dac2dbbe27cf1085bfea495df..214ad61a92565590b30ce9ab7ff0824b16b03652 100644 --- a/configs/stm32f103-minimum/minnsh/Make.defs +++ b/configs/stm32f103-minimum/nrf24/Make.defs @@ -1,7 +1,7 @@ ############################################################################ -# configs/stm32f103-minimum/nsh/Make.defs +# configs/stm32f103-minimum/nrf24/Make.defs # -# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/stm32f103-minimum/minnsh/defconfig b/configs/stm32f103-minimum/nrf24/defconfig similarity index 83% rename from configs/stm32f103-minimum/minnsh/defconfig rename to configs/stm32f103-minimum/nrf24/defconfig index 06b686c04e241e0198ebd158b0b128c110131b59..ebc3352b8628e9faf0f20ef17148208944fd0707 100644 --- a/configs/stm32f103-minimum/minnsh/defconfig +++ b/configs/stm32f103-minimum/nrf24/defconfig @@ -42,8 +42,39 @@ CONFIG_RAW_BINARY=y # # Debug Options # -# CONFIG_DEBUG_ALERT is not set -# CONFIG_DEBUG_FEATURES is not set +CONFIG_DEBUG_ALERT=y +CONFIG_DEBUG_FEATURES=y + +# +# Debug SYSLOG Output Controls +# +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_WARN=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_ASSERTIONS is not set + +# +# Subsystem Debug Options +# +# CONFIG_DEBUG_BINFMT is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_GRAPHICS is not set +# CONFIG_DEBUG_LIB is not set +# CONFIG_DEBUG_MM is not set +# CONFIG_DEBUG_SCHED is not set + +# +# OS Function Debug Options +# +# CONFIG_DEBUG_IRQ is not set + +# +# Driver Debug Options +# +# CONFIG_DEBUG_LEDS is not set +# CONFIG_DEBUG_GPIO is not set +# CONFIG_DEBUG_SPI is not set +# CONFIG_DEBUG_TIMER is not set CONFIG_ARCH_HAVE_STACKCHECK=y # CONFIG_STACK_COLORATION is not set CONFIG_ARCH_HAVE_HEAPCHECK=y @@ -61,10 +92,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -74,7 +107,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -130,6 +162,7 @@ CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARCH_HAVE_TRUSTZONE is not set CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARM_MPU is not set +# CONFIG_DEBUG_HARDFAULT is not set # # ARMV7M Configuration Options @@ -146,7 +179,7 @@ CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARMV7M_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set -# CONFIG_SERIAL_TERMIOS is not set +CONFIG_SERIAL_TERMIOS=y # # STM32 Configuration Options @@ -349,6 +382,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set # CONFIG_STM32_HAVE_DAC1 is not set @@ -376,7 +415,7 @@ CONFIG_STM32_HAVE_SPI3=y # CONFIG_STM32_I2C2 is not set # CONFIG_STM32_PWR is not set # CONFIG_STM32_SDIO is not set -# CONFIG_STM32_SPI1 is not set +CONFIG_STM32_SPI1=y # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set # CONFIG_STM32_TIM1 is not set @@ -395,11 +434,13 @@ CONFIG_STM32_USART1=y # CONFIG_STM32_USB is not set # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set +CONFIG_STM32_SPI=y # CONFIG_STM32_NOEXT_VECTORS is not set # # Alternate Pin Mapping # +# CONFIG_STM32_SPI1_REMAP is not set # CONFIG_STM32_USART1_REMAP is not set # CONFIG_STM32_JTAG_DISABLE is not set CONFIG_STM32_JTAG_FULL_ENABLE=y @@ -440,6 +481,12 @@ CONFIG_STM32_USART1_SERIALDRIVER=y # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set # CONFIG_STM32_USART_SINGLEWIRE is not set + +# +# SPI Configuration +# +# CONFIG_STM32_SPI_INTERRUPTS is not set +# CONFIG_STM32_SPI_DMA is not set CONFIG_STM32_HAVE_RTC_COUNTER=y # CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set @@ -480,7 +527,7 @@ CONFIG_ARCH_HAVE_MPU=y CONFIG_ARCH_HAVE_RESET=y # CONFIG_ARCH_USE_MPU is not set # CONFIG_ARCH_IRQPRIO is not set -# CONFIG_ARCH_STACKDUMP is not set +CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set @@ -530,22 +577,25 @@ CONFIG_ARCH_BOARD="stm32f103-minimum" # CONFIG_ARCH_HAVE_LEDS=y CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_ARCH_HAVE_IRQBUTTONS=y # # Board-Specific Options # # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features # -CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y -CONFIG_DISABLE_SIGNALS=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_OS_API is not set # # Clocks and Timers @@ -557,27 +607,36 @@ CONFIG_USEC_PER_TICK=10000 # CONFIG_CLOCK_MONOTONIC is not set CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2013 -CONFIG_START_MONTH=2 -CONFIG_START_DAY=26 +CONFIG_START_YEAR=2011 +CONFIG_START_MONTH=7 +CONFIG_START_DAY=5 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=4 CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 +CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_RR_INTERVAL=0 +CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=4 +CONFIG_MAX_TASKS=16 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# +# CONFIG_MUTEX_TYPES is not set +CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -588,12 +647,12 @@ CONFIG_MAX_TASKS=4 # # Files and I/O # -# CONFIG_DEV_CONSOLE is not set -CONFIG_FDCLONE_DISABLE=y +CONFIG_DEV_CONSOLE=y +# CONFIG_FDCLONE_DISABLE is not set # CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=0 -CONFIG_NFILE_STREAMS=0 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 # CONFIG_PRIORITY_INHERITANCE is not set @@ -604,11 +663,33 @@ CONFIG_NAME_MAX=32 # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set +# CONFIG_SIG_EVTHREAD is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 # CONFIG_MODULE is not set # # Work queue support # +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 +# CONFIG_SCHED_LPWORK is not set # # Stack and heap information @@ -622,8 +703,8 @@ CONFIG_PTHREAD_STACK_DEFAULT=2048 # # Device Drivers # -CONFIG_DISABLE_POLL=y -# CONFIG_DEV_NULL is not set +# CONFIG_DISABLE_POLL is not set +CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_DEV_URANDOM is not set # CONFIG_DEV_LOOP is not set @@ -640,14 +721,26 @@ CONFIG_DISABLE_POLL=y # CONFIG_PWM is not set CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set -# CONFIG_SPI is not set +CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y +# CONFIG_SPI_SLAVE is not set +CONFIG_SPI_EXCHANGE=y +# CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_CALLBACK is not set +# CONFIG_SPI_HWFEATURES is not set +# CONFIG_SPI_BITORDER is not set +# CONFIG_SPI_CS_DELAY_CONTROL is not set +# CONFIG_SPI_DRIVER is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_I2S is not set # # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -683,8 +776,8 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set @@ -711,10 +804,12 @@ CONFIG_USART1_SERIALDRIVER=y # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set CONFIG_MCU_SERIAL=y -# CONFIG_STANDARD_SERIAL is not set +CONFIG_STANDARD_SERIAL=y +CONFIG_SERIAL_NPOLLWAITERS=2 # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set +# CONFIG_SERIAL_TIOCSERGSTRUCT is not set CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y CONFIG_USART1_SERIAL_CONSOLE=y # CONFIG_OTHER_SERIAL_CONSOLE is not set @@ -723,8 +818,8 @@ CONFIG_USART1_SERIAL_CONSOLE=y # # USART1 Configuration # -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART1_TXBUFSIZE=64 +CONFIG_USART1_RXBUFSIZE=256 +CONFIG_USART1_TXBUFSIZE=256 CONFIG_USART1_BAUD=115200 CONFIG_USART1_BITS=8 CONFIG_USART1_PARITY=0 @@ -736,7 +831,15 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set -# CONFIG_DRIVERS_WIRELESS is not set +CONFIG_DRIVERS_WIRELESS=y +# CONFIG_WL_CC1101 is not set +# CONFIG_WL_CC3000 is not set +CONFIG_WL_NRF24L01=y +CONFIG_WL_NRF24L01_DFLT_ADDR_WIDTH=5 +CONFIG_WL_NRF24L01_CHECK_PARAMS=y +CONFIG_WL_NRF24L01_RXSUPPORT=y +CONFIG_WL_NRF24L01_RXFIFO_LEN=128 +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -745,9 +848,10 @@ CONFIG_USART1_2STOP=0 # CONFIG_RAMLOG is not set # CONFIG_SYSLOG_INTBUFFER is not set # CONFIG_SYSLOG_TIMESTAMP is not set -# CONFIG_SYSLOG_SERIAL_CONSOLE is not set +CONFIG_SYSLOG_SERIAL_CONSOLE=y # CONFIG_SYSLOG_CHAR is not set -CONFIG_SYSLOG_NONE=y +CONFIG_SYSLOG_CONSOLE=y +# CONFIG_SYSLOG_NONE is not set # CONFIG_SYSLOG_FILE is not set # CONFIG_SYSLOG_CHARDEV is not set @@ -770,12 +874,20 @@ CONFIG_SYSLOG_NONE=y # # File system configuration # -CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_AUTOMOUNTER is not set CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y # CONFIG_FS_READABLE is not set # CONFIG_FS_WRITABLE is not set # CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set +# CONFIG_FS_FAT is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set +# CONFIG_FS_TMPFS is not set +# CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set # CONFIG_FS_PROCFS is not set # CONFIG_FS_UNIONFS is not set @@ -787,7 +899,7 @@ CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y # # Memory Management # -CONFIG_MM_SMALL=y +# CONFIG_MM_SMALL is not set CONFIG_MM_REGIONS=1 # CONFIG_ARCH_HAVE_HEAP2 is not set # CONFIG_GRAN is not set @@ -805,11 +917,12 @@ CONFIG_MM_REGIONS=1 # Binary Loader # # CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set -# CONFIG_BUILTIN is not set +CONFIG_BUILTIN=y # CONFIG_PIC is not set -# CONFIG_SYMTAB_ORDEREDBYNAME is not set +CONFIG_SYMTAB_ORDEREDBYNAME=y # # Library Routines @@ -818,14 +931,17 @@ CONFIG_MM_REGIONS=1 # # Standard C Library Options # -CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=0 +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set -CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set # CONFIG_LIBC_LONG_LONG is not set # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -837,12 +953,15 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set # CONFIG_TIME_EXTENDED is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -863,6 +982,11 @@ CONFIG_ARCH_HAVE_TLS=y # Application Configuration # +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + # # CAN Utilities # @@ -870,6 +994,8 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -885,13 +1011,13 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set -# CONFIG_EXAMPLES_NRF24L01TERM is not set +CONFIG_EXAMPLES_NRF24L01TERM=y CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set -# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXHELLO is not set # CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXTEXT is not set @@ -901,18 +1027,19 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -938,6 +1065,7 @@ CONFIG_EXAMPLES_NSH=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -948,6 +1076,7 @@ CONFIG_EXAMPLES_NSH=y # # Network Utilities # +# CONFIG_NETUTILS_CHAT is not set # CONFIG_NETUTILS_CODECS is not set # CONFIG_NETUTILS_ESP8266 is not set # CONFIG_NETUTILS_FTPC is not set @@ -967,10 +1096,12 @@ CONFIG_NSH_READLINE=y # CONFIG_NSH_CLE is not set CONFIG_NSH_LINELEN=80 CONFIG_NSH_DISABLE_SEMICOLON=y +# CONFIG_NSH_CMDPARMS is not set CONFIG_NSH_MAXARGUMENTS=6 # CONFIG_NSH_ARGCAT is not set CONFIG_NSH_NESTDEPTH=3 -# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_DISABLEBG=y +CONFIG_NSH_BUILTIN_APPS=y # # Disable Individual commands @@ -978,11 +1109,11 @@ CONFIG_NSH_NESTDEPTH=3 CONFIG_NSH_DISABLE_ADDROUTE=y CONFIG_NSH_DISABLE_BASENAME=y # CONFIG_NSH_DISABLE_CAT is not set -CONFIG_NSH_DISABLE_CD=y -CONFIG_NSH_DISABLE_CP=y -# CONFIG_NSH_DISABLE_CMP is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +CONFIG_NSH_DISABLE_CMP=y CONFIG_NSH_DISABLE_DATE=y -CONFIG_NSH_DISABLE_DD=y +# CONFIG_NSH_DISABLE_DD is not set CONFIG_NSH_DISABLE_DF=y CONFIG_NSH_DISABLE_DELROUTE=y CONFIG_NSH_DISABLE_DIRNAME=y @@ -990,7 +1121,7 @@ CONFIG_NSH_DISABLE_DIRNAME=y # CONFIG_NSH_DISABLE_EXEC is not set # CONFIG_NSH_DISABLE_EXIT is not set # CONFIG_NSH_DISABLE_FREE is not set -CONFIG_NSH_DISABLE_GET=y +# CONFIG_NSH_DISABLE_GET is not set # CONFIG_NSH_DISABLE_HELP is not set # CONFIG_NSH_DISABLE_HEXDUMP is not set CONFIG_NSH_DISABLE_IFCONFIG=y @@ -1000,48 +1131,52 @@ CONFIG_NSH_DISABLE_LOSETUP=y CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_LS is not set # CONFIG_NSH_DISABLE_MB is not set -CONFIG_NSH_DISABLE_MKDIR=y -CONFIG_NSH_DISABLE_MKRD=y +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKRD is not set # CONFIG_NSH_DISABLE_MH is not set -CONFIG_NSH_DISABLE_MOUNT=y -CONFIG_NSH_DISABLE_MV=y +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set -CONFIG_NSH_DISABLE_PUT=y +# CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set -CONFIG_NSH_DISABLE_RM=y -CONFIG_NSH_DISABLE_RMDIR=y +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set # CONFIG_NSH_DISABLE_SLEEP is not set CONFIG_NSH_DISABLE_TIME=y # CONFIG_NSH_DISABLE_TEST is not set -CONFIG_NSH_DISABLE_UMOUNT=y +# CONFIG_NSH_DISABLE_UMOUNT is not set CONFIG_NSH_DISABLE_UNAME=y # CONFIG_NSH_DISABLE_UNSET is not set # CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_NSH_DISABLE_WGET=y +# CONFIG_NSH_DISABLE_WGET is not set # CONFIG_NSH_DISABLE_XD is not set CONFIG_NSH_MMCSDMINOR=0 # # Configure Command Options # +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 # CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_NSH_FILEIOSIZE=64 +CONFIG_NSH_FILEIOSIZE=1024 # # Scripting Support # -CONFIG_NSH_DISABLESCRIPT=y +# CONFIG_NSH_DISABLESCRIPT is not set +CONFIG_NSH_DISABLE_ITEF=y +CONFIG_NSH_DISABLE_LOOPS=y # # Console Configuration # CONFIG_NSH_CONSOLE=y # CONFIG_NSH_ALTCONDEV is not set -# CONFIG_NSH_ARCHINIT is not set +CONFIG_NSH_ARCHINIT=y # CONFIG_NSH_LOGIN is not set # CONFIG_NSH_CONSOLE_LOGIN is not set @@ -1070,6 +1205,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm32f103-minimum/minnsh/setenv.sh b/configs/stm32f103-minimum/nrf24/setenv.sh similarity index 97% rename from configs/stm32f103-minimum/minnsh/setenv.sh rename to configs/stm32f103-minimum/nrf24/setenv.sh index 73dfab5a4d0b4ffc9b5d6cc3c7dd42df6131bd7e..1cba74e39dc6a5faecaa225acd539d4384e0b3e9 100644 --- a/configs/stm32f103-minimum/minnsh/setenv.sh +++ b/configs/stm32f103-minimum/nrf24/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs//stm32f103-minimum/nsh/setenv.sh +# configs/stm32f103-minimum/nrf24/setenv.sh # -# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/stm32f103-minimum/nsh/defconfig b/configs/stm32f103-minimum/nsh/defconfig index db105a7a7b802379016dc5a581900edcfc3f3def..f7f96edde21a053d4481d5629fa48351bfc7f801 100644 --- a/configs/stm32f103-minimum/nsh/defconfig +++ b/configs/stm32f103-minimum/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -539,8 +537,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -713,7 +709,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -950,7 +945,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/pwm/defconfig b/configs/stm32f103-minimum/pwm/defconfig index 27fa9d85b29c58c0a63d2dd239b6dcdccc79a144..5c851766afc8bf41fc7a084119772735d1d2f859 100644 --- a/configs/stm32f103-minimum/pwm/defconfig +++ b/configs/stm32f103-minimum/pwm/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -75,7 +74,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -551,8 +549,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -CONFIG_BOARDCTL_PWMTEST=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -727,7 +723,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -973,7 +968,6 @@ CONFIG_EXAMPLES_PWM_DURATION=5 CONFIG_EXAMPLES_PWM_DUTYPCT=50 # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/rfid-rc522/defconfig b/configs/stm32f103-minimum/rfid-rc522/defconfig index 0f41c12085e97e7951820fa2cc683661accf0d2b..13b50d89fc044812d735eeb6440f209e0d834239 100644 --- a/configs/stm32f103-minimum/rfid-rc522/defconfig +++ b/configs/stm32f103-minimum/rfid-rc522/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -547,8 +545,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -733,7 +729,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -977,7 +972,6 @@ CONFIG_EXAMPLES_RFID_READUID=y CONFIG_EXAMPLES_RFID_READUID_PRIORITY=100 CONFIG_EXAMPLES_RFID_READUID_STACKSIZE=2048 # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/rgbled/defconfig b/configs/stm32f103-minimum/rgbled/defconfig index e058bd2e537508f19bc357935d90d39d639da6e8..19ef7948efc0b37fe5c9d47a44d3efe1d03654b2 100644 --- a/configs/stm32f103-minimum/rgbled/defconfig +++ b/configs/stm32f103-minimum/rgbled/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -578,8 +576,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -754,7 +750,6 @@ CONFIG_RGBLED=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -999,7 +994,6 @@ CONFIG_EXAMPLES_RGBLED=y CONFIG_EXAMPLES_RGBLED_DEVNAME="/dev/rgbled0" CONFIG_EXAMPLES_RGBLED_PRIORITY=100 CONFIG_EXAMPLES_RGBLED_STACKSIZE=2048 -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/src/Makefile b/configs/stm32f103-minimum/src/Makefile index 4ecd9086ae11ad96162d2147d5bf603fa8a93e2a..367a1677e436a30aca929dae7951857b47e2daf9 100644 --- a/configs/stm32f103-minimum/src/Makefile +++ b/configs/stm32f103-minimum/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/stm32f103-minimum/src/Makefile # -# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # Laurent Latil # @@ -77,4 +77,8 @@ ifeq ($(CONFIG_VEML6070),y) CSRCS += stm32_veml6070.c endif +ifeq ($(CONFIG_WL_NRF24L01),y) +CSRCS += stm32_wireless.c +endif + include $(TOPDIR)/configs/Board.mk diff --git a/configs/stm32f103-minimum/src/stm32_bringup.c b/configs/stm32f103-minimum/src/stm32_bringup.c index ed1cd3d41566e571cae63e05113feadf22daef4a..b193c04ab0bca4b1bea64605ad51513dccb2a1c7 100644 --- a/configs/stm32f103-minimum/src/stm32_bringup.c +++ b/configs/stm32f103-minimum/src/stm32_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/stm32f103-minimum/src/stm32_bringup.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,16 @@ int stm32_bringup(void) #endif int ret = OK; +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + #ifdef CONFIG_AUDIO_TONE /* Configure and initialize the tone generator. */ @@ -173,5 +183,11 @@ int stm32_bringup(void) } #endif +#if defined(CONFIG_WL_NRF24L01) + /* Initialize the NRF24L01 wireless module */ + + stm32_wlinitialize(); +#endif + return ret; } diff --git a/configs/stm32f103-minimum/src/stm32_pwm.c b/configs/stm32f103-minimum/src/stm32_pwm.c index 3238a9077b8d2411992da9ffd42a256f0a76cda4..dec2597991d3dfd2dd0c8fdde23d50f5af04f616 100644 --- a/configs/stm32f103-minimum/src/stm32_pwm.c +++ b/configs/stm32f103-minimum/src/stm32_pwm.c @@ -81,31 +81,25 @@ # undef HAVE_PWM #endif -#if CONFIG_STM32_TIM3_CHANNEL != STM32F103MINIMUM_PWMCHANNEL +#if !defined(CONFIG_STM32_TIM3_CHANNEL) || CONFIG_STM32_TIM3_CHANNEL != STM32F103MINIMUM_PWMCHANNEL # undef HAVE_PWM #endif -#ifdef HAVE_PWM - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { +#ifdef HAVE_PWM static bool initialized = false; struct pwm_lowerhalf_s *pwm; int ret; @@ -138,6 +132,8 @@ int board_pwm_setup(void) } return OK; +#else + return -ENODEV; +#endif } -#endif /* HAVE_PWM */ diff --git a/configs/stm32f103-minimum/src/stm32_spi.c b/configs/stm32f103-minimum/src/stm32_spi.c index 98593be3ca5dbe47183da862b96300413d3b17b6..2ddc0184814383275b06ac9d6d3add0a02baee13 100644 --- a/configs/stm32f103-minimum/src/stm32_spi.c +++ b/configs/stm32f103-minimum/src/stm32_spi.c @@ -81,6 +81,10 @@ void stm32_spidev_initialize(void) #ifdef CONFIG_LCD_ST7567 (void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */ #endif + +#ifdef CONFIG_WL_NRF24L01 + stm32_configgpio(GPIO_NRF24L01_CS); /* nRF24L01 chip select */ +#endif } /**************************************************************************** @@ -125,11 +129,27 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, stm32_gpiowrite(GPIO_CS_MFRC522, !selected); } #endif + +#ifdef CONFIG_WL_NRF24L01 + if (devid == SPIDEV_WIRELESS) + { + stm32_gpiowrite(GPIO_NRF24L01_CS, !selected); + } +#endif } uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { - return 0; + uint8_t status = 0; + +#ifdef CONFIG_WL_NRF24L01 + if (devid == SPIDEV_WIRELESS) + { + status |= SPI_STATUS_PRESENT; + } +#endif + + return status; } #endif diff --git a/configs/stm32f103-minimum/src/stm32_wireless.c b/configs/stm32f103-minimum/src/stm32_wireless.c new file mode 100644 index 0000000000000000000000000000000000000000..51802585f632fc8670f32e6b28bd197c680d8897 --- /dev/null +++ b/configs/stm32f103-minimum/src/stm32_wireless.c @@ -0,0 +1,146 @@ +/************************************************************************************ + * configs/stm32f103-minimum//src/stm32_wireless.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Laurent Latil + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include + +#include +#include +#include + +#include "up_arch.h" +#include "chip.h" +#include "stm32.h" + +#include "stm32f103_minimum.h" + +#ifdef CONFIG_WL_NRF24L01 + +/************************************************************************************ + * Private Function Prototypes + ************************************************************************************/ + +static int stm32tiny_wl_irq_attach(xcpt_t isr); + +static void stm32tiny_wl_chip_enable(bool enable); + +/************************************************************************************ + * Private Data + ************************************************************************************/ + +static FAR struct nrf24l01_config_s nrf_cfg = +{ + .irqattach = stm32tiny_wl_irq_attach, + .chipenable = stm32tiny_wl_chip_enable, +}; + +static xcpt_t g_isr; + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +static int stm32tiny_wl_irq_attach(xcpt_t isr) +{ + winfo("Attach IRQ\n"); + g_isr = isr; + stm32_gpiosetevent(GPIO_NRF24L01_IRQ, false, true, false, g_isr); + return OK; +} + +static void stm32tiny_wl_chip_enable(bool enable) +{ + winfo("CE:%d\n", enable); + stm32_gpiowrite(GPIO_NRF24L01_CE, enable); +} + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32_wlinitialize + * + * Description: + * Initialize the NRF24L01 wireless module + * + * Input Parmeters: + * None + * + * Returned Value: + * None + * + ************************************************************************************/ + +void stm32_wlinitialize(void) +{ +#ifndef CONFIG_STM32_SPI1 +# error "STM32_SPI1 is required to support nRF24L01 module on this board" +#endif + + FAR struct spi_dev_s *spidev; + int result; + + /* Setup CE & IRQ line IOs */ + + stm32_configgpio(GPIO_NRF24L01_CE); + stm32_configgpio(GPIO_NRF24L01_IRQ); + + /* Init SPI bus */ + + spidev = stm32_spibus_initialize(1); + if (!spidev) + { + werr("ERROR: Failed to initialize SPI bus\n"); + return; + } + + result = nrf24l01_register(spidev, &nrf_cfg); + if (result != OK) + { + werr("ERROR: Failed to register initialize SPI bus\n"); + return; + } +} + +#endif /* CONFIG_WL_NRF24L01 */ diff --git a/configs/stm32f103-minimum/src/stm32f103_minimum.h b/configs/stm32f103-minimum/src/stm32f103_minimum.h index 7b0f69ddf3514239245000a15a1b757bd0704ac6..de00b39f628c7d3a108ec25fa7959b7bf7b39fea 100644 --- a/configs/stm32f103-minimum/src/stm32f103_minimum.h +++ b/configs/stm32f103-minimum/src/stm32f103_minimum.h @@ -63,44 +63,58 @@ /* GPIOs **************************************************************/ /* LEDs */ -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) +#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) /* BUTTONs */ -#define GPIO_BTN_USER1 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|\ - GPIO_EXTI|GPIO_PORTA|GPIO_PIN0) +#define GPIO_BTN_USER1 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|\ + GPIO_EXTI|GPIO_PORTA|GPIO_PIN0) -#define GPIO_BTN_USER2 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|\ - GPIO_EXTI|GPIO_PORTA|GPIO_PIN1) +#define GPIO_BTN_USER2 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|\ + GPIO_EXTI|GPIO_PORTA|GPIO_PIN1) -#define MIN_IRQBUTTON BUTTON_USER1 -#define MAX_IRQBUTTON BUTTON_USER2 -#define NUM_IRQBUTTONS (BUTTON_USER1 - BUTTON_USER2 + 1) +#define MIN_IRQBUTTON BUTTON_USER1 +#define MAX_IRQBUTTON BUTTON_USER2 +#define NUM_IRQBUTTONS (BUTTON_USER1 - BUTTON_USER2 + 1) /* SPI chip selects */ -#define GPIO_CS_MFRC522 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) +#define GPIO_CS_MFRC522 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) -#define STM32_LCD_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) +#define STM32_LCD_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) -#define STM32_LCD_RST (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN3) +#define GPIO_NRF24L01_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) -#define STM32_LCD_RS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2) +#define STM32_LCD_RST (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN3) + +#define STM32_LCD_RS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2) /* PWN Configuration */ #define STM32F103MINIMUM_PWMTIMER 3 #define STM32F103MINIMUM_PWMCHANNEL 3 +/* nRF24 Configuration */ + +/* NRF24L01 chip enable: PB.1 */ + +#define GPIO_NRF24L01_CE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) + +/* NRF24L01 IRQ line: PA.0 */ + +#define GPIO_NRF24L01_IRQ (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_PORTA|GPIO_PIN0) + /* USB Soft Connect Pullup: PC.13 */ -#define GPIO_USB_PULLUP (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) +#define GPIO_USB_PULLUP (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) /************************************************************************************ * Public Functions @@ -168,6 +182,36 @@ int stm32_rgbled_setup(void); void stm32_usbinitialize(void); +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: stm32_wlinitialize + * + * Description: + * Initialize the NRF24L01 wireless module + * + * Input Parmeters: + * None + * + * Returned Value: + * None + * + ************************************************************************************/ + +#ifdef CONFIG_WL_NRF24L01 +void stm32_wlinitialize(void); +#endif + /************************************************************************************ * Name: stm32_mfrc522initialize * diff --git a/configs/stm32f103-minimum/usbnsh/defconfig b/configs/stm32f103-minimum/usbnsh/defconfig index e09d96e46e0fdd099f85d3e2182ee75c2cdd84ea..5425732ae14c93471208c7fa5c16eb2ed2b3999c 100644 --- a/configs/stm32f103-minimum/usbnsh/defconfig +++ b/configs/stm32f103-minimum/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -541,8 +539,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -710,7 +706,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y CONFIG_SERIAL_CONSOLE=y @@ -987,7 +982,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/userled/defconfig b/configs/stm32f103-minimum/userled/defconfig index 9cdfdc6380671e1bcf3641da7d5ca8df18402c85..ba69602cc6392b558f3805a20fd9c07e192ef4ba 100644 --- a/configs/stm32f103-minimum/userled/defconfig +++ b/configs/stm32f103-minimum/userled/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -539,8 +537,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -716,7 +712,6 @@ CONFIG_USERLED_LOWER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -959,7 +954,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f103-minimum/veml6070/defconfig b/configs/stm32f103-minimum/veml6070/defconfig index fa44438359d1b74e213f47f249d56380628fb3e3..2c73508f80f009a59fa4c82ab8d7d16d6ad7ae17 100644 --- a/configs/stm32f103-minimum/veml6070/defconfig +++ b/configs/stm32f103-minimum/veml6070/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -564,8 +562,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -772,7 +768,6 @@ CONFIG_MS58XX_VDD=30 CONFIG_VEML6070=y # CONFIG_XEN1210 is not set # CONFIG_ZEROCROSS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1015,7 +1010,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f3discovery/Kconfig b/configs/stm32f3discovery/Kconfig index de0d2da5f804e52caef006e5cd5f5693dae789c8..71e736df11f7abd50c7f6c87fde9721ea4c84f88 100644 --- a/configs/stm32f3discovery/Kconfig +++ b/configs/stm32f3discovery/Kconfig @@ -5,6 +5,11 @@ if ARCH_BOARD_STM32F3_DISCOVERY +config STM32F3DISCO_QETIMER + int "Timer to use with QE encoder" + default 3 + depends on QENCODER + config PM_BUTTONS bool "PM Button support" default n diff --git a/configs/stm32f3discovery/nsh/defconfig b/configs/stm32f3discovery/nsh/defconfig index b1a68d9201b59fde2418eb5e43f3b0e26c2e7a22..0a4c3b350dde37f24479732d05f0afec0133af94 100644 --- a/configs/stm32f3discovery/nsh/defconfig +++ b/configs/stm32f3discovery/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -557,8 +555,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -731,7 +727,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1018,7 +1013,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f3discovery/src/stm32_appinit.c b/configs/stm32f3discovery/src/stm32_appinit.c index c95837c9c52957a2294a383863efb86713f83951..6007b0a4f6cff1b1ac78aafa3efb2ce3d19e776b 100644 --- a/configs/stm32f3discovery/src/stm32_appinit.c +++ b/configs/stm32f3discovery/src/stm32_appinit.c @@ -115,9 +115,9 @@ int board_app_initialize(uintptr_t arg) { -#ifdef HAVE_USBMONITOR - int ret; + int ret = OK; +#ifdef HAVE_USBMONITOR /* Start the USB Monitor */ ret = usbmonitor_start(); @@ -127,5 +127,28 @@ int board_app_initialize(uintptr_t arg) } #endif - return OK; +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_QENCODER + /* Initialize and register the qencoder driver */ + + ret = stm32_qencoder_initialize("/dev/qe0", CONFIG_STM32F3DISCO_QETIMER); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + + return ret; } diff --git a/configs/stm32f3discovery/src/stm32_pwm.c b/configs/stm32f3discovery/src/stm32_pwm.c index a11d2a464aa76f7223d4b09e59a08c8041e8f9d1..262c1bc851a7d060a5f1121966a2ac283ca5eae3 100644 --- a/configs/stm32f3discovery/src/stm32_pwm.c +++ b/configs/stm32f3discovery/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32f3discovery/src/stm32_pwm.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -58,9 +58,9 @@ /* Configuration *******************************************************************/ /* PWM * - * The stm32f3discovery has no real on-board PWM devices, but the board can be configured to output - * a pulse train using TIM4 CH2. This pin is used by FSMC is connect to CN5 just for this - * purpose: + * The stm32f3discovery has no real on-board PWM devices, but the board can be + * configured to output a pulse train using TIM4 CH2. This pin is used by FSMC is + * connected to CN5 just for this purpose: * * PD13 FSMC_A18 / MC_TIM4_CH2OUT pin 33 (EnB) * @@ -85,27 +85,21 @@ # undef HAVE_PWM #endif -#ifdef HAVE_PWM - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { +#ifdef HAVE_PWM static bool initialized = false; struct pwm_lowerhalf_s *pwm; int ret; @@ -138,6 +132,8 @@ int board_pwm_setup(void) } return OK; +#else + return -ENODEV; +#endif } -#endif /* HAVE_PWM */ diff --git a/configs/stm32f3discovery/src/stm32_qencoder.c b/configs/stm32f3discovery/src/stm32_qencoder.c index d4fa6051cc5ef7b0c76eb3374cf7fcd42a62a49a..76697af9809aab15b44cc51b88ed816e6d7d7318 100644 --- a/configs/stm32f3discovery/src/stm32_qencoder.c +++ b/configs/stm32f3discovery/src/stm32_qencoder.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32f3discovery/src/stm32_qencoder.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,83 +50,12 @@ #include "stm32_qencoder.h" #include "stm32f3discovery.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32_TIMn_QE). - */ - -#ifndef CONFIG_STM32_TIM1 -# undef CONFIG_STM32_TIM1_QE -#endif -#ifndef CONFIG_STM32_TIM2 -# undef CONFIG_STM32_TIM2_QE -#endif -#ifndef CONFIG_STM32_TIM3 -# undef CONFIG_STM32_TIM3_QE -#endif -#ifndef CONFIG_STM32_TIM4 -# undef CONFIG_STM32_TIM4_QE -#endif -#ifndef CONFIG_STM32_TIM5 -# undef CONFIG_STM32_TIM5_QE -#endif -#ifndef CONFIG_STM32_TIM8 -# undef CONFIG_STM32_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: qe_devinit + * Name: stm32_qencoder_initialize * * Description: * All STM32 architectures must provide the following interface to work with @@ -134,29 +63,20 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } #endif /* HAVE_QENCODER */ diff --git a/configs/stm32f3discovery/src/stm32f3discovery.h b/configs/stm32f3discovery/src/stm32f3discovery.h index eb35061c01c811ab6eccf27c44237ae83da70384..0926778d8abba8bfb933d0b4b9997522043b0796 100644 --- a/configs/stm32f3discovery/src/stm32f3discovery.h +++ b/configs/stm32f3discovery/src/stm32f3discovery.h @@ -1,8 +1,7 @@ /**************************************************************************************************** * configs/stm32f3discovery/src/stm32f3discovery.h - * arch/arm/src/board/stm32f3discovery.n * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -162,6 +161,30 @@ void weak_function stm32_spidev_initialize(void); void weak_function stm32_usbinitialize(void); #endif +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32_qencoder_initialize(FAR const char *devpath, int timer); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_STM32F3DISCOVERY_SRC_STM32F3DISCOVERY_H */ diff --git a/configs/stm32f3discovery/usbnsh/defconfig b/configs/stm32f3discovery/usbnsh/defconfig index 69d103b1d76afc0e885a798a7e1b11f050e78678..265bb26eeb141a67e235c14674034471b6750940 100644 --- a/configs/stm32f3discovery/usbnsh/defconfig +++ b/configs/stm32f3discovery/usbnsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -564,8 +562,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -749,7 +745,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1036,7 +1031,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f411e-disco/nsh/defconfig b/configs/stm32f411e-disco/nsh/defconfig index c48678fdab26088c15ea149a9c1eaefa72ff9afb..16b329ad850805e20d0f2ab5f19f0b5ae96c241b 100644 --- a/configs/stm32f411e-disco/nsh/defconfig +++ b/configs/stm32f411e-disco/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -710,7 +708,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -956,7 +953,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f429i-disco/README.txt b/configs/stm32f429i-disco/README.txt index 5cbb0acfcab9606a481d0584561973584be9c403..5eb382ec28ef23d9987939b6c8e9cece59617f69 100644 --- a/configs/stm32f429i-disco/README.txt +++ b/configs/stm32f429i-disco/README.txt @@ -35,8 +35,10 @@ Contents - Development Environment - GNU Toolchain Options + - Setup and Programming Flash - LEDs - UARTs + - Ser - Timer Inputs/Outputs - FPU - FSMC SRAM @@ -46,16 +48,64 @@ Contents Development Environment ======================= - The Development environments for the STM32F429I-DISCO board are identical - to the environments for other STM32F boards. For full details on the - environment options and setup, see the README.txt file in the - config/stm32f4discovery directory. +The Development environments for the STM32F429I-DISCO board are identical +to the environments for other STM32F boards. For full details on the +environment options and setup, see the README.txt file in the +config/stm32f4discovery directory. + +Setup and Programming Flash +=========================== + +I use a USB cable to power and program it. And I use a USB/Serial +connected to pins PA9 and PA10 for the serial console (See the section +"UARTs" below). + +FLASH may be programmed: + + - Via USB using STM32 ST-Link Utility + + - Via USB using OpenOCD. This command may be used to flash the + firmware using OpenOCD: + + $ sudo openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" + + - Via JTAG/SWD connected to the SWD connector CN2. + + CN4 Jumpers. Remove jumpers to enable signals at SWD connector CN2. + + SWD 6-Pin STM32F429i-Discovery Connector CN2 + Pin Signal Name Description + ----- ------ ---------- ------------------------------ + Pin 1 AIN_1 VDD_TARGET VDD from application + Pin 2 T_JCLK SWCLK SWD Clock + Pin 3 GND GND Ground + Pin 4 T_JTMS SWDIO SWD data input/output + Pin 5 T_NRST NRST Reset of target MCU + Pin 6 T_SWO SWO Reserved + + SWD 20-pin J-Link Connector + Pin Name Type Description + ------ --------- ------ ------------------------------ + Pin 1 VTref Input Target reference voltage + Pin 2 Vsupply NC Not connected in J-Link + Pin 3 Not used NC Not used in J-Link + Pin 5 Not used NC Not used in J-Link + Pin 7 SWDIO I/O Bi-directional data pin + Pin 9 SWCLK Output Clock signal to target CPU + Pin 11 Not used NC Not used in J-Link + Pin 13 SWO Output Serial wire output trace port + Pin 15 RESET I/O Target CPU reset signal (nRST) + Pin 17 Not used NC Not connected in J-Link + Pin 19 5V-Supply Output Supplies power to some boards. + + Pins 4, 45, 8, 10, 12, 14, 16, 18 and 20 are GND pins in J-Link. They + should also be connected to ground in the target system. LEDs ==== -The STM32F429I-DISCO board has two user LEDs; green, and red on the board -board. These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is +The STM32F429I-DISCO board has two user LEDs; green, and red on the board. +These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is defined. In that case, the usage by the board port is defined in include/board.h and src/up_leds.c. The LEDs are used to encode OS-related events as follows: @@ -82,8 +132,8 @@ UARTs ===== On the STM32F429I-DISCO board, because of pin mappings to support the -onboard SDRAM and LCD, the only UARTs that has both RX and TX pins -avilalbe are USART1 and UART5. Other USARTS could be used for RX or TX +onboard SDRAM and LCD, the only UARTs that have both RX and TX pins +available are USART1 and UART5. Other USARTS could be used for RX or TX only, or they could be used for full-duplex if the other pin functions aren't being used (i.e. LCD or SDRAM). @@ -91,101 +141,112 @@ UART/USART PINS --------------- USART1 - CK PA8 + CK PA8* CTS PA11* RTS PA12* - RX PA10*, PB7* - TX PA9*, PB6* + RX PA10, PB7 + TX PA9, PB6* USART2 CK PA4*, PD7 - CTS PA0*, PD3 - RTS PA1, PD4* - RX PA3, PD6 - TX PA2, PD5* + CTS PA0*, PD3* + RTS PA1*, PD4 + RX PA3*, PD6* + TX PA2*, PD5 USART3 - CK PB12, PC12*, PD10 - CTS PB13, PD11 - RTS PB14, PD12* - RX PB11, PC11, PD9 - TX PB10*, PC10*, PD8 + CK PB12*, PC12, PD10* + CTS PB13*, PD11* + RTS PB14*, PD12* + RX PB11*, PC11, PD9* + TX PB10*, PC10*, PD8* UART4 - RX PA1, PC11 + RX PA1*, PC11 TX PA0*, PC10* UART5 RX PD2 - TX PC12* + TX PC12 USART6 CK PC8, PG7* CTS PG13*, PG15* RTS PG12*, PG8* - RX PC7*, PG9* - TX PC6, PG14* + RX PC7*, PG9 + TX PC6*, PG14* UART7 - RX PE7*,PF6* - TX PE8*,PF7* + RX PE7*, PF6 + TX PE8*, PF7* * Indicates pins that have other on-board functions and should be used only with care (See table 6 in the STM32F429I-DISCO User Guide for a list of free I/O pins on the board). -Default USART/UART Configuration --------------------------------- +Default Serial Console +---------------------- + +USART1 is enabled as the serial console in all configurations (see */defconfig). +USART1 RX and TX are configured on pins PA10 and PA9, respectively (see +include/board.h). + + Header 32X2 P1 + -------------- + Pin 1 5V + Pin 51 PA10 + Pin 52 PA9 + Pin 63 GND -USART1 is enabled in all configurations (see */defconfig). RX and TX are -configured on pins PA3 and PA2, respectively (see include/board.h). +If solder bridges SB11 and SB12 are closed, then USART1 will be connected to +the ST-Link and should be available over USB as a virtual COM interface. Timer Inputs/Outputs ==================== TIM1 - CH1 PA8, PE9 - CH2 PA9*, PE11 - CH3 PA10*, PE13 - CH4 PA11*, PE14 + CH1 PA8*, PE9* + CH2 PA9, PE11* + CH3 PA10, PE13* + CH4 PA11*, PE14* TIM2 - CH1 PA0*, PA15, PA5* - CH2 PA1, PB3* - CH3 PA2, PB10* - CH4 PA3, PB11 + CH1 PA0*, PA15*, PA5 + CH2 PA1*, PB3* + CH3 PA2*, PB10* + CH4 PA3*, PB11* TIM3 - CH1 PA6*, PB4, PC6 - CH2 PA7*, PB5, PC7* - CH3 PB0, PC8 - CH4 PB1, PC9 + CH1 PA6*, PB4, PC6* + CH2 PA7*, PB5*, PC7* + CH3 PB0*, PC8 + CH4 PB1*, PC9* TIM4 CH1 PB6*, PD12* CH2 PB7, PD13* - CH3 PB8, PD14* + CH3 PB8*, PD14* CH4 PB9*, PD15* TIM5 - CH1 PA0*, PH10** - CH2 PA1, PH11** - CH3 PA2, PH12** - CH4 PA3, PI0 + CH1 PA0*, PH10* + CH2 PA1*, PH11* + CH3 PA2*, PH12* + CH4 PA3*, PI0** TIM8 - CH1 PC6, PI5 - CH2 PC7*, PI6 - CH3 PC8, PI7 - CH4 PC9, PI2 + CH1 PC6*, PI5** + CH2 PC7*, PI6** + CH3 PC8, PI7** + CH4 PC9*, PI2** TIM9 - CH1 PA2, PE5 - CH2 PA3, PE6 + CH1 PA2*, PE5 + CH2 PA3*, PE6 TIM10 - CH1 PB8, PF6 + CH1 PB8*, PF6 TIM11 - CH1 PB9*, PF7 + CH1 PB9*, PF7* TIM12 - CH1 PH6**, PB14 - CH2 PC15, PH9** + CH1 PH6*, PB14* + CH2 PC15*, PH9* TIM13 - CH1 PA6*, PF8 + CH1 PA6*, PF8* TIM14 - CH1 PA7*, PF9 + CH1 PA7*, PF9* * Indicates pins that have other on-board functions and should be used only - with care (See table 5 in the STM32F429I-DISCO User Guide). The rest are - free I/O pins. -** Port H pins are not supported by the MCU + with care (See table 6 in the STM32F429I-DISCO User Guide). The rest are + free I/O pins (This need to be updated. They are incorrect!) +** Port I pins are not supported by the MCU FPU === @@ -240,7 +301,7 @@ the following lines in each Make.defs file: Configuration Changes --------------------- -Below are all of the configuration changes that I had to make to configs/stm3240g-eval/nsh2 +Below are all of the configuration changes that I had to make to configs/stm32f429i-disco/nsh2 in order to successfully build NuttX using the Atollic toolchain WITH FPU support: -CONFIG_ARCH_FPU=n : Enable FPU support @@ -598,6 +659,30 @@ instead of configure.sh: Where is one of the following: + extflash: + --------- + + This is another NSH example. If differs from other 'nsh' configurations + in that this configuration defines an external 8 MByte SPI FLASH (the + SST25VF064C part from Silicon Storage Technology, Inc.) which must be + be connected to the Discovery board's SPI4 pins on the expansion pins. + Additionally, this demo uses UART1 for the console + + NOTES: + + 1. This configuration assumes an SST25VF064C 8Mbyte SPI FLASH is + connected to SPI4 on the following Discovery board Pins: + + SCK: Port PE2 Board Connector P1, Pin 15 + MOSI: Port PE6 Board Connector P1, Pin 11 + MISO: Port PE5 Board Connector P1, Pin 14 + CS: Port PE4 Board Connector P1, Pin 13 + + 2. This configuration does have UART1 output enabled and set up as + the system logging device. To use this UART, you must add an + external RS-232 line driver to the UART1 pins of the DISCO board + on PA9 and PA10 of connector P1. + ltdc: ---- STM32F429I-DISCO LTDC Framebuffer demo example. See @@ -843,29 +928,77 @@ Where is one of the following: 2015-04-30 Appears to be fully functional. - extflash: - --------- - - This is another NSH example. If differs from other 'nsh' configurations - in that this configuration defines an external 8 MByte SPI FLASH (the - SST25VF064C part from Silicon Storage Technology, Inc.) which must be - be connected to the Discovery board's SPI4 pins on the expansion pins. - Additionally, this demo uses UART1 for the console + nxwm + ---- + This is a special configuration setup for the NxWM window manager + UnitTest. NOTES: + 1. The NxWM window manager can be found here: - 1. This configuration assumes an SST25VF064C 8Mbyte SPI FLASH is - connected to SPI4 on the following Discovery board Pins: + nuttx-code/NxWidgets/nxwm - SCK: Port PE2 Board Connector P1, Pin 15 - MOSI: Port PE6 Board Connector P1, Pin 11 - MISO: Port PE5 Board Connector P1, Pin 14 - CS: Port PE4 Board Connector P1, Pin 13 + The NxWM unit test can be found at: - 2. This configuration does have UART1 output enabled and set up as - the system logging device. To use this UART, you must add an - external RS-232 line driver to the UART1 pins of the DISCO board - on PA9 and PA10 of connector P1. + nuttx-code/NxWidgets/UnitTests/nxwm + + Documentation for installing the NxWM unit test can be found here: + + nuttx-code/NxWidgets/UnitTests/README.txt + + 2. Here is the quick summary of the build steps (Assuming that all of + the required packages are available in a directory ~/nuttx-code): + + 1. Install the nxwm configuration + + $ cd ~/nuttx-code/nuttx/tools + $ ./configure.sh stm32f429i-disco/nxwm + + 2. Make the build context (only) + + $ cd .. + $ . ./setenv.sh + $ make context + ... + + 3. Install the nxwm unit test + + $ cd ~/nuttx-code/NxWidgets + $ tools/install.sh ~/nuttx-code/apps nxwm + Creating symbolic link + - To ~/nuttx-code/NxWidgets/UnitTests/nxwm + - At ~/nuttx-code/apps/external + + 4. Build the NxWidgets library + + $ cd ~/nuttx-code/NxWidgets/libnxwidgets + $ make TOPDIR=~/nuttx-code/nuttx + ... + + 5. Build the NxWM library + + $ cd ~/nuttx-code/NxWidgets/nxwm + $ make TOPDIR=~/nuttx-code/nuttx + ... + + 6. Built NuttX with the installed unit test as the application + + $ cd ~/nuttx-code/nuttx + $ make + + 3. Performance is not so good in this example configuration because it + uses the slower SPI interfaces. + + STATUS: + 17-01-08: There are instabilities in this configuration that make it + not usable on this platform. While the equivalent configuration works + on other platforms, this one does not: The calculator display does + not form properly. There are fails in the NxTerm display, usually around + the point where the display should scroll up. + + Update: With all optimizations disabled, the issue seems to go away. + So this is most likely due to using high levels of optimization with a + bleeding edge GCC toolchain. usbnsh: ------ diff --git a/configs/stm32f429i-disco/extflash/defconfig b/configs/stm32f429i-disco/extflash/defconfig index de6d4ae58138c3f0a8b3b8cf1badc606dbaa29c8..5d05d3222712d0fc1183f7265e576037ece4cc26 100644 --- a/configs/stm32f429i-disco/extflash/defconfig +++ b/configs/stm32f429i-disco/extflash/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -594,8 +592,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -830,7 +826,6 @@ CONFIG_SST25XX_MEMORY_TYPE=0x25 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1101,7 +1096,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f429i-disco/ide/ltcd/uvision/libc.uvproj b/configs/stm32f429i-disco/ide/ltcd/uvision/libc.uvproj index f7340f2ce7f94803f161d4ce45f2e596b099a62d..97ded008652a96d12bfd9851e94ce222c78e3175 100644 --- a/configs/stm32f429i-disco/ide/ltcd/uvision/libc.uvproj +++ b/configs/stm32f429i-disco/ide/ltcd/uvision/libc.uvproj @@ -915,11 +915,6 @@ 1 ../../../../../libc/stdio/lib_memsostream.c - - lib_lowinstream.c - 1 - ../../../../../libc/stdio/lib_lowinstream.c - lib_lowoutstream.c 1 diff --git a/configs/stm32f429i-disco/include/board.h b/configs/stm32f429i-disco/include/board.h index 723b3984928d8ae93114cd3ad892750014cee5bd..c3dfbea085615802fcda24825b61f315f17ec209 100644 --- a/configs/stm32f429i-disco/include/board.h +++ b/configs/stm32f429i-disco/include/board.h @@ -224,6 +224,11 @@ #define GPIO_TIM4_CH2OUT GPIO_TIM4_CH2OUT_2 +/* I2C - There is a STMPE811 TouchPanel on I2C3 using these pins: */ + +#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 +#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 + /* SPI - There is a MEMS device on SPI5 using these pins: */ #define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 diff --git a/configs/stm32f429i-disco/lcd/defconfig b/configs/stm32f429i-disco/lcd/defconfig index b3d098ed093156f6272e28753b7ba2671945695b..93365891f46b9c2911b42a76d72fd91634ee3381 100644 --- a/configs/stm32f429i-disco/lcd/defconfig +++ b/configs/stm32f429i-disco/lcd/defconfig @@ -62,10 +62,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -351,6 +352,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -581,7 +588,12 @@ CONFIG_STM32F429I_DISCO_ILI9341_LCDDEVICE=0 CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY=20000000 CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16=y # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +# CONFIG_BOARDCTL_TSCTEST is not set +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features @@ -614,6 +626,7 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set @@ -630,6 +643,8 @@ CONFIG_SCHED_WAITPID=y # # CONFIG_MUTEX_TYPES is not set CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -711,6 +726,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -718,6 +735,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -752,6 +770,7 @@ CONFIG_LCD_MAXPOWER=1 # CONFIG_LCD_NOKIA6100 is not set # CONFIG_LCD_MIO283QT2 is not set # CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set # CONFIG_LCD_UG2864HSWEG01 is not set # CONFIG_LCD_UG2832HSWEG04 is not set # CONFIG_LCD_SSD1351 is not set @@ -790,7 +809,6 @@ CONFIG_LCD_ILI9341_IFACE0_RGB565=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -845,6 +863,7 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -980,6 +999,7 @@ CONFIG_NXFONT_MONO5X8=y # CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set # CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set # CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set # CONFIG_NXTERM is not set # @@ -989,7 +1009,10 @@ CONFIG_NX_MULTIUSER=y CONFIG_NX_BLOCKING=y CONFIG_NX_MXSERVERMSGS=32 CONFIG_NX_MXCLIENTMSGS=16 -# CONFIG_NX_NXSTART is not set +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management @@ -1037,6 +1060,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1055,6 +1080,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set # @@ -1095,6 +1122,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1121,13 +1149,12 @@ CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_NULL is not set CONFIG_EXAMPLES_NX=y -CONFIG_EXAMPLES_NX_VPLANE=0 -CONFIG_EXAMPLES_NX_DEVNO=0 CONFIG_EXAMPLES_NX_DEFAULT_COLORS=y CONFIG_EXAMPLES_NX_DEFAULT_FONT=y CONFIG_EXAMPLES_NX_BPP=16 # CONFIG_EXAMPLES_NX_RAWWINDOWS is not set CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 +# CONFIG_EXAMPLES_NX_EXTERNINIT is not set # # Multi-User Configuration Options @@ -1149,7 +1176,6 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1162,6 +1188,7 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -1187,6 +1214,7 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1257,6 +1285,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1279,6 +1308,7 @@ CONFIG_NSH_MMCSDMINOR=0 # Configure Command Options # CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_CMDOPT_HEXDUMP=y CONFIG_NSH_FILEIOSIZE=512 @@ -1325,6 +1355,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm32f429i-disco/ltdc/defconfig b/configs/stm32f429i-disco/ltdc/defconfig index 34a9442a1ace7e15ed10e16e46a0102aec9f0d59..087b0b89cad59e91fc04d05524a3bb442754d0f4 100644 --- a/configs/stm32f429i-disco/ltdc/defconfig +++ b/configs/stm32f429i-disco/ltdc/defconfig @@ -62,10 +62,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -351,6 +352,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -762,14 +769,14 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y CONFIG_SPI_CMDDATA=y # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -780,6 +787,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -815,7 +823,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -870,6 +877,7 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -1066,6 +1074,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -1125,6 +1135,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -1167,7 +1178,6 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -1207,6 +1217,7 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1277,6 +1288,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1346,6 +1358,8 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/stm32f429i-disco/nsh/defconfig b/configs/stm32f429i-disco/nsh/defconfig index e170337cae707133b63862ed594c67ffc969e61a..90fa62e4f73cd1d0d03b820913640a7a5308780d 100644 --- a/configs/stm32f429i-disco/nsh/defconfig +++ b/configs/stm32f429i-disco/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -757,7 +755,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1006,7 +1003,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/compal_e88/nsh_highram/Make.defs b/configs/stm32f429i-disco/nxwm/Make.defs similarity index 92% rename from configs/compal_e88/nsh_highram/Make.defs rename to configs/stm32f429i-disco/nxwm/Make.defs index e9c3e239431e0a716da999916dd6d0d8a1473b0d..8440d1c06ad4f3d0a6f5e9b85fec2d643998c483 100644 --- a/configs/compal_e88/nsh_highram/Make.defs +++ b/configs/stm32f429i-disco/nxwm/Make.defs @@ -1,7 +1,7 @@ ############################################################################ -# configs/compal_e88/nsh_highram/Make.defs +# configs/stm32f429i-disco/nxwm/Make.defs # -# Copyright (C) 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -35,17 +35,21 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/arm/Toolchain.defs +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs LDSCRIPT = ld.script ifeq ($(WINTOOL),y) # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mkwindeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" else # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) @@ -106,19 +110,3 @@ HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe HOSTLDFLAGS = -ifeq ($(CONFIG_HOST_WINDOWS),y) - HOSTEXEEXT = .exe -else - HOSTEXEEXT = -endif - -ifeq ($(WINTOOL),y) - # Windows-native host tools - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mkwindeps.sh -else - # Linux/Cygwin-native host tools - MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) -endif - diff --git a/configs/stm3210e-eval/buttons/defconfig b/configs/stm32f429i-disco/nxwm/defconfig similarity index 55% rename from configs/stm3210e-eval/buttons/defconfig rename to configs/stm32f429i-disco/nxwm/defconfig index 202b99f6c87ff3a1ad039f0d65dd7507ce0bb978..03750fdf1a2d89b3a62c3781b74c554ae8399402 100644 --- a/configs/stm3210e-eval/buttons/defconfig +++ b/configs/stm32f429i-disco/nxwm/defconfig @@ -8,14 +8,10 @@ # # CONFIG_EXPERIMENTAL is not set # CONFIG_DEFAULT_SMALL is not set -# CONFIG_HOST_LINUX is not set +CONFIG_HOST_LINUX=y # CONFIG_HOST_OSX is not set -CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set -CONFIG_WINDOWS_CYGWIN=y -# CONFIG_WINDOWS_MSYS is not set -# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -30,7 +26,7 @@ CONFIG_BUILD_FLAT=y # CONFIG_RRLOAD_BINARY is not set CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set -# CONFIG_RAW_BINARY is not set +CONFIG_RAW_BINARY=y # CONFIG_UBOOT_UIMAGE is not set # @@ -52,11 +48,12 @@ CONFIG_ARCH_HAVE_STACKCHECK=y # CONFIG_STACK_COLORATION is not set CONFIG_ARCH_HAVE_HEAPCHECK=y # CONFIG_HEAP_COLORATION is not set -# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_DEBUG_SYMBOLS=y CONFIG_ARCH_HAVE_CUSTOMOPT=y # CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_CUSTOMOPT=y +# CONFIG_DEBUG_FULLOPT is not set +CONFIG_DEBUG_OPTLEVEL="-O2" # # System Type @@ -65,11 +62,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -79,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -110,8 +107,8 @@ CONFIG_ARCH_CHIP_STM32=y # CONFIG_ARCH_ARM926EJS is not set # CONFIG_ARCH_ARM920T is not set # CONFIG_ARCH_CORTEXM0 is not set -CONFIG_ARCH_CORTEXM3=y -# CONFIG_ARCH_CORTEXM4 is not set +# CONFIG_ARCH_CORTEXM3 is not set +CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXM7 is not set # CONFIG_ARCH_CORTEXA5 is not set # CONFIG_ARCH_CORTEXA8 is not set @@ -130,8 +127,9 @@ CONFIG_ARM_TOOLCHAIN_GNU=y CONFIG_ARCH_HAVE_CMNVECTOR=y # CONFIG_ARMV7M_CMNVECTOR is not set # CONFIG_ARMV7M_LAZYFPU is not set -# CONFIG_ARCH_HAVE_FPU is not set +CONFIG_ARCH_HAVE_FPU=y # CONFIG_ARCH_HAVE_DPFPU is not set +# CONFIG_ARCH_FPU is not set # CONFIG_ARCH_HAVE_TRUSTZONE is not set CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARM_MPU is not set @@ -143,15 +141,11 @@ CONFIG_ARM_HAVE_MPU_UNIFIED=y # CONFIG_ARMV7M_HAVE_DCACHE is not set # CONFIG_ARMV7M_HAVE_ITCM is not set # CONFIG_ARMV7M_HAVE_DTCM is not set -# CONFIG_ARMV7M_TOOLCHAIN_IARW is not set -# CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC is not set +# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARMV7M_TOOLCHAIN_CODEREDW is not set -CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y -# CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM is not set -# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set -# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW is not set -# CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARMV7M_STACKCHECK is not set # CONFIG_ARMV7M_ITMSYSLOG is not set @@ -208,7 +202,7 @@ CONFIG_ARMV7M_HAVE_STACKCHECK=y # CONFIG_ARCH_CHIP_STM32F103VB is not set # CONFIG_ARCH_CHIP_STM32F103VC is not set # CONFIG_ARCH_CHIP_STM32F103VE is not set -CONFIG_ARCH_CHIP_STM32F103ZE=y +# CONFIG_ARCH_CHIP_STM32F103ZE is not set # CONFIG_ARCH_CHIP_STM32F105VB is not set # CONFIG_ARCH_CHIP_STM32F105RB is not set # CONFIG_ARCH_CHIP_STM32F107VC is not set @@ -269,7 +263,7 @@ CONFIG_ARCH_CHIP_STM32F103ZE=y # CONFIG_ARCH_CHIP_STM32F427Z is not set # CONFIG_ARCH_CHIP_STM32F427I is not set # CONFIG_ARCH_CHIP_STM32F429V is not set -# CONFIG_ARCH_CHIP_STM32F429Z is not set +CONFIG_ARCH_CHIP_STM32F429Z=y # CONFIG_ARCH_CHIP_STM32F429I is not set # CONFIG_ARCH_CHIP_STM32F429B is not set # CONFIG_ARCH_CHIP_STM32F429N is not set @@ -294,12 +288,12 @@ CONFIG_STM32_FLASH_CONFIG_DEFAULT=y # CONFIG_STM32_FLASH_CONFIG_I is not set # CONFIG_STM32_STM32L15XX is not set # CONFIG_STM32_ENERGYLITE is not set -CONFIG_STM32_STM32F10XX=y +# CONFIG_STM32_STM32F10XX is not set # CONFIG_STM32_VALUELINE is not set # CONFIG_STM32_CONNECTIVITYLINE is not set -CONFIG_STM32_PERFORMANCELINE=y +# CONFIG_STM32_PERFORMANCELINE is not set # CONFIG_STM32_USBACCESSLINE is not set -CONFIG_STM32_HIGHDENSITY=y +# CONFIG_STM32_HIGHDENSITY is not set # CONFIG_STM32_MEDIUMDENSITY is not set # CONFIG_STM32_LOWDENSITY is not set # CONFIG_STM32_STM32F20XX is not set @@ -309,45 +303,45 @@ CONFIG_STM32_HIGHDENSITY=y # CONFIG_STM32_STM32F302 is not set # CONFIG_STM32_STM32F303 is not set # CONFIG_STM32_STM32F37XX is not set -# CONFIG_STM32_STM32F40XX is not set +CONFIG_STM32_STM32F40XX=y # CONFIG_STM32_STM32F401 is not set # CONFIG_STM32_STM32F411 is not set # CONFIG_STM32_STM32F405 is not set # CONFIG_STM32_STM32F407 is not set # CONFIG_STM32_STM32F427 is not set -# CONFIG_STM32_STM32F429 is not set +CONFIG_STM32_STM32F429=y # CONFIG_STM32_STM32F446 is not set # CONFIG_STM32_STM32F469 is not set -CONFIG_STM32_DFU=y +# CONFIG_STM32_DFU is not set # # STM32 Peripheral Support # -# CONFIG_STM32_HAVE_CCM is not set -CONFIG_STM32_HAVE_USBDEV=y -# CONFIG_STM32_HAVE_OTGFS is not set +CONFIG_STM32_HAVE_CCM=y +# CONFIG_STM32_HAVE_USBDEV is not set +CONFIG_STM32_HAVE_OTGFS=y CONFIG_STM32_HAVE_FSMC=y -# CONFIG_STM32_HAVE_LTDC is not set +CONFIG_STM32_HAVE_LTDC=y CONFIG_STM32_HAVE_USART3=y CONFIG_STM32_HAVE_UART4=y CONFIG_STM32_HAVE_UART5=y -# CONFIG_STM32_HAVE_USART6 is not set -# CONFIG_STM32_HAVE_UART7 is not set -# CONFIG_STM32_HAVE_UART8 is not set +CONFIG_STM32_HAVE_USART6=y +CONFIG_STM32_HAVE_UART7=y +CONFIG_STM32_HAVE_UART8=y CONFIG_STM32_HAVE_TIM1=y # CONFIG_STM32_HAVE_TIM2 is not set CONFIG_STM32_HAVE_TIM3=y CONFIG_STM32_HAVE_TIM4=y -CONFIG_STM32_HAVE_TIM5=y +# CONFIG_STM32_HAVE_TIM5 is not set CONFIG_STM32_HAVE_TIM6=y CONFIG_STM32_HAVE_TIM7=y CONFIG_STM32_HAVE_TIM8=y -# CONFIG_STM32_HAVE_TIM9 is not set -# CONFIG_STM32_HAVE_TIM10 is not set -# CONFIG_STM32_HAVE_TIM11 is not set -# CONFIG_STM32_HAVE_TIM12 is not set -# CONFIG_STM32_HAVE_TIM13 is not set -# CONFIG_STM32_HAVE_TIM14 is not set +CONFIG_STM32_HAVE_TIM9=y +CONFIG_STM32_HAVE_TIM10=y +CONFIG_STM32_HAVE_TIM11=y +CONFIG_STM32_HAVE_TIM12=y +CONFIG_STM32_HAVE_TIM13=y +CONFIG_STM32_HAVE_TIM14=y # CONFIG_STM32_HAVE_TIM15 is not set # CONFIG_STM32_HAVE_TIM16 is not set # CONFIG_STM32_HAVE_TIM17 is not set @@ -358,70 +352,100 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y -# CONFIG_STM32_HAVE_CAN2 is not set +CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y CONFIG_STM32_HAVE_DAC2=y -# CONFIG_STM32_HAVE_RNG is not set -# CONFIG_STM32_HAVE_ETHMAC is not set +CONFIG_STM32_HAVE_RNG=y +CONFIG_STM32_HAVE_ETHMAC=y CONFIG_STM32_HAVE_I2C2=y -# CONFIG_STM32_HAVE_I2C3 is not set +CONFIG_STM32_HAVE_I2C3=y CONFIG_STM32_HAVE_SPI2=y CONFIG_STM32_HAVE_SPI3=y -# CONFIG_STM32_HAVE_SPI4 is not set -# CONFIG_STM32_HAVE_SPI5 is not set -# CONFIG_STM32_HAVE_SPI6 is not set +CONFIG_STM32_HAVE_SPI4=y +CONFIG_STM32_HAVE_SPI5=y +CONFIG_STM32_HAVE_SPI6=y # CONFIG_STM32_HAVE_SAIPLL is not set # CONFIG_STM32_HAVE_I2SPLL is not set # CONFIG_STM32_ADC1 is not set # CONFIG_STM32_ADC2 is not set # CONFIG_STM32_ADC3 is not set -# CONFIG_STM32_BKP is not set +# CONFIG_STM32_BKPSRAM is not set # CONFIG_STM32_CAN1 is not set +# CONFIG_STM32_CAN2 is not set +# CONFIG_STM32_CCMDATARAM is not set # CONFIG_STM32_CRC is not set +# CONFIG_STM32_CRYP is not set # CONFIG_STM32_DMA1 is not set # CONFIG_STM32_DMA2 is not set # CONFIG_STM32_DAC1 is not set # CONFIG_STM32_DAC2 is not set +# CONFIG_STM32_DCMI is not set +# CONFIG_STM32_ETHMAC is not set CONFIG_STM32_FSMC=y +# CONFIG_STM32_HASH is not set # CONFIG_STM32_I2C1 is not set # CONFIG_STM32_I2C2 is not set -# CONFIG_STM32_PWR is not set +CONFIG_STM32_I2C3=y +# CONFIG_STM32_LTDC is not set +# CONFIG_STM32_DMA2D is not set +# CONFIG_STM32_OTGFS is not set +# CONFIG_STM32_OTGHS is not set +CONFIG_STM32_PWR=y +# CONFIG_STM32_RNG is not set # CONFIG_STM32_SDIO is not set # CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set +# CONFIG_STM32_SPI4 is not set +# CONFIG_STM32_SPI5 is not set +# CONFIG_STM32_SPI6 is not set +CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM1 is not set # CONFIG_STM32_TIM2 is not set # CONFIG_STM32_TIM3 is not set # CONFIG_STM32_TIM4 is not set -# CONFIG_STM32_TIM5 is not set # CONFIG_STM32_TIM6 is not set # CONFIG_STM32_TIM7 is not set # CONFIG_STM32_TIM8 is not set +# CONFIG_STM32_TIM9 is not set +# CONFIG_STM32_TIM10 is not set +# CONFIG_STM32_TIM11 is not set +# CONFIG_STM32_TIM12 is not set +# CONFIG_STM32_TIM13 is not set +# CONFIG_STM32_TIM14 is not set CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y +# CONFIG_STM32_USART2 is not set # CONFIG_STM32_USART3 is not set # CONFIG_STM32_UART4 is not set # CONFIG_STM32_UART5 is not set -# CONFIG_STM32_USB is not set +# CONFIG_STM32_USART6 is not set +# CONFIG_STM32_UART7 is not set +# CONFIG_STM32_UART8 is not set # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set +CONFIG_STM32_I2C=y # CONFIG_STM32_NOEXT_VECTORS is not set # # Alternate Pin Mapping # -# CONFIG_STM32_USART1_REMAP is not set -# CONFIG_STM32_USART2_REMAP is not set +# CONFIG_STM32_FLASH_PREFETCH is not set # CONFIG_STM32_JTAG_DISABLE is not set -CONFIG_STM32_JTAG_FULL_ENABLE=y +# CONFIG_STM32_JTAG_FULL_ENABLE is not set # CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set -# CONFIG_STM32_JTAG_SW_ENABLE is not set -# CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG is not set +CONFIG_STM32_JTAG_SW_ENABLE=y +CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y # CONFIG_STM32_FORCEPOWER is not set # CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG is not set -# CONFIG_STM32_FSMC_SRAM is not set +# CONFIG_STM32_CCMEXCLUDE is not set +CONFIG_STM32_FSMC_SRAM=y # # Timer Configuration @@ -431,8 +455,13 @@ CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_STM32_TIM1_CAP is not set # CONFIG_STM32_TIM3_CAP is not set # CONFIG_STM32_TIM4_CAP is not set -# CONFIG_STM32_TIM5_CAP is not set # CONFIG_STM32_TIM8_CAP is not set +# CONFIG_STM32_TIM9_CAP is not set +# CONFIG_STM32_TIM10_CAP is not set +# CONFIG_STM32_TIM11_CAP is not set +# CONFIG_STM32_TIM12_CAP is not set +# CONFIG_STM32_TIM13_CAP is not set +# CONFIG_STM32_TIM14_CAP is not set CONFIG_STM32_USART=y CONFIG_STM32_SERIALDRIVER=y @@ -446,9 +475,6 @@ CONFIG_STM32_SERIALDRIVER=y CONFIG_STM32_USART1_SERIALDRIVER=y # CONFIG_STM32_USART1_1WIREDRIVER is not set # CONFIG_USART1_RS485 is not set -CONFIG_STM32_USART2_SERIALDRIVER=y -# CONFIG_STM32_USART2_1WIREDRIVER is not set -# CONFIG_USART2_RS485 is not set # # Serial Driver Configuration @@ -457,7 +483,17 @@ CONFIG_STM32_USART2_SERIALDRIVER=y # CONFIG_STM32_FLOWCONTROL_BROKEN is not set # CONFIG_STM32_USART_BREAKS is not set # CONFIG_STM32_USART_SINGLEWIRE is not set -CONFIG_STM32_HAVE_RTC_COUNTER=y + +# +# I2C Configuration +# +# CONFIG_STM32_I2C_ALT is not set +# CONFIG_STM32_I2C_DYNTIMEO is not set +CONFIG_STM32_I2CTIMEOSEC=0 +CONFIG_STM32_I2CTIMEOMS=500 +CONFIG_STM32_I2CTIMEOTICKS=500 +# CONFIG_STM32_I2C_DUTY16_9 is not set +# CONFIG_STM32_HAVE_RTC_COUNTER is not set # CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set # @@ -507,14 +543,14 @@ CONFIG_ARCH_HAVE_RAMVECTORS=y # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=5483 +CONFIG_BOARD_LOOPSPERMSEC=16717 # CONFIG_ARCH_CALIBRATION is not set # # Interrupt options # CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_INTERRUPTSTACK=2048 CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y # CONFIG_ARCH_HIPRI_INTERRUPT is not set @@ -531,15 +567,15 @@ CONFIG_BOOT_RUNFROMFLASH=y # Boot Memory Configuration # CONFIG_RAM_START=0x20000000 -CONFIG_RAM_SIZE=65536 +CONFIG_RAM_SIZE=114688 # CONFIG_ARCH_HAVE_SDRAM is not set # # Board Selection # -CONFIG_ARCH_BOARD_STM3210E_EVAL=y +CONFIG_ARCH_BOARD_STM32F429I_DISCO=y # CONFIG_ARCH_BOARD_CUSTOM is not set -CONFIG_ARCH_BOARD="stm3210e-eval" +CONFIG_ARCH_BOARD="stm32f429i-disco" # # Common Board Options @@ -549,28 +585,36 @@ CONFIG_ARCH_LEDS=y CONFIG_ARCH_HAVE_BUTTONS=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_HAVE_IRQBUTTONS=y -CONFIG_ARCH_IRQBUTTONS=y +# CONFIG_ARCH_IRQBUTTONS is not set # # Board-Specific Options # - -# -# STM3210E-EVAL LCD Hardware Configuration -# -# CONFIG_STM3210E_LCD is not set +# CONFIG_STM32F429I_DISCO_FLASH is not set +# CONFIG_STM32F429I_DISCO_RAMMTD is not set +CONFIG_STM32F429I_DISCO_ILI9341=y +# CONFIG_STM32F429I_DISCO_ILI9341_NONE is not set +CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE=y +CONFIG_STM32F429I_DISCO_ILI9341_LCDDEVICE=0 +CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY=20000000 +CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16=y # CONFIG_BOARD_CRASHDUMP is not set -# CONFIG_LIB_BOARDCTL is not set +CONFIG_LIB_BOARDCTL=y +# CONFIG_BOARDCTL_RESET is not set +# CONFIG_BOARDCTL_UNIQUEID is not set +CONFIG_BOARDCTL_TSCTEST=y +# CONFIG_BOARDCTL_GRAPHICS is not set +# CONFIG_BOARDCTL_IOCTL is not set # # RTOS Features # CONFIG_DISABLE_OS_API=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_DISABLE_PTHREAD=y +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set # CONFIG_DISABLE_SIGNALS is not set -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_ENVIRON=y +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set # # Clocks and Timers @@ -583,8 +627,8 @@ CONFIG_USEC_PER_TICK=10000 CONFIG_ARCH_HAVE_TIMEKEEPING=y # CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2011 -CONFIG_START_MONTH=7 -CONFIG_START_DAY=7 +CONFIG_START_MONTH=12 +CONFIG_START_DAY=6 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=4 CONFIG_WDOG_INTRESERVE=0 @@ -593,16 +637,25 @@ CONFIG_PREALLOC_TIMERS=4 # # Tasks and Scheduling # +# CONFIG_SPINLOCK is not set # CONFIG_INIT_NONE is not set CONFIG_INIT_ENTRYPOINT=y # CONFIG_INIT_FILEPATH is not set -CONFIG_USER_ENTRYPOINT="archbuttons_main" +CONFIG_USER_ENTRYPOINT="nxwm_main" CONFIG_RR_INTERVAL=200 # CONFIG_SCHED_SPORADIC is not set CONFIG_TASK_NAME_SIZE=0 -CONFIG_MAX_TASKS=8 +CONFIG_MAX_TASKS=16 # CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_SCHED_WAITPID is not set +CONFIG_SCHED_WAITPID=y + +# +# Pthread Options +# +# CONFIG_MUTEX_TYPES is not set +CONFIG_NPTHREAD_KEYS=4 +# CONFIG_PTHREAD_CLEANUP is not set +# CONFIG_CANCELLATION_POINTS is not set # # Performance Monitoring @@ -617,18 +670,21 @@ CONFIG_DEV_CONSOLE=y # CONFIG_FDCLONE_DISABLE is not set # CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=6 -CONFIG_NFILE_STREAMS=6 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 # CONFIG_PRIORITY_INHERITANCE is not set # # RTOS hooks # -# CONFIG_BOARD_INITIALIZE is not set +CONFIG_BOARD_INITIALIZE=y +# CONFIG_BOARD_INITTHREAD is not set # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set +CONFIG_SCHED_ONEXIT=y +CONFIG_SCHED_ONEXIT_MAX=1 +# CONFIG_SIG_EVTHREAD is not set # # Signal Numbers @@ -636,13 +692,24 @@ CONFIG_NAME_MAX=32 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 + +# +# POSIX Message Queue Options +# +CONFIG_PREALLOC_MQ_MSGS=32 +CONFIG_MQ_MAXMSGSIZE=64 # CONFIG_MODULE is not set # # Work queue support # -# CONFIG_SCHED_WORKQUEUE is not set -# CONFIG_SCHED_HPWORK is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_HPWORKPRIORITY=192 +CONFIG_SCHED_HPWORKPERIOD=50000 +CONFIG_SCHED_HPWORKSTACKSIZE=2048 # CONFIG_SCHED_LPWORK is not set # @@ -674,8 +741,15 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set # CONFIG_PWM is not set CONFIG_ARCH_HAVE_I2CRESET=y -# CONFIG_I2C is not set +CONFIG_I2C=y +# CONFIG_I2C_SLAVE is not set +CONFIG_I2C_POLLED=y +# CONFIG_I2C_RESET is not set +# CONFIG_I2C_TRACE is not set +# CONFIG_I2C_DRIVER is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -686,11 +760,33 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set +# CONFIG_TIMERS_CS2100CP is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set -# CONFIG_INPUT is not set +CONFIG_INPUT=y +# CONFIG_MOUSE is not set +# CONFIG_INPUT_MAX11802 is not set +# CONFIG_INPUT_TSC2007 is not set +# CONFIG_INPUT_ADS7843E is not set +# CONFIG_INPUT_MXT is not set +CONFIG_INPUT_STMPE811=y +# CONFIG_STMPE811_SPI is not set +CONFIG_STMPE811_I2C=y +CONFIG_STMPE811_ACTIVELOW=y +CONFIG_STMPE811_EDGE=y +# CONFIG_STMPE811_MULTIPLE is not set +# CONFIG_STMPE811_TSC_DISABLE is not set +# CONFIG_STMPE811_SWAPXY is not set +CONFIG_STMPE811_THRESHX=39 +CONFIG_STMPE811_THRESHY=51 +CONFIG_STMPE811_ADC_DISABLE=y +CONFIG_STMPE811_GPIO_DISABLE=y +CONFIG_STMPE811_TEMP_DISABLE=y +# CONFIG_BUTTONS is not set +# CONFIG_DJOYSTICK is not set +# CONFIG_AJOYSTICK is not set # # IO Expander/GPIO Support @@ -701,7 +797,45 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # # LCD Driver Support # -# CONFIG_LCD is not set +CONFIG_LCD=y + +# +# Common Graphic LCD Settings +# +# CONFIG_LCD_CONSOLE is not set +# CONFIG_LCD_NOGETRUN is not set +CONFIG_LCD_MAXCONTRAST=63 +CONFIG_LCD_MAXPOWER=1 + +# +# Graphic LCD Devices +# +# CONFIG_LCD_P14201 is not set +# CONFIG_LCD_NOKIA6100 is not set +# CONFIG_LCD_MIO283QT2 is not set +# CONFIG_LCD_MIO283QT9A is not set +# CONFIG_LCD_SH1106_OLED_132 is not set +# CONFIG_LCD_UG2864HSWEG01 is not set +# CONFIG_LCD_UG2832HSWEG04 is not set +# CONFIG_LCD_SSD1351 is not set +# CONFIG_LCD_ST7565 is not set +# CONFIG_LCD_ST7567 is not set +# CONFIG_LCD_UG2864AMBAG01 is not set +# CONFIG_LCD_SSD1289 is not set +# CONFIG_LCD_SHARP_MEMLCD is not set +CONFIG_LCD_LANDSCAPE=y +# CONFIG_LCD_PORTRAIT is not set +# CONFIG_LCD_RPORTRAIT is not set +# CONFIG_LCD_RLANDSCAPE is not set +CONFIG_LCD_ILI9341=y +CONFIG_LCD_ILI9341_NINTERFACES=1 +CONFIG_LCD_ILI9341_IFACE0=y +CONFIG_LCD_ILI9341_IFACE0_LANDSCAPE=y +# CONFIG_LCD_ILI9341_IFACE0_PORTRAIT is not set +# CONFIG_LCD_ILI9341_IFACE0_RLANDSCAPE is not set +# CONFIG_LCD_ILI9341_IFACE0_RPORTRAIT is not set +CONFIG_LCD_ILI9341_IFACE0_RGB565=y +# CONFIG_LCD_RA8875 is not set # CONFIG_SLCD is not set # @@ -719,9 +853,8 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -CONFIG_DEV_LOWCONSOLE=y +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set CONFIG_SERIAL_CONSOLE=y # CONFIG_16550_UART is not set @@ -739,7 +872,7 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_SCI1_SERIALDRIVER is not set # CONFIG_USART0_SERIALDRIVER is not set CONFIG_USART1_SERIALDRIVER=y -CONFIG_USART2_SERIALDRIVER=y +# CONFIG_USART2_SERIALDRIVER is not set # CONFIG_USART3_SERIALDRIVER is not set # CONFIG_USART4_SERIALDRIVER is not set # CONFIG_USART5_SERIALDRIVER is not set @@ -748,12 +881,12 @@ CONFIG_USART2_SERIALDRIVER=y # CONFIG_USART8_SERIALDRIVER is not set # CONFIG_OTHER_UART_SERIALDRIVER is not set CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_DMA is not set CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y CONFIG_USART1_SERIAL_CONSOLE=y -# CONFIG_USART2_SERIAL_CONSOLE is not set # CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set @@ -769,19 +902,6 @@ CONFIG_USART1_2STOP=0 # CONFIG_USART1_IFLOWCONTROL is not set # CONFIG_USART1_OFLOWCONTROL is not set # CONFIG_USART1_DMA is not set - -# -# USART2 Configuration -# -CONFIG_USART2_RXBUFSIZE=256 -CONFIG_USART2_TXBUFSIZE=256 -CONFIG_USART2_BAUD=115200 -CONFIG_USART2_BITS=8 -CONFIG_USART2_PARITY=0 -CONFIG_USART2_2STOP=0 -# CONFIG_USART2_IFLOWCONTROL is not set -# CONFIG_USART2_OFLOWCONTROL is not set -# CONFIG_USART2_DMA is not set # CONFIG_PSEUDOTERM is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -822,26 +942,157 @@ CONFIG_SYSLOG_CONSOLE=y # # File system configuration # -CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_AUTOMOUNTER is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_FS_READABLE is not set -# CONFIG_FS_WRITABLE is not set +CONFIG_FS_READABLE=y +CONFIG_FS_WRITABLE=y # CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set +CONFIG_FS_FAT=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FAT_MAXFNAME=32 +# CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set +# CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set +# CONFIG_FS_TMPFS is not set +# CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set # CONFIG_FS_PROCFS is not set # CONFIG_FS_UNIONFS is not set # # Graphics Support # -# CONFIG_NX is not set +CONFIG_NX=y +CONFIG_NX_LCDDRIVER=y +CONFIG_NX_NPLANES=1 +CONFIG_NX_BGCOLOR=0x0 +# CONFIG_NX_WRITEONLY is not set +# CONFIG_NX_UPDATE is not set + +# +# Supported Pixel Depths +# +CONFIG_NX_DISABLE_1BPP=y +CONFIG_NX_DISABLE_2BPP=y +CONFIG_NX_DISABLE_4BPP=y +CONFIG_NX_DISABLE_8BPP=y +# CONFIG_NX_DISABLE_16BPP is not set +CONFIG_NX_DISABLE_24BPP=y +CONFIG_NX_DISABLE_32BPP=y +CONFIG_NX_PACKEDMSFIRST=y + +# +# Input Devices +# +CONFIG_NX_XYINPUT=y +# CONFIG_NX_XYINPUT_NONE is not set +# CONFIG_NX_XYINPUT_MOUSE is not set +CONFIG_NX_XYINPUT_TOUCHSCREEN=y +CONFIG_NX_KBD=y + +# +# Framed Window Borders +# +CONFIG_NXTK_BORDERWIDTH=4 +# CONFIG_NXTK_DEFAULT_BORDERCOLORS is not set +CONFIG_NXTK_BORDERCOLOR1=0x5cb7 +CONFIG_NXTK_BORDERCOLOR2=0x21c9 +CONFIG_NXTK_BORDERCOLOR3=0xffdf +# CONFIG_NXTK_AUTORAISE is not set + +# +# Font Selections +# +CONFIG_NXFONTS_CHARBITS=7 +# CONFIG_NXFONT_MONO5X8 is not set +# CONFIG_NXFONT_SANS17X22 is not set +# CONFIG_NXFONT_SANS20X26 is not set +CONFIG_NXFONT_SANS23X27=y +# CONFIG_NXFONT_SANS22X29 is not set +# CONFIG_NXFONT_SANS28X37 is not set +# CONFIG_NXFONT_SANS39X48 is not set +# CONFIG_NXFONT_SANS17X23B is not set +# CONFIG_NXFONT_SANS20X27B is not set +CONFIG_NXFONT_SANS22X29B=y +# CONFIG_NXFONT_SANS28X37B is not set +# CONFIG_NXFONT_SANS40X49B is not set +# CONFIG_NXFONT_SERIF22X29 is not set +# CONFIG_NXFONT_SERIF29X37 is not set +# CONFIG_NXFONT_SERIF38X48 is not set +# CONFIG_NXFONT_SERIF22X28B is not set +# CONFIG_NXFONT_SERIF27X38B is not set +# CONFIG_NXFONT_SERIF38X49B is not set +# CONFIG_NXFONT_PIXEL_UNICODE is not set +# CONFIG_NXFONT_PIXEL_LCD_MACHINE is not set +# CONFIG_NXFONT_X11_MISC_FIXED_4X6 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_5X7 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_5X8 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X9 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X10 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X12 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X13 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X13B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_6X13O is not set +# CONFIG_NXFONT_X11_MISC_FIXED_7X13 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_7X13B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_7X13O is not set +# CONFIG_NXFONT_X11_MISC_FIXED_7X14 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_7X14B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_8X13 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_8X13B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_8X13O is not set +# CONFIG_NXFONT_X11_MISC_FIXED_9X15 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_9X15B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set +# CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set +# CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set +# CONFIG_NXFONT_TOM_THUMB_4X6 is not set +CONFIG_NXTERM=y + +# +# NxTerm Output Text/Graphics Options +# +CONFIG_NXTERM_BPP=16 +CONFIG_NXTERM_CURSORCHAR=95 +CONFIG_NXTERM_MXCHARS=325 +CONFIG_NXTERM_CACHESIZE=32 +CONFIG_NXTERM_LINESEPARATION=0 +# CONFIG_NXTERM_NOWRAP is not set + +# +# NxTerm Input options +# +CONFIG_NXTERM_NXKBDIN=y +CONFIG_NXTERM_KBDBUFSIZE=16 +CONFIG_NXTERM_NPOLLWAITERS=4 + +# +# NX Multi-user only options +# +CONFIG_NX_MULTIUSER=y +CONFIG_NX_BLOCKING=y +CONFIG_NX_MXSERVERMSGS=32 +CONFIG_NX_MXCLIENTMSGS=16 +# CONFIG_NXSTART_EXTERNINIT is not set +CONFIG_NXSTART_SERVERPRIO=110 +CONFIG_NXSTART_SERVERSTACK=2048 +CONFIG_NXSTART_DEVNO=0 # # Memory Management # # CONFIG_MM_SMALL is not set -CONFIG_MM_REGIONS=1 -# CONFIG_ARCH_HAVE_HEAP2 is not set +CONFIG_MM_REGIONS=3 +CONFIG_ARCH_HAVE_HEAP2=y +CONFIG_HEAP2_BASE=0xD0000000 +CONFIG_HEAP2_SIZE=8388608 # CONFIG_GRAN is not set # @@ -857,9 +1108,10 @@ CONFIG_MM_REGIONS=1 # Binary Loader # # CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set -# CONFIG_BUILTIN is not set +CONFIG_BUILTIN=y # CONFIG_PIC is not set # CONFIG_SYMTAB_ORDEREDBYNAME is not set @@ -873,6 +1125,7 @@ CONFIG_MM_REGIONS=1 CONFIG_STDIO_BUFFER_SIZE=64 CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set # CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set @@ -890,14 +1143,20 @@ CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_LIBC_TMPDIR="/tmp" +CONFIG_LIBC_MAX_TMPFILE=32 CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set # CONFIG_TIME_EXTENDED is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set CONFIG_ARCH_HAVE_TLS=y # CONFIG_TLS is not set +# CONFIG_LIBC_IPv4_ADDRCONV is not set +# CONFIG_LIBC_IPv6_ADDRCONV is not set # CONFIG_LIBC_NETDB is not set +# CONFIG_NETDB_HOSTFILE is not set # # Non-standard Library Support @@ -911,12 +1170,24 @@ CONFIG_ARCH_HAVE_TLS=y # Basic CXX Support # # CONFIG_C99_BOOL8 is not set -# CONFIG_HAVE_CXX is not set +CONFIG_HAVE_CXX=y +CONFIG_HAVE_CXXINITIALIZE=y +# CONFIG_CXX_NEWLONG is not set + +# +# uClibc++ Standard C++ Library +# +# CONFIG_UCLIBCXX is not set # # Application Configuration # +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + # # CAN Utilities # @@ -924,31 +1195,23 @@ CONFIG_ARCH_HAVE_TLS=y # # Examples # -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=7 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=2 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=7 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="WAKEUP" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="TAMPER" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="KEY" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="SELECT" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="DOWN" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="LEFT" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="RIGHT" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CXXTEST is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FSTEST is not set # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MEDIA is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set @@ -969,18 +1232,19 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WEBSERVER is not set @@ -989,6 +1253,7 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # File System Utilities # # CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set # # GPS Utilities @@ -1004,6 +1269,7 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # # Interpreters # +# CONFIG_INTERPRETERS_BAS is not set # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set # CONFIG_INTERPRETERS_MINIBASIC is not set @@ -1026,11 +1292,280 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # # NSH Library # -# CONFIG_NSH_LIBRARY is not set +CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set + +# +# Command Line Configuration +# +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=64 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_CMDPARMS=y +CONFIG_NSH_MAXARGUMENTS=6 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_ADDROUTE is not set +# CONFIG_NSH_DISABLE_BASENAME is not set +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set +CONFIG_NSH_DISABLE_DATE=y +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set +# CONFIG_NSH_DISABLE_DIRNAME is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +CONFIG_NSH_DISABLE_IFUPDOWN=y +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +CONFIG_NSH_DISABLE_LOSMART=y +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MV is not set +# CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNAME is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set +CONFIG_NSH_MMCSDMINOR=0 + +# +# Configure Command Options +# +CONFIG_NSH_CMDOPT_DF_H=y +# CONFIG_NSH_CMDOPT_DD_STATS is not set +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y +CONFIG_NSH_FILEIOSIZE=512 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +CONFIG_NSH_ARCHINIT=y +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM # +CONFIG_NXWIDGETS=y + +# +# NX Server/Device Configuration +# +CONFIG_NXWIDGETS_FLICKERFREE=y +# CONFIG_NXWIDGETS_EXTERNINIT is not set +CONFIG_NXWIDGET_SERVERINIT=y +CONFIG_NXWIDGETS_CLIENTPRIO=100 +CONFIG_NXWIDGETS_LISTENERPRIO=100 +CONFIG_NXWIDGETS_LISTENERSTACK=2048 +# CONFIG_NXWIDGET_EVENTWAIT is not set + +# +# NXWidget Configuration +# +CONFIG_NXWIDGETS_BPP=16 +# CONFIG_NXWIDGETS_GREYSCALE is not set +CONFIG_NXWIDGETS_SIZEOFCHAR=1 + +# +# NXWidget Default Values +# +# CONFIG_NXWIDGETS_SYSTEM_CUSTOM_FONTID is not set +CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE=16 +CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT=8 +CONFIG_NXWIDGETS_CUSTOM_FILLCOLORS=y +CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR=0x9dfb +CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR=0xd73e +CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR=0xc618 +CONFIG_NXWIDGETS_CUSTOM_EDGECOLORS=y +CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR=0xffdf +CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR=0x21e9 +# CONFIG_NXWIDGETS_CUSTOM_TEXTCOLORS is not set +CONFIG_NXWIDGETS_TRANSPARENT_COLOR=0x0 + +# +# Keypad behavior +# +CONFIG_NXWIDGETS_FIRST_REPEAT_TIME=500 +CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME=200 +CONFIG_NXWIDGETS_DOUBLECLICK_TIME=350 +CONFIG_NXWIDGETS_KBDBUFFER_SIZE=16 +CONFIG_NXWIDGETS_CURSORCONTROL_SIZE=4 +# CONFIG_NXWIDGET_MEMMONITOR is not set +CONFIG_NXWM=y + +# +# NxWM General Settings +# +# CONFIG_NXWM_LARGE_ICONS is not set +# CONFIG_NXWM_CUSTOM_FONTID is not set +CONFIG_NXWM_UNITTEST=y + +# +# Color configuration +# +# CONFIG_NXWM_CUSTOM_FILLCOLORS is not set +# CONFIG_NXWM_CUSTOM_EDGECOLORS is not set +# CONFIG_NXWM_CUSTOM_TEXTCOLORS is not set + +# +# Background Image +# +# CONFIG_NXWM_DISABLE_BACKGROUND_IMAGE is not set +CONFIG_NXWM_BACKGROUND_IMAGE="NXWidgets::g_nuttxBitmap160x160" + +# +# NxWM Taskbar Configuration +# + +# +# Horizontal and vertical spacing of icons in the task bar +# +CONFIG_NXWM_TASKBAR_VSPACING=4 +CONFIG_NXWM_TASKBAR_HSPACING=2 +# CONFIG_NXWM_TASKBAR_TOP is not set +# CONFIG_NXWM_TASKBAR_BOTTOM is not set +CONFIG_NXWM_TASKBAR_LEFT=y +# CONFIG_NXWM_TASKBAR_RIGHT is not set +# CONFIG_NXWM_CUSTOM_TASKBAR_WIDTH is not set +# CONFIG_NXWM_TASKBAR_ICONSCALE is not set +# CONFIG_NXWM_DISABLE_MINIMIZE is not set +# CONFIG_NXWM_TASKBAR_NO_BORDER is not set + +# +# NxWM Toolbar Configuration +# +# CONFIG_NXWM_CUSTOM_TOOLBAR_HEIGHT is not set +# CONFIG_NXWM_TOOLBAR_CUSTOM_FONTID is not set + +# +# NxWM Application Window Configuration +# +# CONFIG_NXWM_CUSTOM_APPWINDOW_ICONS is not set + +# +# NxWM Start Window Configuration +# + +# +# Horizontal and vertical spacing of icons in the task bar +# +CONFIG_NXWM_STARTWINDOW_VSPACING=4 +CONFIG_NXWM_STARTWINDOW_HSPACING=4 +# CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set +CONFIG_NXWM_STARTWINDOW_MQNAME="nxwm" +CONFIG_NXWM_STARTWINDOW_MXMSGS=32 +CONFIG_NXWM_STARTWINDOW_MXMPRIO=42 +CONFIG_NXWM_STARTWINDOW_PRIO=100 +CONFIG_NXWM_STARTWINDOW_STACKSIZE=2048 + +# +# NxTerm Window Settings +# +CONFIG_NXWM_NXTERM=y +CONFIG_NXWM_NXTERM_PRIO=100 +CONFIG_NXWM_NXTERM_STACKSIZE=2048 +# CONFIG_NXWM_NXTERM_CUSTOM_COLORS is not set +# CONFIG_NXWM_NXTERM_CUSTOM_FONTID is not set +# CONFIG_NXWM_CUSTOM_NXTERM_ICON is not set + +# +# NxWM Touchscreen Configuration +# +CONFIG_NXWM_TOUCHSCREEN=y + +# +# Touchscreen Device Settings +# +CONFIG_NXWM_TOUCHSCREEN_DEVINIT=y +CONFIG_NXWM_TOUCHSCREEN_DEVNO=0 +CONFIG_NXWM_TOUCHSCREEN_DEVPATH="/dev/input0" +CONFIG_NXWM_TOUCHSCREEN_SIGNO=5 +CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=120 +CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK=1596 + +# +# NxWM Keyboard Configuration +# +CONFIG_NXWM_KEYBOARD=y + +# +# Keyboard Device Settings +# +CONFIG_NXWM_KEYBOARD_DEVPATH="/dev/console" +# CONFIG_NXWM_KEYBOARD_USBHOST is not set +CONFIG_NXWM_KEYBOARD_SIGNO=6 +CONFIG_NXWM_KEYBOARD_BUFSIZE=16 +CONFIG_NXWM_KEYBOARD_LISTENERPRIO=120 +CONFIG_NXWM_KEYBOARD_LISTENERSTACK=2048 + +# +# NxWM Calibration Display Settings +# +CONFIG_NXWM_CALIBRATION_MARGIN=40 +# CONFIG_NXWM_CALIBRATION_CUSTOM_COLORS is not set +# CONFIG_NXWM_CALIBRATION_MESSAGES is not set +# CONFIG_NXWM_CALIBRATION_ANISOTROPIC is not set +# CONFIG_NXWM_CUSTOM_CALIBRATION_ICON is not set +CONFIG_NXWM_CALIBRATION_SIGNO=5 +CONFIG_NXWM_CALIBRATION_LISTENERPRIO=100 +CONFIG_NXWM_CALIBRATION_LISTENERSTACK=2048 + +# +# NxWM Hex Calculator Display Settings +# +# CONFIG_NXWM_HEXCALCULATOR_CUSTOM_COLORS is not set +# CONFIG_NXWM_CUSTOM_HEXCALCULATOR_ICON is not set +CONFIG_NXWM_HEXCALCULATOR_CUSTOM_FONTID=y +CONFIG_NXWM_HEXCALCULATOR_FONTID=5 + +# +# NxWM Media Player Display Settings +# # # Platform-specific Support @@ -1045,11 +1580,16 @@ CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="UP" # CONFIG_SYSTEM_FREE is not set # CONFIG_SYSTEM_HEX2BIN is not set # CONFIG_SYSTEM_HEXED is not set +# CONFIG_SYSTEM_I2CTOOL is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_RAMTEST is not set -# CONFIG_READLINE_HAVE_EXTMATCH is not set -# CONFIG_SYSTEM_READLINE is not set +CONFIG_READLINE_HAVE_EXTMATCH=y +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y +# CONFIG_READLINE_TABCOMPLETION is not set +# CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_SYSTEM is not set # CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set diff --git a/configs/freedom-kl26z/minnsh/setenv.sh b/configs/stm32f429i-disco/nxwm/setenv.sh old mode 100755 new mode 100644 similarity index 79% rename from configs/freedom-kl26z/minnsh/setenv.sh rename to configs/stm32f429i-disco/nxwm/setenv.sh index 755c02b4b6b8c3359c3dc706109574f92a543dcd..9e49945922dde8eedfc66525d0e497033c0bc44b --- a/configs/freedom-kl26z/minnsh/setenv.sh +++ b/configs/stm32f429i-disco/nxwm/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/freedom-kl26z/minnsh/setenv.sh +# configs/stm32f429i-disco/nxwm/setenv.sh # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -51,6 +51,7 @@ fi # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" #export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" # These are the Cygwin paths to the locations where I installed the Atollic @@ -61,9 +62,17 @@ fi #export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin" #export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin" +# This is the location where I installed the ARM "GNU Tools for ARM Embedded Processors" +# You can this free toolchain here https://launchpad.net/gcc-arm-embedded +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin" + +# This is the path to the location where I installed the devkitARM toolchain +# You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/ +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/devkitARM/bin" + # This is the Cygwin path to the location where I build the buildroot # toolchain. -export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" +#export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin" # Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" diff --git a/configs/stm32f429i-disco/src/Makefile b/configs/stm32f429i-disco/src/Makefile index aec191fdc2bb3f5aa63361c22c552664136f3434..9dcff952a2084189f89ef53bd1789c47ecd39234 100644 --- a/configs/stm32f429i-disco/src/Makefile +++ b/configs/stm32f429i-disco/src/Makefile @@ -64,6 +64,10 @@ ifeq ($(CONFIG_STM32_OTGHS),y) CSRCS += stm32_usb.c endif +ifeq ($(CONFIG_INPUT_STMPE811),y) +CSRCS += stm32_stmpe811.c +endif + ifeq ($(CONFIG_STM32F429I_DISCO_ILI9341),y) CSRCS += stm32_ili93414ws.c endif diff --git a/configs/stm32f429i-disco/src/stm32_boot.c b/configs/stm32f429i-disco/src/stm32_boot.c index 33f855a28ce2b6e7c057eeb0c292ae3b2039d3a6..fd4d7fb23f915402161bc4e8628e41bd72f9232a 100644 --- a/configs/stm32f429i-disco/src/stm32_boot.c +++ b/configs/stm32f429i-disco/src/stm32_boot.c @@ -52,9 +52,76 @@ * Pre-processor Definitions ************************************************************************************/ -/************************************************************************************ - * Private Functions - ************************************************************************************/ +/* Configuration ********************************************************************/ +/* Should we initialize the NX server using nx_start? This is done for NxWidgets + * (CONFIG_NXWIDGETS=y) and if the NxWidget::CNxServer class expects the RTOS do the + * the NX initialization (CONFIG_NXWIDGET_SERVERINIT=n). This combination of + * settings is normally only used in the kernel build mode* (CONFIG_BUILD_PROTECTED) + * when NxWidgets is unable to initialize NX from user-space. + */ + +#undef HAVE_NXSTART + +#if !defined(CONFIG_NX_MULTIUSER) +# undef CONFIG_NX_START +#endif + +#if defined(CONFIG_NXWIDGETS) && !defined(CONFIG_NXWIDGET_SERVERINIT) +# define HAVE_NXSTART +# include +#endif + +/* Should we initialize the touchscreen for the NxWM (CONFIG_NXWM=y)? This + * is done if we have a touchscreen (CONFIG_INPUT_STMPE811=y), NxWM uses the + * touchscreen (CONFIG_NXWM_TOUCHSCREEN=y), and if we were asked to + * initialize the touchscreen for NxWM (NXWM_TOUCHSCREEN_DEVINIT=n). This + * combination of settings is normally only used in the kernel build mode + * (CONFIG_BUILD_PROTECTED) when NxWidgets is unable to initialize NX from + * user-space. + */ + +#undef HAVE_TCINIT + +#if defined(CONFIG_NXWM_TOUCHSCREEN) +# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVNO) +# error CONFIG_NXWM_TOUCHSCREEN_DEVNO is not defined +# elif defined(CONFIG_INPUT_STMPE811) +# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT) +# define HAVE_TCINIT +# include +# endif +# else +# if !defined(CONFIG_NXWM_TOUCHSCREEN_DEVINIT) && defined(CONFIG_BUILD_PROTECTED) +# error CONFIG_INPUT_STMPE811=y is needed +# endif +# endif +#endif + +/* Check if we will need to support the initialization kernel thread */ + +#undef HAVE_INITTHREAD + +#ifdef CONFIG_BOARD_INITIALIZE +# if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) +# define HAVE_INITTHREAD 1 +# elif defined(HAVE_NXSTART) +# define HAVE_INITTHREAD 1 +# elif defined(HAVE_TCINIT) +# define HAVE_INITTHREAD 1 +# endif +#endif + +#ifdef HAVE_INITTHREAD +# include +# include +# include +# ifndef CONFIG_STM32F429I_DISCO_BOARDINIT_PRIO +# define CONFIG_STM32F429I_DISCO_BOARDINIT_PRIO 196 +# endif +# ifndef CONFIG_STM32F429I_DISCO_BOARDINIT_STACK +# define CONFIG_STM32F429I_DISCO_BOARDINIT_STACK 2048 +# endif +#endif /************************************************************************************ * Public Functions @@ -131,6 +198,17 @@ void stm32_boardinitialize(void) #ifdef CONFIG_BOARD_INITIALIZE void board_initialize(void) { +#ifdef HAVE_INITTHREAD + pid_t server; + + /* Start the board initialization kernel thread */ + + server = kernel_thread("Board Init", CONFIG_STM32F429I_DISCO_BOARDINIT_PRIO, + CONFIG_STM32F429I_DISCO_BOARDINIT_STACK, board_initthread, + NULL); + ASSERT(server > 0); +#endif + #ifdef CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE /* Initialize the framebuffer driver */ diff --git a/configs/stm32f429i-disco/src/stm32_ili93414ws.c b/configs/stm32f429i-disco/src/stm32_ili93414ws.c index 04a24411f63b194673cf8c58a37595492f195105..7948c035957eb1ea305293c267ec2d3ff48e7d40 100644 --- a/configs/stm32f429i-disco/src/stm32_ili93414ws.c +++ b/configs/stm32f429i-disco/src/stm32_ili93414ws.c @@ -157,8 +157,7 @@ struct ili93414ws_lcd_s #endif #ifndef CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16 - /* - * Marks current display operation mode (gram or command/parameter) + /* Marks current display operation mode (gram or command/parameter) * If 16-bit spi mode is enabled for pixel data operation, the flag is not * neccessary. The pixel data operation mode can then be recognized by the * DFF flag in the cr1 register. @@ -168,39 +167,38 @@ struct ili93414ws_lcd_s #endif }; - /**************************************************************************** * Private Function Protototypes ****************************************************************************/ /* Low-level spi transfer */ -static void stm32_ili93414ws_modifyreg( - uint32_t reg, uint16_t setbits, uint16_t clrbits); -static inline void stm32_ili93414ws_modifycr1( - uint16_t setbits, uint16_t clrbits); -static inline void stm32_ili93414ws_modifycr2( - uint16_t setbits, uint16_t clrbits); +static void stm32_ili93414ws_modifyreg(uint32_t reg, uint16_t setbits, + uint16_t clrbits); +static inline void stm32_ili93414ws_modifycr1(uint16_t setbits, + uint16_t clrbits); +static inline void stm32_ili93414ws_modifycr2(uint16_t setbits, + uint16_t clrbits); static void stm32_ili93414ws_spisendmode(void); static void stm32_ili93414ws_spirecvmode(void); static void stm32_ili93414ws_spienable(void); static void stm32_ili93414ws_spidisable(void); static inline void stm32_ili93414ws_set8bitmode( - FAR struct ili93414ws_lcd_s *dev); + FAR struct ili93414ws_lcd_s *dev); static inline void stm32_ili93414ws_set16bitmode( - FAR struct ili93414ws_lcd_s *dev); + FAR struct ili93414ws_lcd_s *dev); /* Command and data transmission control */ static void stm32_ili93414ws_sndword(uint16_t wd); static int stm32_ili93414ws_sendblock(FAR struct ili93414ws_lcd_s *lcd, - const uint16_t *wd, uint16_t nwords); + const uint16_t *wd, uint16_t nwords); static uint16_t stm32_ili93414ws_recvword(void); static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, - uint16_t *wd, uint16_t nwords); + uint16_t *wd, uint16_t nwords); static inline void stm32_ili93414ws_cmddata( - FAR struct ili9341_lcd_s *lcd, bool cmd); + FAR struct ili9341_lcd_s *lcd, bool cmd); /* Initializing / Configuration */ @@ -232,17 +230,17 @@ struct ili93414ws_lcd_s g_lcddev; * ****************************************************************************/ -static void stm32_ili93414ws_modifyreg( - uint32_t reg, uint16_t setbits, uint16_t clrbits) +static void stm32_ili93414ws_modifyreg(uint32_t reg, uint16_t setbits, + uint16_t clrbits) { uint16_t regval; - regval = getreg16(reg); + + regval = getreg16(reg); regval &= ~clrbits; regval |= setbits; putreg16(regval, reg); } - /**************************************************************************** * Name: stm32_ili93414ws_modifycr1 * @@ -254,10 +252,12 @@ static void stm32_ili93414ws_modifyreg( * setbits - The bits to set * * Returned Value: + * None * ****************************************************************************/ -static inline void stm32_ili93414ws_modifycr1(uint16_t setbits, uint16_t clrbits) +static inline void stm32_ili93414ws_modifycr1(uint16_t setbits, + uint16_t clrbits) { stm32_ili93414ws_modifyreg(ILI93414WS_SPI_CR1, setbits, clrbits); } @@ -273,15 +273,16 @@ static inline void stm32_ili93414ws_modifycr1(uint16_t setbits, uint16_t clrbits * setbits - The bits to set * * Returned Value: + * None * ****************************************************************************/ -static inline void stm32_ili93414ws_modifycr2(uint16_t setbits, uint16_t clrbits) +static inline void stm32_ili93414ws_modifycr2(uint16_t setbits, + uint16_t clrbits) { stm32_ili93414ws_modifyreg(ILI93414WS_SPI_CR2, setbits, clrbits); } - /**************************************************************************** * Name: stm32_ili93414ws_spirecvmode * @@ -304,15 +305,13 @@ static void stm32_ili93414ws_spirecvmode(void) stm32_ili93414ws_spidisable(); - /* - * Clear the rx buffer if received data exist e.g. from previous + /* Clear the rx buffer if received data exist e.g. from previous * broken transfer. */ (void)getreg16(ILI93414WS_SPI_DR); } - /**************************************************************************** * Name: stm32_ili93414ws_spisendmode * @@ -320,8 +319,10 @@ static void stm32_ili93414ws_spirecvmode(void) * Sets the spi device to the bidirectional transmit mode * * Input Parameters: + * None * * Returned Value: + * None * ****************************************************************************/ @@ -336,7 +337,6 @@ static void stm32_ili93414ws_spisendmode(void) stm32_ili93414ws_spienable(); } - /**************************************************************************** * Name: stm32_ili93414ws_spienable * @@ -344,8 +344,10 @@ static void stm32_ili93414ws_spisendmode(void) * Enable the spi device * * Input Parameters: + * None * * Returned Value: + * None * ****************************************************************************/ @@ -358,7 +360,6 @@ static void stm32_ili93414ws_spienable(void) putreg16(regval, ILI93414WS_SPI_CR1); } - /**************************************************************************** * Name: stm32_ili93414ws_spidisable * @@ -366,8 +367,10 @@ static void stm32_ili93414ws_spienable(void) * Disable the spi device * * Input Parameters: + * None * * Returned Value: + * None * ****************************************************************************/ @@ -380,7 +383,6 @@ static void stm32_ili93414ws_spidisable(void) putreg16(regval, ILI93414WS_SPI_CR1); } - /**************************************************************************** * Name: stm32_ili93414ws_sndword * @@ -391,6 +393,7 @@ static void stm32_ili93414ws_spidisable(void) * wd - word to send * * Returned Value: + * None * ****************************************************************************/ @@ -422,13 +425,14 @@ static void stm32_ili93414ws_sndword(uint16_t wd) ****************************************************************************/ static int stm32_ili93414ws_sendblock(FAR struct ili93414ws_lcd_s *lcd, - const uint16_t *wd, uint16_t nwords) + const uint16_t *wd, uint16_t nwords) { /* Set to bidirectional transmit mode and enable spi */ stm32_ili93414ws_spisendmode(); /* Check if 16-bit spi mode is configured for transmit */ + #ifdef CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16 if ((getreg16(ILI93414WS_SPI_CR1) & SPI_CR1_DFF) != 0) { @@ -444,10 +448,10 @@ static int stm32_ili93414ws_sendblock(FAR struct ili93414ws_lcd_s *lcd, } } #else - /* - * 8-bit spi mode is enabled for pixel data operations. + /* 8-bit spi mode is enabled for pixel data operations. * Each pixel must be transmitted by two write operations. */ + if (lcd->gmode == 16) { /* 8-bit spi mode */ @@ -478,8 +482,7 @@ static int stm32_ili93414ws_sendblock(FAR struct ili93414ws_lcd_s *lcd, } - /* - * Wait until transmit is not busy after the last word is transmitted, marked + /* Wait until transmit is not busy after the last word is transmitted, marked * by the BSY flag in the cr1 register. This is neccessary if entering in halt * mode or disable the spi periphery. */ @@ -500,6 +503,7 @@ static int stm32_ili93414ws_sendblock(FAR struct ili93414ws_lcd_s *lcd, * Receive a word from the lcd driver. * * Input Parameters: + * None * * Returned Value: * On success - The received word from the LCD Single Chip Driver. @@ -513,8 +517,7 @@ static uint16_t stm32_ili93414ws_recvword(void) uint16_t regval; irqstate_t flags; - /* - * Disable interrupts during time critical spi sequence. + /* Disable interrupts during time critical spi sequence. * In bidrectional receive mode the data transfer can only be stopped by * disabling the spi device. This is here done by disabling the spi device * immediately after enabling it. If the pixel data stream is interrupted @@ -533,8 +536,7 @@ static uint16_t stm32_ili93414ws_recvword(void) regval = getreg16(ILI93414WS_SPI_CR1); - /* - * Enable spi device followed by disable the spi device. + /* Enable spi device followed by disable the spi device. * * Ensure that the spi is disabled within 8 or 16 spi clock cycles depending * on the configured spi bit mode. This is neccessary to prevent that the next @@ -557,8 +559,7 @@ static uint16_t stm32_ili93414ws_recvword(void) leave_critical_section(flags); - /* - * Waits until the RX buffer is filled with the received data word signalized + /* Waits until the RX buffer is filled with the received data word signalized * by the spi hardware through the RXNE flag. * A busy loop is preferred against interrupt driven receiving method here * because this happend fairly often. Also we have to ensure to avoid a big @@ -581,7 +582,6 @@ static uint16_t stm32_ili93414ws_recvword(void) return 0; } - /**************************************************************************** * Name: stm32_ili93414ws_recvblock * @@ -602,8 +602,7 @@ static uint16_t stm32_ili93414ws_recvword(void) static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, uint16_t *wd, uint16_t nwords) { - /* - * ili9341 uses a 18-bit pixel format packed in a 24-bit stream per pixel. + /* ili9341 uses a 18-bit pixel format packed in a 24-bit stream per pixel. * The following format is transmitted: RRRRRR00 GGGGGG00 BBBBBB00 * Convert it to: RRRRRGGG GGGBBBBB */ @@ -644,8 +643,7 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, --nwords; } - /* - * Receive + /* Receive * if nwords even and greater than 2: pixel 2 to n-1 * if nwords odd and greater than 2: pixel 2 to n */ @@ -653,9 +651,11 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, while (nwords--) { /* RRRRRR00 GGGGGG00 */ + w1 = stm32_ili93414ws_recvword(); /* BBBBBB00 RRRRRR00 */ + w2 = stm32_ili93414ws_recvword(); *dest++ = ((w1 & 0xf800) | ((w1 << 3) & 0x7e0) | (w2 >> 11)); @@ -666,6 +666,7 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, } /* GGGGGG00 BBBBBB00 */ + w1 = stm32_ili93414ws_recvword(); *dest++ = (((w1 >> 5) & 0x7e0) | @@ -676,16 +677,18 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, } } #else - /* - * 8-bit spi mode is enabled for pixel data operations. + /* 8-bit spi mode is enabled for pixel data operations. * Each pixel must be received by three read operations. */ + if (lcd->gmode == 16) { /* 8-bit spi mode but 16-bit mode is done by two 8-bit transmits */ + uint16_t *dest = wd; /* Dummy read to discard the first 8 bit. */ + (void)stm32_ili93414ws_recvword(); while (nwords--) @@ -715,7 +718,6 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, return OK; } - /**************************************************************************** * Name: stm32_ili93414ws_set8bitmode * @@ -726,6 +728,7 @@ static int stm32_ili93414ws_recvblock(FAR struct ili93414ws_lcd_s *lcd, * dev - Reference to the private driver structure * * Returned Value: + * None * ****************************************************************************/ @@ -738,7 +741,6 @@ static inline void stm32_ili93414ws_set8bitmode( #endif } - #ifdef CONFIG_STM32F429I_DISCO_ILI9341_SPIBITS16 /**************************************************************************** * Name: stm32_ili93414ws_set16bitmode @@ -750,6 +752,7 @@ static inline void stm32_ili93414ws_set8bitmode( * dev - Reference to the private driver structure * * Returned Value: + * None * ****************************************************************************/ @@ -767,7 +770,6 @@ static inline void stm32_ili93414ws_set16bitmode( } #endif - /**************************************************************************** * Name: stm32_ili93414ws_spiconfig * @@ -778,6 +780,7 @@ static inline void stm32_ili93414ws_set16bitmode( * lcd - Reference to the private driver structure * * Returned Value: + * None * ****************************************************************************/ @@ -819,8 +822,7 @@ static void stm32_ili93414ws_spiconfig(FAR struct ili9341_lcd_s *lcd) priv->cr1 = getreg16(ILI93414WS_SPI_CR1); #endif - /* - * Set spi device to bidirectional half duplex + /* Set spi device to bidirectional half duplex * Configure to master with 8-bit data format and SPIDEV_MODE0 */ @@ -887,7 +889,6 @@ static int stm32_ili93414ws_backlight(FAR struct ili9341_lcd_s *lcd, int level) return OK; } - /**************************************************************************** * Name: stm32_ili93414ws_select * @@ -906,8 +907,7 @@ static void stm32_ili93414ws_select(FAR struct ili9341_lcd_s *lcd) { FAR struct ili93414ws_lcd_s *priv = (FAR struct ili93414ws_lcd_s *)lcd; - /* - * Select ili9341 (locking the SPI bus in case there are multiple + /* Select ili9341 (locking the SPI bus in case there are multiple * devices competing for the SPI bus */ @@ -921,7 +921,7 @@ static void stm32_ili93414ws_select(FAR struct ili9341_lcd_s *lcd) #else static void stm32_ili93414ws_select(FAR struct ili9341_lcd_s *lcd) { - /* we own the spi bus, so just select the chip */ + /* We own the spi bus, so just select the chip */ (void)stm32_gpiowrite(GPIO_CS_LCD, false); @@ -952,8 +952,7 @@ static void stm32_ili93414ws_deselect(FAR struct ili9341_lcd_s *lcd) flags = enter_critical_section(); - /* - * Restore cr1 and cr2 register to be sure they will be usable + /* Restore cr1 and cr2 register to be sure they will be usable * by default spi interface structure. (This is an important workarround as * long as half duplex mode is not supported by the spi interface in * arch/arm/src/stm32/stm32_spi.c). @@ -962,8 +961,7 @@ static void stm32_ili93414ws_deselect(FAR struct ili9341_lcd_s *lcd) putreg16(priv->cr2, ILI93414WS_SPI_CR2); putreg16(priv->cr1, ILI93414WS_SPI_CR1); - /* - * Enable spi device is default for initialized spi ports (see + /* Enable spi device is default for initialized spi ports (see * arch/arm/src/stm32/stm32_spi.c). */ @@ -983,7 +981,6 @@ static void stm32_ili93414ws_deselect(FAR struct ili9341_lcd_s *lcd) } #endif - /**************************************************************************** * Name: stm32_ili93414ws_sndcmd * @@ -1018,7 +1015,6 @@ static int stm32_ili93414ws_sendcmd( return ret; } - /**************************************************************************** * Name: stm32_ili93414ws_sendparam * @@ -1048,7 +1044,6 @@ static int stm32_ili93414ws_sendparam(FAR struct ili9341_lcd_s *lcd, return stm32_ili93414ws_sendblock(priv, &bw, 1); } - /**************************************************************************** * Name: stm32_ili93414ws_sendgram * @@ -1079,7 +1074,6 @@ static int stm32_ili93414ws_sendgram(FAR struct ili9341_lcd_s *lcd, return stm32_ili93414ws_sendblock(priv, wd, nwords); }; - /**************************************************************************** * Name: stm32_ili93414ws_recvparam * @@ -1110,7 +1104,6 @@ static int stm32_ili93414ws_recvparam(FAR struct ili9341_lcd_s *lcd, return stm32_ili93414ws_recvblock(priv, (uint16_t*)param, 1); } - /**************************************************************************** * Name: stm32_ili93414ws_recvgram * @@ -1141,7 +1134,6 @@ static int stm32_ili93414ws_recvgram(FAR struct ili9341_lcd_s *lcd, return stm32_ili93414ws_recvblock(priv, wd, nwords); }; - /**************************************************************************** * Name: stm32_ili93414ws_initialize * diff --git a/configs/stm32f429i-disco/src/stm32_lcd.c b/configs/stm32f429i-disco/src/stm32_lcd.c index 7aa094e57a3090c65742c7c22111c0a53289d8b6..581216274bc1b936779074594acdf18e83e1e24f 100644 --- a/configs/stm32f429i-disco/src/stm32_lcd.c +++ b/configs/stm32f429i-disco/src/stm32_lcd.c @@ -170,8 +170,7 @@ ILI9341_MADCTL_LANDSCAPE_BGR | \ ILI9341_MADCTL_LANDSCAPE_MH) -/* - * Portrait: 00000000 / 00001000 / h08 +/* Portrait: 00000000 / 00001000 / h08 * * MY: 0 * MX: 0 @@ -199,8 +198,7 @@ ILI9341_MADCTL_PORTRAIT_BGR | \ ILI9341_MADCTL_PORTRAIT_MH) -/* - * RLandscape: 01100000 / 01101000 / h68 +/* RLandscape: 01100000 / 01101000 / h68 * * MY: 0 * MX: 1 @@ -229,8 +227,7 @@ ILI9341_MADCTL_RLANDSCAPE_BGR | \ ILI9341_MADCTL_RLANDSCAPE_MH) -/* - * RPortrait: 11000000 / 11001000 / hc8 +/* RPortrait: 11000000 / 11001000 / hc8 * * MY: 1 * MX: 1 @@ -463,7 +460,6 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) return NULL; } - /************************************************************************************ * Name: board_lcd_initialize * @@ -494,8 +490,7 @@ int board_lcd_initialize(void) if (dev) { - /* - * Get a reference to valid lcd driver structure to avoid repeated + /* Get a reference to valid lcd driver structure to avoid repeated * initialization of the LCD Device. Also enables uninitializing of * the LCD Device. */ diff --git a/configs/stm32f429i-disco/src/stm32_stmpe811.c b/configs/stm32f429i-disco/src/stm32_stmpe811.c new file mode 100644 index 0000000000000000000000000000000000000000..4e678cef0e8977da56fab5739aea735245a90455 --- /dev/null +++ b/configs/stm32f429i-disco/src/stm32_stmpe811.c @@ -0,0 +1,357 @@ +/************************************************************************************ + * configs/stm32f429i-disco/src/stm32_stmpe811.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "stm32.h" +#include "stm32f429i-disco.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifdef CONFIG_INPUT_STMPE811 +#ifndef CONFIG_INPUT +# error "STMPE811 support requires CONFIG_INPUT" +#endif + +#ifndef CONFIG_STM32_I2C3 +# error "STMPE811 support requires CONFIG_STM32_I2C3" +#endif + +#ifndef CONFIG_STMPE811_I2C +# error "Only the STMPE811 I2C interface is supported" +#endif + +#ifdef CONFIG_STMPE811_SPI +# error "Only the STMPE811 SPI interface is supported" +#endif + +#ifndef CONFIG_STMPE811_FREQUENCY +# define CONFIG_STMPE811_FREQUENCY 100000 +#endif + +#ifndef CONFIG_STMPE811_I2CDEV +# define CONFIG_STMPE811_I2CDEV 3 +#endif + +#if CONFIG_STMPE811_I2CDEV != 3 +# error "CONFIG_STMPE811_I2CDEV must be three" +#endif + +#ifndef CONFIG_STMPE811_DEVMINOR +# define CONFIG_STMPE811_DEVMINOR 0 +#endif + +/* Board definitions ********************************************************/ +/* The STM3240G-EVAL has two STMPE811QTR I/O expanders on board both connected + * to the STM32 via I2C1. They share a common interrupt line: PI2. + * + * STMPE811 U24, I2C address 0x41 (7-bit) + * ------ ---- ---------------- -------------------------------------------- + * STPE11 PIN BOARD SIGNAL BOARD CONNECTION + * ------ ---- ---------------- -------------------------------------------- + * Y- TouchScreen_Y- LCD Connector XL + * X- TouchScreen_X- LCD Connector XR + * Y+ TouchScreen_Y+ LCD Connector XD + * X+ TouchScreen_X+ LCD Connector XU + * IN3 EXP_IO9 + * IN2 EXP_IO10 + * IN1 EXP_IO11 + * IN0 EXP_IO12 + * + * STMPE811 U29, I2C address 0x44 (7-bit) + * ------ ---- ---------------- -------------------------------------------- + * STPE11 PIN BOARD SIGNAL BOARD CONNECTION + * ------ ---- ---------------- -------------------------------------------- + * Y- EXP_IO1 + * X- EXP_IO2 + * Y+ EXP_IO3 + * X+ EXP_IO4 + * IN3 EXP_IO5 + * IN2 EXP_IO6 + * IN1 EXP_IO7 + * IN0 EXP_IO8 + */ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct stm32_stmpe811config_s +{ + /* Configuration structure as seen by the STMPE811 driver */ + + struct stmpe811_config_s config; + + /* Additional private definitions only known to this driver */ + + STMPE811_HANDLE handle; /* The STMPE811 driver handle */ + xcpt_t handler; /* The STMPE811 interrupt handler */ +}; + +/**************************************************************************** + * Static Function Prototypes + ****************************************************************************/ + +/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks + * to isolate the STMPE811 driver from differences in GPIO + * interrupt handling by varying boards and MCUs.* so that contact and loss- + * of-contact events can be detected. + * + * attach - Attach the STMPE811 interrupt handler to the GPIO interrupt + * enable - Enable or disable the GPIO interrupt + * clear - Acknowledge/clear any pending GPIO interrupt + */ + +static int stmpe811_attach(FAR struct stmpe811_config_s *state, xcpt_t isr); +static void stmpe811_enable(FAR struct stmpe811_config_s *state, bool enable); +static void stmpe811_clear(FAR struct stmpe811_config_s *state); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* A reference to a structure of this type must be passed to the STMPE811 + * driver. This structure provides information about the configuration + * of the STMPE811 and provides some board-specific hooks. + * + * Memory for this structure is provided by the caller. It is not copied + * by the driver and is presumed to persist while the driver is active. The + * memory must be writable because, under certain circumstances, the driver + * may modify frequency or X plate resistance values. + */ + +#ifndef CONFIG_STMPE811_TSC_DISABLE +static struct stm32_stmpe811config_s g_stmpe811config = +{ + .config = + { +#ifdef CONFIG_STMPE811_I2C + .address = STMPE811_ADDR1, +#endif + .frequency = CONFIG_STMPE811_FREQUENCY, + +#ifdef CONFIG_STMPE811_MULTIPLE + .irq = STM32_IRQ_EXTI2, +#endif + .ctrl1 = (ADC_CTRL1_SAMPLE_TIME_80 | ADC_CTRL1_MOD_12B), + .ctrl2 = ADC_CTRL2_ADC_FREQ_3p25, + + .attach = stmpe811_attach, + .enable = stmpe811_enable, + .clear = stmpe811_clear, + }, + .handler = NULL, +}; +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/* IRQ/GPIO access callbacks. These operations all hidden behind + * callbacks to isolate the STMPE811 driver from differences in GPIO + * interrupt handling by varying boards and MCUs. + * + * attach - Attach the STMPE811 interrupt handler to the GPIO interrupt + * enable - Enable or disable the GPIO interrupt + * clear - Acknowledge/clear any pending GPIO interrupt + */ + +static int stmpe811_attach(FAR struct stmpe811_config_s *state, xcpt_t isr) +{ + FAR struct stm32_stmpe811config_s *priv = + (FAR struct stm32_stmpe811config_s *)state; + + iinfo("Saving handler %p\n", isr); + DEBUGASSERT(priv); + + /* Just save the handler. We will use it when EXTI interruptsare enabled */ + + priv->handler = isr; + return OK; +} + +static void stmpe811_enable(FAR struct stmpe811_config_s *state, bool enable) +{ + FAR struct stm32_stmpe811config_s *priv = + (FAR struct stm32_stmpe811config_s *)state; + irqstate_t flags; + + /* Attach and enable, or detach and disable. Enabling and disabling GPIO + * interrupts is a multi-step process so the safest thing is to keep + * interrupts disabled during the reconfiguration. + */ + + flags = enter_critical_section(); + if (enable) + { + /* Configure the EXTI interrupt using the SAVED handler */ + + (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, true, true, true, + priv->handler); + } + else + { + /* Configure the EXTI interrupt with a NULL handler to disable it */ + + (void)stm32_gpiosetevent(GPIO_IO_EXPANDER, false, false, false, NULL); + } + leave_critical_section(flags); +} + +static void stmpe811_clear(FAR struct stmpe811_config_s *state) +{ + /* Does nothing */ +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_tsc_setup + * + * Description: + * Each board that supports a touchscreen device must provide this function. + * This function is called by application-specific, setup logic to + * configure the touchscreen device. This function will register the driver + * as /dev/inputN where N is the minor device number. + * + * Input Parameters: + * minor - The input device minor number + * + * Returned Value: + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. + * + ****************************************************************************/ + +int board_tsc_setup(int minor) +{ +#ifndef CONFIG_STMPE811_TSC_DISABLE + FAR struct i2c_master_s *dev; + int ret; + + iinfo("minor %d\n", minor); + DEBUGASSERT(minor == 0); + + /* Check if we are already initialized */ + + if (!g_stmpe811config.handle) + { + iinfo("Initializing\n"); + + /* Configure the STMPE811 interrupt pin as an input */ + + (void)stm32_configgpio(GPIO_IO_EXPANDER); + + /* Get an instance of the I2C interface */ + + dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV); + if (!dev) + { + ierr("ERROR: Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); + return -ENODEV; + } + + /* Instantiate the STMPE811 driver */ + + g_stmpe811config.handle = + stmpe811_instantiate(dev, (FAR struct stmpe811_config_s *)&g_stmpe811config); + if (!g_stmpe811config.handle) + { + ierr("ERROR: Failed to instantiate the STMPE811 driver\n"); + return -ENODEV; + } + + /* Initialize and register the I2C touchscreen device */ + + ret = stmpe811_register(g_stmpe811config.handle, CONFIG_STMPE811_DEVMINOR); + if (ret < 0) + { + ierr("ERROR: Failed to register STMPE driver: %d\n", ret); + /* stm32_i2cbus_uninitialize(dev); */ + return -ENODEV; + } + } + + return OK; +#else + return -ENOSYS; +#endif +} + +/**************************************************************************** + * Name: board_tsc_teardown + * + * Description: + * Each board that supports a touchscreen device must provide this function. + * This function is called by application-specific, setup logic to + * uninitialize the touchscreen device. + * + * Input Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void board_tsc_teardown(void) +{ + /* No support for un-initializing the touchscreen STMPE811 device yet */ +} + +#endif /* CONFIG_INPUT_STMPE811 */ + diff --git a/configs/stm32f429i-disco/src/stm32f429i-disco.h b/configs/stm32f429i-disco/src/stm32f429i-disco.h index 789929facd7c14ae14e7c175874d925b5076763a..1b309a720065f6cb4c263932165467bc474795ad 100644 --- a/configs/stm32f429i-disco/src/stm32f429i-disco.h +++ b/configs/stm32f429i-disco/src/stm32f429i-disco.h @@ -66,6 +66,16 @@ # undef CONFIG_STM32_SPI3 #endif +/* STMPE811 on I2C3 */ + +//#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 +//#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 + +#define STMPE811_ADDR1 0x41 +#define STMPE811_ADDR2 0x44 + +#define GPIO_IO_EXPANDER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTA|GPIO_PIN15) + /* STM32F429 Discovery GPIOs **************************************************************************/ /* LEDs */ diff --git a/configs/stm32f429i-disco/usbmsc/defconfig b/configs/stm32f429i-disco/usbmsc/defconfig index 00cdfd52363aa5a6ccd69a542ff8b4b9fe7f1d97..8f1fbb558356d57ac1ce758157463468ffab92c9 100644 --- a/configs/stm32f429i-disco/usbmsc/defconfig +++ b/configs/stm32f429i-disco/usbmsc/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -589,8 +587,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -779,7 +775,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1047,7 +1042,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f429i-disco/usbnsh/defconfig b/configs/stm32f429i-disco/usbnsh/defconfig index f350e42aafbc6a985806217b9565e94ccbb5ebbf..99cfa1b9851a6c8b7195c4ab66ac8f42bd823f61 100644 --- a/configs/stm32f429i-disco/usbnsh/defconfig +++ b/configs/stm32f429i-disco/usbnsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -580,8 +578,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -765,7 +761,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1063,7 +1058,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/Kconfig b/configs/stm32f4discovery/Kconfig index 3c84095efce3569d7168682b35d1970db9720e6d..9703364210eef05360376262b4ec78e53e2c7893 100644 --- a/configs/stm32f4discovery/Kconfig +++ b/configs/stm32f4discovery/Kconfig @@ -22,6 +22,11 @@ config STM32F4DISCO_USBHOST_PRIO default 100 depends on USBHOST +config STM32F4DISCO_QETIMER + int "Timer to use with QE encoder" + default 3 + depends on QENCODER + config PM_BUTTONS bool "PM button support" default n diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index 2b1bb2501fa2eb8afec9661e471c3718c84510dc..aaa37fe7f7e8c22cec2881826880bcc8f7f221b4 100644 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -456,6 +456,8 @@ pins PA15 and PA1 for CH1 and CH2, respectively). If TIM8 is selected, then PC6 and PI5 will be used for CH1 and CH2 (see include board.h for pin definitions). +Selected via CONFIG_STM32F4DISCO_QETIMER + FPU === diff --git a/configs/stm32f4discovery/canard/defconfig b/configs/stm32f4discovery/canard/defconfig index 327fc9c8188320afaa63e1d9e5c3986c65fd4220..606f95268c0f6f15697af11225c78271f49a4809 100644 --- a/configs/stm32f4discovery/canard/defconfig +++ b/configs/stm32f4discovery/canard/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -590,9 +588,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set -CONFIG_BOARDCTL_CANINIT=y # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -782,7 +777,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1051,7 +1045,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/cxxtest/defconfig b/configs/stm32f4discovery/cxxtest/defconfig index 55b87040f96a51e39db738ab9557299f53ccb5ee..47aa9ad47122b91d824c70425a4ad370b16d457b 100644 --- a/configs/stm32f4discovery/cxxtest/defconfig +++ b/configs/stm32f4discovery/cxxtest/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -748,7 +746,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -982,7 +979,6 @@ CONFIG_EXAMPLES_CXXTEST_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/elf/defconfig b/configs/stm32f4discovery/elf/defconfig index a072d09e953244f84a512fe7676e1c842ff10cf0..a7acd953157aab2bd68d11c291027d20b8e38a38 100644 --- a/configs/stm32f4discovery/elf/defconfig +++ b/configs/stm32f4discovery/elf/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -748,7 +746,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -996,7 +993,6 @@ CONFIG_EXAMPLES_ELF_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/stm32f4discovery/ipv6/defconfig b/configs/stm32f4discovery/ipv6/defconfig index 3b0130947773251e1ba166e55483d7f36ce3989e..964ec83c8417d632bb62cee7f98a3368f9ced90b 100644 --- a/configs/stm32f4discovery/ipv6/defconfig +++ b/configs/stm32f4discovery/ipv6/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -627,8 +625,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -844,10 +840,9 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -871,7 +866,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -948,13 +942,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1216,7 +1208,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1256,7 +1247,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/kostest/defconfig b/configs/stm32f4discovery/kostest/defconfig index c5cdb7b619c851971dbb4a1afad2b016744f59ac..e48549911fc6cb5ef497f68294f0c7b32595d3c9 100644 --- a/configs/stm32f4discovery/kostest/defconfig +++ b/configs/stm32f4discovery/kostest/defconfig @@ -70,7 +70,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -83,7 +82,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -756,7 +754,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -983,7 +980,6 @@ CONFIG_EXAMPLES_OSTEST_WAITRESULT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/netnsh/defconfig b/configs/stm32f4discovery/netnsh/defconfig index 2960a94caf4e158889275430325ce574f3621ca8..7798def2d6dc2ca9589904a6f7c1188d9606007b 100644 --- a/configs/stm32f4discovery/netnsh/defconfig +++ b/configs/stm32f4discovery/netnsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -627,8 +625,6 @@ CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_RESET=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -846,10 +842,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -873,7 +868,6 @@ CONFIG_ETH0_PHY_LAN8720=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -950,13 +944,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1227,7 +1219,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -1267,7 +1258,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/nsh/defconfig b/configs/stm32f4discovery/nsh/defconfig index e5efd97735075202a0122385a71f1aa577e0fb3f..ad989a03844458a3445aa356cbae472116ff8fea 100644 --- a/configs/stm32f4discovery/nsh/defconfig +++ b/configs/stm32f4discovery/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -766,7 +764,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1022,7 +1019,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/nxlines/defconfig b/configs/stm32f4discovery/nxlines/defconfig index 91cc0a7bfefc336bb34d737f40038392d35e3e08..3ea55af740d9c5e14dc3ab8290a675eb203742f9 100644 --- a/configs/stm32f4discovery/nxlines/defconfig +++ b/configs/stm32f4discovery/nxlines/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -801,7 +799,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1150,7 +1147,6 @@ CONFIG_EXAMPLES_NXLINES_BPP=16 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/pm/defconfig b/configs/stm32f4discovery/pm/defconfig index f4e95b0c0742d78dbc66b99c63de871833c8cbaf..9d31f4d16c89722546c9628dce5cbdc680eb0c3d 100644 --- a/configs/stm32f4discovery/pm/defconfig +++ b/configs/stm32f4discovery/pm/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -787,7 +785,6 @@ CONFIG_PM_SLEEPEXIT_THRESH=2 CONFIG_PM_SLEEPENTER_COUNT=70 # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1044,7 +1041,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/posix_spawn/defconfig b/configs/stm32f4discovery/posix_spawn/defconfig index bde4e1647c9c31b7b3b08ed43a214985a6645ea0..6244ecf5de1734748f07d5b2adf1474dac353e2d 100644 --- a/configs/stm32f4discovery/posix_spawn/defconfig +++ b/configs/stm32f4discovery/posix_spawn/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -748,7 +746,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -998,7 +995,6 @@ CONFIG_EXAMPLES_POSIXSPAWN_DEVPATH="/dev/ram0" # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/stm32f4discovery/pseudoterm/defconfig b/configs/stm32f4discovery/pseudoterm/defconfig index c129eb8c72795587250a08ee5f25f6956c52d610..2e888aa40d19ac3774de4d7ae7e6d1c9406e7338 100644 --- a/configs/stm32f4discovery/pseudoterm/defconfig +++ b/configs/stm32f4discovery/pseudoterm/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -766,7 +764,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1050,7 +1047,6 @@ CONFIG_EXAMPLES_PTYTEST_STACKSIZE=2048 CONFIG_EXAMPLES_PTYTEST_DAEMONPRIO=100 # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/rgbled/defconfig b/configs/stm32f4discovery/rgbled/defconfig index 166d2fd1d38f2f21989ffb9896d9dc0c28f64ddb..60d084552e10d1e3bd80b41cc7c7578f26f1d5ec 100644 --- a/configs/stm32f4discovery/rgbled/defconfig +++ b/configs/stm32f4discovery/rgbled/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -773,7 +771,6 @@ CONFIG_RGBLED=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1032,7 +1029,6 @@ CONFIG_EXAMPLES_RGBLED=y CONFIG_EXAMPLES_RGBLED_DEVNAME="/dev/rgbled0" CONFIG_EXAMPLES_RGBLED_PRIORITY=100 CONFIG_EXAMPLES_RGBLED_STACKSIZE=2048 -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/src/stm32_boot.c b/configs/stm32f4discovery/src/stm32_boot.c index 41eb13dcc726823c8f3d56fb454035015b7a306f..483f5edd13bf72eafb3231950944752ca52c6847 100644 --- a/configs/stm32f4discovery/src/stm32_boot.c +++ b/configs/stm32f4discovery/src/stm32_boot.c @@ -47,14 +47,6 @@ #include "up_arch.h" #include "stm32f4discovery.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32f4discovery/src/stm32_bringup.c b/configs/stm32f4discovery/src/stm32_bringup.c index d0b002bb33d93dc7f233742630437bb3a3c348bf..e360c8cc0c72ccb2f04cf0546952e58d27e15689 100644 --- a/configs/stm32f4discovery/src/stm32_bringup.c +++ b/configs/stm32f4discovery/src/stm32_bringup.c @@ -159,6 +159,39 @@ int stm32_bringup(void) } #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_QENCODER + /* Initialize and register the qencoder driver */ + + ret = stm32_qencoder_initialize("/dev/qe0", CONFIG_STM32F4DISCO_QETIMER); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + return ret; + } +#endif + #ifdef HAVE_RTC_DRIVER /* Instantiate the STM32 lower-half RTC driver */ diff --git a/configs/stm32f4discovery/src/stm32_can.c b/configs/stm32f4discovery/src/stm32_can.c index beafd449d9cc00978cba1e170700c6a432e5d16a..702dff902f3fe5734512175c8c846ae0e5f44cd4 100644 --- a/configs/stm32f4discovery/src/stm32_can.c +++ b/configs/stm32f4discovery/src/stm32_can.c @@ -52,7 +52,7 @@ #include "stm32_can.h" #include "stm32f4discovery.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -76,48 +76,41 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_STM32_CAN1 || CONFIG_STM32_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/stm32f4discovery/src/stm32_pwm.c b/configs/stm32f4discovery/src/stm32_pwm.c index 5d7d8ee7fd11a882a43fc1ee01de339ac5d8969d..48b7ff3a5f9c26af0962210b35e1d3a482e28c31 100644 --- a/configs/stm32f4discovery/src/stm32_pwm.c +++ b/configs/stm32f4discovery/src/stm32_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32f4discovery/src/stm32_pwm.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -56,9 +56,9 @@ /* Configuration *******************************************************************/ /* PWM * - * The stm32f4discovery has no real on-board PWM devices, but the board can be configured to output - * a pulse train using TIM4 CH2. This pin is used by FSMC is connect to CN5 just for this - * purpose: + * The stm32f4discovery has no real on-board PWM devices, but the board can be + * configured to output a pulse train using TIM4 CH2. This pin is used by FSMC is + * connected to CN5 just for this purpose: * * PD13 FSMC_A18 / MC_TIM4_CH2OUT pin 33 (EnB) * @@ -79,31 +79,25 @@ # undef HAVE_PWM #endif -#if CONFIG_STM32_TIM4_CHANNEL != STM32F4DISCOVERY_PWMCHANNEL +#if !defined(CONFIG_STM32_TIM4_CHANNEL) || CONFIG_STM32_TIM4_CHANNEL != STM32F4DISCOVERY_PWMCHANNEL # undef HAVE_PWM #endif -#ifdef HAVE_PWM - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { +#ifdef HAVE_PWM static bool initialized = false; struct pwm_lowerhalf_s *pwm; int ret; @@ -136,6 +130,7 @@ int board_pwm_setup(void) } return OK; +#else + return -ENODEV; +#endif } - -#endif /* HAVE_PWM */ diff --git a/configs/stm32f4discovery/src/stm32_qencoder.c b/configs/stm32f4discovery/src/stm32_qencoder.c index 5d0ae6460af061bcc9ea0ff2100ac7e08b565514..80264a7a2a013b2585c9a7ad789d27e0ead59e14 100644 --- a/configs/stm32f4discovery/src/stm32_qencoder.c +++ b/configs/stm32f4discovery/src/stm32_qencoder.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/stm32f4discovery/src/stm32_qencoder.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,79 +50,12 @@ #include "stm32_qencoder.h" #include "stm32f4discovery.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32_TIMn_QE). - */ - -#ifndef CONFIG_STM32_TIM1 -# undef CONFIG_STM32_TIM1_QE -#endif -#ifndef CONFIG_STM32_TIM2 -# undef CONFIG_STM32_TIM2_QE -#endif -#ifndef CONFIG_STM32_TIM3 -# undef CONFIG_STM32_TIM3_QE -#endif -#ifndef CONFIG_STM32_TIM4 -# undef CONFIG_STM32_TIM4_QE -#endif -#ifndef CONFIG_STM32_TIM5 -# undef CONFIG_STM32_TIM5_QE -#endif -#ifndef CONFIG_STM32_TIM8 -# undef CONFIG_STM32_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: qe_devinit + * Name: stm32_qencoder_initialize * * Description: * All STM32 architectures must provide the following interface to work with @@ -130,29 +63,20 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } #endif /* HAVE_QENCODER */ diff --git a/configs/stm32f4discovery/src/stm32_rgbled.c b/configs/stm32f4discovery/src/stm32_rgbled.c index c1d320a05a783ca505c491b08bbc9ba5c1f7a06d..8f6fd9c8e703f3c514c60c42d212cde72b01d094 100644 --- a/configs/stm32f4discovery/src/stm32_rgbled.c +++ b/configs/stm32f4discovery/src/stm32_rgbled.c @@ -93,11 +93,10 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_rgbled_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Configure the RGB LED. * ************************************************************************************/ diff --git a/configs/stm32f4discovery/src/stm32f4discovery.h b/configs/stm32f4discovery/src/stm32f4discovery.h index 50495addf3893f3de860433b78dcf08ebb53f63e..75892830adb536219709b0c6bc1f939ce32e57e9 100644 --- a/configs/stm32f4discovery/src/stm32f4discovery.h +++ b/configs/stm32f4discovery/src/stm32f4discovery.h @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm32f4discovery/src/stm32f4discovery.h * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -438,6 +438,30 @@ void weak_function stm32_usbinitialize(void); int stm32_usbhost_initialize(void); #endif +/**************************************************************************** + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ****************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /**************************************************************************** * Name: stm32_extmemgpios * @@ -524,22 +548,6 @@ void stm32_led_pminitialize(void); void stm32_pm_buttons(void); #endif -/**************************************************************************** - * Name: stm32_bringup - * - * Description: - * Perform architecture-specific initialization - * - * CONFIG_BOARD_INITIALIZE=y : - * Called from board_initialize(). - * - * CONFIG_BOARD_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : - * Called from the NSH library - * - ****************************************************************************/ - -int stm32_bringup(void); - /**************************************************************************** * Name: stm32_sdio_initialize * @@ -564,6 +572,18 @@ int stm32_sdio_initialize(void); void weak_function stm32_netinitialize(void); #endif +/**************************************************************************** + * Name: stm32_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32_qencoder_initialize(FAR const char *devpath, int timer); +#endif + /**************************************************************************** * Name: stm32_zerocross_initialize * diff --git a/configs/stm32f4discovery/uavcan/defconfig b/configs/stm32f4discovery/uavcan/defconfig index d383024729daec0b4497b9965fbfe1394f095fb6..c80096bf7240a8c5f2bcc05d8c21b81a8daefe5d 100644 --- a/configs/stm32f4discovery/uavcan/defconfig +++ b/configs/stm32f4discovery/uavcan/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -718,7 +716,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set # CONFIG_SERIAL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set @@ -944,7 +941,6 @@ CONFIG_LIBUAVCAN_INIT_RETRIES=0 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/usbnsh/defconfig b/configs/stm32f4discovery/usbnsh/defconfig index ee7402e4b7146a0f530e0462536ccb6511315b87..b6661f5d88c4b5565450c265ac16312b06d7b405 100644 --- a/configs/stm32f4discovery/usbnsh/defconfig +++ b/configs/stm32f4discovery/usbnsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -589,8 +587,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -774,7 +770,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -1070,7 +1065,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/winbuild/defconfig b/configs/stm32f4discovery/winbuild/defconfig index 7de0aa129652496602ce0ddfd486b1120d8441d8..a5740592a554f31e38e87b85161fb9d33e368f13 100644 --- a/configs/stm32f4discovery/winbuild/defconfig +++ b/configs/stm32f4discovery/winbuild/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -75,7 +74,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -654,7 +652,6 @@ CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -871,7 +868,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f4discovery/xen1210/defconfig b/configs/stm32f4discovery/xen1210/defconfig index 2e99c29ed8601a63c44e3651a1fb80b76bee0f8b..076a4e5a03ede8aa32e0eb335bd22fd618994a3b 100644 --- a/configs/stm32f4discovery/xen1210/defconfig +++ b/configs/stm32f4discovery/xen1210/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -803,7 +801,6 @@ CONFIG_MS58XX_VDD=30 # CONFIG_QENCODER is not set CONFIG_XEN1210=y # CONFIG_ZEROCROSS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -1060,7 +1057,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f746-ws/nsh/defconfig b/configs/stm32f746-ws/nsh/defconfig index 4ba7dddad462ffc6b58b13f6ecae2d79f47d3657..46aed0463545f3b5ebdca78292cf4763852bf141 100644 --- a/configs/stm32f746-ws/nsh/defconfig +++ b/configs/stm32f746-ws/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -470,8 +468,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -694,7 +690,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -1004,7 +999,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32f746g-disco/nsh/defconfig b/configs/stm32f746g-disco/nsh/defconfig index 330360fdc1f6d7f0a85312a38e679653c3b19270..80155b308a251915ac1d189c0a4310fbaed960d5 100644 --- a/configs/stm32f746g-disco/nsh/defconfig +++ b/configs/stm32f746g-disco/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -620,7 +618,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -867,7 +864,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32l476-mdk/nsh/defconfig b/configs/stm32l476-mdk/nsh/defconfig index 188e704f0b8c7b67225065483b314116dedb99c5..57b5c9fd477e4ddec165d39d54a36b747c203b6d 100644 --- a/configs/stm32l476-mdk/nsh/defconfig +++ b/configs/stm32l476-mdk/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -374,8 +372,6 @@ CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_UNIQUEID=y CONFIG_BOARDCTL_UNIQUEID_SIZE=12 # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -565,7 +561,6 @@ CONFIG_RTC_IOCTL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -832,7 +827,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/stm32l476vg-disco/nsh/defconfig b/configs/stm32l476vg-disco/nsh/defconfig index 25cfb5102ce4568764c19c28c7418ee302e93bf1..a62de0776c445bdae913c2995642cfb7db324a53 100644 --- a/configs/stm32l476vg-disco/nsh/defconfig +++ b/configs/stm32l476vg-disco/nsh/defconfig @@ -61,11 +61,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -75,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -244,6 +244,8 @@ CONFIG_STM32L4_PWR=y # CONFIG_STM32L4_USART1 is not set CONFIG_STM32L4_USART2=y # CONFIG_STM32L4_USART3 is not set +# CONFIG_STM32L4_UART4 is not set +# CONFIG_STM32L4_UART5 is not set # CONFIG_STM32L4_I2C1 is not set # CONFIG_STM32L4_I2C2 is not set # CONFIG_STM32L4_I2C3 is not set @@ -293,8 +295,8 @@ CONFIG_STM32L4_SAI1PLL=y # CONFIG_STM32L4_ONESHOT is not set # CONFIG_STM32L4_FREERUN is not set CONFIG_STM32L4_HAVE_USART3=y -# CONFIG_STM32L4_HAVE_USART4 is not set -# CONFIG_STM32L4_HAVE_USART5 is not set +CONFIG_STM32L4_HAVE_UART4=y +CONFIG_STM32L4_HAVE_UART5=y # # U[S]ART Configuration @@ -388,8 +390,6 @@ CONFIG_LIB_BOARDCTL=y CONFIG_BOARDCTL_UNIQUEID=y CONFIG_BOARDCTL_UNIQUEID_SIZE=12 # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set CONFIG_BOARDCTL_IOCTL=y @@ -519,14 +519,14 @@ CONFIG_DEV_LOOP=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set CONFIG_SPI=y +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set +CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_SLAVE is not set CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_CALLBACK is not set # CONFIG_SPI_HWFEATURES is not set -# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set -# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set -CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_SPI_BITORDER is not set # CONFIG_SPI_CS_DELAY_CONTROL is not set # CONFIG_SPI_DRIVER is not set @@ -614,7 +614,6 @@ CONFIG_N25QXXX_SECTOR512=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -852,20 +851,8 @@ CONFIG_EXAMPLES_ALARM_PRIORITY=100 CONFIG_EXAMPLES_ALARM_STACKSIZE=2048 CONFIG_EXAMPLES_ALARM_DEVPATH="/dev/rtc0" CONFIG_EXAMPLES_ALARM_SIGNO=1 -CONFIG_EXAMPLES_ARCHBUTTONS=y -CONFIG_EXAMPLES_ARCHBUTTONS_MIN=0 -CONFIG_EXAMPLES_ARCHBUTTONS_MAX=4 -CONFIG_EXAMPLES_IRQBUTTONS_MIN=0 -CONFIG_EXAMPLES_IRQBUTTONS_MAX=4 -CONFIG_EXAMPLES_ARCHBUTTONS_NAME0="Center" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME1="Left" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME2="Down" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME3="Right" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME4="Up" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME5="Button 5" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME6="Button 6" -CONFIG_EXAMPLES_ARCHBUTTONS_NAME7="Button 7" # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CXXTEST is not set @@ -905,7 +892,6 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y # CONFIG_EXAMPLES_RANDOM is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/stm32l476vg-disco/src/stm32l476vg-disco.h b/configs/stm32l476vg-disco/src/stm32l476vg-disco.h index 471a19d561677d39c73419a57d4102546bd0e342..dfa9b4ebfa0b86bf97cea70a6e247cc91e98464f 100644 --- a/configs/stm32l476vg-disco/src/stm32l476vg-disco.h +++ b/configs/stm32l476vg-disco/src/stm32l476vg-disco.h @@ -272,16 +272,4 @@ void stm32_spiinitialize(void); void stm32l4_usbinitialize(void); -/************************************************************************************ - * Name: board_adc_initialize - * - * Description: - * Initialize and register the ADC driver(s) - * - ************************************************************************************/ - -#ifdef CONFIG_ADC -int board_adc_initialize(void); -#endif - #endif /* __CONFIGS_STM32L476VG_DISCO_SRC_STM32L476VG_DISCO_H */ diff --git a/configs/stm32ldiscovery/Kconfig b/configs/stm32ldiscovery/Kconfig index 2d37b4e88db9311339e2de0c913660cb34069d2a..34e1f833880d0e0bb2656aab37cf0b357347e13a 100644 --- a/configs/stm32ldiscovery/Kconfig +++ b/configs/stm32ldiscovery/Kconfig @@ -4,4 +4,10 @@ # if ARCH_BOARD_STM32FL_DISCOVERY + +config STM32LDISCO_QETIMER + int "Timer to use with QE encoder" + default 3 + depends on QENCODER + endif diff --git a/configs/stm32ldiscovery/nsh/defconfig b/configs/stm32ldiscovery/nsh/defconfig index 04498a3779f4171912a3d9182e70378901989d29..af6dda6e9a0d051f3b90255a92cfd5baa0a8bcc4 100644 --- a/configs/stm32ldiscovery/nsh/defconfig +++ b/configs/stm32ldiscovery/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -708,7 +706,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -924,7 +921,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/stm32ldiscovery/src/stm32_appinit.c b/configs/stm32ldiscovery/src/stm32_appinit.c index 359e271eb95569d966b195b68b9fa1c4d999e6de..30db4f50f284594cdde8115a8824e899cbffb36c 100644 --- a/configs/stm32ldiscovery/src/stm32_appinit.c +++ b/configs/stm32ldiscovery/src/stm32_appinit.c @@ -47,10 +47,6 @@ #include "stm32ldiscovery.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -82,11 +78,40 @@ int board_app_initialize(uintptr_t arg) { + int ret = OK; + #ifdef CONFIG_STM32_LCD /* Initialize the SLCD and register the SLCD device as /dev/slcd */ - return stm32_slcd_initialize(); -#else - return OK; + ret = stm32_slcd_initialize(); + if (ret != OK) + { + syslog(LOG_ERR, "ERROR: stm32_slcd_initialize failed: %d\n", ret); + return ret; + } #endif + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = stm32_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_pwm_setup() failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_QENCODER + /* Initialize and register the qencoder driver */ + + ret = stm32_qencoder_initialize("/dev/qe0", CONFIG_STM32LDISCO_QETIMER); + if (ret != OK) + { + syslog(LOG_ERR, + "ERROR: Failed to register the qencoder: %d\n", + ret); + } +#endif + + return ret; } diff --git a/configs/stm32ldiscovery/src/stm32_pwm.c b/configs/stm32ldiscovery/src/stm32_pwm.c index 1aeca320fcb1e3dc4e8618400e6fb0980bae4c8a..908307565ceeec062bd989d735eaf41546fbc1a5 100644 --- a/configs/stm32ldiscovery/src/stm32_pwm.c +++ b/configs/stm32ldiscovery/src/stm32_pwm.c @@ -1,8 +1,7 @@ /************************************************************************************ * configs/stm32ldiscovery/src/up_pwm.c - * arch/arm/src/board/up_pwm.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -59,9 +58,9 @@ /* Configuration *******************************************************************/ /* PWM * - * The stm32ldiscovery has no real on-board PWM devices, but the board can be configured to output - * a pulse train using TIM4 CH2. This pin is used by FSMC is connect to CN5 just for this - * purpose: + * The stm32ldiscovery has no real on-board PWM devices, but the board can be + * configured to output a pulse train using TIM4 CH2. This pin is used by FSMC is + * connected to CN5 just for this purpose: * * PD13 FSMC_A18 / MC_TIM4_CH2OUT pin 33 (EnB) * @@ -86,27 +85,21 @@ # undef HAVE_PWM #endif -#ifdef HAVE_PWM - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: stm32_pwm_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int stm32_pwm_setup(void) { +#ifdef HAVE_PWM static bool initialized = false; struct pwm_lowerhalf_s *pwm; int ret; @@ -139,6 +132,8 @@ int board_pwm_setup(void) } return OK; +#else + return -ENODEV; +#endif } -#endif /* HAVE_PWM */ diff --git a/configs/stm32ldiscovery/src/stm32_qencoder.c b/configs/stm32ldiscovery/src/stm32_qencoder.c index ebd78514aa1e3010635f2e00c18c9cf9c4e32c78..7306b14127c3006b67f5145bdea79eeb44192ea8 100644 --- a/configs/stm32ldiscovery/src/stm32_qencoder.c +++ b/configs/stm32ldiscovery/src/stm32_qencoder.c @@ -1,8 +1,7 @@ /************************************************************************************ * configs/stm32ldiscovery/src/up_qencoder.c - * arch/arm/src/board/up_qencoder.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,79 +50,12 @@ #include "stm32_qencoder.h" #include "stm32ldiscovery.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ -/* Check if we have a timer configured for quadrature encoder -- assume YES. */ - -#define HAVE_QENCODER 1 - -/* If TIMn is not enabled (via CONFIG_STM32_TIMn), then the configuration cannot - * specify TIMn as a quadrature encoder (via CONFIG_STM32_TIMn_QE). - */ - -#ifndef CONFIG_STM32_TIM1 -# undef CONFIG_STM32_TIM1_QE -#endif -#ifndef CONFIG_STM32_TIM2 -# undef CONFIG_STM32_TIM2_QE -#endif -#ifndef CONFIG_STM32_TIM3 -# undef CONFIG_STM32_TIM3_QE -#endif -#ifndef CONFIG_STM32_TIM4 -# undef CONFIG_STM32_TIM4_QE -#endif -#ifndef CONFIG_STM32_TIM5 -# undef CONFIG_STM32_TIM5_QE -#endif -#ifndef CONFIG_STM32_TIM8 -# undef CONFIG_STM32_TIM8_QE -#endif - -/* If the upper-half quadrature encoder driver is not enabled, then we cannot - * support the quadrature encoder. - */ - -#ifndef CONFIG_QENCODER -# undef HAVE_QENCODER -#endif - -/* Which Timer should we use, TIMID={1,2,3,4,5,8}. If multiple timers are - * configured as quadrature encoders, this logic will arbitrarily select - * the lowest numbered timer. - * - * At least one TIMn, n={1,2,3,4,5,8}, must be both enabled and configured - * as a quadrature encoder in order to support the lower half quadrature - * encoder driver. The above check assures that if CONFIG_STM32_TIMn_QE - * is defined, then the correspdonding TIMn is also enabled. - */ - -#if defined CONFIG_STM32_TIM1_QE -# define TIMID 1 -#elif defined CONFIG_STM32_TIM2_QE -# define TIMID 2 -#elif defined CONFIG_STM32_TIM3_QE -# define TIMID 3 -#elif defined CONFIG_STM32_TIM4_QE -# define TIMID 4 -#elif defined CONFIG_STM32_TIM5_QE -# define TIMID 5 -#elif defined CONFIG_STM32_TIM8_QE -# define TIMID 8 -#else -# undef HAVE_QENCODER -#endif - -#ifdef HAVE_QENCODER - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: qe_devinit + * Name: stm32_qencoder_initialize * * Description: * All STM32 architectures must provide the following interface to work with @@ -131,29 +63,20 @@ * ************************************************************************************/ -int qe_devinit(void) +int stm32_qencoder_initialize(FAR const char *devpath, int timer) { - static bool initialized = false; int ret; - /* Check if we are already initialized */ + /* Initialize a quadrature encoder interface. */ - if (!initialized) + sninfo("Initializing the quadrature encoder using TIM%d\n", timer); + ret = stm32_qeinitialize(devpath, timer); + if (ret < 0) { - /* Initialize a quadrature encoder interface. */ - - sninfo("Initializing the quadrature encoder using TIM%d\n", TIMID); - ret = stm32_qeinitialize("/dev/qe0", TIMID); - if (ret < 0) - { - snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); - return ret; - } - - initialized = true; + snerr("ERROR: stm32_qeinitialize failed: %d\n", ret); } - return OK; + return ret; } #endif /* HAVE_QENCODER */ diff --git a/configs/stm32ldiscovery/src/stm32ldiscovery.h b/configs/stm32ldiscovery/src/stm32ldiscovery.h index 1bd424f37623126fee2f8b147cd365d89ec5d1c9..c8d05a2c44e8fbc9901968e8261893f1d7cc6b62 100644 --- a/configs/stm32ldiscovery/src/stm32ldiscovery.h +++ b/configs/stm32ldiscovery/src/stm32ldiscovery.h @@ -2,7 +2,7 @@ * configs/stm32ldiscovery/src/stm32ldiscovery.h * arch/arm/src/board/stm32ldiscovery.h * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -243,6 +243,30 @@ void weak_function stm32_spidev_initialize(void); +/************************************************************************************ + * Name: stm32_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int stm32_pwm_setup(void); +#endif + +/**************************************************************************** + * Name: stm32_qencoder_initialize + * + * Description: + * Initialize and register a qencoder + * + ****************************************************************************/ + +#ifdef CONFIG_QENCODER +int stm32_qencoder_initialize(FAR const char *devpath, int timer); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_STM32F3DISCOVERY_SRC_STM32F3DISCOVERY_H */ diff --git a/configs/stm32vldiscovery/nsh/defconfig b/configs/stm32vldiscovery/nsh/defconfig index 25ebdfe79225560130bbd2f22f1cae8c058d6234..c7ca2ef2c5e657c2b4bed50640347db041508bc3 100644 --- a/configs/stm32vldiscovery/nsh/defconfig +++ b/configs/stm32vldiscovery/nsh/defconfig @@ -65,7 +65,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -78,7 +77,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -726,7 +724,6 @@ CONFIG_RTC=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -973,7 +970,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sure-pic32mx/nsh/defconfig b/configs/sure-pic32mx/nsh/defconfig index bf079f0e17041ca5fc4849f482ea3fb3c9ebeeb5..7cf509a7bf3fde9421380d41ff92efd09f60c5a4 100644 --- a/configs/sure-pic32mx/nsh/defconfig +++ b/configs/sure-pic32mx/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -340,8 +339,6 @@ CONFIG_ARCH_DBDP11215=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -509,7 +506,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -741,7 +737,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/sure-pic32mx/usbnsh/defconfig b/configs/sure-pic32mx/usbnsh/defconfig index 42a85541b46bc509ad09ed7a744fbc84fa5b2a42..0a5838887ee3b7538533dea8419a6b7ab8ef58e6 100644 --- a/configs/sure-pic32mx/usbnsh/defconfig +++ b/configs/sure-pic32mx/usbnsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -342,8 +341,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -511,7 +508,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_SERIAL_REMOVABLE=y # CONFIG_SERIAL_CONSOLE is not set @@ -783,7 +779,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-2.0/hello/defconfig b/configs/teensy-2.0/hello/defconfig index b39e8d3db801d315022be758054bd4840c216863..cf6bd2ee38e55ee01bb67267052f2a9d82d20e71 100644 --- a/configs/teensy-2.0/hello/defconfig +++ b/configs/teensy-2.0/hello/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -301,7 +300,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -516,7 +514,6 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-2.0/nsh/defconfig b/configs/teensy-2.0/nsh/defconfig index d46226fbf57f4008445cb9c540aff35bdd70361f..a947d314ee429c755b8a90fdb14e504f3e025876 100644 --- a/configs/teensy-2.0/nsh/defconfig +++ b/configs/teensy-2.0/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -312,7 +311,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -529,7 +527,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-2.0/src/Makefile b/configs/teensy-2.0/src/Makefile index ebf8c9b87646f047a898b73ad4369dfd7249cf86..b56c428442e2312cc9e7fdfd1e18b2b4b61cdcf5 100644 --- a/configs/teensy-2.0/src/Makefile +++ b/configs/teensy-2.0/src/Makefile @@ -41,12 +41,15 @@ CSRCS = at90usb_boot.c ifeq ($(CONFIG_ARCH_LEDS),y) CSRCS += at90usb_leds.c endif + ifeq ($(CONFIG_LIB_BOARDCTL),y) CSRCS += at90usb_appinit.c endif + ifeq ($(CONFIG_USBMSC),y) CSRCS += at90usb_usbmsc.c endif + ifeq ($(CONFIG_AVR_SPI),y) CSRCS += at90usb_spi.c endif diff --git a/configs/teensy-2.0/usbmsc/defconfig b/configs/teensy-2.0/usbmsc/defconfig index c93c850b6c8ea91e9dabd5cd35274d691d15037a..ed35a4ece2eb97f66a3ccec3cc385bb27dac2118 100644 --- a/configs/teensy-2.0/usbmsc/defconfig +++ b/configs/teensy-2.0/usbmsc/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_ARCH_AVR=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -334,7 +333,6 @@ CONFIG_MMCSD_SPIMODE=0 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -592,7 +590,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-3.x/nsh/defconfig b/configs/teensy-3.x/nsh/defconfig index 073e881a48b53200a68eb78dd2375b31adfaf543..4712175377d6bd8bdba0f94845d6e4815763b669 100644 --- a/configs/teensy-3.x/nsh/defconfig +++ b/configs/teensy-3.x/nsh/defconfig @@ -64,7 +64,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -77,7 +76,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -480,7 +478,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -713,7 +710,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-3.x/src/k20_appinit.c b/configs/teensy-3.x/src/k20_appinit.c index f027eb71673d9928b169676e416c7c4370ab301f..ae26f993f688fbdaf8ebacc09fb8bfc12ba14b02 100644 --- a/configs/teensy-3.x/src/k20_appinit.c +++ b/configs/teensy-3.x/src/k20_appinit.c @@ -38,7 +38,10 @@ ****************************************************************************/ #include + #include +#include + #include #include "kinetis_usbotg.h" @@ -75,6 +78,8 @@ int board_app_initialize(uintptr_t arg) { + int ret; + #ifdef CONFIG_USBDEV /* Teensy is powered from usb and (bug?) only boots from being programmed, * so if usb is compiled in signal the controller driver that we're attached now. @@ -83,5 +88,16 @@ int board_app_initialize(uintptr_t arg) khci_usbattach(); #endif +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = kinetis_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: kinetis_pwm_setup() failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/teensy-3.x/src/k20_pwm.c b/configs/teensy-3.x/src/k20_pwm.c index 5fc7652f161305b48a1751d4de709b55b76843c0..6e0d384c18411bfbfe59088ea88fa2d8325de7ba 100644 --- a/configs/teensy-3.x/src/k20_pwm.c +++ b/configs/teensy-3.x/src/k20_pwm.c @@ -66,24 +66,19 @@ extern struct pwm_lowerhalf_s *kinetis_pwminitialize(int timer); -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: kinetis_pwm_setup * * Description: - * All Kinetis K20 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int kinetis_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/teensy-3.x/src/teensy-3x.h b/configs/teensy-3.x/src/teensy-3x.h index 030ac3d2cd624a277456b3d6fdcc3d5e391b7d75..890845adbdbd5e2429c765bdf40a7addbda28e33 100644 --- a/configs/teensy-3.x/src/teensy-3x.h +++ b/configs/teensy-3.x/src/teensy-3x.h @@ -115,6 +115,18 @@ void kinetis_i2cdev_initialize(void); extern void weak_function kinetis_usbinitialize(void); +/************************************************************************************ + * Name: kinetis_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int kinetis_pwm_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_TEENSY_3X_SRC_TEENSY_3X_H */ diff --git a/configs/teensy-3.x/usbnsh/defconfig b/configs/teensy-3.x/usbnsh/defconfig index ad8e9f149d78d5a3e7227a7a1f6a3f6455571ab7..8b71905cfffd6ef86539428a5bb1317ff28d509a 100644 --- a/configs/teensy-3.x/usbnsh/defconfig +++ b/configs/teensy-3.x/usbnsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -308,8 +306,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set CONFIG_BOARDCTL_USBDEVCTRL=y # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -482,7 +478,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set CONFIG_SERIAL_REMOVABLE=y @@ -759,7 +754,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-lc/nsh/defconfig b/configs/teensy-lc/nsh/defconfig index 6b14248f1fa7313ada279b7a1b10384114c9c25f..e3e77e208aea91637b8e87dff6280613df4a9ab9 100644 --- a/configs/teensy-lc/nsh/defconfig +++ b/configs/teensy-lc/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -74,7 +73,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -273,8 +271,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -445,7 +441,6 @@ CONFIG_SPI_EXCHANGE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -682,7 +677,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_PWM is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/teensy-lc/src/kl_appinit.c b/configs/teensy-lc/src/kl_appinit.c index fdd1e3bd307f0230cf877b068b646b147c813bf6..cfe2684ebd638b1dd315903955d3d8d59f70a1e4 100644 --- a/configs/teensy-lc/src/kl_appinit.c +++ b/configs/teensy-lc/src/kl_appinit.c @@ -45,6 +45,8 @@ #include +#include "teensy-lc.h" + #ifdef CONFIG_LIB_BOARDCTL /**************************************************************************** @@ -78,6 +80,19 @@ int board_app_initialize(uintptr_t arg) { + int ret; + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = kl_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: kl_pwm_setup() failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/teensy-lc/src/kl_pwm.c b/configs/teensy-lc/src/kl_pwm.c index 13d58804db526c80d838f3e3140bb570e14be9aa..82d80b543283447f370bcd009330861a870c04be 100644 --- a/configs/teensy-lc/src/kl_pwm.c +++ b/configs/teensy-lc/src/kl_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/teensy-lc/src/kl_pwm.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Alan Carvalho de Assis * @@ -66,24 +66,19 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: kl_pwm_setup * * Description: - * All Kinetis KL architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int kl_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/teensy-lc/src/teensy-lc.h b/configs/teensy-lc/src/teensy-lc.h index 048fcaeab431fb0a4d966d30740be2afcf903bf9..996c8677c4d323e0c769cf874a30a323e324bd9f 100644 --- a/configs/teensy-lc/src/teensy-lc.h +++ b/configs/teensy-lc/src/teensy-lc.h @@ -79,6 +79,18 @@ void weak_function kl_spidev_initialize(void); +/************************************************************************************ + * Name: kl_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int kl_pwm_setup(void); +#endif + /**************************************************************************** * Name: kl_led_initialize * diff --git a/configs/tm4c123g-launchpad/nsh/defconfig b/configs/tm4c123g-launchpad/nsh/defconfig index 2b1fff6606863284b9ae9ee0e3717cb6756b30f5..12288ccbfcd26ae76bfc0c6d725e26aac5cde859 100644 --- a/configs/tm4c123g-launchpad/nsh/defconfig +++ b/configs/tm4c123g-launchpad/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -339,8 +337,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -503,7 +499,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -736,7 +731,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/tm4c123g-launchpad/src/tm4c123g-launchpad.h b/configs/tm4c123g-launchpad/src/tm4c123g-launchpad.h index b9ca7ce4808cb9d07baa6c3f09975ffbcc32b6a0..4b8df2c9e1e339fe10fdcf108a45e037f57be4d3 100644 --- a/configs/tm4c123g-launchpad/src/tm4c123g-launchpad.h +++ b/configs/tm4c123g-launchpad/src/tm4c123g-launchpad.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/tm4c123g-launchpad/src/tm4c123g-launchpad.h * - * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -213,6 +213,18 @@ void tm4c_led_initialize(void); int tm4c_bringup(void); +/************************************************************************************ + * Name: tm4c_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_TIVA_ADC +int tm4c_adc_setup(void); +#endif + /**************************************************************************** * Name: tm4c_at24_automount * @@ -237,17 +249,5 @@ int tm4c_at24_automount(int minor); int tiva_timer_configure(void); #endif -/************************************************************************************ - * Name: board_adc_initialize - * - * Description: - * Initialize and register the ADC driver - * - ************************************************************************************/ - -#ifdef CONFIG_TIVA_ADC -int board_adc_initialize(void); -#endif - #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H */ diff --git a/configs/tm4c123g-launchpad/src/tm4c_adc.c b/configs/tm4c123g-launchpad/src/tm4c_adc.c index c4494b5579cf0437ebb45f9e366a9ff624ba1681..a43f5ee9612be42e827e238b866cad0765b8f082 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_adc.c +++ b/configs/tm4c123g-launchpad/src/tm4c_adc.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/tm4c123g-launchpad/tm4c_adc.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,34 +50,23 @@ #include "tm4c123g-launchpad.h" #include "chip/tiva_pinmap.h" -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ +#ifdef CONFIG_TIVA_ADC /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_adc_initialize + * Name: tm4c_adc_setup * * Description: - * Initialize and register the ADC driver. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -#ifdef CONFIG_TIVA_ADC -int board_adc_initialize(void) +int tm4c_adc_setup(void) { -# if defined (CONFIG_TIVA_ADC) && defined (CONFIG_ADC) +#ifdef CONFIG_ADC static bool initialized = false; int ret; uint8_t srate = 0; @@ -90,11 +79,11 @@ int board_adc_initialize(void) }; sse_cfg0.priority = 0; -# ifdef CONFIG_EXAMPLES_ADC_SWTRIG +#ifdef CONFIG_EXAMPLES_ADC_SWTRIG sse_cfg0.trigger = TIVA_ADC_TRIG_SW; -# else +#else sse_cfg0.trigger = TIVA_ADC_TRIG_ALWAYS; -# endif +#endif adc_cfg.adc = 0; adc_cfg.sse[0] = true; @@ -105,11 +94,11 @@ int board_adc_initialize(void) adc_cfg.steps = 1; adc_cfg.stepcfg = step_cfg; -# ifdef CONFIG_EXAMPLES_ADC_SWTRIG +#ifdef CONFIG_EXAMPLES_ADC_SWTRIG srate = TIVA_ADC_SAMPLE_RATE_FASTEST; -# else +#else srate = TIVA_ADC_SAMPLE_RATE_SLOWEST; -# endif +#endif /* Check if we have already initialized */ @@ -132,35 +121,11 @@ int board_adc_initialize(void) initialized = true; } - return OK; -} #endif /* CONFIG_ADC */ -/************************************************************************************ - * Name: board_adc_setup - * - * Description: - * All Tiva architectures must provide the following interface to work with - * examples/adc. - * - ************************************************************************************/ - -#ifdef CONFIG_EXAMPLES_ADC -int board_adc_setup(void) -{ -#ifdef CONFIG_TIVA_ADC - return board_adc_initialize(); -#else - return -ENOSYS; -#endif + return OK; } -#endif /* CONFIG_EXAMPLES_ADC */ - -#if defined (CONFIG_TIVA_ADC) && defined (CONFIG_TIVA_TIMER) - -/* Tiva timer interface does not currently support user configuration */ -#if 0 /************************************************************************************ * Name: adc_timer_init * @@ -169,6 +134,9 @@ int board_adc_setup(void) * ************************************************************************************/ +/* Tiva timer interface does not currently support user configuration */ + +#if 0 /* defined(CONFIG_TIVA_TIMER) */ TIMER_HANDLE adc_timer_init(void) { struct tiva_gptm32config_s adctimer = @@ -189,6 +157,6 @@ TIMER_HANDLE adc_timer_init(void) return tiva_gptm_configure((const struct tiva_gptmconfig_s *)&adctimer); } +#endif /* CONFIG_TIVA_TIMER */ -#endif -#endif /* defined (CONFIG_TIVA_ADC) && defined (CONFIG_TIVA_TIMER) */ +#endif /* CONFIG_TIVA_ADC */ diff --git a/configs/tm4c123g-launchpad/src/tm4c_bringup.c b/configs/tm4c123g-launchpad/src/tm4c_bringup.c index 48a8d649fea3236f59bcc6ded6a97ab7f3368c07..d70b9156bab3b215034240529ea3dc2aeb01f86a 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_bringup.c +++ b/configs/tm4c123g-launchpad/src/tm4c_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/tm4c123g-launchpad/src/tm4c_bringup.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,6 +63,16 @@ int tm4c_bringup(void) { int ret = OK; +#ifdef CONFIG_TIVA_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = tm4c_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: tm4c_adc_setup failed: %d\n", ret); + } +#endif + #ifdef HAVE_AT24 /* Initialize the AT24 driver */ @@ -85,5 +95,6 @@ int tm4c_bringup(void) } #endif /* CONFIG_TIVA_TIMER */ + UNUSED(ret); return ret; } diff --git a/configs/tm4c1294-launchpad/ipv6/defconfig b/configs/tm4c1294-launchpad/ipv6/defconfig index 4de7a634ef3921936f0ea6e9f85e0f60435844bd..f016e962aaaa8d7c7818545497b132a6fb33a2f0 100644 --- a/configs/tm4c1294-launchpad/ipv6/defconfig +++ b/configs/tm4c1294-launchpad/ipv6/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -358,8 +356,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -556,16 +552,14 @@ CONFIG_NETDEVICES=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_ARCH_PHY_INTERRUPT=y # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -642,13 +636,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -882,7 +874,6 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # -# CONFIG_EXAMPLES_ARCHBUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set @@ -918,7 +909,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/tm4c1294-launchpad/nsh/defconfig b/configs/tm4c1294-launchpad/nsh/defconfig index 922fe3c678178269e2ca97b8c237e79672f72905..3c4bcce6eb905278b5a5d651485aa47cea950b49 100644 --- a/configs/tm4c1294-launchpad/nsh/defconfig +++ b/configs/tm4c1294-launchpad/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -358,8 +356,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -558,16 +554,14 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set CONFIG_ARCH_PHY_INTERRUPT=y # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -644,13 +638,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y # CONFIG_ARCH_HAVE_PHY is not set CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -929,7 +921,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/tm4c1294-launchpad/src/tm4c_appinit.c b/configs/tm4c1294-launchpad/src/tm4c_appinit.c index 747c1f20df3e22f6903d116a81950e599c14a41c..35b1f1ce1b84cb74c754af1d63aef996a2cf02ab 100644 --- a/configs/tm4c1294-launchpad/src/tm4c_appinit.c +++ b/configs/tm4c1294-launchpad/src/tm4c_appinit.c @@ -87,26 +87,4 @@ int board_app_initialize(uintptr_t arg) #endif } -/**************************************************************************** - * Name: board_pwm_setup - * - * Description: - * No implementation for now, it's called by PWM tool via boardctl(). - * See include/nuttx/board.h - * - * Input Parameters: - * None. - * - * Returned Value: - * Zero on Success. - * - ****************************************************************************/ - -#ifdef CONFIG_BOARDCTL_PWMTEST -int board_pwm_setup(void) -{ - return OK; -} -#endif /* CONFIG_BOARDCTL_PWMTEST */ - #endif /* CONFIG_LIB_BOARDCTL */ diff --git a/configs/twr-k60n512/nsh/defconfig b/configs/twr-k60n512/nsh/defconfig index 49bc1c331cd7b47b583da37a21a310224c176b49..ddafbe24e9de8f1c37eb80dca0ec75fd4e0f0c17 100644 --- a/configs/twr-k60n512/nsh/defconfig +++ b/configs/twr-k60n512/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -467,7 +465,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -705,7 +702,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/u-blox-c027/nsh/defconfig b/configs/u-blox-c027/nsh/defconfig index 7f9acf9affad97f144d6a87565ee7f18ce8cb2c8..b1ca48a213c75fe16c3998128bd2e9591a944736 100644 --- a/configs/u-blox-c027/nsh/defconfig +++ b/configs/u-blox-c027/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -324,8 +322,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -523,10 +519,9 @@ CONFIG_NETDEV_LATEINIT=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -560,7 +555,6 @@ CONFIG_ETH1_PHY_NONE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -681,13 +675,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -996,7 +988,6 @@ CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_PPPD=y # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/u-blox-c027/src/Makefile b/configs/u-blox-c027/src/Makefile index 844046486e37f3fb20ba0878ca36625557a86134..e76c00febd438d343bb2b4c52b9b28776f70eb65 100644 --- a/configs/u-blox-c027/src/Makefile +++ b/configs/u-blox-c027/src/Makefile @@ -36,12 +36,20 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = lpc17_boot.c lpc17_leds.c lpc17_ssp.c lpc17_adc.c lpc17_dac.c lpc17_pwm.c +CSRCS = lpc17_boot.c lpc17_leds.c lpc17_ssp.c lpc17_dac.c ifeq ($(CONFIG_LIB_BOARDCTL),y) CSRCS += lpc17_appinit.c endif +ifeq ($(CONFIG_PWM),y) +CSRCS += lpc17_pwm.c +endif + +ifeq ($(CONFIG_ADC),y) +CSRCS += lpc17_adc.c +endif + ifeq ($(CONFIG_MODEM_U_BLOX),y) CSRCS += lpc17_ubxmdm.c endif diff --git a/configs/u-blox-c027/src/lpc17_adc.c b/configs/u-blox-c027/src/lpc17_adc.c index bc876a8d538b49eeec3de3b967ffa9de32ee4f25..0321cda7e7c8fdd6d4efc7ac0bed29de0086a09a 100644 --- a/configs/u-blox-c027/src/lpc17_adc.c +++ b/configs/u-blox-c027/src/lpc17_adc.c @@ -8,7 +8,7 @@ * * which, in turn, was based on configs/stm3220g-eval/src/lpc17_adc.c * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -66,15 +66,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: lpc17_adc_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int lpc17_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/u-blox-c027/src/lpc17_appinit.c b/configs/u-blox-c027/src/lpc17_appinit.c index f315953dfb9dfd632e2f6b3f23d8b9645f5cfc4a..30c6d271617940e9375b0d5b76f77d3a5bb7207c 100644 --- a/configs/u-blox-c027/src/lpc17_appinit.c +++ b/configs/u-blox-c027/src/lpc17_appinit.c @@ -195,5 +195,28 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); #endif + +#ifdef CONFIG_PWM + /* Initialize PWM and register the PWM device. */ + + ret = lpc17_pwm_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpc17_pwm_setup() failed: %d\n", ret); + return ret; + } +#endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = lpc17_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: lpc17_adc_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/u-blox-c027/src/lpc17_pwm.c b/configs/u-blox-c027/src/lpc17_pwm.c index 03569cc11dda0424a26fd2636f50e556eac2a16e..3c4630d0f220dddfd75ce2d3f013d1b6ba6a8959 100644 --- a/configs/u-blox-c027/src/lpc17_pwm.c +++ b/configs/u-blox-c027/src/lpc17_pwm.c @@ -69,15 +69,14 @@ FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer); ************************************************************************************/ /************************************************************************************ - * Name: board_pwm_setup + * Name: lpc17_pwm_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/pwm. + * Initialize PWM and register the PWM device. * ************************************************************************************/ -int board_pwm_setup(void) +int lpc17_pwm_setup(void) { static bool initialized = false; struct pwm_lowerhalf_s *pwm; diff --git a/configs/u-blox-c027/src/u-blox-c027.h b/configs/u-blox-c027/src/u-blox-c027.h index 6f2b8da990ca60ea0d906f792514b8c761d95d66..edeb43dbe1025683d46e5d2212b10506de8c5205 100644 --- a/configs/u-blox-c027/src/u-blox-c027.h +++ b/configs/u-blox-c027/src/u-blox-c027.h @@ -90,14 +90,41 @@ void weak_function c027_sspdev_initialize(void); -#if defined(CONFIG_MODEM_U_BLOX) +/************************************************************************************ + * Name: lpc17_ubxmdm_init + * + * Description: + * Initialisation function for the u-blox modem. + * + ************************************************************************************/ -/* - * Initialisation function for the u-blox modem. - */ +#if defined(CONFIG_MODEM_U_BLOX) void lpc17_ubxmdm_init(bool usb_used); - #endif /* CONFIG_MODEM_U_BLOX */ +/************************************************************************************ + * Name: lpc17_pwm_setup + * + * Description: + * Initialize PWM and register the PWM device. + * + ************************************************************************************/ + +#ifdef CONFIG_PWM +int lpc17_pwm_setup(void); +#endif + +/************************************************************************************ + * Name: lpc17_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int lpc17_adc_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_U_BLOX_C027_SRC_U_BLOX_C027_H */ diff --git a/configs/ubw32/nsh/defconfig b/configs/ubw32/nsh/defconfig index aec162d0a1c3a951150b6b53436d8040b9f66039..91b77cebc885f9963e66e9d5409f006c4ea75c53 100644 --- a/configs/ubw32/nsh/defconfig +++ b/configs/ubw32/nsh/defconfig @@ -63,7 +63,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set CONFIG_ARCH_MIPS=y -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -339,8 +338,6 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -515,7 +512,6 @@ CONFIG_MMCSD_NSLOTS=1 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -758,7 +754,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/us7032evb1/nsh/defconfig b/configs/us7032evb1/nsh/defconfig index 1744ab6fb3b93131040c74f3dee7c8d352b06e35..e64dc02107eedacc89e0b4d61109d7f35ad7499a 100644 --- a/configs/us7032evb1/nsh/defconfig +++ b/configs/us7032evb1/nsh/defconfig @@ -53,7 +53,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set CONFIG_ARCH_RENESAS=y # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -239,7 +238,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -439,7 +437,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/us7032evb1/ostest/defconfig b/configs/us7032evb1/ostest/defconfig index 4b2fe31023e1c828d7f7e140c70ef8c810e12aca..0c196b33de5e8b54bbeaa052b6755b00dc26ca9e 100644 --- a/configs/us7032evb1/ostest/defconfig +++ b/configs/us7032evb1/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set CONFIG_ARCH_RENESAS=y # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -238,7 +237,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -440,7 +438,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/viewtool-stm32f107/README.txt b/configs/viewtool-stm32f107/README.txt index e84f13aec01bb26117321eac2338c887f4b95de5..04ff1afbb2a30a93ec8f4712cba72453c916759e 100644 --- a/configs/viewtool-stm32f107/README.txt +++ b/configs/viewtool-stm32f107/README.txt @@ -365,7 +365,6 @@ ViewTool DP83848 Ethernet Module Networking (required) CONFIG_NET=y : Enabled networking support - CONFIG_NET_MULTIBUFFER=y : Required by driver CONFIG_NSH_NOMAC=y Networking (recommended/typical) diff --git a/configs/viewtool-stm32f107/highpri/defconfig b/configs/viewtool-stm32f107/highpri/defconfig index be27c3afcf975729549a660179dc2391182bb3c4..23206b58e0ef33a640457876ada7e7b20aa18104 100644 --- a/configs/viewtool-stm32f107/highpri/defconfig +++ b/configs/viewtool-stm32f107/highpri/defconfig @@ -65,10 +65,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -357,6 +358,12 @@ CONFIG_STM32_HAVE_ADC3=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y # CONFIG_STM32_HAVE_CAN2 is not set CONFIG_STM32_HAVE_DAC1=y @@ -685,6 +692,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -692,6 +701,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -727,7 +737,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -783,6 +792,7 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -882,6 +892,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -928,6 +940,7 @@ CONFIG_ARCH_HAVE_TLS=y # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -959,7 +972,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -996,6 +1008,7 @@ CONFIG_ARCH_HAVE_TLS=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1040,6 +1053,7 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/viewtool-stm32f107/netnsh/defconfig b/configs/viewtool-stm32f107/netnsh/defconfig index 3da3e1b85b51c47b8f4a366114c2d02ed914734b..4c9058eef1f55396f585aa290d8a2125e0c8f7f6 100644 --- a/configs/viewtool-stm32f107/netnsh/defconfig +++ b/configs/viewtool-stm32f107/netnsh/defconfig @@ -66,7 +66,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -81,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -771,10 +769,9 @@ CONFIG_TELNET_TXBUFFER_SIZE=256 # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -798,7 +795,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -876,13 +872,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -CONFIG_NET_MULTIBUFFER=y CONFIG_NET_ETH_MTU=650 CONFIG_NET_ETH_TCP_RECVWNDO=624 CONFIG_NET_GUARDSIZE=2 @@ -1161,7 +1155,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/viewtool-stm32f107/nsh/defconfig b/configs/viewtool-stm32f107/nsh/defconfig index 8de03f07146a7aedfd4687ea8d7c58dc96ca0d9d..5da2fdda7021b0453c0bbee179f4be491c361df1 100644 --- a/configs/viewtool-stm32f107/nsh/defconfig +++ b/configs/viewtool-stm32f107/nsh/defconfig @@ -65,10 +65,12 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_MISOC is not set # CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_XTENSA is not set # CONFIG_ARCH_Z16 is not set # CONFIG_ARCH_Z80 is not set CONFIG_ARCH="arm" @@ -78,7 +80,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -357,6 +358,12 @@ CONFIG_STM32_HAVE_ADC2=y # CONFIG_STM32_HAVE_ADC2_DMA is not set # CONFIG_STM32_HAVE_ADC3_DMA is not set # CONFIG_STM32_HAVE_ADC4_DMA is not set +# CONFIG_STM32_HAVE_SDADC1 is not set +# CONFIG_STM32_HAVE_SDADC2 is not set +# CONFIG_STM32_HAVE_SDADC3 is not set +# CONFIG_STM32_HAVE_SDADC1_DMA is not set +# CONFIG_STM32_HAVE_SDADC2_DMA is not set +# CONFIG_STM32_HAVE_SDADC3_DMA is not set CONFIG_STM32_HAVE_CAN1=y CONFIG_STM32_HAVE_CAN2=y CONFIG_STM32_HAVE_DAC1=y @@ -389,6 +396,7 @@ CONFIG_STM32_PWR=y # CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set +CONFIG_STM32_SYSCFG=y # CONFIG_STM32_TIM1 is not set # CONFIG_STM32_TIM2 is not set # CONFIG_STM32_TIM3 is not set @@ -530,6 +538,7 @@ CONFIG_RAM_SIZE=65536 # CONFIG_ARCH_BOARD_CLOUDCTRL is not set # CONFIG_ARCH_BOARD_OLIMEX_STM32P107 is not set # CONFIG_ARCH_BOARD_SHENZHOU is not set +# CONFIG_ARCH_BOARD_STM32_BUTTERFLY2 is not set CONFIG_ARCH_BOARD_VIEWTOOL_STM32F107=y # CONFIG_ARCH_BOARD_CUSTOM is not set CONFIG_ARCH_BOARD="viewtool-stm32f107" @@ -680,6 +689,8 @@ CONFIG_DEV_NULL=y CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set +# CONFIG_ARCH_HAVE_SPI_CRCGENERATION is not set +# CONFIG_ARCH_HAVE_SPI_CS_CONTROL is not set CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_I2S is not set @@ -687,6 +698,7 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # Timer Driver Support # # CONFIG_TIMER is not set +# CONFIG_ONESHOT is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -722,7 +734,6 @@ CONFIG_ARCH_HAVE_SPI_BITORDER=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -778,6 +789,7 @@ CONFIG_USART1_2STOP=0 # CONFIG_USBHOST is not set # CONFIG_HAVE_USBTRACE is not set # CONFIG_DRIVERS_WIRELESS is not set +# CONFIG_DRIVERS_CONTACTLESS is not set # # System Logging @@ -878,6 +890,8 @@ CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBC_FLOATINGPOINT is not set CONFIG_LIBC_LONG_LONG=y # CONFIG_LIBC_IOCTL_VARIADIC is not set +# CONFIG_LIBC_WCHAR is not set +# CONFIG_LIBC_LOCALE is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -929,6 +943,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # Examples # # CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CCTYPE is not set # CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -960,7 +975,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set @@ -998,6 +1012,7 @@ CONFIG_EXAMPLES_NSH=y # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_MICROPYTHON is not set +# CONFIG_INTERPRETERS_MINIBASIC is not set # CONFIG_INTERPRETERS_PCODE is not set # @@ -1069,6 +1084,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_MOUNT is not set # CONFIG_NSH_DISABLE_MV is not set # CONFIG_NSH_DISABLE_MW is not set +CONFIG_NSH_DISABLE_PRINTF=y # CONFIG_NSH_DISABLE_PS is not set # CONFIG_NSH_DISABLE_PUT is not set # CONFIG_NSH_DISABLE_PWD is not set @@ -1136,6 +1152,7 @@ CONFIG_READLINE_ECHO=y # CONFIG_READLINE_TABCOMPLETION is not set # CONFIG_READLINE_CMD_HISTORY is not set # CONFIG_SYSTEM_SUDOKU is not set +# CONFIG_SYSTEM_TEE is not set # CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/viewtool-stm32f107/src/stm32_appinit.c b/configs/viewtool-stm32f107/src/stm32_appinit.c index e43fcef6bf31dfdafd1c1671f06e43683a05b249..82e4ff85af40fdd18cb278f91f85ed1909ade4bc 100644 --- a/configs/viewtool-stm32f107/src/stm32_appinit.c +++ b/configs/viewtool-stm32f107/src/stm32_appinit.c @@ -146,17 +146,42 @@ static int rtc_driver_initialize(void) int board_app_initialize(uintptr_t arg) { + int ret; + #ifdef HAVE_RTC_DRIVER - (void)rtc_driver_initialize(); + ret = rtc_driver_initialize(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: rtc_driver_initialize failed: %d\n", ret); + } +#endif + +#ifdef HAVE_MMCSD + ret = stm32_sdinitialize(CONFIG_NSH_MMCSDSLOTNO); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_sdinitialize failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = stm32_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_can_setup failed: %d\n", ret); + } #endif #ifdef CONFIG_MPL115A - stm32_mpl115ainitialize("/dev/press"); + ret = stm32_mpl115ainitialize("/dev/press"); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: stm32_mpl115ainitialize failed: %d\n", ret); + } #endif -#ifdef HAVE_MMCSD - return stm32_sdinitialize(CONFIG_NSH_MMCSDSLOTNO); -#else + UNUSED(ret); return OK; -#endif } diff --git a/configs/viewtool-stm32f107/src/stm32_can.c b/configs/viewtool-stm32f107/src/stm32_can.c index ce2b5912f5dbae409327ae609a4b92345830607b..462e5a72ba84d4cbccd69de1525f7fe2715727b8 100644 --- a/configs/viewtool-stm32f107/src/stm32_can.c +++ b/configs/viewtool-stm32f107/src/stm32_can.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/viewtool-stm32f107/src/stm32_can.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include "stm32.h" #include "stm32_can.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -59,55 +59,57 @@ /* Configuration ********************************************************************/ /* The STM32F107VC supports CAN1 and CAN2 */ -#define CAN_PORT 1 +#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) +# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." +# undef CONFIG_STM32_CAN2 +#endif + +#ifdef CONFIG_STM32_CAN1 +# define CAN_PORT 1 +#else +# define CAN_PORT 2 +#endif /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: stm32_can_setup * * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int stm32_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ + /* Call stm32_caninitialize() to get an instance of the CAN interface */ - if (!initialized) + can = stm32_caninitialize(CAN_PORT); + if (can == NULL) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN driver at "/dev/can0" */ - initialized = true; + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: can_register failed: %d\n", ret); + return ret; } return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && CONFIG_STM32_CAN1 */ +#endif /* CONFIG_CAN */ diff --git a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h index bf4c2692adbe339266240ffcf89be1db7e91b4d1..508f10c8a27571a7cdb1f9266d8456e4325e2749 100644 --- a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h +++ b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h @@ -342,6 +342,18 @@ void weak_function stm32_usbdev_initialize(void); int stm32_sdinitialize(int minor); +/**************************************************************************** + * Name: stm32_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ****************************************************************************/ + +#ifdef CONFIG_CAN +int stm32_can_setup(void); +#endif + /**************************************************************************** * Name: stm32_mpl115ainitialize * diff --git a/configs/xtrs/nsh/defconfig b/configs/xtrs/nsh/defconfig index 8bf05716eb3e1c3c8b0e1fbdacd4861e156c3b4a..18cd15188b65d7aaad267371c545a0c22591ea6f 100644 --- a/configs/xtrs/nsh/defconfig +++ b/configs/xtrs/nsh/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -193,7 +192,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -339,7 +337,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/xtrs/ostest/defconfig b/configs/xtrs/ostest/defconfig index 178cf58462e95097a0595e33d65ed454fb35163b..b03cffef6fbadb101eae0a24d587c19f95f779e1 100644 --- a/configs/xtrs/ostest/defconfig +++ b/configs/xtrs/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -192,7 +191,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -343,7 +341,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/xtrs/pashello/defconfig b/configs/xtrs/pashello/defconfig index 218a91f1c96a60b134263f14036f0cd294fb28cf..b38652e6c050db433748463079ad9005c9ad3609 100644 --- a/configs/xtrs/pashello/defconfig +++ b/configs/xtrs/pashello/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -193,7 +192,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -339,7 +337,6 @@ CONFIG_EXAMPLES_PASHELLO=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/z16f2800100zcog/nsh/defconfig b/configs/z16f2800100zcog/nsh/defconfig index 3c2af0733f879cc7252aacf744ee6b164fad5e4c..781652bd58f760d7ff6338549464d8e91c41e10b 100644 --- a/configs/z16f2800100zcog/nsh/defconfig +++ b/configs/z16f2800100zcog/nsh/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -332,7 +331,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -583,7 +581,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/z16f2800100zcog/ostest/defconfig b/configs/z16f2800100zcog/ostest/defconfig index 10554e2b38a347a3f176345fdae30278275cc2fe..dec05b3b6c62b72a28ee1333c498235daaf4eb36 100644 --- a/configs/z16f2800100zcog/ostest/defconfig +++ b/configs/z16f2800100zcog/ostest/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -332,7 +331,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -582,7 +580,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/z16f2800100zcog/pashello/defconfig b/configs/z16f2800100zcog/pashello/defconfig index 984a060075dcf5f38e86f268a0eec663435bf649..04d067caa424a75c320da34909eb9442ff53e5e5 100644 --- a/configs/z16f2800100zcog/pashello/defconfig +++ b/configs/z16f2800100zcog/pashello/defconfig @@ -69,7 +69,6 @@ CONFIG_WINDOWS_CYGWIN=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -216,7 +215,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -376,7 +374,6 @@ CONFIG_EXAMPLES_PASHELLO=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/z80sim/nsh/defconfig b/configs/z80sim/nsh/defconfig index d7ee01a879e68a71ac7b2e494748a74f99d992d9..7034fccbf926b4cdc1945860c61bbb13937345bc 100644 --- a/configs/z80sim/nsh/defconfig +++ b/configs/z80sim/nsh/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -193,7 +192,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set @@ -339,7 +337,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/z80sim/ostest/defconfig b/configs/z80sim/ostest/defconfig index f0f1fa906deedc832187ca68a97e4feb3d5e0db4..f7eb3afd2c3946d205b174fc0ebc3df13994abba 100644 --- a/configs/z80sim/ostest/defconfig +++ b/configs/z80sim/ostest/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -192,7 +191,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -343,7 +341,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/z80sim/pashello/defconfig b/configs/z80sim/pashello/defconfig index b4916a226979f2b695070b7d42c1d502280fd04e..6945b3c54771d2ed5711f3da8dc1e03de8073164 100644 --- a/configs/z80sim/pashello/defconfig +++ b/configs/z80sim/pashello/defconfig @@ -53,7 +53,6 @@ CONFIG_WINDOWS_NATIVE=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -192,7 +191,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set @@ -338,7 +336,6 @@ CONFIG_EXAMPLES_PASHELLO=y # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_QENCODER is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERLOOP is not set diff --git a/configs/z8encore000zco/ostest/defconfig b/configs/z8encore000zco/ostest/defconfig index c1c37025548e9548361a17aace71eb47de63a0d5..7b8c2d79c809359b64c8b55e9a416cefcceb4d25 100644 --- a/configs/z8encore000zco/ostest/defconfig +++ b/configs/z8encore000zco/ostest/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -346,7 +345,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -587,7 +585,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/z8f64200100kit/ostest/defconfig b/configs/z8f64200100kit/ostest/defconfig index 896db3448d9557883cda4286434ea00c5377ec29..31c730fc47d45bdcf45fbc4dbffdfe530e5f2313 100644 --- a/configs/z8f64200100kit/ostest/defconfig +++ b/configs/z8f64200100kit/ostest/defconfig @@ -62,7 +62,6 @@ CONFIG_DEBUG_FULLOPT=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -346,7 +345,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -588,7 +586,6 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/zkit-arm-1769/hello/defconfig b/configs/zkit-arm-1769/hello/defconfig index d509b93944dda334db2aca54edf499c8d54349a5..f3a86fcb981c7b2d1ebf6a5a1c0f29ea84b009ed 100644 --- a/configs/zkit-arm-1769/hello/defconfig +++ b/configs/zkit-arm-1769/hello/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -491,10 +489,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -518,7 +515,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -594,13 +590,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -858,7 +852,6 @@ CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/zkit-arm-1769/nsh/defconfig b/configs/zkit-arm-1769/nsh/defconfig index 4e3b92cbb236d504c45ff54ef8fa75e888c8ac3c..8a675b6180b57f8f04a7321fec25ba4cd2003272 100644 --- a/configs/zkit-arm-1769/nsh/defconfig +++ b/configs/zkit-arm-1769/nsh/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,8 +316,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -530,10 +526,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -557,7 +552,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -634,13 +628,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -922,7 +914,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/zkit-arm-1769/nxhello/defconfig b/configs/zkit-arm-1769/nxhello/defconfig index a969f3a503db258f94c3eb159a59090aa41fc5cf..4c7dfae49f312b32e6e1b03d3a2ef6bc5adcc7c8 100644 --- a/configs/zkit-arm-1769/nxhello/defconfig +++ b/configs/zkit-arm-1769/nxhello/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -318,8 +316,6 @@ CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_RESET is not set # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_GRAPHICS is not set # CONFIG_BOARDCTL_IOCTL is not set @@ -568,10 +564,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -595,7 +590,6 @@ CONFIG_ETH0_PHY_DP83848C=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -672,13 +666,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -1054,7 +1046,6 @@ CONFIG_EXAMPLES_NXHELLO_DEFAULT_FONT=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/zkit-arm-1769/src/Makefile b/configs/zkit-arm-1769/src/Makefile index 80905b88538044e8c6d5695c7a1ff6dfb78651c1..9e1a628a18460f4f21727eedce6fc6575a7f628a 100644 --- a/configs/zkit-arm-1769/src/Makefile +++ b/configs/zkit-arm-1769/src/Makefile @@ -6,7 +6,7 @@ # # Based on configs/lpcxpresso-lpc1768/src/Makefile # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 201, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/configs/zkit-arm-1769/src/lpc17_adc.c b/configs/zkit-arm-1769/src/lpc17_adc.c index 3d3628ea9cbe143c257065e2dc6ec4cb3ac5f46f..207aa83f82c8cda14825bb51db8aa05c5b0eab53 100644 --- a/configs/zkit-arm-1769/src/lpc17_adc.c +++ b/configs/zkit-arm-1769/src/lpc17_adc.c @@ -6,7 +6,7 @@ * * Based on configs/stm3220g-eval/src/lpc17_adc.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -76,15 +76,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_adc_setup + * Name: zkit_adc_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/adc. + * Initialize ADC and register the ADC driver. * ************************************************************************************/ -int board_adc_setup(void) +int zkit_adc_setup(void) { static bool initialized = false; struct adc_dev_s *adc; diff --git a/configs/zkit-arm-1769/src/lpc17_appinit.c b/configs/zkit-arm-1769/src/lpc17_appinit.c index 3854e0d1c4651856c22f72122eef21404975d5bf..b98cb2bab9c2a3a23c2abc2600621cac76a839ef 100644 --- a/configs/zkit-arm-1769/src/lpc17_appinit.c +++ b/configs/zkit-arm-1769/src/lpc17_appinit.c @@ -6,7 +6,7 @@ * * Based on config/lpcxpresso-lpc1768/src/lpc17_appinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -53,6 +53,7 @@ #include #include "lpc17_spi.h" +#include "zkit-arm-1769.h" /**************************************************************************** * Pre-processor Definitions @@ -160,9 +161,10 @@ int board_app_initialize(uintptr_t arg) { + int ret; + #ifdef CONFIG_NSH_HAVEMMCSD FAR struct spi_dev_s *spi; - int ret; /* Get the SPI port */ @@ -190,5 +192,27 @@ int board_app_initialize(uintptr_t arg) message("Successfuly bound SPI port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); #endif + +#ifdef CONFIG_ADC + /* Initialize ADC and register the ADC driver. */ + + ret = zkit_adc_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: zkit_adc_setup failed: %d\n", ret); + } +#endif + +#ifdef CONFIG_CAN + /* Initialize CAN and register the CAN driver. */ + + ret = zkit_can_setup(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: zkit_can_setup failed: %d\n", ret); + } +#endif + + UNUSED(ret); return OK; } diff --git a/configs/zkit-arm-1769/src/lpc17_can.c b/configs/zkit-arm-1769/src/lpc17_can.c index 03176894a9a8a78074966c8170dd5b7f4de19f41..6b4a1021f8c7baa0fb9ba7acaa6fc5ad6f2b6716 100644 --- a/configs/zkit-arm-1769/src/lpc17_can.c +++ b/configs/zkit-arm-1769/src/lpc17_can.c @@ -6,7 +6,7 @@ * * Based on configs/olimex-lpc1766stk/src/lpc17_can.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ #include "lpc17_can.h" #include "zkit-arm-1769.h" -#if defined(CONFIG_CAN) && (defined(CONFIG_LPC17_CAN1) || defined(CONFIG_LPC17_CAN2)) +#ifdef CONFIG_CAN /************************************************************************************ * Pre-processor Definitions @@ -71,70 +71,63 @@ ************************************************************************************/ /************************************************************************************ - * Name: board_can_initialize + * Name: zkit_can_setup * * Description: - * All LPC17 architectures must provide the following interface to work with - * examples/can. + * Initialize CAN and register the CAN device * ************************************************************************************/ -int board_can_initialize(void) +int zkit_can_setup(void) { - static bool initialized = false; +#if defined(CONFIG_LPC17_CAN1) || defined(CONFIG_LPC17_CAN2) struct can_dev_s *can; int ret; - /* Check if we have already initialized */ +#ifdef CONFIG_LPC17_CAN1 + /* Call lpc17_caninitialize() to get an instance of the CAN1 interface */ - if (!initialized) + can = lpc17_caninitialize(CAN_PORT1); + if (can == NULL) { -#ifdef CONFIG_LPC17_CAN1 - /* Call lpc17_caninitialize() to get an instance of the CAN1 interface */ - - can = lpc17_caninitialize(CAN_PORT1); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN1 interface\n"); - return -ENODEV; - } - - /* Register the CAN1 driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - if (ret < 0) - { - canerr("ERROR: CAN1 register failed: %d\n", ret); - return ret; - } + canerr("ERROR: Failed to get CAN1 interface\n"); + return -ENODEV; + } + + /* Register the CAN1 driver at "/dev/can0" */ + + ret = can_register("/dev/can0", can); + if (ret < 0) + { + canerr("ERROR: CAN1 register failed: %d\n", ret); + return ret; + } #endif #ifdef CONFIG_LPC17_CAN2 - /* Call lpc17_caninitialize() to get an instance of the CAN2 interface */ - - can = lpc17_caninitialize(CAN_PORT2); - if (can == NULL) - { - canerr("ERROR: Failed to get CAN2 interface\n"); - return -ENODEV; - } - - /* Register the CAN2 driver at "/dev/can1" */ - - ret = can_register("/dev/can1", can); - if (ret < 0) - { - canerr("ERROR: CAN2 register failed: %d\n", ret); - return ret; - } -#endif + /* Call lpc17_caninitialize() to get an instance of the CAN2 interface */ + + can = lpc17_caninitialize(CAN_PORT2); + if (can == NULL) + { + canerr("ERROR: Failed to get CAN2 interface\n"); + return -ENODEV; + } - /* Now we are initialized */ + /* Register the CAN2 driver at "/dev/can1" */ - initialized = true; + ret = can_register("/dev/can1", can); + if (ret < 0) + { + canerr("ERROR: CAN2 register failed: %d\n", ret); + return ret; } +#endif return OK; +#else + return -ENODEV; +#endif } -#endif /* CONFIG_CAN && (CONFIG_LPC17_CAN1 || CONFIG_LPC17_CAN2) */ +#endif /* CONFIG_CAN */ diff --git a/configs/zkit-arm-1769/src/zkit-arm-1769.h b/configs/zkit-arm-1769/src/zkit-arm-1769.h index 84de2d3cb24ca464bfb6e139fd7a73868174fedd..1928c0bbb8db7ab1980ab2a693a4cb3fe69a0fdb 100644 --- a/configs/zkit-arm-1769/src/zkit-arm-1769.h +++ b/configs/zkit-arm-1769/src/zkit-arm-1769.h @@ -6,7 +6,7 @@ * * Based on configs/lpcxpresso-lpc1768/src/lpcxpresso.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -249,5 +249,29 @@ void weak_function zkit_sspdev_initialize(void); void weak_function zkit_spidev_initialize(void); +/************************************************************************************ + * Name: zkit_adc_setup + * + * Description: + * Initialize ADC and register the ADC driver. + * + ************************************************************************************/ + +#ifdef CONFIG_ADC +int zkit_adc_setup(void); +#endif + +/************************************************************************************ + * Name: zkit_can_setup + * + * Description: + * Initialize CAN and register the CAN device + * + ************************************************************************************/ + +#ifdef CONFIG_CAN +int zkit_can_setup(void); +#endif + #endif /* __ASSEMBLY__ */ #endif /* _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H */ diff --git a/configs/zkit-arm-1769/thttpd/defconfig b/configs/zkit-arm-1769/thttpd/defconfig index d385519e2c505c2508d509368efac2cb13e7fbde..0438660456dedc642f42fe8619cc90332cde6d7b 100644 --- a/configs/zkit-arm-1769/thttpd/defconfig +++ b/configs/zkit-arm-1769/thttpd/defconfig @@ -61,7 +61,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set # CONFIG_ARCH_MISOC is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_RISCV is not set # CONFIG_ARCH_SIM is not set @@ -76,7 +75,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -491,10 +489,9 @@ CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y # CONFIG_NET_DM90x0 is not set # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set -# CONFIG_NET_E1000 is not set + # CONFIG_NET_SLIP is not set # CONFIG_NET_FTMAC100 is not set -# CONFIG_NET_VNET is not set # # External Ethernet PHY Device Support @@ -521,7 +518,6 @@ CONFIG_DEV_FIFO_SIZE=1024 # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -597,13 +593,11 @@ CONFIG_SYSLOG_CONSOLE=y CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # # Driver buffer configuration # -# CONFIG_NET_MULTIBUFFER is not set CONFIG_NET_ETH_MTU=590 CONFIG_NET_ETH_TCP_RECVWNDO=536 CONFIG_NET_GUARDSIZE=2 @@ -862,7 +856,6 @@ CONFIG_ARCH_HAVE_TLS=y # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RFID_READUID is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set diff --git a/configs/zp214xpa/nsh/defconfig b/configs/zp214xpa/nsh/defconfig index 60c6a1e69f0e73890330dcbfa998e4d9778e8597..547c51e58c24a13704e0493f1b57ef8a12e20403 100644 --- a/configs/zp214xpa/nsh/defconfig +++ b/configs/zp214xpa/nsh/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -395,7 +393,6 @@ CONFIG_DEV_NULL=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set # CONFIG_SERIAL_REMOVABLE is not set @@ -637,7 +634,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/configs/zp214xpa/nxlines/defconfig b/configs/zp214xpa/nxlines/defconfig index fc721d2aa32bc64e938715c9a8491223ea55b653..06f8adea17abc381f4b118acd405b66111e03d88 100644 --- a/configs/zp214xpa/nxlines/defconfig +++ b/configs/zp214xpa/nxlines/defconfig @@ -60,7 +60,6 @@ CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set # CONFIG_ARCH_MIPS is not set -# CONFIG_ARCH_RGMP is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_SIM is not set # CONFIG_ARCH_X86 is not set @@ -73,7 +72,6 @@ CONFIG_ARCH="arm" # # CONFIG_ARCH_CHIP_A1X is not set # CONFIG_ARCH_CHIP_C5471 is not set -# CONFIG_ARCH_CHIP_CALYPSO is not set # CONFIG_ARCH_CHIP_DM320 is not set # CONFIG_ARCH_CHIP_EFM32 is not set # CONFIG_ARCH_CHIP_IMX1 is not set @@ -237,8 +235,6 @@ CONFIG_ARCH_BOARD="zp214xpa" CONFIG_LIB_BOARDCTL=y # CONFIG_BOARDCTL_UNIQUEID is not set # CONFIG_BOARDCTL_TSCTEST is not set -# CONFIG_BOARDCTL_ADCTEST is not set -# CONFIG_BOARDCTL_PWMTEST is not set CONFIG_BOARDCTL_GRAPHICS=y # CONFIG_BOARDCTL_IOCTL is not set @@ -443,7 +439,6 @@ CONFIG_LCD_LANDSCAPE=y # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set -# CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_SERIAL_REMOVABLE is not set @@ -785,7 +780,6 @@ CONFIG_EXAMPLES_NXLINES_EXTERNINIT=y # CONFIG_EXAMPLES_POSIXSPAWN is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_RGBLED is not set -# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set # CONFIG_EXAMPLES_SERIALRX is not set diff --git a/drivers/Kconfig b/drivers/Kconfig index 4ac8a9d0c69d6eec5ec7098296446e0788da585d..740602b9f25fb8b6594e3d07cd26360551bb2879 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -519,23 +519,6 @@ if SENSORS source drivers/sensors/Kconfig endif # SENSORS -menuconfig SERCOMM_CONSOLE - bool "Osmocom-bb Sercomm Driver Support" - default n - ---help--- - Sercomm is the transport used by osmocom-bb that runs on top of serial. - See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed the usage - of nuttx with sercomm. - - drivers/sercomm is only built if SERCOMM_CONSOLE in the NuttX - configuration file. If you attempt to build this driver without - osmocom-bb, you will get compilation errors because of header files - that are needed from the osmocom-bb. - -if SERCOMM_CONSOLE -source drivers/sercomm/Kconfig -endif # SERCOMM_CONSOLE - menuconfig SERIAL bool "Serial Driver Support" default y diff --git a/drivers/Makefile b/drivers/Makefile index daac4cd18c172b719f49d5acda2beae35241cb1a..94f027afbbf822f8405ec5006f0f29118442248e 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -66,7 +66,6 @@ include net$(DELIM)Make.defs include pipes$(DELIM)Make.defs include power$(DELIM)Make.defs include sensors$(DELIM)Make.defs -include sercomm$(DELIM)Make.defs include serial$(DELIM)Make.defs include spi$(DELIM)Make.defs include syslog$(DELIM)Make.defs diff --git a/drivers/README.txt b/drivers/README.txt index fbb13ce25d77c80a8e3c040a302f174e8284cfa3..f9f23af06f2ee1ae4baa5ed7db95f52d92b7385a 100644 --- a/drivers/README.txt +++ b/drivers/README.txt @@ -137,16 +137,6 @@ sensors/ measure and convert voltage levels. DACs, however, are retained in the analog/ sub-directory. -sercomm/ - Sercomm is the transport used by osmocom-bb that runs on top of serial. - See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed the usage - of nuttx with sercomm. - - drivers/sercomm is only built if CONFIG_SERCOMM_CONSOLE in the NuttX - configuration file. If you attempt to build this driver without - osmocom-bb, you will get compilation errors because of header files - that are needed from the osmocom-bb. - serial/ Front-end character drivers for chip-specific UARTs. This provide some TTY-like functionality and are commonly used (but not required for) diff --git a/drivers/analog/ads1242.c b/drivers/analog/ads1242.c index ee7c39582e732ddc6dd9ce3ae9f1e69af054b5b5..018da51cf53c7117400f9a62003930c456618f25 100644 --- a/drivers/analog/ads1242.c +++ b/drivers/analog/ads1242.c @@ -403,15 +403,15 @@ static void ads1242_print_regs(FAR struct ads1242_dev_s *dev, char const *msg) uint8_t mux_reg_value = 0; uint8_t acr_reg_value = 0; - _info("%s\n", msg); + ainfo("%s\n", msg); ads1242_read_reg(dev, ADS1242_REG_SETUP, &setup_reg_value); ads1242_read_reg(dev, ADS1242_REG_MUX, &mux_reg_value); ads1242_read_reg(dev, ADS1242_REG_ACR, &acr_reg_value); - _info("SETUP %02X\n", setup_reg_value); - _info("MUX %02X\n", mux_reg_value); - _info("ACR %02X\n", acr_reg_value); + ainfo("SETUP %02X\n", setup_reg_value); + ainfo("MUX %02X\n", mux_reg_value); + ainfo("ACR %02X\n", acr_reg_value); } #endif /* CONFIG_DEBUG_FEATURES && CONFIG_DEBUG_INFO */ diff --git a/drivers/contactless/pn532.h b/drivers/contactless/pn532.h index ee6980532b3932cc69903d95c29d35318297cc33..87013f7dbe1cf0bcb700ed5fed6996faffa4f537 100644 --- a/drivers/contactless/pn532.h +++ b/drivers/contactless/pn532.h @@ -119,7 +119,7 @@ * Public Types ****************************************************************************/ -struct pn532_frame +begin_packed_struct struct pn532_frame { uint8_t preamble; /* 0x00 */ uint16_t start_code; /* 0x00FF (BE) -> 0xFF00 (LE) */ @@ -130,22 +130,22 @@ struct pn532_frame uint8_t tfi; /* Frame idenfifier 0xD4, 0xD5 */ uint8_t data[]; /* LEN-1 bytes of Packet Data Information. * The first byte PD0 is the Command Code */ -} packed_struct; +} end_packed_struct; -struct pn_poll_response +begin_packed_struct struct pn_poll_response { uint8_t nbtg; uint8_t tg; uint8_t target_data[]; -} packed_struct; +} end_packed_struct; -struct pn_target_type_a +begin_packed_struct struct pn_target_type_a { uint16_t sens_res; uint8_t sel_res; uint8_t nfcid_len; uint8_t nfcid_data[]; -} packed_struct; +} end_packed_struct; struct pn_firmware_version { diff --git a/drivers/lcd/README.txt b/drivers/lcd/README.txt index 85d4f52d71b10b0a858aba947fe29441b34a4e0d..266a583654dbb58b8b8bdb177cb9ee83b812e41f 100644 --- a/drivers/lcd/README.txt +++ b/drivers/lcd/README.txt @@ -162,10 +162,6 @@ that support additional LCDs. LCD drivers in the configuration directory if they support some differ LCD interface (such as a parallel interface) that makes then less re-usable: - SSD1783 Drivers: - - configs/compal_e99/src/ssd1783.c - SSD1289 Drivers: configs/hymini-stm32v/src/ssd1289.c. See also drivers/lcd/ssd1298.c diff --git a/drivers/lcd/ssd1306.h b/drivers/lcd/ssd1306.h index b04f2bc400983dca388ee5b44bd12f1679da7810..9fd38cc0207d4066dcd1bb4beeba0b3d623707c8 100644 --- a/drivers/lcd/ssd1306.h +++ b/drivers/lcd/ssd1306.h @@ -276,7 +276,7 @@ void ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len) #ifdef CONFIG_LCD_SSD1306_SPI void ssd1306_select(FAR struct ssd1306_dev_s *priv, bool cs); void ssd1306_cmddata(FAR struct ssd1306_dev_s *priv, bool cmd); -static inline void ssd1306_configspi(FAR struct spi_dev_s *spi) +static inline void ssd1306_configspi(FAR struct spi_dev_s *spi); #else # define ssd1306_select(priv, cs) diff --git a/drivers/lcd/ssd1306_spi.c b/drivers/lcd/ssd1306_spi.c index 9f3817a7b6456076613e060716ed34409d35ddd5..33d6d61961254a7803a8bd1a3ae97a9b56f76c07 100644 --- a/drivers/lcd/ssd1306_spi.c +++ b/drivers/lcd/ssd1306_spi.c @@ -45,7 +45,7 @@ #include #include - +#include #include "ssd1306.h" #if defined(CONFIG_LCD_SSD1306) && defined(CONFIG_LCD_SSD1306_SPI) @@ -109,7 +109,7 @@ void ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len) { /* Send byte value to display */ - (void)SPI_SNDBLOCK(priv, data, len); + (void)SPI_SNDBLOCK(priv->spi, data, len); } /**************************************************************************** diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index dbdf4e98ca8f105e389697f62413c033baccea6e..b59b9f2fa36f55da4ad5aa10edd5183e6aed69db 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -857,7 +857,7 @@ static void mmcsd_decodeCID(FAR struct mmcsd_state_s *priv, uint32_t cid[4]) */ decoded.mid = cid[0] >> 24; - decoded.oid = (cid[0] >> 16) & 0xffff; + decoded.oid = (cid[0] >> 8) & 0xffff; decoded.pnm[0] = cid[0] & 0xff; /* Word 2: Bits 64:95 @@ -893,9 +893,9 @@ static void mmcsd_decodeCID(FAR struct mmcsd_state_s *priv, uint32_t cid[4]) decoded.mdt = (cid[3] >> 8) & 0x0fff; decoded.crc = (cid[3] >> 1) & 0x7f; - finfo("mid: %02x oid: %04x pnm: %s prv: %d psn: %d mdt: %02x crc: %02x\n", + finfo("mid: %02x oid: %04x pnm: %s prv: %d psn: %lu mdt: %02x crc: %02x\n", decoded.mid, decoded.oid, decoded.pnm, decoded.prv, - decoded.psn, decoded.mdt, decoded.crc); + (unsigned long)decoded.psn, decoded.mdt, decoded.crc); } #endif @@ -1476,6 +1476,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv, { offset = startblock << priv->blockshift; } + finfo("nbytes=%d byte offset=%d\n", nbytes, offset); /* Select the block size for the card */ @@ -2234,7 +2235,8 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry) geometry->geo_mediachanged ? "true" : "false", geometry->geo_writeenabled ? "true" : "false"); finfo("nsectors: %lu sectorsize: %d\n", - (long)geometry->geo_nsectors, geometry->geo_sectorsize); + ((unsigned long))geometry->geo_nsectors, + geometry->geo_sectorsize); priv->mediachanged = false; ret = OK; diff --git a/drivers/mtd/mtd_config.c b/drivers/mtd/mtd_config.c index 35131461c65d49d0314a207e22ec9adfc5a9a957..ca6654b0e64687ade0232fbf6aee3390bb4c354c 100644 --- a/drivers/mtd/mtd_config.c +++ b/drivers/mtd/mtd_config.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/mtd/mtd_config.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit * With Updates from Gregory Nutt @@ -101,13 +101,13 @@ struct mtdconfig_struct_s FAR uint8_t *buffer; /* Temp block read buffer */ }; -struct mtdconfig_header_s +begin_packed_struct struct mtdconfig_header_s { uint8_t flags; /* Entry control flags */ uint8_t instance; /* Instance of the item */ uint16_t id; /* ID of the config data item */ uint16_t len; /* Length of the data block */ -} packed_struct; +} end_packed_struct; /**************************************************************************** * Private Function Prototypes diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index 8b2f2586fdd9accee995d83a609afb26f961db8a..655fe36826140445753bfd4e7f9adddd14e74a73 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -900,8 +900,8 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock, * Sets the name of the specified partition. * ****************************************************************************/ -#ifdef CONFIG_MTD_PARTITION_NAMES +#ifdef CONFIG_MTD_PARTITION_NAMES int mtd_setpartitionname(FAR struct mtd_dev_s *mtd, FAR const char *name) { FAR struct mtd_partition_s *priv = (FAR struct mtd_partition_s *)mtd; diff --git a/drivers/mtd/sst26.c b/drivers/mtd/sst26.c index 27648ae91a2565c484d6771585b1943153fd9c05..2654a857e820f30bdd2e3737223fea1c341a26e2 100644 --- a/drivers/mtd/sst26.c +++ b/drivers/mtd/sst26.c @@ -337,8 +337,8 @@ static inline int sst26_readid(struct sst26_dev_s *priv) SPI_SELECT(priv->dev, SPIDEV_FLASH, false); sst26_unlock(priv->dev); - _info("manufacturer: %02x memory: %02x capacity: %02x\n", - manufacturer, memory, capacity); + sstinfo("manufacturer: %02x memory: %02x capacity: %02x\n", + manufacturer, memory, capacity); /* Check for a valid manufacturer and memory type */ diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 5bcb225dd03b107d0c7e750ec7ae98d74fe13a40..83213465e432b0b524834bbe63e60033a508a291 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -9,12 +9,9 @@ config NETDEV_LOOPBACK bool default n if !NET_LOOPBACK default y if NET_LOOPBACK - select NET_NOINTS select ARCH_HAVE_NETDEV_STATISTICS ---help--- - Add support for the local network loopback device, lo. Any additional - networking devices that are enabled must be compatible with - CONFIG_NET_NOINTS. + Add support for the local network loopback device, lo. if NETDEV_LOOPBACK @@ -195,6 +192,26 @@ config DM9X_NINTERFACES default 1 depends on EXPERIMENTAL +choice + prompt "Work queue" + default DM9X_LPWORK if SCHED_LPWORK + default DM9X_HPWORK if !SCHED_LPWORK && SCHED_HPWORK + depends on SCHED_WORKQUEUE + ---help--- + Work queue support is required to use the Ethernet driver. If the + low priority work queue is available, then it should be used by the + driver. + +config DM9X_HPWORK + bool "High priority" + depends on SCHED_HPWORK + +config DM9X_LPWORK + bool "Low priority" + depends on SCHED_LPWORK + +endchoice # Work queue + endif # NET_DM90x0 config NET_CS89x0 @@ -367,26 +384,6 @@ config ENCX24J600_REGDEBUG endif # ENCX24J600 -menuconfig NET_E1000 - bool "E1000 support" - default n - -if NET_E1000 - -config E1000_N_TX_DESC - int "Number of TX descriptors" - default 128 - -config E1000_N_RX_DESC - int "Number of RX descriptors" - default 128 - -config E1000_BUFF_SIZE - int "Buffer size" - default 2048 - -endif # NET_E1000 - menuconfig NET_SLIP bool "SLIP (serial line) support" default n @@ -466,18 +463,6 @@ endchoice # Work queue endif # NET_FTMAC100 -menuconfig NET_VNET - bool "VNET support" - default n - -if NET_VNET - -config VNET_NINTERFACES - int "Number of VNET interfaces" - default 1 - -endif # NET_VNET - if ARCH_HAVE_PHY comment "External Ethernet PHY Device Support" diff --git a/drivers/net/Make.defs b/drivers/net/Make.defs index fe68efb267aee7bf7a7f9efa1e2c2dc9f00c7f56..144313623b6a5656f9d4a7fe87e2c12993e1f235 100644 --- a/drivers/net/Make.defs +++ b/drivers/net/Make.defs @@ -63,14 +63,6 @@ ifeq ($(CONFIG_ENCX24J600),y) CSRCS += encx24j600.c endif -ifeq ($(CONFIG_NET_VNET),y) - CSRCS += vnet.c -endif - -ifeq ($(CONFIG_NET_E1000),y) - CSRCS += e1000.c -endif - ifeq ($(CONFIG_NET_SLIP),y) CSRCS += slip.c endif diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index dd2af6658bfff0af3743e8a2b34b5f8c9e2ddb83..f662f40f38a0fd05c8173392a8177d02b9a16e34 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/net/cs89x0.c * - * Copyright (C) 2009-2011, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2011, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -93,9 +93,7 @@ # define cs89x0_mapirq(irq) g_cs89x0[0] #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ +#define PKTBUF_SIZE (MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE) /**************************************************************************** * Private Data @@ -1008,6 +1006,8 @@ static int cs89x0_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno) { + FAR uint8_t *pktbuf; + /* Sanity checks -- only performed with debug enabled */ #ifdef CONFIG_DEBUG_FEATURES @@ -1030,9 +1030,18 @@ int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno) return -EAGAIN; } + /* Allocate a packet buffer */ + + pktbuf = (FAR uint_t *)kmm_alloc(MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE); + if (pktbuf == NULL) + { + return -ENOMEM; + } + /* Initialize the driver structure */ g_cs89x[devno] = cs89x0; /* Used to map IRQ back to instance */ + cs89x0->cs_dev.d_buf = g_pktbuf; /* Single packet buffer */ cs89x0->cs_dev.d_ifup = cs89x0_ifup; /* I/F down callback */ cs89x0->cs_dev.d_ifdown = cs89x0_ifdown; /* I/F up (new IP address) callback */ cs89x0->cs_dev.d_txavail = cs89x0_txavail; /* New TX data callback */ @@ -1056,4 +1065,3 @@ int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno) } #endif /* CONFIG_NET && CONFIG_NET_CS89x0 */ - diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index ddc809f4c50b34102a5d79adb7a5578e7bdd2d66..61c22a929bdd8db855b134beedef2870ae0980fb 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -1,7 +1,7 @@ /**************************************************************************** - * drivers/net/dm9x.c + * drivers/net/dm90x0.c * - * Copyright (C) 2007-2010, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2014-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: Davicom data sheets (DM9000-DS-F03-041906.pdf, @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,24 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* If processing is not done at the interrupt level, then work queue support + * is required. + */ + +#if !defined(CONFIG_SCHED_WORKQUEUE) +# error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) +#else + + /* Use the low priority work queue if possible */ + +# if defined(CONFIG_DM9X_HPWORK) +# define ETHWORK HPWORK +# elif defined(CONFIG_DM9X_LPWORK) +# define ETHWORK LPWORK +# else +# error Neither CONFIG_DM9X_HPWORK nor CONFIG_DM9X_LPWORK defined +# endif +#endif /* DM90000 and DM9010 register offets */ @@ -265,7 +284,7 @@ /* TX poll deley = 1 seconds. CLK_TCK is the number of clock ticks per second */ -#define DM6X_WDDELAY (1*CLK_TCK) +#define DM9X_WDDELAY (1*CLK_TCK) /* TX timeout = 1 minute */ @@ -273,7 +292,7 @@ /* This is a helper pointer for accessing the contents of the Ethernet header */ -#define BUF ((struct eth_hdr_s *)dm9x->dm_dev.d_buf) +#define BUF ((struct eth_hdr_s *)priv->dm_dev.d_buf) /**************************************************************************** * Private Types @@ -298,10 +317,11 @@ struct dm9x_driver_s { bool dm_bifup; /* true:ifup false:ifdown */ bool dm_b100M; /* true:speed == 100M; false:speed == 10M */ - WDOG_ID dm_txpoll; /* TX poll timer */ - WDOG_ID dm_txtimeout; /* TX timeout timer */ uint8_t dm_ntxpending; /* Count of packets pending transmission */ uint8_t ncrxpackets; /* Number of continuous rx packets */ + WDOG_ID dm_txpoll; /* TX poll timer */ + WDOG_ID dm_txtimeout; /* TX timeout timer */ + struct work_s dm_work; /* For deferring work to the work queue */ /* Mode-dependent function to move data in 8/16/32 I/O modes */ @@ -318,6 +338,10 @@ struct dm9x_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + /* At present, only a single DM90x0 device is supported. */ static struct dm9x_driver_s g_dm9x[CONFIG_DM9X_NINTERFACES]; @@ -340,9 +364,9 @@ static void write8(const uint8_t *ptr, int len); static void write16(const uint8_t *ptr, int len); static void write32(const uint8_t *ptr, int len); -/* static uint16_t dm9x_readsrom(struct dm9x_driver_s *dm9x, int offset); */ -static uint16_t dm9x_phyread(struct dm9x_driver_s *dm9x, int reg); -static void dm9x_phywrite(struct dm9x_driver_s *dm9x, int reg, uint16_t value); +/* static uint16_t dm9x_readsrom(struct dm9x_driver_s *priv, int offset); */ +static uint16_t dm9x_phyread(struct dm9x_driver_s *priv, int reg); +static void dm9x_phywrite(struct dm9x_driver_s *priv, int reg, uint16_t value); #if defined(CONFIG_DM9X_CHECKSUM) static bool dm9x_rxchecksumready(uint8_t); @@ -352,25 +376,33 @@ static bool dm9x_rxchecksumready(uint8_t); /* Common TX logic */ -static int dm9x_transmit(struct dm9x_driver_s *dm9x); +static int dm9x_transmit(struct dm9x_driver_s *priv); static int dm9x_txpoll(struct net_driver_s *dev); /* Interrupt handling */ -static void dm9x_receive(struct dm9x_driver_s *dm9x); -static void dm9x_txdone(struct dm9x_driver_s *dm9x); +static void dm9x_receive(struct dm9x_driver_s *priv); +static void dm9x_txdone(struct dm9x_driver_s *priv); + +static void dm9x_interrupt_work(FAR void *arg); static int dm9x_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static void dm9x_polltimer(int argc, uint32_t arg, ...); -static void dm9x_txtimeout(int argc, uint32_t arg, ...); +static void dm9x_txtimeout_work(FAR void *arg); +static void dm9x_txtimeout_expiry(int argc, uint32_t arg, ...); + +static void dm9x_poll_work(FAR void *arg); +static void dm9x_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int dm9x_ifup(struct net_driver_s *dev); static int dm9x_ifdown(struct net_driver_s *dev); + +static void dm9x_txavail_work(FAR void *arg); static int dm9x_txavail(struct net_driver_s *dev); + #ifdef CONFIG_NET_IGMP static int dm9x_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); @@ -378,8 +410,8 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); /* Initialization functions */ -static void dm9x_bringup(struct dm9x_driver_s *dm9x); -static void dm9x_reset(struct dm9x_driver_s *dm9x); +static void dm9x_bringup(struct dm9x_driver_s *priv); +static void dm9x_reset(struct dm9x_driver_s *priv); /**************************************************************************** * Private Functions @@ -564,7 +596,7 @@ static void write32(FAR const uint8_t *ptr, int len) * Read a word from SROM * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * offset - SROM offset to read from * * Returned Value: @@ -575,7 +607,7 @@ static void write32(FAR const uint8_t *ptr, int len) ****************************************************************************/ #if 0 /* Not used */ -static uint16_t dm9x_readsrom(struct dm9x_driver_s *dm9x, int offset) +static uint16_t dm9x_readsrom(struct dm9x_driver_s *priv, int offset) { putreg(DM9X_EEPHYA, offset); putreg(DM9X_EEPHYC, DM9X_EEPHYC_ERPRR); @@ -592,7 +624,7 @@ static uint16_t dm9x_readsrom(struct dm9x_driver_s *dm9x, int offset) * Read/write data from/to the PHY * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * reg - PHY register offset * value - The value to write to the PHY register (dm9x_write only) * @@ -603,7 +635,7 @@ static uint16_t dm9x_readsrom(struct dm9x_driver_s *dm9x, int offset) * ****************************************************************************/ -static uint16_t dm9x_phyread(struct dm9x_driver_s *dm9x, int reg) +static uint16_t dm9x_phyread(struct dm9x_driver_s *priv, int reg) { /* Setup DM9X_EEPHYA, the EEPROM/PHY address register */ @@ -620,7 +652,7 @@ static uint16_t dm9x_phyread(struct dm9x_driver_s *dm9x, int reg) return (((uint16_t)getreg(DM9X_EEPHYDH)) << 8) | (uint16_t)getreg(DM9X_EEPHYDL); } -static void dm9x_phywrite(struct dm9x_driver_s *dm9x, int reg, uint16_t value) +static void dm9x_phywrite(struct dm9x_driver_s *priv, int reg, uint16_t value) { /* Setup DM9X_EEPHYA, the EEPROM/PHY address register */ @@ -674,7 +706,7 @@ static inline bool dm9x_rxchecksumready(uint8_t rxbyte) * handling or from watchdog based polling. * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * OK on success; a negated errno on failure @@ -683,17 +715,17 @@ static inline bool dm9x_rxchecksumready(uint8_t rxbyte) * ****************************************************************************/ -static int dm9x_transmit(struct dm9x_driver_s *dm9x) +static int dm9x_transmit(struct dm9x_driver_s *priv) { /* Check if there is room in the DM90x0 to hold another packet. In 100M mode, * that can be 2 packets, otherwise it is a single packet. */ - if (dm9x->dm_ntxpending < 1 || (dm9x->dm_b100M && dm9x->dm_ntxpending < 2)) + if (priv->dm_ntxpending < 1 || (priv->dm_b100M && priv->dm_ntxpending < 2)) { /* Increment count of packets transmitted */ - dm9x->dm_ntxpending++; + priv->dm_ntxpending++; NETDEV_TXPACKETS(&dm9x0->dm_dev); /* Disable all DM90x0 interrupts */ @@ -702,13 +734,13 @@ static int dm9x_transmit(struct dm9x_driver_s *dm9x) /* Set the TX length */ - putreg(DM9X_TXPLL, (dm9x->dm_dev.d_len & 0xff)); - putreg(DM9X_TXPLH, (dm9x->dm_dev.d_len >> 8) & 0xff); + putreg(DM9X_TXPLL, (priv->dm_dev.d_len & 0xff)); + putreg(DM9X_TXPLH, (priv->dm_dev.d_len >> 8) & 0xff); /* Move the data to be sent into TX SRAM */ DM9X_INDEX = DM9X_MWCMD; - dm9x->dm_write(dm9x->dm_dev.d_buf, dm9x->dm_dev.d_len); + priv->dm_write(priv->dm_dev.d_buf, priv->dm_dev.d_len); #if !defined(CONFIG_DM9X_ETRANS) /* Issue TX polling command */ @@ -718,7 +750,7 @@ static int dm9x_transmit(struct dm9x_driver_s *dm9x) /* Clear count of back-to-back RX packet transfers */ - dm9x->ncrxpackets = 0; + priv->ncrxpackets = 0; /* Re-enable DM90x0 interrupts */ @@ -726,8 +758,8 @@ static int dm9x_transmit(struct dm9x_driver_s *dm9x) /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - (void)wd_start(dm9x->dm_txtimeout, DM6X_TXTIMEOUT, dm9x_txtimeout, 1, - (wdparm_t)dm9x); + (void)wd_start(priv->dm_txtimeout, DM6X_TXTIMEOUT, dm9x_txtimeout_expiry, 1, + (wdparm_t)priv); return OK; } return -EBUSY; @@ -756,13 +788,13 @@ static int dm9x_transmit(struct dm9x_driver_s *dm9x) static int dm9x_txpoll(struct net_driver_s *dev) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; + struct dm9x_driver_s *priv = (struct dm9x_driver_s *)dev->d_private; /* If the polling resulted in data that should be sent out on the network, * the field d_len is set to a value > 0. */ - if (dm9x->dm_dev.d_len > 0) + if (priv->dm_dev.d_len > 0) { /* Look up the destination MAC address and add it to the Ethernet * header. @@ -770,10 +802,10 @@ static int dm9x_txpoll(struct net_driver_s *dev) #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(dm9x->dm_dev.d_flags)) + if (IFF_IS_IPv4(priv->dm_dev.d_flags)) #endif { - arp_out(&dm9x->dm_dev); + arp_out(&priv->dm_dev); } #endif /* CONFIG_NET_IPv4 */ @@ -782,19 +814,19 @@ static int dm9x_txpoll(struct net_driver_s *dev) else #endif { - neighbor_out(&dm9x->dm_dev); + neighbor_out(&priv->dm_dev); } #endif /* CONFIG_NET_IPv6 */ /* Send the packet */ - dm9x_transmit(dm9x); + dm9x_transmit(priv); /* Check if there is room in the DM90x0 to hold another packet. In 100M mode, * that can be 2 packets, otherwise it is a single packet. */ - if (dm9x->dm_ntxpending > 1 || !dm9x->dm_b100M) + if (priv->dm_ntxpending > 1 || !priv->dm_b100M) { /* Returning a non-zero value will terminate the poll operation */ @@ -816,7 +848,7 @@ static int dm9x_txpoll(struct net_driver_s *dev) * An interrupt was received indicating the availability of a new RX packet * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -825,7 +857,7 @@ static int dm9x_txpoll(struct net_driver_s *dev) * ****************************************************************************/ -static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) +static void dm9x_receive(FAR struct dm9x_driver_s *priv) { union rx_desc_u rx; bool bchecksumready; @@ -857,7 +889,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) /* Read packet status & length */ - dm9x->dm_read((FAR uint8_t *)&rx, 4); + priv->dm_read((FAR uint8_t *)&rx, 4); /* Check if any errors were reported by the hardware */ @@ -866,11 +898,11 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) /* Bad RX packet... update statistics */ nerr("ERROR: Received packet with errors: %02x\n", rx.desc.rx_status); - NETDEV_RXERRORS(&dm9x->dm_dev); + NETDEV_RXERRORS(&priv->dm_dev); /* Drop this packet and continue to check the next packet */ - dm9x->dm_discard(rx.desc.rx_len); + priv->dm_discard(rx.desc.rx_len); } /* Also check if the packet is a valid size for the network configuration */ @@ -878,23 +910,23 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_MTU + 2)) { nerr("ERROR: RX length error\n"); - NETDEV_RXERRORS(&dm9x->dm_dev); + NETDEV_RXERRORS(&priv->dm_dev); /* Drop this packet and continue to check the next packet */ - dm9x->dm_discard(rx.desc.rx_len); + priv->dm_discard(rx.desc.rx_len); } else { /* Good packet... Copy the packet data out of SRAM and pass it one to the network */ - dm9x->dm_dev.d_len = rx.desc.rx_len; - dm9x->dm_read(dm9x->dm_dev.d_buf, rx.desc.rx_len); + priv->dm_dev.d_len = rx.desc.rx_len; + priv->dm_read(priv->dm_dev.d_buf, rx.desc.rx_len); #ifdef CONFIG_NET_PKT /* When packet sockets are enabled, feed the frame into the packet tap */ - pkt_input(&dm9x->dm_dev); + pkt_input(&priv->dm_dev); #endif /* We only accept IP packets of the configured type and ARP packets */ @@ -909,33 +941,33 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) * layer */ - arp_ipin(&dm9x->dm_dev); - ipv4_input(&dm9x->dm_dev); + arp_ipin(&priv->dm_dev); + ipv4_input(&priv->dm_dev); /* If the above function invocation resulted in data that should be * sent out on the network, the field d_len will set to a value > 0. */ - if (dm9x->dm_dev.d_len > 0) + if (priv->dm_dev.d_len > 0) { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(dm9x->dm_dev.d_flags)) + if (IFF_IS_IPv4(priv->dm_dev.d_flags)) #endif { - arp_out(&dm9x->dm_dev); + arp_out(&priv->dm_dev); } #ifdef CONFIG_NET_IPv6 else { - neighbor_out(&dm9x->dm_dev); + neighbor_out(&priv->dm_dev); } #endif /* And send the packet */ - dm9x_transmit(dm9x); + dm9x_transmit(priv); } } else @@ -948,32 +980,32 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) /* Give the IPv6 packet to the network layer */ - ipv6_input(&dm9x->dm_dev); + ipv6_input(&priv->dm_dev); /* If the above function invocation resulted in data that should be * sent out on the network, the field d_len will set to a value > 0. */ - if (dm9x->dm_dev.d_len > 0) + if (priv->dm_dev.d_len > 0) { /* Update the Ethernet header with the correct MAC address */ #ifdef CONFIG_NET_IPv4 - if (IFF_IS_IPv4(dm9x->dm_dev.d_flags)) + if (IFF_IS_IPv4(priv->dm_dev.d_flags)) { - arp_out(&dm9x->dm_dev); + arp_out(&priv->dm_dev); } else #endif #ifdef CONFIG_NET_IPv6 { - neighbor_out(&dm9x->dm_dev); + neighbor_out(&priv->dm_dev); } #endif /* And send the packet */ - dm9x_transmit(dm9x); + dm9x_transmit(priv); } } else @@ -981,16 +1013,16 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) #ifdef CONFIG_NET_ARP if (BUF->type == htons(ETHTYPE_ARP)) { - arp_arpin(&dm9x->dm_dev); + arp_arpin(&priv->dm_dev); NETDEV_RXARP(&priv->dm_dev); /* If the above function invocation resulted in data that should be * sent out on the network, the field d_len will set to a value > 0. */ - if (dm9x->dm_dev.d_len > 0) + if (priv->dm_dev.d_len > 0) { - dm9x_transmit(dm9x); + dm9x_transmit(priv); } } #endif @@ -1000,10 +1032,10 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) } } - NETDEV_RXPACKETS(&dm9x->dm_dev); - dm9x->ncrxpackets++; + NETDEV_RXPACKETS(&priv->dm_dev); + priv->ncrxpackets++; } - while ((rxbyte & 0x01) == DM9X_PKTRDY && dm9x->ncrxpackets < DM9X_CRXTHRES); + while ((rxbyte & 0x01) == DM9X_PKTRDY && priv->ncrxpackets < DM9X_CRXTHRES); ninfo("All RX packets processed\n"); } @@ -1014,7 +1046,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) * An interrupt was received indicating that the last TX packet(s) is done * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1023,7 +1055,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x) * ****************************************************************************/ -static void dm9x_txdone(struct dm9x_driver_s *dm9x) +static void dm9x_txdone(struct dm9x_driver_s *priv) { int nsr; @@ -1036,9 +1068,9 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x) nsr = getreg(DM9X_NETS); if (nsr & DM9X_NETS_TX1END) { - if (dm9x->dm_ntxpending) + if (priv->dm_ntxpending) { - dm9x->dm_ntxpending--; + priv->dm_ntxpending--; } else { @@ -1048,9 +1080,9 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x) if (nsr & DM9X_NETS_TX2END) { - if (dm9x->dm_ntxpending) + if (priv->dm_ntxpending) { - dm9x->dm_ntxpending--; + priv->dm_ntxpending--; } else { @@ -1060,44 +1092,44 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x) /* Cancel the TX timeout */ - if (dm9x->dm_ntxpending == 0) + if (priv->dm_ntxpending == 0) { - wd_cancel(dm9x->dm_txtimeout); + wd_cancel(priv->dm_txtimeout); } /* Then poll the network for new XMIT data */ - (void)devif_poll(&dm9x->dm_dev, dm9x_txpoll); + (void)devif_poll(&priv->dm_dev, dm9x_txpoll); } /**************************************************************************** - * Function: dm9x_interrupt + * Function: dm9x_interrupt_work * * Description: - * DM90x0 interrupt handler + * Perform interrupt related work from the worker thread * * Parameters: - * irq - Number of the IRQ that generated the interrupt - * context - Interrupt register state save info (architecture-specific) + * arg - The argument passed when work_queue() was called. * * Returned Value: * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static int dm9x_interrupt(int irq, FAR void *context) +static void dm9x_interrupt_work(FAR void *arg) { -#if CONFIG_DM9X_NINTERFACES == 1 - register struct dm9x_driver_s *dm9x = &g_dm9x[0]; -#else -# error "Additional logic needed to support multiple interfaces" -#endif + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; uint8_t isr; uint8_t save; int i; + /* Process pending Ethernet interrupts */ + + net_lock(); + /* Save previous register address */ save = (uint8_t)DM9X_INDEX; @@ -1120,8 +1152,8 @@ static int dm9x_interrupt(int irq, FAR void *context) for (i = 0; i < 500; i++) { - dm9x_phyread(dm9x, 0x1); - if (dm9x_phyread(dm9x, 0x1) & 0x4) /* Link OK */ + dm9x_phyread(priv, 0x1); + if (dm9x_phyread(priv, 0x1) & 0x4) /* Link OK */ { /* Wait to get detected speed */ @@ -1132,41 +1164,41 @@ static int dm9x_interrupt(int irq, FAR void *context) /* Set the new network speed */ - if (dm9x_phyread(dm9x, 0) & 0x2000) + if (dm9x_phyread(priv, 0) & 0x2000) { - dm9x->dm_b100M = true; + priv->dm_b100M = true; } else { - dm9x->dm_b100M = false; + priv->dm_b100M = false; } break; } up_mdelay(1); } - nerr("ERROR: delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); + nerr("ERROR: delay: %dmS speed: %s\n", i, priv->dm_b100M ? "100M" : "10M"); } /* Check if we received an incoming packet */ if (isr & DM9X_INT_PR) { - dm9x_receive(dm9x); + dm9x_receive(priv); } /* Check if we are able to transmit a packet */ if (isr & DM9X_INT_PT) { - dm9x_txdone(dm9x); + dm9x_txdone(priv); } /* If the number of consecutive receive packets exceeds a threshold, * then disable the RX interrupt. */ - if (dm9x->ncrxpackets >= DM9X_CRXTHRES) + if (priv->ncrxpackets >= DM9X_CRXTHRES) { /* Eanble all DM90x0 interrupts EXCEPT for RX */ @@ -1182,38 +1214,98 @@ static int dm9x_interrupt(int irq, FAR void *context) /* Restore previous register address */ DM9X_INDEX = save; + net_unlock(); + + /* Re-enable Ethernet interrupts */ + + up_enable_irq(CONFIG_DM9X_IRQ); +} + +/**************************************************************************** + * Function: dm9x_interrupt + * + * Description: + * Hardware interrupt handler + * + * Parameters: + * irq - Number of the IRQ that generated the interrupt + * context - Interrupt register state save info (architecture-specific) + * + * Returned Value: + * OK on success + * + * Assumptions: + * + ****************************************************************************/ + +static int dm9x_interrupt(int irq, FAR void *context) +{ +#if CONFIG_DM9X_NINTERFACES == 1 + FAR struct dm9x_driver_s *priv = &g_dm9x[0]; +#else +# error "Additional logic needed to support multiple interfaces" +#endif + uint8_t isr; + + /* Disable further Ethernet interrupts. Because Ethernet interrupts are + * also disabled if the TX timeout event occurs, there can be no race + * condition here. + */ + + up_disable_irq(CONFIG_DM9X_IRQ); + + /* Determine if a TX transfer just completed */ + + isr = getreg(DM9X_ISR); + if ((isr & DM9X_INT_PT) != 0) + { + /* If a TX transfer just completed, then cancel the TX timeout so + * there will be no race condition between any subsequent timeout + * expiration and the deferred interrupt processing. + */ + + wd_cancel(priv->dm_txtimeout); + } + + /* Cancel any pending poll work */ + + work_cancel(ETHWORK, &priv->dm_work); + + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->dm_work, dm9x_interrupt_work, priv, 0); return OK; } /**************************************************************************** - * Function: dm9x_txtimeout + * Function: dm9x_txtimeout_work * * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the DM90x0 and start again. + * Perform TX timeout related work from the worker thread * * Parameters: - * argc - The number of available arguments - * arg - The first argument + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * The network is locked. * ****************************************************************************/ -static void dm9x_txtimeout(int argc, uint32_t arg, ...) +static void dm9x_txtimeout_work(FAR void *arg) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)arg; + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; nerr("ERROR: TX timeout\n"); /* Increment statistics and dump debug info */ - NETDEV_TXTIMEOUTS(dm9x->dm_dev); + net_lock(); + NETDEV_TXTIMEOUTS(priv->dm_dev); - ninfo(" TX packet count: %d\n", dm9x->dm_ntxpending); + ninfo(" TX packet count: %d\n", priv->dm_ntxpending); ninfo(" TX read pointer address: 0x%02x:%02x\n", getreg(DM9X_TRPAH), getreg(DM9X_TRPAL)); ninfo(" Memory data write address: 0x%02x:%02x (DM9010)\n", @@ -1221,18 +1313,20 @@ static void dm9x_txtimeout(int argc, uint32_t arg, ...) /* Then reset the DM90x0 */ - dm9x_reset(dm9x); + dm9x_reset(priv); /* Then poll the network for new XMIT data */ - (void)devif_poll(&dm9x->dm_dev, dm9x_txpoll); + (void)devif_poll(&priv->dm_dev, dm9x_txpoll); + net_unlock(); } /**************************************************************************** - * Function: dm9x_polltimer + * Function: dm9x_txtimeout_expiry * * Description: - * Periodic timer handler. Called from the timer interrupt handler. + * Our TX watchdog timed out. Called from the timer interrupt handler. + * The last TX never completed. Reset the hardware and start again. * * Parameters: * argc - The number of available arguments @@ -1242,20 +1336,64 @@ static void dm9x_txtimeout(int argc, uint32_t arg, ...) * None * * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void dm9x_txtimeout_expiry(int argc, wdparm_t arg, ...) +{ + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; + + /* Disable further Ethernet interrupts. This will prevent some race + * conditions with interrupt work. There is still a potential race + * condition with interrupt work that is already queued and in progress. + */ + + up_disable_irq(CONFIG_DM9X_IRQ); + + /* Cancel any pending poll or interrupt work. This will have no effect + * on work that has already been started. + */ + + work_cancel(ETHWORK, &priv->dm_work); + + /* Schedule to perform the TX timeout processing on the worker thread. */ + + work_queue(ETHWORK, &priv->dm_work, dm9x_txtimeout_work, priv, 0); +} + +/**************************************************************************** + * Function: dm9x_poll_work + * + * Description: + * Perform periodic polling from the worker thread + * + * Parameters: + * arg - The argument passed when work_queue() as called. + * + * Returned Value: + * OK on success + * + * Assumptions: + * The network is locked. * ****************************************************************************/ -static void dm9x_polltimer(int argc, uint32_t arg, ...) +static void dm9x_poll_work(FAR void *arg) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)arg; + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; + + /* Perform the poll */ + + net_lock(); /* If the number of contiguous RX packets exceeds a threshold, reset the counter and * re-enable RX interrupts */ - if (dm9x->ncrxpackets >= DM9X_CRXTHRES) + if (priv->ncrxpackets >= DM9X_CRXTHRES) { - dm9x->ncrxpackets = 0; + priv->ncrxpackets = 0; putreg(DM9X_IMR, DM9X_IMRENABLE); } @@ -1263,17 +1401,60 @@ static void dm9x_polltimer(int argc, uint32_t arg, ...) * that can be 2 packets, otherwise it is a single packet. */ - if (dm9x->dm_ntxpending < 1 || (dm9x->dm_b100M && dm9x->dm_ntxpending < 2)) + if (priv->dm_ntxpending < 1 || (priv->dm_b100M && priv->dm_ntxpending < 2)) { /* If so, update TCP timing states and poll the network for new XMIT data */ - (void)devif_timer(&dm9x->dm_dev, dm9x_txpoll); + (void)devif_timer(&priv->dm_dev, dm9x_txpoll); } /* Setup the watchdog poll timer again */ - (void)wd_start(dm9x->dm_txpoll, DM6X_WDDELAY, dm9x_polltimer, 1, - (wdparm_t)arg); + (void)wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, + (wdparm_t)priv); + net_unlock(); +} + +/**************************************************************************** + * Function: dm9x_poll_expiry + * + * Description: + * Periodic timer handler. Called from the timer interrupt handler. + * + * Parameters: + * argc - The number of available arguments + * arg - The first argument + * + * Returned Value: + * None + * + * Assumptions: + * Global interrupts are disabled by the watchdog logic. + * + ****************************************************************************/ + +static void dm9x_poll_expiry(int argc, wdparm_t arg, ...) +{ + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions. + */ + + if (work_available(&priv->dm_work)) + { + /* Schedule to perform the interrupt processing on the worker thread. */ + + work_queue(ETHWORK, &priv->dm_work, dm9x_poll_work, priv, 0); + } + else + { + /* No.. Just re-start the watchdog poll timer, missing one polling + * cycle. + */ + + (void)wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, arg); + } } /**************************************************************************** @@ -1283,7 +1464,7 @@ static void dm9x_polltimer(int argc, uint32_t arg, ...) * Configure the PHY operating mode * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1292,7 +1473,7 @@ static void dm9x_polltimer(int argc, uint32_t arg, ...) * ****************************************************************************/ -static inline void dm9x_phymode(struct dm9x_driver_s *dm9x) +static inline void dm9x_phymode(struct dm9x_driver_s *priv) { uint16_t phyreg0; uint16_t phyreg4; @@ -1316,8 +1497,8 @@ static inline void dm9x_phymode(struct dm9x_driver_s *dm9x) # error "Recognized PHY mode" #endif - dm9x_phywrite(dm9x, 0, phyreg0); - dm9x_phywrite(dm9x, 4, phyreg4); + dm9x_phywrite(priv, 0, phyreg0); + dm9x_phywrite(priv, 4, phyreg4); } /**************************************************************************** @@ -1339,7 +1520,7 @@ static inline void dm9x_phymode(struct dm9x_driver_s *dm9x) static int dm9x_ifup(struct net_driver_s *dev) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; + struct dm9x_driver_s *priv = (struct dm9x_driver_s *)dev->d_private; uint8_t netstatus; int i; @@ -1349,11 +1530,11 @@ static int dm9x_ifup(struct net_driver_s *dev) /* Initilize DM90x0 chip */ - dm9x_bringup(dm9x); + dm9x_bringup(priv); /* Check link state and media speed (waiting up to 3s for link OK) */ - dm9x->dm_b100M = false; + priv->dm_b100M = false; for (i = 0; i < 3000; i++) { netstatus = getreg(DM9X_NETS); @@ -1365,7 +1546,7 @@ static int dm9x_ifup(struct net_driver_s *dev) netstatus = getreg(DM9X_NETS); if ((netstatus & DM9X_NETS_SPEED) == 0) { - dm9x->dm_b100M = true; + priv->dm_b100M = true; } break; } @@ -1373,16 +1554,16 @@ static int dm9x_ifup(struct net_driver_s *dev) up_mdelay(1); } - ninfo("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M"); + ninfo("delay: %dmS speed: %s\n", i, priv->dm_b100M ? "100M" : "10M"); /* Set and activate a timer process */ - (void)wd_start(dm9x->dm_txpoll, DM6X_WDDELAY, dm9x_polltimer, 1, - (wdparm_t)dm9x); + (void)wd_start(priv->dm_txpoll, DM9X_WDDELAY, dm9x_poll_expiry, 1, + (wdparm_t)priv); /* Enable the DM9X interrupt */ - dm9x->dm_bifup = true; + priv->dm_bifup = true; up_enable_irq(CONFIG_DM9X_IRQ); return OK; } @@ -1405,7 +1586,7 @@ static int dm9x_ifup(struct net_driver_s *dev) static int dm9x_ifdown(struct net_driver_s *dev) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; + struct dm9x_driver_s *priv = (struct dm9x_driver_s *)dev->d_private; irqstate_t flags; ninfo("Stopping\n"); @@ -1417,66 +1598,101 @@ static int dm9x_ifdown(struct net_driver_s *dev) /* Cancel the TX poll timer and TX timeout timers */ - wd_cancel(dm9x->dm_txpoll); - wd_cancel(dm9x->dm_txtimeout); + wd_cancel(priv->dm_txpoll); + wd_cancel(priv->dm_txtimeout); /* Reset the device */ - dm9x_phywrite(dm9x, 0x00, 0x8000); /* PHY reset */ + dm9x_phywrite(priv, 0x00, 0x8000); /* PHY reset */ putreg(DM9X_GPD, 0x01); /* Power-down PHY (GEPIO0=1) */ putreg(DM9X_IMR, DM9X_IMRDISABLE); /* Disable all interrupts */ putreg(DM9X_RXC, 0x00); /* Disable RX */ putreg(DM9X_ISR, DM9X_INT_ALL); /* Clear interrupt status */ - dm9x->dm_bifup = false; + priv->dm_bifup = false; leave_critical_section(flags); return OK; } /**************************************************************************** - * Function: dm9x_txavail + * Function: dm9x_txavail_work * * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static int dm9x_txavail(struct net_driver_s *dev) +static void dm9x_txavail_work(FAR void *arg) { - struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private; - irqstate_t flags; + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)arg; ninfo("Polling\n"); - flags = enter_critical_section(); /* Ignore the notification if the interface is not yet up */ - if (dm9x->dm_bifup) + net_lock(); + if (priv->dm_bifup) { /* Check if there is room in the DM90x0 to hold another packet. In 100M * mode, that can be 2 packets, otherwise it is a single packet. */ - if (dm9x->dm_ntxpending < 1 || (dm9x->dm_b100M && dm9x->dm_ntxpending < 2)) + if (priv->dm_ntxpending < 1 || (priv->dm_b100M && priv->dm_ntxpending < 2)) { /* If so, then poll the network for new XMIT data */ - (void)devif_poll(&dm9x->dm_dev, dm9x_txpoll); + (void)devif_poll(&priv->dm_dev, dm9x_txpoll); } } - leave_critical_section(flags); + + net_unlock(); +} + +/**************************************************************************** + * Function: dm9x_txavail + * + * Description: + * Driver callback invoked when new TX data is available. This is a + * stimulus perform an out-of-cycle poll and, thereby, reduce the TX + * latency. + * + * Parameters: + * dev - Reference to the NuttX driver state structure + * + * Returned Value: + * None + * + * Assumptions: + * Called in normal user mode + * + ****************************************************************************/ + +static int dm9x_txavail(FAR struct net_driver_s *dev) +{ + FAR struct dm9x_driver_s *priv = (FAR struct dm9x_driver_s *)dev->d_private; + + /* Is our single work structure available? It may not be if there are + * pending interrupt actions and we will have to ignore the Tx + * availability action. + */ + + if (work_available(&priv->dm_work)) + { + /* Schedule to serialize the poll on the worker thread. */ + + work_queue(ETHWORK, &priv->dm_work, dm9x_txavail_work, priv, 0); + } + return OK; } @@ -1547,7 +1763,7 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) * Initialize the dm90x0 chip * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1556,7 +1772,7 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) * ****************************************************************************/ -static void dm9x_bringup(struct dm9x_driver_s *dm9x) +static void dm9x_bringup(struct dm9x_driver_s *priv) { ninfo("Initializing\n"); @@ -1581,21 +1797,21 @@ static void dm9x_bringup(struct dm9x_driver_s *dm9x) switch (getreg(DM9X_ISR) & DM9X_ISR_IOMODEM) { case DM9X_ISR_IOMODE8: - dm9x->dm_read = read8; - dm9x->dm_write = write8; - dm9x->dm_discard = discard8; + priv->dm_read = read8; + priv->dm_write = write8; + priv->dm_discard = discard8; break; case DM9X_ISR_IOMODE16: - dm9x->dm_read = read16; - dm9x->dm_write = write16; - dm9x->dm_discard = discard16; + priv->dm_read = read16; + priv->dm_write = write16; + priv->dm_discard = discard16; break; case DM9X_ISR_IOMODE32: - dm9x->dm_read = read32; - dm9x->dm_write = write32; - dm9x->dm_discard = discard32; + priv->dm_read = read32; + priv->dm_write = write32; + priv->dm_discard = discard32; break; default: @@ -1604,7 +1820,7 @@ static void dm9x_bringup(struct dm9x_driver_s *dm9x) /* Program PHY operating mode */ - dm9x_phymode(dm9x); + dm9x_phymode(priv); /* Program operating mode */ @@ -1626,9 +1842,9 @@ static void dm9x_bringup(struct dm9x_driver_s *dm9x) /* Initialize statistics */ - dm9x->ncrxpackets = 0; /* Number of continuous RX packets */ - dm9x->dm_ntxpending = 0; /* Number of pending TX packets */ - NETDEV_RESET_STATISTICS(&dm9x->dm_dev); + priv->ncrxpackets = 0; /* Number of continuous RX packets */ + priv->dm_ntxpending = 0; /* Number of pending TX packets */ + NETDEV_RESET_STATISTICS(&priv->dm_dev); /* Activate DM9000A/DM9010 */ @@ -1644,7 +1860,7 @@ static void dm9x_bringup(struct dm9x_driver_s *dm9x) * present, the chip is only reset after a TX timeout. * * Parameters: - * dm9x - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1653,31 +1869,31 @@ static void dm9x_bringup(struct dm9x_driver_s *dm9x) * ****************************************************************************/ -static void dm9x_reset(struct dm9x_driver_s *dm9x) +static void dm9x_reset(struct dm9x_driver_s *priv) { uint8_t save; int i; /* Cancel the TX poll timer and TX timeout timers */ - wd_cancel(dm9x->dm_txpoll); - wd_cancel(dm9x->dm_txtimeout); + wd_cancel(priv->dm_txpoll); + wd_cancel(priv->dm_txtimeout); /* Save previous register address */ save = (uint8_t)DM9X_INDEX; - dm9x_bringup(dm9x); + dm9x_bringup(priv); /* Wait up to 1 second for the link to be OK */ - dm9x->dm_b100M = false; + priv->dm_b100M = false; for (i = 0; i < 1000; i++) { - if (dm9x_phyread(dm9x, 0x1) & 0x4) + if (dm9x_phyread(priv, 0x1) & 0x4) { - if (dm9x_phyread(dm9x, 0) &0x2000) + if (dm9x_phyread(priv, 0) &0x2000) { - dm9x->dm_b100M = true; + priv->dm_b100M = true; } break; } @@ -1746,6 +1962,7 @@ int dm9x_initialize(void) /* Initialize the driver structure */ memset(g_dm9x, 0, CONFIG_DM9X_NINTERFACES*sizeof(struct dm9x_driver_s)); + g_dm9x[0].dm_dev.d_buf = g_pktbuf; /* Single packet buffer */ g_dm9x[0].dm_dev.d_ifup = dm9x_ifup; /* I/F down callback */ g_dm9x[0].dm_dev.d_ifdown = dm9x_ifdown; /* I/F up (new IP address) callback */ g_dm9x[0].dm_dev.d_txavail = dm9x_txavail; /* New TX data callback */ diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c deleted file mode 100644 index 6d5d5dc4f50cecaf38555e25c6ae77aa1a37bed1..0000000000000000000000000000000000000000 --- a/drivers/net/e1000.c +++ /dev/null @@ -1,1275 +0,0 @@ -/**************************************************************************** - * drivers/net/e1000.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#ifdef CONFIG_NET_PKT -# include -#endif - -#include -#include -#include -#include -#include -#include - -#include "e1000.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* TX poll deley = 1 seconds. CLK_TCK is the number of clock ticks per second */ - -#define E1000_WDDELAY (1*CLK_TCK) - -/* TX timeout = 1 minute */ - -#define E1000_TXTIMEOUT (60*CLK_TCK) - -/* This is a helper pointer for accessing the contents of the Ethernet header */ - -#define BUF ((struct eth_hdr_s *)e1000->netdev.d_buf) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct tx_ring -{ - struct tx_desc *desc; - char *buf; - int tail; /* where to write desc */ -}; - -struct rx_ring -{ - struct rx_desc *desc; - char *buf; - int head; /* where to read */ - int tail; /* where to release free desc */ - int free; /* number of freed desc */ -}; - -struct e1000_dev -{ - uint32_t phy_mem_base; - uint32_t io_mem_base; - uint32_t mem_size; - int pci_dev_id; - uint16_t pci_addr; - unsigned char src_mac[6]; - unsigned char dst_mac[6]; - struct irq_action int_desc; - struct tx_ring tx_ring; - struct rx_ring rx_ring; - struct e1000_dev *next; - - /* NuttX net data */ - - bool bifup; /* true:ifup false:ifdown */ - WDOG_ID txpoll; /* TX poll timer */ - WDOG_ID txtimeout; /* TX timeout timer */ - - /* This holds the information visible to the NuttX network */ - - struct net_driver_s netdev; /* Interface understood by networking layer */ -}; - -struct e1000_dev_head -{ - struct e1000_dev *next; -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static struct e1000_dev_head e1000_list = -{ - 0 -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/* Common TX logic */ - -static int e1000_transmit(struct e1000_dev *e1000); -static int e1000_txpoll(struct net_driver_s *dev); - -/* Interrupt handling */ - -static void e1000_receive(struct e1000_dev *e1000); - -/* Watchdog timer expirations */ - -static void e1000_polltimer(int argc, uint32_t arg, ...); -static void e1000_txtimeout(int argc, uint32_t arg, ...); - -/* NuttX callback functions */ - -static int e1000_ifup(struct net_driver_s *dev); -static int e1000_ifdown(struct net_driver_s *dev); -static int e1000_txavail(struct net_driver_s *dev); -#ifdef CONFIG_NET_IGMP -static int e1000_addmac(struct net_driver_s *dev, const uint8_t *mac); -static int e1000_rmmac(struct net_driver_s *dev, const uint8_t *mac); -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -static inline void e1000_outl(struct e1000_dev *dev, int reg, uint32_t val) -{ - writel(dev->io_mem_base+reg, val); -} - -static inline uint32_t e1000_inl(struct e1000_dev *dev, int reg) -{ - return readl(dev->io_mem_base+reg); -} - -/****************************** e1000 driver ********************************/ - -void e1000_reset(struct e1000_dev *dev) -{ - uint32_t dev_control; - - /* Reset the network controller hardware */ - - dev_control = 0; - dev_control |= (1 << 0); /* FD-bit (Full Duplex) */ - dev_control |= (0 << 2); /* GIOMD-bit (GIO Master Disable) */ - dev_control |= (1 << 3); /* LRST-bit (Link Reset) */ - dev_control |= (1 << 6); /* SLU-bit (Set Link Up) */ - dev_control |= (2 << 8); /* SPEED=2 (1000Mbps) */ - dev_control |= (0 << 11); /* FRCSPD-bit (Force Speed) */ - dev_control |= (0 << 12); /* FRCDPLX-bit (Force Duplex) */ - dev_control |= (0 << 20); /* ADVD3WUC-bit (Advertise D3 Wake Up Cap) */ - dev_control |= (1 << 26); /* RST-bit (Device Reset) */ - dev_control |= (1 << 27); /* RFCE-bit (Receive Flow Control Enable) */ - dev_control |= (1 << 28); /* TFCE-bit (Transmit Flow Control Enable) */ - dev_control |= (0 << 30); /* VME-bit (VLAN Mode Enable) */ - dev_control |= (0 << 31); /* PHY_RST-bit (PHY Reset) */ - - e1000_outl(dev, E1000_IMC, 0xFFFFFFFF); - e1000_outl(dev, E1000_STATUS, 0x00000000); - e1000_outl(dev, E1000_CTRL, dev_control); - dev_control &= ~(1 << 26); /* clear RST-bit (Device Reset) */ - e1000_outl(dev, E1000_CTRL, dev_control); - up_mdelay(10); - e1000_outl(dev, E1000_CTRL_EXT, 0x001401C0); - e1000_outl(dev, E1000_IMC, 0xFFFFFFFF); -} - -void e1000_turn_on(struct e1000_dev *dev) -{ - int tx_control; - int rx_control; - uint32_t ims = 0; - - /* turn on the controller's receive engine */ - - rx_control = e1000_inl(dev, E1000_RCTL); - rx_control |= (1 << 1); - e1000_outl(dev, E1000_RCTL, rx_control); - - /* turn on the controller's transmit engine */ - - tx_control = e1000_inl(dev, E1000_TCTL); - tx_control |= (1 << 1); - e1000_outl(dev, E1000_TCTL, tx_control); - - /* enable the controller's interrupts */ - - e1000_outl(dev, E1000_ICR, 0xFFFFFFFF); - e1000_outl(dev, E1000_IMC, 0xFFFFFFFF); - - ims |= 1 << 0; /* TXDW */ - ims |= 1 << 1; /* TXQE */ - ims |= 1 << 2; /* LSC */ - ims |= 1 << 4; /* RXDMT0 */ - ims |= 1 << 7; /* RXT0 */ - e1000_outl(dev, E1000_IMS, ims); -} - -void e1000_turn_off(struct e1000_dev *dev) -{ - int tx_control; - int rx_control; - - /* turn off the controller's receive engine */ - - rx_control = e1000_inl(dev, E1000_RCTL); - rx_control &= ~(1 << 1); - e1000_outl(dev, E1000_RCTL, rx_control); - - /* turn off the controller's transmit engine */ - - tx_control = e1000_inl(dev, E1000_TCTL); - tx_control &= ~(1 << 1); - e1000_outl(dev, E1000_TCTL, tx_control); - - /* turn off the controller's interrupts */ - - e1000_outl(dev, E1000_IMC, 0xFFFFFFFF); -} - -void e1000_init(struct e1000_dev *dev) -{ - uint32_t rxd_phys; - uint32_t txd_phys; - uint32_t kmem_phys; - uint32_t rx_control; - uint32_t tx_control; - uint32_t pba; - int i; - - e1000_reset(dev); - - /* configure the controller's 'receive' engine */ - - rx_control = 0; - rx_control |= (0 << 1); /* EN-bit (Enable) */ - rx_control |= (0 << 2); /* SPB-bit (Store Bad Packets) */ - rx_control |= (0 << 3); /* UPE-bit (Unicast Promiscuous Mode) */ - rx_control |= (1 << 4); /* MPE-bit (Multicast Promiscuous Mode) */ - rx_control |= (0 << 5); /* LPE-bit (Long Packet Enable) */ - rx_control |= (0 << 6); /* LBM=0 (Loop-Back Mode) */ - rx_control |= (0 << 8); /* RDMTS=0 (Rx Descriptor Min Threshold Size) */ - rx_control |= (0 << 10); /* DTYPE=0 (Descriptor Type) */ - rx_control |= (0 << 12); /* MO=0 (Multicast Offset) */ - rx_control |= (1 << 15); /* BAM-bit (Broadcast Address Mode) */ - rx_control |= (0 << 16); /* BSIZE=0 (Buffer Size = 2048) */ - rx_control |= (0 << 18); /* VLE-bit (VLAN filter Enable) */ - rx_control |= (0 << 19); /* CFIEN-bit (Canonical Form Indicator Enable) */ - rx_control |= (0 << 20); /* CFI-bit (Canonical Form Indicator) */ - rx_control |= (1 << 22); /* DPF-bit (Discard Pause Frames) */ - rx_control |= (0 << 23); /* PMCF-bit (Pass MAC Control Frames) */ - rx_control |= (0 << 25); /* BSEX=0 (Buffer Size EXtension) */ - rx_control |= (1 << 26); /* SECRC-bit (Strip Ethernet CRC) */ - rx_control |= (0 << 27); /* FLEXBUF=0 (Flexible Buffer size) */ - e1000_outl(dev, E1000_RCTL, rx_control); - - /* configure the controller's 'transmit' engine */ - - tx_control = 0; - tx_control |= (0 << 1); /* EN-bit (Enable) */ - tx_control |= (1 << 3); /* PSP-bit (Pad Short Packets) */ - tx_control |= (15 << 4); /* CT=15 (Collision Threshold) */ - tx_control |= (63 << 12); /* COLD=63 (Collision Distance) */ - tx_control |= (0 << 22); /* SWXOFF-bit (Software XOFF) */ - tx_control |= (1 << 24); /* RTLC-bit (Re-Transmit on Late Collision) */ - tx_control |= (0 << 25); /* UNORTX-bit (Underrun No Re-Transmit) */ - tx_control |= (0 << 26); /* TXCSCMT=0 (TxDesc Mininum Threshold) */ - tx_control |= (0 << 28); /* MULR-bit (Multiple Request Support) */ - e1000_outl(dev, E1000_TCTL, tx_control); - - /* hardware flow control */ - - pba = e1000_inl(dev, E1000_PBA); - - /* get receive FIFO size */ - - pba = (pba & 0x000000ff) << 10; - e1000_outl(dev, E1000_FCAL, 0x00C28001); - e1000_outl(dev, E1000_FCAH, 0x00000100); - e1000_outl(dev, E1000_FCT, 0x00008808); - e1000_outl(dev, E1000_FCTTV, 0x00000680); - e1000_outl(dev, E1000_FCRTL, (pba * 8 / 10) | 0x80000000); - e1000_outl(dev, E1000_FCRTH, pba * 9 / 10); - - /* setup tx rings */ - - txd_phys = PADDR((uintptr_t)dev->tx_ring.desc); - kmem_phys = PADDR((uintptr_t)dev->tx_ring.buf); - for (i = 0; i < CONFIG_E1000_N_TX_DESC; i++, kmem_phys += CONFIG_E1000_BUFF_SIZE) - { - dev->tx_ring.desc[i].base_address = kmem_phys; - dev->tx_ring.desc[i].packet_length = 0; - dev->tx_ring.desc[i].cksum_offset = 0; - dev->tx_ring.desc[i].cksum_origin = 0; - dev->tx_ring.desc[i].desc_status = 1; - dev->tx_ring.desc[i].desc_command = (1 << 0) | (1 << 1) | (1 << 3); - dev->tx_ring.desc[i].special_info = 0; - } - - dev->tx_ring.tail = 0; - e1000_outl(dev, E1000_TDT, 0); - e1000_outl(dev, E1000_TDH, 0); - - /* tell controller the location, size, and fetch-policy for Tx queue */ - - e1000_outl(dev, E1000_TDBAL, txd_phys); - e1000_outl(dev, E1000_TDBAH, 0x00000000); - e1000_outl(dev, E1000_TDLEN, CONFIG_E1000_N_TX_DESC * 16); - e1000_outl(dev, E1000_TXDCTL, 0x01010000); - - /* setup rx rings */ - - rxd_phys = PADDR((uintptr_t)dev->rx_ring.desc); - kmem_phys = PADDR((uintptr_t)dev->rx_ring.buf); - for (i = 0; i < CONFIG_E1000_N_RX_DESC; i++, kmem_phys += CONFIG_E1000_BUFF_SIZE) - { - dev->rx_ring.desc[i].base_address = kmem_phys; - dev->rx_ring.desc[i].packet_length = 0; - dev->rx_ring.desc[i].packet_cksum = 0; - dev->rx_ring.desc[i].desc_status = 0; - dev->rx_ring.desc[i].desc_errors = 0; - dev->rx_ring.desc[i].vlan_tag = 0; - } - - dev->rx_ring.head = 0; - dev->rx_ring.tail = CONFIG_E1000_N_RX_DESC-1; - dev->rx_ring.free = 0; - - /* give the controller ownership of all receive descriptors */ - - e1000_outl(dev, E1000_RDH, 0); - e1000_outl(dev, E1000_RDT, CONFIG_E1000_N_RX_DESC-1); - - /* tell controller the location, size, and fetch-policy for RX queue */ - - e1000_outl(dev, E1000_RDBAL, rxd_phys); - e1000_outl(dev, E1000_RDBAH, 0x00000000); - e1000_outl(dev, E1000_RDLEN, CONFIG_E1000_N_RX_DESC*16); - e1000_outl(dev, E1000_RXDCTL, 0x01010000); - - e1000_turn_on(dev); -} - -/**************************************************************************** - * Function: e1000_transmit - * - * Description: - * Start hardware transmission. Called either from the txdone interrupt - * handling or from watchdog based polling. - * - * Parameters: - * e1000 - Reference to the driver state structure - * - * Returned Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * May or may not be called from an interrupt handler. In either case, - * global interrupts are disabled, either explicitly or indirectly through - * interrupt handling logic. - * - ****************************************************************************/ - -static int e1000_transmit(struct e1000_dev *e1000) -{ - int tail = e1000->tx_ring.tail; - unsigned char *cp = (unsigned char *) - (e1000->tx_ring.buf + tail * CONFIG_E1000_BUFF_SIZE); - int count = e1000->netdev.d_len; - - /* Verify that the hardware is ready to send another packet. If we get - * here, then we are committed to sending a packet; Higher level logic - * must have assured that there is not transmission in progress. - */ - - if (!e1000->tx_ring.desc[tail].desc_status) - { - return -1; - } - - /* Send the packet: address=skel->sk_dev.d_buf, length=skel->sk_dev.d_len */ - - memcpy(cp, e1000->netdev.d_buf, e1000->netdev.d_len); - - /* prepare the transmit-descriptor */ - - e1000->tx_ring.desc[tail].packet_length = count < 60 ? 60 : count; - e1000->tx_ring.desc[tail].desc_status = 0; - - /* give ownership of this descriptor to the network controller */ - - tail = (tail + 1) % CONFIG_E1000_N_TX_DESC; - e1000->tx_ring.tail = tail; - e1000_outl(e1000, E1000_TDT, tail); - - /* Enable Tx interrupts */ - - /* Setup the TX timeout watchdog (perhaps restarting the timer) */ - - wd_start(e1000->txtimeout, E1000_TXTIMEOUT, e1000_txtimeout, 1, - (wdparm_t)e1000); - return OK; -} - -/**************************************************************************** - * Function: e1000_txpoll - * - * Description: - * The transmitter is available, check if the network has any outgoing packets ready - * to send. This is a callback from devif_poll(). devif_poll() may be called: - * - * 1. When the preceding TX packet send is complete, - * 2. When the preceding TX packet send timesout and the interface is reset - * 3. During normal TX polling - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * May or may not be called from an interrupt handler. In either case, - * global interrupts are disabled, either explicitly or indirectly through - * interrupt handling logic. - * - ****************************************************************************/ - -static int e1000_txpoll(struct net_driver_s *dev) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; - int tail = e1000->tx_ring.tail; - - /* If the polling resulted in data that should be sent out on the network, - * the field d_len is set to a value > 0. - */ - - if (e1000->netdev.d_len > 0) - { - /* Look up the destination MAC address and add it to the Ethernet - * header. - */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(e1000->netdev.d_flags)) -#endif - { - arp_out(&e1000->netdev); - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - neighbor_out(&e1000->netdev); - } -#endif /* CONFIG_NET_IPv6 */ - - /* Send the packet */ - - e1000_transmit(e1000); - - /* Check if there is room in the device to hold another packet. If not, - * return a non-zero value to terminate the poll. - */ - - if (!e1000->tx_ring.desc[tail].desc_status) - { - return -1; - } - } - - /* If zero is returned, the polling will continue until all connections have - * been examined. - */ - - return 0; -} - -/**************************************************************************** - * Function: e1000_receive - * - * Description: - * An interrupt was received indicating the availability of a new RX packet - * - * Parameters: - * e1000 - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by interrupt handling logic. - * - ****************************************************************************/ - -static void e1000_receive(struct e1000_dev *e1000) -{ - int head = e1000->rx_ring.head; - unsigned char *cp = (unsigned char *) - (e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE); - int cnt; - - while (e1000->rx_ring.desc[head].desc_status) - { - /* Here we do not handle packets that exceed packet-buffer size */ - - if ((e1000->rx_ring.desc[head].desc_status & 3) == 1) - { - cprintf("NIC READ: Oversized packet\n"); - goto next; - } - - /* Check if the packet is a valid size for the network buffer configuration */ - - /* get the number of actual data-bytes in this packet */ - - cnt = e1000->rx_ring.desc[head].packet_length; - - if (cnt > CONFIG_NET_ETH_MTU || cnt < 14) - { - cprintf("NIC READ: invalid package size\n"); - goto next; - } - - /* Copy the data data from the hardware to e1000->netdev.d_buf. Set - * amount of data in e1000->netdev.d_len - */ - - /* now we try to copy these data-bytes to the UIP buffer */ - - memcpy(e1000->netdev.d_buf, cp, cnt); - e1000->netdev.d_len = cnt; - -#ifdef CONFIG_NET_PKT - /* When packet sockets are enabled, feed the frame into the packet tap */ - - pkt_input(&e1000->netdev); -#endif - - /* We only accept IP packets of the configured type and ARP packets */ - -#ifdef CONFIG_NET_IPv4 - if (BUF->type == HTONS(ETHTYPE_IP)) - { - ninfo("IPv4 frame\n"); - - /* Handle ARP on input then give the IPv4 packet to the network - * layer - */ - - arp_ipin(&e1000->netdev); - ipv4_input(&e1000->netdev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (e1000->netdev.d_len > 0) - { - /* Update the Ethernet header with the correct MAC address */ - -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(e1000->netdev.d_flags)) -#endif - { - arp_out(&e1000->netdev); - } -#ifdef CONFIG_NET_IPv6 - else - { - neighbor_out(&e1000->netdev); - } -#endif - - /* And send the packet */ - - e1000_transmit(e1000); - } - } - else -#endif -#ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(ETHTYPE_IP6)) - { - ninfo("Iv6 frame\n"); - - /* Give the IPv6 packet to the network layer */ - - ipv6_input(&e1000->netdev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (e1000->netdev.d_len > 0) - { - /* Update the Ethernet header with the correct MAC address */ - -#ifdef CONFIG_NET_IPv4 - if (IFF_IS_IPv4(e1000->netdev.d_flags)) - { - arp_out(&e1000->netdev); - } - else -#endif -#ifdef CONFIG_NET_IPv6 - { - neighbor_out(&e1000->netdev); - } -#endif - - /* And send the packet */ - - e1000_transmit(e1000); - } - } - else -#endif -#ifdef CONFIG_NET_ARP - if (BUF->type == htons(ETHTYPE_ARP)) - { - arp_arpin(&e1000->netdev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (e1000->netdev.d_len > 0) - { - e1000_transmit(e1000); - } -#endif - } - -next: - e1000->rx_ring.desc[head].desc_status = 0; - e1000->rx_ring.head = (head + 1) % CONFIG_E1000_N_RX_DESC; - e1000->rx_ring.free++; - head = e1000->rx_ring.head; - cp = (unsigned char *)(e1000->rx_ring.buf + head * CONFIG_E1000_BUFF_SIZE); - } -} - -/**************************************************************************** - * Function: e1000_txtimeout - * - * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. - * - * Parameters: - * argc - The number of available arguments - * arg - The first argument - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void e1000_txtimeout(int argc, uint32_t arg, ...) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)arg; - - /* Then reset the hardware */ - - e1000_init(e1000); - - /* Then poll the network for new XMIT data */ - - (void)devif_poll(&e1000->netdev, e1000_txpoll); -} - -/**************************************************************************** - * Function: e1000_polltimer - * - * Description: - * Periodic timer handler. Called from the timer interrupt handler. - * - * Parameters: - * argc - The number of available arguments - * arg - The first argument - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void e1000_polltimer(int argc, uint32_t arg, ...) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)arg; - int tail = e1000->tx_ring.tail; - - /* Check if there is room in the send another TX packet. We cannot perform - * the TX poll if he are unable to accept another packet for transmission. - */ - - if (!e1000->tx_ring.desc[tail].desc_status) - { - return; - } - - /* If so, update TCP timing states and poll the network for new XMIT data. Hmmm.. - * might be bug here. Does this mean if there is a transmit in progress, - * we will missing TCP time state updates? - */ - - (void)devif_timer(&e1000->netdev, e1000_txpoll); - - /* Setup the watchdog poll timer again */ - - (void)wd_start(e1000->txpoll, E1000_WDDELAY, e1000_polltimer, 1, - (wdparm_t)arg); -} - -/**************************************************************************** - * Function: e1000_ifup - * - * Description: - * NuttX Callback: Bring up the Ethernet interface when an IP address is - * provided - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -static int e1000_ifup(struct net_driver_s *dev) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; - - ninfo("Bringing up: %d.%d.%d.%d\n", - dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); - - /* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */ - - e1000_init(e1000); - - /* Set and activate a timer process */ - - (void)wd_start(e1000->txpoll, E1000_WDDELAY, e1000_polltimer, 1, - (wdparm_t)e1000); - - if (e1000_inl(e1000, E1000_STATUS) & 2) - { - e1000->bifup = true; - } - else - { - e1000->bifup = false; - } - - return OK; -} - -/**************************************************************************** - * Function: e1000_ifdown - * - * Description: - * NuttX Callback: Stop the interface. - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -static int e1000_ifdown(struct net_driver_s *dev) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; - irqstate_t flags; - - /* Disable the Ethernet interrupt */ - - flags = enter_critical_section(); - - e1000_turn_off(e1000); - - /* Cancel the TX poll timer and TX timeout timers */ - - wd_cancel(e1000->txpoll); - wd_cancel(e1000->txtimeout); - - /* Put the EMAC is its reset, non-operational state. This should be - * a known configuration that will guarantee the skel_ifup() always - * successfully brings the interface back up. - */ - - //e1000_reset(e1000); - - /* Mark the device "down" */ - - e1000->bifup = false; - leave_critical_section(flags); - - return OK; -} - -/**************************************************************************** - * Function: e1000_txavail - * - * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Called in normal user mode - * - ****************************************************************************/ - -static int e1000_txavail(struct net_driver_s *dev) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private; - int tail = e1000->tx_ring.tail; - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Ignore the notification if the interface is not yet up */ - - if (e1000->bifup) - { - /* Check if there is room in the hardware to hold another outgoing packet. */ - - if (e1000->tx_ring.desc[tail].desc_status) - { - (void)devif_poll(&e1000->netdev, e1000_txpoll); - } - } - - leave_critical_section(flags); - return OK; -} - -/**************************************************************************** - * Function: e1000_addmac - * - * Description: - * NuttX Callback: Add the specified MAC address to the hardware multicast - * address filtering - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be added - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IGMP -static int e1000_addmac(struct net_driver_s *dev, const uint8_t *mac) -{ - /* Add the MAC address to the hardware multicast routing table */ - - return OK; -} -#endif - -/**************************************************************************** - * Function: e1000_rmmac - * - * Description: - * NuttX Callback: Remove the specified MAC address from the hardware multicast - * address filtering - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be removed - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IGMP -static int e1000_rmmac(struct net_driver_s *dev, const uint8_t *mac) -{ - /* Add the MAC address to the hardware multicast routing table */ - - return OK; -} -#endif - -static irqreturn_t e1000_interrupt_handler(int irq, void *dev_id) -{ - struct e1000_dev *e1000 = (struct e1000_dev *)dev_id; - - /* Get and clear interrupt status bits */ - - int intr_cause = e1000_inl(e1000, E1000_ICR); - e1000_outl(e1000, E1000_ICR, intr_cause); - - /* not for me */ - - if (intr_cause == 0) - { - return IRQ_NONE; - } - - /* Handle interrupts according to status bit settings */ - - /* Link status change */ - - if (intr_cause & (1 << 2)) - { - if (e1000_inl(e1000, E1000_STATUS) & 2) - { - e1000->bifup = true; - } - else - { - e1000->bifup = false; - } - } - - /* Check if we received an incoming packet, if so, call skel_receive() */ - - /* Rx-descriptor Timer expired */ - - if (intr_cause & (1 << 7)) - { - e1000_receive(e1000); - } - - /* Tx queue empty */ - - if (intr_cause & (1 << 1)) - { - wd_cancel(e1000->txtimeout); - } - - /* Tx-descriptor Written back */ - - if (intr_cause & (1 << 0)) - { - devif_poll(&e1000->netdev, e1000_txpoll); - } - - /* Rx-Descriptors Low */ - - if (intr_cause & (1 << 4)) - { - int tail; - - tail = e1000->rx_ring.tail + e1000->rx_ring.free; - tail %= CONFIG_E1000_N_RX_DESC; - e1000->rx_ring.tail = tail; - e1000->rx_ring.free = 0; - e1000_outl(e1000, E1000_RDT, tail); - } - - return IRQ_HANDLED; -} - -/******************************* PCI driver *********************************/ - -static pci_id_t e1000_id_table[] = -{ - { - .sep = - { - INTEL_VENDERID, E1000_82573L - } - }, - { - .sep = - { - INTEL_VENDERID, E1000_82540EM - } - }, - { - .sep = - { - INTEL_VENDERID, E1000_82574L - } - }, - { - .sep = - { - INTEL_VENDERID, E1000_82567LM - } - }, - { - .sep = - { - INTEL_VENDERID, E1000_82541PI - } - }, - { - .sep = - { - 0, 0 - } - } -}; - -static int e1000_probe(uint16_t addr, pci_id_t id) -{ - uint32_t mmio_base, mmio_size; - uint32_t size; - int errcode; - void *kmem; - void *omem; - struct e1000_dev *dev; - - /* alloc e1000_dev memory */ - - if ((dev = kmm_zalloc(sizeof(struct e1000_dev))) == NULL) - { - return -1; - } - - /* save pci addr */ - - dev->pci_addr = addr; - - /* enable device */ - - if ((errcode = pci_enable_device(addr, PCI_BUS_MASTER)) < 0) - { - goto error; - } - - /* get e1000 device type */ - - dev->pci_dev_id = id.join; - - /* remap the controller's i/o-memory into kernel's address-space */ - - mmio_base = pci_resource_start(addr, 0); - mmio_size = pci_resource_len(addr, 0); - errcode = rgmp_memmap_nocache(mmio_base, mmio_size, mmio_base); - if (errcode) - { - goto error; - } - - dev->phy_mem_base = mmio_base; - dev->io_mem_base = mmio_base; - dev->mem_size = mmio_size; - - /* MAC address */ - - memset(dev->dst_mac, 0xFF, 6); - memcpy(dev->src_mac, (void *)(dev->io_mem_base+E1000_RA), 6); - - /* IRQ setup */ - - dev->int_desc.handler = e1000_interrupt_handler; - dev->int_desc.dev_id = dev; - if ((errcode = pci_request_irq(addr, &dev->int_desc, 0)) < 0) - { - goto err0; - } - - /* Here we alloc a big block of memory once and make it - * aligned to page boundary and multiple of page size. This - * is because the memory can be modified by E1000 DMA and - * should be mapped no-cache which will hugely reduce memory - * access performance. The page size alloc will restrict - * this bad effect only within the memory we alloc here. - * - * NEED FIX: the memalign may alloc memory continuous in - * virtual address but dis-continuous in physical address - * due to RGMP memory setup. - */ - - size = CONFIG_E1000_N_TX_DESC * sizeof(struct tx_desc) + - CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE + - CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + - CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE; - size = ROUNDUP(size, PGSIZE); - omem = kmem = memalign(PGSIZE, size); - if (kmem == NULL) - { - errcode = -ENOMEM; - goto err1; - } - - rgmp_memremap_nocache((uintptr_t)kmem, size); - - /* alloc memory for tx ring */ - - dev->tx_ring.desc = (FAR struct tx_desc *)kmem; - kmem += CONFIG_E1000_N_TX_DESC * sizeof(struct tx_desc); - dev->tx_ring.buf = kmem; - kmem += CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE; - - /* alloc memory for rx rings */ - - dev->rx_ring.desc = (FAR struct rx_desc *)kmem; - kmem += CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc); - dev->rx_ring.buf = kmem; - - /* Initialize the driver structure */ - - dev->netdev.d_ifup = e1000_ifup; /* I/F up (new IP address) callback */ - dev->netdev.d_ifdown = e1000_ifdown; /* I/F down callback */ - dev->netdev.d_txavail = e1000_txavail; /* New TX data callback */ -#ifdef CONFIG_NET_IGMP - dev->netdev.d_addmac = e1000_addmac; /* Add multicast MAC address */ - dev->netdev.d_rmmac = e1000_rmmac; /* Remove multicast MAC address */ -#endif - dev->netdev.d_private = dev; /* Used to recover private state from dev */ - - /* Create a watchdog for timing polling for and timing of transmisstions */ - - dev->txpoll = wd_create(); /* Create periodic poll timer */ - dev->txtimeout = wd_create(); /* Create TX timeout timer */ - - /* Put the interface in the down state. - * e1000 reset - */ - - e1000_reset(dev); - - /* Read the MAC address from the hardware */ - - memcpy(dev->netdev.d_mac.ether_addr_octet, (void *)(dev->io_mem_base+E1000_RA), 6); - - /* Register the device with the OS so that socket IOCTLs can be performed */ - - errcode = netdev_register(&dev->netdev, NET_LL_ETHERNET); - if (errcode) - { - goto err2; - } - - /* insert into e1000_list */ - - dev->next = e1000_list.next; - e1000_list.next = dev; - cprintf("bring up e1000 device: %04x %08x\n", addr, id.join); - - return 0; - -err2: - rgmp_memremap((uintptr_t)omem, size); - free(omem); -err1: - pci_free_irq(addr); -err0: - rgmp_memunmap(mmio_base, mmio_size); -error: - kmm_free(dev); - cprintf("e1000 device probe fail: %d\n", errcode); - return errcode; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void e1000_mod_init(void) -{ - pci_probe_device(e1000_id_table, e1000_probe); -} - -void e1000_mod_exit(void) -{ - uint32_t size; - struct e1000_dev *dev; - - size = CONFIG_E1000_N_TX_DESC * sizeof(struct tx_desc) + - CONFIG_E1000_N_TX_DESC * CONFIG_E1000_BUFF_SIZE + - CONFIG_E1000_N_RX_DESC * sizeof(struct rx_desc) + - CONFIG_E1000_N_RX_DESC * CONFIG_E1000_BUFF_SIZE; - size = ROUNDUP(size, PGSIZE); - - for (dev = e1000_list.next; dev != NULL; dev = dev->next) - { - netdev_unregister(&dev->netdev); - e1000_reset(dev); - wd_delete(dev->txpoll); - wd_delete(dev->txtimeout); - rgmp_memremap((uintptr_t)dev->tx_ring.desc, size); - free(dev->tx_ring.desc); - pci_free_irq(dev->pci_addr); - rgmp_memunmap((uintptr_t)dev->io_mem_base, dev->mem_size); - kmm_free(dev); - } - - e1000_list.next = NULL; -} diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h deleted file mode 100644 index 63ff53e3c3f724bf24152f6155a775b888d9dd00..0000000000000000000000000000000000000000 --- a/drivers/net/e1000.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** - * drivers/net/e1000.h - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 __DRIVERS_NET_E1000_H -#define __DRIVERS_NET_E1000_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/************** PCI ID ***************/ - -#define INTEL_VENDERID 0x8086 -#define E1000_82573L 0x109a -#define E1000_82540EM 0x100e -#define E1000_82574L 0x10d3 -#define E1000_82567LM 0x10f5 -#define E1000_82541PI 0x107c - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -enum e1000_registers { - E1000_CTRL = 0x0000, // Device Control - E1000_STATUS = 0x0008, // Device Status - E1000_CTRL_EXT = 0x0018, // Device Control Extension - E1000_FCAL = 0x0028, // Flow Control Address Low - E1000_FCAH = 0x002C, // Flow Control Address High - E1000_FCT = 0x0030, // Flow Control Type - E1000_ICR = 0x00C0, // Interrupt Cause Read - E1000_ICS = 0x00C8, // Interrupt Cause Set - E1000_IMS = 0x00D0, // Interrupt Mask Set - E1000_IMC = 0x00D8, // Interrupt Mask Clear - E1000_RCTL = 0x0100, // Receive Control - E1000_FCTTV = 0x0170, // Flow Control Transmit Timer Value - E1000_TCTL = 0x0400, // Transmit Control - E1000_PBA = 0x1000, // Packet Buffer Allocation - E1000_FCRTL = 0x2160, // Flow Control Receive Threshold Low - E1000_FCRTH = 0x2168, // Flow Control Receive Threshold High - E1000_RDBAL = 0x2800, // Rx Descriptor Base Address Low - E1000_RDBAH = 0x2804, // Rx Descriptor Base Address High - E1000_RDLEN = 0x2808, // Rx Descriptor Length - E1000_RDH = 0x2810, // Rx Descriptor Head - E1000_RDT = 0x2818, // Rx Descriptor Tail - E1000_RXDCTL = 0x2828, // Rx Descriptor Control - E1000_TDBAL = 0x3800, // Tx Descriptor Base Address Low - E1000_TDBAH = 0x3804, // Tx Descriptor Base Address High - E1000_TDLEN = 0x3808, // Tx Descriptor Length - E1000_TDH = 0x3810, // Tx Descriptor Head - E1000_TDT = 0x3818, // Tx Descriptor Tail - E1000_TXDCTL = 0x3828, // Tx Descriptor Control - E1000_TPR = 0x40D0, // Total Packets Received - E1000_TPT = 0x40D4, // Total Packets Transmitted - E1000_RA = 0x5400, // Receive-filter Array -}; - -/***************** e1000 device structure *****************/ - -struct tx_desc { - uint64_t base_address; - uint16_t packet_length; - uint8_t cksum_offset; - uint8_t desc_command; - uint8_t desc_status; - uint8_t cksum_origin; - uint16_t special_info; -}; - -struct rx_desc { - uint64_t base_address; - uint16_t packet_length; - uint16_t packet_cksum; - uint8_t desc_status; - uint8_t desc_errors; - uint16_t vlan_tag; -}; - -#endif diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index a1c052f73da362770b246b0266aebb830fd657c2..e91a5652ce42efb634d7b5800977cf3c83e64f13 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -135,12 +135,6 @@ # define enc_dumppacket(m,a,n) #endif -/* The ENC28J60 will not do interrupt level processing */ - -#ifndef CONFIG_NET_NOINTS -# warning "CONFIG_NET_NOINTS should be set" -#endif - /* Low-level register debug */ #if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_NET) @@ -269,6 +263,12 @@ struct enc_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver status structure */ + static struct enc_driver_s g_enc28j60[CONFIG_ENC28J60_NINTERFACES]; /**************************************************************************** @@ -1623,14 +1623,13 @@ static void enc_pktif(FAR struct enc_driver_s *priv) static void enc_irqworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; uint8_t eir; DEBUGASSERT(priv); /* Get exclusive access to both the network and the SPI bus. */ - lock = net_lock(); + net_lock(); enc_lock(priv); /* Disable further interrupts by clearing the global interrupt enable bit. @@ -1821,7 +1820,7 @@ static void enc_irqworker(FAR void *arg) /* Release lock on the SPI bus and the network */ enc_unlock(priv); - net_unlock(lock); + net_unlock(); } /**************************************************************************** @@ -1883,7 +1882,6 @@ static int enc_interrupt(int irq, FAR void *context) static void enc_toworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; int ret; nerr("ERROR: Tx timeout\n"); @@ -1891,7 +1889,7 @@ static void enc_toworker(FAR void *arg) /* Get exclusive access to the network */ - lock = net_lock(); + net_lock(); /* Increment statistics and dump debug info */ @@ -1913,7 +1911,7 @@ static void enc_toworker(FAR void *arg) /* Release lock on the network */ - net_unlock(lock); + net_unlock(); } /**************************************************************************** @@ -1977,13 +1975,12 @@ static void enc_txtimeout(int argc, uint32_t arg, ...) static void enc_pollworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; DEBUGASSERT(priv); /* Get exclusive access to both the network and the SPI bus. */ - lock = net_lock(); + net_lock(); enc_lock(priv); /* Verify that the hardware is ready to send another packet. The driver @@ -2005,7 +2002,7 @@ static void enc_pollworker(FAR void *arg) /* Release lock on the SPI bus and the network */ enc_unlock(priv); - net_unlock(lock); + net_unlock(); /* Setup the watchdog poll timer again */ @@ -2631,6 +2628,7 @@ int enc_initialize(FAR struct spi_dev_s *spi, /* Initialize the driver structure */ memset(g_enc28j60, 0, CONFIG_ENC28J60_NINTERFACES*sizeof(struct enc_driver_s)); + priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->dev.d_ifup = enc_ifup; /* I/F down callback */ priv->dev.d_ifdown = enc_ifdown; /* I/F up (new IP address) callback */ priv->dev.d_txavail = enc_txavail; /* New TX data callback */ diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index af415ac6d3721f292f47d8ffa584bf2ddb91e8cc..e1690680471837bafca0b6d1395c18039a097541 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -140,12 +140,6 @@ # define enc_dumppacket(m,a,n) #endif -/* The ENCX24J600 will not do interrupt level processing */ - -#ifndef CONFIG_NET_NOINTS -# warning "CONFIG_NET_NOINTS should be set" -#endif - /* Low-level register debug */ #if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_NET) @@ -282,6 +276,12 @@ struct enc_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver status structure */ + static struct enc_driver_s g_encx24j600[CONFIG_ENCX24J600_NINTERFACES]; /**************************************************************************** @@ -1835,14 +1835,13 @@ static void enc_rxabtif(FAR struct enc_driver_s *priv) static void enc_irqworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; uint16_t eir; DEBUGASSERT(priv); /* Get exclusive access to both the network and the SPI bus. */ - lock = net_lock(); + net_lock(); enc_lock(priv); /* A good practice is for the host controller to clear the Global Interrupt @@ -1986,7 +1985,7 @@ static void enc_irqworker(FAR void *arg) /* Release lock on the SPI bus and the network */ enc_unlock(priv); - net_unlock(lock); + net_unlock(); } /**************************************************************************** @@ -2048,7 +2047,6 @@ static int enc_interrupt(int irq, FAR void *context) static void enc_toworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; int ret; nerr("ERROR: Tx timeout\n"); @@ -2056,7 +2054,7 @@ static void enc_toworker(FAR void *arg) /* Get exclusive access to the network. */ - lock = net_lock(); + net_lock(); /* Increment statistics and dump debug info */ @@ -2078,7 +2076,7 @@ static void enc_toworker(FAR void *arg) /* Release the network */ - net_unlock(lock); + net_unlock(); } /**************************************************************************** @@ -2142,13 +2140,12 @@ static void enc_txtimeout(int argc, uint32_t arg, ...) static void enc_pollworker(FAR void *arg) { FAR struct enc_driver_s *priv = (FAR struct enc_driver_s *)arg; - net_lock_t lock; DEBUGASSERT(priv); /* Get exclusive access to both the network and the SPI bus. */ - lock = net_lock(); + net_lock(); enc_lock(priv); /* Verify that the hardware is ready to send another packet. The driver @@ -2170,7 +2167,7 @@ static void enc_pollworker(FAR void *arg) /* Release lock on the SPI bus and the network */ enc_unlock(priv); - net_unlock(lock); + net_unlock(); /* Setup the watchdog poll timer again */ @@ -2866,6 +2863,7 @@ int enc_initialize(FAR struct spi_dev_s *spi, /* Initialize the driver structure */ memset(g_encx24j600, 0, CONFIG_ENCX24J600_NINTERFACES*sizeof(struct enc_driver_s)); + priv->dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->dev.d_ifup = enc_ifup; /* I/F up (new IP address) callback */ priv->dev.d_ifdown = enc_ifdown; /* I/F down callback */ priv->dev.d_txavail = enc_txavail; /* New TX data callback */ diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index c1fbec650ad79ff6bde0ea189794f59d656eaaac..1550d9ad7c50c628a8159aef22e5c9459a362d5e 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -56,11 +56,7 @@ #include #include #include - -#ifdef CONFIG_NET_NOINTS -# include -#endif - +#include #include #include #include @@ -76,13 +72,12 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#endif +#else -/* Use the low priority work queue if possible */ + /* Use the low priority work queue if possible */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_FTMAC100_HPWORK) # define FTMAWORK HPWORK # elif defined(CONFIG_FTMAC100_LPWORK) @@ -178,10 +173,8 @@ struct ftmac100_driver_s bool ft_bifup; /* true:ifup false:ifdown */ WDOG_ID ft_txpoll; /* TX poll timer */ WDOG_ID ft_txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS unsigned int status; /* Last ISR status */ struct work_s ft_work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -192,6 +185,12 @@ struct ftmac100_driver_s * Private Data ****************************************************************************/ +/* A single packet buffer is used */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structure. */ + static struct ftmac100_driver_s g_ftmac100[CONFIG_FTMAC100_NINTERFACES] __attribute__((aligned(16))); @@ -209,35 +208,26 @@ static int ftmac100_txpoll(struct net_driver_s *dev); static void ftmac100_reset(FAR struct ftmac100_driver_s *priv); static void ftmac100_receive(FAR struct ftmac100_driver_s *priv); static void ftmac100_txdone(FAR struct ftmac100_driver_s *priv); -static inline void ftmac100_interrupt_process(FAR struct ftmac100_driver_s *priv); -#ifdef CONFIG_NET_NOINTS + static void ftmac100_interrupt_work(FAR void *arg); -#endif static int ftmac100_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void ftmac100_txtimeout_process(FAR struct ftmac100_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void ftmac100_txtimeout_work(FAR void *arg); -#endif static void ftmac100_txtimeout_expiry(int argc, uint32_t arg, ...); -static inline void ftmac100_poll_process(FAR struct ftmac100_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void ftmac100_poll_work(FAR void *arg); -#endif static void ftmac100_poll_expiry(int argc, uint32_t arg, ...); /* NuttX callback functions */ static int ftmac100_ifup(FAR struct net_driver_s *dev); static int ftmac100_ifdown(FAR struct net_driver_s *dev); -static inline void ftmac100_txavail_process(FAR struct ftmac100_driver_s *priv); -#ifdef CONFIG_NET_NOINTS + static void ftmac100_txavail_work(FAR void *arg); -#endif static int ftmac100_txavail(FAR struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int ftmac100_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); #ifdef CONFIG_NET_IGMP @@ -867,34 +857,33 @@ static void ftmac100_txdone(FAR struct ftmac100_driver_s *priv) } /**************************************************************************** - * Function: ftmac100_interrupt_process + * Function: ftmac100_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void ftmac100_interrupt_process(FAR struct ftmac100_driver_s *priv) +static void ftmac100_interrupt_work(FAR void *arg) { + FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; FAR struct ftmac100_register_s *iobase = (FAR struct ftmac100_register_s *)priv->iobase; unsigned int status; unsigned int phycr; -#ifdef CONFIG_NET_NOINTS + /* Process pending Ethernet interrupts */ + + net_lock(); status = priv->status; -#else - status = getreg32 (&iobase->isr); -#endif ninfo("status=%08x(%08x) BASE=%p ISR=%p PHYCR=%p\n", status, getreg32(&iobase->isr), iobase, &iobase->isr, &iobase->phycr); @@ -964,47 +953,12 @@ out: putreg32 (INT_MASK_ALL_ENABLED, &iobase->imr); ninfo("ISR-done\n"); -} - -/**************************************************************************** - * Function: ftmac100_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void ftmac100_interrupt_work(FAR void *arg) -{ - FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; - net_lock_t state; -//irqstate_t flags; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); -//flags = enter_critical_section(); - - ftmac100_interrupt_process(priv); - -//leave_critical_section(flags); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ up_enable_irq(CONFIG_FTMAC100_IRQ); } -#endif /**************************************************************************** * Function: ftmac100_interrupt @@ -1028,17 +982,12 @@ static int ftmac100_interrupt(int irq, FAR void *context) FAR struct ftmac100_driver_s *priv = &g_ftmac100[0]; FAR struct ftmac100_register_s *iobase = (FAR struct ftmac100_register_s *)priv->iobase; -#ifdef CONFIG_NET_NOINTS - irqstate_t flags; - /* Disable further Ethernet interrupts. Because Ethernet interrupts are * also disabled if the TX timeout event occurs, there can be no race * condition here. */ - flags = enter_critical_section(); - - priv->status = getreg32 (&iobase->isr); + priv->status = getreg32(&iobase->isr); up_disable_irq(CONFIG_FTMAC100_IRQ); @@ -1067,45 +1016,9 @@ static int ftmac100_interrupt(int irq, FAR void *context) work_queue(FTMAWORK, &priv->ft_work, ftmac100_interrupt_work, priv, 0); - leave_critical_section(flags); -#else - /* Process the interrupt now */ - putreg32 (INT_MASK_ALL_DISABLED, &iobase->imr); - - ftmac100_interrupt_process(priv); -#endif - return OK; } -/**************************************************************************** - * Function: ftmac100_txtimeout_process - * - * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. - * - * Parameters: - * priv - Reference to the driver state structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -static inline void ftmac100_txtimeout_process(FAR struct ftmac100_driver_s *priv) -{ - /* Then reset the hardware */ - - ninfo("TXTIMEOUT\n"); - - /* Then poll the network for new XMIT data */ - - (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); -} - /**************************************************************************** * Function: ftmac100_txtimeout_work * @@ -1123,19 +1036,21 @@ static inline void ftmac100_txtimeout_process(FAR struct ftmac100_driver_s *priv * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void ftmac100_txtimeout_work(FAR void *arg) { FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; - net_lock_t state; + + ninfo("TXTIMEOUT\n"); /* Process pending Ethernet interrupts */ - state = net_lock(); - ftmac100_txtimeout_process(priv); - net_unlock(state); + net_lock(); + + /* Then poll the network for new XMIT data */ + + (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); + net_unlock(); } -#endif /**************************************************************************** * Function: ftmac100_txtimeout_expiry @@ -1160,7 +1075,6 @@ static void ftmac100_txtimeout_expiry(int argc, uint32_t arg, ...) { FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -1177,32 +1091,32 @@ static void ftmac100_txtimeout_expiry(int argc, uint32_t arg, ...) /* Schedule to perform the TX timeout processing on the worker thread. */ work_queue(FTMAWORK, &priv->ft_work, ftmac100_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - ftmac100_txtimeout_process(priv); -#endif } - /**************************************************************************** - * Function: ftmac100_poll_process + * Function: ftmac100_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static inline void ftmac100_poll_process(FAR struct ftmac100_driver_s *priv) +static void ftmac100_poll_work(FAR void *arg) { + FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; + + /* Perform the poll */ + + net_lock(); + /* Check if there is room in the send another TX packet. We cannot perform * the TX poll if he are unable to accept another packet for transmission. */ @@ -1218,39 +1132,9 @@ static inline void ftmac100_poll_process(FAR struct ftmac100_driver_s *priv) (void)wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, (wdparm_t)priv); + net_unlock(); } -/**************************************************************************** - * Function: ftmac100_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void ftmac100_poll_work(FAR void *arg) -{ - FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - ftmac100_poll_process(priv); - net_unlock(state); -} -#endif - /**************************************************************************** * Function: ftmac100_poll_expiry * @@ -1273,7 +1157,6 @@ static void ftmac100_poll_expiry(int argc, uint32_t arg, ...) { FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -1293,12 +1176,6 @@ static void ftmac100_poll_expiry(int argc, uint32_t arg, ...) (void)wd_start(priv->ft_txpoll, FTMAC100_WDDELAY, ftmac100_poll_expiry, 1, (wdparm_t)arg); } - -#else - /* Process the interrupt now */ - - ftmac100_poll_process(priv); -#endif } /**************************************************************************** @@ -1409,24 +1286,30 @@ static int ftmac100_ifdown(struct net_driver_s *dev) } /**************************************************************************** - * Function: ftmac100_txavail_process + * Function: ftmac100_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void ftmac100_txavail_process(FAR struct ftmac100_driver_s *priv) +static void ftmac100_txavail_work(FAR void *arg) { + FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; + + /* Perform the poll */ + + net_lock(); + /* Ignore the notification if the interface is not yet up */ if (priv->ft_bifup) @@ -1437,38 +1320,9 @@ static inline void ftmac100_txavail_process(FAR struct ftmac100_driver_s *priv) (void)devif_poll(&priv->ft_dev, ftmac100_txpoll); } -} - -/**************************************************************************** - * Function: ftmac100_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void ftmac100_txavail_work(FAR void *arg) -{ - FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)arg; - net_lock_t state; - - /* Perform the poll */ - state = net_lock(); - ftmac100_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: ftmac100_txavail @@ -1493,7 +1347,6 @@ static int ftmac100_txavail(struct net_driver_s *dev) { FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -1506,21 +1359,6 @@ static int ftmac100_txavail(struct net_driver_s *dev) work_queue(FTMAWORK, &priv->ft_work, ftmac100_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - ftmac100_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } @@ -1738,6 +1576,7 @@ int ftmac100_initialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct ftmac100_driver_s)); + priv->ft_dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->ft_dev.d_ifup = ftmac100_ifup; /* I/F up (new IP address) callback */ priv->ft_dev.d_ifdown = ftmac100_ifdown; /* I/F down callback */ priv->ft_dev.d_txavail = ftmac100_txavail; /* New TX data callback */ diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index a9c1b6a819cf52bdca7bf5b8ff60130b20591f12..06459d5449087708d457e71ef92521d1a28952e2 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/net/loopback.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,12 +67,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Non-network-driven configuration is required */ - -#ifndef CONFIG_NET_NOINTS -# error CONFIG_NET_NOINTS must be selected -#endif - /* We need to have the work queue to handle SPI interrupts */ #if !defined(CONFIG_SCHED_WORKQUEUE) @@ -121,10 +115,7 @@ struct lo_driver_s ****************************************************************************/ static struct lo_driver_s g_loopback; - -#ifdef CONFIG_NET_MULTIBUFFER static uint8_t g_iobuffer[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif /**************************************************************************** * Private Function Prototypes @@ -247,11 +238,10 @@ static int lo_txpoll(FAR struct net_driver_s *dev) static void lo_poll_work(FAR void *arg) { FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)arg; - net_lock_t state; /* Perform the poll */ - state = net_lock(); + net_lock(); priv->lo_txdone = false; (void)devif_timer(&priv->lo_dev, lo_txpoll); @@ -268,7 +258,7 @@ static void lo_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ (void)wd_start(priv->lo_polldog, LO_WDDELAY, lo_poll_expiry, 1, priv); - net_unlock(state); + net_unlock(); } /**************************************************************************** @@ -404,11 +394,10 @@ static int lo_ifdown(FAR struct net_driver_s *dev) static void lo_txavail_work(FAR void *arg) { FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)arg; - net_lock_t state; /* Ignore the notification if the interface is not yet up */ - state = net_lock(); + net_lock(); if (priv->lo_bifup) { do @@ -421,7 +410,7 @@ static void lo_txavail_work(FAR void *arg) while (priv->lo_txdone); } - net_unlock(state); + net_unlock(); } /**************************************************************************** @@ -555,9 +544,7 @@ int localhost_initialize(void) priv->lo_dev.d_addmac = lo_addmac; /* Add multicast MAC address */ priv->lo_dev.d_rmmac = lo_rmmac; /* Remove multicast MAC address */ #endif -#ifdef CONFIG_NET_MULTIBUFFER priv->lo_dev.d_buf = g_iobuffer; /* Attach the IO buffer */ -#endif priv->lo_dev.d_private = (FAR void *)priv; /* Used to recover private state from dev */ /* Create a watchdog for timing polling for and timing of transmissions */ diff --git a/drivers/net/skeleton.c b/drivers/net/skeleton.c index ea24cf688c2ff50e3e9dc90a390fc63016ed249e..59c5a8fac5058ecabde981c7a36563dd3b48e905 100644 --- a/drivers/net/skeleton.c +++ b/drivers/net/skeleton.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/net/skeleton.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -53,13 +53,10 @@ #include #include #include +#include #include #include -#ifdef CONFIG_NET_NOINTS -# include -#endif - #ifdef CONFIG_NET_PKT # include #endif @@ -71,17 +68,16 @@ * is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#endif +#else -/* Use the low priority work queue if possible */ + /* Use the low priority work queue if possible */ -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_skeleton_HPWORK) -# define skelWORK HPWORK +# define ETHWORK HPWORK # elif defined(CONFIG_skeleton_LPWORK) -# define skelWORK LPWORK +# define ETHWORK LPWORK # else # error Neither CONFIG_skeleton_HPWORK nor CONFIG_skeleton_LPWORK defined # endif @@ -120,9 +116,7 @@ struct skel_driver_s bool sk_bifup; /* true:ifup false:ifdown */ WDOG_ID sk_txpoll; /* TX poll timer */ WDOG_ID sk_txtimeout; /* TX timeout timer */ -#ifdef CONFIG_NET_NOINTS struct work_s sk_work; /* For deferring work to the work queue */ -#endif /* This holds the information visible to the NuttX network */ @@ -133,6 +127,19 @@ struct skel_driver_s * Private Data ****************************************************************************/ +/* These statically allocated structur would mean that only a single + * instance of the device could be supported. In order to support multiple + * devices instances, this data would have to be allocated dynamically. + */ + +/* A single packet buffer per device is used here. There might be multiple + * packet buffers in a more complex, pipelined design. + */ + +static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; + +/* Driver state structure */ + static struct skel_driver_s g_skel[CONFIG_skeleton_NINTERFACES]; /**************************************************************************** @@ -148,35 +155,26 @@ static int skel_txpoll(FAR struct net_driver_s *dev); static void skel_receive(FAR struct skel_driver_s *priv); static void skel_txdone(FAR struct skel_driver_s *priv); -static inline void skel_interrupt_process(FAR struct skel_driver_s *priv); -#ifdef CONFIG_NET_NOINTS + static void skel_interrupt_work(FAR void *arg); -#endif static int skel_interrupt(int irq, FAR void *context); /* Watchdog timer expirations */ -static inline void skel_txtimeout_process(FAR struct skel_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void skel_txtimeout_work(FAR void *arg); -#endif static void skel_txtimeout_expiry(int argc, wdparm_t arg, ...); -static inline void skel_poll_process(FAR struct skel_driver_s *priv); -#ifdef CONFIG_NET_NOINTS static void skel_poll_work(FAR void *arg); -#endif static void skel_poll_expiry(int argc, wdparm_t arg, ...); /* NuttX callback functions */ static int skel_ifup(FAR struct net_driver_s *dev); static int skel_ifdown(FAR struct net_driver_s *dev); -static inline void skel_txavail_process(FAR struct skel_driver_s *priv); -#ifdef CONFIG_NET_NOINTS + static void skel_txavail_work(FAR void *arg); -#endif static int skel_txavail(FAR struct net_driver_s *dev); + #if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) static int skel_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); #ifdef CONFIG_NET_IGMP @@ -494,31 +492,35 @@ static void skel_txdone(FAR struct skel_driver_s *priv) } /**************************************************************************** - * Function: skel_interrupt_process + * Function: skel_interrupt_work * * Description: - * Interrupt processing. This may be performed either within the interrupt - * handler or on the worker thread, depending upon the configuration + * Perform interrupt related work from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() was called. * * Returned Value: - * None + * OK on success * * Assumptions: * The network is locked. * ****************************************************************************/ -static inline void skel_interrupt_process(FAR struct skel_driver_s *priv) +static void skel_interrupt_work(FAR void *arg) { + FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; + + /* Process pending Ethernet interrupts */ + /* Get and clear interrupt status bits */ /* Handle interrupts according to status bit settings */ /* Check if we received an incoming packet, if so, call skel_receive() */ + net_lock(); skel_receive(priv); /* Check if a packet transmission just completed. If so, call skel_txdone. @@ -527,42 +529,12 @@ static inline void skel_interrupt_process(FAR struct skel_driver_s *priv) */ skel_txdone(priv); -} - -/**************************************************************************** - * Function: skel_interrupt_work - * - * Description: - * Perform interrupt related work from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() was called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * The network is locked. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_NOINTS -static void skel_interrupt_work(FAR void *arg) -{ - FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; - net_lock_t state; - - /* Process pending Ethernet interrupts */ - - state = net_lock(); - skel_interrupt_process(priv); - net_unlock(state); + net_unlock(); /* Re-enable Ethernet interrupts */ up_enable_irq(CONFIG_skeleton_IRQ); } -#endif /**************************************************************************** * Function: skel_interrupt @@ -585,7 +557,6 @@ static int skel_interrupt(int irq, FAR void *context) { FAR struct skel_driver_s *priv = &g_skel[0]; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. Because Ethernet interrupts are * also disabled if the TX timeout event occurs, there can be no race * condition here. @@ -597,7 +568,7 @@ static int skel_interrupt(int irq, FAR void *context) { /* If a TX transfer just completed, then cancel the TX timeout so - * there will be do race condition between any subsequent timeout + * there will be no race condition between any subsequent timeout * expiration and the deferred interrupt processing. */ @@ -606,51 +577,14 @@ static int skel_interrupt(int irq, FAR void *context) /* Cancel any pending poll work */ - work_cancel(HPWORK, &priv->sk_work); + work_cancel(ETHWORK, &priv->sk_work); /* Schedule to perform the interrupt processing on the worker thread. */ - work_queue(skelWORK, &priv->sk_work, skel_interrupt_work, priv, 0); - -#else - /* Process the interrupt now */ - - skel_interrupt_process(priv); -#endif - + work_queue(ETHWORK, &priv->sk_work, skel_interrupt_work, priv, 0); return OK; } -/**************************************************************************** - * Function: skel_txtimeout_process - * - * Description: - * Process a TX timeout. Called from the either the watchdog timer - * expiration logic or from the worker thread, depending upon the - * configuration. The timeout means that the last TX never completed. - * Reset the hardware and start again. - * - * Parameters: - * priv - Reference to the driver state structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -static inline void skel_txtimeout_process(FAR struct skel_driver_s *priv) -{ - /* Increment statistics and dump debug info */ - - NETDEV_TXTIMEOUTS(priv->sk_dev); - - /* Then reset the hardware */ - - /* Then poll the network for new XMIT data */ - - (void)devif_poll(&priv->sk_dev, skel_txpoll); -} - /**************************************************************************** * Function: skel_txtimeout_work * @@ -668,19 +602,22 @@ static inline void skel_txtimeout_process(FAR struct skel_driver_s *priv) * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void skel_txtimeout_work(FAR void *arg) { FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; - net_lock_t state; - /* Process pending Ethernet interrupts */ + /* Increment statistics and dump debug info */ - state = net_lock(); - skel_txtimeout_process(priv); - net_unlock(state); + NETDEV_TXTIMEOUTS(priv->sk_dev); + + /* Then reset the hardware */ + + /* Then poll the network for new XMIT data */ + + net_lock(); + (void)devif_poll(&priv->sk_dev, skel_txpoll); + net_unlock(); } -#endif /**************************************************************************** * Function: skel_txtimeout_expiry @@ -705,7 +642,6 @@ static void skel_txtimeout_expiry(int argc, wdparm_t arg, ...) { FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Disable further Ethernet interrupts. This will prevent some race * conditions with interrupt work. There is still a potential race * condition with interrupt work that is already queued and in progress. @@ -717,16 +653,11 @@ static void skel_txtimeout_expiry(int argc, wdparm_t arg, ...) * on work that has already been started. */ - work_cancel(skelWORK, &priv->sk_work); + work_cancel(ETHWORK, &priv->sk_work); /* Schedule to perform the TX timeout processing on the worker thread. */ - work_queue(skelWORK, &priv->sk_work, skel_txtimeout_work, priv, 0); -#else - /* Process the timeout now */ - - skel_txtimeout_process(priv); -#endif + work_queue(ETHWORK, &priv->sk_work, skel_txtimeout_work, priv, 0); } /**************************************************************************** @@ -748,21 +679,6 @@ static void skel_txtimeout_expiry(int argc, wdparm_t arg, ...) static inline void skel_poll_process(FAR struct skel_driver_s *priv) { - /* Check if there is room in the send another TX packet. We cannot perform - * the TX poll if he are unable to accept another packet for transmission. - */ - - /* If so, update TCP timing states and poll the network for new XMIT data. - * Hmmm.. might be bug here. Does this mean if there is a transmit in - * progress, we will missing TCP time state updates? - */ - - (void)devif_timer(&priv->sk_dev, skel_txpoll); - - /* Setup the watchdog poll timer again */ - - (void)wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, - (wdparm_t)priv); } /**************************************************************************** @@ -782,19 +698,30 @@ static inline void skel_poll_process(FAR struct skel_driver_s *priv) * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS static void skel_poll_work(FAR void *arg) { FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; - net_lock_t state; /* Perform the poll */ - state = net_lock(); - skel_poll_process(priv); - net_unlock(state); + /* Check if there is room in the send another TX packet. We cannot perform + * the TX poll if he are unable to accept another packet for transmission. + */ + + /* If so, update TCP timing states and poll the network for new XMIT data. + * Hmmm.. might be bug here. Does this mean if there is a transmit in + * progress, we will missing TCP time state updates? + */ + + net_lock(); + (void)devif_timer(&priv->sk_dev, skel_txpoll); + + /* Setup the watchdog poll timer again */ + + (void)wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, + (wdparm_t)priv); + net_unlock(); } -#endif /**************************************************************************** * Function: skel_poll_expiry @@ -818,7 +745,6 @@ static void skel_poll_expiry(int argc, wdparm_t arg, ...) { FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -827,7 +753,7 @@ static void skel_poll_expiry(int argc, wdparm_t arg, ...) { /* Schedule to perform the interrupt processing on the worker thread. */ - work_queue(skelWORK, &priv->sk_work, skel_poll_work, priv, 0); + work_queue(ETHWORK, &priv->sk_work, skel_poll_work, priv, 0); } else { @@ -837,12 +763,6 @@ static void skel_poll_expiry(int argc, wdparm_t arg, ...) (void)wd_start(priv->sk_txpoll, skeleton_WDDELAY, skel_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - skel_poll_process(priv); -#endif } /**************************************************************************** @@ -944,26 +864,29 @@ static int skel_ifdown(FAR struct net_driver_s *dev) } /**************************************************************************** - * Function: skel_txavail_process + * Function: skel_txavail_work * * Description: - * Perform an out-of-cycle poll. + * Perform an out-of-cycle poll on the worker thread. * * Parameters: - * dev - Reference to the NuttX driver state structure + * arg - Reference to the NuttX driver state structure (cast to void*) * * Returned Value: * None * * Assumptions: - * Called in normal user mode + * Called on the higher priority worker thread. * ****************************************************************************/ -static inline void skel_txavail_process(FAR struct skel_driver_s *priv) +static void skel_txavail_work(FAR void *arg) { + FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; + /* Ignore the notification if the interface is not yet up */ + net_lock(); if (priv->sk_bifup) { /* Check if there is room in the hardware to hold another outgoing packet. */ @@ -972,38 +895,9 @@ static inline void skel_txavail_process(FAR struct skel_driver_s *priv) (void)devif_poll(&priv->sk_dev, skel_txpoll); } -} - -/**************************************************************************** - * Function: skel_txavail_work - * - * Description: - * Perform an out-of-cycle poll on the worker thread. - * - * Parameters: - * arg - Reference to the NuttX driver state structure (cast to void*) - * - * Returned Value: - * None - * - * Assumptions: - * Called on the higher priority worker thread. - * - ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS -static void skel_txavail_work(FAR void *arg) -{ - FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - state = net_lock(); - skel_txavail_process(priv); - net_unlock(state); + net_unlock(); } -#endif /**************************************************************************** * Function: skel_txavail @@ -1028,7 +922,6 @@ static int skel_txavail(FAR struct net_driver_s *dev) { FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)dev->d_private; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions and we will have to ignore the Tx * availability action. @@ -1038,24 +931,9 @@ static int skel_txavail(FAR struct net_driver_s *dev) { /* Schedule to serialize the poll on the worker thread. */ - work_queue(skelWORK, &priv->sk_work, skel_txavail_work, priv, 0); + work_queue(ETHWORK, &priv->sk_work, skel_txavail_work, priv, 0); } -#else - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Perform the out-of-cycle poll now */ - - skel_txavail_process(priv); - leave_critical_section(flags); -#endif - return OK; } @@ -1234,6 +1112,7 @@ int skel_initialize(int intf) /* Initialize the driver structure */ memset(priv, 0, sizeof(struct skel_driver_s)); + priv->sk_dev.d_buf = g_pktbuf; /* Single packet buffer */ priv->sk_dev.d_ifup = skel_ifup; /* I/F up (new IP address) callback */ priv->sk_dev.d_ifdown = skel_ifdown; /* I/F down callback */ priv->sk_dev.d_txavail = skel_txavail; /* New TX data callback */ diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 744126971ec1b26bd383213a90196616a3589fee..afd3ca91ae268739219189990d908440f82febdf 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -76,14 +76,6 @@ /* Configuration ************************************************************/ -#ifndef CONFIG_NET_NOINTS -# warning "CONFIG_NET_NOINTS must be set" -#endif - -#ifndef CONFIG_NET_MULTIBUFFER -# warning "CONFIG_NET_MULTIBUFFER must be set" -#endif - #ifndef CONFIG_NET_SLIP_STACKSIZE # define CONFIG_NET_SLIP_STACKSIZE 2048 #endif @@ -434,7 +426,6 @@ static void slip_txtask(int argc, FAR char *argv[]) { FAR struct slip_driver_s *priv; unsigned int index = *(argv[1]) - '0'; - net_lock_t flags; systime_t start_ticks; systime_t now_ticks; unsigned int hsec; @@ -480,7 +471,7 @@ static void slip_txtask(int argc, FAR char *argv[]) /* Poll the networking layer for new XMIT data. */ - flags = net_lock(); + net_lock(); priv->dev.d_buf = priv->txbuf; /* Has a half second elapsed since the last timer poll? */ @@ -501,7 +492,7 @@ static void slip_txtask(int argc, FAR char *argv[]) (void)devif_poll(&priv->dev, slip_txpoll); } - net_unlock(flags); + net_unlock(); slip_semgive(priv); } } @@ -659,7 +650,6 @@ static int slip_rxtask(int argc, FAR char *argv[]) { FAR struct slip_driver_s *priv; unsigned int index = *(argv[1]) - '0'; - net_lock_t flags; int ch; nerr("index: %d\n", index); @@ -732,7 +722,7 @@ static int slip_rxtask(int argc, FAR char *argv[]) priv->dev.d_buf = priv->rxbuf; priv->dev.d_len = priv->rxlen; - flags = net_lock(); + net_lock(); ipv4_input(&priv->dev); /* If the above function invocation resulted in data that should @@ -745,7 +735,8 @@ static int slip_rxtask(int argc, FAR char *argv[]) slip_transmit(priv); kill(priv->txpid, SIGALRM); } - net_unlock(flags); + + net_unlock(); slip_semgive(priv); } else diff --git a/drivers/net/tun.c b/drivers/net/tun.c index aaa411a613c0c7c55b69ea5bea9126dc530073b7..ebb59587b6252d5ce11d6a88f889b80a749f5b0e 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -58,15 +58,12 @@ #include #include #include +#include #include #include - -#include #include -#ifdef CONFIG_NET_NOINTS -# include -#endif +#include #ifdef CONFIG_NET_PKT # include @@ -79,11 +76,10 @@ * work queue support is required. */ -#if defined(CONFIG_NET_NOINTS) && !defined(CONFIG_SCHED_WORKQUEUE) +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#endif +#else -#if defined(CONFIG_SCHED_WORKQUEUE) # if defined(CONFIG_TUN_HPWORK) # define TUNWORK HPWORK # elif defined(CONFIG_TUN_LPWORK) @@ -119,9 +115,7 @@ struct tun_device_s { bool bifup; /* true:ifup false:ifdown */ WDOG_ID txpoll; /* TX poll timer */ -#ifdef CONFIG_NET_NOINTS struct work_s work; /* For deferring work to the work queue */ -#endif FAR struct file *filep; @@ -169,10 +163,7 @@ static void tun_txdone(FAR struct tun_device_s *priv); /* Watchdog timer expirations */ -static inline void tun_poll_process(FAR struct tun_device_s *priv); -#ifdef CONFIG_NET_NOINTS static void tun_poll_work(FAR void *arg); -#endif static void tun_poll_expiry(int argc, wdparm_t arg, ...); /* NuttX callback functions */ @@ -533,24 +524,31 @@ static void tun_txdone(FAR struct tun_device_s *priv) } /**************************************************************************** - * Function: tun_poll_process + * Function: tun_poll_work * * Description: - * Perform the periodic poll. This may be called either from watchdog - * timer logic or from the worker thread, depending upon the configuration. + * Perform periodic polling from the worker thread * * Parameters: - * priv - Reference to the driver state structure + * arg - The argument passed when work_queue() as called. * * Returned Value: - * None + * OK on success * * Assumptions: + * Ethernet interrupts are disabled * ****************************************************************************/ -static void tun_poll_process(FAR struct tun_device_s *priv) +static void tun_poll_work(FAR void *arg) { + FAR struct tun_device_s *priv = (FAR struct tun_device_s *)arg; + + /* Perform the poll */ + + tun_lock(priv); + net_lock(); + /* Check if there is room in the send another TX packet. We cannot perform * the TX poll if he are unable to accept another packet for transmission. */ @@ -566,42 +564,10 @@ static void tun_poll_process(FAR struct tun_device_s *priv) /* Setup the watchdog poll timer again */ (void)wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, 1, priv); -} - -/**************************************************************************** - * Function: tun_poll_work - * - * Description: - * Perform periodic polling from the worker thread - * - * Parameters: - * arg - The argument passed when work_queue() as called. - * - * Returned Value: - * OK on success - * - * Assumptions: - * Ethernet interrupts are disabled - * - ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS -static void tun_poll_work(FAR void *arg) -{ - FAR struct tun_device_s *priv = (FAR struct tun_device_s *)arg; - net_lock_t state; - - /* Perform the poll */ - - tun_lock(priv); - state = net_lock(); - - tun_poll_process(priv); - - net_unlock(state); + net_unlock(); tun_unlock(priv); } -#endif /**************************************************************************** * Function: tun_poll_expiry @@ -625,7 +591,6 @@ static void tun_poll_expiry(int argc, wdparm_t arg, ...) { FAR struct tun_device_s *priv = (FAR struct tun_device_s *)arg; -#ifdef CONFIG_NET_NOINTS /* Is our single work structure available? It may not be if there are * pending interrupt actions. */ @@ -644,12 +609,6 @@ static void tun_poll_expiry(int argc, wdparm_t arg, ...) (void)wd_start(priv->txpoll, TUN_WDDELAY, tun_poll_expiry, 1, arg); } - -#else - /* Process the interrupt now */ - - tun_poll_process(priv); -#endif } /**************************************************************************** @@ -758,7 +717,6 @@ static int tun_ifdown(struct net_driver_s *dev) static int tun_txavail(struct net_driver_s *dev) { FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private; - net_lock_t state; tun_lock(priv); @@ -770,7 +728,7 @@ static int tun_txavail(struct net_driver_s *dev) return OK; } - state = net_lock(); + net_lock(); if (priv->bifup) { @@ -780,7 +738,7 @@ static int tun_txavail(struct net_driver_s *dev) (void)devif_poll(&priv->dev, tun_txpoll); } - net_unlock(state); + net_unlock(); tun_unlock(priv); return OK; @@ -1005,7 +963,6 @@ static ssize_t tun_write(FAR struct file *filep, FAR const char *buffer, size_t buflen) { FAR struct tun_device_s *priv = filep->f_priv; - net_lock_t state; ssize_t ret; if (!priv) @@ -1021,7 +978,7 @@ static ssize_t tun_write(FAR struct file *filep, FAR const char *buffer, return -EBUSY; } - state = net_lock(); + net_lock(); if (buflen > CONFIG_NET_TUN_MTU) { @@ -1039,7 +996,7 @@ static ssize_t tun_write(FAR struct file *filep, FAR const char *buffer, ret = (ssize_t)buflen; } - net_unlock(state); + net_unlock(); tun_unlock(priv); return ret; @@ -1053,7 +1010,6 @@ static ssize_t tun_read(FAR struct file *filep, FAR char *buffer, size_t buflen) { FAR struct tun_device_s *priv = filep->f_priv; - net_lock_t state; ssize_t ret; size_t write_d_len; size_t read_d_len; @@ -1084,9 +1040,9 @@ static ssize_t tun_read(FAR struct file *filep, FAR char *buffer, if (priv->read_d_len == 0) { - state = net_lock(); + net_lock(); tun_txdone(priv); - net_unlock(state); + net_unlock(); } goto out; @@ -1106,7 +1062,7 @@ static ssize_t tun_read(FAR struct file *filep, FAR char *buffer, tun_lock(priv); } - state = net_lock(); + net_lock(); read_d_len = priv->read_d_len; if (buflen < read_d_len) @@ -1122,7 +1078,7 @@ static ssize_t tun_read(FAR struct file *filep, FAR char *buffer, priv->read_d_len = 0; tun_txdone(priv); - net_unlock(state); + net_unlock(); out: tun_unlock(priv); diff --git a/drivers/net/vnet.c b/drivers/net/vnet.c deleted file mode 100644 index 8f6f14afb299f2da768b96a204f564a79ba14bfb..0000000000000000000000000000000000000000 --- a/drivers/net/vnet.c +++ /dev/null @@ -1,776 +0,0 @@ -/**************************************************************************** - * drivers/net/vnet.c - * - * Copyright (C) 2011 Yu Qiang. All rights reserved. - * Author: Yu Qiang - * - * This file is a part of NuttX: - * - * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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 -#if defined(CONFIG_NET) && defined(CONFIG_NET_VNET) - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#ifdef CONFIG_NET_PKT -# include -#endif - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* CONFIG_VNET_NINTERFACES determines the number of physical interfaces - * that will be supported. - */ - -#ifndef CONFIG_VNET_NINTERFACES -# define CONFIG_VNET_NINTERFACES 1 -#endif - -/* TX poll deley = 1 seconds. CLK_TCK is the number of clock ticks per second */ - -#define VNET_WDDELAY (1*CLK_TCK) - -/* TX timeout = 1 minute */ - -#define VNET_TXTIMEOUT (60*CLK_TCK) - -/* This is a helper pointer for accessing the contents of the Ethernet header */ - -#define BUF ((struct eth_hdr_s *)vnet->sk_dev.d_buf) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/* The vnet_driver_s encapsulates all state information for a single hardware - * interface - */ - -struct vnet_driver_s -{ - bool sk_bifup; /* true:ifup false:ifdown */ - WDOG_ID sk_txpoll; /* TX poll timer */ - struct rgmp_vnet *vnet; - - /* This holds the information visible to the NuttX */ - - struct net_driver_s sk_dev; /* Interface understood by the network */ -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static struct vnet_driver_s g_vnet[CONFIG_VNET_NINTERFACES]; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/* Common TX logic */ - -static int vnet_transmit(FAR struct vnet_driver_s *vnet); -static int vnet_txpoll(struct net_driver_s *dev); - -/* Interrupt handling */ - -static void vnet_txdone(FAR struct vnet_driver_s *vnet); - -/* Watchdog timer expirations */ - -static void vnet_polltimer(int argc, uint32_t arg, ...); -static void vnet_txtimeout(int argc, uint32_t arg, ...); - -/* NuttX callback functions */ - -static int vnet_ifup(struct net_driver_s *dev); -static int vnet_ifdown(struct net_driver_s *dev); -static int vnet_txavail(struct net_driver_s *dev); -#ifdef CONFIG_NET_IGMP -static int vnet_addmac(struct net_driver_s *dev, FAR const uint8_t *mac); -static int vnet_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac); -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Function: vnet_transmit - * - * Description: - * Start hardware transmission. Called either from the txdone interrupt - * handling or from watchdog based polling. - * - * Parameters: - * vnet - Reference to the driver state structure - * - * Returned Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * May or may not be called from an interrupt handler. In either case, - * global interrupts are disabled, either explicitly or indirectly through - * interrupt handling logic. - * - ****************************************************************************/ - -static int vnet_transmit(FAR struct vnet_driver_s *vnet) -{ - int errcode; - - /* Verify that the hardware is ready to send another packet. If we get - * here, then we are committed to sending a packet; Higher level logic - * must have assured that there is not transmission in progress. - */ - - /* Send the packet: address=vnet->sk_dev.d_buf, length=vnet->sk_dev.d_len */ - - errcode = vnet_xmit(vnet->vnet, (char *)vnet->sk_dev.d_buf, vnet->sk_dev.d_len); - if (errcode) - { - /* When vnet_xmit fail, it means TX buffer is full. Watchdog - * is of no use here because no TX done INT will happen. So - * we reset the TX buffer directly. - */ - -#ifdef CONFIG_DEBUG_FEATURES - cprintf("VNET: TX buffer is full\n"); -#endif - return ERROR; - } - else - { - /* This step may be unnecessary here */ - - vnet_txdone(vnet); - } - - return OK; -} - -/**************************************************************************** - * Function: vnet_txpoll - * - * Description: - * The transmitter is available, check if the network has any outgoing - * packets ready to send. This is a callback from devif_poll(). - * devif_poll() may be called: - * - * 1. When the preceding TX packet send is complete, - * 2. When the preceding TX packet send timesout and the interface is reset - * 3. During normal TX polling - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * May or may not be called from an interrupt handler. In either case, - * global interrupts are disabled, either explicitly or indirectly through - * interrupt handling logic. - * - ****************************************************************************/ - -static int vnet_txpoll(struct net_driver_s *dev) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - - /* If the polling resulted in data that should be sent out on the network, - * the field d_len is set to a value > 0. - */ - - if (vnet->sk_dev.d_len > 0) - { - /* Look up the destination MAC address and add it to the Ethernet - * header. - */ - -#ifdef CONFIG_NET_IPv4 -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(vnet->sk_dev.d_flags)) -#endif - { - arp_out(&vnet->sk_dev); - } -#endif /* CONFIG_NET_IPv4 */ - -#ifdef CONFIG_NET_IPv6 -#ifdef CONFIG_NET_IPv4 - else -#endif - { - neighbor_out(&vnet->sk_dev); - } -#endif /* CONFIG_NET_IPv6 */ - - /* Send the packet */ - - vnet_transmit(vnet); - - /* Check if there is room in the device to hold another packet. If not, - * return a non-zero value to terminate the poll. - */ - - if (vnet_is_txbuff_full(vnet->vnet)) - { - return 1; - } - } - - /* If zero is returned, the polling will continue until all connections have - * been examined. - */ - - return 0; -} - -/**************************************************************************** - * Function: rtos_vnet_recv - * - * Description: - * An interrupt was received indicating the availability of a new RX packet - * - * Parameters: - * vnet - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by interrupt handling logic. - * - ****************************************************************************/ - -void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len) -{ - struct vnet_driver_s *vnet = rgmp_vnet->priv; - - do - { - /* Check if the packet is a valid size for the network buffer - * configuration. - */ - - if (len > CONFIG_NET_ETH_MTU || len < 14) - { -#ifdef CONFIG_DEBUG_FEATURES - cprintf("VNET: receive invalid packet of size %d\n", len); -#endif - return; - } - - /* Copy the data data from the hardware to vnet->sk_dev.d_buf. Set - * amount of data in vnet->sk_dev.d_len - */ - - memcpy(vnet->sk_dev.d_buf, data, len); - vnet->sk_dev.d_len = len; - -#ifdef CONFIG_NET_PKT - /* When packet sockets are enabled, feed the frame into the packet tap */ - - pkt_input(&vnet->sk_dev); -#endif - - /* We only accept IP packets of the configured type and ARP packets */ - -#ifdef CONFIG_NET_IPv4 - if (BUF->type == HTONS(ETHTYPE_IP)) - { - ninfo("IPv4 frame\n"); - - /* Handle ARP on input then give the IPv4 packet to the network - * layer - */ - - arp_ipin(&vnet->sk_dev); - ipv4_input(&vnet->sk_dev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (vnet->sk_dev.d_len > 0) - { - /* Update the Ethernet header with the correct MAC address */ - -#ifdef CONFIG_NET_IPv6 - if (IFF_IS_IPv4(vnet->sk_dev.d_flags)) -#endif - { - arp_out(&vnet->sk_dev); - } -#ifdef CONFIG_NET_IPv6 - else - { - neighbor_out(&vnet->sk_dev); - } -#endif - - /* And send the packet */ - - vnet_transmit(vnet); - } - } - else -#endif -#ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(ETHTYPE_IP6)) - { - ninfo("Iv6 frame\n"); - - /* Give the IPv6 packet to the network layer */ - - ipv6_input(&vnet->sk_dev); - - /* If the above function invocation resulted in data that should be - * sent out on the network, the field d_len will set to a value > 0. - */ - - if (vnet->sk_dev.d_len > 0) - { - /* Update the Ethernet header with the correct MAC address */ - -#ifdef CONFIG_NET_IPv4 - if (IFF_IS_IPv4(vnet->sk_dev.d_flags)) - { - arp_out(&vnet->sk_dev); - } - else -#endif -#ifdef CONFIG_NET_IPv6 - { - neighbor_out(&vnet->sk_dev); - } -#endif - - /* And send the packet */ - - vnet_transmit(vnet); - } - } - else -#endif -#ifdef CONFIG_NET_ARP - if (BUF->type == htons(ETHTYPE_ARP)) - { - arp_arpin(&vnet->sk_dev); - - /* If the above function invocation resulted in data that should - * be sent out on the network, the field d_len will set to a - * value > 0. - */ - - if (vnet->sk_dev.d_len > 0) - { - vnet_transmit(vnet); - } - } -#endif - } - while (0); /* While there are more packets to be processed */ -} - -/**************************************************************************** - * Function: vnet_txdone - * - * Description: - * An interrupt was received indicating that the last TX packet(s) is done - * - * Parameters: - * vnet - Reference to the driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void vnet_txdone(FAR struct vnet_driver_s *vnet) -{ - /* Poll the network for new XMIT data */ - - (void)devif_poll(&vnet->sk_dev, vnet_txpoll); -} - -/**************************************************************************** - * Function: vnet_txtimeout - * - * Description: - * Our TX watchdog timed out. Called from the timer interrupt handler. - * The last TX never completed. Reset the hardware and start again. - * - * Parameters: - * argc - The number of available arguments - * arg - The first argument - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void vnet_txtimeout(int argc, uint32_t arg, ...) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg; - - /* Poll the network for new XMIT data */ - - (void)devif_poll(&vnet->sk_dev, vnet_txpoll); -} - -/**************************************************************************** - * Function: vnet_polltimer - * - * Description: - * Periodic timer handler. Called from the timer interrupt handler. - * - * Parameters: - * argc - The number of available arguments - * arg - The first argument - * - * Returned Value: - * None - * - * Assumptions: - * Global interrupts are disabled by the watchdog logic. - * - ****************************************************************************/ - -static void vnet_polltimer(int argc, uint32_t arg, ...) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)arg; - - /* Check if there is room in the send another TX packet. We cannot perform - * the TX poll if he are unable to accept another packet for transmission. - */ - - if (vnet_is_txbuff_full(vnet->vnet)) - { -#ifdef CONFIG_DEBUG_FEATURES - cprintf("VNET: TX buffer is full\n"); -#endif - return; - } - - /* If so, update TCP timing states and poll the network for new XMIT data. - * Hmmm.. might be bug here. Does this mean if there is a transmit in - * progress, we will missing TCP time state updates? - */ - - (void)devif_timer(&vnet->sk_dev, vnet_txpoll); - - /* Setup the watchdog poll timer again */ - - (void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, - (wdparm_t)arg); -} - -/**************************************************************************** - * Function: vnet_ifup - * - * Description: - * NuttX Callback: Bring up the Ethernet interface when an IP address is - * provided - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -static int vnet_ifup(struct net_driver_s *dev) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - - ninfo("Bringing up: %d.%d.%d.%d\n", - dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff, - (dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24); - - /* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */ - - /* Set and activate a timer process */ - - (void)wd_start(vnet->sk_txpoll, VNET_WDDELAY, vnet_polltimer, 1, - (wdparm_t)vnet); - - vnet->sk_bifup = true; - return OK; -} - -/**************************************************************************** - * Function: vnet_ifdown - * - * Description: - * NuttX Callback: Stop the interface. - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -static int vnet_ifdown(struct net_driver_s *dev) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - irqstate_t flags; - - /* Disable the Ethernet interrupt */ - - flags = enter_critical_section(); - - /* Cancel the TX poll timer and TX timeout timers */ - - wd_cancel(vnet->sk_txpoll); - - /* Put the EMAC is its reset, non-operational state. This should be - * a known configuration that will guarantee the vnet_ifup() always - * successfully brings the interface back up. - */ - - /* Mark the device "down" */ - - vnet->sk_bifup = false; - leave_critical_section(flags); - return OK; -} - -/**************************************************************************** - * Function: vnet_txavail - * - * Description: - * Driver callback invoked when new TX data is available. This is a - * stimulus perform an out-of-cycle poll and, thereby, reduce the TX - * latency. - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * - * Returned Value: - * None - * - * Assumptions: - * Called in normal user mode - * - ****************************************************************************/ - -static int vnet_txavail(struct net_driver_s *dev) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - irqstate_t flags; - - /* Disable interrupts because this function may be called from interrupt - * level processing. - */ - - flags = enter_critical_section(); - - /* Ignore the notification if the interface is not yet up */ - - if (vnet->sk_bifup) - { - /* Check if there is room in the hardware to hold another outgoing packet. */ - - if (vnet_is_txbuff_full(vnet->vnet)) - { -#ifdef CONFIG_DEBUG_FEATURES - cprintf("VNET: TX buffer is full\n"); -#endif - goto out; - } - - /* If so, then poll the network for new XMIT data */ - - (void)devif_poll(&vnet->sk_dev, vnet_txpoll); - } - -out: - leave_critical_section(flags); - return OK; -} - -/**************************************************************************** - * Function: vnet_addmac - * - * Description: - * NuttX Callback: Add the specified MAC address to the hardware multicast - * address filtering - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be added - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IGMP -static int vnet_addmac(struct net_driver_s *dev, FAR const uint8_t *mac) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - - /* Add the MAC address to the hardware multicast routing table */ - - return OK; -} -#endif - -/**************************************************************************** - * Function: vnet_rmmac - * - * Description: - * NuttX Callback: Remove the specified MAC address from the hardware multicast - * address filtering - * - * Parameters: - * dev - Reference to the NuttX driver state structure - * mac - The MAC address to be removed - * - * Returned Value: - * None - * - * Assumptions: - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IGMP -static int vnet_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac) -{ - FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private; - - /* Add the MAC address to the hardware multicast routing table */ - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Function: vnet_initialize - * - * Description: - * Initialize the Ethernet controller and driver - * - * Parameters: - * intf - In the case where there are multiple EMACs, this value - * identifies which EMAC is to be initialized. - * - * Returned Value: - * OK on success; Negated errno on failure. - * - * Assumptions: - * - ****************************************************************************/ - -int vnet_init(struct rgmp_vnet *vnet) -{ - struct vnet_driver_s *priv; - static int i = 0; - - if (i >= CONFIG_VNET_NINTERFACES) - { - return -1; - } - - priv = &g_vnet[i++]; - - /* Initialize the driver structure */ - - memset(priv, 0, sizeof(struct vnet_driver_s)); - priv->sk_dev.d_ifup = vnet_ifup; /* I/F down callback */ - priv->sk_dev.d_ifdown = vnet_ifdown; /* I/F up (new IP address) callback */ - priv->sk_dev.d_txavail = vnet_txavail; /* New TX data callback */ -#ifdef CONFIG_NET_IGMP - priv->sk_dev.d_addmac = vnet_addmac; /* Add multicast MAC address */ - priv->sk_dev.d_rmmac = vnet_rmmac; /* Remove multicast MAC address */ -#endif - priv->sk_dev.d_private = (FAR void *)priv; /* Used to recover private state from dev */ - - /* Create a watchdog for timing polling for and timing of transmisstions */ - - priv->sk_txpoll = wd_create(); /* Create periodic poll timer */ - - priv->vnet = vnet; - vnet->priv = priv; - - /* Register the device with the OS */ - - (void)netdev_register(&priv->sk_dev), NET_LL_ETHERNET; - - return 0; -} - -#endif /* CONFIG_NET && CONFIG_NET_VNET */ diff --git a/drivers/sercomm/Kconfig b/drivers/sercomm/Kconfig deleted file mode 100644 index f72f3c094ce4c8f031445c514c343376e4e79e75..0000000000000000000000000000000000000000 --- a/drivers/sercomm/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# diff --git a/drivers/sercomm/README.txt b/drivers/sercomm/README.txt deleted file mode 100644 index 06add26e88bda7bf977f2eb596944c7607cf65e5..0000000000000000000000000000000000000000 --- a/drivers/sercomm/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -drivers/sercomm README -====================== - -If CONFIG_SERCOMM_CONSOLE is defined in the NuttX configuration file, NuttX -will attempt to use sercomm (HDLC protocol) to communicate with the -host system. Sercomm is the transport used by osmocom-bb that runs on top -of serial. See http://bb.osmocom.org/trac/wiki/nuttx-bb/run for detailed -the usage of nuttx with sercomm. - -The drivers/sercomm build that you have the osmocom-bb project directory -at same level as the nuttx project: - - |- nuttx - |- apps - `- osmocom-bb - -If you attempt to build this driver without osmocom-bb, you will get -compilation errors because of header files that are needed from the -osmocom-bb directory. diff --git a/drivers/sercomm/console.c b/drivers/sercomm/console.c deleted file mode 100644 index efd1174ba3f3f2fb085433d5eb56edea153e9efb..0000000000000000000000000000000000000000 --- a/drivers/sercomm/console.c +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * drivers/sercomm/console.c - * Driver for NuttX Console - * - * (C) 2010 by Harald Welte - * (C) 2011 Stefan Richter - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include -#include - -#include -#include -#include - -#include "uart.h" -#include -#include - -/************************************************************************************ - * Fileops Prototypes and Structures - ************************************************************************************/ - -typedef FAR struct file file_t; - -static ssize_t sc_console_read(file_t *filep, FAR char *buffer, size_t buflen); -static ssize_t sc_console_write(file_t *filep, FAR const char *buffer, size_t buflen); -static int sc_console_ioctl(file_t *filep, int cmd, unsigned long arg); -#ifndef CONFIG_DISABLE_POLL -static int sc_console_poll(file_t *filep, FAR struct pollfd *fds, bool setup); -#endif - -static const struct file_operations g_sercom_console_ops = -{ - 0, /* open, always opened */ - 0, /* close, stays open */ - sc_console_read, /* read */ - sc_console_write, /* write */ - 0, /* seek, not supported */ - sc_console_ioctl, /* ioctl */ -#ifndef CONFIG_DISABLE_POLL - sc_console_poll /* poll */ -#endif -}; - -static FAR uart_dev_t *readdev = NULL; -static struct msgb *recvmsg = NULL; - -/**************************************************************************** - * Helper functions - ****************************************************************************/ - -static void recv_cb(uint8_t dlci, struct msgb *msg) -{ - sem_post(&readdev->recvsem); - recvmsg = msg; -} - -/**************************************************************************** - * Fileops - ****************************************************************************/ - -/* REVISIT: recvmsg is overwritten when multiple msg arrive! */ - -static ssize_t sc_console_read(file_t *filep, FAR char *buffer, size_t buflen) -{ - size_t len; - struct msgb *tmp; - - /* Wait until data is received */ - - while (recvmsg == NULL) - { - sem_wait(&readdev->recvsem); - } - - len = recvmsg->len > buflen ? buflen : recvmsg->len; - memcpy(buffer, msgb_get(recvmsg, len), len); - - if (recvmsg->len == 0) - { - /* prevent inconsistent msg by first invalidating it, then free it */ - - tmp = recvmsg; - recvmsg = NULL; - msgb_free(tmp); - } - - return len; -} - -/* REVISIT: redirect to old Osmocom-BB comm/sercomm_cons.c -> 2 buffers */ - -extern int sercomm_puts(const char *s); - -static ssize_t sc_console_write(file_t *filep, FAR const char *buffer, size_t buflen) -{ - char dstbuf[32]; - int cnt; - - if (buflen >= 31) - { - cnt = 31; - } - else - { - cnt = buflen; - } - - memcpy(dstbuf, buffer, cnt); - dstbuf[cnt] = '\0'; - - /* print part of our buffer */ - - sercomm_puts(dstbuf); - - /* wait a little bit to get data transfered */ - - up_mdelay(1); - - return cnt; -} - -/* Forward ioctl to uart driver */ - -static int sc_console_ioctl(struct file *filep, int cmd, unsigned long arg) -{ - FAR struct inode *inode = filep->f_inode; - FAR uart_dev_t *dev = inode->i_private; - - return dev->ops->ioctl(filep, cmd, arg); -} - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/* Use sercomm on uart driver, register console driver */ - -int sercomm_register(FAR const char *path, FAR uart_dev_t *dev) -{ - /* REVISIT: initialize MODEMUART to be used for sercomm */ - - uart_init(SERCOMM_UART_NR, 1); - uart_baudrate(SERCOMM_UART_NR, UART_115200); - readdev = dev; - sercomm_register_rx_cb(SC_DLCI_LOADER, &recv_cb); - - sem_init(&dev->xmit.sem, 0, 1); - sem_init(&dev->recv.sem, 0, 1); - sem_init(&dev->closesem, 0, 1); - sem_init(&dev->xmitsem, 0, 0); - sem_init(&dev->recvsem, 0, 0); -#ifndef CONFIG_DISABLE_POLL - sem_init(&dev->pollsem, 0, 1); -#endif - - sem_setprotocol(&dev->xmitsem, SEM_PRIO_NONE); - sem_setprotocol(&dev->recvsem, SEM_PRIO_NONE); - - _info("Registering %s\n", path); - return register_driver(path, &g_sercom_console_ops, 0666, NULL); -} - -/* Stubs to make serial driver happy */ - -void sercomm_recvchars(void *a) -{ -} - -void sercomm_xmitchars(void *a) -{ -} - -/* Stubs to make memory allocator happy */ - -void cons_puts(void *foo) -{ -} - -void delay_ms(int ms) -{ -} diff --git a/drivers/sercomm/loadwriter.py b/drivers/sercomm/loadwriter.py deleted file mode 100755 index 6234d6f0d3ec80053690c3719f40fde8072f4566..0000000000000000000000000000000000000000 --- a/drivers/sercomm/loadwriter.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python -from socket import * -import time - -SOCKET_NAME = '/tmp/osmocom_loader' - -s = socket(AF_UNIX, SOCK_STREAM) -s.connect(SOCKET_NAME) - -while 1: - try: - x = raw_input(">") - y = len(x) + 1 - s.send(chr(y>>8) + chr(y&255) + x + "\n") - except: - print '' - break - -s.close() diff --git a/drivers/sercomm/uart.c b/drivers/sercomm/uart.c deleted file mode 100644 index 9e257455a89c62631c921e8c6deee80f0549bc5c..0000000000000000000000000000000000000000 --- a/drivers/sercomm/uart.c +++ /dev/null @@ -1,607 +0,0 @@ -/**************************************************************************** - * drivers/sercomm/uart.c - * Calypso DBB internal UART Driver - * - * (C) 2010 by Harald Welte - * (C) 2010 by Ingo Albrecht - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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. - * - ****************************************************************************/ - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -#include "uart.h" - -#define BASE_ADDR_UART_MODEM 0xffff5000 -#define OFFSET_IRDA 0x800 - -#define UART_REG(n,m) (BASE_ADDR_UART_MODEM + ((n)*OFFSET_IRDA)+(m)) - -#define LCR7BIT 0x80 -#define LCRBFBIT 0x40 -#define MCR6BIT 0x20 -#define REG_OFFS(m) ((m) & ~(LCR7BIT|LCRBFBIT|MCR6BIT)) - -/* read access LCR[7] = 0 */ - -enum uart_reg -{ - RHR = 0, - IER = 1, - IIR = 2, - LCR = 3, - MCR = 4, - LSR = 5, - MSR = 6, - SPR = 7, - MDR1 = 8, - DMR2 = 9, - SFLSR = 0x0a, - RESUME = 0x0b, - SFREGL = 0x0c, - SFREGH = 0x0d, - BLR = 0x0e, - ACREG = 0x0f, - SCR = 0x10, - SSR = 0x11, - EBLR = 0x12, - - /* read access LCR[7] = 1 */ - - DLL = RHR | LCR7BIT, - DLH = IER | LCR7BIT, - DIV1_6 = ACREG | LCR7BIT, - - /* read/write access LCR[7:0] = 0xbf */ - - EFR = IIR | LCRBFBIT, - XON1 = MCR | LCRBFBIT, - XON2 = LSR | LCRBFBIT, - XOFF1 = MSR | LCRBFBIT, - XOFF2 = SPR | LCRBFBIT, - - /* read/write access if EFR[4] = 1 and MCR[6] = 1 */ - - TCR = MSR | MCR6BIT, - TLR = SPR | MCR6BIT, -}; - -/* write access LCR[7] = 0 */ - -#define THR RHR -#define FCR IIR /* only if EFR[4] = 1 */ -#define TXFLL SFLSR -#define TXFLH RESUME -#define RXFLL SFREGL -#define RXFLH SFREGH - -enum fcr_bits -{ - FIFO_EN = (1 << 0), - RX_FIFO_CLEAR = (1 << 1), - TX_FIFO_CLEAR = (1 << 2), - DMA_MODE = (1 << 3), -}; - -#define TX_FIFO_TRIG_SHIFT 4 -#define RX_FIFO_TRIG_SHIFT 6 - -enum iir_bits -{ - IIR_INT_PENDING = 0x01, - IIR_INT_TYPE = 0x3E, - IIR_INT_TYPE_RX_STATUS_ERROR = 0x06, - IIR_INT_TYPE_RX_TIMEOUT = 0x0C, - IIR_INT_TYPE_RHR = 0x04, - IIR_INT_TYPE_THR = 0x02, - IIR_INT_TYPE_MSR = 0x00, - IIR_INT_TYPE_XOFF = 0x10, - IIR_INT_TYPE_FLOW = 0x20, - IIR_FCR0_MIRROR = 0xC0, -}; - -#define UART_REG_UIR 0xffff6000 - -/* enable or disable the divisor latch for access to DLL, DLH */ - -static void uart_set_lcr7bit(int uart, int on) -{ - uint8_t reg; - - reg = readb(UART_REG(uart, LCR)); - if (on) - { - reg |= (1 << 7); - } - else - { - reg &= ~(1 << 7); - } - - writeb(reg, UART_REG(uart, LCR)); -} - -static uint8_t old_lcr; -static void uart_set_lcr_bf(int uart, int on) -{ - if (on) - { - old_lcr = readb(UART_REG(uart, LCR)); - writeb(0xBF, UART_REG(uart, LCR)); - } - else - { - writeb(old_lcr, UART_REG(uart, LCR)); - } -} - -/* Enable or disable the TCR_TLR latch bit in MCR[6] */ - -static void uart_set_mcr6bit(int uart, int on) -{ - uint8_t mcr; - - /* we assume EFR[4] is always set to 1 */ - - mcr = readb(UART_REG(uart, MCR)); - if (on) - { - mcr |= (1 << 6); - } - else - { - mcr &= ~(1 << 6); - } - - writeb(mcr, UART_REG(uart, MCR)); -} - -static void uart_reg_write(int uart, enum uart_reg reg, uint8_t val) -{ - if (reg & LCRBFBIT) - { - uart_set_lcr_bf(uart, 1); - } - else if (reg & LCR7BIT) - { - uart_set_lcr7bit(uart, 1); - } - else if (reg & MCR6BIT) - { - uart_set_mcr6bit(uart, 1); - } - - writeb(val, UART_REG(uart, REG_OFFS(reg))); - - if (reg & LCRBFBIT) - { - uart_set_lcr_bf(uart, 0); - } - else if (reg & LCR7BIT) - { - uart_set_lcr7bit(uart, 0); - } - else if (reg & MCR6BIT) - { - uart_set_mcr6bit(uart, 0); - } -} - -/* read from a UART register, applying any required latch bits */ - -static uint8_t uart_reg_read(int uart, enum uart_reg reg) -{ - uint8_t ret; - - if (reg & LCRBFBIT) - { - uart_set_lcr_bf(uart, 1); - } - else if (reg & LCR7BIT) - { - uart_set_lcr7bit(uart, 1); - } - else if (reg & MCR6BIT) - { - uart_set_mcr6bit(uart, 1); - } - - ret = readb(UART_REG(uart, REG_OFFS(reg))); - - if (reg & LCRBFBIT) - { - uart_set_lcr_bf(uart, 0); - } - else if (reg & LCR7BIT) - { - uart_set_lcr7bit(uart, 0); - } - else if (reg & MCR6BIT) - { - uart_set_mcr6bit(uart, 0); - } - - return ret; -} - -#if 0 -static void uart_irq_handler_cons(__unused enum irq_nr irqnr) -{ - const uint8_t uart = CONS_UART_NR; - uint8_t iir; - - iir = uart_reg_read(uart, IIR); - if (iir & IIR_INT_PENDING) - { - return; - } - - switch (iir & IIR_INT_TYPE) - { - case IIR_INT_TYPE_RHR: - break; - - case IIR_INT_TYPE_THR: - if (cons_rb_flush() == 1) - { - /* everything was flushed, disable THR IRQ */ - - uint8_t ier = uart_reg_read(uart, IER); - ier &= ~(1 << 1); - uart_reg_write(uart, IER, ier); - } - break; - - case IIR_INT_TYPE_MSR: - break; - - case IIR_INT_TYPE_RX_STATUS_ERROR: - break; - - case IIR_INT_TYPE_RX_TIMEOUT: - break; - - case IIR_INT_TYPE_XOFF: - break; - } -} -#endif - -static void uart_irq_handler_sercomm(__unused enum irq_nr irqnr, __unused void *context) -{ - const uint8_t uart = SERCOMM_UART_NR; - uint8_t iir, ch; - - iir = uart_reg_read(uart, IIR); - if (iir & IIR_INT_PENDING) - { - return; - } - - switch (iir & IIR_INT_TYPE) - { - case IIR_INT_TYPE_RX_TIMEOUT: - case IIR_INT_TYPE_RHR: - /* as long as we have rx data available */ - - while (uart_getchar_nb(uart, &ch)) - { - if (sercomm_drv_rx_char(ch) < 0) - { - /* sercomm cannot receive more data right now */ - - uart_irq_enable(uart, UART_IRQ_RX_CHAR, 0); - } - } - break; - - case IIR_INT_TYPE_THR: - /* as long as we have space in the FIFO */ - - while (!uart_tx_busy(uart)) - { - /* get a byte from sercomm */ - - if (!sercomm_drv_pull(&ch)) - { - /* no more bytes in sercomm, stop TX interrupts */ - - uart_irq_enable(uart, UART_IRQ_TX_EMPTY, 0); - break; - } - - /* write the byte into the TX FIFO */ - - uart_putchar_nb(uart, ch); - } - break; - - case IIR_INT_TYPE_MSR: - printf("UART IRQ MSR\n"); - break; - - case IIR_INT_TYPE_RX_STATUS_ERROR: - printf("UART IRQ RX_SE\n"); - break; - - case IIR_INT_TYPE_XOFF: - printf("UART IRQXOFF\n"); - break; - } -} - -static const uint8_t uart2irq[] = -{ - [0] = IRQ_UART_IRDA, - [1] = IRQ_UART_MODEM, -}; - -void uart_init(uint8_t uart, uint8_t interrupts) -{ -#if 0 - uint8_t irq = uart2irq[uart]; -#endif - - uart_reg_write(uart, IER, 0x00); - - if (uart == SERCOMM_UART_NR) - { - sercomm_init(); - irq_attach(IRQ_UART_MODEM, (xcpt_t)uart_irq_handler_sercomm); - up_enable_irq(IRQ_UART_MODEM); - uart_irq_enable(uart, UART_IRQ_RX_CHAR, 1); - } - -#if 0 - if (uart == CONS_UART_NR) - { - cons_init(); - if (interrupts) - { - irq_register_handler(irq, &uart_irq_handler_cons); - irq_config(irq, 0, 0, 0xff); - irq_enable(irq); - } - } - else - { - sercomm_init(); - if (interrupts) - { - irq_register_handler(irq, &uart_irq_handler_sercomm); - irq_config(irq, 0, 0, 0xff); - irq_enable(irq); - } - - uart_irq_enable(uart, UART_IRQ_RX_CHAR, 1); - } -#endif -#if 0 - if (uart == 1) - { - /* assign UART to MCU and unmask interrupts */ - - writeb(UART_REG_UIR, 0x00); - } -#endif - - /* if we don't initialize these, we get strange corruptions in the - * received data... :-( - */ - - uart_reg_write(uart, MDR1, 0x07); /* turn off UART */ - uart_reg_write(uart, XON1, 0x00); /* Xon1/Addr Register */ - uart_reg_write(uart, XON2, 0x00); /* Xon2/Addr Register */ - uart_reg_write(uart, XOFF1, 0x00); /* Xoff1 Register */ - uart_reg_write(uart, XOFF2, 0x00); /* Xoff2 Register */ - uart_reg_write(uart, EFR, 0x00); /* Enhanced Features Register */ - - /* select UART mode */ - - uart_reg_write(uart, MDR1, 0); - - /* no XON/XOFF flow control, ENHANCED_EN, no auto-RTS/CTS */ - - uart_reg_write(uart, EFR, (1 << 4)); - - /* enable Tx/Rx FIFO, Tx trigger at 56 spaces, Rx trigger at 60 chars */ - - uart_reg_write(uart, FCR, FIFO_EN | RX_FIFO_CLEAR | TX_FIFO_CLEAR | - (3 << TX_FIFO_TRIG_SHIFT) | (3 << RX_FIFO_TRIG_SHIFT)); - - /* THR interrupt only when TX FIFO and TX shift register are empty */ - - uart_reg_write(uart, SCR, (1 << 0)); /* | (1 << 3)); */ - - /* 8 bit, 1 stop bit, no parity, no break */ - - uart_reg_write(uart, LCR, 0x03); - - uart_set_lcr7bit(uart, 0); -} - -void uart_poll(uint8_t uart) -{ -#if 0 - if (uart == CONS_UART_NR) - { - uart_irq_handler_cons(0); - } - else -#endif - { - uart_irq_handler_sercomm(0, NULL); - } -} - -void uart_irq_enable(uint8_t uart, enum uart_irq irq, int on) -{ - uint8_t ier = uart_reg_read(uart, IER); - uint8_t mask = 0; - - switch (irq) - { - case UART_IRQ_TX_EMPTY: - mask = (1 << 1); - break; - - case UART_IRQ_RX_CHAR: - mask = (1 << 0); - break; - } - - if (on) - { - ier |= mask; - } - else - { - ier &= ~mask; - } - - uart_reg_write(uart, IER, ier); -} - -void uart_putchar_wait(uint8_t uart, int c) -{ - /* wait while TX FIFO indicates full */ - - while (readb(UART_REG(uart, SSR)) & 0x01) { } - - /* put character in TX FIFO */ - - writeb(c, UART_REG(uart, THR)); -} - -int uart_putchar_nb(uint8_t uart, int c) -{ - /* if TX FIFO indicates full, abort */ - - if (readb(UART_REG(uart, SSR)) & 0x01) - { - return 0; - } - - writeb(c, UART_REG(uart, THR)); - return 1; -} - -int uart_getchar_nb(uint8_t uart, uint8_t *ch) -{ - uint8_t lsr; - - lsr = readb(UART_REG(uart, LSR)); - - /* something strange happened */ - - if (lsr & 0x02) - { - printf("LSR RX_OE\n"); - } - - if (lsr & 0x04) - { - printf("LSR RX_PE\n"); - } - - if (lsr & 0x08) - { - printf("LSR RX_FE\n"); - } - - if (lsr & 0x10) - { - printf("LSR RX_BI\n"); - } - - if (lsr & 0x80) - { - printf("LSR RX_FIFO_STS\n"); - } - - /* is the Rx FIFO empty? */ - - if (!(lsr & 0x01)) - { - return 0; - } - - *ch = readb(UART_REG(uart, RHR)); - return 1; -} - -int uart_tx_busy(uint8_t uart) -{ - if (readb(UART_REG(uart, SSR)) & 0x01) - { - return 1; - } - - return 0; -} - -static const uint16_t divider[] = -{ - [UART_38400] = 21, /* 38,690 */ - [UART_57600] = 14, /* 58,035 */ - [UART_115200] = 7, /* 116,071 */ - [UART_230400] = 4, /* 203,125! (-3% would be 223,488) */ - [UART_460800] = 2, /* 406,250! (-3% would be 446,976) */ - [UART_921600] = 1, /* 812,500! (-3% would be 893,952) */ -}; - -int uart_baudrate(uint8_t uart, enum uart_baudrate bdrt) -{ - uint16_t div; - - if (bdrt > ARRAY_SIZE(divider)) - { - return -1; - } - - div = divider[bdrt]; - uart_set_lcr7bit(uart, 1); - writeb(div & 0xff, UART_REG(uart, DLL)); - writeb(div >> 8, UART_REG(uart, DLH)); - uart_set_lcr7bit(uart, 0); - - return 0; -} diff --git a/drivers/sercomm/uart.h b/drivers/sercomm/uart.h deleted file mode 100644 index 81d7a15609ef9280c013602a85c644fe0bc3e1d6..0000000000000000000000000000000000000000 --- a/drivers/sercomm/uart.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _UART_H -#define _UART_H - -#include - -enum uart_baudrate { - UART_38400, - UART_57600, - UART_115200, - UART_230400, - UART_460800, - UART_614400, - UART_921600, -}; - -void uart_init(uint8_t uart, uint8_t interrupts); -void uart_putchar_wait(uint8_t uart, int c); -int uart_putchar_nb(uint8_t uart, int c); -int uart_getchar_nb(uint8_t uart, uint8_t *ch); -int uart_tx_busy(uint8_t uart); -int uart_baudrate(uint8_t uart, enum uart_baudrate bdrt); - -enum uart_irq { - UART_IRQ_TX_EMPTY, - UART_IRQ_RX_CHAR, -}; - -void uart_irq_enable(uint8_t uart, enum uart_irq irq, int on); - -void uart_poll(uint8_t uart); - -#endif /* _UART_H */ diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 80c6fa3f1ad61ac63e9e1835ee1f71418baa766f..85fded4e4707a97158b1a74689c92847da634e6b 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -1421,7 +1421,7 @@ int uart_register(FAR const char *path, FAR uart_dev_t *dev) /* Register the serial driver */ - _info("Registering %s\n", path); + sinfo("Registering %s\n", path); return register_driver(path, &g_serialops, 0666, dev); } diff --git a/drivers/serial/uart_16550.c b/drivers/serial/uart_16550.c index b55597bdf1287bed750de84280efe738faa09d7f..2d77ea812e81397343c9945c7cd43e9543253fb1 100644 --- a/drivers/serial/uart_16550.c +++ b/drivers/serial/uart_16550.c @@ -829,7 +829,7 @@ static int u16550_interrupt(int irq, void *context) /* Read the modem status register (MSR) to clear */ status = u16550_serialin(priv, UART_MSR_OFFSET); - _info("MSR: %02x\n", status); + sinfo("MSR: %02x\n", status); break; } @@ -840,7 +840,7 @@ static int u16550_interrupt(int irq, void *context) /* Read the line status register (LSR) to clear */ status = u16550_serialin(priv, UART_LSR_OFFSET); - _info("LSR: %02x\n", status); + sinfo("LSR: %02x\n", status); break; } diff --git a/drivers/syslog/Kconfig b/drivers/syslog/Kconfig index 3ac22d8b684eb960cf5602725066034cb7ee5c55..eb5b455af6d7a253e064a3f9fed7aba19491b7e9 100644 --- a/drivers/syslog/Kconfig +++ b/drivers/syslog/Kconfig @@ -70,10 +70,10 @@ endif config DRIVER_NOTE bool "Scheduler instrumentation driver" default n - depends on SCHED_INSTRUMENTATION_BUFFER + depends on SCHED_INSTRUMENTATION_BUFFER && SCHED_NOTE_GET ---help--- Enable building a serial driver that can be used by an application - to read data from the in-memory, scheduler instrumentatin "note" + to read data from the in-memory, scheduler instrumentation "note" buffer. config SYSLOG_INTBUFFER diff --git a/drivers/usbdev/cdcacm.c b/drivers/usbdev/cdcacm.c index 64e2e68075db49776f77c7efcf83d813eda5fca9..15f92dd9aea2380bcfcc4feefe2e82e323cb43fc 100644 --- a/drivers/usbdev/cdcacm.c +++ b/drivers/usbdev/cdcacm.c @@ -242,6 +242,12 @@ static const struct uart_ops_s g_uartops = NULL, /* rxavailable */ #ifdef CONFIG_SERIAL_IFLOWCONTROL cdcuart_rxflowcontrol, /* rxflowcontrol */ +#endif +#ifdef CONFIG_SERIAL_DMA + NULL, /* dmasend */ + NULL, /* dmareceive */ + NULL, /* dmarxfree */ + NULL, /* dmatxavail */ #endif NULL, /* send */ cdcuart_txint, /* txinit */ diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index 35610e130838567aadb52664a02fdbd50276c80b..260ed25c5fc22801ca96addc9762ad1d8e590191 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -392,13 +392,22 @@ static bool usbhost_txempty(FAR struct uart_dev_s *uartdev); * device. */ -static const const struct usbhost_id_s g_id = +static const const struct usbhost_id_s g_id[2] = { - USB_CLASS_CDC, /* base */ - CDC_SUBCLASS_NONE, /* subclass */ - CDC_PROTO_NONE, /* proto */ - 0, /* vid */ - 0 /* pid */ + { + USB_CLASS_CDC, /* base */ + CDC_SUBCLASS_NONE, /* subclass */ + CDC_PROTO_NONE, /* proto */ + 0, /* vid */ + 0 /* pid */ + }, + { + USB_CLASS_CDC, /* base */ + CDC_SUBCLASS_ACM, /* subclass */ + CDC_PROTO_ATM, /* proto */ + 0, /* vid */ + 0 /* pid */ + } }; /* This is the USB host CDC/ACM class's registry entry */ @@ -407,8 +416,8 @@ static struct usbhost_registry_s g_cdcacm = { NULL, /* flink */ usbhost_create, /* create */ - 1, /* nids */ - &g_id /* id[] */ + 2, /* nids */ + &g_id[0] /* id[] */ }; /* Serial driver lower half interface */ diff --git a/drivers/usbhost/usbhost_composite.c b/drivers/usbhost/usbhost_composite.c index 64ce0142509d5ac5ee56d0647c1bf89c141fddf8..cc60adff94801f8a8baaf85308e811f30bb2d0fe 100644 --- a/drivers/usbhost/usbhost_composite.c +++ b/drivers/usbhost/usbhost_composite.c @@ -337,7 +337,7 @@ static int usbhost_copyinterface(uint8_t ifno, FAR const uint8_t *configdesc, */ for (offset += len; - offset < desclen - sizeof(struct usb_ifdesc_s); + offset <= desclen - sizeof(struct usb_epdesc_s); offset += len) { epdesc = (FAR struct usb_epdesc_s *)&configdesc[offset]; diff --git a/drivers/wireless/ieee802154/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40.c index 9e216acabcd8512493db906bbc71e686dde2861b..938a4f1acc4333667b33a1528b1578b2cd5b5fa5 100644 --- a/drivers/wireless/ieee802154/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40.c @@ -780,7 +780,7 @@ static int mrf24j40_settxpower(FAR struct ieee802154_dev_s *ieee, return -EINVAL; } - _info("remaining attenuation: %d mBm\n",txpwr); + winfo("remaining attenuation: %d mBm\n",txpwr); switch(txpwr/100) { diff --git a/drivers/wireless/nrf24l01.c b/drivers/wireless/nrf24l01.c index 8b088e98579d883ada1f6d6178285dfdefe898f0..166ab5c4ed17da71c721a71107ebf263594384b1 100644 --- a/drivers/wireless/nrf24l01.c +++ b/drivers/wireless/nrf24l01.c @@ -1254,7 +1254,7 @@ int nrf24l01_register(FAR struct spi_dev_s *spi, FAR struct nrf24l01_config_s *c /* Register the device as an input device */ - iinfo("Registering " DEV_NAME "\n"); + winfo("Registering " DEV_NAME "\n"); result = register_driver(DEV_NAME, &nrf24l01_fops, 0666, dev); if (result < 0) diff --git a/fs/aio/aio_cancel.c b/fs/aio/aio_cancel.c index bdd4ba463a0e306818f9cee8cb9be08b5e06a3b2..aa575fdb8b922f0330720176f5bd241352a2f985 100644 --- a/fs/aio/aio_cancel.c +++ b/fs/aio/aio_cancel.c @@ -61,30 +61,30 @@ * The aio_cancel() function attempts to cancel one or more asynchronous * I/O requests currently outstanding against file descriptor 'fildes'. * The aiocbp argument points to the asynchronous I/O control block for - * a particular request to be cancelled. If aiocbp is NULL, then all + * a particular request to be canceled. If aiocbp is NULL, then all * outstanding cancelable asynchronous I/O requests against fildes will - * be cancelled. + * be canceled. * * Normal asynchronous notification will occur for asynchronous I/O - * operations that are successfully cancelled. If there are requests that - * cannot be cancelled, then the normal asynchronous completion process + * operations that are successfully canceled. If there are requests that + * cannot be canceled, then the normal asynchronous completion process * will take place for those requests when they are completed. * - * For requested operations that are successfully cancelled, the associated + * For requested operations that are successfully canceled, the associated * error status will be set to ECANCELED and the return status will be -1. - * For requested operations that are not successfully cancelled, the aiocbp + * For requested operations that are not successfully canceled, the aiocbp * will not be modified by aio_cancel(). * * Input Parameters: * fildes - Not used in this implementation * aiocbp - Points to the asynchronous I/O control block for a particular - * request to be cancelled. + * request to be canceled. * * Returned Value: * The aio_cancel() function will return the value AIO_CANCELED if the - * requested operation(s) were cancelled. The value AIO_NOTCANCELED will + * requested operation(s) were canceled. The value AIO_NOTCANCELED will * be returned if at least one of the requested operation(s) cannot be - * cancelled because it is in progress. In this case, the state of the + * canceled because it is in progress. In this case, the state of the * other operations, if any, referenced in the call to aio_cancel() is * not indicated by the return value of aio_cancel(). The application * may determine the state of affairs for these operations by using @@ -133,7 +133,7 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) * possibilities:* (1) the work has already been started and * is no longer queued, or (2) the work has not been started * and is still in the work queue. Only the second case can - * be cancelled. work_cancel() will return -ENOENT in the + * be canceled. work_cancel() will return -ENOENT in the * first case. */ @@ -177,7 +177,7 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) * possibilities:* (1) the work has already been started and * is no longer queued, or (2) the work has not been started * and is still in the work queue. Only the second case can - * be cancelled. work_cancel() will return -ENOENT in the + * be canceled. work_cancel() will return -ENOENT in the * first case. */ diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index 6d261ec7d8e6728931906821f58f90cd17b5957d..462c5ddd26eb676ee22415b62a7e71884ecb19d9 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -226,7 +226,7 @@ static void aio_read_worker(FAR void *arg) * aiocbp->aio_nbytes is an invalid value. * * In the case that the aio_read() successfully queues the I/O operation - * but the operation is subsequently cancelled or encounters an error, the + * but the operation is subsequently canceled or encounters an error, the * return status of the asynchronous operation is one of the values * normally returned by the read() function call. In addition, the error * status of the asynchronous operation is set to one of the error @@ -235,7 +235,7 @@ static void aio_read_worker(FAR void *arg) * * EBADF - The aiocbp->aio_fildes argument is not a valid file descriptor * open for reading. - * ECANCELED - The requested I/O was cancelled before the I/O completed + * ECANCELED - The requested I/O was canceled before the I/O completed * due to an explicit aio_cancel() request. * EINVAL - The file offset value implied by aiocbp->aio_offset would be * invalid. diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index 3d20b2dd93eee82aae2cfbf97fd0bda1d4081888..0aab19e7cba107e9f4e9e9150523209cc90dc57e 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -279,7 +279,7 @@ errout: * aiocbp->aio_nbytes is an invalid value. * * In the case that the aio_write() successfully queues the I/O operation - * but the operation is subsequently cancelled or encounters an error, the + * but the operation is subsequently canceled or encounters an error, the * return status of the asynchronous operation is one of the values * normally returned by the write() function call. In addition, the error * status of the asynchronous operation is set to one of the error @@ -290,7 +290,7 @@ errout: * open for writing. * EINVAL - The file offset value implied by aiocbp->aio_offset would be * invalid. - * ECANCELED - The requested I/O was cancelled before the I/O completed + * ECANCELED - The requested I/O was canceled before the I/O completed * due to an explicit aio_cancel() request. * * The following condition may be detected synchronously or asynchronously: diff --git a/fs/mount/fs_automount.c b/fs/mount/fs_automount.c index 1bee61d7f5a922a80cc3a2a64bdd859222deb040..47bc9c0118224295430b8815e9a10eb437ce3e67 100644 --- a/fs/mount/fs_automount.c +++ b/fs/mount/fs_automount.c @@ -485,7 +485,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, /* Queue work to occur after a delay. The delays performs debouncing: * If the insertion/removal detection logic has "chatter", then we may * receive this interrupt numerous times. Each time, the previous work - * will be cancelled (above) and the new work will scheduled with the + * will be canceled (above) and the new work will scheduled with the * delay. So the final mount operation will not be performed until the * insertion state is stable for that delay. */ diff --git a/fs/mqueue/mq_open.c b/fs/mqueue/mq_open.c index 23258f9338f83fb9b0a78cdb58cfd4462979bb4c..8a182bb3491d748d9e84456965c51eea39ff9243 100644 --- a/fs/mqueue/mq_open.c +++ b/fs/mqueue/mq_open.c @@ -100,12 +100,21 @@ mqd_t mq_open(FAR const char *mq_name, int oflags, ...) /* Make sure that a non-NULL name is supplied */ - if (!mq_name) + if (mq_name == NULL || *mq_name == '\0') { errcode = EINVAL; goto errout; } + /* Skip over any leading '/'. All message queue paths are relative to + * CONFIG_FS_MQUEUE_MPATH. + */ + + while (*mq_name == '/') + { + mq_name++; + } + /* Get the full path to the message queue */ snprintf(fullpath, MAX_MQUEUE_PATH, CONFIG_FS_MQUEUE_MPATH "/%s", mq_name); diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index d962559a6a1a8d469fd0830c4b5b23e77de0ebe3..db426ee5ef7591bc3a472889e2e5a6f88e5bde97 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -316,6 +316,9 @@ static FAR const char *g_statenames[] = "Invalid", "Waiting,Unlock", "Ready", +#ifdef CONFIG_SMP + "Assigned", +#endif "Running", "Inactive", "Waiting,Semaphore", @@ -957,7 +960,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, #endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 - linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%3-s %-2s %-3s %s\n", + linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-2s %-3s %s\n", "SD", "RF", "TYP", "FLAGS"); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); @@ -980,7 +983,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, { linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d %2d %3d %02x", i + CONFIG_NFILE_DESCRIPTORS, - (long)socket->s_crefs, socket->s_type, socket->s_flags); + socket->s_crefs, socket->s_type, socket->s_flags); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); totalsize += copysize; diff --git a/fs/vfs/fs_close.c b/fs/vfs/fs_close.c index a2b02b1d8704f810e48d63fc4a4ebabd42edd1fc..6020af573178a8a8a7a50057e146aea4958a0a64 100644 --- a/fs/vfs/fs_close.c +++ b/fs/vfs/fs_close.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_close.c * - * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,8 @@ #include #include #include + +#include #include #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 @@ -82,7 +84,13 @@ int close(int fd) int errcode; #if CONFIG_NFILE_DESCRIPTORS > 0 int ret; +#endif + + /* close() is a cancellation point */ + (void)enter_cancellation_point(); + +#if CONFIG_NFILE_DESCRIPTORS > 0 /* Did we get a valid file descriptor? */ if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) @@ -93,7 +101,9 @@ int close(int fd) #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) { - return net_close(fd); + ret = net_close(fd); + leave_cancellation_point(); + return ret; } else #endif @@ -123,11 +133,13 @@ int close(int fd) goto errout; } + leave_cancellation_point(); return OK; #endif errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } diff --git a/fs/vfs/fs_fcntl.c b/fs/vfs/fs_fcntl.c index 01ca8761fe820ac58be624b42656400733150012..4d8e74b497ea6b7a18e114c16798350eec56a511 100644 --- a/fs/vfs/fs_fcntl.c +++ b/fs/vfs/fs_fcntl.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_fcntl.c * - * Copyright (C) 2009, 2012-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2012-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,20 +44,13 @@ #include #include +#include +#include #include #include -#include #include "inode/inode.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -228,6 +221,10 @@ int fcntl(int fd, int cmd, ...) va_list ap; int ret; + /* fcntl() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Setup to access the variable argument list */ va_start(ap, cmd); @@ -244,6 +241,8 @@ int fcntl(int fd, int cmd, ...) { /* The errno value has already been set */ + va_end(ap); + leave_cancellation_point(); return ERROR; } @@ -273,5 +272,6 @@ int fcntl(int fd, int cmd, ...) } va_end(ap); + leave_cancellation_point(); return ret; } diff --git a/fs/vfs/fs_fsync.c b/fs/vfs/fs_fsync.c index a2d58825eb4abefb8244c8e56069d0fb2008d44f..60c5563497180ee2fd39bd1bbc07bc4d2db4872e 100644 --- a/fs/vfs/fs_fsync.c +++ b/fs/vfs/fs_fsync.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_fsync.c * - * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,8 +44,9 @@ #include #include -#include #include +#include +#include #include "inode/inode.h" @@ -117,6 +118,11 @@ errout: int fsync(int fd) { FAR struct file *filep; + int ret; + + /* fsync() is a cancellation point */ + + (void)enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ @@ -125,12 +131,15 @@ int fsync(int fd) { /* The errno value has already been set */ + leave_cancellation_point(); return ERROR; } /* Perform the fsync operation */ - return file_fsync(filep); + ret = file_fsync(filep); + leave_cancellation_point(); + return ret; } #endif /* !CONFIG_DISABLE_MOUNTPOINT */ diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index a66f62e869a24bba5016460924596bfeb4da03b6..a2a662f722f4b2e646dd22f09337cfb4929c2f6f 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_open.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,15 +48,12 @@ #include #endif +#include #include #include "inode/inode.h" #include "driver/driver.h" -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -106,6 +103,10 @@ int open(const char *path, int oflags, ...) # warning "File creation not implemented" # endif + /* open() is a cancellation point */ + + (void)enter_cancellation_point(); + /* If the file is opened for creation, then get the mode bits */ if ((oflags & (O_WRONLY | O_CREAT)) != 0) @@ -159,6 +160,7 @@ int open(const char *path, int oflags, ...) /* Return the file descriptor */ + leave_cancellation_point(); return fd; } else @@ -204,6 +206,7 @@ int open(const char *path, int oflags, ...) { /* The errno value has already been set */ + leave_cancellation_point(); return ERROR; } @@ -264,6 +267,7 @@ int open(const char *path, int oflags, ...) } #endif + leave_cancellation_point(); return fd; errout_with_fd: @@ -272,5 +276,6 @@ errout_with_inode: inode_release(inode); errout: set_errno(ret); + leave_cancellation_point(); return ERROR; } diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index e2c66abf7bff922f08ea6c5f5dab6f004a886667..f0cc6ce2a9feed104b501f3e4ec7aae3dc5af0dc 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -365,6 +366,10 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) int errcode; int ret; + /* poll() is a cancellation point */ + + (void)enter_cancellation_point(); + /* This semaphore is used for signaling and, hence, should not have * priority inheritance enabled. */ @@ -425,6 +430,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) } sem_destroy(&sem); + leave_cancellation_point(); /* Check for errors */ diff --git a/fs/vfs/fs_pread.c b/fs/vfs/fs_pread.c index e80efe66a08e58f8261388685d463a0a50ff69b2..2385ea00a0cb0ed42ae131c53cbf0da1e0c29762 100644 --- a/fs/vfs/fs_pread.c +++ b/fs/vfs/fs_pread.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_pread.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,12 +43,9 @@ #include #include +#include #include -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -144,6 +141,11 @@ ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes, ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset) { FAR struct file *filep; + ssize_t ret; + + /* pread() is a cancellation point */ + + (void)enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ @@ -152,10 +154,15 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset) { /* The errno value has already been set */ - return (ssize_t)ERROR; + ret = (ssize_t)ERROR; } + else + { + /* Let file_pread do the real work */ - /* Let file_pread do the real work */ + ret = file_pread(filep, buf, nbytes, offset); + } - return file_pread(filep, buf, nbytes, offset); + leave_cancellation_point(); + return ret; } diff --git a/fs/vfs/fs_pwrite.c b/fs/vfs/fs_pwrite.c index 43630c455a4682b006e0114fe091c9b8390f5a24..8e841247ca8e834f6d533d52c3d6a599df70d4f1 100644 --- a/fs/vfs/fs_pwrite.c +++ b/fs/vfs/fs_pwrite.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_pwrite.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,12 +43,9 @@ #include #include +#include #include -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -142,6 +139,11 @@ ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf, ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset) { FAR struct file *filep; + ssize_t ret; + + /* pread() is a cancellation point */ + + (void)enter_cancellation_point(); /* Get the file structure corresponding to the file descriptor. */ @@ -150,10 +152,15 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset) { /* The errno value has already been set */ - return (ssize_t)ERROR; + ret = (ssize_t)ERROR; } + else + { + /* Let file_pread do the real work */ - /* Let file_pread do the real work */ + ret = file_pwrite(filep, buf, nbytes, offset); + } - return file_pwrite(filep, buf, nbytes, offset); + (void)enter_cancellation_point(); + return ret; } diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c index f1d6097236c3186bf45fbaad4b8448c55cba5ccf..6da412c3793dc509afa2d6ea0c04236f4973e0be 100644 --- a/fs/vfs/fs_read.c +++ b/fs/vfs/fs_read.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_read.c * - * Copyright (C) 2007-2009, 2012-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -38,19 +38,17 @@ ****************************************************************************/ #include + #include #include - #include #include #include #include -#include "inode/inode.h" +#include -/**************************************************************************** - * Private Functions - ****************************************************************************/ +#include "inode/inode.h" /**************************************************************************** * Public Functions @@ -136,23 +134,30 @@ ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes) ssize_t read(int fd, FAR void *buf, size_t nbytes) { + ssize_t ret; + + /* read() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Did we get a valid file descriptor? */ #if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) #endif { +#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 /* No.. If networking is enabled, read() is the same as recv() with - * the flags parameter set to zero. + * the flags parameter set to zero. Note that recv() sets + * the errno variable. */ -#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 - return recv(fd, buf, nbytes, 0); + ret = recv(fd, buf, nbytes, 0); #else /* No networking... it is a bad descriptor in any event */ set_errno(EBADF); - return ERROR; + ret = ERROR; #endif } @@ -162,20 +167,28 @@ ssize_t read(int fd, FAR void *buf, size_t nbytes) FAR struct file *filep; /* The descriptor is in a valid range to file descriptor... do the - * read. First, get the file structure. + * read. First, get the file structure. Note that on failure, + * fs_getfilep() will set the errno variable. */ filep = fs_getfilep(fd); - if (!filep) + if (filep == NULL) { /* The errno value has already been set */ - return ERROR; + ret = ERROR; } + else + { + /* Then let file_read do all of the work. Note that file_read() + * sets the errno variable. + */ - /* Then let file_read do all of the work */ - - return file_read(filep, buf, nbytes); + ret = file_read(filep, buf, nbytes); + } } #endif + + leave_cancellation_point(); + return ret; } diff --git a/fs/vfs/fs_select.c b/fs/vfs/fs_select.c index d71d8e28a1c2921593dc5956afe106c21f41afcd..acb42b35aed7b4c8b640e4f60dd7b4b64b9de6fb 100644 --- a/fs/vfs/fs_select.c +++ b/fs/vfs/fs_select.c @@ -49,6 +49,7 @@ #include #include +#include #include #include "inode/inode.h" @@ -110,6 +111,10 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, int ndx; int ret; + /* select() is cancellation point */ + + (void)enter_cancellation_point(); + /* How many pollfd structures do we need to allocate? */ /* Initialize the descriptor list for poll() */ @@ -134,6 +139,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, if (!pollset) { set_errno(ENOMEM); + leave_cancellation_point(); return ERROR; } @@ -280,6 +286,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, set_errno(errcode); } + leave_cancellation_point(); return ret; } diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c index 34b77e5a472d814b93ec01fa575e3f898775889f..4731f26bb102ea45f28031491e10392515aebb09 100644 --- a/fs/vfs/fs_write.c +++ b/fs/vfs/fs_write.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/vfs/fs_write.c * - * Copyright (C) 2007-2009, 2012-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -38,6 +38,7 @@ ****************************************************************************/ #include + #include #include #include @@ -49,11 +50,9 @@ # include #endif -#include "inode/inode.h" +#include -/**************************************************************************** - * Private Functions - ****************************************************************************/ +#include "inode/inode.h" /**************************************************************************** * Public Functions @@ -72,7 +71,7 @@ ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes) { FAR struct inode *inode; - int ret; + ssize_t ret; int errcode; /* Was this file opened for write access? */ @@ -163,6 +162,11 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes) #if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct file *filep; #endif + ssize_t ret; + + /* write() is a cancellation point */ + + (void)enter_cancellation_point(); /* Did we get a valid file descriptor? */ @@ -170,31 +174,44 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes) if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) #endif { - /* Write to a socket descriptor is equivalent to send with flags == 0 */ - #if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0 - return send(fd, buf, nbytes, 0); + /* Write to a socket descriptor is equivalent to send with flags == 0. + * Note that send() will set the errno on failure. + */ + + ret = send(fd, buf, nbytes, 0); #else set_errno(EBADF); - return ERROR; + ret = ERROR ERROR; #endif } #if CONFIG_NFILE_DESCRIPTORS > 0 - /* The descriptor is in the right range to be a file descriptor... write - * to the file. - */ - - filep = fs_getfilep(fd); - if (!filep) + else { - /* The errno value has already been set */ - - return ERROR; + /* The descriptor is in the right range to be a file descriptor.. + * write to the file. Note that fs_getfilep() will set the errno on + * failure. + */ + + filep = fs_getfilep(fd); + if (filep == NULL) + { + /* The errno value has already been set */ + + ret = ERROR; + } + else + { + /* Perform the write operation using the file descriptor as an + * index. Note that file_write() will set the errno on failure. + */ + + ret = file_write(filep, buf, nbytes); + } } - - /* Perform the write operation using the file descriptor as an index */ - - return file_write(filep, buf, nbytes); #endif + + leave_cancellation_point(); + return ret; } diff --git a/graphics/Kconfig b/graphics/Kconfig index 02e020522993630cc63de2b1ea98cedf8695e410..4347326f84613c904b469f8bc2b023f6bfb564e3 100644 --- a/graphics/Kconfig +++ b/graphics/Kconfig @@ -555,6 +555,13 @@ config NXFONT_X11_MISC_FIXED_10X20 This option enables support for a "x11-misc-fixed-10x20". (font ID FONTID_X11_MISC_FIXED_10X20 == 42). +config NXFONT_TOM_THUMB_4X6 + bool "Tom Thumb Monospace 4x6" + default n + ---help--- + This option enables support for a small, 3x5 font (with blank space + padding to 4x6) (font ID FONTID_TOM_THUMB_4X6 == 43). + endmenu menuconfig NXTERM @@ -691,16 +698,6 @@ config NX_MXCLIENTMSGS flooding of the client or server with too many messages (PREALLOC_MQ_MSGS controls how many messages are pre-allocated). -config NX_NXSTART - bool "nx_start()" - default n - ---help--- - If this option is selected, then the nx_start() interface will be - built. The nx_start() interface provides a single call to initialize - and start the NX server. - -if NX_NXSTART - config NXSTART_EXTERNINIT bool "External display Initialization" default n @@ -736,6 +733,14 @@ config NXSTART_DEVNO LCD device number (in case there are more than one LCDs connected). Default: 0 +config NXSTART_DISPLAYNO + int "Display Number" + default 0 + depends on !NX_LCDDRIVER && !NXSTART_EXTERNINIT + ---help--- + Framebuffer display number (in case there are more than one framebuffers). + Default: 0 + config NXSTART_VPLANE int "Plane Number" default 0 @@ -743,7 +748,6 @@ config NXSTART_VPLANE ---help--- Only a single video plane is supported. Default: 0 -endif # NX_NXSTART endif # NX_MULTIUSER source "graphics/vnc/Kconfig" diff --git a/graphics/nxglib/fb/nxglib_copyrectangle.c b/graphics/nxglib/fb/nxglib_copyrectangle.c index ea0d1ad2e7e43458e983efb369a07abdce0ae144..e2d61aedfa9ff67cdc48baa9435df972c681de53 100644 --- a/graphics/nxglib/fb/nxglib_copyrectangle.c +++ b/graphics/nxglib/fb/nxglib_copyrectangle.c @@ -46,26 +46,6 @@ #include "nxglib_bitblit.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/fb/nxglib_fillrectangle.c b/graphics/nxglib/fb/nxglib_fillrectangle.c index baaad84697ba5696360d3490ee14d216a5faa15c..4fec88b60b41d3755a5c22de074ec667dda49f09 100644 --- a/graphics/nxglib/fb/nxglib_fillrectangle.c +++ b/graphics/nxglib/fb/nxglib_fillrectangle.c @@ -54,22 +54,6 @@ # error "NXGLIB_SUFFIX must be defined before including this header file" #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/fb/nxglib_getrectangle.c b/graphics/nxglib/fb/nxglib_getrectangle.c index 39386b4cbd74946244f5cd8ebddfed6cb92c9594..280affae1a26b0f9a393f224f846e52cb2853b54 100644 --- a/graphics/nxglib/fb/nxglib_getrectangle.c +++ b/graphics/nxglib/fb/nxglib_getrectangle.c @@ -46,22 +46,6 @@ #include "nxglib_bitblit.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/graphics/nxglib/fb/nxglib_moverectangle.c b/graphics/nxglib/fb/nxglib_moverectangle.c index e94f32c15be9b282657322213c263a2603c788e1..a24fc9f6f3291c52a706d46b9a39bd49bf021f29 100644 --- a/graphics/nxglib/fb/nxglib_moverectangle.c +++ b/graphics/nxglib/fb/nxglib_moverectangle.c @@ -46,22 +46,6 @@ #include "nxglib_bitblit.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/graphics/nxglib/fb/nxglib_setpixel.c b/graphics/nxglib/fb/nxglib_setpixel.c index c1c764f716f6e04e90f46634a1b342e01ab1d5b3..0cde90ff1ab9d41e1bdf8919f5ef9f3c5684d24c 100644 --- a/graphics/nxglib/fb/nxglib_setpixel.c +++ b/graphics/nxglib/fb/nxglib_setpixel.c @@ -54,22 +54,6 @@ # error "NXGLIB_SUFFIX must be defined before including this header file" #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_copyrectangle.c b/graphics/nxglib/lcd/nxglib_copyrectangle.c index 0c5e266c6202b64541244eb0f707f35c9e5cd66f..a1fc20e8706b44134bcac5c5b25c776d70bfda18 100644 --- a/graphics/nxglib/lcd/nxglib_copyrectangle.c +++ b/graphics/nxglib/lcd/nxglib_copyrectangle.c @@ -48,26 +48,6 @@ #include "nxglib_bitblit.h" #include "nxglib_copyrun.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_fillrectangle.c b/graphics/nxglib/lcd/nxglib_fillrectangle.c index 6bc9a04fcb177cb8817840e7d708d2500082c276..e3c263bff2609386a348178e434914cefdda76fc 100644 --- a/graphics/nxglib/lcd/nxglib_fillrectangle.c +++ b/graphics/nxglib/lcd/nxglib_fillrectangle.c @@ -56,22 +56,6 @@ # error "NXGLIB_SUFFIX must be defined before including this header file" #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_filltrapezoid.c b/graphics/nxglib/lcd/nxglib_filltrapezoid.c index c88cae9542d87fab7822177b7c3a87b002897748..5960384ab104a21f2f65523889d55412e04a77b7 100644 --- a/graphics/nxglib/lcd/nxglib_filltrapezoid.c +++ b/graphics/nxglib/lcd/nxglib_filltrapezoid.c @@ -56,22 +56,6 @@ # error "NXGLIB_SUFFIX must be defined before including this header file" #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_getrectangle.c b/graphics/nxglib/lcd/nxglib_getrectangle.c index 1d6ecb5e60b6b72abc3ec4b5ea9cb9d7ae73c735..adf6a90047c993e028f1982f7c12716293e1196a 100644 --- a/graphics/nxglib/lcd/nxglib_getrectangle.c +++ b/graphics/nxglib/lcd/nxglib_getrectangle.c @@ -46,26 +46,6 @@ #include "nxglib_bitblit.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_moverectangle.c b/graphics/nxglib/lcd/nxglib_moverectangle.c index 02a84df098e43499b92b3d77eb55d04ba352590e..85b388963aea78e3d95cdb5ab088e5ce5549f7d2 100644 --- a/graphics/nxglib/lcd/nxglib_moverectangle.c +++ b/graphics/nxglib/lcd/nxglib_moverectangle.c @@ -46,26 +46,6 @@ #include "nxglib_bitblit.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxglib/lcd/nxglib_setpixel.c b/graphics/nxglib/lcd/nxglib_setpixel.c index 2af2c77a14ce7d58bd8769e465af0725b6189d0b..cb57d048ab4badf97948483608390c642457c95a 100644 --- a/graphics/nxglib/lcd/nxglib_setpixel.c +++ b/graphics/nxglib/lcd/nxglib_setpixel.c @@ -55,22 +55,6 @@ # error "NXGLIB_SUFFIX must be defined before including this header file" #endif -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxmu/Make.defs b/graphics/nxmu/Make.defs index 61016426c4d330fe3c25fa58822fa45e3139e251..9c486dd87ed6b9f8077f80a4081cb285a0185701 100644 --- a/graphics/nxmu/Make.defs +++ b/graphics/nxmu/Make.defs @@ -38,10 +38,7 @@ ifeq ($(CONFIG_NX_MULTIUSER),y) CSRCS += nxmu_kbdin.c nxmu_mouse.c nxmu_openwindow.c nxmu_redrawreq.c CSRCS += nxmu_releasebkgd.c nxmu_requestbkgd.c nxmu_reportposition.c CSRCS += nxmu_sendclient.c nxmu_sendclientwindow.c nxmu_server.c - -ifeq ($(CONFIG_NX_NXSTART),y) CSRCS += nx_start.c -endif DEPPATH += --dep-path nxmu CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxmu} diff --git a/graphics/nxmu/nx_start.c b/graphics/nxmu/nx_start.c index 3c3e6446d94662e488ad99a8bca8a577b1770d22..a262b28a91a3868eeb4349363b829f57d99478c7 100644 --- a/graphics/nxmu/nx_start.c +++ b/graphics/nxmu/nx_start.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -51,7 +52,11 @@ #include "nxfe.h" -#ifdef CONFIG_NX_NXSTART +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static bool g_nxserver_started; /**************************************************************************** * Private Functions @@ -116,14 +121,14 @@ int nx_server(int argc, char *argv[]) * REVISIT: display == 0 is assumed. */ - ret = up_fbinitialize(0); + ret = up_fbinitialize(CONFIG_NXSTART_DISPLAYNO); if (ret < 0) { gerr("ERROR: up_fbinitialize failed: %d\n", ret); return EXIT_FAILURE; } - dev = up_fbgetvplane(0, CONFIG_NXSTART_VPLANE); + dev = up_fbgetvplane(CONFIG_NXSTART_DISPLAYNO, CONFIG_NXSTART_VPLANE); if (!dev) { gerr("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXSTART_VPLANE); @@ -155,6 +160,9 @@ int nx_server(int argc, char *argv[]) * work in the NuttX kernel build because the resources required by the * NX server are private to the kernel mode logic. * + * nx_start() can be called (indirectly) from applications via the + * boardctl() interface with the BOARDIOC_NX_START command. + * * Input Parameters: * None * @@ -170,28 +178,34 @@ int nx_server(int argc, char *argv[]) int nx_start(void) { - pid_t server; + /* Do nothing is the server has already been started */ - /* Start the server kernel thread */ - - ginfo("Starting server task\n"); - server = kernel_thread("NX Server", CONFIG_NXSTART_SERVERPRIO, - CONFIG_NXSTART_SERVERSTACK, nx_server, NULL); - if (server < 0) + if (!g_nxserver_started) { - int errcode = errno; - DEBUGASSERT(errcode > 0); + pid_t server; - gerr("ERROR: Failed to create nx_server kernel thread: %d\n", errcode); - return -errcode; - } + /* Start the server kernel thread */ - /* Wait a bit to make sure that the server get started. NOTE that this - * operation cannot be done from the IDLE thread! - */ + ginfo("Starting server task\n"); + server = kernel_thread("NX Server", CONFIG_NXSTART_SERVERPRIO, + CONFIG_NXSTART_SERVERSTACK, nx_server, NULL); + if (server < 0) + { + int errcode = errno; + DEBUGASSERT(errcode > 0); + + gerr("ERROR: Failed to create nx_server kernel thread: %d\n", errcode); + return -errcode; + } + + g_nxserver_started = true; + + /* Wait a bit to make sure that the server get started. NOTE that + * this operation cannot be done from the IDLE thread! + */ + + usleep(50*1000); + } - usleep(50*1000); return OK; } - -#endif /* CONFIG_NX_NXSTART */ diff --git a/graphics/nxterm/nx_register.c b/graphics/nxterm/nx_register.c index 52f7c31168802be989e3affebba7cb637bb2f8bb..3da6fd8a658fa8a1a5f20e630557d5dcbc4c4fa7 100644 --- a/graphics/nxterm/nx_register.c +++ b/graphics/nxterm/nx_register.c @@ -44,10 +44,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/graphics/nxterm/nxterm.h b/graphics/nxterm/nxterm.h index 326a2ed5f9b44595202790c97d07eb124ae89582..49eded0c884312f45b0a9c7b6f2e7127a77a0025 100644 --- a/graphics/nxterm/nxterm.h +++ b/graphics/nxterm/nxterm.h @@ -1,7 +1,7 @@ /**************************************************************************** * nuttx/graphics/nxterm/nxterm.h * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __GRAPHICS_NXTERM_NXTERM_INTERNAL_H -#define __GRAPHICS_NXTERM_NXTERM_INTERNAL_H +#ifndef __GRAPHICS_NXTERM_NXTERM_H +#define __GRAPHICS_NXTERM_NXTERM_H /**************************************************************************** * Included Files @@ -61,10 +61,6 @@ #define BMFLAGS_NOGLYPH (1 << 0) /* No glyph available, use space */ #define BM_ISSPACE(bm) (((bm)->flags & BMFLAGS_NOGLYPH) != 0) -/* Sizes and maximums */ - -#define MAX_USECNT 255 /* Limit to range of a uint8_t */ - /* Device path formats */ #define NX_DEVNAME_FORMAT "/dev/nxterm%d" @@ -81,6 +77,7 @@ /**************************************************************************** * Public Types ****************************************************************************/ + /* Identifies the state of the VT100 escape sequence processing */ enum nxterm_vt100state_e @@ -111,18 +108,6 @@ struct nxterm_operations_s unsigned int stride); }; -/* Describes one cached glyph bitmap */ - -struct nxterm_glyph_s -{ - uint8_t code; /* Character code */ - uint8_t height; /* Height of this glyph (in rows) */ - uint8_t width; /* Width of this glyph (in pixels) */ - uint8_t stride; /* Width of the glyph row (in bytes) */ - uint8_t usecnt; /* Use count */ - FAR uint8_t *bitmap; /* Allocated bitmap memory */ -}; - /* Describes on character on the display */ struct nxterm_bitmap_s @@ -138,8 +123,7 @@ struct nxterm_state_s { FAR const struct nxterm_operations_s *ops; /* Window operations */ FAR void *handle; /* The window handle */ - FAR struct nxterm_window_s wndo; /* Describes the window and font */ - NXHANDLE font; /* The current font handle */ + FAR struct nxterm_window_s wndo; /* Describes the window and font */ sem_t exclsem; /* Forces mutually exclusive access */ #ifdef CONFIG_DEBUG_FEATURES pid_t holder; /* Deadlock avoidance */ @@ -151,7 +135,6 @@ struct nxterm_state_s uint8_t fheight; /* Max height of a font in pixels */ uint8_t fwidth; /* Max width of a font in pixels */ uint8_t spwidth; /* The width of a space */ - uint8_t maxglyphs; /* Size of the glyph[] array */ uint16_t maxchars; /* Size of the bm[] array */ uint16_t nchars; /* Number of chars in the bm[] array */ @@ -165,13 +148,10 @@ struct nxterm_state_s /* Font cache data storage */ + FCACHE fcache; /* Font cache handle */ struct nxterm_bitmap_s cursor; struct nxterm_bitmap_s bm[CONFIG_NXTERM_MXCHARS]; - /* Glyph cache data storage */ - - struct nxterm_glyph_s glyph[CONFIG_NXTERM_CACHESIZE]; - /* Keyboard input support */ #ifdef CONFIG_NXTERM_NXKBDIN @@ -235,8 +215,8 @@ enum nxterm_vt100state_e nxterm_vt100(FAR struct nxterm_state_s *priv, char ch); void nxterm_home(FAR struct nxterm_state_s *priv); void nxterm_newline(FAR struct nxterm_state_s *priv); -FAR const struct nxterm_bitmap_s *nxterm_addchar(NXHANDLE hfont, - FAR struct nxterm_state_s *priv, uint8_t ch); +FAR const struct nxterm_bitmap_s *nxterm_addchar(FAR struct nxterm_state_s *priv, + uint8_t ch); int nxterm_hidechar(FAR struct nxterm_state_s *priv, FAR const struct nxterm_bitmap_s *bm); int nxterm_backspace(FAR struct nxterm_state_s *priv); @@ -251,4 +231,4 @@ void nxterm_hidecursor(FAR struct nxterm_state_s *priv); void nxterm_scroll(FAR struct nxterm_state_s *priv, int scrollheight); -#endif /* __GRAPHICS_NXTERM_NXTERM_INTERNAL_H */ +#endif /* __GRAPHICS_NXTERM_NXTERM_H */ diff --git a/graphics/nxterm/nxterm_driver.c b/graphics/nxterm/nxterm_driver.c index 975fae2763d11a343359ea516c0629e755154da9..824f674cfd2ca5054bd67cfcc615d259a047597e 100644 --- a/graphics/nxterm/nxterm_driver.c +++ b/graphics/nxterm/nxterm_driver.c @@ -62,6 +62,7 @@ static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer, /**************************************************************************** * Public Data ****************************************************************************/ + /* This is the common NX driver file operations */ #ifdef CONFIG_NXTERM_NXKBDIN @@ -98,10 +99,6 @@ const struct file_operations g_nxterm_drvrops = #endif /* CONFIG_NXTERM_NXKBDIN */ -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/graphics/nxterm/nxterm_font.c b/graphics/nxterm/nxterm_font.c index b3e95d220deb09efdaeba0e18b1d02eea7b0203e..50028459898261ddec2264bc38656531325848b4 100644 --- a/graphics/nxterm/nxterm_font.c +++ b/graphics/nxterm/nxterm_font.c @@ -48,294 +48,26 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Select renderer -- Some additional logic would be required to support - * pixel depths that are not directly addressable (1,2,4, and 24). - */ - -#if CONFIG_NXTERM_BPP == 1 -# define RENDERER nxf_convert_1bpp -#elif CONFIG_NXTERM_BPP == 2 -# define RENDERER nxf_convert_2bpp -#elif CONFIG_NXTERM_BPP == 4 -# define RENDERER nxf_convert_4bpp -#elif CONFIG_NXTERM_BPP == 8 -# define RENDERER nxf_convert_8bpp -#elif CONFIG_NXTERM_BPP == 16 -# define RENDERER nxf_convert_16bpp -#elif CONFIG_NXTERM_BPP == 24 -# define RENDERER nxf_convert_24bpp -#elif CONFIG_NXTERM_BPP == 32 -# define RENDERER nxf_convert_32bpp -#else -# error "Unsupported CONFIG_NXTERM_BPP" -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: nxterm_freeglyph - ****************************************************************************/ - -static void nxterm_freeglyph(FAR struct nxterm_glyph_s *glyph) -{ - if (glyph->bitmap) - { - kmm_free(glyph->bitmap); - } - memset(glyph, 0, sizeof(struct nxterm_glyph_s)); -} - -/**************************************************************************** - * Name: nxterm_allocglyph - ****************************************************************************/ - -static inline FAR struct nxterm_glyph_s * -nxterm_allocglyph(FAR struct nxterm_state_s *priv) -{ - FAR struct nxterm_glyph_s *glyph = NULL; - FAR struct nxterm_glyph_s *luglyph = NULL; - uint8_t luusecnt; - int i; - - /* Search through the glyph cache looking for an unused glyph. Also, keep - * track of the least used glyph as well. We need that if we have to replace - * a glyph in the cache. - */ - - for (i = 0; i < priv->maxglyphs; i++) - { - /* Is this glyph in use? */ - - glyph = &priv->glyph[i]; - if (!glyph->usecnt) - { - /* No.. return this glyph with a use count of one */ - - glyph->usecnt = 1; - return glyph; - } - - /* Yes.. check for the least recently used */ - - if (!luglyph || glyph->usecnt < luglyph->usecnt) - { - luglyph = glyph; - } - } - - /* If we get here, the glyph cache is full. We replace the least used - * glyph with the one we need now. (luglyph can't be NULL). - */ - - luusecnt = luglyph->usecnt; - nxterm_freeglyph(luglyph); - - /* But lets decrement all of the usecnts so that the new one one be so - * far behind in the counts as the older ones. - */ - - if (luusecnt > 1) - { - uint8_t decr = luusecnt - 1; - - for (i = 0; i < priv->maxglyphs; i++) - { - /* Is this glyph in use? */ - - glyph = &priv->glyph[i]; - if (glyph->usecnt > decr) - { - glyph->usecnt -= decr; - } - } - } - - /* Then return the least used glyph */ - - luglyph->usecnt = 1; - return luglyph; -} - -/**************************************************************************** - * Name: nxterm_findglyph - ****************************************************************************/ - -static FAR struct nxterm_glyph_s * -nxterm_findglyph(FAR struct nxterm_state_s *priv, uint8_t ch) -{ - int i; - - /* First, try to find the glyph in the cache of pre-rendered glyphs */ - - for (i = 0; i < priv->maxglyphs; i++) - { - FAR struct nxterm_glyph_s *glyph = &priv->glyph[i]; - if (glyph->usecnt > 0 && glyph->code == ch) - { - /* Increment the use count (unless it is already at the max) */ - - if (glyph->usecnt < MAX_USECNT) - { - glyph->usecnt++; - } - - /* And return the glyph that we found */ - - return glyph; - } - } - return NULL; -} - -/**************************************************************************** - * Name: nxterm_renderglyph - ****************************************************************************/ - -static inline FAR struct nxterm_glyph_s * -nxterm_renderglyph(FAR struct nxterm_state_s *priv, - FAR const struct nx_fontbitmap_s *fbm, uint8_t ch) -{ - FAR struct nxterm_glyph_s *glyph = NULL; - FAR nxgl_mxpixel_t *ptr; -#if CONFIG_NXTERM_BPP < 8 - nxgl_mxpixel_t pixel; -#endif - int bmsize; - int row; - int col; - int ret; - - /* Allocate the glyph (always succeeds) */ - - glyph = nxterm_allocglyph(priv); - glyph->code = ch; - - /* Get the dimensions of the glyph */ - - glyph->width = fbm->metric.width + fbm->metric.xoffset; - glyph->height = fbm->metric.height + fbm->metric.yoffset; - - /* Get the physical width of the glyph in bytes */ - - glyph->stride = (glyph->width * CONFIG_NXTERM_BPP + 7) / 8; - - /* Allocate memory to hold the glyph with its offsets */ - - bmsize = glyph->stride * glyph->height; - glyph->bitmap = (FAR uint8_t *)kmm_malloc(bmsize); - - if (glyph->bitmap) - { - /* Initialize the glyph memory to the background color using the - * hard-coded bits-per-pixel (BPP). - * - * TODO: The rest of NX is configured to support multiple devices - * with differing BPP. They logic should be extended to support - * differing BPP's as well. - */ - -#if CONFIG_NXTERM_BPP < 8 - pixel = priv->wndo.wcolor[0]; - -# if CONFIG_NXTERM_BPP == 1 - - /* Pack 1-bit pixels into a 2-bits */ - - pixel &= 0x01; - pixel = (pixel) << 1 | pixel; - -# endif -# if CONFIG_NXTERM_BPP < 4 - - /* Pack 2-bit pixels into a nibble */ - - pixel &= 0x03; - pixel = (pixel) << 2 | pixel; - -# endif - - /* Pack 4-bit nibbles into a byte */ - - pixel &= 0x0f; - pixel = (pixel) << 4 | pixel; - - ptr = (FAR nxgl_mxpixel_t *)glyph->bitmap; - for (row = 0; row < glyph->height; row++) - { - for (col = 0; col < glyph->stride; col++) - { - /* Transfer the packed bytes into the buffer */ - - *ptr++ = pixel; - } - } - -#elif CONFIG_NXTERM_BPP == 24 -# error "Additional logic is needed here for 24bpp support" - -#else /* CONFIG_NXTERM_BPP = {8,16,32} */ - - ptr = (FAR nxgl_mxpixel_t *)glyph->bitmap; - for (row = 0; row < glyph->height; row++) - { - /* Just copy the color value into the glyph memory */ - - for (col = 0; col < glyph->width; col++) - { - *ptr++ = priv->wndo.wcolor[0]; - } - } -#endif - - /* Then render the glyph into the allocated memory */ - - ret = RENDERER((FAR nxgl_mxpixel_t *)glyph->bitmap, - glyph->height, glyph->width, glyph->stride, - fbm, priv->wndo.fcolor[0]); - if (ret < 0) - { - /* Actually, the RENDERER never returns a failure */ - - gerr("ERROR: nxterm_renderglyph: RENDERER failed\n"); - nxterm_freeglyph(glyph); - glyph = NULL; - } - } - - return glyph; -} - /**************************************************************************** * Name: nxterm_fontsize ****************************************************************************/ -static int nxterm_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *size) +static int nxterm_fontsize(FAR struct nxterm_state_s *priv, uint8_t ch, + FAR struct nxgl_size_s *size) { FAR const struct nx_fontbitmap_s *fbm; + NXHANDLE hfont; + + /* Get the handle of the font managed by the font cache */ - /* No, it is not cached... Does the code map to a font? */ + hfont = nxf_cache_getfonthandle(priv->fcache); + DEBUGASSERT(hfont != NULL); + + /* Does the character code map to a font? */ fbm = nxf_getbitmap(hfont, ch); if (fbm) @@ -347,40 +79,7 @@ static int nxterm_fontsize(NXHANDLE hfont, uint8_t ch, FAR struct nxgl_size_s *s return OK; } - return ERROR; -} - -/**************************************************************************** - * Name: nxterm_getglyph - ****************************************************************************/ - -static FAR struct nxterm_glyph_s * -nxterm_getglyph(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch) -{ - FAR struct nxterm_glyph_s *glyph; - FAR const struct nx_fontbitmap_s *fbm; - - /* First, try to find the glyph in the cache of pre-rendered glyphs */ - - glyph = nxterm_findglyph(priv, ch); - if (glyph) - { - /* We found it in the cache .. return the cached glyph */ - - return glyph; - } - - /* No, it is not cached... Does the code map to a font? */ - - fbm = nxf_getbitmap(hfont, ch); - if (fbm) - { - /* Yes.. render the glyph */ - - glyph = nxterm_renderglyph(priv, fbm, ch); - } - - return glyph; + return -ENOENT; } /**************************************************************************** @@ -397,10 +96,10 @@ nxterm_getglyph(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch) ****************************************************************************/ FAR const struct nxterm_bitmap_s * -nxterm_addchar(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch) +nxterm_addchar(FAR struct nxterm_state_s *priv, uint8_t ch) { FAR struct nxterm_bitmap_s *bm = NULL; - FAR struct nxterm_glyph_s *glyph; + FAR const struct nxfonts_glyph_s *glyph; /* Is there space for another character on the display? */ @@ -416,7 +115,7 @@ nxterm_addchar(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch) /* Find (or create) the matching glyph */ - glyph = nxterm_getglyph(hfont, priv, ch); + glyph = nxf_cache_getglyph(priv->fcache, ch); if (!glyph) { /* No, there is no font for this code. Just mark this as a space. */ @@ -449,6 +148,7 @@ nxterm_addchar(NXHANDLE hfont, FAR struct nxterm_state_s *priv, uint8_t ch) * Erase a character from the window. * ****************************************************************************/ + int nxterm_hidechar(FAR struct nxterm_state_s *priv, FAR const struct nxterm_bitmap_s *bm) { @@ -461,7 +161,7 @@ int nxterm_hidechar(FAR struct nxterm_state_s *priv, * modification is required (not an error). */ - ret = nxterm_fontsize(priv->font, bm->code, &fsize); + ret = nxterm_fontsize(priv, bm->code, &fsize); if (ret < 0) { /* It was rendered as a space. */ @@ -572,10 +272,10 @@ void nxterm_newline(FAR struct nxterm_state_s *priv) ****************************************************************************/ void nxterm_fillchar(FAR struct nxterm_state_s *priv, - FAR const struct nxgl_rect_s *rect, - FAR const struct nxterm_bitmap_s *bm) + FAR const struct nxgl_rect_s *rect, + FAR const struct nxterm_bitmap_s *bm) { - FAR struct nxterm_glyph_s *glyph; + FAR const struct nxfonts_glyph_s *glyph; struct nxgl_rect_s bounds; struct nxgl_rect_s intersection; struct nxgl_size_s fsize; @@ -590,7 +290,7 @@ void nxterm_fillchar(FAR struct nxterm_state_s *priv, /* Get the size of the font glyph (which may not have been created yet) */ - ret = nxterm_fontsize(priv->font, bm->code, &fsize); + ret = nxterm_fontsize(priv, bm->code, &fsize); if (ret < 0) { /* This would mean that there is no bitmap for the character code and @@ -632,7 +332,7 @@ void nxterm_fillchar(FAR struct nxterm_state_s *priv, /* Find (or create) the glyph that goes with this font */ - glyph = nxterm_getglyph(priv->font, priv, bm->code); + glyph = nxf_cache_getglyph(priv->fcache, bm->code); if (!glyph) { /* Shouldn't happen */ @@ -648,4 +348,3 @@ void nxterm_fillchar(FAR struct nxterm_state_s *priv, DEBUGASSERT(ret >= 0); } } - diff --git a/graphics/nxterm/nxterm_putc.c b/graphics/nxterm/nxterm_putc.c index b0479404caf599c11af66df3c313a8431ad79758..449f1ad366e8ce130bcee450ecae02f8523726d2 100644 --- a/graphics/nxterm/nxterm_putc.c +++ b/graphics/nxterm/nxterm_putc.c @@ -43,26 +43,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -142,7 +122,7 @@ void nxterm_putc(FAR struct nxterm_state_s *priv, uint8_t ch) * display. */ - bm = nxterm_addchar(priv->font, priv, ch); + bm = nxterm_addchar(priv, ch); if (bm) { nxterm_fillchar(priv, NULL, bm); diff --git a/graphics/nxterm/nxterm_redraw.c b/graphics/nxterm/nxterm_redraw.c index 925495dfd2e25e54fd1d3224df1240eb070c967c..5e1b2b97491abb4c132a56de5f7f899039f09319 100644 --- a/graphics/nxterm/nxterm_redraw.c +++ b/graphics/nxterm/nxterm_redraw.c @@ -51,30 +51,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxterm/nxterm_register.c b/graphics/nxterm/nxterm_register.c index d1d99d16a43c49577a8181518e9a5154e7f9bdd9..a83e84cffc937fcc8980a22f77f6bcbd70b85b94 100644 --- a/graphics/nxterm/nxterm_register.c +++ b/graphics/nxterm/nxterm_register.c @@ -1,7 +1,7 @@ /**************************************************************************** * nuttx/graphics/nxterm/nxterm_register.c * - * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,9 @@ FAR struct nxterm_state_s * FAR const struct nxterm_operations_s *ops, int minor) { FAR struct nxterm_state_s *priv; + FAR const struct nx_font_s *fontset; char devname[NX_DEVNAME_SIZE]; + NXHANDLE hfont; int ret; DEBUGASSERT(handle && wndo && ops && (unsigned)minor < 256); @@ -101,22 +103,33 @@ FAR struct nxterm_state_s * sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE); #endif - /* Select the font */ + /* Connect to the font cache for the configured font characteristics */ - priv->font = nxf_getfonthandle(wndo->fontid); - if (!priv->font) + priv->fcache = nxf_cache_connect(wndo->fontid, wndo->fcolor[0], + wndo->wcolor[0], CONFIG_NXTERM_BPP, + CONFIG_NXTERM_CACHESIZE); + if (priv->fcache == NULL) { - gerr("ERROR: Failed to get font ID %d: %d\n", wndo->fontid, errno); + gerr("ERROR: Failed to connect to font cache for font ID %d: %d\n", + wndo->fontid, errno); goto errout; } - FAR const struct nx_font_s *fontset; + /* Get the handle of the font managed by the font cache */ + + hfont = nxf_cache_getfonthandle(priv->fcache); + if (hfont == NULL) + { + gerr("ERROR: Failed to get handlr for font ID %d: %d\n", + wndo->fontid, errno); + goto errout; + } /* Get information about the font set being used and save this in the * state structure */ - fontset = nxf_getfontset(priv->font); + fontset = nxf_getfontset(hfont); priv->fheight = fontset->mxheight; priv->fwidth = fontset->mxwidth; priv->spwidth = fontset->spwidth; @@ -125,10 +138,6 @@ FAR struct nxterm_state_s * priv->maxchars = CONFIG_NXTERM_MXCHARS; - /* Set up the font glyph bitmap cache */ - - priv->maxglyphs = CONFIG_NXTERM_CACHESIZE; - /* Set the initial display position */ nxterm_home(priv); @@ -146,6 +155,7 @@ FAR struct nxterm_state_s * { gerr("ERROR: Failed to register %s\n", devname); } + return (NXTERM)priv; errout: diff --git a/graphics/nxterm/nxterm_scroll.c b/graphics/nxterm/nxterm_scroll.c index 50a983a56e141f931a893ef63ba53fe6af45d610..98d4e95e6494bef6988ae64df3d209bd3fda4de5 100644 --- a/graphics/nxterm/nxterm_scroll.c +++ b/graphics/nxterm/nxterm_scroll.c @@ -53,26 +53,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -85,6 +65,7 @@ * we can read the displays framebuffer memory, then the job is pretty * easy. However, many displays (such as SPI-based LCDs) are often read- * only. + * ****************************************************************************/ #ifdef CONFIG_NX_WRITEONLY @@ -219,7 +200,8 @@ void nxterm_scroll(FAR struct nxterm_state_s *priv, int scrollheight) for (j = i; j < priv->nchars-1; j++) { - memcpy(&priv->bm[j], &priv->bm[j+1], sizeof(struct nxterm_bitmap_s)); + memcpy(&priv->bm[j], &priv->bm[j+1], + sizeof(struct nxterm_bitmap_s)); } /* Decrement the number of cached characters ('i' is not incremented diff --git a/graphics/nxterm/nxterm_sem.c b/graphics/nxterm/nxterm_sem.c index 185ff30adc596b30dd2e0f9f97ca8ee191133f4e..cde892465374c28064020554bcf4bab9badac8d3 100644 --- a/graphics/nxterm/nxterm_sem.c +++ b/graphics/nxterm/nxterm_sem.c @@ -48,22 +48,6 @@ #ifdef CONFIG_DEBUG_FEATURES -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/graphics/nxterm/nxterm_unregister.c b/graphics/nxterm/nxterm_unregister.c index e51e44c1739a2759f4639425665732b832427a79..06ad464881760ba41e02b856fcad692add8938b2 100644 --- a/graphics/nxterm/nxterm_unregister.c +++ b/graphics/nxterm/nxterm_unregister.c @@ -50,22 +50,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -89,7 +73,6 @@ void nxterm_unregister(NXTERM handle) { FAR struct nxterm_state_s *priv; char devname[NX_DEVNAME_SIZE]; - int i; DEBUGASSERT(handle); @@ -101,16 +84,9 @@ void nxterm_unregister(NXTERM handle) sem_destroy(&priv->waitsem); #endif - /* Free all allocated glyph bitmap */ + /* Free the font cache */ - for (i = 0; i < CONFIG_NXTERM_CACHESIZE; i++) - { - FAR struct nxterm_glyph_s *glyph = &priv->glyph[i]; - if (glyph->bitmap) - { - kmm_free(glyph->bitmap); - } - } + nxf_cache_disconnect(priv->fcache); /* Unregister the driver */ diff --git a/graphics/nxterm/nxterm_vt100.c b/graphics/nxterm/nxterm_vt100.c index 17e3356ca37416817bac7194aa2f5fb57671a7ec..1ee70e9ca17b3768d2ef9f8d71227cfff0f4eaa2 100644 --- a/graphics/nxterm/nxterm_vt100.c +++ b/graphics/nxterm/nxterm_vt100.c @@ -46,10 +46,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/graphics/nxterm/nxtk_register.c b/graphics/nxterm/nxtk_register.c index c66b56a067758ec8d8aafb4f5a129c4840734f15..ae4e861246441091a71e77abafefc031544fed63 100644 --- a/graphics/nxterm/nxtk_register.c +++ b/graphics/nxterm/nxtk_register.c @@ -44,10 +44,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/graphics/nxterm/nxtool_register.c b/graphics/nxterm/nxtool_register.c index f1618bd5b0cb36dc86bff564240b31e4e1b120f4..2a9de5d5596f9ef10dfc26215221cceb9b6fc3db 100644 --- a/graphics/nxterm/nxtool_register.c +++ b/graphics/nxterm/nxtool_register.c @@ -44,10 +44,6 @@ #include "nxterm.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/include/debug.h b/include/debug.h index c2fc93dd53fdb6ecc4f50744ae2ac440da8afda7..0bde25605befb64364b56f9b74b1f5938cf9d779 100644 --- a/include/debug.h +++ b/include/debug.h @@ -810,7 +810,7 @@ #ifdef CONFIG_DEBUG_CRYPTO_INFO # define cryptinfo _info #else -# define cryptinfo(x...) +# define cryptinfo (void) #endif #ifdef CONFIG_DEBUG_INPUT_ERROR diff --git a/include/nuttx/analog/adc.h b/include/nuttx/analog/adc.h index 639eddc5cf884690b8fc93e36731d603cff629e5..214143357a64f2ed37068bd4f8976b191bd27f77 100644 --- a/include/nuttx/analog/adc.h +++ b/include/nuttx/analog/adc.h @@ -1,7 +1,7 @@ /************************************************************************************ * include/nuttx/analog/adc.h * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Copyright (C) 2011 Li Zhuoyi. All rights reserved. * Author: Li Zhuoyi * Gregory Nutt @@ -103,11 +103,11 @@ struct adc_callback_s /* This describes on ADC message */ -struct adc_msg_s +begin_packed_struct struct adc_msg_s { uint8_t am_channel; /* The 8-bit ADC Channel */ int32_t am_data; /* ADC convert result (4 bytes) */ -} packed_struct; +} end_packed_struct; /* This describes a FIFO of ADC messages */ diff --git a/include/nuttx/analog/dac.h b/include/nuttx/analog/dac.h index 4f34709a847cd2a3ae38ace7540ae3a5e7fbe827..249100d89b4759d2a64b7a349a56206ca7fb5976 100644 --- a/include/nuttx/analog/dac.h +++ b/include/nuttx/analog/dac.h @@ -1,6 +1,7 @@ /************************************************************************************ * include/nuttx/analog/dac.h * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2011 Li Zhuoyi. All rights reserved. * Author: Li Zhuoyi * History: 0.1 2011-08-04 initial version @@ -74,11 +75,11 @@ * Public Types ************************************************************************************/ -struct dac_msg_s +begin_packed_struct struct dac_msg_s { uint8_t am_channel; /* The 8-bit DAC Channel */ int32_t am_data; /* DAC convert result (4 bytes) */ -} packed_struct; +} end_packed_struct; struct dac_fifo_s { diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 8b83308fc80c9ec901f8714a3bbf508e4d274755..b2da611d1b16f45bebe035320ac6216e5e3679ec 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -1821,12 +1821,66 @@ int up_cpu_start(int cpu); * Returned Value: * Zero on success; a negated errno value on failure. * + * Assumptions: + * Called from within a critical section; up_cpu_resume() must be called + * later while still within the same critical section. + * ****************************************************************************/ #ifdef CONFIG_SMP int up_cpu_pause(int cpu); #endif +/**************************************************************************** + * Name: up_cpu_pausereq + * + * Description: + * Return true if a pause request is pending for this CPU. + * + * Input Parameters: + * cpu - The index of the CPU to be queried + * + * Returned Value: + * true = a pause request is pending. + * false = no pasue request is pending. + * + ****************************************************************************/ + +#ifdef CONFIG_SMP +bool up_cpu_pausereq(int cpu); +#endif + +/**************************************************************************** + * Name: up_cpu_paused + * + * Description: + * Handle a pause request from another CPU. Normally, this logic is + * executed from interrupt handling logic within the architecture-specific + * However, it is sometimes necessary necessary to perform the pending + * pause operation in other contexts where the interrupt cannot be taken + * in order to avoid deadlocks. + * + * This function performs the following operations: + * + * 1. It saves the current task state at the head of the current assigned + * task list. + * 2. It waits on a spinlock, then + * 3. Returns from interrupt, restoring the state of the new task at the + * head of the ready to run list. + * + * Input Parameters: + * cpu - The index of the CPU to be paused + * + * Returned Value: + * On success, OK is returned. Otherwise, a negated errno value indicating + * the nature of the failure is returned. + * + ****************************************************************************/ + +#ifdef CONFIG_SMP +int up_cpu_paused(int cpu); +#endif + /**************************************************************************** * Name: up_cpu_resume * @@ -1844,6 +1898,10 @@ int up_cpu_pause(int cpu); * Returned Value: * Zero on success; a negated errno value on failure. * + * Assumptions: + * Called from within a critical section; up_cpu_pause() must have + * previously been called within the same critical section. + * ****************************************************************************/ #ifdef CONFIG_SMP @@ -2250,16 +2308,6 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable); int up_putc(int ch); -/**************************************************************************** - * Name: up_getc - * - * Description: - * Get one character on the console - * - ****************************************************************************/ - -int up_getc(void); - /**************************************************************************** * Name: up_puts * diff --git a/include/nuttx/audio/audio.h b/include/nuttx/audio/audio.h index e955a4618ba75c8f2ad126d2ad757668cfd64b15..d312a6f6d10aebde06b53104632291c90959811c 100644 --- a/include/nuttx/audio/audio.h +++ b/include/nuttx/audio/audio.h @@ -1,6 +1,7 @@ /**************************************************************************** * include/nuttx/audio/audio.h * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit * @@ -363,7 +364,7 @@ struct ap_buffer_info_s /* This structure describes an Audio Pipeline Buffer */ -struct ap_buffer_s +begin_packed_struct struct ap_buffer_s { struct dq_entry_s dq_entry; /* Double linked queue entry */ struct audio_info_s i; /* The info for samples in this buffer */ @@ -377,7 +378,7 @@ struct ap_buffer_s uint16_t flags; /* Buffer flags */ uint16_t crefs; /* Number of reference counts */ uint8_t samp[0]; /* Offset of the first sample */ -} packed_struct; +} end_packed_struct; /* Structure defining the messages passed to a listening audio thread * for dequeuing buffers and other operations. Also used to allocate diff --git a/include/nuttx/board.h b/include/nuttx/board.h index e143c4862bb646aa773389e2f0b685cdaa036b01..f31398548d442bf5756ccec154015f81b23100b4 100644 --- a/include/nuttx/board.h +++ b/include/nuttx/board.h @@ -315,40 +315,6 @@ int board_tsc_setup(int minor); void board_tsc_teardown(void); -/**************************************************************************** - * Name: board_adc_setup - * - * Description: - * All architectures must provide the following interface in order to - * work with examples/adc. - * - * This is an internal OS interface but may be invoked indirectly from - * application-level graphics logic. If CONFIG_LIB_BOARDCTL=y and - * CONFIG_BOARDCTL_ADCTEST=y, then this functions will be invoked via the - * (non-standard) boardctl() interface using the BOARDIOC_ADCTEST_SETUP - * command. - * - ****************************************************************************/ - -int board_adc_setup(void); - -/**************************************************************************** - * Name: board_pwm_setup - * - * Description: - * All architectures must provide the following interface in order to - * work with examples/pwm. - * - * This is an internal OS interface but may be invoked indirectly from - * application-level graphics logic. If CONFIG_LIB_BOARDCTL=y and - * CONFIG_BOARDCTL_PWMTEST=y, then this functions will be invoked via the - * (non-standard) boardctl() interface using the commands - * BOARDIOC_PWMTEST_SETUP command. - * - ****************************************************************************/ - -int board_pwm_setup(void); - /**************************************************************************** * Name: board_graphics_setup * @@ -372,25 +338,6 @@ struct fb_vtable_s; FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno); #endif -/**************************************************************************** - * Name: board_can_initialize - * - * Description: - * Perform one-time CAN initialization. This is currently only needed for - * apps/examples/can. - * - * This is an internal OS interface but may be invoked indirectly from - * application-level graphics logic. If CONFIG_LIB_BOARDCTL=y and - * CONFIG_BOARDCTL_CANINIT=y, then this functions will be invoked via the - * (non-standard) boardctl() interface using the BOARDIOC_CAN_INITIALIZE - * command. - * - ****************************************************************************/ - -#ifdef CONFIG_BOARDCTL_CANINIT -int board_can_initialize(void); -#endif - /**************************************************************************** * Name: board_ioctl * diff --git a/include/nuttx/cancelpt.h b/include/nuttx/cancelpt.h new file mode 100644 index 0000000000000000000000000000000000000000..8adfc8c217e286b57e9cb32b174b392f2ed058d3 --- /dev/null +++ b/include/nuttx/cancelpt.h @@ -0,0 +1,152 @@ +/**************************************************************************** + * include/nuttx/cancelpt.h + * Definitions related to cancellation points + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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_CANCELPT_H +#define __INCLUDE_NUTTX_CANCELPT_H + +/**************************************************************************** + * Cancellation Points. + * + * Cancellation points shall occur when a thread is executing the following + * functions: + * + * accept() mq_timedsend() putpmsg() sigtimedwait() + * aio_suspend() msgrcv() pwrite() sigwait() + * clock_nanosleep() msgsnd() read() sigwaitinfo() + * close() msync() readv() sleep() + * connect() nanosleep() recv() system() + * creat() open() recvfrom() tcdrain() + * fcntl() pause() recvmsg() usleep() + * fdatasync() poll() select() wait() + * fsync() pread() sem_timedwait() waitid() + * getmsg() pselect() sem_wait() waitpid() + * getpmsg() pthread_cond_timedwait() send() write() + * lockf() pthread_cond_wait() sendmsg() writev() + * mq_receive() pthread_join() sendto() + * mq_send() pthread_testcancel() sigpause() + * mq_timedreceive() putmsg() sigsuspend() + * + * Each of the above function must call enter_cancellation_point() on entry + * in order to establish the cancellation point and leave_cancellation_point() + * on exit. These functions are described below. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: enter_cancellation_point + * + * Description: + * Called at the beginning of the cancellation point to establish the + * cancellation point. This function does the following: + * + * 1. If deferred cancellation does not apply to this thread, nothing is + * done, otherwise, it + * 2. Sets state information in the caller's TCB and increments a nesting + * count. + * 3. If this is the outermost nesting level, it checks if there is a + * pending cancellation and, if so, calls either exit() or + * pthread_exit(), depending upon the type of the thread. + * + * Input Parameters: + * None + * + * Returned Value + * true is returned if a cancellation is pending but cannot be performed + * now due to the nesting level. + * + ****************************************************************************/ + +#ifdef CONFIG_CANCELLATION_POINTS +bool enter_cancellation_point(void); +#else +# define enter_cancellation_point() false +#endif + +/**************************************************************************** + * Name: leave_cancellation_point + * + * Description: + * Called at the end of the cancellation point. This function does the + * following: + * + * 1. If deferred cancellation does not apply to this thread, nothing is + * done, otherwise, it + * 2. Clears state information in the caller's TCB and decrements a + * nesting count. + * 3. If this is the outermost nesting level, it checks if there is a + * pending cancellation and, if so, calls either exit() or + * pthread_exit(), depending upon the type of the thread. + * + * Input Parameters: + * None + * + * Returned Value + * None + * + ****************************************************************************/ + +#ifdef CONFIG_CANCELLATION_POINTS +void leave_cancellation_point(void); +#else +# define leave_cancellation_point() +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_NUTTX_CANCELPT_H */ diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index d15bf0253e50440a6f2d1fc6dc3da322f858a907..5c5c25be295b1711122a62c5c3ede721efea186e 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/compiler.h * - * Copyright (C) 2007-2009, 2012-2013, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012-2013, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ # define weak_alias(name, aliasname) # define weak_function # define weak_const_function -#endif +# endif /* The noreturn attribute informs GCC that the function will not return. */ @@ -97,7 +97,8 @@ * ignoring other alignment rules. */ -# define packed_struct __attribute__ ((packed)) +# define begin_packed_struct +# define end_packed_struct __attribute__ ((packed)) /* GCC does not support the reentrant attribute */ @@ -279,7 +280,8 @@ /* SDCC does not support the noreturn or packed attributes */ # define noreturn_function -# define packed_struct +# define begin_packed_struct +# define end_packed_struct /* REVISIT: */ @@ -397,7 +399,8 @@ /* The Zilog compiler does not support the noreturn, packed, naked attributes */ # define noreturn_function -# define packed_struct +# define begin_packed_struct +# define end_packed_struct # define naked_function # define inline_function # define noinline_function @@ -489,7 +492,8 @@ # define weak_const_function # define noreturn_function # define farcall_function -# define packed_struct +# define begin_packed_struct __packed +# define end_packed_struct # define reentrant_function # define naked_function # define inline_function @@ -526,7 +530,8 @@ # define restrict # define noreturn_function # define farcall_function -# define packed_struct +# define begin_packed_struct +# define end_packed_struct # define reentrant_function # define naked_function # define inline_function diff --git a/include/nuttx/drivers/can.h b/include/nuttx/drivers/can.h index 725a9180f6d572532d2ff1d7d4d94ef53f87e9db..310822b0e069806a671cc015f9a15685a0ab73b7 100644 --- a/include/nuttx/drivers/can.h +++ b/include/nuttx/drivers/can.h @@ -1,7 +1,7 @@ /************************************************************************************ * include/nuttx/drivers/can.h * - * Copyright (C) 2008, 2009, 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2009, 2011-2012, 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -388,7 +388,7 @@ */ #ifdef CONFIG_CAN_EXTID -struct can_hdr_s +begin_packed_struct struct can_hdr_s { uint32_t ch_id; /* 11- or 29-bit ID (20- or 3-bits unused) */ uint8_t ch_dlc : 4; /* 4-bit DLC */ @@ -398,9 +398,9 @@ struct can_hdr_s #endif uint8_t ch_extid : 1; /* Extended ID indication */ uint8_t ch_unused : 1; /* Unused */ -} packed_struct; +} end_packed_struct; #else -struct can_hdr_s +begin_packed_struct struct can_hdr_s { uint16_t ch_id; /* 11-bit standard ID (5-bits unused) */ uint8_t ch_dlc : 4; /* 4-bit DLC. May be encoded in CAN_FD mode. */ @@ -409,14 +409,14 @@ struct can_hdr_s uint8_t ch_error : 1; /* 1=ch_id is an error report */ #endif uint8_t ch_unused : 2; /* Unused */ -} packed_struct; +} end_packed_struct; #endif -struct can_msg_s +begin_packed_struct struct can_msg_s { struct can_hdr_s cm_hdr; /* The CAN header */ uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */ -} packed_struct; +} end_packed_struct; /* This structure defines a CAN message FIFO. */ diff --git a/include/nuttx/net/arp.h b/include/nuttx/net/arp.h index cf04895f7678200b0da6729c1ebc4378fb701451..4a33994a1b77a59661250edb4a34f3c57db6c719 100644 --- a/include/nuttx/net/arp.h +++ b/include/nuttx/net/arp.h @@ -137,7 +137,7 @@ extern "C" ****************************************************************************/ #ifdef CONFIG_NET_ARP_IPIN -void arp_ipin(struct net_driver_s *dev); +void arp_ipin(FAR struct net_driver_s *dev); #else # define arp_ipin(dev) #endif @@ -152,20 +152,20 @@ void arp_ipin(struct net_driver_s *dev); * that we previously sent out, the ARP cache will be filled in with * the values from the ARP reply. If the incoming ARP packet is an ARP * request for our IP address, an ARP reply packet is created and put - * into the d_buf[] buffer. + * into the d_buf buffer. * * On entry, this function expects that an ARP packet with a prepended - * Ethernet header is present in the d_buf[] buffer and that the length of + * Ethernet header is present in the d_buf buffer and that the length of * the packet is set in the d_len field. * * When the function returns, the value of the field d_len indicates whether * the device driver should send out the ARP reply packet or not. If d_len * is zero, no packet should be sent; If d_len is non-zero, it contains the - * length of the outbound packet that is present in the d_buf[] buffer. + * length of the outbound packet that is present in the d_buf buffer. * ****************************************************************************/ -void arp_arpin(struct net_driver_s *dev); +void arp_arpin(FAR struct net_driver_s *dev); /**************************************************************************** * Name: arp_out @@ -183,13 +183,13 @@ void arp_arpin(struct net_driver_s *dev); * beginning of the packet and the function returns. * * If no ARP cache entry is found for the destination IIPv4P address, the - * packet in the d_buf[] is replaced by an ARP request packet for the + * packet in the d_buf is replaced by an ARP request packet for the * IPv4 address. The IPv4 packet is dropped and it is assumed that the * higher level protocols (e.g., TCP) eventually will retransmit the * dropped packet. * * Upon return in either the case, a packet to be sent is present in the - * d_buf[] buffer and the d_len field holds the length of the Ethernet + * d_buf buffer and the d_len field holds the length of the Ethernet * frame that should be transmitted. * ****************************************************************************/ diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index 74abc0d701c58220c4534adaa33c3da2bb35ae3a..54f5c83273c224704beb8a8da8cac9dfc817d88c 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -49,10 +49,6 @@ #include #include -#ifndef CONFIG_NET_NOINTS -# include -#endif - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -142,24 +138,6 @@ struct socketlist struct net_driver_s; /* Forward reference. Defined in nuttx/net/netdev.h */ typedef int (*netdev_callback_t)(FAR struct net_driver_s *dev, FAR void *arg); -#ifdef CONFIG_NET_NOINTS -/* Semaphore based locking for non-interrupt based logic. - * - * net_lock_t -- Not used. Only for compatibility - */ - -typedef uint8_t net_lock_t; /* Not really used */ - -#else - -/* Enable/disable locking for interrupt based logic: - * - * net_lock_t -- The processor specific representation of interrupt state. - */ - -# define net_lock_t irqstate_t -#endif - /**************************************************************************** * Public Data ****************************************************************************/ @@ -221,27 +199,15 @@ void net_setup(void); void net_initialize(void); /**************************************************************************** - * Critical section management. The NuttX configuration setting - * CONFIG_NET_NOINTS indicates that the network stack not called from the - * interrupt level. If CONFIG_NET_NOINTS is defined, then these will map - * to semaphore controls. Otherwise, it assumed that the stack will be - * called from interrupt level handling and these will map to interrupt - * enable/disable controls. - * + * Critical section management. * - * If CONFIG_NET_NOINTS is defined, then semaphore based locking is used: + * Semaphore based locking is used: * * net_lock() - Takes the semaphore(). Implements a re-entrant mutex. * net_unlock() - Gives the semaphore(). * net_lockedwait() - Like pthread_cond_wait(); releases the semaphore * momentarily to wait on another semaphore() * - * Otherwise, interrupt based locking is used: - * - * net_lock() - Disables interrupts. - * net_unlock() - Conditionally restores interrupts. - * net_lockedwait() - Just wait for the semaphore. - * ****************************************************************************/ /**************************************************************************** @@ -252,11 +218,7 @@ void net_initialize(void); * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS -net_lock_t net_lock(void); -#else -# define net_lock() enter_critical_section() -#endif +void net_lock(void); /**************************************************************************** * Function: net_unlock @@ -266,11 +228,7 @@ net_lock_t net_lock(void); * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS -void net_unlock(net_lock_t flags); -#else -# define net_unlock(f) leave_critical_section(f) -#endif +void net_unlock(void); /**************************************************************************** * Function: net_timedwait @@ -290,12 +248,8 @@ void net_unlock(net_lock_t flags); * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS struct timespec; int net_timedwait(sem_t *sem, FAR const struct timespec *abstime); -#else -# define net_timedwait(s,t) sem_timedwait(s,t) -#endif /**************************************************************************** * Function: net_lockedwait @@ -313,11 +267,7 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime); * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS int net_lockedwait(sem_t *sem); -#else -# define net_lockedwait(s) sem_wait(s) -#endif /**************************************************************************** * Function: net_setipid diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h index 7ef7cc62d75b1a256dc879bf9c602cd86bccd7f5..aceab4d083d52b032b28a2d0f242f348a18b85e5 100644 --- a/include/nuttx/net/netdev.h +++ b/include/nuttx/net/netdev.h @@ -227,23 +227,19 @@ struct net_driver_s net_ipv6addr_t d_ipv6netmask; /* Network IPv6 subnet mask */ #endif - /* The d_buf array is used to hold incoming and outgoing packets. The device - * driver should place incoming data into this buffer. When sending data, - * the device driver should read the link level headers and the TCP/IP - * headers from this buffer. The size of the link level headers is + /* The d_buf array is used to hold incoming and outgoing packets. The + * device driver should place incoming data into this buffer. When sending + * data, the device driver should read the link level headers and the + * TCP/IP headers from this buffer. The size of the link level headers is * configured by the NET_LL_HDRLEN(dev) define. * * The network will handle only a single buffer for both incoming and - * outgoing packets. However, the driver design may be concurrently send - * and filling separate, break-off buffers if CONFIG_NET_MULTIBUFFER is - * defined. That buffer management must be controlled by the driver. + * outgoing packets. However, the driver design may be concurrently + * sending and filling separate, break-off buffers. That buffer + * management must be controlled by the driver. */ -#ifdef CONFIG_NET_MULTIBUFFER - uint8_t *d_buf; -#else - uint8_t d_buf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE]; -#endif + FAR uint8_t *d_buf; /* d_appdata points to the location where application data can be read from * or written to in the the packet buffer. diff --git a/include/nuttx/net/slip.h b/include/nuttx/net/slip.h index 1fb2e46514c50aa0d69aa5545c7c3f8cbf6c2e08..546781f85fdc21bd8fc1f0e0720a3fc15047f3f1 100644 --- a/include/nuttx/net/slip.h +++ b/include/nuttx/net/slip.h @@ -51,12 +51,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Configuration ***********************************************************/ -/* Dependencies: - * - * CONFIG_NET_NOINTS - Required. - * CONFIG_NET_MULTIBUFFER - Required. - * - * SLIP Configuration: +/* SLIP Configuration: * * CONFIG_NET_SLIP - Enables building of the SLIP driver * CONFIG_NET_SLIP_STACKSIZE - Provides the stack size for SLIP RX and TX diff --git a/include/nuttx/nx/nx.h b/include/nuttx/nx/nx.h index 5f6c02a4811cf7386997f4ea2b0d47520216ab38..0650128bcce99976420459b7e5eac4753a62d604 100644 --- a/include/nuttx/nx/nx.h +++ b/include/nuttx/nx/nx.h @@ -64,7 +64,7 @@ /* Default server MQ name used by nx_run() macro */ -#define NX_DEFAULT_SERVER_MQNAME "/dev/nxs" +#define NX_DEFAULT_SERVER_MQNAME "nxs" /* Mouse button bits */ @@ -287,6 +287,9 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev); * work in the NuttX kernel build because the resources required by the * NX server are private to the kernel mode logic. * + * nx_start() can be called (indirectly) from applications via the + * boardctl() interface with the BOARDIOC_NX_START command. + * * Input Parameters: * None * @@ -300,7 +303,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev); * ****************************************************************************/ -#if defined(CONFIG_NX_MULTIUSER) && defined(CONFIG_NX_NXSTART) +#ifdef CONFIG_NX_MULTIUSER int nx_start(void); #endif diff --git a/include/nuttx/nx/nxfonts.h b/include/nuttx/nx/nxfonts.h index 5a5d81e04bca4bf5159995c27a0cad4a91c180b4..525a5f56a243a3ea25af63db1e31b5abda669196 100644 --- a/include/nuttx/nx/nxfonts.h +++ b/include/nuttx/nx/nxfonts.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/nx/nxfonts.h * - * Copyright (C) 2008, 2009, 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2009, 2011, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,8 @@ /**************************************************************************** * Pre-processor definitions ****************************************************************************/ + +/* Font Definitions *********************************************************/ /* Select the default font. If no fonts are selected, then a compilation * error is likely down the road. */ @@ -124,82 +126,88 @@ /* X11 misc fixed fonts */ #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_4X6) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_4X6 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_4X6 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_5X7) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_5X7 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_5X7 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_5X8) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_5X8 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_5X8 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X9) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X9 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X9 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X10) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X10 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X10 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X12) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X12 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X12 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X13) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X13 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X13 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X13B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X13B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X13B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_6X13O) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_6X13O +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_6X13O #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_7X13) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_7X13 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_7X13 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_7X13B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_7X13B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_7X13B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_7X13O) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_7X13O +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_7X13O #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_7X14) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_7X14 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_7X14 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_7X14B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_7X14B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_7X14B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_8X13) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_8X13 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_8X13 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_8X13B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_8X13B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_8X13B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_8X13O) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_8X13O +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_8X13O #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_9X15) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_9X15 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_9X15 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_9X15B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_9X15B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_9X15B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_9X18) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_9X18 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_9X18 #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_9X18B) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_9X18B +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_9X18B #elif defined(CONFIG_NXFONT_X11_MISC_FIXED_10X20) -# define NXFONT_DEFAULT CONFIG_NXFONT_X11_MISC_FIXED_10X20 +# define NXFONT_DEFAULT FONTID_X11_MISC_FIXED_10X20 /* Mono-space fonts */ #elif defined(CONFIG_NXFONT_MONO5X8) # define NXFONT_DEFAULT FONTID_MONO5X8 +/* Tom Thumb mono-space 4x6 font */ + +#elif defined(CONFIG_NXFONT_TOM_THUMB_4X6) +# define NXFONT_DEFAULT FONTID_TOM_THUMB_4X6 + #endif /**************************************************************************** * Public Types ****************************************************************************/ +/* Font Types ***************************************************************/ /* Font IDs */ enum nx_fontid_e @@ -387,6 +395,10 @@ enum nx_fontid_e #ifdef CONFIG_NXFONT_X11_MISC_FIXED_10X20 , FONTID_X11_MISC_FIXED_10X20 = 42 /* X11 misc fixed 10x20 */ #endif + +#ifdef CONFIG_NXFONT_TOM_THUMB_4X6 + , FONTID_TOM_THUMB_4X6 = 43 /* Tom Thumb monospace 4x6 */ +#endif }; /* This structures provides the metrics for one glyph */ @@ -443,6 +455,25 @@ struct nx_fontpackage_s #endif }; +/* Font Cache ***************************************************************/ +/* Opaque handle used to reference a font cache */ + +typedef FAR void *FCACHE; + +/* Describes one cached font glyph */ + +struct nxfonts_glyph_s +{ + FAR struct nxfonts_glyph_s *flink; /* Implements a singly linked list */ + uint8_t code; /* Character code */ + uint8_t height; /* Height of this glyph (in rows) */ + uint8_t width; /* Width of this glyph (in pixels) */ + uint8_t stride; /* Width of the glyph row (in bytes) */ + FAR uint8_t bitmap[1]; /* Bitmap memory, actual size varies */ +}; + +#define SIZEOF_NXFONTS_GLYPH_S(b) (sizeof(struct nxfonts_glyph_s) + (b) - 1) + /**************************************************************************** * Public Data ****************************************************************************/ @@ -470,6 +501,9 @@ extern "C" * Input Parameters: * fontid: Identifies the font set to get * + * Returned Value: + * One success, a non-NULL font handle is returned. + * ****************************************************************************/ NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid); @@ -554,6 +588,87 @@ int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); +/**************************************************************************** + * Name: nxf_cache_connect + * + * Description: + * Create a new font cache for the provided 'fontid'. If the cache + * already, then just increment a reference count return the handle for + * the existing font cache. + * + * Input Parameters: + * fontid - Identifies the font supported by this cache + * fgcolor - Foreground color + * bgcolor - Background color + * bpp - Bits per pixel + * maxglyphs - Maximum number of glyphs permitted in the cache + * + * Returned value: + * On success a non-NULL handle is returned that then may sequently be + * used with nxf_getglyph() to extract fonts from the font cache. NULL + * returned on any failure with the errno value set to indicate the nature + * of the error. + * + ****************************************************************************/ + +FCACHE nxf_cache_connect(enum nx_fontid_e fontid, + nxgl_mxpixel_t fgcolor, nxgl_mxpixel_t bgcolor, + int bpp, int maxglyph); + +/**************************************************************************** + * Name: nxf_cache_disconnect + * + * Description: + * Decrement the reference count on the font cache and, if the reference + * count goes to zero, free all resources used by the font cache. The + * font handler is invalid upon return in either case. + * + * Input Parameters: + * fhandle - A font cache handler previously returned by nxf_cache_connect(); + * + * Returned value: + * None + * + ****************************************************************************/ + +void nxf_cache_disconnect(FCACHE fhandle); + +/**************************************************************************** + * Name: nxf_cache_getfonthandle + * + * Description: + * Return the handle to the font set used by this instance of the font + * cache. + * + * Input Parameters: + * fhandle - A font cache handle previously returned by nxf_cache_connect(); + * + * Returned value: + * Zero (OK) is returned if the metrics were + * + * Returned Value: + * One success, a non-NULL font handle is returned. + * + ****************************************************************************/ + +NXHANDLE nxf_cache_getfonthandle(FCACHE fhandle); + +/**************************************************************************** + * Name: nxf_cache_getglyph + * + * Description: + * Get the font glyph for the character code 'ch' from the font cache. If + * the glyph for that character code does not exist in the font cache, it + * be rendered. + * + * Returned Value: + * On success, a non-NULL pointer to the rendered glyph in the font cache + * is returned. NULL is returned on any failure. + * + ****************************************************************************/ + +FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle, uint8_t ch); + #undef EXTERN #if defined(__cplusplus) } diff --git a/include/nuttx/nx/nxmu.h b/include/nuttx/nx/nxmu.h index 49940aafd91a6358369dcf94c732af0f1f1398e0..ca8481ebafba4d852f566abaf3ad293f38e3d87b 100644 --- a/include/nuttx/nx/nxmu.h +++ b/include/nuttx/nx/nxmu.h @@ -71,8 +71,8 @@ /* Used to create unique client MQ name */ -#define NX_CLIENT_MQNAMEFMT "/dev/nxc%d" -#define NX_CLIENT_MXNAMELEN (16) +#define NX_CLIENT_MQNAMEFMT "nxc%d" +#define NX_CLIENT_MXNAMELEN (12) #define NX_MXSVRMSGLEN (64) /* Maximum size of a client->server command */ #define NX_MXEVENTLEN (64) /* Maximum size of an event */ diff --git a/include/nuttx/pthread.h b/include/nuttx/pthread.h index 54d5dc659bddf656d1912d9534e4b96fe79ace63..27fb5dd99c859dc2bb5d454833608cae5b2df52f 100644 --- a/include/nuttx/pthread.h +++ b/include/nuttx/pthread.h @@ -2,7 +2,7 @@ * include/nuttx/pthread.h * Non-standard, NuttX-specific pthread-related declarations. * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ ****************************************************************************/ #include + #include #include diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index ec438727f8192985888b64e1b126ac5fea89c20d..687d19dcf9b10b0871ee54ed4b39588ec9132c8b 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -141,16 +141,17 @@ # define TCB_FLAG_TTYPE_PTHREAD (1 << TCB_FLAG_TTYPE_SHIFT) /* User pthread */ # define TCB_FLAG_TTYPE_KERNEL (2 << TCB_FLAG_TTYPE_SHIFT) /* Kernel thread */ #define TCB_FLAG_NONCANCELABLE (1 << 2) /* Bit 2: Pthread is non-cancelable */ -#define TCB_FLAG_CANCEL_PENDING (1 << 3) /* Bit 3: Pthread cancel is pending */ -#define TCB_FLAG_POLICY_SHIFT (4) /* Bit 4-5: Scheduling policy */ +#define TCB_FLAG_CANCEL_DEFERRED (1 << 3) /* Bit 3: Deferred (vs asynch) cancellation type */ +#define TCB_FLAG_CANCEL_PENDING (1 << 4) /* Bit 4: Pthread cancel is pending */ +#define TCB_FLAG_POLICY_SHIFT (5) /* Bit 5-6: Scheduling policy */ #define TCB_FLAG_POLICY_MASK (3 << TCB_FLAG_POLICY_SHIFT) # define TCB_FLAG_SCHED_FIFO (0 << TCB_FLAG_POLICY_SHIFT) /* FIFO scheding policy */ # define TCB_FLAG_SCHED_RR (1 << TCB_FLAG_POLICY_SHIFT) /* Round robin scheding policy */ # define TCB_FLAG_SCHED_SPORADIC (2 << TCB_FLAG_POLICY_SHIFT) /* Sporadic scheding policy */ # define TCB_FLAG_SCHED_OTHER (3 << TCB_FLAG_POLICY_SHIFT) /* Other scheding policy */ -#define TCB_FLAG_CPU_LOCKED (1 << 6) /* Bit 6: Locked to this CPU */ -#define TCB_FLAG_EXIT_PROCESSING (1 << 7) /* Bit 7: Exitting */ - /* Bits 8-15: Available */ +#define TCB_FLAG_CPU_LOCKED (1 << 7) /* Bit 7: Locked to this CPU */ +#define TCB_FLAG_EXIT_PROCESSING (1 << 8) /* Bit 8: Exitting */ + /* Bits 9-15: Available */ /* Values for struct task_group tg_flags */ @@ -322,6 +323,17 @@ struct child_status_s }; #endif +/* struct pthread_cleanup_s ******************************************************/ +/* This structure describes one element of the pthread cleanup stack */ + +#ifdef CONFIG_PTHREAD_CLEANUP +struct pthread_cleanup_s +{ + pthread_cleanup_t pc_cleaner; /* Cleanup callback address */ + FAR void *pc_arg; /* Argument that accompanies the callback */ +}; +#endif + /* struct dspace_s ***************************************************************/ /* This structure describes a reference counted D-Space region. This must be a * separately allocated "break-away" structure that can be owned by a task and @@ -571,6 +583,9 @@ struct tcb_s #ifdef CONFIG_SMP int16_t irqcount; /* 0=interrupts enabled */ #endif +#ifdef CONFIG_CANCELLATION_POINTS + int16_t cpcount; /* Nested cancellation point count */ +#endif #if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) int32_t timeslice; /* RR timeslice OR Sporadic budget */ @@ -682,6 +697,17 @@ struct pthread_tcb_s pthread_addr_t arg; /* Startup argument */ FAR void *joininfo; /* Detach-able info to support join */ + /* Clean-up stack *************************************************************/ + +#ifdef CONFIG_PTHREAD_CLEANUP + /* tos - The index to the next avaiable entry at the top of the stack. + * stack - The pre-allocated clean-up stack memory. + */ + + uint8_t tos; + struct pthread_cleanup_s stack[CONFIG_PTHREAD_CLEANUP_STACKSIZE]; +#endif + /* POSIX Thread Specific Data *************************************************/ #if CONFIG_NPTHREAD_KEYS > 0 diff --git a/include/nuttx/sched_note.h b/include/nuttx/sched_note.h index c21f0400660c01e768dc4ab390f5bff3e5c44891..bd1091e95038cba72fe134c5fe8037310ef5c09e 100644 --- a/include/nuttx/sched_note.h +++ b/include/nuttx/sched_note.h @@ -50,6 +50,22 @@ #ifdef CONFIG_SCHED_INSTRUMENTATION +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Provide defaults for some configuration settings (could be undefined with + * old configuration files) + */ + +#ifndef CONFIG_SCHED_INSTRUMENTATION_CPUSET +# define CONFIG_SCHED_INSTRUMENTATION_CPUSET 0xffff +#endif + +#ifndef CONFIG_SCHED_NOTE_BUFSIZE +# define CONFIG_SCHED_NOTE_BUFSIZE 2048 +#endif + /**************************************************************************** * Public Types ****************************************************************************/ @@ -60,19 +76,35 @@ enum note_type_e { - NOTE_START = 0, - NOTE_STOP, - NOTE_SUSPEND, - NOTE_RESUME + NOTE_START = 0, + NOTE_STOP = 1, + NOTE_SUSPEND = 2, + NOTE_RESUME = 3 +#ifdef CONFIG_SMP + , + NOTE_CPU_START = 4, + NOTE_CPU_STARTED = 5, + NOTE_CPU_PAUSE = 6, + NOTE_CPU_PAUSED = 7, + NOTE_CPU_RESUME = 8, + NOTE_CPU_RESUMED = 9 +#endif #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION , - NOTE_PREEMPT_LOCK, - NOTE_PREEMPT_UNLOCK + NOTE_PREEMPT_LOCK = 10, + NOTE_PREEMPT_UNLOCK = 11 #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION , - NOTE_CSECTION_ENTER, - NOTE_CSECTION_LEAVE + NOTE_CSECTION_ENTER = 12, + NOTE_CSECTION_LEAVE = 13 +#endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + , + NOTE_SPINLOCK_LOCK = 14, + NOTE_SPINLOCK_LOCKED = 15, + NOTE_SPINLOCK_UNLOCK = 16, + NOTE_SPINLOCK_ABORT = 17 #endif }; @@ -122,6 +154,54 @@ struct note_resume_s struct note_common_s nre_cmn; /* Common note parameters */ }; +#ifdef CONFIG_SMP + +/* This is the specific form of the NOTE_CPU_START note */ + +struct note_cpu_start_s +{ + struct note_common_s ncs_cmn; /* Common note parameters */ + uint8_t ncs_target; /* CPU being started */ +}; + +/* This is the specific form of the NOTE_CPU_STARTED note */ + +struct note_cpu_started_s +{ + struct note_common_s ncs_cmn; /* Common note parameters */ +}; + +/* This is the specific form of the NOTE_CPU_PAUSE note */ + +struct note_cpu_pause_s +{ + struct note_common_s ncp_cmn; /* Common note parameters */ + uint8_t ncp_target; /* CPU being paused */ +}; + +/* This is the specific form of the NOTE_CPU_PAUSED note */ + +struct note_cpu_paused_s +{ + struct note_common_s ncp_cmn; /* Common note parameters */ +}; + +/* This is the specific form of the NOTE_CPU_RESUME note */ + +struct note_cpu_resume_s +{ + struct note_common_s ncr_cmn; /* Common note parameters */ + uint8_t ncr_target; /* CPU being resumed */ +}; + +/* This is the specific form of the NOTE_CPU_RESUMED note */ + +struct note_cpu_resumed_s +{ + struct note_common_s ncr_cmn; /* Common note parameters */ +}; +#endif + #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION /* This is the specific form of the NOTE_PREEMPT_LOCK/UNLOCK note */ @@ -143,6 +223,17 @@ struct note_csection_s #endif }; #endif /* CONFIG_SCHED_INSTRUMENTATION_CSECTION */ + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS +/* This is the specific form of the NOTE_SPINLOCK_LOCK/LOCKED/UNLOCK/ABORT note */ + +struct note_spinlock_s +{ + struct note_common_s nsp_cmn; /* Common note parameters */ + FAR void *nsp_spinlock; /* Address of spinlock */ + uint8_t nsp_value; /* Value of spinlock */ +}; +#endif /* CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS */ #endif /* CONFIG_SCHED_INSTRUMENTATION_BUFFER */ /**************************************************************************** @@ -174,12 +265,44 @@ void sched_note_stop(FAR struct tcb_s *tcb); void sched_note_suspend(FAR struct tcb_s *tcb); void sched_note_resume(FAR struct tcb_s *tcb); +#ifdef CONFIG_SMP +void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu); +void sched_note_cpu_started(FAR struct tcb_s *tcb); +void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu); +void sched_note_cpu_paused(FAR struct tcb_s *tcb); +void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu); +void sched_note_cpu_resumed(FAR struct tcb_s *tcb); +#else +# define sched_note_cpu_start(t,c) +# define sched_note_cpu_started(t) +# define sched_note_cpu_pause(t,c) +# define sched_note_cpu_paused(t) +# define sched_note_cpu_resume(t,c) +# define sched_note_cpu_resumed(t) +#endif + #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION void sched_note_premption(FAR struct tcb_s *tcb, bool locked); +#else +# define sched_note_premption(t,l) #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION void sched_note_csection(FAR struct tcb_s *tcb, bool enter); +#else +# define sched_note_csection(t,e) +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS +void sched_note_spinlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock); +void sched_note_spinlocked(FAR struct tcb_s *tcb, FAR volatile void *spinlock); +void sched_note_spinunlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock); +void sched_note_spinabort(FAR struct tcb_s *tcb, FAR volatile void *spinlock); +#else +# define sched_note_spinlock(t,s) +# define sched_note_spinlocked(t,s) +# define sched_note_spinunlock(t,s) +# define sched_note_spinabort(t,s) #endif /**************************************************************************** @@ -200,7 +323,8 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter); * ****************************************************************************/ -#ifdef CONFIG_SCHED_INSTRUMENTATION_BUFFER +#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ + defined(CONFIG_SCHED_NOTE_GET) ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen); #endif @@ -219,7 +343,8 @@ ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen); * ****************************************************************************/ -#ifdef CONFIG_SCHED_INSTRUMENTATION_BUFFER +#if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ + defined(CONFIG_SCHED_NOTE_GET) ssize_t sched_note_size(void); #endif @@ -250,8 +375,18 @@ int note_register(void); # define sched_note_stop(t) # define sched_note_suspend(t) # define sched_note_resume(t) +# define sched_note_cpu_start(t,c) +# define sched_note_cpu_started(t) +# define sched_note_cpu_pause(t,c) +# define sched_note_cpu_paused(t) +# define sched_note_cpu_resume(t,c) +# define sched_note_cpu_resumed(t) # define sched_note_premption(t,l) # define sched_note_csection(t,e) +# define sched_note_spinlock(t,s) +# define sched_note_spinlocked(t,s) +# define sched_note_spinunlock(t,s) +# define sched_note_spinabort(t,s) #endif /* CONFIG_SCHED_INSTRUMENTATION */ #endif /* __INCLUDE_NUTTX_SCHED_NOTE_H */ diff --git a/include/nuttx/sensors/veml6070.h b/include/nuttx/sensors/veml6070.h index a143f1ee8d2219ad881d8d76f1ba87d1e6f8ca96..487eb539599df5c1438606346542f85cf1bb105d 100644 --- a/include/nuttx/sensors/veml6070.h +++ b/include/nuttx/sensors/veml6070.h @@ -109,6 +109,7 @@ extern "C" * ****************************************************************************/ +struct i2c_master_s; int veml6070_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); diff --git a/include/nuttx/sensors/xen1210.h b/include/nuttx/sensors/xen1210.h index de92cd5225b1ba3e2a27297930224a906cb07aec..d76b504833179a6fe344b9fc3a8d21b46d021a1d 100644 --- a/include/nuttx/sensors/xen1210.h +++ b/include/nuttx/sensors/xen1210.h @@ -114,6 +114,7 @@ * handler but rather from the context of the worker thread with interrupts enabled. */ +struct xen1210_config_s; typedef void (*xen1210_handler_t)(FAR struct xen1210_config_s *config, FAR void *arg); /* A reference to a structure of this type must be passed to the XEN1210 driver when the diff --git a/include/nuttx/sercomm/msgb.h b/include/nuttx/sercomm/msgb.h deleted file mode 100644 index 39067c3ba39ccc0a4ff6bc05de8ea9b3f28289d7..0000000000000000000000000000000000000000 --- a/include/nuttx/sercomm/msgb.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** - * (C) 2008-2010 by Harald Welte - * - * This source code is derivated from Osmocom-BB project and was - * relicensed as BSD with permission from original authors. - * - * 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. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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 OWNER 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_SERCOM_MSGB_H -#define __INCLUDE_NUTTX_SERCOM_MSGB_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -struct msgb -{ - struct llist_head list; - - /* the layer 1 header, if any */ - - unsigned char *l1h; - - /* the A-bis layer 2 header: OML, RSL(RLL), NS */ - - unsigned char *l2h; - - /* the layer 3 header. For OML: FOM; RSL: 04.08; GPRS: BSSGP */ - - unsigned char *l3h; - - uint16_t data_len; - uint16_t len; - - unsigned char *head; /* start of buffer */ - unsigned char *tail; /* end of message */ - unsigned char *data; /* start of message */ - unsigned char _data[0]; -}; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -struct msgb *msgb_alloc(uint16_t size, const char *name); -void msgb_free(struct msgb *m); -void msgb_enqueue(struct llist_head *queue, struct msgb *msg); -struct msgb *msgb_dequeue(struct llist_head *queue); -void msgb_reset(struct msgb *m); - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -#define msgb_l1(m) ((void *)(m->l1h)) -#define msgb_l2(m) ((void *)(m->l2h)) -#define msgb_l3(m) ((void *)(m->l3h)) - -static inline unsigned int msgb_l1len(const struct msgb *msgb) -{ - return msgb->tail - (uint8_t *)msgb_l1(msgb); -} - -static inline unsigned int msgb_l2len(const struct msgb *msgb) -{ - return msgb->tail - (uint8_t *)msgb_l2(msgb); -} - -static inline unsigned int msgb_l3len(const struct msgb *msgb) -{ - return msgb->tail - (uint8_t *)msgb_l3(msgb); -} - -static inline unsigned int msgb_headlen(const struct msgb *msgb) -{ - return msgb->len - msgb->data_len; -} - -static inline int msgb_tailroom(const struct msgb *msgb) -{ - return (msgb->head + msgb->data_len) - msgb->tail; -} - -static inline unsigned char *msgb_put(struct msgb *msgb, unsigned int len) -{ - unsigned char *tmp = msgb->tail; - - /* we intentionally call cons_puts() here to display an allocation - * failure on the _other_ serial port (i.e. the one that doesn't - * have the HDLC layer on it - */ - - if (msgb_tailroom(msgb) < len) - { - cons_puts("msgb_tailroom insufficient!\n"); - } - - msgb->tail += len; - msgb->len += len; - return tmp; -} - -static inline void msgb_put_u8(struct msgb *msgb, uint8_t word) -{ - uint8_t *space = msgb_put(msgb, 1); - space[0] = word & 0xFF; -} - -static inline void msgb_put_u16(struct msgb *msgb, uint16_t word) -{ - uint8_t *space = msgb_put(msgb, 2); - space[0] = word >> 8 & 0xFF; - space[1] = word & 0xFF; -} - -static inline void msgb_put_u32(struct msgb *msgb, uint32_t word) -{ - uint8_t *space = msgb_put(msgb, 4); - space[0] = word >> 24 & 0xFF; - space[1] = word >> 16 & 0xFF; - space[2] = word >> 8 & 0xFF; - space[3] = word & 0xFF; -} - -static inline unsigned char *msgb_get(struct msgb *msgb, unsigned int len) -{ - unsigned char *tmp = msgb->data; - msgb->data += len; - msgb->len -= len; - return tmp; -} - -static inline uint8_t msgb_get_u8(struct msgb *msgb) -{ - uint8_t *space = msgb_get(msgb, 1); - return space[0]; -} - -static inline uint16_t msgb_get_u16(struct msgb *msgb) -{ - uint8_t *space = msgb_get(msgb, 2); - return space[0] << 8 | space[1]; -} - -static inline uint32_t msgb_get_u32(struct msgb *msgb) -{ - uint8_t *space = msgb_get(msgb, 4); - return space[0] << 24 | space[1] << 16 | space[2] << 8 | space[3]; -} - -static inline unsigned char *msgb_push(struct msgb *msgb, unsigned int len) -{ - msgb->data -= len; - msgb->len += len; - return msgb->data; -} - -static inline unsigned char *msgb_pull(struct msgb *msgb, unsigned int len) -{ - msgb->len -= len; - return msgb->data += len; -} - -/* increase the headroom of an empty msgb, reducing the tailroom */ - -static inline void msgb_reserve(struct msgb *msg, int len) -{ - msg->data += len; - msg->tail += len; -} - -static inline struct msgb *msgb_alloc_headroom(int size, int headroom, - const char *name) -{ - struct msgb *msg = msgb_alloc(size, name); - if (msg) - { - msgb_reserve(msg, headroom); - } - - return msg; -} - -#endif /* __INCLUDE_NUTTX_SERCOM_MSGB_H */ diff --git a/include/nuttx/sercomm/sercomm.h b/include/nuttx/sercomm/sercomm.h deleted file mode 100644 index 260f1be57b88ccc53ae0dcce2ecbc7ea44d4e58a..0000000000000000000000000000000000000000 --- a/include/nuttx/sercomm/sercomm.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef __INCLUDE_NUTTX_SERCOMM_SERCOMM_H -#define __INCLUDE_NUTTX_SERCOMM_SERCOMM_H - -/* SERCOMM layer on UART1 (modem UART) */ - -#include - -#define SERCOMM_UART_NR 1 - -#define HDLC_FLAG 0x7E -#define HDLC_ESCAPE 0x7D - -#define HDLC_C_UI 0x03 -#define HDLC_C_P_BIT (1 << 4) -#define HDLC_C_F_BIT (1 << 4) - -/* a low sercomm_dlci means high priority. A high DLCI means low priority */ -enum sercomm_dlci { - SC_DLCI_HIGHEST = 0, - SC_DLCI_DEBUG = 4, - SC_DLCI_L1A_L23 = 5, - SC_DLCI_LOADER = 9, - SC_DLCI_CONSOLE = 10, - SC_DLCI_ECHO = 128, - _SC_DLCI_MAX -}; - -void sercomm_init(void); -int sercomm_initialized(void); - -/* User Interface: Tx */ - -/* user interface for transmitting messages for a given DLCI */ -void sercomm_sendmsg(uint8_t dlci, struct msgb *msg); -/* how deep is the Tx queue for a given DLCI */ -unsigned int sercomm_tx_queue_depth(uint8_t dlci); - -/* User Interface: Rx */ - -/* receiving messages for a given DLCI */ -typedef void (*dlci_cb_t)(uint8_t dlci, struct msgb *msg); -int sercomm_register_rx_cb(uint8_t dlci, dlci_cb_t cb); - -/* Driver Interface */ - -/* fetch one octet of to-be-transmitted serial data. returns 0 if no more data */ -int sercomm_drv_pull(uint8_t *ch); -/* the driver has received one byte, pass it into sercomm layer. - returns 1 in case of success, 0 in case of unrecognized char */ -int sercomm_drv_rx_char(uint8_t ch); - -static inline struct msgb *sercomm_alloc_msgb(unsigned int len) -{ - return msgb_alloc_headroom(len+4, 4, "sercomm_tx"); -} - -#endif /* __INCLUDE_NUTTX_SERCOMM_SERCOMM_H */ diff --git a/include/nuttx/sercomm/sercomm_cons.h b/include/nuttx/sercomm/sercomm_cons.h deleted file mode 100644 index eb8e7fa12bdac907a2ec8577f3deecde6f660729..0000000000000000000000000000000000000000 --- a/include/nuttx/sercomm/sercomm_cons.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __INCLUDE_NUTTX_SERCOMM_SERCOMM_CONS_H -#define __INCLUDE_NUTTX_SERCOMM_SERCOMM_CONS_H - -/* how large buffers do we allocate? */ -#define SERCOMM_CONS_ALLOC 256 - -int sercomm_puts(const char *s); -int sercomm_putchar(int c); - -#endif /* __INCLUDE_NUTTX_SERCOMM_SERCOMM_CONS_H */ diff --git a/include/nuttx/spinlock.h b/include/nuttx/spinlock.h index 65786a0c6d5ec6cc03325c7e56d9e6331a7ccf97..3798e177ff5755ea7ba4878531391d9a3b420295 100644 --- a/include/nuttx/spinlock.h +++ b/include/nuttx/spinlock.h @@ -59,6 +59,43 @@ #include +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Memory barriers may be provided in arch/spinlock.h + * + * DMB - Data memory barrier. Assures writes are completed to memory. + * DSB - Data syncrhonization barrier. + */ + +#undef __SP_UNLOCK_FUNCTION +#if !defined(SP_DMB) +# define SP_DMB() +#else +# define __SP_UNLOCK_FUNCTION 1 +#endif + +#if !defined(SP_DSB) +# define SP_DSB() +#endif + +#if defined(CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS) && !defined(__SP_UNLOCK_FUNCTION) +# define __SP_UNLOCK_FUNCTION 1 +#endif + +/* If the target CPU supports a data cache then it may be necessary to + * manage spinlocks in a special way, perhaps linking them all into a + * special non-cacheable memory region. + * + * SP_SECTION - Special storage attributes may be required to force + * spinlocks into a special, non-cacheable section. + */ + +#if !defined(SP_SECTION) +# define SP_SECTION +#endif + /**************************************************************************** * Public Types ****************************************************************************/ @@ -108,15 +145,16 @@ spinlock_t up_testset(volatile FAR spinlock_t *lock); * Initialize a non-reentrant spinlock object to its initial, unlocked state. * * Input Parameters: - * lock - A reference to the spinlock object to be initialized. + * lock - A reference to the spinlock object to be initialized. + * state - Initial state of the spinlock {SP_LOCKED or SP_UNLOCKED) * * Returned Value: * None. * ****************************************************************************/ -/* void spin_initialize(FAR spinlock_t *lock); */ -#define spin_initialize(i) do { (l) = SP_UNLOCKED; } while (0) +/* void spin_initialize(FAR spinlock_t *lock, spinlock_t state); */ +#define spin_initialize(l,s) do { *(l) = (s); } while (0) /**************************************************************************** * Name: spin_initializer @@ -159,6 +197,27 @@ void spin_initializer(FAR struct spinlock_s *lock); void spin_lock(FAR volatile spinlock_t *lock); +/**************************************************************************** + * Name: spin_trylock + * + * Description: + * Try once to lock the spinlock. Do not wait if the spinlock is already + * locked. + * + * Input Parameters: + * lock - A reference to the spinlock object to lock. + * + * Returned Value: + * SP_LOCKED - Failure, the spinlock was already locked + * SP_UNLOCKED - Success, the spinlock was successfully locked + * + * Assumptions: + * Not running at the interrupt level. + * + ****************************************************************************/ + +#define spin_trylock(l) up_testset(l) + /**************************************************************************** * Name: spin_lockr * @@ -203,8 +262,11 @@ void spin_lockr(FAR struct spinlock_s *lock); * ****************************************************************************/ -/* void spin_unlock(FAR spinlock_t *lock); */ -#define spin_unlock(l) do { *(l) = SP_UNLOCKED; } while (0) +#ifdef __SP_UNLOCK_FUNCTION +void spin_unlock(FAR volatile spinlock_t *lock); +#else +# define spin_unlock(l) do { *(l) = SP_UNLOCKED; } while (0) +#endif /**************************************************************************** * Name: spin_unlockr @@ -268,7 +330,7 @@ void spin_unlockr(FAR struct spinlock_s *lock); * Input Parameters: * set - A reference to the bitset to set the CPU bit in * cpu - The bit number to be set - * setlock - A reference to the lock lock protecting the set + * setlock - A reference to the lock protecting the set * orlock - Will be set to SP_LOCKED while holding setlock * * Returned Value: @@ -289,7 +351,7 @@ void spin_setbit(FAR volatile cpu_set_t *set, unsigned int cpu, * Input Parameters: * set - A reference to the bitset to set the CPU bit in * cpu - The bit number to be set - * setlock - A reference to the lock lock protecting the set + * setlock - A reference to the lock protecting the set * orlock - Will be set to SP_UNLOCKED if all bits become cleared in set * * Returned Value: diff --git a/include/nuttx/streams.h b/include/nuttx/streams.h index ffbcffc9ec58760bc3dfd19b2ad0e0774e3933c5..eb7ad678449994494d5ab1f09d8ff1e0d20ca13a 100644 --- a/include/nuttx/streams.h +++ b/include/nuttx/streams.h @@ -299,15 +299,13 @@ void lib_rawsistream(FAR struct lib_rawsistream_s *instream, int fd); void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd); /**************************************************************************** - * Name: lib_lowinstream, lib_lowoutstream + * Name: lib_lowoutstream * * Description: - * Initializes a stream for use with low-level, architecture-specific I/O. - * Defined in lib/stdio/lib_lowinstream.c and lib/stdio/lib_lowoutstream.c + * Initializes a stream for use with low-level, architecture-specific output. + * Defined in ib/stdio/lib_lowoutstream.c * * Input parameters: - * lowinstream - User allocated, uninitialized instance of struct - * lib_lowinstream_s to be initialized. * lowoutstream - User allocated, uninitialized instance of struct * lib_lowoutstream_s to be initialized. * @@ -316,9 +314,6 @@ void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd); * ****************************************************************************/ -#ifdef CONFIG_ARCH_LOWGETC -void lib_lowinstream(FAR struct lib_instream_s *lowinstream); -#endif #ifdef CONFIG_ARCH_LOWPUTC void lib_lowoutstream(FAR struct lib_outstream_s *lowoutstream); #endif diff --git a/include/nuttx/usb/audio.h b/include/nuttx/usb/audio.h index 8bec321225127e591f331440ca65abbfe979adea..ab1bb6528209661d4a091d6edac5a87d14992c88 100644 --- a/include/nuttx/usb/audio.h +++ b/include/nuttx/usb/audio.h @@ -2,7 +2,7 @@ * include/nuttx/usb/audio.h * Audio Device Class (ADC) definitions * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: This header file is based on information provided by the @@ -1321,18 +1321,18 @@ struct adc_l1_curparm_s /* Layout 1, Control RANGE Parameter Block */ -struct adc_l1_subrange_s +begin_packed_struct struct adc_l1_subrange_s { uint8_t l1_min; /* 0: MIN attribute */ uint8_t l1_max; /* 1: MAX attribute */ uint8_t l1_res; /* 2: RES attribute */ -} packed_struct; +} end_packed_struct; -struct adc_l1_rangeparm_s +begin_packed_struct struct adc_l1_rangeparm_s { uint8_t l1_nranges; /* 0: Number of sub-ranges */ struct adc_l1_subrange_s l1_subrange[1]; -} packed_struct; +} end_packed_struct; #define USB_SIZEOF_ADC_LI_RANGEPARM(nranges) (1+3*(nranges)) @@ -1422,18 +1422,18 @@ struct adc_equalizer_curparm_s /* Graphic Equalizer Control RANGE Parameter Block */ -struct adc_eq_subrange_s +begin_packed_struct struct adc_eq_subrange_s { uint8_t eq_min; /* 0: MIN attribute */ uint8_t eq_max; /* 1: MAX attribute */ uint8_t eq_res; /* 2: RES attribute */ -} packed_struct; +} end_packed_struct; -struct adc_equalizer_rangeparm_s +begin_packed_struct struct adc_equalizer_rangeparm_s { uint8_t eq_nranges; /* 0: Number of sub-ranges */ struct adc_eq_subrange_s eq_subrange[1]; -} packed_struct; +} end_packed_struct; #define USB_SIZEOF_ADC_EQUALIZER_RANGEPARM(nranges) (1+3*(nranges)) @@ -1457,18 +1457,18 @@ struct adc_hilo_curparm_s /* High/Low Scaling Control RANGE Parameter Block */ -struct adc_hl_subrange_s +begin_packed_struct struct adc_hl_subrange_s { uint8_t hl_min; /* 0: MIN attribute */ uint8_t hl_max; /* 1: MAX attribute */ uint8_t hl_res; /* 2: RES attribute */ -} packed_struct; +} end_packed_struct; -struct adc_hilo_rangeparm_s +begin_packed_struct struct adc_hilo_rangeparm_s { uint8_t hl_nranges[2]; /* 0: Number of sub-ranges */ struct adc_hl_subrange_s hl_subrange[1]; -} packed_struct; +} end_packed_struct; #define USB_SIZEOF_ADC_HILO_RANGEPARM(nranges) (2+3*(nranges)) diff --git a/include/pthread.h b/include/pthread.h index ac495e44c29a612ecacf21444c90016a79449264..d943a843e2f1391729513b11ab5fb03072943586 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -115,11 +115,16 @@ #define PTHREAD_DEFAULT_PRIORITY 100 -/* Cancellation states returned by pthread_cancelstate() */ +/* Cancellation states used by pthread_setcancelstate() */ #define PTHREAD_CANCEL_ENABLE (0) #define PTHREAD_CANCEL_DISABLE (1) +/* Cancellation types used by pthread_setcanceltype() */ + +#define PTHREAD_CANCEL_DEFERRED (0) +#define PTHREAD_CANCEL_ASYNCHRONOUS (1) + /* Thread return value when a pthread is canceled */ #define PTHREAD_CANCELED ((FAR void*)ERROR) @@ -265,6 +270,12 @@ typedef struct pthread_barrier_s pthread_barrier_t; typedef bool pthread_once_t; #define __PTHREAD_ONCE_T_DEFINED 1 +#ifdef CONFIG_PTHREAD_CLEANUP +/* This type describes the pthread cleanup callback (non-standard) */ + +typedef CODE void (*pthread_cleanup_t)(FAR void *arg); +#endif + /* Forward references */ struct sched_param; /* Defined in sched.h */ @@ -334,8 +345,18 @@ int pthread_detach(pthread_t thread); void pthread_exit(pthread_addr_t value) noreturn_function; int pthread_cancel(pthread_t thread); int pthread_setcancelstate(int state, FAR int *oldstate); +int pthread_setcanceltype(int type, FAR int *oldtype); void pthread_testcancel(void); +/* A thread may set up cleanup functions to execut when the thread exits or + * is canceled. + */ + +#ifdef CONFIG_PTHREAD_CLEANUP +void pthread_cleanup_pop(int execute); +void pthread_cleanup_push(pthread_cleanup_t routine, FAR void *arg); +#endif + /* A thread can await termination of another thread and retrieve the return * value of the thread. */ diff --git a/include/sched.h b/include/sched.h index 31526f923e1806363e214c20c230df649cadadbb..f63c42201ae292054f8598a984d7961996573142 100644 --- a/include/sched.h +++ b/include/sched.h @@ -54,18 +54,30 @@ /* POSIX-like scheduling policies */ -#define SCHED_FIFO 1 /* FIFO priority scheduling policy */ -#define SCHED_RR 2 /* Round robin scheduling policy */ -#define SCHED_SPORADIC 3 /* Sporadic scheduling policy */ -#define SCHED_OTHER 4 /* Not supported */ +#define SCHED_FIFO 1 /* FIFO priority scheduling policy */ +#define SCHED_RR 2 /* Round robin scheduling policy */ +#define SCHED_SPORADIC 3 /* Sporadic scheduling policy */ +#define SCHED_OTHER 4 /* Not supported */ /* Maximum number of SCHED_SPORADIC replenishments */ -#define SS_REPL_MAX CONFIG_SCHED_SPORADIC_MAXREPL +#define SS_REPL_MAX CONFIG_SCHED_SPORADIC_MAXREPL + +/* Cancellation definitions *****************************************************/ + +/* Cancellation states used by task_setcancelstate() */ + +#define TASK_CANCEL_ENABLE (0) +#define TASK_CANCEL_DISABLE (1) + +/* Cancellation types used by task_setcanceltype() */ + +#define TASK_CANCEL_DEFERRED (0) +#define TASK_CANCEL_ASYNCHRONOUS (1) /* Pthread definitions **********************************************************/ -#define PTHREAD_KEYS_MAX CONFIG_NPTHREAD_KEYS +#define PTHREAD_KEYS_MAX CONFIG_NPTHREAD_KEYS /* CPU affinity mask helpers ***************************************************/ /* These are not standard but are defined for Linux compatibility */ @@ -229,6 +241,10 @@ int task_create(FAR const char *name, int priority, int stack_size, int task_delete(pid_t pid); int task_restart(pid_t pid); +int task_setcancelstate(int state, FAR int *oldstate); +int task_setcanceltype(int type, FAR int *oldtype); +void task_testcancel(void); + /* Task Scheduling Interfaces (based on POSIX APIs) */ int sched_setparam(pid_t pid, const struct sched_param *param); diff --git a/include/sys/boardctl.h b/include/sys/boardctl.h index b1ebe45e8fa84bca24998bb4806b87675465a4f9..c96215ec93f0dba78db1e4c51f2793dc2fef848c 100644 --- a/include/sys/boardctl.h +++ b/include/sys/boardctl.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/sys/boardctl.h * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -109,6 +109,12 @@ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_USBDEVCTRL * DEPENDENCIES: Board logic must provide board__initialize() * + * CMD: BOARDIOC_NX_START + * DESCRIPTION: Start the NX servier + * ARG: None + * CONFIGURATION: CONFIG_NX_MULTIUSER + * DEPENDENCIES: Base graphics logic provides nx_start() + * * CMD: BOARDIOC_TSCTEST_SETUP * DESCRIPTION: Touchscreen controller test configuration * ARG: Touch controller device minor number @@ -121,30 +127,12 @@ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST * DEPENDENCIES: Board logic must provide board_tsc_teardown() * - * CMD: BOARDIOC_ADCTEST_SETUP - * DESCRIPTION: ADC controller test configuration - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_ADCTEST - * DEPENDENCIES: Board logic must provide board_adc_setup() - * - * CMD: BOARDIOC_PWMTEST_SETUP - * DESCRIPTION: PWM controller test configuration - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_PWMTEST - * DEPENDENCIES: Board logic must provide board_pwm_setup() - * - * CMD: BOARDIOC_CAN_INITIALIZE - * DESCRIPTION: CAN device initialization - * ARG: None - * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_CANINIT - * DEPENDENCIES: Board logic must provide board_can_initialize() - * * CMD: BOARDIOC_GRAPHICS_SETUP * DESCRIPTION: Configure graphics that require special initialization * procedures * ARG: A pointer to an instance of struct boardioc_graphics_s * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_GRAPHICS - * DEPENDENCIES: Board logic must provide board_adc_setup() + * DEPENDENCIES: Board logic must provide board_graphics_setup() */ #define BOARDIOC_INIT _BOARDIOC(0x0001) @@ -154,12 +142,10 @@ #define BOARDIOC_APP_SYMTAB _BOARDIOC(0x0005) #define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0006) #define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x0007) -#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0008) -#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0009) -#define BOARDIOC_ADCTEST_SETUP _BOARDIOC(0x000a) -#define BOARDIOC_PWMTEST_SETUP _BOARDIOC(0x000b) -#define BOARDIOC_CAN_INITIALIZE _BOARDIOC(0x000c) -#define BOARDIOC_GRAPHICS_SETUP _BOARDIOC(0x000d) +#define BOARDIOC_NX_START _BOARDIOC(0x0008) +#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0009) +#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x000a) +#define BOARDIOC_GRAPHICS_SETUP _BOARDIOC(0x000b) /* If CONFIG_BOARDCTL_IOCTL=y, then boad-specific commands will be support. * In this case, all commands not recognized by boardctl() will be forwarded diff --git a/include/sys/syscall.h b/include/sys/syscall.h index d0bfcd959778d166f5c9b4bd10511b806312e000..8da2d8f968a7cd261d34f885ad9d99c463c7ecc5 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -128,8 +128,16 @@ # define SYS_task_delete __SYS_task_delete # define SYS_task_restart (__SYS_task_delete+1) -# define SYS_up_assert (__SYS_task_delete+2) -# define __SYS_vfork (__SYS_task_delete+3) +# define SYS_task_setcancelstate (__SYS_task_delete+2) +# define SYS_up_assert (__SYS_task_delete+3) + +# ifdef CONFIG_CANCELLATION_POINTS +# define SYS_task_setcanceltype (__SYS_task_delete+4) +# define SYS_task_testcancel (__SYS_task_delete+5) +# define __SYS_vfork (__SYS_task_delete+6) +# else +# define __SYS_vfork (__SYS_task_delete+4) +# endif /* The following can be individually enabled */ @@ -400,27 +408,35 @@ # define SYS_pthread_mutex_trylock (__SYS_pthread+20) # define SYS_pthread_mutex_unlock (__SYS_pthread+21) # define SYS_pthread_once (__SYS_pthread+22) -# define SYS_pthread_setcancelstate (__SYS_pthread+23) -# define SYS_pthread_setschedparam (__SYS_pthread+24) -# define SYS_pthread_setschedprio (__SYS_pthread+25) -# define SYS_pthread_setspecific (__SYS_pthread+26) -# define SYS_pthread_yield (__SYS_pthread+27) - -# ifndef CONFIG_SMP -# define SYS_pthread_setaffinity_np (__SYS_pthread+28) -# define SYS_pthread_getaffinity_np (__SYS_pthread+29) -# define __SYS_pthread_signals (__SYS_pthread+30) +# define SYS_pthread_setschedparam (__SYS_pthread+23) +# define SYS_pthread_setschedprio (__SYS_pthread+24) +# define SYS_pthread_setspecific (__SYS_pthread+25) +# define SYS_pthread_yield (__SYS_pthread+26) +# define __SYS_pthread_smp (__SYS_pthread+27) + +# ifdef CONFIG_SMP +# define SYS_pthread_setaffinity_np (__SYS_pthread_smp+0) +# define SYS_pthread_getaffinity_np (__SYS_pthread_smp+1) +# define __SYS_pthread_signals (__SYS_pthread_smp+2) # else -# define __SYS_pthread_signals (__SYS_pthread+28) +# define __SYS_pthread_signals __SYS_pthread_smp # endif # ifndef CONFIG_DISABLE_SIGNALS # define SYS_pthread_cond_timedwait (__SYS_pthread_signals+0) # define SYS_pthread_kill (__SYS_pthread_signals+1) # define SYS_pthread_sigmask (__SYS_pthread_signals+2) -# define __SYS_mqueue (__SYS_pthread_signals+3) +# define __SYS_pthread_cleanup (__SYS_pthread_signals+3) +# else +# define __SYS_pthread_cleanup __SYS_pthread_signals +# endif + +# ifdef CONFIG_PTHREAD_CLEANUP +# define __SYS_pthread_cleanup_push (__SYS_pthread_cleanup+0) +# define __SYS_pthread_cleanup_pop (__SYS_pthread_cleanup+1) +# define __SYS_mqueue (__SYS_pthread_cleanup+2) # else -# define __SYS_mqueue __SYS_pthread_signals +# define __SYS_mqueue __SYS_pthread_cleanup # endif #else diff --git a/include/termios.h b/include/termios.h index 00ff32e5c6692dae245c78268f0fd978cc0137bf..8427cbf5991cf1462845ef15a5e7809d54b9ac8a 100644 --- a/include/termios.h +++ b/include/termios.h @@ -110,8 +110,8 @@ #define HUPCL (1 << 6) /* Bit 6: Hang up on last close */ #define CLOCAL (1 << 7) /* Bit 7: Ignore modem status lines */ #define CCTS_OFLOW (1 << 8) /* Bit 8: CTS flow control of output */ -#define CRTSCTS CCTS_OFLOW #define CRTS_IFLOW (1 << 9) /* Bit 9: RTS flow control of input */ +#define CRTSCTS (CRTS_IFLOW | CCTS_OFLOW) /* Local Modes (c_lflag in the termios structure) */ diff --git a/libc/Kconfig b/libc/Kconfig index dead1df0b34424dad2e8415c12cedc5bb7bb0c1f..a8d40fed543fbda44bc406afdd7cf728a46ed128 100644 --- a/libc/Kconfig +++ b/libc/Kconfig @@ -61,6 +61,12 @@ config LIBC_LONG_LONG libraries that will be drawn into the build if long long support is enabled. +config LIBC_SCANSET + bool "Scanset support" + default n + ---help--- + Add scanset support to sscanf(). + config LIBC_IOCTL_VARIADIC bool "Enable variadic ioctl()" default n @@ -575,6 +581,16 @@ config TLS_NELEM endif # TLS +config LIBC_IPv4_ADDRCONV + bool "IPv4 address conversions" + default n + depends on !NET_IPv4 + +config LIBC_IPv6_ADDRCONV + bool "IPv6 address conversions" + default n + depends on !NET_IPv6 + config LIBC_NETDB bool default n diff --git a/libc/aio/aio_suspend.c b/libc/aio/aio_suspend.c index 948462cd909b5e314db1245fc20dec075291b442..34b7e4a72bd3828ea4d55d05d7d024b64484bdd5 100644 --- a/libc/aio/aio_suspend.c +++ b/libc/aio/aio_suspend.c @@ -47,27 +47,6 @@ #ifdef CONFIG_FS_AIO -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ -/* Configuration ************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libc/net/lib_inetntoa.c b/libc/net/lib_inetntoa.c index a25364ce2d23d7227b6a6f4c9d535659cf4a846c..7914accdc24e0397c66eaf9a44647df13ec6c16e 100644 --- a/libc/net/lib_inetntoa.c +++ b/libc/net/lib_inetntoa.c @@ -44,7 +44,7 @@ #include #include -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV) /**************************************************************************** * Public Functions @@ -78,4 +78,4 @@ FAR char *_inet_ntoa(in_addr_t in) return buffer; } #endif -#endif /* CONFIG_NET_IPv4 */ +#endif /* CONFIG_NET_IPv4 || CONFIG_LIBC_IPv4_ADDRCONV */ diff --git a/libc/net/lib_inetntop.c b/libc/net/lib_inetntop.c index 2a6037f97c421d800145fb0de27fb92e8b9950f1..196dfa62e378d06984b342711d29fa19867a1456 100644 --- a/libc/net/lib_inetntop.c +++ b/libc/net/lib_inetntop.c @@ -62,10 +62,10 @@ */ #ifdef CONFIG_NETDB_HOSTFILE -# undef CONFIG_NET_IPv4 -# undef CONFIG_NET_IPv6 -# define CONFIG_NET_IPv4 1 -# define CONFIG_NET_IPv6 1 +# undef CONFIG_LIBC_IPv4_ADDRCONV +# undef CONFIG_LIBC_IPv6_ADDRCONV +# define CONFIG_LIBC_IPv4_ADDRCONV 1 +# define CONFIG_LIBC_IPv6_ADDRCONV 1 #endif /**************************************************************************** @@ -97,7 +97,7 @@ * ****************************************************************************/ -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV) static int inet_ipv4_ntop(FAR const void *src, FAR char *dest, socklen_t size) { FAR char *ptr; @@ -141,7 +141,7 @@ static int inet_ipv4_ntop(FAR const void *src, FAR char *dest, socklen_t size) * ****************************************************************************/ -#ifdef CONFIG_NET_IPv6 +#if defined(CONFIG_NET_IPv6) || defined(CONFIG_LIBC_IPv6_ADDRCONV) static int inet_ipv6_ntop(FAR const void *src, FAR char *dest, socklen_t size) { FAR const struct in6_addr *in6_addr; @@ -265,13 +265,13 @@ FAR const char *inet_ntop(int af, FAR const void *src, FAR char *dest, switch (af) { -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV) case AF_INET: ret = inet_ipv4_ntop(src, dest, size); break; #endif -#ifdef CONFIG_NET_IPv6 +#if defined(CONFIG_NET_IPv6) || defined(CONFIG_LIBC_IPv6_ADDRCONV) case AF_INET6: ret = inet_ipv6_ntop(src, dest, size); break; diff --git a/libc/net/lib_inetpton.c b/libc/net/lib_inetpton.c index 8b5eb77dd1fbbec789b87fc3d0eddcb57c47f7e0..93a8804b72db427fa354a8579f9b6bd5f7f8293b 100644 --- a/libc/net/lib_inetpton.c +++ b/libc/net/lib_inetpton.c @@ -64,10 +64,10 @@ */ #ifdef CONFIG_NETDB_HOSTFILE -# undef CONFIG_NET_IPv4 -# undef CONFIG_NET_IPv6 -# define CONFIG_NET_IPv4 1 -# define CONFIG_NET_IPv6 1 +# undef CONFIG_LIBC_IPv4_ADDRCONV +# undef CONFIG_LIBC_IPv6_ADDRCONV +# define CONFIG_LIBC_IPv4_ADDRCONV 1 +# define CONFIG_LIBC_IPv6_ADDRCONV 1 #endif /**************************************************************************** @@ -93,7 +93,7 @@ * ****************************************************************************/ -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV) static int inet_ipv4_pton(FAR const char *src, FAR void *dest) { size_t srcoffset; @@ -203,7 +203,7 @@ static int inet_ipv4_pton(FAR const char *src, FAR void *dest) * ****************************************************************************/ -#ifdef CONFIG_NET_IPv6 +#if defined(CONFIG_NET_IPv6) || defined(CONFIG_LIBC_IPv6_ADDRCONV) static int inet_ipv6_pton(FAR const char *src, FAR void *dest) { size_t srcoffset; @@ -393,12 +393,12 @@ int inet_pton(int af, FAR const char *src, FAR void *dest) switch (af) { -#ifdef CONFIG_NET_IPv4 +#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV) case AF_INET: return inet_ipv4_pton(src, dest); #endif -#ifdef CONFIG_NET_IPv6 +#if defined(CONFIG_NET_IPv6) || defined(CONFIG_LIBC_IPv6_ADDRCONV) case AF_INET6: return inet_ipv6_pton(src, dest); #endif diff --git a/libc/pthread/Make.defs b/libc/pthread/Make.defs index bbb3280959d3866762d2b51608d672e3a1ad09f5..f5eab2b9432e87939cef2de46af299e9de8c189c 100644 --- a/libc/pthread/Make.defs +++ b/libc/pthread/Make.defs @@ -47,6 +47,8 @@ CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c CSRCS += pthread_mutexattr_getpshared.c pthread_mutexattr_setpshared.c CSRCS += pthread_mutexattr_setprotocol.c pthread_mutexattr_getprotocol.c CSRCS += pthread_mutexattr_settype.c pthread_mutexattr_gettype.c +CSRCS += pthread_setcancelstate.c pthread_setcanceltype.c +CSRCS += pthread_testcancel.c ifeq ($(CONFIG_SMP),y) CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c diff --git a/libc/pthread/pthread_mutexattr_setprotocol.c b/libc/pthread/pthread_mutexattr_setprotocol.c index 0d128e0480d95029568ad077ea50d651dd365b9f..44d8be78494d47b992c40cdcbda4270e3268ff52 100644 --- a/libc/pthread/pthread_mutexattr_setprotocol.c +++ b/libc/pthread/pthread_mutexattr_setprotocol.c @@ -86,5 +86,4 @@ int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr, return ENOSYS; #endif - } diff --git a/sched/pthread/pthread_setcancelstate.c b/libc/pthread/pthread_setcancelstate.c similarity index 64% rename from sched/pthread/pthread_setcancelstate.c rename to libc/pthread/pthread_setcancelstate.c index b9aab9a7d122efbda7665adc0e17feb50b3246a9..e81a4440f7a46536c0a29bbff42648e0d9e38bed 100644 --- a/sched/pthread/pthread_setcancelstate.c +++ b/libc/pthread/pthread_setcancelstate.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread/pthread_setcancelstate.c + * libc/pthread/pthread_setcancelstate.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,24 @@ * Included Files ****************************************************************************/ +#include + #include +#include #include -#include "sched/sched.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ +/* These are defined in different header files but must have the same values. */ + +#if PTHREAD_CANCEL_ENABLE != TASK_CANCEL_ENABLE +# error We must have PTHREAD_CANCEL_ENABLE == TASK_CANCEL_ENABLE +#endif + +#if PTHREAD_CANCEL_DISABLE != TASK_CANCEL_DISABLE +# error We must have PTHREAD_CANCEL_DISABLE == TASK_CANCEL_DISABLE +#endif /**************************************************************************** * Public Functions @@ -47,61 +62,31 @@ /**************************************************************************** * Name: pthread_setcancelstate + * + * Description: + * The pthread_setcancelstate() function atomically both sets the calling + * thread's cancelability state to the indicated state and returns the + * previous cancelability state at the location referenced by oldstate. + * Legal values for state are PTHREAD_CANCEL_ENABLE and + * PTHREAD_CANCEL_DISABLE. + * + * The cancelability state and type of any newly created threads, + * including the thread in which main() was first invoked, are + * PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively. + * ****************************************************************************/ int pthread_setcancelstate(int state, FAR int *oldstate) { - FAR struct tcb_s *tcb = this_task(); - int ret = OK; + int ret; - /* Suppress context changes for a bit so that the flags are stable. (the - * flags should not change in interrupt handling). - */ + /* task_setcancelstate() can do this */ - sched_lock(); - - /* Return the current state if so requrested */ - - if (oldstate) - { - if ((tcb->flags & TCB_FLAG_NONCANCELABLE) != 0) - { - *oldstate = PTHREAD_CANCEL_DISABLE; - } - else - { - *oldstate = PTHREAD_CANCEL_ENABLE; - } - } - - /* Set the new cancellation state */ - - if (state == PTHREAD_CANCEL_ENABLE) - { - unsigned flags = tcb->flags; - - /* Clear the non-cancelable and cancel pending flags */ - - tcb->flags &= ~(TCB_FLAG_NONCANCELABLE | TCB_FLAG_CANCEL_PENDING); - - /* If the cancel was pending, then just exit as requested */ - - if (flags & TCB_FLAG_CANCEL_PENDING) - { - pthread_exit(PTHREAD_CANCELED); - } - } - else if (state == PTHREAD_CANCEL_DISABLE) - { - /* Set the non-cancelable state */ - - tcb->flags |= TCB_FLAG_NONCANCELABLE; - } - else + ret = task_setcancelstate(state, oldstate); + if (ret < 0) { - ret = EINVAL; + ret = errno; } - sched_unlock(); return ret; } diff --git a/arch/arm/src/lpc11xx/lpc11_getc.c b/libc/pthread/pthread_setcanceltype.c similarity index 66% rename from arch/arm/src/lpc11xx/lpc11_getc.c rename to libc/pthread/pthread_setcanceltype.c index f809e9d3438b367fb60e0dc699adb74c3f8bbd17..583376dfcc53e3401ab5ebd4290fc4c68c6f1610 100644 --- a/arch/arm/src/lpc11xx/lpc11_getc.c +++ b/libc/pthread/pthread_setcanceltype.c @@ -1,7 +1,7 @@ /**************************************************************************** - * arch/arm/src/lpc11/lpc11_getc.c + * libc/pthread/pthread_setcanceltype.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,26 +37,23 @@ * Included Files ****************************************************************************/ -#include - -#include - -#include "up_arch.h" - -#include "lpc11_getc.h" +#include +#include +#include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* The following are defined in different header files but must have the + * same values. + */ -/* Select UART parameters for the selected console */ +#if PTHREAD_CANCEL_DEFERRED != TASK_CANCEL_DEFERRED +# error We must have PTHREAD_CANCEL_DEFERRED == TASK_CANCEL_DEFERRED +#endif -#if defined(CONFIG_UART0_SERIAL_CONSOLE) -# define CONSOLE_BASE LPC11_UART0_BASE -#elif defined(CONFIG_UART1_SERIAL_CONSOLE) -# define CONSOLE_BASE LPC11_UART1_BASE -#elif defined(CONFIG_UART2_SERIAL_CONSOLE) -# define CONSOLE_BASE LPC11_UART2_BASE +#if PTHREAD_CANCEL_ASYNCHRONOUS != TASK_CANCEL_ASYNCHRONOUS +# error We must have PTHREAD_CANCEL_ASYNCHRONOUS == TASK_CANCEL_ASYNCHRONOUS #endif /**************************************************************************** @@ -64,32 +61,32 @@ ****************************************************************************/ /**************************************************************************** - * Name: up_getc + * Name: pthread_setcancelstate * * Description: - * Input one byte from the serial console. + * The pthread_setcanceltype() function atomically both sets the calling + * thread's cancelability type to the indicated type and returns the + * previous cancelability type at the location referenced by oldtype + * Legal values for type are PTHREAD_CANCEL_DEFERRED and + * PTHREAD_CANCEL_ASYNCHRONOUS. * - * REVIST: If used with the serial driver enabled, then this could - * interfere with the serial driver operations. Serial interrupts should - * be disabled when this function executes in that case. + * The cancelability state and type of any newly created threads, + * including the thread in which main() was first invoked, are + * PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively. * ****************************************************************************/ -int up_getc(void) +int pthread_setcanceltype(int type, FAR int *oldtype) { - uint8_t ch = 0; + int ret; -#if defined HAVE_UART && defined HAVE_SERIAL_CONSOLE - /* Wait while the Receiver Data Ready (RDR) is indicating a "empty" FIFO to - * assure that we have data in the buffer to read. - */ + /* task_setcanceltype() can do this */ - while ((getreg32(CONSOLE_BASE+LPC11_UART_LSR_OFFSET) & UART_LSR_RDR) == 0); - - /* Then read a character from the UART data register */ - - ch = getreg8(CONSOLE_BASE+LPC11_UART_RBR_OFFSET); -#endif + ret = task_setcanceltype(type, oldtype); + if (ret < 0) + { + ret = errno; + } - return (int)ch; + return ret; } diff --git a/arch/arm/src/kl/kl_getc.h b/libc/pthread/pthread_testcancel.c similarity index 68% rename from arch/arm/src/kl/kl_getc.h rename to libc/pthread/pthread_testcancel.c index aff6b2a0b37890ca8efe8725caef0cb82ff08d4a..c5bf14aec426f63810bd48d83c462a029b54f634 100644 --- a/arch/arm/src/kl/kl_getc.h +++ b/libc/pthread/pthread_testcancel.c @@ -1,7 +1,7 @@ -/************************************************************************************ - * arch/arm/src/kl/kl_getc.h +/**************************************************************************** + * libc/pthread/pthread_testcancel.c * - * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,18 +31,32 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_ARM_SRC_KL_KINETIS_GETC_H -#define __ARCH_ARM_SRC_KL_KINETIS_GETC_H - -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ -#include +/**************************************************************************** + * Name: pthread_testcancel + * + * Description: + * The pthread_testcancel() function creates a cancellation point in the + * calling thread. The pthread_testcancel() function has no effect if + * cancelability is disabled + * + ****************************************************************************/ -#include "kl_config.h" -#include "chip/kl_uart.h" +void pthread_testcancel(void) +{ + /* task_testcancel() does the real work */ -#endif /* __ARCH_ARM_SRC_KL_KINETIS_GETC_H */ + task_testcancel(); +} diff --git a/libc/queue/sq_addfirst.c b/libc/queue/sq_addfirst.c index a00841cfaad5429c55ee52c744f3436b6ae9db08..bbc9f26a9c19baedfb6f36ac927f09ff34f648b6 100644 --- a/libc/queue/sq_addfirst.c +++ b/libc/queue/sq_addfirst.c @@ -58,5 +58,6 @@ void sq_addfirst(FAR sq_entry_t *node, sq_queue_t *queue) { queue->tail = node; } + queue->head = node; } diff --git a/libc/queue/sq_remafter.c b/libc/queue/sq_remafter.c index a3527b7908aa1967ca7b90b1533f08e3ccc68524..34685ae96159936b7f4793378a1c05f9829c866d 100644 --- a/libc/queue/sq_remafter.c +++ b/libc/queue/sq_remafter.c @@ -44,10 +44,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: + * Name: sq_remafter * * Description: - * sq_remafter removes the entry following 'node; from the'queue' Returns + * sq_remafter removes the entry following 'node' from the'queue' Returns * a reference to the removed entry. * ****************************************************************************/ @@ -55,6 +55,7 @@ FAR sq_entry_t *sq_remafter(FAR sq_entry_t *node, sq_queue_t *queue) { FAR sq_entry_t *ret = node->flink; + if (queue->head && ret) { if (queue->tail == ret) diff --git a/libc/sched/Make.defs b/libc/sched/Make.defs index eeb4be1c1bb834acea697f32782d02546cf2644b..5d875d3eac69ae7996150994dce4080c0d8cdf87 100644 --- a/libc/sched/Make.defs +++ b/libc/sched/Make.defs @@ -37,6 +37,10 @@ CSRCS += sched_getprioritymax.c sched_getprioritymin.c +ifneq ($(CONFIG_CANCELLATION_POINTS),y) +CSRCS += task_setcanceltype.c task_testcancel.c +endif + ifeq ($(CONFIG_SMP),y) CSRCS += sched_cpucount.c endif diff --git a/libc/sched/task_setcanceltype.c b/libc/sched/task_setcanceltype.c new file mode 100644 index 0000000000000000000000000000000000000000..d43f5d9d30c83d930f439c577de6bf629f69b7ad --- /dev/null +++ b/libc/sched/task_setcanceltype.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * libc/sched/task_setcanceltype.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: task_setcancelstate + * + * Description: + * The task_setcanceltype() function atomically both sets the calling + * task's cancelability type to the indicated type and returns the + * previous cancelability type at the location referenced by oldtype + * Legal values for type are TASK_CANCEL_DEFERRED and + * TASK_CANCEL_ASYNCHRONOUS. + * + * The cancelability state and type of any newly created tasks are + * TASK_CANCEL_ENABLE and TASK_CANCEL_DEFERRED respectively. + * + ****************************************************************************/ + +int task_setcanceltype(int type, FAR int *oldtype) +{ + /* Return the current type if so requrested */ + + if (oldtype != NULL) + { + *oldtype = TASK_CANCEL_ASYNCHRONOUS; + } + + /* Check the requested cancellation type */ + + return (type == TASK_CANCEL_ASYNCHRONOUS) ? OK : ENOSYS; +} diff --git a/arch/arm/include/calypso/armio.h b/libc/sched/task_testcancel.c similarity index 76% rename from arch/arm/include/calypso/armio.h rename to libc/sched/task_testcancel.c index 2f232beb22ade32761d28aed29498ff5ec51ac55..0d99dbebbc2f3b1cc26ca238aa5278c123f7302c 100644 --- a/arch/arm/include/calypso/armio.h +++ b/libc/sched/task_testcancel.c @@ -1,8 +1,8 @@ /**************************************************************************** - * Driver for Calypso ARMIO + * libc/sched/task_testcancel.c * - * Copyright (C) 2011 Stefan Richter. All rights reserved. - * Author: Stefan Richter + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,17 +33,26 @@ * ****************************************************************************/ -#include -#include - /**************************************************************************** - * Prototypes for interrupt handling + * Included Files ****************************************************************************/ -inline int calypso_kbd_irq(int irq, uint32_t *regs); +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ /**************************************************************************** - * Initialize device, add /dev/... nodes + * Name: task_testcancel + * + * Description: + * The task_testcancel() function creates a cancellation point in the + * calling thread. The task_testcancel() function has no effect if + * cancelability is disabled + * ****************************************************************************/ -void calypso_armio(void); +void task_testcancel(void) +{ +} diff --git a/libc/stdio/Make.defs b/libc/stdio/Make.defs index f308266d65627a81d639eaa4a5758212969abe03..f6220671c9de3f2e0907eee954f05f822b09edd6 100644 --- a/libc/stdio/Make.defs +++ b/libc/stdio/Make.defs @@ -41,7 +41,7 @@ CSRCS += lib_fileno.c lib_printf.c lib_sprintf.c lib_asprintf.c CSRCS += lib_snprintf.c lib_libsprintf.c lib_vsprintf.c lib_vasprintf.c CSRCS += lib_vsnprintf.c lib_libvsprintf.c lib_dprintf.c lib_vdprintf.c CSRCS += lib_meminstream.c lib_memoutstream.c lib_memsistream.c -CSRCS += lib_memsostream.c lib_lowinstream.c lib_lowoutstream.c +CSRCS += lib_memsostream.c lib_lowoutstream.c CSRCS += lib_zeroinstream.c lib_nullinstream.c lib_nulloutstream.c CSRCS += lib_sscanf.c diff --git a/libc/stdio/lib_dtoa.c b/libc/stdio/lib_dtoa.c index 8ddc3bfd3540843f6e046bb443d046a04de98ce9..1e85bc3e0f6e0d1adc2244dd1dd81c1cceab6c5c 100644 --- a/libc/stdio/lib_dtoa.c +++ b/libc/stdio/lib_dtoa.c @@ -591,6 +591,7 @@ static int cmp(Bigint * a, Bigint * b) break; } } + return 0; } @@ -784,6 +785,7 @@ static Bigint *d2b(double d, int *e, int *bits) } while (!x[i]) --i; + b->wds = i + 1; #endif if (de) @@ -849,12 +851,14 @@ static int quorem(Bigint * b, Bigint * S) #endif n = S->wds; + #ifdef CONFIG_DEBUG_LIB if (b->wds > n) { lerr("ERROR: oversize b in quorem\n"); } #endif + if (b->wds < n) { return 0; @@ -865,17 +869,19 @@ static int quorem(Bigint * b, Bigint * S) bx = b->x; bxe = bx + n; q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ + #ifdef CONFIG_DEBUG_LIB if (q > 9) - { - lerr("ERROR: oversized quotient in quorem\n"); - } + { + lerr("ERROR: oversized quotient in quorem\n"); + } #endif if (q) { borrow = 0; carry = 0; + do { #ifdef Pack_32 @@ -912,6 +918,7 @@ static int quorem(Bigint * b, Bigint * S) b->wds = n; } } + if (cmp(b, S) >= 0) { q++; @@ -919,6 +926,7 @@ static int quorem(Bigint * b, Bigint * S) carry = 0; bx = b->x; sx = S->x; + do { #ifdef Pack_32 @@ -943,12 +951,14 @@ static int quorem(Bigint * b, Bigint * S) #endif } while (sx <= sxe); + bx = b->x; bxe = bx + n; if (!*bxe) { while (--bxe > bx && !*bxe) --n; + b->wds = n; } } @@ -1041,7 +1051,8 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) if (word0(d) & Sign_bit) { - /* set sign for everything, including 0's and NaNs */ + /* Set sign for everything, including 0's and NaNs */ + *sign = 1; word0(d) &= ~Sign_bit; /* clear sign bit */ } @@ -1058,6 +1069,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) #endif { /* Infinity or NaN */ + *decpt = 9999; s = #ifdef IEEE_Arith @@ -1076,6 +1088,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) return s; } #endif + if (!d) { *decpt = 1; @@ -1203,6 +1216,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) case 3: leftright = 0; /* no break */ + case 5: i = ndigits + k + 1; ilim = i; @@ -1241,7 +1255,8 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) if (j & Bletch) { - /* prevent overflows */ + /* Prevent overflows */ + j &= Bletch - 1; d /= bigtens[n_bigtens - 1]; ieps++; @@ -1292,8 +1307,10 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) d -= 5.; if (d > eps) goto one_digit; + if (d < -eps) goto no_digits; + goto fast_failed; } @@ -1357,6 +1374,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) #ifndef No_leftright } #endif + fast_failed: s = s0; d = d2; @@ -1386,8 +1404,10 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) { L = (int)(d / ds); d -= L * ds; + #ifdef Check_FLT_ROUNDS /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (d < 0) { L--; @@ -1411,6 +1431,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) ++*s++; } + break; } @@ -1500,6 +1521,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) if (!word1(d) && !(word0(d) & Bndry_mask) && word0(d) & Exp_mask) { /* The special case */ + b2 += Log2P; s2 += Log2P; spec_case = 1; diff --git a/libc/stdio/lib_libdtoa.c b/libc/stdio/lib_libdtoa.c index a3ef37d2209e2ec5c934994cd00e673543402060..072ad45120e8e315a59c252bbd5e9123754b7581 100644 --- a/libc/stdio/lib_libdtoa.c +++ b/libc/stdio/lib_libdtoa.c @@ -44,7 +44,12 @@ * Included Files ****************************************************************************/ +#include + #include +#include + +#include #include "libc.h" @@ -157,6 +162,15 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec, int dsgn; /* Unused sign indicator */ int i; + /* This function may *NOT* be called within interrupt level logic. That is + * because the logic in __dtoa may attempt to allocate memory. That will + * lead to cryptic failures down the road within the memory manager. + * Better to explicitly assert upstream here. Rule: Don't use floating + * point formats on any output from interrupt handling logic. + */ + + DEBUGASSERT(up_interrupt_context() == false); + /* Special handling for NaN and Infinity */ if (isnan(value)) diff --git a/libc/stdio/lib_sscanf.c b/libc/stdio/lib_sscanf.c index 0bc413295b0cdd0e647ae3bf2a867a63a3bae0c9..b5fd60f4de8458f839a4be5b41e08fe4af8940c1 100644 --- a/libc/stdio/lib_sscanf.c +++ b/libc/stdio/lib_sscanf.c @@ -90,6 +90,7 @@ static const char spaces[] = " \t\n\r\f\v"; static int findwidth(FAR const char *buf, FAR const char *fmt) { +#if 0 /* Behavior no longer supported */ FAR const char *next = fmt + 1; /* No... is there a space after the format? Or does the format string end @@ -114,7 +115,7 @@ static int findwidth(FAR const char *buf, FAR const char *fmt) */ FAR const char *ptr = strchr(buf, *next); - if (ptr) + if (ptr != NULL) { return (int)(ptr - buf); } @@ -130,10 +131,165 @@ static int findwidth(FAR const char *buf, FAR const char *fmt) * determining the width of the data if there is no fieldwidth, no space * separating the input, and no usable delimiter character. */ +#endif + + /* Use the input up until the first white space is encountered. */ return strcspn(buf, spaces); } +/**************************************************************************** + * Function: findscanset + * + * Description: + * Fill in the given table from the scanset at the given format. + * Return a pointer to the character the closing ']'. + * The table has a 1 wherever characters should be considered part of the + * scanset. + * + * Function findscanset based on source function __sccl of FreeBSD + * (https://github.com/lattera/freebsd/blob/master/sys/kern/subr_scanf.c) + * + ****************************************************************************/ + +#ifdef CONFIG_LIBC_SCANSET +static FAR const char *findscanset(FAR const char *fmt, + FAR unsigned char set[32]) +{ + int c; + int n; + int v; + int i; + + fmt++; /* Skip '[' */ + + /* First `clear' the whole table */ + + c = *fmt++; /* First char hat => negated scanset */ + if (c == '^') + { + v = 1; /* Default => accept */ + c = *fmt++; /* Get new first char */ + } + else + { + v = 0; /* Default => reject */ + } + + memset(set, 0, 32); + if (c == 0) + { + goto doexit; + } + + /* Now set the entries corresponding to the actual scanset + * to the opposite of the above. + * + * The first character may be ']' (or '-') without being special; + * the last character may be '-'. + */ + + for (;;) + { + set[c / 8] |= (1 << (c % 8)); /* Take character c */ + +doswitch: + n = *fmt++; /* Examine the next */ + switch (n) + { + case 0: /* Format ended too soon */ + case ']': /* End of scanset */ + goto doexit; + + case '-': + /* A scanset of the form + * + * [01+-] + * + * is defined as "the digit 0, the digit 1, the character +, the + * character -", but the effect of a scanset such as + * + * [a-zA-Z0-9] + * + * is implementation defined. The V7 Unix scanf treats "a-z" as + * "the letters a through z", but treats "a-a" as "the letter a, + * the character -, and the letter a". + * + * For compatibility, the `-' is not considerd to define a range + * if the character following it is either a close bracket + * (required by ANSI) or is not numerically greater than the + * character* we just stored in the table (c). + */ + + n = *fmt; + if (n == ']' || n < c) + { + c = '-'; + break; /* Resume the for(;;) */ + } + + fmt++; + do + { + /* Fill in the range */ + + c++; + set[c / 8] |= (1 << (c % 8)); /* Take character c */ + } + while (c < n); + + /* Alas, the V7 Unix scanf also treats formats such as [a-c-e] as + * "the letters a through e". This too is permitted by the + * standard. + */ + + goto doswitch; + + default: /* Just another character */ + c = n; + break; + } + } + +doexit: + if (v) /* Default => accept */ + { + for (i = 0; i < 32; i++) /* Invert all */ + { + set[i] ^= 0xFF; + } + } + + return (fmt - 1); +} +#endif + +/**************************************************************************** + * Function: scansetwidth + ****************************************************************************/ + +#ifdef CONFIG_LIBC_SCANSET +static int scansetwidth(FAR const char *buf, + FAR const unsigned char set[32]) +{ + FAR const char *next = buf; + int c; + + while (*next) + { + c = *next; + if ((set[c / 8] & (1 << (c % 8))) == 0) + { + break; + } + + next++; + } + + return (next - buf); +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -177,6 +333,9 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) int fwidth; int base = 10; char tmp[MAXLN]; +#ifdef CONFIG_LIBC_SCANSET + unsigned char set[32]; /* Bit field (256 / 8) */ +#endif linfo("vsscanf: buf=\"%s\" fmt=\"%s\"\n", buf, fmt); @@ -220,7 +379,11 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) { linfo("vsscanf: Processing %c\n", *fmt); +#ifdef CONFIG_LIBC_SCANSET + if (strchr("dibouxcsefgn[%", *fmt)) +#else if (strchr("dibouxcsefgn%", *fmt)) +#endif { break; } @@ -307,6 +470,72 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) } } +#ifdef CONFIG_LIBC_SCANSET + /* Process %[: Scanset conversion */ + + if (*fmt == '[') + { + linfo("vsscanf: Performing scanset conversion\n"); + + fmt = findscanset(fmt, set); /* find scanset */ + + /* Get a pointer to the char * value. We need to do this even + * if we have reached the end of the input data in order to + * update the 'ap' variable. + */ + + tv = NULL; /* To avoid warnings about begin uninitialized */ + if (!noassign) + { + tv = va_arg(ap, FAR char *); + tv[0] = '\0'; + } + + /* But we only perform the data conversion is we still have + * bytes remaining in the input data stream. + */ + + if (*buf) + { + /* Skip over white space */ + + while (isspace(*buf)) + { + buf++; + } + + /* Guess a field width using some heuristics */ + + fwidth = scansetwidth(buf, set); + + /* Use the actual field's width if 1) no fieldwidth + * specified or 2) the actual field's width is smaller + * than fieldwidth specified + */ + + if (!width || fwidth < width) + { + width = fwidth; + } + + width = MIN(sizeof(tmp) - 1, width); + + /* Copy the string (if we are making an assignment) */ + + if (!noassign) + { + strncpy(tv, buf, width); + tv[width] = '\0'; + count++; + } + + /* Update the buffer pointer past the string in the input */ + + buf += width; + } + } +#endif + /* Process %c: Character conversion */ else if (*fmt == 'c') diff --git a/libc/unistd/lib_usleep.c b/libc/unistd/lib_usleep.c index 5b72bbdcdf7df6ec0dc5f7aeef824710695a23fd..4e3d4cdb0c4b44b9e97e7b1574585d0bb80738a5 100644 --- a/libc/unistd/lib_usleep.c +++ b/libc/unistd/lib_usleep.c @@ -43,26 +43,6 @@ #include #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/Makefile b/libnx/Makefile index 295d64e85d55cf4c50d998100a09cc91c3bdfc5c..af0da579f4271509d685f5fef996574384c1ed22 100644 --- a/libnx/Makefile +++ b/libnx/Makefile @@ -225,6 +225,10 @@ ifeq ($(CONFIG_NXFONT_X11_MISC_FIXED_10X20),y) $(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=42 EXTRADEFINES=$(EXTRADEFINES) endif +ifeq ($(CONFIG_NXFONT_TOM_THUMB_4X6),y) + $(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=43 EXTRADEFINES=$(EXTRADEFINES) +endif + gensources: gen1bppsources gen2bppsource gen4bppsource gen8bppsource gen16bppsource gen24bppsource gen32bppsources genfontsources $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S diff --git a/libnx/nxfonts/Make.defs b/libnx/nxfonts/Make.defs index cc3bb80f811791305b1177087a84f89a135b1132..fee5f77baa554a2f1dc751cc5ddb08cb77a90832 100644 --- a/libnx/nxfonts/Make.defs +++ b/libnx/nxfonts/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # libnx/nxfonts/Make.defs # -# Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ ifeq ($(CONFIG_NX),y) -CSRCS += nxfonts_getfont.c +CSRCS += nxfonts_getfont.c nxfonts_cache.c CSRCS += nxfonts_convert_1bpp.c nxfonts_convert_2bpp.c CSRCS += nxfonts_convert_4bpp.c nxfonts_convert_8bpp.c CSRCS += nxfonts_convert_16bpp.c nxfonts_convert_24bpp.c @@ -225,7 +225,11 @@ ifeq ($(CONFIG_NXFONT_X11_MISC_FIXED_10X20),y) CSRCS += nxfonts_bitmaps_x11-misc-fixed-10x20.c endif +# Tom Thumb mono-space 4x6 font +ifeq ($(CONFIG_NXFONT_TOM_THUMB_4X6),y) +CSRCS += nxfonts_tom-thumb-4x6.c +endif # Add the nxfont/ directory to the build diff --git a/libnx/nxfonts/Makefile.sources b/libnx/nxfonts/Makefile.sources index 7df446bda05b369a680dacefa243f739a50f020c..5c079cddcc1346b9f28d3e5ade469b62f430b46d 100644 --- a/libnx/nxfonts/Makefile.sources +++ b/libnx/nxfonts/Makefile.sources @@ -1,7 +1,7 @@ ############################################################################ # libnx/nxfonts/Makefile.sources # -# Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -296,6 +296,12 @@ NXFONTS_PREFIX := g_x11_misc_fixed_10x20_ GEN_CSRC = nxfonts_bitmaps_x11-misc-fixed-10x20.c endif +# Tom Thumb mono-space 4x6 font + +ifeq ($(NXFONTS_FONTID),43) +NXFONTS_PREFIX := g_tom_thumb_4x6_ +GEN_CSRC = nxfonts_tom-thumb-4x6.c +endif DEPENDENCY := nxfonts_bitmaps.c CPPFLAGS += -DNXFONTS_FONTID=$(NXFONTS_FONTID) diff --git a/libnx/nxfonts/nxfonts.h b/libnx/nxfonts/nxfonts.h index 1e3fa18bb3f89e36036ebf498dc33c4b49fda47f..1d8a348903eeaf08c5ea71f88dff6dbe7c8ac216 100644 --- a/libnx/nxfonts/nxfonts.h +++ b/libnx/nxfonts/nxfonts.h @@ -54,10 +54,6 @@ # define CONFIG_NXFONTS_CHARBITS 7 #endif -/**************************************************************************** - * Public Types - ****************************************************************************/ - /**************************************************************************** * Public Data ****************************************************************************/ @@ -65,7 +61,8 @@ #undef EXTERN #if defined(__cplusplus) # define EXTERN extern "C" -extern "C" { +extern "C" +{ #else # define EXTERN extern #endif diff --git a/libnx/nxfonts/nxfonts_bitmaps.c b/libnx/nxfonts/nxfonts_bitmaps.c index 28e6aa18dcc3395c04da52118a1d9bf8b0e91e09..b9a6fc1ca42e045bd24aca08978557a79d5b2fa3 100644 --- a/libnx/nxfonts/nxfonts_bitmaps.c +++ b/libnx/nxfonts/nxfonts_bitmaps.c @@ -130,6 +130,8 @@ # include "nxfonts_x11-misc-fixed-9x18B.h" #elif NXFONTS_FONTID == 42 # include "nxfonts_x11-misc-fixed-10x20.h" +#elif NXFONTS_FONTID == 43 +# include "nxfonts_tom-thumb-4x6.h" #else # error "No font ID specified" #endif diff --git a/libnx/nxfonts/nxfonts_cache.c b/libnx/nxfonts/nxfonts_cache.c new file mode 100644 index 0000000000000000000000000000000000000000..9d45827826a16d0164d77446dd14fe5aed651a91 --- /dev/null +++ b/libnx/nxfonts/nxfonts_cache.c @@ -0,0 +1,935 @@ +/**************************************************************************** + * libnx/nxfonts/nxfonts_cache.c + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include +#include + +#include + +#include "nxcontext.h" + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This describes a rendering function */ + +typedef CODE int (*nxf_renderer_t)(FAR nxgl_mxpixel_t *dest, uint16_t height, + uint16_t width, uint16_t stride, + FAR const struct nx_fontbitmap_s *bm, + nxgl_mxpixel_t color); + +/* This structure defines one font cache */ + +struct nxfonts_fcache_s +{ + FAR struct nxfonts_fcache_s *flink; /* Supports a singly linked list */ + NXHANDLE font; /* Font handle associated with fontid */ + sem_t fsem; /* Serializes access to the font cache */ + uint16_t fontid; /* ID of font in this cache */ + int16_t fclients; /* Number of connected clients */ + uint8_t maxglyphs; /* Maximum size of glyph[] array */ + uint8_t nglyphs; /* Current size of glyph[] array */ + uint8_t bpp; /* Bits per pixel */ + nxgl_mxpixel_t fgcolor; /* Foreground color */ + nxgl_mxpixel_t bgcolor; /* Background color */ + nxf_renderer_t renderer; /* Font renderer */ + + /* Glyph cache data storage */ + + FAR struct nxfonts_glyph_s *head; /* Head of the list of glyphs */ + FAR struct nxfonts_glyph_s *tail; /* Tail of the list of glyphs */ +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Head of a list of font caches */ + +static FAR struct nxfonts_fcache_s *g_fcaches; +static sem_t g_cachesem = SEM_INITIALIZER(1); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nxf_list_lock and nxf_list_unlock + * + * Description: + * Get/relinquish exclusive access to the font cache list + * + ****************************************************************************/ + +static void nxf_list_lock(void) +{ + int ret; + + /* Get exclusive access to the font cache */ + + while ((ret = sem_wait(&g_cachesem)) < 0) + { + int errorcode = errno; + DEBUGASSERT(errorcode == EINTR || errorcode == ECANCELED); + UNUSED(errorcode); + } +} + +#define nxf_list_unlock() (sem_post(&g_cachesem)) + +/**************************************************************************** + * Name: nxf_removecache + * + * Description: + * Removes the entry 'glyph' from the font cache. + * + * Assumptions: + * The caller holds the font cache list semaphore. + * + ****************************************************************************/ + +static inline void nxf_removecache(FAR struct nxfonts_fcache_s *fcache, + FAR struct nxfonts_fcache_s *prev) +{ + /* Remove the cache for the list. First check for removal from the head */ + + if (prev == NULL) + { + /* Replace the head with the node following glyph */ + + g_fcaches = fcache->flink; + } + + /* No.. Remove from the head or from mid-list */ + + else + { + prev->flink = fcache->flink; + } + + fcache->flink = NULL; +} + +/**************************************************************************** + * Name: nxf_cache_lock and nxf_cache_unlock + * + * Description: + * Get/relinquish exclusive access to the font cache + * + ****************************************************************************/ + +static void nxf_cache_lock(FAR struct nxfonts_fcache_s *priv) +{ + int ret; + + /* Get exclusive access to the font cache */ + + while ((ret = sem_wait(&priv->fsem)) < 0) + { + int errorcode = errno; + DEBUGASSERT(errorcode == EINTR || errorcode == ECANCELED); + UNUSED(errorcode); + } +} + +#define nxf_cache_unlock(p) (sem_post(&priv->fsem)) + +/**************************************************************************** + * Name: nxf_removeglyph + * + * Description: + * Removes the entry 'glyph' from the font cache. + * + ****************************************************************************/ + +static inline void nxf_removeglyph(FAR struct nxfonts_fcache_s *priv, + FAR struct nxfonts_glyph_s *glyph, + FAR struct nxfonts_glyph_s *prev) +{ + ginfo("fcache=%p glyph=%p\n", priv, glyph); + + /* Remove the glyph for the list. First check for removal from the head + * (which, I think, never actually happens). + */ + + if (prev == NULL) + { + /* Replace the head with the node following glyph */ + + priv->head = glyph->flink; + + /* If there is no node following glyph, then the list is empty */ + + if (priv->head == NULL) + { + priv->tail = NULL; + } + } + + /* Check for removal from the tail (we know that the list cannot become + * empty in either of the next two cases). + */ + + else if (glyph->flink == NULL) + { + priv->tail = prev; + prev->flink = NULL; + } + + /* No.. Remove from mid-list */ + + else + { + prev->flink = glyph->flink; + } + + glyph->flink = NULL; + + /* Decrement the count of glyphs in the font cache */ + + DEBUGASSERT(priv->nglyphs > 0); + priv->nglyphs--; +} + +/**************************************************************************** + * Name: nxf_addglyph + * + * Description: + * Add the entry 'glyph' to the head font cache list. + * + ****************************************************************************/ + +static inline void nxf_addglyph(FAR struct nxfonts_fcache_s *priv, + FAR struct nxfonts_glyph_s *glyph) +{ + ginfo("fcache=%p glyph=%p\n", priv, glyph); + + /* Add the glyph to the head of the list */ + + glyph->flink = priv->head; + + if (priv->head == NULL) + { + priv->tail = glyph; + } + + priv->head = glyph; + + /* Increment the count of glyphs in the font cache. */ + + DEBUGASSERT(priv->nglyphs < priv->maxglyphs); + priv->nglyphs++; +} + +/**************************************************************************** + * Name: nxf_findglyph + * + * Description: + * Find the glyph for the specific character 'ch' in the list of pre- + * rendered fonts in the font cache. + * + * This is logically a part of nxf_cache_getglyph(). nxf_cache_getglyph() + * will attempt to find the cached glyph before rendering a new one. So + * this function has two unexpected side-effects: (1) If the font cache + * is full and the font is not found, then the least-recently-used glyph + * is deleted to make space for the new glyph that will be allocated. + * + * (2) If the glyph is found, then it is moved to the head of the list of + * glyphs since it is now the most recently used (leaving the least + * recently used glyph at the tail of the list). + * + * Assumptions: + * The caller has exclusive access to the font cache. + * + ****************************************************************************/ + +static FAR struct nxfonts_glyph_s * +nxf_findglyph(FAR struct nxfonts_fcache_s *priv, uint8_t ch) +{ + FAR struct nxfonts_glyph_s *glyph; + FAR struct nxfonts_glyph_s *prev; + + ginfo("fcache=%p ch=%c (%02x)\n", + priv, (ch >= 32 && ch < 128) ? ch : '.', ch); + + /* Try to find the glyph in the list of pre-rendered glyphs */ + + for (prev = NULL, glyph = priv->head; + glyph != NULL; + prev = glyph, glyph = glyph->flink) + { + /* Check if we found the the glyph for this character */ + + if (glyph->code == ch) + { + /* This is now the most recently used glyph. Move it to the head + * of the list (if it is not already at the head of the list). + */ + + if (prev != NULL) + { + nxf_removeglyph(priv, glyph, prev); + nxf_addglyph(priv, glyph); + } + + /* And return the glyph that we found */ + + return glyph; + } + + /* Is this the last glyph in the list? Has the cache reached its + * limit for the number of cached fonts? + */ + + if (glyph->flink == NULL && priv->nglyphs >= priv->maxglyphs) + { + /* Yes.. then remove it from the list and free the glyph memory. + * We do this because we have all of the information in hand now + * and we will surely need to have this space later. + */ + + nxf_removeglyph(priv, glyph, prev); + return NULL; + } + } + + return NULL; +} + +/**************************************************************************** + * Name: nxf_fillglyph + * + * Description: + * Fill the glyph memory with the background color + * + ****************************************************************************/ + +static inline void nxf_fillglyph(FAR struct nxfonts_fcache_s *priv, + FAR struct nxfonts_glyph_s *glyph) +{ + int row; + int col; + + /* Initialize the glyph memory to the background color. */ + +#if !defined(CONFIG_NX_DISABLE_1BPP) || !defined(CONFIG_NX_DISABLE_2BPP) || \ + !defined(CONFIG_NX_DISABLE_4BPP) || !defined(CONFIG_NX_DISABLE_8BPP) + + /* For pixel depths of 1, 2, 4, and 8, build up an 8-bit value containing + * multiple background colored pixels. + */ + + if (priv->bpp <= 8) + { + uint8_t pixel = (uint8_t)priv->bgcolor; + FAR uint8_t *ptr; + +#ifndef CONFIG_NX_DISABLE_1BPP + /* Pack a 1-bit pixel to 2 pixels */ + + if (priv->bpp < 2) + { + /* Pack 1-bit pixels into a 2-bits */ + + pixel &= 0x01; + pixel = (pixel) << 1 | pixel; + } +#endif + +#if !defined(CONFIG_NX_DISABLE_1BPP) || !defined(CONFIG_NX_DISABLE_2BPP) + /* Pack a 2-bit pixel to a 4-bit nibble */ + + if (priv->bpp < 4) + { + /* Pack 2-bit pixels into a nibble */ + + pixel &= 0x03; + pixel = (pixel) << 2 | pixel; + } +#endif + +#if !defined(CONFIG_NX_DISABLE_1BPP) || !defined(CONFIG_NX_DISABLE_2BPP) || \ + !defined(CONFIG_NX_DISABLE_4BPP) + /* Pack the 4-bit nibble into a byte */ + + if (priv->bpp < 8) + { + pixel &= 0x0f; + pixel = (pixel) << 4 | pixel; + } +#endif + + /* Then fill the glyph with the packed background color */ + + ptr = (FAR uint8_t *)glyph->bitmap; + for (row = 0; row < glyph->height; row++) + { + for (col = 0; col < glyph->stride; col++) + { + /* Transfer the packed bytes into the buffer */ + + *ptr++ = pixel; + } + } + } + else +#endif + +#if !defined(CONFIG_NX_DISABLE_16BPP) + if (priv->bpp == 16) + { + FAR uint16_t *ptr = (FAR uint16_t *)glyph->bitmap; + + for (row = 0; row < glyph->height; row++) + { + /* Just copy the color value into the glyph memory */ + + for (col = 0; col < glyph->width; col++) + { + *ptr++ = priv->bgcolor; + } + } + } + else +#endif + +#ifndef CONFIG_NX_DISABLE_24BPP + if (priv->bpp == 24) + { + FAR uint32_t *ptr = (FAR uint32_t *)glyph->bitmap; + FAR uint32_t pixel[3]; + + /* Get two 32-bit values for alternating 32 representations */ + + pixel[0] = (uint32_t)priv->bgcolor << 8 | (uint32_t)priv->bgcolor >> 16; + pixel[1] = (uint32_t)priv->bgcolor << 16 | (uint32_t)priv->bgcolor >> 8; + pixel[1] = (uint32_t)priv->bgcolor << 24 | (uint32_t)priv->bgcolor; + + for (row = 0; row < glyph->height; row++) + { + /* Copy the color value into the glyph memory */ + + col = 0; + for (; ; ) + { + *ptr++ = pixel[0]; + if (++col >= glyph->width) + { + break; + } + + *ptr++ = pixel[1]; + if (++col >= glyph->width) + { + break; + } + + *ptr++ = pixel[2]; + if (++col >= glyph->width) + { + break; + } + } + } + } + else +#endif + +#if !defined(CONFIG_NX_DISABLE_32BPP) + if (priv->bpp == 32) + { + FAR uint32_t *ptr = (FAR uint32_t *)glyph->bitmap; + + for (row = 0; row < glyph->height; row++) + { + /* Just copy the color value into the glyph memory */ + + for (col = 0; col < glyph->width; col++) + { + *ptr++ = priv->bgcolor; + } + } + } + else +#endif + { + PANIC(); + } +} + +/**************************************************************************** + * Name: nxf_renderglyph + * + * Description: + * Allocate memory for a new glyph and render the bitmap font into the + * allocated glyph memory. + * + * Assumptions: + * The caller holds the font cache semaphore. + * + ****************************************************************************/ + +static inline FAR struct nxfonts_glyph_s * +nxf_renderglyph(FAR struct nxfonts_fcache_s *priv, + FAR const struct nx_fontbitmap_s *fbm, uint8_t ch) +{ + FAR struct nxfonts_glyph_s *glyph = NULL; + size_t bmsize; + unsigned int height; + unsigned int width; + unsigned int stride; + int ret; + + ginfo("fcache=%p fbm=%p ch=%c (%02x)\n", + priv, fbm, (ch >= 32 && ch < 128) ? ch : '.', ch); + + /* Get the size of the glyph */ + + width = fbm->metric.width + fbm->metric.xoffset; + height = fbm->metric.height + fbm->metric.yoffset; + + /* Get the physical width of the glyph in bytes */ + + stride = (width * priv->bpp + 7) >> 3; + + /* Allocate the glyph (always succeeds) */ + + bmsize = stride * height; + glyph = (FAR struct nxfonts_glyph_s *)lib_malloc(SIZEOF_NXFONTS_GLYPH_S(bmsize)); + + if (glyph != NULL) + { + /* Save the character code, dimensions, and physcial width of the glyph */ + + glyph->code = ch; + glyph->width = width; + glyph->height = height; + glyph->stride = stride; + + /* Initialize the glyph memory to the background color. */ + + nxf_fillglyph(priv, glyph); + + /* Then render the glyph into the allocated, initialized memory */ + + ret = priv->renderer((FAR nxgl_mxpixel_t *)glyph->bitmap, + glyph->height, glyph->width, glyph->stride, + fbm, priv->fgcolor); + if (ret < 0) + { + /* Actually, the renderer never returns a failure */ + + gerr("ERROR: nxf_renderglyph: Renderer failed\n"); + lib_free(glyph); + return NULL; + } + + /* Add the new glyph to the font cache */ + + nxf_addglyph(priv, glyph); + } + + return glyph; +} + +/**************************************************************************** + * Name: nxf_findcache + * + * Description: + * Find a font cache tht matches the font charcteristics. + * + * Assumptions: + * The caller holds the font cache list semaphore. + * + ****************************************************************************/ + +static FAR struct nxfonts_fcache_s * +nxf_findcache(enum nx_fontid_e fontid, nxgl_mxpixel_t fgcolor, + nxgl_mxpixel_t bgcolor, int bpp) +{ + FAR struct nxfonts_fcache_s *fcache; + + ginfo("fontid=%p fgcolor=%u bgcolor=%u bpp=%d\n", + fontid, fgcolor, bgcolor, bpp); + + /* Search for a cache for this font characteristics */ + + for (fcache = g_fcaches; fcache != NULL; fcache = fcache->flink) + { + /* Does this font have the same characteristics? */ + + if (fcache->fontid == fontid && + fcache->fgcolor == fgcolor && + fcache->bgcolor == bgcolor && + fcache->bpp == bpp) + { + /* Yes... return it */ + + ginfo("Returning fcache=%p\n", fcache); + return fcache; + } + } + + ginfo("Not found\n"); + return NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nxf_cache_connect + * + * Description: + * Create a new font cache for the provided 'fontid'. If the cache + * already, then just increment a reference count return the handle for + * the existing font cache. + * + * Input Parameters: + * fontid - Identifies the font supported by this cache + * fgcolor - Foreground color + * bgcolor - Background color + * bpp - Bits per pixel + * maxglyphs - Maximum number of glyphs permitted in the cache + * + * Returned value: + * On success a non-NULL handle is returned that then may sequently be + * used with nxf_getglyph() to extract fonts from the font cache. NULL + * returned on any failure with the errno value set to indicate the nature + * of the error. + * + ****************************************************************************/ + +FCACHE nxf_cache_connect(enum nx_fontid_e fontid, + nxgl_mxpixel_t fgcolor, nxgl_mxpixel_t bgcolor, + int bpp, int maxglyphs) +{ + FAR struct nxfonts_fcache_s *priv; + int errcode; + + ginfo("fontid=%p fgcolor=%u bgcolor=%u bpp=%d maxglyphs=%d\n", + fontid, fgcolor, bgcolor, bpp, maxglyphs); + + /* Get exclusive access to the font cache list */ + + nxf_list_lock(); + + /* Find a font cache with the matching font characteristics */ + + priv = nxf_findcache(fontid, fgcolor, bgcolor, bpp); + if (priv == NULL) + { + /* There isn't one... we will have to create a new font cache for this + * client. + */ + + /* Allocate memory for the (empty) font cache */ + + priv = (FAR struct nxfonts_fcache_s *) + lib_zalloc(sizeof( struct nxfonts_fcache_s)); + + if (priv == NULL) + { + errcode = ENOMEM; + goto errout_with_lock; + } + + /* Initialize the font cache */ + + priv->fontid = fontid; + priv->fclients = 1; + priv->maxglyphs = maxglyphs; + priv->bpp = bpp; + priv->fgcolor = fgcolor; + priv->bgcolor = bgcolor; + + /* Select the rendering function */ + + /* Select renderer -- Some additional logic would be required to + * support pixel depths that are not directly addressable (1,2,4, and + * 24). + */ + + switch (bpp) + { +#ifndef CONFIG_NX_DISABLE_1BPP + case 1: + priv->renderer = (nxf_renderer_t)nxf_convert_1bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_2BPP + case 2: + priv->renderer = (nxf_renderer_t)nxf_convert_2bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_4BPP + case 4: + priv->renderer = (nxf_renderer_t)nxf_convert_4bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_8BPP + case 8: + priv->renderer = (nxf_renderer_t)nxf_convert_8bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_16BPP + case 16: + priv->renderer = (nxf_renderer_t)nxf_convert_16bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_24BPP + case 24: + priv->renderer = (nxf_renderer_t)nxf_convert_24bpp; + break; +#endif +#ifndef CONFIG_NX_DISABLE_32BPP + case 32: + priv->renderer = (nxf_renderer_t)nxf_convert_32bpp; + break; +#endif + default: + gerr("ERROR: Unsupported pixel depth: %d\n", bpp); + errcode = ENOSYS; + goto errout_with_fcache; + } + + /* Select the font */ + + priv->font = nxf_getfonthandle(fontid); + if (priv->font == NULL) + { + errcode = get_errno(); + gerr("ERROR: Failed to get font ID %d: %d\n", fontid, errcode); + goto errout_with_fcache; + } + + /* Initialize the mutual exclusion semaphore */ + + sem_init(&priv->fsem, 0, 1); + + /* Add the new font cache to the list of font caches */ + + priv->flink = g_fcaches; + g_fcaches = priv; + } + else + { + /* A font cache with these characteristics already exists. Just make + * sure that it is as least a big as the size requested. + */ + + if (priv->maxglyphs < maxglyphs) + { + priv->maxglyphs = maxglyphs; + } + + /* Increment the number of clients of the font cache */ + + priv->fclients++; + } + + nxf_list_unlock(); + ginfo("fhandle=%p\n", priv); + return (FCACHE)priv; + +errout_with_fcache: + lib_free(priv); +errout_with_lock: + nxf_list_unlock(); + set_errno(errcode); + return NULL; +} + +/**************************************************************************** + * Name: nxf_cache_disconnect + * + * Description: + * Decrement the reference count on the font cache and, if the reference + * count goes to zero, free all resources used by the font cache. The + * font handle is invalid upon return in either case. + * + * Input Parameters: + * fhandle - A font cache handle previously returned by nxf_cache_connect(); + * + * Returned value: + * None + * + ****************************************************************************/ + +void nxf_cache_disconnect(FCACHE fhandle) +{ + FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle; + FAR struct nxfonts_fcache_s *fcache; + FAR struct nxfonts_fcache_s *prev; + FAR struct nxfonts_glyph_s *glyph; + FAR struct nxfonts_glyph_s *next; + + ginfo("fhandle=%p\n", fhandle); + + DEBUGASSERT(priv != NULL && priv->fclients > 0); + + /* Get exclusive access to the font cache */ + + nxf_cache_lock(priv); + + /* Is this the last client of the font cache? */ + + if (priv->fclients <= 1) + { + /* Get exclusive access to the font cache list */ + + nxf_list_lock(); + + /* Remove the font cache from the list of caches. This is a singly + * linked list, so we must do this the hard way. + */ + + for (prev = NULL, fcache = g_fcaches; + fcache != priv && fcache != NULL; + fcache = fcache->flink); + + ASSERT(fcache == priv); + nxf_removecache(fcache, prev); + nxf_list_unlock(); + + /* Free all allocated glyph memory */ + + for (glyph = priv->head; glyph != NULL; glyph = next) + { + next = glyph->flink; + lib_free(glyph); + } + + /* Destroy the serializing semaphore... while we are holding it? */ + + sem_destroy(&priv->fsem); + + /* Finally, free the font cache stucture itself */ + + lib_free(priv); + } + else + { + /* No.. just decrement the number of clients connected to the font + * cache. + */ + + priv->fclients--; + nxf_cache_unlock(priv); + } +} + +/**************************************************************************** + * Name: nxf_cache_getfonthandle + * + * Description: + * Return the handle to the font set used by this instance of the font + * cache. + * + * Input Parameters: + * fhandle - A font cache handle previously returned by nxf_cache_connect(); + * + * Returned value: + * Zero (OK) is returned if the metrics were + * + * Returned Value: + * One success, a non-NULL font handle is returned. + * + ****************************************************************************/ + +NXHANDLE nxf_cache_getfonthandle(FCACHE fhandle) +{ + FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle; + + DEBUGASSERT(priv != NULL && priv->font != NULL); + return priv->font; +} + +/**************************************************************************** + * Name: nxf_cache_getglyph + * + * Description: + * Get the font glyph for the character code 'ch' from the font cache. If + * the glyph for that character code does not exist in the font cache, it + * be rendered. + * + * Returned Value: + * On success, a non-NULL pointer to the rendered glyph in the font cache + * is returned. NULL is returned on any failure. + * + ****************************************************************************/ + +FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle, uint8_t ch) +{ + FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle; + FAR struct nxfonts_glyph_s *glyph; + FAR const struct nx_fontbitmap_s *fbm; + + ginfo("ch=%c (%02x)\n", (ch >= 32 && ch < 128) ? ch : '.', ch); + + /* Get exclusive access to the font cache */ + + nxf_cache_lock(priv); + + /* First, try to find the glyph in the cache of pre-rendered glyphs */ + + glyph = nxf_findglyph(priv, ch); + if (glyph == NULL) + { + /* No, it is not cached... Does the code map to a font? */ + + fbm = nxf_getbitmap(priv->font, ch); + if (fbm) + { + /* Yes.. render the glyph for the font */ + + glyph = nxf_renderglyph(priv, fbm, ch); + } + } + + nxf_cache_unlock(priv); + return glyph; +} diff --git a/libnx/nxfonts/nxfonts_getfont.c b/libnx/nxfonts/nxfonts_getfont.c index 1e8f80edc2af7f7737f5413733e39e845363632b..afe0f7bc68aff03f489f8cb22c31f0ac43d655d2 100644 --- a/libnx/nxfonts/nxfonts_getfont.c +++ b/libnx/nxfonts/nxfonts_getfont.c @@ -1,7 +1,7 @@ /**************************************************************************** * libnx/nxfonts/nxfonts_getfont.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,14 +48,6 @@ #include "nxfonts.h" -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -246,9 +238,12 @@ extern const struct nx_fontpackage_s g_x11_misc_fixed_9x18B_package; extern const struct nx_fontpackage_s g_x11_misc_fixed_10x20_package; #endif +#ifdef CONFIG_NXFONT_TOM_THUMB_4X6 +extern const struct nx_fontpackage_s g_tom_thumb_4x6_package; +#endif + static FAR const struct nx_fontpackage_s *g_fontpackages[] = { - /* MONO */ #ifdef CONFIG_NXFONT_MONO5X8 @@ -431,13 +426,15 @@ static FAR const struct nx_fontpackage_s *g_fontpackages[] = &g_x11_misc_fixed_10x20_package, #endif +/* Tom Thumb mono-space 4x6 font */ + +#ifdef CONFIG_NXFONT_TOM_THUMB_4X6 + &g_tom_thumb_4x6_package, +#endif + NULL }; -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/libnx/nxfonts/nxfonts_tom-thumb-4x6.h b/libnx/nxfonts/nxfonts_tom-thumb-4x6.h new file mode 100644 index 0000000000000000000000000000000000000000..dcd34efe97c9eb808df6ab95288ae91121081bd8 --- /dev/null +++ b/libnx/nxfonts/nxfonts_tom-thumb-4x6.h @@ -0,0 +1,827 @@ +/**************************************************************************** + * libnx/nxfonts/nxfonts_tom-thumb-4x6.h + * + * Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved. + * Author: Alan Carvalho de Assis + * + * Based on Tom Thumb font: + * https://robey.lag.net/2010/01/23/tiny-monospace-font.html + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 __LIBNX_NXFONTS_NXFONTS_TOM_THUMB_4X6_H +#define __LIBNX_NXFONTS_NXFONTS_TOM_THUMB_4X6_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/* Font ID */ + +#define NXFONT_ID FONTID_TOM_THUMB_4X6 + +/* Ranges of 7-bit and 8-bit fonts */ + +#define NXFONT_MIN7BIT 33 +#define NXFONT_MAX7BIT 126 + +#define NXFONT_MIN8BIT 161 +#define NXFONT_MAX8BIT 255 + +/* Maximum height and width of any glyph in the set */ + +#define NXFONT_MAXHEIGHT 6 +#define NXFONT_MAXWIDTH 4 + +/* The width of a space */ + +#define NXFONT_SPACEWIDTH 4 + +/* exclam (33) */ +#define NXFONT_METRICS_33 {1, 2, 5, 1, 0, 0} +#define NXFONT_BITMAP_33 {0x80, 0x80, 0x80, 0x0, 0x80} + +/* quotedbl (34) */ +#define NXFONT_METRICS_34 {1, 4, 2, 0, 0, 0} +#define NXFONT_BITMAP_34 {0xa0, 0xa0} + +/* numbersign (35) */ +#define NXFONT_METRICS_35 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_35 {0xa0, 0xe0, 0xa0, 0xe0, 0xa0} + +/* dollar (36) */ +#define NXFONT_METRICS_36 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_36 {0x60, 0xc0, 0x60, 0xc0, 0x40} + +/* percent (37) */ +#define NXFONT_METRICS_37 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_37 {0x80, 0x20, 0x40, 0x80, 0x20} + +/* ampersand (38) */ +#define NXFONT_METRICS_38 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_38 {0xc0, 0xc0, 0xe0, 0xa0, 0x60} + +/* quotesingle (39) */ +#define NXFONT_METRICS_39 {1, 2, 2, 1, 0, 0} +#define NXFONT_BITMAP_39 {0x80, 0x80} + +/* parenleft (40) */ +#define NXFONT_METRICS_40 {1, 3, 5, 1, 0, 0} +#define NXFONT_BITMAP_40 {0x40, 0x80, 0x80, 0x80, 0x40} + +/* parenright (41) */ +#define NXFONT_METRICS_41 {1, 3, 5, 0, 0, 0} +#define NXFONT_BITMAP_41 {0x80, 0x40, 0x40, 0x40, 0x80} + +/* asterisk (42) */ +#define NXFONT_METRICS_42 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_42 {0xa0, 0x40, 0xa0} + +/* plus (43) */ +#define NXFONT_METRICS_43 {1, 4, 3, 0, 1, 0} +#define NXFONT_BITMAP_43 {0x40, 0xe0, 0x40} + +/* comma (44) */ +#define NXFONT_METRICS_44 {1, 3, 2, 0, 3, 0} +#define NXFONT_BITMAP_44 {0x40, 0x80} + +/* hyphen (45) */ +#define NXFONT_METRICS_45 {1, 4, 1, 0, 2, 0} +#define NXFONT_BITMAP_45 {0xe0} + +/* period (46) */ +#define NXFONT_METRICS_46 {1, 2, 1, 1, 4, 0} +#define NXFONT_BITMAP_46 {0x80} + +/* slash (47) */ +#define NXFONT_METRICS_47 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_47 {0x20, 0x20, 0x40, 0x80, 0x80} + +/* zero (48) */ +#define NXFONT_METRICS_48 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_48 {0x60, 0xa0, 0xa0, 0xa0, 0xc0} + +/* one (49) */ +#define NXFONT_METRICS_49 {1, 3, 5, 0, 0, 0} +#define NXFONT_BITMAP_49 {0x40, 0xc0, 0x40, 0x40, 0x40} + +/* two (50) */ +#define NXFONT_METRICS_50 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_50 {0xc0, 0x20, 0x40, 0x80, 0xe0} + +/* three (51) */ +#define NXFONT_METRICS_51 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_51 {0xc0, 0x20, 0x40, 0x20, 0xc0} + +/* four (52) */ +#define NXFONT_METRICS_52 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_52 {0xa0, 0xa0, 0xe0, 0x20, 0x20} + +/* five (53) */ +#define NXFONT_METRICS_53 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_53 {0xe0, 0x80, 0xc0, 0x20, 0xc0} + +/* six (54) */ +#define NXFONT_METRICS_54 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_54 {0x60, 0x80, 0xe0, 0xa0, 0xe0} + +/* seven (55) */ +#define NXFONT_METRICS_55 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_55 {0xe0, 0x20, 0x40, 0x80, 0x80} + +/* eight (56) */ +#define NXFONT_METRICS_56 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_56 {0xe0, 0xa0, 0xe0, 0xa0, 0xe0} + +/* nine (57) */ +#define NXFONT_METRICS_57 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_57 {0xe0, 0xa0, 0xe0, 0x20, 0xc0} + +/* colon (58) */ +#define NXFONT_METRICS_58 {1, 2, 3, 1, 1, 0} +#define NXFONT_BITMAP_58 {0x80, 0x0, 0x80} + +/* semicolon (59) */ +#define NXFONT_METRICS_59 {1, 3, 4, 0, 1, 0} +#define NXFONT_BITMAP_59 {0x40, 0x0, 0x40, 0x80} + +/* less (60) */ +#define NXFONT_METRICS_60 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_60 {0x20, 0x40, 0x80, 0x40, 0x20} + +/* equal (61) */ +#define NXFONT_METRICS_61 {1, 4, 3, 0, 1, 0} +#define NXFONT_BITMAP_61 {0xe0, 0x0, 0xe0} + +/* greater (62) */ +#define NXFONT_METRICS_62 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_62 {0x80, 0x40, 0x20, 0x40, 0x80} + +/* question (63) */ +#define NXFONT_METRICS_63 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_63 {0xe0, 0x20, 0x40, 0x0, 0x40} + +/* at (64) */ +#define NXFONT_METRICS_64 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_64 {0x40, 0xa0, 0xe0, 0x80, 0x60} + +/* A (65) */ +#define NXFONT_METRICS_65 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_65 {0x40, 0xa0, 0xe0, 0xa0, 0xa0} + +/* B (66) */ +#define NXFONT_METRICS_66 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_66 {0xc0, 0xa0, 0xc0, 0xa0, 0xc0} + +/* C (67) */ +#define NXFONT_METRICS_67 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_67 {0x60, 0x80, 0x80, 0x80, 0x60} + +/* D (68) */ +#define NXFONT_METRICS_68 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_68 {0xc0, 0xa0, 0xa0, 0xa0, 0xc0} + +/* E (69) */ +#define NXFONT_METRICS_69 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_69 {0xe0, 0x80, 0xe0, 0x80, 0xe0} + +/* F (70) */ +#define NXFONT_METRICS_70 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_70 {0xe0, 0x80, 0xe0, 0x80, 0x80} + +/* G (71) */ +#define NXFONT_METRICS_71 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_71 {0x60, 0x80, 0xe0, 0xa0, 0x60} + +/* H (72) */ +#define NXFONT_METRICS_72 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_72 {0xa0, 0xa0, 0xe0, 0xa0, 0xa0} + +/* I (73) */ +#define NXFONT_METRICS_73 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_73 {0xe0, 0x40, 0x40, 0x40, 0xe0} + +/* J (74) */ +#define NXFONT_METRICS_74 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_74 {0x20, 0x20, 0x20, 0xa0, 0x40} + +/* K (75) */ +#define NXFONT_METRICS_75 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_75 {0xa0, 0xa0, 0xc0, 0xa0, 0xa0} + +/* L (76) */ +#define NXFONT_METRICS_76 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_76 {0x80, 0x80, 0x80, 0x80, 0xe0} + +/* M (77) */ +#define NXFONT_METRICS_77 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_77 {0xa0, 0xe0, 0xe0, 0xa0, 0xa0} + +/* N (78) */ +#define NXFONT_METRICS_78 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_78 {0xa0, 0xe0, 0xe0, 0xe0, 0xa0} + +/* O (79) */ +#define NXFONT_METRICS_79 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_79 {0x40, 0xa0, 0xa0, 0xa0, 0x40} + +/* P (80) */ +#define NXFONT_METRICS_80 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_80 {0xc0, 0xa0, 0xc0, 0x80, 0x80} + +/* Q (81) */ +#define NXFONT_METRICS_81 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_81 {0x40, 0xa0, 0xa0, 0xe0, 0x60} + +/* R (82) */ +#define NXFONT_METRICS_82 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_82 {0xc0, 0xa0, 0xe0, 0xc0, 0xa0} + +/* S (83) */ +#define NXFONT_METRICS_83 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_83 {0x60, 0x80, 0x40, 0x20, 0xc0} + +/* T (84) */ +#define NXFONT_METRICS_84 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_84 {0xe0, 0x40, 0x40, 0x40, 0x40} + +/* U (85) */ +#define NXFONT_METRICS_85 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_85 {0xa0, 0xa0, 0xa0, 0xa0, 0x60} + +/* V (86) */ +#define NXFONT_METRICS_86 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_86 {0xa0, 0xa0, 0xa0, 0x40, 0x40} + +/* W (87) */ +#define NXFONT_METRICS_87 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_87 {0xa0, 0xa0, 0xe0, 0xe0, 0xa0} + +/* X (88) */ +#define NXFONT_METRICS_88 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_88 {0xa0, 0xa0, 0x40, 0xa0, 0xa0} + +/* Y (89) */ +#define NXFONT_METRICS_89 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_89 {0xa0, 0xa0, 0x40, 0x40, 0x40} + +/* Z (90) */ +#define NXFONT_METRICS_90 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_90 {0xe0, 0x20, 0x40, 0x80, 0xe0} + +/* bracketleft (91) */ +#define NXFONT_METRICS_91 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_91 {0xe0, 0x80, 0x80, 0x80, 0xe0} + +/* backslash (92) */ +#define NXFONT_METRICS_92 {1, 4, 3, 0, 1, 0} +#define NXFONT_BITMAP_92 {0x80, 0x40, 0x20} + +/* bracketright (93) */ +#define NXFONT_METRICS_93 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_93 {0xe0, 0x20, 0x20, 0x20, 0xe0} + +/* asciicircum (94) */ +#define NXFONT_METRICS_94 {1, 4, 2, 0, 0, 0} +#define NXFONT_BITMAP_94 {0x40, 0xa0} + +/* underscore (95) */ +#define NXFONT_METRICS_95 {1, 4, 1, 0, 4, 0} +#define NXFONT_BITMAP_95 {0xe0} + +/* grave (96) */ +#define NXFONT_METRICS_96 {1, 3, 2, 0, 0, 0} +#define NXFONT_BITMAP_96 {0x80, 0x40} + +/* a (97) */ +#define NXFONT_METRICS_97 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_97 {0xc0, 0x60, 0xa0, 0xe0} + +/* b (98) */ +#define NXFONT_METRICS_98 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_98 {0x80, 0xc0, 0xa0, 0xa0, 0xc0} + +/* c (99) */ +#define NXFONT_METRICS_99 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_99 {0x60, 0x80, 0x80, 0x60} + +/* d (100) */ +#define NXFONT_METRICS_100 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_100 {0x20, 0x60, 0xa0, 0xa0, 0x60} + +/* e (101) */ +#define NXFONT_METRICS_101 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_101 {0x60, 0xa0, 0xc0, 0x60} + +/* f (102) */ +#define NXFONT_METRICS_102 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_102 {0x20, 0x40, 0xe0, 0x40, 0x40} + +/* g (103) */ +#define NXFONT_METRICS_103 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_103 {0x60, 0xa0, 0xe0, 0x20, 0x40} + +/* h (104) */ +#define NXFONT_METRICS_104 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_104 {0x80, 0xc0, 0xa0, 0xa0, 0xa0} + +/* i (105) */ +#define NXFONT_METRICS_105 {1, 2, 5, 1, 0, 0} +#define NXFONT_BITMAP_105 {0x80, 0x0, 0x80, 0x80, 0x80} + +/* j (106) */ +#define NXFONT_METRICS_106 {1, 4, 6, 0, 0, 0} +#define NXFONT_BITMAP_106 {0x20, 0x0, 0x20, 0x20, 0xa0, 0x40} + +/* k (107) */ +#define NXFONT_METRICS_107 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_107 {0x80, 0xa0, 0xc0, 0xc0, 0xa0} + +/* l (108) */ +#define NXFONT_METRICS_108 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_108 {0xc0, 0x40, 0x40, 0x40, 0xe0} + +/* m (109) */ +#define NXFONT_METRICS_109 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_109 {0xe0, 0xe0, 0xe0, 0xa0} + +/* n (110) */ +#define NXFONT_METRICS_110 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_110 {0xc0, 0xa0, 0xa0, 0xa0} + +/* o (111) */ +#define NXFONT_METRICS_111 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_111 {0x40, 0xa0, 0xa0, 0x40} + +/* p (112) */ +#define NXFONT_METRICS_112 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_112 {0xc0, 0xa0, 0xa0, 0xc0, 0x80} + +/* q (113) */ +#define NXFONT_METRICS_113 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_113 {0x60, 0xa0, 0xa0, 0x60, 0x20} + +/* r (114) */ +#define NXFONT_METRICS_114 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_114 {0x60, 0x80, 0x80, 0x80} + +/* s (115) */ +#define NXFONT_METRICS_115 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_115 {0x60, 0xc0, 0x60, 0xc0} + +/* t (116) */ +#define NXFONT_METRICS_116 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_116 {0x40, 0xe0, 0x40, 0x40, 0x60} + +/* u (117) */ +#define NXFONT_METRICS_117 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_117 {0xa0, 0xa0, 0xa0, 0x60} + +/* v (118) */ +#define NXFONT_METRICS_118 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_118 {0xa0, 0xa0, 0xe0, 0x40} + +/* w (119) */ +#define NXFONT_METRICS_119 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_119 {0xa0, 0xe0, 0xe0, 0xe0} + +/* x (120) */ +#define NXFONT_METRICS_120 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_120 {0xa0, 0x40, 0x40, 0xa0} + +/* y (121) */ +#define NXFONT_METRICS_121 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_121 {0xa0, 0xa0, 0x60, 0x20, 0x40} + +/* z (122) */ +#define NXFONT_METRICS_122 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_122 {0xe0, 0x60, 0xc0, 0xe0} + +/* braceleft (123) */ +#define NXFONT_METRICS_123 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_123 {0x60, 0x40, 0x80, 0x40, 0x60} + +/* bar (124) */ +#define NXFONT_METRICS_124 {1, 2, 5, 1, 0, 0} +#define NXFONT_BITMAP_124 {0x80, 0x80, 0x0, 0x80, 0x80} + +/* braceright (125) */ +#define NXFONT_METRICS_125 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_125 {0xc0, 0x40, 0x20, 0x40, 0xc0} + +/* asciitilde (126) */ +#define NXFONT_METRICS_126 {1, 4, 2, 0, 0, 0} +#define NXFONT_BITMAP_126 {0x60, 0xc0} + +/* exclamdown (161) */ +#define NXFONT_METRICS_161 {1, 2, 5, 1, 0, 0} +#define NXFONT_BITMAP_161 {0x80, 0x0, 0x80, 0x80, 0x80} + +/* cent (162) */ +#define NXFONT_METRICS_162 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_162 {0x40, 0xe0, 0x80, 0xe0, 0x40} + +/* sterling (163) */ +#define NXFONT_METRICS_163 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_163 {0x60, 0x40, 0xe0, 0x40, 0xe0} + +/* currency (164) */ +#define NXFONT_METRICS_164 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_164 {0xa0, 0x40, 0xe0, 0x40, 0xa0} + +/* yen (165) */ +#define NXFONT_METRICS_165 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_165 {0xa0, 0xa0, 0x40, 0xe0, 0x40} + +/* brokenbar (166) */ +#define NXFONT_METRICS_166 {1, 2, 5, 1, 0, 0} +#define NXFONT_BITMAP_166 {0x80, 0x80, 0x0, 0x80, 0x80} + +/* section (167) */ +#define NXFONT_METRICS_167 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_167 {0x60, 0x40, 0xa0, 0x40, 0xc0} + +/* dieresis (168) */ +#define NXFONT_METRICS_168 {1, 4, 1, 0, 0, 0} +#define NXFONT_BITMAP_168 {0xa0} + +/* copyright (169) */ +#define NXFONT_METRICS_169 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_169 {0x60, 0x80, 0x60} + +/* ordfeminine (170) */ +#define NXFONT_METRICS_170 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_170 {0x60, 0xa0, 0xe0, 0x0, 0xe0} + +/* guillemotleft (171) */ +#define NXFONT_METRICS_171 {1, 3, 3, 0, 0, 0} +#define NXFONT_BITMAP_171 {0x40, 0x80, 0x40} + +/* logicalnot (172) */ +#define NXFONT_METRICS_172 {1, 4, 2, 0, 1, 0} +#define NXFONT_BITMAP_172 {0xe0, 0x20} + +/* softhyphen (173) */ +#define NXFONT_METRICS_173 {1, 3, 1, 0, 2, 0} +#define NXFONT_BITMAP_173 {0xc0} + +/* registered (174) */ +#define NXFONT_METRICS_174 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_174 {0xc0, 0xc0, 0xa0} + +/* macron (175) */ +#define NXFONT_METRICS_175 {1, 4, 1, 0, 0, 0} +#define NXFONT_BITMAP_175 {0xe0} + +/* degree (176) */ +#define NXFONT_METRICS_176 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_176 {0x40, 0xa0, 0x40} + +/* plusminus (177) */ +#define NXFONT_METRICS_177 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_177 {0x40, 0xe0, 0x40, 0x0, 0xe0} + +/* twosuperior (178) */ +#define NXFONT_METRICS_178 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_178 {0xc0, 0x40, 0x60} + +/* threesuperior (179) */ +#define NXFONT_METRICS_179 {1, 4, 3, 0, 0, 0} +#define NXFONT_BITMAP_179 {0xe0, 0x60, 0xe0} + +/* acute (180) */ +#define NXFONT_METRICS_180 {1, 3, 2, 1, 0, 0} +#define NXFONT_BITMAP_180 {0x40, 0x80} + +/* mu (181) */ +#define NXFONT_METRICS_181 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_181 {0xa0, 0xa0, 0xa0, 0xc0, 0x80} + +/* paragraph (182) */ +#define NXFONT_METRICS_182 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_182 {0x60, 0xa0, 0x60, 0x60, 0x60} + +/* periodcentered (183) */ +#define NXFONT_METRICS_183 {1, 4, 3, 0, 1, 0} +#define NXFONT_BITMAP_183 {0xe0, 0xe0, 0xe0} + +/* cedilla (184) */ +#define NXFONT_METRICS_184 {1, 4, 3, 0, 2, 0} +#define NXFONT_BITMAP_184 {0x40, 0x20, 0xc0} + +/* onesuperior (185) */ +#define NXFONT_METRICS_185 {1, 2, 3, 1, 0, 0} +#define NXFONT_BITMAP_185 {0x80, 0x80, 0x80} + +/* ordmasculine (186) */ +#define NXFONT_METRICS_186 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_186 {0x40, 0xa0, 0x40, 0x0, 0xe0} + +/* guillemotright (187) */ +#define NXFONT_METRICS_187 {1, 3, 3, 1, 0, 0} +#define NXFONT_BITMAP_187 {0x80, 0x40, 0x80} + +/* onequarter (188) */ +#define NXFONT_METRICS_188 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_188 {0x80, 0x80, 0x0, 0x60, 0x20} + +/* onehalf (189) */ +#define NXFONT_METRICS_189 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_189 {0x80, 0x80, 0x0, 0xc0, 0x60} + +/* threequarters (190) */ +#define NXFONT_METRICS_190 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_190 {0xc0, 0xc0, 0x0, 0x60, 0x20} + +/* questiondown (191) */ +#define NXFONT_METRICS_191 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_191 {0x40, 0x0, 0x40, 0x80, 0xe0} + +/* Agrave (192) */ +#define NXFONT_METRICS_192 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_192 {0x40, 0x20, 0x40, 0xe0, 0xa0} + +/* Aacute (193) */ +#define NXFONT_METRICS_193 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_193 {0x40, 0x80, 0x40, 0xe0, 0xa0} + +/* Acircumflex (194) */ +#define NXFONT_METRICS_194 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_194 {0xe0, 0x0, 0x40, 0xe0, 0xa0} + +/* Atilde (195) */ +#define NXFONT_METRICS_195 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_195 {0x60, 0xc0, 0x40, 0xe0, 0xa0} + +/* Adieresis (196) */ +#define NXFONT_METRICS_196 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_196 {0xa0, 0x40, 0xa0, 0xe0, 0xa0} + +/* Aring (197) */ +#define NXFONT_METRICS_197 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_197 {0xc0, 0xc0, 0xa0, 0xe0, 0xa0} + +/* AE (198) */ +#define NXFONT_METRICS_198 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_198 {0x60, 0xc0, 0xe0, 0xc0, 0xe0} + +/* Ccedilla (199) */ +#define NXFONT_METRICS_199 {1, 4, 6, 0, 0, 0} +#define NXFONT_BITMAP_199 {0x60, 0x80, 0x80, 0x60, 0x20, 0x40} + +/* Egrave (200) */ +#define NXFONT_METRICS_200 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_200 {0x40, 0x20, 0xe0, 0xc0, 0xe0} + +/* Eacute (201) */ +#define NXFONT_METRICS_201 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_201 {0x40, 0x80, 0xe0, 0xc0, 0xe0} + +/* Ecircumflex (202) */ +#define NXFONT_METRICS_202 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_202 {0xe0, 0x0, 0xe0, 0xc0, 0xe0} + +/* Edieresis (203) */ +#define NXFONT_METRICS_203 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_203 {0xa0, 0x0, 0xe0, 0xc0, 0xe0} + +/* Igrave (204) */ +#define NXFONT_METRICS_204 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_204 {0x40, 0x20, 0xe0, 0x40, 0xe0} + +/* Iacute (205) */ +#define NXFONT_METRICS_205 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_205 {0x40, 0x80, 0xe0, 0x40, 0xe0} + +/* Icircumflex (206) */ +#define NXFONT_METRICS_206 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_206 {0xe0, 0x0, 0xe0, 0x40, 0xe0} + +/* Idieresis (207) */ +#define NXFONT_METRICS_207 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_207 {0xa0, 0x0, 0xe0, 0x40, 0xe0} + +/* Eth (208) */ +#define NXFONT_METRICS_208 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_208 {0xc0, 0xa0, 0xe0, 0xa0, 0xc0} + +/* Ntilde (209) */ +#define NXFONT_METRICS_209 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_209 {0xc0, 0x60, 0xa0, 0xe0, 0xa0} + +/* Ograve (210) */ +#define NXFONT_METRICS_210 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_210 {0x40, 0x20, 0xe0, 0xa0, 0xe0} + +/* Oacute (211) */ +#define NXFONT_METRICS_211 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_211 {0x40, 0x80, 0xe0, 0xa0, 0xe0} + +/* Ocircumflex (212) */ +#define NXFONT_METRICS_212 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_212 {0xe0, 0x0, 0xe0, 0xa0, 0xe0} + +/* Otilde (213) */ +#define NXFONT_METRICS_213 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_213 {0xc0, 0x60, 0xe0, 0xa0, 0xe0} + +/* Odieresis (214) */ +#define NXFONT_METRICS_214 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_214 {0xa0, 0x0, 0xe0, 0xa0, 0xe0} + +/* multiply (215) */ +#define NXFONT_METRICS_215 {1, 4, 3, 0, 1, 0} +#define NXFONT_BITMAP_215 {0xa0, 0x40, 0xa0} + +/* Oslash (216) */ +#define NXFONT_METRICS_216 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_216 {0x60, 0xa0, 0xe0, 0xa0, 0xc0} + +/* Ugrave (217) */ +#define NXFONT_METRICS_217 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_217 {0x80, 0x40, 0xa0, 0xa0, 0xe0} + +/* Uacute (218) */ +#define NXFONT_METRICS_218 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_218 {0x20, 0x40, 0xa0, 0xa0, 0xe0} + +/* Ucircumflex (219) */ +#define NXFONT_METRICS_219 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_219 {0xe0, 0x0, 0xa0, 0xa0, 0xe0} + +/* Udieresis (220) */ +#define NXFONT_METRICS_220 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_220 {0xa0, 0x0, 0xa0, 0xa0, 0xe0} + +/* Yacute (221) */ +#define NXFONT_METRICS_221 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_221 {0x20, 0x40, 0xa0, 0xe0, 0x40} + +/* Thorn (222) */ +#define NXFONT_METRICS_222 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_222 {0x80, 0xe0, 0xa0, 0xe0, 0x80} + +/* germandbls (223) */ +#define NXFONT_METRICS_223 {1, 4, 6, 0, 0, 0} +#define NXFONT_BITMAP_223 {0x60, 0xa0, 0xc0, 0xa0, 0xc0, 0x80} + +/* agrave (224) */ +#define NXFONT_METRICS_224 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_224 {0x40, 0x20, 0x60, 0xa0, 0xe0} + +/* aacute (225) */ +#define NXFONT_METRICS_225 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_225 {0x40, 0x80, 0x60, 0xa0, 0xe0} + +/* acircumflex (226) */ +#define NXFONT_METRICS_226 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_226 {0xe0, 0x0, 0x60, 0xa0, 0xe0} + +/* atilde (227) */ +#define NXFONT_METRICS_227 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_227 {0x60, 0xc0, 0x60, 0xa0, 0xe0} + +/* adieresis (228) */ +#define NXFONT_METRICS_228 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_228 {0xa0, 0x0, 0x60, 0xa0, 0xe0} + +/* aring (229) */ +#define NXFONT_METRICS_229 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_229 {0x60, 0x60, 0x60, 0xa0, 0xe0} + +/* ae (230) */ +#define NXFONT_METRICS_230 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_230 {0x60, 0xe0, 0xe0, 0xc0} + +/* ccedilla (231) */ +#define NXFONT_METRICS_231 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_231 {0x60, 0x80, 0x60, 0x20, 0x40} + +/* egrave (232) */ +#define NXFONT_METRICS_232 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_232 {0x40, 0x20, 0x60, 0xe0, 0x60} + +/* eacute (233) */ +#define NXFONT_METRICS_233 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_233 {0x40, 0x80, 0x60, 0xe0, 0x60} + +/* ecircumflex (234) */ +#define NXFONT_METRICS_234 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_234 {0xe0, 0x0, 0x60, 0xe0, 0x60} + +/* edieresis (235) */ +#define NXFONT_METRICS_235 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_235 {0xa0, 0x0, 0x60, 0xe0, 0x60} + +/* igrave (236) */ +#define NXFONT_METRICS_236 {1, 3, 5, 1, 0, 0} +#define NXFONT_BITMAP_236 {0x80, 0x40, 0x80, 0x80, 0x80} + +/* iacute (237) */ +#define NXFONT_METRICS_237 {1, 3, 5, 0, 0, 0} +#define NXFONT_BITMAP_237 {0x40, 0x80, 0x40, 0x40, 0x40} + +/* icircumflex (238) */ +#define NXFONT_METRICS_238 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_238 {0xe0, 0x0, 0x40, 0x40, 0x40} + +/* idieresis (239) */ +#define NXFONT_METRICS_239 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_239 {0xa0, 0x0, 0x40, 0x40, 0x40} + +/* eth (240) */ +#define NXFONT_METRICS_240 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_240 {0x60, 0xc0, 0x60, 0xa0, 0x60} + +/* ntilde (241) */ +#define NXFONT_METRICS_241 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_241 {0xc0, 0x60, 0xc0, 0xa0, 0xa0} + +/* ograve (242) */ +#define NXFONT_METRICS_242 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_242 {0x40, 0x20, 0x40, 0xa0, 0x40} + +/* oacute (243) */ +#define NXFONT_METRICS_243 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_243 {0x40, 0x80, 0x40, 0xa0, 0x40} + +/* ocircumflex (244) */ +#define NXFONT_METRICS_244 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_244 {0xe0, 0x0, 0x40, 0xa0, 0x40} + +/* otilde (245) */ +#define NXFONT_METRICS_245 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_245 {0xc0, 0x60, 0x40, 0xa0, 0x40} + +/* odieresis (246) */ +#define NXFONT_METRICS_246 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_246 {0xa0, 0x0, 0x40, 0xa0, 0x40} + +/* divide (247) */ +#define NXFONT_METRICS_247 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_247 {0x40, 0x0, 0xe0, 0x0, 0x40} + +/* oslash (248) */ +#define NXFONT_METRICS_248 {1, 4, 4, 0, 1, 0} +#define NXFONT_BITMAP_248 {0x60, 0xe0, 0xa0, 0xc0} + +/* ugrave (249) */ +#define NXFONT_METRICS_249 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_249 {0x80, 0x40, 0xa0, 0xa0, 0x60} + +/* uacute (250) */ +#define NXFONT_METRICS_250 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_250 {0x20, 0x40, 0xa0, 0xa0, 0x60} + +/* ucircumflex (251) */ +#define NXFONT_METRICS_251 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_251 {0xe0, 0x0, 0xa0, 0xa0, 0x60} + +/* udieresis (252) */ +#define NXFONT_METRICS_252 {1, 4, 5, 0, 0, 0} +#define NXFONT_BITMAP_252 {0xa0, 0x0, 0xa0, 0xa0, 0x60} + +/* yacute (253) */ +#define NXFONT_METRICS_253 {1, 4, 6, 0, 0, 0} +#define NXFONT_BITMAP_253 {0x20, 0x40, 0xa0, 0x60, 0x20, 0x40} + +/* thorn (254) */ +#define NXFONT_METRICS_254 {1, 4, 5, 0, 1, 0} +#define NXFONT_BITMAP_254 {0x80, 0xc0, 0xa0, 0xc0, 0x80} + +/* ydieresis (255) */ +#define NXFONT_METRICS_255 {1, 4, 6, 0, 0, 0} +#define NXFONT_BITMAP_255 {0xa0, 0x0, 0xa0, 0x60, 0x20, 0x40} + +#endif diff --git a/libnx/nxmu/nx_block.c b/libnx/nxmu/nx_block.c index eb4cb41fd9dea611951e8317a7ed3681ede6e76d..4cab852e3604535433239f2a398014110e0389af 100644 --- a/libnx/nxmu/nx_block.c +++ b/libnx/nxmu/nx_block.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_closewindow.c b/libnx/nxmu/nx_closewindow.c index 0ac1909583705e6528a76aa7f7f5ed1ca656049b..6e5661f6b449d2c6a59d9bad0c7c452b44dc35d3 100644 --- a/libnx/nxmu/nx_closewindow.c +++ b/libnx/nxmu/nx_closewindow.c @@ -47,26 +47,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_connect.c b/libnx/nxmu/nx_connect.c index 7b2db2808f07c9748716d6825db0d5cc0a757e74..9e035c86dd3cdea6b68ceae40b6f92e866ef4ef5 100644 --- a/libnx/nxmu/nx_connect.c +++ b/libnx/nxmu/nx_connect.c @@ -52,14 +52,6 @@ #include "nxcontext.h" -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -76,14 +68,6 @@ static sem_t g_nxlibsem = { 1 }; static uint32_t g_nxcid = 1; -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_constructwindow.c b/libnx/nxmu/nx_constructwindow.c index 32f47880d5711de43353cd8af2a17ce842ed74a1..8b15f35029fa3dce9506a5501b624957df9b4a81 100644 --- a/libnx/nxmu/nx_constructwindow.c +++ b/libnx/nxmu/nx_constructwindow.c @@ -49,26 +49,6 @@ #include "nxcontext.h" -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_disconnect.c b/libnx/nxmu/nx_disconnect.c index 50571f38ac91508ad71ebb7febb2a243a362406e..d8cd4517e266579264f87465815708e48d17022d 100644 --- a/libnx/nxmu/nx_disconnect.c +++ b/libnx/nxmu/nx_disconnect.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_eventhandler.c b/libnx/nxmu/nx_eventhandler.c index fbc694826d2c7da0e5190ade5cb2cd757435194a..b6c6ca7094b1d4c211ea16b4701a68da0166c617 100644 --- a/libnx/nxmu/nx_eventhandler.c +++ b/libnx/nxmu/nx_eventhandler.c @@ -52,22 +52,6 @@ #include "nxcontext.h" -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_eventnotify.c b/libnx/nxmu/nx_eventnotify.c index 37f2b1591e3b9714ce5f60c3c60534add8683143..70653f62e2e2d1d9c90067c6f1d2280c60d195ba 100644 --- a/libnx/nxmu/nx_eventnotify.c +++ b/libnx/nxmu/nx_eventnotify.c @@ -50,26 +50,6 @@ #ifndef CONFIG_DISABLE_SIGNALS -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_fill.c b/libnx/nxmu/nx_fill.c index 93c8c613ca7c5c152010760aa571cc4adead84a0..bb59f6b28119c73530b3935aebadefc20a657732 100644 --- a/libnx/nxmu/nx_fill.c +++ b/libnx/nxmu/nx_fill.c @@ -48,26 +48,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_filltrapezoid.c b/libnx/nxmu/nx_filltrapezoid.c index 04f69320acf294e50ce2c04c0a51beaf0209131e..6dbdf27ab3b22c4d56d9f17bd771210ad8fd7a4b 100644 --- a/libnx/nxmu/nx_filltrapezoid.c +++ b/libnx/nxmu/nx_filltrapezoid.c @@ -48,26 +48,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_getposition.c b/libnx/nxmu/nx_getposition.c index ff3f7723f37c0fd75099ea743c9056b70965db2e..d18d1d3a593f8a4a0c3128b1071a6e2206f8534a 100644 --- a/libnx/nxmu/nx_getposition.c +++ b/libnx/nxmu/nx_getposition.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_kbdchin.c b/libnx/nxmu/nx_kbdchin.c index c94f6fd973ae6bb601d22532f6f040902b487b84..6c634ff894f42d2df95cf64bad12011ab9a6b538 100644 --- a/libnx/nxmu/nx_kbdchin.c +++ b/libnx/nxmu/nx_kbdchin.c @@ -48,26 +48,6 @@ #ifdef CONFIG_NX_KBD -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_kbdin.c b/libnx/nxmu/nx_kbdin.c index 610792c5851a5ed31ee7d93773b32f13e80ecadc..1fcaea0dd6cd03a7dbd5b049bd28b242ee766b63 100644 --- a/libnx/nxmu/nx_kbdin.c +++ b/libnx/nxmu/nx_kbdin.c @@ -49,26 +49,6 @@ #ifdef CONFIG_NX_KBD -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_lower.c b/libnx/nxmu/nx_lower.c index 347089cb0748be9786dd5197dd5d7a695f8ec6e5..06952d17f7931212fac87936433d9ecf9348827f 100644 --- a/libnx/nxmu/nx_lower.c +++ b/libnx/nxmu/nx_lower.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_mousein.c b/libnx/nxmu/nx_mousein.c index ea10ca005fdd8656802c5ace8707714fccf8c0bf..6a6378e460eaa2c0fb3ca94186502efeaae2ba84 100644 --- a/libnx/nxmu/nx_mousein.c +++ b/libnx/nxmu/nx_mousein.c @@ -48,26 +48,6 @@ #ifdef CONFIG_NX_XYINPUT -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_move.c b/libnx/nxmu/nx_move.c index d62d680df558a7cc8d1c1881a17606ce951bfb69..144e9e588b589bc07b0990ad19df330ed2526c7b 100644 --- a/libnx/nxmu/nx_move.c +++ b/libnx/nxmu/nx_move.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_openwindow.c b/libnx/nxmu/nx_openwindow.c index a704c4249610a2473fd4786d4b176118cc61aee5..3280ee4225d1ff04f2de5c47dbe3b1c9c17ddab7 100644 --- a/libnx/nxmu/nx_openwindow.c +++ b/libnx/nxmu/nx_openwindow.c @@ -48,26 +48,6 @@ #include "nxcontext.h" -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_raise.c b/libnx/nxmu/nx_raise.c index 9917d2748a0592992af13e5672e34317c990349c..a149acdb280f4738870590f521dc4ca104c9b0a5 100644 --- a/libnx/nxmu/nx_raise.c +++ b/libnx/nxmu/nx_raise.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_redrawreq.c b/libnx/nxmu/nx_redrawreq.c index cc771119f95d5874a037d23bc19bcca315ef0d99..520305bf80ddb1edc9e46709d9a33e01b2762a03 100644 --- a/libnx/nxmu/nx_redrawreq.c +++ b/libnx/nxmu/nx_redrawreq.c @@ -47,26 +47,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_releasebkgd.c b/libnx/nxmu/nx_releasebkgd.c index ca51f5e92eb1cb87e41d98dba6f208f995a692b8..9fe9a44c719591ce06e54198115795cd801ec28d 100644 --- a/libnx/nxmu/nx_releasebkgd.c +++ b/libnx/nxmu/nx_releasebkgd.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_requestbkgd.c b/libnx/nxmu/nx_requestbkgd.c index b1f3e68028c776d769d85fd95d0b78baa0e35307..154b8e19bf212209553a781d28c2406572f24dc0 100644 --- a/libnx/nxmu/nx_requestbkgd.c +++ b/libnx/nxmu/nx_requestbkgd.c @@ -45,26 +45,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_setbgcolor.c b/libnx/nxmu/nx_setbgcolor.c index 78599edb2ba054ee8f476a1f2f37f9743572cead..74c683acf34c0a9ab02c9b1a0280f8897438054d 100644 --- a/libnx/nxmu/nx_setbgcolor.c +++ b/libnx/nxmu/nx_setbgcolor.c @@ -45,26 +45,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_setpixel.c b/libnx/nxmu/nx_setpixel.c index 5c973bec71b1e22b34e8779ba382ba8388fd5754..376f85b04c4bee6fef21770773c8765ccf665ce0 100644 --- a/libnx/nxmu/nx_setpixel.c +++ b/libnx/nxmu/nx_setpixel.c @@ -48,26 +48,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_setposition.c b/libnx/nxmu/nx_setposition.c index 7ca0d02baf33ff34fefc7040cd8769ed29cdf824..a537d1b79a706e09665a624a48b03cb7e81d335f 100644 --- a/libnx/nxmu/nx_setposition.c +++ b/libnx/nxmu/nx_setposition.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nx_setsize.c b/libnx/nxmu/nx_setsize.c index b1cbb1086aa341c731715497c1f09d3298cb863c..dd2ee119ff1dd9dc4bc8009b6b78a0d8710c856a 100644 --- a/libnx/nxmu/nx_setsize.c +++ b/libnx/nxmu/nx_setsize.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nxmu_semtake.c b/libnx/nxmu/nxmu_semtake.c index 9753e6e3b2ed89887735aa1fad01ed3d41371802..ce532f0fe6dc8399b9535fda2f9da72a0c965270 100644 --- a/libnx/nxmu/nxmu_semtake.c +++ b/libnx/nxmu/nxmu_semtake.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nxmu_sendserver.c b/libnx/nxmu/nxmu_sendserver.c index 59bd5b795df520c0f4fc161d24ff54062e74f41b..e239382b2f62d6df075f24aa80306e9d21cedac9 100644 --- a/libnx/nxmu/nxmu_sendserver.c +++ b/libnx/nxmu/nxmu_sendserver.c @@ -45,26 +45,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libnx/nxmu/nxmu_sendwindow.c b/libnx/nxmu/nxmu_sendwindow.c index ff279d86ac105b5b41da92be283bc83396120753..350fecd41dcb74af3bbe6c06c8f36c58f3508aea 100644 --- a/libnx/nxmu/nxmu_sendwindow.c +++ b/libnx/nxmu/nxmu_sendwindow.c @@ -46,26 +46,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/net/Kconfig b/net/Kconfig index a216650c76fef9ad164408c6083049a092a23f70..2fea54f86fa240d18c459a231d2d6885fc2c2276 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -20,17 +20,6 @@ config NET if NET -config NET_NOINTS - bool "Not interrupt driven" - default n - ---help--- - NET_NOINT indicates that network layer is not called from the - interrupt level. If NET_NOINTS is defined, critical sections - will be managed with semaphores; Otherwise, it assumed that - network layer will be called from interrupt level handling - and critical sections will be managed by enabling and disabling - interrupts. - config NET_PROMISCUOUS bool "Promiscuous mode" default n @@ -40,17 +29,6 @@ config NET_PROMISCUOUS menu "Driver buffer configuration" -config NET_MULTIBUFFER - bool "Use multiple device-side I/O buffers" - default n - ---help--- - Traditionally, the uIP-based stack has used a single buffer for all - incoming and outgoing traffic. If this configuration is selected, - then the driver can manage multiple I/O buffers and can, for - example, be filling one input buffer while sending another output - buffer. Or, as another example, the driver may support queuing of - concurrent input/ouput and output transfers for better performance. - config NET_ETH_MTU int "Ethernet packet buffer size (MTU)" default 1294 if NET_IPv6 @@ -160,9 +138,7 @@ config NET_LOOPBACK select NETDEV_MULTINIC if NET_ETHERNET || NET_SLIP || NET_TUN select NET_MULTILINK if NET_ETHERNET || NET_SLIP || NET_TUN ---help--- - Add support for the local network loopback device, lo. Any additional - networking devices that are enabled must be compatible with - CONFIG_NET_NOINTS. + Add support for the local network loopback device, lo. config NET_SLIP bool "SLIP support" @@ -171,8 +147,7 @@ config NET_SLIP select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_TUN ---help--- Enables building of the SLIP driver. SLIP requires - at least one IP protocol selected and the following additional - network settings: NET_NOINTS and NET_MULTIBUFFER. + at least one IP protocol selected. SLIP supports point-to-point IP communications over a serial port. The default data link layer for network layer is Ethernet. If @@ -217,7 +192,6 @@ config NET_TUN default n select NETDEV_MULTINIC if NET_ETHERNET || NET_LOOPBACK || NET_SLIP select NET_MULTILINK if NET_ETHERNET || NET_LOOPBACK || NET_SLIP - select NET_MULTIBUFFER select ARCH_HAVE_NETDEV_STATISTICS if NET_TUN diff --git a/net/arp/arp_arpin.c b/net/arp/arp_arpin.c index 40c557c41d73a7b49d73055e1f1bdc2ced7a6a93..fe8d47a63ef5931bfacd1146ee27620dde107d29 100644 --- a/net/arp/arp_arpin.c +++ b/net/arp/arp_arpin.c @@ -76,16 +76,16 @@ * that we previously sent out, the ARP cache will be filled in with * the values from the ARP reply. If the incoming ARP packet is an ARP * request for our IP address, an ARP reply packet is created and put - * into the d_buf[] buffer. + * into the d_buf buffer. * * On entry, this function expects that an ARP packet with a prepended - * Ethernet header is present in the d_buf[] buffer and that the length of + * Ethernet header is present in the d_buf buffer and that the length of * the packet is set in the d_len field. * * When the function returns, the value of the field d_len indicates whether * the device driver should send out the ARP reply packet or not. If d_len * is zero, no packet should be sent; If d_len is non-zero, it contains the - * length of the outbound packet that is present in the d_buf[] buffer. + * length of the outbound packet that is present in the d_buf buffer. * ****************************************************************************/ diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index 667851a200f6b2d2406fc27991ae420c9de5fb01..b8161976718ce36c4e33672d84ab75c4bf7f7c79 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -123,13 +123,13 @@ static const uint8_t g_multicast_ethaddr[3] = * beginning of the packet and the function returns. * * If no ARP cache entry is found for the destination IP address, the - * packet in the d_buf[] is replaced by an ARP request packet for the + * packet in the d_buf is replaced by an ARP request packet for the * IP address. The IP packet is dropped and it is assumed that the * higher level protocols (e.g., TCP) eventually will retransmit the * dropped packet. * * Upon return in either the case, a packet to be sent is present in the - * d_buf[] buffer and the d_len field holds the length of the Ethernet + * d_buf buffer and the d_len field holds the length of the Ethernet * frame that should be transmitted. * ****************************************************************************/ diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index 0a525c7d6811c1513a696cb1de4364ee81dd7c9a..e5a1e48221ad4d0819f3e5dea7a562913a152907 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -192,7 +192,6 @@ int arp_send(in_addr_t ipaddr) struct arp_notify_s notify; struct timespec delay; struct arp_send_s state; - net_lock_t save; int ret; /* First check if destination is a local broadcast. */ @@ -282,7 +281,7 @@ int arp_send(in_addr_t ipaddr) * want anything to happen until we are ready. */ - save = net_lock(); + net_lock(); state.snd_cb = arp_callback_alloc(dev); if (!state.snd_cb) { @@ -409,7 +408,7 @@ int arp_send(in_addr_t ipaddr) sem_destroy(&state.snd_sem); arp_callback_free(dev, state.snd_cb); errout_with_lock: - net_unlock(save); + net_unlock(); errout: return ret; } diff --git a/net/devif/devif_callback.c b/net/devif/devif_callback.c index 01986a3a9e801a84678088b652a9ce04120ee1b2..067b7663d97a8e59d9c85a49711903d30af3ccb1 100644 --- a/net/devif/devif_callback.c +++ b/net/devif/devif_callback.c @@ -80,11 +80,10 @@ static void devif_callback_free(FAR struct net_driver_s *dev, { FAR struct devif_callback_s *prev; FAR struct devif_callback_s *curr; - net_lock_t save; if (cb) { - save = net_lock(); + net_lock(); #ifdef CONFIG_DEBUG_FEATURES /* Check for double freed callbacks */ @@ -159,7 +158,7 @@ static void devif_callback_free(FAR struct net_driver_s *dev, cb->nxtconn = g_cbfreelist; cb->nxtdev = NULL; g_cbfreelist = cb; - net_unlock(save); + net_unlock(); } } @@ -210,11 +209,10 @@ FAR struct devif_callback_s * FAR struct devif_callback_s **list) { FAR struct devif_callback_s *ret; - net_lock_t save; /* Check the head of the free list */ - save = net_lock(); + net_lock(); ret = g_cbfreelist; if (ret) { @@ -241,7 +239,7 @@ FAR struct devif_callback_s * /* No.. release the callback structure and fail */ devif_callback_free(NULL, NULL, list); - net_unlock(save); + net_unlock(); return NULL; } @@ -264,7 +262,7 @@ FAR struct devif_callback_s * } #endif - net_unlock(save); + net_unlock(); return ret; } @@ -385,13 +383,12 @@ uint16_t devif_conn_event(FAR struct net_driver_s *dev, void *pvconn, uint16_t flags, FAR struct devif_callback_s *list) { FAR struct devif_callback_s *next; - net_lock_t save; /* Loop for each callback in the list and while there are still events * set in the flags set. */ - save = net_lock(); + net_lock(); while (list && flags) { /* Save the pointer to the next callback in the lists. This is done @@ -419,7 +416,7 @@ uint16_t devif_conn_event(FAR struct net_driver_s *dev, void *pvconn, list = next; } - net_unlock(save); + net_unlock(); return flags; } @@ -450,13 +447,12 @@ uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, { FAR struct devif_callback_s *cb; FAR struct devif_callback_s *next; - net_lock_t save; /* Loop for each callback in the list and while there are still events * set in the flags set. */ - save = net_lock(); + net_lock(); for (cb = dev->d_devcb; cb != NULL && flags != 0; cb = next) { /* Save the pointer to the next callback in the lists. This is done @@ -484,7 +480,7 @@ uint16_t devif_dev_event(FAR struct net_driver_s *dev, void *pvconn, cb = next; } - net_unlock(save); + net_unlock(); return flags; } diff --git a/net/icmp/icmp_ping.c b/net/icmp/icmp_ping.c index 96dd811cce1eca51fc4d746794e2c18fec3ef6cd..e6f8961b4806593125b5295f1129dd5b370d8926 100644 --- a/net/icmp/icmp_ping.c +++ b/net/icmp/icmp_ping.c @@ -334,7 +334,6 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, { FAR struct net_driver_s *dev; struct icmp_ping_s state; - net_lock_t save; #ifdef CONFIG_NET_ARP_SEND int ret; #endif @@ -380,7 +379,7 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, state.png_datlen = datalen; /* The length of data to send in the ECHO request */ state.png_sent = false; /* ECHO request not yet sent */ - save = net_lock(); + net_lock(); state.png_time = clock_systimer(); /* Set up the callback */ @@ -410,7 +409,7 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, icmp_callback_free(dev, state.png_cb); } - net_unlock(save); + net_unlock(); /* Return the negated error number in the event of a failure, or the * sequence number of the ECHO reply on success. diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index 0e8fc688cd27b02af0faa2551c1dba0a8163c665..05a9c449265468b280b8d566db1e0ed6dff5f161 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -279,7 +279,6 @@ errout_with_semaphore: * Parameters: * dev - The device to use to send the solicitation * notify - The pre-initialized notification structure - * save - We will need this to temporarily release the net lock * * Returned Value: * Zero (OK) is returned on success; On error a negated errno value is @@ -291,8 +290,7 @@ errout_with_semaphore: ****************************************************************************/ static int icmpv6_wait_radvertise(FAR struct net_driver_s *dev, - FAR struct icmpv6_rnotify_s *notify, - net_lock_t *save) + FAR struct icmpv6_rnotify_s *notify) { struct timespec delay; int ret; @@ -353,7 +351,6 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) #else /* CONFIG_NET_ETHERNET */ struct icmpv6_rnotify_s notify; net_ipv6addr_t lladdr; - net_lock_t save; int retries; int ret; @@ -374,9 +371,9 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) /* The interface should be in the down state */ - save = net_lock(); + net_lock(); netdev_ifdown(dev); - net_unlock(save); + net_unlock(); /* IPv6 Stateless Autoconfiguration * Reference: http://www.tcpipguide.com/free/t_IPv6AutoconfigurationandRenumbering.htm @@ -415,9 +412,9 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) #ifdef CONFIG_NET_ICMPv6_NEIGHBOR /* Bring the interface up with no IP address */ - save = net_lock(); + net_lock(); netdev_ifup(dev); - net_unlock(save); + net_unlock(); /* 2. Link-Local Address Uniqueness Test: The node tests to ensure that * the address it generated isn't for some reason already in use on the @@ -435,9 +432,9 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) /* Take the interface back down */ - save = net_lock(); + net_lock(); netdev_ifdown(dev); - net_unlock(save); + net_unlock(); if (ret == OK) { @@ -456,7 +453,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) * on the wider Internet (since link-local addresses are not routed). */ - save = net_lock(); + net_lock(); net_ipv6addr_copy(dev->d_ipv6addr, lladdr); /* Bring the interface up with the new, temporary IP address */ @@ -489,7 +486,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) /* Wait to receive the Router Advertisement message */ - ret = icmpv6_wait_radvertise(dev, ¬ify, &save); + ret = icmpv6_wait_radvertise(dev, ¬ify); if (ret != -ETIMEDOUT) { /* ETIMEDOUT is the only expected failure. We will retry on that @@ -534,7 +531,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) * work out quite the way we wanted). */ - net_unlock(save); + net_unlock(); return ret; } @@ -557,7 +554,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev) */ netdev_ifup(dev); - net_unlock(save); + net_unlock(); return OK; #endif /* CONFIG_NET_ETHERNET */ } diff --git a/net/icmpv6/icmpv6_neighbor.c b/net/icmpv6/icmpv6_neighbor.c index 60f63660bd542af7eb67303fb033fed359940ec2..de7ba28046a9f58899951c60a9912c00c1f0b639 100644 --- a/net/icmpv6/icmpv6_neighbor.c +++ b/net/icmpv6/icmpv6_neighbor.c @@ -207,7 +207,6 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) struct timespec delay; struct icmpv6_neighbor_s state; FAR const uint16_t *lookup; - net_lock_t save; int ret; /* First check if destination is a local broadcast or a multicast address. @@ -295,7 +294,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) * want anything to happen until we are ready. */ - save = net_lock(); + net_lock(); state.snd_cb = icmpv6_callback_alloc(dev); if (!state.snd_cb) { @@ -404,7 +403,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) sem_destroy(&state.snd_sem); icmpv6_callback_free(dev, state.snd_cb); errout_with_lock: - net_unlock(save); + net_unlock(); errout: return ret; } diff --git a/net/icmpv6/icmpv6_ping.c b/net/icmpv6/icmpv6_ping.c index 839ac06e071a5bd7cde0c25960f98a03c31a2757..2d37890464e8f96a83505cdb445880a56585e3f3 100644 --- a/net/icmpv6/icmpv6_ping.c +++ b/net/icmpv6/icmpv6_ping.c @@ -408,7 +408,6 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno, { FAR struct net_driver_s *dev; struct icmpv6_ping_s state; - net_lock_t save; #ifdef CONFIG_NET_ICMPv6_NEIGHBOR int ret; @@ -454,7 +453,7 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno, net_ipv6addr_copy(state.png_addr, addr); /* Address of the peer to be ping'ed */ - save = net_lock(); + net_lock(); state.png_time = clock_systimer(); /* Set up the callback */ @@ -484,7 +483,7 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno, icmpv6_callback_free(dev, state.png_cb); } - net_unlock(save); + net_unlock(); /* Return the negated error number in the event of a failure, or the * sequence number of the ECHO reply on success. diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c index e93a502052aad6758dc27a91eb1de00641b062d9..a1fe865eb5b77413e00b2eceea1948821a545dd0 100644 --- a/net/igmp/igmp_group.c +++ b/net/igmp/igmp_group.c @@ -213,7 +213,6 @@ FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev, FAR const in_addr_t *addr) { FAR struct igmp_group_s *group; - net_lock_t flags; ninfo("addr: %08x dev: %p\n", *addr, dev); if (up_interrupt_context()) @@ -256,12 +255,12 @@ FAR struct igmp_group_s *igmp_grpalloc(FAR struct net_driver_s *dev, /* Interrupts must be disabled in order to modify the group list */ - flags = net_lock(); + net_lock(); /* Add the group structure to the list in the device structure */ sq_addfirst((FAR sq_entry_t *)group, &dev->grplist); - net_unlock(flags); + net_unlock(); } return group; @@ -282,7 +281,6 @@ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, FAR const in_addr_t *addr) { FAR struct igmp_group_s *group; - net_lock_t flags; grpinfo("Searching for addr %08x\n", (int)*addr); @@ -290,7 +288,7 @@ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, * called from. */ - flags = net_lock(); + net_lock(); for (group = (FAR struct igmp_group_s *)dev->grplist.head; group; group = group->next) @@ -303,7 +301,7 @@ FAR struct igmp_group_s *igmp_grpfind(FAR struct net_driver_s *dev, } } - net_unlock(flags); + net_unlock(); return group; } @@ -347,13 +345,11 @@ FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev, void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group) { - net_lock_t flags; - grpinfo("Free: %p flags: %02x\n", group, group->flags); /* Cancel the wdog */ - flags = net_lock(); + net_lock(); wd_cancel(group->wdog); /* Remove the group structure from the group list in the device structure */ @@ -377,7 +373,7 @@ void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group) { grpinfo("Put back on free list\n"); sq_addlast((FAR sq_entry_t *)group, &g_freelist); - net_unlock(flags); + net_unlock(); } else #endif @@ -386,7 +382,7 @@ void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group) * this function is executing within an interrupt handler. */ - net_unlock(flags); + net_unlock(); grpinfo("Call sched_kfree()\n"); sched_kfree(group); } diff --git a/net/igmp/igmp_leave.c b/net/igmp/igmp_leave.c index 8e40451101b68d76dc76531a64eabc501ff21967..2b7ee654b3f9cd875dc1173479c1653b01e4c0c7 100644 --- a/net/igmp/igmp_leave.c +++ b/net/igmp/igmp_leave.c @@ -127,7 +127,6 @@ int igmp_leavegroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) { struct igmp_group_s *group; - net_lock_t flags; DEBUGASSERT(dev && grpaddr); @@ -143,11 +142,11 @@ int igmp_leavegroup(struct net_driver_s *dev, FAR const struct in_addr *grpaddr) * could interfere with the Leave Group. */ - flags = net_lock(); + net_lock(); wd_cancel(group->wdog); CLR_SCHEDMSG(group->flags); CLR_WAITMSG(group->flags); - net_unlock(flags); + net_unlock(); IGMP_STATINCR(g_netstats.igmp.leaves); diff --git a/net/igmp/igmp_msg.c b/net/igmp/igmp_msg.c index 3fd56fc3814ddb19d870191df5f742437a7e9c9b..0b5065f3ec857e43bc2ebe3539db7ad4a700f7eb 100644 --- a/net/igmp/igmp_msg.c +++ b/net/igmp/igmp_msg.c @@ -72,15 +72,13 @@ void igmp_schedmsg(FAR struct igmp_group_s *group, uint8_t msgid) { - net_lock_t flags; - /* The following should be atomic */ - flags = net_lock(); + net_lock(); DEBUGASSERT(!IS_SCHEDMSG(group->flags)); group->msgid = msgid; SET_SCHEDMSG(group->flags); - net_unlock(flags); + net_unlock(); } /**************************************************************************** @@ -98,11 +96,9 @@ void igmp_schedmsg(FAR struct igmp_group_s *group, uint8_t msgid) void igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid) { - net_lock_t flags; - /* Schedule to send the message */ - flags = net_lock(); + net_lock(); DEBUGASSERT(!IS_WAITMSG(group->flags)); SET_WAITMSG(group->flags); igmp_schedmsg(group, msgid); @@ -126,7 +122,7 @@ void igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid) /* The message has been sent and we are no longer waiting */ CLR_WAITMSG(group->flags); - net_unlock(flags); + net_unlock(); } #endif /* CONFIG_NET_IGMP */ diff --git a/net/igmp/igmp_timer.c b/net/igmp/igmp_timer.c index e413eb75fb8879a46a502841f3d59335e27c5443..9019376a4e561c53478791d4ce03633f3f0b4184 100644 --- a/net/igmp/igmp_timer.c +++ b/net/igmp/igmp_timer.c @@ -196,14 +196,13 @@ void igmp_starttimer(FAR struct igmp_group_s *group, uint8_t decisecs) bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks) { - net_lock_t flags; int remaining; /* Disable interrupts so that there is no race condition with the actual * timer expiration. */ - flags = net_lock(); + net_lock(); /* Get the timer remaining on the watchdog. A time of <= zero means that * the watchdog was never started. @@ -222,11 +221,11 @@ bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks) /* Cancel the watchdog timer and return true */ wd_cancel(group->wdog); - net_unlock(flags); + net_unlock(); return true; } - net_unlock(flags); + net_unlock(); return false; } diff --git a/net/local/local_connect.c b/net/local/local_connect.c index b336b370b3ed7dd749998b4803b7f102562c7ec6..53dd3219055629c6c1286a09dcb71172d7b4a2e0 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -123,7 +123,7 @@ static inline void _local_semtake(sem_t *sem) int inline local_stream_connect(FAR struct local_conn_s *client, FAR struct local_conn_s *server, - bool nonblock, net_lock_t state) + bool nonblock) { int ret; @@ -135,7 +135,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, if (server->lc_state != LOCAL_STATE_LISTENING || server->u.server.lc_pending >= server->u.server.lc_backlog) { - net_unlock(state); + net_unlock(); nerr("ERROR: Server is not listening: lc_state=%d\n", server->lc_state); nerr(" OR: The backlog limit was reached: %d or %d\n", @@ -156,7 +156,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, nerr("ERROR: Failed to create FIFOs for %s: %d\n", client->lc_path, ret); - net_unlock(state); + net_unlock(); return ret; } @@ -170,7 +170,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n", client->lc_path, ret); - net_unlock(state); + net_unlock(); goto errout_with_fifos; } @@ -182,7 +182,7 @@ int inline local_stream_connect(FAR struct local_conn_s *client, client->lc_state = LOCAL_STATE_ACCEPT; local_accept_pollnotify(server, POLLIN); _local_semgive(&server->lc_waitsem); - net_unlock(state); + net_unlock(); /* Wait for the server to accept the connections */ @@ -257,7 +257,6 @@ int psock_local_connect(FAR struct socket *psock, FAR struct local_conn_s *client; FAR struct sockaddr_un *unaddr = (FAR struct sockaddr_un *)addr; FAR struct local_conn_s *conn; - net_lock_t state; DEBUGASSERT(psock && psock->s_conn); client = (FAR struct local_conn_s *)psock->s_conn; @@ -270,7 +269,7 @@ int psock_local_connect(FAR struct socket *psock, /* Find the matching server connection */ - state = net_lock(); + net_lock(); for (conn = (FAR struct local_conn_s *)g_local_listeners.head; conn; conn = (FAR struct local_conn_s *)dq_next(&conn->lc_node)) @@ -290,7 +289,7 @@ int psock_local_connect(FAR struct socket *psock, case LOCAL_TYPE_ABSTRACT: /* lc_path is length zero */ { #warning Missing logic - net_unlock(state); + net_unlock(); return OK; } break; @@ -317,12 +316,11 @@ int psock_local_connect(FAR struct socket *psock, if (conn->lc_proto == SOCK_STREAM) { ret = local_stream_connect(client, conn, - _SS_ISNONBLOCK(psock->s_flags), - state); + _SS_ISNONBLOCK(psock->s_flags)); } else { - net_unlock(state); + net_unlock(); } return ret; @@ -335,13 +333,13 @@ int psock_local_connect(FAR struct socket *psock, case LOCAL_TYPE_UNTYPED: /* Type is not determined until the socket is bound */ { - net_unlock(state); + net_unlock(); return -EINVAL; } } } - net_unlock(state); + net_unlock(); return -EADDRNOTAVAIL; } diff --git a/net/local/local_listen.c b/net/local/local_listen.c index 712055c9cefa659e0f9b747f1bfa297a0e5d1f4e..a1020570e7731cd24acb4f9d55d198b9e6255f10 100644 --- a/net/local/local_listen.c +++ b/net/local/local_listen.c @@ -84,7 +84,6 @@ dq_queue_t g_local_listeners; int local_listen(FAR struct local_conn_s *server, int backlog) { - net_lock_t state; /* Some sanity checks */ @@ -118,9 +117,9 @@ int local_listen(FAR struct local_conn_s *server, int backlog) /* Add the connection structure to the list of listeners */ - state = net_lock(); + net_lock(); dq_addlast(&server->lc_node, &g_local_listeners); - net_unlock(state); + net_unlock(); /* And change the server state to listing */ diff --git a/net/local/local_netpoll.c b/net/local/local_netpoll.c index 9800af3172c1b11ee0c629b6359bae99090d02d7..f9e087b36d98b4714d6dcb43c499aa11031d13a4 100644 --- a/net/local/local_netpoll.c +++ b/net/local/local_netpoll.c @@ -62,12 +62,11 @@ static int local_accept_pollsetup(FAR struct local_conn_s *conn, FAR struct pollfd *fds, bool setup) { - net_lock_t state; pollevent_t eventset; int ret = OK; int i; - state = net_lock(); + net_lock(); if (setup) { /* This is a request to set up the poll. Find an available @@ -125,7 +124,7 @@ static int local_accept_pollsetup(FAR struct local_conn_s *conn, } errout: - net_unlock(state); + net_unlock(); return ret; } #endif diff --git a/net/local/local_release.c b/net/local/local_release.c index 29ea65f2f3b0dacacbb6d344ec9014cf1c3683c3..0d2bf42f8038f4969b17dbff6964e0be2f6f6355 100644 --- a/net/local/local_release.c +++ b/net/local/local_release.c @@ -69,12 +69,11 @@ int local_release(FAR struct local_conn_s *conn) { - net_lock_t state; /* There should be no references on this structure */ DEBUGASSERT(conn->lc_crefs == 0); - state = net_lock(); + net_lock(); #ifdef CONFIG_NET_LOCAL_STREAM /* We should not bet here with state LOCAL_STATE_ACCEPT. That is an @@ -126,7 +125,7 @@ int local_release(FAR struct local_conn_s *conn) /* Free the connection structure */ local_free(conn); - net_unlock(state); + net_unlock(); return OK; } diff --git a/net/neighbor/neighbor_out.c b/net/neighbor/neighbor_out.c index c00253ffe3eedaec1dbd6a678b6bea6cdba52dfe..4725a90ea274aa2fc1f273f3e05a6773665c84cb 100644 --- a/net/neighbor/neighbor_out.c +++ b/net/neighbor/neighbor_out.c @@ -120,13 +120,13 @@ static const uint8_t g_multicast_ethaddr[3] = * beginning of the packet and the function returns. * * If no Neighbor Table entry is found for the destination IPv6 address, - * the packet in the d_buf[] is replaced by an ICMPv6 Neighbor Solicit + * the packet in the d_buf is replaced by an ICMPv6 Neighbor Solicit * request packet for the IPv6 address. The IPv6 packet is dropped and * it is assumed that the higher level protocols (e.g., TCP) eventually * will retransmit the dropped packet. * * Upon return in either the case, a packet to be sent is present in the - * d_buf[] buffer and the d_len field holds the length of the Ethernet + * d_buf buffer and the d_len field holds the length of the Ethernet * frame that should be transmitted. * ****************************************************************************/ diff --git a/net/netdev/netdev_count.c b/net/netdev/netdev_count.c index 73ff960f3d84740689cd1188341db27014802073..171039caf6d5c16ba68df1642521d4a1aba9647f 100644 --- a/net/netdev/netdev_count.c +++ b/net/netdev/netdev_count.c @@ -72,12 +72,11 @@ int netdev_count(void) { struct net_driver_s *dev; - net_lock_t save; int ndev; - save = net_lock(); + net_lock(); for (dev = g_netdevices, ndev = 0; dev; dev = dev->flink, ndev++); - net_unlock(save); + net_unlock(); return ndev; } diff --git a/net/netdev/netdev_default.c b/net/netdev/netdev_default.c index 24884259a7da42bfbcc58e51d40073a23a7f79ea..331f50343d18d049d1d7cab784fb2795f1a0bb86 100644 --- a/net/netdev/netdev_default.c +++ b/net/netdev/netdev_default.c @@ -76,11 +76,10 @@ FAR struct net_driver_s *netdev_default(void) { FAR struct net_driver_s *dev; - net_lock_t save; /* Examine each registered network device */ - save = net_lock(); + net_lock(); for (dev = g_netdevices; dev; dev = dev->flink) { /* Is the interface in the "up" state? */ @@ -91,12 +90,12 @@ FAR struct net_driver_s *netdev_default(void) * state. */ - net_unlock(save); + net_unlock(); return dev; } } - net_unlock(save); + net_unlock(); return NULL; } diff --git a/net/netdev/netdev_findbyaddr.c b/net/netdev/netdev_findbyaddr.c index 54cf1cee35ad13bfe4dcf681b7e81e84ddc8777c..25fbc02b8d1f9c9c6f94869179a18185c05cc18f 100644 --- a/net/netdev/netdev_findbyaddr.c +++ b/net/netdev/netdev_findbyaddr.c @@ -82,11 +82,10 @@ static FAR struct net_driver_s *netdev_finddevice_ipv4addr(in_addr_t ripaddr) { FAR struct net_driver_s *dev; - net_lock_t save; /* Examine each registered network device */ - save = net_lock(); + net_lock(); for (dev = g_netdevices; dev; dev = dev->flink) { /* Is the interface in the "up" state? */ @@ -100,7 +99,7 @@ static FAR struct net_driver_s *netdev_finddevice_ipv4addr(in_addr_t ripaddr) { /* Its a match */ - net_unlock(save); + net_unlock(); return dev; } } @@ -108,7 +107,7 @@ static FAR struct net_driver_s *netdev_finddevice_ipv4addr(in_addr_t ripaddr) /* No device with the matching address found */ - net_unlock(save); + net_unlock(); return NULL; } #endif /* CONFIG_NET_IPv4 */ @@ -137,11 +136,10 @@ static FAR struct net_driver_s * netdev_finddevice_ipv6addr(const net_ipv6addr_t ripaddr) { FAR struct net_driver_s *dev; - net_lock_t save; /* Examine each registered network device */ - save = net_lock(); + net_lock(); for (dev = g_netdevices; dev; dev = dev->flink) { /* Is the interface in the "up" state? */ @@ -155,7 +153,7 @@ netdev_finddevice_ipv6addr(const net_ipv6addr_t ripaddr) { /* Its a match */ - net_unlock(save); + net_unlock(); return dev; } } @@ -163,7 +161,7 @@ netdev_finddevice_ipv6addr(const net_ipv6addr_t ripaddr) /* No device with the matching address found */ - net_unlock(save); + net_unlock(); return NULL; } #endif /* CONFIG_NET_IPv6 */ diff --git a/net/netdev/netdev_findbyindex.c b/net/netdev/netdev_findbyindex.c index 74ccba04c843322c50086f37400ea2cbb8485949..f17bba0b7c60c58b5fa64e712796b81f76d40781 100644 --- a/net/netdev/netdev_findbyindex.c +++ b/net/netdev/netdev_findbyindex.c @@ -78,20 +78,19 @@ FAR struct net_driver_s *netdev_findbyindex(int index) { #ifdef CONFIG_NETDEV_MULTINIC FAR struct net_driver_s *dev; - net_lock_t save; int i; - save = net_lock(); + net_lock(); for (i = 0, dev = g_netdevices; dev; i++, dev = dev->flink) { if (i == index) { - net_unlock(save); + net_unlock(); return dev; } } - net_unlock(save); + net_unlock(); return NULL; #else return (index == 0) ? g_netdevices : NULL; diff --git a/net/netdev/netdev_findbyname.c b/net/netdev/netdev_findbyname.c index 04c20b27c8e844b40cfb8be33e9a076b93af1080..944489a2d023fdc7726ebd4a18a3ffabd338e53d 100644 --- a/net/netdev/netdev_findbyname.c +++ b/net/netdev/netdev_findbyname.c @@ -73,21 +73,20 @@ FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname) { FAR struct net_driver_s *dev; - net_lock_t save; if (ifname) { - save = net_lock(); + net_lock(); for (dev = g_netdevices; dev; dev = dev->flink) { if (strcmp(ifname, dev->d_ifname) == 0) { - net_unlock(save); + net_unlock(); return dev; } } - net_unlock(save); + net_unlock(); } return NULL; diff --git a/net/netdev/netdev_foreach.c b/net/netdev/netdev_foreach.c index 99d6a8c061f487f9ab41c362d2f4a83a602066b4..11df953902ed47da09f070e4a63721596cbe6e9d 100644 --- a/net/netdev/netdev_foreach.c +++ b/net/netdev/netdev_foreach.c @@ -73,12 +73,11 @@ int netdev_foreach(netdev_callback_t callback, FAR void *arg) { FAR struct net_driver_s *dev; - net_lock_t save; int ret = 0; if (callback) { - save = net_lock(); + net_lock(); for (dev = g_netdevices; dev; dev = dev->flink) { if (callback(dev, arg) != 0) @@ -88,7 +87,7 @@ int netdev_foreach(netdev_callback_t callback, FAR void *arg) } } - net_unlock(save); + net_unlock(); } return ret; diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index 81bfe8232b3305257812890884656df9d04aa810..a2144d2288bbfd4f9e20ef053417251b71c27ee7 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -178,7 +178,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) #ifdef CONFIG_NET_USER_DEVFMT FAR const char devfmt_str[IFNAMSIZ]; #endif - net_lock_t save; int devnum; if (dev) @@ -271,7 +270,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) * the interface */ - save = net_lock(); + net_lock(); #ifdef CONFIG_NET_MULTILINK # ifdef CONFIG_NET_LOOPBACK @@ -316,7 +315,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype) #ifdef CONFIG_NET_IGMP igmp_devinit(dev); #endif - net_unlock(save); + net_unlock(); #ifdef CONFIG_NET_ETHERNET ninfo("Registered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n", diff --git a/net/netdev/netdev_unregister.c b/net/netdev/netdev_unregister.c index 405118e308a39a04618feacc0488634d68546bb6..6d56ad70f4351709766cda5b0c85bfdb76cf0226 100644 --- a/net/netdev/netdev_unregister.c +++ b/net/netdev/netdev_unregister.c @@ -91,11 +91,10 @@ int netdev_unregister(FAR struct net_driver_s *dev) { struct net_driver_s *prev; struct net_driver_s *curr; - net_lock_t save; if (dev) { - save = net_lock(); + net_lock(); /* Find the device in the list of known network devices */ @@ -125,7 +124,7 @@ int netdev_unregister(FAR struct net_driver_s *dev) curr->flink = NULL; } - net_unlock(save); + net_unlock(); #ifdef CONFIG_NET_ETHERNET ninfo("Unregistered MAC: %02x:%02x:%02x:%02x:%02x:%02x as dev: %s\n", diff --git a/net/netdev/netdev_verify.c b/net/netdev/netdev_verify.c index 8fdd42b53a529527e600a665af04a1d31f6f47e5..ee3031ea783b4bb72ef0b1a38b6dd7b1438c59e1 100644 --- a/net/netdev/netdev_verify.c +++ b/net/netdev/netdev_verify.c @@ -64,12 +64,11 @@ bool netdev_verify(FAR struct net_driver_s *dev) { FAR struct net_driver_s *chkdev; - net_lock_t save; bool valid = false; /* Search the list of registered devices */ - save = net_lock(); + net_lock(); for (chkdev = g_netdevices; chkdev != NULL; chkdev = chkdev->flink) { /* Is the the network device that we are looking for? */ @@ -83,6 +82,6 @@ bool netdev_verify(FAR struct net_driver_s *dev) } } - net_unlock(save); + net_unlock(); return valid; } diff --git a/net/pkt/pkt_send.c b/net/pkt/pkt_send.c index b4dc0d6d4515cbfb16db8e897d925ead2ccd6e7e..fa5bda318b18a5e48c8d8c8a88efd55ca81708cf 100644 --- a/net/pkt/pkt_send.c +++ b/net/pkt/pkt_send.c @@ -213,7 +213,6 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf, { FAR struct net_driver_s *dev; struct send_s state; - net_lock_t save; int errcode; int ret = OK; @@ -245,7 +244,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf, * are ready. */ - save = net_lock(); + net_lock(); memset(&state, 0, sizeof(struct send_s)); /* This semaphore is used for signaling and, hence, should not have @@ -293,7 +292,7 @@ ssize_t psock_pkt_send(FAR struct socket *psock, FAR const void *buf, } sem_destroy(&state.snd_sem); - net_unlock(save); + net_unlock(); /* Set the socket state to idle */ diff --git a/net/route/net_addroute.c b/net/route/net_addroute.c index 3451a1691e9a8c24aabb178f8c408b248ecf2c8a..1f75944ec502464721667c4b8277eaae2f43d591 100644 --- a/net/route/net_addroute.c +++ b/net/route/net_addroute.c @@ -74,7 +74,6 @@ int net_addroute(in_addr_t target, in_addr_t netmask, in_addr_t router) { FAR struct net_route_s *route; - net_lock_t save; /* Allocate a route entry */ @@ -93,12 +92,12 @@ int net_addroute(in_addr_t target, in_addr_t netmask, in_addr_t router) /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_routes); - net_unlock(save); + net_unlock(); return OK; } #endif @@ -107,7 +106,6 @@ int net_addroute(in_addr_t target, in_addr_t netmask, in_addr_t router) int net_addroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask, net_ipv6addr_t router) { FAR struct net_route_ipv6_s *route; - net_lock_t save; /* Allocate a route entry */ @@ -126,12 +124,12 @@ int net_addroute_ipv6(net_ipv6addr_t target, net_ipv6addr_t netmask, net_ipv6add /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_routes_ipv6); - net_unlock(save); + net_unlock(); return OK; } #endif diff --git a/net/route/net_allocroute.c b/net/route/net_allocroute.c index 5c278a9a039189905df0874451da0105d01b852b..8c0cfdd02f3101f661a37c5fd454e0c6e52a03c0 100644 --- a/net/route/net_allocroute.c +++ b/net/route/net_allocroute.c @@ -161,18 +161,17 @@ void net_initroute(void) FAR struct net_route_s *net_allocroute(void) { FAR struct net_route_s *route; - net_lock_t save; /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ route = (FAR struct net_route_s *) sq_remfirst((FAR sq_queue_t *)&g_freeroutes); - net_unlock(save); + net_unlock(); return route; } #endif @@ -181,24 +180,23 @@ FAR struct net_route_s *net_allocroute(void) FAR struct net_route_ipv6_s *net_allocroute_ipv6(void) { FAR struct net_route_ipv6_s *route; - net_lock_t save; /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ route = (FAR struct net_route_ipv6_s *) sq_remfirst((FAR sq_queue_t *)&g_freeroutes_ipv6); - net_unlock(save); + net_unlock(); return route; } #endif /**************************************************************************** - * Function: net_allocroute + * Function: net_freeroute * * Description: * Free one route by adding it from the free list @@ -214,36 +212,32 @@ FAR struct net_route_ipv6_s *net_allocroute_ipv6(void) #ifdef CONFIG_NET_IPv4 void net_freeroute(FAR struct net_route_s *route) { - net_lock_t save; - DEBUGASSERT(route); /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_freeroutes); - net_unlock(save); + net_unlock(); } #endif #ifdef CONFIG_NET_IPv6 void net_freeroute_ipv6(FAR struct net_route_ipv6_s *route) { - net_lock_t save; - DEBUGASSERT(route); /* Get exclusive address to the networking data structures */ - save = net_lock(); + net_lock(); /* Then add the new entry to the table */ sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_freeroutes_ipv6); - net_unlock(save); + net_unlock(); } #endif diff --git a/net/route/net_foreachroute.c b/net/route/net_foreachroute.c index 1c5789dd64910885b92dad800021260d541019c8..b9e52051afb53ab95745e047a50307e396507ce6 100644 --- a/net/route/net_foreachroute.c +++ b/net/route/net_foreachroute.c @@ -72,12 +72,11 @@ int net_foreachroute(route_handler_t handler, FAR void *arg) { FAR struct net_route_s *route; FAR struct net_route_s *next; - net_lock_t save; int ret = 0; /* Prevent concurrent access to the routing table */ - save = net_lock(); + net_lock(); /* Visit each entry in the routing table */ @@ -93,7 +92,7 @@ int net_foreachroute(route_handler_t handler, FAR void *arg) /* Unlock the network */ - net_unlock(save); + net_unlock(); return ret; } #endif @@ -103,12 +102,11 @@ int net_foreachroute_ipv6(route_handler_ipv6_t handler, FAR void *arg) { FAR struct net_route_ipv6_s *route; FAR struct net_route_ipv6_s *next; - net_lock_t save; int ret = 0; /* Prevent concurrent access to the routing table */ - save = net_lock(); + net_lock(); /* Visit each entry in the routing table */ @@ -124,7 +122,7 @@ int net_foreachroute_ipv6(route_handler_ipv6_t handler, FAR void *arg) /* Unlock the network */ - net_unlock(save); + net_unlock(); return ret; } #endif diff --git a/net/socket/accept.c b/net/socket/accept.c index 59fa329bd8947aa5cfa6f01f231caedb65483b94..4bf35dc7f21a61b981c18f48909acb9f467d65fd 100644 --- a/net/socket/accept.c +++ b/net/socket/accept.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/socket/accept.c * - * Copyright (C) 2007-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include +#include #include #include "tcp/tcp.h" @@ -132,6 +133,10 @@ int psock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, DEBUGASSERT(psock != NULL); + /* Treat as a cancellation point */ + + (void)enter_cancellation_point(); + /* Is the socket a stream? */ if (psock->s_type != SOCK_STREAM) @@ -233,15 +238,13 @@ int psock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, else #endif { - net_lock_t state; - /* Perform the local accept operation (with the network locked) */ - state = net_lock(); + net_lock(); ret = psock_tcp_accept(psock, addr, addrlen, &newsock->s_conn); if (ret < 0) { - net_unlock(state); + net_unlock(); errcode = -ret; goto errout; } @@ -258,12 +261,12 @@ int psock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, * called. Undo everything we have done and return a failure. */ - net_unlock(state); + net_unlock(); errcode = -ret; goto errout_after_accept; } - net_unlock(state); + net_unlock(); } #endif /* CONFIG_NET_TCP */ @@ -271,6 +274,8 @@ int psock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, newsock->s_flags |= _SF_CONNECTED; newsock->s_flags &= ~_SF_CLOSED; + + leave_cancellation_point(); return OK; errout_after_accept: @@ -278,6 +283,7 @@ errout_after_accept: errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } @@ -357,6 +363,10 @@ int accept(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) int errcode; int ret; + /* accept() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify that the sockfd corresponds to valid, allocated socket */ if (psock == NULL || psock->s_crefs <= 0) @@ -404,9 +414,11 @@ int accept(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) /* The errno value has already been set */ sockfd_release(newfd); + leave_cancellation_point(); return ERROR; } + leave_cancellation_point(); return newfd; errout_with_socket: @@ -414,6 +426,7 @@ errout_with_socket: errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } diff --git a/net/socket/connect.c b/net/socket/connect.c index 3e174ae0b3a335032cd188a8ac5bb9bb73050c63..6a0140ea55a7992ee1e046aae7e41df912467858 100644 --- a/net/socket/connect.c +++ b/net/socket/connect.c @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -346,7 +347,6 @@ static inline int psock_tcp_connect(FAR struct socket *psock, FAR const struct sockaddr *addr) { struct tcp_connect_s state; - net_lock_t flags; int ret = OK; /* Interrupts must be disabled through all of the following because @@ -354,7 +354,7 @@ static inline int psock_tcp_connect(FAR struct socket *psock, * setup. */ - flags = net_lock(); + net_lock(); /* Get the connection reference from the socket */ @@ -431,7 +431,7 @@ static inline int psock_tcp_connect(FAR struct socket *psock, } } - net_unlock(flags); + net_unlock(); return ret; } #endif /* CONFIG_NET_TCP */ @@ -517,6 +517,10 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr, #endif int errcode; + /* Treat as a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify that the psock corresponds to valid, allocated socket */ if (!psock || psock->s_crefs <= 0) @@ -664,10 +668,12 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr, goto errout; } + leave_cancellation_point(); return OK; errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } @@ -742,13 +748,21 @@ errout: int connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen) { + int ret; + + /* accept() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Get the underlying socket structure */ FAR struct socket *psock = sockfd_socket(sockfd); /* Then let psock_connect() do all of the work */ - return psock_connect(psock, addr, addrlen); + ret = psock_connect(psock, addr, addrlen); + leave_cancellation_point(); + return ret; } #endif /* CONFIG_NET */ diff --git a/net/socket/getsockname.c b/net/socket/getsockname.c index 3b895525ef40e4c1d1d0de7d686e36d01cdf4d4d..7bf87c29d120e651684c438d08c807487edee99c 100644 --- a/net/socket/getsockname.c +++ b/net/socket/getsockname.c @@ -99,7 +99,6 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, in_addr_t lipaddr; in_addr_t ripaddr; #endif - net_lock_t save; /* Check if enough space has been provided for the full address */ @@ -152,7 +151,7 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, * a single network device and only the network device knows the IP address. */ - save = net_lock(); + net_lock(); #ifdef CONFIG_NETDEV_MULTINIC /* Find the device matching the IPv4 address in the connection structure */ @@ -166,7 +165,7 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, if (!dev) { - net_unlock(save); + net_unlock(); return -EINVAL; } @@ -177,7 +176,7 @@ int ipv4_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, outaddr->sin_addr.s_addr = dev->d_ipaddr; *addrlen = sizeof(struct sockaddr_in); #endif - net_unlock(save); + net_unlock(); /* Return success */ @@ -223,7 +222,6 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, net_ipv6addr_t *lipaddr; net_ipv6addr_t *ripaddr; #endif - net_lock_t save; /* Check if enough space has been provided for the full address */ @@ -276,7 +274,7 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, * a single network device and only the network device knows the IP address. */ - save = net_lock(); + net_lock(); #ifdef CONFIG_NETDEV_MULTINIC /* Find the device matching the IPv6 address in the connection structure */ @@ -290,7 +288,7 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, if (!dev) { - net_unlock(save); + net_unlock(); return -EINVAL; } @@ -301,7 +299,7 @@ int ipv6_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, memcpy(outaddr->sin6_addr.in6_u.u6_addr8, dev->d_ipv6addr, 16); *addrlen = sizeof(struct sockaddr_in6); #endif - net_unlock(save); + net_unlock(); /* Return success */ diff --git a/net/socket/net_clone.c b/net/socket/net_clone.c index e76f4ed2ceead7d06e84392039640bec04a4c332..5398c614fdf6dc9abdc4b2b307797949b83bd72e 100644 --- a/net/socket/net_clone.c +++ b/net/socket/net_clone.c @@ -66,12 +66,11 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2) { - net_lock_t flags; int ret = OK; /* Parts of this operation need to be atomic */ - flags = net_lock(); + net_lock(); /* Duplicate the socket state */ @@ -120,7 +119,7 @@ int net_clone(FAR struct socket *psock1, FAR struct socket *psock2) ret = -EBADF; } - net_unlock(flags); + net_unlock(); return ret; } diff --git a/net/socket/net_close.c b/net/socket/net_close.c index 3ca53d30de34c6c671a6a75cd6ad1b4705caa2d0..ba0fb85dc1d2e8a0e83ba0ebcc6bbe2245de1d47 100644 --- a/net/socket/net_close.c +++ b/net/socket/net_close.c @@ -337,7 +337,6 @@ static inline int netclose_disconnect(FAR struct socket *psock) { struct tcp_close_s state; FAR struct tcp_conn_s *conn; - net_lock_t flags; #ifdef CONFIG_NET_SOLINGER bool linger; #endif @@ -345,7 +344,7 @@ static inline int netclose_disconnect(FAR struct socket *psock) /* Interrupts are disabled here to avoid race conditions */ - flags = net_lock(); + net_lock(); conn = (FAR struct tcp_conn_s *)psock->s_conn; /* If we have a semi-permanent write buffer callback in place, then @@ -449,7 +448,7 @@ static inline int netclose_disconnect(FAR struct socket *psock) tcp_free(conn); } - net_unlock(flags); + net_unlock(); return ret; } #endif /* CONFIG_NET_TCP */ diff --git a/net/socket/net_monitor.c b/net/socket/net_monitor.c index d7d566725ba0456153592cb3a938908224a0f86a..cee6a13cd941bd84609339df7161657f49dab2be 100644 --- a/net/socket/net_monitor.c +++ b/net/socket/net_monitor.c @@ -216,7 +216,6 @@ int net_startmonitor(FAR struct socket *psock) { FAR struct tcp_conn_s *conn; FAR struct devif_callback_s *cb; - net_lock_t save; DEBUGASSERT(psock != NULL && psock->s_conn != NULL); conn = (FAR struct tcp_conn_s *)psock->s_conn; @@ -226,7 +225,7 @@ int net_startmonitor(FAR struct socket *psock) * registered the monitoring callback.) */ - save = net_lock(); + net_lock(); if (!(conn->tcpstateflags == TCP_ESTABLISHED || conn->tcpstateflags == TCP_SYN_RCVD)) { @@ -244,7 +243,7 @@ int net_startmonitor(FAR struct socket *psock) * because the socket was already disconnected. */ - net_unlock(save); + net_unlock(); return -ENOTCONN; } @@ -270,7 +269,7 @@ int net_startmonitor(FAR struct socket *psock) conn->connection_private = (FAR void *)psock; conn->connection_event = connection_event; - net_unlock(save); + net_unlock(); return OK; } @@ -294,13 +293,11 @@ int net_startmonitor(FAR struct socket *psock) void net_stopmonitor(FAR struct tcp_conn_s *conn) { - net_lock_t save; - DEBUGASSERT(conn); /* Free any allocated device event callback structure */ - save = net_lock(); + net_lock(); if (conn->connection_devcb) { tcp_monitor_callback_free(conn, conn->connection_devcb); @@ -311,7 +308,7 @@ void net_stopmonitor(FAR struct tcp_conn_s *conn) conn->connection_private = NULL; conn->connection_devcb = NULL; conn->connection_event = NULL; - net_unlock(save); + net_unlock(); } /**************************************************************************** @@ -335,19 +332,17 @@ void net_stopmonitor(FAR struct tcp_conn_s *conn) void net_lostconnection(FAR struct socket *psock, uint16_t flags) { - net_lock_t save; - DEBUGASSERT(psock != NULL && psock->s_conn != NULL); /* Close the connection */ - save = net_lock(); + net_lock(); connection_closed(psock, flags); /* Stop the network monitor */ net_stopmonitor((FAR struct tcp_conn_s *)psock->s_conn); - net_unlock(save); + net_unlock(); } #endif /* CONFIG_NET && CONFIG_NET_TCP */ diff --git a/net/socket/net_sendfile.c b/net/socket/net_sendfile.c index 1efb22d1c8b777871a3f9ea933113ebd4b3dd241..617bce53972d8dd17599d903b58af31ac6ac1dc9 100644 --- a/net/socket/net_sendfile.c +++ b/net/socket/net_sendfile.c @@ -604,7 +604,6 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, FAR struct socket *psock = sockfd_socket(outfd); FAR struct tcp_conn_s *conn; struct sendfile_s state; - net_lock_t save; int errcode; /* Verify that the sockfd corresponds to valid, allocated socket */ @@ -673,7 +672,7 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, * are ready. */ - save = net_lock(); + net_lock(); memset(&state, 0, sizeof(struct sendfile_s)); /* This semaphore is used for signaling and, hence, should not have @@ -757,7 +756,7 @@ errout_datacb: errout_locked: sem_destroy(&state. snd_sem); - net_unlock(save); + net_unlock(); errout: diff --git a/net/socket/net_vfcntl.c b/net/socket/net_vfcntl.c index 977db7833ad22312593970134492d60041b5f103..b260edb5b0a27b8a0ff4232e682aa45b38981117 100644 --- a/net/socket/net_vfcntl.c +++ b/net/socket/net_vfcntl.c @@ -76,7 +76,6 @@ int net_vfcntl(int sockfd, int cmd, va_list ap) { FAR struct socket *psock = sockfd_socket(sockfd); - net_lock_t flags; int errcode = 0; int ret = 0; @@ -92,7 +91,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap) /* Interrupts must be disabled in order to perform operations on socket structures */ - flags = net_lock(); + net_lock(); switch (cmd) { case F_DUPFD: @@ -271,7 +270,7 @@ int net_vfcntl(int sockfd, int cmd, va_list ap) break; } - net_unlock(flags); + net_unlock(); errout: if (errcode != 0) diff --git a/net/socket/recv.c b/net/socket/recv.c index 412ed6e0d0b5cc8cfce3dc2f99570fd32c3e483d..2e590c0b7154ab5612bc0fb633c24bfbc55808fb 100644 --- a/net/socket/recv.c +++ b/net/socket/recv.c @@ -71,6 +71,8 @@ ssize_t recv(int sockfd, FAR void *buf, size_t len, int flags) { + /* recv is a cancellation point, but that can all be handled by recvfrom */ + return recvfrom(sockfd, buf, len, flags, NULL, 0); } diff --git a/net/socket/recvfrom.c b/net/socket/recvfrom.c index 046860b75fd9c29b7b168d4a7091f634229f2538..9a692fea8aa83c620a6dc630d96f78efa48811ae 100644 --- a/net/socket/recvfrom.c +++ b/net/socket/recvfrom.c @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -1395,7 +1396,6 @@ static ssize_t pkt_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, FAR struct pkt_conn_s *conn = (FAR struct pkt_conn_s *)psock->s_conn; FAR struct net_driver_s *dev; struct recvfrom_s state; - net_lock_t save; int ret; /* Perform the packet recvfrom() operation */ @@ -1405,7 +1405,7 @@ static ssize_t pkt_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, * are ready. */ - save = net_lock(); + net_lock(); recvfrom_init(psock, buf, len, from, fromlen, &state); /* Get the device driver that will service this transfer */ @@ -1463,7 +1463,7 @@ static ssize_t pkt_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, } errout_with_state: - net_unlock(save); + net_unlock(); recvfrom_uninit(&state); return ret; } @@ -1496,7 +1496,6 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, FAR struct udp_conn_s *conn = (FAR struct udp_conn_s *)psock->s_conn; FAR struct net_driver_s *dev; struct recvfrom_s state; - net_lock_t save; int ret; /* Perform the UDP recvfrom() operation */ @@ -1506,7 +1505,7 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, * are ready. */ - save = net_lock(); + net_lock(); recvfrom_init(psock, buf, len, from, fromlen, &state); /* Setup the UDP remote connection */ @@ -1604,7 +1603,7 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, } errout_with_state: - net_unlock(save); + net_unlock(); recvfrom_uninit(&state); return ret; } @@ -1634,16 +1633,15 @@ errout_with_state: static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, FAR struct sockaddr *from, FAR socklen_t *fromlen) { - struct recvfrom_s state; - net_lock_t save; - int ret; + struct recvfrom_s state; + int ret; /* Initialize the state structure. This is done with interrupts * disabled because we don't want anything to happen until we * are ready. */ - save = net_lock(); + net_lock(); recvfrom_init(psock, buf, len, from, fromlen, &state); /* Handle any any TCP data already buffered in a read-ahead buffer. NOTE @@ -1783,7 +1781,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, } } - net_unlock(save); + net_unlock(); recvfrom_uninit(&state); return (ssize_t)ret; } @@ -1854,6 +1852,10 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, ssize_t ret; int errcode; + /* Treat as a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify that non-NULL pointers were passed */ #ifdef CONFIG_DEBUG_FEATURES @@ -2016,10 +2018,12 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len, /* Success return */ + leave_cancellation_point(); return ret; errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } @@ -2079,6 +2083,11 @@ ssize_t recvfrom(int sockfd, FAR void *buf, size_t len, int flags, FAR struct sockaddr *from, FAR socklen_t *fromlen) { FAR struct socket *psock; + ssize_t ret; + + /* recvfrom() is a cancellation point */ + + (void)enter_cancellation_point(); /* Get the underlying socket structure */ @@ -2086,7 +2095,9 @@ ssize_t recvfrom(int sockfd, FAR void *buf, size_t len, int flags, /* Then let psock_recvfrom() do all of the work */ - return psock_recvfrom(psock, buf, len, flags, from, fromlen); + ret = psock_recvfrom(psock, buf, len, flags, from, fromlen); + leave_cancellation_point(); + return ret; } #endif /* CONFIG_NET */ diff --git a/net/socket/send.c b/net/socket/send.c index 60b19ab296fbff601bd7579bae48cbc4654bb24e..e90b27b116a314684937f1332d4ca9a21067acb9 100644 --- a/net/socket/send.c +++ b/net/socket/send.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/socket/send.c * - * Copyright (C) 2007-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,8 @@ #include #include +#include + #include "tcp/tcp.h" #include "udp/udp.h" #include "pkt/pkt.h" @@ -122,6 +124,10 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, { int ret; + /* Treat as a cancellation point */ + + (void)enter_cancellation_point(); + switch (psock->s_type) { #if defined(CONFIG_NET_PKT) @@ -192,6 +198,7 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, break; } + leave_cancellation_point(); return ret; } @@ -261,5 +268,20 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len, ssize_t send(int sockfd, FAR const void *buf, size_t len, int flags) { - return psock_send(sockfd_socket(sockfd), buf, len, flags); + FAR struct socket *psock; + ssize_t ret; + + /* send() is a cancellation point */ + + (void)enter_cancellation_point(); + + /* Get the underlying socket structure */ + + psock = sockfd_socket(sockfd); + + /* And let psock_send do all of the work */ + + ret = psock_send(psock, buf, len, flags); + leave_cancellation_point(); + return ret; } diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 79eb93e68fa4c1a4cda05341d9a2c7a12865b7c2..db51b73c79a65b3f90ce7ba7064bd8ee1c1575d7 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -45,6 +45,7 @@ #include #include +#include #include #include "udp/udp.h" @@ -309,6 +310,11 @@ ssize_t sendto(int sockfd, FAR const void *buf, size_t len, int flags, FAR const struct sockaddr *to, socklen_t tolen) { FAR struct socket *psock; + ssize_t ret; + + /* sendto() is a cancellation point */ + + (void)enter_cancellation_point(); /* Get the underlying socket structure */ @@ -316,5 +322,7 @@ ssize_t sendto(int sockfd, FAR const void *buf, size_t len, int flags, /* And let psock_sendto do all of the work */ - return psock_sendto(psock, buf, len, flags, to, tolen); + ret = psock_sendto(psock, buf, len, flags, to, tolen); + leave_cancellation_point(); + return ret; } diff --git a/net/socket/setsockopt.c b/net/socket/setsockopt.c index 2086771b37b91a1abc12cac20aa4ea6cdb3330d6..cdcd8d2e851b7ecfd569672ef1a1b99cd731d7a8 100644 --- a/net/socket/setsockopt.c +++ b/net/socket/setsockopt.c @@ -105,7 +105,6 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option, FAR const void *value, socklen_t value_len) { - net_lock_t flags; int errcode; /* Verify that the socket option if valid (but might not be supported ) */ @@ -153,7 +152,7 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option, * level access to options. */ - flags = net_lock(); + net_lock(); /* Set or clear the option bit */ @@ -166,7 +165,7 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option, _SO_CLROPT(psock->s_options, option); } - net_unlock(flags); + net_unlock(); } break; @@ -235,7 +234,7 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option, * level access to options. */ - flags = net_lock(); + net_lock(); /* Set or clear the linger option bit and linger time (in deciseconds) */ @@ -250,7 +249,7 @@ int psock_setsockopt(FAR struct socket *psock, int level, int option, psock->s_linger = 0; } - net_unlock(flags); + net_unlock(); } break; #endif diff --git a/net/tcp/tcp_backlog.c b/net/tcp/tcp_backlog.c index 6d7122fd3d0e2981571298d0dce64d1cf3919fa4..252f04a0f8cf8d427ded3350a5a19ffd581cadfa 100644 --- a/net/tcp/tcp_backlog.c +++ b/net/tcp/tcp_backlog.c @@ -72,7 +72,6 @@ int tcp_backlogcreate(FAR struct tcp_conn_s *conn, int nblg) { FAR struct tcp_backlog_s *bls = NULL; FAR struct tcp_blcontainer_s *blc; - net_lock_t flags; int size; int offset; int i; @@ -125,7 +124,7 @@ int tcp_backlogcreate(FAR struct tcp_conn_s *conn, int nblg) /* Destroy any existing backlog (shouldn't be any) */ - flags = net_lock(); + net_lock(); tcp_backlogdestroy(conn); /* Now install the backlog tear-off in the connection. NOTE that bls may @@ -135,7 +134,7 @@ int tcp_backlogcreate(FAR struct tcp_conn_s *conn, int nblg) */ conn->backlog = bls; - net_unlock(flags); + net_unlock(); return OK; } diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c index 12f7b332ea8bf7aea3a4c88982fdcfa1a231b554..8ca70aed79eda8d9865526dfa1f74a80721a03c4 100644 --- a/net/tcp/tcp_conn.c +++ b/net/tcp/tcp_conn.c @@ -514,13 +514,12 @@ static inline FAR struct tcp_conn_s * static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn, FAR const struct sockaddr_in *addr) { - net_lock_t flags; int port; int ret; /* Verify or select a local port and address */ - flags = net_lock(); + net_lock(); /* Verify or select a local port (host byte order) */ @@ -565,7 +564,7 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn, return ret; } - net_unlock(flags); + net_unlock(); return OK; } #endif /* CONFIG_NET_IPv4 */ @@ -589,13 +588,12 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn, static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn, FAR const struct sockaddr_in6 *addr) { - net_lock_t flags; int port; int ret; /* Verify or select a local port and address */ - flags = net_lock(); + net_lock(); /* Verify or select a local port (host byte order) */ @@ -646,7 +644,7 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn, return ret; } - net_unlock(flags); + net_unlock(); return OK; } #endif /* CONFIG_NET_IPv6 */ @@ -700,14 +698,13 @@ void tcp_initialize(void) FAR struct tcp_conn_s *tcp_alloc(uint8_t domain) { FAR struct tcp_conn_s *conn; - net_lock_t flags; /* Because this routine is called from both interrupt level and * and from user level, we have not option but to disable interrupts * while accessing g_free_tcp_connections[]; */ - flags = net_lock(); + net_lock(); /* Return the entry from the head of the free list */ @@ -786,7 +783,7 @@ FAR struct tcp_conn_s *tcp_alloc(uint8_t domain) } #endif - net_unlock(flags); + net_unlock(); /* Mark the connection allocated */ @@ -818,7 +815,6 @@ void tcp_free(FAR struct tcp_conn_s *conn) #ifdef CONFIG_NET_TCP_WRITE_BUFFERS FAR struct tcp_wrbuffer_s *wrbuffer; #endif - net_lock_t flags; /* Because g_free_tcp_connections is accessed from user level and interrupt * level, code, it is necessary to keep interrupts disabled during this @@ -826,7 +822,7 @@ void tcp_free(FAR struct tcp_conn_s *conn) */ DEBUGASSERT(conn->crefs == 0); - flags = net_lock(); + net_lock(); /* Free remaining callbacks, actually there should be only the close callback * left. @@ -891,7 +887,7 @@ void tcp_free(FAR struct tcp_conn_s *conn) conn->tcpstateflags = TCP_CLOSED; dq_addlast(&conn->node, &g_free_tcp_connections); - net_unlock(flags); + net_unlock(); } /**************************************************************************** @@ -1184,7 +1180,6 @@ int tcp_bind(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr) int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr) { - net_lock_t flags; int port; int ret; @@ -1203,7 +1198,7 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr) * but the port may still be INPORT_ANY. */ - flags = net_lock(); + net_lock(); #ifdef CONFIG_NETDEV_MULTINIC /* If there are multiple network devices, then we need to pass the local, @@ -1373,7 +1368,7 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr) ret = OK; errout_with_lock: - net_unlock(flags); + net_unlock(); return ret; } diff --git a/net/tcp/tcp_listen.c b/net/tcp/tcp_listen.c index b4990ba1663eb068a0aa2ae0ce620a836efef5fc..8a10fd9b57f6583fac5146003ebd6b4b52f24427 100644 --- a/net/tcp/tcp_listen.c +++ b/net/tcp/tcp_listen.c @@ -141,11 +141,10 @@ void tcp_listen_initialize(void) int tcp_unlisten(FAR struct tcp_conn_s *conn) { - net_lock_t flags; int ndx; int ret = -EINVAL; - flags = net_lock(); + net_lock(); for (ndx = 0; ndx < CONFIG_NET_MAX_LISTENPORTS; ndx++) { if (tcp_listenports[ndx] == conn) @@ -156,7 +155,7 @@ int tcp_unlisten(FAR struct tcp_conn_s *conn) } } - net_unlock(flags); + net_unlock(); return ret; } @@ -173,7 +172,6 @@ int tcp_unlisten(FAR struct tcp_conn_s *conn) int tcp_listen(FAR struct tcp_conn_s *conn) { - net_lock_t flags; int ndx; int ret; @@ -181,7 +179,7 @@ int tcp_listen(FAR struct tcp_conn_s *conn) * is accessed from interrupt level as well. */ - flags = net_lock(); + net_lock(); /* First, check if there is already a socket listening on this port */ @@ -216,7 +214,7 @@ int tcp_listen(FAR struct tcp_conn_s *conn) } } - net_unlock(flags); + net_unlock(); return ret; } diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c index 41382144c2f5ac45e453e2da8581cb40a841de67..733c8c89e8d6d533570fca26af4f2207d4968100 100644 --- a/net/tcp/tcp_netpoll.c +++ b/net/tcp/tcp_netpoll.c @@ -164,7 +164,6 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) FAR struct tcp_conn_s *conn = psock->s_conn; FAR struct tcp_poll_s *info; FAR struct devif_callback_s *cb; - net_lock_t flags; int ret; /* Sanity check */ @@ -186,7 +185,7 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) /* Some of the following must be atomic */ - flags = net_lock(); + net_lock(); /* Allocate a TCP/IP callback structure */ @@ -296,12 +295,12 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) sem_post(fds->sem); } - net_unlock(flags); + net_unlock(); return OK; errout_with_lock: kmm_free(info); - net_unlock(flags); + net_unlock(); return ret; } @@ -325,7 +324,6 @@ int tcp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) { FAR struct tcp_conn_s *conn = psock->s_conn; FAR struct tcp_poll_s *info; - net_lock_t flags; /* Sanity check */ @@ -344,9 +342,9 @@ int tcp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) { /* Release the callback */ - flags = net_lock(); + net_lock(); tcp_callback_free(conn, info->cb); - net_unlock(flags); + net_unlock(); /* Release the poll/select data slot */ diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 468f90b9dac3e68bd3f931627ed7e571b25b1ebb..dbb2f28087ebb62e1ce922d5ec6390636739951d 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -948,7 +948,6 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, { FAR struct tcp_conn_s *conn; FAR struct tcp_wrbuffer_s *wrb; - net_lock_t save; ssize_t result = 0; int errcode; int ret = OK; @@ -1019,7 +1018,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, * unlocked here. */ - save = net_lock(); + net_lock(); wrb = tcp_wrbuffer_alloc(); if (!wrb) { @@ -1077,7 +1076,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, /* Notify the device driver of the availability of TX data */ send_txnotify(psock, conn); - net_unlock(save); + net_unlock(); } /* Set the socket state to idle */ @@ -1112,7 +1111,7 @@ errout_with_wrb: tcp_wrbuffer_release(wrb); errout_with_lock: - net_unlock(save); + net_unlock(); errout: set_errno(errcode); diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 4710c41fe704093d244ab8d85054b5ed21941549..385c385a29a9c42fb2d098f3c8dada31d822d1b8 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -720,7 +720,6 @@ ssize_t psock_tcp_send(FAR struct socket *psock, { FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)psock->s_conn; struct send_s state; - net_lock_t save; int errcode; int ret = OK; @@ -792,7 +791,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, * are ready. */ - save = net_lock(); + net_lock(); memset(&state, 0, sizeof(struct send_s)); /* This semaphore is used for signaling and, hence, should not have @@ -854,7 +853,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, } sem_destroy(&state.snd_sem); - net_unlock(save); + net_unlock(); /* Set the socket state to idle */ diff --git a/net/udp/udp_conn.c b/net/udp/udp_conn.c index 1f5ecd095c6b997dad95c9f1b9ee677068709541..964846e91de3b2647ee28a8f48fa432bd4bdccb1 100644 --- a/net/udp/udp_conn.c +++ b/net/udp/udp_conn.c @@ -229,7 +229,7 @@ static uint16_t udp_select_port(void) * listen port number that is not being used by any other connection. */ - net_lock_t flags = net_lock(); + net_lock(); do { /* Guess that the next available port number will be the one after @@ -256,7 +256,7 @@ static uint16_t udp_select_port(void) */ portno = g_last_udp_port; - net_unlock(flags); + net_unlock(); return portno; } @@ -576,7 +576,6 @@ FAR struct udp_conn_s *udp_nextconn(FAR struct udp_conn_s *conn) int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr) { - net_lock_t flags; uint16_t portno; int ret; @@ -643,7 +642,7 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr) { /* Interrupts must be disabled while access the UDP connection list */ - flags = net_lock(); + net_lock(); /* Is any other UDP connection already bound to this address and port? */ @@ -659,7 +658,7 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr) ret = OK; } - net_unlock(flags); + net_unlock(); } return ret; diff --git a/net/udp/udp_netpoll.c b/net/udp/udp_netpoll.c index eade182fa120448bcccec9942f4d8d2410e3c5fc..6dd873aaec0fe37162c35d1e599a90a6e0350296 100644 --- a/net/udp/udp_netpoll.c +++ b/net/udp/udp_netpoll.c @@ -161,7 +161,6 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) FAR struct udp_conn_s *conn = psock->s_conn; FAR struct udp_poll_s *info; FAR struct devif_callback_s *cb; - net_lock_t flags; int ret; /* Sanity check */ @@ -183,7 +182,7 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) /* Some of the following must be atomic */ - flags = net_lock(); + net_lock(); /* Get the device that will provide the provide the NETDEV_DOWN event. * NOTE: in the event that the local socket is bound to INADDR_ANY, the @@ -262,12 +261,12 @@ int udp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) sem_post(fds->sem); } - net_unlock(flags); + net_unlock(); return OK; errout_with_lock: kmm_free(info); - net_unlock(flags); + net_unlock(); return ret; } @@ -291,7 +290,6 @@ int udp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) { FAR struct udp_conn_s *conn = psock->s_conn; FAR struct udp_poll_s *info; - net_lock_t flags; /* Sanity check */ @@ -310,9 +308,9 @@ int udp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds) { /* Release the callback */ - flags = net_lock(); + net_lock(); udp_callback_free(info->dev, conn, info->cb); - net_unlock(flags); + net_unlock(); /* Release the poll/select data slot */ diff --git a/net/udp/udp_psock_sendto.c b/net/udp/udp_psock_sendto.c index 7ae830c5b78f738af79661907072369b7c8b9d37..84564f8a7e2609e9466f4078eb2ac707154b9e9f 100644 --- a/net/udp/udp_psock_sendto.c +++ b/net/udp/udp_psock_sendto.c @@ -340,7 +340,6 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, FAR struct udp_conn_s *conn; FAR struct net_driver_s *dev; struct sendto_s state; - net_lock_t save; int ret; #if defined(CONFIG_NET_ARP_SEND) || defined(CONFIG_NET_ICMPv6_NEIGHBOR) @@ -390,7 +389,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, * are ready. */ - save = net_lock(); + net_lock(); memset(&state, 0, sizeof(struct sendto_s)); /* This semaphore is used for signaling and, hence, should not have @@ -484,7 +483,7 @@ errout_with_lock: /* Unlock the network and return the result of the sendto() operation */ - net_unlock(save); + net_unlock(); return ret; } diff --git a/net/utils/Make.defs b/net/utils/Make.defs index 5abcb9226c77dd2c082e24e43d731c650c057b76..270b80bbbe8fd4c5fedc39665c84d92783a88a5f 100644 --- a/net/utils/Make.defs +++ b/net/utils/Make.defs @@ -36,7 +36,7 @@ # Common utilities NET_CSRCS += net_dsec2tick.c net_dsec2timeval.c net_timeval2dsec.c -NET_CSRCS += net_chksum.c +NET_CSRCS += net_chksum.c net_lock.c # IPv6 utilities @@ -44,12 +44,6 @@ ifeq ($(CONFIG_NET_IPv6),y) NET_CSRCS += net_ipv6_maskcmp.c net_ipv6_mask2pref.c net_ipv6_pref2mask.c endif -# Non-interrupt level support required? - -ifeq ($(CONFIG_NET_NOINTS),y) -NET_CSRCS += net_lock.c -endif - # Include utility build support DEPPATH += --dep-path utils diff --git a/net/utils/net_lock.c b/net/utils/net_lock.c index 49ce834070f8714e9f5ae85877c30baad568d1b5..fbd42342aeee69957f877fcb22ac8f555829dec8 100644 --- a/net/utils/net_lock.c +++ b/net/utils/net_lock.c @@ -51,8 +51,6 @@ #include "utils/utils.h" -#if defined(CONFIG_NET) && defined(CONFIG_NET_NOINTS) - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -116,7 +114,7 @@ void net_lockinitialize(void) * ****************************************************************************/ -net_lock_t net_lock(void) +void net_lock(void) { pid_t me = getpid(); @@ -139,8 +137,6 @@ net_lock_t net_lock(void) g_holder = me; g_count = 1; } - - return 0; } /**************************************************************************** @@ -151,7 +147,7 @@ net_lock_t net_lock(void) * ****************************************************************************/ -void net_unlock(net_lock_t flags) +void net_unlock(void) { DEBUGASSERT(g_holder == getpid() && g_count > 0); @@ -261,4 +257,3 @@ int net_lockedwait(sem_t *sem) return net_timedwait(sem, NULL); } -#endif /* CONFIG_NET */ diff --git a/net/utils/utils.h b/net/utils/utils.h index 355e75e51e78ea7d9cdae3b989357f9d7b4fd4d3..6e33b72a83b005287b4f0a7238ff9ceb2ba264ba 100644 --- a/net/utils/utils.h +++ b/net/utils/utils.h @@ -84,11 +84,7 @@ struct timeval; /* Forward reference */ * ****************************************************************************/ -#ifdef CONFIG_NET_NOINTS void net_lockinitialize(void); -#else -# define net_lockinitialize() -#endif /**************************************************************************** * Function: net_dsec2timeval diff --git a/sched/Kconfig b/sched/Kconfig index 60156e036810c1c6d6cac3e29b47ff1c4a7ccc46..7b8dbaaa76624beee1d71aaa7f4f4ccf7bf5ff67 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -249,7 +249,6 @@ menu "Tasks and Scheduling" config SPINLOCK bool "Support Spinlocks" default n - depends on EXPERIMENTAL ---help--- Enables suppport for spinlocks. Spinlocks are current used only for SMP suppport. @@ -537,8 +536,37 @@ config NPTHREAD_KEYS The number of items of thread- specific data that can be retained +config PTHREAD_CLEANUP + bool "pthread cleanup stack" + default n + ---help--- + Select to enable support for pthread exit cleanup stacks. This + enables the interfaces pthread_cleanup_push() and + pthread_cleanup_pop(). + +config PTHREAD_CLEANUP_STACKSIZE + int "pthread cleanup stack size" + default 1 + range 1 32 + depends on PTHREAD_CLEANUP + ---help--- + The maximum number of cleanup actions that may be pushed by + pthread_clean_push(). This setting will increase the size of EVERY + pthread task control block by about n * CONFIG_PTHREAD_CLEANUP_STACKSIZE + where n is the size of a pointer, 2* sizeof(uintptr_t), this would be + 8 for a CPU with 32-bit addressing and 4 for a CPU with 16-bit + addressing. + endmenu # Pthread Options +config CANCELLATION_POINTS + bool "Cancellation points" + default n + ---help--- + Enable POSIX cancellation points for pthread_cancel(). If selected, + cancellation points will also used with the () task_delete() API even if + pthreads are not enabled. + menu "Performance Monitoring" config SCHED_CPULOAD @@ -661,6 +689,14 @@ config SCHED_INSTRUMENTATION void sched_note_suspend(FAR struct tcb_s *tcb); void sched_note_resume(FAR struct tcb_s *tcb); + If CONFIG_SMP is enabled, then these additional interfaces are + expected: + + void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu); + void sched_note_cpu_paused(FAR struct tcb_s *tcb); + void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu); + void sched_note_cpu_resumed(FAR struct tcb_s *tcb); + NOTE: These are internal OS interfaces and are called at at very critical locations in the OS. There is very little that can be done in these interfaces. For example, normal devices may not be @@ -670,6 +706,13 @@ config SCHED_INSTRUMENTATION if SCHED_INSTRUMENTATION +config SCHED_INSTRUMENTATION_CPUSET + hex "CPU bit set" + default 0xffff + depends on SMP + ---help--- + Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc. + config SCHED_INSTRUMENTATION_PREEMPTION bool "Preemption monitor hooks" default n @@ -682,7 +725,6 @@ config SCHED_INSTRUMENTATION_PREEMPTION config SCHED_INSTRUMENTATION_CSECTION bool "Critical section monitor hooks" default n - depends on EXPERIMENTAL || !SCHED_INSTRUMENTATION_BUFFER ---help--- Enables additional hooks for entry and exit from critical sections. Interrupts are disabled while within a critical section. Board- @@ -690,13 +732,17 @@ config SCHED_INSTRUMENTATION_CSECTION void sched_note_csection(FAR struct tcb_s *tcb, bool state); - NOTE: This option is marked EXPERIMENTAL because there is a logical - error in the design when this feature is used with - CONFIG_SCHED_INSTRUMENTATION_BUFFER. That error is that - sched_note_get() calls enter_ and leave_critical_section. That - means that each call to sched_note_get() causes two entries to be - added from the note buffer in order to remove one entry. Not - very useful in its current state! +config SCHED_INSTRUMENTATION_SPINLOCKS + bool "Spinlock monitor hooks" + default n + ---help--- + Enables additional hooks for spinlock state. Board-specific logic + must provide this additional logic. + + void sched_note_spinlock(FAR struct tcb_s *tcb, bool state); + void sched_note_spinlocked(FAR struct tcb_s *tcb, bool state); + void sched_note_spinunlock(FAR struct tcb_s *tcb, bool state); + void sched_note_spinabort(FAR struct tcb_s *tcb, bool state); config SCHED_INSTRUMENTATION_BUFFER bool "Buffer instrumentation data in memory" @@ -722,14 +768,35 @@ config SCHED_INSTRUMENTATION_BUFFER does not occur. See include/nuttx/sched_note.h for additional information. +if SCHED_INSTRUMENTATION_BUFFER + config SCHED_NOTE_BUFSIZE int "Instrumentation buffer size" default 2048 - depends on SCHED_INSTRUMENTATION_BUFFER ---help--- The size of the in-memory, circular instrumentation buffer (in bytes). +config SCHED_NOTE_GET + int "Callable interface to get instrumentatin data" + default 2048 + depends on !SCHED_INSTRUMENTATION_CSECTION && (!SCHED_INSTRUMENTATION_SPINLOCK || !SMP) + ---help--- + Add support for interfaces to get the size of the next note and also + to extract the next note from the instrumentation buffer: + + ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen); + ssize_t sched_note_size(void); + + NOTE: This option is not available if critical sections are being + monitor (nor if spinlocks are being monitored in SMP configuration) + because there would be a logical error in the design in those cases. + That error is that these interfaces call enter_ and leave_critical_section + (and which us spinlocks in SMP mode). That means that each call to + sched_note_get() causes several additional entries to be added from + the note buffer in order to remove one entry. + +endif # SCHED_INSTRUMENTATION_BUFFER endif # SCHED_INSTRUMENTATION endmenu # Performance Monitoring diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c index ac8afca3e59bb3b688886f98a8018d3d69ac1fb6..363cccf92a27699a0887880ab98ca2722ded6561 100644 --- a/sched/group/group_signal.c +++ b/sched/group/group_signal.c @@ -93,12 +93,11 @@ static int group_signal_handler(pid_t pid, FAR void *arg) FAR sigactq_t *sigact; int ret; - DEBUGASSERT(tcb != NULL && tcb->group != NULL && info != NULL); - /* Get the TCB associated with the group member */ tcb = sched_gettcb(pid); - DEBUGASSERT(tcb ! = NULL); + DEBUGASSERT(tcb != NULL && tcb->group != NULL && info != NULL); + if (tcb) { /* Set this one as the default if we have not already set the default. */ diff --git a/sched/init/os_smpstart.c b/sched/init/os_smpstart.c index ba8afac2ded0cd0f1b4fb427f4febb6cd5bb80b7..17316e5b6167e5c637a74bbb69b80b2ceec4427a 100644 --- a/sched/init/os_smpstart.c +++ b/sched/init/os_smpstart.c @@ -218,6 +218,13 @@ int os_smp_start(void) */ up_initial_state(tcb); + + /* Set the task flags to indicate that this is a kernel thread and that + * this task is locked to this CPU. + */ + + tcb->flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NONCANCELABLE | TCB_FLAG_CPU_LOCKED); + tcb->cpu = cpu; } /* Then start all of the other CPUs after we have completed the memory diff --git a/sched/init/os_start.c b/sched/init/os_start.c index 17e1f40cde949dee1360c51c7896f8f4dedba6bd..2d8eb2e6e14e209d9fe5c70c96ee800199c5115b 100644 --- a/sched/init/os_start.c +++ b/sched/init/os_start.c @@ -470,10 +470,11 @@ void os_start(void) */ #ifdef CONFIG_SMP - g_idletcb[cpu].cmn.flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_CPU_LOCKED); + g_idletcb[cpu].cmn.flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NONCANCELABLE | + TCB_FLAG_CPU_LOCKED); g_idletcb[cpu].cmn.cpu = cpu; #else - g_idletcb[cpu].cmn.flags = TCB_FLAG_TTYPE_KERNEL; + g_idletcb[cpu].cmn.flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NONCANCELABLE); #endif #ifdef CONFIG_SMP diff --git a/sched/irq/irq.h b/sched/irq/irq.h index 60d38443fbddfb1b4f068aa86bdba0ed24d1cad4..a7b4b431ab352210348245e8cb109c06120ac23f 100644 --- a/sched/irq/irq.h +++ b/sched/irq/irq.h @@ -1,7 +1,7 @@ /**************************************************************************** * sched/irq/irq.h * - * Copyright (C) 2007, 2008, 2013-2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008, 2013-2014, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -65,12 +66,16 @@ extern FAR xcpt_t g_irqvector[NR_IRQS]; * disabled. */ -extern volatile spinlock_t g_cpu_irqlock; +extern volatile spinlock_t g_cpu_irqlock SP_SECTION; /* Used to keep track of which CPU(s) hold the IRQ lock. */ -extern volatile spinlock_t g_cpu_irqsetlock; -extern volatile cpu_set_t g_cpu_irqset; +extern volatile spinlock_t g_cpu_irqsetlock SP_SECTION; +extern volatile cpu_set_t g_cpu_irqset SP_SECTION; + +/* Handles nested calls to enter_critical section from interrupt handlers */ + +extern volatile uint8_t g_cpu_nestcount[CONFIG_SMP_NCPUS]; #endif /**************************************************************************** @@ -106,6 +111,33 @@ void weak_function irq_initialize(void); int irq_unexpected_isr(int irq, FAR void *context); +/**************************************************************************** + * Name: irq_cpu_locked + * + * Description: + * Test if the IRQ lock set OR if this CPU holds the IRQ lock + * There is an interaction with pre-emption controls and IRQ locking: + * Even if the pre-emption is enabled, tasks will be forced to pend if + * the IRQ lock is also set UNLESS the CPU starting the task is the + * holder of the IRQ lock. + * + * Inputs: + * rtcb - Points to the blocked TCB that is ready-to-run + * + * Return Value: + * true - IRQs are locked by a different CPU. + * false - IRQs are unlocked OR if they are locked BUT this CPU + * is the holder of the lock. + * + * Warning: This values are volatile at only valid at the instance that + * the CPU set was queried. + * + ****************************************************************************/ + +#ifdef CONFIG_SMP +bool irq_cpu_locked(int cpu); +#endif + #undef EXTERN #ifdef __cplusplus } diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c index 8071da9758800cf23ba07a7b1f90ab1707292981..a67dbc16bf672250c5bdd3d8b5a5fce706062055 100644 --- a/sched/irq/irq_csection.c +++ b/sched/irq/irq_csection.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/irq/irq_csection.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -60,22 +60,113 @@ * disabled. */ -volatile spinlock_t g_cpu_irqlock = SP_UNLOCKED; +volatile spinlock_t g_cpu_irqlock SP_SECTION = SP_UNLOCKED; /* Used to keep track of which CPU(s) hold the IRQ lock. */ -volatile spinlock_t g_cpu_irqsetlock; -volatile cpu_set_t g_cpu_irqset; +volatile spinlock_t g_cpu_irqsetlock SP_SECTION; +volatile cpu_set_t g_cpu_irqset SP_SECTION; + +/* Handles nested calls to enter_critical section from interrupt handlers */ + +volatile uint8_t g_cpu_nestcount[CONFIG_SMP_NCPUS]; #endif /**************************************************************************** - * Private Data + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: irq_waitlock + * + * Description: + * Spin to get g_irq_waitlock, handling a known deadlock condition: + * + * A deadlock may occur if enter_critical_section is called from an + * interrupt handler. Suppose: + * + * - CPUn is in a critical section and has the g_cpu_irqlock spinlock. + * - CPUm takes an interrupt and attempts to enter the critical section. + * - It spins waiting on g_cpu_irqlock with interrupts disabled. + * - CPUn calls up_cpu_pause() to pause operation on CPUm. This will + * issue an inter-CPU interrupt to CPUm + * - But interrupts are disabled on CPUm so the up_cpu_pause() is never + * handled, causing the deadlock. + * + * This same deadlock can occur in the normal tasking case: + * + * - A task on CPUn enters a critical section and has the g_cpu_irqlock + * spinlock. + * - Another task on CPUm attempts to enter the critical section but has + * to wait, spinning to get g_cpu_irqlock with interrupts disabled. + * - The task on CPUn causes a new task to become ready-torun and the + * scheduler selects CPUm. CPUm is requested to pause via a pause + * interrupt. + * - But the task on CPUm is also attempting to enter the critical + * section. Since it is spinning with interrupts disabled, CPUm cannot + * process the pending pause interrupt, causing the deadlock. + * + * This function detects this deadlock condition while spinning with \ + * interrupts disabled. + * + * Input Parameters: + * cpu - The index of CPU that is trying to enter the critical section. + * + * Returned Value: + * True: The g_cpu_irqlock spinlock has been taken. + * False: The g_cpu_irqlock spinlock has not been taken yet, but there is + * a pending pause interrupt request. + * ****************************************************************************/ #ifdef CONFIG_SMP -/* Handles nested calls to enter_critical section from interrupt handlers */ +static inline bool irq_waitlock(int cpu) +{ +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + FAR struct tcb_s *tcb = this_task(); + + /* Notify that we are waiting for a spinlock */ + + sched_note_spinlock(tcb, &g_cpu_irqlock); +#endif + + /* Duplicate the spin_lock() logic from spinlock.c, but adding the check + * for the deadlock condition. + */ + + while (spin_trylock(&g_cpu_irqlock) == SP_LOCKED) + { + /* Is a pause request pending? */ + + if (up_cpu_pausereq(cpu)) + { + /* Yes.. some other CPU is requesting to pause this CPU! + * Abort the wait and return false. + */ + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are waiting for a spinlock */ + + sched_note_spinabort(tcb, &g_cpu_irqlock); +#endif + + return false; + } + + SP_DSB(); + } + + /* We have g_cpu_irqlock! */ -static uint8_t g_cpu_nestcount[CONFIG_SMP_NCPUS]; +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we have the spinlock */ + + sched_note_spinlocked(tcb, &g_cpu_irqlock); +#endif + + SP_DMB(); + return true; +} #endif /**************************************************************************** @@ -111,6 +202,8 @@ irqstate_t enter_critical_section(void) * the local CPU. */ +try_again: + ret = up_irq_save(); /* Verify that the system has sufficiently initialized so that the task @@ -144,14 +237,14 @@ irqstate_t enter_critical_section(void) * * g_cpu_irqlock = SP_LOCKED. * g_cpu_nestcount = 0 - * The bit in g_cpu_irqset for this CPU hould be zero + * The bit in g_cpu_irqset for this CPU should be zero * * 4. An extension of 3 is that we may be re-entered numerous * times from the same interrupt handler. In that case: * * g_cpu_irqlock = SP_LOCKED. * g_cpu_nestcount > 0 - * The bit in g_cpu_irqset for this CPU hould be zero + * The bit in g_cpu_irqset for this CPU should be zero * * NOTE: However, the interrupt entry conditions can change due * to previous processing by the interrupt handler that may @@ -187,15 +280,30 @@ irqstate_t enter_critical_section(void) if ((g_cpu_irqset & (1 << cpu)) == 0) { /* Wait until we can get the spinlock (meaning that we are - * no longer in the critical section). + * no longer blocked by the critical section). */ - spin_lock(&g_cpu_irqlock); + if (!irq_waitlock(cpu)) + { + /* We are in a deadlock condition due to a pending + * pause request interrupt request. Break the + * deadlock by handling the pause interrupt now. + */ + + DEBUGVERIFY(up_cpu_paused(cpu)); + } } /* In any event, the nesting count is now one */ g_cpu_nestcount[cpu] = 1; + + /* Also set the CPU bit so that other CPUs will be aware that this + * CPU holds the critical section. + */ + + spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); } } else @@ -231,7 +339,23 @@ irqstate_t enter_critical_section(void) cpu = this_cpu(); DEBUGASSERT((g_cpu_irqset & (1 << cpu)) == 0); - spin_lock(&g_cpu_irqlock); + + if (!irq_waitlock(cpu)) + { + /* We are in a deadlock condition due to a pending pause + * request interrupt. Re-enable interrupts on this CPU + * and try again. Briefly re-enabling interrupts should + * be sufficient to permit processing the pending pause + * request. + * + * NOTE: This should never happen on architectures like + * the Cortex-A; the inter-CPU interrupt (SGI) is not + * maskable. + */ + + up_irq_restore(ret); + goto try_again; + } /* The set the lock count to 1. * @@ -332,18 +456,22 @@ void leave_critical_section(irqstate_t flags) } else { - /* No, not nested. Release the spinlock. */ + /* No, not nested. Restore the g_cpu_irqset for this CPU + * and release the spinlock (if necessary). + */ DEBUGASSERT(spin_islocked(&g_cpu_irqlock) && g_cpu_nestcount[cpu] == 1); - spin_lock(&g_cpu_irqsetlock); /* Protects g_cpu_irqset */ - if (g_cpu_irqset == 0) + FAR struct tcb_s *rtcb = this_task(); + DEBUGASSERT(rtcb != NULL); + + if (rtcb->irqcount <= 0) { - spin_unlock(&g_cpu_irqlock); + spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); } - spin_unlock(&g_cpu_irqsetlock); g_cpu_nestcount[cpu] = 0; } } @@ -381,39 +509,41 @@ void leave_critical_section(irqstate_t flags) DEBUGASSERT(spin_islocked(&g_cpu_irqlock) && (g_cpu_irqset & (1 << cpu)) != 0); - rtcb->irqcount = 0; - spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, - &g_cpu_irqlock); - - /* Have all CPUs released the lock? */ + /* Check if releasing the lock held by this CPU will unlock the + * critical section. + */ - if (!spin_islocked(&g_cpu_irqlock)) + if ((g_cpu_irqset & ~(1 << cpu)) == 0) { - /* Check if there are pending tasks and that pre-emption - * is also enabled. - * - * REVISIT: Is there an issue here? up_release_pending() - * must be called from within a critical section but here - * we have just left the critical section. At least we - * still have interrupts disabled on this CPU. + /* Yes.. Check if there are pending tasks and that pre-emption + * is also enabled. This is necessary because we may have + * deferred the up_release_pending() call in sched_unlock() + * because we were within a critical section then. */ if (g_pendingtasks.head != NULL && !spin_islocked(&g_cpu_schedlock)) { /* Release any ready-to-run tasks that have collected - * in g_pendingtasks if the scheduler is not locked. - * - * NOTE: This operation has a very high likelihood of - * causing this task to be switched out! - * - * REVISIT: Should this not be done while we are in the - * critical section. + * in g_pendingtasks. NOTE: This operation has a very + * high likelihood of causing this task to be switched + * out! */ up_release_pending(); } } + + /* Now, possibly on return from a context switch, clear our + * count on the lock. If all CPUs have released the lock, + * then unlock the global IRQ spinlock. + */ + + rtcb->irqcount = 0; + spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, + &g_cpu_irqlock); + + /* Have all CPUs released the lock? */ } } } @@ -447,4 +577,78 @@ void leave_critical_section(irqstate_t flags) } #endif -#endif /* CONFIG_SMP || CONFIG_SCHED_INSTRUMENTATION_CSECTION*/ +/**************************************************************************** + * Name: irq_cpu_locked + * + * Description: + * Test if the IRQ lock set OR if this CPU holds the IRQ lock + * There is an interaction with pre-emption controls and IRQ locking: + * Even if the pre-emption is enabled, tasks will be forced to pend if + * the IRQ lock is also set UNLESS the CPU starting the task is the + * holder of the IRQ lock. + * + * Inputs: + * rtcb - Points to the blocked TCB that is ready-to-run + * + * Return Value: + * true - IRQs are locked by a different CPU. + * false - IRQs are unlocked OR if they are locked BUT this CPU + * is the holder of the lock. + * + * Warning: This values are volatile at only valid at the instance that + * the CPU set was queried. + * + ****************************************************************************/ + +#ifdef CONFIG_SMP +bool irq_cpu_locked(int cpu) +{ + cpu_set_t irqset; + + /* g_cpu_irqset is not valid in early phases of initialization */ + + if (g_os_initstate < OSINIT_OSREADY) + { + /* We are still single threaded. In either state of g_cpu_irqlock, + * the correct return value should always be false. + */ + + return false; + } + + /* Test if g_cpu_irqlock is locked. We don't really need to use check + * g_cpu_irqlock to do this, we can use the g_cpu_set. + * + * Sample the g_cpu_irqset once. That is an atomic operation. All + * subsequent operations will operate on the sampled cpu set. + */ + + irqset = (cpu_set_t)g_cpu_irqset; + if (irqset != 0) + { + /* Some CPU holds the lock. So g_cpu_irqlock should be locked. + * Return false if the 'cpu' is the holder of the lock; return + * true if g_cpu_irqlock is locked, but this CPU is not the + * holder of the lock. + */ + + return ((irqset & (1 << cpu)) == 0); + } + + /* No CPU holds the lock */ + + else + { + /* In this case g_cpu_irqlock should be unlocked. However, if + * the lock was established in the interrupt handler AND there are + * no bits set in g_cpu_irqset, that probabaly means only that + * critical section was established from an interrupt handler. + * Return false in either case. + */ + + return false; + } +} +#endif + +#endif /* CONFIG_SMP || CONFIG_SCHED_INSTRUMENTATION_CSECTION */ diff --git a/sched/mqueue/mq_rcvinternal.c b/sched/mqueue/mq_rcvinternal.c index c260c1183dd1fb00006be5e5f32489c967901408..91701e5e07675a502cccbd6063776d614d1f3392 100644 --- a/sched/mqueue/mq_rcvinternal.c +++ b/sched/mqueue/mq_rcvinternal.c @@ -50,6 +50,7 @@ #include #include +#include #include "sched/sched.h" #include "mqueue/mqueue.h" @@ -141,6 +142,23 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) FAR struct mqueue_inode_s *msgq; FAR struct mqueue_msg_s *rcvmsg; + /* mq_waitreceive() is not a cancellation point, but it is always called + * from a cancellation point. + */ + + if (enter_cancellation_point()) + { +#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ + /* If there is a pending cancellation, then do not perform + * the wait. Exit now with ECANCELED. + */ + + set_errno(ECANCELED); + leave_cancellation_point(); + return NULL; +#endif + } + /* Get a pointer to the message queue */ msgq = mqdes->msgq; @@ -195,6 +213,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) msgq->nmsgs--; } + leave_cancellation_point(); return rcvmsg; } diff --git a/sched/mqueue/mq_receive.c b/sched/mqueue/mq_receive.c index 4fed3b5afd2cc96701162fd0df34fabe39629f40..31878a29a5781f44e06563506fa3b6d341b74403 100644 --- a/sched/mqueue/mq_receive.c +++ b/sched/mqueue/mq_receive.c @@ -47,6 +47,7 @@ #include #include +#include #include "mqueue/mqueue.h" @@ -103,12 +104,17 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, DEBUGASSERT(up_interrupt_context() == false); + /* mq_receive() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify the input parameters and, in case of an error, set * errno appropriately. */ if (mq_verifyreceive(mqdes, msg, msglen) != OK) { + leave_cancellation_point(); return ERROR; } @@ -145,5 +151,6 @@ ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen, } sched_unlock(); + leave_cancellation_point(); return ret; } diff --git a/sched/mqueue/mq_send.c b/sched/mqueue/mq_send.c index 12ce2b85c1e9048b0306566e76c6cc73bd63002b..59e6eecebefa99deaf849dd468a5e53f95754a65 100644 --- a/sched/mqueue/mq_send.c +++ b/sched/mqueue/mq_send.c @@ -46,6 +46,7 @@ #include #include +#include #include "mqueue/mqueue.h" @@ -103,12 +104,17 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) irqstate_t flags; int ret = ERROR; + /* mq_send() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify the input parameters -- setting errno appropriately * on any failures to verify. */ if (mq_verifysend(mqdes, msg, msglen, prio) != OK) { + leave_cancellation_point(); return ERROR; } @@ -177,5 +183,6 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio) } sched_unlock(); + leave_cancellation_point(); return ret; } diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index 087e1f15dc90c7e6247ba8ce3659881945c24852..c59250683fddc0dc69f86e540d1ac5af45aa0464 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/mqueue/mq_send.c + * sched/mqueue/mq_sndinternal.c * * Copyright (C) 2007, 2009, 2013-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -53,6 +53,7 @@ #include #include #include +#include #include "sched/sched.h" #ifndef CONFIG_DISABLE_SIGNALS @@ -232,6 +233,23 @@ int mq_waitsend(mqd_t mqdes) FAR struct tcb_s *rtcb; FAR struct mqueue_inode_s *msgq; + /* mq_waitsend() is not a cancellation point, but it is always called from + * a cancellation point. + */ + + if (enter_cancellation_point()) + { +#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ + /* If there is a pending cancellation, then do not perform + * the wait. Exit now with ECANCELED. + */ + + set_errno(ECANCELED); + leave_cancellation_point(); + return ERROR; +#endif + } + /* Get a pointer to the message queue */ msgq = mqdes->msgq; @@ -249,6 +267,7 @@ int mq_waitsend(mqd_t mqdes) /* No... We will return an error to the caller. */ set_errno(EAGAIN); + leave_cancellation_point(); return ERROR; } @@ -283,12 +302,14 @@ int mq_waitsend(mqd_t mqdes) if (get_errno() != OK) { + leave_cancellation_point(); return ERROR; } } } } + leave_cancellation_point(); return OK; } diff --git a/sched/mqueue/mq_timedreceive.c b/sched/mqueue/mq_timedreceive.c index b5bb100b89a0ddc0fb80fe02d2c1db9b7e5ef0ec..9df2a6ab61a11b986ebf2e4162ac7066b11fcacd 100644 --- a/sched/mqueue/mq_timedreceive.c +++ b/sched/mqueue/mq_timedreceive.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "sched/sched.h" #include "clock/clock.h" @@ -174,18 +175,24 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, DEBUGASSERT(up_interrupt_context() == false && rtcb->waitdog == NULL); + /* mq_timedreceive() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify the input parameters and, in case of an error, set * errno appropriately. */ if (mq_verifyreceive(mqdes, msg, msglen) != OK) { + leave_cancellation_point(); return ERROR; } if (!abstime || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { set_errno(EINVAL); + leave_cancellation_point(); return ERROR; } @@ -198,6 +205,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, if (!rtcb->waitdog) { set_errno(EINVAL); + leave_cancellation_point(); return ERROR; } @@ -250,6 +258,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, rtcb->waitdog = NULL; set_errno(result); + leave_cancellation_point(); return ERROR; } @@ -288,5 +297,6 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, sched_unlock(); wd_delete(rtcb->waitdog); rtcb->waitdog = NULL; + leave_cancellation_point(); return ret; } diff --git a/sched/mqueue/mq_timedsend.c b/sched/mqueue/mq_timedsend.c index 0b82fb8edb27191621643dc11056433ec3ea05bd..83e25515eb3694ef49ddcaaa2576101b3319cc37 100644 --- a/sched/mqueue/mq_timedsend.c +++ b/sched/mqueue/mq_timedsend.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "clock/clock.h" #include "sched/sched.h" @@ -178,6 +179,10 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, DEBUGASSERT(up_interrupt_context() == false && rtcb->waitdog == NULL); + /* mq_timedsend() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify the input parameters -- setting errno appropriately * on any failures to verify. */ @@ -186,6 +191,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, { /* mq_verifysend() will set the errno appropriately */ + leave_cancellation_point(); return ERROR; } @@ -199,6 +205,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, */ set_errno(ENOMEM); + leave_cancellation_point(); return ERROR; } @@ -229,6 +236,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, ret = mq_dosend(mqdes, mqmsg, msg, msglen, prio); sched_unlock(); + leave_cancellation_point(); return ret; } @@ -320,6 +328,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, sched_unlock(); wd_delete(rtcb->waitdog); rtcb->waitdog = NULL; + leave_cancellation_point(); return ret; /* Exit here with (1) the scheduler locked, (2) a message allocated, (3) a @@ -341,5 +350,6 @@ errout_with_mqmsg: sched_unlock(); set_errno(result); + leave_cancellation_point(); return ERROR; } diff --git a/sched/pthread/Make.defs b/sched/pthread/Make.defs index d27938aa379220439ef47a96ad3da91c62ebd032..6156dd5411260a6e4884a82266edf6d4a4364945 100644 --- a/sched/pthread/Make.defs +++ b/sched/pthread/Make.defs @@ -42,8 +42,9 @@ CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c CSRCS += pthread_condinit.c pthread_conddestroy.c CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c -CSRCS += pthread_cancel.c pthread_setcancelstate.c -CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c pthread_keydelete.c +CSRCS += pthread_cancel.c +CSRCS += pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c +CSRCS += pthread_keydelete.c CSRCS += pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c CSRCS += pthread_once.c pthread_release.c pthread_setschedprio.c @@ -55,6 +56,10 @@ ifeq ($(CONFIG_SMP),y) CSRCS += pthread_setaffinity.c pthread_getaffinity.c endif +ifeq ($(CONFIG_PTHREAD_CLEANUP),y) +CSRCS += pthread_cleanup.c +endif + # Include pthread build support DEPPATH += --dep-path pthread diff --git a/sched/pthread/pthread.h b/sched/pthread/pthread.h index 6371e9df330984f9312d0b6727823ac13c6567c1..be7a20de2eae2e71db3517cc8e5a0e59344d46c6 100644 --- a/sched/pthread/pthread.h +++ b/sched/pthread/pthread.h @@ -96,6 +96,11 @@ struct task_group_s; /* Forward reference */ void weak_function pthread_initialize(void); int pthread_schedsetup(FAR struct pthread_tcb_s *tcb, int priority, start_t start, pthread_startroutine_t entry); + +#ifdef CONFIG_PTHREAD_CLEANUP +void pthread_cleanup_popall(FAR struct pthread_tcb_s *tcb); +#endif + int pthread_completejoin(pid_t pid, FAR void *exit_value); void pthread_destroyjoin(FAR struct task_group_s *group, FAR struct join_s *pjoin); diff --git a/sched/pthread/pthread_cancel.c b/sched/pthread/pthread_cancel.c index a8ba2ee4c9352290f8db65a24032a4ce16fca394..a9b7e8270b74e6304df95f12f9f4eac413d01256 100644 --- a/sched/pthread/pthread_cancel.c +++ b/sched/pthread/pthread_cancel.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread/pthread_cancel.c * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ #include #include "sched/sched.h" +#include "task/task.h" #include "pthread/pthread.h" /**************************************************************************** @@ -53,11 +54,11 @@ int pthread_cancel(pthread_t thread) { - FAR struct tcb_s *tcb; + FAR struct pthread_tcb_s *tcb; /* First, make sure that the handle references a valid thread */ - if (!thread) + if (thread == 0) { /* pid == 0 is the IDLE task. Callers cannot cancel the * IDLE task. @@ -66,8 +67,8 @@ int pthread_cancel(pthread_t thread) return ESRCH; } - tcb = sched_gettcb((pid_t)thread); - if (!tcb) + tcb = (FAR struct pthread_tcb_s *)sched_gettcb((pid_t)thread); + if (tcb == NULL) { /* The pid does not correspond to any known thread. The thread * has probably already exited. @@ -76,13 +77,17 @@ int pthread_cancel(pthread_t thread) return ESRCH; } + /* Only pthreads should use this interface */ + + DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD); + /* Check to see if this thread has the non-cancelable bit set in its * flags. Suppress context changes for a bit so that the flags are stable. - * (the flags should not change in interrupt handling. + * (the flags should not change in interrupt handling). */ sched_lock(); - if ((tcb->flags & TCB_FLAG_NONCANCELABLE) != 0) + if ((tcb->cmn.flags & TCB_FLAG_NONCANCELABLE) != 0) { /* Then we cannot cancel the thread now. Here is how this is * supposed to work: @@ -97,29 +102,67 @@ int pthread_cancel(pthread_t thread) * processing." */ - tcb->flags |= TCB_FLAG_CANCEL_PENDING; + tcb->cmn.flags |= TCB_FLAG_CANCEL_PENDING; sched_unlock(); return OK; } +#ifdef CONFIG_CANCELLATION_POINTS + /* Check if this thread supports deferred cancellation */ + + if ((tcb->cmn.flags & TCB_FLAG_CANCEL_DEFERRED) != 0) + { + /* Then we cannot cancel the thread asynchronously. Mark the cancellation + * as pending. + */ + + tcb->cmn.flags |= TCB_FLAG_CANCEL_PENDING; + + /* If the thread is waiting at a cancellation point, then notify of the + * cancellation thereby waking the task up with an ECANCELED error. + */ + + if (tcb->cmn.cpcount > 0) + { + notify_cancellation(&tcb->cmn); + } + + sched_unlock(); + return OK; + } +#endif + + /* Otherwise, perform the asyncrhonous cancellation */ + sched_unlock(); /* Check to see if the ID refers to ourselves.. this would be the * same as pthread_exit(PTHREAD_CANCELED). */ - if (tcb == this_task()) + if (tcb == (FAR struct pthread_tcb_s *)this_task()) { pthread_exit(PTHREAD_CANCELED); } +#ifdef CONFIG_PTHREAD_CLEANUP + /* Perform any stack pthread clean-up callbacks. + * + * REVISIT: In this case, the clean-up callback will execute on the + * thread of the caller of pthread cancel, not on the thread of + * the thread-to-be-canceled. Is that an issue? Presumably they + * are both within the same group and within the same process address + * space. + */ + + pthread_cleanup_popall(tcb); +#endif + /* Complete pending join operations */ (void)pthread_completejoin((pid_t)thread, PTHREAD_CANCELED); - /* Then let pthread_delete do the real work */ + /* Then let task_terminate do the real work */ - task_delete((pid_t)thread); - return OK; + return task_terminate((pid_t)thread, false); } - diff --git a/sched/pthread/pthread_cleanup.c b/sched/pthread/pthread_cleanup.c new file mode 100644 index 0000000000000000000000000000000000000000..6c71cd8c1380c8ce29ae1d4db1ad48a414449569 --- /dev/null +++ b/sched/pthread/pthread_cleanup.c @@ -0,0 +1,226 @@ +/**************************************************************************** + * sched/pthread/pthread_cleanup.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include + +#include + +#include "sched/sched.h" +#include "pthread/pthread.h" + +#ifdef CONFIG_PTHREAD_CLEANUP + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pthread_cleanup_pop_tcb + * + * Description: + * The pthread_cleanup_pop_tcb() function will remove the routine at the top + * of the calling thread's cancellation cleanup stack and optionally + * invoke it (if 'execute' is non-zero). + * + * Input Parameters: + * tcb - The TCB of the pthread that is exiting or being canceled. + * + * Return Value: + * None + * + * Assumptions: + * The scheduler is locked. + * + ****************************************************************************/ + +static void pthread_cleanup_pop_tcb(FAR struct pthread_tcb_s *tcb, int execute) +{ + if (tcb->tos > 0) + { + unsigned int ndx; + + /* Get the index to the last cleaner function pushed onto the stack */ + + ndx = tcb->tos - 1; + DEBUGASSERT(ndx >= 0 && ndx < CONFIG_PTHREAD_CLEANUP_STACKSIZE); + + /* Should we execute the cleanup routine at the top of the stack? */ + + if (execute != 0) + { + FAR struct pthread_cleanup_s *cb; + + /* Yes.. Execute the clean-up routine. + * + * REVISIT: This is a security problem In the PROTECTED and KERNEL + * builds: We must not call the registered function in supervisor + * mode! See also on_exit() and atexit() callbacks. + */ + + cb = &tcb->stack[ndx]; + cb->pc_cleaner(cb->pc_arg); + } + + tcb->tos = ndx; + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pthread_cleanup_push + * pthread_cleanup_pop + * + * Description: + * The pthread_cleanup_pop() function will remove the routine at the top + * of the calling thread's cancellation cleanup stack and optionally + * invoke it (if 'execute' is non-zero). + * + * The pthread_cleanup_push() function will push the specified cancellation + * cleanup handler routine onto the calling thread's cancellation cleanup + * stack. The cancellation cleanup handler will be popped from the + * cancellation cleanup stack and invoked with the argument arg when: + * + * - The thread exits (that is, calls pthread_exit()). + * - The thread acts upon a cancellation request. + * - The thread calls pthread_cleanup_pop() with a non-zero execute argument. + * + * Input Parameters: + * routine - The cleanup routine to be pushed on the the cleanup stack. + * arg - An argument that will accompany the callback. + * execute - Execute the popped cleanup function immediately. + * + * Returned Value: + * None + * + ****************************************************************************/ + +void pthread_cleanup_pop(int execute) +{ + FAR struct pthread_tcb_s *tcb = (FAR struct pthread_tcb_s *)this_task(); + + /* We don't assert if called from a non-pthread; we just don't do anything */ + + DEBUGASSERT(tcb != NULL); + + /* sched_lock() should provide sufficient protection. We only need to + * have this TCB stationary; the pthread cleanup stack should never be + * modified by interrupt level logic. + */ + + sched_lock(); + if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + pthread_cleanup_pop_tcb(tcb, execute); + } + + sched_unlock(); +} + +void pthread_cleanup_push(pthread_cleanup_t routine, FAR void *arg) +{ + FAR struct pthread_tcb_s *tcb = (FAR struct pthread_tcb_s *)this_task(); + + /* We don't assert if called from a non-pthread; we just don't do anything */ + + DEBUGASSERT(tcb != NULL); + DEBUGASSERT(tcb->tos < CONFIG_PTHREAD_CLEANUP_STACKSIZE); + + /* sched_lock() should provide sufficient protection. We only need to + * have this TCB stationary; the pthread cleanup stack should never be + * modified by interrupt level logic. + */ + + sched_lock(); + if ((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD && + tcb->tos < CONFIG_PTHREAD_CLEANUP_STACKSIZE) + { + unsigned int ndx = tcb->tos; + + tcb->tos++; + tcb->stack[ndx].pc_cleaner = routine; + tcb->stack[ndx].pc_arg = arg; + } + + sched_unlock(); +} + +/**************************************************************************** + * Name: pthread_cleanup_popall + * + * Description: + * The pthread_cleanup_popall() is an internal function that will pop and + * execute all clean-up functions. This function is only called from within + * the pthread_exit() and pthread_cancellation() logic + * + * Input Parameters: + * tcb - The TCB of the pthread that is exiting or being canceled. + * + * Returned Value: + * None + * + ****************************************************************************/ + +void pthread_cleanup_popall(FAR struct pthread_tcb_s *tcb) +{ + DEBUGASSERT(tcb != NULL); + DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD); + + /* Pop and execute each cleanup routine/ + * + * sched_lock() should provide sufficient protection. We only need to + * have this TCB stationary; the pthread cleanup stack should never be + * modified by interrupt level logic. + */ + + sched_lock(); + while (tcb->tos > 0) + { + pthread_cleanup_pop_tcb(tcb, 1); + } + + sched_unlock(); +} + +#endif /* CONFIG_PTHREAD_CLEANUP */ diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index 7950c5b5fc45f046def501e17cf1265d20c6dc9e..9027c305ef940310377b6aaa6470314ede4d1126 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -51,6 +51,7 @@ #include #include +#include #include "sched/sched.h" #include "pthread/pthread.h" @@ -178,6 +179,10 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, DEBUGASSERT(rtcb->waitdog == NULL); + /* pthread_cond_timedwait() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Make sure that non-NULL references were provided. */ if (!cond || !mutex) @@ -338,6 +343,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, } } + leave_cancellation_point(); sinfo("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index a9ad2ba91cfc0c1832f6bcee2e0038761227ec13..e7c6a9af255056bebeb7eaaa0e1aaac8c07eeaa8 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread/pthread_condwait.c * - * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,8 @@ #include #include +#include + #include "pthread/pthread.h" /**************************************************************************** @@ -73,9 +75,13 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) sinfo("cond=0x%p mutex=0x%p\n", cond, mutex); + /* pthread_cond_wait() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Make sure that non-NULL references were provided. */ - if (!cond || !mutex) + if (cond == NULL || mutex == NULL) { ret = EINVAL; } @@ -101,16 +107,21 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) ret |= pthread_takesemaphore((FAR sem_t *)&cond->sem); sched_unlock(); - /* Reacquire the mutex */ + /* Reacquire the mutex. + * + * REVISIT: When cancellation points are enabled, we will almost + * certainly hold the mutex when the pthread is canceled. + */ sinfo("Reacquire mutex...\n"); ret |= pthread_takesemaphore((FAR sem_t *)&mutex->sem); - if (!ret) + if (ret == OK) { mutex->pid = getpid(); } } + leave_cancellation_point(); sinfo("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 6efc9aa21ad6bc1c013f6b23aa9555b2eeedaf27..7a4e628e00d91308c103eb9e384bfca966e8f350 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -483,6 +483,12 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, #endif } +#ifdef CONFIG_CANCELLATION_POINTS + /* Set the deferred cancellation type */ + + ptcb->cmn.flags |= TCB_FLAG_CANCEL_DEFERRED; +#endif + /* Get the assigned pid before we start the task (who knows what * could happen to ptcb after this!). Copy this ID into the join structure * as well. diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index 15b6240ee79ace4c1e217b9c8aa443f8cba50923..40a5b7fb0de84b7be5fa554c05dccc2efa0dbb29 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -80,6 +80,9 @@ void pthread_exit(FAR void *exit_value) sinfo("exit_value=%p\n", exit_value); + DEBUGASSERT(tcb != NULL); + DEBUGASSERT((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD); + /* Block any signal actions that would awaken us while were * are performing the JOIN handshake. */ @@ -91,6 +94,23 @@ void pthread_exit(FAR void *exit_value) } #endif +#ifdef CONFIG_CANCELLATION_POINTS + /* Mark the pthread as non-cancelable to avoid additional calls to + * pthread_exit() due to any cancellation point logic that might get + * kicked off by actions taken during pthread_exit processing. + */ + + tcb->flags |= TCB_FLAG_NONCANCELABLE; + tcb->flags &= ~TCB_FLAG_CANCEL_PENDING; + tcb->cpcount = 0; +#endif + +#ifdef CONFIG_PTHREAD_CLEANUP + /* Perform any stack pthread clean-up callbacks */ + + pthread_cleanup_popall((FAR struct pthread_tcb_s *)tcb); +#endif + /* Complete pending join operations */ status = pthread_completejoin(getpid(), exit_value); diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 9b73fd4268f8adb0eb9d12fb20812e5ce58b7247..01c1c713eaabb3ff23d78a0c946b2dcc34530967 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread/pthread_join.c * - * Copyright (C) 2007, 2008, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008, 2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,16 @@ * Included Files ****************************************************************************/ +#include + #include #include #include #include #include +#include + #include "sched/sched.h" #include "group/group.h" #include "pthread/pthread.h" @@ -90,12 +94,17 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) sinfo("thread=%d group=%p\n", thread, group); DEBUGASSERT(group); + /* pthread_join() is a cancellation point */ + + (void)enter_cancellation_point(); + /* First make sure that this is not an attempt to join to * ourself. */ if ((pid_t)thread == getpid()) { + leave_cancellation_point(); return EDEADLK; } @@ -230,6 +239,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) ret = OK; } + leave_cancellation_point(); sinfo("Returning %d\n", ret); return ret; } diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c index a6b945f67022f370ef28968357162c12fc2fe2e0..8bab62c4743a8417a68301b403391adb061c0f7f 100644 --- a/sched/pthread/pthread_mutexdestroy.c +++ b/sched/pthread/pthread_mutexdestroy.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -74,7 +75,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) sinfo("mutex=0x%p\n", mutex); - if (!mutex) + if (mutex == NULL) { ret = EINVAL; } @@ -90,7 +91,29 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) if (mutex->pid != -1) { - ret = EBUSY; +#ifndef CONFIG_DISABLE_SIGNALS + /* Verify that the PID still exists. We may be destroying the + * mutex after cancelling a pthread and the mutex may have been + * in a bad state owned by the dead pthread. + */ + + ret = kill(mutex->pid, 0); + if (ret < 0) + { + /* The thread associated with the PID no longer exists */ + + mutex->pid = -1; + + /* Destroy the semaphore */ + + status = sem_destroy((FAR sem_t *)&mutex->sem); + ret = (status != OK) ? get_errno() : OK; + } + else +#endif + { + ret = EBUSY; + } } else { @@ -99,7 +122,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) status = sem_destroy((FAR sem_t *)&mutex->sem); if (status != OK) { - ret = EINVAL; + ret = get_errno(); } } diff --git a/sched/sched/sched.h b/sched/sched/sched.h index 9e4bd64ba399d05d4a57879b559520e78e6d7c1e..c8534e139950b5c95a62206b6299e6ff872c259b 100644 --- a/sched/sched/sched.h +++ b/sched/sched/sched.h @@ -353,12 +353,12 @@ extern volatile uint32_t g_cpuload_total; * least one CPU has pre-emption disabled. */ -extern volatile spinlock_t g_cpu_schedlock; +extern volatile spinlock_t g_cpu_schedlock SP_SECTION; /* Used to keep track of which CPU(s) hold the IRQ lock. */ -extern volatile spinlock_t g_cpu_locksetlock; -extern volatile cpu_set_t g_cpu_lockset; +extern volatile spinlock_t g_cpu_locksetlock SP_SECTION; +extern volatile cpu_set_t g_cpu_lockset SP_SECTION; #endif /* CONFIG_SMP */ diff --git a/sched/sched/sched_addreadytorun.c b/sched/sched/sched_addreadytorun.c index 77b1492c5350e3ecf38d2a5d4b7cee87f4ec5229..3d9fc6179e25862eb40bb18867e49741fca91f89 100644 --- a/sched/sched/sched_addreadytorun.c +++ b/sched/sched/sched_addreadytorun.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sched/sched_addreadytorun.c * - * Copyright (C) 2007-2009, 2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2014, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -167,10 +167,11 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) { FAR struct tcb_s *rtcb; FAR dq_queue_t *tasklist; - int task_state; - int cpu; bool switched; bool doswitch; + int task_state; + int cpu; + int me; /* Check if the blocked TCB is locked to this CPU */ @@ -226,9 +227,17 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * disabled. If the selected state is TSTATE_TASK_READYTORUN, then it * should also go to the pending task list so that it will have a chance * to be restarted when the scheduler is unlocked. + * + * There is an interaction here with IRQ locking. Even if the pre- + * emption is enabled, tasks will be forced to pend if the IRQ lock + * is also set UNLESS the CPU starting the thread is also the holder of + * the IRQ lock. irq_cpu_locked() performs an atomic check for that + * situation. */ - if (spin_islocked(&g_cpu_schedlock) && task_state != TSTATE_TASK_ASSIGNED) + me = this_cpu(); + if ((spin_islocked(&g_cpu_schedlock) || irq_cpu_locked(me)) && + task_state != TSTATE_TASK_ASSIGNED) { /* Add the new ready-to-run task to the g_pendingtasks task list for * now. @@ -255,10 +264,8 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) } else /* (task_state == TSTATE_TASK_ASSIGNED || task_state == TSTATE_TASK_RUNNING) */ { - int me = this_cpu(); - - /* If we are modifying some assigned task list other than our own, we will - * need to stop that CPU. + /* If we are modifying some assigned task list other than our own, we + * will need to stop that CPU. */ if (cpu != me) @@ -273,7 +280,8 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) tasklist = (FAR dq_queue_t *)&g_assignedtasks[cpu]; switched = sched_addprioritized(btcb, tasklist); - /* If the selected task was the g_assignedtasks[] list, then a context + /* If the selected task list was the g_assignedtasks[] list and if the + * new tasks is the highest priority (RUNNING) task, then a context * switch will occur. */ @@ -314,13 +322,40 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) if (btcb->irqcount > 0) { + /* Yes... make sure that scheduling logic on other CPUs knows + * that we hold the IRQ lock. + */ + spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, &g_cpu_irqlock); } - else + + /* No.. This CPU will be relinquishing the lock. But this works + * differently if we are performing a context switch from an + * interrupt handler and the interrupt handler has established + * a critical section. We can detect this case when + * g_cpu_nestcount[me] > 0. + */ + + else if (g_cpu_nestcount[me] <= 0) { + /* Release our hold on the IRQ lock. */ + spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, - &g_cpu_irqlock); + &g_cpu_irqlock); + } + + /* Sanity check. g_cpu_netcount should be greater than zero + * only while we are within the critical section and within + * an interrupt handler. If we are not in an interrupt handler + * then there is a problem; perhaps some logic previously + * called enter_critical_section() with no matching call to + * leave_critical_section(), leaving the non-zero count. + */ + + else + { + DEBUGASSERT(up_interrupt_context()); } /* If the following task is not locked to this CPU, then it must @@ -367,7 +402,14 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) } else { - /* No context switch. Assign the CPU and set the assigned state */ + /* No context switch. Assign the CPU and set the assigned state. + * + * REVISIT: I have seen this assertion fire. Apparently another + * CPU may add another, higher prioirity task to the same + * g_assignedtasks[] list sometime after sched_cpu_select() was + * called above, leaving this TCB in the wrong task list if task_state + * is TSTATE_TASK_ASSIGNED). + */ DEBUGASSERT(task_state == TSTATE_TASK_ASSIGNED); diff --git a/sched/sched/sched_cpupause.c b/sched/sched/sched_cpupause.c index 513e8deb489367f50726a0a7c232f8c75a3d4509..d2b14d187d7858070fccfa08ee7878debbc8513f 100644 --- a/sched/sched/sched_cpupause.c +++ b/sched/sched/sched_cpupause.c @@ -44,6 +44,7 @@ #include #include +#include #include "sched/sched.h" diff --git a/sched/sched/sched_lock.c b/sched/sched/sched_lock.c index 36b53775d21211ac1b588faf4b1f7a19f9bae878..5f389eed57f0ee518c0460a8da1965158a78a449 100644 --- a/sched/sched/sched_lock.c +++ b/sched/sched/sched_lock.c @@ -109,12 +109,12 @@ * least one CPU has pre-emption disabled. */ -volatile spinlock_t g_cpu_schedlock = SP_UNLOCKED; +volatile spinlock_t g_cpu_schedlock SP_SECTION = SP_UNLOCKED; /* Used to keep track of which CPU(s) hold the IRQ lock. */ -volatile spinlock_t g_cpu_locksetlock; -volatile cpu_set_t g_cpu_lockset; +volatile spinlock_t g_cpu_locksetlock SP_SECTION; +volatile cpu_set_t g_cpu_lockset SP_SECTION; #endif /* CONFIG_SMP */ diff --git a/sched/sched/sched_mergepending.c b/sched/sched/sched_mergepending.c index 07a554ff068d4616e61df96616dbf48f737c8411..15e87ce99c67af4ab0951506289a88ca4b7bcb04 100644 --- a/sched/sched/sched_mergepending.c +++ b/sched/sched/sched_mergepending.c @@ -48,6 +48,7 @@ # include #endif +#include "irq/irq.h" #include "sched/sched.h" /**************************************************************************** @@ -196,15 +197,16 @@ bool sched_mergepending(void) FAR struct tcb_s *tcb; bool ret = false; int cpu; + int me; /* Remove and process every TCB in the g_pendingtasks list. * - * This function is only called in the context where locking is known to - * disabled on one CPU. However, we must do nothing if pre-emption is - * still locked because of actions of other CPUs. + * Do nothing if (1) pre-emption is still disabled (by any CPU), or (2) if + * some CPU other than this one is in a critical section. */ - if (!spin_islocked(&g_cpu_schedlock)) + me = this_cpu(); + if (!spin_islocked(&g_cpu_schedlock) && !irq_cpu_locked(me)) { /* Find the CPU that is executing the lowest priority task */ @@ -243,7 +245,7 @@ bool sched_mergepending(void) * Check if that happened. */ - if (spin_islocked(&g_cpu_schedlock)) + if (spin_islocked(&g_cpu_schedlock) || irq_cpu_locked(me)) { /* Yes.. then we may have incorrectly placed some TCBs in the * g_readytorun list (unlikely, but possible). We will have to @@ -271,11 +273,11 @@ bool sched_mergepending(void) return ret; } - cpu = sched_cpu_select(ALL_CPUS /* ptcb->affinity */); + cpu = sched_cpu_select(ALL_CPUS /* ptcb->affinity */); rtcb = current_task(cpu); } - /* No more pending tasks can be made running. Move any reamaining + /* No more pending tasks can be made running. Move any remaining * tasks in the pending task list to the ready-to-run task list. */ diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index 4dc1bd262ecbaac797eb0cc1c8617b2cb59915e0..bdc308fa91dc20af2501e05264aceb0fb7edd711 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -46,8 +46,11 @@ #include #include +#include #include +#include "sched/sched.h" + #ifdef CONFIG_SCHED_INSTRUMENTATION_BUFFER /**************************************************************************** @@ -60,8 +63,8 @@ struct note_info_s { - unsigned int ni_head; - unsigned int ni_tail; + volatile unsigned int ni_head; + volatile unsigned int ni_tail; uint8_t ni_buffer[CONFIG_SCHED_NOTE_BUFSIZE]; }; @@ -79,6 +82,12 @@ struct note_startalloc_s # define SIZEOF_NOTE_START(n) (sizeof(struct note_start_s)) #endif +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void note_add(FAR const uint8_t *note, uint8_t notelen); + /**************************************************************************** * Private Data ****************************************************************************/ @@ -122,8 +131,10 @@ static inline unsigned int note_next(unsigned int ndx, unsigned int offset) * Fill in some of the common fields in the note structure. * * Input Parameters: - * tcb - The TCB containing the information - * note - The common note structure to use + * tcb - The TCB containing the information + * note - The common note structure to use + * length - The total lengthof the note structure + * type - The type of the note * * Returned Value: * None @@ -154,6 +165,39 @@ static void note_common(FAR struct tcb_s *tcb, FAR struct note_common_s *note, note->nc_systime[3] = (uint8_t)((systime >> 24) & 0xff); } +/**************************************************************************** + * Name: note_spincommon + * + * Description: + * Common logic for NOTE_SPINLOCK, NOTE_SPINLOCKED, and NOTE_SPINUNLOCK + * + * Input Parameters: + * tcb - The TCB containing the information + * note - The common note structure to use + * + * Returned Value: + * None + * + ****************************************************************************/ + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS +void note_spincommon(FAR struct tcb_s *tcb, FAR volatile spinlock_t *spinlock, + int type) +{ + struct note_spinlock_s note; + + /* Format the note */ + + note_common(tcb, ¬e.nsp_cmn, sizeof(struct note_spinlock_s), type); + note.nsp_spinlock = (FAR void *)spinlock; + note.nsp_value = (uint8_t)*spinlock; + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_spinlock_s)); +} +#endif + /**************************************************************************** * Name: note_length * @@ -244,6 +288,33 @@ static void note_add(FAR const uint8_t *note, uint8_t notelen) unsigned int head; unsigned int next; +#ifdef CONFIG_SMP + /* Ignore notes that are not in the set of monitored CPUs */ + + if ((CONFIG_SCHED_INSTRUMENTATION_CPUSET & (1 << this_cpu())) == 0) + { + /* Not in the set of monitored CPUs. Do not log the note. */ + + return; + } +#endif + + /* REVISIT: In the single CPU case, the following should be safe because + * the logic is always called within a critical section, but in the SMP + * case we have protection. One option would be to precalculate and + * advancing the new head entry before writing the data into the buffer. + * That will eliminate fatal race conditions (although could result in + * single notes being corrupted harmlessly). + * + * But there is a complexity: Advancing the head pointer where the note + * buffer is almost full could advance the head to wrap beyond the tail + * leaving the buffer in a bad state. A solution to this would be to pre- + * remove entries at the tail of the buffer as necessary to make certain + * that there will be space for the new note at the beginning of the + * buffer. I am less certain that this can be done safely in the SMP + * case. + */ + /* Get the index to the head of the circular buffer */ DEBUGASSERT(note != NULL && notelen < CONFIG_SCHED_NOTE_BUFSIZE); @@ -369,6 +440,89 @@ void sched_note_resume(FAR struct tcb_s *tcb) note_add((FAR const uint8_t *)¬e, sizeof(struct note_resume_s)); } +#ifdef CONFIG_SMP +void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu) +{ + struct note_cpu_start_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_start_s), NOTE_CPU_START); + note.ncs_target = (uint8_t)cpu; + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_start_s)); +} + +void sched_note_cpu_started(FAR struct tcb_s *tcb) +{ + struct note_cpu_started_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncs_cmn, sizeof(struct note_cpu_started_s), NOTE_CPU_STARTED); + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_started_s)); +} + +void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu) +{ + struct note_cpu_pause_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_pause_s), NOTE_CPU_PAUSE); + note.ncp_target = (uint8_t)cpu; + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_pause_s)); +} + +void sched_note_cpu_paused(FAR struct tcb_s *tcb) +{ + struct note_cpu_paused_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncp_cmn, sizeof(struct note_cpu_paused_s), NOTE_CPU_PAUSED); + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_paused_s)); +} + +void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu) +{ + struct note_cpu_resume_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resume_s), NOTE_CPU_RESUME); + note.ncr_target = (uint8_t)cpu; + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_resume_s)); +} + +void sched_note_cpu_resumed(FAR struct tcb_s *tcb) +{ + struct note_cpu_resumed_s note; + + /* Format the note */ + + note_common(tcb, ¬e.ncr_cmn, sizeof(struct note_cpu_resumed_s), NOTE_CPU_RESUMED); + + /* Add the note to circular buffer */ + + note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_resumed_s)); +} +#endif + #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION void sched_note_premption(FAR struct tcb_s *tcb, bool locked) { @@ -407,6 +561,27 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter) } #endif +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS +void sched_note_spinlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock) +{ + note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCK); +} + +void sched_note_spinlocked(FAR struct tcb_s *tcb, FAR volatile void *spinlock) +{ + note_spincommon(tcb, spinlock, NOTE_SPINLOCK_LOCKED); +} + +void sched_note_spinunlock(FAR struct tcb_s *tcb, FAR volatile void *spinlock) +{ + note_spincommon(tcb, spinlock, NOTE_SPINLOCK_UNLOCK); +} +void sched_note_spinabort(FAR struct tcb_s *tcb, FAR volatile void *spinlock) +{ + note_spincommon(tcb, spinlock, NOTE_SPINLOCK_ABORT); +} +#endif + /**************************************************************************** * Name: sched_note_get * @@ -425,6 +600,7 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter) * ****************************************************************************/ +#ifdef CONFIG_SCHED_NOTE_GET ssize_t sched_note_get(FAR uint8_t *buffer, size_t buflen) { FAR struct note_common_s *note; @@ -492,6 +668,7 @@ errout_with_csection: leave_critical_section(flags); return notelen; } +#endif /**************************************************************************** * Name: sched_note_size @@ -508,6 +685,7 @@ errout_with_csection: * ****************************************************************************/ +#ifdef CONFIG_SCHED_NOTE_GET ssize_t sched_note_size(void) { FAR struct note_common_s *note; @@ -542,5 +720,6 @@ errout_with_csection: leave_critical_section(flags); return notelen; } +#endif #endif /* CONFIG_SCHED_INSTRUMENTATION_BUFFER */ diff --git a/sched/sched/sched_removereadytorun.c b/sched/sched/sched_removereadytorun.c index 35543037ef4a4ab7f2a1c94dd93ef215cfb41937..2f5ec9295a5c389acdefc739505a3e8857e60ce0 100644 --- a/sched/sched/sched_removereadytorun.c +++ b/sched/sched/sched_removereadytorun.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sched_removereadytorun.c * - * Copyright (C) 2007-2009, 2012, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2012, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -145,7 +145,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) cpu = rtcb->cpu; tasklist = TLIST_HEAD(rtcb->task_state, cpu); - /* Check if the TCB to be removed is at the head of a ready to run list. + /* Check if the TCB to be removed is at the head of a ready-to-run list. * For the case of SMP, there are two lists involved: (1) the * g_readytorun list that holds non-running tasks that have not been * assigned to a CPU, and (2) and the g_assignedtasks[] lists which hold @@ -154,15 +154,18 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) * only only removing the head of that list can result in a context * switch. * - * The tasklist RUNNABLE attribute will inform us if the list holds the - * currently executing and task and, hence, if a context switch could - * occur. + * rtcb->blink == NULL will tell us if the TCB is at the head of the + * ready-to-run list and, hence, a candidate for the new running task. + * + * If so, then the tasklist RUNNABLE attribute will inform us if the list + * holds the currently executing task and, hence, if a context switch + * should occur. */ if (rtcb->blink == NULL && TLIST_ISRUNNABLE(rtcb->task_state)) { FAR struct tcb_s *nxttcb; - FAR struct tcb_s *rtrtcb; + FAR struct tcb_s *rtrtcb = NULL; int me; /* There must always be at least one task in the list (the IDLE task) @@ -195,17 +198,27 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) * g_readytorun list. We can only select a task from that list if * the affinity mask includes the current CPU. * - * REVISIT: What should we do, if anything, if pre-emption is locked - * by the another CPU? Should just used nxttcb? Should we select - * from the pending task list instead of the g_readytorun list? + * If pre-emption is locked or another CPU is in a critical section, + * then use the 'nxttcb' which will probably be the IDLE thread. + * REVISIT: What if it is not the IDLE thread? */ - for (rtrtcb = (FAR struct tcb_s *)g_readytorun.head; - rtrtcb != NULL && !CPU_ISSET(cpu, &rtrtcb->affinity); - rtrtcb = (FAR struct tcb_s *)rtrtcb->flink); + if (!spin_islocked(&g_cpu_schedlock) && !irq_cpu_locked(me)) + { + /* Search for the highest priority task that can run on this + * CPU. + */ + + for (rtrtcb = (FAR struct tcb_s *)g_readytorun.head; + rtrtcb != NULL && !CPU_ISSET(cpu, &rtrtcb->affinity); + rtrtcb = (FAR struct tcb_s *)rtrtcb->flink); + } /* Did we find a task in the g_readytorun list? Which task should - * we use? We decide strictly by the priority of the two tasks. + * we use? We decide strictly by the priority of the two tasks: + * Either (1) the task currently at the head of the g_assignedtasks[cpu] + * list (nexttcb) or (2) the highest priority task from the + * g_readytorun list with matching affinity (rtrtcb). */ if (rtrtcb != NULL && rtrtcb->sched_priority >= nxttcb->sched_priority) @@ -247,23 +260,46 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) &g_cpu_schedlock); } - /* Interrupts may be disabled after the switch. If irqcount is greater - * than zero, then this task/this CPU holds the IRQ lock + /* Adjust global IRQ controls. If irqcount is greater than zero, + * then this task/this CPU holds the IRQ lock */ if (nxttcb->irqcount > 0) { - /* Yes... make sure that scheduling logic knows about this */ + /* Yes... make sure that scheduling logic on other CPUs knows + * that we hold the IRQ lock. + */ spin_setbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, &g_cpu_irqlock); } - else + + /* No.. This CPU will be relinquishing the lock. But this works + * differently if we are performing a context switch from an + * interrupt handler and the interrupt handler has established + * a critical section. We can detect this case when + * g_cpu_nestcount[me] > 0. + */ + + else if (g_cpu_nestcount[me] <= 0) { - /* No.. we may need to perform release our hold on the irq state. */ + /* Release our hold on the IRQ lock. */ spin_clrbit(&g_cpu_irqset, cpu, &g_cpu_irqsetlock, - &g_cpu_irqlock); + &g_cpu_irqlock); + } + + /* Sanity check. g_cpu_netcount should be greater than zero + * only while we are within the critical section and within + * an interrupt handler. If we are not in an interrupt handler + * then there is a problem; perhaps some logic previously + * called enter_critical_section() with no matching call to + * leave_critical_section(), leaving the non-zero count. + */ + + else + { + DEBUGASSERT(up_interrupt_context()); } nxttcb->task_state = TSTATE_TASK_RUNNING; diff --git a/sched/sched/sched_roundrobin.c b/sched/sched/sched_roundrobin.c index bf856004d67024d5882e22e28af0cc83b6916ed5..9aa5a6b8edf30b74b0374e5801337f43b44fe76c 100644 --- a/sched/sched/sched_roundrobin.c +++ b/sched/sched/sched_roundrobin.c @@ -105,23 +105,20 @@ uint32_t sched_roundrobin_process(FAR struct tcb_s *tcb, uint32_t ticks, /* How much can we decrement the timeslice delay? If 'ticks' is greater * than the timeslice value, then we ignore any excess amount. * - * 'ticks' should never be greater than the remaining timeslice. We try - * to handle that gracefully but it would be an error in the scheduling - * if there ever were the case. + * 'ticks' should not be greater than the remaining timeslice. But that + * event seems to be possible, perhaps in cases where pre-emption has been + * disabled or the noswitches flag is set. This might cause jitter of a + * few ticks in the slicing because the excess amount is not handled. */ - DEBUGASSERT(tcb != NULL && ticks <= tcb->timeslice); + DEBUGASSERT(tcb != NULL); decr = MIN(tcb->timeslice, ticks); /* Decrement the timeslice counter */ tcb->timeslice -= decr; - /* Did decrementing the timeslice counter cause the timeslice to expire? - * - * If the task has pre-emption disabled. Then we will let the timeslice - * count go negative as a indication of this situation. - */ + /* Did decrementing the timeslice counter cause the timeslice to expire? */ ret = tcb->timeslice; if (tcb->timeslice <= 0 && !sched_islocked(tcb)) diff --git a/sched/sched/sched_setpriority.c b/sched/sched/sched_setpriority.c index 9e2c9384aa9c434c7f067a15687d8a9b70f4c386..bf273e1e5b2e0af002ddfd97c38cc305cc72d1be 100644 --- a/sched/sched/sched_setpriority.c +++ b/sched/sched/sched_setpriority.c @@ -46,12 +46,71 @@ #include #include +#include "irq/irq.h" #include "sched/sched.h" /**************************************************************************** * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: sched_nexttcb + * + * Description: + * Get the next highest priority ready-to-run task. + * + * Inputs: + * tcb - the TCB of task to reprioritize. + * + * Return Value: + * TCB of the next highest priority ready-to-run task. + * + ****************************************************************************/ + +#ifdef CONFIG_SMP +static FAR struct tcb_s *sched_nexttcb(FAR struct tcb_s *tcb) +{ + FAR struct tcb_s *nxttcb = (FAR struct tcb_s *)tcb->flink; + FAR struct tcb_s *rtrtcb; + int cpu = this_cpu(); + + /* Which task should run next? It will be either the next tcb in the + * assigned task list (nxttcb) or a TCB in the g_readytorun list. We can + * only select a task from that list if the affinity mask includes the + * current CPU. + * + * If pre-emption is locked or another CPU is in a critical section, + * then use the 'nxttcb' which will probably be the IDLE thread. + */ + + if (!spin_islocked(&g_cpu_schedlock) && !irq_cpu_locked(cpu)) + { + /* Search for the highest priority task that can run on this CPU. */ + + for (rtrtcb = (FAR struct tcb_s *)g_readytorun.head; + rtrtcb != NULL && !CPU_ISSET(cpu, &rtrtcb->affinity); + rtrtcb = (FAR struct tcb_s *)rtrtcb->flink); + + /* Return the TCB from the readyt-to-run list if it is the next + * highest priority task. + */ + + if (rtrtcb != NULL && + rtrtcb->sched_priority >= nxttcb->sched_priority) + { + return rtrtcb; + } + } + + /* Otherwise, return the next TCB in the g_assignedtasks[] list... + * probably the TCB of the IDLE thread. + * REVISIT: What if it is not the IDLE thread? + */ + + return nxttcb; +} +#endif + /**************************************************************************** * Name: sched_running_setpriority * @@ -77,12 +136,24 @@ static inline void sched_running_setpriority(FAR struct tcb_s *tcb, int sched_priority) { + FAR struct tcb_s *nxttcb; + + /* Get the TCB of the next highest priority, ready to run task */ + +#ifdef CONFIG_SMP + nxttcb = sched_nexttcb(tcb); +#else + nxttcb = (FAR struct tcb_s *)tcb->flink; +#endif + + DEBUGASSERT(nxttcb != NULL); + /* A context switch will occur if the new priority of the running * task becomes less than OR EQUAL TO the next highest priority * ready to run task. */ - if (sched_priority <= tcb->flink->sched_priority) + if (sched_priority <= nxttcb->sched_priority) { /* A context switch will occur. */ diff --git a/sched/sched/sched_unlock.c b/sched/sched/sched_unlock.c index 9a6ff5a924857fc7ad46c2b58de69cc92fe81c20..d22a4b48bd6bdccbce68bc3aa092532b63099c6e 100644 --- a/sched/sched/sched_unlock.c +++ b/sched/sched/sched_unlock.c @@ -44,6 +44,7 @@ #include #include +#include "irq/irq.h" #include "sched/sched.h" /**************************************************************************** @@ -66,6 +67,14 @@ int sched_unlock(void) { FAR struct tcb_s *rtcb = this_task(); +#ifdef CONFIG_SMP + int cpu; + + cpu = this_cpu(); + rtcb = current_task(cpu); +#else + rtcb = this_task(); +#endif /* Check for some special cases: (1) rtcb may be NULL only during * early boot-up phases, and (2) sched_unlock() should have no @@ -106,23 +115,48 @@ int sched_unlock(void) */ DEBUGASSERT(g_cpu_schedlock == SP_LOCKED && - (g_cpu_lockset & (1 << this_cpu())) != 0); + (g_cpu_lockset & (1 << cpu)) != 0); - spin_clrbit(&g_cpu_lockset, this_cpu(), &g_cpu_locksetlock, + spin_clrbit(&g_cpu_lockset, cpu, &g_cpu_locksetlock, &g_cpu_schedlock); #endif /* Release any ready-to-run tasks that have collected in - * g_pendingtasks. In the SMP case, the scheduler remains - * locked if interrupts are disabled. + * g_pendingtasks. * * NOTE: This operation has a very high likelihood of causing * this task to be switched out! */ #ifdef CONFIG_SMP - if (g_pendingtasks.head != NULL && rtcb->irqcount <= 0) + /* In the SMP case, the tasks remains pend(1) if we are + * in a critical section, i.e., g_cpu_irqlock is locked by other + * CPUs, or (2) other CPUs still have pre-emption disabled, i.e., + * g_cpu_schedlock is locked. In those cases, the release of the + * pending tasks must be deferred until those conditions are met. + * + * There are certain conditions that we must avoid by preventing + * releasing the pending tasks while within the critical section + * of other CPUs. This logic does that and there is matching + * logic in sched_addreadytorun to avoid starting new tasks within + * the critical section (unless the CPU is the holder of the lock). + * + * REVISIT: If this CPU is only one that holds the IRQ lock, then + * we should go ahead and release the pending tasks. See the logic + * leave_critical_section(): It will call up_release_pending() + * BEFORE it clears IRQ lock. + * BEFORE it clears IRQ lock. + */ + + if (!spin_islocked(&g_cpu_schedlock) && !irq_cpu_locked(cpu) && + g_pendingtasks.head != NULL) #else + /* In the single CPU case, decrementing irqcount to zero is + * sufficient to release the pending tasks. Further, in that + * configuration, critical sections and pre-emption can operate + * fully independently. + */ + if (g_pendingtasks.head != NULL) #endif { diff --git a/sched/sched/sched_wait.c b/sched/sched/sched_wait.c index d1547e07cfa75c0784e1ff29f4fe4667bdb197e2..c558de50bf6ad341b9d92e111a3542e4081bf50d 100644 --- a/sched/sched/sched_wait.c +++ b/sched/sched/sched_wait.c @@ -80,8 +80,11 @@ pid_t wait(FAR int *stat_loc) { + /* wait() is a cancellation point, but nothings needs to be done for this + * trivial case. + */ + return waitpid((pid_t)-1, stat_loc, 0); } #endif /* CONFIG_SCHED_WAITPID && CONFIG_SCHED_HAVE_PARENT */ - diff --git a/sched/sched/sched_waitid.c b/sched/sched/sched_waitid.c index f4e48d5f649c9799608ab541067021b37da83938..dd3dd86211fa77ff2636698c28fddf44f6893cd1 100644 --- a/sched/sched/sched_waitid.c +++ b/sched/sched/sched_waitid.c @@ -44,6 +44,7 @@ #include #include +#include #include "sched/sched.h" #include "group/group.h" @@ -164,6 +165,10 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) int errcode; int ret; + /* waitid() is a cancellation point */ + + (void)enter_cancellation_point(); + /* MISSING LOGIC: If WNOHANG is provided in the options, then this function * should returned immediately. However, there is no mechanism available now * know if the thread has child: The children remember their parents (if @@ -404,12 +409,14 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) } } + leave_cancellation_point(); sched_unlock(); return OK; errout_with_errno: set_errno(errcode); errout: + leave_cancellation_point(); sched_unlock(); return ERROR; } diff --git a/sched/sched/sched_waitpid.c b/sched/sched/sched_waitpid.c index a3ef50674f1cf8884cca1c9c5d422953db16862e..aca86d093fe646a9a38d08d5eb31b4518e77e320 100644 --- a/sched/sched/sched_waitpid.c +++ b/sched/sched/sched_waitpid.c @@ -45,6 +45,7 @@ #include #include +#include #include "sched/sched.h" #include "group/group.h" @@ -185,12 +186,17 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) DEBUGASSERT(stat_loc); + /* waitpid() is a cancellation point */ + + (void)enter_cancellation_point(); + /* None of the options are supported */ #ifdef CONFIG_DEBUG_FEATURES if (options != 0) { set_errno(ENOSYS); + leave_cancellation_point(); return ERROR; } #endif @@ -268,12 +274,14 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* On success, return the PID */ + leave_cancellation_point(); sched_unlock(); return pid; errout_with_errno: set_errno(errcode); errout: + leave_cancellation_point(); sched_unlock(); return ERROR; } @@ -307,12 +315,17 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) DEBUGASSERT(stat_loc); + /* waitpid() is a cancellation point */ + + (void)enter_cancellation_point(); + /* None of the options are supported */ #ifdef CONFIG_DEBUG_FEATURES if (options != 0) { set_errno(ENOSYS); + leave_cancellation_point(); return ERROR; } #endif @@ -528,6 +541,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) } } + leave_cancellation_point(); sched_unlock(); return (int)pid; @@ -535,6 +549,7 @@ errout_with_errno: set_errno(errcode); errout_with_lock: + leave_cancellation_point(); sched_unlock(); return ERROR; } diff --git a/sched/semaphore/sem_timedwait.c b/sched/semaphore/sem_timedwait.c index 81e7a79d50615a6c3806518ea139117a635deb48..23c16cc2d53b46c28e87824c9d3149b2e520f96f 100644 --- a/sched/semaphore/sem_timedwait.c +++ b/sched/semaphore/sem_timedwait.c @@ -49,6 +49,7 @@ #include #include #include +#include #include "sched/sched.h" #include "clock/clock.h" @@ -103,6 +104,10 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) DEBUGASSERT(up_interrupt_context() == false && rtcb->waitdog == NULL); + /* sem_timedwait() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Verify the input parameters and, in case of an error, set * errno appropriately. */ @@ -209,6 +214,7 @@ success_with_irqdisabled: leave_critical_section(flags); wd_delete(rtcb->waitdog); rtcb->waitdog = NULL; + leave_cancellation_point(); return OK; /* Error exits */ @@ -220,5 +226,6 @@ errout_with_irqdisabled: errout: set_errno(errcode); + leave_cancellation_point(); return ERROR; } diff --git a/sched/semaphore/sem_wait.c b/sched/semaphore/sem_wait.c index da855bc70c0a9ce66eb94bfc735131f1322ad02d..1aec3679d819f48b88bc9fdcdbb1a429a5826df5 100644 --- a/sched/semaphore/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -46,6 +46,7 @@ #include #include +#include #include "sched/sched.h" #include "semaphore/semaphore.h" @@ -86,17 +87,33 @@ int sem_wait(FAR sem_t *sem) DEBUGASSERT(sem != NULL && up_interrupt_context() == false); - /* Make sure we were supplied with a valid semaphore. */ + /* The following operations must be performed with interrupts + * disabled because sem_post() may be called from an interrupt + * handler. + */ - if (sem != NULL) + flags = enter_critical_section(); + + /* sem_wait() is a cancellation point */ + + if (enter_cancellation_point()) { - /* The following operations must be performed with interrupts - * disabled because sem_post() may be called from an interrupt - * handler. +#ifndef CONFIG_CANCELLATION_POINTS /* Not reachable in this case */ + /* If there is a pending cancellation, then do not perform + * the wait. Exit now with ECANCELED. */ - flags = enter_critical_section(); + set_errno(ECANCELED); + leave_cancellation_point(); + leave_critical_section(flags); + return ERROR; +#endif + } + + /* Make sure we were supplied with a valid semaphore. */ + if (sem != NULL) + { /* Check if the lock is available */ if (sem->semcount > 0) @@ -186,15 +203,13 @@ int sem_wait(FAR sem_t *sem) sched_unlock(); #endif } - - /* Interrupts may now be enabled. */ - - leave_critical_section(flags); } else { set_errno(EINVAL); } + leave_cancellation_point(); + leave_critical_section(flags); return ret; } diff --git a/sched/semaphore/spinlock.c b/sched/semaphore/spinlock.c index 79d904e7efcb5a62bbf1eccee82c4e1322fc1e97..349cdec57fcc49e08f87d5ec18788751a9e4d3d9 100644 --- a/sched/semaphore/spinlock.c +++ b/sched/semaphore/spinlock.c @@ -44,6 +44,7 @@ #include #include +#include #include #include "sched/sched.h" @@ -119,14 +120,56 @@ void spin_initializer(FAR struct spinlock_s *lock) void spin_lock(FAR volatile spinlock_t *lock) { +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are waiting for a spinlock */ + + sched_note_spinlock(this_task(), lock); +#endif + while (up_testset(lock) == SP_LOCKED) { -#if 0 /* Would recurse */ - sched_yield(); -#endif + SP_DSB(); } + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we have the spinlock */ + + sched_note_spinlocked(this_task(), lock); +#endif + SP_DMB(); } +/**************************************************************************** + * Name: spin_unlock + * + * Description: + * Release one count on a non-reentrant spinlock. + * + * Input Parameters: + * lock - A reference to the spinlock object to unlock. + * + * Returned Value: + * None. + * + * Assumptions: + * Not running at the interrupt level. + * + ****************************************************************************/ + +#ifdef __SP_UNLOCK_FUNCTION +void spin_unlock(FAR volatile spinlock_t *lock) +{ +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are unlocking the spinlock */ + + sched_note_spinunlock(this_task(), lock); +#endif + + *lock = SP_UNLOCKED; + SP_DMB(); +} +#endif + /**************************************************************************** * Name: spin_lockr * @@ -183,6 +226,13 @@ void spin_lockr(FAR struct spinlock_s *lock) # warning Missing logic #endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are waiting for a spinlock */ + + sched_note_spinlock(this_task(), &lock->sp_lock); +#endif + /* Take the lock. REVISIT: We should set an indication in the TCB * that the thread is spinning. This might be useful in determining * some scheduling actions? @@ -193,8 +243,17 @@ void spin_lockr(FAR struct spinlock_s *lock) up_irq_restore(flags); sched_yield(); flags = up_irq_save(); + SP_DSB(); } +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we have thespinlock */ + + sched_note_spinlocked(this_task(), &lock->sp_lock); +#endif + + SP_DMB(); + /* Take one count on the lock */ lock->sp_cpu = cpu; @@ -205,6 +264,12 @@ void spin_lockr(FAR struct spinlock_s *lock) #else /* CONFIG_SMP */ +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are waiting for a spinlock */ + + sched_note_spinlock(this_task(), &lock->sp_lock); +#endif + /* Take the lock. REVISIT: We should set an indication in the TCB that * the thread is spinning. This might be useful in determining some * scheduling actions? @@ -213,8 +278,16 @@ void spin_lockr(FAR struct spinlock_s *lock) while (up_testset(&lock->sp_lock) == SP_LOCKED) { sched_yield(); + SP_DSB() } +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we have thespinlock */ + + sched_note_spinlocked(this_task(), &lock->sp_lock); +#endif + + SP_DMB(); #endif /* CONFIG_SMP */ } @@ -273,6 +346,11 @@ void spin_unlockr(FAR struct spinlock_s *lock) if (lock->sp_count <= 1) { +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are unlocking the spinlock */ + + sched_note_spinunlock(this_task(), &lock->sp_lock); +#endif /* The count must decremented to zero */ lock->sp_count = 0; @@ -288,6 +366,13 @@ void spin_unlockr(FAR struct spinlock_s *lock) up_irq_restore(flags); #else /* CONFIG_SMP */ + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + /* Notify that we are unlocking the spinlock */ + + sched_note_spinunlock(this_task(), &lock->sp_lock); +#endif + /* Just mark the spinlock unlocked */ DEBUGASSERT(lock != NULL && lock->sp_lock == SP_LOCKED); @@ -305,7 +390,7 @@ void spin_unlockr(FAR struct spinlock_s *lock) * Input Parameters: * set - A reference to the bitset to set the CPU bit in * cpu - The bit number to be set - * setlock - A reference to the lock lock protecting the set + * setlock - A reference to the lock protecting the set * orlock - Will be set to SP_LOCKED while holding setlock * * Returned Value: @@ -317,15 +402,31 @@ void spin_setbit(FAR volatile cpu_set_t *set, unsigned int cpu, FAR volatile spinlock_t *setlock, FAR volatile spinlock_t *orlock) { +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + cpu_set_t prev; +#endif + /* First, get the 'setlock' spinlock */ spin_lock(setlock); /* Then set the bit and mark the 'orlock' as locked */ +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + prev = *set; +#endif *set |= (1 << cpu); *orlock = SP_LOCKED; +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + if (prev == 0) + { + /* Notify that we have locked the spinlock */ + + sched_note_spinlocked(this_task(), orlock); + } +#endif + /* Release the 'setlock' */ spin_unlock(setlock); @@ -340,7 +441,7 @@ void spin_setbit(FAR volatile cpu_set_t *set, unsigned int cpu, * Input Parameters: * set - A reference to the bitset to set the CPU bit in * cpu - The bit number to be set - * setlock - A reference to the lock lock protecting the set + * setlock - A reference to the lock protecting the set * orlock - Will be set to SP_UNLOCKED if all bits become cleared in set * * Returned Value: @@ -352,6 +453,10 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int cpu, FAR volatile spinlock_t *setlock, FAR volatile spinlock_t *orlock) { +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + cpu_set_t prev; +#endif + /* First, get the 'setlock' spinlock */ spin_lock(setlock); @@ -360,9 +465,21 @@ void spin_clrbit(FAR volatile cpu_set_t *set, unsigned int cpu, * upon the resulting state of the CPU set. */ +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + prev = *set; +#endif *set &= ~(1 << cpu); *orlock = (*set != 0) ? SP_LOCKED : SP_UNLOCKED; +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS + if (prev != 0 && *set == 0) + { + /* Notify that we have unlocked the spinlock */ + + sched_note_spinunlock(this_task(), orlock); + } +#endif + /* Release the 'setlock' */ spin_unlock(setlock); diff --git a/sched/signal/sig_nanosleep.c b/sched/signal/sig_nanosleep.c index 4a492f0c853e25141a102d41d141068c699bb335..05f2c88af73f4f347e2f0b3bc927de8839e4f779 100644 --- a/sched/signal/sig_nanosleep.c +++ b/sched/signal/sig_nanosleep.c @@ -46,6 +46,7 @@ #include #include +#include #include "clock/clock.h" @@ -112,6 +113,10 @@ int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp) int ret; #endif + /* nanosleep() is a cancellation point */ + + (void)enter_cancellation_point(); + if (!rqtp || rqtp->tv_nsec < 0 || rqtp->tv_nsec >= 1000000000) { errval = EINVAL; @@ -154,6 +159,7 @@ int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp) /* The timeout "error" is the normal, successful result */ leave_critical_section(flags); + leave_cancellation_point(); return OK; } @@ -203,5 +209,6 @@ int nanosleep(FAR const struct timespec *rqtp, FAR struct timespec *rmtp) errout: set_errno(errval); + leave_cancellation_point(); return ERROR; } diff --git a/sched/signal/sig_pause.c b/sched/signal/sig_pause.c index 80fc712cb7bbe56869e79d27af1ff3f4a7a3b4f1..5a83f1a735b029982111e27d0d7289f4f55420f7 100644 --- a/sched/signal/sig_pause.c +++ b/sched/signal/sig_pause.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/signal/sig_pause.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,8 @@ #include #include +#include + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -72,8 +74,13 @@ int pause(void) { - sigset_t set; struct siginfo value; + sigset_t set; + int ret; + + /* pause() is a cancellation point */ + + (void)enter_cancellation_point(); /* Set up for the sleep. Using the empty set means that we are not * waiting for any particular signal. However, any unmasked signal @@ -86,5 +93,7 @@ int pause(void) * meaning that some unblocked signal was caught. */ - return sigwaitinfo(&set, &value); + ret = sigwaitinfo(&set, &value); + leave_cancellation_point(); + return ret; } diff --git a/sched/signal/sig_suspend.c b/sched/signal/sig_suspend.c index d3a4a9ba7190207afd25ec0f2de3ebe8636ae170..ab5cfd25fe7ecbc98fd1532c14a469b1fa261b89 100644 --- a/sched/signal/sig_suspend.c +++ b/sched/signal/sig_suspend.c @@ -46,6 +46,7 @@ #include #include +#include #include "sched/sched.h" #include "signal/signal.h" @@ -98,6 +99,10 @@ int sigsuspend(FAR const sigset_t *set) irqstate_t flags; int unblocksigno; + /* sigsuspend() is a cancellation point */ + + (void)enter_cancellation_point(); + /* Several operations must be performed below: We must determine if any * signal is pending and, if not, wait for the signal. Since signals can * be posted from the interrupt level, there is a race condition that @@ -154,5 +159,6 @@ int sigsuspend(FAR const sigset_t *set) } sched_unlock(); - return ERROR; + leave_cancellation_point(); + return ERROR; /* ??REVISIT: Always returns ERROR?? */ } diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index 687884dcf9c48f3947bd420a3c04366916ebd864..bdb5376d8bdb769466a874e96958514b62753911 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "sched/sched.h" #include "signal/signal.h" @@ -173,6 +174,9 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, DEBUGASSERT(rtcb->waitdog == NULL); + /* sigtimedwait() is a cancellation point */ + + (void)enter_cancellation_point(); sched_lock(); /* Not necessary */ /* Several operations must be performed below: We must determine if any @@ -343,5 +347,6 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, } sched_unlock(); + leave_cancellation_point(); return ret; } diff --git a/sched/signal/sig_waitinfo.c b/sched/signal/sig_waitinfo.c index d271dc9884cdbcf7163d2471805a7c3b4397fc40..73afb186de3d8d9daf369e89b11c34c34fd62bb0 100644 --- a/sched/signal/sig_waitinfo.c +++ b/sched/signal/sig_waitinfo.c @@ -38,8 +38,11 @@ ****************************************************************************/ #include + #include +#include + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -65,5 +68,15 @@ int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *info) { - return sigtimedwait(set, info, NULL); + int ret; + + /* sigwaitinfo() is a cancellation point */ + + (void)enter_cancellation_point(); + + /* Just a wrapper around sigtimedwait() */ + + ret = sigtimedwait(set, info, NULL); + leave_cancellation_point(); + return ret; } diff --git a/sched/task/Make.defs b/sched/task/Make.defs index ddf3e972b73ee59b44728157bc45638f0bde19e3..a5c2295692c6a007e27e464f3ffc8063058b0fef 100644 --- a/sched/task/Make.defs +++ b/sched/task/Make.defs @@ -35,8 +35,9 @@ CSRCS += task_create.c task_init.c task_setup.c task_activate.c CSRCS += task_start.c task_delete.c task_exit.c task_exithook.c -CSRCS += task_recover.c task_restart.c task_spawnparms.c task_terminate.c -CSRCS += task_getgroup.c task_prctl.c task_getpid.c exit.c +CSRCS += task_getgroup.c task_getpid.c task_prctl.c task_recover.c +CSRCS += task_restart.c task_spawnparms.c task_setcancelstate.c +CSRCS += task_terminate.c exit.c ifeq ($(CONFIG_ARCH_HAVE_VFORK),y) ifeq ($(CONFIG_SCHED_WAITPID),y) @@ -48,6 +49,10 @@ ifneq ($(CONFIG_BUILD_KERNEL),y) CSRCS += task_spawn.c endif +ifeq ($(CONFIG_CANCELLATION_POINTS),y) +CSRCS += task_setcanceltype.c task_testcancel.c +endif + ifneq ($(CONFIG_BINFMT_DISABLE),y) ifeq ($(CONFIG_LIBC_EXECFUNCS),y) CSRCS += task_execv.c task_posixspawn.c @@ -66,6 +71,10 @@ ifeq ($(CONFIG_SCHED_ONEXIT),y) CSRCS += task_onexit.c endif +ifeq ($(CONFIG_CANCELLATION_POINTS),y) +CSRCS += task_cancelpt.c +endif + # Include task build support DEPPATH += --dep-path task diff --git a/sched/task/task.h b/sched/task/task.h index e81f0eaefcd5e3d2ca6fc32599426a8081180ed8..83ce71d3f53c4621136c4a5f85b80d05be6815a0 100644 --- a/sched/task/task.h +++ b/sched/task/task.h @@ -80,4 +80,10 @@ int task_terminate(pid_t pid, bool nonblocking); void task_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking); void task_recover(FAR struct tcb_s *tcb); +/* Cancellation points */ + +#ifdef CONFIG_CANCELLATION_POINTS +void notify_cancellation(FAR struct tcb_s *tcb); +#endif + #endif /* __SCHED_TASK_TASK_H */ diff --git a/sched/task/task_cancelpt.c b/sched/task/task_cancelpt.c new file mode 100644 index 0000000000000000000000000000000000000000..07b4a664c887afcbb9f2ee541c4a7e2165bc7303 --- /dev/null +++ b/sched/task/task_cancelpt.c @@ -0,0 +1,324 @@ +/**************************************************************************** + * sched/task/task_cancelpt.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Cancellation Points. + * + * Cancellation points shall occur when a thread is executing the following + * functions: + * + * accept() mq_timedsend() putpmsg() sigtimedwait() + * aio_suspend() msgrcv() pwrite() sigwait() + * clock_nanosleep() msgsnd() read() sigwaitinfo() + * close() msync() readv() sleep() + * connect() nanosleep() recv() system() + * creat() open() recvfrom() tcdrain() + * fcntl() pause() recvmsg() usleep() + * fdatasync() poll() select() wait() + * fsync() pread() sem_timedwait() waitid() + * getmsg() pselect() sem_wait() waitpid() + * getpmsg() pthread_cond_timedwait() send() write() + * lockf() pthread_cond_wait() sendmsg() writev() + * mq_receive() pthread_join() sendto() + * mq_send() pthread_testcancel() sigpause() + * mq_timedreceive() putmsg() sigsuspend() + * + * Each of the above function must call enter_cancellation_point() on entry + * in order to establish the cancellation point and leave_cancellation_point() + * on exit. These functions are described below. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "sched/sched.h" +#include "semaphore/semaphore.h" +#include "mqueue/mqueue.h" +#include "task/task.h" + +#ifdef CONFIG_CANCELLATION_POINTS + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: enter_cancellation_point + * + * Description: + * Called at the beginning of the cancellation point to establish the + * cancellation point. This function does the following: + * + * 1. If deferred cancellation does not apply to this thread, nothing is + * done, otherwise, it + * 2. Sets state information in the caller's TCB and increments a nesting + * count. + * 3. If this is the outermost nesting level, it checks if there is a + * pending cancellation and, if so, calls either exit() or + * pthread_exit(), depending upon the type of the thread. + * + * Input Parameters: + * None + * + * Returned Value + * true is returned if a cancellation is pending but cannot be performed + * now due to the nesting level. + * + ****************************************************************************/ + +bool enter_cancellation_point(void) +{ + FAR struct tcb_s *tcb = this_task(); + bool ret = false; + + /* Disabling pre-emption should provide sufficient protection. We only + * need the TCB to be stationary (no interrupt level modification is + * anticipated). + * + * REVISIT: is locking the scheduler sufficent in SMP mode? + */ + + sched_lock(); + + /* If cancellation is disabled on this thread or if this thread is using + * asynchronous cancellation, then do nothing. + * + * Special case: if the cpcount count is greater than zero, then we are + * nested and the above condition was certainly true at the outermost + * nesting level. + */ + + if (((tcb->flags & TCB_FLAG_NONCANCELABLE) == 0 && + (tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0) || + tcb->cpcount > 0) + { + /* Check if there is a pending cancellation */ + + if ((tcb->flags & TCB_FLAG_CANCEL_PENDING) != 0) + { + /* Yes... return true (if we don't exit here) */ + + ret = true; + + /* If there is a pending cancellation and we are at the outermost + * nesting level of cancellation function calls, then exit + * according to the type of the thread. + */ + + if (tcb->cpcount == 0) + { +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + pthread_exit(PTHREAD_CANCELED); + } + else +#endif + { + exit(EXIT_FAILURE); + } + } + } + + /* Otherwise, indicate that we are at a cancellation point by + * incrementing the nesting level of the cancellation point + * functions. + */ + + DEBUGASSERT(tcb->cpcount < INT16_MAX); + tcb->cpcount++; + } + + sched_unlock(); + return ret; +} + +/**************************************************************************** + * Name: leave_cancellation_point + * + * Description: + * Called at the end of the cancellation point. This function does the + * following: + * + * 1. If deferred cancellation does not apply to this thread, nothing is + * done, otherwise, it + * 2. Clears state information in the caller's TCB and decrements a + * nesting count. + * 3. If this is the outermost nesting level, it checks if there is a + * pending cancellation and, if so, calls either exit() or + * pthread_exit(), depending upon the type of the thread. + * + * Input Parameters: + * None + * + * Returned Value + * None + * + ****************************************************************************/ + +void leave_cancellation_point(void) +{ + FAR struct tcb_s *tcb = this_task(); + + /* Disabling pre-emption should provide sufficient protection. We only + * need the TCB to be stationary (no interrupt level modification is + * anticipated). + * + * REVISIT: is locking the scheduler sufficent in SMP mode? + */ + + sched_lock(); + + /* If cancellation is disabled on this thread or if this thread is using + * asynchronous cancellation, then do nothing. Here we check only the + * nesting level: if the cpcount count is greater than zero, then the + * required condition was certainly true at the outermost nesting level. + */ + + if (tcb->cpcount > 0) + { + /* Decrement the nesting level. If if would decrement to zero, then + * we are at the outermost nesting level and may need to do more. + */ + + if (tcb->cpcount == 1) + { + /* We are no longer at the cancellation point */ + + tcb->cpcount = 0; + + /* If there is a pending cancellation then just exit according to + * the type of the thread. + */ + + if ((tcb->flags & TCB_FLAG_CANCEL_PENDING) != 0) + { +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + pthread_exit(PTHREAD_CANCELED); + } + else +#endif + { + exit(EXIT_FAILURE); + } + } + } + else + { + /* We are not at the outermost nesting level. Just decrment the + * nesting level count. + */ + + tcb->cpcount--; + } + } + + sched_unlock(); +} + +/**************************************************************************** + * Name: notify_cancellation + * + * Description: + * Called by task_delete() or pthread_cancel() if the cancellation occurs + * while we the thread is within the cancellation point. This logic + * behaves much like sending a signal: It will cause waiting threads + * to wake up and terminated with ECANCELED. A call to + * leave_cancellation_point() whould then follow, causing the thread to + * exit. + * + ****************************************************************************/ + +void notify_cancellation(FAR struct tcb_s *tcb) +{ + irqstate_t flags; + + /* We need perform the following operations from within a critical section + * because it can compete with interrupt level activity. + */ + + flags = enter_critical_section(); + + /* Make sure that the cancellation pending indication is set. */ + + tcb->flags |= TCB_FLAG_CANCEL_PENDING; + + /* We only notify the cancellation if (1) the thread has not disabled + * cancellation, (2) the thread uses the deffered cancellation mode, + * (3) the thread is waiting within a cancellation point. + */ + + if (((tcb->flags & TCB_FLAG_NONCANCELABLE) == 0 && + (tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0) || + tcb->cpcount > 0) + { + /* If the thread is blocked waiting for a semaphore, then the thread + * must be unblocked to handle the cancellation. + */ + + if (tcb->task_state == TSTATE_WAIT_SEM) + { + sem_waitirq(tcb, ECANCELED); + } + + /* If the thread is blocked waiting on a message queue, then the + * thread must be unblocked to handle the cancellation. + */ + +#ifndef CONFIG_DISABLE_MQUEUE + if (tcb->task_state == TSTATE_WAIT_MQNOTEMPTY || + tcb->task_state == TSTATE_WAIT_MQNOTFULL) + { + mq_waitirq(tcb, ECANCELED); + } +#endif + } + + leave_critical_section(flags); +} + +#endif /* CONFIG_CANCELLATION_POINTS */ diff --git a/sched/task/task_delete.c b/sched/task/task_delete.c index 5b4c0f747dcc0d5e555cf0f57a98fbc26f199f15..ebf94c8bd813a481cf21fbf1b8f951f23fbcb2e2 100644 --- a/sched/task/task_delete.c +++ b/sched/task/task_delete.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/task/task_delete.c * - * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ #include #include +#include #include @@ -64,37 +65,109 @@ * redirected to exit(). This can only happen if a task calls task_delete() * in order to delete itself. * - * In fact, this function (and task_terminate) are the final functions - * called all task termination sequences. task_delete may be called - * from: - * - * - task_restart(), - * - pthread_cancel(), - * - and directly from user code. - * - * Other exit paths (exit(), _eixt(), and pthread_exit()) will go through - * task_terminate() + * This function obeys the semantics of pthread cancellation: task + * deletion is deferred if cancellation is disabled or if deferred + * cancellation is supported (with cancellation points enabled). * * Inputs: * pid - The task ID of the task to delete. A pid of zero * signifies the calling task. * * Return Value: - * OK on success; or ERROR on failure - * - * This function can fail if the provided pid does not correspond to a - * task (errno is not set) + * OK on success; or ERROR on failure with the errno variable set + * appropriately. * ****************************************************************************/ int task_delete(pid_t pid) { + FAR struct tcb_s *dtcb; FAR struct tcb_s *rtcb; + int ret; - /* Check if the task to delete is the calling task */ + /* Check if the task to delete is the calling task: PID=0 means to delete + * the calling task. In this case, task_delete() is much like exit() + * except that it obeys the cancellation semantics. + */ rtcb = this_task(); - if (pid == 0 || pid == rtcb->pid) + if (pid == 0) + { + pid = rtcb->pid; + } + + /* Get the TCB of the task to be deleted */ + + dtcb = (FAR struct tcb_s *)sched_gettcb(pid); + if (dtcb == NULL) + { + /* The pid does not correspond to any known thread. The task + * has probably already exited. + */ + + set_errno(ESRCH); + return ERROR; + } + + /* Only tasks and kernel threads should use this interface */ + + DEBUGASSERT((dtcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_PTHREAD); + + /* Check to see if this task has the non-cancelable bit set in its + * flags. Suppress context changes for a bit so that the flags are stable. + * (the flags should not change in interrupt handling). + */ + + sched_lock(); + if ((dtcb->flags & TCB_FLAG_NONCANCELABLE) != 0) + { + /* Then we cannot cancel the thread now. Here is how this is + * supposed to work: + * + * "When cancelability is disabled, all cancels are held pending + * in the target thread until the thread changes the cancelability. + * When cancelability is deferred, all cancels are held pending in + * the target thread until the thread changes the cancelability, calls + * a function which is a cancellation point or calls pthread_testcancel(), + * thus creating a cancellation point. When cancelability is asynchronous, + * all cancels are acted upon immediately, interrupting the thread with its + * processing." + */ + + dtcb->flags |= TCB_FLAG_CANCEL_PENDING; + sched_unlock(); + return OK; + } + +#ifdef CONFIG_CANCELLATION_POINTS + /* Check if this task supports deferred cancellation */ + + if ((dtcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0) + { + /* Then we cannot cancel the task asynchronously. Mark the cancellation + * as pending. + */ + + dtcb->flags |= TCB_FLAG_CANCEL_PENDING; + + /* If the task is waiting at a cancellation point, then notify of the + * cancellation thereby waking the task up with an ECANCELED error. + */ + + if (dtcb->cpcount > 0) + { + notify_cancellation(dtcb); + } + + sched_unlock(); + return OK; + } +#endif + + /* Check if the task to delete is the calling task */ + + sched_unlock(); + if (pid == rtcb->pid) { /* If it is, then what we really wanted to do was exit. Note that we * don't bother to unlock the TCB since it will be going away. @@ -103,7 +176,16 @@ int task_delete(pid_t pid) exit(EXIT_SUCCESS); } - /* Then let task_terminate do the heavy lifting */ + /* Otherwise, perform the asynchronous cancellation, letting + * task_terminate() do all of the heavy lifting. + */ + + ret = task_terminate(pid, false); + if (ret < 0) + { + set_errno(-ret); + return ERROR; + } - return task_terminate(pid, false); + return OK; } diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index cffae18e7d90ed2ffc0a32db93ea2a244baad199..3c44135330c069c3a18b1d49a5e6fe5deb99db54 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -73,6 +73,14 @@ static inline void task_atexit(FAR struct tcb_s *tcb) /* Make sure that we have not already left the group. Only the final * exiting thread in the task group should trigger the atexit() * callbacks. + * + * REVISIT: This is a security problem In the PROTECTED and KERNEL builds: + * We must not call the registered function in supervisor mode! See also + * on_exit() and pthread_cleanup_pop() callbacks. + * + * REVISIT: In the case of task_delete(), the callback would execute in + * the context the caller of task_delete() cancel, not in the context of + * the exiting task (or process). */ if (group && group->tg_nmembers == 1) @@ -133,6 +141,14 @@ static inline void task_onexit(FAR struct tcb_s *tcb, int status) /* Make sure that we have not already left the group. Only the final * exiting thread in the task group should trigger the atexit() * callbacks. + * + * REVISIT: This is a security problem In the PROTECTED and KERNEL builds: + * We must not call the registered function in supervisor mode! See also + * atexit() and pthread_cleanup_pop() callbacks. + * + * REVISIT: In the case of task_delete(), the callback would execute in + * he context the caller of task_delete() cancel, not in the context of + * the exiting task (or process). */ if (group && group->tg_nmembers == 1) @@ -596,6 +612,17 @@ void task_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking) return; } +#ifdef CONFIG_CANCELLATION_POINTS + /* Mark the task as non-cancelable to avoid additional calls to exit() + * due to any cancellation point logic that might get kicked off by + * actions taken during exit processing. + */ + + tcb->flags |= TCB_FLAG_NONCANCELABLE; + tcb->flags &= ~TCB_FLAG_CANCEL_PENDING; + tcb->cpcount = 0; +#endif + #if defined(CONFIG_SCHED_ATEXIT) || defined(CONFIG_SCHED_ONEXIT) /* If exit function(s) were registered, call them now before we do any un- * initialization. diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index 36251348ed6bfd87b562f8ca4d32d9829d21dc72..e499a6c598818bab9824a9ff8bafa9773427bbd5 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -97,7 +97,7 @@ int task_restart(pid_t pid) /* Not implemented */ errcode = ENOSYS; - goto errout_with_lock; + goto errout; } /* We are restarting some other task than ourselves. Make sure that the @@ -214,7 +214,7 @@ int task_restart(pid_t pid) ret = task_activate((FAR struct tcb_s *)tcb); if (ret != OK) { - (void)task_delete(pid); + (void)task_terminate(pid, true); errcode = -ret; goto errout_with_lock; } @@ -222,7 +222,8 @@ int task_restart(pid_t pid) return OK; errout_with_lock: - set_errno(errcode); leave_critical_section(flags); +errout: + set_errno(errcode); return ERROR; } diff --git a/sched/task/task_setcancelstate.c b/sched/task/task_setcancelstate.c new file mode 100644 index 0000000000000000000000000000000000000000..d7003f3af7eb3f2acb5d5dab56b9a12fca49a186 --- /dev/null +++ b/sched/task/task_setcancelstate.c @@ -0,0 +1,164 @@ +/**************************************************************************** + * sched/task/task_setcancelstate.c + * + * Copyright (C) 2007, 2008, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include +#include +#include + +#include "sched/sched.h" +#include "task/task.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: task_setcancelstate + * + * Description: + * The task_setcancelstate() function atomically both sets the calling + * task's cancelability state to the indicated state and returns the + * previous cancelability state at the location referenced by oldstate. + * Legal values for state are TASK_CANCEL_ENABLE and TASK_CANCEL_DISABLE. + * + * The cancelability state and type of any newly created tasks are + * TASK_CANCEL_ENABLE and TASK_CANCEL_DEFERRED respectively. + * + * Input Parameters: + * state - the new cancellability state, either TASK_CANCEL_ENABLE or + * TASK_CANCEL_DISABLE + * oldstate - The location to return the old cancellability state. + * + * Returned Value: + * Zero (OK) on success; ERROR is returned on any failure with the + * errno value set appropriately. + * + ****************************************************************************/ + +int task_setcancelstate(int state, FAR int *oldstate) +{ + FAR struct tcb_s *tcb = this_task(); + int ret = OK; + + /* Suppress context changes for a bit so that the flags are stable. (the + * flags should not change in interrupt handling). + */ + + sched_lock(); + + /* Return the current state if so requrested */ + + if (oldstate != NULL) + { + if ((tcb->flags & TCB_FLAG_NONCANCELABLE) != 0) + { + *oldstate = TASK_CANCEL_DISABLE; + } + else + { + *oldstate = TASK_CANCEL_ENABLE; + } + } + + /* Set the new cancellation state */ + + if (state == TASK_CANCEL_ENABLE) + { + /* Clear the non-cancelable flag */ + + tcb->flags &= ~TCB_FLAG_NONCANCELABLE; + + /* Check if a cancellation was pending */ + + if ((tcb->flags & TCB_FLAG_CANCEL_PENDING) != 0) + { +#ifdef CONFIG_CANCELLATION_POINTS + /* If we are using deferred cancellation? */ + + if ((tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0) + { + /* Yes.. If we are within a cancellation point, then + * notify of the cancellation. + */ + + if (tcb->cpcount > 0) + { + notify_cancellation(tcb); + } + } + else +#endif + { + /* No.. We are using asynchronous cancellation. If the + * cancellation was pending in this case, then just exit. + */ + + tcb->flags &= ~TCB_FLAG_CANCEL_PENDING; + +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + pthread_exit(PTHREAD_CANCELED); + } + else +#endif + { + exit(EXIT_FAILURE); + } + } + } + } + else if (state == TASK_CANCEL_DISABLE) + { + /* Set the non-cancelable state */ + + tcb->flags |= TCB_FLAG_NONCANCELABLE; + } + else + { + set_errno(EINVAL); + ret = ERROR; + } + + sched_unlock(); + return ret; +} diff --git a/arch/xtensa/src/esp32/esp32_cpuhead.S b/sched/task/task_setcanceltype.c similarity index 50% rename from arch/xtensa/src/esp32/esp32_cpuhead.S rename to sched/task/task_setcanceltype.c index 40cbf2e85d6fc95b5cc22caf65c197e5b5016ae9..b7536f46258def3500035d15679728cdd732939a 100644 --- a/arch/xtensa/src/esp32/esp32_cpuhead.S +++ b/sched/task/task_setcanceltype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/xtensa/src/esp32/esp32_cpuhead.S + * sched/task/task_setcanceltype.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,116 +33,111 @@ * ****************************************************************************/ - .file "esp32_cpuhead.S" - /**************************************************************************** * Included Files ****************************************************************************/ #include -#include -#include - -#ifdef CONFIG_SMP -/**************************************************************************** - * Private Data - ****************************************************************************/ +#include +#include +#include +#include - .section .noinit, "aw" - .global g_cpu1_idlestack - .type g_cpu1_idlestack, @object - .align 16 - -g_cpu1_idlestack: - .space (CONFIG_SMP_IDLETHREAD_STACKSIZE & ~15) -.Lcpu1_stacktop: - .size g_cpu1_idlestack, . - g_cpu1_idlestack +#include "sched/sched.h" +#include "task/task.h" /**************************************************************************** * Public Functions ****************************************************************************/ - .text - /**************************************************************************** - * Name: __cpu[n]_start + * Name: task_setcancelstate * * Description: - * Boot functions for each CPU (other than CPU0). These functions set up - * the ARM operating mode, the initial stack, and configure co-processor - * registers. At the end of the boot, esp32_cpu_boot() is called. - * - * These functions are provided by the common ARMv7-A logic. + * The task_setcanceltype() function atomically both sets the calling + * thread's cancelability type to the indicated type and returns the + * previous cancelability type at the location referenced by oldtype + * Legal values for type are TASK_CANCEL_DEFERRED and + * TASK_CANCEL_ASYNCHRONOUS. * - * Input parameters: - * None - * - * Returned Value: - * Do not return. + * The cancelability state and type of any newly created threads, + * including the thread in which main() was first invoked, are + * TASK_CANCEL_ENABLE and TASK_CANCEL_DEFERRED respectively. * ****************************************************************************/ - .global __cpu1_start - .type __cpu1_start, @function - - .align 4 - -.Lcpu1_bottomofstack: - .long .Lcpu1_stacktop - .size .Lcpu1_bottomofstack, . - .Lcpu1_bottomofstack - -#ifdef CONFIG_STACK_COLORATION -.Lcpu1_bottomofstack: - .long .Lcpu1_stacktop - .size .Lcpu1_bottomofstack, . - .Lcpu1_bottomofstack - -.Lcpu1_stackcolor: - .long STACK_COLOR - .size .Lcpu1_stackcolor, . - .Lcpu1_stackcolor +int task_setcanceltype(int type, FAR int *oldtype) +{ + FAR struct tcb_s *tcb = this_task(); + int ret = OK; + + /* Suppress context changes for a bit so that the flags are stable. (the + * flags should not change in interrupt handling). + */ + + sched_lock(); + + /* Return the current type if so requrested */ + + if (oldtype != NULL) + { + if ((tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0) + { + *oldtype = TASK_CANCEL_DEFERRED; + } + else + { + *oldtype = TASK_CANCEL_ASYNCHRONOUS; + } + } + + /* Set the new cancellation type */ + + if (type == TASK_CANCEL_ASYNCHRONOUS) + { + /* Clear the deferred cancellation bit */ + + tcb->flags &= ~TCB_FLAG_CANCEL_DEFERRED; + +#ifdef CONFIG_CANCELLATION_POINTS + /* If we just switched from deferred to asynchronous type and if a + * cancellation is pending, then exit now. + */ + + if ((tcb->flags & TCB_FLAG_CANCEL_PENDING) != 0 && + (tcb->flags & TCB_FLAG_NONCANCELABLE) == 0) + { + tcb->flags &= ~TCB_FLAG_CANCEL_PENDING; + + /* Exit according to the type of the thread */ + +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + pthread_exit(PTHREAD_CANCELED); + } + else #endif - - .align 4 - -__cpu1_start: - - /* Set up the stack pointer and the CPU index */ - - l32r sp, .Lcpu1_bottomofstack - - /* REVIST: Does it make since to have co-processors enabled on the IDLE thread? */ - -#ifdef CONFIG_STACK_COLORATION - /* Write a known value to the IDLE thread stack to support stack - * monitoring logic - */ - - mov a0, sp - l32r a1, .Lcpu1_bottomofstack - l32r a2, .Lcpu1_stackcolor - -1: - s32i a2, a1, 0 - addi a2, a2, 4 - bne a1, a2, 1b + { + exit(EXIT_FAILURE); + } + } #endif - - /* Set up the intiali PS */ - -#ifdef __XTENSA_CALL0_ABI__ - movi a0, (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_EXCM) -#else - movi a0, (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_EXCM | PS_WOE | PS_CALLINC(1)) + } +#ifdef CONFIG_CANCELLATION_POINTS + else if (type == TASK_CANCEL_DEFERRED) + { + /* Set the deferred cancellation type */ + + tcb->flags |= TCB_FLAG_CANCEL_DEFERRED; + } #endif - wsr a0, PS - - /* Finish initialization in C */ - - movi a2, 1 /* Argument 1: CPU ID */ - call0 xtensa_start_handler - - /* xtensa_start_handler() does not return */ - -2: j 2b - .size __cpu1_start, . - __cpu1_start -#endif /* CONFIG_SMP */ + else + { + ret = EINVAL; + } + + sched_unlock(); + return ret; +} diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index 7b8b086434812c114b326edaf3c1f1c335488706..19736f86abb54e20c9b2af9be72be6fea014d921 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -378,6 +378,12 @@ static int thread_schedsetup(FAR struct tcb_s *tcb, int priority, tcb->flags &= ~TCB_FLAG_TTYPE_MASK; tcb->flags |= ttype; +#ifdef CONFIG_CANCELLATION_POINTS + /* Set the deferred cancellation type */ + + tcb->flags |= TCB_FLAG_CANCEL_DEFERRED; +#endif + /* Save the task ID of the parent task in the TCB and allocate * a child status structure. */ diff --git a/sched/task/task_testcancel.c b/sched/task/task_testcancel.c new file mode 100644 index 0000000000000000000000000000000000000000..b0407173e3da7adfb66ebf9875713fca3f400bca --- /dev/null +++ b/sched/task/task_testcancel.c @@ -0,0 +1,67 @@ +/**************************************************************************** + * sched/task/task_testcancel.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 OWNER 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 + +#include +#include + +#include + +#include "task/task.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: task_testcancel + * + * Description: + * The task_testcancel() function creates a cancellation point in the + * calling thread. The task_testcancel() function has no effect if + * cancelability is disabled + * + ****************************************************************************/ + +void task_testcancel(void) +{ + (void)enter_cancellation_point(); + leave_cancellation_point(); +} diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 8ecf52854fcb206cca8e9403b0e51416721ecc1b..4dbcc98227f374d733e581a76e779d995b8893eb 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -64,6 +64,8 @@ "pthread_barrier_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" "pthread_barrier_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" "pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" +"pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int" +"pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*" "pthread_cond_broadcast","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" "pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*" "pthread_cond_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR const pthread_condattr_t*" @@ -87,7 +89,6 @@ "pthread_mutex_unlock","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutex_t*" "pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)" "pthread_setaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR const cpu_set_t*" -"pthread_setcancelstate","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR int*" "pthread_setschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int","FAR const struct sched_param*" "pthread_setschedprio","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","int" "pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void*" @@ -148,6 +149,9 @@ #"task_create","sched.h","","int","const char*","int","main_t","FAR char * const []|FAR char * const *" "task_delete","sched.h","","int","pid_t" "task_restart","sched.h","","int","pid_t" +"task_setcancelstate","sched.h","","int","int","FAR int*" +"task_setcanceltype","sched.h","defined(CONFIG_CANCELLATION_POINTS)","int","int","FAR int*" +"task_testcancel","pthread.h","defined(CONFIG_CANCELLATION_POINTS)","void" "telldir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","off_t","FAR DIR*" "timer_create","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","clockid_t","FAR struct sigevent*","FAR timer_t*" "timer_delete","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 0c16b8ce1e63540e24db78b85915f22fa63de67a..25807590d8730a3512f717203ab9e0bedaa8eaad 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -86,8 +86,14 @@ SYSCALL_LOOKUP(pgalloc, 2, STUB_pgalloc) #endif SYSCALL_LOOKUP(task_delete, 1, STUB_task_delete) SYSCALL_LOOKUP(task_restart, 1, STUB_task_restart) +SYSCALL_LOOKUP(task_setcancelstate, 2, STUB_task_setcancelstate) SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) +# ifdef CONFIG_CANCELLATION_POINTS + SYSCALL_LOOKUP(task_setcanceltype, 2, STUB_task_setcanceltype) + SYSCALL_LOOKUP(task_testcancel, 0, STUB_task_testcancel) +# endif + /* The following can be individually enabled */ #ifdef CONFIG_ARCH_HAVE_VFORK @@ -290,7 +296,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(pthread_mutex_trylock, 1, STUB_pthread_mutex_trylock) SYSCALL_LOOKUP(pthread_mutex_unlock, 1, STUB_pthread_mutex_unlock) SYSCALL_LOOKUP(pthread_once, 2, STUB_pthread_once) - SYSCALL_LOOKUP(pthread_setcancelstate, 2, STUB_pthread_setcancelstate) SYSCALL_LOOKUP(pthread_setschedparam, 3, STUB_pthread_setschedparam) SYSCALL_LOOKUP(pthread_setschedprio, 2, STUB_pthread_setschedprio) SYSCALL_LOOKUP(pthread_setspecific, 2, STUB_pthread_setspecific) @@ -304,6 +309,10 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(pthread_kill, 2, STUB_pthread_kill) SYSCALL_LOOKUP(pthread_sigmask, 3, STUB_pthread_sigmask) # endif +# ifdef CONFIG_PTHREAD_CLEANUP + SYSCALL_LOOKUP(pthread_cleanup_push, 2, STUB_pthread_cleanup_push) + SYSCALL_LOOKUP(pthread_cleanup_pop, 1, STUB_pthread_cleanup_pop) +# endif #endif /* The following are defined only if message queues are enabled */ diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c index f655e0800d0c7bd6e992ff76e8ae059c4982889a..fda336d5aa47ca59ae7f4f854a3b5d3215a5274e 100644 --- a/syscall/syscall_stublookup.c +++ b/syscall/syscall_stublookup.c @@ -96,8 +96,14 @@ uintptr_t STUB_task_create(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3, uintptr_t parm4, uintptr_t parm5); uintptr_t STUB_task_delete(int nbr, uintptr_t parm1); uintptr_t STUB_task_restart(int nbr, uintptr_t parm1); +uintptr_t STUB_task_setcancelstate(int nbr, uintptr_t parm1, + uintptr_t parm2); uintptr_t STUB_up_assert(int nbr, uintptr_t parm1, uintptr_t parm2); +uintptr_t STUB_task_setcanceltype(int nbr, uintptr_t parm1, + uintptr_t parm2); +uintptr_t STUB_task_testcancel(int nbr); + /* The following can be individually enabled */ uintptr_t STUB_vfork(int nbr); @@ -290,8 +296,6 @@ uintptr_t STUB_pthread_mutex_lock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_mutex_trylock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_mutex_unlock(int nbr, uintptr_t parm1); uintptr_t STUB_pthread_once(int nbr, uintptr_t parm1, uintptr_t parm2); -uintptr_t STUB_pthread_setcancelstate(int nbr, uintptr_t parm1, - uintptr_t parm2); uintptr_t STUB_pthread_setschedparam(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); uintptr_t STUB_pthread_setschedprio(int nbr, uintptr_t parm1, @@ -311,6 +315,10 @@ uintptr_t STUB_pthread_kill(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_pthread_sigmask(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); +uintptr_t STUB_pthread_cleanup_pop(int nbr, uintptr_t parm1); +uintptr_t STUB_pthread_cleanup_push(int nbr, uintptr_t parm1, + uintptr_t parm2); + /* The following are defined only if message queues are enabled */ uintptr_t STUB_mq_close(int nbr, uintptr_t parm1); diff --git a/tools/README.txt b/tools/README.txt index 1fcac577c1003f227c7bdbab9ff16b7d82c2625c..b0f36793e93cdb29754da0d3dc005f14a3c242d6 100644 --- a/tools/README.txt +++ b/tools/README.txt @@ -269,7 +269,7 @@ bdf-convert.c 2. Use the bdf-converter program to convert the BDF font to the NuttX font format. This will result in a C header file containing definitions. That header file should be installed at, for example, - graphics/nxfonts/nxfonts_myfont.h. + libnx/nxfonts/nxfonts_myfont.h. Create a new NuttX configuration variable. For example, suppose you define the following variable: CONFIG_NXFONT_MYFONT. Then @@ -324,7 +324,7 @@ bdf-convert.c @$(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=2 EXTRADEFINES=$(EXTRADEFINES) endif - 6. nuttx/graphics/nxfonts/Make.defs. Set the make variable NXFSET_CSRCS. + 6. nuttx/libnx/nxfonts/Make.defs. Set the make variable NXFSET_CSRCS. NXFSET_CSRCS determines the name of the font C file to build when NXFONTS_FONTID=2: @@ -335,12 +335,12 @@ bdf-convert.c NXFSET_CSRCS += nxfonts_bitmaps_myfont.c endif - 7. nuttx/graphics/nxfonts/Makefile.sources. This is the Makefile used + 7. nuttx/libnx/nxfonts/Makefile.sources. This is the Makefile used in step 5 that will actually generate the font C file. So, given your NXFONTS_FONTID=2, it needs to determine a prefix to use for auto-generated variable and function names and (again) the name of the auto-generated file to create (this must be the same name that - was used in nuttx/graphics/nxfonts/Make.defs): + was used in nuttx/libnx/nxfonts/Make.defs): ifeq ($(NXFONTS_FONTID),1) NXFONTS_PREFIX := g_sans23x27_ @@ -351,9 +351,9 @@ bdf-convert.c GEN_CSRC = nxfonts_bitmaps_myfont.c endif - 8. graphics/nxfonts/nxfonts_bitmaps.c. This is the file that contains + 8. graphics/libnx/nxfonts_bitmaps.c. This is the file that contains the generic font structures. It is used as a "template" file by - nuttx/graphics/nxfonts/Makefile.sources to create your customized + nuttx/libnx/nxfonts/Makefile.sources to create your customized font data set. #if NXFONTS_FONTID == 1 @@ -367,7 +367,7 @@ bdf-convert.c Where nxfonts_myfont.h is the NuttX font file that we generated in step 2 using the bdf-converter tool. - 9. graphics/nxfonts/nxfonts_getfont.c. Finally, we need to extend the + 9. libnx/nxfonts/nxfonts_getfont.c. Finally, we need to extend the logic that does the run-time font lookups so that can find our new font. The lookup function is NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid). The new font information needs to be added to data structures used by @@ -688,6 +688,18 @@ refresh.sh refresh.sh will prompt you first to avoid overwriting the defconfig file with changes that you may not want. +showsize.sh +----------- + + Show the top 10 biggest memory hogs in code and data spaces. This + must be executed from the top-level NuttX directory like: + + $ tools/showsize.sh + TOP 10 BIG DATA + ... + TOP 10 BIG CODE + ... + testbuild.sh ------------ diff --git a/tools/cfgdefine.c b/tools/cfgdefine.c index bb9a81eee2bd821ff6c658f7796e12eda5bd79b1..cd8816734ee3997bd8121eac94e1b13360f4ffd6 100644 --- a/tools/cfgdefine.c +++ b/tools/cfgdefine.c @@ -72,10 +72,6 @@ static const char *dequote_list[] = "CONFIG_INIT_SYMTAB", /* Global symbol table */ "CONFIG_INIT_NEXPORTS", /* Global symbol table size */ - /* RGMP */ - - "CONFIG_RGMP_SUBARCH", /* RGMP sub-architecture */ - /* NxWidgets/NxWM */ "CONFIG_NXWM_BACKGROUND_IMAGE", /* Name of bitmap image class */ diff --git a/tools/sethost.sh b/tools/sethost.sh index 085361f5b68e11111444c37d74c9d18a41d1f203..c8bc0e4f95ee9b7a5e54c2bf713a8ce225df78c6 100755 --- a/tools/sethost.sh +++ b/tools/sethost.sh @@ -1,7 +1,7 @@ #!/bin/bash # tools/sethost.sh # -# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -42,13 +42,14 @@ unset configfile function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|n] [-32|64] []" + echo "USAGE: $progname [-w|l] [-c|u|n] [-32|64] []" echo " $progname -h" echo "" echo "Where:" echo " -w|l selects Windows (w) or Linux (l). Default: Linux" - echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin" - echo " -32|64 selects 32- or 64-bit host (Only for Cygwin). Default 64" + echo " -c|u|n selects Windows environment option: Cygwin (c), Ubuntu under" + echo " Windows 10 (u), or Windows native (n). Default Cygwin" + echo " -32|64 selects 32- or 64-bit host. Default 64" echo " -h will show this help test and terminate" echo " selects configuration file. Default: .config" exit 1 @@ -65,9 +66,15 @@ while [ ! -z "$1" ]; do host=linux ;; -c ) + host=windows wenv=cygwin ;; + -u ) + host=windows + wenv=ubuntu + ;; -n ) + host=windows wenv=native ;; -32 ) @@ -170,6 +177,7 @@ if [ "X$host" == "Xlinux" ]; then kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER @@ -184,11 +192,19 @@ else if [ "X$wenv" == "Xcygwin" ]; then echo " Select CONFIG_WINDOWS_CYGWIN=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE else - echo " Select CONFIG_WINDOWS_NATIVE=y" - kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN + if [ "X$wenv" == "Xubuntu" ]; then + echo " Select CONFIG_WINDOWS_UBUNTU=y" + kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE + else + echo " Select CONFIG_WINDOWS_NATIVE=y" + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU + kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE + fi fi kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS diff --git a/drivers/sercomm/Make.defs b/tools/showsize.sh similarity index 64% rename from drivers/sercomm/Make.defs rename to tools/showsize.sh index 0cf93d4c805ba915b653c45af95a2d63844a5931..ec66d63184dcb6859662dde7b6794c77a7b8a436 100644 --- a/drivers/sercomm/Make.defs +++ b/tools/showsize.sh @@ -1,8 +1,10 @@ +#!/bin/bash ############################################################################ -# drivers/serial/Make.defs +# tools/showsize.sh # -# Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Author: Lorenz Meier (Original concept) +# Gregory Nutt (This instantiation) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,23 +35,37 @@ # ############################################################################ -# File descriptor support is needed for this driver +# set -x -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +# Host nm should always work +# vs. NM=arm-none-eabi-nm -# The sercomm driver should not be build for all platforms. Only build it -# is so configured +NM=nm -ifeq ($(CONFIG_SERCOMM_CONSOLE),y) +# This should be executed from the top-level NuttX directory -# Include serial drivers +if [ ! -x "tools/showsize.sh" ]; then + echo "This script must executed from the top-level NuttX directory" + exit 1 +fi -CSRCS += console.c uart.c +# On the cywin simulation, the executable will be nuttx.exe -# Include sercomm build support +if [ -f "nuttx" ]; then + NUTTX=nuttx +else + if [ -x "nuttx.exe" ]; then + NUTTX=nuttx.exe + else + echo "Cannot find the NuttX executable" + exit 1 + fi +fi -DEPPATH += --dep-path sercomm -VPATH += :sercomm +# Show what we were asked for -endif -endif +echo "TOP 10 BIG DATA" +$NM --print-size --size-sort --radix dec -C $NUTTX | grep ' [DdBb] ' | tail -20 + +echo "TOP 10 BIG CODE" +$NM --print-size --size-sort --radix dec -C $NUTTX | grep ' [TtWw] ' | tail -20 diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 775dcab3fb9af64b910e30e44b8b7561f2c25188..0d10702c756650330242d2f87e689eed747ba4a7 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -1,7 +1,7 @@ #!/bin/bash # testbuild.sh # -# Copyright (C) 2016 Gregory Nutt. All rights reserved. +# Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -47,12 +47,13 @@ unset testfile function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|n] [-s] [-a ] [-n ] " + echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-a ] [-n ] " echo " $progname -h" echo "" echo "Where:" echo " -w|l selects Windows (w) or Linux (l). Default: Linux" - echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin" + echo " -c|u|n selects Windows environment option: Cygwin (c), Ubuntu under" + echo " Windows 10 (u), or Windows native (n). Default Cygwin" echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" echo " -a provides the relative path to the apps/ directory. Default ../apps" echo " -n provides the relative path to the NxWidgets/ directory. Default ../NxWidgets" @@ -76,12 +77,19 @@ while [ ! -z "$1" ]; do host=linux ;; -c ) + host=windows wenv=cygwin ;; + -u ) + host=windows + wenv=ubuntu + ;; -n ) + host=windows wenv=native ;; -s ) + host=windows sizet=long ;; -a ) @@ -165,11 +173,19 @@ function configure { if [ "X$wenv" == "Xcygwin" ]; then echo " Select CONFIG_WINDOWS_CYGWIN=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE else - echo " Select CONFIG_WINDOWS_NATIVE=y" - kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN + if [ "X$wenv" == "Xubuntu" ]; then + echo " Select CONFIG_WINDOWS_UBUNTU=y" + kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE + else + echo " Select CONFIG_WINDOWS_NATIVE=y" + kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU + kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE + fi fi kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS