diff options
author | Daniel Axtens <dja@axtens.net> | 2015-11-16 15:57:36 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-18 11:30:44 +1100 |
commit | 0baf63f38757d356de3436ac0ab47511f98b8723 (patch) | |
tree | 46b0fa3cbfd410aab235cc36898de98427b45f63 /hdata | |
parent | 30b0074073fb419a0586c6da39852aa412869ed4 (diff) | |
download | skiboot-0baf63f38757d356de3436ac0ab47511f98b8723.zip skiboot-0baf63f38757d356de3436ac0ab47511f98b8723.tar.gz skiboot-0baf63f38757d356de3436ac0ab47511f98b8723.tar.bz2 |
Drop support for p5ioc2
p5ioc2 is used by approximately 2 machines in the world, and has never
ever been a supported configuration.
Not only is the code virtually unused and very tricky to test, but
keeping it around is making life unnecessarily difficult:
- It's more complexity to manage for things such as PCI slot support
- It's more code for static analysis to cover, which means more time
fixing bugs that affect no-one.
- It's bloating every single install of skiboot for no benefit.
- It's reducing coverage stats, which is sad.
Drop p5ioc2.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r-- | hdata/iohub.c | 214 | ||||
-rw-r--r-- | hdata/spira.h | 1 |
2 files changed, 0 insertions, 215 deletions
diff --git a/hdata/iohub.c b/hdata/iohub.c index 4fa256d..d599a05 100644 --- a/hdata/iohub.c +++ b/hdata/iohub.c @@ -22,7 +22,6 @@ #include <ccan/str/str.h> #include <ccan/array_size/array_size.h> #include <device.h> -#include <p5ioc2.h> #include <p7ioc.h> #include <vpd.h> #include <inttypes.h> @@ -379,213 +378,6 @@ static void io_add_p8_cec_vpd(const struct HDIF_common_hdr *sp_iohubs) io_get_lx_info(kwvpd, kwvpd_sz, 0, dt_root); } -static struct dt_node *io_add_hea(const struct cechub_io_hub *hub, - const void *sp_io) -{ - struct dt_node *np, *gnp; - uint64_t reg[2]; - unsigned int i, vpd_sz; - uint8_t kw_sz; - const void *iokid, *vpd, *ccin; - const uint8_t *mac; - const struct HDIF_child_ptr *iokids; - - /* - * We have a table of supported dauther cards looked up - * by CCIN. We don't use the 1008 slot map in the VPD. - * - * This is basically translated from BML and will do for - * now especially since we don't really support p5ioc2 - * machine, this is just for lab use - * - * This is mostly untested on 10G ... we might need more - * info about the PHY in that case - */ - const struct hea_iocard { - const char ccin[4]; - struct { - uint32_t speed; - uint16_t ports; - uint16_t phy_id; - } pg[2]; - } hea_iocards[] = { - { - .ccin = "1818", /* HV4 something */ - .pg[0] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - }, - { - .ccin = "1819", /* HV4 Titov Card */ - .pg[0] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - .pg[1] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - }, - { - .ccin = "1830", /* HV4 Sergei Card */ - .pg[0] = { .speed = 10000, .ports = 1, .phy_id = 0 }, - .pg[1] = { .speed = 10000, .ports = 1, .phy_id = 0 }, - }, - { - .ccin = "181A", /* L4 Evans Card */ - .pg[1] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - }, - { - .ccin = "181B", /* L4 Weber Card */ - .pg[0] = { .speed = 10000, .ports = 1, .phy_id = 0 }, - .pg[1] = { .speed = 10000, .ports = 1, .phy_id = 0 }, - }, - { - .ccin = "181C", /* HV4 Gibson Card */ - .pg[0] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - .pg[1] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - }, - { - .ccin = "2BC4", /* MR Riverside 2 */ - .pg[0] = { .speed = 1000, .ports = 1, .phy_id = 1 }, - .pg[1] = { .speed = 1000, .ports = 1, .phy_id = 1 }, - }, - { - .ccin = "2BC5", /* MR Lions 2 */ - .pg[0] = { .speed = 10000, .ports = 1, .phy_id = 1 }, - .pg[1] = { .speed = 10000, .ports = 1, .phy_id = 1 }, - }, - { - .ccin = "2BC6", /* MR Onion 2 */ - .pg[0] = { .speed = 10000, .ports = 1, .phy_id = 1 }, - .pg[1] = { .speed = 1000, .ports = 2, .phy_id = 1 }, - }, - { - .ccin = "266D", /* Jupiter Bonzai */ - .pg[0] = { .speed = 1000, .ports = 2, .phy_id = 1 }, - .pg[1] = { .speed = 1000, .ports = 2, .phy_id = 1 }, - }, - /* The blade use an IO KID that's a bit oddball and seems to - * represent the backplane itself, but let's use it anyway - * - * XXX Probably want a different PHY type ! - */ - { - .ccin = "531C", /* P7 Blade */ - .pg[0] = { .speed = 1000, .ports = 2, .phy_id = 0 }, - }, - }; - const struct hea_iocard *card = NULL; - - /* WARNING: This makes quite a lot of nasty assumptions - * that appear to hold true on the few machines I care - * about, which is good enough for now. We don't officially - * support p5ioc2 anyway... - */ - - /* Get first IO KID, we only support one. Real support would - * mean using the FRU ID and the SLCA to find the right "stuff" - * but at this stage it's unnecessary - */ - iokids = HDIF_child_arr(sp_io, CECHUB_CHILD_IO_KIDS); - if (!CHECK_SPPTR(iokids)) { - prerror("HEA: no IOKID in HDAT child array !\n"); - return NULL; - } - if (!iokids->count) { - prerror("HEA: IOKID count is 0 !\n"); - return NULL; - } - if (be32_to_cpu(iokids->count) > 1) { - prlog(PR_WARNING, "HEA: WARNING ! More than 1 IO KID !!! (%d)\n", - iokids->count); - } - iokid = HDIF_child(sp_io, iokids, 0, "IO KID"); - if (!iokid) { - prerror("HEA: Failed to retrieve IO KID 0 !\n"); - return NULL; - } - - /* Grab VPD */ - vpd = HDIF_get_idata(iokid, IOKID_KW_VPD, &vpd_sz); - if (!CHECK_SPPTR(vpd)) { - prerror("HEA: Failed to retrieve VPD from IO KID !\n"); - return NULL; - } - - /* Grab the MAC address */ - mac = vpd_find(vpd, vpd_sz, "VINI", "B1", &kw_sz); - if (!mac || kw_sz < 8) { - prerror("HEA: Failed to retrieve MAC Address !\n"); - return NULL; - } - - /* Grab the CCIN (card ID) */ - ccin = vpd_find(vpd, vpd_sz, "VINI", "CC", &kw_sz); - if (!ccin || kw_sz < 4) { - prerror("HEA: Failed to retrieve CCIN !\n"); - return NULL; - } - - /* Now we could try to parse the 1008 slot map etc... but instead - * we'll do like BML and grab the CCIN & use it for known cards. - * We also grab the MAC - */ - for (i = 0; i < ARRAY_SIZE(hea_iocards) && !card; i++) { - if (strncmp(hea_iocards[i].ccin, ccin, 4)) - continue; - card = &hea_iocards[i]; - } - if (!card) { - prerror("HEA: Unknown CCIN 0x%.4s!\n", (const char *)ccin); - return NULL; - } - - /* Assume base address is BAR3 + 0x4000000000 */ - reg[0] = be64_to_cpu(hub->gx_ctrl_bar3) + 0x4000000000; - reg[1] = 0xc0000000; - - prlog(PR_DEBUG, "CEC: * Adding HEA to P5IOC2, assuming GBA=0x%llx\n", - (long long)reg[0]); - np = dt_new_addr(dt_root, "ibm,hea", reg[0]); - if (!np) - return NULL; - - dt_add_property(np, "reg", reg, sizeof(reg)); - dt_add_property_strings(np, "compatible", "ibm,p5ioc2-hea"); - dt_add_property_cells(np, "#address-cells", 1); - dt_add_property_cells(np, "#size-cells", 0); - dt_add_property(np, "ibm,vpd", vpd, vpd_sz); - dt_add_property_cells(np, "#mac-address", mac[7]); - dt_add_property(np, "mac-address-base", mac, 6); - /* BUID is base + 0x30 */ - dt_add_property(np, "interrupt-controller", NULL, 0); - dt_add_property_cells(np, "interrupt-base", - ((be32_to_cpu(hub->buid_ext) << 9) | 0x30) << 4); - dt_add_property_cells(np, "interrupt-max-count", 128); - - /* Always 2 port groups */ - for (i = 0; i < 2; i++) { - unsigned int clause; - - switch(card->pg[i].speed) { - case 1000: - clause = 0x22; - break; - case 10000: - clause = 0x45; - break; - default: - /* Unused port group */ - continue; - } - gnp = dt_new_addr(np, "portgroup", i + 1); - if (!gnp) - continue; - - dt_add_property_cells(gnp, "reg", i + 1); - dt_add_property_cells(gnp, "speed", card->pg[i].speed); - /* XX FIXME */ - dt_add_property_strings(gnp, "phy-type", "mdio"); - dt_add_property_cells(gnp, "phy-mdio-addr", card->pg[i].phy_id); - dt_add_property_cells(gnp, "phy-mdio-clause", clause); - dt_add_property_cells(gnp, "subports", card->pg[i].ports); - } - return np; -} - static void io_parse_fru(const void *sp_iohubs) { unsigned int i; @@ -643,12 +435,6 @@ static void io_parse_fru(const void *sp_iohubs) hn = io_add_p7ioc(hub, sp_iohubs); io_add_common(hn, hub); break; - case CECHUB_HUB_P5IOC2: - prlog(PR_INFO, "CEC: P5IOC2 !\n"); - hn = io_add_p5ioc2(hub, sp_iohubs); - io_add_common(hn, hub); - io_add_hea(hub, sp_iohubs); - break; case CECHUB_HUB_MURANO: case CECHUB_HUB_MURANO_SEGU: prlog(PR_INFO, "CEC: Murano !\n"); diff --git a/hdata/spira.h b/hdata/spira.h index 0916fe3..5ed9329 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -476,7 +476,6 @@ struct cechub_io_hub { #define CECHUB_HUB_FAB_BR1_PDT_PHB4 0x08 /* p7ioc only */ #define CECHUB_HUB_FAB_BR1_PDT_PHB5 0x04 /* p7ioc only */ __be16 iohub_id; /* the type of hub */ -#define CECHUB_HUB_P5IOC2 0x1061 /* from VPL1 */ #define CECHUB_HUB_P7IOC 0x60e7 /* from VPL3 */ #define CECHUB_HUB_MURANO 0x20ef /* Murano from spec */ #define CECHUB_HUB_MURANO_SEGU 0x0001 /* Murano+Seguso from spec */ |