Deleted Added
full compact
octeon_machdep.c (243253) octeon_machdep.c (243469)
1/*-
2 * Copyright (c) 2006 Wojciech A. Koszek <wkoszek@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2006 Wojciech A. Koszek <wkoszek@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/mips/cavium/octeon_machdep.c 243253 2012-11-19 00:19:27Z jmallett $
26 * $FreeBSD: head/sys/mips/cavium/octeon_machdep.c 243469 2012-11-24 02:00:29Z jmallett $
27 */
28#include <sys/cdefs.h>
27 */
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/mips/cavium/octeon_machdep.c 243253 2012-11-19 00:19:27Z jmallett $");
29__FBSDID("$FreeBSD: head/sys/mips/cavium/octeon_machdep.c 243469 2012-11-24 02:00:29Z jmallett $");
30
31#include <sys/param.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/systm.h>
35#include <sys/imgact.h>
36#include <sys/bio.h>
37#include <sys/buf.h>

--- 233 unchanged lines hidden (view full) ---

271}
272
273void
274platform_start(__register_t a0, __register_t a1, __register_t a2 __unused,
275 __register_t a3)
276{
277 const struct octeon_feature_description *ofd;
278 uint64_t platform_counter_freq;
30
31#include <sys/param.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/systm.h>
35#include <sys/imgact.h>
36#include <sys/bio.h>
37#include <sys/buf.h>

--- 233 unchanged lines hidden (view full) ---

271}
272
273void
274platform_start(__register_t a0, __register_t a1, __register_t a2 __unused,
275 __register_t a3)
276{
277 const struct octeon_feature_description *ofd;
278 uint64_t platform_counter_freq;
279 int rv;
279
280 mips_postboot_fixup();
281
282 /*
283 * Initialize boot parameters so that we can determine things like
284 * which console we shoud use, etc.
285 */
286 octeon_boot_params_init(a3);
287
288 /* Initialize pcpu stuff */
289 mips_pcpu0_init();
290 mips_timer_early_init(cvmx_sysinfo_get()->cpu_clock_hz);
291
292 /* Initialize console. */
293 cninit();
294
295 /*
280
281 mips_postboot_fixup();
282
283 /*
284 * Initialize boot parameters so that we can determine things like
285 * which console we shoud use, etc.
286 */
287 octeon_boot_params_init(a3);
288
289 /* Initialize pcpu stuff */
290 mips_pcpu0_init();
291 mips_timer_early_init(cvmx_sysinfo_get()->cpu_clock_hz);
292
293 /* Initialize console. */
294 cninit();
295
296 /*
296 * Display information about the board/CPU.
297 * Display information about the CPU.
297 */
298 */
299#if !defined(OCTEON_MODEL)
300 printf("Using runtime CPU model checks.\n");
301#else
302 printf("Compiled for CPU model: " __XSTRING(OCTEON_MODEL) "\n");
303#endif
304 strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id()));
305 printf("CPU Model: %s\n", cpu_model);
298 printf("CPU clock: %uMHz Core Mask: %#x\n",
299 cvmx_sysinfo_get()->cpu_clock_hz / 1000000,
300 cvmx_sysinfo_get()->core_mask);
306 printf("CPU clock: %uMHz Core Mask: %#x\n",
307 cvmx_sysinfo_get()->cpu_clock_hz / 1000000,
308 cvmx_sysinfo_get()->core_mask);
301 printf("Board Type: %u Revision: %u/%u\n",
302 cvmx_sysinfo_get()->board_type,
303 cvmx_sysinfo_get()->board_rev_major,
304 cvmx_sysinfo_get()->board_rev_minor);
305 printf("MAC address base: %6D (%u configured)\n",
306 cvmx_sysinfo_get()->mac_addr_base, ":",
307 cvmx_sysinfo_get()->mac_addr_count);
309 rv = octeon_model_version_check(cvmx_get_proc_id());
310 if (rv == -1)
311 panic("%s: kernel not compatible with this processor.", __func__);
308
312
313 /*
314 * Display information about the board.
315 */
309#if defined(OCTEON_BOARD_CAPK_0100ND)
310 strcpy(cpu_board, "CAPK-0100ND");
311 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) {
312 panic("Compiled for %s, but board type is %s.", cpu_board,
313 cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type));
314 }
315#else
316 strcpy(cpu_board,
317 cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type));
318#endif
319 printf("Board: %s\n", cpu_board);
316#if defined(OCTEON_BOARD_CAPK_0100ND)
317 strcpy(cpu_board, "CAPK-0100ND");
318 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CN3010_EVB_HS5) {
319 panic("Compiled for %s, but board type is %s.", cpu_board,
320 cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type));
321 }
322#else
323 strcpy(cpu_board,
324 cvmx_board_type_to_string(cvmx_sysinfo_get()->board_type));
325#endif
326 printf("Board: %s\n", cpu_board);
320 strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id()));
321 printf("Model: %s\n", cpu_model);
327 printf("Board Type: %u Revision: %u/%u\n",
328 cvmx_sysinfo_get()->board_type,
329 cvmx_sysinfo_get()->board_rev_major,
330 cvmx_sysinfo_get()->board_rev_minor);
322 printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number);
323
331 printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number);
332
333 /*
334 * Additional on-chip hardware/settings.
335 *
336 * XXX Display PCI host/target? What else?
337 */
338 printf("MAC address base: %6D (%u configured)\n",
339 cvmx_sysinfo_get()->mac_addr_base, ":",
340 cvmx_sysinfo_get()->mac_addr_count);
341
342
324 octeon_ciu_reset();
325 /*
326 * XXX
327 * We can certainly parse command line arguments or U-Boot environment
328 * to determine whether to bootverbose / single user / ... I think
329 * stass has patches to add support for loader things to U-Boot even.
330 */
331 bootverbose = 1;

--- 295 unchanged lines hidden ---
343 octeon_ciu_reset();
344 /*
345 * XXX
346 * We can certainly parse command line arguments or U-Boot environment
347 * to determine whether to bootverbose / single user / ... I think
348 * stass has patches to add support for loader things to U-Boot even.
349 */
350 bootverbose = 1;

--- 295 unchanged lines hidden ---