static int __init pSeries_probe(void) { unsigned long root = of_get_flat_dt_root(); char *dtype = of_get_flat_dt_prop(root, "device_type", NULL); if (dtype == NULL) return 0; if (strcmp(dtype, "chrp")) return 0; /* Cell blades firmware claims to be chrp while it's not. Until this * is fixed, we need to avoid those here. */ if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0") || of_flat_dt_is_compatible(root, "IBM,CBEA")) return 0; DBG("pSeries detected, looking for LPAR capability...\n"); /* Now try to figure out if we are running on LPAR */ of_scan_flat_dt(pSeries_probe_hypertas, NULL); if (firmware_has_feature(FW_FEATURE_LPAR)) hpte_init_lpar(); else hpte_init_native(); DBG("Machine is%s LPAR !\n", (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not"); return 1; }
static int __init pSeries_probe_hypertas(unsigned long node, const char *uname, int depth, void *data) { if (depth != 1 || (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) return 0; if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) powerpc_firmware_features |= FW_FEATURE_LPAR; if (firmware_has_feature(FW_FEATURE_LPAR)) hpte_init_lpar(); else hpte_init_native(); return 1; }
/* * Early initialization. Relocation is on but do not reference unbolted pages */ static void __init pSeries_init_early(void) { void *comport; int iommu_off = 0; unsigned int default_speed; u64 physport; DBG(" -> pSeries_init_early()\n"); fw_feature_init(); if (systemcfg->platform & PLATFORM_LPAR) hpte_init_lpar(); else { hpte_init_native(); iommu_off = (of_chosen && get_property(of_chosen, "linux,iommu-off", NULL)); } generic_find_legacy_serial_ports(&physport, &default_speed); if (systemcfg->platform & PLATFORM_LPAR) find_udbg_vterm(); else if (physport) { /* Map the uart for udbg. */ comport = (void *)ioremap(physport, 16); udbg_init_uart(comport, default_speed); ppc_md.udbg_putc = udbg_putc; ppc_md.udbg_getc = udbg_getc; ppc_md.udbg_getc_poll = udbg_getc_poll; DBG("Hello World !\n"); } iommu_init_early_pSeries(); pSeries_discover_pic(); DBG(" <- pSeries_init_early()\n"); }