All times are UTC-06:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: EFIKA and mscan
PostPosted: Tue Jun 17, 2008 11:57 am 
Offline

Joined: Tue Jun 17, 2008 8:39 am
Posts: 2
I'm trying to enable mscan controller in SmartFirmware and configure it for use with Linux OS.

I have already looked at another similar thread on this site(http://www.powerdeveloper.org/forums/vi ... php?t=1466).

After setting up ALT bits (MBAR+0xB00), and enabling CAN controller (MBAR+0x901 for CAN1), is there any other register that needs to be changed?

Also, where can I find some guidelines, or tutorial, that explains how to add interrupt definitions to this device (like interrupt properties for other controllers in device tree supplement)?


Top
   
 Post subject: Re: EFIKA and mscan
PostPosted: Wed Jun 18, 2008 4:06 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
After setting up ALT bits (MBAR+0xB00), and enabling CAN controller (MBAR+0x901 for CAN1), is there any other register that needs to be changed?
I'm not sure. I will take a look. In theory all you need to do is that, but I bet it is in fact a little more complicated. That should be the BARE minimum for handing off to Linux though.
Quote:
Also, where can I find some guidelines, or tutorial, that explains how to add interrupt definitions to this device (like interrupt properties for other controllers in device tree supplement)?
Ah, well these are in the manual. There are 3 (or 4) classes of interrupt in the MPC5200B, Normal, Peripheral, Critical (and BestComm). They're in some order from 0-3 which is the first number in the interrupt definition (BestComm is 3, Peripherals I think is 2.. whatever I'm using in the device tree supplement for the devices there like audio).

Then the other numbers are the interrupt number (which is in a table 7-27 in Chapter 7 for peripherals - so MSCAN1 is "17" because it's marked as PEa17 - I have no idea why they didn't just use bit numbers) and the edge/level type of the interrupt (Efika uses 3 which I think is EDGE). So the interrupt property needs to be 3 cells; So for MSCAN it'd be..
Code:
s" /builtin" find-device
new-device
s" mscan" 2dup device-name device-type
0xf0000900 0x40 reg

0x2 encode-int
0x11 encode-int encode+
0x3 encode-int encode+
s" interrupts" property

s" MPC52xx MSCAN Controller 1" encode-string s" .description" property
s" mpc5200b-mscan" encode-string s" mpc5200-mscan" encode-string encode+ s" compatible" property

0 encode-int s" cell-index" property
finish-device
You need the driver of course, that's up to you, but I think it's trying to be mainlined right now..

_________________
Matt Sealey


Top
   
 Post subject: Re: EFIKA and mscan
PostPosted: Wed Jun 18, 2008 6:14 am 
Offline

Joined: Tue Jun 17, 2008 8:39 am
Posts: 2
Quote:
Ah, well these are in the manual. There are 3 (or 4) classes of interrupt in the MPC5200B, Normal, Peripheral, Critical (and BestComm).
Thank you for the answer, but yesterday I have found this description: http://www.mjmwired.net/kernel/Document ... ndings.txt

It is in draft, but it was enough to give me directions what and where to look.

It would be nice if someone from Genesi or bPlan can compile document that describes this kind of information (firmware, interrupts, how it interacts with kernel at boot, etc...), or atleast document with links where to look for information.
Quote:
You need the driver of course, that's up to you, but I think it's trying to be mainlined right now..
I will try to run patched peak driver (i hope it will be this week).

But, here is also another suggestion - Freescale gives BSP with their boards (there is also patched driver for CAN, and support for other onboard devices, I think). It would make a lot of people happy if Genesi could provide something like that for EFIKA, so someone that has almost no experience with Linux ( me :) ) can jump-start and test this board.


Top
   
 Post subject: Re: EFIKA and mscan
PostPosted: Wed Jun 18, 2008 7:20 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
It would be nice if someone from Genesi or bPlan can compile document that describes this kind of information (firmware, interrupts, how it interacts with kernel at boot, etc...), or atleast document with links where to look for information.
This is all covered by the IEEE 1275 specification and the usual best practises for CHRP and building devices with our kind of firmware.

We don't want to duplicate the documentation available as it just makes it confusing; by the time we have collated documentation, some of it changes (the MPC5200B device tree is still in flux as of this month) - we only make a big deal out of the differences, of which there should be very few or are plainly obvious looking at the device tree.
Quote:
I will try to run patched peak driver (i hope it will be this week).

But, here is also another suggestion - Freescale gives BSP with their boards (there is also patched driver for CAN, and support for other onboard devices, I think). It would make a lot of people happy if Genesi could provide something like that for EFIKA, so someone that has almost no experience with Linux ( me :) ) can jump-start and test this board.
Our BSP is the mainlined Linux kernel (2.6.26) and we have a reference for drivers and expected functionality based on 2.6.19 on http://www.efika.de/ - features for all the chipset IP cores are either in mainline, the LinuxPPC Patchwork archive (http://patchwork.ozlabs.org/) or not yet written (not our problem, to be honest, however we will undertake the work for customers who have the requirement, large orders and are willing to negotiate a contract or firmware license).

The Peak CAN driver is pretty much all you need from this point in, you can use the Freescale BSP version (which is quite old) or there are updates I think on the OSELAS.Toolchain website which I think supports the MPC5200B (if it does not, there is a recent patch floating around.. I will need to check on it for you but you may have faster results looking for yourself)

_________________
Matt Sealey


Top
   
 Post subject:
PostPosted: Thu Jun 19, 2008 3:57 am 
Offline

Joined: Fri Nov 17, 2006 4:24 pm
Posts: 10
Location: Slovenia
BTW. there's alternative to peak implementation, socketcan.

Socketcan has been merged some versions ago, but i don't see mscan driver inside, so maybe it's on socketcan ML or somewhere.


Top
   
 Post subject:
PostPosted: Thu Jun 19, 2008 4:29 am 
Offline
Site Admin

Joined: Fri Sep 24, 2004 1:39 am
Posts: 1589
Location: Austin, TX
Quote:
BTW. there's alternative to peak implementation, socketcan.

Socketcan has been merged some versions ago, but i don't see mscan driver inside, so maybe it's on socketcan ML or somewhere.
Ah, the OSELAS toolchain has Socketcan, and an MPC52xx driver in it, I just browsed the phyCORE-MPC5200B-tiny kit and found it.

_________________
Matt Sealey


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group