Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2635472pxj; Sun, 6 Jun 2021 08:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHBzFqQ16zWo6I2KFMtwA64M4klOBUxZEBswe/7dQgKLfiB8IneAyNza8AvS46smovTd38 X-Received: by 2002:a05:6402:511:: with SMTP id m17mr15731083edv.1.1622994198590; Sun, 06 Jun 2021 08:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622994198; cv=none; d=google.com; s=arc-20160816; b=YSoUFeq58JAwAoXtHEwPAqbbd0yc+HcStqPEBEyqz+bCSXVEFSQeUxhggLfLR6aIs3 bf24hMHCfzvKaJG96vlyecpDbFx72GH1QXiHWpFZRca+0noWBh221kCUXrwxP2m1+syF s+igx8aPzBPaDYD3q5IJt+d/QfH41c6sFFKWzwgHJUFAmD2FPPE/yciNryqINRQXwAHe 4baTN++A1kb4ZI41LrS7wlqkn+EV8PmZcmrmrrOnUfWQ/o+Q1k1/BdQQSA5hFRIadxi8 g0i4DE95I/DXHJNu/YXqRwv/2W2i/nTBEzA2ZnsmzhKGzUtGxm+uup6SefNtG0B22SnJ EBpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0PrGq1R4q4mzmgUfCdmPfha8bTLMxXo0qld5hpYFpRk=; b=s+JDkEOI0hdMGc/H1VHY8gHSvNIB6LfJqS7dE9PuRR9g1lXXzvFV3pTDDVP7SftM6i jTEod/u32oLBvOWeI6s9HIql6QfdUhN98zPZFSKqw8wQ4/eca67Ty1KsRI638QDccNkG sU+PesicglnscE7NIe6Q3s4XOwA0SQ/OfRsr9mXeT82wc5fcoSQzhsfpia21W6Qi6vwq ix2TgNtFymVIcAijhhuVBcCHbqmPXUgLZNTFIaVZiNrLOex9QEol3Xpwd+q1fO8VQPl8 Q8eu+eKnaIwzmaU2wD94eYqFyYuFZt9sc1VWIYG+K23HevjQJHdPipS3zN4N9TY8C8yi 2NrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N9rfx5WE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si9410500edb.182.2021.06.06.08.42.56; Sun, 06 Jun 2021 08:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N9rfx5WE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbhFFPnw (ORCPT + 99 others); Sun, 6 Jun 2021 11:43:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbhFFPnv (ORCPT ); Sun, 6 Jun 2021 11:43:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D7B0A6141E; Sun, 6 Jun 2021 15:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622994121; bh=UALv1P9ICCpdZuB9WXtufq8mFK4k0gfcSTsGNuUHdbs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N9rfx5WEM01sc2oMICMR3LxHqzPwHxVD3X8RaCYGAz2aqJLvnGQKEjWlwIcAJ90vP FSyE+y4lcqtA2TIifHh6qG0g8ALpoHwdJfdFDcAoVhN6GURA2sAnCYO9UNbxvVB2RF CU2fMPGiGHcj6x0NfT7qT8+UqkfQ+nhrCTFOvdM8XKjXlDergtr9cmR/bQvMxgIhkk 5ach0+jzOFf412AgFUHq0QcsDzu/AP8R/P6BV0Y9REFYKd46o+DIizQfbGlg43aBVQ W0uT8riRypy0LfiJrCdqNWH3Cojpd96xA7ZlZZ0IfKo6JIveUoo+bNCNJuwPa7nTWT vr1Minc11imBg== Received: by mail-lj1-f175.google.com with SMTP id d2so14310010ljj.11; Sun, 06 Jun 2021 08:42:01 -0700 (PDT) X-Gm-Message-State: AOAM53020T8PVnMSPbH767qlEwgHUrtMdpIa1SRyr9VL93u8pBOGhdGU mgDuSd3udLdgBtU4mLMIzr4tp0xO1CLRzU6Pma0= X-Received: by 2002:a2e:8e90:: with SMTP id z16mr11137106ljk.508.1622994120228; Sun, 06 Jun 2021 08:42:00 -0700 (PDT) MIME-Version: 1.0 References: <1622970249-50770-1-git-send-email-guoren@kernel.org> <20210606115027.5c715e64@slackpad.fritz.box> <49182865.cm8dGOVcTj@jernej-laptop> In-Reply-To: <49182865.cm8dGOVcTj@jernej-laptop> From: Guo Ren Date: Sun, 6 Jun 2021 23:41:48 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 11/11] riscv: soc: Allwinner D1 GMAC driver only for temp use To: =?UTF-8?Q?Jernej_=C5=A0krabec?= Cc: Andre Przywara , Anup Patel , Palmer Dabbelt , Arnd Bergmann , wens@csie.org, maxime@cerno.tech, Drew Fustini , liush@allwinnertech.com, =?UTF-8?B?V2VpIFd1ICjlkLTkvJ8p?= , wefu@redhat.com, linux-riscv , Linux Kernel Mailing List , linux-arch , linux-sunxi@lists.linux.dev, Maxime Ripard , Corentin Labbe , Samuel Holland , Icenowy Zheng , LABBE Corentin , Michael Walle , Guo Ren Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 6, 2021 at 11:39 PM Jernej =C5=A0krabec wrote: > > Hi! > > Dne nedelja, 06. junij 2021 ob 17:32:22 CEST je Guo Ren napisal(a): > > , > > > > On Sun, Jun 6, 2021 at 6:50 PM Andre Przywara > wrote: > > > On Sun, 6 Jun 2021 09:04:09 +0000 > > > guoren@kernel.org wrote: > > > > > > Hi, > > > > > > > From: liush > > > > > > > > This is a temporary driver, only guaranteed to work on allwinner > > > > D1. In order to ensure the developer's demand for network usage. > > > > > > That looks like some Allwinner BSP driver, please don't endorse code > > > of this quality (just look at all that commented code and the attempt > > > for compile-time configuration). > > > > > > > It only could work at 1Gps mode. > > > > > > > > The correct gmac driver should follow (I guess) > > > > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > > > > > > > If anyone is familiar with it and can help porting, I would be > > > > very grateful. > > > > > > Have you tried compiling and using that driver? Ideally it should jus= t > > > work, Linux drivers are meant to be portable, by design. And the driv= er > > > is already enabled by COMPILE_TEST. > > > > It still needs some work with dwmac-sun8i.c glue layer, eg: > > tx/rx-delay setting, clk & pinmux drivers. > > > > The patch is just to help people using D1 with GMAC temporarily with > > network function. > > It should be marked "DO NOT MERGE" or similar then. Yes, thx for reminding. I'll fix it next time. > > Best regards, > Jernej > > > > > > But I guess you need some extra care to make the non-coherent DMA wor= k? > > > I haven't looked in detail, but are those new CMOs hooked into the > > > generic DMA framework? > > > > Yes, we have the simliar principle with arm & csky for non-coherent: > > - Using PTE attributes setting Using PTE attributes to support > > _PAGE_IOREMAP & _PAGE_WRITECOMBINE > > - Using CMO instructions deal SYNC_DMA_FOR_CPU/DEVICE. > > > > > Cheers, > > > Andre > > > > > > > Signed-off-by: Liu Shaohua > > > > Tested-by: Guo Ren > > > > Signed-off-by: Guo Ren > > > > Cc: Maxime Ripard > > > > Cc: Corentin Labbe > > > > Cc: Samuel Holland > > > > Cc: Icenowy Zheng > > > > Cc: LABBE Corentin > > > > Cc: Michael Walle > > > > Cc: Chen-Yu Tsai > > > > Cc: Maxime Ripard > > > > Cc: Wei Fu > > > > Cc: Wei Wu > > > > Signed-off-by: Guo Ren > > > --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/