[PATCH 36/38] MIPS: SGI-IP27: register the Odyssey graphics widget

From: Imre Kaloz

Date: Thu Oct 01 2026 - 13:08:34 EST


The Odyssey (VPro) graphics widget is a direct xtalk widget with no PCI
bridge in front of it, so it needs a platform_device of its own rather
than piggybacking on bridge_platform_create(). Its register aperture is
the widget's small window, and the sgi-odyssey DRM driver binds it.

Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
arch/mips/sgi-ip27/ip27-xtalk.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c
index 091186cb7a04..b754bbb3ca33 100644
--- a/arch/mips/sgi-ip27/ip27-xtalk.c
+++ b/arch/mips/sgi-ip27/ip27-xtalk.c
@@ -7,6 +7,7 @@
* Generic XTALK initialization code
*/

+#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/platform_device.h>
@@ -24,6 +25,9 @@
#define PXBOW_WIDGET_PART_NUM 0xd100 /* PXbow */
#define BASE_XBOW_PORT 8 /* Lowest external port */

+/* Odyssey's register aperture, as sized by the sgi-odyssey driver. */
+#define ODYSSEY_REG_SIZE 0x00410000
+
enum xtalk_bridge_type {
XTALK_BRIDGE,
XTALK_XBRIDGE,
@@ -167,6 +171,27 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid,
return;
}

+static void odyssey_platform_create(nasid_t nasid, int widget)
+{
+ struct platform_device *pdev;
+ struct resource res;
+
+ memset(&res, 0, sizeof(res));
+ res.name = "sgi-odyssey";
+ res.start = NODE_OFFSET(nasid) + (widget << SWIN_SIZE_BITS);
+ res.end = res.start + ODYSSEY_REG_SIZE - 1;
+ res.flags = IORESOURCE_MEM;
+
+ pr_info("xtalk:n%d/%x odyssey widget: reg=[%pa-%pa]\n",
+ nasid, widget, &res.start, &res.end);
+
+ pdev = platform_device_register_simple("sgi-odyssey",
+ PLATFORM_DEVID_AUTO, &res, 1);
+ if (IS_ERR(pdev))
+ pr_warn("xtalk:n%d/%x odyssey platform device registration failed: %ld\n",
+ nasid, widget, PTR_ERR(pdev));
+}
+
static int probe_one_port(nasid_t nasid, int widget, int masterwid)
{
widgetreg_t widget_id;
@@ -190,6 +215,9 @@ static int probe_one_port(nasid_t nasid, int widget, int masterwid)
bridge_platform_create(nasid, widget, masterwid,
XTALK_PIC_BUS1);
break;
+ case WIDGET_ODYS_PART_NUM:
+ odyssey_platform_create(nasid, widget);
+ break;
default:
pr_info("xtalk:n%d/%d unknown widget (0x%x)\n",
nasid, widget, partnum);
--
2.47.3