All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 21/25] dm: usb: Convert echi-pci to use new DM PCI API
Date: Tue, 17 Nov 2015 09:03:25 +0100	[thread overview]
Message-ID: <201511170903.26030.marex@denx.de> (raw)
In-Reply-To: <1447732444-30892-22-git-send-email-sjg@chromium.org>

On Tuesday, November 17, 2015 at 04:53:59 AM, Simon Glass wrote:
> Convert this driver to use the new driver model PCI API.

Nit, in the subject, it should be ehci, not echi ;-)

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/usb/host/ehci-pci.c | 43
> +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35
> insertions(+), 8 deletions(-)

[...]

> @@ -38,12 +40,12 @@ static void ehci_pci_common_init(pci_dev_t pdev, struct
> ehci_hccr **ret_hccr, *ret_hcor = hcor;
> 
>  	/* enable busmaster */
> -	pci_read_config_dword(pdev, PCI_COMMAND, &cmd);
> +	dm_pci_read_config32(dev, PCI_COMMAND, &cmd);

Is the dm_ prefix really needed on these functions ?

>  	cmd |= PCI_COMMAND_MASTER;
> -	pci_write_config_dword(pdev, PCI_COMMAND, cmd);
> +	dm_pci_write_config32(dev, PCI_COMMAND, cmd);
>  }
> 
> -#ifndef CONFIG_DM_USB
> +#else
> 
>  #ifdef CONFIG_PCI_EHCI_DEVICE
>  static struct pci_device_id ehci_pci_ids[] = {
> @@ -55,6 +57,31 @@ static struct pci_device_id ehci_pci_ids[] = {
>  };
>  #endif
> 
> +static void ehci_pci_legacy_init(pci_dev_t pdev, struct ehci_hccr
> **ret_hccr, +				 struct ehci_hcor **ret_hcor)
> +{
> +	struct ehci_hccr *hccr;
> +	struct ehci_hcor *hcor;
> +	uint32_t cmd;
> +
> +	hccr = (struct ehci_hccr *)pci_map_bar(pdev,
> +			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
> +	hcor = (struct ehci_hcor *)((uint32_t) hccr +

This should be uintptr_t instead of uint32_t . Oh, and uint32_t should
not be used, use u32 where applicable.

> +			HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
> +
> +	debug("EHCI-PCI init hccr 0x%x and hcor 0x%x hc_length %d\n",
> +	      (uint32_t)hccr, (uint32_t)hcor,
> +	      (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
> +
> +	*ret_hccr = hccr;
> +	*ret_hcor = hcor;
> +
> +	/* enable busmaster */
> +	pci_read_config_dword(pdev, PCI_COMMAND, &cmd);
> +	cmd |= PCI_COMMAND_MASTER;
> +	pci_write_config_dword(pdev, PCI_COMMAND, cmd);
> +}

[...]

Best regards,
Marek Vasut

  reply	other threads:[~2015-11-17  8:03 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17  3:53 [U-Boot] [PATCH 00/25] dm: Conversion of code to the new driver model PCI API Simon Glass
2015-11-17  3:53 ` [U-Boot] [PATCH 01/25] dm: pci: Mark legacy files as such Simon Glass
2015-11-18  4:26   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 02/25] dm: pci: Use driver model PCI API in auto-config Simon Glass
2015-11-18  4:26   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 03/25] dm: pci: Add a driver-model version of pci_find_device() Simon Glass
2015-11-18  4:26   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 04/25] dm: pci: scsi: Use driver-model PCI API Simon Glass
2015-11-18  4:26   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 05/25] dm: pci: Add a driver-model version of pci_find_class() Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 06/25] dm: pci: Add a function to read a PCI BAR Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 07/25] dm: serial: Convert ns16550 driver to use driver model PCI API Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 08/25] dm: x86: ivybridge: Convert graphics init to use DM " Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 09/25] dm: Convert bios_interrupts " Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 10/25] dm: pci: video: Convert video and pci_rom " Simon Glass
2015-11-18  4:27   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 11/25] dm: x86: pci: Adjust bios_run_on_x86() to use the " Simon Glass
2015-11-18  4:47   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 12/25] dm: pci: Drop the old version of pci_find_device() Simon Glass
2015-11-18  4:48   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 13/25] dm: pci: Drop the old version of pci_find_class() Simon Glass
2015-11-18  4:48   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 14/25] dm: tegra: net: Convert tegra boards to driver model for Ethernet Simon Glass
2015-11-18  4:48   ` Bin Meng
2015-11-18 21:35   ` Stephen Warren
2015-11-18 22:14     ` Simon Glass
2015-11-18 22:52       ` Stephen Warren
2015-11-17  3:53 ` [U-Boot] [PATCH 15/25] dm: test: Convert PCI tests to use the DM PCI API Simon Glass
2015-11-18  4:48   ` Bin Meng
2015-11-29  6:05     ` Simon Glass
2015-11-17  3:53 ` [U-Boot] [PATCH 16/25] dm: x86: Convert x86 PCI functions over to " Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 17/25] dm: pci: Add driver model API functions for address mapping Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 18/25] dm: net: Convert rtl8169 to use DM PCI API Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-23 23:32   ` Joe Hershberger
2015-11-30 23:17     ` Simon Glass
2015-11-17  3:53 ` [U-Boot] [PATCH 19/25] dm: pci: Switch to DM API for PCI address mapping Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 20/25] dm: ahci: Convert to use new DM PCI API Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-17  3:53 ` [U-Boot] [PATCH 21/25] dm: usb: Convert echi-pci " Simon Glass
2015-11-17  8:03   ` Marek Vasut [this message]
2015-11-18  5:16   ` Bin Meng
2015-11-17  3:54 ` [U-Boot] [PATCH 22/25] dm: Convert PCI MMC over to use " Simon Glass
2015-11-18  5:16   ` Bin Meng
2015-11-29  6:05     ` Simon Glass
2015-11-17  3:54 ` [U-Boot] [PATCH 23/25] pci: Tidy up comments in pci_bind_bus_devices() Simon Glass
2015-11-18  6:57   ` Bin Meng
2015-11-17  3:54 ` [U-Boot] [PATCH 24/25] dm: net: usb: Refactor mcs7830 driver ready for DM conversion Simon Glass
2015-11-23 23:22   ` Joe Hershberger
2015-11-17  3:54 ` [U-Boot] [PATCH 25/25] dm: net: usb: Convert mcs7830 driver to support driver model Simon Glass
2015-11-23 23:22   ` Joe Hershberger

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=201511170903.26030.marex@denx.de \
    --to=marex@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.