From 6a63b098f0ea34a2cdfea11a5c5f89e723c862c7 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 26 Jul 2013 10:17:39 -0300 Subject: bus: mvebu-mbus: Add new API for window creation We add an API to create MBus address decoding windows from the target ID and attribute. This function will be used later and deprecate the current name based scheme. Signed-off-by: Thomas Petazzoni Tested-by: Andrew Lunn Tested-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- include/linux/mbus.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/mbus.h') diff --git a/include/linux/mbus.h b/include/linux/mbus.h index dba482e31a13..9245b663e720 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h @@ -62,8 +62,14 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void) int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, size_t size, phys_addr_t remap, unsigned int flags); +int mvebu_mbus_add_window_remap_by_id(unsigned int target, + unsigned int attribute, + phys_addr_t base, size_t size, + phys_addr_t remap); int mvebu_mbus_add_window(const char *devname, phys_addr_t base, size_t size); +int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute, + phys_addr_t base, size_t size); int mvebu_mbus_del_window(phys_addr_t base, size_t size); int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base, size_t mbus_size, phys_addr_t sdram_phys_base, -- cgit v1.2.3 From 6839cfa82f99fd098ea486e7f9df78344c8e091f Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Fri, 26 Jul 2013 10:17:45 -0300 Subject: bus: mvebu-mbus: Introduce device tree binding This patch adds the most fundamental device-tree initialization. We only introduce what's required to be able to probe the mvebu-mbus driver from the DT. Follow-up patches will extend the device tree binding, allowing to describe static address decoding windows. Signed-off-by: Thomas Petazzoni Signed-off-by: Ezequiel Garcia Tested-by: Andrew Lunn Tested-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- include/linux/mbus.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/mbus.h') diff --git a/include/linux/mbus.h b/include/linux/mbus.h index 9245b663e720..eadefd687a0b 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h @@ -74,5 +74,6 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size); int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base, size_t mbus_size, phys_addr_t sdram_phys_base, size_t sdram_size); +int mvebu_mbus_dt_init(void); #endif /* __LINUX_MBUS_H */ -- cgit v1.2.3 From 79d946837c042fba3e9ba2726f3cfa56aa408e16 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Fri, 26 Jul 2013 10:17:47 -0300 Subject: bus: mvebu-mbus: Add new API for the PCIe memory and IO aperture We add two optional properties to the MBus DT binding, to encode the PCIe memory and IO aperture. This allows such information to be retrieved by -for instance- the pci driver to allocate the MBus decoding windows. Correspondingly, and in order to retrieve this information, we add two new APIs. Signed-off-by: Ezequiel Garcia Tested-by: Andrew Lunn Tested-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- include/linux/mbus.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/mbus.h') diff --git a/include/linux/mbus.h b/include/linux/mbus.h index eadefd687a0b..650bc154a86e 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h @@ -11,6 +11,8 @@ #ifndef __LINUX_MBUS_H #define __LINUX_MBUS_H +struct resource; + struct mbus_dram_target_info { /* @@ -59,6 +61,8 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void) } #endif +void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); +void mvebu_mbus_get_pcie_io_aperture(struct resource *res); int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, size_t size, phys_addr_t remap, unsigned int flags); -- cgit v1.2.3 From 124e5427f59877cd9dde5fa2ea90c413765e77ef Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 26 Jul 2013 10:17:50 -0300 Subject: bus: mvebu-mbus: Remove the no longer used name-based API Now that every user of the deprecated name-based API has been converted to using the ID-based API, let's remove the former one. Signed-off-by: Thomas Petazzoni Tested-by: Andrew Lunn Tested-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- include/linux/mbus.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include/linux/mbus.h') diff --git a/include/linux/mbus.h b/include/linux/mbus.h index 650bc154a86e..345b8c53b897 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h @@ -63,15 +63,10 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void) void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); void mvebu_mbus_get_pcie_io_aperture(struct resource *res); -int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, - size_t size, phys_addr_t remap, - unsigned int flags); int mvebu_mbus_add_window_remap_by_id(unsigned int target, unsigned int attribute, phys_addr_t base, size_t size, phys_addr_t remap); -int mvebu_mbus_add_window(const char *devname, phys_addr_t base, - size_t size); int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute, phys_addr_t base, size_t size); int mvebu_mbus_del_window(phys_addr_t base, size_t size); -- cgit v1.2.3