summaryrefslogtreecommitdiff
path: root/chip/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32')
-rw-r--r--chip/stm32/flash-stm32l15x.c8
-rw-r--r--chip/stm32/registers.h18
2 files changed, 13 insertions, 13 deletions
diff --git a/chip/stm32/flash-stm32l15x.c b/chip/stm32/flash-stm32l15x.c
index d110267fa6..8fa1d711d4 100644
--- a/chip/stm32/flash-stm32l15x.c
+++ b/chip/stm32/flash-stm32l15x.c
@@ -140,8 +140,8 @@ static void write_optb(int offset, uint16_t value)
*/
static uint32_t read_optb_wrp(void)
{
- return read_optb(STM32_OPTB_WRP01) |
- ((uint32_t)read_optb(STM32_OPTB_WRP23) << 16);
+ return read_optb(STM32_OPTB_WRP1L) |
+ ((uint32_t)read_optb(STM32_OPTB_WRP1H) << 16);
}
/**
@@ -149,8 +149,8 @@ static uint32_t read_optb_wrp(void)
*/
static void write_optb_wrp(uint32_t value)
{
- write_optb(STM32_OPTB_WRP01, (uint16_t)value);
- write_optb(STM32_OPTB_WRP23, value >> 16);
+ write_optb(STM32_OPTB_WRP1L, (uint16_t)value);
+ write_optb(STM32_OPTB_WRP1H, value >> 16);
}
/**
diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h
index 148d1f2e08..adc1ed1b70 100644
--- a/chip/stm32/registers.h
+++ b/chip/stm32/registers.h
@@ -496,15 +496,15 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
#define STM32_FLASH_OBR REG32(STM32_FLASH_REGS_BASE + 0x1c)
#define STM32_FLASH_WRPR REG32(STM32_FLASH_REGS_BASE + 0x20)
-#define STM32_OPTB_BASE 0x1FF80000
-
-#define STM32_OPTB_RDP_OFF 0x00
-#define STM32_OPTB_USER_OFF 0x04
-#define STM32_OPTB_WRP01 0x08
-#define STM32_OPTB_WRP_OFF(n) (0x08 + (n&1) + (n&2) * 2)
-#define STM32_OPTB_WRP23 0x0c
-
-#define STM32_OPTB_COMPL_SHIFT 16
+#define STM32_OPTB_BASE 0x1ff80000
+#define STM32_OPTB_RDP 0x00
+#define STM32_OPTB_USER 0x04
+#define STM32_OPTB_WRP1L 0x08
+#define STM32_OPTB_WRP1H 0x0c
+#define STM32_OPTB_WRP2L 0x10
+#define STM32_OPTB_WRP2H 0x14
+#define STM32_OPTB_WRP3L 0x18
+#define STM32_OPTB_WRP3H 0x1c
#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
#define STM32_FLASH_REGS_BASE 0x40022000