From patchwork Tue Jul 23 13:37:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 169534 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8888025ilk; Tue, 23 Jul 2019 06:38:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzL/VsJ/+RjYRdZ9//LuQaHxuz7t+dl/OfEvxH5oTMERrj5MWDApqtFB1vdLm+McuEYqZGA X-Received: by 2002:a65:56c1:: with SMTP id w1mr75383464pgs.395.1563889085798; Tue, 23 Jul 2019 06:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563889085; cv=none; d=google.com; s=arc-20160816; b=KuS1n4+MqvJ3OfsROpItEAMd0i3P7G9ACoaeU11hQKDgKS2cDb4Vl/gm9p1/3ja7CU /DV0OKUbhsezbB1eYsjK68MN/T3OvxtmiL6fmGfvwZ7MS78ixtWadxOLuYoTl0UBSnQZ fNg9TS5Q+9xRPSGzkyQ7G1lKXruuFVomQrPMogliUDR9eUsZCz4ilGxa5HNS4zR+VWxz 31FQgqiWNsoM3qX9sCgW8G4ND41algnrRoovwowDJlZ9F1O9vvcqnHHRmEaoM+BhPmkD Xa1adikwDPmzCJUm1ln3FnEQmrWzRdMHJ9TuGHIffycZB5XKFh+FaKRR5yfmHfiOloiC l2ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=u7L49gnFLn5GuJkOchKcpSG8dXO/OkdwqrQPGDbBQJk=; b=gwsSKhYjcK7jXi51LAbAmvQa08XfrvymbjDepqLgfOMGWooLaZiKcZMt7j0oSuPRm3 QvSr1VC4L6CM3ruiBTgEkXfqRrMY+IFlFYaBoLPPHDL6jhvDEdCczzZgn6b9fEPw4fCa IcNc+5HnMm0M2CwdOlu34PDwKDkmBALHh+dmfPsbxjWuKy4NZKow3CrCtGnMje3vOJ6X zzVQhJ+ps9oe1Ahy2LugsdTHj569g1nPw9lxztlH1Gq7idRPGCCcRawKE3ztz4PetmHf cyYG2SPKjqEwEJnS+oReiDdrz/ZnWeSJxrqBBeVMmfj7qj4gzPz7E+Ws8uD3bQ4vgZkm T1rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id r14si11448742pgm.406.2019.07.23.06.38.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2019 06:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DAA96E20F; Tue, 23 Jul 2019 13:38:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05BEE6E20F for ; Tue, 23 Jul 2019 13:38:03 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id h28so29355511lfj.5 for ; Tue, 23 Jul 2019 06:38:02 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=ktAJuIJ9KXqby1Ak7scwTAEzieMJIsOT18B61deNl2M=; b=GUFNJfHoybmG6R3EWomQnB5H3dVfM4oW6IJx3z+fdgnHLV1wcAb5hYxYbQQK1oxdDi MKlmg/9x3kqBi8rI4yZVKyiQEZ0SGspmegaKe/hPtjFcDFeLZVZDqLn0kIYuKretitpE eQMGXLJLLIa6VVkWEa2J0JW3K1MVd/oD1i/rK6Tn5Erjc8NSLO1RjIEUxRYb7h1YH6Pi zjbdKgV5TfG0o/WsEHwId98scv99wQXyKEm3PsywXipxR+k8pRUuA612eWdLY4lF6ISz pIZvtHPIhJRIt6KYc5CmY5u+/2Swwx7rhHoNnXA6lkJrd8Gnj7LfhLZeJAO1ZILy+IBW 0MPQ== X-Gm-Message-State: APjAAAUy/4o2Q/9rkwRoM5juMyIfolxntqq0mOnHnkp6MOJHMc2xmFdJ wy9nvOqMB89SRQqV0A2ZTK9RoOyG7Es= X-Received: by 2002:a19:48c5:: with SMTP id v188mr34546643lfa.69.1563889081429; Tue, 23 Jul 2019 06:38:01 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id l24sm8069411lji.78.2019.07.23.06.38.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 06:38:00 -0700 (PDT) From: Linus Walleij To: Daniel Tang , Fabian Vogt Subject: [PATCH 0/3] RFT: PL111 DRM conversion of nspire Date: Tue, 23 Jul 2019 15:37:52 +0200 Message-Id: <20190723133755.22677-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ktAJuIJ9KXqby1Ak7scwTAEzieMJIsOT18B61deNl2M=; b=IOHG8EdqQTEgJQ4hE28am0duu+7wfJe9cI9ps0P+6q9NodmUKIyWVwaDmwkRpWqbvM XQhZHmU6j0l0pUsRHJnHQrhAV213lArsWk3eFFM4pz7DoWecbK3DbxBh/BUdEgzeeQ4g b27rCQsENSd3Gl0vybn5+PVATdtYn1zQyqzq0SLl6HTjedTHeScJJDvjij0COsASmu5T ro5Hgc57ug6avJwmpE3+vZU6GjCGSFMS7qhAQ10m7LcCMsw9Qvd2smSk6uiZl5Z9eDoa zr+wYW823XuPthBYn8z3hjG61x2/o5c62dw4zpLgYGK7dof3SNfsfTsIMnT0LA5SA94h leCQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" So this is a cold-coded attempt to move the TI nspire over to using DRM. It is more or less the last user of the old fbdev driver so it is a noble cause and interesting usecase. This can be applied on top of a vanilla Torvalds v5.3-rc1 kernel out since sunday. I do not expect these patches to "just work", I expect them to need some hacking, so someone who is actually working on the hardware will need to step in and fix it up. It does outline the overall idea of how to do this. I found no defconfig for nspire in the kernel so I used ARMv4t multi. Configuring the driver for nspire: - Disable CONFIG_FB_ARMCLCD - Enable CONFIG_DRM_PL111, CONFIG_DRM_PANEL_SIMPLE Hacker notes for nspire: - I don't know which PrimeCell ID this hardware has, I hope the amba_id mask in drivers/gpu/drm/pl111/pl111_drv.c for PL111 and PL110 will match it. Please confirm that you get a clean probe call, else report what ID this has. - The 24bit RGB frame buffer may be a bit much for the PL111 in the TI nspire to handle. Try editing the .fb_bpp in drivers/gpu/drm/pl111/pl111_drv.c down to 16 if this is the PL111 variant. If it is the PL110 variant, we will get 16 buts framebuffer anyway. - I have hard-coded the panels to 1MHz, based on the fact that the AHB clock into the CLCD appears to be 48 MHz and the hard-coded TIM2 value for the classic means "divide by 48" and this seems to want the clock freq divided down to 1MHz. Verify this by adding prints inside drivers/gpu/drm/pl111/pl111_display.c in the function pl111_clk_div_set_rate() to verify that the divider gets set to 48 in TIM2_PCD_HI and TIM2_PCD_LO. TIM2_PCD_LO bits 0..4 = 10000 and TIM2_PCD_HI bits 27..31 = 00001 in that register. Please test and fix, if you can. Linus Walleij (3): RFT: drm/pl111: Support grayscale RTF: drm/panel: simple: Add TI nspire panels RFT: ARM: nspire: Move CLCD set-up to device tree arch/arm/boot/dts/nspire-classic.dtsi | 19 ++++- arch/arm/boot/dts/nspire-cx.dts | 18 +++- arch/arm/boot/dts/nspire.dtsi | 10 ++- arch/arm/mach-nspire/Makefile | 1 - arch/arm/mach-nspire/clcd.c | 114 -------------------------- arch/arm/mach-nspire/clcd.h | 10 --- arch/arm/mach-nspire/nspire.c | 25 ------ drivers/gpu/drm/panel/panel-simple.c | 63 ++++++++++++++ drivers/gpu/drm/pl111/pl111_display.c | 28 ++++++- include/linux/amba/clcd-regs.h | 1 + 10 files changed, 133 insertions(+), 156 deletions(-) delete mode 100644 arch/arm/mach-nspire/clcd.c delete mode 100644 arch/arm/mach-nspire/clcd.h Acked-by: Sam Ravnborg