void __init setup_pdc()

in kernel/inventory.c [47:125]


void __init setup_pdc(void)
{
	long status;
	unsigned int bus_id;
	struct pdc_system_map_mod_info module_result;
	struct pdc_module_path module_path;
	struct pdc_model model;
#ifdef CONFIG_64BIT
	struct pdc_pat_cell_num cell_info;
#endif

	/* Determine the pdc "type" used on this machine */

	printk(KERN_INFO "Determining PDC firmware type: ");

	status = pdc_system_map_find_mods(&module_result, &module_path, 0);
	if (status == PDC_OK) {
		pdc_type = PDC_TYPE_SYSTEM_MAP;
		pr_cont("System Map.\n");
		return;
	}

	/*
	 * If the machine doesn't support PDC_SYSTEM_MAP then either it
	 * is a pdc pat box, or it is an older box. All 64 bit capable
	 * machines are either pdc pat boxes or they support PDC_SYSTEM_MAP.
	 */

	/*
	 * TODO: We should test for 64 bit capability and give a
	 * clearer message.
	 */

#ifdef CONFIG_64BIT
	status = pdc_pat_cell_get_number(&cell_info);
	if (status == PDC_OK) {
		unsigned long legacy_rev, pat_rev;
		pdc_type = PDC_TYPE_PAT;
		pr_cont("64 bit PAT.\n");
		parisc_cell_num = cell_info.cell_num;
		parisc_cell_loc = cell_info.cell_loc;
		pr_info("PAT: Running on cell %lu and location %lu.\n",
			parisc_cell_num, parisc_cell_loc);
		status = pdc_pat_pd_get_pdc_revisions(&legacy_rev,
			&pat_rev, &parisc_pat_pdc_cap);
		pr_info("PAT: legacy revision 0x%lx, pat_rev 0x%lx, pdc_cap 0x%lx, S-PTLB %d, HPMC_RENDEZ %d.\n",
			legacy_rev, pat_rev, parisc_pat_pdc_cap,
			parisc_pat_pdc_cap
			 & PDC_PAT_CAPABILITY_BIT_SIMULTANEOUS_PTLB ? 1:0,
			parisc_pat_pdc_cap
			 & PDC_PAT_CAPABILITY_BIT_PDC_HPMC_RENDEZ   ? 1:0);
		return;
	}
#endif

	/* Check the CPU's bus ID.  There's probably a better test.  */

	status = pdc_model_info(&model);

	bus_id = (model.hversion >> (4 + 7)) & 0x1f;

	switch (bus_id) {
	case 0x4:		/* 720, 730, 750, 735, 755 */
	case 0x6:		/* 705, 710 */
	case 0x7:		/* 715, 725 */
	case 0x8:		/* 745, 747, 742 */
	case 0xA:		/* 712 and similar */
	case 0xC:		/* 715/64, at least */

		pdc_type = PDC_TYPE_SNAKE;
		pr_cont("Snake.\n");
		return;

	default:		/* Everything else */

		pr_cont("Unsupported.\n");
		panic("If this is a 64-bit machine, please try a 64-bit kernel.\n");
	}
}