We do only i/o device credit setup here. CPU credit setup is now * moved to xlp_msgring_cpu_init() so that the credits get setup * only if the CPU exists. xlp_msgring_cpu_init() gets called from * platform_init_ap; and this makes it easy for us to setup CMS * credits for various types of XLP chips, with varying number of * cpu's and cores. */
| 116 | * cpu's and cores. |
| 117 | */ |
| 118 | static void |
| 119 | xlp_cms_credit_setup(int credit) |
| 120 | { |
| 121 | uint64_t cmspcibase, cmsbase, pcibase; |
| 122 | uint32_t devoffset; |
| 123 | int dev, fn, maxqid; |
| 124 | int src, qid, i; |
| 125 | |
| 126 | for (i = 0; i < XLP_MAX_NODES; i++) { |
| 127 | cmspcibase = nlm_get_cms_pcibase(i); |
| 128 | if (!nlm_dev_exists(XLP_IO_CMS_OFFSET(i))) |
| 129 | continue; |
| 130 | cmsbase = nlm_get_cms_regbase(i); |
| 131 | maxqid = nlm_read_reg(cmspcibase, XLP_PCI_DEVINFO_REG0); |
| 132 | for (dev = 0; dev < 8; dev++) { |
| 133 | for (fn = 0; fn < 8; fn++) { |
| 134 | devoffset = XLP_HDR_OFFSET(i, 0, dev, fn); |
| 135 | if (nlm_dev_exists(devoffset) == 0) |
| 136 | continue; |
| 137 | pcibase = nlm_pcicfg_base(devoffset); |
| 138 | src = nlm_qidstart(pcibase); |
| 139 | if (src == 0) |
| 140 | continue; |
| 141 | #if 0 /* Debug */ |
| 142 | printf("Setup CMS credits for queues "); |
| 143 | printf("[%d to %d] from src %d\n", 0, |
| 144 | maxqid, src); |
| 145 | #endif |
| 146 | for (qid = 0; qid < maxqid; qid++) |
| 147 | nlm_cms_setup_credits(cmsbase, qid, |
| 148 | src, credit); |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | void |
| 155 | xlp_msgring_cpu_init(int node, int cpu, int credit) |
no test coverage detected