From: Jim Quinlan <jim2101024@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Brian Norris <computersforpeace@gmail.com>,
Gregory Fong <gregory.0xf0@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com,
Russell King <linux@armlinux.org.uk>,
Ray Jui <ray.jui@broadcom.com>,
Scott Branden <scott.branden@broadcom.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Ralf Baechle <ralf@linux-mips.org>,
Paul Burton <paul.burton@mips.com>,
James Hogan <jhogan@kernel.org>,
Kevin Cernekee <cernekee@gmail.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Arnd Bergmann <arnd@arndb.de>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
Kees Cook <keescook@chromium.org>,
Jinbum Park <jinb.park7@gmail.com>,
Vladimir Murzin <vladimir.murzin@arm.com>,
Jim Quinlan <jim2101024@gmail.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Palmer Dabbelt <palmer@sifive.com>,
Stefan Agner <stefan@agner.ch>, Eric Anholt <eric@anholt.net>,
Simon Horman <horms+renesas@verge.net.au>,
Tony Lindgren <tony@atomide.com>,
Stefan Wahren <stefan.wahren@i2se.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Olof Johansson <olof@lixom.net>,
Thomas Hellstrom <thellstrom@vmware.com>,
Alex Deucher <alexander.deucher@amd.com>,
"Dirk Hohndel (VMware)" <dirk@hohndel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Philippe Ombredanne <pombredanne@nexb.com>,
Kate Stewart <kstewart@linuxfoundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Robin Murphy <robin.murphy@arm.com>,
Justin Chen <justinpopo6@gmail.com>,
Markus Mayer <markus.mayer@broadcom.com>,
Gareth Powell <gpowell@broadcom.com>,
Doug Berger <opendmb@gmail.com>,
linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org,
Christoph Hellwig <hch@lst.de>
Subject: [PATCH v5 10/12] ARM64: declare __phys_to_dma on ARCH_HAS_PHYS_TO_DMA
Date: Thu, 6 Sep 2018 16:42:59 -0400 [thread overview]
Message-ID: <1536266581-7308-11-git-send-email-jim2101024@gmail.com> (raw)
In-Reply-To: <1536266581-7308-1-git-send-email-jim2101024@gmail.com>
This change allows one to define custom routines for __phys_to_dma()
and __dma_to_phys() for the ARM64 architecture by selecting
ARCH_HAS_PHYS_TO_DMA. This is done for similar reasons that caused
arch/x86/include/asm/dma-direct.h to exist (see CONFIG_STA2X11).
Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
---
arch/arm64/include/asm/dma-direct.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 arch/arm64/include/asm/dma-direct.h
diff --git a/arch/arm64/include/asm/dma-direct.h b/arch/arm64/include/asm/dma-direct.h
new file mode 100644
index 0000000..d87da92
--- /dev/null
+++ b/arch/arm64/include/asm/dma-direct.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ARM64_DMA_DIRECT_H
+#define _ARM64_DMA_DIRECT_H 1
+
+static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
+{
+ if (!dev->dma_mask)
+ return false;
+
+ return addr + size - 1 <= *dev->dma_mask;
+}
+
+dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr);
+phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t daddr);
+
+#endif /* _ARM64_DMA_DIRECT_H */
--
1.9.0.138.g2de3478
next prev parent reply other threads:[~2018-09-06 20:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 20:42 [PATCH v5 00/12] PCI: brcmstb: Add Broadcom Settopbox PCIe support Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 01/12] soc: bcm: brcmstb: add memory API Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 02/12] dt-bindings: pci: add DT docs for Brcmstb PCIe device Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 03/12] PCI: brcmstb: add Broadcom STB PCIe host controller driver Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 04/12] PCI: brcmstb: add dma-range mapping for inbound traffic Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 05/12] PCI: brcmstb: add MSI capability Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 06/12] MIPS: BMIPS: add dma remap for BrcmSTB PCIe Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 07/12] PCI/MSI: enable PCI_MSI_IRQ_DOMAIN support for MIPS Jim Quinlan
2018-09-06 21:45 ` Paul Burton
2018-09-10 14:42 ` Jim Quinlan
2018-09-10 14:42 ` Jim Quinlan
2018-09-06 20:42 ` [PATCH v5 08/12] MIPS: BMIPS: add PCI bindings for 7425, 7435 Jim Quinlan
2018-09-06 21:49 ` Paul Burton
2018-09-10 14:37 ` Jim Quinlan
2018-09-10 14:37 ` Jim Quinlan
2018-09-12 14:36 ` Jonas Gorski
2018-09-12 14:36 ` Jonas Gorski
2018-09-12 17:20 ` Florian Fainelli
2018-09-12 17:20 ` Florian Fainelli
2018-09-06 20:42 ` [PATCH v5 09/12] MIPS: BMIPS: enable PCI Jim Quinlan
2018-09-06 20:42 ` Jim Quinlan [this message]
2018-09-06 20:43 ` [PATCH v5 11/12] ARM64: add dma remap for BrcmSTB PCIe Jim Quinlan
2018-09-06 20:43 ` [PATCH v5 12/12] ARM: " Jim Quinlan
2018-09-06 21:25 ` Florian Fainelli
2018-09-13 11:07 ` [PATCH v5 00/12] PCI: brcmstb: Add Broadcom Settopbox PCIe support Lorenzo Pieralisi
2018-09-13 18:24 ` Jim Quinlan
2018-09-13 18:24 ` Jim Quinlan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1536266581-7308-11-git-send-email-jim2101024@gmail.com \
--to=jim2101024@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=cernekee@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dirk@hohndel.org \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=gpowell@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.0xf0@gmail.com \
--cc=hch@lst.de \
--cc=horms+renesas@verge.net.au \
--cc=jhogan@kernel.org \
--cc=jinb.park7@gmail.com \
--cc=justinpopo6@gmail.com \
--cc=keescook@chromium.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lorenzo.pieralisi@arm.com \
--cc=m.szyprowski@samsung.com \
--cc=mark.rutland@arm.com \
--cc=markus.mayer@broadcom.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=nicolas.pitre@linaro.org \
--cc=olof@lixom.net \
--cc=opendmb@gmail.com \
--cc=palmer@sifive.com \
--cc=paul.burton@mips.com \
--cc=pombredanne@nexb.com \
--cc=ralf@linux-mips.org \
--cc=ray.jui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=scott.branden@broadcom.com \
--cc=stefan.wahren@i2se.com \
--cc=stefan@agner.ch \
--cc=tglx@linutronix.de \
--cc=thellstrom@vmware.com \
--cc=tony@atomide.com \
--cc=vladimir.murzin@arm.com \
--cc=will.deacon@arm.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox