Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
firmware.c File Reference
#include <stdarg.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <asm/page.h>
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/processor.h>

Go to the source code of this file.

Data Structures

struct  narrow_stack
 

Macros

#define MEM_PDC   (unsigned long)PAGE0->mem_pdc
 
#define mem_pdc_call(args...)   real32_call(MEM_PDC, args)
 
#define IS_SPROCKETS()
 

Functions

void __cpuinit set_firmware_width_unlocked (void)
 
void __cpuinit set_firmware_width (void)
 
void pdc_emergency_unlock (void)
 
int pdc_add_valid (unsigned long address)
 
 EXPORT_SYMBOL (pdc_add_valid)
 
int __init pdc_chassis_info (struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len)
 
int pdc_chassis_disp (unsigned long disp)
 
int pdc_chassis_warn (unsigned long *warn)
 
int __cpuinit pdc_coproc_cfg_unlocked (struct pdc_coproc_cfg *pdc_coproc_info)
 
int __cpuinit pdc_coproc_cfg (struct pdc_coproc_cfg *pdc_coproc_info)
 
int pdc_iodc_read (unsigned long *actcnt, unsigned long hpa, unsigned int index, void *iodc_data, unsigned int iodc_data_size)
 
 EXPORT_SYMBOL (pdc_iodc_read)
 
int pdc_system_map_find_mods (struct pdc_system_map_mod_info *pdc_mod_info, struct pdc_module_path *mod_path, long mod_index)
 
int pdc_system_map_find_addrs (struct pdc_system_map_addr_info *pdc_addr_info, long mod_index, long addr_index)
 
int pdc_model_info (struct pdc_model *model)
 
: A char array of at least 81 characters.

pdc_model_sysmodel - Get the system model name.

Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L). Using OS_ID_HPUX will return the equivalent of the 'modelname' command on HP/UX.

long real32_call (unsigned long function,...)
 
int pdc_model_sysmodel (char *name)
 
int pdc_model_versions (unsigned long *versions, int id)
 
int pdc_model_cpuid (unsigned long *cpu_id)
 
int pdc_model_capabilities (unsigned long *capabilities)
 
int pdc_cache_info (struct pdc_cache_info *cache_info)
 
int pdc_spaceid_bits (unsigned long *space_bits)
 
int pdc_btlb_info (struct pdc_btlb_info *btlb)
 
int pdc_mem_map_hpa (struct pdc_memory_map *address, struct pdc_module_path *mod_path)
 
int pdc_lan_station_id (char *lan_addr, unsigned long hpa)
 
 EXPORT_SYMBOL (pdc_lan_station_id)
 
int pdc_stable_read (unsigned long staddr, void *memaddr, unsigned long count)
 
 EXPORT_SYMBOL (pdc_stable_read)
 
int pdc_stable_write (unsigned long staddr, void *memaddr, unsigned long count)
 
 EXPORT_SYMBOL (pdc_stable_write)
 
int pdc_stable_get_size (unsigned long *size)
 
 EXPORT_SYMBOL (pdc_stable_get_size)
 
int pdc_stable_verify_contents (void)
 
 EXPORT_SYMBOL (pdc_stable_verify_contents)
 
int pdc_stable_initialize (void)
 
 EXPORT_SYMBOL (pdc_stable_initialize)
 
int pdc_get_initiator (struct hardware_path *hwpath, struct pdc_initiator *initiator)
 
 EXPORT_SYMBOL (pdc_get_initiator)
 
int pdc_pci_irt_size (unsigned long *num_entries, unsigned long hpa)
 
int pdc_pci_irt (unsigned long num_entries, unsigned long hpa, void *tbl)
 
int pdc_tod_read (struct pdc_tod *tod)
 
 EXPORT_SYMBOL (pdc_tod_read)
 
int pdc_tod_set (unsigned long sec, unsigned long usec)
 
 EXPORT_SYMBOL (pdc_tod_set)
 
int pdc_do_firm_test_reset (unsigned long ftc_bitmap)
 
int pdc_do_reset (void)
 
int __init pdc_soft_power_info (unsigned long *power_reg)
 
int pdc_soft_power_button (int sw_control)
 
void pdc_io_reset (void)
 
void pdc_io_reset_devices (void)
 
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)
 
 EXPORT_SYMBOL (pdc_sti_call)
 

Variables

unsigned long pdc_result [NUM_PDC_RESULT]
 
unsigned long pdc_result2 [NUM_PDC_RESULT]
 

Macro Definition Documentation

#define IS_SPROCKETS ( )
Value:
(strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \
strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785", 8) == 0)
#define MEM_PDC   (unsigned long)PAGE0->mem_pdc

Definition at line 105 of file firmware.c.

#define mem_pdc_call (   args...)    real32_call(MEM_PDC, args)

Definition at line 106 of file firmware.c.

Function Documentation

EXPORT_SYMBOL ( pdc_add_valid  )
EXPORT_SYMBOL ( pdc_iodc_read  )
EXPORT_SYMBOL ( pdc_lan_station_id  )
EXPORT_SYMBOL ( pdc_stable_read  )
EXPORT_SYMBOL ( pdc_stable_write  )
EXPORT_SYMBOL ( pdc_stable_get_size  )
EXPORT_SYMBOL ( pdc_stable_verify_contents  )
EXPORT_SYMBOL ( pdc_stable_initialize  )
EXPORT_SYMBOL ( pdc_get_initiator  )
EXPORT_SYMBOL ( pdc_tod_read  )
EXPORT_SYMBOL ( pdc_tod_set  )
EXPORT_SYMBOL ( pdc_sti_call  )
int pdc_add_valid ( unsigned long  address)

pdc_add_valid - Verify address can be accessed without causing a HPMC. : Address to be verified.

This PDC call attempts to read from the specified address and verifies if the address is valid.

The return value is PDC_OK (0) in case accessing this address is valid.

Definition at line 210 of file firmware.c.

pdc_btlb_info - Return block TLB information. : The return buffer.

Returns information about the hardware Block TLB.

Definition at line 587 of file firmware.c.

pdc_cache_info - Return cache and TLB information. : The return buffer.

Returns information about the processor's cache and TLB.

Definition at line 545 of file firmware.c.

int pdc_chassis_disp ( unsigned long  disp)

pdc_pat_chassis_send_log - Sends a PDC PAT CHASSIS log message.

Return values
-1 on error, 0 on success. Other value are PDC errors

Must be correctly formatted or expect system crash pdc_chassis_disp - Updates chassis code

Return values
-1 on error, 0 on success

Definition at line 275 of file firmware.c.

int __init pdc_chassis_info ( struct pdc_chassis_info chassis_info,
void led_info,
unsigned long  len 
)

pdc_chassis_info - Return chassis information.

Returns
: The return buffer. : The memory buffer address. : The size of the memory buffer address.

An HVERSION dependent call for returning the chassis information.

Definition at line 231 of file firmware.c.

int pdc_chassis_warn ( unsigned long warn)

pdc_chassis_warn - Fetches chassis warnings

Return values
-1 on error, 0 on success

Definition at line 291 of file firmware.c.

pdc_coproc_cfg - To identify coprocessors attached to the processor. : Return buffer address.

This PDC call returns the presence and status of all the coprocessors attached to the processor.

Definition at line 325 of file firmware.c.

int __cpuinit pdc_coproc_cfg_unlocked ( struct pdc_coproc_cfg pdc_coproc_info)

Definition at line 304 of file firmware.c.

int pdc_do_firm_test_reset ( unsigned long  ftc_bitmap)

Definition at line 1000 of file firmware.c.

int pdc_do_reset ( void  )

Definition at line 1018 of file firmware.c.

void pdc_emergency_unlock ( void  )

pdc_emergency_unlock - Unlock the linux pdc lock

This call unlocks the linux pdc lock in case we need some PDC functions (like pdc_add_valid) during kernel stack dump.

Definition at line 193 of file firmware.c.

int pdc_get_initiator ( struct hardware_path hwpath,
struct pdc_initiator initiator 
)

pdc_get_initiator - Get the SCSI Interface Card params (SCSI ID, SDTR, SE or LVD) : fully bc.mod style path to the device. : the array to return the result into

Get the SCSI operational parameters from PDC. Needed since HPUX never used BIOS or symbios card NVRAM. Most ncr/sym cards won't have an entry and just use whatever capabilities of the card are (eg Ultra, LVD). But there are several cases where it's useful: o set SCSI id for Multi-initiator clusters, o cable too long (ie SE scsi 10Mhz won't support 6m length), o bus width exported is less than what the interface chip supports.

Definition at line 786 of file firmware.c.

void pdc_io_reset ( void  )

Definition at line 1082 of file firmware.c.

void pdc_io_reset_devices ( void  )

Definition at line 1100 of file firmware.c.

int pdc_iodc_getc ( void  )

pdc_iodc_getc - Read a character (non-blocking) from the PDC console.

Read a character (non-blocking) from the PDC console, returns -1 if key is not present.

Definition at line 1159 of file firmware.c.

int pdc_iodc_read ( unsigned long actcnt,
unsigned long  hpa,
unsigned int  index,
void iodc_data,
unsigned int  iodc_data_size 
)

pdc_iodc_read - Read data from the modules IODC. : The actual number of bytes. : The HPA of the module for the iodc read. : The iodc entry point. : A buffer memory for the iodc options. : Size of the memory buffer.

This PDC call reads from the IODC of the module specified by the hpa argument.

Definition at line 348 of file firmware.c.

int pdc_lan_station_id ( char lan_addr,
unsigned long  hpa 
)

pdc_lan_station_id - Get the LAN address. : The return buffer. : The network device HPA.

Get the LAN station address when it is not directly available from the LAN hardware.

Definition at line 639 of file firmware.c.

int pdc_mem_map_hpa ( struct pdc_memory_map address,
struct pdc_module_path mod_path 
)

pdc_mem_map_hpa - Find fixed module information. : The return buffer : pointer to dev path structure.

This call was developed for S700 workstations to allow the kernel to find the I/O devices (Core I/O). In the future (Kittyhawk and beyond) this call will be replaced (on workstations) by the architected PDC_SYSTEM_MAP call.

This call is supported by all existing S700 workstations (up to Gecko).

Definition at line 615 of file firmware.c.

int pdc_model_capabilities ( unsigned long capabilities)

pdc_model_capabilities - Returns the platform capabilities. : The return buffer.

Returns information about platform support for 32- and/or 64-bit OSes, IO-PDIR coherency, and virtual aliasing.

Definition at line 520 of file firmware.c.

int pdc_model_cpuid ( unsigned long cpu_id)

pdc_model_cpuid - Returns the CPU_ID. : The return buffer.

Returns the CPU_ID value which uniquely identifies the cpu portion of the processor module.

Definition at line 498 of file firmware.c.

int pdc_model_info ( struct pdc_model model)

pdc_model_info - Return model information about the processor. : The return buffer.

Returns the version numbers, identifiers, and capabilities from the processor module.

Definition at line 425 of file firmware.c.

int pdc_model_sysmodel ( char name)

Definition at line 447 of file firmware.c.

int pdc_model_versions ( unsigned long versions,
int  id 
)

pdc_model_versions - Identify the version number of each processor. : The return buffer. : The id of the processor to check.

Returns the version number for each processor component.

This comment was here before, but I do not know what it means :( -RB id: 0 = cpu revision, 1 = boot-rom-version

Definition at line 477 of file firmware.c.

int pdc_pci_irt ( unsigned long  num_entries,
unsigned long  hpa,
void tbl 
)

pdc_pci_irt - Get the PCI interrupt routing table. : The number of entries in the table. : The Hard Physical Address of the device. :

Get the PCI interrupt routing table for the device at the given HPA. Similar to PDC_PAT stuff - but added for Forte/Allegro boxes

Definition at line 871 of file firmware.c.

int pdc_pci_irt_size ( unsigned long num_entries,
unsigned long  hpa 
)

pdc_pci_irt_size - Get the number of entries in the interrupt routing table. : The return value. : The HPA for the device.

This PDC function returns the number of entries in the specified cell's interrupt table. Similar to PDC_PAT stuff - but added for Forte/Allegro boxes

Definition at line 847 of file firmware.c.

int pdc_soft_power_button ( int  sw_control)

Definition at line 1065 of file firmware.c.

int __init pdc_soft_power_info ( unsigned long power_reg)

Definition at line 1036 of file firmware.c.

int pdc_spaceid_bits ( unsigned long space_bits)

pdc_spaceid_bits - Return whether Space ID hashing is turned on. : Should be 0, if not, bad mojo!

Returns information about Space ID hashing.

Definition at line 565 of file firmware.c.

int pdc_stable_get_size ( unsigned long size)

pdc_stable_get_size - Get Stable Storage size in bytes. : pointer where the size will be stored.

This PDC call returns the number of bytes in the processor's Stable Storage, which is the number of contiguous bytes implemented in Stable Storage starting from staddr=0. size in an unsigned 64-bit integer which is a multiple of four.

Definition at line 720 of file firmware.c.

int pdc_stable_initialize ( void  )

pdc_stable_initialize - Sets Stable Storage contents to zero and initialize the validity indicator.

This PDC call will erase all contents of Stable Storage. Use with care!

Definition at line 759 of file firmware.c.

int pdc_stable_read ( unsigned long  staddr,
void memaddr,
unsigned long  count 
)

pdc_stable_read - Read data from Stable Storage. : Stable Storage address to access. : The memory address where Stable Storage data shall be copied. : number of bytes to transfer. count is multiple of 4.

This PDC call reads from the Stable Storage address supplied in staddr and copies count bytes to the memory address memaddr. The call will fail if staddr+count > PDC_STABLE size.

Definition at line 669 of file firmware.c.

int pdc_stable_verify_contents ( void  )

pdc_stable_verify_contents - Checks that Stable Storage contents are valid.

This PDC call is meant to be used to check the integrity of the current contents of Stable Storage.

Definition at line 740 of file firmware.c.

int pdc_stable_write ( unsigned long  staddr,
void memaddr,
unsigned long  count 
)

pdc_stable_write - Write data to Stable Storage. : Stable Storage address to access. : The memory address where Stable Storage data shall be read from. : number of bytes to transfer. count is multiple of 4.

This PDC call reads count bytes from the supplied memaddr address, and copies count bytes to the Stable Storage address staddr. The call will fail if staddr+count > PDC_STABLE size.

Definition at line 695 of file firmware.c.

int pdc_sti_call ( unsigned long  func,
unsigned long  flags,
unsigned long  inptr,
unsigned long  outputr,
unsigned long  glob_cfg 
)

Definition at line 1186 of file firmware.c.

int pdc_system_map_find_addrs ( struct pdc_system_map_addr_info pdc_addr_info,
long  mod_index,
long  addr_index 
)

pdc_system_map_find_addrs - Retrieve additional address ranges. : Return buffer address. : Fixed address module index. : Address range index.

Retrieve additional information about subsequent address ranges for modules with multiple address ranges.

Definition at line 402 of file firmware.c.

int pdc_system_map_find_mods ( struct pdc_system_map_mod_info pdc_mod_info,
struct pdc_module_path mod_path,
long  mod_index 
)

pdc_system_map_find_mods - Locate unarchitected modules. : Return buffer address. : pointer to dev path structure. : fixed address module index.

To locate and identify modules which reside at fixed I/O addresses, which do not self-identify via architected bus walks.

Definition at line 375 of file firmware.c.

int pdc_tod_read ( struct pdc_tod tod)

pdc_tod_read - Read the Time-Of-Day clock. : The return buffer:

Read the Time-Of-Day clock

Definition at line 943 of file firmware.c.

int pdc_tod_set ( unsigned long  sec,
unsigned long  usec 
)

pdc_tod_set - Set the Time-Of-Day clock. : The number of seconds since epoch. : The number of micro seconds.

Set the Time-Of-Day clock.

Definition at line 965 of file firmware.c.

long real32_call ( unsigned long  function,
  ... 
)

Definition at line 1414 of file firmware.c.

void __cpuinit set_firmware_width ( void  )

Definition at line 182 of file firmware.c.

void __cpuinit set_firmware_width_unlocked ( void  )

Definition at line 178 of file firmware.c.

Variable Documentation

unsigned long pdc_result[NUM_PDC_RESULT]
unsigned long pdc_result2[NUM_PDC_RESULT]