mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alessandro Rubini <rubini@gnudd.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] x86: initial support for sta2x11
Date: Fri, 06 Jan 2012 16:05:23 -0800	[thread overview]
Message-ID: <1325894723.12292.13.camel@joe2Laptop> (raw)
In-Reply-To: <1446410617.668.1325893939253.JavaMail.mail@webmail05>

On Fri, 2012-01-06 at 13:33 +0100, Alessandro Rubini wrote:
> The "ConneXt" sta2x11 I/O Hub is a bridge from PCIe to AMBA, and is
> used as main chipset in some Atom boards.  The set of peripherals it
> exports live in an AMBA bus internal to the chip, so a custom
> remapping of addresses is needed. This is implemented by fixup calls
> for the PCI deivices, based on CONFIG_X86_DEV_DMA_OPS and
> CONFIG_X86_DMA_REMAP .

trivia:

> diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c
[]
> +++ b/arch/x86/pci/sta2x11-fixup.c
> @@ -0,0 +1,403 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

> +#include <linux/pci.h>
> +#include <linux/export.h>

> +static void sta2x11_new_instance(struct pci_dev *pdev)
> +{
> +	struct sta2x11_instance *instance;
> +
> +	instance = kzalloc(sizeof(*instance), GFP_ATOMIC);
> +	if (!instance)
> +		return;
> +	/* This has a subordindate bridge, with 4 more-subordinate ones */

typo: s/subordindate/subordinate/

> +	instance->bus0 = pdev->subordinate->number + 1;
> +
> +	if (list_empty(&sta2x11_instance_list)) {
> +		int size = STA2X11_SWIOTLB_SIZE;
> +		/* First instance: register your own swiotlb area */
> +		dev_info(&pdev->dev, "sta2x11: Using SWIOTLB (size %i)\n",

It's probably not necessary to prefix with "sta2x11: "

> +			 size);
> +		if (swiotlb_late_init_with_default_size(size))
> +			dev_emerg(&pdev->dev, "%s: init swiotlb(%i) failed\n",
> +				  __func__, size);

or __func__

[]
> +static void set_platform_data(struct pci_dev *pdev)
> +{
> +	void *data = sta2x11_get_platform_data(pdev);
> +	if (data)
> +		printk(KERN_INFO "sta2x11: setting platform data for device "
> +		       "%04x:%04x\n", pdev->vendor, pdev->device);

		pr_info("setting platform data for device %04x:%04x\n",
			pdev->vendor, pdev->device);


> +/* Print STA2X11 version, for diagnostic information */
> +static void sta2x11_print_version(struct pci_dev *pdev)
> +{
> +	uint32_t v[2]; /* used as a string... */

less than pretty.

> +	void __iomem *base;
> +
> +	base = ioremap(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1));
> +	if (!base) {
> +		dev_err(&pdev->dev, " Can't ioreamp BAR 1\n");
> +		return;
> +	}
> +	v[0] = readl(base + 0x7fec); /* STA2X11_ROM_VERSION_OFFSET */
> +	v[1] = 0;
> +	printk("STA2X11: detected version %s (%s)\n", (char *)v,
> +	       v[0] == 0x30303276 ? "good" : "UNSUPPORTED");
(yeah, it's x86, but...)
and
	pr_info("detected version %s (%s)\n", etc.



  parent reply	other threads:[~2012-01-07  0:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06 12:32 [PATCH 1/6] pci_ids: add device ids for STA2X11 device (aka ConneXT) Alessandro Rubini
2012-01-06 12:32 ` [PATCH 2/6] x86: introduce CONFIG_X86_DEV_DMA_OPS Alessandro Rubini
2012-01-06 12:33 ` [PATCH 3/6] x86: introduce CONFIG_X86_DMA_REMAP Alessandro Rubini
2012-01-06 12:33 ` [PATCH 4/6] x86: initial support for sta2x11 Alessandro Rubini
2012-01-06 12:33 ` [PATCH 5/6] usb: add support for STA2X11 host driver Alessandro Rubini
2012-01-06 16:35   ` Alan Stern
2012-01-06 17:57     ` Alessandro Rubini
2012-01-06 12:33 ` [PATCH 6/6] ahci: support the STA2X11 I/O Hub Alessandro Rubini
2012-01-11 22:57   ` Alan Cox
2012-01-11 23:26   ` Alessandro Rubini
2012-01-06 20:11 ` [PATCH 1/6] pci_ids: add device ids for STA2X11 device (aka ConneXT) Jesse Barnes
2012-01-06 20:18 ` Alessandro Rubini
     [not found] ` <1446410617.668.1325893939253.JavaMail.mail@webmail05>
2012-01-07  0:05   ` Joe Perches [this message]
2012-01-07  8:22   ` [PATCH 4/6] x86: initial support for sta2x11 Alessandro Rubini
2012-01-07 10:05     ` Joe Perches

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=1325894723.12292.13.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rubini@gnudd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®