{"action":"created","comment":{"url":"https://api.github.com/repos/maruel/dlibox/pulls/comments/80378654","id":80378654,"diff_hunk":"@@ -908,19 +1088,40 @@ var mapping = [116][5]string{\n // Defaults to 0x01C20800 as per datasheet if could query the file system.\n func getBaseAddressPB() uint64 {\n \tbase := uint64(0x01C20800)\n+\n+\t// try the way it looks on pine64 first (Debian ??)\n \tlink, err := os.Readlink(\"/sys/bus/platform/drivers/sun50i-pinctrl/driver\")\n-\tif err != nil {\n-\t\treturn base\n-\t}\n-\tparts := strings.SplitN(path.Base(link), \".\", 2)\n-\tif len(parts) != 2 {\n-\t\treturn base\n+\tif err == nil {\n+\t\tparts := strings.SplitN(path.Base(link), \".\", 2)\n+\t\tif len(parts) != 2 {\n+\t\t\treturn base\n+\t\t}\n+\t\tbase2, err := strconv.ParseUint(parts[0], 16, 64)\n+\t\tif err != nil {\n+\t\t\treturn base\n+\t\t}\n+\t\treturn base2\n \t}\n-\tbase2, err := strconv.ParseUint(parts[0], 16, 64)\n-\tif err != nil {\n-\t\treturn base\n+\n+\t// next try the way it looks on C.H.I.P. (Debian wheezy)\n+\t// note that CHIP's r8 is a repackaging of the a13\n+\titems, _ := ioutil.ReadDir(\"/sys/bus/platform/drivers/sun5i-a13-pinctrl/\")","path":"go/pio/host/allwinner/allwinner.go","position":393,"original_position":393,"commit_id":"c55dd99c7809cc53fa03d749efd7a7692389c49c","original_commit_id":"c55dd99c7809cc53fa03d749efd7a7692389c49c","user":{"login":"maruel","id":75011,"avatar_url":"https://avatars.githubusercontent.com/u/75011?v=3","gravatar_id":"","url":"https://api.github.com/users/maruel","html_url":"https://github.com/maruel","followers_url":"https://api.github.com/users/maruel/followers","following_url":"https://api.github.com/users/maruel/following{/other_user}","gists_url":"https://api.github.com/users/maruel/gists{/gist_id}","starred_url":"https://api.github.com/users/maruel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maruel/subscriptions","organizations_url":"https://api.github.com/users/maruel/orgs","repos_url":"https://api.github.com/users/maruel/repos","events_url":"https://api.github.com/users/maruel/events{/privacy}","received_events_url":"https://api.github.com/users/maruel/received_events","type":"User","site_admin":false},"body":"I mean side effects on sysyfs population from loaded kernel module.","created_at":"2016-09-25T10:20:41Z","updated_at":"2016-09-25T10:33:53Z","html_url":"https://github.com/maruel/dlibox/pull/3#discussion_r80378654","pull_request_url":"https://api.github.com/repos/maruel/dlibox/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/comments/80378654"},"html":{"href":"https://github.com/maruel/dlibox/pull/3#discussion_r80378654"},"pull_request":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/maruel/dlibox/pulls/3","id":86632321,"html_url":"https://github.com/maruel/dlibox/pull/3","diff_url":"https://github.com/maruel/dlibox/pull/3.diff","patch_url":"https://github.com/maruel/dlibox/pull/3.patch","issue_url":"https://api.github.com/repos/maruel/dlibox/issues/3","number":3,"state":"open","locked":false,"title":"add support for C.H.I.P.","user":{"login":"tve","id":39480,"avatar_url":"https://avatars.githubusercontent.com/u/39480?v=3","gravatar_id":"","url":"https://api.github.com/users/tve","html_url":"https://github.com/tve","followers_url":"https://api.github.com/users/tve/followers","following_url":"https://api.github.com/users/tve/following{/other_user}","gists_url":"https://api.github.com/users/tve/gists{/gist_id}","starred_url":"https://api.github.com/users/tve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tve/subscriptions","organizations_url":"https://api.github.com/users/tve/orgs","repos_url":"https://api.github.com/users/tve/repos","events_url":"https://api.github.com/users/tve/events{/privacy}","received_events_url":"https://api.github.com/users/tve/received_events","type":"User","site_admin":false},"body":"This PR primarily adds support for NextThing Co's CHIP.\r\nIt fixes some minor bugs in the pine64 header pins and in the parsing of /etc/os-release.\r\nThe Allwinner R8 has some pins that the A64 doesn't have, I added these at the end. It wasn't clear to me whether the pin numbers had any meaning outside of matching up the Pins table with the mapping table. I can renumber so it's all sorted if that's OK.\r\nThe detection for A64 vs R8 is crap. I spent quite some time looking into cpu_info and other stuff and have come out empty-handed. As far as I can tell the detection has to be driven by the device tree on ARM processors. In the DTS for CHIP it says:\r\n```\r\n        model = \"NextThing C.H.I.P.\";\r\n        compatible = \"nextthing,chip\", \"allwinner,sun5i-r8\";\r\n```\r\nI have the faint hope that the `compatible` values end up somewhere that is accessible from user-space...","created_at":"2016-09-24T22:06:46Z","updated_at":"2016-09-25T10:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbbc16109210d2a1fbdddcbe16ffe1fe94429997","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/maruel/dlibox/pulls/3/commits","review_comments_url":"https://api.github.com/repos/maruel/dlibox/pulls/3/comments","review_comment_url":"https://api.github.com/repos/maruel/dlibox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maruel/dlibox/issues/3/comments","statuses_url":"https://api.github.com/repos/maruel/dlibox/statuses/c55dd99c7809cc53fa03d749efd7a7692389c49c","head":{"label":"tve:chip","ref":"chip","sha":"c55dd99c7809cc53fa03d749efd7a7692389c49c","user":{"login":"tve","id":39480,"avatar_url":"https://avatars.githubusercontent.com/u/39480?v=3","gravatar_id":"","url":"https://api.github.com/users/tve","html_url":"https://github.com/tve","followers_url":"https://api.github.com/users/tve/followers","following_url":"https://api.github.com/users/tve/following{/other_user}","gists_url":"https://api.github.com/users/tve/gists{/gist_id}","starred_url":"https://api.github.com/users/tve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tve/subscriptions","organizations_url":"https://api.github.com/users/tve/orgs","repos_url":"https://api.github.com/users/tve/repos","events_url":"https://api.github.com/users/tve/events{/privacy}","received_events_url":"https://api.github.com/users/tve/received_events","type":"User","site_admin":false},"repo":{"id":69085869,"name":"dlibox","full_name":"tve/dlibox","owner":{"login":"tve","id":39480,"avatar_url":"https://avatars.githubusercontent.com/u/39480?v=3","gravatar_id":"","url":"https://api.github.com/users/tve","html_url":"https://github.com/tve","followers_url":"https://api.github.com/users/tve/followers","following_url":"https://api.github.com/users/tve/following{/other_user}","gists_url":"https://api.github.com/users/tve/gists{/gist_id}","starred_url":"https://api.github.com/users/tve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tve/subscriptions","organizations_url":"https://api.github.com/users/tve/orgs","repos_url":"https://api.github.com/users/tve/repos","events_url":"https://api.github.com/users/tve/events{/privacy}","received_events_url":"https://api.github.com/users/tve/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tve/dlibox","description":"Drives APA102 LED strips via a Raspberry Pi in Golang or ESP8266 in C++","fork":true,"url":"https://api.github.com/repos/tve/dlibox","forks_url":"https://api.github.com/repos/tve/dlibox/forks","keys_url":"https://api.github.com/repos/tve/dlibox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tve/dlibox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tve/dlibox/teams","hooks_url":"https://api.github.com/repos/tve/dlibox/hooks","issue_events_url":"https://api.github.com/repos/tve/dlibox/issues/events{/number}","events_url":"https://api.github.com/repos/tve/dlibox/events","assignees_url":"https://api.github.com/repos/tve/dlibox/assignees{/user}","branches_url":"https://api.github.com/repos/tve/dlibox/branches{/branch}","tags_url":"https://api.github.com/repos/tve/dlibox/tags","blobs_url":"https://api.github.com/repos/tve/dlibox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tve/dlibox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tve/dlibox/git/refs{/sha}","trees_url":"https://api.github.com/repos/tve/dlibox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tve/dlibox/statuses/{sha}","languages_url":"https://api.github.com/repos/tve/dlibox/languages","stargazers_url":"https://api.github.com/repos/tve/dlibox/stargazers","contributors_url":"https://api.github.com/repos/tve/dlibox/contributors","subscribers_url":"https://api.github.com/repos/tve/dlibox/subscribers","subscription_url":"https://api.github.com/repos/tve/dlibox/subscription","commits_url":"https://api.github.com/repos/tve/dlibox/commits{/sha}","git_commits_url":"https://api.github.com/repos/tve/dlibox/git/commits{/sha}","comments_url":"https://api.github.com/repos/tve/dlibox/comments{/number}","issue_comment_url":"https://api.github.com/repos/tve/dlibox/issues/comments{/number}","contents_url":"https://api.github.com/repos/tve/dlibox/contents/{+path}","compare_url":"https://api.github.com/repos/tve/dlibox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tve/dlibox/merges","archive_url":"https://api.github.com/repos/tve/dlibox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tve/dlibox/downloads","issues_url":"https://api.github.com/repos/tve/dlibox/issues{/number}","pulls_url":"https://api.github.com/repos/tve/dlibox/pulls{/number}","milestones_url":"https://api.github.com/repos/tve/dlibox/milestones{/number}","notifications_url":"https://api.github.com/repos/tve/dlibox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tve/dlibox/labels{/name}","releases_url":"https://api.github.com/repos/tve/dlibox/releases{/id}","deployments_url":"https://api.github.com/repos/tve/dlibox/deployments","created_at":"2016-09-24T06:51:40Z","updated_at":"2016-09-24T06:51:41Z","pushed_at":"2016-09-25T04:27:10Z","git_url":"git://github.com/tve/dlibox.git","ssh_url":"git@github.com:tve/dlibox.git","clone_url":"https://github.com/tve/dlibox.git","svn_url":"https://github.com/tve/dlibox","homepage":"http://www.dlibox.com","size":1208,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"maruel:master","ref":"master","sha":"3158fc6ff6f93ecc016b918c7d15f16532073b37","user":{"login":"maruel","id":75011,"avatar_url":"https://avatars.githubusercontent.com/u/75011?v=3","gravatar_id":"","url":"https://api.github.com/users/maruel","html_url":"https://github.com/maruel","followers_url":"https://api.github.com/users/maruel/followers","following_url":"https://api.github.com/users/maruel/following{/other_user}","gists_url":"https://api.github.com/users/maruel/gists{/gist_id}","starred_url":"https://api.github.com/users/maruel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maruel/subscriptions","organizations_url":"https://api.github.com/users/maruel/orgs","repos_url":"https://api.github.com/users/maruel/repos","events_url":"https://api.github.com/users/maruel/events{/privacy}","received_events_url":"https://api.github.com/users/maruel/received_events","type":"User","site_admin":false},"repo":{"id":52384925,"name":"dlibox","full_name":"maruel/dlibox","owner":{"login":"maruel","id":75011,"avatar_url":"https://avatars.githubusercontent.com/u/75011?v=3","gravatar_id":"","url":"https://api.github.com/users/maruel","html_url":"https://github.com/maruel","followers_url":"https://api.github.com/users/maruel/followers","following_url":"https://api.github.com/users/maruel/following{/other_user}","gists_url":"https://api.github.com/users/maruel/gists{/gist_id}","starred_url":"https://api.github.com/users/maruel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maruel/subscriptions","organizations_url":"https://api.github.com/users/maruel/orgs","repos_url":"https://api.github.com/users/maruel/repos","events_url":"https://api.github.com/users/maruel/events{/privacy}","received_events_url":"https://api.github.com/users/maruel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maruel/dlibox","description":"Drives APA102 LED strips via a Raspberry Pi in Golang or ESP8266 in C++","fork":false,"url":"https://api.github.com/repos/maruel/dlibox","forks_url":"https://api.github.com/repos/maruel/dlibox/forks","keys_url":"https://api.github.com/repos/maruel/dlibox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maruel/dlibox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maruel/dlibox/teams","hooks_url":"https://api.github.com/repos/maruel/dlibox/hooks","issue_events_url":"https://api.github.com/repos/maruel/dlibox/issues/events{/number}","events_url":"https://api.github.com/repos/maruel/dlibox/events","assignees_url":"https://api.github.com/repos/maruel/dlibox/assignees{/user}","branches_url":"https://api.github.com/repos/maruel/dlibox/branches{/branch}","tags_url":"https://api.github.com/repos/maruel/dlibox/tags","blobs_url":"https://api.github.com/repos/maruel/dlibox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maruel/dlibox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maruel/dlibox/git/refs{/sha}","trees_url":"https://api.github.com/repos/maruel/dlibox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maruel/dlibox/statuses/{sha}","languages_url":"https://api.github.com/repos/maruel/dlibox/languages","stargazers_url":"https://api.github.com/repos/maruel/dlibox/stargazers","contributors_url":"https://api.github.com/repos/maruel/dlibox/contributors","subscribers_url":"https://api.github.com/repos/maruel/dlibox/subscribers","subscription_url":"https://api.github.com/repos/maruel/dlibox/subscription","commits_url":"https://api.github.com/repos/maruel/dlibox/commits{/sha}","git_commits_url":"https://api.github.com/repos/maruel/dlibox/git/commits{/sha}","comments_url":"https://api.github.com/repos/maruel/dlibox/comments{/number}","issue_comment_url":"https://api.github.com/repos/maruel/dlibox/issues/comments{/number}","contents_url":"https://api.github.com/repos/maruel/dlibox/contents/{+path}","compare_url":"https://api.github.com/repos/maruel/dlibox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maruel/dlibox/merges","archive_url":"https://api.github.com/repos/maruel/dlibox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maruel/dlibox/downloads","issues_url":"https://api.github.com/repos/maruel/dlibox/issues{/number}","pulls_url":"https://api.github.com/repos/maruel/dlibox/pulls{/number}","milestones_url":"https://api.github.com/repos/maruel/dlibox/milestones{/number}","notifications_url":"https://api.github.com/repos/maruel/dlibox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maruel/dlibox/labels{/name}","releases_url":"https://api.github.com/repos/maruel/dlibox/releases{/id}","deployments_url":"https://api.github.com/repos/maruel/dlibox/deployments","created_at":"2016-02-23T19:17:24Z","updated_at":"2016-09-20T17:00:02Z","pushed_at":"2016-09-25T04:27:11Z","git_url":"git://github.com/maruel/dlibox.git","ssh_url":"git@github.com:maruel/dlibox.git","clone_url":"https://github.com/maruel/dlibox.git","svn_url":"https://github.com/maruel/dlibox","homepage":"http://www.dlibox.com","size":1178,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/3"},"html":{"href":"https://github.com/maruel/dlibox/pull/3"},"issue":{"href":"https://api.github.com/repos/maruel/dlibox/issues/3"},"comments":{"href":"https://api.github.com/repos/maruel/dlibox/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maruel/dlibox/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/maruel/dlibox/statuses/c55dd99c7809cc53fa03d749efd7a7692389c49c"}}}}
{"actor":{"display_login":"maruel"}}