From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99027C433B4 for ; Fri, 14 May 2021 15:30:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24BB660C3D for ; Fri, 14 May 2021 15:30:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24BB660C3D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uvALy7gOU1s50c9otaNBxq6ii0TXES3H9XTWwI1//jM=; b=SPnRc5fjfpl659TLpAcejOni6 QkaJmqNF3GnQUnCG/W24kr1JAWsIGRrJvjHxIaaiTj9BsBDlX70OsrSj+QaAl5gReEV7NBvo/Hkrg SVIeIvh58pwE0QLxnXJQz+rbtakGafRYXvysdKLSRCD0fvOCDIligtWM2qXvgc1MLaN9kSU7lTebb QcbpcHOKtjo0JvcVoIR0TnV/4F5Qd4iJI/v25HK9+BvExyU7De/LhM7d9zq7IBOaq/8jEPBoGkdEH /bxvOf186zt50cC357Z1moR63WZa8kQ+nqJ62Ud1QaXEi0ozwDILLJQTFRcQ42tBqlQsts1JKzy5a RN6rvGcbw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZiy-008Oep-Nk; Fri, 14 May 2021 15:27:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZiw-008OeV-J1 for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 15:27:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=i3brosy5XXCkmKkwn4l+AKR0pDfb4h3+yvaYa21wYq8=; b=Y588sSVAg29S6XvzG5Z1z1t8+x hvuwguMKKlGpny6xIjcfwR8z+iAV54YkKo3QhT03zLZ0vfEdpsOMsAskjqYWI71PS5C1aA03yF2E+ UixVorXxgR/XSMrIi5vwuzBDc/vA05V91bSqgg3nnEPweuP5o8iaLr/b3i5EjdYue/aBDBkyUSxG8 JlL0VzXnG3VlUt/0M2z9AHXP4J+BwxLV+mwuGfDBKFPDBOcCY409tmF6O+4bIJUqG3lo5kJ1gHizd H3uVUc/Q8xVPHkZnQSM93teRkKJnALUbtv1rpMgHr/DKUAKXCgRtaz2j5dK3VM4ga9kuyLL4vajTn ampMs/Vw==; Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZit-00C50G-8b for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 15:27:33 +0000 Received: by mail-ed1-x52b.google.com with SMTP id v5so24051979edc.8 for ; Fri, 14 May 2021 08:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i3brosy5XXCkmKkwn4l+AKR0pDfb4h3+yvaYa21wYq8=; b=mvupAA+p79dUWGrk5E9BhZLhvX9JvYDYdfPKI0wDBotNmCLqg3UFxsUrKQkKJqiY8S XhsJVW4vb1kD1hglJRcJzKssA5UudA7JhrLNQ70yXUK4P4dNVfNhXsyKC0nashJtSiwZ orl4sFrJASzL4RelDgUo65UasmHetoYz+MTm7rZzbxDsooDJ25IlZrMV4oru0CiIu91y 5XSaX9kx2z5I0tlTHvbX+dikC1jfIQFiTiLHQSZ1UPlIAfmPlZBSGc/IxYepE/4l+o2L AMV6zGQOuc4Rr9IeLJ61y/xUYZV3gHWJZg7j1Q9Po+Gj1YWHfdXEj8coPnAq9LwhRmbF /LgA== 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=i3brosy5XXCkmKkwn4l+AKR0pDfb4h3+yvaYa21wYq8=; b=KUQnJj5mJn+z/vmDqnyx7Y31PY1V3+eq0udspjJNuFi0cwdh8YGIrdzBikXwuIYaf9 yLolXj3rvQEoeDCslL1rZHzaEz9QJ+yLZ5ZAFy52EyaNrdkH+zdJuSefxzHxMdjDqs7l ce1Mklt1XUAQPfyGWzKCsnX52We6thNO/JlnftDIVobv0Zx5trpA6WNo8paegWEeRGm3 WwFEQh83LD4spkX/KgfWd68tJb8uNvcmpApvZU/Z0FrYBrKL6+LFEBtNTMT3zoG2n7/S PtJ+sQHK3BEPMgIf1vGVzoTty3rio+IhaFXfzzMBV+EtJcMbPgBJwpkiuN3dxc2J+26d Hkog== X-Gm-Message-State: AOAM530YCog5fTAZmwycyEM1FgdlTMF8xooaduGbqVzTFD91Cmj5iHGC M0I3Pz9IL6iMCdy1zG45+me3mWJoGD2D6KRJ88E= X-Google-Smtp-Source: ABdhPJzxzvECOpWhrEYSAUed+9/+7dKEurVBbGT3SafR8RZsxzrkQZPj+cNf2hwM9Z2zBQsI6YC4+h9k5GCJ+ejBCoQ= X-Received: by 2002:a05:6402:310a:: with SMTP id dc10mr56815244edb.38.1621006049041; Fri, 14 May 2021 08:27:29 -0700 (PDT) MIME-Version: 1.0 References: <20210406013344.124255-1-aford173@gmail.com> <20210511024604.GE3425@dragon> In-Reply-To: From: Adam Ford Date: Fri, 14 May 2021 10:27:17 -0500 Message-ID: Subject: Re: [PATCH 1/2] arm64: dts: imx8mn: Add spba1 bus To: Robin Gong Cc: Shawn Guo , arm-soc , Rob Herring , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , dl-linux-imx , devicetree , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_082731_327429_A85DF62E X-CRM114-Status: GOOD ( 41.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 14, 2021 at 9:57 AM Robin Gong wrote: > > On 5/11/21 22:49 Adam Ford wrote: > > > > Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch? > > > > > > > In fact, if the DMA firmware isn't loaded, I often get transfer errors. > > > UART use SDMA ROM firmware instead of RAM firmware, so it should work > > > even without sdma RAM firmware loaded. Still curious what really > > > happen in your board without this patch. > > > > What I am seeing is that at times, the HCI UART loading before the DMA > > firmware is loaded. > > > > [ 10.582037] Bluetooth: HCI UART driver ver 2.3 > > [ 10.586867] Bluetooth: HCI UART protocol H4 registered > > [ 10.593566] imx-sdma 30bd0000.dma-controller: sdma firmware not > > ready! > Seems you apply my patch set ' add ecspi ERR009165 for i.mx6/7 soc family' > https://www.spinics.net/lists/linux-spi/msg26728.html I did this on the 5.13-rc1 which appears to have this series applied. > where 'sdma firmware not ready' added? > > > [ 10.594548] Bluetooth: HCI UART protocol Broadcom registered > > [ 10.600108] imx-uart 30860000.serial: We cannot prepare for the RX slave > > dma! > Why not use ROM script for UART as mailine linux-next did (even the above patch set)? > If so, I don't think you could such issue on your board. What script(peripheral types) you > set in uart dts such as below is 4-- MCU domain UART-> IMX_DMATYPE_UART->app_2_mcu: > > dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>; I didn't change the DMA references from the default, and I didn't check to verify whether they are right or not. > > > > > When I get the above message, the bluetooth chip I have throws timeouts and > > does not function. > > > > [ 10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5 > > > > Once the firmware is loaded, I can unload the HCI Uart driver and re-load > > Bluetooth works again. > > > > Based on that, I've been having my system delay the loading of the Bluetooth > > modules until after the firmware is loaded, but this tells me there is a > > relationship between the DMA and UART. > If you use ram script, of course you should use it after firmware loaded. Actually > Spba bus in dts is only used for per_2_per script judging if the peripheral address > could be accessed directly by SDMA over SPBA, if yes, set SDMA_WATERMARK_LEVEL_SP > to let per_2_per script access peripheral over SPBA, otherwise, access peripheral by > AIPS instead like ARM side did. Please check with below commit for more. > Besides, per_2_per script is used for audio data sample rate convert between ASRC and > various audio input. So audio peripherals include ASRC should be in register scope of > 'spba-bus' . But with your patch, there are two 'spba-bus' device node in dts, so the first > Spba-bus should contain audio peripheral, otherwise, 'of_find_compatible_node > (NULL, NULL, "fsl,spba-bus")' may find the wrong one so that SDMA_WATERMARK_LEVEL_SP > Never be set. I don't pretend to understand the details of the dma driver, but I attempted to make the patch match the address range of both spba busses from the technical reference manual,so there should be an spba bus for the audio peripherals and an spba bus for the serial peripherals like UART and SPI. I only named them spba1 and spba2 based on the memory ranges defined in the ref manual. Table 2-5 shows SBPA1 is 3080_0000 and table 2-3 shows SPBA2 starts at 3000_0000 which is what I believe I did in this patch. > > BTW, do you mean the above firmware load issue you met is gone if this patch applied? > If yes, that really surprised me... I wasn't trying to imply that adding the spba-bus fixes my Bluetooth issue. I was just stating there is some relationship between the DMA and the UART and if the UART throws a DMA error, the Bluetooth will fail too. What I have been doing to ensure the order of operations is to make the imx_sdma and the Bluetooth system as modules. I tell my sysfs to load the imx_sdma module first, then load the Bluetooth modules. When done in that order, I never see the DMA errors. With UART baud rates at 3Mbps+, I wanted to make sure the DMA was operational to help potentially reduce the A53 workload. adam > > commit 8391ecf465ec5c8ccef547267df6d40beb8999a4 > Author: Shengjiu Wang > Date: Fri Jul 10 17:08:16 2015 +0800 > > dmaengine: imx-sdma: Add device to device support > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel