Skip to content

Commit c7cda07

Browse files
committed
ccmp1: define 'is_boot_from_usb' implementation
This macro guarantees that the 'bootcmd_mfg' will be run instead of 'bootcmd' when the device boots via USB. https://onedigi.atlassian.net/browse/DUB-1039 Signed-off-by: Gonzalo Ruiz <[email protected]>
1 parent 48315a4 commit c7cda07

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

arch/arm/mach-stm32mp/include/mach/stm32.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,9 @@ enum forced_boot_mode {
169169
#define BSEC_OTP_BOARD 60
170170
#endif
171171

172+
bool is_usb_boot(void);
173+
#define is_boot_from_usb is_usb_boot
174+
#define disconnect_from_pc()
175+
172176
#endif /* __ASSEMBLY__ */
173177
#endif /* _MACH_STM32_H_ */

board/digi/ccmp1/ccmp1.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,16 @@ void print_bootinfo(void)
228228
break;
229229
}
230230
}
231+
232+
bool is_usb_boot(void)
233+
{
234+
u32 bootmode = get_bootmode();
235+
236+
switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
237+
case BOOT_SERIAL_USB:
238+
case BOOT_SERIAL_USB_OTG:
239+
return true;
240+
default:
241+
return false;
242+
}
243+
}

board/digi/ccmp1/ccmp1.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ void fdt_fixup_ccmp1(void *fdt);
1313
void som_default_environment(void);
1414
void print_som_info(void);
1515
void print_bootinfo(void);
16+
bool is_usb_boot(void);
1617

1718
#endif /* CCMP1_H */

0 commit comments

Comments
 (0)