diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/of_address.h | 48 | ||||
| -rw-r--r-- | include/linux/of_pci.h | 2 | ||||
| -rw-r--r-- | include/linux/platform_data/omap_ocp2scp.h | 31 |
3 files changed, 50 insertions, 31 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 0506eb53519b..4c2e6f26432c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
| @@ -4,6 +4,36 @@ | |||
| 4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
| 5 | #include <linux/of.h> | 5 | #include <linux/of.h> |
| 6 | 6 | ||
| 7 | struct of_pci_range_parser { | ||
| 8 | struct device_node *node; | ||
| 9 | const __be32 *range; | ||
| 10 | const __be32 *end; | ||
| 11 | int np; | ||
| 12 | int pna; | ||
| 13 | }; | ||
| 14 | |||
| 15 | struct of_pci_range { | ||
| 16 | u32 pci_space; | ||
| 17 | u64 pci_addr; | ||
| 18 | u64 cpu_addr; | ||
| 19 | u64 size; | ||
| 20 | u32 flags; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define for_each_of_pci_range(parser, range) \ | ||
| 24 | for (; of_pci_range_parser_one(parser, range);) | ||
| 25 | |||
| 26 | static inline void of_pci_range_to_resource(struct of_pci_range *range, | ||
| 27 | struct device_node *np, | ||
| 28 | struct resource *res) | ||
| 29 | { | ||
| 30 | res->flags = range->flags; | ||
| 31 | res->start = range->cpu_addr; | ||
| 32 | res->end = range->cpu_addr + range->size - 1; | ||
| 33 | res->parent = res->child = res->sibling = NULL; | ||
| 34 | res->name = np->full_name; | ||
| 35 | } | ||
| 36 | |||
| 7 | #ifdef CONFIG_OF_ADDRESS | 37 | #ifdef CONFIG_OF_ADDRESS |
| 8 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 38 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
| 9 | extern bool of_can_translate_address(struct device_node *dev); | 39 | extern bool of_can_translate_address(struct device_node *dev); |
| @@ -27,6 +57,11 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | |||
| 27 | #define pci_address_to_pio pci_address_to_pio | 57 | #define pci_address_to_pio pci_address_to_pio |
| 28 | #endif | 58 | #endif |
| 29 | 59 | ||
| 60 | extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
| 61 | struct device_node *node); | ||
| 62 | extern struct of_pci_range *of_pci_range_parser_one( | ||
| 63 | struct of_pci_range_parser *parser, | ||
| 64 | struct of_pci_range *range); | ||
| 30 | #else /* CONFIG_OF_ADDRESS */ | 65 | #else /* CONFIG_OF_ADDRESS */ |
| 31 | #ifndef of_address_to_resource | 66 | #ifndef of_address_to_resource |
| 32 | static inline int of_address_to_resource(struct device_node *dev, int index, | 67 | static inline int of_address_to_resource(struct device_node *dev, int index, |
| @@ -53,6 +88,19 @@ static inline const __be32 *of_get_address(struct device_node *dev, int index, | |||
| 53 | { | 88 | { |
| 54 | return NULL; | 89 | return NULL; |
| 55 | } | 90 | } |
| 91 | |||
| 92 | static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
| 93 | struct device_node *node) | ||
| 94 | { | ||
| 95 | return -1; | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline struct of_pci_range *of_pci_range_parser_one( | ||
| 99 | struct of_pci_range_parser *parser, | ||
| 100 | struct of_pci_range *range) | ||
| 101 | { | ||
| 102 | return NULL; | ||
| 103 | } | ||
| 56 | #endif /* CONFIG_OF_ADDRESS */ | 104 | #endif /* CONFIG_OF_ADDRESS */ |
| 57 | 105 | ||
| 58 | 106 | ||
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index bb115deb7612..7a04826018c0 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
| @@ -10,5 +10,7 @@ int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); | |||
| 10 | struct device_node; | 10 | struct device_node; |
| 11 | struct device_node *of_pci_find_child_device(struct device_node *parent, | 11 | struct device_node *of_pci_find_child_device(struct device_node *parent, |
| 12 | unsigned int devfn); | 12 | unsigned int devfn); |
| 13 | int of_pci_get_devfn(struct device_node *np); | ||
| 14 | int of_pci_parse_bus_range(struct device_node *node, struct resource *res); | ||
| 13 | 15 | ||
| 14 | #endif | 16 | #endif |
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h deleted file mode 100644 index 5c6c3939355f..000000000000 --- a/include/linux/platform_data/omap_ocp2scp.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * omap_ocp2scp.h -- ocp2scp header file | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __DRIVERS_OMAP_OCP2SCP_H | ||
| 20 | #define __DRIVERS_OMAP_OCP2SCP_H | ||
| 21 | |||
| 22 | struct omap_ocp2scp_dev { | ||
| 23 | const char *drv_name; | ||
| 24 | struct resource *res; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct omap_ocp2scp_platform_data { | ||
| 28 | int dev_cnt; | ||
| 29 | struct omap_ocp2scp_dev **devices; | ||
| 30 | }; | ||
| 31 | #endif /* __DRIVERS_OMAP_OCP2SCP_H */ | ||
