Commit Graph

499 Commits

Author SHA1 Message Date
Frank Benkert
cf5fdf1f8f SAM Watchdog: Register the watchdog device at the configured device path CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt 2016-10-21 07:09:20 -06:00
Gregory Nutt
1c20376e39 SAM GPIO: Apply Wolfgang's change for SAM3/4 to SAMA5 and SAMV7 2016-09-20 15:33:31 -06:00
Wolfgang Reißnegger
3f22b63321 SAM3/4: Fix GPIO pull-up/down code.
Enabling the pull-down resistor while the pull-up resistor is still enabled
is not possible. In this case, the write of PIO_PPDER for the relevant I/O
line is discarded. Likewise, enabling the pull-up resistor while the
pull-down resistor is still enabled is not possible. In this case, the
write of PIO_PUER for the relevant I/O line is discarded.
2016-09-20 13:32:04 -07:00
Gregory Nutt
4dc3521743 All SAM Ethernet Drivers: Add support so that the drivers can be built with CONFIG_NET_MULTIBUFFER=y 2016-09-20 08:56:36 -06:00
Gregory Nutt
046acf6b54 Add a simulated oneshot lowerhalf driver 2016-08-12 13:14:03 -06:00
Gregory Nutt
b4e8876b09 Correct some spacing 2016-08-12 12:41:49 -06:00
Gregory Nutt
82b86cdcf3 oneshot interface: max_delay method should return time in a standard struct timespec form. 2016-08-12 11:33:10 -06:00
Gregory Nutt
61b0ac06bf Missed a dependency in last set of commits 2016-08-11 17:20:12 -06:00
Gregory Nutt
a5a776e223 SAM4CM: Add option to support oneshot timer without free-running timer. Add oneshot lower half driver. 2016-08-11 17:04:19 -06:00
Gregory Nutt
0e35bad987 Update some comments 2016-08-11 10:12:04 -06:00
Gregory Nutt
7823a1680e Update a comment 2016-08-09 17:08:03 -06:00
Gregory Nutt
698d6d1294 SAM3/4: Extend clocking logic to enable clocking on ports D-F 2016-08-09 17:05:11 -06:00
Wolfgang Reissnegger
cf35bb0b18 SAM3/4 GPIO: Enable peripheral clock for GPIO port when GPIO is configured as input.
The value of a GPIO input is only sampled when the peripheral clock for
the port controller the GPIO resides in is enabled. Therefore we need
to enable the clock even when polling a GPIO.
2016-08-09 13:23:05 -07:00
Gregory Nutt
e895e19b9f Minor changes from review of last PR 2016-07-24 07:45:46 -06:00
Wolfgang Reissnegger
c0fa319f2b SAM3/4 UDP: Fix handling of endpoint RX FIFO banks.
This fixes a race condition where the HW fills a FIFO bank while the SW is
busy, resulting in out of sequence USB packets.
2016-07-23 20:11:04 -07:00
Wolfgang Reissnegger
cc191a977d SAM3/4 UDP: Remove redundant EP state assignment. 2016-07-23 20:11:03 -07:00
Wolfgang Reissnegger
f3a6a40f62 SAM3/4 Serial: Fix warning when CONFIG_SUPPRESS_UART_CONFIG is set. 2016-07-23 16:23:49 -07:00
Gregory Nutt
96d5b734a8 Add missing TWI definitions 2016-07-21 08:01:59 -06:00
Gregory Nutt
18059d6821 Restore Wolfgang Reissnegger's PR as submitted. My mistake is it late here. 2016-07-14 18:39:51 -06:00
Wolfgang Reissnegger
f982180ec7 SAM3/4 Timer: Remove broken definitions for BMR register.
Per documentation SAM4S and SAM4E have the BMR register values
as they are already defined. No need for chip specific values.

In addition:
 - CONFIG_ARCH_CHIP_SAM4s has wrong lower case 's' so the definitions would
   not be used anyways for SAM4S builds.
 - TC_BMR_TC2XC2S_TIOA2 does not make sense. There is no way to loop back
   TC2's TIOA2 into itself.
2016-07-14 18:17:05 -06:00
Wolfgang Reissnegger
d89e062c06 SAM3/4 I2C: Fix reversed logic in twi_startmessage(). 2016-07-09 06:51:07 -06:00
Wolfgang Reissnegger
f4adb82fe7 [sam34][dacc] Bugfix: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY 2016-06-23 17:12:24 -07:00
Gregory Nutt
aed4d0e198 Missed a few *llinfo() to *info() conversions 2016-06-20 16:24:09 -06:00
Gregory Nutt
2a751068e6 Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err(). 2016-06-20 12:44:38 -06:00
Gregory Nutt
43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt
d40a473f72 Without lowsyslog() *llwarn() is not useful. Eliminate and replace with *warn(). 2016-06-20 09:37:08 -06:00
Gregory Nutt
832efae5d8 Fix some debug output statements that were changed and lost their ll-ness 2016-06-18 09:41:55 -06:00
Gregory Nutt
3fa41c0f18 Kconfig files: Fix some dependencies that have CONFIG_ in the variable name 2016-06-17 19:30:19 -06:00
Gregory Nutt
0d3ecb3ddd Fix another victim of the mass name changes: xyz_errmonitor->xyz_dbgmonitor 2016-06-17 07:00:33 -06:00
Gregory Nutt
f35086dbf7 Change *err() to either info() or err(ERROR:..), depending upon if an error has occurred. 2016-06-16 16:30:45 -06:00
Gregory Nutt
801d661423 Change *err() to either info() or err(ERROR:..), depending upon if an error has occurred. 2016-06-16 15:10:57 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
b7f0fbc073 Centralize definitions associated with CONFIG_DEBUG_RTC 2016-06-16 07:39:23 -06:00
Gregory Nutt
37b9742189 Centralize definitions associated with CONFIG_DEBUG_TIMER 2016-06-16 07:16:25 -06:00
Gregory Nutt
6b517ed017 Centralize definitions associated with CONFIG_DEBUG_WATCHDOG 2016-06-16 06:28:04 -06:00
Gregory Nutt
5c89b18af8 Centralize definitions associated with CONFIG_DEBUG_I2C 2016-06-15 16:30:12 -06:00
Gregory Nutt
ba03134bed Centralize definitions associated with CONFIG_DEBUG_SPI 2016-06-15 10:41:13 -06:00
Gregory Nutt
a97d3ae707 Centralize definitions associated with CONFIG_DEBUG_GPIO 2016-06-15 09:20:23 -06:00
Gregory Nutt
c4e6f50eac Centralize definitions associated with CONFIG_DEBUG_IRQ 2016-06-15 08:35:22 -06:00
Gregory Nutt
0f249016a0 Eliminate some warnings 2016-06-13 14:01:32 -06:00
Gregory Nutt
eac916c907 Fix some warnings 2016-06-13 11:48:20 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
3a74a438d9 Rename CONFIG_DEBUG_VERBOSE to CONFIG_DEBUG_INFO 2016-06-11 11:50:18 -06:00
Gregory Nutt
275f8988f8 Fix a cloned error in debug macro definitions 2016-06-10 10:13:30 -06:00
Gregory Nutt
ae1281d244 SAM4E AFEC: Fix some columnar alignement 2016-06-10 10:00:36 -06:00
OrbitalFox
78a2465af4 SAM4E: Fix some errors in AFEC header file. 2016-06-10 09:56:35 -06:00
Gregory Nutt
f65616f872 Replace confusing references to uIP with just 'the network' 2016-05-30 09:16:32 -06:00
Gregory Nutt
fa10927dcc Stefan Kolb's change to the SAMV7 Oneshot Timer (commit d44ecbcfbb) should also be applied to the SAM3/4 oneshot time since the drivers are identical. Here are the commit commits from Stefan's original change:
"This is a fix to a problem in the handling of the oneshot timer. Due to a wrong assumption concerning the behavior directly after the start of the timer/counter the function sam_oneshot_cancel(…) calculates the wrong remaining time. The code assumes that the counter register is zero directly after the start of the timer, but this is not true. To start the time/counter a software trigger is invoked, this trigger starts the timer/count and sets the counter register to zero, but the reset of the counter register is not performed instantly. According to the datasheet: “The counter can be reset by a trigger. In this case, the counter value passes to zero on the next valid edge of the selected clock.” Thus the counter is set to zero between 0 and USEC_PER_TICK microseconds after the clock was started.

"In my fix I use the freerun count value to determine if at least one tick passed since the start of the timer and thus if the value of the oneshot counter is correct. I also tried to use the function up_timer_gettime(…) to achieve this but, at least if compiled with no optimization the problem vanishes without using the value of the function, the function call takes too long.

"Another problem treated in the fix is that if the oneshot timer/counter is canceled, we only know the remaining time with a precision of USEC_PER_TICK microseconds. This means the calculated remaining time is between 0 and USEC_PER_TICK microseconds  too long. To fix this I subtract one tick if the calculated remaining time is greater than one tick and otherwise set the remaining time to zero. By doing so the measured times are much more precise as without it."
2016-05-29 08:25:41 -06:00
Gregory Nutt
9ec104834a Remove CONFIG_USARTn_ISUART 2016-05-25 11:21:48 -06:00
Gregory Nutt
2a87741e72 Rename CONFIG_ARCH_HAVE_UARTn to CONFIG_UARTn_SERIALDRIVER 2016-05-25 10:45:01 -06:00
Gregory Nutt
249a2e48e5 Rename CONFIG_ARCH_HAVE_USARTn to CONFIG_USARTn_SERIALDRIVER 2016-05-25 10:39:23 -06:00
David Sidrane
fca329945b This patch ensures that the TWIHS (i2c) hw get's its clock set when the sequence of
sam_i2cbus_initialize
sam_i2cbus_uninitialize
sam_i2cbus_initialize

Or twi_reset is called.

I found this a while back in the stm32 family, so there may be more arch-es with this sort of bug. I suppose any driver that has the notion of "do not set the freq if it is already set" could be suspect.
2016-05-23 13:38:34 -06:00
Gregory Nutt
f07ea1bb94 SAM (all): Fix several places in DMA logic where a spurious semicolon causes bad conditional logic 2016-05-11 17:26:59 -06:00
Gregory Nutt
8df80e6615 Kconfigs: All RNG selections also must select ARCH_HAVE_RNG 2016-03-30 07:56:03 -06:00
Gregory Nutt
4a8ac55c9d All SAM TWI: g_twiops should be both static and const 2016-03-09 18:11:55 -06:00
Gregory Nutt
51be83aa3a ARM: Fix missing header file. Update comments in all *_irq.c files. 2016-03-09 15:08:58 -06:00
Gregory Nutt
4d4f54a789 Rename current_regs to g_current_regs; For ARM, g_current_regs needs to be an array to support multiple CPUs 2016-03-09 13:41:48 -06:00
Gregory Nutt
9c63736c98 Standard some naming if code sectino comments 2016-02-21 18:06:09 -06:00
Gregory Nutt
666cc280f4 Rename irqenable() to up_irq_enable(); rename irqdisable() to up_irq_disable() 2016-02-14 16:54:09 -06:00
Gregory Nutt
83bc1c97c3 Rename irqsave() and irqrestore() to up_irq_save() and up_irq_restore() 2016-02-14 16:11:25 -06:00
Gregory Nutt
70e502adb0 Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-13 19:11:09 -06:00
Gregory Nutt
a6eb9a351c Add spinlock support for ARMv7-M architectures 2016-02-09 13:44:22 -06:00
Gregory Nutt
03b382d443 SAM3/4, SAMA5, SAMv7 Tickless: Refuse to call lower-level timer logic if not yet initialized 2016-02-05 10:22:11 -06:00
Gregory Nutt
1166e311b0 Networking: Remove the HSEC argument from devif_timer. 2016-02-03 11:17:15 -06:00
Gregory Nutt
d2b2cd3415 Duplicate Manuel's EMAC driver fix to every other driver that supports CONFIG_NET_NOINTS 2016-02-03 10:33:22 -06:00
Gregory Nutt
1e4f2ae2c1 Rename up_i2c initialize and uninitialize functions using the correct MCU-specific naming 2016-02-02 12:08:23 -06:00
Gregory Nutt
d2571985ef I2C: up_i2creset should not be a global function; Now it is an I2C interface method 2016-02-02 11:21:45 -06:00
Gregory Nutt
0693e76be8 I2C: Remove the setfrequency method from the interface 2016-02-01 16:30:29 -06:00
Gregory Nutt
a64f36a63e I2C: Remove setaddress method 2016-02-01 12:14:20 -06:00
Gregory Nutt
ce988c7ed3 Remove the read and write methods from the I2C interface 2016-02-01 09:22:10 -06:00
Gregory Nutt
2171438c61 I2C_TRANSFER support is no longer optional 2016-01-31 14:00:53 -06:00
Gregory Nutt
531d73af41 Remove I2C slave methods from I2C master interface; rename i2c_dev_s to i2c_master_s. 2016-01-30 08:35:46 -06:00
Gregory Nutt
9f9b85a932 Move include/nuttx/i2c.h to include/nuttx/i2c/i2c_master.h 2016-01-30 07:59:44 -06:00
Gregory Nutt
3b6a502eff For LK MCUs, rename up_spiinitialize to kl_spibus_initialize 2016-01-26 16:19:03 -06:00
Gregory Nutt
d16978be7f For SAM MCUs, rename up_spiinitialize to sam_spibus_initialize 2016-01-26 13:03:17 -06:00
Gregory Nutt
c0fb4e34a7 I2C: Eliminate the I2C_WRITEREAD method 2016-01-26 10:23:09 -06:00
Gregory Nutt
b7cbbab761 Remove CONFIG_SPI_OWNBUS: Now it is not just a good idea, it is the law 2016-01-23 18:10:21 -06:00
Gregory Nutt
4bd6adb725 Add dummy hwfeatures method to all SPI interfaces 2016-01-23 15:09:38 -06:00
Gregory Nutt
dfec6a0dd0 Rename CONFIG_ARMV7M_MPU to CONFIG_ARM_MPU so that we can reuse the configuration settings for the ARMV7R MPU 2015-12-14 13:56:21 -06:00
Gregory Nutt
daea1e614b All architectures need to build ELF support if either CONFIG_ELF or CONFIG_MODULE are selected. Cortex-M7 also must support module cache corherence 2015-12-12 09:35:05 -06:00
Gregory Nutt
25a2e17347 Rename up_rtcinitialize to up_rtc_initialize so that it looks like other RTC interfaces 2015-11-20 08:27:04 -06:00
Paul A. Patience
52454cf79b Fix typo 2015-11-11 13:06:15 -05:00
Gregory Nutt
1c79e77811 ARMv7-M: Minor naming change to improve readability 2015-11-06 11:24:52 -06:00
Gregory Nutt
f6d7da24a7 SAM4CM should advertise that it supports Tickless operation in Kconfig 2015-11-02 06:39:24 -06:00
Gregory Nutt
b28e32e3d3 Rename board_led_on to board_autoled_on 2015-11-01 09:07:06 -06:00
Gregory Nutt
ef5f3dcff4 SAM3/4 RTC: Fix a bungled change from a recent commit 2015-10-08 19:21:35 -06:00
Gregory Nutt
beb060d422 Yet more spacing issues 2015-10-07 20:24:19 -06:00
Gregory Nutt
b6638315a4 Correct some spacing issues 2015-10-07 11:39:06 -06:00
Gregory Nutt
2ab66a015b Cosmetic fixes to C coding style 2015-10-05 17:28:26 -06:00
Gregory Nutt
3fdd914203 Costmetic fixes to C coding style 2015-10-05 17:13:53 -06:00
Gregory Nutt
6fc6d17760 Fix some spacing problems 2015-10-04 14:59:08 -06:00
Gregory Nutt
7ced84c5f0 Standardize the width of all comment boxes in C files 2015-10-03 07:25:03 -06:00
Gregory Nutt
36726b1bc4 Standardize the width of all comment boxes in header files 2015-10-02 17:42:29 -06:00
Gregory Nutt
39859a9645 All ARMV7-M: Force 8-byte stack alignment when calling from assembly to C to interrupt handling 2015-09-15 07:37:09 -06:00
Gregory Nutt
f7ca98c5ae Fix error in almost all ARMv7-M interrupt stack handling 2015-09-14 07:07:13 -06:00
Gregory Nutt
36f1d84374 Remove some nonfunctional logic that also generates warnings 2015-09-08 13:02:33 -06:00
Gregory Nutt
2913aac866 Eliminate warnings 2015-09-08 10:20:41 -06:00