All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pci: Add PCI_SLOT macro to include/pci.h
Date: Tue, 22 Jan 2019 10:53:20 +0100	[thread overview]
Message-ID: <4455a4a7-5dc3-731a-011b-8b21832ff395@denx.de> (raw)
In-Reply-To: <CAPnjgZ0i147e0S4jB71xVTXSh9SMEvPBWYaiKEDYBJ0rso-rBA@mail.gmail.com>

Hi Simon,

On 22.01.19 01:32, Simon Glass wrote:
> On Sat, 19 Jan 2019 at 00:46, Stefan Roese <sr@denx.de> wrote:
>>
>> This macro will be used the by the Marvell Armada XP/38x PCIe driver,
>> which is moved to DM right now.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Bin Meng <bmeng.cn@gmail.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> ---
>>   include/pci.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/include/pci.h b/include/pci.h
>> index 785d7d28b7..f4a9e025b3 100644
>> --- a/include/pci.h
>> +++ b/include/pci.h
>> @@ -501,6 +501,7 @@ typedef int pci_dev_t;
>>   #define PCI_BUS(d)             (((d) >> 16) & 0xff)
>>   #define PCI_DEV(d)             (((d) >> 11) & 0x1f)
>>   #define PCI_FUNC(d)            (((d) >> 8) & 0x7)
>> +#define PCI_SLOT(d)            (((d) >> 3) & 0x1f)
> 
> This seems unrelated to the other macros, since is shifts left only 3
> positions. Can you perhaps move it to the end and add a comment as to
> what the input is and what it returns? It seems different to the
> others.

We seem to have the same different interpretation (U-Boot vs Linux)
as remarked in my last mail. It seems that U-Boot expects devfn
to reside in bits 15-8.

Regarding the input and what it returns: My current understanding is,
that PCI_DEV in U-Boot is identical to PCI_SLOT in Linux (PCI_DEV is
not used there at all). The input here is devfn as well.

I can adapt my driver to use PCI_DEV instead. But frankly, these
different macro implementations (U-Boot vs Linux) are confusing.

Thanks,
Stefan

  parent reply	other threads:[~2019-01-22  9:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 11:46 [U-Boot] [PATCH] core: ofnode: Add ofnode_pci_get_devfn() Stefan Roese
2019-01-18 11:46 ` [U-Boot] [PATCH] pci: Add PCI_SLOT macro to include/pci.h Stefan Roese
2019-01-22  0:32   ` Simon Glass
2019-01-22  2:11     ` Bin Meng
2019-01-22  9:54       ` Stefan Roese
2019-01-22  9:53     ` Stefan Roese [this message]
2019-01-18 11:46 ` [U-Boot] [PATCH 1/3 v2] pci: pci_mvebu: Add DM_PCI support and move CONFIG_PCI_MVEBU to defconfig Stefan Roese
2019-01-22  7:35   ` Chris Packham
2019-01-22 10:06     ` Stefan Roese
2019-01-18 11:46 ` [U-Boot] [PATCH 2/3 v2] arm: mvebu: armada-xp/37x.dtsi: Sync PCIe DT nodes with Linux v4.20 Stefan Roese
2019-01-18 11:46 ` [U-Boot] [PATCH 3/3 v2] arm: mvebu: armada-xp-theadorable.dts: Enable PCIe DT nodes Stefan Roese
2019-01-21 18:15 ` [U-Boot] [PATCH] core: ofnode: Add ofnode_pci_get_devfn() Simon Glass
2019-01-22  9:36   ` Stefan Roese
2019-01-31 10:04     ` Simon Glass
2019-01-31 10:45       ` Stefan Roese
2019-02-02  6:05         ` Simon Glass
2019-02-05  9:34           ` Stefan Roese

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=4455a4a7-5dc3-731a-011b-8b21832ff395@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.