# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/linux/hotfix-offb.patch.sparc64 # Copyright (C) 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- --- linux-6.10/drivers/video/fbdev/Kconfig.vanilla 2024-09-23 22:31:37.163335541 +0200 +++ linux-6.10/drivers/video/fbdev/Kconfig 2024-09-23 22:32:15.446669040 +0200 @@ -269,7 +269,7 @@ config FB_OF tristate "Open Firmware frame buffer device support" - depends on FB && PPC && (!PPC_PSERIES || PCI) + depends on FB && (PPC && (!PPC_PSERIES || PCI) || (SPARC && PCI)) depends on !DRM_OFDRM select APERTURE_HELPERS select FB_IOMEM_HELPERS --- linux-6.10/drivers/video/fbdev/offb.c.orig 2024-07-15 00:43:32.000000000 +0200 +++ linux-6.10/drivers/video/fbdev/offb.c 2024-09-24 12:21:14.546722392 +0200 @@ -134,6 +134,7 @@ return 0; switch (par->cmap_type) { +#ifndef __sparc__ case cmap_simple: writeb(regno, par->cmap_adr); writeb(red, par->cmap_data); @@ -168,6 +169,7 @@ out_le32(((unsigned __iomem *) par->cmap_adr) + regno, (red << 16 | green << 8 | blue)); break; +#endif case cmap_avivo: /* Write to both LUTs for now */ writel(1, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); @@ -205,6 +207,7 @@ if (blank) for (i = 0; i < 256; i++) { switch (par->cmap_type) { +#ifndef __sparc__ case cmap_simple: writeb(i, par->cmap_adr); for (j = 0; j < 3; j++) @@ -236,6 +239,7 @@ out_le32(((unsigned __iomem *) par->cmap_adr) + i, 0); break; +#endif case cmap_avivo: writel(1, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); writeb(i, par->cmap_adr + AVIVO_DC_LUT_RW_INDEX); @@ -628,7 +633,12 @@ skip_addr: if (address == OF_BAD_ADDR && addr_prop) address = (u64)addr_prop; + +#if defined(__sparc__) && defined(CONFIG_PC) + if (1) { +#else if (address != OF_BAD_ADDR) { +#endif #ifdef CONFIG_PCI const __be32 *vidp, *didp; u32 vid, did; @@ -640,11 +650,23 @@ pdev = pci_get_device(vid, did, NULL); if (!pdev || pci_enable_device(pdev)) return; +#ifdef __sparc__ + address = pci_resource_start (pdev, 0); +#endif } #endif - /* kludge for valkyrie */ +#ifdef __sparc__ + if (!address) + return; +#endif + +#ifdef __sparc__ + if (of_node_name_eq(dp, "SUNW,XVR-300")) + address += 0x8000; +#else if (of_node_name_eq(dp, "valkyrie")) address += 0x1000; +#endif offb_init_fb(parent, no_real_node ? "bootx" : NULL, width, height, depth, pitch, address, foreign_endian, no_real_node ? NULL : dp); @@ -685,6 +710,10 @@ static const struct of_device_id offb_of_match_display[] = { { .compatible = "display", }, +#ifdef __sparc__ + { .compatible = "VGA", }, /* Qemu */ + { .name = "SUNW,XVR-300", }, +#endif { }, }; MODULE_DEVICE_TABLE(of, offb_of_match_display);