7 Commits

Author SHA1 Message Date
Kevin O'Connor
9f9a872176 stm32: Avoid read-modify-write operations in flash.c
Avoid read-modify-write operations on the FLASH->CR register.  Write
out the desired valid explicitly.

Use writew() and writel() to write the flash bytes out to avoid gcc
reordering the memory write relative to the flash register writes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 19:21:51 -04:00
Kevin O'Connor
8316d2f0af armcm_boot: Introduce application_check_valid()
Move application_check_valid() in bootentry.c to armcm_boot.c and make
the check specific to the ARM cortex-m.  On these ARM machines it is
easier to validate the application stack address.

Also rename jump_to_application() to application_jump().

Also rename flash_read_block() to application_read_flash() and move to
armcm_boot.c .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 19:21:51 -04:00
Eric Callahan
fbf59301b3 stm32: add support for stm32f4 flash operations
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-05-16 09:04:45 -04:00
Kevin O'Connor
468b756f8d stm32: Avoid alignment issues in flash_read_block()
Use a regular memcpy() call to avoid issues with pointer alignment.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 06:19:08 -04:00
Eric Callahan
beb06d600d canboot_main: use direct addressing
Rather than use indicies, use the desired address when requesting
a block write or read.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-05-09 17:12:24 -04:00
Kevin O'Connor
5279c33ea0 flash: Autodetect stm32f103 flash page size
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-05 14:06:43 -04:00
Arksine
2762299895 canboot: initial source commit
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-02-06 20:04:47 -05:00