AP_Bootloader: use new check_limit_flash_1M()
use common function
This commit is contained in:
parent
b6e7236d3c
commit
8957152b80
@ -29,12 +29,12 @@ const mcu_des_t mcu_descriptions[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mcu_rev_t silicon_revs[] = {
|
const mcu_rev_t silicon_revs[] = {
|
||||||
{MCU_REV_STM32F4_REV_3, '3', false}, /* Revision 3 */
|
{MCU_REV_STM32F4_REV_3, '3'}, /* Revision 3 */
|
||||||
|
|
||||||
{MCU_REV_STM32F4_REV_A, 'A', true}, /* Revision A */
|
{MCU_REV_STM32F4_REV_A, 'A'}, /* Revision A */
|
||||||
{MCU_REV_STM32F4_REV_Z, 'Z', true}, /* Revision Z */
|
{MCU_REV_STM32F4_REV_Z, 'Z'}, /* Revision Z */
|
||||||
{MCU_REV_STM32F4_REV_Y, 'Y', true}, /* Revision Y */
|
{MCU_REV_STM32F4_REV_Y, 'Y'}, /* Revision Y */
|
||||||
{MCU_REV_STM32F4_REV_1, '1', true}, /* Revision 1 */
|
{MCU_REV_STM32F4_REV_1, '1'}, /* Revision 1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STM32F4
|
#endif // STM32F4
|
||||||
|
@ -13,10 +13,10 @@ mcu_des_t mcu_descriptions[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mcu_rev_t silicon_revs[] = {
|
const mcu_rev_t silicon_revs[] = {
|
||||||
{0x1001, 'Z', false},
|
{0x1001, 'Z'},
|
||||||
{0x1003, 'Y', false},
|
{0x1003, 'Y'},
|
||||||
{0x2001, 'X', false},
|
{0x2001, 'X'},
|
||||||
{0x2003, 'V', false},
|
{0x2003, 'V'},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STM32H7
|
#endif // STM32H7
|
||||||
|
@ -274,24 +274,6 @@ uint32_t get_mcu_desc(uint32_t max, uint8_t *revstr)
|
|||||||
return strp - revstr;
|
return strp - revstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
see if we should limit flash to 1M on devices with older revisions
|
|
||||||
*/
|
|
||||||
bool check_limit_flash_1M(void)
|
|
||||||
{
|
|
||||||
#ifdef STM32F427xx
|
|
||||||
uint32_t idcode = (*(uint32_t *)DBGMCU_BASE);
|
|
||||||
uint16_t revid = ((idcode & REVID_MASK) >> 16);
|
|
||||||
|
|
||||||
for (int i = 0; i < ARRAY_SIZE(silicon_revs); i++) {
|
|
||||||
if (silicon_revs[i].revid == revid) {
|
|
||||||
return silicon_revs[i].limit_flash_size_1M;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void led_on(unsigned led)
|
void led_on(unsigned led)
|
||||||
{
|
{
|
||||||
#ifdef HAL_GPIO_PIN_LED_BOOTLOADER
|
#ifdef HAL_GPIO_PIN_LED_BOOTLOADER
|
||||||
|
@ -36,7 +36,6 @@ bool flash_write_buffer(uint32_t address, const uint32_t *v, uint8_t nwords);
|
|||||||
|
|
||||||
uint32_t get_mcu_id(void);
|
uint32_t get_mcu_id(void);
|
||||||
uint32_t get_mcu_desc(uint32_t len, uint8_t *buf);
|
uint32_t get_mcu_desc(uint32_t len, uint8_t *buf);
|
||||||
bool check_limit_flash_1M(void);
|
|
||||||
|
|
||||||
uint32_t board_get_rtc_signature(void);
|
uint32_t board_get_rtc_signature(void);
|
||||||
void board_set_rtc_signature(uint32_t sig);
|
void board_set_rtc_signature(uint32_t sig);
|
||||||
@ -62,5 +61,4 @@ typedef struct mcu_des_t {
|
|||||||
typedef struct mcu_rev_t {
|
typedef struct mcu_rev_t {
|
||||||
uint16_t revid;
|
uint16_t revid;
|
||||||
char rev;
|
char rev;
|
||||||
bool limit_flash_size_1M;
|
|
||||||
} mcu_rev_t;
|
} mcu_rev_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user