Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5358716ybl; Tue, 27 Aug 2019 03:29:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqykB5SXB2u7HiBuK1kfYanbhcZ1NsgnfrEcURPLxoYDbT3VYVEFCoITa9Y5u8+yKbyw2PXF X-Received: by 2002:a17:90a:e502:: with SMTP id t2mr24649742pjy.104.1566901779963; Tue, 27 Aug 2019 03:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566901779; cv=none; d=google.com; s=arc-20160816; b=MZPlRj70dx3ESIpwA9ZHSR67cbR/+eve5aapvSx34C4i8CEbO/DWJbX8fomUuF5lso 5z3gAbgKlxkz85dVhcSaE6F9Lr5sS4OM6ybBJ1ordbwRmP3vOR7InNsn45g3tBQ1JRmn OjXTnlaV/mq1T4TcCKRr6bKziSdoPa6P1sqONzTGzaMPBdAmxR6BtFq6+9LqGv1Q3drE XDhSoIQm1tmOy8YKzv0m/Gs9K3MeI6B8BtlsMRDw53WVYHA/EKCC59Q3G6piAUYk5UNq 4ChA81vJ+p/ra+MgR76QZBDkji6q5EhPrEyD2gJga68D8pnQMEtFzvDZstG7kc2PeKzF PK1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=hpmMfEcW04e4wPdBKLOA6yCkiTAFKCBRUZkT3TMGsjY=; b=yEjCdeR59ktVAACmihdzM0MOYGKowQZoLHTZ/j5ZD4VnnvdNtgwDx08K2UVOD9lc1K nS8qrcpBR++z6LD/4pl+gfYEhT4vHDWISlftO2eXGFro37BzNmg+NPPghjPmhoLU7DKG B1rtp73uPBW6tsYI3OlxaHJ3dxC81a7Y2vwRaV8+l6pfeAp7TkglKvkXAWzEZZnJEboC wsywgBLSHdF6lZL3xZF3SuyzzjGH2uLfzW1ZFZE5Syz5i/pK4rT3JgiyvCUz86aLupIW fz0SPp/7KaydSEBSvDMEvh10SkkkHxJo9kKioaWWWAzGx+5hJmDWWyCv9qOIAr2IWsar j6kA== ARC-Authentication-Results: i=1; mx.google.com; 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 b16si11401655pgh.296.2019.08.27.03.29.24; Tue, 27 Aug 2019 03:29:39 -0700 (PDT) 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; 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 S1727380AbfH0K2e (ORCPT + 99 others); Tue, 27 Aug 2019 06:28:34 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:44950 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbfH0K2e (ORCPT ); Tue, 27 Aug 2019 06:28:34 -0400 Received: by mail-ed1-f66.google.com with SMTP id a21so30684217edt.11 for ; Tue, 27 Aug 2019 03:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hpmMfEcW04e4wPdBKLOA6yCkiTAFKCBRUZkT3TMGsjY=; b=c6byvNcwbhIrNve7LC3shQH9cUbZdUoI4/jFQJVsXz4gQ/OJQ5YiTsuZLnSmDczGNn iW4BdFD6Md0soOOQIgWQ1zHJIODbswJr+DVw2RnueHiAwToTneg9EPK4KkTCAdh12752 a8xh/piIoIJVZIW7rLQDp3qnC43Bx5dOsvS720iEhj4aASzVY/aDoZetOeFoYd+8Ff6s 1iBJCsoyRTo7RvcSvJf01b004DYuIX6EL1GeZJesDS2PAtOg8RdiyYqFt+yPZE3EGw2C wJW42sU2hLZac5xOKWDMB7QN5sEERJMfgQ/pKOymT4Q8ZSNMmPzceNOAMNkWPYKSxeX7 dDZg== X-Gm-Message-State: APjAAAUp6sGHG3CY4isCbMNn4hGYq9e8sPoO+q12xhjy98hMqY5+mOjc DtrQR+0Y/2y5ofDOXrAufxCjp9JSuxc= X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr21404030ejb.275.1566901711746; Tue, 27 Aug 2019 03:28:31 -0700 (PDT) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com. [209.85.128.48]) by smtp.gmail.com with ESMTPSA id y19sm1877777edu.90.2019.08.27.03.28.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Aug 2019 03:28:31 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id i63so2425443wmg.4 for ; Tue, 27 Aug 2019 03:28:31 -0700 (PDT) X-Received: by 2002:a1c:eb0a:: with SMTP id j10mr28275617wmh.125.1566901711153; Tue, 27 Aug 2019 03:28:31 -0700 (PDT) MIME-Version: 1.0 References: <20190826180734.15801-1-codekipper@gmail.com> <20190826180734.15801-2-codekipper@gmail.com> In-Reply-To: From: Chen-Yu Tsai Date: Tue, 27 Aug 2019 18:28:16 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T To: Code Kipper Cc: Maxime Ripard , linux-sunxi , linux-arm-kernel , Liam Girdwood , Mark Brown , linux-kernel , Linux-ALSA , "Andrea Venturi (pers)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 4:35 PM Code Kipper wrote: > > On Tue, 27 Aug 2019 at 10:01, Chen-Yu Tsai wrote: > > > > On Tue, Aug 27, 2019 at 1:55 PM Code Kipper wrote: > > > > > > On Tue, 27 Aug 2019 at 06:13, Chen-Yu Tsai wrote: > > > > > > > > On Tue, Aug 27, 2019 at 2:07 AM wrote: > > > > > > > > > > From: Marcus Cooper > > > > > > > > > > The regmap configuration is set up for the legacy block on the > > > > > A83T whereas it uses the new block with a larger register map. > > > > > > > > Looking at the code Allwinner previously released [1], that doesn't seem to be > > > > the case. Keep in mind that the register map shown in the user manual is for > > > > the TDM interface, which we don't actually support right now. > > > > > > Should it matter what we support right now?, the block according to the user > > > manual shows the bigger range. I don't have a A83T device and from what I > > > > There are a total of four I2S controllers on the A83T. Currently three of them > > are listed in the dtsi file, which are _not_ the one shown in the user manual. > > The one shown is the fourth one, which is the TDM controller. > > The configuration for the A83T suggests that it's a mixture of old and > new which I don't > think is the case considering it was released around the same time as > the H3. There > is enough similarity between the blocks for it to still work. For > example on the H6 > we referenced by mistake the H3 block and we still got audio (with > only slight distortion). The difference with the A83T here is large enough that if you play anything it will simply stall. I already reported it as broken and Maxime has sent fixes. > I would suggest to validate all of the i2s blocks we need to test > using the internal loopback > as that will also cover capture. > > > > > It's not like we haven't seen this before. IIRC the A64 also had two variants > > of the I2S interface. The one coupled with the audio codec was different from > > the others. > > Yes...but the i2s of the audio codec was documented in the audio codec > section. I've used > this device to ensure that I've not broken anything in the old block > with these new changes. > > > > > > gather not many users do. But the compatible for the H3 has been removed > > > and replaced with the settings for the A83T which also has default settings in > > > registers further up than SUNXI_RXCHMAP. > > > > I'll sync up with Maxime on this. > > > > > > > > > > The file shows the base address as 0x01c22800, and the last defined register > > > > is SUNXI_RXCHMAP at 0x3c. > > > > > > > > The I2S driver [2] also shows that it is the old register map size, but with > > > > TX_FIFO and INT_STA swapped around. This might mean that it would need a > > > > separate regmap_config, as the read/write callbacks need to be changed to > > > > fit the swapped registers. > > > > > > > > Finally, the TDM driver [3], which matches the TDM section in the manual, shows > > > > a larger register map. > > > > > > > > A83T is SUN8IW6, while SUN8IW7 refers to the H3. > > > > > > Since when have we trusted Allwinner code?, the TDM labelled block > > > clearly supports > > > > Since they haven't listed the I2S block in the user manual, so that is what we > > have to go by. > > > > The TDM section in the user manual only lists the block at 0x1c23000. The memory > > map says DAUDIO-[012] for addresses 0x1c22000, 0x1c22400, 0x1c22800, and TDM for > > address 0x1c23000. One would assume this meant these are somewhat different. > > > > > I2S. The biggest use case for this block is getting HDMI audio working > > > on the newer > > > > I understand that. > > > > > devices(LibreELEC nightlies has a user base of over 300) and I've tested this on > > > numerous set ups over the last couple of years. > > > > Tested on the H3, correct? > > Yes....but only with the additional changes for multi-channel with my > LibreELEC build. > These changes I tested on my pine64 before pushing upstream. > > > > > > Failing that reverting (3e9acd7ac693: "ASoC: sun4i-i2s: Remove > > > duplicated quirks structure") > > > would help. > > > > I'll take a look. IIRC it worked with the old layout, with the two registers > > swapped, playing standard 48 KHz / 16 bit audio when I added supported for > > the A83T. Then again maybe the stars were perfectly aligned. At the very least > > we could separate A83T and H3 as you suggested. Maxime has sent a patch reverting the merger. ChenYu