[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110111230539.GC18762@pengutronix.de>
Date: Wed, 12 Jan 2011 00:05:39 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: Wolfgang Grandegger <wg@...ndegger.com>,
Bhupesh SHARMA <bhupesh.sharma@...com>,
"Socketcan-core@...ts.berlios.de" <Socketcan-core@...ts.berlios.de>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Oliver Hartkopp <socketcan@...tkopp.net>
Subject: Re: [PATCH net-next-2.6 v3 1/1] can: c_can: Added support for
Bosch C_CAN controller
> platform bus bindings. The question might be do we need the platform bus
> bindings or is it better to have AMBA bindings? The platform driver
> supports 16 and 32 bit attached devices, via IORESOURCE_MEM_{16,32}BIT.
platform_bus might be more generic. Depends on how many possibilities there
exist to connect the core to $something.
> Where do we have to look for the AMBA id registers?
I'll let the code speak (drivers/amba/bus.c):
/*
* Read pid and cid based on size of resource
* they are located at end of region
*/
for (pid = 0, i = 0; i < 4; i++)
pid |= (readl(tmp + size - 0x20 + 4 * i) & 255) <<
(i * 8);
for (cid = 0, i = 0; i < 4; i++)
cid |= (readl(tmp + size - 0x10 + 4 * i) & 255) <<
(i * 8);
amba_put_disable_pclk(dev);
if (cid == AMBA_CID)
dev->periphid = pid;
if (!dev->periphid)
ret = -ENODEV;
with AMBA_CID being (include/linux/amba/bus.h):
#define AMBA_CID 0xb105f00d
periphid is used to match the driver to the device then. If done correctly, it
should have been registered with ARM Ltd. before (AFAIK).
Good night,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists