From patchwork Wed Jan 10 03:47:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10153933 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 619FC60223 for ; Wed, 10 Jan 2018 04:05:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E81327853 for ; Wed, 10 Jan 2018 04:05:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42C5B279E0; Wed, 10 Jan 2018 04:05:13 +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 8C31127853 for ; Wed, 10 Jan 2018 04:05:12 +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=uTaYP7Tb9URYXGvHcu0ryggAAa etWNVGKrRQxLwLt97vMOopAU0Y4qumikV6gYPtHO4vDIKk0L27Hk383pDGCozCwlnxRwXiZDERb2F 0WgVQpwH9Lc1HNHjxn1mxAb7UhfXcIYERj2ccCUiVZYANyTIWDaRnPKYXNxkLvwK5zG3oi18kM85a 9tar+h7xp+45aGOL+1hjLdUomyerNnTKNc23YAQ8jb4Fs+UGbRiLhd4w6QCLys6ZBrLVTKXfkKfPA smhYTlsVyDCXvKHIVcUhygqQpWe9elIFVJ0w2I1jnaTk6cEPYObtZRZTG5LHKJCwAeI5rs3nZzsyo 9Qagif+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZ7dW-0005FD-DV; Wed, 10 Jan 2018 04:05:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZ7dI-0004ck-AX for linux-arm-kernel@bombadil.infradead.org; Wed, 10 Jan 2018 04:04:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SjXMPtCgr7kmgW6Sc3OPuAZH24KsIrVGddQxvD6R5y0=; b=iOPpqDs/6RcbEaBG33LbkB8f7 MGmMBrHO/SgaSzCYbjAtCCO/LBrJOz6D9CY5w8Cmk1K/KXTVrTyGQ+R6d9od49EkdSnnM3C0HqA+t UrTJK21XcCngHI+4N9+FyVez2wc0HgARADiRnq0rxULGMv49HRuIgU/IFHYYWHbivQkZwUu+azYuz IarJEj7kJZmJ52w1qJdkeiJFQ2/fDRiKjPAroSRtUPgGsjVODoGoQggXpyVDhL8nF9KML1KfHhkIM 4/ysF+IO/eciB1SlgNjP7CHSAWLgXlY3a6bamTuWsKmiBQHRt7seud0OVDWAbMdTPyS0N2rqOWq8Y QWOdKt5xA==; Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZ7NS-0003Ns-5w for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2018 03:48:36 +0000 Received: by mail-pg0-x241.google.com with SMTP id q67so9809485pga.9 for ; Tue, 09 Jan 2018 19:48:23 -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=gkxrNxuBaAWUumc3op6iTOkXIZQQv2Jeuq7jO3YUNfPbGp2FabzyyRQlGILvchZruz M1oPtBLmrsT8pO8FDv3us0UniqhX9Bm/How2LTSuOc2r6IZSw7oKDaddqtEzJpqI8OkY MuCUVOoIKJ7U5D3hn9WmbxNpHyIgctRSwfcZw= 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=drXxVGE2vOjVFsFleCsajE9F1d7QSPC4WnBqJ9SQ1hSV38ATm8p1HLbeyw+6qW1LNE XwHN7PKALu1ATsCY+wFvoWiZfd9TfXmSQgnx70v0f9sp0ycixVigZ63yqLxC85aigrju LZ5HBdfJCdwh988ROhEVMikFBTHvWt17iCEOUW+SUUYebveQbHHbZL0agMEmV7KafcMW osR2JyPUB71ZTe1PG1mf5l5zOMiqaHys3RlJ8vyYOtquMlRm8Y+Or8oXj+QIg4FIy7gr Oimugg1vuFz+x3pGBfxYRmMxIaoqkLSYYt1mSL+LkS0v0NeoFgT0+rJaa1VhZwXKNUkA HFkw== X-Gm-Message-State: AKGB3mIzKi4bVxMNQKTwdNcB8BR2I4wIcln3c4a3yQTWiYnw7kOmlDcu c0fWooeoCzlBVOmXSd3NIj/b4qPpECU= X-Google-Smtp-Source: ACJfBovRKXRmWMA2Ohi38zo6uhyYUOqZbxAOHRTgasvBye920bIddVLaoGcxpufUusukR8x4AuWL8g== X-Received: by 10.98.68.135 with SMTP id m7mr15604341pfi.9.1515556101832; Tue, 09 Jan 2018 19:48:21 -0800 (PST) Received: from localhost ([122.172.19.39]) by smtp.gmail.com with ESMTPSA id d24sm5769069pfb.30.2018.01.09.19.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 19:48:21 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman Subject: [PATCH V6 11/13] boot_constraint: Add Qualcomm display controller constraints Date: Wed, 10 Jan 2018 09:17:40 +0530 Message-Id: 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-20180110_034834_244599_64B24FED X-CRM114-Status: GOOD ( 21.22 ) 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);