Search code examples
linux-kernelarmu-bootdevice-tree

ARM R0 register value while moving from U-boot to Kernel


While understanding the device tree for Kernel(specific to ARM), I came to know that following difference before the device tree and after the device tree.

Before device tree : R1 register contains machine type R2 register contains pointer to ATAGS

With device tree: No need to check the R1 register R2 register contains pointer to dtb file.

My doubht here is what exactly R0 contains before device tree and any change in the R0 register usage with device tree.


Solution

  • From arch/arm/kernel/head.S

    /*
     * Kernel startup entry point.
     * ---------------------------
     *
     * This is normally called from the decompressor code.  The requirements
     * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
     * r1 = machine nr, r2 = atags or dtb pointer.