From patchwork Mon Nov 16 17:02:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1401054 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=F0o3XV86; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CZb402DkGz9sPB for ; Tue, 17 Nov 2020 04:02:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8803B823E1; Mon, 16 Nov 2020 18:02:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1605546161; bh=ldPxqKr3rJflifhFWlBIPFY9YLCggZRoIKFXvsTMHgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F0o3XV86SyYn3bJCR457C1y3/kSKttCYUIx6TQBQD0hg6+67IjAKR4eUoosW9jQvI uN7iZkrrBcd9Hvk6Ttrv9RkbhN90T4FGftaey+VlRQyMBTSHZmUOi7FIGgfG70YyQu 9i7YZ1/VTHoFt3IDnIGTJotD4QuaCD7hPHSCZI45WFynox/gPa7fZ0x0+mLHnm/Hc5 O14+OnKdiyppP9L6oE2QsQbDchwnR3WwLC2FbIwgpf2GePxUOtYYNTV4tF22s5QwBl dyAQ3ViDhxdaMNUFJKYmbu5rWZ+TSG+yU2kVQ2S+uzS/abYOzmWlvck+TAUza+giKd ZFfRInKsaPJCg== Received: by phobos.denx.de (Postfix, from userid 109) id 564FA82309; Mon, 16 Nov 2020 18:02:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 97AE882304 for ; Mon, 16 Nov 2020 18:02:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 17402A0BBF; Mon, 16 Nov 2020 18:02:35 +0100 (CET) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 5M9OMQ_TK5ym; Mon, 16 Nov 2020 18:02:31 +0100 (CET) From: Stefan Roese To: u-boot@lists.denx.de Cc: Joe Hershberger , Aaron Williams , Chandrakala Chavva Subject: [PATCH 3/3] net: e1000: Add missing address translations Date: Mon, 16 Nov 2020 18:02:30 +0100 Message-Id: <20201116170230.1148457-3-sr@denx.de> In-Reply-To: <20201116170230.1148457-1-sr@denx.de> References: <20201116170230.1148457-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -0.77 / 15.00 / 15.00 X-Rspamd-Queue-Id: EC59D1854 X-Rspamd-UID: 77eb52 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.3 at phobos.denx.de X-Virus-Status: Clean Add some missing address translations from virtual address in local DRAM to physical address, which is needed for the DMA transactions to work correctly. This issue was detected while testing the e1000 driver on the MIPS Octeon III platform, which needs address translation. Signed-off-by: Stefan Roese Cc: Joe Hershberger Cc: Aaron Williams Cc: Chandrakala Chavva --- drivers/net/e1000.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index bf6cd7d602..cf57ff067b 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -5143,7 +5143,7 @@ fill_rx(struct e1000_hw *hw) rd = rx_base + rx_tail; rx_tail = (rx_tail + 1) % 8; memset(rd, 0, 16); - rd->buffer_addr = cpu_to_le64((unsigned long)packet); + rd->buffer_addr = cpu_to_le64(virt_to_phys(packet)); /* * Make sure there are no stale data in WB over this area, which @@ -5174,8 +5174,8 @@ e1000_configure_tx(struct e1000_hw *hw) unsigned long tipg, tarc; uint32_t ipgr1, ipgr2; - E1000_WRITE_REG(hw, TDBAL, lower_32_bits((unsigned long)tx_base)); - E1000_WRITE_REG(hw, TDBAH, upper_32_bits((unsigned long)tx_base)); + E1000_WRITE_REG(hw, TDBAL, lower_32_bits(virt_to_phys(tx_base))); + E1000_WRITE_REG(hw, TDBAH, upper_32_bits(virt_to_phys(tx_base))); E1000_WRITE_REG(hw, TDLEN, 128); @@ -5319,8 +5319,8 @@ e1000_configure_rx(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } /* Setup the Base and Length of the Rx Descriptor Ring */ - E1000_WRITE_REG(hw, RDBAL, lower_32_bits((unsigned long)rx_base)); - E1000_WRITE_REG(hw, RDBAH, upper_32_bits((unsigned long)rx_base)); + E1000_WRITE_REG(hw, RDBAL, lower_32_bits(virt_to_phys(rx_base))); + E1000_WRITE_REG(hw, RDBAH, upper_32_bits(virt_to_phys(rx_base))); E1000_WRITE_REG(hw, RDLEN, 128);