void __init iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { /* Associate Lp Event Queue 0 with processor 0 */ HvCallEvent_setLpEventQueueInterruptProc( 0, 0 ); { /* copy the command line parameter from the primary VSP */ char *p, *q; HvCallEvent_dmaToSp( cmd_line, 2*64*1024, 256, HvLpDma_Direction_RemoteToLocal ); p = q = cmd_line + 255; while( p > cmd_line ) { if ((*p == 0) || (*p == ' ') || (*p == '\n')) --p; else break; } if ( p < q ) *(p+1) = 0; } iSeries_proc_early_init(); mf_init(); mf_initialized = 1; mb(); iSeries_proc_callback( &pmc_proc_init ); }
HashTable *hashTableInit(HashTable *p) { int i; if (!p) p = malloc(sizeof (HashTable)); if (!p) { perror ("hashTableInit: malloc"); return NULL; } mf_init (&(p->mf_data)); /* Initialize the entries */ for (i = 0; i < HASHSIZE; i++) p->hashEntries[i] = NULL; return p; } /* hashTableInit */
static void __init iSeries_init_early(void) { DBG(" -> iSeries_init_early()\n"); /* Snapshot the timebase, for use in later recalibration */ iSeries_time_init_early(); /* * Initialize the DMA/TCE management */ iommu_init_early_iSeries(); /* Initialize machine-dependency vectors */ #ifdef CONFIG_SMP smp_init_iSeries(); #endif /* Associate Lp Event Queue 0 with processor 0 */ HvCallEvent_setLpEventQueueInterruptProc(0, 0); mf_init(); DBG(" <- iSeries_init_early()\n"); }
/*static*/ void __init iSeries_init_early(void) { extern unsigned long memory_limit; DBG(" -> iSeries_init_early()\n"); ppcdbg_initialize(); #if defined(CONFIG_BLK_DEV_INITRD) /* * If the init RAM disk has been configured and there is * a non-zero starting address for it, set it up */ if (naca->xRamDisk) { initrd_start = (unsigned long)__va(naca->xRamDisk); initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE; initrd_below_start_ok = 1; // ramdisk in kernel space ROOT_DEV = Root_RAM0; if (((rd_size * 1024) / PAGE_SIZE) < naca->xRamDiskSize) rd_size = (naca->xRamDiskSize * PAGE_SIZE) / 1024; } else #endif /* CONFIG_BLK_DEV_INITRD */ { /* ROOT_DEV = MKDEV(VIODASD_MAJOR, 1); */ } iSeries_recal_tb = get_tb(); iSeries_recal_titan = HvCallXm_loadTod(); /* * Cache sizes must be initialized before hpte_init_iSeries is called * as the later need them for flush_icache_range() */ setup_iSeries_cache_sizes(); /* * Initialize the hash table management pointers */ hpte_init_iSeries(); /* * Initialize the DMA/TCE management */ tce_init_iSeries(); /* * Initialize the table which translate Linux physical addresses to * AS/400 absolute addresses */ build_iSeries_Memory_Map(); iSeries_get_cmdline(); /* Save unparsed command line copy for /proc/cmdline */ strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); /* Parse early parameters, in particular mem=x */ parse_early_param(); if (memory_limit) { if (memory_limit < systemcfg->physicalMemorySize) systemcfg->physicalMemorySize = memory_limit; else { printk("Ignoring mem=%lu >= ram_top.\n", memory_limit); memory_limit = 0; } } /* Bolt kernel mappings for all of memory (or just a bit if we've got a limit) */ iSeries_bolt_kernel(0, systemcfg->physicalMemorySize); lmb_init(); lmb_add(0, systemcfg->physicalMemorySize); lmb_analyze(); lmb_reserve(0, __pa(klimit)); /* Initialize machine-dependency vectors */ #ifdef CONFIG_SMP smp_init_iSeries(); #endif if (itLpNaca.xPirEnvironMode == 0) piranha_simulator = 1; /* Associate Lp Event Queue 0 with processor 0 */ HvCallEvent_setLpEventQueueInterruptProc(0, 0); mf_init(); mf_initialized = 1; mb(); /* If we were passed an initrd, set the ROOT_DEV properly if the values * look sensible. If not, clear initrd reference. */ #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE && initrd_end > initrd_start) ROOT_DEV = Root_RAM0; else initrd_start = initrd_end = 0; #endif /* CONFIG_BLK_DEV_INITRD */ DBG(" <- iSeries_init_early()\n"); }