dt: Add general DMA window parser
Subsystems (2)
PATCH v3 1/1 dt: Add general DMA window parser
This code was based on:
"arch/microblaze/kernel/prom_parse.c"
"arch/powerpc/kernel/prom_parse.c"
"ibm," prefix could be supported with some modification.
Signed-off-by Hiroshi DOYU <[email protected]>
Cc Thierry Reding <[email protected]>
--- drivers/of/Kconfig | 4 ++ drivers/of/Makefile | 1 + drivers/of/of_dma.c | 70 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/of_address.h | 13 ++++++++ 4 files changed, 88 insertions(+), 0 deletions(-)
drivers/of/Kconfig +4 -0
@@ -83,4 +83,8 @@ config OF_MTD depends on MTD def_bool y +config OF_DMA + depends on HAS_DMA + def_bool y + endmenu # OF
drivers/of/Makefile +1 -0
@@ -11,3 +11,4 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o obj-$(CONFIG_OF_PCI) += of_pci.o obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o obj-$(CONFIG_OF_MTD) += of_mtd.o +obj-$(CONFIG_OF_DMA) += of_dma.o
drivers/of/of_dma.c new file +70 -0
70 lines not on this page · raw message
include/linux/of_address.h +13 -0
@@ -21,6 +21,11 @@ extern void __iomem *of_iomap(struct device_node *device, int index);extern const u32 *of_get_address (struct device_node *dev,int index,u64 *size,unsigned int *flags); +extern int of_get_dma_window (struct device_node *dev, +const char *propname,int index, +unsigned long *busno, +dma_addr_t *phys,size_t *size); +#ifndef pci_address_to_piostatic inline unsigned long pci_address_to_pio (phys_addr_t addr) {return -1 ; }#define pci_address_to_pio pci_address_to_pio
@@ -48,6 +53,14 @@ static inline const u32 *of_get_address(struct device_node *dev, int index, {return NULL ; } + +extern int of_get_dma_window (struct device_node *dev, +const char *propname,int index, +unsigned long *busno, +dma_addr_t *phys,size_t *size) +{ +return 0 ; +}#endif /* CONFIG_OF_ADDRESS */
Signature · 1 line
1.7.5.4
PATCH 1/1 dt: Add general DMA window parser
From: Hiroshi DOYU <[email protected]>
This code was based on:
"arch/microblaze/kernel/prom_parse.c"
"arch/powerpc/kernel/prom_parse.c"
"ibm," prefix could be supported with some modification.
Signed-off-by Hiroshi DOYU <[email protected]>
Cc Thierry Reding <[email protected]>
--- drivers/of/Kconfig | 4 ++ drivers/of/Makefile | 1 + drivers/of/of_dma.c | 70 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/of_address.h | 13 ++++++++ 4 files changed, 88 insertions(+), 0 deletions(-)
drivers/of/Kconfig +4 -0
@@ -83,4 +83,8 @@ config OF_MTD depends on MTD def_bool y +config OF_DMA + depends on HAS_DMA + def_bool y + endmenu # OF
drivers/of/Makefile +1 -0
@@ -11,3 +11,4 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o obj-$(CONFIG_OF_PCI) += of_pci.o obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o obj-$(CONFIG_OF_MTD) += of_mtd.o +obj-$(CONFIG_OF_DMA) += of_dma.o
drivers/of/of_dma.c new file +70 -0
70 lines not on this page · raw message
include/linux/of_address.h +13 -0
@@ -21,6 +21,11 @@ extern void __iomem *of_iomap(struct device_node *device, int index);extern const u32 *of_get_address (struct device_node *dev,int index,u64 *size,unsigned int *flags); +extern int of_get_dma_window (struct device_node *dev, +const char *propname,int index, +unsigned long *busno, +dma_addr_t *phys,size_t *size); +#ifndef pci_address_to_piostatic inline unsigned long pci_address_to_pio (phys_addr_t addr) {return -1 ; }#define pci_address_to_pio pci_address_to_pio
@@ -48,6 +53,14 @@ static inline const u32 *of_get_address(struct device_node *dev, int index, {return NULL ; } + +extern int of_get_dma_window (struct device_node *dev, +const char *propname,int index, +unsigned long *busno, +dma_addr_t *phys,size_t *size) +{ +return 0 ; +}#endif /* CONFIG_OF_ADDRESS */
Signature · 1 line
1.7.5.4