| 574 | } |
| 575 | |
| 576 | void |
| 577 | platform_start(__register_t a0, __register_t a1, __register_t a2, |
| 578 | __register_t a3) |
| 579 | { |
| 580 | vm_offset_t kernend; |
| 581 | uint64_t platform_counter_freq; |
| 582 | int error; |
| 583 | |
| 584 | /* clear the BSS and SBSS segments */ |
| 585 | kernend = (vm_offset_t)&end; |
| 586 | memset(&edata, 0, kernend - (vm_offset_t)(&edata)); |
| 587 | |
| 588 | mips_postboot_fixup(); |
| 589 | |
| 590 | /* Initialize pcpu stuff */ |
| 591 | mips_pcpu0_init(); |
| 592 | |
| 593 | #ifdef CFE |
| 594 | /* |
| 595 | * Initialize CFE firmware trampolines. This must be done |
| 596 | * before any CFE APIs are called, including writing |
| 597 | * to the CFE console. |
| 598 | * |
| 599 | * CFE passes the following values in registers: |
| 600 | * a0: firmware handle |
| 601 | * a2: firmware entry point |
| 602 | * a3: entry point seal |
| 603 | */ |
| 604 | if (a3 == CFE_EPTSEAL) |
| 605 | cfe_init(a0, a2); |
| 606 | #endif |
| 607 | |
| 608 | /* Init BCM platform data */ |
| 609 | if ((error = bcm_init_platform_data(&bcm_platform_data))) |
| 610 | panic("bcm_init_platform_data() failed: %d", error); |
| 611 | |
| 612 | platform_counter_freq = bcm_get_cpufreq(bcm_get_platform()); |
| 613 | |
| 614 | /* CP0 ticks every two cycles */ |
| 615 | mips_timer_early_init(platform_counter_freq / 2); |
| 616 | |
| 617 | cninit(); |
| 618 | |
| 619 | mips_init(); |
| 620 | |
| 621 | mips_timer_init_params(platform_counter_freq, 1); |
| 622 | } |
| 623 | |
| 624 | /* |
| 625 | * CFE-based EARLY_PRINTF support. To use, add the following to the kernel |
nothing calls this directly
no test coverage detected