~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/skiboot/platforms/astbmc/barreleye.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2016 Ingrasys.
 
2
 *
 
3
 * Licensed under the Apache License, Version 2.0 (the "License");
 
4
 * you may not use this file except in compliance with the License.
 
5
 * You may obtain a copy of the License at
 
6
 *
 
7
 *      http://www.apache.org/licenses/LICENSE-2.0
 
8
 *
 
9
 * Unless required by applicable law or agreed to in writing, software
 
10
 * distributed under the License is distributed on an "AS IS" BASIS,
 
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 
12
 * implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
 
 
18
#include <skiboot.h>
 
19
#include <device.h>
 
20
#include <console.h>
 
21
#include <chip.h>
 
22
#include <ipmi.h>
 
23
 
 
24
#include "astbmc.h"
 
25
 
 
26
static const struct slot_table_entry barreleye_phb0_0_slot[] = {
 
27
        {
 
28
                .etype = st_pluggable_slot,
 
29
                .location = ST_LOC_DEVFN(0,0),
 
30
                .name = "Slot1",
 
31
        },
 
32
        { .etype = st_end },
 
33
};
 
34
 
 
35
static const struct slot_table_entry barreleye_plx_slots[] = {
 
36
        {
 
37
                .etype = st_builtin_dev,
 
38
                .location = ST_LOC_DEVFN(1,0),
 
39
                .name = "IO Board SATA",
 
40
        },
 
41
        {
 
42
                .etype = st_builtin_dev,
 
43
                .location = ST_LOC_DEVFN(2,0),
 
44
                .name = "IO Board USB",
 
45
        },
 
46
        {
 
47
                .etype = st_builtin_dev,
 
48
                .location = ST_LOC_DEVFN(3,0),
 
49
                .name = "IO Board BMC",
 
50
        },
 
51
        {
 
52
                .etype = st_builtin_dev,
 
53
                .location = ST_LOC_DEVFN(4,0),
 
54
                .name = "IO Board NIC",
 
55
        },
 
56
        { .etype = st_end },
 
57
};
 
58
 
 
59
static const struct slot_table_entry barreleye_plx_up[] = {
 
60
        {
 
61
                .etype = st_builtin_dev,
 
62
                .location = ST_LOC_DEVFN(0,0),
 
63
                .children = barreleye_plx_slots,
 
64
        },
 
65
        { .etype = st_end },
 
66
};
 
67
 
 
68
static const struct slot_table_entry barreleye_phb0_1_slot[] = {
 
69
        {
 
70
                .etype = st_builtin_dev,
 
71
                .location = ST_LOC_DEVFN(0,0),
 
72
                .name = "PLX Switch",
 
73
                .children = barreleye_plx_up,
 
74
        },
 
75
        { .etype = st_end },
 
76
};
 
77
 
 
78
static const struct slot_table_entry barreleye_phb0_2_slot[] = {
 
79
        {
 
80
                .etype = st_pluggable_slot,
 
81
                .location = ST_LOC_DEVFN(0,0),
 
82
                .name = "Network Mezz",
 
83
        },
 
84
        { .etype = st_end },
 
85
};
 
86
 
 
87
static const struct slot_table_entry barreleye_phb8_0_slot[] = {
 
88
        {
 
89
                .etype = st_pluggable_slot,
 
90
                .location = ST_LOC_DEVFN(0,0),
 
91
                .name = "Storage Mezz",
 
92
        },
 
93
        { .etype = st_end },
 
94
};
 
95
 
 
96
static const struct slot_table_entry barreleye_phb8_1_slot[] = {
 
97
        {
 
98
                .etype = st_pluggable_slot,
 
99
                .location = ST_LOC_DEVFN(0,0),
 
100
                .name = "Slot3",
 
101
        },
 
102
        { .etype = st_end },
 
103
};
 
104
 
 
105
static const struct slot_table_entry barreleye_phb8_2_slot[] = {
 
106
        {
 
107
                .etype = st_pluggable_slot,
 
108
                .location = ST_LOC_DEVFN(0,0),
 
109
                .name = "Slot2",
 
110
        },
 
111
        { .etype = st_end },
 
112
};
 
113
 
 
114
static const struct slot_table_entry barreleye_phb_table[] = {
 
115
        {
 
116
                .etype = st_phb,
 
117
                .location = ST_LOC_PHB(0,0),
 
118
                .children = barreleye_phb0_0_slot,
 
119
        },
 
120
        {
 
121
                .etype = st_phb,
 
122
                .location = ST_LOC_PHB(0,1),
 
123
                .children = barreleye_phb0_1_slot,
 
124
        },
 
125
        {
 
126
                .etype = st_phb,
 
127
                .location = ST_LOC_PHB(0,2),
 
128
                .children = barreleye_phb0_2_slot,
 
129
        },
 
130
        {
 
131
                .etype = st_phb,
 
132
                .location = ST_LOC_PHB(8,0),
 
133
                .children = barreleye_phb8_0_slot,
 
134
        },
 
135
        {
 
136
                .etype = st_phb,
 
137
                .location = ST_LOC_PHB(8,1),
 
138
                .children = barreleye_phb8_1_slot,
 
139
        },
 
140
        {
 
141
                .etype = st_phb,
 
142
                .location = ST_LOC_PHB(8,2),
 
143
                .children = barreleye_phb8_2_slot,
 
144
        },
 
145
        { .etype = st_end },
 
146
};
 
147
 
 
148
static bool barreleye_probe(void)
 
149
{
 
150
        if (!dt_node_is_compatible(dt_root, "ingrasys,barreleye"))
 
151
                return false;
 
152
 
 
153
        /* Lot of common early inits here */
 
154
        astbmc_early_init();
 
155
        slot_table_init(barreleye_phb_table);
 
156
 
 
157
        return true;
 
158
}
 
159
 
 
160
 
 
161
DECLARE_PLATFORM(barreleye) = {
 
162
        .name                   = "Barreleye",
 
163
        .probe                  = barreleye_probe,
 
164
        .init                   = astbmc_init,
 
165
        .pci_get_slot_info      = slot_table_get_slot_info,
 
166
        .external_irq           = astbmc_ext_irq_serirq_cpld,
 
167
        .cec_power_down         = astbmc_ipmi_power_down,
 
168
        .cec_reboot             = astbmc_ipmi_reboot,
 
169
        .elog_commit            = ipmi_elog_commit,
 
170
        .start_preload_resource = flash_start_preload_resource,
 
171
        .resource_loaded        = flash_resource_loaded,
 
172
        .exit                   = ipmi_wdt_final_reset,
 
173
        .terminate              = ipmi_terminate,
 
174
};