Skip to contentSkip to conversation

CRIS v32: increase NR_IRQS

PATCH Applied Rabin Vincent 2 participants 12 messages Aug 3, 2015 – Oct 1, 2015 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 CRIS v32: increase NR_IRQS

Increase NR_IQRS so we can fit in GPIO interrupts.

---
 arch/cris/arch-v32/kernel/irq.c       | 4 ++--
 arch/cris/include/arch-v32/arch/irq.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/cris/arch-v32/kernel/irq.c +2 -2
index 6a881e0..b566a03 100644
@@ -464,14 +464,14 @@ init_IRQ(void)
 		etrax_irv->v[i] = weird_irq;
 
 	np = of_find_compatible_node(NULL, NULL, "axis,crisv32-intc");
-	domain = irq_domain_add_legacy(np, NR_IRQS - FIRST_IRQ,
+	domain = irq_domain_add_legacy(np, NBR_INTR_VECT - FIRST_IRQ,
 				       FIRST_IRQ, FIRST_IRQ,
 				       &crisv32_irq_ops, NULL);
 	BUG_ON(!domain);
 	irq_set_default_host(domain);
 	of_node_put(np);
 
-	for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) {
+	for (i = FIRST_IRQ, j = 0; j < NBR_INTR_VECT; i++, j++) {
 		set_exception_vector(i, interrupt[j]);
 	}
 
arch/cris/include/arch-v32/arch/irq.h +1 -1
index 0c1b4d3..8270a1b 100644
@@ -4,7 +4,7 @@
 #include <hwregs/intr_vect.h>
 
 /* Number of non-cpu interrupts. */
-#define NR_IRQS NBR_INTR_VECT /* Exceptions + IRQs */
+#define NR_IRQS (NBR_INTR_VECT + 256) /* Exceptions + IRQs */
 #define FIRST_IRQ 0x31 /* Exception number for first IRQ */
 #define NR_REAL_IRQS (NBR_INTR_VECT - FIRST_IRQ) /* IRQs */
 #if NR_REAL_IRQS > 32
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/6 CRIS: add dt-bindings symlink

Add a dt-bindings symlink to get DT include files, as on other architectures. See c58299a ("kbuild: create an "include chroot" for DT bindings") for the details.

---
 arch/cris/boot/dts/include/dt-bindings | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 arch/cris/boot/dts/include/dt-bindings
arch/cris/boot/dts/include/dt-bindings new file +1 -0
new file mode 120000
index 0000000..08c00e4
@@ -0,0 +1 @@
+../../../../../include/dt-bindings
\ No newline at end of file
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 2/6] CRIS: add dt-bindings symlink

Quoted 3 lines · Rabin Vincent

Add a dt-bindings symlink to get DT include files, as on other architectures. See c58299a ("kbuild: create an "include chroot" for DT bindings") for the details.

Applied to the cris tree, thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
#3 lore raw

PATCH 3/6 CRIS v32: dev88: add GPIO, LEDs, RTC, temp sensor

In reply to Rabin Vincent

Add the GPIO driver to the device tree and, using it, support for the LEDs and the RTC chip (via I2C-GPIO), as well as the temperature sensor (via SPI-GPIO).

---
 arch/cris/boot/dts/dev88.dts    | 49 +++++++++++++++++++++++++++++++++++++++++
 arch/cris/boot/dts/etraxfs.dtsi |  8 +++++++
 2 files changed, 57 insertions(+)
arch/cris/boot/dts/dev88.dts +49 -0
index 4fa5a3f..b9a230d 100644
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
+
 /include/ "etraxfs.dtsi"
 
 / {
@@ -15,4 +17,51 @@
 			status = "okay";
 		};
 	};
+
+	spi {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		gpio-sck = <&gio 1 0 0xd>;
+		gpio-miso = <&gio 4 0 0xd>;
+		gpio-mosi = <&gio 0 0 0xd>;
+		cs-gpios = <&gio 3 0 0xd>;
+		num-chipselects = <1>;
+
+		temp-sensor@0 {
+			compatible = "ti,lm70";
+			reg = <0>;
+
+			spi-max-frequency = <100000>;
+		};
+	};
+
+	i2c {
+		compatible = "i2c-gpio";
+		gpios = <&gio 5 0 0xd>, <&gio 6 0 0xd>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		rtc@51 {
+			compatible = "nxp,pcf8563";
+			reg = <0x51>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		network {
+			label = "network";
+			gpios = <&gio 2 GPIO_ACTIVE_LOW 0xa>;
+		};
+
+		status {
+			label = "status";
+			gpios = <&gio 3 GPIO_ACTIVE_LOW 0xa>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
 };
arch/cris/boot/dts/etraxfs.dtsi +8 -0
index 909bced..bf1b858 100644
@@ -28,6 +28,14 @@
 			#interrupt-cells = <1>;
 		};
 
+		gio: gpio@b001a000 {
+			compatible = "axis,etraxfs-gio";
+			reg = <0xb001a000 0x1000>;
+			interrupts = <50>;
+			gpio-controller;
+			#gpio-cells = <3>;
+		};
+
 		serial@b00260000 {
 			compatible = "axis,etraxfs-uart";
 			reg = <0xb0026000 0x1000>;
Signature · 1 line
2.1.4
#4 lore raw

Re: [PATCH 3/6] CRIS v32: dev88: add GPIO, LEDs, RTC, temp sensor

Quoted 3 lines · Rabin Vincent

Add the GPIO driver to the device tree and, using it, support for the LEDs and the RTC chip (via I2C-GPIO), as well as the temperature sensor (via SPI-GPIO).

Applied to the cris tree, thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
#5 lore raw

PATCH 4/6 CRIS v32: add ARTPEC-3 and P1343 device trees

In reply to Rabin Vincent

Add a device tree for the Axis P1343 with the ARTPEC-3 SoC and on-board LEDs and RTC.

---
 arch/cris/boot/dts/artpec3.dtsi | 46 +++++++++++++++++++++++++
 arch/cris/boot/dts/p1343.dts    | 76 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100644 arch/cris/boot/dts/artpec3.dtsi
 create mode 100644 arch/cris/boot/dts/p1343.dts
arch/cris/boot/dts/artpec3.dtsi new file +46 -0
new file mode 100644
index 0000000..be15be6
@@ -0,0 +1,46 @@
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	interrupt-parent = <&intc>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			model = "axis,crisv32";
+			reg = <0>;
+		};
+	};
+
+	soc {
+		compatible = "simple-bus";
+		model = "artpec3";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		intc: interrupt-controller {
+			compatible = "axis,crisv32-intc";
+			reg = <0xb002a000 0x1000>;
+			interrupt-controller;
+			#interrupt-cells = <1>;
+		};
+
+		gio: gpio@b0020000 {
+			compatible = "axis,artpec3-gio";
+			reg = <0xb0020000 0x1000>;
+			interrupts = <61>;
+			gpio-controller;
+			#gpio-cells = <3>;
+		};
+
+		serial@b003e000 {
+			compatible = "axis,etraxfs-uart";
+			reg = <0xb003e000 0x1000>;
+			interrupts = <64>;
+			status = "disabled";
+		};
+	};
+};
arch/cris/boot/dts/p1343.dts new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
2.1.4
#6 lore raw

Re: [PATCH 4/6] CRIS v32: add ARTPEC-3 and P1343 device trees

Quoted 2 lines · Rabin Vincent

Add a device tree for the Axis P1343 with the ARTPEC-3 SoC and on-board LEDs and RTC.

Applied to the cris tree, thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
#7 lore raw

PATCH 5/6 CRIS v32: remove I2C bitbanging driver

In reply to Rabin Vincent

Now that we have a gpiolib GPIO driver, the generic i2c-gpio driver provides this functionality.

---
 arch/cris/arch-v32/drivers/Kconfig  |  18 -
 arch/cris/arch-v32/drivers/Makefile |   1 -
 arch/cris/arch-v32/drivers/i2c.c    | 751 ------------------------------------
 arch/cris/arch-v32/drivers/i2c.h    |  16 -
 4 files changed, 786 deletions(-)
 delete mode 100644 arch/cris/arch-v32/drivers/i2c.c
 delete mode 100644 arch/cris/arch-v32/drivers/i2c.h
arch/cris/arch-v32/drivers/Kconfig +0 -18
index 4fc16b4..bebb718 100644
@@ -149,24 +149,6 @@ config ETRAX_NANDBOOT
 	  Say Y if your boot code, kernel and root file system is in
 	  NAND flash. Say N if they are in NOR flash.
 
-config ETRAX_I2C
-	bool "I2C driver"
-	depends on ETRAX_ARCH_V32
-	help
-	  This option enables the I2C driver used by e.g. the RTC driver.
-
-config ETRAX_V32_I2C_DATA_PORT
-	string "I2C data pin"
-	depends on ETRAX_I2C
-	help
-	  The pin to use for I2C data.
-
-config ETRAX_V32_I2C_CLK_PORT
-	string "I2C clock pin"
-	depends on ETRAX_I2C
-	help
-	  The pin to use for I2C clock.
-
 config ETRAX_GPIO
 	bool "GPIO support"
 	depends on ETRAX_ARCH_V32
arch/cris/arch-v32/drivers/Makefile +0 -1
index 15fbfef..b5a75fd 100644
@@ -7,6 +7,5 @@ obj-$(CONFIG_ETRAX_AXISFLASHMAP)        += axisflashmap.o
 obj-$(CONFIG_ETRAXFS)                   += mach-fs/
 obj-$(CONFIG_CRIS_MACH_ARTPEC3)         += mach-a3/
 obj-$(CONFIG_ETRAX_IOP_FW_LOAD)         += iop_fw_load.o
-obj-$(CONFIG_ETRAX_I2C)			+= i2c.o
 obj-$(CONFIG_ETRAX_SYNCHRONOUS_SERIAL)	+= sync_serial.o
 obj-$(CONFIG_PCI)			+= pci/
arch/cris/arch-v32/drivers/i2c.c deleted +0 -751

751 lines not on this page · raw message

arch/cris/arch-v32/drivers/i2c.h deleted +0 -16
deleted file mode 100644
index d9cc856..0000000
@@ -1,16 +0,0 @@
-
-#include <linux/init.h>
-
-/* High level I2C actions */
-int i2c_write(unsigned char theSlave, void *data, size_t nbytes);
-int i2c_read(unsigned char theSlave, void *data, size_t nbytes);
-int i2c_writereg(unsigned char theSlave, unsigned char theReg, unsigned char theValue);
-unsigned char i2c_readreg(unsigned char theSlave, unsigned char theReg);
-
-/* Low level I2C */
-void i2c_start(void);
-void i2c_stop(void);
-void i2c_outbyte(unsigned char x);
-unsigned char i2c_inbyte(void);
-int i2c_getack(void);
-void i2c_sendack(void);
Signature · 1 line
2.1.4
#8 lore raw

Re: [PATCH 5/6] CRIS v32: remove I2C bitbanging driver

Quoted 2 lines · Rabin Vincent

Now that we have a gpiolib GPIO driver, the generic i2c-gpio driver provides this functionality.

Applied to the cris tree, thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]
#9 lore raw

PATCH 6/6 CRIS v32: remove old GPIO and LEDs code

In reply to Rabin Vincent

Since we now have a gpiolib driver, remove this code:

The gpio-etraxfs driver (along with things like gpio-keys-polled for polling support) replaces the GIO driver implementations in mach-a3 and mach-fs. The various generic external chip drivers replace the "virtual gpio" parts.

The generic gpio-leds driver replaces the LED handling.

---
 arch/cris/arch-v32/Kconfig                  |  89 ---
 arch/cris/arch-v32/drivers/Kconfig          | 149 -----
 arch/cris/arch-v32/drivers/mach-a3/Makefile |   1 -
 arch/cris/arch-v32/drivers/mach-a3/gpio.c   | 999 ----------------------------
 arch/cris/arch-v32/drivers/mach-fs/Makefile |   1 -
 arch/cris/arch-v32/drivers/mach-fs/gpio.c   | 979 ---------------------------
 arch/cris/arch-v32/kernel/crisksyms.c       |   3 -
 arch/cris/arch-v32/mach-a3/Makefile         |   2 +-
 arch/cris/arch-v32/mach-a3/io.c             | 149 -----
 arch/cris/arch-v32/mach-fs/Makefile         |   2 +-
 arch/cris/arch-v32/mach-fs/io.c             | 191 ------
 arch/cris/include/arch-v32/arch/io.h        | 140 ----
 arch/cris/include/asm/io.h                  |   2 +
 13 files changed, 4 insertions(+), 2703 deletions(-)
 delete mode 100644 arch/cris/arch-v32/drivers/mach-a3/gpio.c
 delete mode 100644 arch/cris/arch-v32/drivers/mach-fs/gpio.c
 delete mode 100644 arch/cris/arch-v32/mach-a3/io.c
 delete mode 100644 arch/cris/arch-v32/mach-fs/io.c
 delete mode 100644 arch/cris/include/arch-v32/arch/io.h
arch/cris/arch-v32/Kconfig +0 -89
index 21bbd93..17dbe03 100644
@@ -11,95 +11,6 @@ config ETRAX_DRAM_VIRTUAL_BASE
 	default "c0000000"
 
 choice
-	prompt "Nbr of Ethernet LED groups"
-	depends on ETRAX_ARCH_V32
-	default ETRAX_NBR_LED_GRP_ONE
-	help
-	  Select how many Ethernet LED groups that can be used. Usually one per Ethernet
-	  interface is a good choice.
-
-config	ETRAX_NBR_LED_GRP_ZERO
-	bool "Use zero LED groups"
-	help
-	  Select this if you do not want any Ethernet LEDs.
-
-config	ETRAX_NBR_LED_GRP_ONE
-	bool "Use one LED group"
-	help
-	  Select this if you want one Ethernet LED group. This LED group
-	  can be used for one or more Ethernet interfaces. However, it is
-	  recommended that each Ethernet interface use a dedicated LED group.
-
-config	ETRAX_NBR_LED_GRP_TWO
-	bool "Use two LED groups"
-	help
-	  Select this if you want two Ethernet LED groups. This is the
-	  best choice if you have more than one Ethernet interface and
-	  would like to have separate LEDs for the interfaces.
-
-endchoice
-
-config ETRAX_LED_G_NET0
-	string "Ethernet LED group 0 green LED bit"
-	depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
-	default "PA3"
-	help
-	  Bit to use for the green LED in Ethernet LED group 0.
-
-config ETRAX_LED_R_NET0
-	string "Ethernet LED group 0 red LED bit"
-	depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
-	default "PA4"
-	help
-	  Bit to use for the red LED in Ethernet LED group 0.
-
-config ETRAX_LED_G_NET1
-	string "Ethernet group 1 green LED bit"
-	depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
-	default ""
-	help
-	  Bit to use for the green LED in Ethernet LED group 1.
-
-config ETRAX_LED_R_NET1
-	string "Ethernet group 1 red LED bit"
-	depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
-	default ""
-	help
-	  Bit to use for the red LED in Ethernet LED group 1.
-
-config ETRAX_V32_LED2G
-	string "Second green LED bit"
-	depends on ETRAX_ARCH_V32
-	default "PA5"
-	help
-	  Bit to use for the first green LED (status LED).
-	  Most Axis products use bit A5 here.
-
-config ETRAX_V32_LED2R
-	string "Second red LED bit"
-	depends on ETRAX_ARCH_V32
-	default "PA6"
-	help
-	  Bit to use for the first red LED (network LED).
-	  Most Axis products use bit A6 here.
-
-config ETRAX_V32_LED3G
-	string "Third green LED bit"
-	depends on ETRAX_ARCH_V32
-	default "PA7"
-	help
-	  Bit to use for the first green LED (drive/power LED).
-	  Most Axis products use bit A7 here.
-
-config ETRAX_V32_LED3R
-	string "Third red LED bit"
-	depends on ETRAX_ARCH_V32
-	default "PA7"
-	help
-	  Bit to use for the first red LED (drive/power LED).
-	  Most Axis products use bit A7 here.
-
-choice
 	prompt "Kernel GDB port"
 	depends on ETRAX_KGDB
 	default ETRAX_KGDB_PORT0
arch/cris/arch-v32/drivers/Kconfig +0 -149

155 lines not on this page · raw message

arch/cris/arch-v32/drivers/mach-a3/Makefile +0 -1
index 5c6d2a2..59028d0 100644
@@ -3,4 +3,3 @@
 #
 
 obj-$(CONFIG_ETRAX_NANDFLASH)   += nandflash.o
-obj-$(CONFIG_ETRAX_GPIO)        += gpio.o
arch/cris/arch-v32/drivers/mach-a3/gpio.c deleted +0 -999

999 lines not on this page · raw message

arch/cris/arch-v32/drivers/mach-fs/Makefile +0 -1
index 5c6d2a2..59028d0 100644
@@ -3,4 +3,3 @@
 #
 
 obj-$(CONFIG_ETRAX_NANDFLASH)   += nandflash.o
-obj-$(CONFIG_ETRAX_GPIO)        += gpio.o
arch/cris/arch-v32/drivers/mach-fs/gpio.c deleted +0 -979

979 lines not on this page · raw message

arch/cris/arch-v32/kernel/crisksyms.c +0 -3
index bde8d1a..b056635 100644
@@ -3,7 +3,6 @@
 #include <arch/dma.h>
 #include <arch/intmem.h>
 #include <mach/pinmux.h>
-#include <arch/io.h>
 
 /* Functions for allocating DMA channels */
 EXPORT_SYMBOL(crisv32_request_dma);
@@ -20,8 +19,6 @@ EXPORT_SYMBOL(crisv32_pinmux_alloc);
 EXPORT_SYMBOL(crisv32_pinmux_alloc_fixed);
 EXPORT_SYMBOL(crisv32_pinmux_dealloc);
 EXPORT_SYMBOL(crisv32_pinmux_dealloc_fixed);
-EXPORT_SYMBOL(crisv32_io_get_name);
-EXPORT_SYMBOL(crisv32_io_get);
 
 /* Functions masking/unmasking interrupts */
 EXPORT_SYMBOL(crisv32_mask_irq);
arch/cris/arch-v32/mach-a3/Makefile +1 -1
index 18a2271..0cc6eeb 100644
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y   := dma.o pinmux.o io.o arbiter.o
+obj-y   := dma.o pinmux.o arbiter.o
 
 clean:
 
arch/cris/arch-v32/mach-a3/io.c deleted +0 -149

149 lines not on this page · raw message

arch/cris/arch-v32/mach-fs/Makefile +1 -1
index 18a2271..0cc6eeb 100644
@@ -2,7 +2,7 @@
 # Makefile for the linux kernel.
 #
 
-obj-y   := dma.o pinmux.o io.o arbiter.o
+obj-y   := dma.o pinmux.o arbiter.o
 
 clean:
 
arch/cris/arch-v32/mach-fs/io.c deleted +0 -191

191 lines not on this page · raw message

arch/cris/include/arch-v32/arch/io.h deleted +0 -140

140 lines not on this page · raw message

arch/cris/include/asm/io.h +2 -0
index 752a3f4..cce8664 100644
@@ -2,7 +2,9 @@
 #define _ASM_CRIS_IO_H
 
 #include <asm/page.h>   /* for __va, __pa */
+#ifdef CONFIG_ETRAX_ARCH_V10
 #include <arch/io.h>
+#endif
 #include <asm-generic/iomap.h>
 #include <linux/kernel.h>
 
Signature · 1 line
2.1.4
#10 lore raw

Re: [PATCH 6/6] CRIS v32: remove old GPIO and LEDs code

Quoted 8 lines · Rabin Vincent

Since we now have a gpiolib driver, remove this code:

The gpio-etraxfs driver (along with things like gpio-keys-polled for polling support) replaces the GIO driver implementations in mach-a3 and mach-fs. The various generic external chip drivers replace the "virtual gpio" parts.

The generic gpio-leds driver replaces the LED handling.

Applied to the cris tree, thanks!

/^JN - Jesper Nilsson

Signature · 1 line
               Jesper Nilsson -- [email protected]