Commit 24b574d0 authored by Kyle McMartin's avatar Kyle McMartin Committed by Kyle McMartin

parisc: add pdc_coproc_cfg_unlocked and set_firmware_width_unlocked

These functions are called only when bringing up the monarch cpu,
so it is safe to call them without taking the pdc spinlock. In the
future, this may become relevant for lockdep, since these functions were
taking spinlocks before start_kernel called the lockdep initializers.
parent deae26bf
...@@ -603,6 +603,7 @@ int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsi ...@@ -603,6 +603,7 @@ int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsi
int pdc_chassis_disp(unsigned long disp); int pdc_chassis_disp(unsigned long disp);
int pdc_chassis_warn(unsigned long *warn); int pdc_chassis_warn(unsigned long *warn);
int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info); int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info);
int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index, int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
void *iodc_data, unsigned int iodc_data_size); void *iodc_data, unsigned int iodc_data_size);
int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info, int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
...@@ -641,6 +642,7 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, ...@@ -641,6 +642,7 @@ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
#endif #endif
void set_firmware_width(void); void set_firmware_width(void);
void set_firmware_width_unlocked(void);
int pdc_do_firm_test_reset(unsigned long ftc_bitmap); int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
int pdc_do_reset(void); int pdc_do_reset(void);
int pdc_soft_power_info(unsigned long *power_reg); int pdc_soft_power_info(unsigned long *power_reg);
......
...@@ -150,26 +150,40 @@ static void convert_to_wide(unsigned long *addr) ...@@ -150,26 +150,40 @@ static void convert_to_wide(unsigned long *addr)
#endif #endif
} }
#ifdef CONFIG_64BIT
void __init set_firmware_width_unlocked(void)
{
int ret;
ret = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES,
__pa(pdc_result), 0);
convert_to_wide(pdc_result);
if (pdc_result[0] != NARROW_FIRMWARE)
parisc_narrow_firmware = 0;
}
/** /**
* set_firmware_width - Determine if the firmware is wide or narrow. * 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 * This function must be called before any pdc_* function that uses the
* function. * convert_to_wide function.
*/ */
void __init set_firmware_width(void) void __init set_firmware_width(void)
{ {
#ifdef CONFIG_64BIT
int retval;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pdc_lock, flags);
set_firmware_width_unlocked();
spin_unlock_irqrestore(&pdc_lock, flags);
}
#else
void __init set_firmware_width_unlocked(void) {
return;
}
spin_lock_irqsave(&pdc_lock, flags); void __init set_firmware_width(void) {
retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); return;
convert_to_wide(pdc_result);
if(pdc_result[0] != NARROW_FIRMWARE)
parisc_narrow_firmware = 0;
spin_unlock_irqrestore(&pdc_lock, flags);
#endif
} }
#endif /*CONFIG_64BIT*/
/** /**
* pdc_emergency_unlock - Unlock the linux pdc lock * pdc_emergency_unlock - Unlock the linux pdc lock
...@@ -288,6 +302,20 @@ int pdc_chassis_warn(unsigned long *warn) ...@@ -288,6 +302,20 @@ int pdc_chassis_warn(unsigned long *warn)
return retval; return retval;
} }
int __init pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
{
int ret;
ret = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
convert_to_wide(pdc_result);
pdc_coproc_info->ccr_functional = pdc_result[0];
pdc_coproc_info->ccr_present = pdc_result[1];
pdc_coproc_info->revision = pdc_result[17];
pdc_coproc_info->model = pdc_result[18];
return ret;
}
/** /**
* pdc_coproc_cfg - To identify coprocessors attached to the processor. * pdc_coproc_cfg - To identify coprocessors attached to the processor.
* @pdc_coproc_info: Return buffer address. * @pdc_coproc_info: Return buffer address.
...@@ -297,19 +325,14 @@ int pdc_chassis_warn(unsigned long *warn) ...@@ -297,19 +325,14 @@ int pdc_chassis_warn(unsigned long *warn)
*/ */
int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info) int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
{ {
int retval; int ret;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pdc_lock, flags); spin_lock_irqsave(&pdc_lock, flags);
retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result)); ret = pdc_coproc_cfg_unlocked(pdc_coproc_info);
convert_to_wide(pdc_result); spin_unlock_irqrestore(&pdc_lock, flags);
pdc_coproc_info->ccr_functional = pdc_result[0];
pdc_coproc_info->ccr_present = pdc_result[1];
pdc_coproc_info->revision = pdc_result[17];
pdc_coproc_info->model = pdc_result[18];
spin_unlock_irqrestore(&pdc_lock, flags);
return retval; return ret;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment