arch/powerpc/kernel/setup-common.c

Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/setup-common.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kernel/setup-common.c
Extension
.c
Size
25914 bytes
Lines
1024
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

* Called into from start_kernel this initializes memblock, which is used
 * to manage page allocation until mem_init is called.
 */
void __init setup_arch(char **cmdline_p)
{
	kasan_init();

	*cmdline_p = boot_command_line;

	/* Set a half-reasonable default so udelay does something sensible */
	loops_per_jiffy = 500000000 / HZ;

	/* Unflatten the device-tree passed by prom_init or kexec */
	unflatten_device_tree();

	/*
	 * Initialize cache line/block info from device-tree (on ppc64) or
	 * just cputable (on ppc32).
	 */
	initialize_cache_info();

	/* Initialize RTAS if available. */
	rtas_initialize();

	/* Check if we have an initrd provided via the device-tree. */
	check_for_initrd();

	/* Probe the machine type, establish ppc_md. */
	probe_machine();

	/* Setup panic notifier if requested by the platform. */
	setup_panic();

	/*
	 * Configure ppc_md.power_save (ppc32 only, 64-bit machines do
	 * it from their respective probe() function.
	 */
	setup_power_save();

	/* Discover standard serial ports. */
	find_legacy_serial_ports();

	/* Register early console with the printk subsystem. */
	register_early_udbg_console();

	/* Setup the various CPU maps based on the device-tree. */
	smp_setup_cpu_maps();

	/* Initialize xmon. */
	xmon_setup();

	/* Check the SMT related command line arguments (ppc64). */
	check_smt_enabled();

	/* Parse memory topology */
	mem_topology_setup();
	high_memory = (void *)__va(max_low_pfn * PAGE_SIZE);

	/*
	 * Release secondary cpus out of their spinloops at 0x60 now that
	 * we can map physical -> logical CPU ids.
	 *
	 * Freescale Book3e parts spin in a loop provided by firmware,
	 * so smp_release_cpus() does nothing for them.
	 */
#ifdef CONFIG_SMP
	smp_setup_pacas();

	/* On BookE, setup per-core TLB data structures. */
	setup_tlb_core_data();
#endif

	/* Print various info about the machine that has been gathered so far. */
	print_system_info();

	klp_init_thread_info(&init_task);

	setup_initial_init_mm(_stext, _etext, _edata, _end);
	/* sched_init() does the mmgrab(&init_mm) for the primary CPU */
	VM_WARN_ON(cpumask_test_cpu(smp_processor_id(), mm_cpumask(&init_mm)));
	cpumask_set_cpu(smp_processor_id(), mm_cpumask(&init_mm));
	inc_mm_active_cpus(&init_mm);
	mm_iommu_init(&init_mm);

	irqstack_early_init();
	exc_lvl_early_init();
	emergency_stack_init();

	mce_init();
	smp_release_cpus();

Annotation

Implementation Notes