Esempio n. 1
0
static int setup_dt_blob(void *blob)
{
	char *bootargs = LINUX_KERNEL_ARG_STRING;
	char *p;
	unsigned int mem_bank = MEM_BANK;
	unsigned int mem_size = MEM_SIZE;
	int ret;

	if (check_dt_blob_valid(blob)) {
		dbg_info("DT: the blob is not a valid fdt\n");
		return -1;
	}

	dbg_info("\nUsing device tree in place at %d\n",
						(unsigned int)blob);

#if defined(CONFIG_LOAD_ANDROID) && defined(CONFIG_SAMA5D3XEK)
	if (get_dm_sn() == BOARD_ID_PDA_DM)
		bootargs = cmd_line_android_pda;
	else
		bootargs = cmd_line_android;
#endif

	/* set "/chosen" node */
	for (p = bootargs; *p == ' '; p++)
		;

	if (*p == '\0')
		return -1;

	ret = fixup_chosen_node(blob, p);
	if (ret)
		return ret;

	ret = fixup_memory_node(blob, &mem_bank, &mem_size);
	if (ret)
		return ret;

	return 0;
}
static void sdcard_set_of_name_board(char *of_name)
{
	unsigned int cpu_board_id = get_cm_sn();
	unsigned int disp_board_id = get_dm_sn();

	if (cpu_board_id == BOARD_ID_SAM9G15_CM)
		strcpy(of_name, "at91sam9g15ek");
	else if (cpu_board_id == BOARD_ID_SAM9G25_CM)
		strcpy(of_name, "at91sam9g25ek");
	else if (cpu_board_id == BOARD_ID_SAM9G35_CM)
		strcpy(of_name, "at91sam9g35ek");
	else if (cpu_board_id == BOARD_ID_SAM9X25_CM)
		strcpy(of_name, "at91sam9x25ek");
	else if (cpu_board_id == BOARD_ID_SAM9X35_CM)
		strcpy(of_name, "at91sam9x35ek");
	else
		dbg_info("WARNING: Not correct CPU board ID\n");

	if (disp_board_id == BOARD_ID_PDA_DM)
		strcat(of_name, "_pda");

	strcat(of_name, ".dtb");
}