Skip to content

Commit ededd9d

Browse files
committed
sticon/parisc: Allow 64-bit STI calls in PDC firmware abstration
Some 64-bit machines require us to call the STI ROM in 64-bit mode, e.g. with the VisFXe graphic card. This patch allows drivers to use such 64-bit calling conventions. Tested-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent c9cc454 commit ededd9d

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

arch/parisc/include/asm/pdc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ int pdc_iodc_print(const unsigned char *str, unsigned count);
8888

8989
void pdc_emergency_unlock(void);
9090
int pdc_sti_call(unsigned long func, unsigned long flags,
91-
unsigned long inptr, unsigned long outputr,
92-
unsigned long glob_cfg);
91+
unsigned long inptr, unsigned long outputr,
92+
unsigned long glob_cfg, int do_call64);
9393

9494
int __pdc_cpu_rendezvous(void);
9595
void pdc_cpu_rendezvous_lock(void);

arch/parisc/kernel/firmware.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,17 +1389,25 @@ int pdc_iodc_getc(void)
13891389
}
13901390

13911391
int pdc_sti_call(unsigned long func, unsigned long flags,
1392-
unsigned long inptr, unsigned long outputr,
1393-
unsigned long glob_cfg)
1392+
unsigned long inptr, unsigned long outputr,
1393+
unsigned long glob_cfg, int do_call64)
13941394
{
1395-
int retval;
1395+
int retval = 0;
13961396
unsigned long irqflags;
13971397

1398-
spin_lock_irqsave(&pdc_lock, irqflags);
1399-
retval = real32_call(func, flags, inptr, outputr, glob_cfg);
1400-
spin_unlock_irqrestore(&pdc_lock, irqflags);
1398+
spin_lock_irqsave(&pdc_lock, irqflags);
1399+
if (IS_ENABLED(CONFIG_64BIT) && do_call64) {
1400+
#ifdef CONFIG_64BIT
1401+
retval = real64_call(func, flags, inptr, outputr, glob_cfg);
1402+
#else
1403+
WARN_ON(1);
1404+
#endif
1405+
} else {
1406+
retval = real32_call(func, flags, inptr, outputr, glob_cfg);
1407+
}
1408+
spin_unlock_irqrestore(&pdc_lock, irqflags);
14011409

1402-
return retval;
1410+
return retval;
14031411
}
14041412
EXPORT_SYMBOL(pdc_sti_call);
14051413

drivers/video/sticore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ int sti_call(const struct sti_struct *sti, unsigned long func,
11421142
return -1;
11431143
#endif
11441144

1145-
ret = pdc_sti_call(func, _flags, _inptr, _outptr, _glob_cfg);
1145+
ret = pdc_sti_call(func, _flags, _inptr, _outptr, _glob_cfg, 0);
11461146

11471147
return ret;
11481148
}

0 commit comments

Comments
 (0)