[Skiboot] [PATCH 02/12] cpu: use dt accessor device tree access
Nicholas Piggin
npiggin at gmail.com
Wed Oct 2 13:25:07 AEST 2019
Oliver O'Halloran's on October 1, 2019 1:03 pm:
> On Sun, 2019-09-29 at 17:46 +1000, Nicholas Piggin wrote:
>> @@ -183,10 +183,10 @@ static void add_xics_icps(void)
>> dt_add_property_string(icp, "device_type",
>> "PowerPC-External-Interrupt-Presentation");
>> for (i = 0; i < num_threads*2; i += 2) {
>> - reg[i] = ibase;
>> + reg[i] = cpu_to_be64(ibase);
>> /* One page is enough for a handful of regs. */
>> - reg[i+1] = 4096;
>> - ibase += reg[i+1];
>> + reg[i+1] = cpu_to_be64(4096);
>> + ibase += be64_to_cpu(reg[i+1]);
>> }
>> dt_add_property(icp, "reg", reg, sizeof(reg));
>> }
>
> Looks like this code is used as a fallback if we can't find the XICS
> address ranges in the PACA. However, it's also got:
>
> num_threads = intsrv->len / sizeof(u32);
> assert(num_threads <= PACA_MAX_THREADS);
>
> icp = dt_new_addr(dt_root, "interrupt-controller", ibase);
> if (!icp)
> continue;
>
> dt_add_property_strings(icp, "compatible",
> "IBM,ppc-xicp",
> "IBM,power7-xicp");
>
> and:
> #define PACA_MAX_THREADS 4
>
> So I'm guessing this is all dead P7 code that we can delete.
It does get called for power8 as well though, is it adding something
which is compatible with both? I'll try to do the very minimal endian
changes in this series. Removing dead code or changing to different
dt_ APIs I would prefer to do separately although they are all good
cleanups.
Thanks,
Nick
More information about the Skiboot
mailing list