Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2010-2011 Freescale Semiconductor, Inc. |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame^] | 6 | #include <config.h> |
| 7 | #include <linux/kernel.h> |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 8 | #include <asm/fsl_portals.h> |
| 9 | #include <asm/fsl_liodn.h> |
| 10 | |
| 11 | #ifdef CONFIG_SYS_DPAA_QBMAN |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 12 | struct qportal_info qp_info[CFG_SYS_QMAN_NUM_PORTALS] = { |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 13 | /* dqrr liodn, frame data liodn, liodn off, sdest */ |
| 14 | SET_QP_INFO(1, 2, 1, 0), |
| 15 | SET_QP_INFO(3, 4, 2, 1), |
| 16 | SET_QP_INFO(5, 6, 3, 2), |
| 17 | SET_QP_INFO(7, 8, 4, 3), |
| 18 | SET_QP_INFO(9, 10, 5, 0), |
| 19 | SET_QP_INFO(11, 12, 6, 1), |
| 20 | SET_QP_INFO(13, 14, 7, 2), |
| 21 | SET_QP_INFO(15, 16, 8, 3), |
| 22 | SET_QP_INFO(17, 18, 9, 0), /* for now, set sdest to 0 */ |
| 23 | SET_QP_INFO(19, 20, 10, 0), /* for now, set sdest to 0 */ |
| 24 | }; |
| 25 | #endif |
| 26 | |
| 27 | struct liodn_id_table liodn_tbl[] = { |
| 28 | #ifdef CONFIG_SYS_DPAA_QBMAN |
| 29 | SET_QMAN_LIODN(31), |
| 30 | SET_BMAN_LIODN(32), |
| 31 | #endif |
| 32 | |
| 33 | SET_SDHC_LIODN(1, 64), |
| 34 | |
| 35 | SET_USB_LIODN(1, "fsl-usb2-mph", 93), |
| 36 | SET_USB_LIODN(2, "fsl-usb2-dr", 94), |
| 37 | |
| 38 | SET_SATA_LIODN(1, 95), |
| 39 | SET_SATA_LIODN(2, 96), |
| 40 | |
| 41 | SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 1, 195), |
| 42 | SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 2, 196), |
| 43 | SET_PCI_LIODN_BASE(CONFIG_SYS_FSL_PCIE_COMPAT, 3, 197), |
| 44 | |
Tudor Laurentiu | 7210d9a | 2014-11-20 12:09:31 +0200 | [diff] [blame] | 45 | SET_DMA_LIODN(1, "fsl,eloplus-dma", 193), |
| 46 | SET_DMA_LIODN(2, "fsl,eloplus-dma", 194), |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 47 | }; |
| 48 | int liodn_tbl_sz = ARRAY_SIZE(liodn_tbl); |
| 49 | |
| 50 | #ifdef CONFIG_SYS_DPAA_FMAN |
Igal Liberman | e14ec99 | 2015-08-18 14:47:05 +0300 | [diff] [blame] | 51 | struct fman_liodn_id_table fman1_liodn_tbl[] = { |
Tudor Laurentiu | f2baab2 | 2014-12-09 11:00:19 +0200 | [diff] [blame] | 52 | SET_FMAN_RX_1G_LIODN(1, 0, 11), |
| 53 | SET_FMAN_RX_1G_LIODN(1, 1, 12), |
| 54 | SET_FMAN_RX_1G_LIODN(1, 2, 13), |
| 55 | SET_FMAN_RX_1G_LIODN(1, 3, 14), |
| 56 | SET_FMAN_RX_1G_LIODN(1, 4, 15), |
| 57 | SET_FMAN_RX_10G_LIODN(1, 0, 16), |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 58 | }; |
| 59 | int fman1_liodn_tbl_sz = ARRAY_SIZE(fman1_liodn_tbl); |
| 60 | |
Tom Rini | 0a2bac7 | 2022-11-16 13:10:29 -0500 | [diff] [blame] | 61 | #if (CFG_SYS_NUM_FMAN == 2) |
Igal Liberman | e14ec99 | 2015-08-18 14:47:05 +0300 | [diff] [blame] | 62 | struct fman_liodn_id_table fman2_liodn_tbl[] = { |
Tudor Laurentiu | f2baab2 | 2014-12-09 11:00:19 +0200 | [diff] [blame] | 63 | SET_FMAN_RX_1G_LIODN(2, 0, 17), |
| 64 | SET_FMAN_RX_1G_LIODN(2, 1, 18), |
| 65 | SET_FMAN_RX_1G_LIODN(2, 2, 19), |
| 66 | SET_FMAN_RX_1G_LIODN(2, 3, 20), |
| 67 | SET_FMAN_RX_1G_LIODN(2, 4, 21), |
| 68 | SET_FMAN_RX_10G_LIODN(2, 0, 22), |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 69 | }; |
| 70 | int fman2_liodn_tbl_sz = ARRAY_SIZE(fman2_liodn_tbl); |
| 71 | #endif |
| 72 | #endif |
| 73 | |
| 74 | struct liodn_id_table sec_liodn_tbl[] = { |
| 75 | SET_SEC_JR_LIODN_ENTRY(0, 129, 130), |
| 76 | SET_SEC_JR_LIODN_ENTRY(1, 131, 132), |
| 77 | SET_SEC_JR_LIODN_ENTRY(2, 133, 134), |
| 78 | SET_SEC_JR_LIODN_ENTRY(3, 135, 136), |
| 79 | SET_SEC_RTIC_LIODN_ENTRY(a, 89), |
| 80 | SET_SEC_RTIC_LIODN_ENTRY(b, 90), |
| 81 | SET_SEC_RTIC_LIODN_ENTRY(c, 91), |
| 82 | SET_SEC_RTIC_LIODN_ENTRY(d, 92), |
| 83 | SET_SEC_DECO_LIODN_ENTRY(0, 139, 140), |
| 84 | SET_SEC_DECO_LIODN_ENTRY(1, 141, 142), |
| 85 | SET_SEC_DECO_LIODN_ENTRY(2, 143, 144), |
| 86 | SET_SEC_DECO_LIODN_ENTRY(3, 145, 146), |
| 87 | }; |
| 88 | int sec_liodn_tbl_sz = ARRAY_SIZE(sec_liodn_tbl); |
| 89 | |
| 90 | #ifdef CONFIG_SYS_FSL_RAID_ENGINE |
| 91 | struct liodn_id_table raide_liodn_tbl[] = { |
| 92 | SET_RAID_ENGINE_JQ_LIODN_ENTRY(0, 0, 60), |
| 93 | SET_RAID_ENGINE_JQ_LIODN_ENTRY(0, 1, 61), |
| 94 | SET_RAID_ENGINE_JQ_LIODN_ENTRY(1, 0, 62), |
| 95 | SET_RAID_ENGINE_JQ_LIODN_ENTRY(1, 1, 63), |
| 96 | }; |
| 97 | int raide_liodn_tbl_sz = ARRAY_SIZE(raide_liodn_tbl); |
| 98 | #endif |
| 99 | |
| 100 | struct liodn_id_table liodn_bases[] = { |
| 101 | [FSL_HW_PORTAL_SEC] = SET_LIODN_BASE_2(64, 101), |
| 102 | #ifdef CONFIG_SYS_DPAA_FMAN |
| 103 | [FSL_HW_PORTAL_FMAN1] = SET_LIODN_BASE_1(32), |
| 104 | #endif |
Tom Rini | 0a2bac7 | 2022-11-16 13:10:29 -0500 | [diff] [blame] | 105 | #if (CFG_SYS_NUM_FMAN == 2) |
Timur Tabi | d5e1388 | 2012-10-05 11:09:19 +0000 | [diff] [blame] | 106 | [FSL_HW_PORTAL_FMAN2] = SET_LIODN_BASE_1(160), |
| 107 | #endif |
| 108 | #ifdef CONFIG_SYS_FSL_RAID_ENGINE |
| 109 | [FSL_HW_PORTAL_RAID_ENGINE] = SET_LIODN_BASE_1(49), |
| 110 | #endif |
| 111 | }; |