aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* stm32: adc for new stm32f0 common code (#2120)clearchris2019-11-054-3/+144
| | | | | | | Derived from stm32/adc.c and stm32f0/adc.c with additional changes. Tested on Monoprice Mini Delta (malyan) stm32f070xb board. Signed-off-by: Chris Lombardi <clearchris@hotmail.com>
* stm32: Define PGx pins on stm32f103Kevin O'Connor2019-11-021-2/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* flash_usb: Pass -t $CONFIG_MCU to flash_usb on all targetsKevin O'Connor2019-10-264-11/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* flash_usb: Use "-s" option to specify flash offset on atsamdKevin O'Connor2019-10-261-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for flashing over usb on stm32f042Kevin O'Connor2019-10-262-0/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: stm32f4 usb boot check only needed when CONFIG_USBSERIALKevin O'Connor2019-10-261-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f4: Add support for flashing over USBKevin O'Connor2019-10-262-1/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: sysio support is only available on sam4sKevin O'Connor2019-10-241-0/+2
| | | | | | Fix sam4e build error introduced in commit f723a314. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Allow PB4-PB7,PB10-PB12 to be used as gpio on sam4Kevin O'Connor2019-10-241-0/+3
| | | | | | | 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>
* stm32: Implement armcm_main() in arch specific codeKevin O'Connor2019-10-246-30/+40
| | | | | | | Move armcm_main() to stm32f0.c, stm32f1.c, and stm32f4.c. This gives the arch specific code more control on the early boot setup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Use armcm_main() instead of main() to start board codeKevin O'Connor2019-10-246-25/+27
| | | | | | | | | | 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>
* stm32: Support PA11/PA12 pin remap on stm32f042 tsop20 chipKevin O'Connor2019-10-232-0/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support stm32f042 build from stm32/ directoryKevin O'Connor2019-10-234-4/+41
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Initial support for stm32f070Kevin O'Connor2019-10-239-21/+390
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f0: Rename internal build symbol from MACH_STM32F0 to MACH_STM32F0_HALKevin O'Connor2019-10-232-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support 16bit packet memory access on usbfs controllerKevin O'Connor2019-10-231-9/+15
| | | | | | | The stm32f0 line uses 16bit packet memory reads/writes (as opposed to the goofy 32bit accesses required on the stm32f103). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Be explicit in layout of gpio banks in digital_regs variableKevin O'Connor2019-10-231-3/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use stm32f103xe header for stm32f103 lineKevin O'Connor2019-10-231-1/+1
| | | | | | Use the "e" revision so that the SPI3 device is available for use. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Make sure to turn on the usb clock before writing to the packet memoryKevin O'Connor2019-10-131-4/+4
| | | | | | | The USB clock needs to be enabled prior to writing to the USB packet memory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: List 20Mhz option below 16Mhz option in KconfigKevin O'Connor2019-09-301-2/+2
| | | | | | | | When enabling "low level options" in Kconfig, selecting a chip that is 20Mhz capable would result in 20Mhz being the default. A 16Mhz speed is the preferred default, so list that first in the menu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Use FIOPIN to set start value on gpio_out_reset()Kevin O'Connor2019-09-291-4/+1
| | | | | | | | The FIOSET and FIOCLR registers may not set an initial value if the pin is not in an output mode. So, use FIOPIN to set the initial value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only prompt for a bootloader on stm32f103 and stm32f407Kevin O'Connor2019-09-181-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: No need to call SystemInit() from main()Kevin O'Connor2019-09-181-2/+1
| | | | | | The SystemInit() is already called from armcm_boot.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Export MCU definition from armcm_bootKevin O'Connor2019-09-186-16/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_reset: Add a new helper file defining command_reset()Kevin O'Connor2019-09-187-26/+21
| | | | | | Add a generic ARM Cortex-M implementation of the "reset" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Move VTOR fixup from main() to chip specific codeKevin O'Connor2019-09-183-3/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Move usb_request_bootloader() to chip specific codeKevin O'Connor2019-09-184-20/+24
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix usbfs rx buffer sizingKevin O'Connor2019-09-161-2/+2
| | | | | | | | | The usbfs receive buffers must also have space for the 2 byte crc at the end of a transmission. This fixes an error that could lead to lost messages from mcu to host (resulting in bytes_invalid increasing in stats) on the stm32f103. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use official defines for EPR bitsKevin O'Connor2019-09-161-30/+23
| | | | | | Use the standard definitions for the endpoint register bits. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rename USB_BTABLE to EPM in usbfs.cKevin O'Connor2019-09-161-20/+20
| | | | | | | Rename the internal definition so it isn't in conflict with the USB_BTABLE register. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add missing PB21 pin to ADC moduleKevin O'Connor2019-09-161-1/+1
| | | | | | Reported by @mental405. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Disable usb irqs in usbotg handlersKevin O'Connor2019-09-121-17/+56
| | | | | | | | It appears the usbotg controller can get confused if the usb irq handler runs while processing a usb request. Disable usb irqs during usb processing to avoid this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Enable flash loop caching optimization on sam4sKevin O'Connor2019-09-081-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rework usbotg transmit interruptsKevin O'Connor2019-09-081-7/+10
| | | | | | | | Use the XFRC interrupt instead of TXFE. Don't mask/unmask the tx interrupts during runtime. This fixes some race conditions where a tx notification may have previously gotten lost. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for SPI3 bus on alternate PC11,PC12,PC10 pinsKevin O'Connor2019-09-051-1/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmcuart: Fix typo in function nameKevin O'Connor2019-09-011-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for SPI1 and SPI3 bussesKevin O'Connor2019-08-312-13/+35
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix gpio enumerations (each bank has 16 pins, not 32)Kevin O'Connor2019-08-311-9/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Work around stm32f407 usbotg chip errataKevin O'Connor2019-08-311-3/+10
| | | | | | | It appears bogus entries can get placed on the rxqueue - detect and clear them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Configure and enable usbotg endpoint0 during setupKevin O'Connor2019-08-301-25/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Disable and flush usbotg bulk transmit pipe on usb_set_configure()Kevin O'Connor2019-08-301-19/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Perform usbotg endpoint init during usb_set_configure()Kevin O'Connor2019-08-301-26/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Discard usbotg tx data until usb is readyKevin O'Connor2019-08-301-2/+2
| | | | | | If the usb interface is not ready, just discard messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: No need to clear the usbotg address on resetKevin O'Connor2019-08-301-4/+2
| | | | | | The controller automatically clears the address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable usbotg bulk reads during endpoint configurationKevin O'Connor2019-08-301-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: ADC pins need to be in input mode with pullups disabledKevin O'Connor2019-08-281-0/+3
| | | | | | | | | | 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>
* buildcommands: Match DECL_X names to the actual C macro namesKevin O'Connor2019-08-221-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_link: Rename armcm_boot.lds.S to armcm_link.lds.SKevin O'Connor2019-08-226-9/+9
| | | | | | | 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>
* ctr: Encode negative integers in normal hex notationKevin O'Connor2019-08-221-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expressionKevin O'Connor2019-08-221-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>