[PATCH v2 42/53] MIPS: SGI-IP27: register the Odyssey graphics widget

From: Imre Kaloz

Date: Tue Oct 13 2026 - 09:44:51 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.
The driver programs the board with the widget id of its master hub,
passed as the u32 property "sgi,master-widget".

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

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

+#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/platform_data/sgi-w1.h>
#include <linux/platform_data/xtalk-bridge.h>
#include <asm/sn/addrs.h>
@@ -24,6 +26,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 +172,37 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid,
return;
}

+static void odyssey_platform_create(nasid_t nasid, int widget, int masterwid)
+{
+ const struct property_entry props[] = {
+ PROPERTY_ENTRY_U32("sgi,master-widget", masterwid),
+ { }
+ };
+ struct resource res;
+ struct platform_device_info info = {
+ .name = "sgi-odyssey",
+ .id = PLATFORM_DEVID_AUTO,
+ .res = &res,
+ .num_res = 1,
+ .properties = props,
+ };
+ struct platform_device *pdev;
+
+ 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_full(&info);
+ 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 +226,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, masterwid);
+ break;
default:
pr_info("xtalk:n%d/%d unknown widget (0x%x)\n",
nasid, widget, partnum);
--
2.47.3