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.

LCD Controller

Other Parts Discussed in Thread: AM3359

I am trying to write a driver for my beaglebone running Ubuntu. I am having trouble figuring out how to enable the clock to the LCDC module of the AM3359 processor in the Linux kernel, I am trying to write the driver as a Linux kernel module.

I'm attempting to use the kernel function clk_get() however i have been unsuccessful.

  • Hi Derek,

    Is the compilation unsuccessful or is there some other kind of problem? Have you seen this guide: http://processors.wiki.ti.com/index.php/AM335x_LCD_Controller_Driver%27s_Guide

    Please provide logs of whatever is failing.

    Best regards,
    Miroslav
  • I head read over that link however it does not assist me in what i am trying to do. I am attaching a LCD with an LCD controller to the GPIO port on the beagle bone. I want to use the LCDC LIDD module to interface with the LCD form Linux.

    When I attempt to enable the LCDC clock with the kernel command, clk_get( NULL, "lcdc_fck"), it returns an IS_ERR condition.

    When the LCDC clock is not enabled the driver module produces the following error, from dmesg, when loaded into the kernel from user space.

    [ 1307.420166] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa30e000
    [ 1307.428283] Internal error: : 1028 [#1]
    [ 1307.432312] Modules linked in: hello(O+) aes_generic arc4 rtl8192cu rtl8192c_common rtlwifi mac80211 snd_soc_tlv320aic3x cfg80211 rfkill spidev ti_tscadc
    [ 1307.446899] CPU: 0 Tainted: G O (3.2.33-psp26 #1)
    [ 1307.453155] PC is at hello_init+0xc8/0x118 [hello]
    [ 1307.458251] LR is at console_unlock+0x1d8/0x1f0
    [ 1307.463043] pc : [<bf1020c8>] lr : [<c0039ef4>] psr: 20000013
    [ 1307.463043] sp : cf167eb8 ip : cf167de0 fp : cf167ed4
    [ 1307.475158] r10: bf102000 r9 : 00000000 r8 : 00000001
    [ 1307.480651] r7 : cf13f700 r6 : bf1001cc r5 : 00000001 r4 : c06f1c4c
    [ 1307.487518] r3 : fa30e000 r2 : 00000001 r1 : 00005594 r0 : 00000026
    [ 1307.494415] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 1307.501922] Control: 10c5387d Table: 8ec60019 DAC: 00000015
    [ 1307.507995] Process insmod (pid: 1065, stack limit = 0xcf1662f0)
    [ 1307.514312] Stack: (0xcf167eb8 to 0xcf168000)
    [ 1307.518920] 7ea0: 00000000 c02a94c4
    [ 1307.527557] 7ec0: cf167efc bf100184 cf167f14 cf167ed8 c0008690 bf10200c cf167f04 bf100184
    [ 1307.536163] 7ee0: 00000001 bf1001cc cf13f700 bf100184 00000001 bf1001cc cf13f700 00000001
    [ 1307.544799] 7f00: c0064138 0000001c cf167fa4 cf167f18 c0066984 c0008600 bf100190 cf167f28
    [ 1307.553405] 7f20: 00000000 c0064230 00000000 c04ef510 c00bf294 c068096c d0972000 00001078
    [ 1307.562042] 7f40: d0972850 d097278d d0972f58 cf3a7b40 000002d4 00000374 00000000 00000000
    [ 1307.570648] 7f60: 00000012 00000013 0000000a 00000008 00000006 00000000 ceee6c80 00008c4d
    [ 1307.579254] 7f80: 00001078 00004000 00000080 c000da44 cf166000 00000000 00000000 cf167fa8
    [ 1307.587890] 7fa0: c000d8c0 c00652d8 00008c4d 00001078 00013018 00001078 00013008 00000068
    [ 1307.596527] 7fc0: 00008c4d 00001078 00004000 00000080 00013018 00000003 400ef000 00000000
    [ 1307.605163] 7fe0: 40249260 beb8b748 00008ab9 40249270 80000010 00013018 00000000 00000000
    [ 1307.613769] Backtrace:
    [ 1307.616394] [<bf102000>] (hello_init+0x0/0x118 [hello]) from [<c0008690>] (do_one_initcall+0x9c/0x16c)
    [ 1307.626190] r4:bf100184
    [ 1307.628906] [<c00085f4>] (do_one_initcall+0x0/0x16c) from [<c0066984>] (sys_init_module+0x16b8/0x1848)
    [ 1307.638702] [<c00652cc>] (sys_init_module+0x0/0x1848) from [<c000d8c0>] (ret_fast_syscall+0x0/0x30)
    [ 1307.648223] Code: e59f0050 eb4f72a6 e59f302c e5933000 (e5931000)
    [ 1307.654907] ---[ end trace 5e31fd7c58f15202 ]---

  • Hi Derek,

    The "Unhandled fault: external abort on non-linefetch (0x1028)" error is normal behavior if you try to access the MMIO registers before enabling the LCDC clock.

    Please take a look at this post: http://www.cemetech.net/forum/viewtopic.php?t=7814. The LCD may not be the same as yours, but the LCDC LIDD is used, so it may be useful.

    The section "Interfacing the TI's AM335x LCDC LIDD Mode in Non-DMA Mode" contains some really helpful hints regarding your error. There is also a link to the source code at the bottom of the post.

    Best regards,
    Miroslav

  • I have read over his post a few times; however, he is making a kernel driver that requires recompiling the whole kernel. I would like to do it with a kernel module driver that i can insert and remove at run time.