SJA1000 with EBI

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

Posts: 22
Joined: Wed Sep 06, 2006 3:06 pm

SJA1000 with EBI

Thu Jul 04, 2019 3:21 pm


I have troubles with connecting an SJA1000 CAN Controller to a SAMA5D27-D1G. Yes, I know the SAMA5 has an integrated CAN Controller but the controller is used as an replacement where the SJA1000 was connected as ISA device.
I'm pretty sure I have to configure EBI in some way to get this working. So far I can use devmem from console to read some of the registers of the SJA1000 but I have issues to configure the linux driver for it correctly.

Here is what I can do at the moment and the results on the console:

Code: Select all

modprobe sja1000-isa mem=0x10000300 irq=5

sja1000_isa sja1000_isa.0: sja1000_isa device registered (reg_base=0xc8a19300, irq=5)
Legacy sja1000_isa driver for max. 8 devices registered

Code: Select all

ip link set can0 type can bitrate 125000

sja1000_isa sja1000_isa.0 can0: setting BTR0=0x03 BTR1=0x1c

Code: Select all

ip link set up can0

RTNETLINK answers: Resource temporarily unavailable

I also tried to define an entry in DTS for the SJA1000 which automatically loads sja1000-platform module but no canX device available

Code: Select all

/ {
	ahb {
		apb {
			pinctrl@fc038000 {
				pinctrl_isabus: isabus {
					address_lines {
						pinmux = <PIN_PC11__A0_NBS0>,
					data_lines {
						pinmux = <PIN_PA0__D0>,
					special_lines {
						pinmux = <PIN_PA8__NWE_NANDWE>,
					irq-lines {
						pinmux = <PIN_PC9__GPIO>;
		ebi: ebi@10000000 {
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_isabus>;
			clocks = <&h32ck>;

			status = "okay";
			canisa: can@0,0x300 {
				compatible = "nxp,sja1000";
				reg = <0 0x00000300 0x00000100>;
				interrupt-parent = <&pioA>;
				interrupts = <PIN_PC9 IRQ_TYPE_EDGE_RISING>;
				nxp,external-clock-frequency = <16000000>;
				nxp,tx-output-config = <0x16>;
				atmel,smc-read-mode = "nrd";
				atmel,smc-write-mode = "nwe";
				atmel,smc-exnw-mode = "frozen"; /* disabled, frozen oder ready */
				atmel,smc-bus-width = <16>;
				atmel,smc-ncs-rd-setup-ns = <0>;
				atmel,smc-ncs-wr-setup-ns = <0>;
				atmel,smc-nwe-setup-ns = <0>;
				atmel,smc-nrd-setup-ns = <0>;
				atmel,smc-ncs-rd-pulse-ns = <564>;
				atmel,smc-ncs-wr-pulse-ns = <564>;
				atmel,smc-nrd-pulse-ns = <528>;
				atmel,smc-nwe-pulse-ns = <528>;
				atmel,smc-nrd-cycle-ns = <648>;
				atmel,smc-nwe-cycle-ns = <648>;
				atmel,smc-tdf-ns = <0>;

I hope anyone can point me in the right direction so I can finally use the CAN controller again.

Return to “LINUX”

Who is online

Users browsing this forum: Google [Bot] and 4 guests