blob: a7ed4f19a3dfd19a2f0f47bad71c4ba20fea89ed [file] [log] [blame]
Stewart Smithbffd3502019-12-08 22:48:04 -08001From 376bed3fbe902138b92e95d9da58bb5e1509072e Mon Sep 17 00:00:00 2001
2From: Stewart Smith <stewart@flamingspork.com>
3Date: Sun, 8 Dec 2019 19:06:25 -0800
4Subject: [PATCH] platform: add Raptor Blackbird support
5
6Based off the Raptor patch:
7https://git.raptorcs.com/git/blackbird-skiboot/commit/?id=c81f9d66592dc2a7cf7f6c59c3def5cee0638c1f
8
9Notable changes are slot names matching what's silkscreened on the board.
10See https://i1.wp.com/www.flamingspork.com/blog/wp-content/uploads/2019/12/IMG_4006-scaled.jpg
11for a photo of the actual board.
12
13I haven't included the port 80h bit as I haven't worked out how to probe that from the BMC to test.
14
15Boot tested, seems good.
16
17Signed-off-by: Stewart Smith <stewart@flamingspork.com>
18---
19 platforms/astbmc/Makefile.inc | 3 +-
20 platforms/astbmc/blackbird.c | 66 +++++++++++++++++++++++++++++++++++
21 2 files changed, 68 insertions(+), 1 deletion(-)
22 create mode 100644 platforms/astbmc/blackbird.c
23
24diff --git a/platforms/astbmc/Makefile.inc b/platforms/astbmc/Makefile.inc
25index fd4eaeac..e0f8760d 100644
26--- a/platforms/astbmc/Makefile.inc
27+++ b/platforms/astbmc/Makefile.inc
28@@ -6,7 +6,8 @@ ASTBMC_OBJS = pnor.o common.o slots.o \
29 garrison.o barreleye.o \
30 witherspoon.o zaius.o romulus.o p9dsu.o \
31 vesnin.o nicole.o mihawk.o\
32- talos.o swift.o
33+ talos.o blackbird.o \
34+ swift.o
35
36 ASTBMC = $(PLATDIR)/astbmc/built-in.a
37 $(ASTBMC): $(ASTBMC_OBJS:%=$(PLATDIR)/astbmc/%)
38diff --git a/platforms/astbmc/blackbird.c b/platforms/astbmc/blackbird.c
39new file mode 100644
40index 00000000..8817b8c5
41--- /dev/null
42+++ b/platforms/astbmc/blackbird.c
43@@ -0,0 +1,66 @@
44+// SPDX-License-Identifier: Apache-2.0
45+/* Copyright 2017 IBM Corp.
46+ * Copyright 2018-2019 Raptor Engineering, LLC
47+ * Copyright 2019 Stewart Smith
48+ */
49+
50+#include <skiboot.h>
51+#include <device.h>
52+#include <console.h>
53+#include <chip.h>
54+#include <ipmi.h>
55+#include <psi.h>
56+
57+#include "astbmc.h"
58+
59+ST_PLUGGABLE(blackbird_cpu1_slot1, "SLOT1 PCIE 4.0 X16");
60+ST_PLUGGABLE(blackbird_cpu1_slot2, "SLOT2 PCIE 4.0 X8");
61+
62+ST_BUILTIN_DEV(blackbird_builtin_sata, "Builtin SATA");
63+ST_BUILTIN_DEV(blackbird_builtin_usb, "Builtin USB");
64+ST_BUILTIN_DEV(blackbird_builtin_ethernet, "Builtin Ethernet");
65+ST_BUILTIN_DEV(blackbird_builtin_bmc, "BMC");
66+
67+static const struct slot_table_entry blackbird_phb_table[] = {
68+ ST_PHB_ENTRY(0, 0, blackbird_cpu1_slot1),
69+ ST_PHB_ENTRY(0, 1, blackbird_cpu1_slot2),
70+
71+ ST_PHB_ENTRY(0, 2, blackbird_builtin_sata),
72+ ST_PHB_ENTRY(0, 3, blackbird_builtin_usb),
73+ ST_PHB_ENTRY(0, 4, blackbird_builtin_ethernet),
74+ ST_PHB_ENTRY(0, 5, blackbird_builtin_bmc),
75+
76+ { .etype = st_end },
77+};
78+
79+static bool blackbird_probe(void)
80+{
81+ if (!dt_node_is_compatible(dt_root, "rcs,blackbird"))
82+ return false;
83+
84+ /* Lot of common early inits here */
85+ astbmc_early_init();
86+
87+ /* Setup UART for use by OPAL (Linux hvc) */
88+ uart_set_console_policy(UART_CONSOLE_OPAL);
89+
90+ slot_table_init(blackbird_phb_table);
91+
92+ return true;
93+}
94+
95+DECLARE_PLATFORM(blackbird) = {
96+ .name = "Blackbird",
97+ .probe = blackbird_probe,
98+ .init = astbmc_init,
99+ .start_preload_resource = flash_start_preload_resource,
100+ .resource_loaded = flash_resource_loaded,
101+ .bmc = &bmc_plat_ast2500_openbmc,
102+ .pci_get_slot_info = slot_table_get_slot_info,
103+ .pci_probe_complete = check_all_slot_table,
104+ .cec_power_down = astbmc_ipmi_power_down,
105+ .cec_reboot = astbmc_ipmi_reboot,
106+ .elog_commit = ipmi_elog_commit,
107+ .exit = astbmc_exit,
108+ .terminate = ipmi_terminate,
109+};
110--
1112.23.0
112