// SPDX-License-Identifier: GPL-2.012/*3* Early init before relocation4*/56#include <linux/init.h>7#include <linux/kernel.h>8#include <asm/setup.h>9#include <asm/sections.h>1011/*12* We're called here very early in the boot.13*14* Note that the kernel may be running at an address which is different15* from the address that it was linked at, so we must use RELOC/PTRRELOC16* to access static data (including strings). -- paulus17*/18notrace unsigned long __init early_init(unsigned long dt_ptr)19{20unsigned long kva, offset = reloc_offset();2122kva = *PTRRELOC(&kernstart_virt_addr);2324/* First zero the BSS */25if (kva == KERNELBASE)26memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);2728/*29* Identify the CPU type and fix up code sections30* that depend on which cpu we have.31*/32identify_cpu(offset, mfspr(SPRN_PVR));3334apply_feature_fixups();3536return kva + offset;37}383940