Skip to contentSkip to conversation

parisc: Fix STI console on 64-bit only machines

PATCH Superseded Helge Deller 1 participant 1 message May 3, 2023

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Fix STI console on 64-bit only machines

Fix the STI console to be able to execute 64-bit STI ROM code in addition to 32-bit STI ROM code.

This is necessary on 64-bit only machines (e.g. C8000 workstation) which will now support HP graphic cards like Visualize-FX5/10 and Visualize-FXe in STI text mode (no graphics mode yet).

This patch is for kernel v6.3 and below.
In upstream kernels some of the touched files will be moved by queued changes in drm-misc-next git tree.

arch/parisc/include/asm/pdc.h +1 -1
index 2b4fad8328e8..4258c8998ebe 100644
@@ -89,7 +89,7 @@ int pdc_iodc_print(const unsigned char *str, unsigned count);
 void pdc_emergency_unlock(void);
 int pdc_sti_call(unsigned long func, unsigned long flags,
                  unsigned long inptr, unsigned long outputr,
-                 unsigned long glob_cfg);
+                 unsigned long glob_cfg, int sti_call_64bit);
 
 int __pdc_cpu_rendezvous(void);
 void pdc_cpu_rendezvous_lock(void);
arch/parisc/kernel/firmware.c +13 -6
index cc124d9f1f7f..03bfdc324146 100644
@@ -1390,16 +1390,23 @@ int pdc_iodc_getc(void)
 
 int pdc_sti_call(unsigned long func, unsigned long flags,
                  unsigned long inptr, unsigned long outputr,
-                 unsigned long glob_cfg)
+                 unsigned long glob_cfg, int sti_call_64bit)
 {
-        int retval;
+	int retval;
 	unsigned long irqflags;
 
-        spin_lock_irqsave(&pdc_lock, irqflags);
-        retval = real32_call(func, flags, inptr, outputr, glob_cfg);
-        spin_unlock_irqrestore(&pdc_lock, irqflags);
+	spin_lock_irqsave(&pdc_lock, irqflags);
+	if (IS_ENABLED(CONFIG_64BIT) && sti_call_64bit) {
+#ifdef CONFIG_64BIT
+		retval = real64_call(func, flags, inptr, outputr, glob_cfg);
+#else
+		BUG();
+#endif
+	} else
+		retval = real32_call(func, flags, inptr, outputr, glob_cfg);
+	spin_unlock_irqrestore(&pdc_lock, irqflags);
 
-        return retval;
+	return retval;
 }
 EXPORT_SYMBOL(pdc_sti_call);
 
drivers/video/console/sticore.c +116 -60

343 lines not on this page · raw message

drivers/video/fbdev/sticore.h +24 -23

161 lines not on this page · raw message

drivers/video/fbdev/stifb.c +2 -2
index 3feb6e40d56d..ec786791d2f3 100644
@@ -71,9 +71,9 @@
 
 #include "sticore.h"
 
-/* REGION_BASE(fb_info, index) returns the virtual address for region <index> */
+/* REGION_BASE(fb_info, index) returns the physical address for region <index> */
 #define REGION_BASE(fb_info, index) \
-	F_EXTEND(fb_info->sti->glob_cfg->region_ptrs[index])
+	F_EXTEND(fb_info->sti->regions_phys[index])
 
 #define NGLEDEVDEPROM_CRT_REGION 1