18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * arch/arm/plat-orion/include/plat/addr-map.h 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Marvell Orion SoC address map handling. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public 78c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any 88c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied. 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __PLAT_ADDR_MAP_H 128c2ecf20Sopenharmony_ci#define __PLAT_ADDR_MAP_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciextern struct mbus_dram_target_info orion_mbus_dram_info; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct orion_addr_map_cfg { 178c2ecf20Sopenharmony_ci const int num_wins; /* Total number of windows */ 188c2ecf20Sopenharmony_ci const int remappable_wins; 198c2ecf20Sopenharmony_ci void __iomem *bridge_virt_base; 208c2ecf20Sopenharmony_ci int hw_io_coherency; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci /* If NULL, the default cpu_win_can_remap will be used, using 238c2ecf20Sopenharmony_ci the value in remappable_wins */ 248c2ecf20Sopenharmony_ci int (*cpu_win_can_remap) (const struct orion_addr_map_cfg *cfg, 258c2ecf20Sopenharmony_ci const int win); 268c2ecf20Sopenharmony_ci /* If NULL, the default win_cfg_base will be used, using the 278c2ecf20Sopenharmony_ci value in bridge_virt_base */ 288c2ecf20Sopenharmony_ci void __iomem *(*win_cfg_base) (const struct orion_addr_map_cfg *cfg, 298c2ecf20Sopenharmony_ci const int win); 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* 338c2ecf20Sopenharmony_ci * Information needed to setup one address mapping. 348c2ecf20Sopenharmony_ci */ 358c2ecf20Sopenharmony_cistruct orion_addr_map_info { 368c2ecf20Sopenharmony_ci const int win; 378c2ecf20Sopenharmony_ci const u32 base; 388c2ecf20Sopenharmony_ci const u32 size; 398c2ecf20Sopenharmony_ci const u8 target; 408c2ecf20Sopenharmony_ci const u8 attr; 418c2ecf20Sopenharmony_ci const int remap; 428c2ecf20Sopenharmony_ci}; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_civoid __init orion_config_wins(struct orion_addr_map_cfg *cfg, 458c2ecf20Sopenharmony_ci const struct orion_addr_map_info *info); 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_civoid __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, 488c2ecf20Sopenharmony_ci const int win, const u32 base, 498c2ecf20Sopenharmony_ci const u32 size, const u8 target, 508c2ecf20Sopenharmony_ci const u8 attr, const int remap); 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_civoid __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, 538c2ecf20Sopenharmony_ci const void __iomem *ddr_window_cpu_base); 548c2ecf20Sopenharmony_ci#endif 55