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.

Linux/AM5728: Keypad driver not working

Part Number: AM5728
Other Parts Discussed in Thread: TPD12S015, SYSCONFIG

Tool/software: Linux

I am trying to use the AM5728 keypad device. I am using kernel 4.4.41.

I have 4 rows and 4 columns muxed in the mux_data.h file of the boot loader:

    {VIN2A_D3, (M9 | PIN_OUTPUT)},               /* vin2a_d3.kbd_col0 */
    {VIN2A_D4, (M9 | PIN_OUTPUT)},               /* vin2a_d4.kbd_col1 */
    {VIN2A_D5, (M9 | PIN_OUTPUT)},               /* vin2a_d5.kbd_col2 */
    {VIN2A_D6, (M9 | PIN_OUTPUT)},               /* vin2a_d5.kbd_col3 */
    {VIN1A_DE0, (M9 | PIN_INPUT_PULLUP)},        /* vin1a_de0.kbd_row0 */
    {VIN1A_FLD0, (M9 | PIN_INPUT_PULLUP)},       /* vin1a_fld0.kbd_row1 */
    {VIN1A_D8, (M9 | PIN_INPUT_PULLUP)},         /* vin1a_d8.kbd_row2 */
    {VIN1A_D9, (M9 | PIN_INPUT_PULLUP)},         /* vin1a_d9.kbd_row3 */

I have configured the kernel with KEYBOARD_OMAP4.

I have added this entry to dra7.dtsi file, in ocp node (note the different versions of the interrupt specification, none work):

        keypad: keypad@4ae1c000 {
              compatible = "ti,omap4-keypad";
              reg = <0x4ae1c000 0x80>;
              interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
//              interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
//              interrupts-extended = <&crossbar_mpu GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
//              interrupts-extended = <&crossbar_mpu GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
              keypad,num-rows = <4>;
              keypad,num-columns = <4>;
                    linux,keymap = <
                      0x00000041 0x00010042 0x00020043 0x00030044
                      0x01000045 0x01010046 0x01020047 0x01030048
                            0x02000049 0x0201004a 0x0202004b 0x0203004c
                      0x0300004d 0x0301004e 0x0302004f 0x03030050
                >;
              };

Also, in our custom .dts file:

&keypad {
    status = "okay";
};

When I boot the board with the above configuration, I get the following output in the log:

[   10.319049] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000

[   10.319055] ------------[ cut here ]------------

[   10.319067] WARNING: CPU: 0 PID: 248 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x368()

[   10.319071] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_WKUP (Read): Data Access in User mode during Functional access

[   10.319130] Modules linked in: pruss(+) omap4_keypad(+) omap_wdt phy_omap_usb2 phy_ti_pipe3 phy_omap_control ti_vpe ti_vip ti_sc ti_csc ti_vpdma v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 dwc3_omap videobuf2_core extcon rtc_omap pwm_tiehrpwm rtc_palmas flk_ti_mt9p031 aptina_pll spi_omap2_mcspi omap_remoteproc remoteproc virtio virtio_ring uio_pdrv_genirq uio cryptodev(O) fluke_mir_hp v4l2_common videodev media autofs4

[   10.319135] CPU: 0 PID: 248 Comm: systemd-journal Tainted: G           O    4.4.41 #9

[   10.319137] Hardware name: Generic DRA74X (Flattened Device Tree)

[   10.319141] Backtrace:

[   10.319151] [<c00130e4>] (dump_backtrace) from [<c00132e0>] (show_stack+0x18/0x1c)

[   10.319160]  r7:c02a2a78 r6:20000193 r5:00000000 r4:c06aca34

[   10.319168] [<c00132c8>] (show_stack) from [<c027816c>] (dump_stack+0x8c/0xa0)

[   10.319175] [<c02780e0>] (dump_stack) from [<c0032990>] (warn_slowpath_common+0x88/0xb8)

[   10.319182]  r7:c02a2a78 r6:00000093 r5:00000009 r4:ee21bb58

[   10.319188] [<c0032908>] (warn_slowpath_common) from [<c00329f8>] (warn_slowpath_fmt+0x38/0x40)

[   10.319196]  r8:00000017 r7:c05ddaec r6:00000002 r5:c05ddbac r4:c05ddc50

[   10.319203] [<c00329c4>] (warn_slowpath_fmt) from [<c02a2a78>] (l3_interrupt_handler+0x25c/0x368)

[   10.319207]  r3:eea22100 r2:c05ddc50

[   10.319210]  r4:80080003

[   10.319217] [<c02a281c>] (l3_interrupt_handler) from [<c007e0e8>] (handle_irq_event_percpu+0xb4/0x160)

[   10.319225]  r10:c06c5ca9 r9:eea1b540 r8:00000017 r7:00000000 r6:00000000 r5:eea1b5a0

[   10.319227]  r4:eea22600

[   10.319233] [<c007e034>] (handle_irq_event_percpu) from [<c007e1d4>] (handle_irq_event+0x40/0x64)

[   10.319241]  r10:00000000 r9:00000000 r8:ee808000 r7:00000000 r6:c0686cf4 r5:eea1b5a0

[   10.319243]  r4:eea1b540

[   10.319249] [<c007e194>] (handle_irq_event) from [<c0081500>] (handle_fasteoi_irq+0xc0/0x194)

[   10.319256]  r7:00000000 r6:c0686cf4 r5:eea1b5a0 r4:eea1b540

[   10.319261] [<c0081440>] (handle_fasteoi_irq) from [<c007d714>] (generic_handle_irq+0x2c/0x3c)

[   10.319268]  r7:00000000 r6:00000000 r5:00000017 r4:c067d41c

[   10.319273] [<c007d6e8>] (generic_handle_irq) from [<c007d9ec>] (__handle_domain_irq+0x64/0xbc)

[   10.319278] [<c007d988>] (__handle_domain_irq) from [<c000948c>] (gic_handle_irq+0x40/0x7c)

[   10.319286]  r9:00000000 r8:fa213000 r7:fa212000 r6:ee21bd18 r5:fa21200c r4:c06828c4

[   10.319290] [<c000944c>] (gic_handle_irq) from [<c0013dc0>] (__irq_svc+0x40/0x74)

[   10.319292] Exception stack(0xee21bd18 to 0xee21bd60)

[   10.319295] bd00:                                                       c0699560 00000009

[   10.319299] bd20: 00000000 ee4722c0 ee4722c0 00000001 ee858230 ee21be38 2f2f2f2f 00000000

[   10.319304] bd40: 00000000 ee21bd74 ee21bd78 ee21bd68 c0184048 c0490b24 20000013 ffffffff

[   10.319312]  r9:00000000 r8:2f2f2f2f r7:ee21bd4c r6:ffffffff r5:20000013 r4:c0490b24

[   10.319321] [<c0490b08>] (mutex_unlock) from [<c0184048>] (kernfs_iop_permission+0x44/0x5c)

[   10.319327] [<c0184004>] (kernfs_iop_permission) from [<c012e31c>] (__inode_permission+0x84/0xd8)

[   10.319333]  r7:ee21be38 r6:00000001 r5:80808080 r4:ee4722c0

[   10.319337] [<c012e298>] (__inode_permission) from [<c012e388>] (inode_permission+0x18/0x4c)

[   10.319344]  r7:ee21be38 r6:fefefeff r5:80808080 r4:ee34601d

[   10.319348] [<c012e370>] (inode_permission) from [<c012fcd8>] (link_path_walk+0x6c/0x4e4)

[   10.319352] [<c012fc6c>] (link_path_walk) from [<c01304bc>] (path_lookupat+0x88/0x10c)

[   10.319360]  r10:00000000 r9:00000000 r8:ee21bf10 r7:00000000 r6:ee21bf10 r5:ee346000

[   10.319363]  r4:ee21be38

[   10.319368] [<c0130434>] (path_lookupat) from [<c0131e18>] (filename_lookup+0x98/0xf4)

[   10.319374]  r7:00000000 r6:ee21be38 r5:ee346000 r4:00000000

[   10.319378] [<c0131d80>] (filename_lookup) from [<c0131f48>] (user_path_at_empty+0x4c/0x54)

[   10.319386]  r8:ee21bf40 r7:7f644ca0 r6:ee21bf10 r5:ffffff9c r4:00000000

[   10.319391] [<c0131efc>] (user_path_at_empty) from [<c0128610>] (vfs_fstatat+0x54/0xa8)

[   10.319397]  r6:ffffff9c r5:00000000 r4:bef47070

[   10.319402] [<c01285bc>] (vfs_fstatat) from [<c0128c64>] (SyS_lstat64+0x28/0x44)

[   10.319410]  r9:ee21a000 r8:c000fbc4 r7:000000c4 r6:7f645ca0 r5:7f644ccf r4:bef47070

[   10.319416] [<c0128c3c>] (SyS_lstat64) from [<c000fa20>] (ret_fast_syscall+0x0/0x34)

[   10.319418]  r4:7f644658

[   10.319421] ---[ end trace d673a89005621914 ]---

[   10.677550] [drm] Initialized drm 1.1.0 20060810

[   10.749385] pgd = ee35d5c0

[   10.752102] [00000000] *pgd=00000000

[   10.755700] Internal error: : 1211 [#1] PREEMPT SMP ARM

[   10.760942] Modules linked in: pvrsrvkm(O+) drm omapdss(+) omapdss_base pruss(+) omap4_keypad(+) omap_wdt phy_omap_usb2 phy_ti_pipe3 phy_omap_control ti_vpe ti_vip ti_sc ti_csc ti_vpdma v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 dwc3_omap videobuf2_core extcon rtc_omap pwm_tiehrpwm rtc_palmas flk_ti_mt9p031 aptina_pll spi_omap2_mcspi omap_remoteproc remoteproc virtio virtio_ring uio_pdrv_genirq uio cryptodev(O) fluke_mir_hp v4l2_common videodev media autofs4

[   10.804000] CPU: 1 PID: 308 Comm: systemd-udevd Tainted: G        W  O    4.4.41 #9

[   10.811686] Hardware name: Generic DRA74X (Flattened Device Tree)

[   10.817801] task: ee2e1200 ti: edd08000 task.ti: edd08000

[   10.823226] PC is at omap4_keypad_probe+0x288/0x438 [omap4_keypad]

[   10.829432] LR is at __pm_runtime_resume+0x64/0x6c

[   10.834240] pc : [<bf24266c>]    lr : [<c0315b18>]    psr: 400f0013

[   10.834240] sp : edd09c88  ip : edd09c68  fp : edd09cc4

[   10.845764] r10: eea6ba00  r9 : 00000000  r8 : ed828640

[   10.851008] r7 : eea89610  r6 : eea89600  r5 : 00000000  r4 : ed828000

[   10.857557] r3 : fce1c000  r2 : 00000000  r1 : 600f0013  r0 : 00000000

[   10.864110] Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user

[   10.871272] Control: 30c5387d  Table: ae35d5c0  DAC: 55555555

[   10.877041] Process systemd-udevd (pid: 308, stack limit = 0xedd08210)

[   10.883597] Stack: (0xedd09c88 to 0xedd0a000)

[   10.887972] 9c80:                   00000080 00000000 eea6cf40 00000000 eea89618 c06fff5c

[   10.896184] 9ca0: eea89610 bf242bdc fffffdfb 0000002f ed828e48 00000000 edd09ce4 edd09cc8

[   10.904396] 9cc0: c030d990 bf2423f0 c06fff5c eea89610 00000000 bf242bdc edd09d0c edd09ce8

[   10.912605] 9ce0: c030bf18 c030d948 eea89610 bf242bdc eea89644 00000000 127d71dc ed828e48

[   10.920816] 9d00: edd09d2c edd09d10 c030c0a0 c030bd20 00000000 bf242bdc c030c00c 00000000

[   10.929027] 9d20: edd09d54 edd09d30 c030a1a0 c030c018 ee85bc5c eea6bab4 ee85bc70 bf242bdc

[   10.937237] 9d40: ee8e5b00 c06b4550 edd09d64 edd09d58 c030b804 c030a13c edd09d8c edd09d68

[   10.945448] 9d60: c030b440 c030b7ec bf242b50 edd09d78 bf242bdc bf245000 c0684760 ed828f40

[   10.953657] 9d80: edd09da4 edd09d90 c030c840 c030b2a4 c06b4550 bf245000 edd09dbc edd09da8

[   10.960273] connector-hdmi connector: failed to find video source

[   10.967983] 9da0: c030d8b8 c030c7cc c0684760 bf245000 edd09dcc edd09dc0 bf245020 c030d87c

[   10.976195] 9dc0: edd09e4c edd09dd0 c000978c bf24500c 00000000 00080000 00000001 ef40ea70

[   10.984407] 9de0: edcbc100 c010911c edd08000 ee801e40 edd09e08 00009fa3 edd09e3c edd09e08

[   10.987439] panel-dpi display: failed to find video source

[   10.998118] 9e00: c0114464 c011390c 00000001 c010911c 127d71dc 0000001b edcbc100 f2ca3000

[   11.002968] tpd12s015 encoder: failed to find video source

[   11.011834] 9e20: 00000001 bf242c40 00000001 ed828f00 00000001 127d71dc ed828e48 bf242c40

[   11.020047] 9e40: edd09e74 edd09e50 c00d239c c0009700 edd09e74 edd09e60 c0109208 edd09f44

[   11.028259] 9e60: 00000001 ed828e40 edd09f3c edd09e78 c00a9d98 c00d2340 bf242c4c 00007fff

[   11.036470] 9e80: bf242c40 c00a6f94 ee22ec00 c05bf8c8 c05bf8a0 c05bf894 c05bf8f8 c0498708

[   11.044682] 9ea0: 00000000 bf242c4c f2cbdddc bf242de0 c068248c bf242e00 bf242c88 c00a6904

[   11.052892] 9ec0: f2ca3000 0001ae2c 005c2951 00000000 0000000e 00000000 00000000 00000000

[   11.061102] 9ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[   11.069312] 9f00: 00000000 00000000 00000000 00000000 000000d8 00000000 00000006 b6e47d90

[   11.077523] 9f20: 0000017b c000fbc4 edd08000 00000000 edd09fa4 edd09f40 c00aa1d8 c00a7fac

[   11.085733] 9f40: 00000002 f2ca3000 0001ae2c f2cbd83c f2cb6e33 f2cb766c 00000e00 00001040

[   11.093943] 9f60: 00000000 00000000 00000000 00000bec 00000024 00000025 0000000e 0000000b

[   11.102155] 9f80: 00000009 00000000 00000000 00000000 7f6a8de0 00000000 00000000 edd09fa8

[   11.110367] 9fa0: c000fa20 c00aa15c 00000000 7f6a8de0 00000006 b6e47d90 00000000 00000000

[   11.118577] 9fc0: 00000000 7f6a8de0 00000000 0000017b 7f6ac428 00000000 7f6ac428 7f6ac118

[   11.126788] 9fe0: bed56950 bed56940 b6e40c08 b6f2ddf2 80070030 00000006 00000000 00000000

[   11.134994] Backtrace:

[   11.137468] [<bf2423e4>] (omap4_keypad_probe [omap4_keypad]) from [<c030d990>] (platform_drv_probe+0x54/0xb8)

[   11.147423]  r10:00000000 r9:ed828e48 r8:0000002f r7:fffffdfb r6:bf242bdc r5:eea89610

[   11.155320]  r4:c06fff5c

[   11.157872] [<c030d93c>] (platform_drv_probe) from [<c030bf18>] (driver_probe_device+0x204/0x2f8)

[   11.166779]  r7:bf242bdc r6:00000000 r5:eea89610 r4:c06fff5c

[   11.172498] [<c030bd14>] (driver_probe_device) from [<c030c0a0>] (__driver_attach+0x94/0x98)

[   11.180971]  r9:ed828e48 r8:127d71dc r7:00000000 r6:eea89644 r5:bf242bdc r4:eea89610

[   11.188798] [<c030c00c>] (__driver_attach) from [<c030a1a0>] (bus_for_each_dev+0x70/0xa4)

[   11.197009]  r7:00000000 r6:c030c00c r5:bf242bdc r4:00000000

[   11.202730] [<c030a130>] (bus_for_each_dev) from [<c030b804>] (driver_attach+0x24/0x28)

[   11.210764]  r6:c06b4550 r5:ee8e5b00 r4:bf242bdc

[   11.215426] [<c030b7e0>] (driver_attach) from [<c030b440>] (bus_add_driver+0x1a8/0x220)

[   11.223468] [<c030b298>] (bus_add_driver) from [<c030c840>] (driver_register+0x80/0x100)

[   11.231595]  r7:ed828f40 r6:c0684760 r5:bf245000 r4:bf242bdc

[   11.237312] [<c030c7c0>] (driver_register) from [<c030d8b8>] (__platform_driver_register+0x48/0x50)

[   11.246395]  r5:bf245000 r4:c06b4550

[   11.250006] [<c030d870>] (__platform_driver_register) from [<bf245020>] (omap4_keypad_driver_init+0x20/0x24 [omap4_keypad])

[   11.261182]  r5:bf245000 r4:c0684760

[   11.264793] [<bf245000>] (omap4_keypad_driver_init [omap4_keypad]) from [<c000978c>] (do_one_initcall+0x98/0x1e4)

[   11.275102] [<c00096f4>] (do_one_initcall) from [<c00d239c>] (do_init_module+0x68/0x374)

[   11.283225]  r10:bf242c40 r9:ed828e48 r8:127d71dc r7:00000001 r6:ed828f00 r5:00000001

[   11.291127]  r4:bf242c40

[   11.293678] [<c00d2334>] (do_init_module) from [<c00a9d98>] (load_module+0x1df8/0x2068)

[   11.301710]  r6:ed828e40 r5:00000001 r4:edd09f44

[   11.306365] [<c00a7fa0>] (load_module) from [<c00aa1d8>] (SyS_finit_module+0x88/0x98)

[   11.314222]  r10:00000000 r9:edd08000 r8:c000fbc4 r7:0000017b r6:b6e47d90 r5:00000006

[   11.322115]  r4:00000000

[   11.324666] [<c00aa150>] (SyS_finit_module) from [<c000fa20>] (ret_fast_syscall+0x0/0x34)

[   11.332872]  r6:00000000 r5:7f6a8de0 r4:00000000

[   11.337531] Code: eb431885 e1a00009 eb443ac1 ea000018 (e5842018)

[   11.343651] ---[ end trace d673a89005621915 ]---

I find that when I use interrupt 115, it causes lots of errors with other drivers failing to load. 120 behaves a bit better (but still gives the stack dumps). In that case the other drivers load and I get a /dev/input/event0 device. But pressing the buttons on the board does not result in any output from /dev/input/event0.

  • The software team have been notified. They will respond here.
  • Hi Thomas,

    As you noted your problem starts with an L3 Custom error:
    [ 10.319071] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_WKUP (Read): Data Access in User mode during Functional access
    I think it is possible that the root cause for this is, as you stated, incorrect use of interrupts.

    After this, the problem seems to be that the keypad driver is somehow messing with the video drivers. The problem starts with probing the keypad dts:
    PC is at omap4_keypad_probe+0x288/0x438 [omap4_keypad]
    Then you get to the point where the kernel cannot resolve video sources:
    connector-hdmi connector: failed to find video source
    panel-dpi display: failed to find video source
    tpd12s015 encoder: failed to find video source

    Are you using a custom board? Can you check if you've removed the corresponding vin pins & vin drivers? It is possible that both vin & keypad try to use event0 to register activity in your system. Can you try removing the display & touchscreen drivers (if any) and see if the problem persists?

    Note that besides taking care of mux_data.h, the sdk04.01 also uses dts file in u-boot. You also need to take care of the settings in this device tree file. The dts files are located in arch/arm/dts/.

    Best Regards,
    Yordan
  • Hi Yordan,

    Yes, we are using a custom board. I will check the dts* files to ensure that we do not have conflicting pins muxed.
    We have some additional information that may shed light on this issue. We took a look at the omap4-keypad.c driver file and noticed that it reads the KBD_REVISION register at 0x4ae1c000 in the AM57xx register space. When we use devmem to read that register, we get the following:

    # devmem 0x4ae1c000 32
    [ 40.585243] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
    [ 40.585252] ------------[ cut here ]------------
    [ 40.585303] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x368()
    [ 40.585316] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_WKUP (Read): Data Access in User mode during Functional access
    [ 40.585569] Modules linked in: cfg80211 bc_example(O) snd_soc_omap_hdmi_audio snd_soc_omap rpmsg_rpc snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer snd soundcore omapdrm virtio_rpmsg_bus drm_kms_helper syscopyarea pvrsrvkm(O) sysfillrect sysimgblt fb_sys_fops drm omapdss connector_hdmi encoder_tpd12s015 omapdss_base pruss omap_wdt phy_ti_pipe3 phy_omap_usb2 phy_omap_control ti_vip ti_vpe ti_sc ti_csc ti_vpdma videobuf2_dma_contig v4l2_mem2mem videobuf2_memops videobuf2_v4l2 videobuf2_core dwc3_omap extcon rtc_omap pwm_tiehrpwm rtc_palmas flk_ti_mt9p031 aptina_pll spi_omap2_mcspi omap_remoteproc remoteproc virtio virtio_ring uio_pdrv_genirq uio cryptodev(O) fluke_mir_hp v4l2_common videodev media autofs4
    [ 40.585586] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 4.4.41 #11
    [ 40.585593] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 40.585603] Backtrace:
    [ 40.585644] [<c00130e4>] (dump_backtrace) from [<c00132e0>] (show_stack+0x18/0x1c)
    [ 40.585672] r7:c02a2a78 r6:200f0193 r5:00000000 r4:c06aca34
    [ 40.585701] [<c00132c8>] (show_stack) from [<c027816c>] (dump_stack+0x8c/0xa0)
    [ 40.585728] [<c02780e0>] (dump_stack) from [<c0032990>] (warn_slowpath_common+0x88/0xb8)
    [ 40.585753] r7:c02a2a78 r6:00000093 r5:00000009 r4:c0681d30
    [ 40.585774] [<c0032908>] (warn_slowpath_common) from [<c00329f8>] (warn_slowpath_fmt+0x38/0x40)
    [ 40.585801] r8:00000017 r7:c05ddb2c r6:00000002 r5:c05ddbec r4:c05ddc90
    [ 40.585824] [<c00329c4>] (warn_slowpath_fmt) from [<c02a2a78>] (l3_interrupt_handler+0x25c/0x368)
    [ 40.585838] r3:eea22100 r2:c05ddc90
    [ 40.585848] r4:80080003
    [ 40.585872] [<c02a281c>] (l3_interrupt_handler) from [<c007e0e8>] (handle_irq_event_percpu+0xb4/0x160)
    [ 40.585901] r10:c06c5ca9 r9:eea1b540 r8:00000017 r7:00000000 r6:00000000 r5:eea1b5a0
    [ 40.585910] r4:eea22600
    [ 40.585929] [<c007e034>] (handle_irq_event_percpu) from [<c007e1d4>] (handle_irq_event+0x40/0x64)
    [ 40.585957] r10:c06824e4 r9:c04971c4 r8:ee808000 r7:00000000 r6:c0686cf4 r5:eea1b5a0
    [ 40.585966] r4:eea1b540
    [ 40.585987] [<c007e194>] (handle_irq_event) from [<c0081500>] (handle_fasteoi_irq+0xc0/0x194)
    [ 40.586009] r7:00000000 r6:c0686cf4 r5:eea1b5a0 r4:eea1b540
    [ 40.586029] [<c0081440>] (handle_fasteoi_irq) from [<c007d714>] (generic_handle_irq+0x2c/0x3c)
    [ 40.586051] r7:00000000 r6:00000000 r5:00000017 r4:c067d41c
    [ 40.586069] [<c007d6e8>] (generic_handle_irq) from [<c007d9ec>] (__handle_domain_irq+0x64/0xbc)
    [ 40.586086] [<c007d988>] (__handle_domain_irq) from [<c000948c>] (gic_handle_irq+0x40/0x7c)
    [ 40.586113] r9:c04971c4 r8:fa213000 r7:fa212000 r6:c0681ef0 r5:fa21200c r4:c06828c4
    [ 40.586128] [<c000944c>] (gic_handle_irq) from [<c0013dc0>] (__irq_svc+0x40/0x74)
    [ 40.586137] Exception stack(0xc0681ef0 to 0xc0681f38)
    [ 40.586149] 1ee0: 00000001 00000000 fe600000 00000000
    [ 40.586164] 1f00: c0680000 c0682484 00000000 00000000 c0681f60 c04971c4 c06824e4 c0681f4c
    [ 40.586176] 1f20: c0681f2c c0681f40 c0025a84 c0010540 600f0013 ffffffff
    [ 40.586205] r9:c04971c4 r8:c0681f60 r7:c0681f24 r6:ffffffff r5:600f0013 r4:c0010540
    [ 40.586229] [<c0010518>] (arch_cpu_idle) from [<c006e978>] (default_idle_call+0x28/0x34)
    [ 40.586250] [<c006e950>] (default_idle_call) from [<c006ebd8>] (cpu_startup_entry+0x200/0x260)
    [ 40.586269] [<c006e9d8>] (cpu_startup_entry) from [<c048dacc>] (rest_init+0x90/0x94)
    [ 40.586279] r7:00000000
    [ 40.586298] [<c048da3c>] (rest_init) from [<c0637d8c>] (start_kernel+0x404/0x410)
    [ 40.586313] r5:c06c8000 r4:c06c8040
    [ 40.586328] [<c0637988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 40.586336] ---[ end trace 80ba50c8aa2bf87b ]---
    [ 40.946661] pgd = ecaa5c80
    [ 40.949392] [00000000] *pgd=ac891003, *pmd=fe2f8003
    Bus error (core dumped)

    This error looks pretty much like the error we are seeing in the boot log. Any idea why reading the revision register would cause this? Is there a silicon problem in the AM5728?

    Thanks,

    Tom McManus
  • Tom,

    Ok, It seems that the kernel does NOT enable the Keyboard controller clock.

    I got the same error on my AM5728 EVM:

    root@am57xx-evm:~# devmem2 0x4AE1C000
    /dev/mem opened.
    [ 32.565004] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
    [ 32.565008] pgd = ece37e80
    [ 32.565017] [00000000] *pgd=94c87003, *pmd=fb904003
    [ 32.565049] ------------[ cut here ]------------
    Memory mapped at address 0xb6f50000.
    [ 32.586061] WARNING: CPU: 1 PID: 27 at /home/gtbldadm/processor-sdk-linux-rt-morty-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work-shared/c
    [ 32.610669] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_WKUP (Read): Data Access in User mode during Functional access
    [ 32.622028] Modules linked in: bc_example(O) xhci_plat_hcd xhci_hcd usbcore dwc3 udc_core usb_common rpmsg_proto rpmsg_rpc sha512_generic sha512_arm sha)
    [ 32.690460] CPU: 1 PID: 27 Comm: irq/23-l3-app-i Tainted: G O 4.9.41-rt23-gc038d21a22 #2
    [ 32.690463] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 32.690467] Backtrace:
    [ 32.690485] [<c020b2b4>] (dump_backtrace) from [<c020b570>] (show_stack+0x18/0x1c)
    [ 32.690492] r7:00000009 r6:600e0113 r5:00000000 r4:c1024b00
    [ 32.690506] [<c020b558>] (show_stack) from [<c04d1f9c>] (dump_stack+0x8c/0xa0)
    [ 32.690515] [<c04d1f10>] (dump_stack) from [<c022d95c>] (__warn+0xec/0x104)
    [ 32.690520] r7:00000009 r6:c0bc4f00 r5:00000000 r4:ee625e20
    [ 32.690527] [<c022d870>] (__warn) from [<c022d9b4>] (warn_slowpath_fmt+0x40/0x48)
    [ 32.690533] r9:00000010 r8:ee5f2f50 r7:c0bc4d6c r6:00000002 r5:c0bc4e2c r4:c0bc4ed0
    [ 32.690542] [<c022d978>] (warn_slowpath_fmt) from [<c0501f6c>] (l3_interrupt_handler+0x25c/0x36c)
    [ 32.690545] r3:ee5f2dc0 r2:c0bc4ed0
    [ 32.690548] r4:80080003
    [ 32.690557] [<c0501d10>] (l3_interrupt_handler) from [<c0282038>] (irq_forced_thread_fn+0x28/0x7c)
    [ 32.690563] r10:c0282010 r9:ee5fa2c0 r8:ee5f8000 r7:00000001 r6:00000000 r5:ee5f8000
    [ 32.690565] r4:ee5fa2c0
    [ 32.690572] [<c0282010>] (irq_forced_thread_fn) from [<c028239c>] (irq_thread+0x124/0x1f8)
    [ 32.690576] r7:00000001 r6:00000000 r5:ee624000 r4:ee5fa2e4
    [ 32.690585] [<c0282278>] (irq_thread) from [<c024adc8>] (kthread+0x100/0x118)
    [ 32.690590] r10:00000000 r9:00000000 r8:c0282278 r7:ee5fa2c0 r6:ee624000 r5:ee5fa300
    [ 32.690592] r4:00000000
    [ 32.690599] [<c024acc8>] (kthread) from [<c0207c90>] (ret_from_fork+0x14/0x24)
    [ 32.690604] r8:00000000 r7:00000000 r6:00000000 r5:c024acc8 r4:ee5fa300
    [ 32.690606] ---[ end trace 0000000000000002 ]---
    Bus error (core dumped)


    But when I enable the clock, I am able to read Keyboard Controller registers:

    root@am57xx-evm:~# devmem2 0x4AE07878 w 00000002 ===> ENABLE THE CLOCK FROM PRCM
    /dev/mem opened.
    Memory mapped at address 0xb6f36000.
    Read at address 0x4AE07878 (0xb6f36878): 0x00030000
    Write at address 0x4AE07878 (0xb6f36878): 0x00000002, readback 0x00000002
    root@am57xx-evm:~# devmem2 0x4AE1C000 ===> READ THE KBD REVISION register
    /dev/mem opened.
    Memory mapped at address 0xb6f47000.
    Read at address 0x4AE1C000 (0xb6f47000): 0x5FFF2200

    On probing the kbd device tree information, can you try enabling the clock first using _raw_writel() on the PRCM register?
    Or can you revisit the dts files both in u-boot & linux kernel and make sure you set kbd status = "okay"?

    Best Regards,
    Yordan
  • This worked:

    In dra7.dtsi file, added this entry under ocp node:

    keypad: keypad@4ae1c000 {
    compatible = "ti,omap4-keypad";
    reg = <0x4ae1c000 0x80>;
    interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
    keypad,num-rows = <4>;
    keypad,num-columns = <4>;
    linux,keymap = <
    0x00000041 0x00010042 0x00020043 0x00030044
    0x01000045 0x01010046 0x01020047 0x01030048
    0x02000049 0x0201004a 0x0202004b 0x0203004c
    0x0300004d 0x0301004e 0x0302004f 0x03030050
    >;
    };

    In u-boot mux_data.h file:

    {VIN2A_D3, (M9 | PIN_OUTPUT)}, /* vin2a_d3.kbd_col0 */
    {VIN2A_D4, (M9 | PIN_OUTPUT)}, /* vin2a_d4.kbd_col1 */
    {VIN2A_D5, (M9 | PIN_OUTPUT)}, /* vin2a_d5.kbd_col2 */
    {VIN2A_D6, (M9 | PIN_OUTPUT)}, /* vin2a_d5.kbd_col3 */
    {VIN1A_DE0, (M9 | PIN_INPUT_PULLUP)}, /* vin1a_de0.kbd_row0 */
    {VIN1A_FLD0, (M9 | PIN_INPUT_PULLUP)}, /* vin1a_fld0.kbd_row1 */
    {VIN1A_D8, (M9 | PIN_INPUT_PULLUP)}, /* vin1a_d8.kbd_row2 */
    {VIN1A_D9, (M9 | PIN_INPUT_PULLUP)}, /* vin1a_d9.kbd_row3 */

    Modified omap4-keypad.c driver file as follows:

    diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
    index 6639b2b..eec5715 100644
    --- a/drivers/input/keyboard/omap4-keypad.c
    +++ b/drivers/input/keyboard/omap4-keypad.c
    @@ -32,6 +32,9 @@
    #include <linux/slab.h>
    #include <linux/pm_runtime.h>

    +// Fluke customization.
    +#define CM_WKUPAON_KBD_CLKCTRL 0x4ae07878
    +
    /* OMAP4 registers */
    #define OMAP4_KBD_REVISION 0x00
    #define OMAP4_KBD_SYSCONFIG 0x10
    @@ -68,6 +71,9 @@ enum {
    KBD_REVISION_OMAP5,
    };

    +// Fluke customization. Base address of keypad clock enable register.
    +static void __iomem *kbd_clock_register;
    +
    struct omap4_keypad {
    struct input_dev *input;

    @@ -244,6 +250,12 @@ static int omap4_keypad_probe(struct platform_device *pdev)
    int irq;
    int error;

    + // Fluke customization - turn on clock to keyboard controller.
    + // Map the control register.
    + kbd_clock_register = ioremap(CM_WKUPAON_KBD_CLKCTRL,4);
    + writel(0x2, kbd_clock_register);
    + iounmap(kbd_clock_register);
    +
    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    if (!res) {
    dev_err(&pdev->dev, "no base address specified\n");

    Device driver now loads without error and writes to /dev/input/event0.

    Tom McManus