All of lore.kernel.org
 help / color / mirror / Atom feed
* Fail to configure interrupt for new device
@ 2020-05-15 14:05 Jacko Dirks
  0 siblings, 0 replies; only message in thread
From: Jacko Dirks @ 2020-05-15 14:05 UTC (permalink / raw)
  To: devicetree

Hello,

I am working on implementing a new device on the raspberry pi 4, an I2C
slave. The interrupt is not working, and I think I did something wrong
with the DTS. But I cannot quite figure out what it is.

Here is what I have so far:
In bcm2711-rpi-4-b.dts

	i2c_slave0_pins: i2cs0 {
		brcm,pins = <10 11>;
		brcm,function = <BCM2835_FSEL_ALT3>;
	};

In bcm2711.dtsi


		i2cs0: i2c_slave@7e214000 {
			compatible = "brcm,bcm2711-i2c-slave";
			reg = <0x7e214000 0x200>;
			interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clocks BCM2835_CLOCK_VPU>;
			#address-cells = <1>;
			#size-cells = <0>;
			status = "disabled";
		};

Interrupt number 107 here is a guess. The guess goes as follows: In the
bcm2711 ARM periphials file there is a table on page 108. This table
shows my interrupt (SPI/BSC slave) to be at place 43. This table also
shows all I2C master interrupts to be at place 53. A I2C master 
interrupt uses number 117. 117 - (53 - 43) = 107. So, that approach
might be an issue.

Moreover, I have never specifed that I want that interrupt to be
attached to pin 11. There was a large renovation somewhat recently, but
before that I could drop a line like

interrupts = <2 11>;

Somewhere.

To be complete: here is the overlay:

/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2711";

	fragment@0 {
		target = <&i2cs0>;
		frag0: __overlay__ {
			status = "okay";
			pinctrl-names = "default";
			pinctrl-0 = <&i2c_slave0_pins>;
		};
	};
};

Any feedback or input would be very welcome.

Jacko Dirks

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-15 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 14:05 Fail to configure interrupt for new device Jacko Dirks

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.