Skip to content

Commit 089d552

Browse files
jkkmKyle McMartin
authored andcommitted
parisc: hijack jump to start_kernel
Bang in our own start_parisc call, which initializes the PDC width, and turns on the FPU. Previously, if CONFIG_PRINTK_TIME was on, we'd attempt to use the FPU before we had enabled it, resulting in a difficult to diagnose panic. This patch causes init_per_cpu to redundantly set these for cpu0, but this is harmless.
1 parent 24b574d commit 089d552

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

‎arch/parisc/kernel/head.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ $pgt_fill_loop:
121121
copy %r0,%r2
122122

123123
/* And the RFI Target address too */
124-
load32 start_kernel,%r11
124+
load32 start_parisc,%r11
125125

126126
/* And the initial task pointer */
127127
load32 init_thread_union,%r6

‎arch/parisc/kernel/setup.c‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,31 @@ static int __init parisc_init(void)
368368

369369
return 0;
370370
}
371-
372371
arch_initcall(parisc_init);
373372

373+
void start_parisc(void)
374+
{
375+
extern void start_kernel(void);
376+
377+
int ret, cpunum;
378+
struct pdc_coproc_cfg coproc_cfg;
379+
380+
cpunum = smp_processor_id();
381+
382+
set_firmware_width_unlocked();
383+
384+
ret = pdc_coproc_cfg_unlocked(&coproc_cfg);
385+
if (ret >= 0 && coproc_cfg.ccr_functional) {
386+
mtctl(coproc_cfg.ccr_functional, 10);
387+
388+
cpu_data[cpunum].fp_rev = coproc_cfg.revision;
389+
cpu_data[cpunum].fp_model = coproc_cfg.model;
390+
391+
asm volatile ("fstd %fr0,8(%sp)");
392+
} else {
393+
panic("must have an fpu to boot linux");
394+
}
395+
396+
start_kernel();
397+
// not reached
398+
}

0 commit comments

Comments
 (0)