On Wed, Sep 30, 2026 at 2:07 AM Joel Stanley <[email protected]> wrote: > > On Sat, 5 Sept 2026 at 00:18, Anirudh Srinivasan > <[email protected]> wrote: > > @@ -265,7 +265,8 @@ static void create_fdt_cpu(void *fdt, > > TTAtlantisSoCState *s, > > } > > > > static void create_fdt_uart(void *fdt, const MemMapEntry *mem, int irq, > > - int irqchip_phandle) > > + int irqchip_phandle, uint32_t > > clk_parent_phandle, > > + uint32_t clk_phandle) > > { > > g_autofree char *name = g_strdup_printf("/soc/serial@%"HWADDR_PRIX, > > mem->base); > > @@ -275,7 +276,8 @@ static void create_fdt_uart(void *fdt, const > > MemMapEntry *mem, int irq, > > qemu_fdt_setprop_sized_cells(fdt, name, "reg", 2, mem->base, 2, > > mem->size); > > qemu_fdt_setprop_cell(fdt, name, "reg-shift", 2); > > qemu_fdt_setprop_cell(fdt, name, "reg-io-width", 4); > > - qemu_fdt_setprop_cell(fdt, name, "clock-frequency", 3686400); > > The downside of this is we no longer boot with a Linux build that > lacks the PRCM driver, like the old build that is used for functional > testing in the tree. > > I suggest we keep clock-frequency along side the clocks node. New > kernels with the PRCM driver use the clock phandle and calculate the > clock. Old kernels keep booting. > > The other option is to drop this patch entirely for now, and revisit > later. I'd prefer keeping clock-frequency along side.
Will add clock-frequency back. > > > + qemu_fdt_setprop_cells(fdt, name, "clocks", clk_parent_phandle, > > + clk_phandle); > > qemu_fdt_setprop_cell(fdt, name, "interrupt-parent", irqchip_phandle); > > qemu_fdt_setprop_cells(fdt, name, "interrupts", irq, 0x4); > > > @@ -314,8 +318,8 @@ static void create_fdt_i2c(void *fdt, const MemMapEntry > > *mem, uint32_t irq, > > qemu_fdt_setprop_sized_cells(fdt, name, "reg", 2, mem->base, 2, > > mem->size); > > qemu_fdt_setprop_cell(fdt, name, "interrupt-parent", irqchip_phandle); > > qemu_fdt_setprop_cells(fdt, name, "interrupts", irq, 0x4); > > - qemu_fdt_setprop_cell(fdt, name, "clocks", clk_phandle); > > - qemu_fdt_setprop_cell(fdt, name, "clock-frequency", 100000); > > This should stay, it's the bus frequency. Okay, I thought this was a substitute/alternative to the clocks property (similar to the UART), so I removed it. Will add it back. > > > clock-frequency: > description: Desired I2C bus clock frequency in Hz > enum: [100000, 400000, 1000000, 3400000] > default: 400000 > > (or we omit it, and default to 400kHz. Your call). > > > + qemu_fdt_setprop_cells(fdt, name, "clocks", clk_parent_phandle, > > + clk_phandle); > > This looks good. > > > qemu_fdt_setprop_cell(fdt, name, "#address-cells", 1); > > qemu_fdt_setprop_cell(fdt, name, "#size-cells", 0); > > }
