1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * arch/arm/plat-orion/include/plat/addr-map.h 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Marvell Orion SoC address map handling. 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * This file is licensed under the terms of the GNU General Public 7*4882a593Smuzhiyun * License version 2. This program is licensed "as is" without any 8*4882a593Smuzhiyun * warranty of any kind, whether express or implied. 9*4882a593Smuzhiyun */ 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun #ifndef __PLAT_ADDR_MAP_H 12*4882a593Smuzhiyun #define __PLAT_ADDR_MAP_H 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun extern struct mbus_dram_target_info orion_mbus_dram_info; 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun struct orion_addr_map_cfg { 17*4882a593Smuzhiyun const int num_wins; /* Total number of windows */ 18*4882a593Smuzhiyun const int remappable_wins; 19*4882a593Smuzhiyun void __iomem *bridge_virt_base; 20*4882a593Smuzhiyun int hw_io_coherency; 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun /* If NULL, the default cpu_win_can_remap will be used, using 23*4882a593Smuzhiyun the value in remappable_wins */ 24*4882a593Smuzhiyun int (*cpu_win_can_remap) (const struct orion_addr_map_cfg *cfg, 25*4882a593Smuzhiyun const int win); 26*4882a593Smuzhiyun /* If NULL, the default win_cfg_base will be used, using the 27*4882a593Smuzhiyun value in bridge_virt_base */ 28*4882a593Smuzhiyun void __iomem *(*win_cfg_base) (const struct orion_addr_map_cfg *cfg, 29*4882a593Smuzhiyun const int win); 30*4882a593Smuzhiyun }; 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun /* 33*4882a593Smuzhiyun * Information needed to setup one address mapping. 34*4882a593Smuzhiyun */ 35*4882a593Smuzhiyun struct orion_addr_map_info { 36*4882a593Smuzhiyun const int win; 37*4882a593Smuzhiyun const u32 base; 38*4882a593Smuzhiyun const u32 size; 39*4882a593Smuzhiyun const u8 target; 40*4882a593Smuzhiyun const u8 attr; 41*4882a593Smuzhiyun const int remap; 42*4882a593Smuzhiyun }; 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun void __init orion_config_wins(struct orion_addr_map_cfg *cfg, 45*4882a593Smuzhiyun const struct orion_addr_map_info *info); 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, 48*4882a593Smuzhiyun const int win, const u32 base, 49*4882a593Smuzhiyun const u32 size, const u8 target, 50*4882a593Smuzhiyun const u8 attr, const int remap); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, 53*4882a593Smuzhiyun const void __iomem *ddr_window_cpu_base); 54*4882a593Smuzhiyun #endif 55