1 /* SPDX-License-Identifier: GPL-2.0+
2  *
3  * NSIH (Nexell System Information Header) for FriendlyArm nanopi2 board
4  *
5  * The NSIH (first 512 Bytes of u-boot.bin) is necessary for the
6  * 2nd-Bootloader to get information like load address of U-Boot.
7  *
8  * 0x400 must be added to CONFIG_SYS_TEXT_BASE to have the actual load and
9  * start address because 2nd-Bootloader loads with an offset of 0x400
10  * (NSIH + 0x200 bytes are not loaded into RAM).
11  *
12  * It has been tested / is working with the following 2nd-Bootloader:
13  * "BL1 by Nexell V1.0.0-gd551e13 [Built on 2018-01-25 16:58:29]"
14  *
15  * (C) Copyright 2020 Stefan Bosch <stefan_b@posteo.net>
16  */
17 
18 #ifndef __BOOT0_H
19 #define __BOOT0_H
20 
21 	ARM_VECTORS
22 	.space	0x30
23 	.word	(_end - _start) + 20 * 1024	/* 0x50: load size
24 						 *       (bin + 20k for DTB) */
25 	.space	0x4
26 	.word	CONFIG_SYS_TEXT_BASE + 0x400	/* 0x58: load address */
27 	.word	0x00000000
28 	.word	CONFIG_SYS_TEXT_BASE + 0x400	/* 0x60: start address */
29 	.space	0x198
30 	.byte	'N'				/* 0x1FC: "NSIH" signature */
31 	.byte	'S'
32 	.byte	'I'
33 	.byte	'H'
34 
35 	/* The NSIH + 0x200 bytes are omitted by the 2nd-Bootloader */
36 	.space	0x200
37 _start:
38 	ARM_VECTORS
39 
40 #endif /* __BOOT0_H */
41