Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Liu Gang | 4cc8532 | 2012-03-08 00:33:17 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2011-2012 Freescale Semiconductor, Inc. |
Liu Gang | 4cc8532 | 2012-03-08 00:33:17 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _FSL_SRIO_H_ |
| 7 | #define _FSL_SRIO_H_ |
| 8 | |
Fabio Estevam | 1a03a7e | 2015-11-05 12:43:40 -0200 | [diff] [blame] | 9 | #include <linux/log2.h> |
| 10 | |
Liu Gang | 4cc8532 | 2012-03-08 00:33:17 +0000 | [diff] [blame] | 11 | enum atmu_size { |
| 12 | ATMU_SIZE_4K = 0xb, |
| 13 | ATMU_SIZE_8K, |
| 14 | ATMU_SIZE_16K, |
| 15 | ATMU_SIZE_32K, |
| 16 | ATMU_SIZE_64K, |
| 17 | ATMU_SIZE_128K, |
| 18 | ATMU_SIZE_256K, |
| 19 | ATMU_SIZE_512K, |
| 20 | ATMU_SIZE_1M, |
| 21 | ATMU_SIZE_2M, |
| 22 | ATMU_SIZE_4M, |
| 23 | ATMU_SIZE_8M, |
| 24 | ATMU_SIZE_16M, |
| 25 | ATMU_SIZE_32M, |
| 26 | ATMU_SIZE_64M, |
| 27 | ATMU_SIZE_128M, |
| 28 | ATMU_SIZE_256M, |
| 29 | ATMU_SIZE_512M, |
| 30 | ATMU_SIZE_1G, |
| 31 | ATMU_SIZE_2G, |
| 32 | ATMU_SIZE_4G, |
| 33 | ATMU_SIZE_8G, |
| 34 | ATMU_SIZE_16G, |
| 35 | ATMU_SIZE_32G, |
| 36 | ATMU_SIZE_64G, |
| 37 | }; |
| 38 | |
| 39 | #define atmu_size_mask(sz) (__ilog2_u64(sz) - 1) |
| 40 | #define atmu_size_bytes(x) (1ULL << ((x & 0x3f) + 1)) |
| 41 | |
| 42 | extern void srio_init(void); |
Liu Gang | d7b17a9 | 2012-08-09 05:09:59 +0000 | [diff] [blame] | 43 | #ifdef CONFIG_FSL_CORENET |
| 44 | extern void srio_boot_master(int port); |
| 45 | extern void srio_boot_master_release_slave(int port); |
Liu Gang | 4cc8532 | 2012-03-08 00:33:17 +0000 | [diff] [blame] | 46 | #endif |
| 47 | #endif |