{"action":"created","comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/70506532","id":70506532,"diff_hunk":"@@ -0,0 +1,102 @@\n+/*\n+ * Copyright (c) 2016, Linaro Limited\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice,\n+ * this list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ * this list of conditions and the following disclaimer in the documentation\n+ * and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#include <compiler.h>\n+#include <drivers/pl050.h>\n+#include <util.h>\n+#include <io.h>\n+\n+#define KMI_ICR\t\t0x00\n+#define KMI_STAT\t0x04\n+#define KMI_DATA\t0x08\n+#define KMI_CLKDIV\t0x0c\n+#define KMI_IR\t\t0x10\n+\n+#define KMI_ICR_TYPE\t\t(1 << 5)\n+#define KMI_ICR_RXINTERN\t(1 << 4)\n+#define KMI_ICR_TXINTERN\t(1 << 3)\n+#define KMI_ICR_EN\t\t(1 << 2)\n+#define KMI_ICR_FKMID\t\t(1 << 1)\n+#define KMI_ICR_FKMIC\t\t(1 << 0)\n+\n+#define KMI_STAT_TXEMPTY\t(1 << 6)\n+#define KMI_STAT_TXBUSY\t\t(1 << 5)\n+#define KMI_STAT_RXFULL\t\t(1 << 4)\n+#define KMI_STAT_RXBUSY\t\t(1 << 3)\n+#define KMI_STAT_RXPARITY\t(1 << 2)\n+#define KMI_STAT_KMIC\t\t(1 << 1)\n+#define KMI_STAT_KMID\t\t(1 << 0)\n+\n+#define KMI_IR_TXINTR\t\t(1 << 1)\n+#define KMI_IR_RXINTR\t\t(1 << 0)\n+\n+static bool pl050_have_rx_data(struct serial_chip *chip)\n+{\n+\tstruct pl050_data *pd = container_of(chip, struct pl050_data, chip);\n+\n+\treturn !!(read8(pd->base + KMI_STAT) & KMI_STAT_RXFULL);\n+}\n+\n+static int pl050_getchar(struct serial_chip *chip)\n+{\n+\tstruct pl050_data *pd = container_of(chip, struct pl050_data, chip);\n+\n+\twhile (!pl050_have_rx_data(chip))\n+\t\t;\n+\treturn read8(pd->base + KMI_DATA);\n+}\n+\n+static void pl050_flush(struct serial_chip *chip)\n+{\n+\tstruct pl050_data *pd = container_of(chip, struct pl050_data, chip);\n+\n+\twhile (!(read8(pd->base + KMI_STAT) & KMI_STAT_TXEMPTY))\n+\t\t;\n+}\n+\n+static void pl050_putc(struct serial_chip *chip, int ch)\n+{\n+\tstruct pl050_data *pd = container_of(chip, struct pl050_data, chip);\n+\n+\tpl050_flush(chip);\n+\twrite8(ch, pd->base + KMI_DATA);\n+}\n+\n+static const struct serial_ops pl050_ops = {\n+\t.putc = pl050_putc,\n+\t.flush = pl050_flush,\n+\t.have_rx_data = pl050_have_rx_data,\n+\t.getchar = pl050_getchar,\n+};\n+\n+void pl050_init(struct pl050_data *pd, vaddr_t base, uint32_t clk)\n+{\n+\tpd->base = base;\n+\tpd->chip.ops = &pl050_ops;\n+\n+\twrite8(KMI_ICR_RXINTERN | KMI_ICR_EN ,pd->base + KMI_ICR);","path":"core/drivers/pl050.c","position":100,"original_position":100,"commit_id":"65bc1910ffac1e051ade5df46c8810225307bb69","original_commit_id":"65bc1910ffac1e051ade5df46c8810225307bb69","user":{"login":"etiennec-linaro","id":19990310,"avatar_url":"https://avatars.githubusercontent.com/u/19990310?v=3","gravatar_id":"","url":"https://api.github.com/users/etiennec-linaro","html_url":"https://github.com/etiennec-linaro","followers_url":"https://api.github.com/users/etiennec-linaro/followers","following_url":"https://api.github.com/users/etiennec-linaro/following{/other_user}","gists_url":"https://api.github.com/users/etiennec-linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/etiennec-linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etiennec-linaro/subscriptions","organizations_url":"https://api.github.com/users/etiennec-linaro/orgs","repos_url":"https://api.github.com/users/etiennec-linaro/repos","events_url":"https://api.github.com/users/etiennec-linaro/events{/privacy}","received_events_url":"https://api.github.com/users/etiennec-linaro/received_events","type":"User","site_admin":false},"body":"minor : misplaced space ","created_at":"2016-07-12T19:35:00Z","updated_at":"2016-07-12T19:35:00Z","html_url":"https://github.com/OP-TEE/optee_os/pull/898#discussion_r70506532","pull_request_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898","_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/70506532"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/898#discussion_r70506532"},"pull_request":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898"}}},"pull_request":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898","id":76263935,"html_url":"https://github.com/OP-TEE/optee_os/pull/898","diff_url":"https://github.com/OP-TEE/optee_os/pull/898.diff","patch_url":"https://github.com/OP-TEE/optee_os/pull/898.patch","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/898","number":898,"state":"open","locked":false,"title":"Tui drivers","user":{"login":"jenswi-linaro","id":6150306,"avatar_url":"https://avatars.githubusercontent.com/u/6150306?v=3","gravatar_id":"","url":"https://api.github.com/users/jenswi-linaro","html_url":"https://github.com/jenswi-linaro","followers_url":"https://api.github.com/users/jenswi-linaro/followers","following_url":"https://api.github.com/users/jenswi-linaro/following{/other_user}","gists_url":"https://api.github.com/users/jenswi-linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/jenswi-linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenswi-linaro/subscriptions","organizations_url":"https://api.github.com/users/jenswi-linaro/orgs","repos_url":"https://api.github.com/users/jenswi-linaro/repos","events_url":"https://api.github.com/users/jenswi-linaro/events{/privacy}","received_events_url":"https://api.github.com/users/jenswi-linaro/received_events","type":"User","site_admin":false},"body":"Drivers needed by Trusted UI","created_at":"2016-07-05T12:17:17Z","updated_at":"2016-07-12T19:35:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90741336af0d6da622153c90e780169ad7fa315c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898/commits","review_comments_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898/comments","review_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/898/comments","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/65bc1910ffac1e051ade5df46c8810225307bb69","head":{"label":"jenswi-linaro:tui_drivers","ref":"tui_drivers","sha":"65bc1910ffac1e051ade5df46c8810225307bb69","user":{"login":"jenswi-linaro","id":6150306,"avatar_url":"https://avatars.githubusercontent.com/u/6150306?v=3","gravatar_id":"","url":"https://api.github.com/users/jenswi-linaro","html_url":"https://github.com/jenswi-linaro","followers_url":"https://api.github.com/users/jenswi-linaro/followers","following_url":"https://api.github.com/users/jenswi-linaro/following{/other_user}","gists_url":"https://api.github.com/users/jenswi-linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/jenswi-linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenswi-linaro/subscriptions","organizations_url":"https://api.github.com/users/jenswi-linaro/orgs","repos_url":"https://api.github.com/users/jenswi-linaro/repos","events_url":"https://api.github.com/users/jenswi-linaro/events{/privacy}","received_events_url":"https://api.github.com/users/jenswi-linaro/received_events","type":"User","site_admin":false},"repo":{"id":20770355,"name":"optee_os","full_name":"jenswi-linaro/optee_os","owner":{"login":"jenswi-linaro","id":6150306,"avatar_url":"https://avatars.githubusercontent.com/u/6150306?v=3","gravatar_id":"","url":"https://api.github.com/users/jenswi-linaro","html_url":"https://github.com/jenswi-linaro","followers_url":"https://api.github.com/users/jenswi-linaro/followers","following_url":"https://api.github.com/users/jenswi-linaro/following{/other_user}","gists_url":"https://api.github.com/users/jenswi-linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/jenswi-linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenswi-linaro/subscriptions","organizations_url":"https://api.github.com/users/jenswi-linaro/orgs","repos_url":"https://api.github.com/users/jenswi-linaro/repos","events_url":"https://api.github.com/users/jenswi-linaro/events{/privacy}","received_events_url":"https://api.github.com/users/jenswi-linaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jenswi-linaro/optee_os","description":"Trusted side of the TEE","fork":true,"url":"https://api.github.com/repos/jenswi-linaro/optee_os","forks_url":"https://api.github.com/repos/jenswi-linaro/optee_os/forks","keys_url":"https://api.github.com/repos/jenswi-linaro/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenswi-linaro/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenswi-linaro/optee_os/teams","hooks_url":"https://api.github.com/repos/jenswi-linaro/optee_os/hooks","issue_events_url":"https://api.github.com/repos/jenswi-linaro/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/jenswi-linaro/optee_os/events","assignees_url":"https://api.github.com/repos/jenswi-linaro/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/jenswi-linaro/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/jenswi-linaro/optee_os/tags","blobs_url":"https://api.github.com/repos/jenswi-linaro/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenswi-linaro/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenswi-linaro/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenswi-linaro/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenswi-linaro/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/jenswi-linaro/optee_os/languages","stargazers_url":"https://api.github.com/repos/jenswi-linaro/optee_os/stargazers","contributors_url":"https://api.github.com/repos/jenswi-linaro/optee_os/contributors","subscribers_url":"https://api.github.com/repos/jenswi-linaro/optee_os/subscribers","subscription_url":"https://api.github.com/repos/jenswi-linaro/optee_os/subscription","commits_url":"https://api.github.com/repos/jenswi-linaro/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenswi-linaro/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenswi-linaro/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenswi-linaro/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenswi-linaro/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/jenswi-linaro/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenswi-linaro/optee_os/merges","archive_url":"https://api.github.com/repos/jenswi-linaro/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenswi-linaro/optee_os/downloads","issues_url":"https://api.github.com/repos/jenswi-linaro/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/jenswi-linaro/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/jenswi-linaro/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/jenswi-linaro/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenswi-linaro/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/jenswi-linaro/optee_os/releases{/id}","deployments_url":"https://api.github.com/repos/jenswi-linaro/optee_os/deployments","created_at":"2014-06-12T14:26:39Z","updated_at":"2016-01-15T08:39:54Z","pushed_at":"2016-07-07T13:41:12Z","git_url":"git://github.com/jenswi-linaro/optee_os.git","ssh_url":"git@github.com:jenswi-linaro/optee_os.git","clone_url":"https://github.com/jenswi-linaro/optee_os.git","svn_url":"https://github.com/jenswi-linaro/optee_os","homepage":null,"size":6342,"stargazers_count":0,"watchers_count":0,"language":"C","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":"OP-TEE:master","ref":"master","sha":"14ed32748f7d915493e31dbf01664c119fad91c6","user":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"repo":{"id":20193261,"name":"optee_os","full_name":"OP-TEE/optee_os","owner":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OP-TEE/optee_os","description":"Trusted side of the TEE","fork":false,"url":"https://api.github.com/repos/OP-TEE/optee_os","forks_url":"https://api.github.com/repos/OP-TEE/optee_os/forks","keys_url":"https://api.github.com/repos/OP-TEE/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OP-TEE/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OP-TEE/optee_os/teams","hooks_url":"https://api.github.com/repos/OP-TEE/optee_os/hooks","issue_events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/OP-TEE/optee_os/events","assignees_url":"https://api.github.com/repos/OP-TEE/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/OP-TEE/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/OP-TEE/optee_os/tags","blobs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OP-TEE/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/OP-TEE/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/OP-TEE/optee_os/languages","stargazers_url":"https://api.github.com/repos/OP-TEE/optee_os/stargazers","contributors_url":"https://api.github.com/repos/OP-TEE/optee_os/contributors","subscribers_url":"https://api.github.com/repos/OP-TEE/optee_os/subscribers","subscription_url":"https://api.github.com/repos/OP-TEE/optee_os/subscription","commits_url":"https://api.github.com/repos/OP-TEE/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/OP-TEE/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/OP-TEE/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/OP-TEE/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OP-TEE/optee_os/merges","archive_url":"https://api.github.com/repos/OP-TEE/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OP-TEE/optee_os/downloads","issues_url":"https://api.github.com/repos/OP-TEE/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/OP-TEE/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/OP-TEE/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/OP-TEE/optee_os/releases{/id}","deployments_url":"https://api.github.com/repos/OP-TEE/optee_os/deployments","created_at":"2014-05-26T17:18:57Z","updated_at":"2016-07-11T11:00:37Z","pushed_at":"2016-07-12T15:24:14Z","git_url":"git://github.com/OP-TEE/optee_os.git","ssh_url":"git@github.com:OP-TEE/optee_os.git","clone_url":"https://github.com/OP-TEE/optee_os.git","svn_url":"https://github.com/OP-TEE/optee_os","homepage":null,"size":10587,"stargazers_count":133,"watchers_count":133,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":34,"forks":137,"open_issues":34,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/898"},"issue":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/898"},"comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/898/comments"},"review_comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898/comments"},"review_comment":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/898/commits"},"statuses":{"href":"https://api.github.com/repos/OP-TEE/optee_os/statuses/65bc1910ffac1e051ade5df46c8810225307bb69"}}}}
{"actor":{"display_login":"etiennec-linaro"}}