summaryrefslogtreecommitdiffstats
path: root/arch/x86/mach-i386/include/mach/barebox.lds.h
blob: 50f17340e40ae487f0137ca2b4448e5eb0afbff8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* SPDX-FileCopyrightText: 2009 Juergen Beisert, Pengutronix */

/**
 * @file
 * @brief Adapt linker script content in accordance to Kconfig settings
 */

/**
 * Area in the MBR of the barebox basic boot code. This offset must be in
 * accordance to the 'indirect_sector_lba' label.
 */
#define PATCH_AREA 400

/**
 * Offset where to store the boot drive number (BIOS number, 1 byte)
 */
#define PATCH_AREA_BOOT_DEV 16

/**
 * Offset where to store information about the persistent environment storage
 * It points to an LBA number (8 bytes) and defines the first sector of this
 * storage on disk.
 */
#define PATCH_AREA_PERS_START 20

/**
 * Offset where to store information about the persistent environment storage
 * It points to a short number (2 bytes) and defines the sector count of this
 * storage on disk.
 */
#define PATCH_AREA_PERS_SIZE 28

/**
 * Offset where to store information about the persistent environment storage
 * drive number (BIOS number, 1 byte)
 */
#define PATCH_AREA_PERS_DRIVE 30

/**
 * Mark the persistent environment as not used
 */
#define PATCH_AREA_PERS_SIZE_UNUSED 0x000

/**
 * Mark a DAPS as unused/invalid
 */
#define MARK_DAPS_INVALID 0x0000

/**
 * Offset of the partition table in an MBR
 */
#define OFFSET_OF_PARTITION_TABLE 446

/**
 * Offset of the signature in an MBR
 */
#define OFFSET_OF_SIGNATURE 510

/**
 * Area where to store indirect sector to loop through. Keep this value
 * in accordance to the 'indirect_area' label. Note: .
 *
 * @attention These addresses are real mode ones (seg:offset)
 */
#define INDIRECT_AREA 0x7A00
#define INDIRECT_SEGMENT 0x0000

/**
 * Area where to load sectors from disk to. They should start after the
 * MBR area and must be in accordance to the offset of the '.bootstrapping'
 * section in the linker file.
 *
 * @attention The address must be a multiple of 512.
 */
#define LOAD_AREA 0x7e00
#define LOAD_SEGMENT 0x0000

/**
 * Size of one sector.
 */
#define SECTOR_SIZE 512