This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352 --- Timer 6 - interrupt 94 -- throwing kernel panic --

Other Parts Discussed in Thread: AM3352

hiii,

we are using AM3352 -- timer 6 for the pwm-ecap --to read fanspeed, but it is throwing kernel panic -- we took the interrupt number from the dts file - am33xx.dtsi - provided with SDK- we are using SDK-08 as reference. 

dts file timer info and kernel bootlog is below .

timer6: timer@48048000 {

compatible = "ti,am335x-timer";
reg = <0x48048000 0x400>;
interrupts = <94>;
ti,hwmods = "timer6";
ti,timer-pwm;
};

unable to fix this issue -- with timer 6 interrupt number 94. please help us in this -- to fix the kernel panic. 

[ 6.619412] genirq: Flags mismatch irq 94. 00000020 (wkup_m3_txev) vs. 00000201 (timer6)
[ 6.628036] wkup_m3 44d00000.wkup_m3: request_irq failed
[ 6.633666] remoteproc0: releasing wkup_m3
[ 6.640190] wkup_m3: probe of 44d00000.wkup_m3 failed with error -16
[ 6.647054] ------------[ cut here ]------------
[ 6.651970] WARNING: CPU: 0 PID: 50 at arch/arm/mach-omap2/omap_hwmod.c:2270 _idle+0x1cc/0x218()
[ 6.661189] omap_hwmod: wkup_m3: idle state can only be entered from enabled state
[ 6.669128] Modules linked in:
[ 6.672366] CPU: 0 PID: 50 Comm: kworker/0:1 Not tainted 3.14.26-g2489c02-dirty #249
[ 6.680518] Workqueue: pm pm_runtime_work
[ 6.684733] Backtrace:
[ 6.687355] [<c0011268>] (dump_backtrace) from [<c0011404>] (show_stack+0x18/0x1c)
[ 6.695302] r6:000008de r5:00000009 r4:cf0c3dc0 r3:c082f100
[ 6.701322] [<c00113ec>] (show_stack) from [<c05b01b4>] (dump_stack+0x20/0x28)
[ 6.708938] [<c05b0194>] (dump_stack) from [<c00381f8>] (warn_slowpath_common+0x6c/0x8c)
[ 6.717449] [<c003818c>] (warn_slowpath_common) from [<c00382bc>] (warn_slowpath_fmt+0x38/0x40)
[ 6.726574] r8:c082dc08 r7:00000008 r6:00000000 r5:cf0cd140 r4:c0827630
[ 6.733674] [<c0038288>] (warn_slowpath_fmt) from [<c0024594>] (_idle+0x1cc/0x218)
[ 6.741616] r3:c07208cc r2:c071e9b8
[ 6.745407] [<c00243c8>] (_idle) from [<c0024ae8>] (omap_hwmod_idle+0x20/0x34)
[ 6.752984] r5:cf0cd140 r4:a0000113
[ 6.756776] [<c0024ac8>] (omap_hwmod_idle) from [<c0026100>] (omap_device_idle+0x44/0x80)
[ 6.765354] r4:00000001 r3:cf0cd100
[ 6.769140] [<c00260bc>] (omap_device_idle) from [<c0026160>] (_od_runtime_suspend+0x24/0x2c)
[ 6.778081] r5:cf0cea10 r4:00000000
[ 6.781868] [<c002613c>] (_od_runtime_suspend) from [<c0367000>] (rpm_callback+0xa4/0xc0)
[ 6.790445] r5:0000000a r4:cf0cea10
[ 6.794229] [<c0366f5c>] (rpm_callback) from [<c0367474>] (rpm_suspend+0xf0/0x494)
[ 6.802174] r6:00000000 r5:0000000a r4:00000000 r3:c08240e8
[ 6.808168] [<c0367384>] (rpm_suspend) from [<c03678f8>] (rpm_idle+0x84/0x1b8)
[ 6.815744] r10:00000000 r9:cf0c2000 r8:00000000 r7:cfbd4a00 r6:00000002 r5:cf0cea10
[ 6.824008] r4:00000000
[ 6.826691] [<c0367874>] (rpm_idle) from [<c0368670>] (pm_runtime_work+0x88/0xa4)
[ 6.834541] r6:c082dfe4 r5:cf0ceaa0 r4:cf0ba380 r3:00000080
[ 6.840547] [<c03685e8>] (pm_runtime_work) from [<c004ae0c>] (process_one_work+0xfc/0x338)
[ 6.849239] [<c004ad10>] (process_one_work) from [<c004b1a0>] (worker_thread+0x11c/0x364)
[ 6.857819] r10:c0865f9f r9:c082dfe4 r8:00000001 r7:cf0c2000 r6:cf0ba398 r5:c082dff4
[ 6.866080] r4:cf0ba380
[ 6.868771] [<c004b084>] (worker_thread) from [<c0050d14>] (kthread+0xc4/0xe0)
[ 6.876351] r10:00000000 r9:00000000 r8:00000000 r7:c004b084 r6:cf0ba380 r5:cf0b7100
[ 6.884612] r4:00000000
[ 6.887300] [<c0050c50>] (kthread) from [<c000e878>] (ret_from_fork+0x14/0x3c)
[ 6.894878] r7:00000000 r6:00000000 r5:c0050c50 r4:cf0b7100
[ 6.900858] ---[ end trace d66f6f2f3b0a457e ]---

regards,

Viswanath k

  • Hi Viswanath,

    As I see from Table 8-1. ARM Cortex-A9 Interrupts, timer6 is connected with IRQ number 126, not IRQ94.
    Can you try changing it as per TRM?
    Also can you share which dts file are you using(custom or one of the files in arch/arm/boot/dts), also can you share the timer6 dts node you've created?

    Best Regards,
    Yordan
  • Hi Yordan,

    we are following doc revision:L AM335x ref manaul -- Table 6-1 for the interrupts given as 94 for timer6 and 78 for the wkup_m3 .

    dts file is added.

    the above error is of my mistake only -- which i done wrong configuration for the TImer 6 Irq -- 

    platform_get_irq -- in that function 2nd arguments as "0" which the num of interrupts -- nd i given 94 - thinking number of the interrupt. 

    so i got the kernel panic -- as i changed the kernel panic is not occurred.  

    But i am unable to  register the timer 6 interrupt in pwm-tiecap.c 

    becoz the driver is pwm -- and in that driver i am unable to get the timer platform info -- so interrupt -- i am unable to configure.??

    i need help here. please any help me in this.


    regards,
    Viswanath K

    /*
     * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License version 2 as
     * published by the Free Software Foundation.
     */
    
    /*
     * AM335x Starter Kit
     * http://www.ti.com/tool/tmdssk3358
     */
    
    /dts-v1/;
    
    #include "am33xx.dtsi"
    #include <dt-bindings/pwm/pwm.h>
    
    / {
    	model = "TI AM335x EVM-SK";
    	compatible = "ti,am335x-evmsk", "ti,am33xx";
    
    	cpus {
    		cpu@0 {
    			cpu0-supply = <&vdd1_reg>;
    		};
    	};
    
    	memory {
    		device_type = "memory";
    		reg = <0x80000000 0x10000000>; /* 256 MB */
    	};
    
    	vbat: fixedregulator@0 {
    		compatible = "regulator-fixed";
    		regulator-name = "vbat";
    		regulator-min-microvolt = <5000000>;
    		regulator-max-microvolt = <5000000>;
    		regulator-boot-on;
    	};
    
    	lis3_reg: fixedregulator@1 {
    		compatible = "regulator-fixed";
    		regulator-name = "lis3_reg";
    		regulator-boot-on;
    	};
    
    
    	vtt_fixed: fixedregulator@3 {
    		compatible = "regulator-fixed";
    		regulator-name = "vtt";
    		regulator-min-microvolt = <1500000>;
    		regulator-max-microvolt = <1500000>;
    		gpio = <&gpio0 7 GPIO_ACTIVE_HIGH>;
    		regulator-always-on;
    		regulator-boot-on;
    		enable-active-high;
    	};
    
    
    
    	leds {
    		pinctrl-names = "default", "sleep";
    		pinctrl-0 = <&user_leds_default>;
    		pinctrl-1 = <&user_leds_sleep>;
    
    		compatible = "gpio-leds";
    
    		led@1 {
    			label = "power_led_R";
    			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@2 {
    			label = "power_led_G";
    			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@3 {
    			label = "preset_led_R";
    			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@4 {
    			label = "preset_led_G";
    			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@5 {
    			label = "config_led_R";
    			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@6 {
    			label = "config_led_G";
    			gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@7 {
    			label = "status_led_R";
    			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@8 {
    			label = "status_led_G";
    			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
    			default-state = "off";
    		};
    
    		led@9 {
    			label = "backlight_lcd";
    			gpios = <&gpio2 18 GPIO_ACTIVE_HIGH>;
    			default-state = "on";
    		};
    	};
    
    	gpio_buttons: gpio_buttons@0 {
    		compatible = "gpio-keys";
    		#address-cells = <1>;
    		#size-cells = <0>;
    
    		switch@1 {
    			label = "key_up";
    			linux,code = <0x100>;
    			gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@2 {
    			label = "key_down";
    			linux,code = <0x101>;
    			gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@3 {
    			label = "key_left";
    			linux,code = <0x102>;
    			gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>;
    			gpio-key,wakeup;
    		};
    
    		switch@4 {
    			label = "key_right";
    			linux,code = <0x103>;
    			gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@5 {
    			label = "key_ent";
    			linux,code = <0x104>;
    			gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@6 {
    			label = "key_preset";
    			linux,code = <0x105>;
    			gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@7 {
    			label = "key_status";
    			linux,code = <0x106>;
    			gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
    		};
    
    		switch@8 {
    			label = "key_setting";
    			linux,code = <0x107>;
    			gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
    		};
    	};
    
    
    	itdb28 {
    		compatible = "ph,ph128160";
    		status = "okay";
    		pinctrl-0 = <&lcd_pinctl>;
    		pinctrl-1 = <&lcd_sleep>;
    		rotate = <90>;
    		bgr;
    		buswidth = <8>;
    		rd-gpios = <&gpio2 24 0>;
    		dc-gpios = <&gpio2 22 0>;
    		cs-gpios = <&gpio2 25 0>;
    		wr-gpios = <&gpio2 23 0>;
    		db-gpios = <&gpio2  6 0>,
    			   <&gpio2  7 0>,
    			   <&gpio2  8 0>,
    			   <&gpio2  9 0>,
    			   <&gpio2 10 0>,
    			   <&gpio2 11 0>,
    			   <&gpio2 12 0>,
    			   <&gpio2 13 0>;
    		/* LED pin drives backlight directly. Use transistor (50mA) */
    		/* led-gpios = <&gpio2 4 1>; */
    		debug = <1>;
    	};
    
    
    	sound {
                     compatible = "ti,da830-evm-audio";
                     ti,model = "AM335x-EVMSK";
                     ti,audio-codec = <&tlv320aic3106>;
                     ti,mcasp-controller = <&mcasp1>;
                     ti,codec-clock-rate = <24000000>;
                     ti,audio-routing =
                             "Headphone Jack",       "HPL",
                             "Headphone Jack",       "HPR",
                             "Speaker",              "SPK";
                     ti,hp-det-gpios = <&gpio3 10 0>;                
            };
    	
    };
    
    
    
    
    &am33xx_pinmux {
    	pinctrl-names = "default";
    	pinctrl-0 = <&gpio_keys_s0 &feton12_pins_default>;
    
    	lcd_pinctl: lcd_pinctl {
    		pinctrl-single,pins = <
    			0xa0 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (R1) lcd_data0.gpio2[6] */
    			0xa4 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (R2) lcd_data1.gpio2[7] */
    			0xa8 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (R3) lcd_data2.gpio2[8] */
    			0xac ( PIN_OUTPUT_PULLDOWN  | MUX_MODE7 ) /* (R4) lcd_data3.gpio2[9] */
    			0xb0 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (T1) lcd_data4.gpio2[10] */
    			0xb4 ( PIN_OUTPUT_PULLDOWN  | MUX_MODE7 ) /* (T2) lcd_data5.gpio2[11] */
    			0xb8 ( PIN_OUTPUT_PULLDOWN  | MUX_MODE7 ) /* (T3) lcd_data6.gpio2[12] */
    			0xbc ( PIN_OUTPUT_PULLDOWN  | MUX_MODE7 ) /* (T4) lcd_data7.gpio2[13] */
    			0xe0 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (U5) lcd_vsync.gpio2[22] */
    			0xe4 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (R5) lcd_hsync.gpio2[23] */
    			0xe8 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (V5) lcd_pclk.gpio2[24] */
    			0xec ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (R6) lcd_ac_bias_en.gpio2[25] */
    		>;
    	};
    
    	lcd_sleep: lcd_sleep {
    		pinctrl-single,pins = <
    			0xa0 (PIN_INPUT_PULLDOWN ) /* (R1) lcd_data0.gpio2[6] */
    			0xa4 (PIN_INPUT_PULLDOWN ) /* (R2) lcd_data1.gpio2[7] */
    			0xa8 (PIN_INPUT_PULLDOWN ) /* (R3) lcd_data2.gpio2[8] */
    			0xac (PIN_INPUT_PULLDOWN ) /* (R4) lcd_data3.gpio2[9] */
    			0xb0 (PIN_INPUT_PULLDOWN ) /* (T1) lcd_data4.gpio2[10] */
    			0xb4 (PIN_INPUT_PULLDOWN ) /* (T2) lcd_data5.gpio2[11] */
    			0xb8 (PIN_INPUT_PULLDOWN ) /* (T3) lcd_data6.gpio2[12] */
    			0xbc (PIN_INPUT_PULLDOWN ) /* (T4) lcd_data7.gpio2[13] */
    			0xe0 (PIN_INPUT_PULLDOWN ) /* (U5) lcd_vsync.gpio2[22] */
    			0xe4 (PIN_INPUT_PULLDOWN ) /* (R5) lcd_hsync.gpio2[23] */
    			0xe8 (PIN_INPUT_PULLDOWN ) /* (V5) lcd_pclk.gpio2[24] */
    			0xec (PIN_INPUT_PULLDOWN ) /* (R6) lcd_ac_bias_en.gpio2[25] */
    			>;
    	};
    
         usb0_pins_default: usb0_pins_default 
         {
    	    pinctrl-single,pins = <	
                    0x21c ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) /* (F16) USB0_DRVVBUS.USB0_DRVVBUS */
    		>;
         }; 
    
    	user_leds_default: user_leds_default {
    		pinctrl-single,pins = <
    			0x20 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U10) gpmc_ad8.gpio0[22] */
    			0x24 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T10) gpmc_ad9.gpio0[23] */
    			0x28 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T11) gpmc_ad10.gpio0[26] */
    			0x2c ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U12) gpmc_ad11.gpio0[27] */
    			0x30 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T12) gpmc_ad12.gpio1[12] */
    			0x34 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (R12) gpmc_ad13.gpio1[13] */
    			0x38 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (V13) gpmc_ad14.gpio1[14] */
    			0x3c ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U13) gpmc_ad15.gpio1[15] */
                            0x134 ( PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* (L17) gmii1_rxd3.gpio2[18] */  
    		>;
    	};
    
    	user_leds_sleep: user_leds_sleep {
    		pinctrl-single,pins = <
    			0x20 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U10) gpmc_ad8.gpio0[22] */
    			0x24 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T10) gpmc_ad9.gpio0[23] */
    			0x28 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T11) gpmc_ad10.gpio0[26] */
    			0x2c ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U12) gpmc_ad11.gpio0[27] */
    			0x30 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T12) gpmc_ad12.gpio1[12] */
    			0x34 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (R12) gpmc_ad13.gpio1[13] */
    			0x38 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (V13) gpmc_ad14.gpio1[14] */
    			0x3c ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U13) gpmc_ad15.gpio1[15] */
                            0x134 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (L17) gmii1_rxd3.gpio2[18] */
    		>;
    	};
    
    	gpio_keys_s0: gpio_keys_s0 {
                    pinctrl-single,pins = <
                    0x190 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (A13) mcasp0_aclkx.gpio3[14] */
                    0x194 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (B13) mcasp0_fsx.gpio3[15] */
                    0x198 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (D12) mcasp0_axr0.gpio3[16] */                
                    0x1a0 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (B12) mcasp0_aclkr.gpio3[18] */
                    0x1a4 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (C13) mcasp0_fsr.gpio3[19] */
                    0x1a8 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (D13) mcasp0_axr1.gpio3[20] */
                    0x1ac ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (A14) mcasp0_ahclkx.gpio3[21] */
                    0x138 ( PIN_INPUT_PULLUP | MUX_MODE7 ) /* (L16) gmii1_rxd2.gpio2[19] */
    
                    >;
            };
    
    	i2c1_pins: pinmux_i2c1_pins {
    		pinctrl-single,pins = <
    			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
    			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
    		>;
    	};
    
    	i2c0_pins: pinmux_i2c0_pins {
    		pinctrl-single,pins = <
    			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
    			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
    		>;
    	};
    
    
    	uart0_pins: pinmux_uart0_pins {
    		pinctrl-single,pins = <
    			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
    			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* uart0_txd.uart0_txd */
    		>;
    	};
    
    
    	uart2_pins: pinmux_uart2_pins {
    		pinctrl-single,pins = <
    			0x150 ( PIN_INPUT | MUX_MODE1 ) /* (A17) spi0_sclk.uart2_rxd */
                 		0x154 ( PIN_OUTPUT | MUX_MODE1 ) /* (B17) spi0_d0.uart2_txd */
    		>;
    	};
          
          feton12_pins_default: feton12_pins_default {
    		pinctrl-single,pins = <
    			0x60 ( PIN_INPUT | MUX_MODE7 ) /* (V16) gpmc_a8.gpio1[24] */
    			0x64 ( PIN_INPUT | MUX_MODE7 ) /* (U16) gpmc_a9.gpio1[25] */
    		>;
          };
    
    	feton12_pins_sleep: feton12_pins_sleep {
    		pinctrl-single,pins = <
    			0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (V16) gpmc_a8.gpio1[24] */
    			0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U16) gpmc_a9.gpio1[25] */
    		>;
    	};
    
    	
    
    	nandflash_pins_default: nandflash_pins_default {
    		pinctrl-single,pins = <
    			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
    			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
    			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
    			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
    			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
    			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
    			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
    			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
    			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
    			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
    			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
    			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
    			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
    			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
    			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
    		>;
    	};
    
    	nandflash_pins_sleep: nandflash_pins_sleep {
    		pinctrl-single,pins = <
    			0x0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0xc (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x10 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x14 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x18 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x1c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x7c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x90 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x94 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x9c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    		>;
    	};
    
          
            ehrpwm1A_pins: backlight_pins {
                     pinctrl-single,pins = <
                           	0x48 ( PIN_OUTPUT_PULLUP | MUX_MODE6 ) /* (U14) gpmc_a2.ehrpwm1A */			
                            0x4c ( PIN_OUTPUT_PULLUP | MUX_MODE6 ) /* (T14) gpmc_a3.ehrpwm1B */
                     >;
             };
    
    	ehrpwm1A_pins_sleep: ehrpwm1A_pins_sleep {
    		pinctrl-single,pins = <
    			0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (U14) gpmc_a2.ehrpwm1A */
    			
    		>;
    	};
    
            ehrpwm1B_pins: backlight1_pins {
                     pinctrl-single,pins = <
                      0x48 ( PIN_OUTPUT_PULLUP | MUX_MODE6 ) /* (U14) gpmc_a2.ehrpwm1A */			
    			0x4c ( PIN_OUTPUT_PULLUP | MUX_MODE6 ) /* (T14) gpmc_a3.ehrpwm1B */
                     >;
             };
    
    	ehrpwm1B_pins_sleep: ehrpwm1B_pins_sleep {
    		pinctrl-single,pins = <
    			0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (T14) gpmc_a3.ehrpwm1B */
    		>;
    	};
    
    	mmc1_pins_default: pinmux_mmc1_pins {
    		pinctrl-single,pins = <
    			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
    			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
    			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
    			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
    			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
    			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
    			0x1A0 (PIN_INPUT_PULLUP | MUX_MODE7)	/* mcasp0_aclkr.gpio3_18 */
    			0x160 (PIN_INPUT | MUX_MODE7)		/* spi0_cs1.gpio0_6 */
    		>;
    	};
    
    	mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
    		pinctrl-single,pins = <
    			0x0F0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x0F4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x0F8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x0FC (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x100 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x104 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    		>;
    	};
    
    	mcasp1_pins: mcasp1_pins {
    		pinctrl-single,pins = <
    			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
    			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */
    			0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */
    			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
                            0x130 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* mic detection           */
    		>;
    	};
    
    	mcasp1_pins_sleep: mcasp1_pins_sleep {
    		pinctrl-single,pins = <
    			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    		>;
    	};
    	ecap_0_pins_default: ecap_0_pins_default {
    		pinctrl-single,pins = <
    			0x164 ( PIN_INPUT | MUX_MODE0 ) /* (C18) eCAP0_in_PWM0_out.eCAP0_in_PWM0_out */
    		>;
    	};
    	
    	ecap_0_pins_sleep: ecap_0_pins_sleep {
    		pinctrl-single,pins = <
    			0x164 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (C18) eCAP0_in_PWM0_out.eCAP0_in_PWM0_out */
    		>;
    	};
    
    	ecap_2_pins_default: ecap_2_pins_default {
    		pinctrl-single,pins = <
    			0x19c ( PIN_INPUT | MUX_MODE4 ) /* (C12) mcasp0_ahclkr.eCAP2_in_PWM2_out */
    		>;
    	};
    	
    	ecap_2_pins_sleep: ecap_2_pins_sleep {
    		pinctrl-single,pins = <
    			0x19c (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (C12) mcasp0_ahclkr.eCAP2_in_PWM2_out */
    		>;
    	};
    
    	timer_5_pins_default: timer_5_pins_default {
    		pinctrl-single,pins = <
    			0x14c ( PIN_INPUT | MUX_MODE1 ) /* (M18) mdio_clk.timer5 */
    		>;
    	};
    
    	timer_5_pins_sleep: timer_5_pins_sleep {
    		pinctrl-single,pins = <
    			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M18) mdio_clk.timer5 */
    		>;
    	};
    
    	timer_6_pins_default: timer_6_pins_default {
    		pinctrl-single,pins = <
    			0x148 ( PIN_INPUT | MUX_MODE1 ) /* (M17) mdio_data.timer6 */
    		>;
    	};
    
    	timer_6_pins_sleep: timer_6_pins_sleep {
    		pinctrl-single,pins = <
    			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.timer6 */
    		>;
    	};
    
    };
    
    &uart0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart0_pins>;
    
    	status = "okay";
    };
    
    &uart2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart2_pins>;
    
    	status = "okay";
    };
    
    
    
    &i2c1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c1_pins>;
    
    	status = "okay";
    	clock-frequency = <400000>;
    
    	tps: tps@2d {
    		reg = <0x2d>;
    
    	};
    };
    
    
    
    &i2c0 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c0_pins>;
    
    	status = "okay";
    	clock-frequency = <100000>;
    
            tlv320aic3106: tlv320aic3106@18 
            {
                     compatible = "ti,tlv320aic3100";
                     reg = <0x18>;
                     status = "okay";
    
                     /* Regulators */     
                     HPVDD-supply = <&vaux33_reg>;
                     SPKVDD-supply = <&vdd3_reg>;
                     SPKVDD_1-supply = <&vdd3_reg>;
                     AVDD-supply = <&vaux2_reg>;
                     IOVDD-supply = <&vaux2_reg>;                 
                     DVDD-supply = <&vdac_reg>;
    
           };
    };
    
    
    
    &usb {
            pinctrl-0 = <&usb0_pins_default>;
    	status = "okay";
    
    	control@44e10620 {
    		status = "okay";
    	};
    
    	usb-phy@47401300 {
    		status = "okay";
    	};
    
    	usb@47401000 {
    		status = "okay";		
    	};
    
    	dma-controller@47402000  {
    		status = "okay";
    	};
    
    	usb-phy@47401b00 {
    		status = "okay";
    	};
    	usb@47401800 {
    		status = "okay";
    		dr_mode = "host";
    	};	
    };
    
    
    &wkup_m3 {
    	ti,needs-vtt-toggle;
    	ti,vtt-gpio-pin = <7>;
    	ti,scale-data-fw = "am335x-evm-scale-data.bin";
    };
    
    
    
    &epwmss1 {
             status = "okay";
     
             ehrpwm1: ehrpwm@48302200 {
                     status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ehrpwm1B_pins>;
             };
     };
    
    &epwmss1 {
             status = "okay";
     
             ehrpwm1: ehrpwm@48302200 {
                     status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ehrpwm1A_pins>;
             };
     };
    
    &timer5{
             status = "okay";
             pinctrl-names = "default";
             pinctrl-0 = <&timer_5_pins_default>; 	
    };
    
    &timer6{
            
    	 status = "okay";
             pinctrl-names = "default";
             pinctrl-0 = <&timer_6_pins_default>;
    };
    
    &epwmss0{
            status = "okay";
    	ecap0: ecap@48300100 {
    	         status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ecap_0_pins_default>;
    	};
    };
    
    &epwmss2{
            status = "okay";
    	ecap2: ecap@48304100 {
    	         status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ecap_2_pins_default>;
    	};
    };
    
    
    &elm {
    	status = "okay";
    };
    
    &gpmc {
    	status = "okay";
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&nandflash_pins_default>;
    	pinctrl-1 = <&nandflash_pins_sleep>;
    	ranges = <0 0 0x08000000 0x10000000>;	/* CS0: NAND */
    	nand@0,0 {
    		reg = <0 0 0>; /* CS0, offset 0 */
    		ti,nand-ecc-opt = "bch8";
    		ti,elm-id = <&elm>;
    		nand-bus-width = <8>;
    		gpmc,device-width = <1>;
    		gpmc,sync-clk-ps = <0>;
    		gpmc,cs-on-ns = <0>;
    		gpmc,cs-rd-off-ns = <44>;
    		gpmc,cs-wr-off-ns = <44>;
    		gpmc,adv-on-ns = <6>;
    		gpmc,adv-rd-off-ns = <34>;
    		gpmc,adv-wr-off-ns = <44>;
    		gpmc,we-on-ns = <0>;
    		gpmc,we-off-ns = <40>;
    		gpmc,oe-on-ns = <0>;
    		gpmc,oe-off-ns = <54>;
    		gpmc,access-ns = <64>;
    		gpmc,rd-cycle-ns = <82>;
    		gpmc,wr-cycle-ns = <82>;
    		gpmc,wait-on-read = "true";
    		gpmc,wait-on-write = "true";
    		gpmc,bus-turnaround-ns = <0>;
    		gpmc,cycle2cycle-delay-ns = <0>;
    		gpmc,clk-activation-ns = <0>;
    		gpmc,wait-monitoring-ns = <0>;
    		gpmc,wr-access-ns = <40>;
    		gpmc,wr-data-mux-bus-ns = <0>;
    		/* MTD partition table */
    		/* All SPL-* partitions are sized to minimal length
    		 * which can be independently programmable. For
    		 * NAND flash this is equal to size of erase-block */
    		#address-cells = <1>;
    		#size-cells = <1>;
    		partition@0 {
    			label = "NAND.SPL";
    			reg = <0x00000000 0x000020000>;
    		};
    		partition@1 {
    			label = "NAND.SPL.backup1";
    			reg = <0x00020000 0x00020000>;
    		};
    		partition@2 {
    			label = "NAND.SPL.backup2";
    			reg = <0x00040000 0x00020000>;
    		};
    		partition@3 {
    			label = "NAND.SPL.backup3";
    			reg = <0x00060000 0x00020000>;
    		};
    		partition@4 {
    			label = "NAND.u-boot-spl-os";
    			reg = <0x00080000 0x00040000>;
    		};
    		partition@5 {
    			label = "NAND.u-boot";
    			reg = <0x000C0000 0x00100000>;
    		};
    		partition@6 {
    			label = "NAND.u-boot-env";
    			reg = <0x001C0000 0x00020000>;
    		};
    		partition@7 {
    			label = "NAND.u-boot-env.backup1";
    			reg = <0x001E0000 0x00020000>;
    		};
    		partition@8 {
    			label = "NAND.kernel";
    			reg = <0x00200000 0x00800000>;
    		};
    		partition@9 {
    			label = "NAND.rootfs";
    			reg = <0x00A00000 0x0F600000>;
    		};
    	};
    };
    
    
    
    
    #include "tps65910.dtsi"
    
    &tps {
    	vcc1-supply = <&vbat>;
    	vcc2-supply = <&vbat>;
    	vcc3-supply = <&vbat>;
    	vcc4-supply = <&vbat>;
    	vcc5-supply = <&vbat>;
    	vcc6-supply = <&vbat>;
    	vcc7-supply = <&vbat>;
    	vccio-supply = <&vbat>;
    
    	regulators {
    		vrtc_reg: regulator@0 {
    			regulator-always-on;
    		};
    
    		vio_reg: regulator@1 {
    			regulator-always-on;
    		};
    
    		vdd1_reg: regulator@2 {
    			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1378000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd2_reg: regulator@3 {
    			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    			regulator-name = "vdd_core";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1150000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd3_reg: regulator@4 {
    			regulator-always-on;
    		};
    
    		vdig1_reg: regulator@5 {
    			regulator-always-on;
    		};
    
    		vdig2_reg: regulator@6 {
    			regulator-always-on;
    		};
    
    		vpll_reg: regulator@7 {
    			regulator-always-on;
    		};
    
    		vdac_reg: regulator@8 {
    			regulator-always-on;
    		};
    
    		vaux1_reg: regulator@9 {
    			regulator-always-on;
    		};
    
    		vaux2_reg: regulator@10 {
    			regulator-always-on;
    		};
    
    		vaux33_reg: regulator@11 {
    			regulator-always-on;
    		};
    
    		vmmc_reg: regulator@12 {
    			regulator-min-microvolt = <1800000>;
    			regulator-max-microvolt = <3300000>;
    			regulator-always-on;
    		};
    	};
    };
    
    
    
    
    &mmc1 {
    	status = "okay";
    	vmmc-supply = <&vmmc_reg>;
    	bus-width = <4>;
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mmc1_pins_default>;
    	pinctrl-1 = <&mmc1_pins_sleep>;
    	cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
    };
    
    &sham {
    	status = "okay";
    };
    
    &aes {
    	status = "okay";
    };
    
    &gpio0 {
    	ti,no-reset-on-init;
    };
    
    &mcasp1 {
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mcasp1_pins>;
    	pinctrl-1 = <&mcasp1_pins_sleep>;
    
    	status = "okay";
    
    	op-mode = <0>;	/* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	/* 4 serializers */
    	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
    		0 0 1 2
    	>;
    	tx-num-evt = <32>;
    	rx-num-evt = <32>;
    };
    
    

  • Hi Viswanath, 

    VISWANATH KONDAPALLI said:
    we are following doc revision:L AM335x ref manaul -- Table 6-1 for the interrupts given as 94 for timer6 and 78 for the wkup_m3 .

    You are correct, I was looking at AM437x documentation by mistake. The correct interrupt number for TIMER6 is 94. Sorry for the confusion. 

    VISWANATH KONDAPALLI said:

    But i am unable to  register the timer 6 interrupt in pwm-tiecap.c 

    becoz the driver is pwm -- and in that driver i am unable to get the timer platform info -- so interrupt -- i am unable to configure.??

     

    You are trying to use a timer withing the pwm driver, right? Can you please elaborate, what is your use case?

    Maybe you need to try and define timers parameter in the PWM device tree node, i.e.:    

    &epwmss2 {
                         status = "okay";

                         ecap2: ecap@48304100 {
                                                          status = "okay";
                                                          pinctrl-names = "default", "sleep";
                                                          pinctrl-0 = <&ecap2_pins_default>;
                                                          pinctrl-1 = <&ecap2_pins_sleep>;

                                                          timers = <&timer6>;
                         };
    };

    This way kernel should be aware that timer6 is dedicated to ecap2 in epwmss2. 

    Best Regards, 
    Yordan

  • Hi Yordan,
    YES. You are right. i need to use timer in ecap driver.
    ###r our requirement is to read FAN Speed in rpm-- which is controlled with PWM signal. 3-wire fan

    yellow wire and 3rd pin of the fan is Tacho-out pin of the fan will give the signal out -- which tells either 4 periods are 2 pulse gives one rotation of the fan --
    so we tried with ecap -- but we are not getting proper values with ecap.

    ecap0 and ecap 2 are to capture the fan speed and pwm-1A and 1B are to set the fan speed.



    Then we are trying to use timers to capture the signal in pulse so that it is easy to calculate the rpm of the fan.

    Method 1#: we tried to use ecap- usecases -- 1 and 2 which is given in AM3352- TRM in 15 chapter in that ecap --
    Method 2# like to use timers with interrupts to count the pulse so that to find the rpm of the fan.

    I will try as you suggested for the timer update for the PWM with timer.

    regards,
    Viswanath K.

  • Hi Yordan,

    i am registering the timer interrupt in this way- please correct me - if am wrong.
    this code in the pwm-tiecap.c --- in -- ecap_pwm_probe(struct platform_device *pdev)

    irq = platform_get_irq(pdev, 0);
    printk(KERN_INFO "timer 5 irq:%d \n",irq);
    if (irq >= 0)
    {
    ret = devm_request_irq(&pdev->dev, irq,timer5_irq_handler,
    __IRQF_TIMER | IRQF_TRIGGER_RISING, "timer5", pc);
    if (ret) {
    dev_err(&pdev->dev, "Timer 5 for pwm cap IRQ request failed\n");
    goto err;
    }
    }


    //interrupt : timer 6
    irq = platform_get_irq(pdev, 0);
    printk(KERN_INFO "timer 6 irq:%d \n",irq);
    if (irq >= 0)
    {
    ret = devm_request_irq(&pdev->dev, irq, timer6_irq_handler,
    __IRQF_TIMER | IRQF_TRIGGER_RISING, "timer6", pc);
    if (ret) {
    dev_err(&pdev->dev, "Timer 5 for pwm cap IRQ request failed\n");
    goto err;
    }
    }

    regards,
    Viswanath K
  • The code seems correct.

    Can you share how did you declare irq & timer6_irq_handler?

    Best Regards,
    Yordan
  • Sure. I will post all details related to timer and pwm.
    one more thing is:

    in AM3352 ecap0 and ecap2 has interrupt numbers - in page 465
    31 eCAP0INT eCAP0 event/interrupt ecap_intr_intr_pend
    61 eCAP2INT eCAP2 (PWM Subsystem) ecap_intr_intr_pend -- in page 466

    is it possible to add these 2 interrupt numbers in am33xx.dtsi  -- 

    we are getting "-6"  as status for the platform_get_irq function.   

    i attached current dts and dtsi configuration for timer5 and 6 and ecap0 and ecap2.

    regards,

    Viswanath K

    
    file: am335xx.dtsi 
    
    		timer5: timer@48046000 {
    			compatible = "ti,am335x-timer";
    			reg = <0x48046000 0x400>;
    			interrupts = <93>;
    			ti,hwmods = "timer5";
    			ti,timer-pwm;
    		};
    
    		timer6: timer@48048000 {
    			compatible = "ti,am335x-timer";
    			reg = <0x48048000 0x400>;
    			interrupts = <94>;
    			ti,hwmods = "timer6";
    			ti,timer-pwm;
    		};
    
    epwmss0: epwmss@48300000 {
    			compatible = "ti,am33xx-pwmss";
    			reg = <0x48300000 0x10>;
    			ti,hwmods = "epwmss0";
    			#address-cells = <1>;
    			#size-cells = <1>;
    			status = "disabled";
    			ranges = <0x48300100 0x48300100 0x80   /* ECAP */
    				  0x48300180 0x48300180 0x80   /* EQEP */
    				  0x48300200 0x48300200 0x80>; /* EHRPWM */
    
    			ecap0: ecap@48300100 {
    				compatible = "ti,am33xx-ecap";
    				#pwm-cells = <3>;
    				reg = <0x48300100 0x80>;
    				ti,hwmods = "ecap0";
    				status = "disabled";
    			};
    
    			ehrpwm0: ehrpwm@48300200 {
    				compatible = "ti,am33xx-ehrpwm";
    				#pwm-cells = <3>;
    				reg = <0x48300200 0x80>;
    				ti,hwmods = "ehrpwm0";
    				status = "disabled";
    			};
    		};
    
    
    		epwmss2: epwmss@48304000 {
    			compatible = "ti,am33xx-pwmss";
    			reg = <0x48304000 0x10>;
    			ti,hwmods = "epwmss2";
    			#address-cells = <1>;
    			#size-cells = <1>;
    			status = "disabled";
    			ranges = <0x48304100 0x48304100 0x80   /* ECAP */
    				  0x48304180 0x48304180 0x80   /* EQEP */
    				  0x48304200 0x48304200 0x80>; /* EHRPWM */
    
    			ecap2: ecap@48304100 {
    				compatible = "ti,am33xx-ecap";
    				#pwm-cells = <3>;
    				reg = <0x48304100 0x80>;
    				ti,hwmods = "ecap2";
    				status = "disabled";
    			};
    
    			ehrpwm2: ehrpwm@48304200 {
    				compatible = "ti,am33xx-ehrpwm";
    				#pwm-cells = <3>;
    				reg = <0x48304200 0x80>;
    				ti,hwmods = "ehrpwm2";
    				status = "disabled";
    			};
    		};
    
    am335x-evmsk.dts:
    
    	ecap_0_pins_sleep: ecap_0_pins_sleep {
    		pinctrl-single,pins = <
    			0x164 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (C18) eCAP0_in_PWM0_out.eCAP0_in_PWM0_out */
    		>;
    	};
    
    	ecap_2_pins_default: ecap_2_pins_default {
    		pinctrl-single,pins = <
    			0x19c ( PIN_INPUT | MUX_MODE4 ) /* (C12) mcasp0_ahclkr.eCAP2_in_PWM2_out */
    		>;
    	};
    	
    	ecap_2_pins_sleep: ecap_2_pins_sleep {
    		pinctrl-single,pins = <
    			0x19c (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (C12) mcasp0_ahclkr.eCAP2_in_PWM2_out */
    		>;
    	};
    
    	timer_5_pins_default: timer_5_pins_default {
    		pinctrl-single,pins = <
    			0x14c ( PIN_INPUT | MUX_MODE1 ) /* (M18) mdio_clk.timer5 */
    		>;
    	};
    
    	timer_5_pins_sleep: timer_5_pins_sleep {
    		pinctrl-single,pins = <
    			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M18) mdio_clk.timer5 */
    		>;
    	};
    
    	timer_6_pins_default: timer_6_pins_default {
    		pinctrl-single,pins = <
    			0x148 ( PIN_INPUT | MUX_MODE1 ) /* (M17) mdio_data.timer6 */
    		>;
    	};
    
    	timer_6_pins_sleep: timer_6_pins_sleep {
    		pinctrl-single,pins = <
    			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.timer6 */
    		>;
    	};
    
    &timer5{
             status = "okay";
             pinctrl-names = "default";
             pinctrl-0 = <&timer_5_pins_default>; 	
    };
    
    &timer6{
            
    	 status = "okay";
             pinctrl-names = "default";
             pinctrl-0 = <&timer_6_pins_default>;
    };
    
    &epwmss0{
            status = "okay";
    	  ecap0: ecap@48300100 {
    	           status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ecap_0_pins_default>;
                     timers = <&timer5>;
    	};
    };
    
    &epwmss2{
            status = "okay";
    	  ecap2: ecap@48304100 {
    	           status = "okay";
                     pinctrl-names = "default";
                     pinctrl-0 = <&ecap_2_pins_default>;
                     timers = <&timer6>;
    	};
    };
    
    
    
     

  • timer handlers:

    static irqreturn_t timer5_irq_handler(int irq, void *data)
    {
    timer_5_counter++;

    return IRQ_HANDLED;
    }

    static irqreturn_t timer6_irq_handler(int irq, void *data)
    {
    timer_6_counter++;
    return IRQ_HANDLED;
    }

    My doubt: In pwm-tiecap.c: in this function
    static int ecap_pwm_probe(struct platform_device *pdev)

    irq = platform_get_irq(pdev, 0); //here pdev --- will get ecap details and timer from dts file only -- but irq details are in dtsi file -- that this
    // function will map ..?? is doubt -- ofcourse -- of_irq_get(dev->dev.of_node, num); will get from dts file only
    // might i am thing -- will it get from dtsi..???
    // irq = 93;
    printk(KERN_INFO "timer 5 irq:%d \n",irq); //here -6 we are getting so irq registration will happen

    ret = devm_request_irq(&pdev->dev, irq,timer5_irq_handler,
    __IRQF_TIMER | IRQF_TRIGGER_FALLING "timer5", pc);


    regards,
    Viswanath K