From patchwork Mon Feb 12 20:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 39216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6805BC48BC3 for ; Mon, 12 Feb 2024 20:23:51 +0000 (UTC) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by mx.groups.io with SMTP id smtpd.web10.17133.1707769426828027484 for ; Mon, 12 Feb 2024 12:23:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cnZkccDC; spf=pass (domain: gmail.com, ip: 209.85.219.44, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-68ce2fe86e3so1081246d6.3 for ; Mon, 12 Feb 2024 12:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707769425; x=1708374225; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Xf+k/hp8bQdYqfH28ShXCKQOe6CzUtC96RrgMMnp4hw=; b=cnZkccDCOEtzP/gL/HLpSNO+hcYLUikjNnM9S1xuVSKItsqN7UVsbVuSJNLc30qSZ6 6ECVRn0Ren6KuCnOAquA7ITBK22nSjQeHuJsg/lc2lCjINeHiQbfJo0R+ZEDX8CCBkj3 JVCoBbk7gAV1sD82cAICxLYm/1X00xYmBCMYgV0w97X1dVMOjnCq4O4GfAlcc5OR+4vn XGKCjAV/wrAg8Hthv1mkD7tpHvh0/Ky+HvcgR8FHgqJciohr7opc4wlYiMlPL2w+Kne1 FSg7OgBvdKnLoDENGc/XT5vJLzzdlRFR+Rq4tLgyxmHYhvoTrzmochbq0qmGwXRi7zQc OsXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769425; x=1708374225; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Xf+k/hp8bQdYqfH28ShXCKQOe6CzUtC96RrgMMnp4hw=; b=v9VAuuSApMtoxE5lBTetbYFX9ZmrkbaFfmcL9d9s1lAKUQgQQUCBuCx6AA0f044n6l 8juqXzzuQbhxASBQWgFiOio4qMyh8pKfN3UPDfzWpx2IteakujjtD5R/bEZKZ7JIWwhe 9bjAZqDXek/OW3/oT/1dM17nktLG4rjWVobZI8IO0hRAY2mTKcJZgAFo34MHX86PgrA7 BFYvpQgH+706u7qldzoms0AjPVXM8mbrplacsm7JW0ZYTVNs3uSKp97sEQ7W1m3JFClm LurKmas3x2wbqOkFtT+sr0LlRXNAF0KXKZKStrFszjXsBsfjN7qAa9dwz0wAEx0UMcOn mssQ== X-Gm-Message-State: AOJu0YzO53tyZBtrVyIQnBvwmygcS3BB42yNOBKEf7+4130Uw6U6wW3z JC78iR+8zwovzAqPwW9J5DuDVYJ77Gevm1kuVXe/AszGVsoyRLPb9ISRKs2p X-Google-Smtp-Source: AGHT+IFHaQ6zmL82st+6WRQoWbzVz6M0ygkpthsr7DGTWqLFmYUpyw33Nk1f4o83GnerpYMYJvzhcQ== X-Received: by 2002:ad4:5caf:0:b0:68c:c43f:f988 with SMTP id q15-20020ad45caf000000b0068cc43ff988mr11705050qvh.8.1707769424791; Mon, 12 Feb 2024 12:23:44 -0800 (PST) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id oj9-20020a056214440900b0068d1c9801aesm477233qvb.66.2024.02.12.12.23.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:23:44 -0800 (PST) From: Trevor Woerner To: yocto@lists.yoctoproject.org Subject: [meta-rockchip][PATCH 1/4] rockchip.wks: specify fstype Date: Mon, 12 Feb 2024 15:23:39 -0500 Message-ID: <20240212202342.37778-1-twoerner@gmail.com> X-Mailer: git-send-email 2.43.0.76.g1a87c842ece3 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 12 Feb 2024 20:23:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/62464 If the wks file doesn't specify, the fstype is assumed to be vfat. Most of the partitions in the Rockchip layout don't have filesystems. Implicitly setting the fstype to vfat causes wic to format the partitions. Also, it doesn't make sense to format the rawcopy partitions as vfat, just to immediately overwrite them with binaries. Signed-off-by: Trevor Woerner Reviewed-by: Quentin Schulz --- wic/rockchip.wks | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wic/rockchip.wks b/wic/rockchip.wks index fac0b8f70112..b14ec0d1690a 100644 --- a/wic/rockchip.wks +++ b/wic/rockchip.wks @@ -17,12 +17,12 @@ # boot 32768 229376 # root 262144 - (suggested) -part loader1 --offset 32 --fixed-size 4000K --source rawcopy --sourceparams="file=${SPL_BINARY}" -part reserved1 --offset 4032 --fixed-size 64K -part reserved2 --offset 4096 --fixed-size 4096K -part loader2 --offset 8192 --fixed-size 4096K --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" -part atf --offset 12288 --fixed-size 4096K -part /boot --offset 16384 --size 114688K --active --source bootimg-partition --fstype=vfat --label boot --use-uuid --sourceparams="loader=u-boot" -part / --source rootfs --fstype=ext4 --label root --use-uuid +part loader1 --offset 32 --fixed-size 4000K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}" +part reserved1 --offset 4032 --fixed-size 64K --fstype=none +part reserved2 --offset 4096 --fixed-size 4096K --fstype=none +part loader2 --offset 8192 --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" +part atf --offset 12288 --fixed-size 4096K --fstype=none +part /boot --offset 16384 --size 114688K --fstype=vfat --active --source bootimg-partition --label boot --use-uuid --sourceparams="loader=u-boot" +part / --fstype=ext4 --source rootfs --label root --use-uuid bootloader --ptable gpt --append="console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 init=/sbin/init" From patchwork Mon Feb 12 20:23:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 39217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6663CC48BC1 for ; Mon, 12 Feb 2024 20:23:51 +0000 (UTC) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by mx.groups.io with SMTP id smtpd.web11.17313.1707769429196843182 for ; Mon, 12 Feb 2024 12:23:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Tec6TuwB; spf=pass (domain: gmail.com, ip: 209.85.219.43, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6861538916cso20724896d6.3 for ; Mon, 12 Feb 2024 12:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707769427; x=1708374227; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3lFrNolN2DyXT57DBwXVB2Im3zeTJwxi2dTdhZpB634=; b=Tec6TuwBceFufH6+s8d8VTdJ2JC5qa9kBNH+ZfZC8/2STTmhpsRu8NZBQXwjrFv5CL O7jvOUlKtlTk/K9gJ/dK4iC3aJNcOKRbrG5yWCTjn8DWaitfNDQcanIklorpzeAzfO2G 5xP/Tg1jogpOABpJV6t6xOJuqB8hhufaqop7lfTNGxzG5pqcPmE3qw19X80ffEmPosvM WRo2Yh2cocxqCB/6LxTxAWfgCA3FqDo6JH5PLUhchWoLUYUQDMZVFkAA/8VvWMWaq5dQ rbNB+sYD115oUBHaphdfFeNWtLlQ0dT9t5oMBayYmc3EwyFQcrRiZhIVChPlczIBaBns 9GDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769427; x=1708374227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3lFrNolN2DyXT57DBwXVB2Im3zeTJwxi2dTdhZpB634=; b=NDBrZvNG8Lb2JWS2zRZHFmYiZ6ZSyhgwtXsKcJJ8aY7j5ftR3qGe0HwJl1dt16Soy+ KWb8WlotXJm0KSqrz61RP/JgfYYTEeVjon00iIW14HAvDZ8Z0o8m/wGDIntONq7bGNC0 uiijPKDeLdvfGNe5Qpzm/WtLfXgIHhFaRFMcEj1vpwfapPaGIfU7OHPVebgGOrI2Vrt3 z42e+LA0PnAmY9uAOFlAMuC4tuo7fkMhFrULSJDiP7OoUbaEMICbez3R3RJI5m1Xa7TE 4mycqJrHHHUc1E8RzABne5pPHvaOBFUMxz7AJsyrK2OoIt+b08P4U0dWA8RxLmSi2U/f 9R7Q== X-Gm-Message-State: AOJu0YyhC8mkkK6MUyZLkpbYvWiMWMMUxq5vLxBgTX6tQBtHubW2CxYS lshoh9aJsj2uBASojV4aWP3OAWikSvYTMZo488lZ/4mWkp+G0x8DaourDIxl X-Google-Smtp-Source: AGHT+IHp492jt+xRM0FF9HR7H79H/JEO3yOK4XscLozYwXvxQaq9tr2fg9HdJQ+suxOo2VT5vAQ7Rg== X-Received: by 2002:a05:6214:c43:b0:686:acd2:4afc with SMTP id r3-20020a0562140c4300b00686acd24afcmr11852868qvj.17.1707769427220; Mon, 12 Feb 2024 12:23:47 -0800 (PST) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id oj9-20020a056214440900b0068d1c9801aesm477233qvb.66.2024.02.12.12.23.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:23:45 -0800 (PST) From: Trevor Woerner To: yocto@lists.yoctoproject.org Subject: [meta-rockchip][PATCH 2/4] rockchip.wks: add all Rockchip partitions Date: Mon, 12 Feb 2024 15:23:40 -0500 Message-ID: <20240212202342.37778-2-twoerner@gmail.com> X-Mailer: git-send-email 2.43.0.76.g1a87c842ece3 In-Reply-To: <20240212202342.37778-1-twoerner@gmail.com> References: <20240212202342.37778-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 12 Feb 2024 20:23:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/62465 Rockchip defines the expected layout/map of the default storage device. Fill out the wks description so it matches. https://opensource.rock-chips.com/wiki_Partitions Signed-off-by: Trevor Woerner --- wic/rockchip.wks | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/wic/rockchip.wks b/wic/rockchip.wks index b14ec0d1690a..8dc4d20f2f54 100644 --- a/wic/rockchip.wks +++ b/wic/rockchip.wks @@ -9,16 +9,22 @@ # wic uses 1KB blocks. The following table uses 512 byte sectors: # # Partition Start Sector Number of Sectors -# loader1 64 8000 (idbloader / U-Boot SPL) -# reserved1 8064 128 -# reserved2 8192 8192 +# loader1 64 7104 (idbloader / U-Boot SPL) +# vstorage 7168 512 (serial number, MAC address, etc) +# reserved 7680 384 (not used) +# reserved1 8064 64 (legacy DRM key) +# uboot_env 8128 64 (U-Boot environment) +# reserved2 8192 8192 (legacy parameters, ATAGS, etc) # loader2 16384 8192 (U-Boot proper) -# atf 24576 8192 +# atf 24576 8192 (trusted OS e.g. ATR, OP-TEE, etc) # boot 32768 229376 # root 262144 - (suggested) -part loader1 --offset 32 --fixed-size 4000K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}" -part reserved1 --offset 4032 --fixed-size 64K --fstype=none +part loader1 --offset 32 --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}" +part vstorage --offset 3584 --fixed-size 256K --fstype=none +part reserved --offset 3840 --fixed-size 192K --fstype=none +part reserved1 --offset 4032 --fixed-size 32K --fstype=none +part uboot_env --offset 4064 --fixed-size 32K --fstype=none part reserved2 --offset 4096 --fixed-size 4096K --fstype=none part loader2 --offset 8192 --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" part atf --offset 12288 --fixed-size 4096K --fstype=none From patchwork Mon Feb 12 20:23:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 39219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 447F2C48BC1 for ; Mon, 12 Feb 2024 20:24:01 +0000 (UTC) Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) by mx.groups.io with SMTP id smtpd.web10.17136.1707769432004122391 for ; Mon, 12 Feb 2024 12:23:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Wd92aawb; spf=pass (domain: gmail.com, ip: 209.85.222.41, mailfrom: twoerner@gmail.com) Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-7d6a772e08dso1018112241.2 for ; Mon, 12 Feb 2024 12:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707769429; x=1708374229; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+rWuyhE4H3LCBQl5K3aMdLQZia6EQFtfeTuCvR3dEXA=; b=Wd92aawbO4LS/yfz2eXiup7+DV5RGgsqhyk895p3PFoQekzg+up++lR5BtLlWJf+Gp nWDqB56UKj1PmLXlkwMrpGoF4Y0UD1pioFNmNqiLmmFQeruiO5JoBLQ4kSnq7zylO1as uZkIZ5VO7DzXUkl8reBR2HgwIcswIwdzKILNmRHyxL4o3EXNmh/P4qTMB3qJgP/NpW7i PddWNb8sVyhjSKqzInDhbaZdxG0jhK8CbcQVCA6sdmQR5QvvMN4Yqu4nZQM1y0DLKvH+ wUKnhBrK0zCBGBsuWbNskaO3T4S72njsvzw0L1n8Pkl4fWy55xXQMGxlpWuc7bh2/S5Y pfmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769429; x=1708374229; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+rWuyhE4H3LCBQl5K3aMdLQZia6EQFtfeTuCvR3dEXA=; b=RqSZ9jjDpvGLg3CMlh4cm4j5OCl8mE9JciXNTrYV2cVwodYO8yQMX1OSGjdGx579Cj gMCVfOgREA29YStzVNQ7r7XEVanhWZamPaP8mM/wWTIr4vbOQGNoL26QcKislxfJiyLf how4wTmA800jnvXJ/5OpLFRlLVQwfvGlvOrs5O0WopGZDO8UsKfUiZPK3tAYikekvZIZ 11GXKs4Lhpzoc/ESey3WxiAVuJV2Wl4mSSLwAWSO2g6jc7/7BW6lggqw8qoWXDXkldLr wI9j+GwWPUI/osS+aFm5OY3AOiP7e1qHUtZ7WGsu13MroQW1zJxJlRnjyl3reu7DArZk QEmw== X-Gm-Message-State: AOJu0YxHHxqBcVpX/0drLpTCUyPouCsKNh33OJMTgR0bnBiU3Ek5i7+j MtNdkUtWnIDEo/cW9YjO1Uhs/uaqKVaVNBb4iQMZpkrmJ5jGx//IXJWiTZs9 X-Google-Smtp-Source: AGHT+IEl6yxWFecsWnP+zo28Bpv+r2kf04BkRLA7oer5i60BzhifIBEu10xQVGmPpIw7wg/Poj9mew== X-Received: by 2002:a05:6102:394e:b0:46d:7523:1fe with SMTP id f14-20020a056102394e00b0046d752301femr3642210vsu.30.1707769429345; Mon, 12 Feb 2024 12:23:49 -0800 (PST) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id oj9-20020a056214440900b0068d1c9801aesm477233qvb.66.2024.02.12.12.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:23:47 -0800 (PST) From: Trevor Woerner To: yocto@lists.yoctoproject.org Subject: [meta-rockchip][PATCH 3/4] remove /boot partition from wic:bootimg-paritition Date: Mon, 12 Feb 2024 15:23:41 -0500 Message-ID: <20240212202342.37778-3-twoerner@gmail.com> X-Mailer: git-send-email 2.43.0.76.g1a87c842ece3 In-Reply-To: <20240212202342.37778-1-twoerner@gmail.com> References: <20240212202342.37778-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 12 Feb 2024 20:24:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/62466 In order to boot successfully, most Rockchip SoCs require a specific partitioning scheme which was defined many years (and many SoCs) ago. That partitioning scheme places the SPL and U-Boot at specific offsets at the start of the boot block device: https://opensource.rock-chips.com/wiki_Partitions The Rockchip partitioning scheme goes on to also define the locations and sizes of a number of additional partitions, including the "boot" and "root" partitions. Since both the SPL and U-Boot have already been placed on the block device, the "boot" partition only contains the extlinux config file and the kernel+dtb/fitImage; it doesn't contain any bootloader artifacts (other than the extlinux config). The locations and sizes of the SPL and U-Boot partitions are hard dependencies since the BOOTROM etched inside the Rockchip SoCs is programmed to blindly load and run what it finds at these locations. The locations, sizes, and contents of the "boot" and "root" partitions are not so rigid since it is U-Boot which interacts with them. U-Boot is very flexible with how it finds boot components, and in its support for various devices, filesystems, sizes, etc. Both oe-core's U-Boot metadata and wic's bootimg-partition script contain logic to generate the extlinux pieces required for a bootloader to boot a Linux system. If both are enabled, the wic pieces silently clobber the U-Boot pieces. However, the mechanisms contained in the U-Boot metadata are much more flexible, from a user's point of view, than the mechanisms in bootimg-partition. Also, if a user wishes to setup some sort of A/B redundant update mechanism, they must have redundant root partitions (in order to update their filesystem contents) but they also need to have redundant boot partitions if they wish to update the kernel as part of their update mechanism. Pairing redundant kernel partitions with redundant filesystem partitions becomes unnecessarily complicated. Therefore it makes sense to combine the kernel and the filesystem into the same partition so that both the kernel and filesystem are updated, or rolled back, in lock-step as one unit. Specific kernel versions and configurations often have dependencies on user-space components and versions. The boot partition is not going away. This patch simply transfers responsibility for its creation to the more flexible U-Boot mechanism and includes the kernel as part of the same partition as the root filesystem. Not only does it add flexibility, it also makes update schemes more straightforward. Although having a separate /boot partition is a "requirement" of the Rockchip partitioning scheme, it is not an actual hard requirement when using a flexible, open-source bootloader (such as U-Boot) instead of using Rockchip's proprietary miniloader, preloader, and trust.img. Boot-tested on: nanopi-m4b, nanopi-r2s, nanopi-r4s, roc-rk3328-cc, rock-3a, rock-pi-4b, rock-5a, rock-5b, rock-pi-e, rock-pi-s, rock64 Signed-off-by: Trevor Woerner --- conf/machine/include/rockchip-defaults.inc | 2 ++ conf/machine/include/rockchip-extlinux.inc | 10 ++++++++++ conf/machine/include/rockchip-wic.inc | 17 ++--------------- wic/rockchip.wks | 5 ++--- 4 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 conf/machine/include/rockchip-extlinux.inc diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc index 3ce2e246ab0b..2387eb909934 100644 --- a/conf/machine/include/rockchip-defaults.inc +++ b/conf/machine/include/rockchip-defaults.inc @@ -19,3 +19,5 @@ XSERVER = " \ # misc SERIAL_CONSOLES ?= "1500000;ttyS2" +RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}" +RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}" diff --git a/conf/machine/include/rockchip-extlinux.inc b/conf/machine/include/rockchip-extlinux.inc new file mode 100644 index 000000000000..c73fb7d17e02 --- /dev/null +++ b/conf/machine/include/rockchip-extlinux.inc @@ -0,0 +1,10 @@ +UBOOT_EXTLINUX ?= "1" +UBOOT_EXTLINUX_ROOT ?= "root=PARTLABEL=root" +UBOOT_EXTLINUX_FDTDIR ?= "" +UBOOT_EXTLINUX_CONSOLE ?= "console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8" +UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw rootfstype=ext4 earlycon" +UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}" +UBOOT_EXTLINUX_LABELS ?= "default" +UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}" + +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "u-boot-extlinux" diff --git a/conf/machine/include/rockchip-wic.inc b/conf/machine/include/rockchip-wic.inc index 67a8310f7d6a..cae14c90e1db 100644 --- a/conf/machine/include/rockchip-wic.inc +++ b/conf/machine/include/rockchip-wic.inc @@ -1,5 +1,7 @@ # common meta-rockchip wic/wks items +require conf/machine/include/rockchip-extlinux.inc + SPL_BINARY ?= "idbloader.img" IMAGE_FSTYPES += "wic wic.bmap" @@ -11,23 +13,8 @@ WKS_FILE_DEPENDS ?= " \ virtual/bootloader \ virtual/kernel \ " -# KERNEL_DEVICETREE follows the pattern of 'rockchip/${SOC_FAMILY}-${BOARD}.dtb' -# but is placed in the deploy directory as simply '${SOC_FAMILY}-${BOARD}.dtb' -# therefore we have to strip off the 'rockchip/' for IMAGE_BOOT_FILES -NONFITDT="${@d.getVar('KERNEL_DEVICETREE').split('/')[1]}" -IMAGE_BOOT_FILES = " \ - ${KERNEL_IMAGETYPE} \ - ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '${NONFITDT}', d)} \ - " - -# use the first-defined ; pair in SERIAL_CONSOLES -# for the console parameter in the wks files -RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}" -RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}" WICVARS:append = " \ - RK_CONSOLE_BAUD \ - RK_CONSOLE_DEVICE \ SPL_BINARY \ UBOOT_SUFFIX \ " diff --git a/wic/rockchip.wks b/wic/rockchip.wks index 8dc4d20f2f54..5d7701ef8a2e 100644 --- a/wic/rockchip.wks +++ b/wic/rockchip.wks @@ -28,7 +28,6 @@ part uboot_env --offset 4064 --fixed-size 32K --fstype=none part reserved2 --offset 4096 --fixed-size 4096K --fstype=none part loader2 --offset 8192 --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" part atf --offset 12288 --fixed-size 4096K --fstype=none -part /boot --offset 16384 --size 114688K --fstype=vfat --active --source bootimg-partition --label boot --use-uuid --sourceparams="loader=u-boot" -part / --fstype=ext4 --source rootfs --label root --use-uuid +part / --offset 16384 --fstype=ext4 --active --source rootfs --label root -bootloader --ptable gpt --append="console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 init=/sbin/init" +bootloader --ptable gpt From patchwork Mon Feb 12 20:23:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 39218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44572C4829E for ; Mon, 12 Feb 2024 20:24:01 +0000 (UTC) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by mx.groups.io with SMTP id smtpd.web11.17315.1707769433085046934 for ; Mon, 12 Feb 2024 12:23:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=R9+5zQYH; spf=pass (domain: gmail.com, ip: 209.85.219.49, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-68c8790aeadso1820286d6.1 for ; Mon, 12 Feb 2024 12:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707769430; x=1708374230; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jjoLFPE4j3DkkhFAbMHrbGEsD3jq4L1c1keadLUikHI=; b=R9+5zQYHNghnBDy543wSRwLf8VU7otcQr2zXvUr2lSj3i6pbWQr/8qTwKGDj1HbWHD s2bz4txa4GkkPOrpfHxD7cX/I4PmlTs9eJo6ywXr/+2c1yZwO690CwXw7mrUExnwtD2Y kTKgZQzf3Vsx7OzAQ/AJ7tTpRTkhuqZOpyq5Xb+UnJ4UvJxMe/8xQWvw/blMfiIcRp2O VS3d8wI31w5a3XGMcofEBiMwa0QGfwaDlKkXeGdZACTJAxY2Kz+OFl12nglUn+MV7ddl MJ777cO/MY0+UD6N7bS5tK2j/JTmlRZgkByFF6Ckme0fVPBjkB9p2NqybjeGn3HEgPLb icAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769430; x=1708374230; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jjoLFPE4j3DkkhFAbMHrbGEsD3jq4L1c1keadLUikHI=; b=tfG2QpDaj+aGxgw7YZB+PkknfMd2XOHqmuLJtzkREIpuNV0kILVrko4TdogJZLspZb Wk9HeTgDp/nBDGo3yGIyujWyoY1Vb8X3AXVTact/1ZoU85yfbi7b/Rg5dfyuasmPqabp f3JFB3LCD6/gAjDu2kD1KTZ/8inmbXpqwZGnRiy6R5NE+HmhKmIGedMiUtVP5UFuzNcD rLpDluE3MDjWgZUhoFbxHDGPGi8cS+b8PiU+TKtOYAEr0J4eailW/LgwNiPlIbJh4Fq0 cp08QC40KvVayWtVxTjHBMdn11qt5Ts2RsMNY+XMlE1OfFogcv5tbaw9anMFnLyBpWbN 3uKg== X-Gm-Message-State: AOJu0YxRtXPcU4/JJSGW3F3c1EjFyTYphDlc7MYD40EsT1TXCNk7FYHf UTfcRlaekEjXEuFEpSgFbWVwJQ/20nQ52xx1ccuv/rxGQm1TAn7GhzZgVSTA X-Google-Smtp-Source: AGHT+IFOiEZiF2x/hz7xnmJNzW/NwV/LOPOETfyAbfmXjSM3sLqygyqh2nkI2GER3kostr56T1Cfmw== X-Received: by 2002:a05:6214:2269:b0:68c:c76a:10df with SMTP id gs9-20020a056214226900b0068cc76a10dfmr10665531qvb.12.1707769430372; Mon, 12 Feb 2024 12:23:50 -0800 (PST) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id oj9-20020a056214440900b0068d1c9801aesm477233qvb.66.2024.02.12.12.23.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:23:49 -0800 (PST) From: Trevor Woerner To: yocto@lists.yoctoproject.org Subject: [meta-rockchip][PATCH 4/4] wks file cleanup Date: Mon, 12 Feb 2024 15:23:42 -0500 Message-ID: <20240212202342.37778-4-twoerner@gmail.com> X-Mailer: git-send-email 2.43.0.76.g1a87c842ece3 In-Reply-To: <20240212202342.37778-1-twoerner@gmail.com> References: <20240212202342.37778-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 12 Feb 2024 20:24:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/62467 Cleanup the elements of the wic/rockchip.wks file so they take up less horizontal space. Signed-off-by: Trevor Woerner Reviewed-by: Quentin Schulz --- wic/rockchip.wks | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wic/rockchip.wks b/wic/rockchip.wks index 5d7701ef8a2e..e76439dd52c3 100644 --- a/wic/rockchip.wks +++ b/wic/rockchip.wks @@ -20,14 +20,14 @@ # boot 32768 229376 # root 262144 - (suggested) -part loader1 --offset 32 --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}" +part loader1 --offset 32 --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}" part vstorage --offset 3584 --fixed-size 256K --fstype=none part reserved --offset 3840 --fixed-size 192K --fstype=none part reserved1 --offset 4032 --fixed-size 32K --fstype=none part uboot_env --offset 4064 --fixed-size 32K --fstype=none part reserved2 --offset 4096 --fixed-size 4096K --fstype=none -part loader2 --offset 8192 --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" +part loader2 --offset 8192 --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}" part atf --offset 12288 --fixed-size 4096K --fstype=none -part / --offset 16384 --fstype=ext4 --active --source rootfs --label root +part / --offset 16384 --active --label root --fstype=ext4 --source rootfs bootloader --ptable gpt