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.
201 * pdc_emergency_unlock - Unlock the linux pdc lock
215 * pdc_add_valid - Verify address can be accessed without causing a HPMC.
237 * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler.
257 * pdc_chassis_info - Return chassis information.
282 * pdc_pat_chassis_send_log - Sends a PDC PAT CHASSIS log message.
283 * @retval: -1 on error, 0 on success. Other value are PDC errors
294 return -1; in pdc_pat_chassis_send_log()
305 * pdc_chassis_disp - Updates chassis code
306 * @retval: -1 on error, 0 on success
321 * pdc_cpu_rendenzvous - Stop currently executing CPU
322 * @retval: -1 on error, 0 on success
333 * pdc_cpu_rendezvous_lock - Lock PDC while transitioning to rendezvous state
341 * pdc_cpu_rendezvous_unlock - Unlock PDC after reaching rendezvous state
349 * pdc_pat_get_PDC_entrypoint - Get PDC entry point for current CPU
350 * @retval: -1 on error, 0 on success
371 * pdc_chassis_warn - Fetches chassis warnings
372 * @retval: -1 on error, 0 on success
393 pdc_coproc_info->ccr_functional = pdc_result[0]; in pdc_coproc_cfg_unlocked()
394 pdc_coproc_info->ccr_present = pdc_result[1]; in pdc_coproc_cfg_unlocked()
395 pdc_coproc_info->revision = pdc_result[17]; in pdc_coproc_cfg_unlocked()
396 pdc_coproc_info->model = pdc_result[18]; in pdc_coproc_cfg_unlocked()
402 * pdc_coproc_cfg - To identify coprocessors attached to the processor.
421 * pdc_iodc_read - Read data from the modules IODC.
450 * pdc_system_map_find_mods - Locate unarchitected modules.
456 * do not self-identify via architected bus walks.
472 pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr); in pdc_system_map_find_mods()
477 * pdc_system_map_find_addrs - Retrieve additional address ranges.
498 pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr); in pdc_system_map_find_addrs()
503 * pdc_model_info - Return model information about the processor.
523 * pdc_model_sysmodel - Get the system model name.
551 * pdc_model_versions - Identify the version number of each processor.
557 * This comment was here before, but I do not know what it means :( -RB
558 * id: 0 = cpu revision, 1 = boot-rom-version
575 * pdc_model_cpuid - Returns the CPU_ID.
597 * pdc_model_capabilities - Returns the platform capabilities.
600 * Returns information about platform support for 32- and/or 64-bit
601 * OSes, IO-PDIR coherency, and virtual aliasing.
623 * pdc_model_platform_info - Returns machine product and serial number.
647 * pdc_cache_info - Return cache and TLB information.
667 * pdc_spaceid_bits - Return whether Space ID hashing is turned on.
689 * pdc_btlb_info - Return block TLB information.
705 btlb->max_size = 0; in pdc_btlb_info()
711 * pdc_mem_map_hpa - Find fixed module information.
740 * pdc_lan_station_id - Get the LAN address.
767 * pdc_stable_read - Read data from Stable Storage.
768 * @staddr: Stable Storage address to access.
769 * @memaddr: The memory address where Stable Storage data shall be copied.
772 * This PDC call reads from the Stable Storage address supplied in staddr
793 * pdc_stable_write - Write data to Stable Storage.
794 * @staddr: Stable Storage address to access.
795 * @memaddr: The memory address where Stable Storage data shall be read from.
799 * and copies count bytes to the Stable Storage address staddr.
819 * pdc_stable_get_size - Get Stable Storage size in bytes.
822 * This PDC call returns the number of bytes in the processor's Stable
823 * Storage, which is the number of contiguous bytes implemented in Stable
824 * Storage starting from staddr=0. size in an unsigned 64-bit integer
842 * pdc_stable_verify_contents - Checks that Stable Storage contents are valid.
845 * contents of Stable Storage.
861 * pdc_stable_initialize - Sets Stable Storage contents to zero and initialize
864 * This PDC call will erase all contents of Stable Storage. Use with care!
880 * pdc_get_initiator - Get the SCSI Interface Card params (SCSI ID, SDTR, SE or LVD)
889 * o set SCSI id for Multi-initiator clusters,
900 /* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */ in pdc_get_initiator()
910 initiator->host_id = pdc_result[0]; in pdc_get_initiator()
912 initiator->host_id = -1; in pdc_get_initiator()
920 case 1: initiator->factor = 50; break; in pdc_get_initiator()
921 case 2: initiator->factor = 25; break; in pdc_get_initiator()
922 case 5: initiator->factor = 12; break; in pdc_get_initiator()
923 case 25: initiator->factor = 10; break; in pdc_get_initiator()
924 case 20: initiator->factor = 12; break; in pdc_get_initiator()
925 case 40: initiator->factor = 10; break; in pdc_get_initiator()
926 default: initiator->factor = -1; break; in pdc_get_initiator()
930 initiator->width = pdc_result[4]; in pdc_get_initiator()
931 initiator->mode = pdc_result[5]; in pdc_get_initiator()
933 initiator->width = -1; in pdc_get_initiator()
934 initiator->mode = -1; in pdc_get_initiator()
946 * pdc_pci_irt_size - Get the number of entries in the interrupt routing table.
952 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
970 * pdc_pci_irt - Get the PCI interrupt routing table.
976 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
995 #if 0 /* UNTEST CODE - left here in case someone needs it */
998 * pdc_pci_config_read - read PCI config space.
1021 * pdc_pci_config_write - read PCI config space.
1024 * @val value we want in the 32-bit register
1045 * pdc_tod_read - Read the Time-Of-Day clock.
1048 * Read the Time-Of-Day clock
1096 * 64-bit kernels should not call this PDT function in narrow mode. in pdc_mem_pdt_read_entries()
1097 * The pdt_entries_ptr array above will now contain 32-bit values in pdc_mem_pdt_read_entries()
1107 * pdc_pim_toc11 - Fetch TOC PIM 1.1 data from firmware.
1123 * pdc_pim_toc20 - Fetch TOC PIM 2.0 data from firmware.
1139 * pdc_tod_set - Set the Time-Of-Day clock.
1143 * Set the Time-Of-Day clock.
1194 * pdc_do_reset - Reset the system.
1211 * pdc_soft_power_info - Enable soft power switch.
1212 * @power_reg: address of soft power register
1214 * Return the absolute address of the soft power switch register
1221 *power_reg = (unsigned long) (-1); in pdc_soft_power_info()
1235 * pdc_soft_power_button - Control the soft power button behaviour
1239 * This PDC function places the soft power button under software or
1242 * down the system. Under hardware control pressing the power button
1258 * pdc_io_reset - Hack to avoid overlapping range registers of Bridges devices.
1259 * Primarily a problem on T600 (which parisc-linux doesn't support) but
1272 * pdc_io_reset_devices - Hack to Stop USB controller
1296 * pdc_iodc_print - Console print using IODC.
1326 real32_call(PAGE0->mem_cons.iodc_io, in pdc_iodc_print()
1327 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT, in pdc_iodc_print()
1328 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), in pdc_iodc_print()
1337 * pdc_iodc_getc - Read a character (non-blocking) from the PDC console.
1339 * Read a character (non-blocking) from the PDC console, returns -1 if
1349 if (!PAGE0->mem_kbd.iodc_io) in pdc_iodc_getc()
1352 /* wait for a keyboard (rs232)-input */ in pdc_iodc_getc()
1354 real32_call(PAGE0->mem_kbd.iodc_io, in pdc_iodc_getc()
1355 (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN, in pdc_iodc_getc()
1356 PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers), in pdc_iodc_getc()
1364 return -1; in pdc_iodc_getc()
1386 * pdc_pat_cell_get_number - Returns the cell number.
1406 * pdc_pat_cell_module - Retrieve the cell's module information.
1436 * pdc_pat_cell_info - Retrieve the cell's information.
1440 * @cell_number: The cell number which should be asked, or -1 for current cell.
1466 * pdc_pat_cpu_get_number - Retrieve the cpu number.
1487 * pdc_pat_get_irt_size - Retrieve the number of entries in the cell's interrupt table.
1509 * pdc_pat_get_irt - Retrieve the cell's interrupt table.
1529 * pdc_pat_pd_get_addr_map - Retrieve information about memory address ranges.
1553 * pdc_pat_pd_get_PDC_interface_revisions - Retrieve PDC interface revisions.
1580 * pdc_pat_io_pci_cfg_read - Read PCI configuration space.
1605 * pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges.
1626 * pdc_pat_mem_pdc_info - Retrieve information about page deallocation table
1646 * pdc_pat_mem_pdt_cell_info - Retrieve information about page deallocation
1669 * pdc_pat_mem_read_cell_pdt - Read PDT entries from (old) PAT firmware
1690 pret->pdt_entries = entries; in pdc_pat_mem_read_cell_pdt()
1691 pret->actual_count_bytes = entries * sizeof(unsigned long); in pdc_pat_mem_read_cell_pdt()
1700 * pdc_pat_mem_read_pd_pdt - Read PDT entries from (newer) PAT firmware
1721 pret->actual_count_bytes = entries; in pdc_pat_mem_read_pd_pdt()
1722 pret->pdt_entries = entries / sizeof(unsigned long); in pdc_pat_mem_read_pd_pdt()
1731 * pdc_pat_mem_get_dimm_phys_location - Get physical DIMM slot via PAT firmware
1758 /***************** 32-bit real-mode calls ***********/
1760 * to overlay real_stack (real2.S), preparing a 32-bit call frame.
1814 /***************** 64-bit real-mode calls ***********/