[PATCH v1 2/2] PCI: microchip: rework reg region handing
Conor Dooley
conor at kernel.org
Tue Jun 11 06:12:45 PDT 2024
On Mon, May 27, 2024 at 10:37:17AM +0100, Conor Dooley wrote:
> @@ -1150,28 +1129,44 @@ static int mc_host_probe(struct platform_device *pdev)
>
> port->dev = dev;
>
> - port->axi_base_addr = devm_platform_ioremap_resource(pdev, 1);
> - if (IS_ERR(port->axi_base_addr))
> - return PTR_ERR(port->axi_base_addr);
> + /*
> + * The original, incorrect, binding that lumped the control and
> + * bridge addresses together still needs to be handled by the driver.
> + */
> + axi_base_addr = devm_platform_ioremap_resource_byname(pdev, "apb");
I noticed yesterday that this will print an error during boot, which I
don't really want for the devices using the updated format. I'll send a
v2 tomorrow with the reg region probing inverted.
Thanks,
Conor.
> + if (!IS_ERR(axi_base_addr)) {
> + port->bridge_base_addr = axi_base_addr + MC_PCIE1_BRIDGE_ADDR;
> + port->ctrl_base_addr = axi_base_addr + MC_PCIE1_CTRL_ADDR;
> + goto addrs_set;
> + }
>
> + port->bridge_base_addr = devm_platform_ioremap_resource_byname(pdev, "bridge");
> + if (IS_ERR(port->bridge_base_addr))
> + return dev_err_probe(dev, PTR_ERR(port->bridge_base_addr),
> + "legacy apb register and bridge region missing");
> +
> + port->ctrl_base_addr = devm_platform_ioremap_resource_byname(pdev, "ctrl");
> + if (IS_ERR(port->ctrl_base_addr))
> + return dev_err_probe(dev, PTR_ERR(port->ctrl_base_addr),
> + "legacy apb register and ctrl region missing");
> +
> +addrs_set:
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20240611/d0a31ce6/attachment.sig>
More information about the linux-riscv
mailing list