Hi Yuriy,

On 10/09/2011 08:44 PM, Yuriy Kiselev wrote:
> Hi!
> I apologize in advance for the dummy question.
> I have to write driver for my own device based on arm (xScale) processor
> pxa270 & sja1000 placed on separate chip select (CS) behind FPGA organizing
> multiplexer for CAN-transceiver.
> For access to corresponding sja1000 register I should write to/read from
> [(remaped) base pointer plus multiplied by 2 register address] (it's just
> realization of multiplexer in FPGA). Ie sja_write() in my own driver looks
> like (we use 16bit bus):
> 
> 
> void *iomem_cs4 = ioremap(nCS4, SJA_MEMREG_SIZE);
> ...
> 
> void sja_write((volatile u8 data, void __iomem* sja_reg_addr)
> {
>     extern void *iomem_cs4;
>     *(u16*)(iomem_cs4 + ((u32)sja_reg_addr * 2)) = data;
> }
> 
> Interrupt from SJA1000 lives on pxa270 GPIO.
> 
> I want to use SocketCAN, but I couldn't found write place in driver and docs
> for my needs.
> Regards.

At a first glance, I think that the SJA1000 platform driver already
supports your hardware:

http://lxr.linux.no/#linux/drivers/net/can/sja1000/sja1000_platform.c

You mainly need to provide proper platform data in your platform code
similar to:

http://lxr.linux.no/#linux+v3.0.4/arch/arm/mach-imx/mach-pcm037.c#L505

Be aware of IORESOURCE_MEM_16BIT.

Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to