blob: 172dbdbe46496e463bc09491f489d2c59f40f31a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
York Sun9941a222012-10-08 07:44:19 +00002/*
3 * Copyright 2012 Freescale Semiconductor, Inc.
York Sun9941a222012-10-08 07:44:19 +00004 */
5
6#include <common.h>
7#include <asm/fsl_portals.h>
8#include <asm/fsl_liodn.h>
9
10#ifdef CONFIG_SYS_DPAA_QBMAN
11struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
12 /* dqrr liodn, frame data liodn, liodn off, sdest */
13 SET_QP_INFO(1, 27, 1, 0),
14 SET_QP_INFO(2, 28, 1, 0),
15 SET_QP_INFO(3, 29, 1, 1),
16 SET_QP_INFO(4, 30, 1, 1),
17 SET_QP_INFO(5, 31, 1, 2),
18 SET_QP_INFO(6, 32, 1, 2),
19 SET_QP_INFO(7, 33, 1, 3),
20 SET_QP_INFO(8, 34, 1, 3),
21 SET_QP_INFO(9, 35, 1, 4),
22 SET_QP_INFO(10, 36, 1, 4),
23 SET_QP_INFO(11, 37, 1, 5),
24 SET_QP_INFO(12, 38, 1, 5),
25 SET_QP_INFO(13, 39, 1, 6),
26 SET_QP_INFO(14, 40, 1, 6),
27 SET_QP_INFO(15, 41, 1, 7),
28 SET_QP_INFO(16, 42, 1, 7),
29 SET_QP_INFO(17, 43, 1, 8),
30 SET_QP_INFO(18, 44, 1, 8),
31 SET_QP_INFO(19, 45, 1, 9),
32 SET_QP_INFO(20, 46, 1, 9),
33 SET_QP_INFO(21, 47, 1, 10),
34 SET_QP_INFO(22, 48, 1, 10),
35 SET_QP_INFO(23, 49, 1, 11),
36 SET_QP_INFO(24, 50, 1, 11),
37 SET_QP_INFO(65, 89, 1, 0),
38 SET_QP_INFO(66, 90, 1, 0),
39 SET_QP_INFO(67, 91, 1, 1),
40 SET_QP_INFO(68, 92, 1, 1),
41 SET_QP_INFO(69, 93, 1, 2),
42 SET_QP_INFO(70, 94, 1, 2),
43 SET_QP_INFO(71, 95, 1, 3),
44 SET_QP_INFO(72, 96, 1, 3),
45 SET_QP_INFO(73, 97, 1, 4),
46 SET_QP_INFO(74, 98, 1, 4),
47 SET_QP_INFO(75, 99, 1, 5),
48 SET_QP_INFO(76, 100, 1, 5),
49 SET_QP_INFO(77, 101, 1, 6),
50 SET_QP_INFO(78, 102, 1, 6),
51 SET_QP_INFO(79, 103, 1, 7),
52 SET_QP_INFO(80, 104, 1, 7),
53 SET_QP_INFO(81, 105, 1, 8),
54 SET_QP_INFO(82, 106, 1, 8),
55 SET_QP_INFO(83, 107, 1, 9),
56 SET_QP_INFO(84, 108, 1, 9),
57 SET_QP_INFO(85, 109, 1, 10),
58 SET_QP_INFO(86, 110, 1, 10),
59 SET_QP_INFO(87, 111, 1, 11),
60 SET_QP_INFO(88, 112, 1, 11),
61 SET_QP_INFO(25, 51, 1, 0),
62 SET_QP_INFO(26, 52, 1, 0),
63};
64#endif
65
Chunhe Lan8e4f3ff2014-04-14 18:42:06 +080066#ifdef CONFIG_SYS_SRIO
York Sun9941a222012-10-08 07:44:19 +000067struct srio_liodn_id_table srio_liodn_tbl[] = {
Liu Gangd5eca7e2013-06-25 18:12:14 +080068 SET_SRIO_LIODN_BASE(1, 307),
69 SET_SRIO_LIODN_BASE(2, 387),
York Sun9941a222012-10-08 07:44:19 +000070};
71int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
Chunhe Lan8e4f3ff2014-04-14 18:42:06 +080072#endif
York Sun9941a222012-10-08 07:44:19 +000073
74struct liodn_id_table liodn_tbl[] = {
75#ifdef CONFIG_SYS_DPAA_QBMAN
76 SET_QMAN_LIODN(62),
77 SET_BMAN_LIODN(63),
78#endif
79
80 SET_SDHC_LIODN(1, 552),
81
82 SET_PME_LIODN(117),
83
84 SET_USB_LIODN(1, "fsl-usb2-mph", 553),
85 SET_USB_LIODN(2, "fsl-usb2-dr", 554),
86
87 SET_SATA_LIODN(1, 555),
88 SET_SATA_LIODN(2, 556),
89
Laurentiu TUDOR4a6f7102013-10-23 15:20:16 +030090 SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 1, 148),
91 SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 2, 228),
92 SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 3, 308),
93 SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 4, 388),
York Sun9941a222012-10-08 07:44:19 +000094
Tudor Laurentiu7210d9a2014-11-20 12:09:31 +020095 SET_DMA_LIODN(1, "fsl,elo3-dma", 147),
96 SET_DMA_LIODN(2, "fsl,elo3-dma", 227),
York Sun9941a222012-10-08 07:44:19 +000097
98 SET_GUTS_LIODN("fsl,rapidio-delta", 199, rio1liodnr, 0),
99 SET_GUTS_LIODN(NULL, 200, rio2liodnr, 0),
100 SET_GUTS_LIODN(NULL, 201, rio1maintliodnr, 0),
101 SET_GUTS_LIODN(NULL, 202, rio2maintliodnr, 0),
102
103#ifdef CONFIG_SYS_PMAN
104 SET_PMAN_LIODN(1, 513),
105 SET_PMAN_LIODN(2, 514),
106 SET_PMAN_LIODN(3, 515),
107#endif
108
109 /* SET_NEXUS_LIODN(557), -- not yet implemented */
110};
111int liodn_tbl_sz = ARRAY_SIZE(liodn_tbl);
112
113#ifdef CONFIG_SYS_DPAA_FMAN
Igal Libermane14ec992015-08-18 14:47:05 +0300114struct fman_liodn_id_table fman1_liodn_tbl[] = {
York Sun9941a222012-10-08 07:44:19 +0000115 SET_FMAN_RX_1G_LIODN(1, 0, 88),
116 SET_FMAN_RX_1G_LIODN(1, 1, 89),
117 SET_FMAN_RX_1G_LIODN(1, 2, 90),
118 SET_FMAN_RX_1G_LIODN(1, 3, 91),
119 SET_FMAN_RX_1G_LIODN(1, 4, 92),
120 SET_FMAN_RX_1G_LIODN(1, 5, 93),
121 SET_FMAN_RX_10G_LIODN(1, 0, 94),
122 SET_FMAN_RX_10G_LIODN(1, 1, 95),
123};
124int fman1_liodn_tbl_sz = ARRAY_SIZE(fman1_liodn_tbl);
125#if (CONFIG_SYS_NUM_FMAN == 2)
Igal Libermane14ec992015-08-18 14:47:05 +0300126struct fman_liodn_id_table fman2_liodn_tbl[] = {
York Sun9941a222012-10-08 07:44:19 +0000127 SET_FMAN_RX_1G_LIODN(2, 0, 88),
128 SET_FMAN_RX_1G_LIODN(2, 1, 89),
129 SET_FMAN_RX_1G_LIODN(2, 2, 90),
130 SET_FMAN_RX_1G_LIODN(2, 3, 91),
131 SET_FMAN_RX_1G_LIODN(2, 4, 92),
132 SET_FMAN_RX_1G_LIODN(2, 5, 93),
133 SET_FMAN_RX_10G_LIODN(2, 0, 94),
134 SET_FMAN_RX_10G_LIODN(2, 1, 95),
135};
136int fman2_liodn_tbl_sz = ARRAY_SIZE(fman2_liodn_tbl);
137#endif
138#endif
139
140struct liodn_id_table sec_liodn_tbl[] = {
141 SET_SEC_JR_LIODN_ENTRY(0, 454, 458),
142 SET_SEC_JR_LIODN_ENTRY(1, 455, 459),
143 SET_SEC_JR_LIODN_ENTRY(2, 456, 460),
144 SET_SEC_JR_LIODN_ENTRY(3, 457, 461),
145 SET_SEC_RTIC_LIODN_ENTRY(a, 453),
146 SET_SEC_RTIC_LIODN_ENTRY(b, 549),
147 SET_SEC_RTIC_LIODN_ENTRY(c, 550),
148 SET_SEC_RTIC_LIODN_ENTRY(d, 551),
149 SET_SEC_DECO_LIODN_ENTRY(0, 541, 610),
150 SET_SEC_DECO_LIODN_ENTRY(1, 542, 611),
151 SET_SEC_DECO_LIODN_ENTRY(2, 543, 612),
152 SET_SEC_DECO_LIODN_ENTRY(3, 544, 613),
153 SET_SEC_DECO_LIODN_ENTRY(4, 545, 614),
154 SET_SEC_DECO_LIODN_ENTRY(5, 546, 615),
155 SET_SEC_DECO_LIODN_ENTRY(6, 547, 616),
156 SET_SEC_DECO_LIODN_ENTRY(7, 548, 617),
157};
158int sec_liodn_tbl_sz = ARRAY_SIZE(sec_liodn_tbl);
159
160#ifdef CONFIG_SYS_DPAA_RMAN
161struct liodn_id_table rman_liodn_tbl[] = {
162 /* Set RMan block 0-3 liodn offset */
Minghuan Lian621de442013-07-03 18:32:41 +0800163 SET_RMAN_LIODN(0, 6),
164 SET_RMAN_LIODN(1, 7),
165 SET_RMAN_LIODN(2, 8),
166 SET_RMAN_LIODN(3, 9),
York Sun9941a222012-10-08 07:44:19 +0000167};
168int rman_liodn_tbl_sz = ARRAY_SIZE(rman_liodn_tbl);
169#endif
170
171struct liodn_id_table liodn_bases[] = {
172#ifdef CONFIG_SYS_DPAA_DCE
173 [FSL_HW_PORTAL_DCE] = SET_LIODN_BASE_2(618, 694),
174#endif
175 [FSL_HW_PORTAL_SEC] = SET_LIODN_BASE_2(462, 558),
176#ifdef CONFIG_SYS_DPAA_FMAN
177 [FSL_HW_PORTAL_FMAN1] = SET_LIODN_BASE_1(973),
178#if (CONFIG_SYS_NUM_FMAN == 2)
179 [FSL_HW_PORTAL_FMAN2] = SET_LIODN_BASE_1(1069),
180#endif
181#endif
182#ifdef CONFIG_SYS_DPAA_PME
183 [FSL_HW_PORTAL_PME] = SET_LIODN_BASE_2(770, 846),
184#endif
185#ifdef CONFIG_SYS_DPAA_RMAN
186 [FSL_HW_PORTAL_RMAN] = SET_LIODN_BASE_1(922),
187#endif
188};