14
14
15
15
#include "bootloader.h"
16
16
#include "bootloader_version.h"
17
- #include "leds.h"
18
17
#include "mpu_regions.h"
19
18
20
19
#include <driver_init.h>
31
30
#include <ui/fonts/arial_fonts.h>
32
31
#include <ui/oled/oled.h>
33
32
#include <ui/ugui/ugui.h>
34
- #if PLATFORM_BITBOXBASE == 1
35
- #include <usart/usart.h>
36
- #include <usart/usart_frame.h>
37
- #elif PLATFORM_BITBOX02 == 1
38
33
#include <usb/usb.h>
39
34
#include <usb/usb_packet.h>
40
- #endif
41
35
#include <usb/usb_processing.h>
42
36
#include <util.h>
43
37
@@ -223,27 +217,6 @@ static const uint8_t _root_pubkeys[BOOT_NUM_ROOT_SIGNING_KEYS][BOOT_PUBKEY_LEN]
223
217
0x1b , 0xec , 0x2b , 0x99 , 0x40 , 0x61 , 0x3e , 0xef , 0xe7 , 0x9e , 0x6a , 0x2b , 0x10 , 0xbe , 0xda , 0xc2 ,
224
218
},
225
219
};
226
- #elif PRODUCT_BITBOX_BASE == 1
227
- static const uint8_t _root_pubkeys [BOOT_NUM_ROOT_SIGNING_KEYS ][BOOT_PUBKEY_LEN ] = { // order is important
228
- {
229
- 0x89 , 0x61 , 0xff , 0xaa , 0x89 , 0x9b , 0x9d , 0x2d , 0x71 , 0xee , 0x31 , 0x62 , 0xe2 , 0x01 , 0x20 , 0xbe ,
230
- 0x63 , 0x0a , 0xfb , 0x5d , 0xf3 , 0x5c , 0x99 , 0xbf , 0x10 , 0xa9 , 0x15 , 0xbf , 0x48 , 0xd2 , 0xc6 , 0xf6 ,
231
- 0xa0 , 0x83 , 0xbe , 0x8b , 0xb5 , 0x35 , 0xf7 , 0x69 , 0x67 , 0xc8 , 0x2a , 0xa5 , 0xdd , 0x5a , 0xe8 , 0x7e ,
232
- 0x3e , 0xe6 , 0xa0 , 0x4d , 0x87 , 0x9c , 0xba , 0x08 , 0x3a , 0x46 , 0x63 , 0x62 , 0xb7 , 0xc1 , 0x86 , 0x35 ,
233
- },
234
- {
235
- 0x3a , 0xb8 , 0x77 , 0x41 , 0x6e , 0x4e , 0x1d , 0xfc , 0xcb , 0x5c , 0xec , 0xdd , 0xf5 , 0xfb , 0x42 , 0x18 ,
236
- 0x51 , 0x1b , 0xe3 , 0x5e , 0x23 , 0x06 , 0x9e , 0x86 , 0x20 , 0x0c , 0x79 , 0x7e , 0xc7 , 0xc5 , 0xd7 , 0xe3 ,
237
- 0x04 , 0x1e , 0xc7 , 0x23 , 0xec , 0x1e , 0xae , 0xbe , 0xf2 , 0x22 , 0xad , 0x60 , 0xda , 0x93 , 0xea , 0xe7 ,
238
- 0xf0 , 0x60 , 0x48 , 0xd1 , 0x66 , 0x34 , 0xf9 , 0xf0 , 0xcb , 0xa9 , 0x7a , 0x26 , 0x50 , 0x2a , 0x01 , 0xd1 ,
239
- },
240
- {
241
- 0x03 , 0xc9 , 0xb2 , 0xd1 , 0xea , 0x13 , 0x6a , 0x0c , 0x5f , 0xe5 , 0x01 , 0x91 , 0x32 , 0xe6 , 0x57 , 0xf4 ,
242
- 0x2d , 0xfa , 0x75 , 0x8f , 0x74 , 0xb0 , 0xb3 , 0xe3 , 0x74 , 0x0e , 0x51 , 0xdc , 0x5f , 0x7f , 0xd6 , 0x0d ,
243
- 0xdb , 0x00 , 0x94 , 0x7a , 0xa3 , 0x2a , 0xff , 0x05 , 0x20 , 0xa9 , 0x66 , 0xfc , 0xe7 , 0xdd , 0x2a , 0x81 ,
244
- 0x8e , 0x6c , 0xd1 , 0x48 , 0xc3 , 0x54 , 0x8a , 0x9d , 0xfb , 0x6b , 0xdf , 0x61 , 0xd6 , 0xc4 , 0xf3 , 0xee ,
245
- },
246
- };
247
220
#else
248
221
#error "unknown product"
249
222
#endif
@@ -831,16 +804,12 @@ static void _api_reboot(void)
831
804
832
805
static size_t _api_screen_rotate (uint8_t * output )
833
806
{
834
- #if PLATFORM_BITBOX02 == 1
835
807
if (_loading_ready ) {
836
808
return _report_status (OP_STATUS_ERR_LOAD_FLAG , output );
837
809
}
838
810
screen_rotate ();
839
811
_render_default_screen ();
840
812
return _report_status (OP_STATUS_OK , output );
841
- #elif PLATFORM_BITBOXBASE == 1
842
- return _report_status (OP_STATUS_ERR_INVALID_CMD , output );
843
- #endif
844
813
}
845
814
846
815
static size_t _api_command (const uint8_t * input , uint8_t * output , const size_t max_out_len )
@@ -1026,15 +995,10 @@ void bootloader_jump(void)
1026
995
1027
996
if (shared_data .fields .auto_enter != sectrue_u8 ) {
1028
997
#ifdef BOOTLOADER_DEVDEVICE
1029
- #if PLATFORM_BITBOXBASE == 1
1030
- // We don't have touch on base dev bootloader yet
1031
- _binary_exec ();
1032
- #elif PLATFORM_BITBOX02 == 1
1033
998
if (!_devdevice_enter (_firmware_verified_jump (& bootdata , secfalse_u32 ))) {
1034
999
_binary_exec ();
1035
1000
/* no return */
1036
1001
}
1037
- #endif
1038
1002
#else
1039
1003
_firmware_verified_jump (& bootdata , sectrue_u32 ); // no return if firmware is valid
1040
1004
_render_message ("Firmware\ninvalid\n \nEntering bootloader" , 3000 );
@@ -1044,12 +1008,7 @@ void bootloader_jump(void)
1044
1008
// App not entered. Start USB API to receive boot commands
1045
1009
_compute_is_app_flash_empty ();
1046
1010
_render_default_screen ();
1047
- #if PLATFORM_BITBOX02 == 1
1048
1011
if (usb_start (_api_setup ) != ERR_NONE ) {
1049
1012
_render_message ("Failed to initialize USB" , 0 );
1050
1013
}
1051
- #elif PLATFORM_BITBOXBASE == 1
1052
- usart_start ();
1053
- _api_setup ();
1054
- #endif
1055
1014
}
0 commit comments