From patchwork Fri Mar 1 05:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikandan Muralidharan X-Patchwork-Id: 208644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp872821dyb; Thu, 29 Feb 2024 21:26:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJ8SkFKs9l8AbKqhZA9bkKzNG0djMe/CE6QzHMRLuX+C1uLjbHJVfXEFA2rEOqGnTKIhKUtEjPk7+/cBLDSUPGNGsdvw== X-Google-Smtp-Source: AGHT+IESJK7UHnectiuID002GEdPa4hwH6S9P+NYf8uVhk8tKt7bxMQ5/NGTbyyAsLvEfPKj++Sw X-Received: by 2002:a25:8b8f:0:b0:dcd:2aa3:d744 with SMTP id j15-20020a258b8f000000b00dcd2aa3d744mr483985ybl.17.1709270811405; Thu, 29 Feb 2024 21:26:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709270811; cv=pass; d=google.com; s=arc-20160816; b=pr36rmXgC/GuGGYmle7D6tBcomL0cpUgXEJADhoAbacuWeC3eUFEKjqhCbTKIdB4eF FYKvGOEE9Xpk2Ip/piKvhi5CmXHSrtDlNg66RRmmRVevpS1QNRORozJuHgrrNiECeVdX QxKaZpkSyRErFkvUmFsQZzhFSQ2vS/vPXrzdtDIvVLVTYSSAjkL7GPsoW3XI377VKniN PupvMKQn3B5CyrBAugSJJ+K1oX0NV9LJ8SvLGwDOeyznoSQWGxc8wzMTuMf75magpYIP 0gU1nzm65w6r1jx3uOx9OSIkqDxA0fnPSRB6iv+STKrTshZyTbIncRHyFAzUETx+OIC7 4eLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Dm4LcAWmvmn2GNOcXISlcQd5iHyFoOkCd35bN5JU/sU=; fh=7LlwrKsimiND7hPCZs/yKkmKi2XUc8gnfHs3RVyzKvk=; b=nDdcI9+oLAJBOuQLmxfkqJIXMdbGMCNGtUEWp9LlsLf/B82hCD1IoqGf5U86eWIjlo 9R3gmaOI9g5xhGp1H2NazagVpd0QqsYWSmy8PGtAUCWPSlXYBT4JkaR0VqUb92/X/MRO wZHkGo6bA4caeJAydq8hoM/HD3YY/2KuROj3NAXQ+V8V4VrXU7V4hhmM56IhLhdZ5uq0 OoNM04aLw46C328khYOrVm9+0Nhihy7XqBHBW3xD9uosylyHk0BojCgezy3w9ZCkOu7u 7fhRNXvc8JHJrF0fVdq5rKEJmeGcFiJSL82ftjQwGLcNU9kIUDn7dIPDlswlXLlLqk3W OY8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=zvja2t3O; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-87916-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87916-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c34-20020a634e22000000b005c65d0dd9a0si2803016pgb.503.2024.02.29.21.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 21:26:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87916-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=zvja2t3O; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-87916-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87916-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DCB2CB22DDE for ; Fri, 1 Mar 2024 05:26:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52247524AA; Fri, 1 Mar 2024 05:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="zvja2t3O" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86C4850255 for ; Fri, 1 Mar 2024 05:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709270790; cv=none; b=KvjgZF6tM7KDJhGhxxMBELNnV+feNO0A6OmQEhDNm9I/GtOnJvveOfRieEUWPaj07fmZ2axGsGPVCaYwKt/MT8eYHNCDtPYzQdDF/EL/shZ6cdQsBGDru8OUi+C63h2C7BfyieDu/gV8lCUId0tFLYMMUMP9WgFKJcNYpB9Ull4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709270790; c=relaxed/simple; bh=AL/4ZvvFwmCOmUaslwsy4E+8TUsYU2ExbAs2QfvPrCE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Dvv2Y61mon90L2J5fg/Z4cD719762Iy0alQ509nzERzHP3K68bCfSH2tDd8oa1dQQ3d4NYOGAikAuzQtZacXbwHntxLQscV0NbEKxOLTRwMW1fG3i+3x/S7d/A8dbX8D2vKFilo12mQ/O3j5nuHHn34jG59LipkCFg/ZqWlRBpE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=zvja2t3O; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1709270789; x=1740806789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AL/4ZvvFwmCOmUaslwsy4E+8TUsYU2ExbAs2QfvPrCE=; b=zvja2t3O5UkKAn6MPOVcBGtr1ebzS91X5TXmXtdssioY6tUDSn6eif10 FSH7AdJ+BdFvQKVDaLZuNIohgdW6Oy7VfdRgOudWO0J2qMSTIgohObG8Q LfFu1B1spDeLTliwa/hqrB4QWEZyCOoDrnvjK2wyYp3QJsAltDdkIzaJ1 gm7eeRu8r6i8zX0Dwa1IXl/2EgJifI1cS2m0XaDxQrNDYWR3YRQcWPBUx LLNrqrvoJDxSvLwyOr1tdDXGlSqbySN8LAl6QKu+YfR8zSdkl+w9tWO7n gffZ7G4OoguYbcHOwW9FLIc3dT3mvhigR28D8VpwSZK5cTu/PQ/QJx1NJ g==; X-CSE-ConnectionGUID: epEW2Y4BQQKheh4DRATFNw== X-CSE-MsgGUID: 2pog/TE/QoeBPFpdaKooqw== X-IronPort-AV: E=Sophos;i="6.06,195,1705388400"; d="scan'208";a="247809237" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Feb 2024 22:26:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 29 Feb 2024 22:26:11 -0700 Received: from che-lt-i67131.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 29 Feb 2024 22:26:02 -0700 From: Manikandan Muralidharan To: , , , , , , , , , , , , , CC: , , , , , , , , "Manikandan Muralidharan" , Durai Manickam KR Subject: [PATCH v9 2/8] drm: atmel-hlcdc: Define XLCDC specific registers Date: Fri, 1 Mar 2024 10:55:28 +0530 Message-ID: <20240301052534.38651-3-manikandan.m@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240301052534.38651-1-manikandan.m@microchip.com> References: <20240301052534.38651-1-manikandan.m@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792300350238763124 X-GMAIL-MSGID: 1792300350238763124 From: Durai Manickam KR The register address of the XLCDC IP used in SAM9X7 SoC family are different from the previous HLCDC. Defining those address space with valid macros. Signed-off-by: Durai Manickam KR [manikandan.m@microchip.com: Remove unused macro definitions] Signed-off-by: Manikandan Muralidharan Acked-by: Lee Jones --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 42 ++++++++++++++++++++ include/linux/mfd/atmel-hlcdc.h | 10 +++++ 2 files changed, 52 insertions(+) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index d0ecf0f58cce..c32e5c8809d7 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -15,6 +15,7 @@ #include +/* LCD controller common registers */ #define ATMEL_HLCDC_LAYER_CHER 0x0 #define ATMEL_HLCDC_LAYER_CHDR 0x4 #define ATMEL_HLCDC_LAYER_CHSR 0x8 @@ -128,6 +129,47 @@ #define ATMEL_HLCDC_MAX_LAYERS 6 +/* XLCDC controller specific registers */ +#define ATMEL_XLCDC_LAYER_ENR 0x10 +#define ATMEL_XLCDC_LAYER_EN BIT(0) + +#define ATMEL_XLCDC_LAYER_IER 0x0 +#define ATMEL_XLCDC_LAYER_IDR 0x4 +#define ATMEL_XLCDC_LAYER_ISR 0xc +#define ATMEL_XLCDC_LAYER_OVR_IRQ(p) BIT(2 + (8 * (p))) + +#define ATMEL_XLCDC_LAYER_PLANE_ADDR(p) (((p) * 0x4) + 0x18) + +#define ATMEL_XLCDC_LAYER_DMA_CFG 0 + +#define ATMEL_XLCDC_LAYER_DMA BIT(0) +#define ATMEL_XLCDC_LAYER_REP BIT(1) +#define ATMEL_XLCDC_LAYER_DISCEN BIT(4) + +#define ATMEL_XLCDC_LAYER_SFACTC_A0_MULT_AS (4 << 6) +#define ATMEL_XLCDC_LAYER_SFACTA_ONE BIT(9) +#define ATMEL_XLCDC_LAYER_DFACTC_M_A0_MULT_AS (6 << 11) +#define ATMEL_XLCDC_LAYER_DFACTA_ONE BIT(14) + +#define ATMEL_XLCDC_LAYER_A0_SHIFT 16 +#define ATMEL_XLCDC_LAYER_A0(x) \ + ((x) << ATMEL_XLCDC_LAYER_A0_SHIFT) + +#define ATMEL_XLCDC_LAYER_VSCALER_LUMA_ENABLE BIT(0) +#define ATMEL_XLCDC_LAYER_VSCALER_CHROMA_ENABLE BIT(1) +#define ATMEL_XLCDC_LAYER_HSCALER_LUMA_ENABLE BIT(4) +#define ATMEL_XLCDC_LAYER_HSCALER_CHROMA_ENABLE BIT(5) + +#define ATMEL_XLCDC_LAYER_VXSYCFG_ONE BIT(0) +#define ATMEL_XLCDC_LAYER_VXSYTAP2_ENABLE BIT(4) +#define ATMEL_XLCDC_LAYER_VXSCCFG_ONE BIT(16) +#define ATMEL_XLCDC_LAYER_VXSCTAP2_ENABLE BIT(20) + +#define ATMEL_XLCDC_LAYER_HXSYCFG_ONE BIT(0) +#define ATMEL_XLCDC_LAYER_HXSYTAP2_ENABLE BIT(4) +#define ATMEL_XLCDC_LAYER_HXSCCFG_ONE BIT(16) +#define ATMEL_XLCDC_LAYER_HXSCTAP2_ENABLE BIT(20) + /** * Atmel HLCDC Layer registers layout structure * diff --git a/include/linux/mfd/atmel-hlcdc.h b/include/linux/mfd/atmel-hlcdc.h index a186119a49b5..80d675a03b39 100644 --- a/include/linux/mfd/atmel-hlcdc.h +++ b/include/linux/mfd/atmel-hlcdc.h @@ -22,6 +22,8 @@ #define ATMEL_HLCDC_DITHER BIT(6) #define ATMEL_HLCDC_DISPDLY BIT(7) #define ATMEL_HLCDC_MODE_MASK GENMASK(9, 8) +#define ATMEL_XLCDC_MODE_MASK GENMASK(10, 8) +#define ATMEL_XLCDC_DPI BIT(11) #define ATMEL_HLCDC_PP BIT(10) #define ATMEL_HLCDC_VSPSU BIT(12) #define ATMEL_HLCDC_VSPHO BIT(13) @@ -34,6 +36,12 @@ #define ATMEL_HLCDC_IDR 0x30 #define ATMEL_HLCDC_IMR 0x34 #define ATMEL_HLCDC_ISR 0x38 +#define ATMEL_XLCDC_ATTRE 0x3c + +#define ATMEL_XLCDC_BASE_UPDATE BIT(0) +#define ATMEL_XLCDC_OVR1_UPDATE BIT(1) +#define ATMEL_XLCDC_OVR3_UPDATE BIT(2) +#define ATMEL_XLCDC_HEO_UPDATE BIT(3) #define ATMEL_HLCDC_CLKPOL BIT(0) #define ATMEL_HLCDC_CLKSEL BIT(2) @@ -48,6 +56,8 @@ #define ATMEL_HLCDC_DISP BIT(2) #define ATMEL_HLCDC_PWM BIT(3) #define ATMEL_HLCDC_SIP BIT(4) +#define ATMEL_XLCDC_SD BIT(5) +#define ATMEL_XLCDC_CM BIT(6) #define ATMEL_HLCDC_SOF BIT(0) #define ATMEL_HLCDC_SYNCDIS BIT(1)