Lines Matching +full:power +full:- +full:stable +full:- +full:time
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * arch/parisc/kernel/firmware.c - safe PDC access routines
14 * Copyright 2003 Grant Grundler <grundler parisc-linux org>
15 * Copyright 2003,2004 Ryan Bradetich <rbrad@parisc-linux.org>
16 * Copyright 2004,2006 Thibaut VARENE <varenet@parisc-linux.org>
22 * - the name of the pdc wrapper should match one of the macros
24 * - don't use caps for random parts of the name
25 * - use the static PDC result buffers and "copyout" to structs
27 * - hold pdc_lock while in PDC or using static result buffers
28 * - use __pa() to convert virtual (kernel) pointers to physical
30 * - the name of the struct used for pdc return values should equal
33 * - keep the order of arguments
34 * - don't be smart (setting trailing NUL bytes for strings, return
89 /* On most currently-supported platforms, IODC I/O calls are 32-bit calls
91 * Some PAT boxes may have 64-bit IODC I/O.
94 * 64-bit kernels to run on systems with 32-bit MEM_PDC calls.
96 * We now detect 32-bit-only PDC and dynamically switch to 32-bit mode
97 * when running a 64-bit kernel on such boxes (e.g. C200 or C360).
106 # define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc
109 # define MEM_PDC (unsigned long)PAGE0->mem_pdc
115 * f_extend - Convert PDC addresses to kernel addresses.
136 * convert_to_wide - Convert the return buffer addresses into kernel addresses.
150 for (i = (NUM_PDC_RESULT-1); i >= 0; --i) in convert_to_wide()
169 * set_firmware_width - Determine if the firmware is wide or narrow.
196 * pdc_emergency_unlock - Unlock the linux pdc lock
210 * pdc_add_valid - Verify address can be accessed without causing a HPMC.
232 * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler.
252 * pdc_chassis_info - Return chassis information.
277 * pdc_pat_chassis_send_log - Sends a PDC PAT CHASSIS log message.
278 * @retval: -1 on error, 0 on success. Other value are PDC errors
289 return -1; in pdc_pat_chassis_send_log()
300 * pdc_chassis_disp - Updates chassis code
301 * @retval: -1 on error, 0 on success
316 * pdc_cpu_rendenzvous - Stop currently executing CPU
317 * @retval: -1 on error, 0 on success
329 * pdc_chassis_warn - Fetches chassis warnings
330 * @retval: -1 on error, 0 on success
351 pdc_coproc_info->ccr_functional = pdc_result[0]; in pdc_coproc_cfg_unlocked()
352 pdc_coproc_info->ccr_present = pdc_result[1]; in pdc_coproc_cfg_unlocked()
353 pdc_coproc_info->revision = pdc_result[17]; in pdc_coproc_cfg_unlocked()
354 pdc_coproc_info->model = pdc_result[18]; in pdc_coproc_cfg_unlocked()
360 * pdc_coproc_cfg - To identify coprocessors attached to the processor.
379 * pdc_iodc_read - Read data from the modules IODC.
408 * pdc_system_map_find_mods - Locate unarchitected modules.
414 * do not self-identify via architected bus walks.
430 pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr); in pdc_system_map_find_mods()
435 * pdc_system_map_find_addrs - Retrieve additional address ranges.
456 pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr); in pdc_system_map_find_addrs()
461 * pdc_model_info - Return model information about the processor.
481 * pdc_model_sysmodel - Get the system model name.
509 * pdc_model_versions - Identify the version number of each processor.
515 * This comment was here before, but I do not know what it means :( -RB
516 * id: 0 = cpu revision, 1 = boot-rom-version
533 * pdc_model_cpuid - Returns the CPU_ID.
555 * pdc_model_capabilities - Returns the platform capabilities.
558 * Returns information about platform support for 32- and/or 64-bit
559 * OSes, IO-PDIR coherency, and virtual aliasing.
581 * pdc_model_platform_info - Returns machine product and serial number.
605 * pdc_cache_info - Return cache and TLB information.
625 * pdc_spaceid_bits - Return whether Space ID hashing is turned on.
647 * pdc_btlb_info - Return block TLB information.
663 btlb->max_size = 0; in pdc_btlb_info()
669 * pdc_mem_map_hpa - Find fixed module information.
698 * pdc_lan_station_id - Get the LAN address.
725 * pdc_stable_read - Read data from Stable Storage.
726 * @staddr: Stable Storage address to access.
727 * @memaddr: The memory address where Stable Storage data shall be copied.
730 * This PDC call reads from the Stable Storage address supplied in staddr
751 * pdc_stable_write - Write data to Stable Storage.
752 * @staddr: Stable Storage address to access.
753 * @memaddr: The memory address where Stable Storage data shall be read from.
757 * and copies count bytes to the Stable Storage address staddr.
777 * pdc_stable_get_size - Get Stable Storage size in bytes.
780 * This PDC call returns the number of bytes in the processor's Stable
781 * Storage, which is the number of contiguous bytes implemented in Stable
782 * Storage starting from staddr=0. size in an unsigned 64-bit integer
800 * pdc_stable_verify_contents - Checks that Stable Storage contents are valid.
803 * contents of Stable Storage.
819 * pdc_stable_initialize - Sets Stable Storage contents to zero and initialize
822 * This PDC call will erase all contents of Stable Storage. Use with care!
838 * pdc_get_initiator - Get the SCSI Interface Card params (SCSI ID, SDTR, SE or LVD)
847 * o set SCSI id for Multi-initiator clusters,
858 /* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */ in pdc_get_initiator()
868 initiator->host_id = pdc_result[0]; in pdc_get_initiator()
870 initiator->host_id = -1; in pdc_get_initiator()
878 case 1: initiator->factor = 50; break; in pdc_get_initiator()
879 case 2: initiator->factor = 25; break; in pdc_get_initiator()
880 case 5: initiator->factor = 12; break; in pdc_get_initiator()
881 case 25: initiator->factor = 10; break; in pdc_get_initiator()
882 case 20: initiator->factor = 12; break; in pdc_get_initiator()
883 case 40: initiator->factor = 10; break; in pdc_get_initiator()
884 default: initiator->factor = -1; break; in pdc_get_initiator()
888 initiator->width = pdc_result[4]; in pdc_get_initiator()
889 initiator->mode = pdc_result[5]; in pdc_get_initiator()
891 initiator->width = -1; in pdc_get_initiator()
892 initiator->mode = -1; in pdc_get_initiator()
904 * pdc_pci_irt_size - Get the number of entries in the interrupt routing table.
910 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
928 * pdc_pci_irt - Get the PCI interrupt routing table.
934 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
953 #if 0 /* UNTEST CODE - left here in case someone needs it */
956 * pdc_pci_config_read - read PCI config space.
979 * pdc_pci_config_write - read PCI config space.
982 * @val value we want in the 32-bit register
1003 * pdc_tod_read - Read the Time-Of-Day clock.
1006 * Read the Time-Of-Day clock
1054 * 64-bit kernels should not call this PDT function in narrow mode. in pdc_mem_pdt_read_entries()
1055 * The pdt_entries_ptr array above will now contain 32-bit values in pdc_mem_pdt_read_entries()
1065 * pdc_tod_set - Set the Time-Of-Day clock.
1069 * Set the Time-Of-Day clock.
1120 * pdc_do_reset - Reset the system.
1137 * pdc_soft_power_info - Enable soft power switch.
1138 * @power_reg: address of soft power register
1140 * Return the absolute address of the soft power switch register
1147 *power_reg = (unsigned long) (-1); in pdc_soft_power_info()
1161 * pdc_soft_power_button - Control the soft power button behaviour
1165 * This PDC function places the soft power button under software or
1168 * down the system. Under hardware control pressing the power button
1184 * pdc_io_reset - Hack to avoid overlapping range registers of Bridges devices.
1185 * Primarily a problem on T600 (which parisc-linux doesn't support) but
1198 * pdc_io_reset_devices - Hack to Stop USB controller
1222 * pdc_iodc_print - Console print using IODC.
1252 real32_call(PAGE0->mem_cons.iodc_io, in pdc_iodc_print()
1253 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT, in pdc_iodc_print()
1254 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), in pdc_iodc_print()
1263 * pdc_iodc_getc - Read a character (non-blocking) from the PDC console.
1265 * Read a character (non-blocking) from the PDC console, returns -1 if
1275 if (!PAGE0->mem_kbd.iodc_io) in pdc_iodc_getc()
1278 /* wait for a keyboard (rs232)-input */ in pdc_iodc_getc()
1280 real32_call(PAGE0->mem_kbd.iodc_io, in pdc_iodc_getc()
1281 (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN, in pdc_iodc_getc()
1282 PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers), in pdc_iodc_getc()
1290 return -1; in pdc_iodc_getc()
1312 * pdc_pat_cell_get_number - Returns the cell number.
1332 * pdc_pat_cell_module - Retrieve the cell's module information.
1362 * pdc_pat_cell_info - Retrieve the cell's information.
1366 * @cell_number: The cell number which should be asked, or -1 for current cell.
1392 * pdc_pat_cpu_get_number - Retrieve the cpu number.
1413 * pdc_pat_get_irt_size - Retrieve the number of entries in the cell's interrupt table.
1435 * pdc_pat_get_irt - Retrieve the cell's interrupt table.
1455 * pdc_pat_pd_get_addr_map - Retrieve information about memory address ranges.
1479 * pdc_pat_pd_get_PDC_interface_revisions - Retrieve PDC interface revisions.
1506 * pdc_pat_io_pci_cfg_read - Read PCI configuration space.
1531 * pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges.
1552 * pdc_pat_mem_pdc_info - Retrieve information about page deallocation table
1572 * pdc_pat_mem_pdt_cell_info - Retrieve information about page deallocation
1595 * pdc_pat_mem_read_cell_pdt - Read PDT entries from (old) PAT firmware
1616 pret->pdt_entries = entries; in pdc_pat_mem_read_cell_pdt()
1617 pret->actual_count_bytes = entries * sizeof(unsigned long); in pdc_pat_mem_read_cell_pdt()
1626 * pdc_pat_mem_read_pd_pdt - Read PDT entries from (newer) PAT firmware
1647 pret->actual_count_bytes = entries; in pdc_pat_mem_read_pd_pdt()
1648 pret->pdt_entries = entries / sizeof(unsigned long); in pdc_pat_mem_read_pd_pdt()
1657 * pdc_pat_mem_get_dimm_phys_location - Get physical DIMM slot via PAT firmware
1684 /***************** 32-bit real-mode calls ***********/
1686 * to overlay real_stack (real2.S), preparing a 32-bit call frame.
1740 /***************** 64-bit real-mode calls ***********/