From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 22/26] dm: usb: Convert echi-pci to use new DM PCI API
Date: Sun, 29 Nov 2015 21:43:53 +0100 [thread overview]
Message-ID: <201511292143.53249.marex@denx.de> (raw)
In-Reply-To: <1448828291-12660-23-git-send-email-sjg@chromium.org>
On Sunday, November 29, 2015 at 09:18:07 PM, Simon Glass wrote:
> Convert this driver to use the new driver model PCI API.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
ad subject -- it's EHCI, not ECHI .
> ---
>
> Changes in v2:
> - Use u32 instead of uint32_t
> - Use uintptr_t to cast the hcor address
>
> drivers/usb/host/ehci-pci.c | 51
> ++++++++++++++++++++++++++++++++++----------- 1 file changed, 39
> insertions(+), 12 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> index d607088..cda1c6d 100644
> --- a/drivers/usb/host/ehci-pci.c
> +++ b/drivers/usb/host/ehci-pci.c
> @@ -18,32 +18,34 @@ struct ehci_pci_priv {
> struct ehci_ctrl ehci;
> };
>
> -static void ehci_pci_common_init(pci_dev_t pdev, struct ehci_hccr
> **ret_hccr, - struct ehci_hcor **ret_hcor)
> +#ifdef CONFIG_DM_USB
> +
> +static void ehci_pci_init(struct udevice *dev, struct ehci_hccr
> **ret_hccr, + struct ehci_hcor **ret_hcor)
> {
> struct ehci_hccr *hccr;
> struct ehci_hcor *hcor;
> - uint32_t cmd;
> + u32 cmd;
>
> - hccr = (struct ehci_hccr *)pci_map_bar(pdev,
> + hccr = (struct ehci_hccr *)dm_pci_map_bar(dev,
> PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
> - hcor = (struct ehci_hcor *)((uint32_t) hccr +
> + hcor = (struct ehci_hcor *)((uintptr_t) hccr +
> 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)));
> + (u32)hccr, (u32)hcor,
> + (u32)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
Use uintptr here as well then ?
> *ret_hccr = hccr;
> *ret_hcor = hcor;
>
> /* enable busmaster */
> - pci_read_config_dword(pdev, PCI_COMMAND, &cmd);
> + dm_pci_read_config32(dev, PCI_COMMAND, &cmd);
> cmd |= PCI_COMMAND_MASTER;
> - pci_write_config_dword(pdev, PCI_COMMAND, cmd);
> + dm_pci_write_config32(dev, PCI_COMMAND, cmd);
> }
Looks good otherwise,
Acked-by: Marek Vasut <marex@denx.de>
next prev parent reply other threads:[~2015-11-29 20:43 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 20:17 [U-Boot] [PATCH v2 00/26] dm: Conversion of code to the new driver model PCI API Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 01/26] dm: pci: Mark legacy files as such Simon Glass
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 02/26] dm: pci: Add a dm_ prefix to pci_get_bdf() Simon Glass
2015-12-03 9:06 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 03/26] dm: pci: Add a dm_ prefix to pci_bus_find_bdf() Simon Glass
2015-12-03 9:06 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 04/26] dm: pci: Use driver model PCI API in auto-config Simon Glass
2015-12-03 9:15 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 05/26] dm: pci: Add a driver-model version of pci_find_device() Simon Glass
2015-12-03 9:18 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 06/26] dm: pci: scsi: Use driver-model PCI API Simon Glass
2015-12-03 10:03 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 07/26] dm: pci: Add a driver-model version of pci_find_class() Simon Glass
2015-12-03 10:03 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 08/26] dm: pci: Add a function to read a PCI BAR Simon Glass
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 09/26] dm: serial: Convert ns16550 driver to use driver model PCI API Simon Glass
2015-12-07 13:27 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 10/26] dm: x86: ivybridge: Convert graphics init to use DM " Simon Glass
2015-12-07 10:34 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 11/26] dm: Convert bios_interrupts " Simon Glass
2015-12-07 10:53 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 12/26] dm: pci: video: Convert video and pci_rom " Simon Glass
2015-11-30 9:29 ` Anatolij Gustschin
2015-12-07 10:53 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 13/26] dm: x86: pci: Adjust bios_run_on_x86() to use the " Simon Glass
2015-12-07 10:53 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:17 ` [U-Boot] [PATCH v2 14/26] dm: pci: Drop the old version of pci_find_device/s() Simon Glass
2015-12-07 10:58 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 15/26] dm: pci: Drop the old version of pci_find_class() Simon Glass
2015-12-07 10:58 ` Bin Meng
2015-12-14 3:45 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 16/26] dm: tegra: net: Convert tegra boards to driver model for Ethernet Simon Glass
2015-11-30 22:35 ` Joe Hershberger
2015-12-14 3:46 ` Simon Glass
2016-01-15 23:53 ` Stephen Warren
2016-01-18 3:58 ` Simon Glass
2016-01-18 17:27 ` Stephen Warren
2016-01-19 1:59 ` Simon Glass
2016-02-11 23:21 ` Stephen Warren
2016-02-12 0:10 ` Simon Glass
2016-02-12 0:45 ` Stephen Warren
2016-02-12 20:04 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 17/26] dm: test: Convert PCI tests to use the DM PCI API Simon Glass
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 18/26] dm: pci: Add driver model API functions for address mapping Simon Glass
2015-12-07 11:14 ` Bin Meng
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 19/26] dm: net: Convert rtl8169 to use DM PCI API Simon Glass
2015-11-30 22:35 ` Joe Hershberger
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 20/26] dm: pci: Switch to DM API for PCI address mapping Simon Glass
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 21/26] dm: ahci: Convert to use new DM PCI API Simon Glass
2015-12-07 11:27 ` Bin Meng
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 22/26] dm: usb: Convert echi-pci " Simon Glass
2015-11-29 20:43 ` Marek Vasut [this message]
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 23/26] dm: Convert PCI MMC over to use " Simon Glass
2015-12-07 11:28 ` Bin Meng
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 24/26] pci: Tidy up comments in pci_bind_bus_devices() Simon Glass
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 25/26] dm: net: usb: Refactor mcs7830 driver ready for DM conversion Simon Glass
2015-12-14 3:46 ` Simon Glass
2015-11-29 20:18 ` [U-Boot] [PATCH v2 26/26] dm: net: usb: Convert mcs7830 driver to support driver model Simon Glass
2015-12-14 3:46 ` Simon Glass
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=201511292143.53249.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox