4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _PICLDEVTREE_H
28 #define _PICLDEVTREE_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 #define DEVICE_TYPE_BLOCK "block"
39 #define DEVICE_TYPE_BYTE "byte"
40 #define DEVICE_TYPE_DISK "disk"
41 #define DEVICE_TYPE_SES "ses"
42 #define DEVICE_TYPE_FP "fp"
44 #define HASH_TABLE_SIZE 64
45 #define HASH_INDEX(s, x) ((int)((x) & ((s) - 1)))
47 #define MAX_NAMEVAL_SIZE 80
48 #define CONFFILE_LINELEN_MAX 1024
50 #define KSTAT_STATE_BEGIN "state_begin"
51 #define KSTAT_CPU_INFO "cpu_info"
52 #define ASR_DISABLED "disabled"
53 #define ASR_FAILED "failed"
55 #define DEVTREE_CONFFILE_NAME "picldevtree.conf"
56 #define ASRTREE_CONFFILE_NAME "picl_asr.conf"
57 #define CONFFILE_COMMENT_CHAR '#'
62 #define FFB_MANUF_BUFSIZE 256
63 #define SUPPORTED_NUM_CELL_SIZE 2 /* #size-cells */
64 #define MAX_STATE_SIZE 32
67 * Hash table structure
69 typedef struct hash_elem
{
71 struct hash_elem
*next
;
80 * name to class map entries in the conf file
82 typedef struct conf_entries
{
85 struct conf_entries
*next
;
89 * name to address to class map for asr2
91 typedef struct asr_conf_entries
{
97 struct asr_conf_entries
*next
;
101 * type, name, val property triplet for asr2
103 typedef struct asr_prop_triplet
{
107 } asr_prop_triplet_t
;
110 * built-in name to class mapping table
113 char name
[MAX_NAMEVAL_SIZE
];
114 char piclclass
[PICL_CLASSNAMELEN_MAX
];
118 * property name to type mapping table
121 char pname
[PICL_PROPNAMELEN_MAX
];
125 /* known values for manufacturer's JED code */
126 #define MANF_BROOKTREE 214
127 #define MANF_MITSUBISHI 28
128 #define FFB_NAME "ffb"
129 #define FFBIOC ('F' << 8)
130 #define FFB_SYS_INFO (FFBIOC| 80)
132 /* FFB strap reg union */
137 uint32_t major_rev
:2;
138 uint32_t board_rev
:2;
139 uint32_t board_mem
:1;
143 uint32_t ffb_strap_bits
;
146 /* FFB mnufacturer union */
149 uint32_t version
:4; /* version of part number */
150 uint32_t partno
:16; /* part number */
151 uint32_t manf
:11; /* manufacturer's JED code */
152 uint32_t one
:1; /* always set to '1' */
157 typedef struct ffb_sys_info
{
158 strap_un_t ffb_strap_bits
; /* ffb_strapping register */
159 manuf_t fbc_version
; /* revision of FBC chip */
160 manuf_t dac_version
; /* revision of DAC chip */
161 manuf_t fbram_version
; /* revision of FBRAMs chip */
162 uint32_t flags
; /* miscellaneous flags */
163 uint32_t afb_nfloats
; /* no. of Float asics in AFB */
164 uint32_t pad
[58]; /* padding for AFB chips & misc. */
167 typedef struct memspecs
{
174 * UnitAddress property related constants and data structures
177 #define DEFAULT_ADDRESS_CELLS 2
178 #define MAX_UNIT_ADDRESS_LEN 256
180 typedef int unitaddr_func_t(char *, int, uint32_t *, uint_t
);
183 char *class; /* class name */
184 unitaddr_func_t
*func
; /* function to encode unit address */
185 int addrcellcnt
; /* #addrcell expected, if non-zero */
192 #endif /* _PICLDEVTREE_H */