From patchwork Thu Dec 14 15:33:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10112547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 360DC6019C for ; Thu, 14 Dec 2017 15:38:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2430029190 for ; Thu, 14 Dec 2017 15:38:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 188C8293B5; Thu, 14 Dec 2017 15:38:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8872E29190 for ; Thu, 14 Dec 2017 15:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XgzymQWhqUqOI8mUujgetRX1kZ6Im9vjneQZwr/oMPU=; b=VM9ZAiT6udWRxiOTGhdbOv7ofq WyPCu1VRJ3rfIK2h8ZcbG9e+mXwKBBBGHEKvj0ivDfMZ6QZyTHPuwF0h/iZqYJmvYq9P86soZbOR0 hdxCUqEwhOYrByKtwjvseP/yrDdaaIRRM8UfvZ+i1wPye4Zwvh93qXdDq0jl0yAvNHkiAUVv9ESJj eTF43EUJKLK7qRA9d+yc6QrvXoUMsH555SkAGSi+ouoLkAmAI4D6vtA+NxCqki8QkoA8R+WNT5Y4x 6HJj4AqON3TVLSkOdcTb4CiAnRNGIrD3on7WU9eKCneFwjig9jDyePM4z2yRLPwwV09edpU1TK0OG 2kP9UhWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePVag-0000A8-35; Thu, 14 Dec 2017 15:38:30 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePVWy-0003ru-Sz for linux-arm-kernel@lists.infradead.org; Thu, 14 Dec 2017 15:34:52 +0000 Received: by mail-pf0-x243.google.com with SMTP id j124so3858697pfc.2 for ; Thu, 14 Dec 2017 07:34:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SjXMPtCgr7kmgW6Sc3OPuAZH24KsIrVGddQxvD6R5y0=; b=LI+oPMH4R9c2x7tUfCZ45Gcatv9F0d5zcKlhxNoKKdVDMP1kevEWhK+MOKho5LFrCg AEclw8sYgQTLaRLitS37tHsVfiDJjW025jP7RVTRd2fx+hcphXbvvBiTkoV6/P51ZjsW gApQPA0yE4y9lbbZ8Wjud7nUtxbIKjNwNMV14= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=SjXMPtCgr7kmgW6Sc3OPuAZH24KsIrVGddQxvD6R5y0=; b=kwx7Z7h/dMaX475GILX+0M1HRhKtwIvbv3QgGCs16QRyAaM03TApX6jv7riG96E+gR bSjV32LWNTK4ykz+UEMDUOLiuvExgVPW5NghNBzA+5bZsUrjVsTxr1u3W6qQafiqfLbU WjgR7aeTiaZAjJp++3H64kNroOKRlZIqUj+pKXKJlSIeoLXej33+RoBXqNuzCo5SVlqv jZ4S/8bDQeck+tT6warnVX/LFKYLA13fwZk5yQu7HRaWXMO+DPD9hMGH3nMGrQczcHre mH+GgGPytToSGmtyYkin4aEsNhewnqL37iEe2OacRMitbv27AeE2XOr/1IIZWKBi1T5P u6jA== X-Gm-Message-State: AKGB3mIZ5jdXxBMRzEjRbG2Czcek4H1qm1rZxWQuKt/BzP78i8F6x3GZ yVBjDnhkBY+6Gj26qYaZLiBVGA== X-Google-Smtp-Source: ACJfBotWrBcITJ0c0h36Z9w5tIXWrRXqiUzleQmcATT91zWl55mvQFIiqPh7sltAhvXoUjBV8xhh/g== X-Received: by 10.101.81.72 with SMTP id g8mr8930870pgq.135.1513265662413; Thu, 14 Dec 2017 07:34:22 -0800 (PST) Received: from localhost ([122.172.99.7]) by smtp.gmail.com with ESMTPSA id b25sm9241551pfd.182.2017.12.14.07.34.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 07:34:21 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman Subject: [PATCH V5 11/13] boot_constraint: Add Qualcomm display controller constraints Date: Thu, 14 Dec 2017 21:03:18 +0530 Message-Id: <22b3eec1377cc64242bede04f03bb65b8d2ba00a.1513264961.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171214_073441_699701_D7B83877 X-CRM114-Status: GOOD ( 18.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, Rajendra Nayak , Viresh Kumar , s.hauer@pengutronix.de, Stephen Boyd , linux-kernel@vger.kernel.org, xuwei5@hisilicon.com, robdclark@gmail.com, robh+dt@kernel.org, fabio.estevam@nxp.com, Vincent Guittot , shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rajendra Nayak This sets boot constraints for the display controller used on Qualcomm dragonboard 410c. The display controlled is enabled by the bootloader to show a flash screen during kernel boot. The handover to kernel should be without any glitches on the screen.The resources of the display controller (like regulators) are shared with other peripherals, which may reconfigure those resources before the display driver comes up. The same problem can happen if the display driver probes first, as the constraints of the other devices (sharing same resources with display controller) may not be honored anymore by the kernel. Signed-off-by: Rajendra Nayak Signed-off-by: Viresh Kumar --- arch/arm64/Kconfig.platforms | 1 + drivers/boot_constraint/Makefile | 1 + drivers/boot_constraint/qcom.c | 122 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 drivers/boot_constraint/qcom.c diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index a586ed728393..b514327290ca 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -136,6 +136,7 @@ config ARCH_QCOM bool "Qualcomm Platforms" select GPIOLIB select PINCTRL + select DEV_BOOT_CONSTRAINT help This enables support for the ARMv8 based Qualcomm chipsets. diff --git a/drivers/boot_constraint/Makefile b/drivers/boot_constraint/Makefile index f3e123b5d854..7b6b5966c908 100644 --- a/drivers/boot_constraint/Makefile +++ b/drivers/boot_constraint/Makefile @@ -4,3 +4,4 @@ obj-y := clk.o deferrable_dev.o core.o pm.o supply.o obj-$(CONFIG_ARCH_HISI) += hikey.o obj-$(CONFIG_ARCH_MXC) += imx.o +obj-$(CONFIG_ARCH_QCOM) += qcom.o diff --git a/drivers/boot_constraint/qcom.c b/drivers/boot_constraint/qcom.c new file mode 100644 index 000000000000..0498f464da05 --- /dev/null +++ b/drivers/boot_constraint/qcom.c @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * This sets up Dragonboard 410c constraints on behalf of the bootloader, which + * uses display controller to display a flash screen during system boot. + * + * Copyright (C) 2017 Linaro. + * Viresh Kumar + * Rajendra Nayak + */ + +#include +#include +#include +#include + +static struct dev_boot_constraint_clk_info iface_clk_info = { + .name = "iface_clk", +}; + +static struct dev_boot_constraint_clk_info bus_clk_info = { + .name = "bus_clk", +}; + +static struct dev_boot_constraint_clk_info core_clk_info = { + .name = "core_clk", +}; + +static struct dev_boot_constraint_clk_info vsync_clk_info = { + .name = "vsync_clk", +}; + +static struct dev_boot_constraint_clk_info esc0_clk_info = { + .name = "core_clk", +}; + +static struct dev_boot_constraint_clk_info byte_clk_info = { + .name = "byte_clk", +}; + +static struct dev_boot_constraint_clk_info pixel_clk_info = { + .name = "pixel_clk", +}; + +static struct dev_boot_constraint_supply_info vdda_info = { + .name = "vdda" +}; + +static struct dev_boot_constraint_supply_info vddio_info = { + .name = "vddio" +}; + +static struct dev_boot_constraint constraints_mdss[] = { + { + .type = DEV_BOOT_CONSTRAINT_PM, + .data = NULL, + }, +}; + +static struct dev_boot_constraint constraints_mdp[] = { + { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &iface_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &bus_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &core_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &vsync_clk_info, + }, +}; + +static struct dev_boot_constraint constraints_dsi[] = { + { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &esc0_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &byte_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_CLK, + .data = &pixel_clk_info, + }, { + .type = DEV_BOOT_CONSTRAINT_SUPPLY, + .data = &vdda_info, + + }, { + .type = DEV_BOOT_CONSTRAINT_SUPPLY, + .data = &vddio_info, + }, +}; + +static struct dev_boot_constraint_of constraints[] = { + { + .compat = "qcom,mdss", + .constraints = constraints_mdss, + .count = ARRAY_SIZE(constraints_mdss), + }, { + .compat = "qcom,mdp5", + .constraints = constraints_mdp, + .count = ARRAY_SIZE(constraints_mdp), + }, { + .compat = "qcom,mdss-dsi-ctrl", + .constraints = constraints_dsi, + .count = ARRAY_SIZE(constraints_dsi), + }, +}; + +static int __init qcom_constraints_init(void) +{ + /* Only Dragonboard 410c is supported for now */ + if (!of_machine_is_compatible("qcom,apq8016-sbc")) + return 0; + + dev_boot_constraint_add_deferrable_of(constraints, + ARRAY_SIZE(constraints)); + + return 0; +} +subsys_initcall(qcom_constraints_init);