Skip to contentSkip to conversation

parisc: Move parisc_narrow_firmware variable to header file

PATCH New [email protected] 1 participant 2 messages Oct 18, 2023 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 parisc: Move parisc_narrow_firmware variable to header file

From: Helge Deller <[email protected]>

---
 arch/parisc/include/asm/processor.h | 1 +
 arch/parisc/kernel/setup.c          | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/parisc/include/asm/processor.h +1 -0
index ff6cbdb6903b..c05d121cf5d0 100644
@@ -287,6 +287,7 @@ extern int _parisc_requires_coherency;
 #endif
 
 extern int running_on_qemu;
+extern int parisc_narrow_firmware;
 
 extern void __noreturn toc_intr(struct pt_regs *regs);
 extern void toc_handler(void);
arch/parisc/kernel/setup.c +0 -3
index 2f434f2da185..ace483b6f19a 100644
@@ -100,9 +100,6 @@ static void __init dma_ops_init(void)
 
 void __init setup_arch(char **cmdline_p)
 {
-#ifdef CONFIG_64BIT
-	extern int parisc_narrow_firmware;
-#endif
 	unwind_init();
 
 	init_per_cpu(smp_processor_id());	/* Set Modes & Enable FP */
Signature · 1 line
2.41.0
#1 lore raw

PATCH 2/2 parisc/firmware: Use PDC constants for narrow/wide firmware

From: Helge Deller <[email protected]>

PDC uses the PDC_MODEL_OS64 and PDC_MODEL_OS32 constants, so use those constants for the internal WIDE_FIRMWARE/NARROW_FIRMWARE too.

---
 arch/parisc/kernel/firmware.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/parisc/kernel/firmware.c +7 -7
index 81078abec521..904ca3b9e7a7 100644
@@ -78,12 +78,12 @@ static unsigned long pdc_result[NUM_PDC_RESULT]  __aligned(8);
 static unsigned long pdc_result2[NUM_PDC_RESULT] __aligned(8);
 
 #ifdef CONFIG_64BIT
-#define WIDE_FIRMWARE 0x1
-#define NARROW_FIRMWARE 0x2
+#define WIDE_FIRMWARE		PDC_MODEL_OS64
+#define NARROW_FIRMWARE		PDC_MODEL_OS32
 
-/* Firmware needs to be initially set to narrow to determine the 
+/* Firmware needs to be initially set to narrow to determine the
  * actual firmware width. */
-int parisc_narrow_firmware __ro_after_init = 2;
+int parisc_narrow_firmware __ro_after_init = NARROW_FIRMWARE;
 #endif
 
 /* On most currently-supported platforms, IODC I/O calls are 32-bit calls
@@ -166,10 +166,10 @@ void set_firmware_width_unlocked(void)
 	if (pdc_result[0] != NARROW_FIRMWARE)
 		parisc_narrow_firmware = 0;
 }
-	
+
 /**
  * set_firmware_width - Determine if the firmware is wide or narrow.
- * 
+ *
  * This function must be called before any pdc_* function that uses the
  * convert_to_wide function.
  */
@@ -178,7 +178,7 @@ void set_firmware_width(void)
 	unsigned long flags;
 
 	/* already initialized? */
-	if (parisc_narrow_firmware != 2)
+	if (parisc_narrow_firmware != NARROW_FIRMWARE)
 		return;
 
 	spin_lock_irqsave(&pdc_lock, flags);
Signature · 1 line
2.41.0