Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 1 | /* |
| 2 | * MSMC controller utilities |
| 3 | * |
| 4 | * (C) Copyright 2012-2014 |
| 5 | * Texas Instruments Incorporated, <www.ti.com> |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
| 10 | #include <common.h> |
Hao Zhang | bccf0b7 | 2014-07-16 00:59:24 +0300 | [diff] [blame^] | 11 | #include <asm/arch/msmc.h> |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 12 | |
| 13 | struct mpax { |
| 14 | u32 mpaxl; |
| 15 | u32 mpaxh; |
| 16 | }; |
| 17 | |
| 18 | struct msms_regs { |
| 19 | u32 pid; |
| 20 | u32 _res_04; |
| 21 | u32 smcerrar; |
| 22 | u32 smcerrxr; |
| 23 | u32 smedcc; |
| 24 | u32 smcea; |
| 25 | u32 smsecc; |
| 26 | u32 smpfar; |
| 27 | u32 smpfxr; |
| 28 | u32 smpfr; |
| 29 | u32 smpfcr; |
| 30 | u32 _res_2c; |
| 31 | u32 sbndc[8]; |
| 32 | u32 sbndm; |
| 33 | u32 sbnde; |
| 34 | u32 _res_58; |
| 35 | u32 cfglck; |
| 36 | u32 cfgulck; |
| 37 | u32 cfglckstat; |
| 38 | u32 sms_mpax_lck; |
| 39 | u32 sms_mpax_ulck; |
| 40 | u32 sms_mpax_lckstat; |
| 41 | u32 ses_mpax_lck; |
| 42 | u32 ses_mpax_ulck; |
| 43 | u32 ses_mpax_lckstat; |
| 44 | u32 smestat; |
| 45 | u32 smirstat; |
| 46 | u32 smirc; |
| 47 | u32 smiestat; |
| 48 | u32 smiec; |
| 49 | u32 _res_94_c0[12]; |
| 50 | u32 smncerrar; |
| 51 | u32 smncerrxr; |
| 52 | u32 smncea; |
| 53 | u32 _res_d0_1fc[76]; |
| 54 | struct mpax sms[16][8]; |
| 55 | struct mpax ses[16][8]; |
| 56 | }; |
| 57 | |
| 58 | |
Hao Zhang | bccf0b7 | 2014-07-16 00:59:24 +0300 | [diff] [blame^] | 59 | void msmc_share_all_segments(int priv_id) |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 60 | { |
Khoronzhuk, Ivan | d5cb1bb | 2014-07-09 23:44:44 +0300 | [diff] [blame] | 61 | struct msms_regs *msmc = (struct msms_regs *)KS2_MSMC_CTRL_BASE; |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 62 | int j; |
| 63 | |
| 64 | for (j = 0; j < 8; j++) { |
| 65 | msmc->sms[priv_id][j].mpaxh &= 0xffffff7ful; |
| 66 | msmc->ses[priv_id][j].mpaxh &= 0xffffff7ful; |
| 67 | } |
| 68 | } |