{"action":"created","issue":{"url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/91","repository_url":"https://api.github.com/repos/beagleboard/bb.org-overlays","labels_url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/91/comments","events_url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/91/events","html_url":"https://github.com/beagleboard/bb.org-overlays/issues/91","id":348349494,"node_id":"MDU6SXNzdWUzNDgzNDk0OTQ=","number":91,"title":"Issues creating a PPS overlay","user":{"login":"tehkillerbee","id":815886,"node_id":"MDQ6VXNlcjgxNTg4Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/815886?v=4","gravatar_id":"","url":"https://api.github.com/users/tehkillerbee","html_url":"https://github.com/tehkillerbee","followers_url":"https://api.github.com/users/tehkillerbee/followers","following_url":"https://api.github.com/users/tehkillerbee/following{/other_user}","gists_url":"https://api.github.com/users/tehkillerbee/gists{/gist_id}","starred_url":"https://api.github.com/users/tehkillerbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehkillerbee/subscriptions","organizations_url":"https://api.github.com/users/tehkillerbee/orgs","repos_url":"https://api.github.com/users/tehkillerbee/repos","events_url":"https://api.github.com/users/tehkillerbee/events{/privacy}","received_events_url":"https://api.github.com/users/tehkillerbee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-07T14:34:58Z","updated_at":"2018-08-08T07:11:08Z","closed_at":null,"author_association":"NONE","body":"I have been trying to create a PPS GPIO overlay in conjunction with the existing UART4 overlay (BB-UART4-00A0).\r\n\r\nMy BBB is running the latest kernel, latest uboot at this point. I have also made sure that the bb-cape-overlays package is up to date (https://github.com/beagleboard/bb.org-overlays/issues/76)..\r\n\r\nI am able to enable UART4, by adding it as follows and it works perfectly.\r\n###Additional custom capes\r\nuboot_overlay_addr4=/lib/firmware/BB-UART4-00A0.dtbo\r\n\r\nThen I tried adding my own PPS overlay (based on existing examples), containing the following:\r\n```\r\n/*\r\n *\r\n */\r\n/dts-v1/;\r\n/plugin/;\r\n\r\n/ {\r\n\tcompatible = \"ti,beaglebone\", \"ti,beaglebone-black\";\r\n\r\n\t/* identification */\r\n\tpart-number = \"BB-PPS-P9_12\";\r\n\tversion = \"00A0\";\r\n\t\r\n\t/* state the resources this cape uses */\r\n\texclusive-use =\r\n\t/* the pin header uses */\r\n\t\"P9.12\";\t/* pps gpio */\r\n\r\n\tfragment@0 {\r\n\t\ttarget = <&am33xx_pinmux>;\r\n\t\t__overlay__ {\r\n\t\t\tpps_pins: pinmux_pps_pins {\r\n\t\t\t\tpinctrl-single,pins = <\r\n\t\t\t\t\t0x078\t0x27\t/* gpmc_a0.gpio1_28, INPUT | PULLDIS | MODE7 */\r\n\t\t\t\t>;\r\n\t\t\t};\r\n\t\t};\r\n\t};\r\n\r\n\tfragment@2 {\r\n\t\ttarget = <&ocp>;\r\n\t\t__overlay__ {\r\n\t\t\tpps {\r\n\t\t\t\tcompatible = \"pps-gpio\";\r\n\t\t\t\tstatus = \"okay\";\r\n\t\t\t\tpinctrl-names = \"default\";\r\n\t\t\t\tpinctrl-0 = <&pps_pins>;\r\n\r\n\t\t\t\tgpios = <&gpio1 28 0>; /*really gpio1!*/\r\n\t\t\t\tassert-falling-edge;\r\n\t\t\t};\r\n\t\t};\r\n\t};\r\n};\r\n\r\n```\r\n\r\nThe above is based largely on http://mythopoeic.org/BBG-NTP/NF3H-PPS-00A0.dts. I took note that [mythopoeic.org] mentioned:\r\n\r\n> Apparently at some point in the past, the kernel PPS driver used one-based numbering for the GPIO bank, while everything else used zero-based numbering. For example, you'd use \"gpio1_28\" in the reservations, but \"gpio2 28 0\" in the gpios clause for the PPS driver. In the 4.x kernels, that is no longer the case; everything uses zero-based numbering. Much less confusing -- unless you're looking at examples that use the old method.)\r\n\r\nSo I therefore used the same approach; i.e. zero-based numbering for all variables. I compiled it and copied it to /lib/firmware:\r\n\r\ndtc -O dtb -o BB-PPS-P9_12-00A0.dtbo -b 0 -@ BB-PPS-P9_12-00A0.dts\r\nsudo cp BB-PPS-P9_12-00A0.dtbo /lib/firmware/BB-PPS-P9_12-00A0.dtbo\r\n\r\nI then added it to the list of custom capes, as follows:\r\nuboot_overlay_addr5=/lib/firmware/BB-PPS-P9_12-00A0.dtbo\r\n\r\nWhen I reboot the BBB, I get the following errors:\r\n\r\n dmesg | grep pps\r\n[    0.613866] pps_core: LinuxPPS API ver. 1 registered\r\n[    0.613874] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>\r\n[   29.974000] pinctrl-single 44e10800.pinmux: pin PIN30 already requested by ocp:P9_12_pinmux; cannot claim for ocp:pps\r\n[   30.025884] pinctrl-single 44e10800.pinmux: pin-30 (ocp:pps) status -22\r\n[   30.065959] pinctrl-single 44e10800.pinmux: could not request pin 30 (PIN30) from group pinmux_pps_pins  on device pinctrl-single\r\n[   30.142863] pps-gpio ocp:pps: Error applying setting, reverse things back\r\n[   30.180262] pps-gpio: probe of ocp:pps failed with error -22\r\n\r\nI have not added any other cape overlays at this point but as I understand from the above, my overlay is interfering with an existing one. I understand that an \"universal cape overlay\" is automatically added, making it possible to control all GPIO (including the PIN30). At first, I thought that could be interfering with my overlay so I set on to disable it. But what is the correct way to handle pins overlapping with the universal cape overlay? Do you disable it completely? If so, how is that done correctly?\r\n\r\nI tried setting the \"enable_uboot_cape_universal=0\" in \"/boot/uEnv.txt\", but it does not make any difference. I still get the exact same error message. \r\n\r\nOn http://mythopoeic.org/beaglebone-green-time-server/, it is mentioned that you can remove \" cape_universal=enable\" from the cmdline in \"/boot/uEnv.txt\". As my cmdline does not contain cape_universal, I tried adding cape_universal=disable instead, although that did not make any difference either..\r\n\r\nI hope this post is not too irrelevant. Most of the information I have been able to find regarding PPS on BBB is quite old by now."},"comment":{"url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/comments/411309316","html_url":"https://github.com/beagleboard/bb.org-overlays/issues/91#issuecomment-411309316","issue_url":"https://api.github.com/repos/beagleboard/bb.org-overlays/issues/91","id":411309316,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTMwOTMxNg==","user":{"login":"tehkillerbee","id":815886,"node_id":"MDQ6VXNlcjgxNTg4Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/815886?v=4","gravatar_id":"","url":"https://api.github.com/users/tehkillerbee","html_url":"https://github.com/tehkillerbee","followers_url":"https://api.github.com/users/tehkillerbee/followers","following_url":"https://api.github.com/users/tehkillerbee/following{/other_user}","gists_url":"https://api.github.com/users/tehkillerbee/gists{/gist_id}","starred_url":"https://api.github.com/users/tehkillerbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehkillerbee/subscriptions","organizations_url":"https://api.github.com/users/tehkillerbee/orgs","repos_url":"https://api.github.com/users/tehkillerbee/repos","events_url":"https://api.github.com/users/tehkillerbee/events{/privacy}","received_events_url":"https://api.github.com/users/tehkillerbee/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T07:11:08Z","updated_at":"2018-08-08T07:11:08Z","author_association":"NONE","body":"Brilliant! I was previously using some older .dts files as reference when setting up the PPS, so I never realized that it is necessary to perform pinmux disable. After looking into the latest .dts sources in this repository (https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm), it makes good sense.\r\n\r\nThank you very much, naturally the PPS works now (Both on P9_12 and P9_15):\r\ndebian@beaglebone:~$ dmesg | grep pps\r\n[    0.613860] pps_core: LinuxPPS API ver. 1 registered\r\n[    0.613868] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>\r\n[   77.655840] pps pps0: new PPS source ocp:pps.-1\r\n[   77.655954] pps pps0: Registered IRQ 108 as PPS source\r\n\r\nI have uploaded both my .dts files as a .zip, in case anyone is interested in them.\r\n\r\n[BB-PPS.zip](https://github.com/beagleboard/bb.org-overlays/files/2269268/BB-PPS.zip)\r\n\r\n\r\n"}}
{"actor":{"display_login":"tehkillerbee"}}