# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/linux/hotfix-mips64-xtalk-bridge.patch # Copyright (C) 2024 - 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- ld: arch/mips/pci/pci-xtalk-bridge.o: in function `bridge_get_partnum': pci-xtalk-bridge.c:(.text+0x384): undefined reference to `crc16' Implement xtalk platform devs for impact and odyssey fb. Fix phys_to_dma for non PCI xtalk fb devices. Export xtalk_get_swin for impact and odyssey fb. - Rene Rebe --- linux-6.9/arch/mips/Kconfig.vanilla 2024-06-20 18:56:55.436910044 +0200 +++ linux-6.9/arch/mips/Kconfig 2024-06-20 18:55:14.057915930 +0200 @@ -1217,6 +1217,7 @@ bool config PCI_XTALK_BRIDGE + select CRC16 bool config NO_EXCEPT_FILL --- linux-6.14/arch/mips/pci/pci-xtalk-bridge.c.vanilla 2025-05-18 12:58:12.655830947 +0200 +++ linux-6.14/arch/mips/pci/pci-xtalk-bridge.c 2025-05-18 14:08:45.348970530 +0200 @@ -28,10 +28,12 @@ */ dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) { - struct pci_dev *pdev = to_pci_dev(dev); - struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus); - - return bc->baddr + paddr; + if (dev->bus == &pci_bus_type) { + struct pci_dev *pdev = to_pci_dev(dev); + struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus); + return bc->baddr + paddr; + } + return paddr; } --- linux-6.14/arch/mips/sgi-ip30/ip30-xtalk.c.vanilla 2025-05-16 21:01:21.163242399 +0200 +++ linux-6.14/arch/mips/sgi-ip30/ip30-xtalk.c 2025-05-17 12:16:56.077612139 +0200 @@ -36,6 +36,12 @@ #define xtalk_read __raw_readl +unsigned long +xtalk_get_swin(int wid) +{ + return IP30_SWIN_BASE(wid); +} + static void bridge_platform_create(int widget, int masterwid) { struct xtalk_bridge_platform_data *bd; @@ -148,23 +154,42 @@ static void __init xtalk_init_widget(s8 wid, s8 masterwid) { + xwidget_mfg_num_t mfgnum; xwidget_part_num_t partnum; + xwidget_rev_num_t rev; + widgetreg_t widget_id; if (!xbow_widget_active(wid)) return; widget_id = xtalk_read((void *)(IP30_RAW_SWIN_BASE(wid) + WIDGET_ID)); - + mfgnum = XWIDGET_MFG_NUM(widget_id); partnum = XWIDGET_PART_NUM(widget_id); + rev = XWIDGET_REV_NUM(widget_id); + switch (partnum) { case BRIDGE_WIDGET_PART_NUM: case XBRIDGE_WIDGET_PART_NUM: bridge_platform_create(wid, masterwid); break; default: - pr_info("xtalk:%x unknown widget (0x%x)\n", wid, partnum); + { + const struct widget_ident *wi; + for (wi = widget_idents; wi->name; wi++) + if (wi->mfgr == mfgnum && wi->part == partnum) + break; + + if (wi->name == NULL) { + pr_info("xtalk:%x unknown widget (0x%08x)\n", wid, partnum); + } else { + if (platform_device_register_simple(wi->name, wid, NULL, 0)) + pr_info("xtalk: %x %s widget (rev %s) " + "registered as a platform device.\n", wid, + wi->name, wi->revs[rev] ? : "unknown"); + } + } break; } }