Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp612846imm; Thu, 6 Sep 2018 07:34:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeR2MD9iO6xxc7saLT0XlSkbGZ9Kvbx91fSMyGGFZ0+zMtYMJEo/DGfZqAtsBZv9FcNLpa X-Received: by 2002:a63:555c:: with SMTP id f28-v6mr3063398pgm.37.1536244445334; Thu, 06 Sep 2018 07:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536244445; cv=none; d=google.com; s=arc-20160816; b=deMxniIeONSoI0fx6BlCG5yyfzPIhOmwaVd3UrWt3bSwErgQwxEgRt52waH8iyqH8h WRKNH1UIMgr/IxdkYPTeFaOivpKfHJ0HrqVr/7Kw0M63YXJfBRhOhVFLKY/F3zZdcDCC dQo0oORlx5yiiFOvhVTMAxbdBXpYVDzFn5DgxxBV4vDfepoco5+zFQNzaCmIHZByIWn4 elni/eSiRCKI4tzowQu/SDYIKDNmf8KEuLz9ma/MoO3MSgl1dr1H63YRbQpFHp/9c9oT 0nBqDcC5BIMaQ2cAlkNijz1Lj6iUtWgjLRHNQszhUKrX9ptQuvovj0D9HxNg+yA2v0gt VDwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=/dTnNXbG7AJ3uOEcFPlRh3sJWKocXIpEXNe+XKnoXLs=; b=NHdeIwJiOTcyKtG1TwkkS5SUfH7WPudGtv57skQ9JPRQZe01vdbZcAa5wZVsDGkf06 n5HSmBgk85m1FQbDeTV5fUsPWPP3igV2zDOl+l/hj/IA3d/L3rphP/87WkKCd9VX/O0Y cN7h2vubZtlNHpfXyejGA8c6qbvmYZg2KQ/jKb1lByQloRlANCXJwXEgm0SmLLywY9NC ppZJ6O9or/crbOCs9FJFVSn+RzvVDwJ5qCOMcn/6GqMhMtCxoY3e9o2FlB9zeIDawc+Z zZIKcWFZ6UACrHUDpGL15tWcvLNvYWTsyz9HbCjjecrrPQzfmtyCHhRFafSUsS+KK32b KVRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n28-v6si5367475pfg.127.2018.09.06.07.33.40; Thu, 06 Sep 2018 07:34:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbeIFTHW (ORCPT + 99 others); Thu, 6 Sep 2018 15:07:22 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:34567 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729937AbeIFTHW (ORCPT ); Thu, 6 Sep 2018 15:07:22 -0400 Received: by mail-qt0-f195.google.com with SMTP id m13-v6so12523197qth.1; Thu, 06 Sep 2018 07:31:33 -0700 (PDT) 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=/dTnNXbG7AJ3uOEcFPlRh3sJWKocXIpEXNe+XKnoXLs=; b=dUDoB1TKr/o3a4AG//35ZYAfIbDtAgGAxsaHfB8qLUxUrAzXMYP7WOuOpv6RTUiqjP O36r7oZtrb/vWXNGatBoERo78QFbpzQhdZVOkS5CjqMTlQ237tQHHWcvbKtnz9g3x/Pz 2QW5ok2/ECGIPxYXwJRUVr7/QAtxKmBthqgKfoKa/subTgtFUZLG/UZ/FZfLw3g6chIf 5gbSYj10GANSTIQS/HEJdU0i5dapiCPbZSvAfrnxBN9ie6Tzl0JfsJmNzUb9oarUMZBw FuceygILQ24oZ1ZbFoGjHpE/fouUaKMS68gTsFoQQZYFtw39BskOheEtVbx9qbh29zBy E/tw== X-Gm-Message-State: APzg51DC9Y3Nkq6NsaVsrhgd+gHw5pWwcNx/5d3AAsATCCUGIexug3dD jLkFJOBR4CNyuIWLtx0EIvXcoeh1EvrZ4DIR4f4= X-Received: by 2002:aed:2b47:: with SMTP id p65-v6mr2331145qtd.132.1536244292864; Thu, 06 Sep 2018 07:31:32 -0700 (PDT) MIME-Version: 1.0 References: <16105a3e54f1c4bb65a5ec81d77af7c176e705c6.1536138304.git.ren_guo@c-sky.com> In-Reply-To: <16105a3e54f1c4bb65a5ec81d77af7c176e705c6.1536138304.git.ren_guo@c-sky.com> From: Arnd Bergmann Date: Thu, 6 Sep 2018 16:31:16 +0200 Message-ID: Subject: Re: [PATCH V3 06/26] csky: Cache and TLB routines To: Guo Ren Cc: linux-arch , Linux Kernel Mailing List , Thomas Gleixner , Daniel Lezcano , Jason Cooper , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, Thomas Petazzoni , wbx@uclibc-ng.org, Greentime Hu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 5, 2018 at 2:08 PM Guo Ren wrote: > diff --git a/arch/csky/include/asm/io.h b/arch/csky/include/asm/io.h > new file mode 100644 > index 0000000..fcb2142 > --- /dev/null > +++ b/arch/csky/include/asm/io.h > @@ -0,0 +1,23 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > +#ifndef __ASM_CSKY_IO_H > +#define __ASM_CSKY_IO_H > + > +#include > +#include > +#include > + > +extern void __iomem *ioremap(phys_addr_t offset, size_t size); > + > +extern void iounmap(void *addr); > + > +extern int remap_area_pages(unsigned long address, phys_addr_t phys_addr, > + size_t size, unsigned long flags); > + > +#define ioremap_nocache(phy, sz) ioremap(phy, sz) > +#define ioremap_wc ioremap_nocache > +#define ioremap_wt ioremap_nocache > + > +#include It is very unusual for an architecture to not need special handling in asm/io.h, to do the proper barriers etc. Can you describe how C-Sky hardware implements MMIO? In particular: - Is a read from uncached memory always serialized with DMA, and with other CPUs doing MMIO access to a different address? - How does endianess work? Are there any buses that flip bytes around when running big-endian, or do you always do that in software? Arnd