{"action":"closed","number":2666,"pull_request":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/2666","id":232811314,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyODExMzE0","html_url":"https://github.com/OP-TEE/optee_os/pull/2666","diff_url":"https://github.com/OP-TEE/optee_os/pull/2666.diff","patch_url":"https://github.com/OP-TEE/optee_os/pull/2666.patch","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/2666","number":2666,"state":"closed","locked":false,"title":"Master+optee overlay","user":{"login":"bryanodonoghue","id":12875090,"node_id":"MDQ6VXNlcjEyODc1MDkw","avatar_url":"https://avatars3.githubusercontent.com/u/12875090?v=4","gravatar_id":"","url":"https://api.github.com/users/bryanodonoghue","html_url":"https://github.com/bryanodonoghue","followers_url":"https://api.github.com/users/bryanodonoghue/followers","following_url":"https://api.github.com/users/bryanodonoghue/following{/other_user}","gists_url":"https://api.github.com/users/bryanodonoghue/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanodonoghue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanodonoghue/subscriptions","organizations_url":"https://api.github.com/users/bryanodonoghue/orgs","repos_url":"https://api.github.com/users/bryanodonoghue/repos","events_url":"https://api.github.com/users/bryanodonoghue/events{/privacy}","received_events_url":"https://api.github.com/users/bryanodonoghue/received_events","type":"User","site_admin":false},"body":"This pull request adds the ability for OPTEE to provide a DTB overlay to a subsequent boot stage.\r\nWe can either\r\n\r\n1. Append to an existing DTB overlay located at CFG_DT_ADDR or passed in arg2\r\n2. Generate a new DTB overlay at CFG_DT_ADDR\r\n\r\nProviding a DT overlay means it is possible for OPTEE to provide internal dynamic data without requiring the DTB to already be in-memory.\r\n\r\nHere is an example of merging an OPTEE provided device tree overlay into a main DTB image.\r\n\r\nCFG_DT_ADDR = 0x82000000\r\nCFG_DT_OVERLAY = y\r\n\r\nu-boot:\r\n\r\n=> load mmc 0:1 0x83000000 imx7s-warp.dtb\r\n38564 bytes read in 10 ms (3.7 MiB/s)\r\n=> fdt addr 0x83000000\r\n=> fdt resize 0x1000\r\n\r\n=> fdt print /firmware\r\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\r\n\r\n=> fdt print /psci\r\nlibfdt fdt_path_offset() returned FDT_ERR_NOTFOUND\r\n\r\n=> fdt print /reserved-memory\r\n```\r\nreserved-memory {\r\n        #address-cells = <0x00000001>;\r\n        #size-cells = <0x00000001>;\r\n        ranges;\r\n        linux,cma {\r\n                compatible = \"shared-dma-pool\";\r\n                reusable;\r\n                size = <0x02800000>;\r\n                linux,cma-default;\r\n        };\r\n};\r\n\r\n```\r\nNow merge the DTB overlay @ 0x82000000\r\n\r\n=> fdt apply 0x82000000\r\n=> fdt print /firmware\r\n```\r\nfirmware {\r\n        optee {\r\n                compatible = \"linaro,optee-tz\";\r\n                method = \"smc\";\r\n        };\r\n```\r\n\r\n=> fdt print /psci\r\n```\r\npsci {\r\n        compatible = \"arm,psci-1.0\", \"arm,psci-0.2\", \"arm,psci\";\r\n        method = \"smc\";\r\n        cpu_suspend = <0x84000001>;\r\n        cpu_off = <0x84000002>;\r\n        cpu_on = <0x84000003>;\r\n        sys_poweroff = <0x84000008>;\r\n        sys_reset = <0x84000009>;\r\n};\r\n```\r\n=> fdt print /reserved-memory\r\n```\r\nreserved-memory {\r\n        #address-cells = <0x00000002>;\r\n        #size-cells = <0x00000002>;\r\n        ranges;\r\n        optee@0x9fe00000 {\r\n                reg = <0x00000000 0x9fe00000 0x00000000 0x00200000>;\r\n                no-map;\r\n        };\r\n        linux,cma {\r\n                compatible = \"shared-dma-pool\";\r\n                reusable;\r\n                size = <0x02800000>;\r\n                linux,cma-default;\r\n        };\r\n};\r\n\r\n```\r\nThe raw in-memory OPTEE DTB overlay looks like this:\r\n\r\n=> fdt addr 0x82000000\r\n=> fdt print /\r\n```\r\n/ {\r\n        fragment@2 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        reserved-memory {\r\n                                ranges;\r\n                                #size-cells = <0x00000002>;\r\n                                #address-cells = <0x00000002>;\r\n                                optee@0x9fe00000 {\r\n                                        no-map;\r\n                                        reg = <0x00000000 0x9fe00000 0x00000000 0x00200000>;\r\n                                };\r\n                        };\r\n                };\r\n        };\r\n        fragment@1 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        psci {\r\n                                sys_reset = <0x84000009>;\r\n                                sys_poweroff = <0x84000008>;\r\n                                cpu_on = <0x84000003>;\r\n                                cpu_off = <0x84000002>;\r\n                                cpu_suspend = <0x84000001>;\r\n                                method = \"smc\";\r\n                                compatible = \"arm,psci-1.0\", \"arm,psci-0.2\", \"arm,psci\";\r\n                        };\r\n                };\r\n        };\r\n        fragment@0 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        firmware {\r\n                                optee {\r\n                                        method = \"smc\";\r\n                                        compatible = \"linaro,optee-tz\";\r\n                                };\r\n                        };\r\n                };\r\n        };\r\n};\r\n```\r\nHere is a trivial example of a DTB overlay passed from ATF that has been appended to.\r\n\r\n=> fdt addr 0x82000000\r\n=> fdt print /\r\n```\r\n/ {\r\n        fragment@3 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        reserved-memory {\r\n                                ranges;\r\n                                #size-cells = <0x00000002>;\r\n                                #address-cells = <0x00000002>;\r\n                                optee@0x9fe00000 {\r\n                                        no-map;\r\n                                        reg = <0x00000000 0x9fe00000 0x00000000 0x00200000>;\r\n                                };\r\n                        };\r\n                };\r\n        };\r\n        fragment@2 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        psci {\r\n                                sys_reset = <0x84000009>;\r\n                                sys_poweroff = <0x84000008>;\r\n                                cpu_on = <0x84000003>;\r\n                                cpu_off = <0x84000002>;\r\n                                cpu_suspend = <0x84000001>;\r\n                                method = \"smc\";\r\n                                compatible = \"arm,psci-1.0\", \"arm,psci-0.2\", \"arm,psci\";\r\n                        };\r\n                };\r\n        };\r\n        fragment@1 {\r\n                target-path = \"/\";\r\n                __overlay__ {\r\n                        firmware {\r\n                                optee {\r\n                                        method = \"smc\";\r\n                                        compatible = \"linaro,optee-tz\";\r\n                                };\r\n                        };\r\n                };\r\n        };\r\n        fragment@0 {\r\n                target = \"/\";\r\n                __overlay__ {\r\n                        test-int-property = <0x0000002b>;\r\n                };\r\n        };\r\n};\r\n\r\n```","created_at":"2018-11-21T22:15:41Z","updated_at":"2018-11-29T15:57:22Z","closed_at":"2018-11-29T15:57:22Z","merged_at":"2018-11-29T15:57:22Z","merge_commit_sha":"241593c54ee675a8351a98bbc92283151c11ac38","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/2666/commits","review_comments_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/2666/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/2666/comments","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/d887087cf24721006cc2a2e78c9f0fb718270965","head":{"label":"bryanodonoghue:master+optee_overlay","ref":"master+optee_overlay","sha":"d887087cf24721006cc2a2e78c9f0fb718270965","user":{"login":"bryanodonoghue","id":12875090,"node_id":"MDQ6VXNlcjEyODc1MDkw","avatar_url":"https://avatars3.githubusercontent.com/u/12875090?v=4","gravatar_id":"","url":"https://api.github.com/users/bryanodonoghue","html_url":"https://github.com/bryanodonoghue","followers_url":"https://api.github.com/users/bryanodonoghue/followers","following_url":"https://api.github.com/users/bryanodonoghue/following{/other_user}","gists_url":"https://api.github.com/users/bryanodonoghue/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanodonoghue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanodonoghue/subscriptions","organizations_url":"https://api.github.com/users/bryanodonoghue/orgs","repos_url":"https://api.github.com/users/bryanodonoghue/repos","events_url":"https://api.github.com/users/bryanodonoghue/events{/privacy}","received_events_url":"https://api.github.com/users/bryanodonoghue/received_events","type":"User","site_admin":false},"repo":{"id":121767680,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE3Njc2ODA=","name":"optee_os","full_name":"bryanodonoghue/optee_os","private":false,"owner":{"login":"bryanodonoghue","id":12875090,"node_id":"MDQ6VXNlcjEyODc1MDkw","avatar_url":"https://avatars3.githubusercontent.com/u/12875090?v=4","gravatar_id":"","url":"https://api.github.com/users/bryanodonoghue","html_url":"https://github.com/bryanodonoghue","followers_url":"https://api.github.com/users/bryanodonoghue/followers","following_url":"https://api.github.com/users/bryanodonoghue/following{/other_user}","gists_url":"https://api.github.com/users/bryanodonoghue/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanodonoghue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanodonoghue/subscriptions","organizations_url":"https://api.github.com/users/bryanodonoghue/orgs","repos_url":"https://api.github.com/users/bryanodonoghue/repos","events_url":"https://api.github.com/users/bryanodonoghue/events{/privacy}","received_events_url":"https://api.github.com/users/bryanodonoghue/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bryanodonoghue/optee_os","description":"Trusted side of the TEE","fork":true,"url":"https://api.github.com/repos/bryanodonoghue/optee_os","forks_url":"https://api.github.com/repos/bryanodonoghue/optee_os/forks","keys_url":"https://api.github.com/repos/bryanodonoghue/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bryanodonoghue/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bryanodonoghue/optee_os/teams","hooks_url":"https://api.github.com/repos/bryanodonoghue/optee_os/hooks","issue_events_url":"https://api.github.com/repos/bryanodonoghue/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/bryanodonoghue/optee_os/events","assignees_url":"https://api.github.com/repos/bryanodonoghue/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/bryanodonoghue/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/bryanodonoghue/optee_os/tags","blobs_url":"https://api.github.com/repos/bryanodonoghue/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bryanodonoghue/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bryanodonoghue/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/bryanodonoghue/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bryanodonoghue/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/bryanodonoghue/optee_os/languages","stargazers_url":"https://api.github.com/repos/bryanodonoghue/optee_os/stargazers","contributors_url":"https://api.github.com/repos/bryanodonoghue/optee_os/contributors","subscribers_url":"https://api.github.com/repos/bryanodonoghue/optee_os/subscribers","subscription_url":"https://api.github.com/repos/bryanodonoghue/optee_os/subscription","commits_url":"https://api.github.com/repos/bryanodonoghue/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/bryanodonoghue/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/bryanodonoghue/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/bryanodonoghue/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/bryanodonoghue/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/bryanodonoghue/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bryanodonoghue/optee_os/merges","archive_url":"https://api.github.com/repos/bryanodonoghue/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bryanodonoghue/optee_os/downloads","issues_url":"https://api.github.com/repos/bryanodonoghue/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/bryanodonoghue/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/bryanodonoghue/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/bryanodonoghue/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bryanodonoghue/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/bryanodonoghue/optee_os/releases{/id}","deployments_url":"https://api.github.com/repos/bryanodonoghue/optee_os/deployments","created_at":"2018-02-16T15:40:58Z","updated_at":"2018-02-16T15:41:04Z","pushed_at":"2018-11-29T14:54:11Z","git_url":"git://github.com/bryanodonoghue/optee_os.git","ssh_url":"git@github.com:bryanodonoghue/optee_os.git","clone_url":"https://github.com/bryanodonoghue/optee_os.git","svn_url":"https://github.com/bryanodonoghue/optee_os","homepage":null,"size":16349,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OP-TEE:master","ref":"master","sha":"412dcda18a16e25038715f801c8eb3024d73690b","user":{"login":"OP-TEE","id":7488961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0ODg5NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/7488961?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMDE5MzI2MQ==","name":"optee_os","full_name":"OP-TEE/optee_os","private":false,"owner":{"login":"OP-TEE","id":7488961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0ODg5NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/7488961?v=4","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},"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":"2018-11-29T15:15:13Z","pushed_at":"2018-11-29T15:57:22Z","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":16391,"stargazers_count":519,"watchers_count":519,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":396,"mirror_url":null,"archived":false,"open_issues_count":212,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":396,"open_issues":212,"watchers":519,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/2666"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/2666"},"issue":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/2666"},"comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/2666/comments"},"review_comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/2666/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/2666/commits"},"statuses":{"href":"https://api.github.com/repos/OP-TEE/optee_os/statuses/d887087cf24721006cc2a2e78c9f0fb718270965"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"jforissier","id":8288195,"node_id":"MDQ6VXNlcjgyODgxOTU=","avatar_url":"https://avatars2.githubusercontent.com/u/8288195?v=4","gravatar_id":"","url":"https://api.github.com/users/jforissier","html_url":"https://github.com/jforissier","followers_url":"https://api.github.com/users/jforissier/followers","following_url":"https://api.github.com/users/jforissier/following{/other_user}","gists_url":"https://api.github.com/users/jforissier/gists{/gist_id}","starred_url":"https://api.github.com/users/jforissier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jforissier/subscriptions","organizations_url":"https://api.github.com/users/jforissier/orgs","repos_url":"https://api.github.com/users/jforissier/repos","events_url":"https://api.github.com/users/jforissier/events{/privacy}","received_events_url":"https://api.github.com/users/jforissier/received_events","type":"User","site_admin":false},"comments":7,"review_comments":33,"maintainer_can_modify":false,"commits":6,"additions":175,"deletions":68,"changed_files":3}}
{"actor":{"display_login":"jforissier"}}