blob: ec25e16829983ede59634f5a28951987f7e65ff2 [file] [log] [blame]
Liu Gang4cc85322012-03-08 00:33:17 +00001/*
2 * Copyright 2011-2012 Freescale Semiconductor, Inc.
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Liu Gang4cc85322012-03-08 00:33:17 +00005 */
6
7#ifndef _FSL_SRIO_H_
8#define _FSL_SRIO_H_
9
Fabio Estevam1a03a7e2015-11-05 12:43:40 -020010#include <linux/log2.h>
11
Liu Gang4cc85322012-03-08 00:33:17 +000012enum atmu_size {
13 ATMU_SIZE_4K = 0xb,
14 ATMU_SIZE_8K,
15 ATMU_SIZE_16K,
16 ATMU_SIZE_32K,
17 ATMU_SIZE_64K,
18 ATMU_SIZE_128K,
19 ATMU_SIZE_256K,
20 ATMU_SIZE_512K,
21 ATMU_SIZE_1M,
22 ATMU_SIZE_2M,
23 ATMU_SIZE_4M,
24 ATMU_SIZE_8M,
25 ATMU_SIZE_16M,
26 ATMU_SIZE_32M,
27 ATMU_SIZE_64M,
28 ATMU_SIZE_128M,
29 ATMU_SIZE_256M,
30 ATMU_SIZE_512M,
31 ATMU_SIZE_1G,
32 ATMU_SIZE_2G,
33 ATMU_SIZE_4G,
34 ATMU_SIZE_8G,
35 ATMU_SIZE_16G,
36 ATMU_SIZE_32G,
37 ATMU_SIZE_64G,
38};
39
40#define atmu_size_mask(sz) (__ilog2_u64(sz) - 1)
41#define atmu_size_bytes(x) (1ULL << ((x & 0x3f) + 1))
42
43extern void srio_init(void);
Liu Gangd7b17a92012-08-09 05:09:59 +000044#ifdef CONFIG_FSL_CORENET
45extern void srio_boot_master(int port);
46extern void srio_boot_master_release_slave(int port);
Liu Gang4cc85322012-03-08 00:33:17 +000047#endif
48#endif