From patchwork Fri Dec 24 13:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1573048 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XFfC/z9K; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JL7bC1tNcz9sVq for ; Sat, 25 Dec 2021 00:44:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C3377837A2; Fri, 24 Dec 2021 14:44:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XFfC/z9K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 69AF483791; Fri, 24 Dec 2021 14:44:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8A62983784 for ; Fri, 24 Dec 2021 14:44:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x533.google.com with SMTP id b13so33541259edd.8 for ; Fri, 24 Dec 2021 05:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bvNn7sgOz4AWEdFUI/DtCY3gWIKqUhF8aMWMIKXmz+E=; b=XFfC/z9KHSeVcIOVgywInb01OoIlZo9CHTM987WtTCHD5L/U/j8wblMGEs2bxMGf+m vIENTQYBSIyAI4uptzykGQAIYiCxGGvPeOuASah6oIa4+Bb9mp9CF04NuRPTqai/H221 r63IZFOiD74jW50WOiNTVhdWqazfo5+bzQleXKpytFSOnY5iWDSRGDhWuG6YBmgqs3XG T44/KbFmuEZ30is1XR5Otqa/J5Up7HxYav3Ub1jc3agOeYZM1YK/HipWLtniAdQIwj2U ejwplmX+yMT9C9yrQ4EKc9TftShN+v45k4WbIK45ncKvMgEt1Fy11Sv3KGXu0eoqIamf J62Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bvNn7sgOz4AWEdFUI/DtCY3gWIKqUhF8aMWMIKXmz+E=; b=wuESrF/bjBH2Mcx/bZ1CAjNM4IafVgy+UNzfpSs9aNrOkgH6beOLrE/orIwPpNgfPu 9e6QxgTSXrMGNdMu9RFxHfqeumpCuI3bAEQEFlegbJSxQoTUr+g20Z3Us4ZBS0L50h9M Od+DIN/wRNo1RSlWdkiAZ7S4iTmxODfgFMQfzk1hETNRK10F0rj02QHFYCBZECQsGrOt bvWx3Y5QqeWumAVTIHbw3LVWURJGrrJmTM/1qjagm2moDaYYkHzU7qML8zQmuBeHUYJi /R32BXS5d6x7LFxhIJyq0neZXUcI/uTaI4gpMDGHjf7QzydIV0xH1mSyQLaLlpF0JYhX c16g== X-Gm-Message-State: AOAM533fU6sh3uFih8FTBfWE6AV8eLbjyyh8Zdst1xVG2nFrmN7vKxVQ 6wkv7GYw68QfwuDPrOeEZEehSV3+47KHMg== X-Google-Smtp-Source: ABdhPJxn6vceQ9t6lC9O2kcYiia/jzC3WDFh+h48acNxs2F9nsuMwsuGTVAJR9tAY6k8jxX4DXlKMA== X-Received: by 2002:a17:907:7208:: with SMTP id dr8mr5493406ejc.697.1640353449916; Fri, 24 Dec 2021 05:44:09 -0800 (PST) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id ho9sm2696231ejc.86.2021.12.24.05.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Dec 2021 05:44:09 -0800 (PST) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: "Marty E . Plummer" , Simon Glass , Christian Hewitt , Andre Przywara , Peter Robinson , Kever Yang , Heiko Schocher , Johan Jonker , Tim Harvey , Alexandre Vicenzi , Fabio Estevam , Jagan Teki , Neil Armstrong , Philipp Tomsich , Artem Lapkin , Alper Nebi Yasak Subject: [PATCH v3 2/4] rockchip: gru: Add more devicetree settings Date: Fri, 24 Dec 2021 16:43:44 +0300 Message-Id: <20211224134347.41812-3-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211224134347.41812-1-alpernebiyasak@gmail.com> References: <20211224134347.41812-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Simon Glass This adds some devicetree settings for the Gru-based boards, based on what works on a Kevin board. Gru-based boards usually have an 8MiB SPI flash chip and boot from it. Make the u-boot.rom file intended to be flashed on it match its size. Add properties for booting from SPI, and only try to boot from SPI as MMC and SD card don't seem to work in SPL yet. The Chromium OS EC needs a delay between transactions so it can get itself ready. Also it currently uses a non-standard way of specifying the interrupt. Add these so that the EC works reliably. The Rockchip Embedded DisplayPort driver is looking for a rockchip,panel property to find the panel it should work on. Add the property for the Gru-based boards. The U-Boot GPIO controlled regulator driver only considers the "enable-gpios" devicetree property, not the singular "enable-gpio" one. Some devicetree source files have the singular form as they were added to Linux kernel when it used that form, and imported to U-Boot as is. Fix one instance of this in the Gru boards' devicetree to the form that works in U-Boot. The PWM controlled regulator driver complains that there is no init voltage set for a regulator it drives, though it's not clear which one. Set them all to the voltage levels coreboot sets them: 900 mV. The RK3399 SoC needs to know the voltage level that some supplies provides, including one fixed 1.8V audio-related regulator. Although this synchronization is currently statically done in the board init functions, a not-so-hypothetical driver that does this dynamically would query the regulator only to get -ENODATA and be confused. Make sure U-Boot knows this supply is at 1.8V by setting its limits to that. Most of this is a reapplication of commit 08c85b57a5ec ("rockchip: gru: Add extra device-tree settings") whose changes were removed during a sync with Linux at commit 167efc2c7a46 ("arm64: dts: rk3399: Sync v5.7-rc1 from Linux"). Apply things to rk3399-gru-u-boot.dtsi instead so they don't get lost again. Signed-off-by: Simon Glass [Alper: move to -u-boot.dtsi, rewrite commit message, add more nodes] Co-developed-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak Reviewed-by: Kever Yang Reviewed-by: Simon Glass Tested-by: Simon Glass --- Kept sign-off and author as Simon based on the aforementioned commit. Changes in v3: - Add tag: "Reviewed-by: Kever Yang " arch/arm/dts/rk3399-gru-u-boot.dtsi | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi index 390ac2bb5a9a..33734e99be50 100644 --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi @@ -5,6 +5,61 @@ #include "rk3399-u-boot.dtsi" +/ { + chosen { + u-boot,spl-boot-order = &spi_flash; + }; + + config { + u-boot,spl-payload-offset = <0x40000>; + }; +}; + +&binman { + rom { + size = <0x800000>; + }; +}; + +&cros_ec { + ec-interrupt = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>; +}; + +&edp { + rockchip,panel = <&edp_panel>; +}; + +&pp1800_audio { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +}; + +&ppvar_bigcpu_pwm { + regulator-init-microvolt = <900000>; +}; + +&ppvar_centerlogic_pwm { + regulator-init-microvolt = <900000>; +}; + +&ppvar_gpu_pwm { + regulator-init-microvolt = <900000>; +}; + +&ppvar_litcpu_pwm { + regulator-init-microvolt = <900000>; +}; + +&ppvar_sd_card_io { + enable-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; +}; + +&spi5 { + spi-activate-delay = <100>; + spi-max-frequency = <3000000>; + spi-deactivate-delay = <200>; +}; + &spi_flash { u-boot,dm-pre-reloc; };