1 /*
2  * Copyright 2011-2012 Freescale Semiconductor, Inc.
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
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  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22 
23 #ifndef _FSL_SRIO_H_
24 #define _FSL_SRIO_H_
25 
26 enum atmu_size {
27 	ATMU_SIZE_4K = 0xb,
28 	ATMU_SIZE_8K,
29 	ATMU_SIZE_16K,
30 	ATMU_SIZE_32K,
31 	ATMU_SIZE_64K,
32 	ATMU_SIZE_128K,
33 	ATMU_SIZE_256K,
34 	ATMU_SIZE_512K,
35 	ATMU_SIZE_1M,
36 	ATMU_SIZE_2M,
37 	ATMU_SIZE_4M,
38 	ATMU_SIZE_8M,
39 	ATMU_SIZE_16M,
40 	ATMU_SIZE_32M,
41 	ATMU_SIZE_64M,
42 	ATMU_SIZE_128M,
43 	ATMU_SIZE_256M,
44 	ATMU_SIZE_512M,
45 	ATMU_SIZE_1G,
46 	ATMU_SIZE_2G,
47 	ATMU_SIZE_4G,
48 	ATMU_SIZE_8G,
49 	ATMU_SIZE_16G,
50 	ATMU_SIZE_32G,
51 	ATMU_SIZE_64G,
52 };
53 
54 #define atmu_size_mask(sz)	(__ilog2_u64(sz) - 1)
55 #define atmu_size_bytes(x)	(1ULL << ((x & 0x3f) + 1))
56 
57 extern void srio_init(void);
58 #ifdef CONFIG_FSL_CORENET
59 extern void srio_boot_master(int port);
60 extern void srio_boot_master_release_slave(int port);
61 #endif
62 #endif
63