Skip to content

Commit

Permalink
platform/witherspoon: Add slot names to table
Browse files Browse the repository at this point in the history
Add the other PCIe devices to the witherspoon slot tables. This provides
a fall back for systems without IOSLOT information in the HDAT. This is
mainly to allow DD1 systems to continue being useful.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Sep 15, 2017
1 parent dcd53cf commit 4fc76e5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 22 deletions.
10 changes: 10 additions & 0 deletions platforms/astbmc/astbmc.h
Expand Up @@ -41,6 +41,16 @@ struct slot_table_entry {
const struct slot_table_entry *children;
};

/*
* Helper to reduce the noise in the PHB table
*/
#define ST_PHB_ENTRY(chip_id, phb_id, child_table) \
{ \
.etype = st_phb, \
.location = ST_LOC_PHB(chip_id, phb_id), \
.children = child_table \
}

extern const struct bmc_platform astbmc_ami;
extern const struct bmc_platform astbmc_openbmc;

Expand Down
80 changes: 58 additions & 22 deletions platforms/astbmc/witherspoon.c
Expand Up @@ -30,6 +30,42 @@

#include "astbmc.h"

static const struct slot_table_entry witherspoon_slot1[] = {
{
.etype = st_pluggable_slot,
.location = ST_LOC_DEVFN(0,0),
.name = "SLOT0"
},
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_slot2_shared[] = {
{
.etype = st_pluggable_slot,
.location = ST_LOC_DEVFN(0,0),
.name = "SLOT1"
},
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_slot3[] = {
{
.etype = st_pluggable_slot,
.location = ST_LOC_DEVFN(0,0),
.name = "SLOT2"
},
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_slot4[] = {
{
.etype = st_pluggable_slot,
.location = ST_LOC_DEVFN(0,0),
.name = "SLOT3"
},
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_gpu0[] = {
{
.etype = st_pluggable_slot,
Expand Down Expand Up @@ -146,7 +182,7 @@ static const struct slot_table_entry witherspoon_plx1_up[] = {
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_phb0_4_slot[] = {
static const struct slot_table_entry witherspoon_plx0_phb[] = {
{
.etype = st_builtin_dev,
.location = ST_LOC_DEVFN(0,0),
Expand All @@ -155,7 +191,7 @@ static const struct slot_table_entry witherspoon_phb0_4_slot[] = {
{ .etype = st_end },
};

static const struct slot_table_entry witherspoon_phb8_5_slot[] = {
static const struct slot_table_entry witherspoon_plx1_phb[] = {
{
.etype = st_builtin_dev,
.location = ST_LOC_DEVFN(0,0),
Expand Down Expand Up @@ -202,27 +238,27 @@ static const struct slot_table_entry witherspoon_npu8_slots[] = {
{ .etype = st_end },
};

/*
* Slot numbering:
*
* slot 1 - x4 slot
* slot 2 - shared slot, 8x to each chip's PHB3
* slot 3 - 16x \w CAPI, second chip
* slot 4 - 16x \w CAPI, first chip
*/

static const struct slot_table_entry witherspoon_phb_table[] = {
{
.etype = st_phb,
.location = ST_LOC_PHB(0,4),
.children = witherspoon_phb0_4_slot,
},
{
.etype = st_phb,
.location = ST_LOC_PHB(0,7),
.children = witherspoon_npu0_slots,
},
{
.etype = st_phb,
.location = ST_LOC_PHB(8,5),
.children = witherspoon_phb8_5_slot,
},
{
.etype = st_phb,
.location = ST_LOC_PHB(8,8),
.children = witherspoon_npu8_slots,
},
ST_PHB_ENTRY(0, 0, witherspoon_slot4),
ST_PHB_ENTRY(0, 3, witherspoon_slot2_shared),
ST_PHB_ENTRY(0, 4, witherspoon_plx0_phb),
ST_PHB_ENTRY(0, 7, witherspoon_npu0_slots),

ST_PHB_ENTRY(8, 0, witherspoon_slot3),
ST_PHB_ENTRY(8, 3, witherspoon_slot2_shared),
ST_PHB_ENTRY(8, 4, witherspoon_slot1),
ST_PHB_ENTRY(8, 5, witherspoon_plx1_phb),
ST_PHB_ENTRY(8, 8, witherspoon_npu8_slots),

{ .etype = st_end },
};

Expand Down

0 comments on commit 4fc76e5

Please sign in to comment.