Refactor bootloader_jump() implementations (#15450)
				
					
				
			* Refactor `bootloader_jump()` implementations * Fix tests? * Rename `atmel-samba` to `md-boot`
This commit is contained in:
		
							parent
							
								
									cffe143ca2
								
							
						
					
					
						commit
						6bc870d899
					
				
					 32 changed files with 701 additions and 493 deletions
				
			
		| 
						 | 
				
			
			@ -19,7 +19,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
#define _ARM_ATSAM_PROTOCOL_H_
 | 
			
		||||
 | 
			
		||||
#include "samd51j18a.h"
 | 
			
		||||
#include "md_bootloader.h"
 | 
			
		||||
 | 
			
		||||
#include "timer.h"
 | 
			
		||||
#include "d51_util.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,24 +0,0 @@
 | 
			
		|||
#ifndef _MD_BOOTLOADER_H_
 | 
			
		||||
#define _MD_BOOTLOADER_H_
 | 
			
		||||
 | 
			
		||||
extern uint32_t _srom;
 | 
			
		||||
extern uint32_t _lrom;
 | 
			
		||||
extern uint32_t _erom;
 | 
			
		||||
 | 
			
		||||
#define BOOTLOADER_SERIAL_MAX_SIZE 20  // DO NOT MODIFY!
 | 
			
		||||
 | 
			
		||||
#ifdef KEYBOARD_massdrop_ctrl
 | 
			
		||||
// WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support
 | 
			
		||||
extern uint32_t _eram;
 | 
			
		||||
#    define BOOTLOADER_MAGIC 0x3B9ACA00
 | 
			
		||||
#    define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef MD_BOOTLOADER
 | 
			
		||||
 | 
			
		||||
#    define MCU_HZ 48000000
 | 
			
		||||
#    define I2C_HZ 0  // Not used
 | 
			
		||||
 | 
			
		||||
#endif  // MD_BOOTLOADER
 | 
			
		||||
 | 
			
		||||
#endif  //_MD_BOOTLOADER_H_
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +28,6 @@
 | 
			
		|||
 */
 | 
			
		||||
 | 
			
		||||
#include "samd51.h"
 | 
			
		||||
#include "md_bootloader.h"
 | 
			
		||||
 | 
			
		||||
/* Initialize segments */
 | 
			
		||||
extern uint32_t _sfixed;
 | 
			
		||||
| 
						 | 
				
			
			@ -496,6 +495,11 @@ __attribute__((section(".vectors"))) const DeviceVectors exception_table = {
 | 
			
		|||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support
 | 
			
		||||
extern uint32_t _eram;
 | 
			
		||||
#define BOOTLOADER_MAGIC 0x3B9ACA00
 | 
			
		||||
#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \brief This is the code that gets called on processor reset.
 | 
			
		||||
 * To initialize the device, and call the main() routine.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,7 +51,8 @@
 | 
			
		|||
#include "udi_device_conf.h"
 | 
			
		||||
#include "udi.h"
 | 
			
		||||
#include "udc.h"
 | 
			
		||||
#include "md_bootloader.h"
 | 
			
		||||
 | 
			
		||||
#define BOOTLOADER_SERIAL_MAX_SIZE 20  // DO NOT MODIFY!
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \ingroup udc_group
 | 
			
		||||
| 
						 | 
				
			
			@ -122,6 +123,8 @@ static uint8_t udc_string_product_name[] = USB_DEVICE_PRODUCT_NAME;
 | 
			
		|||
#    define USB_DEVICE_SERIAL_NAME_SIZE 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern uint32_t _srom;
 | 
			
		||||
 | 
			
		||||
uint8_t     usb_device_serial_name_size = 0;
 | 
			
		||||
#if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL
 | 
			
		||||
uint8_t     bootloader_serial_number[BOOTLOADER_SERIAL_MAX_SIZE + 1] = "";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue