Lines Matching +full:pdc +full:- +full:global
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2001 Matthew Wilcox for Hewlett-Packard
13 * Map before checking for a Snake -- this probably doesn't cause any
26 #include <asm/pdc.h>
30 #include <asm/parisc-device.h>
35 ** DEBUG_PAT Dump details which PDC PAT provides about ranges/devices.
58 /* Determine the pdc "type" used on this machine */ in setup_pdc()
60 printk(KERN_INFO "Determining PDC firmware type: "); in setup_pdc()
71 * is a pdc pat box, or it is an older box. All 64 bit capable in setup_pdc()
72 * machines are either pdc pat boxes or they support PDC_SYSTEM_MAP. in setup_pdc()
92 pr_info("PAT: legacy revision 0x%lx, pat_rev 0x%lx, pdc_cap 0x%lx, S-PTLB %d, HPMC_RENDEZ %d.\n", in setup_pdc()
123 panic("If this is a 64-bit machine, please try a 64-bit kernel.\n"); in setup_pdc()
127 #define PDC_PAGE_ADJ_SHIFT (PAGE_SHIFT - 12) /* pdc pages are always 4k */
137 * pdc info is bad in this case). in set_pmem_entry()
140 if (unlikely( ((start & (PAGE_SIZE - 1)) != 0) in set_pmem_entry()
141 || ((pages4k & ((1UL << PDC_PAGE_ADJ_SHIFT) - 1)) != 0) )) { in set_pmem_entry()
146 pmem_ptr->start_pfn = (start >> PAGE_SHIFT); in set_pmem_entry()
147 pmem_ptr->pages = (pages4k >> PDC_PAGE_ADJ_SHIFT); in set_pmem_entry()
167 npages = (PAGE_ALIGN(PAGE0->imm_max_mem) >> PAGE_SHIFT); in pagezero_memconfig()
174 /* All of the PDC PAT specific code is 64-bit only */
192 unsigned long temp; /* 64-bit scratch value */ in pat_query_module()
193 long status; /* PDC return value status */ in pat_query_module()
210 temp = pa_pdc_cell->cba; in pat_query_module()
211 dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path)); in pat_query_module()
217 /* alloc_pa_dev sets dev->hpa */ in pat_query_module()
224 dev->pcell_loc = pcell_loc; in pat_query_module()
225 dev->mod_index = mod_index; in pat_query_module()
229 dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */ in pat_query_module()
230 dev->pmod_loc = pa_pdc_cell->mod_location; in pat_query_module()
231 dev->mod0 = pa_pdc_cell->mod[0]; in pat_query_module()
237 switch (PAT_GET_ENTITY(dev->mod_info)) { in pat_query_module()
243 pa_pdc_cell->mod[0]); in pat_query_module()
249 pa_pdc_cell->mod[0], pa_pdc_cell->mod[1], in pat_query_module()
250 pa_pdc_cell->mod[2]); in pat_query_module()
270 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]); in pat_query_module()
271 for (i = 0; i < pa_pdc_cell->mod[1]; i++) { in pat_query_module()
274 i, pa_pdc_cell->mod[2 + i * 3], /* type */ in pat_query_module()
275 pa_pdc_cell->mod[3 + i * 3], /* start */ in pat_query_module()
276 pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */ in pat_query_module()
294 /* pat pdc can return information about a variety of different
321 /* The above pdc call shouldn't fail, but, just in in pat_memconfig()
346 pmem_ptr = pmem_ranges; /* Global firmware independent table */ in pat_memconfig()
348 if ( (mtbl_ptr->entry_type != PAT_MEMORY_DESCRIPTOR) in pat_memconfig()
349 || (mtbl_ptr->memory_type != PAT_MEMTYPE_MEMORY) in pat_memconfig()
350 || (mtbl_ptr->pages == 0) in pat_memconfig()
351 || ( (mtbl_ptr->memory_usage != PAT_MEMUSE_GENERAL) in pat_memconfig()
352 && (mtbl_ptr->memory_usage != PAT_MEMUSE_GI) in pat_memconfig()
353 && (mtbl_ptr->memory_usage != PAT_MEMUSE_GNI) ) ) { in pat_memconfig()
364 set_pmem_entry(pmem_ptr++,mtbl_ptr->paddr,mtbl_ptr->pages); in pat_memconfig()
377 ** implement PDC_PAT_CELL sub-options 0 and 2. in pat_inventory()
412 /* The above pdc call only works on boxes with sprockets in sprockets_memconfig()
413 * firmware (newer B,C,J class). Other non PAT PDC machines in sprockets_memconfig()
431 pmem_ptr = pmem_ranges; /* Global firmware independent table */ in sprockets_memconfig()
433 set_pmem_entry(pmem_ptr++,mtbl_ptr->paddr,mtbl_ptr->pages); in sprockets_memconfig()
460 dev = alloc_pa_dev(r_addr->hpa, &module_path->path); in legacy_create_device()
473 * mod to get the HPA for the top-level devices. Bus adapters may have
474 * sub-devices which are discovered by setting bc[5] to 0 and bc[4] to the
489 if ((!dev) || (dev->id.hw_type != HPHW_BA)) in snake_inventory()
510 * add_system_map_addresses - Add additional addresses to the parisc device.
526 dev->addr = kmalloc_array(num_addrs, sizeof(*dev->addr), GFP_KERNEL); in add_system_map_addresses()
527 if(!dev->addr) { in add_system_map_addresses()
537 dev->addr[dev->num_addrs] = (unsigned long)addr_result.mod_addr; in add_system_map_addresses()
538 dev->num_addrs++; in add_system_map_addresses()
548 * system_map_inventory - Retrieve firmware devices via SYSTEM_MAP.
551 * knows about via the SYSTEM_MAP PDC call.
604 panic("Unknown PDC type!\n"); in do_memory_inventory()
635 panic("Unknown PDC type!\n"); in do_device_inventory()
651 base = ((unsigned long long) PAGE0->pad0[2] << 32) in do_device_inventory()
652 | PAGE0->pad0[3]; /* SeaBIOS stored it here */ in do_device_inventory()
656 res[0].end = base + 8 - 1; in do_device_inventory()