[RFC,02/12] witherspoon: Fix up slot map

Message ID 20170801130007.8990-3-oohall@gmail.com
State RFC
Headers show

Commit Message

Oliver Aug. 1, 2017, 12:59 p.m.
The witherspoon slot map tables have a few quirks compared to the other
machine types. On witherspoon we have an extra topology level for the PCIe
switch down ports the bus number is baked into the DEVFN location number
for each port. Neither of these should be necessary so fix them up here.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 platforms/astbmc/witherspoon.c | 84 ++++++------------------------------------
 1 file changed, 12 insertions(+), 72 deletions(-)

Patch

diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index 8f7b15ce6a64..3c64cb17095b 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -30,78 +30,21 @@ 
 
 #include "astbmc.h"
 
-static const struct slot_table_entry witherspoon_gpu0[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0x80,0),
-		.name = "GPU0",
-	},
-	{ .etype = st_end },
-};
-
-static const struct slot_table_entry witherspoon_gpu1[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0xa0,0),
-		.name = "GPU1",
-	},
-	{ .etype = st_end },
-};
-
-static const struct slot_table_entry witherspoon_gpu2[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0xc0,0),
-		.name = "GPU2",
-	},
-	{ .etype = st_end },
-};
-
-static const struct slot_table_entry witherspoon_gpu3[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0x60,0),
-		.name = "GPU3",
-	},
-	{ .etype = st_end },
-};
-
-static const struct slot_table_entry witherspoon_gpu4[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0x80,0),
-		.name = "GPU4",
-	},
-	{ .etype = st_end },
-};
-
-static const struct slot_table_entry witherspoon_gpu5[] = {
-	{
-		.etype = st_pluggable_slot,
-		.location = ST_LOC_DEVFN(0xa0,0),
-		.name = "GPU5",
-	},
-	{ .etype = st_end },
-};
-
 static const struct slot_table_entry witherspoon_plx0_down[] = {
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x4a,0),
-		.children = witherspoon_gpu0,
-		.name = "GPU0 down",
+		.location = ST_LOC_DEVFN(0xa,0),
+		.name = "GPU0",
 	},
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x4b,0),
-		.children = witherspoon_gpu1,
-		.name = "GPU1 down",
+		.location = ST_LOC_DEVFN(0xb,0),
+		.name = "GPU1",
 	},
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x4c,0),
-		.children = witherspoon_gpu2,
-		.name = "GPU2 down",
+		.location = ST_LOC_DEVFN(0xc,0),
+		.name = "GPU2",
 	},
 	{ .etype = st_end },
 };
@@ -109,21 +52,18 @@  static const struct slot_table_entry witherspoon_plx0_down[] = {
 static const struct slot_table_entry witherspoon_plx1_down[] = {
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x44,0),
-		.children = witherspoon_gpu3,
-		.name = "GPU3 down",
+		.location = ST_LOC_DEVFN(0x4,0),
+		.name = "GPU3",
 	},
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x45,0),
-		.children = witherspoon_gpu4,
-		.name = "GPU4 down",
+		.location = ST_LOC_DEVFN(0x8,0),
+		.name = "GPU4",
 	},
 	{
 		.etype = st_builtin_dev,
-		.location = ST_LOC_DEVFN(0x4d,0),
-		.children = witherspoon_gpu5,
-		.name = "GPU5 down",
+		.location = ST_LOC_DEVFN(0xd,0),
+		.name = "GPU5",
 	},
 	{ .etype = st_end },
 };