All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Kashperko <george@znau.edu.ua>
To: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: SSB AI support code ([RFC1/11] SSB admatch redefine)
Date: Wed, 09 Feb 2011 16:29:29 +0200	[thread overview]
Message-ID: <1297261769.18053.14.camel@dev.znau.edu.ua> (raw)
In-Reply-To: <1297258590.17400.37.camel@dev.znau.edu.ua>

From: George Kashperko <george@znau.edu.ua>

Move direct master/slave wrappers registers' queries into SSB management code.
Indirect requests to SB management code for wrappers' base/size rather than
direct access to backplane-specific registers will let adding AI-style SSB
buses support without need to alter drivers' code later on.
Signed-off-by: George Kashperko <george@znau.edu.ua>
---
 drivers/ssb/driver_gige.c   |    2 +-
 drivers/ssb/main.c          |    8 ++++++--
 drivers/usb/host/ohci-ssb.c |    8 ++++----
 include/linux/ssb/ssb.h     |    4 ++--
 4 files changed, 13 insertions(+), 9 deletions(-)
--- linux-next-20110203.orig/drivers/ssb/driver_gige.c	2011-02-01 05:05:49.000000000 +0200
+++ linux-next-20110203/drivers/ssb/driver_gige.c	2011-02-05 17:41:30.000000000 +0200
@@ -193,7 +193,7 @@ static int ssb_gige_probe(struct ssb_dev
 		ssb_device_enable(sdev, 0);
 
 	/* Setup BAR0. This is a 64k MMIO region. */
-	base = ssb_admatch_base(ssb_read32(sdev, SSB_ADMATCH1));
+	base = ssb_admatch_base(sdev, SSB_ADMATCH1);
 	gige_pcicfg_write32(dev, PCI_BASE_ADDRESS_0, base);
 	gige_pcicfg_write32(dev, PCI_BASE_ADDRESS_1, 0);
 
--- linux-next-20110203.orig/drivers/ssb/main.c	2011-02-01 05:05:49.000000000 +0200
+++ linux-next-20110203/drivers/ssb/main.c	2011-02-05 17:42:37.000000000 +0200
@@ -1312,10 +1312,12 @@ error:
 }
 EXPORT_SYMBOL(ssb_bus_powerup);
 
-u32 ssb_admatch_base(u32 adm)
+u32 ssb_admatch_base(struct ssb_device *dev, u32 adm)
 {
 	u32 base = 0;
 
+	adm = ssb_read32(dev, adm);
+
 	switch (adm & SSB_ADM_TYPE) {
 	case SSB_ADM_TYPE0:
 		base = (adm & SSB_ADM_BASE0);
@@ -1336,10 +1338,12 @@ u32 ssb_admatch_base(u32 adm)
 }
 EXPORT_SYMBOL(ssb_admatch_base);
 
-u32 ssb_admatch_size(u32 adm)
+u32 ssb_admatch_size(struct ssb_device *dev, u32 adm)
 {
 	u32 size = 0;
 
+	adm = ssb_read32(dev, adm);
+
 	switch (adm & SSB_ADM_TYPE) {
 	case SSB_ADM_TYPE0:
 		size = ((adm & SSB_ADM_SZ0) >> SSB_ADM_SZ0_SHIFT);
--- linux-next-20110203.orig/drivers/usb/host/ohci-ssb.c	2011-02-01 05:05:49.000000000 +0200
+++ linux-next-20110203/drivers/usb/host/ohci-ssb.c	2011-02-05 17:44:59.000000000 +0200
@@ -107,7 +107,7 @@ static int ssb_ohci_attach(struct ssb_de
 	struct ssb_ohci_device *ohcidev;
 	struct usb_hcd *hcd;
 	int err = -ENOMEM;
-	u32 tmp, flags = 0;
+	u32 flags = 0;
 
 	if (dma_set_mask(dev->dma_dev, DMA_BIT_MASK(32)) ||
 	    dma_set_coherent_mask(dev->dma_dev, DMA_BIT_MASK(32)))
@@ -118,6 +118,7 @@ static int ssb_ohci_attach(struct ssb_de
 		flags |= SSB_OHCI_TMSLOW_HOSTMODE;
 		ssb_device_enable(dev, flags);
 	} else if (dev->id.coreid == SSB_DEV_USB20_HOST) {
+		u32 tmp;
 		/*
 		 * USB 2.0 special considerations:
 		 *
@@ -163,9 +164,8 @@ static int ssb_ohci_attach(struct ssb_de
 	ohcidev = hcd_to_ssb_ohci(hcd);
 	ohcidev->enable_flags = flags;
 
-	tmp = ssb_read32(dev, SSB_ADMATCH0);
-	hcd->rsrc_start = ssb_admatch_base(tmp);
-	hcd->rsrc_len = ssb_admatch_size(tmp);
+	hcd->rsrc_start = ssb_admatch_base(dev, SSB_ADMATCH0);
+	hcd->rsrc_len = ssb_admatch_size(dev, SSB_ADMATCH0);
 	hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
 	if (!hcd->regs)
 		goto err_put_hcd;
--- linux-next-20110203.orig/include/linux/ssb/ssb.h	2011-02-01 05:05:49.000000000 +0200
+++ linux-next-20110203/include/linux/ssb/ssb.h	2011-02-05 17:40:13.000000000 +0200
@@ -520,8 +520,8 @@ extern int ssb_bus_powerup(struct ssb_bu
 

 /* Various helper functions */
-extern u32 ssb_admatch_base(u32 adm);
-extern u32 ssb_admatch_size(u32 adm);
+extern u32 ssb_admatch_base(struct ssb_device *dev, u32 adm);
+extern u32 ssb_admatch_size(struct ssb_device *dev, u32 adm);
 
 /* PCI device mapping and fixup routines.
  * Called from the architecture pcibios init code.




  reply	other threads:[~2011-02-09 14:36 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 13:36 SSB AI support code George Kashperko
2011-02-09 14:29 ` George Kashperko [this message]
2011-02-09 14:31 ` SSB AI support code ([RFC2/11] SSB reintroduce handlers as device ops) George Kashperko
2011-02-09 14:32 ` SSB AI support code ([RFC3/11] SSB irqflag device op) George Kashperko
2011-02-09 16:19   ` Larry Finger
2011-02-09 17:10     ` George Kashperko
2011-02-09 17:48       ` Larry Finger
2011-02-09 18:23         ` George Kashperko
2011-02-09 19:19           ` Larry Finger
2011-02-09 19:26             ` George Kashperko
2011-02-09 19:42               ` Larry Finger
2011-02-09 14:34 ` SSB AI support code ([RFC4/11] SSB core control and state device ops) George Kashperko
2011-02-09 20:35   ` Rafał Miłecki
2011-02-09 21:01     ` Rafał Miłecki
2011-02-09 21:21       ` George Kashperko
2011-02-09 21:03     ` George Kashperko
2011-02-09 21:14       ` Michael Büsch
2011-02-09 21:55       ` Rafał Miłecki
2011-02-09 21:58         ` George Kashperko
2011-02-09 22:00         ` George Kashperko
2011-02-09 22:02         ` Michael Büsch
2011-02-09 22:22           ` George Kashperko
2011-02-09 14:36 ` SSB AI support code ([RFC5/11] SSB propagate core control and state ops usage) George Kashperko
2011-02-09 20:58   ` Rafał Miłecki
2011-02-09 21:12     ` Michael Büsch
2011-02-09 21:26     ` George Kashperko
2011-02-09 21:50       ` Rafał Miłecki
2011-02-09 21:55         ` George Kashperko
2011-02-09 14:37 ` SSB AI support code ([RFC6/11] SSB introduce bus_check_core routine) George Kashperko
2011-02-09 14:39 ` SSB AI support code ([RFC7/11] SSB introduce ssb_bus_detect routine) George Kashperko
2011-02-09 14:40 ` SSB AI support code ([RFC8/11] SSB separate SB-specific scanning) George Kashperko
2011-02-09 14:41 ` SSB AI support code ([RFC9/11] SSB modify irqflag treatment) George Kashperko
2011-02-09 16:23   ` Larry Finger
2011-02-09 16:53     ` George Kashperko
2011-02-09 14:44 ` SSB AI support code ([RFC9/11] SSB separate SB-specific code) George Kashperko
2011-02-09 14:45 ` SSB AI support code ([RFC10/11] SSB modify irqflag treatment) George Kashperko
2011-02-09 14:46 ` SSB AI support code ([RFC11/11] SSB add AI-bus support) George Kashperko
2011-02-09 16:25   ` Larry Finger
2011-02-09 18:33     ` George Kashperko
2011-02-09 16:49   ` Larry Finger
2011-02-09 21:35 ` SSB AI support code Rafał Miłecki
2011-02-09 21:41   ` George Kashperko
2011-02-09 21:51   ` Michael Büsch
2011-02-09 22:53     ` Rafał Miłecki
2011-02-09 23:10       ` Michael Büsch
2011-02-09 23:18       ` Larry Finger
2011-02-10  5:24         ` SSB AI support code ([RFC] v2) George Kashperko
2011-02-10 10:20           ` Michael Büsch
2011-02-10 17:40             ` George Kashperko
2011-02-10 18:11               ` Michael Büsch
     [not found]                 ` <1297362251.15805.51.camel@dev.znau.edu.ua>
     [not found]                   ` <1297363781.30218.37.camel@maggie>
2011-02-10 19:52                     ` George Kashperko
2011-02-10 20:07                       ` Michael Büsch
2011-02-15 14:50                 ` Rafał Miłecki
2011-02-15 15:05                   ` George Kashperko
2011-02-09 23:30       ` SSB AI support code George Kashperko
2011-02-15 14:48         ` Rafał Miłecki
2011-02-15 14:53           ` George Kashperko
2011-02-12 13:03 ` Hauke Mehrtens
2011-02-12 14:15   ` George Kashperko
2011-02-17  9:28   ` Roland Vossen

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=1297261769.18053.14.camel@dev.znau.edu.ua \
    --to=george@znau.edu.ua \
    --cc=linux-wireless@vger.kernel.org \
    /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.