1 /*
2  * Copyright 2012 Freescale Semiconductor, Inc.
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <asm/fsl_portals.h>
9 #include <asm/fsl_liodn.h>
10 
11 #ifdef CONFIG_SYS_DPAA_QBMAN
12 struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
13 	/* dqrr liodn, frame data liodn, liodn off, sdest */
14 	SET_QP_INFO(1, 27, 1, 0),
15 	SET_QP_INFO(2, 28, 1, 0),
16 	SET_QP_INFO(3, 29, 1, 1),
17 	SET_QP_INFO(4, 30, 1, 1),
18 	SET_QP_INFO(5, 31, 1, 2),
19 	SET_QP_INFO(6, 32, 1, 2),
20 	SET_QP_INFO(7, 33, 1, 3),
21 	SET_QP_INFO(8, 34, 1, 3),
22 	SET_QP_INFO(9, 35, 1, 0),
23 	SET_QP_INFO(10, 36, 1, 0),
24 	SET_QP_INFO(11, 37, 1, 1),
25 	SET_QP_INFO(12, 38, 1, 1),
26 	SET_QP_INFO(13, 39, 1, 2),
27 	SET_QP_INFO(14, 40, 1, 2),
28 	SET_QP_INFO(15, 41, 1, 3),
29 	SET_QP_INFO(16, 42, 1, 3),
30 	SET_QP_INFO(17, 43, 1, 0),
31 	SET_QP_INFO(18, 44, 1, 0),
32 	SET_QP_INFO(19, 45, 1, 1),
33 	SET_QP_INFO(20, 46, 1, 1),
34 	SET_QP_INFO(21, 47, 1, 2),
35 	SET_QP_INFO(22, 48, 1, 2),
36 	SET_QP_INFO(23, 49, 1, 3),
37 	SET_QP_INFO(24, 50, 1, 3),
38 	SET_QP_INFO(25, 51, 1, 0),
39 };
40 #endif
41 
42 struct srio_liodn_id_table srio_liodn_tbl[] = {
43 	SET_SRIO_LIODN_1(1, 307),
44 	SET_SRIO_LIODN_1(2, 387),
45 };
46 int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
47 
48 struct liodn_id_table liodn_tbl[] = {
49 #ifdef CONFIG_SYS_DPAA_QBMAN
50 	SET_QMAN_LIODN(62),
51 	SET_BMAN_LIODN(63),
52 #endif
53 
54 	SET_SDHC_LIODN(1, 552),
55 
56 	SET_USB_LIODN(1, "fsl-usb2-mph", 553),
57 
58 	SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 1, 148),
59 
60 	SET_DMA_LIODN(1, 147),
61 	SET_DMA_LIODN(2, 227),
62 
63 	SET_GUTS_LIODN("fsl,rapidio-delta", 199, rio1liodnr, 0),
64 	SET_GUTS_LIODN(NULL, 200, rio2liodnr, 0),
65 	SET_GUTS_LIODN(NULL, 201, rio1maintliodnr, 0),
66 	SET_GUTS_LIODN(NULL, 202, rio2maintliodnr, 0),
67 
68 	/* SET_NEXUS_LIODN(557), -- not yet implemented */
69 };
70 int liodn_tbl_sz = ARRAY_SIZE(liodn_tbl);
71 
72 #ifdef CONFIG_SYS_DPAA_FMAN
73 struct liodn_id_table fman1_liodn_tbl[] = {
74 	SET_FMAN_RX_1G_LIODN(1, 0, 88),
75 	SET_FMAN_RX_1G_LIODN(1, 1, 89),
76 	SET_FMAN_RX_1G_LIODN(1, 2, 90),
77 	SET_FMAN_RX_1G_LIODN(1, 3, 91),
78 	SET_FMAN_RX_1G_LIODN(1, 4, 92),
79 	SET_FMAN_RX_1G_LIODN(1, 5, 93),
80 	SET_FMAN_RX_10G_LIODN(1, 0, 94),
81 	SET_FMAN_RX_10G_LIODN(1, 1, 95),
82 };
83 int fman1_liodn_tbl_sz = ARRAY_SIZE(fman1_liodn_tbl);
84 #endif
85 
86 struct liodn_id_table sec_liodn_tbl[] = {
87 	SET_SEC_JR_LIODN_ENTRY(0, 454, 458),
88 	SET_SEC_JR_LIODN_ENTRY(1, 455, 459),
89 	SET_SEC_JR_LIODN_ENTRY(2, 456, 460),
90 	SET_SEC_JR_LIODN_ENTRY(3, 457, 461),
91 	SET_SEC_RTIC_LIODN_ENTRY(a, 453),
92 	SET_SEC_RTIC_LIODN_ENTRY(b, 549),
93 	SET_SEC_RTIC_LIODN_ENTRY(c, 550),
94 	SET_SEC_RTIC_LIODN_ENTRY(d, 551),
95 	SET_SEC_DECO_LIODN_ENTRY(0, 541, 610),
96 	SET_SEC_DECO_LIODN_ENTRY(1, 542, 611),
97 };
98 int sec_liodn_tbl_sz = ARRAY_SIZE(sec_liodn_tbl);
99 
100 #ifdef CONFIG_SYS_DPAA_RMAN
101 struct liodn_id_table rman_liodn_tbl[] = {
102 	/* Set RMan block 0-3 liodn offset */
103 	SET_RMAN_LIODN(0, 678),
104 	SET_RMAN_LIODN(1, 679),
105 	SET_RMAN_LIODN(2, 680),
106 	SET_RMAN_LIODN(3, 681),
107 };
108 int rman_liodn_tbl_sz = ARRAY_SIZE(rman_liodn_tbl);
109 #endif
110 
111 struct liodn_id_table liodn_bases[] = {
112 	[FSL_HW_PORTAL_SEC]  = SET_LIODN_BASE_2(462, 558),
113 #ifdef CONFIG_SYS_DPAA_FMAN
114 	[FSL_HW_PORTAL_FMAN1] = SET_LIODN_BASE_1(973),
115 #endif
116 #ifdef CONFIG_SYS_DPAA_RMAN
117 	[FSL_HW_PORTAL_RMAN] = SET_LIODN_BASE_1(922),
118 #endif
119 };
120