From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 16 Oct 2017 05:20:59 -0500 From: Segher Boessenkool To: Alexey Kardashevskiy Cc: David Gibson , Thomas Huth , Nikunj A Dadhania , Greg Kurz , slof@lists.ozlabs.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH kernel] RFC: prom_init: Fetch flatten device tree from the system firmware Message-ID: <20171016102058.GH4406@gate.crashing.org> References: <20171016054917.21577-1-aik@ozlabs.ru> <20171016061125.GD2776@umbus.fritz.box> <00ec0e99-45dd-dbe0-d75f-4413253e8093@ozlabs.ru> <20171016064633.GE2776@umbus.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Oct 16, 2017 at 06:07:06PM +1100, Alexey Kardashevskiy wrote: > On 16/10/17 17:46, David Gibson wrote: > >>>> + /* Fixup the boot cpuid */ > >>>> + hdr->boot_cpuid_phys = cpu_to_be32(prom.cpu); > >>> > >>> If SLOF is generating a tree it really should get this header field > >>> right as well. > >> > >> > >> Ah, I did not realize it is just a phandle from /chosen/cpu. Will > >> fix. > > > > It's not a phandle. It's just the "address" (i.e. reg value) of the > > boot cpu. > > Well, it is "reg" of a CPU with phandle==/chosen/cpu so my fdt code needs > to look there to pick the right "reg" rather than just plain 0. I'll fix > this but in general can it possibly be not a zero in QEMU/SLOF? /chosen/cpu is an ihandle, not a phandle. Most (if not all) references in /chosen are. Segher