{"action":"created","issue":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/960","repository_url":"https://api.github.com/repos/OP-TEE/optee_os","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/960/labels{/name}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/960/comments","events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/960/events","html_url":"https://github.com/OP-TEE/optee_os/issues/960","id":169154200,"number":960,"title":"boot without ATF","user":{"login":"bafATsit","id":18030556,"avatar_url":"https://avatars.githubusercontent.com/u/18030556?v=3","gravatar_id":"","url":"https://api.github.com/users/bafATsit","html_url":"https://github.com/bafATsit","followers_url":"https://api.github.com/users/bafATsit/followers","following_url":"https://api.github.com/users/bafATsit/following{/other_user}","gists_url":"https://api.github.com/users/bafATsit/gists{/gist_id}","starred_url":"https://api.github.com/users/bafATsit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bafATsit/subscriptions","organizations_url":"https://api.github.com/users/bafATsit/orgs","repos_url":"https://api.github.com/users/bafATsit/repos","events_url":"https://api.github.com/users/bafATsit/events{/privacy}","received_events_url":"https://api.github.com/users/bafATsit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-03T15:03:07Z","updated_at":"2016-08-10T09:52:27Z","closed_at":null,"body":"Hi,\r\n\r\nI try to port optee_ os to a new platform which has a Cortex A9.\r\nThus, ARM-Trusted-Firmware (ATF) is not supported for this platform.\r\n\r\nI did also see a CFG_WITH_ARM_TRUSTED_FW flag in plat-*/conf.mk.\r\nSo I assume, there is a way to boot without ATF, isn't there?\r\n\r\nCan someone please explain how to build a booting image without ATF?\r\nDoes OP-TEE provide a build process (Makefile) for this?"},"comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments/238819429","html_url":"https://github.com/OP-TEE/optee_os/issues/960#issuecomment-238819429","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/960","id":238819429,"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},"created_at":"2016-08-10T09:52:27Z","updated_at":"2016-08-10T09:52:27Z","body":"dear @bafATsit,\r\n\r\nbios_qemu_tz_arm may not be the best candidate to implement an optee bootloader. I think it is rather designed for qemu or jtag based booting.\r\n\r\nActually booting an optee for c-a9 requires:\r\n- loading 'secure optee' image in RAM: raw image file copy or formatted file parsing and load.\r\n- setting optee boot parameters: 'nonsecure entry point' (mandatory), TEE pager settings and device tree address (optional).\r\n- branching each cpu core in optee entry point (with arguments in gp register `lr` and `r0-r2`)\r\n- each core completes optee inits (setups, install TZ monitor) then branches at provided return address in supervisor mode/nonsecure state.\r\n\r\nbios_qemu_tz_arm does all this to have optee initialized and returning into bios_qemu_tz_arm (with secure state droped) and then to process linux booted (load kernel/fdt/ramdisk images, boot kernel with args). U-boot provides means to do the same.\r\n\r\nYour armv7 c-a9 based distribution likely already integrates one or two bootloaders. A preloaded (ROMed like) early bootloader and eventually a rich bootloader (u-boot like) to load and boot the linux kernel. Can you modify them to handle optee inits and nonsecure/secure states split ? Do you a want a 'secure' bootloader for optee and the linux or do you rather have a 'secure' bootloader for optee and a nonsecure bootloader for linux ? What about SMP ? c-a9 usually support hpen for linux kernel entry. Bootloader must handle hpen setup and optee inits for secondary core. bios_qemu_tz_arm does not (yet) support SMP booting.\r\n\r\nIf you planned to use u-boot to boot linux, you can plan to run u-boot in secure state and modify it to handle optee load/inits before loading/booting linux kernel. \r\n\r\nLoading optee image is very simple if optee pager is not enabled (optee fully runs in DDR). A generic bootloader can load the 'tee-pager.bin' (see optee-os build directory out/<target>/core/tee-pager.bin). The load address is the optee inits entry point.\r\nIf you plan to use the optee pager, then your optee bootloader needs to load the 'tee.bin' formatted file and parse its header to load optee images and expected locations.\r\n\r\nbios_qemu_tz_arm provides FDT support to boot optee but it is not mandatory. Platform configuration can be statically defined inside optee image and FDT can statically integrate optee device node. This remove fdt support from optee boot requirements.\r\n\r\nAs a startup, booting an optee without FDT and with optee pager off is rather simple.\r\nSMP requires extra changes but a legacy bootloader can be modified to support SMP and optee inits."}}
{"actor":{"display_login":"etiennec-linaro"}}