static void __init mac_identify()

in mac/config.c [787:867]


static void __init mac_identify(void)
{
	struct mac_model *m;

	/* Penguin data useful? */
	int model = mac_bi_data.id;
	if (!model) {
		/* no bootinfo model id -> NetBSD booter was used! */
		/* XXX FIXME: breaks for model > 31 */
		model = (mac_bi_data.cpuid >> 2) & 63;
		pr_warn("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n");
	}

	macintosh_config = mac_data_table;
	for (m = macintosh_config; m->ident != -1; m++) {
		if (m->ident == model) {
			macintosh_config = m;
			break;
		}
	}

	/* Set up serial port resources for the console initcall. */

	scc_a_rsrcs[0].start     = (resource_size_t)mac_bi_data.sccbase + 2;
	scc_a_rsrcs[0].end       = scc_a_rsrcs[0].start;
	scc_a_pdev.num_resources = ARRAY_SIZE(scc_a_rsrcs);
	scc_a_pdev.resource      = scc_a_rsrcs;

	scc_b_rsrcs[0].start     = (resource_size_t)mac_bi_data.sccbase;
	scc_b_rsrcs[0].end       = scc_b_rsrcs[0].start;
	scc_b_pdev.num_resources = ARRAY_SIZE(scc_b_rsrcs);
	scc_b_pdev.resource      = scc_b_rsrcs;

	switch (macintosh_config->scc_type) {
	case MAC_SCC_PSC:
		scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
		scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
		break;
	default:
		/* On non-PSC machines, the serial ports share an IRQ. */
		if (macintosh_config->ident == MAC_MODEL_IIFX) {
			scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
			scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
		} else {
			scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4;
			scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4;
		}
		break;
	}

	pr_info("Detected Macintosh model: %d\n", model);

	/*
	 * Report booter data:
	 */
	printk(KERN_DEBUG " Penguin bootinfo data:\n");
	printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
		mac_bi_data.videoaddr, mac_bi_data.videorow,
		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
		mac_bi_data.dimensions >> 16);
	printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
		mac_bi_data.videological, mac_orig_videoaddr,
		mac_bi_data.sccbase);
	printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
		mac_bi_data.boottime, mac_bi_data.gmtbias);
	printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
		mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);

	iop_init();
	oss_init();
	via_init();
	psc_init();
	baboon_init();

#ifdef CONFIG_ADB_CUDA
	find_via_cuda();
#endif
#ifdef CONFIG_ADB_PMU
	find_via_pmu();
#endif
}