{"action":"created","comment":{"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments/64541595","id":64541595,"diff_hunk":"@@ -0,0 +1,111 @@\n+/*\n+ * Copyright (c) 2016, ARM Limited and Contributors. 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+ * Redistributions of source code must retain the above copyright notice, this\n+ * list of conditions and the following disclaimer.\n+ *\n+ * 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+ * Neither the name of ARM nor the names of its contributors may be used\n+ * to endorse or promote products derived from this software without specific\n+ * prior written permission.\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+\n+#include <stdint.h>\n+#include <arch_helpers.h>\n+#include <mmio.h>\n+#include <mt_cpuxgpt.h>\n+#include <stdint.h>\n+#include <platform.h>\n+#include <debug.h>\n+#define CPUXGPT_BASE\t0x10200000\n+#define INDEX_BASE\t\t(CPUXGPT_BASE+0x0674)\n+#define CTL_BASE\t\t(CPUXGPT_BASE+0x0670)\n+\n+uint64_t normal_time_base;\n+uint64_t atf_time_base;\n+\n+static void __write_cpuxgpt(unsigned int reg_index, unsigned int value)\n+{\n+\tmmio_write_32(INDEX_BASE, reg_index);\n+\tmmio_write_32(CTL_BASE, value);\n+}\n+\n+static void __cpuxgpt_set_init_cnt(unsigned int countH, unsigned int countL)\n+{\n+\t__write_cpuxgpt(INDEX_CNT_H_INIT, countH);\n+\t/* update count when countL programmed */\n+\t__write_cpuxgpt(INDEX_CNT_L_INIT, countL);\n+}\n+\n+void generic_timer_backup(void)\n+{\n+\tuint64_t cval;\n+\n+\tcval = read_cntpct_el0();\n+\t__cpuxgpt_set_init_cnt((uint32_t)(cval >> 32),\n+\t\t(uint32_t)(cval & 0xffffffff));\n+}\n+\n+void sched_clock_init(uint64_t normal_base, uint64_t atf_base)\n+{\n+\tnormal_time_base = normal_base;\n+\tatf_time_base = atf_base;\n+}\n+\n+uint64_t sched_clock(void)\n+{\n+\tuint64_t cval;\n+\n+\tcval = (((read_cntpct_el0() - atf_time_base)*1000)/13)","path":"plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c","position":77,"original_position":77,"commit_id":"6e060ab7395a9a925927c311a1046e6c02aa8924","original_commit_id":"6e060ab7395a9a925927c311a1046e6c02aa8924","user":{"login":"danh-arm","id":5684642,"avatar_url":"https://avatars.githubusercontent.com/u/5684642?v=3","gravatar_id":"","url":"https://api.github.com/users/danh-arm","html_url":"https://github.com/danh-arm","followers_url":"https://api.github.com/users/danh-arm/followers","following_url":"https://api.github.com/users/danh-arm/following{/other_user}","gists_url":"https://api.github.com/users/danh-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/danh-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danh-arm/subscriptions","organizations_url":"https://api.github.com/users/danh-arm/orgs","repos_url":"https://api.github.com/users/danh-arm/repos","events_url":"https://api.github.com/users/danh-arm/events{/privacy}","received_events_url":"https://api.github.com/users/danh-arm/received_events","type":"User","site_admin":false},"body":"Better to not use frequency magic numbers, Can you not use SYS_COUNTER_FREQ_IN_TICKS?","created_at":"2016-05-25T09:25:43Z","updated_at":"2016-05-25T09:25:43Z","html_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/631#discussion_r64541595","pull_request_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631","_links":{"self":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments/64541595"},"html":{"href":"https://github.com/ARM-software/arm-trusted-firmware/pull/631#discussion_r64541595"},"pull_request":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631"}}},"pull_request":{"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631","id":71348072,"html_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/631","diff_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/631.diff","patch_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/631.patch","issue_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/631","number":631,"state":"open","locked":false,"title":"Support for Mediatek MT6795 SoC","user":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"body":"This patch only support single core to boot to Linux kernel\r\nthrough Trusted Firmware.\r\nIt also support 32 bit kernel and 64 bit kernel booting.\r\nSMP and hotplug patch will be available for later SoC.\r\n\r\nSigned-off-by: Leon Chen <leon.chen@mediatek.com>","created_at":"2016-05-25T08:20:02Z","updated_at":"2016-05-25T09:25:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e533021ad313d9a0f94191b8a2721f6ab8dfbf6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631/commits","review_comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631/comments","review_comment_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/631/comments","statuses_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/6e060ab7395a9a925927c311a1046e6c02aa8924","head":{"label":"leon-chen-mtk:mt6795_1","ref":"mt6795_1","sha":"6e060ab7395a9a925927c311a1046e6c02aa8924","user":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"repo":{"id":59575706,"name":"arm-trusted-firmware","full_name":"leon-chen-mtk/arm-trusted-firmware","owner":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware","description":"ARM Trusted Firmware","fork":true,"url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware","forks_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/forks","keys_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/teams","hooks_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/hooks","issue_events_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/events","assignees_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/tags","blobs_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/languages","stargazers_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/stargazers","contributors_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/contributors","subscribers_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/subscribers","subscription_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/subscription","commits_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/merges","archive_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/downloads","issues_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/labels{/name}","releases_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/deployments","created_at":"2016-05-24T13:30:58Z","updated_at":"2016-05-24T13:31:01Z","pushed_at":"2016-05-25T08:14:39Z","git_url":"git://github.com/leon-chen-mtk/arm-trusted-firmware.git","ssh_url":"git@github.com:leon-chen-mtk/arm-trusted-firmware.git","clone_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware.git","svn_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware","homepage":null,"size":6717,"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":"ARM-software:integration","ref":"integration","sha":"e141aa0357fd4977ba874f4f86874e2cadc73498","user":{"login":"ARM-software","id":5690313,"avatar_url":"https://avatars.githubusercontent.com/u/5690313?v=3","gravatar_id":"","url":"https://api.github.com/users/ARM-software","html_url":"https://github.com/ARM-software","followers_url":"https://api.github.com/users/ARM-software/followers","following_url":"https://api.github.com/users/ARM-software/following{/other_user}","gists_url":"https://api.github.com/users/ARM-software/gists{/gist_id}","starred_url":"https://api.github.com/users/ARM-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARM-software/subscriptions","organizations_url":"https://api.github.com/users/ARM-software/orgs","repos_url":"https://api.github.com/users/ARM-software/repos","events_url":"https://api.github.com/users/ARM-software/events{/privacy}","received_events_url":"https://api.github.com/users/ARM-software/received_events","type":"Organization","site_admin":false},"repo":{"id":13740589,"name":"arm-trusted-firmware","full_name":"ARM-software/arm-trusted-firmware","owner":{"login":"ARM-software","id":5690313,"avatar_url":"https://avatars.githubusercontent.com/u/5690313?v=3","gravatar_id":"","url":"https://api.github.com/users/ARM-software","html_url":"https://github.com/ARM-software","followers_url":"https://api.github.com/users/ARM-software/followers","following_url":"https://api.github.com/users/ARM-software/following{/other_user}","gists_url":"https://api.github.com/users/ARM-software/gists{/gist_id}","starred_url":"https://api.github.com/users/ARM-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARM-software/subscriptions","organizations_url":"https://api.github.com/users/ARM-software/orgs","repos_url":"https://api.github.com/users/ARM-software/repos","events_url":"https://api.github.com/users/ARM-software/events{/privacy}","received_events_url":"https://api.github.com/users/ARM-software/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARM-software/arm-trusted-firmware","description":"ARM Trusted Firmware","fork":false,"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware","forks_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/forks","keys_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/teams","hooks_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/hooks","issue_events_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/events","assignees_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/tags","blobs_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/languages","stargazers_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/stargazers","contributors_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/contributors","subscribers_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/subscribers","subscription_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/subscription","commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/merges","archive_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/downloads","issues_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/labels{/name}","releases_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/deployments","created_at":"2013-10-21T11:39:00Z","updated_at":"2016-05-17T13:28:05Z","pushed_at":"2016-05-25T09:11:01Z","git_url":"git://github.com/ARM-software/arm-trusted-firmware.git","ssh_url":"git@github.com:ARM-software/arm-trusted-firmware.git","clone_url":"https://github.com/ARM-software/arm-trusted-firmware.git","svn_url":"https://github.com/ARM-software/arm-trusted-firmware","homepage":null,"size":9100,"stargazers_count":178,"watchers_count":178,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":180,"mirror_url":null,"open_issues_count":8,"forks":180,"open_issues":8,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631"},"html":{"href":"https://github.com/ARM-software/arm-trusted-firmware/pull/631"},"issue":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/631"},"comments":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/631/comments"},"review_comments":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631/comments"},"review_comment":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/631/commits"},"statuses":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/6e060ab7395a9a925927c311a1046e6c02aa8924"}}}}
{"actor":{"display_login":"danh-arm"}}