summaryrefslogtreecommitdiffstats
path: root/sys/arm/include/atags.h
blob: 3665890d0057521c59b7e0d204453cc91f473f89 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*-
 * Copyright (c) 2012 M. Warner Losh.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD$
 */

#ifndef	__MACHINE_ATAGS_H__
#define __MACHINE_ATAGS_H__

/*
 * Linux boot ABI compatable ATAG definitions.  All these structures
 * assume tight packing, but since they are all uint32_t's, I've not
 * bothered to do the usual alignment dance.
 */

#define	LBABI_MAX_COMMAND_LINE  1024

struct arm_lbabi_header
{
	uint32_t	size;		/* Size of this node, including header */
	uint32_t	tag;		/* Node type */
};

#define	ATAG_NONE       0x00000000	/* End of atags list */
#define	ATAG_CORE	0x54410001	/* List must start with ATAG_CORE */
#define	ATAG_MEM	0x54410002	/* Multiple ATAG_MEM nodes possible */
#define	ATAG_VIDEOTEXT	0x54410003	/* Video parameters */
#define	ATAG_RAMDISK	0x54410004	/* Describes the ramdisk parameters */
#define	ATAG_INITRD	0x54410005	/* Deprecated ramdisk -- used va not pa */
#define	ATAG_INITRD2	0x54420005	/* compressed ramdisk image */
#define	ATAG_SERIAL	0x54410006	/* 64-bits of serial number */
#define	ATAG_REVISION	0x54410007	/* Board revision */
#define	ATAG_VIDEOLFB	0x54410008	/* vesafb framebuffer */
#define	ATAG_CMDLINE	0x54410009	/* Command line */

/*
 * ATAG_CORE data
 */
struct arm_lbabi_core
{
	uint32_t flags;			/* bit 0 == read-only */
	uint32_t pagesize;
	uint32_t rootdev;
};

/*
 * ATAG_MEM data -- Can be more than one to describe different
 * banks.
 */
struct arm_lbabi_mem32
{
	uint32_t size;
	uint32_t start;			/* start of physical memory */
};

/*
 * ATAG_INITRD2 - Compressed ramdisk image details
 */
struct arm_lbabi_initrd
{
	uint32_t start;			/* pa of start */
	uint32_t size;			/* How big the ram disk is */
};

/*
 * ATAG_SERIAL - serial number
 */
struct arm_lbabi_serial_number
{
	uint32_t low;
	uint32_t high;
};

/*
 * ATAG_REVISION - board revision
 */
struct arm_lbabi_revision
{
	uint32_t rev;
};

/*
 * ATAG_CMDLINE - Command line from uboot
 */
struct arm_lbabi_command_line
{
	char command[1];		/* Minimum command length */
};

struct arm_lbabi_tag
{
	struct arm_lbabi_header tag_hdr;
	union {
		struct arm_lbabi_core tag_core;
		struct arm_lbabi_mem32 tag_mem;
		struct arm_lbabi_initrd tag_initrd;
		struct arm_lbabi_serial_number tag_sn;
		struct arm_lbabi_revision tag_rev;
		struct arm_lbabi_command_line tag_cmd;
	} u;
};

#define	ATAG_TAG(a)  (a)->tag_hdr.tag
#define ATAG_SIZE(a) (a)->tag_hdr.size
#define ATAG_NEXT(a) (struct arm_lbabi_tag *)((char *)(a) + ATAG_SIZE(a))

#endif /* __MACHINE_ATAGS_H__ */
OpenPOWER on IntegriCloud