X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstm32l4x.h;h=4458c087560593dee9510f3b61f5d80c79b308f5;hb=b61a280860f9ceb9bc38125c48d2f0f4d35f1c11;hp=566cc2226aa290e668aeb650d625d6df4dabd347;hpb=48f267d4adea3e582d5287080f947b0e696d4f22;p=openocd.git diff --git a/src/flash/nor/stm32l4x.h b/src/flash/nor/stm32l4x.h index 566cc2226a..4458c08756 100644 --- a/src/flash/nor/stm32l4x.h +++ b/src/flash/nor/stm32l4x.h @@ -70,6 +70,14 @@ /* FLASH_OPTR register bits */ #define FLASH_RDP_MASK 0xFF +#define FLASH_G0_DUAL_BANK BIT(21) +#define FLASH_G4_DUAL_BANK BIT(22) +#define FLASH_L4_DUAL_BANK BIT(21) +#define FLASH_L4R_DBANK BIT(22) +#define FLASH_LRR_DB1M BIT(21) +#define FLASH_L5_DBANK BIT(22) +#define FLASH_L5_DB256 BIT(21) +#define FLASH_U5_DUALBANK BIT(21) #define FLASH_TZEN BIT(31) /* FLASH secure block based bank 1/2 register offsets */ @@ -128,9 +136,24 @@ struct stm32l4_work_area { } params; uint8_t stack[LDR_STACK_SIZE]; struct flash_async_algorithm_circbuf { + /* note: stm32l4_work_area struct is shared between the loader + * and stm32l4x flash driver. + * + * '*wp' and '*rp' pointers' size is 4 bytes each since stm32l4x + * devices have 32-bit processors. + * however when used in openocd code, their size depends on the host + * if the host is 32-bit, then the size is 4 bytes each. + * if the host is 64-bit, then the size is 8 bytes each. + * to avoid this size difference, change their types depending on the + * usage (pointers for the loader, and 32-bit integers in openocd code). + */ +#ifdef OPENOCD_CONTRIB_LOADERS_FLASH_STM32_STM32L4X uint8_t *wp; uint8_t *rp; - uint8_t *buf; +#else + uint32_t wp; + uint32_t rp; +#endif /* OPENOCD_CONTRIB_LOADERS_FLASH_STM32_STM32L4X */ } fifo; };