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

« back to all changes in this revision

Viewing changes to roms/skiboot/platforms/astbmc/firestone.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 2013-2014 IBM Corp.
 
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 firestone_phb0_0_slot[] = {
 
27
        {
 
28
                .etype = st_pluggable_slot,
 
29
                .location = ST_LOC_DEVFN(0,0),
 
30
                .name = "Slot5",
 
31
        },
 
32
        { .etype = st_end },
 
33
};
 
34
 
 
35
static const struct slot_table_entry firestone_phb0_1_slot[] = {
 
36
        {
 
37
                .etype = st_pluggable_slot,
 
38
                .location = ST_LOC_DEVFN(0,0),
 
39
                .name = "Slot4",
 
40
        },
 
41
        { .etype = st_end },
 
42
};
 
43
 
 
44
static const struct slot_table_entry firestone_phb8_0_slot[] = {
 
45
        {
 
46
                .etype = st_pluggable_slot,
 
47
                .location = ST_LOC_DEVFN(0,0),
 
48
                .name = "Slot2",
 
49
        },
 
50
        { .etype = st_end },
 
51
};
 
52
 
 
53
static const struct slot_table_entry firestone_plx_slots[] = {
 
54
        {
 
55
                .etype = st_pluggable_slot,
 
56
                .location = ST_LOC_DEVFN(1,0),
 
57
                .name = "Slot3",
 
58
        },
 
59
        {
 
60
                .etype = st_builtin_dev,
 
61
                .location = ST_LOC_DEVFN(9,0),
 
62
                .name = "Backplane USB",
 
63
        },
 
64
        {
 
65
                .etype = st_builtin_dev,
 
66
                .location = ST_LOC_DEVFN(0xa,0),
 
67
                .name = "Backplane SATA",
 
68
        },
 
69
        {
 
70
                .etype = st_builtin_dev,
 
71
                .location = ST_LOC_DEVFN(0xb,0),
 
72
                .name = "Backplane BMC",
 
73
        },
 
74
        { .etype = st_end },
 
75
};
 
76
 
 
77
static const struct slot_table_entry firestone_plx_up[] = {
 
78
        {
 
79
                .etype = st_builtin_dev,
 
80
                .location = ST_LOC_DEVFN(0,0),
 
81
                .children = firestone_plx_slots,
 
82
        },
 
83
        { .etype = st_end },
 
84
};
 
85
 
 
86
static const struct slot_table_entry firestone_phb8_1_slot[] = {
 
87
        {
 
88
                .etype = st_builtin_dev,
 
89
                .location = ST_LOC_DEVFN(0,0),
 
90
                .name = "Backplane PLX",
 
91
                .children = firestone_plx_up,
 
92
        },
 
93
        { .etype = st_end },
 
94
};
 
95
 
 
96
static const struct slot_table_entry firestone_phb8_2_slot[] = {
 
97
        {
 
98
                .etype = st_pluggable_slot,
 
99
                .location = ST_LOC_DEVFN(0,0),
 
100
                .name = "Slot1",
 
101
        },
 
102
        { .etype = st_end },
 
103
};
 
104
 
 
105
static const struct slot_table_entry firestone_phb_table[] = {
 
106
        {
 
107
                .etype = st_phb,
 
108
                .location = ST_LOC_PHB(0,0),
 
109
                .children = firestone_phb0_0_slot,
 
110
        },
 
111
        {
 
112
                .etype = st_phb,
 
113
                .location = ST_LOC_PHB(0,1),
 
114
                .children = firestone_phb0_1_slot,
 
115
        },
 
116
        {
 
117
                .etype = st_phb,
 
118
                .location = ST_LOC_PHB(8,0),
 
119
                .children = firestone_phb8_0_slot,
 
120
        },
 
121
        {
 
122
                .etype = st_phb,
 
123
                .location = ST_LOC_PHB(8,1),
 
124
                .children = firestone_phb8_1_slot,
 
125
        },
 
126
        {
 
127
                .etype = st_phb,
 
128
                .location = ST_LOC_PHB(8,2),
 
129
                .children = firestone_phb8_2_slot,
 
130
        },
 
131
        { .etype = st_end },
 
132
};
 
133
 
 
134
static bool firestone_probe(void)
 
135
{
 
136
        if (!dt_node_is_compatible(dt_root, "ibm,firestone"))
 
137
                return false;
 
138
 
 
139
        /* Lot of common early inits here */
 
140
        astbmc_early_init();
 
141
        slot_table_init(firestone_phb_table);
 
142
 
 
143
        return true;
 
144
}
 
145
 
 
146
 
 
147
DECLARE_PLATFORM(firestone) = {
 
148
        .name                   = "Firestone",
 
149
        .probe                  = firestone_probe,
 
150
        .init                   = astbmc_init,
 
151
        .pci_get_slot_info      = slot_table_get_slot_info,
 
152
        .external_irq           = astbmc_ext_irq_serirq_cpld,
 
153
        .cec_power_down         = astbmc_ipmi_power_down,
 
154
        .cec_reboot             = astbmc_ipmi_reboot,
 
155
        .elog_commit            = ipmi_elog_commit,
 
156
        .start_preload_resource = flash_start_preload_resource,
 
157
        .resource_loaded        = flash_resource_loaded,
 
158
        .exit                   = ipmi_wdt_final_reset,
 
159
        .terminate              = ipmi_terminate,
 
160
};