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=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 C229CC47095 for ; Wed, 9 Jun 2021 09:55:38 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7114461377 for ; Wed, 9 Jun 2021 09:55:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7114461377 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F3D382ED6; Wed, 9 Jun 2021 11:55:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="HPOhg2U2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 76F5882EF5; Wed, 9 Jun 2021 11:55:33 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::60d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 15C6C82EBF for ; Wed, 9 Jun 2021 11:55:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V0TEYG+0EGRA6Xmv7AtlHpK0OZQ6OCs/KLHJWm5cCsEwxu2uMTHs8FqL/9iccjA2RFuZrYlz5HtnTjAYcU5d2+PiAi56x116VNUtyPr323zjMI7BqHS+GBfO41EAZ+cSJB0NaotNDy/4ohyPH6sOheMdKA1NgmhuCg1VMz3EX52hGnKlzHOINsf+0SWTWId1MgkmCZS4NMI1PkMQdUzMp4UGU+Ttm6r+qBGaglJZIUjcyormvb5b9hCmxv+cPSgxodGtvEA1soU2NpL4XgOv0xiZumuBNQS3/y8TEtBglHAfju4suzKEL2vrMiF/4/6vlKYPGrWtW+n5rUYE88K9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Qac74H65jCkR2D+CybgTHCZf0OP2m1K93cQziAby0k=; b=QumkD3+18iVfpvnXT8kFvD7HvvbD0iKpDJ1zSlxeX8+KaSv4FWyPd9hzVKDQveGYHtk9dGnXdfHsAtojy7GjCL6nxLriK50cLzoYeMFXFISNMDrutIZFfulKKRvDujFG8Q9JcDeAKAfo/+WNfLFKzdTiyr0Bt47tUcU0RXzZgwZ3KDFOu6o1k7pZyNheqSobYMtliCUJa2ChDtkVYX22oZeoPNgzVQYTm1giWuAkJmM2B0e2iZm46nApPwIIXOMo1cYw+G1tFtJyF4mO8/lZAX4YlhUrxo6Jc6UZ1kljeYZN8XKRDBLuf5xUhSyvDriATu6E+9TUENrMP4UqmFcIww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Qac74H65jCkR2D+CybgTHCZf0OP2m1K93cQziAby0k=; b=HPOhg2U2lA3mqfzdSK3jbBfbU35ltuUx+fk7n/PW3x0fK1sWmDaySop7nf8EVQLXlqxoUPtyiObTeW/MwQYa6VQ36NbVdUYJphiKB/7v/qx5drBBxC7nn0eeKHzns7gLUF6PBEbKJ2dHbuw7R8f82BDp5+4uEAQfiCwL5QgtOZk= Received: from DM6PR11CA0025.namprd11.prod.outlook.com (2603:10b6:5:190::38) by MW4PR02MB7411.namprd02.prod.outlook.com (2603:10b6:303:7c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.26; Wed, 9 Jun 2021 09:55:25 +0000 Received: from DM3NAM02FT019.eop-nam02.prod.protection.outlook.com (2603:10b6:5:190:cafe::2) by DM6PR11CA0025.outlook.office365.com (2603:10b6:5:190::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 09:55:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT019.mail.protection.outlook.com (10.13.4.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 09:55:24 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 02:55:24 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 9 Jun 2021 02:55:24 -0700 Envelope-to: u-boot@lists.denx.de, jorge@foundries.io Received: from [172.30.17.109] (port=44110) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lquvk-0008KN-4j; Wed, 09 Jun 2021 02:55:24 -0700 To: "Jorge Ramirez-Ortiz, Foundries" , Michal Simek CC: References: <20210607162748.GA13505@trex> <20210607184142.GA568@trex> <20210608123002.GA25130@trex> From: Michal Simek Subject: Re: Zynq UltraScale MPSoC, DMA driver Message-ID: <53b670be-55db-905a-e873-7149f72ca846@xilinx.com> Date: Wed, 9 Jun 2021 11:55:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210608123002.GA25130@trex> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 620dcbec-5069-4938-e722-08d92b2cb3f7 X-MS-TrafficTypeDiagnostic: MW4PR02MB7411: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xt2pGIKTdmXQTW3/FpvxLemt5b0oiLOWWCIJeUETd7dxw3TG2Yb3MjEEKk4ktQapy0oFstKO0KSXqaMjCWwnWawlhqJkRxU4qGyK69HBSQWkfRckdcSPcsB1S+0USQuUNoOhCS44j72Nyx3togEsCUnG4kyq2wR9jY1ZntCHgXMFtP4KQhZ1Nnk2cslO8c9cOTEJMDVE8CBrADwILqdU1NbWJj97fWAVma698DxyXlcmhwTRLxpwY9H45B8ZYS52TgFdP6iefr4h1qPYzTlnSBdy9J5X5CEaYwptgiJB8zgoLiQk/leXoIsuufstqRaQVbBVjeR66weBXa7O0mZsrSQHhkPHBlj129trBhYP7V8Ku5LYXoMkABzBlihFjkpS6Y+sdS43wgTNrCYynnNdOkMMF+imtrkqueFdigjgQbEMS+UzRGrxtqEa/n4hHHHuc13zLC7hiluDaOtEklMjRAMkDlWeQXD1mLMEEQes6A7LjhMAmvzm7Zw0tCQF6UTDNHtSHr9TloPSHaZ3fJ11Ypx0TKkSxyVBMii9tlpuMdz2ByhfpWzC8WJpckhis0rG1Y+ACko3TXEBD6C7m7YennErdNG+mUO/V1suJhVO93dbr+fATOSoXBhq160x4aD+V83lVOrOf55k86Dxexie3lhsm8Qzs6YSJgGYCEP09MxlBQ3JnjKp7N5x5MSd1keTQS286g0gnSELWP5wcMteIw== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(376002)(39850400004)(396003)(346002)(36840700001)(46966006)(47076005)(478600001)(8676002)(8936002)(9786002)(31696002)(356005)(7636003)(2616005)(36860700001)(426003)(5660300002)(53546011)(82310400003)(110136005)(2906002)(36756003)(83380400001)(44832011)(70206006)(31686004)(186003)(26005)(82740400003)(36906005)(70586007)(316002)(336012)(4326008)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 09:55:24.6650 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 620dcbec-5069-4938-e722-08d92b2cb3f7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT019.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7411 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On 6/8/21 2:30 PM, Jorge Ramirez-Ortiz, Foundries wrote: > On 08/06/21, Michal Simek wrote: >> Hi, >> >> On 6/7/21 8:41 PM, Jorge Ramirez-Ortiz, Foundries wrote: >>> On 07/06/21, Jorge Ramirez-Ortiz, Foundries wrote: >>>> hi Michal >>>> >>>> um, when we exchanged emails about enabling ECC support for MPSoC, I >>>> left with the understanding that there already was a DMA driver >>>> available in u-boot that I could use to initialize the memory. >>>> >>>> do you have something in the works or will I have to write such a >>>> driver? compatible would be 'xlnx,zynqmp-dma-1.0' >>> >>> alternatively, would it be acceptable - upstream - If I just init ECC >>> as done by FSBL (ie, without a proper DMA driver, just accessing the >>> controller)? >> >> There are 2 things here. >> The first thing that would be the best to do it proper framework which >> is likely dma where dma_memset should be likely added. >> The second that this code should land in SPL which can't be big that's >> why this feature should be very small. > > the way I am doing it ATM is just a verbatim of XFsbl_EccInit (grabs a > channel and inits all memory to DEADBEEF). About 100 LOC total. > > I belive the FSBL copyright notice allows for that (below excerpt). > > [..] Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal > in the Software without restriction, including without limitation the rights > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > copies of the Software, and to permit persons to whom the Software is > furnished to do so, [..] > > but yes this just works as expected. You should talk to lawyer about it and I can't give you any recommendation about it. > > a bit trickier is where to init from - for the particular product > I am working on I can hardcode the addresses and sizes and init right > after board_init_f in spl.c...havent had the time to think about > something portable yet - if you have a suggestion I could send both > patches (one for the spl_ecc_init(addr, len) function and another one > calling it) SPL dtb doesn't have memory node which is a surprise. But I expect ECC is working on the memory which is written first. I am OK with adding memory base/size for ECC to Kconfig till someone has time to take a look at memory controller registers to find out which one has size in it that can be read and use. Thanks, Michal