Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: kvmarm@lists.cs.columbia.edu
Subject: Re: [kvm-unit-tests PATCH 09/11] arm/pci: PCI host bridge info printing
Date: Fri, 15 Jan 2016 16:35:59 +0100	[thread overview]
Message-ID: <20160115153559.GO3915@hawk.localdomain> (raw)
In-Reply-To: <c82448afa4642ddb782990d75d0ff14eaff8e804.1452341807.git.agordeev@redhat.com>

On Sat, Jan 09, 2016 at 01:22:56PM +0100, Alexander Gordeev wrote:
> Cc: Andrew Jones <drjones@redhat.com>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  lib/pci-host-generic.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/lib/pci-host-generic.c b/lib/pci-host-generic.c
> index 3d9c271..2d218a4 100644
> --- a/lib/pci-host-generic.c
> +++ b/lib/pci-host-generic.c
> @@ -19,6 +19,15 @@
>  	     dev >= 0;					\
>  	     dev = find_next_dev(pci, dev, &conf))
>  
> +static char *addr_space_desc[] = {
> +	[PCI_RES_TYPE_CONF]		= "CONF",
> +	[PCI_RES_TYPE_IO]		= "IO",
> +	[PCI_RES_TYPE_MEM32]		= "MEM32",
> +	[PCI_RES_TYPE_MEM64]		= "MEM64",
> +	[PCI_RES_TYPE_PREFMEM32]	= "MEM32/p",
> +	[PCI_RES_TYPE_PREFMEM64]	= "MEM64/p"
> +};
> +
>  static pci_res_type_t flags_to_type(u32 of_flags)
>  {
>  	return ((of_flags & 0x40000000) >> 28) | ((of_flags >> 24) & 0x03);
> @@ -105,6 +114,28 @@ static void pci_host_addr_space_init(struct pci_addr_space as[], int nr_as,
>  	}
>  }
>  
> +static void pci_host_bridge_print(struct pci_host_bridge *host)
> +{
> +	printf("PCIe start %016llx size %016llx "
> +	       "bus %02x bus_max %02x #spaces %d\n\n",
> +		host->cpu_range.start, host->cpu_range.size,
> +		host->bus, host->bus_max, host->nr_addr_spaces);
> +}
> +
> +static void pci_address_spaces_print(struct pci_addr_space as[], int nr_as)
> +{
> +	int i;
> +
> +	for (i = 0; i < nr_as; i++, as++) {
> +		printf("%s address space:\n"
> +		       "CPU: start %016llx size %016llx\n"
> +		       "PCI: start %016llx size %016llx\n\n",
> +			addr_space_desc[flags_to_type(as->of_flags)],
> +			as->cpu_range.start, as->cpu_range.size,
> +		        as->pci_range.start, as->pci_range.size);
> +	}
> +}
> +
>  /*
>   * Probe DT for a generic PCI host controller
>   * See kernel Documentation/devicetree/bindings/pci/host-generic-pci.txt
> @@ -180,9 +211,13 @@ static struct pci_host_bridge *pci_host_bridge_probe(void)
>  	host->bus_max		= bus_max;
>  	host->nr_addr_spaces	= nr_addr_spaces;
>  
> +	pci_host_bridge_print(host);
> +
>  	pci_host_addr_space_init(&host->addr_space[0], nr_addr_spaces,
>  				 (u32*)prop->data, nr_range_cells);
>  
> +	pci_address_spaces_print(&host->addr_space[0], host->nr_addr_spaces);
> +
>  	return host;
>  }

Looks good

drew

  reply	other threads:[~2016-01-15 15:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-09 12:22 [kvm-unit-tests PATCH 00/11] pci/arm: add PCI bus support Alexander Gordeev
2016-01-09 12:22 ` [kvm-unit-tests PATCH 01/11] arm/pci: Device tree PCI probing Alexander Gordeev
2016-01-13 15:13   ` Andrew Jones
2016-01-28 15:17     ` Alexander Gordeev
2016-01-28 16:40       ` Andrew Jones
2016-02-05 11:48     ` Alexander Gordeev
2016-02-05 12:18       ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 02/11] arm/pci: PCI bus scanning Alexander Gordeev
2016-01-13 15:58   ` Andrew Jones
2016-02-02  9:34     ` Alexander Gordeev
2016-02-02 11:20       ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 03/11] arm/pci: Read devices BARs Alexander Gordeev
2016-01-09 12:22 ` [kvm-unit-tests PATCH 04/11] arm/pci: Allocate and assign memory/io space resources Alexander Gordeev
2016-01-09 12:22 ` [kvm-unit-tests PATCH 05/11] arm/pci: Add pci_find_dev() and pci_bar_addr() functions Alexander Gordeev
2016-01-15 15:17   ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 06/11] arm/pci: PCI testdev existence test Alexander Gordeev
2016-01-09 12:22 ` [kvm-unit-tests PATCH 07/11] arm/pci: PCI device operation test Alexander Gordeev
2016-01-15 15:32   ` Andrew Jones
2016-02-04 12:18     ` Alexander Gordeev
2016-02-04 15:31       ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 08/11] arm/pci: PCI device read/write test Alexander Gordeev
2016-01-15 15:33   ` Andrew Jones
2016-02-04 12:03     ` Alexander Gordeev
2016-01-15 15:34   ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 09/11] arm/pci: PCI host bridge info printing Alexander Gordeev
2016-01-15 15:35   ` Andrew Jones [this message]
2016-01-09 12:22 ` [kvm-unit-tests PATCH 10/11] arm/pci: PCI devices basic " Alexander Gordeev
2016-01-15 15:38   ` Andrew Jones
2016-01-09 12:22 ` [kvm-unit-tests PATCH 11/11] arm/pci: PCI testdev test flavour printing Alexander Gordeev
2016-01-15 15:39   ` Andrew Jones
2016-01-15 15:42 ` [kvm-unit-tests PATCH 00/11] pci/arm: add PCI bus support Andrew Jones

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=20160115153559.GO3915@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=agordeev@redhat.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox