|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 12/15] xen/arm: generate vpl011 node on device tree for domU
Hi Stefano, On 06/13/2018 11:15 PM, Stefano Stabellini wrote: The definition of interrupt looks suspicious. gic_interrupt_t is defined as be32[3]. Here you pass a pointer, so interrupt type would be __be32 **, that you crudely cast to __be32* below. Most likely you don't want to pass a pointer here and just use the type gic_interrupt_t. Because it is an array, then there will be no issue. Explicit cast are always a bad idea. If you need one, then mostly likely you did something wrong :). In that case interrupt type is __be32** and you cast to __be32*. If you change the type as suggested above, then the cast will not be necessary here. + int is_ppi = (irq < 32); + + irq -= (is_ppi) ? 16: 32; /* PPIs start at 16, SPIs at 32 */ + + /* See linux Documentation/devictree/bindings/arm/gic.txt */ + dt_set_cell(&cells, 1, is_ppi); /* is a PPI? */ + dt_set_cell(&cells, 1, irq); + dt_set_cell(&cells, 1, (cpumask << 8) | level); +} We already have a function to generate PPI interrupt (set_interrupt_ppi). Would it be possible to extend it to support interrupt? Most likely, you will want to use set_interrupt(...) everywhere and just drop set_interrupt_ppi. Coding style: if ( ... ) + return res; + + res = fdt_property_string(fdt, "compatible", "arm,sbsa-uart"); To make clear, you are exposing a SBSA compatible UART and not a PL011. SBSA UART is a subset of PL011 r1p5. A full PL011 implementation in Xen would just be too difficult, so your guest may require some changes in their driver. I think this is a small price to pay, but I wanted to make sure you don't expect the guest to drive the UART the same way a PL011. + if (res) Coding style + return res; + + cells = ®[0]; + dt_child_set_range(&cells, addrcells, sizecells, GUEST_PL011_BASE, + GUEST_PL011_SIZE); The indentation looks wrong here. + if (res) Coding style + return res; + res = fdt_property(fdt, "reg", reg, sizeof(reg)); + if (res) Coding style + return res; + + set_interrupt(&intr, GUEST_VPL011_SPI, 0xf, DT_IRQ_TYPE_LEVEL_HIGH); + + res = fdt_property(fdt, "interrupts", intr, sizeof (intr)); + if (res) Coding style + return res; + + res = fdt_property_cell(fdt, "interrupt-parent", + PHANDLE_GIC); + if (res) Coding style + return res; + + /* Use a default baud rate of 115200. */ + fdt_property_u32(fdt, "current-speed", 115200); + + res = fdt_end_node(fdt); + if (res) Coding style
I would prefer if don't expose the pl011 by default to a guest and provide a way to enable it for a given guest Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |