From patchwork Sun Apr 10 19:51:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 559666 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1D35C433F5 for ; Sun, 10 Apr 2022 19:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241871AbiDJUAm (ORCPT ); Sun, 10 Apr 2022 16:00:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbiDJUAl (ORCPT ); Sun, 10 Apr 2022 16:00:41 -0400 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C8A24BED for ; Sun, 10 Apr 2022 12:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1649620707; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=7GwK/4S6nthcFz5Q6/n7ZwkJwwi0a5nJaRpVJcMD4+k=; b=NdXttbhrkqEmZM1ZK2x6Hk5y/QF41TCn64NdWU0GoyQexAy29tR5uUyXWiowXmvOvG Vur/M9QxPRL3jl7b1525jCJmCI/zX+MCOvW0pCu/DPOKdB40/vAnOuzSUoLZ3DtH7vTA wXk4q1VgOXi329NFeidQzM5lX+2XdYATQP8DOxvZWmpj5CXd7+b37AJoODHuDYrRfk0V ji2nCxJXi2k7k4elaOManKAM+BINPvhNd/puprXoEllC8mwgm5aBI7ZDkfPtgA000PZv +BqCfX9nzaxqiahWUAx3BDsRT9YsTlhz5uxnTz1vJZhKha5tChFXfWZBf4vKBudMqMW/ mrAg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXQ7UOGqRde+a0fiL/b+s=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.42.2 AUTH) with ESMTPSA id u05e50y3AJwRAOq (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 10 Apr 2022 21:58:27 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Stephan Gerhold Subject: [PATCH 1/2] arm64: dts: qcom: msm8916-huawei-g7: Clarify installation instructions Date: Sun, 10 Apr 2022 21:51:12 +0200 Message-Id: <20220410195113.13646-2-stephan@gerhold.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220410195113.13646-1-stephan@gerhold.net> References: <20220410195113.13646-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The comment with installation instructions in the huawei-g7 device tree is a bit misleading and does not describe the recommended installation steps very well. The bootloader is actually not patched; to avoid all trouble with the vendor bootloader it is easier to bypass it completely by jumping to a custom bootloader (e.g. based on the open-source LK released by Qualcomm). To avoid confusion, simplify the comment to state only the problem and then refer to the wiki article which contains detailed suggested installation instructions. This will also make it easier to keep it up to date with new developments in the future. Fixes: 55056b229189 ("arm64: dts: qcom: msm8916: Add device tree for Huawei Ascend G7") Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index 42d93d3fba36..8ad9eb436a0c 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -11,15 +11,10 @@ /* * Note: The original firmware from Huawei can only boot 32-bit kernels. - * To boot arm64 kernels it is necessary to flash 64-bit TZ/HYP firmware - * with EDL, e.g. taken from the DragonBoard 410c. This works because Huawei - * forgot to set up (firmware) secure boot for some reason. - * - * Also note that Huawei no longer provides bootloader unlock codes. - * This can be bypassed by patching the bootloader from a custom HYP firmware, - * making it think the bootloader is unlocked. - * - * See: https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7) + * To boot this device tree using arm64 it is necessary to flash 64-bit TZ/HYP + * firmware (e.g. taken from the DragonBoard 410c). + * See https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7) + * for suggested installation instructions. */ / { From patchwork Sun Apr 10 19:51:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 559497 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F979C433EF for ; Sun, 10 Apr 2022 19:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241874AbiDJUAm (ORCPT ); Sun, 10 Apr 2022 16:00:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241871AbiDJUAl (ORCPT ); Sun, 10 Apr 2022 16:00:41 -0400 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD2127CC7 for ; Sun, 10 Apr 2022 12:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1649620708; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=lariGe15ffChJw5ninp2M9SlMA0vagWBeEgnfxRpd2Y=; b=osoK8XtLwR4/rQNuzm0tU10Wcuejj5AXnezUF4Bt7R3AoN35Vk+WmfJVvA1iXPjLz9 1x7PTlOz64ZK8CWk5QsjoouFwaoknMETHOU0KbmtNoiwLQSCndcLj4IUH41Y0Ff4BG2z hod772pVSAgf+iKvRMgtwCMrDMZrJH8jMQHmizXa7UaqHwkYAQSXAbM6SmX5A70GaN6b or5sphKsThdpEEZDIDk9lRXLzbrd1H6EeUu3IG4SSPJfCqky2p09/LwRJ24ZBp0qDbFL ylpj2ti6K16QAn+9APj7whccxC92vbyH98ADKK9WGmIZ/u3TrqhS8wbKj1UIgBU/pRWE q2Tg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXQ7UOGqRde+a0fiL/b+s=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.42.2 AUTH) with ESMTPSA id u05e50y3AJwRAOr (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 10 Apr 2022 21:58:27 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Stephan Gerhold Subject: [PATCH 2/2] arm64: dts: qcom: msm8916-huawei-g7: Add sound card Date: Sun, 10 Apr 2022 21:51:13 +0200 Message-Id: <20220410195113.13646-3-stephan@gerhold.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220410195113.13646-1-stephan@gerhold.net> References: <20220410195113.13646-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The huawei-g7 uses the msm8916-wcd-digital/analog audio codecs similar to apq8016-sbc, so we can mostly copy paste it from there to make audio work correctly. The main difference is the hphl-jack-type-normally-open property, which is needed to avoid inverted audio jack detection. Note that at least on my device the jack detection is not fully reliable: sometimes headphones are detected as headsets (with microphone). However, this is not a big problem for typical usage. Signed-off-by: Stephan Gerhold --- .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index 8ad9eb436a0c..00488afb413d 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -8,6 +8,7 @@ #include #include #include +#include /* * Note: The original firmware from Huawei can only boot 32-bit kernels. @@ -211,6 +212,10 @@ &blsp1_uart2 { status = "okay"; }; +&lpass { + status = "okay"; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -255,6 +260,40 @@ &sdhc_2 { cd-gpios = <&msmgpio 56 GPIO_ACTIVE_LOW>; }; +&sound { + status = "okay"; + + model = "msm8916"; + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS External2", + "AMIC3", "MIC BIAS External1"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cdc_pdm_lines_act>; + pinctrl-1 = <&cdc_pdm_lines_sus>; + + primary-dai-link { + link-name = "WCD"; + cpu { + sound-dai = <&lpass MI2S_PRIMARY>; + }; + codec { + sound-dai = <&lpass_codec 0>, <&wcd_codec 0>; + }; + }; + + tertiary-dai-link { + link-name = "WCD-Capture"; + cpu { + sound-dai = <&lpass MI2S_TERTIARY>; + }; + codec { + sound-dai = <&lpass_codec 1>, <&wcd_codec 1>; + }; + }; +}; + &usb { status = "okay"; extcon = <&usb_id>, <&usb_id>; @@ -264,6 +303,13 @@ &usb_hs_phy { extcon = <&usb_id>; }; +&wcd_codec { + qcom,micbias-lvl = <2800>; + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; + qcom,hphl-jack-type-normally-open; +}; + &smd_rpm_regulators { vdd_l1_l2_l3-supply = <&pm8916_s3>; vdd_l4_l5_l6-supply = <&pm8916_s4>;