Received: by 10.223.176.5 with SMTP id f5csp616356wra; Wed, 7 Feb 2018 04:50:56 -0800 (PST) X-Google-Smtp-Source: AH8x2266MWXmTYyjMVrQp5mvpndmrm6k6hhtX/Eqx3MaAc+w1NNjYnfdoYWrGN4cNwu7ZE49EvQ4 X-Received: by 10.98.217.25 with SMTP id s25mr6015946pfg.38.1518007856801; Wed, 07 Feb 2018 04:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518007856; cv=none; d=google.com; s=arc-20160816; b=Os5ZqqgSwei763cHYUCVuA8xNTCBbV4x9gDwxtzM8rQSuuymVvBL/lohxpK8JnMqrj TofYnwbwN3Ad64RHOIZjoKS4voHeMo35y84f73V9vBR5v0MislnJpT7E136kuHnZ2s+n uJ5w2TyWqgQOc8WCYOsvg3/AM8cNbBIP/3StudDiQU8CcJehsgkQzrBKFyCN2Kd9UB/t eXONH+z/hCRj9cDsTHzkqRqX0FxDlm/m4J/RJGGvEfMlMVyH0GbOt25iU098/IMoemtO q2/f+tlgYhq5X4z069uNtYHRNp4Ok3VqdeT4J25e7i3gIK314Wb7iM6WJiBOnZLQr3Ln hgrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Cc1wH/0wZR3NdY+TdzmMMffzpWv8UkaEYwNj3pZUN0k=; b=HY51ciAp4Rf5QS/btKSZ80J50KdARvVCVKN2DD4E7i9ai2eExe7XEcpffykSNqSVuI ekru1shzHpRI3akAHvhzn3EEMPlxwS644RWl/sRcAkF9aAlJS9mKg6GokntZ0dqBOon+ 4e9fcL36P/yJHBie3YwfhxHqAt1Pzf09MM+/aIg8h+I6z7JoMw0AtgL0vOEGHyM3EFks ZJQV1zJT99oiSmjaSlXxOmeePxxU80sAMaLBmwd8z45JcnI+N9XgUeCSnGjd9rexiBG1 LE6DAkLhU2u2m89bfCp5N7UvfrvpcOz+V25VHJd6e4wHrGacF9MSvJmMr9W9bT68FP87 Lqwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=ntkE76T6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v191si900953pgd.616.2018.02.07.04.50.42; Wed, 07 Feb 2018 04:50:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=ntkE76T6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753745AbeBGMuE (ORCPT + 99 others); Wed, 7 Feb 2018 07:50:04 -0500 Received: from mail.micronovasrl.com ([212.103.203.10]:37206 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753478AbeBGMuD (ORCPT ); Wed, 7 Feb 2018 07:50:03 -0500 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id C11C4B00CEE for ; Wed, 7 Feb 2018 13:50:01 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1518007800; x=1518871801; bh=RmK04QsxXsYPYGd1vjpm5FZy1SAnE206xVj qTyeR0B8=; b=ntkE76T6Zt8+QatuKkiX6s39GYdaVvFFvbtbK9Rh8czYhkq9RJv ldkQjvUpD+L5cLSnwinZ6UUk+BX8uLJzZqgKLJHW/FuJ//dMa9LvQTLRWUGrTVjL a3PNf8gSzPNk5Srx/xxsRXruiLOKjbr92zHZl7EvJrDvHHphFw60XEJE= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SsRON7UvQ7xN for ; Wed, 7 Feb 2018 13:50:00 +0100 (CET) Received: from [192.168.2.132] (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 16906B00556; Wed, 7 Feb 2018 13:50:00 +0100 (CET) Subject: Re: [PATCH 2/2] drm/sun4i: Handle DRM_MODE_FLAG_**SYNC_POSITIVE correctly To: Maxime Ripard Cc: airlied@linux.ie, wens@csie.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1516474221-114596-1-git-send-email-giulio.benetti@micronovasrl.com> <1516474221-114596-2-git-send-email-giulio.benetti@micronovasrl.com> <20180122085112.7xo2t3x5ag4k2kpl@flea.lan> <59f7b542-3b1d-ff62-e290-37c47f4075ff@micronovasrl.com> <9929d894-53c3-a7e9-a328-a00cfc1ef546@micronovasrl.com> <20180207103905.mtyzgu73mmifyvvj@flea> From: Giulio Benetti Message-ID: <653f0438-c55a-02a5-dffb-2ee8e6d9ef4a@micronovasrl.com> Date: Wed, 7 Feb 2018 13:49:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180207103905.mtyzgu73mmifyvvj@flea> Content-Type: text/plain; charset=windows-1252 Content-Language: it Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Il 07/02/2018 11:39, Maxime Ripard ha scritto: > On Wed, Jan 24, 2018 at 08:37:28PM +0100, Giulio Benetti wrote: >>>>> Also, how was it tested? This seems quite weird that we haven't caught >>>>> that one sooner, and I'm a bit worried about the possible regressions >>>>> here. >>>> >>>> It sounds really strange to me too, >>>> because everybody under uboot use "sync:3"(HIGH). >>>> I will retry to measure, >>>> unfortunately at home I don't have a scope, >>>> but I think I'm going to have one soon, because of this. :) >>> >>> Here I am with scope captures and tcon0 registers dump: >>> tcon0_regs => https://pasteboard.co/H4r8Zcs.png >>> dclk_d0 => https://pasteboard.co/H4r8QRe.png >>> dclk_de => https://pasteboard.co/H4r8zh4R.png >>> dclk_vsnc => https://pasteboard.co/H4r8Hye.png >>> >>> As you can see circled in reg on registers, >>> TCON0_IO_POL_REG = 0x00000000. >>> But on all the waveforms you can see: >>> - dclk_d0: clock phase is 0, but it starts with falling edge, otherwise >>> the rising front overlaps dclk rising edge(not good), so to me this is >>> falling, then I mean it Negative. >>> - dclk_de: de pulse is clearly negative, even if register is 0 and its' >>> polarity bit is 0. >>> - dclk_vsnc: same as dclk_de >>> - dclk_hsync: I didn't take scope screenshot but I can assure you it's >>> negative. >>> >>> You can also check all the other registers about TCON0. >>> >>> Now I proceed testing it on A33, maybe the peripheral is slightly >>> different between Axx SoCs, if I find it that way, >>> it should be only a check about SoC or peripheral ID, >>> and treat polarity as it should be done. >> >> Here I am with A33 waveforms: >> tcon0_regs => https://pasteboard.co/H4rXfN0M.png >> dclk_d0 => https://pasteboard.co/H4rVXwy.png >> dclk_de => https://pasteboard.co/H4rWDt8.png >> dclk_vsnc => https://pasteboard.co/H4rWRACu.png >> dclk_hsync => https://pasteboard.co/H4rWK6I.png >> >> It behaves the same way as A20, so as I mean IO polarity, >> all signals(except D0-D23), are inverted. >> For A33 I've used A33-OLinuXino. >> For A20 our LiNova1. > > If you have an A33 handy, you probably want to read that mail: > https://lists.freedesktop.org/archives/dri-devel/2017-July/147951.html > > Especially the 90-phase part. Here is a summary of different SoCs TCON: With DCLK_Sel: 0x0 => normal phase 0x1 => 1/3 phase 0x2 => 2/3 phase A10, A20 With DCLK_Sel: 0x0 => normal phase 0x1 => 1/3 phase 0x2 => 2/3 phase 0x5 => DCLK/2 phase 0 0x4 => DCLK/2 phase 90 A31, A31s, A33, A80, A83T Also I've found that TCON1 has not this feature, nor first, nor second case(at least is not described on user manuals). So I could handle differently according to SoC. Unfortunately there is not TCON register keeping IP version, so the only way I see is to create a long if-or statement to understand which kind of TCON we're using. But what sounds not the best to me, is that DCLK is divided by 2 if using phase 90. So we need to reconsider also bitclock driver according to this. I don't know if it make sense. IMHO, I would keep only: - As normal => "0x1 => 1/3 phase" - As inverted => "0x0 => normal phase" According to scope captures above on both A20 and A33. Unfortunately I don't have other boards for the other SoCs to take captures. What do you think? > > Maxime > -- Giulio Benetti R&D Manager & Advanced Research MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale ? 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642