| 128 | } |
| 129 | |
| 130 | int |
| 131 | platform_start_ap(int cpuid) |
| 132 | { |
| 133 | uint64_t cores_in_reset; |
| 134 | |
| 135 | /* |
| 136 | * Release the core if it is in reset, and let it rev up a bit. |
| 137 | * The real synchronization happens below via octeon_ap_boot. |
| 138 | */ |
| 139 | cores_in_reset = cvmx_read_csr(CVMX_CIU_PP_RST); |
| 140 | if (cores_in_reset & (1ULL << cpuid)) { |
| 141 | if (bootverbose) |
| 142 | printf ("AP #%d still in reset\n", cpuid); |
| 143 | cores_in_reset &= ~(1ULL << cpuid); |
| 144 | cvmx_write_csr(CVMX_CIU_PP_RST, (uint64_t)(cores_in_reset)); |
| 145 | DELAY(2000); /* Give it a moment to start */ |
| 146 | } |
| 147 | |
| 148 | if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0) |
| 149 | return (-1); |
| 150 | for (;;) { |
| 151 | DELAY(1000); |
| 152 | if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0) |
| 153 | return (0); |
| 154 | printf("Waiting for cpu%d to start\n", cpuid); |
| 155 | } |
| 156 | } |
nothing calls this directly
no test coverage detected