Buildroot support for Chromebook Elm
v2 cover Buildroot support for Chromebook Elm
This patch series adds supports for generating Buildroot kernel + rootfs images for the Arm Elm Chromebook
(https://www.acer.com/ac/en/US/content/series/acerchromebookr13).
A board is added under board/chromebook which provides infrastructure necessary to generate images. For example, the kernel.its file helps to generate FIT image while the kernel.args file lists all the necessary kernel command line params. Both of these files are used to generate a signed kernel image by the sign.sh file. This folder also contains a patch which must be applied to the linux kernel to get the HDMI working. This patch is lying in "drm-misc-next" and should make it to the mainline by 5.10, at which point it should be removed from buildroot and kernel up-reved to 5.10 assuming nothing else fails. We also add a configuration necessary to build the kernel.
In addition, a defconfig for Elm chromebook is added to make life easy for the user. To generate kernel+rootfs, the user only needs to do
make chromebook_elm_defconfig
make menuconfig # If changes are required
make -j ${nproc}
All of this is briefly mentioned in the readme file under the elm board file.
The following changes have been made specifically in v2,
-> Added myself in the DEVELOPERS file for chromebook elm -> Created seperate patches instead of a single consolidated patch. -> Moved these patches to a seperate folder to keep top-level clean. -> Made sign.sh executable.
-> Fixed other misc issues reported in v1.
Bilal Wasim (2):
board/chromebook: Add support of Chromebook Elm
DEVELOPERS: add myself as contact for chromebook elm
DEVELOPERS | 4 + board/chromebook/elm/kernel.args | 1 + board/chromebook/elm/kernel.its | 38 ++ board/chromebook/elm/linux.config | 453 ++++++++++++++++++ ...ctor-Set-default-status-connected-fo.patch | 35 ++ ...ps8640-Get-the-EDID-from-eDP-control.patch | 50 ++ ...0-Return-an-error-for-incorrect-atta.patch | 35 ++ ...0-Print-an-error-if-VDO-control-fail.patch | 58 +++ ...e-ps8640-Rework-power-state-handling.patch | 162 +++++++ board/chromebook/elm/readme.txt | 56 +++ board/chromebook/elm/sign.sh | 41 ++ configs/chromebook_elm_defconfig | 35 ++ 12 files changed, 968 insertions(+) create mode 100644 board/chromebook/elm/kernel.args create mode 100644 board/chromebook/elm/kernel.its create mode 100644 board/chromebook/elm/linux.config create mode 100644 board/chromebook/elm/patches/0001-drm-bridge_connector-Set-default-status-connected-fo.patch create mode 100644 board/chromebook/elm/patches/0002-drm-bridge-ps8640-Get-the-EDID-from-eDP-control.patch create mode 100644 board/chromebook/elm/patches/0003-drm-bridge-ps8640-Return-an-error-for-incorrect-atta.patch create mode 100644 board/chromebook/elm/patches/0004-drm-bridge-ps8640-Print-an-error-if-VDO-control-fail.patch create mode 100644 board/chromebook/elm/patches/0005-drm-bridge-ps8640-Rework-power-state-handling.patch create mode 100644 board/chromebook/elm/readme.txt create mode 100755 board/chromebook/elm/sign.sh create mode 100644 configs/chromebook_elm_defconfig
Signature · 1 line
2.25.1
PATCH v2 1/2 board/chromebook: Add support of Chromebook Elm
This commit adds supports for building buildroot kernel + rootfs for MT8173 Elm board, also known as Chromebook Elm
(https://www.acer.com/ac/en/US/content/series/acerchromebookr13).
Though Chrome-OS is officially supproted on this board, the mainline kernel works as well (benchmarks + conformance), and so the 5.9 kernel is used. As the 5.9 kernel isn't yet released, we use the 5.9-rc5 for now, which will be up-revd to 5.9 once its released.
Using the mainline kernel means that we have to apply certain patches to get the HDMI screen working. These patches are lying in the "drm-misc-next" list and will make it to the kernel after 5.9. At that time, we will remove the patches and point buildroot to use the latest kernel (hopefully, 5.10).
This commit also adds an ITS file(for creating FIT images), an ARGS file(for providing kernel args) and a "sign.sh" script to generate signed kernel images. Though the "sign.sh" is very similar to the coresponding file under board/chromebook/snow, it cannot be shared between both boards, as the script requires access to the board specific its / args file.
Additionally a readme & defconfig is added to help the user get started.
--- board/chromebook/elm/kernel.args | 1 + board/chromebook/elm/kernel.its | 38 ++ board/chromebook/elm/linux.config | 453 ++++++++++++++++++ ...ctor-Set-default-status-connected-fo.patch | 35 ++ ...ps8640-Get-the-EDID-from-eDP-control.patch | 50 ++ ...0-Return-an-error-for-incorrect-atta.patch | 35 ++ ...0-Print-an-error-if-VDO-control-fail.patch | 58 +++ ...e-ps8640-Rework-power-state-handling.patch | 162 +++++++ board/chromebook/elm/readme.txt | 56 +++ board/chromebook/elm/sign.sh | 41 ++ configs/chromebook_elm_defconfig | 35 ++ 11 files changed, 964 insertions(+) create mode 100644 board/chromebook/elm/kernel.args create mode 100644 board/chromebook/elm/kernel.its create mode 100644 board/chromebook/elm/linux.config create mode 100644 board/chromebook/elm/patches/0001-drm-bridge_connector-Set-default-status-connected-fo.patch create mode 100644 board/chromebook/elm/patches/0002-drm-bridge-ps8640-Get-the-EDID-from-eDP-control.patch create mode 100644 board/chromebook/elm/patches/0003-drm-bridge-ps8640-Return-an-error-for-incorrect-atta.patch create mode 100644 board/chromebook/elm/patches/0004-drm-bridge-ps8640-Print-an-error-if-VDO-control-fail.patch create mode 100644 board/chromebook/elm/patches/0005-drm-bridge-ps8640-Rework-power-state-handling.patch create mode 100644 board/chromebook/elm/readme.txt create mode 100755 board/chromebook/elm/sign.sh create mode 100644 configs/chromebook_elm_defconfig
board/chromebook/elm/kernel.args new file +1 -0
@@ -0,0 +1 @@ +root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd kern_guid=%U console=tty0
board/chromebook/elm/kernel.its new file +38 -0
@@ -0,0 +1,38 @@ +/dts-v1/; + +/ { + description = "Chrome OS kernel image with FDT"; + #address-cells = <1>; + + images { + kernel-1 { + data = /incbin/("Image"); + type = "kernel_noload"; + arch = "arm64"; + os = "linux"; + compression = "none"; + load = <0>; + entry = <0>; + }; + + fdt-1 { + description = "mt8173-elm.dtb"; + data = /incbin/("mt8173-elm.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + + hash-1 { + algo = "sha1"; + }; + }; + }; + + configurations { + default = "conf-1"; + conf-1 { + kernel = "kernel-1"; + fdt = "fdt-1"; + }; + }; +};
board/chromebook/elm/linux.config new file +453 -0
454 lines not on this page · raw message
board/chromebook/elm/patches/0001-drm-bridge_connector-Set-default-status-connected-fo.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 510d0ad0ce1b51c072309ba12dfb024fc2c3dbac Mon Sep 17 00:00:00 2001 +From: Enric Balletbo i Serra <[email protected]> +Date: Wed, 26 Aug 2020 10:15:22 +0200 +Subject: [PATCH 1/5] drm/bridge_connector: Set default status connected for + eDP connectors + +In an eDP application, HPD is not required and on most bridge chips +useless. If HPD is not used, we need to set initial status as connected, +otherwise the connector created by the drm_bridge_connector API remains +in an unknown state. + +Reviewed-by: Laurent Pinchart <[email protected]> +Acked-by: Sam Ravnborg <[email protected]> +Signed-off-by: Enric Balletbo i Serra <[email protected]> +Reviewed-by: Bilal Wasim <[email protected]> +Tested-by: Bilal Wasim <[email protected]> +--- + drivers/gpu/drm/drm_bridge_connector.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c +index c6994fe673f3..a58cbde59c34 100644 +--- a/drivers/gpu/drm/drm_bridge_connector.c ++++ b/drivers/gpu/drm/drm_bridge_connector.c +@@ -187,6 +187,7 @@ drm_bridge_connector_detect(struct drm_connector *connector, bool force) + case DRM_MODE_CONNECTOR_DPI: + case DRM_MODE_CONNECTOR_LVDS: + case DRM_MODE_CONNECTOR_DSI: ++ case DRM_MODE_CONNECTOR_eDP: + status = connector_status_connected; + break; + default: +-- +2.25.1 +
board/chromebook/elm/patches/0002-drm-bridge-ps8640-Get-the-EDID-from-eDP-control.patch new file +50 -0
50 lines not on this page · raw message
board/chromebook/elm/patches/0003-drm-bridge-ps8640-Return-an-error-for-incorrect-atta.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 62afc499fc46c8018f40733c31a675b28f0717d8 Mon Sep 17 00:00:00 2001 +From: Enric Balletbo i Serra <[email protected]> +Date: Wed, 26 Aug 2020 10:15:24 +0200 +Subject: [PATCH 3/5] drm/bridge: ps8640: Return an error for incorrect attach + flags + +Bridge drivers that implement the new model only shall return an error +from their attach() handler when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag +is not set. So make sure we return an error because only the new +drm_bridge model is supported. + +Reviewed-by: Sam Ravnborg <[email protected]> +Signed-off-by: Enric Balletbo i Serra <[email protected]> +--- + drivers/gpu/drm/bridge/parade-ps8640.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c +index 13755d278db6..ce3e8b2da8c9 100644 +--- a/drivers/gpu/drm/bridge/parade-ps8640.c ++++ b/drivers/gpu/drm/bridge/parade-ps8640.c +@@ -200,6 +200,10 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge, + .channel = 0, + .node = NULL, + }; ++ ++ if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) ++ return -EINVAL; ++ + /* port at 0 is ps8640 dsi input port */ + in_ep = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); + if (!in_ep) +-- +2.25.1 +
board/chromebook/elm/patches/0004-drm-bridge-ps8640-Print-an-error-if-VDO-control-fail.patch new file +58 -0
58 lines not on this page · raw message
board/chromebook/elm/patches/0005-drm-bridge-ps8640-Rework-power-state-handling.patch new file +162 -0
162 lines not on this page · raw message
board/chromebook/elm/readme.txt new file +56 -0
56 lines not on this page · raw message
board/chromebook/elm/sign.sh new file +41 -0
41 lines not on this page · raw message
configs/chromebook_elm_defconfig new file +35 -0
@@ -0,0 +1,35 @@ +# Architecture +BR2_aarch64=y +BR2_cortex_a72_a53=y + +# Filesystem +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.9-rc5" +BR2_LINUX_KERNEL_PATCH="board/chromebook/elm/patches/" + +# Build Kernel with a Custom config. +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/chromebook/elm/linux.config" + +# DTS support +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="mediatek/mt8173-elm" + +# Package Firmware for WiFi chip. +BR2_PACKAGE_LINUX_FIRMWARE=y +BR2_PACKAGE_LINUX_FIRMWARE_MWIFIEX_SD8797=y + +# Scripts to generate final images. +BR2_ROOTFS_POST_BUILD_SCRIPT="board/chromebook/elm/sign.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/chromebook/mksd.sh" + +# Supporting host tools to build / sign FIT Image. +BR2_PACKAGE_HOST_PARTED=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y +BR2_PACKAGE_HOST_VBOOT_UTILS=y
Signature · 1 line
2.25.1
PATCH v2 2/2 DEVELOPERS: add myself as contact for chromebook elm
In reply to Bilal Wasim--- DEVELOPERS | 4 ++++ 1 file changed, 4 insertions(+)
DEVELOPERS +4 -0
@@ -511,6 +511,10 @@ N: Biagio Montaruli <[email protected]> F: board/acmesystems/ F: configs/acmesystems_* +N: Bilal Wasim <[email protected]> +F: board/chromebook/elm/ +F: configs/chromebook_elm_defconfig + N: Bogdan Radulescu <[email protected]> F: package/iftop/ F: package/ncdu/
Signature · 1 line
2.25.1
v2 cover Buildroot support for Chromebook Elm
In reply to Bilal WasimHello Bilal,
Quoted 3 lines · On Thu, 24 Sep 2020 04:52:12 +0500 Bilal Wasim <[email protected]> wrote:
Bilal Wasim (2):
board/chromebook: Add support of Chromebook Elm
DEVELOPERS: add myself as contact for chromebook elm
Thanks for your new quick iteration. I squashed both patches together, and changed the commit title to configs/chromebook_elm: new defconfig.
I also changed to use BR2_GLOBAL_PATCH_DIR instead of BR2_LINUX_KERNEL_PATCH, as we prefer using BR2_GLOBAL_PATCH_DIR.
Applied with those changes! Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com