Skip to contentSkip to conversation

various updates

PATCH In review Trevor Woerner 4 participants 32 messages Feb 19, 2017 – Mar 6, 2017 Arm Rockchip

lore
Share & tools
lore
#0 lore raw

v2 cover various updates

Here are a couple v2's of some patches that were submitted to the mailing list earlier.

Changes since v1:
- break commits to separate files into separate patches
- rename the rk3288 image bbclass
- make improvements to the rk3288 image bbclass
- improve the commit message for the image bbclass

Trevor Woerner (5):
machine: rk3288: enable SoC-specific assignments
u-boot-rockchip: add
machine: firefly-rk3288: specify bootloader
classes: rockchip-gpt-img: add
machine: rk3288: GPT image support

 classes/rockchip-gpt-img.bbclass          | 132 ++++++++++++++++++++++++++++++
 conf/machine/firefly-rk3288.conf          |   1 +
 conf/machine/include/rk3288.inc           |   9 ++
 recipes-bsp/u-boot/u-boot-rockchip_git.bb |  19 +++++
 4 files changed, 161 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
Signature · 1 line
2.12.0.rc1.48.g076c053
#1 lore raw

PATCH v2 1/5 machine: rk3288: enable SoC-specific assignments

Enable machine overrides for RK3288.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
conf/machine/include/rk3288.inc +3 -0
index 86fc567..769e5c1 100644
@@ -1,7 +1,10 @@
 # Copyright (C) 2015 Romain Perier
 # Released under the MIT license (see COPYING.MIT for the terms)
 
+SOC_FAMILY = "rk3288"
+
 require conf/machine/include/tune-cortexa17.inc
+require conf/machine/include/soc-family.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
Signature · 1 line
2.12.0.rc1.48.g076c053
#6 lore raw

PATCH v2 2/5 u-boot-rockchip: add

In reply to Trevor Woerner

This recipe was taken from the Rockchip team's recipe at
https://github.com/rockchip-linux/meta-rockchip/commit/6a139d5b7510c7ba36aace82c239b894d5741cac

It was mostly written by Jacob Chen <[email protected]> and I've made a couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +19 -0
new file mode 100644
index 0000000..3b4f109
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+	# copy to default search path
+	cp ${B}/spl/${SPL_BINARY} ${B}/
+}
Signature · 1 line
2.12.0.rc1.48.g076c053
#18 lore raw

PATCH v2 3/5 machine: firefly-rk3288: specify bootloader

In reply to Trevor Woerner

Set the default preferred bootloader for firefly-rk3288 to be u-boot-rockchip and set the default name of the SPL binary.

---
 conf/machine/firefly-rk3288.conf | 1 +
 conf/machine/include/rk3288.inc  | 3 +++
 2 files changed, 4 insertions(+)
conf/machine/firefly-rk3288.conf +1 -0
index 8fa005d..58d752b 100644
@@ -8,3 +8,4 @@
 
 include conf/machine/include/rk3288.inc
 KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+UBOOT_MACHINE = "firefly-rk3288_defconfig"
conf/machine/include/rk3288.inc +3 -0
index 769e5c1..4a4201f 100644
@@ -10,3 +10,6 @@ PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
 KERNEL_IMAGETYPE = "zImage"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
+SPL_BINARY ?= "u-boot-spl-dtb.bin"
Signature · 1 line
2.12.0.rc1.48.g076c053
#23 lore raw

PATCH v2 4/5 classes: rockchip-gpt-img: add

In reply to Trevor Woerner

This bbclass was taken from the Rockchip team's work at
https://github.com/rockchip-linux/meta-rockchip/commit/53d2e2e474a3014e3013d0059fd1da773fb0e2b7
It was mostly written by Jacob Chen <[email protected]>. I've made some small modifications and added it.

Older images used (what Rockchip calls) the "rk-boot" format. Newer images use u-boot and a GPT partitioning scheme. This class allows the build to generate a gpt-img file that can either be flashed to eMMC or written to an SDcard (the same image is used for both).

This is the new image format used for rk3288 SoCs (e.g. the Firefly board).

---
 classes/rockchip-gpt-img.bbclass | 132 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
classes/rockchip-gpt-img.bbclass new file +132 -0
new file mode 100644
index 0000000..fd80625
@@ -0,0 +1,132 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+inherit image_types
+
+# Use an uncompressed ext4 by default as rootfs
+IMG_ROOTFS_TYPE = "ext4"
+IMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${IMG_ROOTFS_TYPE}"
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_rockchip-gpt-img = "${IMG_ROOTFS_TYPE}"
+
+GPTIMG_SUFFIX  = "gpt-img"
+GPTIMG         = "${IMAGE_NAME}.${GPTIMG_SUFFIX}"
+GPTIMG_SIZE   ?= "4096"
+BOOT_IMG       = "boot.img"
+MINILOADER     = "loader.bin"
+UBOOT          = "u-boot.out"
+TRUST          = "trust.out"
+GPTIMG_APPEND ?= "console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"
+
+# default partitions [in Sectors]
+# More info at http://rockchip.wikidot.com/partitions
+LOADER1_SIZE = "8000"
+RESERVED1_SIZE = "128"
+RESERVED2_SIZE = "8192"
+LOADER2_SIZE = "8192"
+ATF_SIZE = "8192"
+BOOT_SIZE = "229376"
+
+IMAGE_DEPENDS_rockchip-gpt-img = "parted-native \
+	u-boot-mkimage-native \
+	mtools-native \
+	dosfstools-native \
+	virtual/kernel:do_deploy \
+	virtual/bootloader:do_deploy"
+
+PER_CHIP_IMG_GENERATION_COMMAND_rk3288 = "generate_rk3288_image"
+
+IMAGE_CMD_rockchip-gpt-img () {
+	# Change to image directory
+	cd ${DEPLOY_DIR_IMAGE}
+
+	# Remove the exist image
+	rm -rf *${GPTIMG_SUFFIX}
+
+	create_rk_image
+
+	${PER_CHIP_IMG_GENERATION_COMMAND}
+
+	cd ${DEPLOY_DIR_IMAGE}
+	ln -s ${GPTIMG} "${IMAGE_BASENAME}-${MACHINE}.${GPTIMG_SUFFIX}"
+}
+
+create_rk_image () {
+
+	# Initialize sdcard image file
+	dd if=/dev/zero of=${GPTIMG} bs=1M count=0 seek=${GPTIMG_SIZE}
+
+	# Create partition table
+	parted -s ${GPTIMG} mklabel gpt
+
+	# Create vendor defined partitions
+	LOADER1_START=64
+	RESERVED1_START=`expr ${LOADER1_START}  + ${LOADER1_SIZE}`
+	RESERVED2_START=`expr ${RESERVED1_START}  + ${RESERVED1_SIZE}`
+	LOADER2_START=`expr ${RESERVED2_START}  + ${RESERVED2_SIZE}`
+	ATF_START=`expr ${LOADER2_START}  + ${LOADER2_SIZE}`
+	BOOT_START=`expr ${ATF_START}  + ${ATF_SIZE}`
+	ROOTFS_START=`expr ${BOOT_START}  + ${BOOT_SIZE}`
+
+	parted -s ${GPTIMG} unit s mkpart loader1 ${LOADER1_START} `expr ${RESERVED1_START} - 1`
+	parted -s ${GPTIMG} unit s mkpart reserved1 ${RESERVED1_START} `expr ${RESERVED2_START} - 1`
+	parted -s ${GPTIMG} unit s mkpart reserved2 ${RESERVED2_START} `expr ${LOADER2_START} - 1`
+	parted -s ${GPTIMG} unit s mkpart loader2 ${LOADER2_START} `expr ${ATF_START} - 1`
+	parted -s ${GPTIMG} unit s mkpart atf ${ATF_START} `expr ${BOOT_START} - 1`
+
+	# Create boot partition and mark it as bootable
+	parted -s ${GPTIMG} unit s mkpart boot ${BOOT_START} `expr ${ROOTFS_START} - 1`
+	parted -s ${GPTIMG} set 6 boot on
+
+	# Create rootfs partition
+	parted -s ${GPTIMG} unit s mkpart root ${ROOTFS_START} 100%
+
+	parted ${GPTIMG} print
+
+	# Delete the boot image to avoid trouble with the build cache
+	rm -f ${WORKDIR}/${BOOT_IMG}
+
+	# Create boot partition image
+	BOOT_BLOCKS=$(LC_ALL=C parted -s ${GPTIMG} unit b print | awk '/ 6 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
+	BOOT_BLOCKS=`expr $BOOT_BLOCKS / 63 \* 63`
+
+	mkfs.vfat -n "boot" -S 512 -C ${WORKDIR}/${BOOT_IMG} $BOOT_BLOCKS
+	mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}
+
+	DEVICETREE_DEFAULT=""
+	for DTS_FILE in ${KERNEL_DEVICETREE}; do
+		[ -n "${DEVICETREE_DEFAULT}"] && DEVICETREE_DEFAULT="${DTS_FILE}"
+		mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_FILE} ::${DTS_FILE}
+	done
+
+	# Create extlinux config file
+	cat > ${WORKDIR}/extlinux.conf <<EOF
+default yocto
+
+label yocto
+	kernel /${KERNEL_IMAGETYPE}
+	devicetree /${DEVICETREE_DEFAULT}
+	append ${GPTIMG_APPEND}
+EOF
+
+	mmd -i ${WORKDIR}/${BOOT_IMG} ::/extlinux
+	mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${WORKDIR}/extlinux.conf ::/extlinux/
+
+	# Burn Boot Partition
+	dd if=${WORKDIR}/${BOOT_IMG} of=${GPTIMG} conv=notrunc,fsync seek=${BOOT_START}
+
+	# Burn Rootfs Partition
+	dd if=${IMG_ROOTFS} of=${GPTIMG} seek=${ROOTFS_START}
+
+}
+
+generate_rk3288_image () {
+
+	# Burn bootloader
+	mkimage -n rk3288 -T rksd -d ${DEPLOY_DIR_IMAGE}/${SPL_BINARY} ${WORKDIR}/${UBOOT}
+	cat ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin >>  ${WORKDIR}/${UBOOT}
+	dd if=${WORKDIR}/${UBOOT} of=${GPTIMG} conv=notrunc,fsync seek=64
+
+}
Signature · 1 line
2.12.0.rc1.48.g076c053
#29 lore raw

PATCH v2 5/5 machine: rk3288: GPT image support

In reply to Trevor Woerner

Configure any rk3288 build to generate the new GPT image which is then either flashed to eMMC or dd'ed to an SDcard.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
conf/machine/include/rk3288.inc +3 -0
index 4a4201f..964d8b0 100644
@@ -13,3 +13,6 @@ KBUILD_DEFCONFIG = "multi_v7_defconfig"
 
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
 SPL_BINARY ?= "u-boot-spl-dtb.bin"
+
+IMAGE_FSTYPES = "ext4 rockchip-gpt-img"
+IMAGE_CLASSES += "rockchip-gpt-img"
Signature · 1 line
2.12.0.rc1.48.g076c053
#7 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

In reply to Trevor Woerner

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 18 lines

This recipe was taken from the Rockchip team's recipe at
https://github.com/rockchip-linux/meta-rockchip/commit/6a139d5b7510c7ba36aace82c239b894d5741cac

It was mostly written by Jacob Chen <[email protected]> and I've made a couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +0 -0
new file mode 100644
index 0000000..3b4f109

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 7

Quoted 7 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +7 -0
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"

I don't like the next-dev. It is internal branch name. It is meaningless to people outside Rockchip. Why not call it "Rockchip U-Boot"

Quoted 20 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +12 -1
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw

Re: [meta-rockchip][PATCH v2 1/5] machine: rk3288: enable SoC-specific assignments

In reply to Trevor Woerner

Hi Trevor

Is this the same one i submit before?
https://www.mail-archive.com/[email protected]/msg33572.html

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 30 lines

Enable machine overrides for RK3288.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
conf/machine/include/rk3288.inc +3 -1
index 86fc567..769e5c1 100644
@@ -1,7 +1,10 @@
 # Copyright (C) 2015 Romain Perier
 # Released under the MIT license (see COPYING.MIT for the terms)
 
+SOC_FAMILY = "rk3288"
+
 require conf/machine/include/tune-cortexa17.inc
+require conf/machine/include/soc-family.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#19 lore raw

Re: [meta-rockchip][PATCH v2 3/5] machine: firefly-rk3288: specify bootloader

In reply to Trevor Woerner

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 8 lines

Set the default preferred bootloader for firefly-rk3288 to be u-boot-rockchip and set the default name of the SPL binary.

---
 conf/machine/firefly-rk3288.conf | 1 +
 conf/machine/include/rk3288.inc  | 3 +++
 2 files changed, 4 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 29 lines
conf/machine/firefly-rk3288.conf +1 -0
index 8fa005d..58d752b 100644
@@ -8,3 +8,4 @@
 
 include conf/machine/include/rk3288.inc
 KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+UBOOT_MACHINE = "firefly-rk3288_defconfig"
conf/machine/include/rk3288.inc +3 -1
index 769e5c1..4a4201f 100644
@@ -10,3 +10,6 @@ PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
 KERNEL_IMAGETYPE = "zImage"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
+SPL_BINARY ?= "u-boot-spl-dtb.bin"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#24 lore raw

Re: [meta-rockchip][PATCH v2 4/5] classes: rockchip-gpt-img: add

In reply to Trevor Woerner

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 2 lines

This bbclass was taken from the Rockchip team's work at

https://github.com/rockchip-linux/meta-rockchip/commit/53d2e2e474a3014e3013d0059fd1da773fb0e2b7

Quoted 1 line

It was mostly written by Jacob Chen <[email protected]>. I've made

some

Quoted 3 lines

small modifications and added it.

Older images used (what Rockchip calls) the "rk-boot" format. Newer

images use
We call it legacy parameter format

Quoted 1 line

u-boot and a GPT partitioning scheme. This class allows the build to

generate

Quoted 1 line

a gpt-img file that can either be flashed to eMMC or written to an SDcard

(the

Quoted 1 line

same image is used for both).

gpt-img is much better than previous one. I like this name.

Quoted 2 lines

This is the new image format used for rk3288 SoCs (e.g. the Firefly

board).

Quoted 4 lines
---
 classes/rockchip-gpt-img.bbclass | 132

+++++++++++++++++++++++++++++++++++++++

Review

Quoted 4 lines
 1 file changed, 132 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
(quoted diff) +0 -0

b/classes/rockchip-gpt-img.bbclass

Quoted 11 lines

new file mode 100644
index 0000000..fd80625

classes/rockchip-gpt-img.bbclass new file +6 -0
@@ -0,0 +1,132 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+inherit image_types
+

classes/rockchip-gpt-img.bbclass line 16

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+# Use an uncompressed ext4 by default as rootfs
+IMG_ROOTFS_TYPE = "ext4"
+IMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${IMG_ROOTFS_TYPE}"
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_rockchip-gpt-img = "${IMG_ROOTFS_TYPE}"
+
+GPTIMG_SUFFIX  = "gpt-img"
+GPTIMG         = "${IMAGE_NAME}.${GPTIMG_SUFFIX}"
+GPTIMG_SIZE   ?= "4096"

This should be GPT size in sectors which is 64 sectors. The name GPTIMG_SIZE is not clear enough. People may think it is whole gpt image. What about call it GPT_SIZE?

classes/rockchip-gpt-img.bbclass

Quoted 5 lines
classes/rockchip-gpt-img.bbclass new file +5 -0
+BOOT_IMG       = "boot.img"
+MINILOADER     = "loader.bin"
+UBOOT          = "u-boot.out"
+TRUST          = "trust.out"
+GPTIMG_APPEND ?= "console=tty1 console=ttyS2,115200n8 rw

root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"

Quoted 8 lines
classes/rockchip-gpt-img.bbclass new file +8 -0
+
+# default partitions [in Sectors]
+# More info at http://rockchip.wikidot.com/partitions
+LOADER1_SIZE = "8000"
+RESERVED1_SIZE = "128"
+RESERVED2_SIZE = "8192"
+LOADER2_SIZE = "8192"
+ATF_SIZE = "8192"

classes/rockchip-gpt-img.bbclass line 39

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+BOOT_SIZE = "229376"
+
+IMAGE_DEPENDS_rockchip-gpt-img = "parted-native \
+       u-boot-mkimage-native \
+       mtools-native \
+       dosfstools-native \
+       virtual/kernel:do_deploy \
+       virtual/bootloader:do_deploy"
+
+PER_CHIP_IMG_GENERATION_COMMAND_rk3288 = "generate_rk3288_image"

This is not just for rk3288. in fact, it can be used for all the Rockchip SoC.

classes/rockchip-gpt-img.bbclass line 46

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+IMAGE_CMD_rockchip-gpt-img () {
+       # Change to image directory
+       cd ${DEPLOY_DIR_IMAGE}
+
+       # Remove the exist image
+       rm -rf *${GPTIMG_SUFFIX}

${IMAGE_NAME} is derived using the IMAGE_BASENAME, MACHINE, and DATETIME variables. So we don't need to delete previous one to avoid mistake.

Quoted 17 lines
classes/rockchip-gpt-img.bbclass new file +17 -0
+
+       create_rk_image
+
+       ${PER_CHIP_IMG_GENERATION_COMMAND}
+
+       cd ${DEPLOY_DIR_IMAGE}
+       ln -s ${GPTIMG} "${IMAGE_BASENAME}-${MACHINE}.${GPTIMG_SUFFIX}"
+}
+
+create_rk_image () {
+
+       # Initialize sdcard image file
+       dd if=/dev/zero of=${GPTIMG} bs=1M count=0 seek=${GPTIMG_SIZE}
+
+       # Create partition table
+       parted -s ${GPTIMG} mklabel gpt
+

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+       # Create vendor defined partitions
+       LOADER1_START=64
+       RESERVED1_START=`expr ${LOADER1_START}  + ${LOADER1_SIZE}`
+       RESERVED2_START=`expr ${RESERVED1_START}  + ${RESERVED1_SIZE}`
+       LOADER2_START=`expr ${RESERVED2_START}  + ${RESERVED2_SIZE}`
+       ATF_START=`expr ${LOADER2_START}  + ${LOADER2_SIZE}`
+       BOOT_START=`expr ${ATF_START}  + ${ATF_SIZE}`
+       ROOTFS_START=`expr ${BOOT_START}  + ${BOOT_SIZE}`
+
+       parted -s ${GPTIMG} unit s mkpart loader1 ${LOADER1_START} `expr

${RESERVED1_START} - 1`

classes/rockchip-gpt-img.bbclass line 74

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved1 ${RESERVED1_START}

expr ${RESERVED2_START} - 1

classes/rockchip-gpt-img.bbclass line 75

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved2 ${RESERVED2_START}

expr ${LOADER2_START} - 1

classes/rockchip-gpt-img.bbclass line 76

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart loader2 ${LOADER2_START} `expr

${ATF_START} - 1`

classes/rockchip-gpt-img.bbclass line 77

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart atf ${ATF_START} `expr

${BOOT_START} - 1`

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition and mark it as bootable
+       parted -s ${GPTIMG} unit s mkpart boot ${BOOT_START} `expr

${ROOTFS_START} - 1`

classes/rockchip-gpt-img.bbclass line 89

Quoted 9 lines
classes/rockchip-gpt-img.bbclass new file +9 -0
+       parted -s ${GPTIMG} set 6 boot on
+
+       # Create rootfs partition
+       parted -s ${GPTIMG} unit s mkpart root ${ROOTFS_START} 100%
+
+       parted ${GPTIMG} print
+
+       # Delete the boot image to avoid trouble with the build cache
+       rm -f ${WORKDIR}/${BOOT_IMG}

what about use BOOT_IMG = "boot-${MACHINE}-${DATETIME}.img" instead? That will leave the previous build for debug and avoid trouble.

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition image
+       BOOT_BLOCKS=$(LC_ALL=C parted -s ${GPTIMG} unit b print | awk '/

6 / { print substr($4, 1, length($4 -1)) / 512 /2 }')

classes/rockchip-gpt-img.bbclass

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+       BOOT_BLOCKS=`expr $BOOT_BLOCKS / 63 \* 63`
+
+       mkfs.vfat -n "boot" -S 512 -C ${WORKDIR}/${BOOT_IMG} $BOOT_BLOCKS
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}

classes/rockchip-gpt-img.bbclass

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+
+       DEVICETREE_DEFAULT=""
+       for DTS_FILE in ${KERNEL_DEVICETREE}; do
+               [ -n "${DEVICETREE_DEFAULT}"] &&

DEVICETREE_DEFAULT="${DTS_FILE}"

classes/rockchip-gpt-img.bbclass line 101

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+               mcopy -i ${WORKDIR}/${BOOT_IMG} -s

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_FILE} ::${DTS_FILE}

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+       done
+
+       # Create extlinux config file
+       cat > ${WORKDIR}/extlinux.conf <<EOF

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+default yocto
+
+label yocto
+       kernel /${KERNEL_IMAGETYPE}
+       devicetree /${DEVICETREE_DEFAULT}
+       append ${GPTIMG_APPEND}
+EOF
+
+       mmd -i ${WORKDIR}/${BOOT_IMG} ::/extlinux
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${WORKDIR}/extlinux.conf

::/extlinux/

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn Boot Partition
+       dd if=${WORKDIR}/${BOOT_IMG} of=${GPTIMG} conv=notrunc,fsync

seek=${BOOT_START}

classes/rockchip-gpt-img.bbclass line 125

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+       # Burn Rootfs Partition
+       dd if=${IMG_ROOTFS} of=${GPTIMG} seek=${ROOTFS_START}
+
+}
+
+generate_rk3288_image () {

It is not only for rk3288. In fact, This function is for create load1 partition. So what about using generate_load1 or create_loader1 ?

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn bootloader
+       mkimage -n rk3288 -T rksd -d ${DEPLOY_DIR_IMAGE}/${SPL_BINARY}

${WORKDIR}/${UBOOT}

classes/rockchip-gpt-img.bbclass line 129

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       cat ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin >>

${WORKDIR}/${UBOOT}

Quoted 11 lines
classes/rockchip-gpt-img.bbclass new file +3 -1
+       dd if=${WORKDIR}/${UBOOT} of=${GPTIMG} conv=notrunc,fsync seek=64
+
+}
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#30 lore raw

Re: [meta-rockchip][PATCH v2 5/5] machine: rk3288: GPT image support

In reply to Trevor Woerner

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 9 lines

Configure any rk3288 build to generate the new GPT image which is then either
flashed to eMMC or dd'ed to an SDcard.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 22 lines
conf/machine/include/rk3288.inc +3 -1
index 4a4201f..964d8b0 100644
@@ -13,3 +13,6 @@ KBUILD_DEFCONFIG = "multi_v7_defconfig"
 
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
 SPL_BINARY ?= "u-boot-spl-dtb.bin"
+
+IMAGE_FSTYPES = "ext4 rockchip-gpt-img"
+IMAGE_CLASSES += "rockchip-gpt-img"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#20 lore raw

Re: [meta-rockchip][PATCH v2 3/5] machine: firefly-rk3288: specify bootloader

In reply to Eddie Cai

Hi Trevor,

2017-02-19 13:03 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 36 lines

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 8 lines

Set the default preferred bootloader for firefly-rk3288 to be u-boot-rockchip and set the default name of the SPL binary.

---
 conf/machine/firefly-rk3288.conf | 1 +
 conf/machine/include/rk3288.inc  | 3 +++
 2 files changed, 4 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 24 lines
conf/machine/firefly-rk3288.conf +1 -0
index 8fa005d..58d752b 100644
@@ -8,3 +8,4 @@
 
 include conf/machine/include/rk3288.inc
 KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+UBOOT_MACHINE = "firefly-rk3288_defconfig"
conf/machine/include/rk3288.inc +3 -1
index 769e5c1..4a4201f 100644
@@ -10,3 +10,6 @@ PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
 KERNEL_IMAGETYPE = "zImage"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
+SPL_BINARY ?= "u-boot-spl-dtb.bin"
--

2.12.0.rc1.48.g076c053

Quoted 10 lines
Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]>

#25 lore raw

Re: [meta-rockchip][PATCH v2 4/5] classes: rockchip-gpt-img: add

In reply to Eddie Cai

Hi all,

Eddie Cai wrote on 2017年02月19日 14:32:

Quoted 41 lines

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected] <mailto:[email protected]>>:

Quoted 2 lines

This bbclass was taken from the Rockchip team's work at

https://github.com/rockchip-linux/meta-rockchip/commit/53d2e2e474a3014e3013d0059fd1da773fb0e2b7

Quoted 1 line

It was mostly written by Jacob Chen <[email protected]

<mailto:[email protected]>>. I've made some

Quoted 3 lines

small modifications and added it.

Older images used (what Rockchip calls) the "rk-boot" format. Newer

images use
We call it legacy parameter format

Quoted 1 line

u-boot and a GPT partitioning scheme. This class allows the build to

generate

Quoted 1 line

a gpt-img file that can either be flashed to eMMC or written to an

SDcard (the

Quoted 1 line

same image is used for both).

gpt-img is much better than previous one. I like this name.

Quoted 2 lines

This is the new image format used for rk3288 SoCs (e.g. the Firefly

board).

Quoted 2 lines

<mailto:[email protected]>>

Quoted 2 lines
---
 classes/rockchip-gpt-img.bbclass | 132 

+++++++++++++++++++++++++++++++++++++++

Review

Quoted 4 lines
 1 file changed, 132 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
(quoted diff) +0 -0

b/classes/rockchip-gpt-img.bbclass

classes/rockchip-gpt-img.bbclass line 2

Quoted 7 lines

new file mode 100644
index 0000000..fd80625

classes/rockchip-gpt-img.bbclass new file +2 -0
@@ -0,0 +1,132 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected] 

<mailto:[email protected]>>

Quoted 15 lines
Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+inherit image_types
+

classes/rockchip-gpt-img.bbclass line 16

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+# Use an uncompressed ext4 by default as rootfs
+IMG_ROOTFS_TYPE = "ext4"
+IMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${IMG_ROOTFS_TYPE}"
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_rockchip-gpt-img = "${IMG_ROOTFS_TYPE}"
+
+GPTIMG_SUFFIX  = "gpt-img"
+GPTIMG         = "${IMAGE_NAME}.${GPTIMG_SUFFIX}"
+GPTIMG_SIZE   ?= "4096"

This should be GPT size in sectors which is 64 sectors. The name GPTIMG_SIZE is not clear enough. People may think it is whole gpt image. What about call it GPT_SIZE?

It's whole gpt image.

Quoted 17 lines

classes/rockchip-gpt-img.bbclass

Quoted 5 lines
classes/rockchip-gpt-img.bbclass new file +5 -0
+BOOT_IMG       = "boot.img"
+MINILOADER     = "loader.bin"
+UBOOT          = "u-boot.out"
+TRUST          = "trust.out"
+GPTIMG_APPEND ?= "console=tty1 console=ttyS2,115200n8 rw 

root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"

Quoted 11 lines
classes/rockchip-gpt-img.bbclass new file +11 -0
+
+# default partitions [in Sectors]
+# More info at http://rockchip.wikidot.com/partitions
+LOADER1_SIZE = "8000"
+RESERVED1_SIZE = "128"
+RESERVED2_SIZE = "8192"
+LOADER2_SIZE = "8192"
+ATF_SIZE = "8192"
+BOOT_SIZE = "229376"
+
+IMAGE_DEPENDS_rockchip-gpt-img = "parted-native \
Quoted 8 lines

classes/rockchip-gpt-img.bbclass line 39

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+       u-boot-mkimage-native \
+       mtools-native \
+       dosfstools-native \
+       virtual/kernel:do_deploy \
+       virtual/bootloader:do_deploy"
+
+PER_CHIP_IMG_GENERATION_COMMAND_rk3288 = "generate_rk3288_image"

This is not just for rk3288. in fact, it can be used for all the Rockchip SoC.

There're many differences between Chips.
Some chips didn't implement SPL support and have to use rk-miniloader to create u-boot blob. (e.g. previous rk3399, rk3229) Some chips didn't use "spl_back_to_brom" so their tpl have a different offset.(e.g. previous rk3288)

The name "generate_load1" can't express it clearly.

Quoted 48 lines

classes/rockchip-gpt-img.bbclass line 46

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+IMAGE_CMD_rockchip-gpt-img () {
+       # Change to image directory
+       cd ${DEPLOY_DIR_IMAGE}
+
+       # Remove the exist image
+       rm -rf *${GPTIMG_SUFFIX}

${IMAGE_NAME} is derived using the IMAGE_BASENAME, MACHINE, and DATETIME variables. So we don't need to delete previous one to avoid mistake.

Quoted 17 lines
classes/rockchip-gpt-img.bbclass new file +17 -0
+
+       create_rk_image
+
+       ${PER_CHIP_IMG_GENERATION_COMMAND}
+
+       cd ${DEPLOY_DIR_IMAGE}
+       ln -s ${GPTIMG} "${IMAGE_BASENAME}-${MACHINE}.${GPTIMG_SUFFIX}"
+}
+
+create_rk_image () {
+
+       # Initialize sdcard image file
+       dd if=/dev/zero of=${GPTIMG} bs=1M count=0 seek=${GPTIMG_SIZE}
+
+       # Create partition table
+       parted -s ${GPTIMG} mklabel gpt
+

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+       # Create vendor defined partitions
+       LOADER1_START=64
+       RESERVED1_START=`expr ${LOADER1_START}  + ${LOADER1_SIZE}`
+       RESERVED2_START=`expr ${RESERVED1_START}  + ${RESERVED1_SIZE}`
+       LOADER2_START=`expr ${RESERVED2_START}  + ${RESERVED2_SIZE}`
+       ATF_START=`expr ${LOADER2_START}  + ${LOADER2_SIZE}`
+       BOOT_START=`expr ${ATF_START}  + ${ATF_SIZE}`
+       ROOTFS_START=`expr ${BOOT_START}  + ${BOOT_SIZE}`
+
+       parted -s ${GPTIMG} unit s mkpart loader1 ${LOADER1_START} 

expr ${RESERVED1_START} - 1

classes/rockchip-gpt-img.bbclass line 74

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved1 

${RESERVED1_START} expr ${RESERVED2_START} - 1

classes/rockchip-gpt-img.bbclass line 75

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved2 

${RESERVED2_START} expr ${LOADER2_START} - 1

classes/rockchip-gpt-img.bbclass line 76

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart loader2 ${LOADER2_START} 

expr ${ATF_START} - 1

classes/rockchip-gpt-img.bbclass line 77

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart atf ${ATF_START} `expr 

${BOOT_START} - 1`

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition and mark it as bootable
+       parted -s ${GPTIMG} unit s mkpart boot ${BOOT_START} `expr 

${ROOTFS_START} - 1`

Quoted 10 lines

classes/rockchip-gpt-img.bbclass line 89

Quoted 9 lines
classes/rockchip-gpt-img.bbclass new file +9 -0
+       parted -s ${GPTIMG} set 6 boot on
+
+       # Create rootfs partition
+       parted -s ${GPTIMG} unit s mkpart root ${ROOTFS_START} 100%
+
+       parted ${GPTIMG} print
+
+       # Delete the boot image to avoid trouble with the build cache
+       rm -f ${WORKDIR}/${BOOT_IMG}

what about use BOOT_IMG = "boot-${MACHINE}-${DATETIME}.img" instead? That will leave the previous build for debug and avoid trouble.

BOOT_IMG seems will not be deleted automatically so i delete it in here. If we leave the previous build, it will make a mess.

Quoted 57 lines

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition image
+       BOOT_BLOCKS=$(LC_ALL=C parted -s ${GPTIMG} unit b print | 

awk '/ 6 / { print substr($4, 1, length($4 -1)) / 512 /2 }')

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+       BOOT_BLOCKS=`expr $BOOT_BLOCKS / 63 \* 63`
+
+       mkfs.vfat -n "boot" -S 512 -C ${WORKDIR}/${BOOT_IMG} 

$BOOT_BLOCKS

classes/rockchip-gpt-img.bbclass line 96

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s 

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}

classes/rockchip-gpt-img.bbclass

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+
+       DEVICETREE_DEFAULT=""
+       for DTS_FILE in ${KERNEL_DEVICETREE}; do
+               [ -n "${DEVICETREE_DEFAULT}"] && 

DEVICETREE_DEFAULT="${DTS_FILE}"

classes/rockchip-gpt-img.bbclass line 101

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+               mcopy -i ${WORKDIR}/${BOOT_IMG} -s 

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_FILE} ::${DTS_FILE}

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+       done
+
+       # Create extlinux config file
+       cat > ${WORKDIR}/extlinux.conf <<EOF

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+default yocto
+
+label yocto
+       kernel /${KERNEL_IMAGETYPE}
+       devicetree /${DEVICETREE_DEFAULT}
+       append ${GPTIMG_APPEND}
+EOF
+
+       mmd -i ${WORKDIR}/${BOOT_IMG} ::/extlinux
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${WORKDIR}/extlinux.conf 

::/extlinux/

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn Boot Partition
+       dd if=${WORKDIR}/${BOOT_IMG} of=${GPTIMG} conv=notrunc,fsync 

seek=${BOOT_START}

classes/rockchip-gpt-img.bbclass line 125

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+       # Burn Rootfs Partition
+       dd if=${IMG_ROOTFS} of=${GPTIMG} seek=${ROOTFS_START}
+
+}
+
+generate_rk3288_image () {

It is not only for rk3288. In fact, This function is for create load1 partition. So what about using generate_load1 or create_loader1 ?

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn bootloader
+       mkimage -n rk3288 -T rksd -d 

${DEPLOY_DIR_IMAGE}/${SPL_BINARY} ${WORKDIR}/${UBOOT}

classes/rockchip-gpt-img.bbclass line 129

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       cat ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin >> 

${WORKDIR}/${UBOOT}

classes/rockchip-gpt-img.bbclass line 130

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       dd if=${WORKDIR}/${UBOOT} of=${GPTIMG} conv=notrunc,fsync 

seek=64

Quoted 5 lines
classes/rockchip-gpt-img.bbclass new file +2 -1
+
+}
--

2.12.0.rc1.48.g076c053

Quoted 5 lines
Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected] <mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]>

#26 lore raw

Re: [meta-rockchip][PATCH v2 4/5] classes: rockchip-gpt-img: add

Hi

2017-02-19 16:31 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 62 lines

Hi all,

Eddie Cai wrote on 2017年02月19日 14:32:

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 2 lines

This bbclass was taken from the Rockchip team's work at
https://github.com/rockchip-linux/meta-rockchip/commit/

53d2e2e474a3014e3013d0059fd1da773fb0e2b7

Quoted 1 line

It was mostly written by Jacob Chen <[email protected]>. I've made

some

Quoted 3 lines

small modifications and added it.

Older images used (what Rockchip calls) the "rk-boot" format. Newer

images use
We call it legacy parameter format

Quoted 1 line

u-boot and a GPT partitioning scheme. This class allows the build to

generate

Quoted 1 line

a gpt-img file that can either be flashed to eMMC or written to an

SDcard (the

Quoted 1 line

same image is used for both).

gpt-img is much better than previous one. I like this name.

Quoted 2 lines

This is the new image format used for rk3288 SoCs (e.g. the Firefly

board).

Quoted 4 lines
---
 classes/rockchip-gpt-img.bbclass | 132 ++++++++++++++++++++++++++++++

+++++++++

Review

Quoted 4 lines
 1 file changed, 132 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
(quoted diff) +0 -0

b/classes/rockchip-gpt-img.bbclass

Quoted 11 lines

new file mode 100644
index 0000000..fd80625

classes/rockchip-gpt-img.bbclass new file +6 -0
@@ -0,0 +1,132 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+inherit image_types
+

classes/rockchip-gpt-img.bbclass line 16

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+# Use an uncompressed ext4 by default as rootfs
+IMG_ROOTFS_TYPE = "ext4"
+IMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${IMG_ROOTFS_TYPE}"
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_rockchip-gpt-img = "${IMG_ROOTFS_TYPE}"
+
+GPTIMG_SUFFIX  = "gpt-img"
+GPTIMG         = "${IMAGE_NAME}.${GPTIMG_SUFFIX}"
+GPTIMG_SIZE   ?= "4096"

This should be GPT size in sectors which is 64 sectors. The name GPTIMG_SIZE is not clear enough. People may think it is whole gpt image. What about call it GPT_SIZE?

Quoted 2 lines

It's whole gpt image.

OK, my mistake. So that look good to me.

Quoted 30 lines

classes/rockchip-gpt-img.bbclass

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +5 -0
+BOOT_IMG       = "boot.img"
+MINILOADER     = "loader.bin"
+UBOOT          = "u-boot.out"
+TRUST          = "trust.out"
+GPTIMG_APPEND ?= "console=tty1 console=ttyS2,115200n8 rw

root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"

Quoted 8 lines
classes/rockchip-gpt-img.bbclass new file +8 -0
+
+# default partitions [in Sectors]
+# More info at http://rockchip.wikidot.com/partitions
+LOADER1_SIZE = "8000"
+RESERVED1_SIZE = "128"
+RESERVED2_SIZE = "8192"
+LOADER2_SIZE = "8192"
+ATF_SIZE = "8192"

classes/rockchip-gpt-img.bbclass line 39

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+BOOT_SIZE = "229376"
+
+IMAGE_DEPENDS_rockchip-gpt-img = "parted-native \
+       u-boot-mkimage-native \
+       mtools-native \
+       dosfstools-native \
+       virtual/kernel:do_deploy \
+       virtual/bootloader:do_deploy"
+
+PER_CHIP_IMG_GENERATION_COMMAND_rk3288 = "generate_rk3288_image"

This is not just for rk3288. in fact, it can be used for all the Rockchip SoC.

Quoted 4 lines

There're many differences between Chips.
Some chips didn't implement SPL support and have to use rk-miniloader to create u-boot blob. (e.g. previous rk3399, rk3229)

all the chips supported by uboot-rockchip and upstream u-boot have SPL support . The legacy should go to use legacy update image intead.

Quoted 3 lines

Some chips didn't use "spl_back_to_brom" so their tpl have a different offset.(e.g. previous rk3288)

The back_to_brom is not chip configuration. It is board configuration.
Actually all the rk3288 board in uboot-rockchip and upstream u-boot support it now.

Quoted 3 lines

The name "generate_load1" can't express it clearly.

Sorry, should be generate_loader1 which is the partition name shows in
http://rockchip.wikidot.com/partitions

Quoted 64 lines

classes/rockchip-gpt-img.bbclass line 46

Quoted 9 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+IMAGE_CMD_rockchip-gpt-img () {
+       # Change to image directory
+       cd ${DEPLOY_DIR_IMAGE}
+
+       # Remove the exist image
+       rm -rf *${GPTIMG_SUFFIX}

${IMAGE_NAME} is derived using the IMAGE_BASENAME, MACHINE, and DATETIME variables. So we don't need to delete previous one to avoid mistake.

Quoted 17 lines
classes/rockchip-gpt-img.bbclass new file +17 -0
+
+       create_rk_image
+
+       ${PER_CHIP_IMG_GENERATION_COMMAND}
+
+       cd ${DEPLOY_DIR_IMAGE}
+       ln -s ${GPTIMG} "${IMAGE_BASENAME}-${MACHINE}.${GPTIMG_SUFFIX}"
+}
+
+create_rk_image () {
+
+       # Initialize sdcard image file
+       dd if=/dev/zero of=${GPTIMG} bs=1M count=0 seek=${GPTIMG_SIZE}
+
+       # Create partition table
+       parted -s ${GPTIMG} mklabel gpt
+

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+       # Create vendor defined partitions
+       LOADER1_START=64
+       RESERVED1_START=`expr ${LOADER1_START}  + ${LOADER1_SIZE}`
+       RESERVED2_START=`expr ${RESERVED1_START}  + ${RESERVED1_SIZE}`
+       LOADER2_START=`expr ${RESERVED2_START}  + ${RESERVED2_SIZE}`
+       ATF_START=`expr ${LOADER2_START}  + ${LOADER2_SIZE}`
+       BOOT_START=`expr ${ATF_START}  + ${ATF_SIZE}`
+       ROOTFS_START=`expr ${BOOT_START}  + ${BOOT_SIZE}`
+
+       parted -s ${GPTIMG} unit s mkpart loader1 ${LOADER1_START} `expr

${RESERVED1_START} - 1`

classes/rockchip-gpt-img.bbclass line 74

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved1 ${RESERVED1_START}

expr ${RESERVED2_START} - 1

classes/rockchip-gpt-img.bbclass line 75

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart reserved2 ${RESERVED2_START}

expr ${LOADER2_START} - 1

classes/rockchip-gpt-img.bbclass line 76

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart loader2 ${LOADER2_START} `expr

${ATF_START} - 1`

classes/rockchip-gpt-img.bbclass line 77

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       parted -s ${GPTIMG} unit s mkpart atf ${ATF_START} `expr

${BOOT_START} - 1`

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition and mark it as bootable
+       parted -s ${GPTIMG} unit s mkpart boot ${BOOT_START} `expr

${ROOTFS_START} - 1`

classes/rockchip-gpt-img.bbclass line 89

Quoted 9 lines
classes/rockchip-gpt-img.bbclass new file +9 -0
+       parted -s ${GPTIMG} set 6 boot on
+
+       # Create rootfs partition
+       parted -s ${GPTIMG} unit s mkpart root ${ROOTFS_START} 100%
+
+       parted ${GPTIMG} print
+
+       # Delete the boot image to avoid trouble with the build cache
+       rm -f ${WORKDIR}/${BOOT_IMG}

what about use BOOT_IMG = "boot-${MACHINE}-${DATETIME}.img" instead? That will leave the previous build for debug and avoid trouble.

Quoted 3 lines

BOOT_IMG seems will not be deleted automatically so i delete it in here. If we leave the previous build, it will make a mess.

Can you try to fix it instead of just delete it? I believe add a timestamp can help.

Quoted 69 lines

classes/rockchip-gpt-img.bbclass

Quoted 6 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition image
+       BOOT_BLOCKS=$(LC_ALL=C parted -s ${GPTIMG} unit b print | awk '/

6 / { print substr($4, 1, length($4 -1)) / 512 /2 }')

classes/rockchip-gpt-img.bbclass

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+       BOOT_BLOCKS=`expr $BOOT_BLOCKS / 63 \* 63`
+
+       mkfs.vfat -n "boot" -S 512 -C ${WORKDIR}/${BOOT_IMG} $BOOT_BLOCKS
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin

::${KERNEL_IMAGETYPE}

classes/rockchip-gpt-img.bbclass

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+
+       DEVICETREE_DEFAULT=""
+       for DTS_FILE in ${KERNEL_DEVICETREE}; do
+               [ -n "${DEVICETREE_DEFAULT}"] &&

DEVICETREE_DEFAULT="${DTS_FILE}"

classes/rockchip-gpt-img.bbclass line 101

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+               mcopy -i ${WORKDIR}/${BOOT_IMG} -s

${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_FILE} ::${DTS_FILE}

Quoted 4 lines
classes/rockchip-gpt-img.bbclass new file +4 -0
+       done
+
+       # Create extlinux config file
+       cat > ${WORKDIR}/extlinux.conf <<EOF

classes/rockchip-gpt-img.bbclass

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+default yocto
+
+label yocto
+       kernel /${KERNEL_IMAGETYPE}
+       devicetree /${DEVICETREE_DEFAULT}
+       append ${GPTIMG_APPEND}
+EOF
+
+       mmd -i ${WORKDIR}/${BOOT_IMG} ::/extlinux
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${WORKDIR}/extlinux.conf

::/extlinux/

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn Boot Partition
+       dd if=${WORKDIR}/${BOOT_IMG} of=${GPTIMG} conv=notrunc,fsync

seek=${BOOT_START}

classes/rockchip-gpt-img.bbclass line 125

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+       # Burn Rootfs Partition
+       dd if=${IMG_ROOTFS} of=${GPTIMG} seek=${ROOTFS_START}
+
+}
+
+generate_rk3288_image () {

It is not only for rk3288. In fact, This function is for create load1 partition. So what about using generate_load1 or create_loader1 ?

classes/rockchip-gpt-img.bbclass

Quoted 3 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn bootloader
+       mkimage -n rk3288 -T rksd -d ${DEPLOY_DIR_IMAGE}/${SPL_BINARY}

${WORKDIR}/${UBOOT}

classes/rockchip-gpt-img.bbclass line 129

Quoted 1 line
classes/rockchip-gpt-img.bbclass new file +1 -0
+       cat ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin >>

${WORKDIR}/${UBOOT}

Quoted 11 lines
classes/rockchip-gpt-img.bbclass new file +3 -1
+       dd if=${WORKDIR}/${UBOOT} of=${GPTIMG} conv=notrunc,fsync seek=64
+
+}
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]> <[email protected]>

#8 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

In reply to Trevor Woerner

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 27 lines

This recipe was taken from the Rockchip team's recipe at
https://github.com/rockchip-linux/meta-rockchip/commit/6a139d5b7510c7ba36aace82c239b894d5741cac

It was mostly written by Jacob Chen <[email protected]> and I've made a couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +9 -0
new file mode 100644
index 0000000..3b4f109
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 10 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +10 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

Quoted 8 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#9 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

2017-02-19 22:22 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 34 lines

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 2 lines

This recipe was taken from the Rockchip team's recipe at
https://github.com/rockchip-linux/meta-rockchip/commit/

6a139d5b7510c7ba36aace82c239b894d5741cac

Quoted 2 lines

It was mostly written by Jacob Chen <[email protected]> and I've

made a

Review

Quoted 9 lines

couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
(quoted diff) +0 -0

b/recipes-bsp/u-boot/u-boot-rockchip_git.bb

Quoted 5 lines

new file mode 100644
index 0000000..3b4f109

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 9

Quoted 9 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +9 -0
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=

a2c678cfd4a4d97135585cad908541c6"

Quoted 13 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 10 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +10 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

It works for me. Did you delete build/tmp?

Quoted 15 lines
Quoted 9 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#10 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

2017-02-19 22:33 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 51 lines

2017-02-19 22:22 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 34 lines

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 2 lines

This recipe was taken from the Rockchip team's recipe at
https://github.com/rockchip-linux/meta-rockchip/commit/6a139

d5b7510c7ba36aace82c239b894d5741cac

Quoted 2 lines

It was mostly written by Jacob Chen <[email protected]> and I've

made a

Review

Quoted 9 lines

couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
(quoted diff) +0 -0

b/recipes-bsp/u-boot/u-boot-rockchip_git.bb

Quoted 5 lines

new file mode 100644
index 0000000..3b4f109

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 9

Quoted 9 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +9 -0
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2

c678cfd4a4d97135585cad908541c6"

Quoted 13 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 10 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +10 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

Quoted 2 lines

It works for me. Did you delete build/tmp?

I failed when i did a clean build(delete build dir). I modify
do_deploy_prepend to do_install_prepend. Everything is fine. I guess i
can build before because sstate-cache cache the previous build data.

Quoted 17 lines
Quoted 15 lines
Quoted 9 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#11 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

I'll have to investigate this further. From a completely clean build do_install_prepend always fails the first time, but simply restarting the build again causes it to succeed. With do_deploy_prepend it always succeeds without issue whether its the first or subsequent tries.

Quoted 79 lines · Eddie Cai

2017-02-19 22:33 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 53 lines

2017-02-19 22:22 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 40 lines

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 36 lines

This recipe was taken from the Rockchip team's recipe at

https://github.com/rockchip-linux/meta-rockchip/commit/6a139d5b7510c7ba36aace82c239b894d5741cac

It was mostly written by Jacob Chen <[email protected]> and I've made a
couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +9 -0
new file mode 100644
index 0000000..3b4f109
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM =

"file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"

recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +5 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
Quoted 8 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 5 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +5 -0
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

Quoted 1 line

It works for me. Did you delete build/tmp?

I failed when i did a clean build(delete build dir). I modify
do_deploy_prepend to do_install_prepend. Everything is fine. I guess i can
build before because sstate-cache cache the previous build data.

Quoted 17 lines
Quoted 15 lines
Quoted 10 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#12 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

I can't reproduce the problem you're seeing and I'm interested in knowing more about how you're building to see if I can reproduce it.

I've done 4 builds: 2 on master, 2 on morty; one of which (for each master and morty) is poky and one on OE's nodistro. All of them are able to build this recipe (as I've contributed it) whether or not it's the first time, or it's in sstate, after a clean, on a fresh build... That's why I "fixed" this line, because with the previous line it always failed once and then work the second time the build was run.

Maybe you could post the build configuration from your build? That way I could see what layers you're enabling and at what revisions? Mine is:

meta-rockchip =
devs/twoerner/feb-updates-2:c252843cf2bf8326ccf2b552b59209f7a2ac3f16
meta = master:def3800c7e58d9d1b54ea1df27b190a0f6d1d544

Quoted 85 lines · Trevor Woerner

I'll have to investigate this further. From a completely clean build do_install_prepend always fails the first time, but simply restarting the build again causes it to succeed. With do_deploy_prepend it always succeeds without issue whether its the first or subsequent tries.

Quoted 79 lines · Eddie Cai

2017-02-19 22:33 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 53 lines

2017-02-19 22:22 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 40 lines

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 36 lines

This recipe was taken from the Rockchip team's recipe at

https://github.com/rockchip-linux/meta-rockchip/commit/6a139d5b7510c7ba36aace82c239b894d5741cac

It was mostly written by Jacob Chen <[email protected]> and I've made a
couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +9 -0
new file mode 100644
index 0000000..3b4f109
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM =

"file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"

recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +5 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=release;"
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
Quoted 8 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 5 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +5 -0
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

Quoted 1 line

It works for me. Did you delete build/tmp?

I failed when i did a clean build(delete build dir). I modify
do_deploy_prepend to do_install_prepend. Everything is fine. I guess i can
build before because sstate-cache cache the previous build data.

Quoted 17 lines
Quoted 15 lines
Quoted 10 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#27 lore raw

Re: [meta-rockchip][PATCH v2 4/5] classes: rockchip-gpt-img: add

In reply to Eddie Cai

Okay, thanks for the review!! I'll create a v3 and post it next week. I'm away and don't have a board with me to test.

Quoted 262 lines · Eddie Cai

Hi

2017-02-19 16:31 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 64 lines

Hi all,

Eddie Cai wrote on 2017年02月19日 14:32:

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 9 lines

This bbclass was taken from the Rockchip team's work at

https://github.com/rockchip-linux/meta-rockchip/commit/53d2e2e474a3014e3013d0059fd1da773fb0e2b7
It was mostly written by Jacob Chen <[email protected]>. I've made some
small modifications and added it.

Older images used (what Rockchip calls) the "rk-boot" format. Newer images use

We call it legacy parameter format

Quoted 5 lines

u-boot and a GPT partitioning scheme. This class allows the build to generate
a gpt-img file that can either be flashed to eMMC or written to an SDcard (the
same image is used for both).

gpt-img is much better than previous one. I like this name.

Quoted 24 lines

This is the new image format used for rk3288 SoCs (e.g. the Firefly board).

---
 classes/rockchip-gpt-img.bbclass | 132
+++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 classes/rockchip-gpt-img.bbclass
classes/rockchip-gpt-img.bbclass new file +6 -0
new file mode 100644
index 0000000..fd80625
@@ -0,0 +1,132 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+inherit image_types
+

classes/rockchip-gpt-img.bbclass line 16

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+# Use an uncompressed ext4 by default as rootfs
+IMG_ROOTFS_TYPE = "ext4"
+IMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${IMG_ROOTFS_TYPE}"
+
+# This image depends on the rootfs image
+IMAGE_TYPEDEP_rockchip-gpt-img = "${IMG_ROOTFS_TYPE}"
+
+GPTIMG_SUFFIX  = "gpt-img"
+GPTIMG         = "${IMAGE_NAME}.${GPTIMG_SUFFIX}"
+GPTIMG_SIZE   ?= "4096"

This should be GPT size in sectors which is 64 sectors. The name GPTIMG_SIZE is not clear enough. People may think it is whole gpt image. What about call it GPT_SIZE?

Quoted 1 line

It's whole gpt image.

OK, my mistake. So that look good to me.

Quoted 31 lines
Quoted 17 lines
classes/rockchip-gpt-img.bbclass new file +5 -0
+BOOT_IMG       = "boot.img"
+MINILOADER     = "loader.bin"
+UBOOT          = "u-boot.out"
+TRUST          = "trust.out"
+GPTIMG_APPEND ?= "console=tty1 console=ttyS2,115200n8 rw

root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"

classes/rockchip-gpt-img.bbclass new file +8 -0
+
+# default partitions [in Sectors]
+# More info at http://rockchip.wikidot.com/partitions
+LOADER1_SIZE = "8000"
+RESERVED1_SIZE = "128"
+RESERVED2_SIZE = "8192"
+LOADER2_SIZE = "8192"
+ATF_SIZE = "8192"

classes/rockchip-gpt-img.bbclass line 39

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +10 -0
+BOOT_SIZE = "229376"
+
+IMAGE_DEPENDS_rockchip-gpt-img = "parted-native \
+       u-boot-mkimage-native \
+       mtools-native \
+       dosfstools-native \
+       virtual/kernel:do_deploy \
+       virtual/bootloader:do_deploy"
+
+PER_CHIP_IMG_GENERATION_COMMAND_rk3288 = "generate_rk3288_image"

This is not just for rk3288. in fact, it can be used for all the Rockchip SoC.

Quoted 3 lines

There're many differences between Chips.
Some chips didn't implement SPL support and have to use rk-miniloader to create u-boot blob. (e.g. previous rk3399, rk3229)

all the chips supported by uboot-rockchip and upstream u-boot have SPL support . The legacy should go to use legacy update image intead.

Quoted 3 lines

Some chips didn't use "spl_back_to_brom" so their tpl have a different offset.(e.g. previous rk3288)

The back_to_brom is not chip configuration. It is board configuration.
Actually all the rk3288 board in uboot-rockchip and upstream u-boot support it now.

Quoted 3 lines

The name "generate_load1" can't express it clearly.

Sorry, should be generate_loader1 which is the partition name shows in
http://rockchip.wikidot.com/partitions

Quoted 65 lines

classes/rockchip-gpt-img.bbclass line 46

Quoted 10 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+IMAGE_CMD_rockchip-gpt-img () {
+       # Change to image directory
+       cd ${DEPLOY_DIR_IMAGE}
+
+       # Remove the exist image
+       rm -rf *${GPTIMG_SUFFIX}

${IMAGE_NAME} is derived using the IMAGE_BASENAME, MACHINE, and DATETIME variables. So we don't need to delete previous one to avoid mistake.

Quoted 40 lines
classes/rockchip-gpt-img.bbclass new file +27 -0
+
+       create_rk_image
+
+       ${PER_CHIP_IMG_GENERATION_COMMAND}
+
+       cd ${DEPLOY_DIR_IMAGE}
+       ln -s ${GPTIMG} "${IMAGE_BASENAME}-${MACHINE}.${GPTIMG_SUFFIX}"
+}
+
+create_rk_image () {
+
+       # Initialize sdcard image file
+       dd if=/dev/zero of=${GPTIMG} bs=1M count=0 seek=${GPTIMG_SIZE}
+
+       # Create partition table
+       parted -s ${GPTIMG} mklabel gpt
+
+       # Create vendor defined partitions
+       LOADER1_START=64
+       RESERVED1_START=`expr ${LOADER1_START}  + ${LOADER1_SIZE}`
+       RESERVED2_START=`expr ${RESERVED1_START}  + ${RESERVED1_SIZE}`
+       LOADER2_START=`expr ${RESERVED2_START}  + ${RESERVED2_SIZE}`
+       ATF_START=`expr ${LOADER2_START}  + ${LOADER2_SIZE}`
+       BOOT_START=`expr ${ATF_START}  + ${ATF_SIZE}`
+       ROOTFS_START=`expr ${BOOT_START}  + ${BOOT_SIZE}`
+
+       parted -s ${GPTIMG} unit s mkpart loader1 ${LOADER1_START} `expr

${RESERVED1_START} - 1`
+ parted -s ${GPTIMG} unit s mkpart reserved1 ${RESERVED1_START}
expr ${RESERVED2_START} - 1
+ parted -s ${GPTIMG} unit s mkpart reserved2 ${RESERVED2_START}
expr ${LOADER2_START} - 1
+ parted -s ${GPTIMG} unit s mkpart loader2 ${LOADER2_START} `expr
${ATF_START} - 1`
+ parted -s ${GPTIMG} unit s mkpart atf ${ATF_START} `expr
${BOOT_START} - 1`

classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition and mark it as bootable
+       parted -s ${GPTIMG} unit s mkpart boot ${BOOT_START} `expr

${ROOTFS_START} - 1`

classes/rockchip-gpt-img.bbclass line 89

Quoted 9 lines
classes/rockchip-gpt-img.bbclass new file +9 -0
+       parted -s ${GPTIMG} set 6 boot on
+
+       # Create rootfs partition
+       parted -s ${GPTIMG} unit s mkpart root ${ROOTFS_START} 100%
+
+       parted ${GPTIMG} print
+
+       # Delete the boot image to avoid trouble with the build cache
+       rm -f ${WORKDIR}/${BOOT_IMG}

what about use BOOT_IMG = "boot-${MACHINE}-${DATETIME}.img" instead? That will leave the previous build for debug and avoid trouble.

Quoted 2 lines

BOOT_IMG seems will not be deleted automatically so i delete it in here. If we leave the previous build, it will make a mess.

Can you try to fix it instead of just delete it? I believe add a timestamp can help.

Quoted 70 lines
Quoted 40 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Create boot partition image
+       BOOT_BLOCKS=$(LC_ALL=C parted -s ${GPTIMG} unit b print | awk '/

6 / { print substr($4, 1, length($4 -1)) / 512 /2 }')

classes/rockchip-gpt-img.bbclass new file +3 -0
+       BOOT_BLOCKS=`expr $BOOT_BLOCKS / 63 \* 63`
+
+       mkfs.vfat -n "boot" -S 512 -C ${WORKDIR}/${BOOT_IMG}

$BOOT_BLOCKS
+ mcopy -i ${WORKDIR}/${BOOT_IMG} -s
${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}

classes/rockchip-gpt-img.bbclass new file +4 -0
+
+       DEVICETREE_DEFAULT=""
+       for DTS_FILE in ${KERNEL_DEVICETREE}; do
+               [ -n "${DEVICETREE_DEFAULT}"] &&

DEVICETREE_DEFAULT="${DTS_FILE}"
+ mcopy -i ${WORKDIR}/${BOOT_IMG} -s
${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_FILE} ::${DTS_FILE}

classes/rockchip-gpt-img.bbclass new file +14 -0
+       done
+
+       # Create extlinux config file
+       cat > ${WORKDIR}/extlinux.conf <<EOF
+default yocto
+
+label yocto
+       kernel /${KERNEL_IMAGETYPE}
+       devicetree /${DEVICETREE_DEFAULT}
+       append ${GPTIMG_APPEND}
+EOF
+
+       mmd -i ${WORKDIR}/${BOOT_IMG} ::/extlinux
+       mcopy -i ${WORKDIR}/${BOOT_IMG} -s ${WORKDIR}/extlinux.conf

::/extlinux/

classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn Boot Partition
+       dd if=${WORKDIR}/${BOOT_IMG} of=${GPTIMG} conv=notrunc,fsync

seek=${BOOT_START}

classes/rockchip-gpt-img.bbclass line 125

Quoted 7 lines
classes/rockchip-gpt-img.bbclass new file +7 -0
+
+       # Burn Rootfs Partition
+       dd if=${IMG_ROOTFS} of=${GPTIMG} seek=${ROOTFS_START}
+
+}
+
+generate_rk3288_image () {

It is not only for rk3288. In fact, This function is for create load1 partition. So what about using generate_load1 or create_loader1 ?

Quoted 13 lines
classes/rockchip-gpt-img.bbclass new file +3 -0
+
+       # Burn bootloader
+       mkimage -n rk3288 -T rksd -d ${DEPLOY_DIR_IMAGE}/${SPL_BINARY}

${WORKDIR}/${UBOOT}
+ cat ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin >>
${WORKDIR}/${UBOOT}
+ dd if=${WORKDIR}/${UBOOT} of=${GPTIMG} conv=notrunc,fsync
seek=64

classes/rockchip-gpt-img.bbclass new file +2 -1
+
+}
--

2.12.0.rc1.48.g076c053

Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]>

#21 lore raw

Re: [meta-rockchip][PATCH v2 3/5] machine: firefly-rk3288: specify bootloader

In reply to Jacob Chen

Great, thanks for the review!

Quoted 52 lines · Jacob Chen

Hi Trevor,

2017-02-19 13:03 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 36 lines

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 8 lines

Set the default preferred bootloader for firefly-rk3288 to be u-boot-rockchip and set the default name of the SPL binary.

---
 conf/machine/firefly-rk3288.conf | 1 +
 conf/machine/include/rk3288.inc  | 3 +++
 2 files changed, 4 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 24 lines
conf/machine/firefly-rk3288.conf +1 -0
index 8fa005d..58d752b 100644
@@ -8,3 +8,4 @@
 
 include conf/machine/include/rk3288.inc
 KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+UBOOT_MACHINE = "firefly-rk3288_defconfig"
conf/machine/include/rk3288.inc +3 -1
index 769e5c1..4a4201f 100644
@@ -10,3 +10,6 @@ PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
 KERNEL_IMAGETYPE = "zImage"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
+SPL_BINARY ?= "u-boot-spl-dtb.bin"
--

2.12.0.rc1.48.g076c053

Quoted 10 lines
Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]>

#3 lore raw

Re: [meta-rockchip][PATCH v2 1/5] machine: rk3288: enable SoC-specific assignments

In reply to Eddie Cai

Almost. The file you created a patch against had DEFAULTTUNE which has been removed so I had to create a new patch that would apply. If you're happy with this patch (which is very similar to yours) I'll add your signed-off-by line to it when I commit?

Quoted 36 lines · Eddie Cai

Hi Trevor

Is this the same one i submit before?
https://www.mail-archive.com/[email protected]/msg33572.html

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 30 lines

Enable machine overrides for RK3288.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
conf/machine/include/rk3288.inc +3 -1
index 86fc567..769e5c1 100644
@@ -1,7 +1,10 @@
 # Copyright (C) 2015 Romain Perier
 # Released under the MIT license (see COPYING.MIT for the terms)
 
+SOC_FAMILY = "rk3288"
+
 require conf/machine/include/tune-cortexa17.inc
+require conf/machine/include/soc-family.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#4 lore raw

Re: [meta-rockchip][PATCH v2 1/5] machine: rk3288: enable SoC-specific assignments

Hi Trevor

2017-02-22 6:25 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 5 lines

Almost. The file you created a patch against had DEFAULTTUNE which has been removed so I had to create a new patch that would apply. If you're happy with this patch (which is very similar to yours) I'll add your signed-off-by line to it when I commit?

Sure, My pleasure.

Quoted 41 lines
Quoted 6 lines · Eddie Cai

Hi Trevor

Is this the same one i submit before?
https://www.mail-archive.com/[email protected]/msg33572.html

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 8 lines

Review

Quoted 8 lines

Enable machine overrides for RK3288.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/conf/machine/include/rk3288.inc

Quoted 22 lines
Quoted 22 lines

index 86fc567..769e5c1 100644

conf/machine/include/rk3288.inc +3 -1
@@ -1,7 +1,10 @@
 # Copyright (C) 2015 Romain Perier
 # Released under the MIT license (see COPYING.MIT for the terms)
 
+SOC_FAMILY = "rk3288"
+
 require conf/machine/include/tune-cortexa17.inc
+require conf/machine/include/soc-family.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#13 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

In reply to Trevor Woerner

Hi Trevor

Here is mine

Build Configuration:

BB_VERSION        = "1.32.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "universal"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "firefly-rk3288"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2.1"
TUNE_FEATURES     = "arm armv7ve vfp  neon  vfpv4  callconvention-hard

cortexa17"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "HEAD:6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f"
meta-rockchip =
"review-uboot-gtpimg-v2:5e181d4e74c50e290b507b1a990b1517eaffcea6"

BBLAYERS ?= " \
${BSPDIR}/src/poky/meta \
${BSPDIR}/src/poky/meta-poky \
${BSPDIR}/src/poky/meta-yocto-bsp \
${BSPDIR}/src/meta-rockchip \

2017-02-22 6:18 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 111 lines

I can't reproduce the problem you're seeing and I'm interested in knowing more about how you're building to see if I can reproduce it.

I've done 4 builds: 2 on master, 2 on morty; one of which (for each master and morty) is poky and one on OE's nodistro. All of them are able to build this recipe (as I've contributed it) whether or not it's the first time, or it's in sstate, after a clean, on a fresh build... That's why I "fixed" this line, because with the previous line it always failed once and then work the second time the build was run.

Maybe you could post the build configuration from your build? That way I could see what layers you're enabling and at what revisions? Mine is:

meta-rockchip =
devs/twoerner/feb-updates-2:c252843cf2bf8326ccf2b552b59209f7a2ac3f16
meta = master:def3800c7e58d9d1b54ea1df27b190a0f6d1d544

Quoted 6 lines · Trevor Woerner

I'll have to investigate this further. From a completely clean build do_install_prepend always fails the first time, but simply restarting the build again causes it to succeed. With do_deploy_prepend it always succeeds without issue whether its the first or subsequent tries.

On Mon, Feb 20, 2017 at 6:14 AM, Eddie Cai <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines

2017-02-19 22:33 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 3 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

2017-02-19 22:22 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 7 lines

Hi,

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 3 lines

This recipe was taken from the Rockchip team's recipe at

https://github.com/rockchip-linux/meta-rockchip/commit/

6a139d5b7510c7ba36aace82c239b894d5741cac

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

It was mostly written by Jacob Chen <[email protected]> and

I've

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines

made a
couple small modifications.

---
 recipes-bsp/u-boot/u-boot-rockchip_git.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-rockchip_git.bb
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +5 -0
new file mode 100644
index 0000000..3b4f109
@@ -0,0 +1,19 @@
+# Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+# Copyright (C) 2017 Trevor Woerner <[email protected]>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require recipes-bsp/u-boot/u-boot.inc
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb

Quoted 8 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +4 -0
+
+DESCRIPTION = "Rockchip next-dev U-Boot"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM =

"file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"

recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +3 -0
+COMPATIBLE_MACHINE = "(firefly-rk3288)"
+
+SRC_URI = "git://github.com/rockchip-linux/u-boot.git;branch=

release;"

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

recipes-bsp/u-boot/u-boot-rockchip_git.bb line 19

Quoted 7 lines
recipes-bsp/u-boot/u-boot-rockchip_git.bb new file +7 -0
+SRCREV = "${AUTOREV}"
+S = "${WORKDIR}/git"
+
+do_deploy_prepend () {
+       # copy to default search path
+       cp ${B}/spl/${SPL_BINARY} ${B}/
+}

I can't pass build if use do_deploy_prepend instead of do_install_prepend.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

It works for me. Did you delete build/tmp?

I failed when i did a clean build(delete build dir). I modify
do_deploy_prepend to do_install_prepend. Everything is fine. I guess

i can

Quoted 19 lines
Quoted 19 lines

build before because sstate-cache cache the previous build data.

Quoted 17 lines
Quoted 15 lines
Quoted 10 lines

--
2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#5 lore raw

Re: [meta-rockchip][PATCH v2 1/5] machine: rk3288: enable SoC-specific assignments

In reply to Eddie Cai

pushed, thanks!

Quoted 53 lines · Eddie Cai

Hi Trevor

2017-02-22 6:25 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 5 lines

Almost. The file you created a patch against had DEFAULTTUNE which has been removed so I had to create a new patch that would apply. If you're happy with this patch (which is very similar to yours) I'll add your signed-off-by line to it when I commit?

Sure, My pleasure.

Quoted 41 lines
Quoted 37 lines · Eddie Cai

Hi Trevor

Is this the same one i submit before?
https://www.mail-archive.com/[email protected]/msg33572.html

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 31 lines

Enable machine overrides for RK3288.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)
conf/machine/include/rk3288.inc +3 -1
index 86fc567..769e5c1 100644
@@ -1,7 +1,10 @@
 # Copyright (C) 2015 Romain Perier
 # Released under the MIT license (see COPYING.MIT for the terms)
 
+SOC_FAMILY = "rk3288"
+
 require conf/machine/include/tune-cortexa17.inc
+require conf/machine/include/soc-family.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author Applied
#22 lore raw

Re: [meta-rockchip][PATCH v2 3/5] machine: firefly-rk3288: specify bootloader

In reply to Trevor Woerner

applied, thanks!

Quoted 55 lines · Trevor Woerner

Great, thanks for the review!

Quoted 52 lines · Jacob Chen

Hi Trevor,

2017-02-19 13:03 GMT+08:00 Eddie Cai <[email protected]>:

Quoted 36 lines

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 8 lines

Set the default preferred bootloader for firefly-rk3288 to be u-boot-rockchip and set the default name of the SPL binary.

---
 conf/machine/firefly-rk3288.conf | 1 +
 conf/machine/include/rk3288.inc  | 3 +++
 2 files changed, 4 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 24 lines
conf/machine/firefly-rk3288.conf +1 -0
index 8fa005d..58d752b 100644
@@ -8,3 +8,4 @@
 
 include conf/machine/include/rk3288.inc
 KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+UBOOT_MACHINE = "firefly-rk3288_defconfig"
conf/machine/include/rk3288.inc +3 -1
index 769e5c1..4a4201f 100644
@@ -10,3 +10,6 @@ PREFERRED_PROVIDER_virtual/kernel = "linux"
 SERIAL_CONSOLES = "115200;ttyS2"
 KERNEL_IMAGETYPE = "zImage"
 KBUILD_DEFCONFIG = "multi_v7_defconfig"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
+SPL_BINARY ?= "u-boot-spl-dtb.bin"
--

2.12.0.rc1.48.g076c053

Quoted 10 lines
Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

It looks good, Reviewed-by: Jacob Chen <[email protected]>

author Applied
#31 lore raw

Re: [meta-rockchip][PATCH v2 5/5] machine: rk3288: GPT image support

In reply to Eddie Cai

applied, thanks!

Quoted 39 lines · Eddie Cai

Hi Trevor

2017-02-19 10:43 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 9 lines

Configure any rk3288 build to generate the new GPT image which is then either
flashed to eMMC or dd'ed to an SDcard.

---
 conf/machine/include/rk3288.inc | 3 +++
 1 file changed, 3 insertions(+)

Reviewed-by Eddie Cai <[email protected]>

Quoted 22 lines
conf/machine/include/rk3288.inc +3 -1
index 4a4201f..964d8b0 100644
@@ -13,3 +13,6 @@ KBUILD_DEFCONFIG = "multi_v7_defconfig"
 
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-rockchip"
 SPL_BINARY ?= "u-boot-spl-dtb.bin"
+
+IMAGE_FSTYPES = "ext4 rockchip-gpt-img"
+IMAGE_CLASSES += "rockchip-gpt-img"
--

2.12.0.rc1.48.g076c053

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#28 lore raw

Re: [meta-rockchip][PATCH v2 4/5] classes: rockchip-gpt-img: add

In reply to Trevor Woerner
Quoted 2 lines

what about use BOOT_IMG = "boot-${MACHINE}-${DATETIME}.img" instead? That will leave the previous build for debug and avoid trouble.

Using boot-${MACHINE}-${DATETIME}.img doesn't work, it leads to the following errors:

ERROR: When reparsing /z/rockchip/master/layers/openembedded-core/meta/recipes-core/images/core-image-minimal.bb.do_image_rockchip_gpt_img, the basehash value changed from 7150ddd4bffcc76eed6ec85216596f3b to 2c30fda706826e991aaf953180edc3b2. The metadata is not deterministic and this needs to be fixed.

#14 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

In reply to Eddie Cai
Quoted 17 lines · Eddie Cai

Build Configuration:

BB_VERSION        = "1.32.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "universal"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "firefly-rk3288"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2.1"
TUNE_FEATURES     = "arm armv7ve vfp  neon  vfpv4  callconvention-hard

cortexa17"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "HEAD:6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f"
meta-rockchip =
"review-uboot-gtpimg-v2:5e181d4e74c50e290b507b1a990b1517eaffcea6"

Quoted 5 lines

BBLAYERS ?= " \
${BSPDIR}/src/poky/meta \
${BSPDIR}/src/poky/meta-poky \
${BSPDIR}/src/poky/meta-yocto-bsp \
${BSPDIR}/src/meta-rockchip \

I can't reproduce the issue you're seeing, and your meta-rockchip branch sounds suspicious. In a completely fresh location with a fresh shell could you please try the following?

	$ mkdir -p ~/tmp/rockchip/layers
	$ cd ~/tmp/rockchip/layers
	$ git clone git://git.openembedded.org/openembedded-core
	$ git clone git://git.openembedded.org/bitbake
	$ git clone git://git.yoctoproject.org/meta-rockchip
	$ cd meta-rockchip
	$ git checkout devs/twoerner/feb-updates-2
	$ cd ~/tmp/rockchip
	$ . layers/openembedded-core/oe-init-build-env build layers/bitbake
	$ echo "BBLAYERS += \"$HOME/tmp/rockchip/layers/meta-rockchip\"" >> conf/bblayers.conf
	set conf/local.conf to:
		MACHINE ?= "firefly-rk3288"
		DISTRO ?= "nodistro"
		DL_DIR = "/opt/Downloads"
		DEFAULTTUNE_rk3288 = "cortexa17hf-neon-vfpv4"
		PACKAGE_CLASSES ?= "package_ipk"
		EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
		USER_CLASSES ?= "buildstats image-mklibs image-prelink"
		PATCHRESOLVE = "noop"
		BB_DISKMON_DIRS = "\
		    STOPTASKS,${TMPDIR},1G,100K \
		    STOPTASKS,${DL_DIR},1G,100K \
		    STOPTASKS,${SSTATE_DIR},1G,100K \
		    STOPTASKS,/tmp,100M,100K \
		    ABORT,${TMPDIR},100M,1K \
		    ABORT,${DL_DIR},100M,1K \
		    ABORT,${SSTATE_DIR},100M,1K \
		    ABORT,/tmp,10M,1K"
		PACKAGECONFIG_append_pn-qemu-native = " sdl"
		PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
		ASSUME_PROVIDED += "libsdl-native"
		CONF_VERSION = "1" 
	$ bitbake virtual/bootloader

The build configuration should look like:
Build Configuration:
BB_VERSION = "1.33.1"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "opensuse-42.2"
TARGET_SYS = "arm-oe-linux-gnueabi"
MACHINE = "firefly-rk3288"
DISTRO = "nodistro"
DISTRO_VERSION = "nodistro.0"
TUNE_FEATURES = "arm armv7ve vfp neon vfpv4 callconvention-hard cortexa17"
TARGET_FPU = "hard"
meta = "master:65cfc8aca3ff7e39453977a0215a350d13cb85ef"
meta-rockchip = "devs/twoerner/feb-updates-2:c252843cf2bf8326ccf2b552b59209f7a2ac3f16"

#15 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

I can assume everyone can build/include u-boot successfully when using unmodified repositories?

#16 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

2017-03-06 13:06 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 3 lines

I can assume everyone can build/include u-boot successfully when using unmodified repositories?

Yes, I can build it successfully.

#17 lore raw

Re: [meta-rockchip][PATCH v2 2/5] u-boot-rockchip: add

Quoted 6 lines · Eddie Cai

2017-03-06 13:06 GMT+08:00 Trevor Woerner <[email protected]>:

Quoted 3 lines

I can assume everyone can build/include u-boot successfully when using unmodified repositories?

Yes, I can build it successfully.

Excellent, thank you for the update. I'll push the commit to master.