Hi, I just posted a guide on this topic on this group that I think that it 
will help you. Read it and let me know if you have a question.

Τη Παρασκευή, 9 Ιουνίου 2017 - 2:09:33 μ.μ. UTC+3, ο χρήστης 
[email protected] έγραψε:
>
> Hello, Vladimir. I am a student of computer engineering with some problems 
> to multiplex my BeagleBoard xM. How did you edit your device tree? I feel 
> like I'm at the very beginning of what I need to know to make my GPIO work, 
> but I'd be grateful for any help your experience might bring me.
>
> Thank you.
>
> Em sexta-feira, 15 de novembro de 2013 13:22:26 UTC-2, porkupan escreveu:
>>
>> On 3.12 an attempt to dump 
>> */sys/kernel/debug/pinctrl/48002030.pinmux/pins* continues to cause a 
>> kernel crash (not a complete crash, but bad enough):
>>
>> root@arm:~# cat /sys/kernel/debug/pinctrl/48002030.pinmux/pins
>> Segmentation fault
>>
>> http://paste.ubuntu.com/6421695/
>>
>> [63418.031249] Unhandled fault: external abort on non-linefetch (0x1028) 
>> at 0xfa002268
>> [63418.039337] Internal error: : 1028 [#1] SMP ARM
>> [63418.044128] Modules linked in: ftdi_sio smsc95xx usbnet usbserial 
>> joydev leds_pwm rtc_twl uio_pdrv_genirq gpio_keys phy_generic uio
>> [63418.056762] CPU: 0 PID: 1798 Comm: cat Not tainted 3.12.0-armv7-x8 #2
>> [63418.063537] task: de739600 ti: df082000 task.ti: df082000
>> [63418.069244] PC is at pcs_readw+0x0/0x10
>> [63418.073303] LR is at pcs_pin_dbg_show+0x2c/0x4c
>> [63418.078094] pc : [<c0393d40>]    lr : [<c0394a14>]    psr: a0000013
>> [63418.078094] sp : df083ee0  ip : 00000000  fp : c0961fb5
>> [63418.090209] r10: de16088c  r9 : c077a5e8  r8 : de1608b8
>> [63418.095703] r7 : 0000011c  r6 : df566a00  r5 : 0000011c  r4 : df566a00
>> [63418.102600] r3 : c0393d40  r2 : fa002030  r1 : df566a00  r0 : fa002268
>> [63418.109466] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  
>> Segment user
>> [63418.117004] Control: 10c5387d  Table: 9db08019  DAC: 00000015
>> [63418.123046] Process cat (pid: 1798, stack limit = 0xdf082248)
>> [63418.129119] Stack: (0xdf083ee0 to 0xdf084000)
>> [63418.133728] 3ee0: de160880 0000011c df566a00 c038ef24 c038ee88 
>> 00000000 df083f20 df566a00
>> [63418.142364] 3f00: 00000001 00010000 000cf000 df083f80 dd9f1e40 
>> c0139e58 00000000 df566a28
>> [63418.151000] 3f20: 00000000 00000000 00000000 dd9f1e40 df083f80 
>> dd9f1e40 000cf000 dd9f1e40
>> [63418.159606] 3f40: df082018 df083f80 00010000 00000000 00000000 
>> c011c1f8 dd9f1e40 000cf000
>> [63418.168243] 3f60: 00000000 00000000 dd9f1e40 00000000 000cf000 
>> 00010000 00000000 c011c914
>> [63418.176879] 3f80: 00000000 00000000 00010000 00010000 000171c4 
>> 000cf000 00000003 c000da64
>> [63418.185516] 3fa0: df082000 c000d8e0 00010000 000171c4 00000003 
>> 000cf000 00010000 000cf000
>> [63418.194122] 3fc0: 00010000 000171c4 000cf000 00000003 7fffe000 
>> 00000000 00010000 00000000
>> [63418.202758] 3fe0: 00000000 bead0574 0000b581 b6ef6f2c 40000010 
>> 00000003 ffffffeb ff7fdfbf
>> [63418.211395] [<c0393d40>] (pcs_readw+0x0/0x10) from [<c0394a14>] 
>> (pcs_pin_dbg_show+0x2c/0x4c)
>> [63418.220336] [<c0394a14>] (pcs_pin_dbg_show+0x2c/0x4c) from 
>> [<c038ef24>] (pinctrl_pins_show+0x9c/0xd0)
>> [63418.230072] [<c038ef24>] (pinctrl_pins_show+0x9c/0xd0) from 
>> [<c0139e58>] (seq_read+0x1b0/0x404)
>> [63418.239257] [<c0139e58>] (seq_read+0x1b0/0x404) from [<c011c1f8>] 
>> (vfs_read+0xa4/0x168)
>> [63418.247711] [<c011c1f8>] (vfs_read+0xa4/0x168) from [<c011c914>] 
>> (SyS_read+0x38/0x68)
>> [63418.256011] [<c011c914>] (SyS_read+0x38/0x68) from [<c000d8e0>] 
>> (ret_fast_syscall+0x0/0x30)
>> [63418.264831] Code: e5d03000 e6ef0073 f57ff04f e12fff1e (e1d030b0)
>> [63418.307189] ---[ end trace 12432e5fbd2a5e32 ]---
>> [63418.312133] In-band Error seen by MPU  at address 0
>> [63418.317260] ------------[ cut here ]------------
>> [63418.322174] WARNING: CPU: 0 PID: 1798 at drivers/bus/omap_l3_smx.c:162 
>> omap3_l3_app_irq+0xcc/0x110()
>> [63418.331787] Modules linked in: ftdi_sio smsc95xx usbnet usbserial 
>> joydev leds_pwm rtc_twl uio_pdrv_genirq gpio_keys phy_generic uio
>> [63418.344390] CPU: 0 PID: 1798 Comm: cat Tainted: G      D      
>> 3.12.0-armv7-x8 #2
>> [63418.352233] [<c0014000>] (unwind_backtrace+0x0/0xdc) from [<c0010eb0>] 
>> (show_stack+0x10/0x14)
>> [63418.361236] [<c0010eb0>] (show_stack+0x10/0x14) from [<c06febf0>] 
>> (dump_stack+0x70/0x8c)
>> [63418.369781] [<c06febf0>] (dump_stack+0x70/0x8c) from [<c003b328>] 
>> (warn_slowpath_common+0x64/0x88)
>> [63418.379241] [<c003b328>] (warn_slowpath_common+0x64/0x88) from 
>> [<c003b3dc>] (warn_slowpath_null+0x18/0x20)
>> [63418.389434] [<c003b3dc>] (warn_slowpath_null+0x18/0x20) from 
>> [<c038e034>] (omap3_l3_app_irq+0xcc/0x110)
>> [63418.399353] [<c038e034>] (omap3_l3_app_irq+0xcc/0x110) from 
>> [<c007b104>] (handle_irq_event_percpu+0x6c/0x1fc)
>> [63418.409851] [<c007b104>] (handle_irq_event_percpu+0x6c/0x1fc) from 
>> [<c007b2d4>] (handle_irq_event+0x40/0x60)
>> [63418.420227] [<c007b2d4>] (handle_irq_event+0x40/0x60) from 
>> [<c007dd2c>] (handle_level_irq+0xd4/0xfc)
>> [63418.429840] [<c007dd2c>] (handle_level_irq+0xd4/0xfc) from 
>> [<c007a968>] (generic_handle_irq+0x20/0x30)
>> [63418.439666] [<c007a968>] (generic_handle_irq+0x20/0x30) from 
>> [<c000e1c4>] (handle_IRQ+0x68/0x90)
>> [63418.448944] [<c000e1c4>] (handle_IRQ+0x68/0x90) from [<c00085d8>] 
>> (omap3_intc_handle_irq+0x60/0x74)
>> [63418.458496] [<c00085d8>] (omap3_intc_handle_irq+0x60/0x74) from 
>> [<c07038c0>] (__irq_svc+0x40/0x50)
>> [63418.467956] Exception stack(0xdf083cd8 to 0xdf083d20)
>> [63418.473266] 
>> 3cc0:                                                       df5ca9c4 
>> 00003572
>> [63418.481903] 3ce0: df5ca4c0 00000504 df6cedc0 df082000 00000b58 
>> 00000001 df082000 0000000b
>> [63418.490539] 3d00: c0ac97b0 c0393d40 00000000 df083d20 c0095a4c 
>> c0095b54 40000113 ffffffff
>> [63418.499176] [<c07038c0>] (__irq_svc+0x40/0x50) from [<c0095b54>] 
>> (acct_collect+0x19c/0x1a0)
>> [63418.507995] [<c0095b54>] (acct_collect+0x19c/0x1a0) from [<c003d6c0>] 
>> (do_exit+0x1d0/0x940)
>> [63418.516815] [<c003d6c0>] (do_exit+0x1d0/0x940) from [<c001115c>] 
>> (die+0x2a8/0x3a0)
>> [63418.524810] [<c001115c>] (die+0x2a8/0x3a0) from [<c00083b8>] 
>> (do_DataAbort+0x84/0x98)
>> [63418.533081] [<c00083b8>] (do_DataAbort+0x84/0x98) from [<c0703858>] 
>> (__dabt_svc+0x38/0x60)
>> [63418.541778] Exception stack(0xdf083e98 to 0xdf083ee0)
>> [63418.547119] 
>> 3e80:                                                       fa002268 
>> df566a00
>> [63418.555755] 3ea0: fa002030 c0393d40 df566a00 0000011c df566a00 
>> 0000011c de1608b8 c077a5e8
>> [63418.564361] 3ec0: de16088c c0961fb5 00000000 df083ee0 c0394a14 
>> c0393d40 a0000013 ffffffff
>> [63418.573028] [<c0703858>] (__dabt_svc+0x38/0x60) from [<c0393d40>] 
>> (pcs_readw+0x0/0x10)
>> [63418.581359] [<c0393d40>] (pcs_readw+0x0/0x10) from [<c0394a14>] 
>> (pcs_pin_dbg_show+0x2c/0x4c)
>> [63418.590270] [<c0394a14>] (pcs_pin_dbg_show+0x2c/0x4c) from 
>> [<c038ef24>] (pinctrl_pins_show+0x9c/0xd0)
>> [63418.600036] [<c038ef24>] (pinctrl_pins_show+0x9c/0xd0) from 
>> [<c0139e58>] (seq_read+0x1b0/0x404)
>> [63418.609222] [<c0139e58>] (seq_read+0x1b0/0x404) from [<c011c1f8>] 
>> (vfs_read+0xa4/0x168)
>> [63418.617675] [<c011c1f8>] (vfs_read+0xa4/0x168) from [<c011c914>] 
>> (SyS_read+0x38/0x68)
>> [63418.625946] [<c011c914>] (SyS_read+0x38/0x68) from [<c000d8e0>] 
>> (ret_fast_syscall+0x0/0x30)
>> [63418.634735] ---[ end trace 12432e5fbd2a5e33 ]---
>>
>>
>> On Thursday, October 31, 2013 4:13:58 PM UTC-4, porkupan wrote:
>>>
>>> Well, so I think I understand a bit more about the DTS support for 
>>> GPIO.  I configured the pinctrl for GPIO5 channel, and it seems to have 
>>> some effect on the GPIO pins.  After the kernel starts up the LEDs are 
>>> being turned off.
>>>
>>> &omap3_pmx_core {
>>>          vvv_gpio_pins: pinmux_gpio_pins {
>>>                 pinctrl-single,pins = <
>>>                         0x136 (PIN_OUTPUT | MUX_MODE4)          /* 
>>> gpio_137 */
>>>                         0x138 (PIN_OUTPUT | MUX_MODE4)          /* 
>>> gpio_138 */
>>>                         0x13a (PIN_OUTPUT | MUX_MODE4)          /* 
>>> gpio_139 */
>>>                 >;
>>>         };
>>> };
>>>
>>> &gpio5 {
>>>           pinctrl-names = "default";
>>>           pinctrl-0 = <&vvv_gpio_pins>;
>>> };
>>>
>>> However the GPIO export mechanism from userspace is still not working.  
>>> Basically, no matter what value you try to set gpio137-139, they stay low 
>>> (although the value in the /sys/class/gpio/gpioXXX/value file is being 
>>> changed appropriately.  It's as if gpiochip128 is not really associated 
>>> with gpio5.  
>>>
>>> I am also worried about not being able to dump 
>>> */sys/kernel/debug/pinctrl/48002030.pinmux/pins* . The kernel hiccup 
>>> occurs on the base 3.11 DTB file, so it's not my change that's causing it.
>>>
>>>
>>>
>>> On Friday, October 25, 2013 3:13:46 PM UTC-4, porkupan wrote:
>>>>
>>>> Trying to dump the pinmux states 
>>>> (/sys/kernel/debug/pinctrl/48002030.pinmux/pins) in 3.11 seems to cause a 
>>>> kernel crash:
>>>> http://paste.ubuntu.com/6302171/
>>>>
>>>> GPIO access via /sys/class/gpio  appears to be nonoperational in 3.11.  
>>>> It looks like a reasonable assumption that GPIOs may not be muxed into the 
>>>> GPIO pins.  
>>>>
>>>> I tried to add a devicetree entry to to force-mux GPIOs:
>>>>
>>>> &omap3_pmx_core {
>>>>          vvv_gpio_pins: pinmux_gpio_pins {
>>>>                 pinctrl-single,pins = <
>>>>                         0x134 (PIN_OUTPUT | MUX_MODE4)          /* 
>>>> gpio_137 */
>>>>                         0x135 (PIN_OUTPUT | MUX_MODE4)          /* 
>>>> gpio_138 */
>>>>                         0x136 (PIN_OUTPUT | MUX_MODE4)          /* 
>>>> gpio_139 */
>>>>                 >;
>>>>         };
>>>> };
>>>>
>>>> &ocp {
>>>>                 gpio_helper: helper {
>>>>                         compatible = "ti,omap3-gpio";
>>>>                         pinctrl-names = "default";
>>>>                         pinctrl-0 = <&vvv_gpio_pins>;
>>>>                         status = "okay";
>>>>                 };
>>>> };
>>>>
>>>> Doesn't seem to do anything.  The only indication that the kernel is 
>>>> actually trying to parse the fake "helper" device is these lines in the 
>>>> message log:
>>>>
>>>> [    0.369201] omap_gpio helper.26: could not find pctldev for node 
>>>> /ocp/pinmux@48002030/pinmux_gpio_pins, deferring probe
>>>> [    0.369232] platform helper.26: Driver omap_gpio requests probe deferral
>>>> <...>
>>>> [    3.354125] omap_gpio helper.26: Invalid IRQ resource
>>>>
>>>> Obviously, I have no idea what "compatible" driver should I chose, 
>>>> omap3_gpio just sounded like something that could fit.  For BBB they 
>>>> reference bone-pinmux-helper, which I assume is BBB-specific?
>>>>
>>>> Thanks!
>>>>
>>>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/8b2de04c-a2ef-48ad-bf91-713aa17d5e63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to