void main(void) { timestamp_add_now(TS_START_ROMSTAGE); console_init(); configure_l2ctlr(); tsadc_init(); /* vdd_log 1200mv is enough for ddr run 666Mhz */ regulate_vdd_log(1200); timestamp_add_now(TS_BEFORE_INITRAM); sdram_init(get_sdram_config()); timestamp_add_now(TS_AFTER_INITRAM); /* Now that DRAM is up, add mappings for it and DMA coherency buffer. */ mmu_config_range((uintptr_t)_dram/MiB, sdram_size_mb(), DCACHE_WRITEBACK); mmu_config_range((uintptr_t)_dma_coherent/MiB, _dma_coherent_size/MiB, DCACHE_OFF); cbmem_initialize_empty(); timestamp_add_now(TS_END_ROMSTAGE); run_ramstage(); }
void main(void) { extern struct mem_timings mem_timings; int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP); int power_init_failed; exynos5420_config_smp(); power_init_failed = setup_power(is_resume); timestamp_init(timestamp_get()); timestamp_add_now(TS_START_ROMSTAGE); /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ system_clock_init(); exynos_pinmux_uart3(); console_init(); exception_init(); if (power_init_failed) die("Failed to intialize power.\n"); /* re-initialize PMIC I2C channel after (re-)setting system clocks */ i2c_init(PMIC_I2C_BUS, 1000000, 0x00); /* 1MHz */ timestamp_add_now(TS_BEFORE_INITRAM); setup_memory(&mem_timings, is_resume); timestamp_add_now(TS_AFTER_INITRAM); primitive_mem_test(); trustzone_init(); if (is_resume) { wakeup(); } setup_gpio(); setup_ec(); simple_spi_test(); /* Set SPI (primary CBFS media) clock to 50MHz. */ /* if this is uncommented SPI will not work correctly. */ clock_set_rate(PERIPH_ID_SPI1, 50000000); exynos_pinmux_spi1(); simple_spi_test(); cbmem_initialize_empty(); simple_spi_test(); timestamp_add_now(TS_END_ROMSTAGE); run_ramstage(); }
asmlinkage void car_stage_entry(void) { console_init(); cbmem_recovery(0); timestamp_add_now(TS_START_ROMSTAGE); run_ramstage(); }
void main(void) { console_init(); initialize_dram(); /* Add dram mappings to mmu tables. */ setup_dram_mappings(DRAM_INITIALIZED); cbmem_initialize_empty(); run_ramstage(); }
static void __attribute__((noinline)) romstage(void) { timestamp_init(0); timestamp_add_now(TS_START_ROMSTAGE); console_init(); exception_init(); sdram_init(get_sdram_config()); /* used for MMU and CBMEM setup, in MB */ u32 dram_start_mb = (uintptr_t)_dram/MiB; u32 dram_end_mb = sdram_max_addressable_mb(); u32 dram_size_mb = dram_end_mb - dram_start_mb; configure_l2_cache(); mmu_init(); /* Device memory below DRAM is uncached. */ mmu_config_range(0, dram_start_mb, DCACHE_OFF); /* SRAM is cached. MMU code will round size up to page size. */ mmu_config_range((uintptr_t)_sram/MiB, div_round_up(_sram_size, MiB), DCACHE_WRITEBACK); /* DRAM is cached. */ mmu_config_range(dram_start_mb, dram_size_mb, DCACHE_WRITEBACK); /* A window for DMA is uncached. */ mmu_config_range((uintptr_t)_dma_coherent/MiB, _dma_coherent_size/MiB, DCACHE_OFF); /* The space above DRAM is uncached. */ if (dram_end_mb < 4096) mmu_config_range(dram_end_mb, 4096 - dram_end_mb, DCACHE_OFF); mmu_disable_range(0, 1); dcache_mmu_enable(); /* * A watchdog reset only resets part of the system so it ends up in * a funny state. If that happens, we need to reset the whole machine. */ if (power_reset_status() == POWER_RESET_WATCHDOG) { printk(BIOS_INFO, "Watchdog reset detected, rebooting.\n"); hard_reset(); } /* FIXME: this may require coordination with moving timestamps */ cbmem_initialize_empty(); early_mainboard_init(); run_ramstage(); }
void main(void) { #if CONFIG_COLLECT_TIMESTAMPS uint64_t start_romstage_time; uint64_t before_dram_time; uint64_t after_dram_time; uint64_t base_time = timestamp_get(); start_romstage_time = timestamp_get(); #endif console_init(); configure_l2ctlr(); tsadc_init(); /* vdd_log 1200mv is enough for ddr run 666Mhz */ regulate_vdd_log(1200); #if CONFIG_COLLECT_TIMESTAMPS before_dram_time = timestamp_get(); #endif sdram_init(get_sdram_config()); #if CONFIG_COLLECT_TIMESTAMPS after_dram_time = timestamp_get(); #endif /* Now that DRAM is up, add mappings for it and DMA coherency buffer. */ mmu_config_range((uintptr_t)_dram/MiB, sdram_size_mb(), DCACHE_WRITEBACK); mmu_config_range((uintptr_t)_dma_coherent/MiB, _dma_coherent_size/MiB, DCACHE_OFF); cbmem_initialize_empty(); #if CONFIG_COLLECT_TIMESTAMPS timestamp_init(base_time); timestamp_add(TS_START_ROMSTAGE, start_romstage_time); timestamp_add(TS_BEFORE_INITRAM, before_dram_time); timestamp_add(TS_AFTER_INITRAM, after_dram_time); timestamp_add_now(TS_END_ROMSTAGE); #endif #if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE) void *entry = vboot2_load_ramstage(); if (entry != NULL) stage_exit(entry); #endif run_ramstage(); }
void romstage(void) { timestamp_add_now(TS_START_ROMSTAGE); console_init(); exception_init(); printk(BIOS_INFO, "T132: romstage here\n"); #if CONFIG_BOOTROM_SDRAM_INIT printk(BIOS_INFO, "T132 romstage: SDRAM init done by BootROM, RAMCODE = %d\n", sdram_get_ram_code()); #else sdram_init(get_sdram_config()); printk(BIOS_INFO, "T132 romstage: sdram_init done\n"); #endif timestamp_add_now(TS_AFTER_INITRAM); /* * Trust Zone needs to be initialized after the DRAM initialization * because carveout registers are programmed during DRAM init. * cbmem_initialize() is dependent on the Trust Zone region * initalization because CBMEM lives right below the Trust Zone which * needs to be properly identified. */ trustzone_region_init(); /* * When romstage is running it's always on the reboot path -- never a * resume path where cbmem recovery is required. Therefore, always * initialize the cbmem area to be empty. */ cbmem_initialize_empty(); ccplex_cpu_prepare(); printk(BIOS_INFO, "T132 romstage: cpu prepare done\n"); ccplex_load_mts(); printk(BIOS_INFO, "T132 romstage: MTS loading done\n"); romstage_mainboard_init(); run_ramstage(); }
void main(void) { console_init(); tsadc_init(TSHUT_POL_HIGH); exception_init(); /* Init DVS to conservative values. */ init_dvs_outputs(); prepare_usb(); sdram_init(get_sdram_config()); mmu_config_range((void *)0, (uintptr_t)dram_size, CACHED_MEM); mmu_config_range(_dma_coherent, _dma_coherent_size, UNCACHED_MEM); cbmem_initialize_empty(); run_ramstage(); }
void main(void) { struct mem_timings *mem; int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP); timestamp_init(timestamp_get()); timestamp_add_now(TS_START_ROMSTAGE); /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ mem = setup_clock(); console_init(); exception_init(); setup_power(is_resume); timestamp_add_now(TS_BEFORE_INITRAM); setup_memory(mem, is_resume); timestamp_add_now(TS_AFTER_INITRAM); /* This needs to happen on normal boots and on resume. */ trustzone_init(); if (is_resume) { wakeup(); } setup_gpio(); setup_graphics(); /* Set SPI (primary CBFS media) clock to 50MHz and configure pinmux. */ exynos_pinmux_spi1(); clock_set_rate(PERIPH_ID_SPI1, 50000000); cbmem_initialize_empty(); timestamp_add_now(TS_END_ROMSTAGE); run_ramstage(); }
void main(void) { enum cb_err err; console_init(); /* Configure power rails */ err = cubieboard_setup_power(); if (err == CB_SUCCESS) { /* TODO: Get this clock from devicetree.cb */ a1x_set_cpu_clock(1008); } else { /* cubieboard_setup_power() prints more details */ printk(BIOS_WARNING, "Will run CPU at reduced speed\n"); a1x_set_cpu_clock(384); } run_ramstage(); }
void main(void) { console_init(); /* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */ /* * Flush console before changing clock/UART divisor to prevent garbage * being printed. */ console_tx_flush(); clock_init(); // re-initialize UART if (IS_ENABLED(CONFIG_CONSOLE_SERIAL)) uart_init(CONFIG_UART_FOR_CONSOLE); sdram_init(); cbmem_initialize_empty(); run_ramstage(); }
asmlinkage void car_stage_entry(void) { void *hob_list_ptr; struct range_entry fsp_mem; struct range_entry reg_car; printk(BIOS_DEBUG, "Starting romstage...\n"); disable_watchdog(); soc_early_romstage_init(); /* Make sure the blob does not override our data in CAR */ range_entry_init(®_car, (uintptr_t)_car_relocatable_data_end, (uintptr_t)_car_region_end, 0); if (fsp_memory_init(&hob_list_ptr, ®_car) != FSP_SUCCESS) { die("FSP memory init failed. Giving up."); } fsp_find_reserved_memory(&fsp_mem, hob_list_ptr); /* initialize cbmem by adding FSP reserved memory first thing */ cbmem_initialize_empty_id_size(CBMEM_ID_FSP_RESERVED_MEMORY, range_entry_size(&fsp_mem)); /* make sure FSP memory is reserved in cbmem */ if (range_entry_base(&fsp_mem) != (uintptr_t)cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY)) die("Failed to accommodate FSP reserved memory request"); /* Now that CBMEM is up, save the list so ramstage can use it */ fsp_save_hob_list(hob_list_ptr); run_ramstage(); }
void asmlinkage romstage_after_car(void) { /* Load the ramstage. */ run_ramstage(); }
void main(void) { console_init(); run_ramstage(); }
void after_cache_as_ram_stage(void) { /* Load the ramstage. */ run_ramstage(); die("ERROR - Failed to load ramstage!"); }
void main(void) { console_init(); cbmem_initialize_empty(); run_ramstage(); }