Lines Matching +full:pdc +full:- +full:ranges
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * arch/parisc/kernel/firmware.c - safe PDC access routines
5 * PDC == Processor Dependent Code
7 * See PDC documentation at
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>
20 * guidelines when writing PDC wrappers:
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
32 * corresponding PDC call
33 * - keep the order of arguments
34 * - don't be smart (setting trailing NUL bytes for strings, return
64 #include <asm/pdc.h>
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.
116 * @address: Address returned from PDC.
118 * This function is used to convert PDC addresses into kernel addresses
119 * when the PDC address size and kernel address size are different.
136 * convert_to_wide - Convert the return buffer addresses into kernel addresses.
137 * @addr: The return buffer from PDC.
139 * This function is used to convert the return buffer addresses retrieved from PDC
140 * into kernel addresses when the PDC address size and kernel address size are
150 for (i = (NUM_PDC_RESULT-1); i >= 0; --i) in convert_to_wide()
171 * set_firmware_width - Determine if the firmware is wide or narrow.
203 * pdc_emergency_unlock - Unlock the linux pdc lock
205 * This call unlocks the linux pdc lock in case we need some PDC functions
217 * pdc_add_valid - Verify address can be accessed without causing a HPMC.
220 * This PDC call attempts to read from the specified address and verifies
239 * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler.
259 * pdc_chassis_info - Return chassis information.
284 * pdc_pat_chassis_send_log - Sends a PDC PAT CHASSIS log message.
297 return -1; in pdc_pat_chassis_send_log()
308 * pdc_chassis_disp - Updates chassis code
324 * __pdc_cpu_rendezvous - Stop currently executing CPU and do not return.
335 * pdc_cpu_rendezvous_lock - Lock PDC while transitioning to rendezvous state
343 * pdc_cpu_rendezvous_unlock - Unlock PDC after reaching rendezvous state
351 * pdc_pat_get_PDC_entrypoint - Get PDC entry point for current CPU
352 * @pdc_entry: pointer to where the PDC entry point should be stored
373 * pdc_chassis_warn - Fetches chassis warnings
395 pdc_coproc_info->ccr_functional = pdc_result[0]; in pdc_coproc_cfg_unlocked()
396 pdc_coproc_info->ccr_present = pdc_result[1]; in pdc_coproc_cfg_unlocked()
397 pdc_coproc_info->revision = pdc_result[17]; in pdc_coproc_cfg_unlocked()
398 pdc_coproc_info->model = pdc_result[18]; in pdc_coproc_cfg_unlocked()
404 * pdc_coproc_cfg - To identify coprocessors attached to the processor.
407 * This PDC call returns the presence and status of all the coprocessors
423 * pdc_iodc_read - Read data from the modules IODC.
430 * This PDC call reads from the IODC of the module specified by the hpa
452 * pdc_system_map_find_mods - Locate unarchitected modules.
458 * do not self-identify via architected bus walks.
474 pdc_mod_info->mod_addr = f_extend(pdc_mod_info->mod_addr); in pdc_system_map_find_mods()
479 * pdc_system_map_find_addrs - Retrieve additional address ranges.
484 * Retrieve additional information about subsequent address ranges for modules
485 * with multiple address ranges.
500 pdc_addr_info->mod_addr = f_extend(pdc_addr_info->mod_addr); in pdc_system_map_find_addrs()
505 * pdc_model_info - Return model information about the processor.
525 * pdc_model_sysmodel - Get the system model name.
529 * Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L).
554 * pdc_model_versions - Identify the version number of each processor.
560 * This comment was here before, but I do not know what it means :( -RB
561 * id: 0 = cpu revision, 1 = boot-rom-version
578 * pdc_model_cpuid - Returns the CPU_ID.
600 * pdc_model_capabilities - Returns the platform capabilities.
603 * Returns information about platform support for 32- and/or 64-bit
604 * OSes, IO-PDIR coherency, and virtual aliasing.
626 * pdc_model_platform_info - Returns machine product and serial number.
650 * pdc_cache_info - Return cache and TLB information.
670 * pdc_spaceid_bits - Return whether Space ID hashing is turned on.
691 * pdc_btlb_info - Return block TLB information.
710 btlb->max_size = 0; in pdc_btlb_info()
746 * pdc_mem_map_hpa - Find fixed module information.
777 * pdc_lan_station_id - Get the LAN address.
804 * pdc_stable_read - Read data from Stable Storage.
809 * This PDC call reads from the Stable Storage address supplied in staddr
830 * pdc_stable_write - Write data to Stable Storage.
835 * This PDC call reads count bytes from the supplied memaddr address,
856 * pdc_stable_get_size - Get Stable Storage size in bytes.
859 * This PDC call returns the number of bytes in the processor's Stable
861 * Storage starting from staddr=0. size in an unsigned 64-bit integer
879 * pdc_stable_verify_contents - Checks that Stable Storage contents are valid.
881 * This PDC call is meant to be used to check the integrity of the current
898 * pdc_stable_initialize - Sets Stable Storage contents to zero and initialize
901 * This PDC call will erase all contents of Stable Storage. Use with care!
917 * pdc_get_initiator - Get the SCSI Interface Card params (SCSI ID, SDTR, SE or LVD)
921 * Get the SCSI operational parameters from PDC.
926 * o set SCSI id for Multi-initiator clusters,
937 /* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */ in pdc_get_initiator()
938 #define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \ in pdc_get_initiator()
939 strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785", 8) == 0) in pdc_get_initiator()
947 initiator->host_id = pdc_result[0]; in pdc_get_initiator()
949 initiator->host_id = -1; in pdc_get_initiator()
957 case 1: initiator->factor = 50; break; in pdc_get_initiator()
958 case 2: initiator->factor = 25; break; in pdc_get_initiator()
959 case 5: initiator->factor = 12; break; in pdc_get_initiator()
960 case 25: initiator->factor = 10; break; in pdc_get_initiator()
961 case 20: initiator->factor = 12; break; in pdc_get_initiator()
962 case 40: initiator->factor = 10; break; in pdc_get_initiator()
963 default: initiator->factor = -1; break; in pdc_get_initiator()
967 initiator->width = pdc_result[4]; in pdc_get_initiator()
968 initiator->mode = pdc_result[5]; in pdc_get_initiator()
970 initiator->width = -1; in pdc_get_initiator()
971 initiator->mode = -1; in pdc_get_initiator()
983 * pdc_pci_irt_size - Get the number of entries in the interrupt routing table.
987 * This PDC function returns the number of entries in the specified cell's
989 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
1007 * pdc_pci_irt - Get the PCI interrupt routing table.
1013 * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
1032 #if 0 /* UNTEST CODE - left here in case someone needs it */
1035 * pdc_pci_config_read - read PCI config space.
1036 * @hpa: Token from PDC to indicate which PCI device
1058 * pdc_pci_config_write - read PCI config space.
1059 * @hpa: Token from PDC to indicate which PCI device
1061 * @val: Value we want in the 32-bit register
1082 * pdc_tod_read - Read the Time-Of-Day clock.
1085 * Read the Time-Of-Day clock
1133 * 64-bit kernels should not call this PDT function in narrow mode. in pdc_mem_pdt_read_entries()
1134 * The pdt_entries_ptr array above will now contain 32-bit values in pdc_mem_pdt_read_entries()
1144 * pdc_pim_toc11 - Fetch TOC PIM 1.1 data from firmware.
1160 * pdc_pim_toc20 - Fetch TOC PIM 2.0 data from firmware.
1176 * pdc_tod_set - Set the Time-Of-Day clock.
1180 * Set the Time-Of-Day clock.
1213 /* FIXME: Is this pdc used? I could not find type reference to ftc_bitmap
1231 * pdc_do_reset - Reset the system.
1248 * pdc_soft_power_info - Enable soft power switch.
1258 *power_reg = (unsigned long) (-1); in pdc_soft_power_info()
1272 * pdc_soft_power_button{_panic} - Control the soft power button behaviour
1276 * This PDC function places the soft power button under software or
1304 return -EBUSY; /* ignored by the panic notifier */ in pdc_soft_power_button_panic()
1314 * pdc_io_reset - Hack to avoid overlapping range registers of Bridges devices.
1315 * Primarily a problem on T600 (which parisc-linux doesn't support) but
1328 * pdc_io_reset_devices - Hack to Stop USB controller
1330 * If PDC used the usb controller, the usb controller
1332 * setup, because of still running DMA. This PDC call
1351 * pdc_iodc_print - Console print using IODC.
1384 real32_call(PAGE0->mem_cons.iodc_io, in pdc_iodc_print()
1385 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT, in pdc_iodc_print()
1386 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), in pdc_iodc_print()
1390 return i - found; in pdc_iodc_print()
1395 * pdc_iodc_getc - Read a character (non-blocking) from the PDC console.
1397 * Read a character (non-blocking) from the PDC console, returns -1 if
1407 if (!PAGE0->mem_kbd.iodc_io) in pdc_iodc_getc()
1410 /* wait for a keyboard (rs232)-input */ in pdc_iodc_getc()
1412 real32_call(PAGE0->mem_kbd.iodc_io, in pdc_iodc_getc()
1413 (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN, in pdc_iodc_getc()
1414 PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers), in pdc_iodc_getc()
1423 return -1; in pdc_iodc_getc()
1453 * pdc_pat_cell_get_number - Returns the cell number.
1456 * This PDC call returns the cell number of the cell from which the call
1473 * pdc_pat_cell_module - Retrieve the cell's module information.
1480 * This PDC call returns information about each module attached to the cell
1503 * pdc_pat_cell_info - Retrieve the cell's information.
1507 * @cell_number: The cell number which should be asked, or -1 for current cell.
1509 * This PDC call returns information about the given cell (or all cells).
1533 * pdc_pat_cpu_get_number - Retrieve the cpu number.
1554 * pdc_pat_get_irt_size - Retrieve the number of entries in the cell's interrupt table.
1558 * This PDC function returns the number of entries in the specified cell's
1576 * pdc_pat_get_irt - Retrieve the cell's interrupt table.
1580 * This PDC function returns the actual interrupt table for the specified cell.
1596 * pdc_pat_pd_get_addr_map - Retrieve information about memory address ranges.
1620 * pdc_pat_pd_get_pdc_revisions - Retrieve PDC interface revisions.
1623 * @pdc_cap: The PDC capabilities.
1647 * pdc_pat_io_pci_cfg_read - Read PCI configuration space.
1672 * pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges.
1693 * pdc_pat_mem_pdt_info - Retrieve information about page deallocation table
1713 * pdc_pat_mem_pdt_cell_info - Retrieve information about page deallocation
1736 * pdc_pat_mem_read_cell_pdt - Read PDT entries from (old) PAT firmware
1757 pret->pdt_entries = entries; in pdc_pat_mem_read_cell_pdt()
1758 pret->actual_count_bytes = entries * sizeof(unsigned long); in pdc_pat_mem_read_cell_pdt()
1767 * pdc_pat_mem_read_pd_pdt - Read PDT entries from (newer) PAT firmware
1788 pret->actual_count_bytes = entries; in pdc_pat_mem_read_pd_pdt()
1789 pret->pdt_entries = entries / sizeof(unsigned long); in pdc_pat_mem_read_pd_pdt()
1798 * pdc_pat_mem_get_dimm_phys_location - Get physical DIMM slot via PAT firmware
1825 /***************** 32-bit real-mode calls ***********/
1827 * to overlay real_stack (real2.S), preparing a 32-bit call frame.
1881 /***************** 64-bit real-mode calls ***********/