|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [PATCH 32/40] arm: parse out the address/size for gicd/gicc
Hi, On 08/11/17 09:22, Huang Shijie wrote: On Mon, Nov 06, 2017 at 05:48:35PM +0000, Julien Grall wrote:Hi Shijie, On 03/11/17 03:12, Huang Shijie wrote: It is valid to have 64bit value in Arm32 Device-Tree... Arm32 in fact supports more than 32-bits PA. It may not be used by Mini-OS but it doesn't mean you should not get the interface correct... Also s/size/cell/ Please quote the spec and then we can discuss it... have a function reading an arbitrary number of cells and return a 64-bit value. This function could be implemented with a loop for instance. Lastly, I would really prefer if we have a file containing FDT helpers rather than open-coding them in gic.ccould you please give the functions? I searched the FDT, and did not found the proper function for the parsing. I didn't say it was existing in the libfdt, but suggesting to create a new file in Mini-OS containing all the FDT helpers. You will need the same for GICv3 and other driver... + + return (unsigned long)fdt64_to_cpu(reg64[0]); + } + BUG(); +} + +/* + * Parse out the address/size for gicd/gicc. + * + * Return 0 on success; return 1 on error. + */ +static int gic_parse(int node, unsigned long *gicd_addr, unsigned long *gicd_size, > + unsigned long *gicc_addr, unsigned long *gicc_size)All the unsigned long should be paddr_t. You didn't get what I mean... If you implement an helper that read a number depending on the number of cells given in parameter, you don't have to worry how where to use fdt32_to_cpu() or fdt64_to_cpu(). That helper will do it for you. That helper could still use fdt32_to_cpu(). A prototype for the helper would be: uint64_t fdt_get_number(fdt32_t *prop, unsigned int cells); + + reg32 = (uint32_t *)fdt_getprop(device_tree, pnode, "#size-cells", NULL);Ditto for the cast.+ if (reg32) + cell_size = fdt32_to_cpu(reg32[0]);Ditto for reading the number. Which kernel are you speaking about??? If I look at x86 code of Mini-OS, the { are on a separate line... The Arm port seems to be a mess regarding the coding style. I have used to it. Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |