From: Hauke Mehrtens <hauke@hauke-m.de>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: linux-wireless@vger.kernel.org, linux-mips@linux-mips.org,
zajec5@gmail.com, mb@bu3sch.de, george@znau.edu.ua,
arend@broadcom.com, b43-dev@lists.infradead.org,
bernhardloos@googlemail.com
Subject: [RFC][PATCH 03/10] bcma: add embedded bus
Date: Mon, 06 Jun 2011 23:40:10 +0200 [thread overview]
Message-ID: <4DED493A.8050209@hauke-m.de> (raw)
In-Reply-To: <BANLkTi=atiB_=_N3xSJBAjRGXjTV8a97CA@mail.gmail.com>
On 06/06/2011 01:22 AM, Julian Calaby wrote:
> Hauke,
>
> Minor nit:
>
> On Mon, Jun 6, 2011 at 08:07, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> This patch adds support for using bcma on an embedded bus. An embedded
>> system like the bcm4716 could register this bus and it searches for the
>> bcma cores then.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>> diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
>> index 70b39f7..9229615 100644
>> --- a/drivers/bcma/scan.c
>> +++ b/drivers/bcma/scan.c
>> @@ -219,9 +219,34 @@ int bcma_bus_scan(struct bcma_bus *bus)
>> bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
>> bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
>> bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
>> + bus->nr_cores = (tmp & BCMA_CC_ID_NRCORES) >> BCMA_CC_ID_NRCORES_SHIFT;
>> +
>> + /* If we are an embedded device we now know the number of avaliable
>> + * core and ioremap the correct space.
>> + */
>> + if (bus->hosttype == BCMA_HOSTTYPE_EMBEDDED) {
>> + iounmap(bus->mmio);
>> + mmio = ioremap(BCMA_ADDR_BASE, BCMA_CORE_SIZE * bus->nr_cores);
>> + if (!mmio)
>> + return -ENOMEM;
>> + bus->mmio = mmio;
>> +
>> + mmio = ioremap(BCMA_WRAP_BASE, BCMA_CORE_SIZE * bus->nr_cores);
>> + if (!mmio)
>> + return -ENOMEM;
>> + bus->host_embedded = mmio;
>> + }
>> + /* reset it to 0 as we use it for counting */
>> + bus->nr_cores = 0;
>
> Would it make sense to use a local variable for nr_cores, and only use
> it within the BCMA_HOSTTYPE_EMBEDDED if statement, rather than
> re-using bus->nr_cores and having to reset it?
Yes that looks better.
Hauke
next prev parent reply other threads:[~2011-06-06 21:40 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 22:07 [RFC][PATCH 00/10] bcma: add support for embedded devices like bcm4716 Hauke Mehrtens
2011-06-05 22:07 ` [RFC][PATCH 01/10] bcma: Use array to store cores Hauke Mehrtens
2011-06-06 9:42 ` Rafał Miłecki
2011-06-05 22:07 ` [RFC][PATCH 02/10] bcma: Make it possible to run bcma_register_cores() later Hauke Mehrtens
2011-06-05 22:07 ` [RFC][PATCH 03/10] bcma: add embedded bus Hauke Mehrtens
2011-06-06 10:22 ` Rafał Miłecki
[not found] ` <1307356322.28734.11.camel@dev.znau.edu.ua>
2011-06-06 10:51 ` Rafał Miłecki
[not found] ` <4DECB232.70308@broadcom.com>
2011-06-06 11:00 ` Rafał Miłecki
2011-06-06 22:00 ` Hauke Mehrtens
2011-06-07 0:33 ` Rafał Miłecki
[not found] ` <4DEDFDC8.50005@broadcom.com>
2011-06-07 21:23 ` Hauke Mehrtens
[not found] ` <BANLkTi=atiB_=_N3xSJBAjRGXjTV8a97CA@mail.gmail.com>
2011-06-06 21:40 ` Hauke Mehrtens [this message]
2011-06-05 22:07 ` [RFC][PATCH 04/10] bcma: add mips driver Hauke Mehrtens
2011-06-06 11:23 ` Rafał Miłecki
2011-06-06 22:06 ` Hauke Mehrtens
2011-06-06 22:50 ` Rafał Miłecki
2011-06-05 22:07 ` [RFC][PATCH 05/10] bcma: add serial console support Hauke Mehrtens
2011-06-06 10:30 ` Rafał Miłecki
2011-06-05 22:07 ` [RFC][PATCH 06/10] bcma: get CPU clock Hauke Mehrtens
2011-06-06 10:34 ` Rafał Miłecki
2011-06-06 10:40 ` Rafał Miłecki
2011-06-05 22:07 ` [RFC][PATCH 07/10] bcma: add pci(e) host mode Hauke Mehrtens
2011-06-06 11:32 ` Rafał Miłecki
2011-06-06 22:11 ` Hauke Mehrtens
2011-06-06 11:34 ` Rafał Miłecki
2011-06-05 22:07 ` [RFC][PATCH 08/10] bcm47xx: prepare to support different buses Hauke Mehrtens
2011-06-05 22:07 ` [RFC][PATCH 09/10] bcm47xx: add support for bcma bus Hauke Mehrtens
2011-06-06 11:07 ` Rafał Miłecki
2011-06-06 22:13 ` Hauke Mehrtens
2011-06-05 22:07 ` [RFC][PATCH 10/10] bcm47xx: fix irq assignment for new SoCs Hauke Mehrtens
[not found] ` <201106061332.51661.arnd@arndb.de>
[not found] ` <1307363399.28734.25.camel@dev.znau.edu.ua>
[not found] ` <201106061503.14852.arnd@arndb.de>
2011-06-06 21:38 ` [RFC][PATCH 01/10] bcma: Use array to store cores Hauke Mehrtens
[not found] ` <201106062353.40470.arnd@arndb.de>
[not found] ` <4DEDF98C.6020905@broadcom.com>
2011-06-07 21:44 ` Hauke Mehrtens
2011-06-08 0:06 ` Rafał Miłecki
2011-06-08 8:20 ` Michael Büsch
2011-06-11 22:33 ` Hauke Mehrtens
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=4DED493A.8050209@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=arend@broadcom.com \
--cc=b43-dev@lists.infradead.org \
--cc=bernhardloos@googlemail.com \
--cc=george@znau.edu.ua \
--cc=julian.calaby@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mb@bu3sch.de \
--cc=zajec5@gmail.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;
as well as URLs for NNTP newsgroup(s).