Exemple #1
0
void main(void)
{
	struct mem_timings *mem;
	void *entry;
	int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);

	/* Clock must be initialized before console_init, otherwise you may need
	 * to re-initialize serial console drivers again. */
	mem = setup_clock();

	console_init();

	setup_power(is_resume);
	setup_memory(mem, is_resume);

	if (is_resume) {
		wakeup();
	}

	setup_storage();
	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();

	entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/ramstage");
	stage_exit(entry);
}
Exemple #2
0
void main(void)
{

	extern struct mem_timings mem_timings;
	void *entry;
	int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);

	/* Clock must be initialized before console_init, otherwise you may need
	 * to re-initialize serial console drivers again. */
	system_clock_init();

	console_init();

	setup_power(is_resume);
	setup_memory(&mem_timings, is_resume);

	primitive_mem_test();

	if (is_resume) {
		wakeup();
	}

	setup_storage();
	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);
	simple_spi_test();
	entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");
	simple_spi_test();
	stage_exit(entry);
}
static int init_uffs_fs(void)
{
	struct uffs_MountTableEntrySt *mtbl = &demo_mount;

	/* setup flash storage attributes */
	setup_storage(femu_GetStorage());

	/* setup memory allocator */
	uffs_MemSetupStaticAllocator(&mtbl->dev->mem, static_buffer_pool, sizeof(static_buffer_pool));

	/* setup device: init, release, attr */
	setup_device(mtbl->dev);

	/* register mount table */
	uffs_RegisterMountTable(mtbl);

	return uffs_InitMountTable() == U_SUCC ? 0 : -1;
}
int main(int argc, char *argv[])
{
	int ret;

#ifdef UNIX
	signal(SIGSEGV, crash_handler);
#endif

	uffs_SetupDebugOutput(); 	// setup debug output as early as possible

	if (parse_options(argc, argv) < 0) {
		return -1;
	}
	
	if (conf_verbose_mode) {
		#if 1
		MSGLN("Internal data structure size:");
		MSGLN("  TreeNode: %d", sizeof(TreeNode));
		MSGLN("  struct BlockListSt: %d", sizeof(struct BlockListSt));
		MSGLN("  struct DirhSt: %d", sizeof(struct DirhSt));
		MSGLN("  struct FilehSt: %d", sizeof(struct FilehSt));
		MSGLN("  struct FdataSt: %d", sizeof(struct FdataSt));
		MSGLN("  struct uffs_TagStoreSt: %d", sizeof(struct uffs_TagStoreSt));
		MSGLN("  uffs_Buf: %d", sizeof(uffs_Buf));
		MSGLN("  struct uffs_BlockInfoSt: %d", sizeof(struct uffs_BlockInfoSt));
		MSGLN("");
		#endif
		print_params();
		print_mount_points();
	}

	// setup file emulator storage with parameters from command line
	setup_storage(femu_GetStorage());

	// setup file emulator private data
	setup_emu_private(femu_GetPrivate());

	ret = init_uffs_fs();
	if (ret != 0) {
		MSGLN ("Init file system fail: %d", ret);
		return -1;
	}

	cli_add_commandset(get_helper_cmds());
	cli_add_commandset(get_test_cmds());
	if (conf_command_line_mode) {
		if (conf_exec_script) {
			cli_interpret(script_command);
		}
		cli_main_entry();
	}
	else {
		if (conf_exec_script) {
			cli_interpret(script_command);
		}
		else {
			cli_main_entry();
		}
	}

	release_uffs_fs();

	return 0;
}
Exemple #5
0
/* this happens after cpu_init where exynos resources are set */
static void mainboard_init(device_t dev)
{
	int dp_tries;
	struct s5p_dp_device dp_device = {
		.base = exynos_dp1,
		.video_info = &dp_video_info,
	};
	void *fb_addr = (void *)(get_fb_base_kb() * KiB);

	prepare_usb();
	gpio_init();
	setup_storage();

	i2c_init(TPS65090_BUS, I2C_0_SPEED, I2C_SLAVE);
	i2c_init(7, I2C_0_SPEED, I2C_SLAVE);

	tmu_init(&exynos5250_tmu_info);

	/* Clock Gating all the unused IP's to save power */
	clock_gate();

	/* Disable USB3.0 PLL to save 250mW of power */
	disable_usb30_pll();

	sdmmc_vdd();

	set_vbe_mode_info_valid(&edid, (uintptr_t)fb_addr);

	lcd_vdd();

	// FIXME: should timeout
	do {
		udelay(50);
	} while (!exynos_dp_hotplug());

	exynos_dp_bridge_setup();
	for (dp_tries = 1; dp_tries <= MAX_DP_TRIES; dp_tries++) {
		exynos_dp_bridge_init();
		if (exynos_dp_hotplug()) {
			exynos_dp_reset();
			continue;
		}

		if (dp_controller_init(&dp_device))
			continue;

		udelay(LCD_T3_DELAY_MS * 1000);

		backlight_vdd();
		backlight_pwm();
		backlight_en();
		/* if we're here, we're successful */
		break;
	}

	if (dp_tries > MAX_DP_TRIES)
		printk(BIOS_ERR, "%s: Failed to set up displayport\n", __func__);

	setup_usb();

	// Uncomment to get excessive GPIO output:
	// gpio_info();
}