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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6FCB2C6FA92 for ; Tue, 27 Sep 2022 11:21:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8CFA84CAA; Tue, 27 Sep 2022 13:21:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=codasip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=codasip.com header.i=@codasip.com header.b="O7sESVWE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FD5A80548; Tue, 27 Sep 2022 13:21:44 +0200 (CEST) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C45EE84C4C for ; Tue, 27 Sep 2022 13:21:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=codasip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel.obuch@codasip.com Received: by mail-ed1-x52c.google.com with SMTP id z13so12672567edb.13 for ; Tue, 27 Sep 2022 04:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codasip.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=CZApdUejItPVSz3Thp+yoNc7WUwmfwwbEeb15AClUTQ=; b=O7sESVWE0DLtHd29VX52XvsCZqK8yXCgQXtnKpT2m2OAgrBdBZ1C3XwY8T+mE+IWRi u/yzn1q+bjNP1LykJ+8ypczQzyNn2hpDsS0ls5iSkLXtIexnzG0KsvDZPXvE0jWFvWfu uJrGaxe9LdS5vo4cntXBJgidbdeK4W7uLUncVeCT/HgQBPQd2fNsPQGHPUb/4ksDngLR bvgwSduKEAjfUJey8p3Jq8rS35LIZVfO/f1OFZikvNcaFaGjfpLtgRWyxDKAkLfZCt1I SEVJJliJWwp2a5AqRkhOxI1cXAtxaVgF2clXY/8iPm+yIzeAudmTuewjT4iornKVeGV7 nnDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=CZApdUejItPVSz3Thp+yoNc7WUwmfwwbEeb15AClUTQ=; b=rowsX4X9nNkezVLgoMZ17j4GyUWRNqGSpu/gvLirc10V4nxz49zL3doNBCqQjb75KW PRiH7qJCvSXjMeBfFONxK1xmo9O/Uw207NuJ1deO3o3W2ms4UJX+1u7fV4Dk++1qbaA1 eKEQ56q3Ip/getT8cD3Qf/bElCc9FvfmZFVu0FTQRRY0oSs/tyWqUGICZsW9JKQXWzBN VhEVSW64VVnfX+QnkV3xcbsGqyR8qwMFUiJKBiANSCsVwGl6mTdQ+CMBnGIHIUOvgDxR dk3sHQgzK9Mzt4XpdWrM+f+1VuIcRUeHQtopa7Z1XjgJJKeq7Cj8HafcUjrBz+py9w0H /0vA== X-Gm-Message-State: ACrzQf0JFdYpk5v8WvYXS+FHv/NyqNnetSzwMQtnz0Ganwf54HIIOYB/ C3nHYVUCQYgwy3Yg4FwmrfisbPQFUsucdO4S X-Google-Smtp-Source: AMsMyM5uJzFmEtrI3tT48Y6ew8gY7luqtU/qRUhXisxghC8xcpbD+3BLOt00E/uX5pyPwcnwgdx4dg== X-Received: by 2002:a05:6402:3552:b0:451:2037:639e with SMTP id f18-20020a056402355200b004512037639emr27829271edd.136.1664277699506; Tue, 27 Sep 2022 04:21:39 -0700 (PDT) Received: from nb76.codasip.com (fw1.dino.sk. [84.245.95.252]) by smtp.gmail.com with ESMTPSA id i1-20020a170906a28100b0078238c1c182sm622523ejz.222.2022.09.27.04.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 04:21:39 -0700 (PDT) From: samuel.obuch@codasip.com To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, michal.simek@amd.com, Samuel Obuch Subject: [PATCH v3 1/3] net: emaclite: enable for more architectures Date: Tue, 27 Sep 2022 13:21:01 +0200 Message-Id: <20220927112103.155689-1-samuel.obuch@codasip.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean From: Samuel Obuch Function ioremap_nocache seems to be defined only for MIPS and Microblaze architectures. Therefore, the function call in the emaclite driver causes this driver to be unusable with other architectures, for example RISC-V. Use ioremap function instead of ioremap_nocache, and include linux/io.h instead of asm/io.h, so that ioremap function is automatically created, if not defined by the architecture. We can switch to the ioremap function, as Microblaze's ioremap_nocache is just empty and in MIPS implementations of ioremap_nocache and ioremap are the same. Signed-off-by: Samuel Obuch --- v3: Fix commit message, remove addtional asm/io.h include. v2: Use ioremap instead of ioremap_nocache, switch to linux/io.h. v1: Do not use ioremap_nocache for archs other than MIPS and Microblaze. drivers/net/xilinx_emaclite.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 6c9f1f7c27..29e8271c63 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -14,14 +14,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include -#include #include DECLARE_GLOBAL_DATA_PTR; @@ -615,8 +614,8 @@ static int emaclite_of_to_plat(struct udevice *dev) int offset = 0; pdata->iobase = dev_read_addr(dev); - emaclite->regs = (struct emaclite_regs *)ioremap_nocache(pdata->iobase, - 0x10000); + emaclite->regs = (struct emaclite_regs *)ioremap(pdata->iobase, + 0x10000); emaclite->phyaddr = -1; -- 2.31.1