Okay the configuration is as follows:
CAN1 is connected to the CAN1 port - it's present on I2C1 pins (W19 and V19).
The way I see it you need to look at Chapter 7 of the manual and look at the GPS Port Configuration Register, for the "ALT" bits - will set up alternative configuration so that CAN1 is on I2C1.
Code:
01 = ALT CAN position: CAN1 on I2C1, CAN2 on Tmr0/1 pins, see Note 1
Doing this in my head, you can do this from Firmware using;
Code:
0xf0000b00 dup l@ 0x10000000 and l!
You can then access the MSCAN bus at MBAR + 0x0900. I would suggest you perform that logic operation above and add in the code to a Forth script or your nvramrc to enable it on boot;
Code:
s" /builtin" find-device
new-device
s" mscan" 2dup device-name device-type
0xf0000900 0x40 reg
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 may need to add a probe-all above it in nvramrc if it's not there, and put all this between that and "install-console banner" if that's present.
Please do not try this unless you're sure! Now all you need is a driver for the CAN bus, and you're all set (this at least gives any arch/powerpc-compliant driver all the things it needs from the firmware)
As a side effect, it seems that the CAN pins on the bottom of the board are an effective I2C bus on boot without further configuration. You could add the bus with this snippet (mutually exclusive with the above):
Code:
s" /builtin" find-device
new-device
s" i2c" 2dup device-name device-type
0xf0003d00 0x1c reg
s" MPC52xx i2c Controller 1" encode-string s" .description" property
s" mpc5200b-i2c" encode-string s" mpc5200-i2c" encode-string encode+ s" compatible" property
0 encode-int s" cell-index" property
finish-device
There are obviously missing interrupt properties etc. but I will leave that as an exercise to the reader.
If someone manages to test these please give me a nudge and I will integrate them happily into the
Device Tree Supplement and
Platform Specifications page! I know a lot of people wanted an I2C bus on their Efika for controlling devices, and this is the key information..