All of lore.kernel.org
 help / color / mirror / Atom feed
From: clement.leger@bootlin.com
To: Lizhi Hou <lizhi.hou@amd.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, robh@kernel.org,
	frowand.list@gmail.com, helgaas@kernel.org, max.zhen@amd.com,
	sonal.santan@amd.com, larry.liu@amd.com, brian.xu@amd.com,
	stefano.stabellini@xilinx.com, trix@redhat.com,
	Allan.Nielsen@microchip.com, Horatiu.Vultur@microchip.com,
	Steen.Hegelund@microchip.com
Subject: Re: [PATCH V5 2/3] PCI: Create device tree node for selected devices
Date: Tue, 03 Jan 2023 20:34:55 +0100	[thread overview]
Message-ID: <b9078b9583e35dce6113c344abe0ca69@bootlin.com> (raw)
In-Reply-To: <b50306fe-d710-4d11-d5e2-2b9c8293e44e@amd.com>

Le 2023-01-03 19:44, Lizhi Hou a écrit :
> On 1/2/23 05:56, Clément Léger wrote:
>> Le Thu, 15 Dec 2022 09:30:45 -0800,
>> Lizhi Hou <lizhi.hou@amd.com> a écrit :
>> 
>>> +};
>>> +
>>> +static int of_pci_prop_device_type(struct pci_dev *pdev,
>>> +				   struct of_changeset *ocs,
>>> +				   struct device_node *np)
>>> +{
>>> +	return of_changeset_add_prop_string(ocs, np, "device_type", "pci");
>>> +}
>>> +
>>> +static int of_pci_prop_address_cells(struct pci_dev *pdev,
>>> +				     struct of_changeset *ocs,
>>> +				     struct device_node *np)
>>> +{
>>> +	return of_changeset_add_prop_u32(ocs, np, "#address_cells",
>>> +					 OF_PCI_ADDRESS_CELLS);
>>> +}
>>> +
>>> +static int of_pci_prop_size_cells(struct pci_dev *pdev,
>>> +				  struct of_changeset *ocs,
>>> +				  struct device_node *np)
>>> +{
>>> +	return of_changeset_add_prop_u32(ocs, np, "#size_cells",
>>> +					 OF_PCI_SIZE_CELLS);
>>> +}
>> Hi Lizhi,
>> 
>> For all these functions, the "pdev" parameter is actually unused.
>> 
>> [snip]
> Ok. I will remove unused pdev.
>> 
>>> +
>>> +static int of_pci_prop_compatible(struct pci_dev *pdev,
>>> +				  struct of_changeset *ocs,
>>> +				  struct device_node *np)
>>> +{
>>> +	const char *compat_strs[PROP_COMPAT_NUM] = { 0 };
>>> +	int i, ret;
>>> +
>>> +	compat_strs[PROP_COMPAT_PCI_VVVV_DDDD] =
>>> +		kasprintf(GFP_KERNEL, "pci%x,%x", pdev->vendor, pdev->device);
>> Maybe it should be better to use "pci%04x,%04x" to keep the existing
>> naming.
> 
> Based on
> https://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf,
> "pci%x,%x" should be used?
> 
> "name" Based on the PCI Class Code register, pick a name from Table 1.
> If none apply, generate a name of the
> form pciVVVV,DDDD as described below under "compatible".
> 
> VVVV, DDDD, SSSS, ssss and RR are lower-case ASCII hexadecimal numbers
> without leading zeroes.

You might be right then ! I just looked at the already existing 
device-tree
which adds leading zeroes. Someone like Rob or Frank might be able to 
answer
on that.

Clément

> 
> 
> Thanks,
> 
> Lizhi
> 
>> 

  reply	other threads:[~2023-01-03 19:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 17:30 [PATCH V5 0/3] Generate device tree node for pci devices Lizhi Hou
2022-12-15 17:30 ` [PATCH V5 1/3] of: dynamic: Add interfaces for creating device node dynamically Lizhi Hou
2023-01-02 13:50   ` Clément Léger
2023-01-03 18:34     ` Lizhi Hou
2022-12-15 17:30 ` [PATCH V5 2/3] PCI: Create device tree node for selected devices Lizhi Hou
2023-01-02 13:56   ` Clément Léger
2023-01-03 18:44     ` Lizhi Hou
2023-01-03 19:34       ` clement.leger [this message]
2023-01-02 17:16   ` Clément Léger
2023-01-03 19:45     ` Lizhi Hou
2023-01-04  0:29       ` Lizhi Hou
2023-01-03 14:48   ` Clément Léger
2023-01-04  0:31     ` Lizhi Hou
2023-01-04  5:57       ` clement.leger
2023-01-03 15:38   ` Clément Léger
2022-12-15 17:30 ` [PATCH V5 3/3] PCI: Add PCI quirks to generate device tree node for Xilinx Alveo U50 Lizhi Hou
  -- strict thread matches above, loose matches on Subject: below --
2022-12-09 19:38 [PATCH V5 0/3] Generate device tree node for pci devices Lizhi Hou
2022-12-09 19:38 ` [PATCH V5 2/3] PCI: Create device tree node for selected devices Lizhi Hou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9078b9583e35dce6113c344abe0ca69@bootlin.com \
    --to=clement.leger@bootlin.com \
    --cc=Allan.Nielsen@microchip.com \
    --cc=Horatiu.Vultur@microchip.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=brian.xu@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=larry.liu@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=max.zhen@amd.com \
    --cc=robh@kernel.org \
    --cc=sonal.santan@amd.com \
    --cc=stefano.stabellini@xilinx.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.