Commit Graph

35 Commits

Author SHA1 Message Date
Kevin O'Connor 73e84abaff atsam: Fix typo causing chipid to not be fully read
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-27 14:33:20 -05:00
Kevin O'Connor 401f7a879c atsam: Enable chipid as usb serial number
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-26 08:42:14 -05:00
Kevin O'Connor 1a69f38e6e flash_usb: Pass -t $CONFIG_MCU to flash_usb on all targets
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 18:48:00 -04:00
Kevin O'Connor 081c24326d atsam: sysio support is only available on sam4s
Fix sam4e build error introduced in commit f723a314.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:21:47 -04:00
Kevin O'Connor f723a3141e atsam: Allow PB4-PB7,PB10-PB12 to be used as gpio on sam4
A separate "sysio" register must be set in order to use some port B
pins on the sam4 mcu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:02:29 -04:00
Kevin O'Connor faeaa54925 armcm_boot: Use armcm_main() instead of main() to start board code
The main() function has a special meaning to gcc and using it can
result in different code generation.  Use armcm_main() to avoid that.

Also, invoke SystemInit() from the board specific armcm_main() code.
This gives the board code more control over board initialization.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 11:16:10 -04:00
Kevin O'Connor 9e2c17f468 atsam: No need to call SystemInit() from main()
The SystemInit() is already called from armcm_boot.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-18 11:59:43 -04:00
Kevin O'Connor 9b70c052cc armcm_boot: Export MCU definition from armcm_boot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-18 11:59:43 -04:00
Kevin O'Connor c780537c57 atsam: Add missing PB21 pin to ADC module
Reported by @mental405.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-16 10:50:24 -04:00
Kevin O'Connor 8d4a5c16be atsam: Enable flash loop caching optimization on sam4s
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-09-08 09:11:41 -04:00
Kevin O'Connor c95209bf7a atsam: ADC pins need to be in input mode with pullups disabled
The ADC pins (on at least the sam3x8e) need to be configured in input
mode with the internal pullups disabled in order to get accurate ADC
readings.

Reported by @bryanboettcher.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-28 13:45:01 -04:00
Kevin O'Connor caeb610bb9 armcm_link: Rename armcm_boot.lds.S to armcm_link.lds.S
Rename the linker script so the build does not have any conflicts with
the armcm_boot.d dependency file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-22 13:18:24 -04:00
Kevin O'Connor 44f862388f atsam: Update code to use armcm_boot mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-22 09:58:58 -04:00
Kevin O'Connor fc879456db atsam: Move irq handler code above irq setup
Only code movement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-08-22 09:58:58 -04:00
Kevin O'Connor 3910a44cc9 atsam: Add support for "timer" controlled hardware pwm pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-02 10:59:33 -04:00
Kevin O'Connor edb679b83d atsam: Enable pullup on i2c SDA line
The internal pullup helps ensure i2c errors are detected properly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-23 09:32:10 -04:00
Kevin O'Connor 24b1638c25 atsam: Improve i2c timeout detection
Unify timeout detection in i2c_write() and i2c_read().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-23 09:32:10 -04:00
Kevin O'Connor 5fe5f09244 atsam: Minor whitespace changes to i2c.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-05-23 09:13:55 -04:00
Kevin O'Connor 7e8ecfe177 atsam: Use enumerations for buses and reserve pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:29:31 -04:00
Kevin O'Connor 8b0195f896 atsam: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor b28e95ca1a command: Always pass a string to the DECL_CONSTANT() macro
Make it clear that the name of the constant being defined is a string.
When the value being defined is also a string, use a new
DECL_CONSTANT_STR() macro.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-17 19:38:18 -04:00
Kevin O'Connor a5aede52cb flash_usb: Try to make the bossac atsam reboot logic more stable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-10 15:06:41 -04:00
Kevin O'Connor 079fdf8807 atsam: Improve support for flashing over USB
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 22:22:41 -05:00
Kevin O'Connor 399d539969 Makefile: Reduce use of $^ in build rules
It's rare to use all of a target's prerequisites in a recipe - replace
most cases with $< (the target's first prerequisite).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-02 12:01:44 -05:00
Kevin O'Connor 5a74549ef6 atsam: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 14:20:15 -05:00
Kevin O'Connor dddfb681c7 pins: Add support for pull down resistors
Add initial support for selecting pull down resistors (for
micro-controllers that support it).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 11:13:21 -05:00
Kevin O'Connor 0da65bf6b0 atsam: Fix hard pwm cycle divider calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-13 18:18:12 -05:00
Kevin O'Connor 090cd930d9 atsam: Add support for hard pwm via PWM controller
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-13 11:15:24 -05:00
Kevin O'Connor 74c216543c atsam: Configure the atsam sram matrix register
The sram matrix configuration is, bizarrely, configured with a slow
default.  It will typically add an extra wait state to every memory
access.  Set the matrix sram controller to improve the performance.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-07 13:12:35 -05:00
Kevin O'Connor 77db1aa379 atsam: Convert code to use armcm_timer
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-06 22:03:09 -05:00
Kevin O'Connor b6ccd2682c Kconfig: Move SERIAL_BAUD to src/Kconfig and show with LOW_LEVEL_OPTIONS
Move the definition of SERIAL_BAUD to the main src/Kconfig file.  Only
show this as an option if the user selects the ability to configure
low-level options.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-25 18:02:03 -05:00
Kevin O'Connor eb7842c221 atsam: Add support for the SAM3X8C micro-controller
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-22 09:07:12 -05:00
Kevin O'Connor efd1bf5e04 atsam: Add support for USB on SAM3X
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-19 22:32:28 -05:00
Kevin O'Connor d4790356da atsam: Add MACH_SAM3X, MACH_SAM4, MACH_SAM4E, MACH_SAM4S definitions
Add additional Kconfig definitions to make it easier to select the
correct code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-18 09:56:24 -05:00
Florian Heilmann 6256599a6d src: Rename source folders for atsam and atsamd architectures
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2019-01-12 20:14:50 -05:00