{"action":"created","issue":{"url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/126","labels_url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/126/comments","events_url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/126/events","html_url":"https://github.com/linux-sunxi/meta-sunxi/pull/126","id":120550024,"number":126,"title":"Support for NextThingCo C.H.I.P (sun5i r8 chip)","user":{"login":"soderstrom-rikard","id":3750094,"avatar_url":"https://avatars.githubusercontent.com/u/3750094?v=3","gravatar_id":"","url":"https://api.github.com/users/soderstrom-rikard","html_url":"https://github.com/soderstrom-rikard","followers_url":"https://api.github.com/users/soderstrom-rikard/followers","following_url":"https://api.github.com/users/soderstrom-rikard/following{/other_user}","gists_url":"https://api.github.com/users/soderstrom-rikard/gists{/gist_id}","starred_url":"https://api.github.com/users/soderstrom-rikard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soderstrom-rikard/subscriptions","organizations_url":"https://api.github.com/users/soderstrom-rikard/orgs","repos_url":"https://api.github.com/users/soderstrom-rikard/repos","events_url":"https://api.github.com/users/soderstrom-rikard/events{/privacy}","received_events_url":"https://api.github.com/users/soderstrom-rikard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-05T12:07:33Z","updated_at":"2015-12-09T05:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/pulls/126","html_url":"https://github.com/linux-sunxi/meta-sunxi/pull/126","diff_url":"https://github.com/linux-sunxi/meta-sunxi/pull/126.diff","patch_url":"https://github.com/linux-sunxi/meta-sunxi/pull/126.patch"},"body":"Most parts of this pull request is kinda straight forward. However the changes to `classes/sdcard_image-sunxi.bbclass` should probably be explained.\r\n\r\nI also include a short usage guide, since there are some manual steps with the CHIP-tools needed. Even thou a pull request probably isn't the best place for this. I think it is important to highlight this. I will try having an update guide in nexthingco forums, here\r\nhttps://bbs.nextthing.co/t/yocto-project-an-initial-teaser-release/833\r\n\r\nThoughts? Feedback?\r\n\r\n##### SDCARD and FEX files \r\n\r\nThe nextthingco chip does not have an sdcard slot nor does it use fex files. Therefor I made it like a switch, where it defaults to the standard behavior of having a sdcard and fex files. But in the `conf/machine/chip.conf`we ensure that for the chip machine it is not included by explicitly adding\r\n```\r\nSUNXI_BOARD_FEX_IMAGE        ?= \"\"\r\nSUNXI_BOARD_FEX_IMAGE_DEPLOY ?= \"\"\r\n``` \r\n\r\nPersonally I haven't seen a more reliable way introducing this change, but if someone knows a better strategy please feel free to tell me. \r\n\r\n##### CHIP Tools\r\n\r\nCurrently the CHIP tools is hardwired for the buildroot images. In particular the rootfs partition name.\r\nSo that would need to be changed in order to run on target. I have a commit for this here\r\nhttps://github.com/soderstrom-rikard/CHIP-tools/commit/ccb38147a1628ca1a1638c1d84823b17ad70f24a\r\n\r\n```diff\r\n \techo \"nand write.raw $SPL_MEM_ADDR 0x400000 $PADDED_SPL_SIZE\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n \techo \"sunxi_nand config default\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n \techo \"nand write $UBOOT_MEM_ADDR 0x800000 $PADDED_UBOOT_SIZE\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n-\techo \"setenv bootargs root=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n-\techo \"setenv bootcmd 'source \\${scriptaddr}; nand slc-mode on; mtdparts; ubi part UBI; ubifsmount ubi0:rootfs; ubifsload \\$fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload \\$kernel_addr_r /boot/zImage; bootz \\$kernel_addr_r - \\$fdt_addr_r'\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n+\techo \"setenv bootargs root=ubi0:chip-rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n+\techo \"setenv bootcmd 'source \\${scriptaddr}; nand slc-mode on; mtdparts; ubi part UBI; ubifsmount ubi0:chip-rootfs; ubifsload \\$fdt_addr_r /boot/sun5i-r8-chip.dtb; ubifsload \\$kernel_addr_r /boot/zImage; bootz \\$kernel_addr_r - \\$fdt_addr_r'\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n \techo \"saveenv\" >> \"${UBOOT_SCRIPT_SRC}\"\r\n \r\n   if [[ \"${METHOD}\" == \"fel\" ]]; then\r\n```\r\n\r\n##### Configuration and build\r\n\r\n1. Setup bblayers normally for meta-sunxi.\r\n2. Set `MACHINE` in `conf/local.conf` to `chip`\r\n3. Build with `bitbake core-image-minimal`\r\n4. Copy images to CHIP-tools/.firmware/images\r\n\r\nThe copying step needs to match the names `chip-fel-flash.sh` from CHIP-tools uses\r\n\r\nSo for example\r\n```bash\r\ncd CHIP-tools/.firmware/images\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/core-image-minimal-chip.ubi rootfs.ubi\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/zImage-sun5i-r8-chip.dtb sun5i-r8-chip.dtb\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/sunxi-spl.bin .\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/u-boot-dtb.bin .\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/uboot-env.bin .\r\n${YOCTO-CHIP-BUILDDIR}/tmp/deploy/images/chip/zImage .\r\n```\r\n\r\nIs one way to do this."},"comment":{"url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/comments/163115173","html_url":"https://github.com/linux-sunxi/meta-sunxi/pull/126#issuecomment-163115173","issue_url":"https://api.github.com/repos/linux-sunxi/meta-sunxi/issues/126","id":163115173,"user":{"login":"jlucius","id":6508987,"avatar_url":"https://avatars.githubusercontent.com/u/6508987?v=3","gravatar_id":"","url":"https://api.github.com/users/jlucius","html_url":"https://github.com/jlucius","followers_url":"https://api.github.com/users/jlucius/followers","following_url":"https://api.github.com/users/jlucius/following{/other_user}","gists_url":"https://api.github.com/users/jlucius/gists{/gist_id}","starred_url":"https://api.github.com/users/jlucius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlucius/subscriptions","organizations_url":"https://api.github.com/users/jlucius/orgs","repos_url":"https://api.github.com/users/jlucius/repos","events_url":"https://api.github.com/users/jlucius/events{/privacy}","received_events_url":"https://api.github.com/users/jlucius/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T05:29:29Z","updated_at":"2015-12-09T05:29:29Z","body":"the += should be replaced by =\r\n\r\nI will bump the kernels this week and replace it."}}