8 #ifndef OPENOCD_FLASH_NOR_STM32L4X
9 #define OPENOCD_FLASH_NOR_STM32L4X
18 #define BIT(nr) (1UL << (nr))
22 #define FLASH_PG BIT(0)
23 #define FLASH_PER BIT(1)
24 #define FLASH_MER1 BIT(2)
25 #define FLASH_PAGE_SHIFT 3
26 #define FLASH_BKER BIT(11)
27 #define FLASH_BKER_G0 BIT(13)
28 #define FLASH_MER2 BIT(15)
29 #define FLASH_STRT BIT(16)
30 #define FLASH_OPTSTRT BIT(17)
31 #define FLASH_EOPIE BIT(24)
32 #define FLASH_ERRIE BIT(25)
33 #define FLASH_OBL_LAUNCH BIT(27)
34 #define FLASH_OPTLOCK BIT(30)
35 #define FLASH_LOCK BIT(31)
38 #define FLASH_BSY BIT(16)
39 #define FLASH_BSY2 BIT(17)
42 #define FLASH_PGSERR BIT(7)
43 #define FLASH_SIZERR BIT(6)
44 #define FLASH_PGAERR BIT(5)
45 #define FLASH_WRPERR BIT(4)
46 #define FLASH_PROGERR BIT(3)
47 #define FLASH_OPERR BIT(1)
48 #define FLASH_EOP BIT(0)
49 #define FLASH_ERROR (FLASH_PGSERR | FLASH_SIZERR | FLASH_PGAERR | \
50 FLASH_WRPERR | FLASH_PROGERR | FLASH_OPERR)
53 #define KEY1 0x45670123
54 #define KEY2 0xCDEF89AB
57 #define OPTKEY1 0x08192A3B
58 #define OPTKEY2 0x4C5D6E7F
61 #define FLASH_RDP_MASK 0xFF
62 #define FLASH_G0_DUAL_BANK BIT(21)
63 #define FLASH_G4_DUAL_BANK BIT(22)
64 #define FLASH_L4_DUAL_BANK BIT(21)
65 #define FLASH_L4R_DBANK BIT(22)
66 #define FLASH_LRR_DB1M BIT(21)
67 #define FLASH_L5_DBANK BIT(22)
68 #define FLASH_L5_DB256 BIT(21)
69 #define FLASH_U5_DUALBANK BIT(21)
70 #define FLASH_TZEN BIT(31)
73 #define FLASH_SECBB1(X) (0x80 + 4 * (X - 1))
74 #define FLASH_SECBB2(X) (0xA0 + 4 * (X - 1))
76 #define FLASH_SECBB_SECURE 0xFFFFFFFF
77 #define FLASH_SECBB_NON_SECURE 0
80 #define DBGMCU_IDCODE_G0 0x40015800
81 #define DBGMCU_IDCODE_L4_G4 0xE0042000
82 #define DBGMCU_IDCODE_L5 0xE0044000
83 #define UID64_DEVNUM 0x1FFF7580
84 #define UID64_IDS 0x1FFF7584
85 #define UID64_IDS_STM32WL 0x0080E115
88 #define DEVID_STM32L47_L48XX 0x415
89 #define DEVID_STM32L43_L44XX 0x435
90 #define DEVID_STM32G05_G06XX 0x456
91 #define DEVID_STM32G07_G08XX 0x460
92 #define DEVID_STM32L49_L4AXX 0x461
93 #define DEVID_STM32L45_L46XX 0x462
94 #define DEVID_STM32L41_L42XX 0x464
95 #define DEVID_STM32G03_G04XX 0x466
96 #define DEVID_STM32G0B_G0CXX 0x467
97 #define DEVID_STM32G43_G44XX 0x468
98 #define DEVID_STM32G47_G48XX 0x469
99 #define DEVID_STM32L4R_L4SXX 0x470
100 #define DEVID_STM32L4P_L4QXX 0x471
101 #define DEVID_STM32L55_L56XX 0x472
102 #define DEVID_STM32G49_G4AXX 0x479
103 #define DEVID_STM32U57_U58XX 0x482
104 #define DEVID_STM32WB1XX 0x494
105 #define DEVID_STM32WB5XX 0x495
106 #define DEVID_STM32WB3XX 0x496
107 #define DEVID_STM32WLE_WL5XX 0x497
110 #define STM32_FLASH_BANK_BASE 0x08000000
111 #define STM32_FLASH_S_BANK_BASE 0x0C000000
114 #define STM32L5_REGS_SEC_OFFSET 0x10000000
117 #define LDR_STACK_SIZE 100
139 #ifdef OPENOCD_CONTRIB_LOADERS_FLASH_STM32_STM32L4X
uint32_t flash_sr_bsy_mask
struct stm32l4_work_area::flash_async_algorithm_circbuf fifo
struct stm32l4_work_area::stm32l4_loader_params params
uint8_t stack[LDR_STACK_SIZE]