⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootvector.s

📁 采用ST20 CPU的机顶盒的烧写程序
💻 S
字号:
/*
 * Sample ST40 boot vector
 *
 * (C) STMicroelectronics 2003-2007. All rights reserved.
 *
 * This code is placed at the bottom of FLASH (0xa0000000).
 * It reads a bootstrap start address from BOOTSTRAP_PTR + (CPU_NUMBER * 0x28)
 * where BOOTSTRAP_PTR is the address of the bootstrap descriptors in the FLASH
 * layout.
 *
 * The STi5528 and STD1000 are special cases; the STi5528 due to it's ST20 boot
 * mechanism, and the STD1000 due to it's bootrom.
 */

#ifndef BOOTSTRAP_PTR
#if defined (__mb376__) || defined (__espresso__)
#define BOOTSTRAP_PTR 0x00000700
#elif defined(__mb548__)
#define BOOTSTRAP_PTR 0x01000300
#else
#define BOOTSTRAP_PTR 0x00000300
#endif
#endif /* !BOOTSTRAP_PTR */

#ifndef CPU_NUMBER
/* Default to CPU 0 (the master CPU). */
#define CPU_NUMBER    0
#endif

	.text
	.org 0

#if !defined(__mb548__)
	mov.l	bootstrap_ptr, r0
	mov.l	p2_mask, r1
#else /* On an STD1000 with it's bootrom */
	.word   0x0030 /* Size of code to copy to STD1000 SRAM in bytes */
	mov     #-1, r2
	shlr16  r2
        mov.w	bootstrap_ptr_0, r0
        and     r2, r0
        mov.w	bootstrap_ptr_1, r1
        and     r2, r1
        swap.w  r1, r1
        or      r1, r0
	mov.w	p2_mask, r1
	and     r2, r1
	swap.w  r1, r1
#endif
	mov.l	@r0, r0
        or      r1, r0
	jmp	@r0
	  nop

	.align 4
#if !defined(__mb548__)
bootstrap_ptr:	.long   (BOOTSTRAP_PTR + (CPU_NUMBER * 0x28)) | 0xa0000000
p2_mask:        .long   0xa0000000
#else /* On an STD1000 with it's bootrom */
                .word   0x0000
bootstrap_ptr_0:.word   ((BOOTSTRAP_PTR + (CPU_NUMBER * 0x28)) | 0xa0000000) & 0xFFFF
bootstrap_ptr_1:.word   (((BOOTSTRAP_PTR + (CPU_NUMBER * 0x28)) | 0xa0000000) & 0xFFFF0000) >> 16
p2_mask:        .word   0xa000
#endif
	.end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -