Ejemplo n.º 1
0
/*
 * The Bluetooth MAC address serves as the board serial number.
 */
void get_board_serial(struct tag_serialnr *serialnr)
{
	u32 offset;
	u8 buf[6];

	if (!board_rev)
		board_rev = get_board_rev();

	/* Board rev 3 has MAC address where rev should be */
	offset = (board_rev == 3) ? EEPROM_REV_OFFSET : EEPROM_MAC_OFFSET;

	if (i2c_read(EEPROM_I2C_ADDR, offset, 2, buf, 6)) {
		printf("\nBoard serial read failed!\n");
	} else {
		u8 *nr;

		nr = (u8 *)&serialnr->low;
		nr[0] = buf[5];
		nr[1] = buf[4];
		nr[2] = buf[3];
		nr[3] = buf[2];
		nr = (u8 *)&serialnr->high;
		nr[0] = buf[1];
		nr[1] = buf[0];
		nr[2] = 0;
		nr[3] = 0;
	}
}
Ejemplo n.º 2
0
int board_init(void)
{
	int val;

#ifndef CONFIG_USE_IRQ
	irq_init();
#endif

	/* address of boot parameters */
	gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;

#ifdef CONFIG_DRIVER_TI_EMAC
	/* select emac MII mode */
	val = readl(&davinci_syscfg_regs->cfgchip3);
	val &= ~(1 << 8);
	writel(val, &davinci_syscfg_regs->cfgchip3);
#endif /* CONFIG_DRIVER_TI_EMAC */

#ifdef CONFIG_HW_WATCHDOG
	davinci_hw_watchdog_enable();
#endif

	printf("Input clock frequency: %d Hz\n", calimain_get_osc_freq());
	printf("Board revision:        %d\n", get_board_rev());

	return 0;
}
Ejemplo n.º 3
0
void set_board_info(void)
{
	char info[64];

	snprintf(info, ARRAY_SIZE(info), "%u.%u", (s5p_cpu_rev & 0xf0) >> 4,
		 s5p_cpu_rev & 0xf);
	setenv("soc_rev", info);

	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
	setenv("soc_id", info);

#ifdef CONFIG_REVISION_TAG
	snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev());
	setenv("board_rev", info);
#endif
#ifdef CONFIG_OF_LIBFDT
	const char *bdtype = "";
	const char *bdname = CONFIG_SYS_BOARD;

#ifdef CONFIG_BOARD_TYPES
	bdtype = get_board_type();
	sprintf(info, "%s%s", bdname, bdtype);
	setenv("boardname", info);
#endif
	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
		 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
	setenv("fdtfile", info);
#endif
}
Ejemplo n.º 4
0
static void display_board_info(void)
{
#ifdef CONFIG_GENERIC_MMC
	struct mmc *mmc = find_mmc_device(0);
#endif
	vidinfo_t *vid = &panel_info;

	lcd_position_cursor(4, 4);

	lcd_printf("%s\n\t", U_BOOT_VERSION);
	lcd_puts("\n\t\tBoard Info:\n");
#ifdef CONFIG_SYS_BOARD
	lcd_printf("\tBoard name: %s\n", CONFIG_SYS_BOARD);
#endif
#ifdef CONFIG_REVISION_TAG
	lcd_printf("\tBoard rev: %u\n", get_board_rev());
#endif
	lcd_printf("\tDRAM banks: %u\n", CONFIG_NR_DRAM_BANKS);
	lcd_printf("\tDRAM size: %u MB\n", gd->ram_size / SZ_1M);

#ifdef CONFIG_GENERIC_MMC
	if (mmc) {
		if (!mmc->capacity)
			mmc_init(mmc);

		lcd_printf("\teMMC size: %llu MB\n", mmc->capacity / SZ_1M);
	}
#endif
	if (vid)
		lcd_printf("\tDisplay resolution: %u x % u\n",
			   vid->vl_col, vid->vl_row);

	lcd_printf("\tDisplay BPP: %u\n", 1 << vid->vl_bpix);
}
Ejemplo n.º 5
0
int board_late_init(void)
{
#if defined(CONFIG_REVISION_TAG) && \
    defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)
	char env_str[256];
	u32 rev;

	rev = get_board_rev();
	snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev);
	env_set("board_rev", env_str);

#ifndef CONFIG_TDX_APALIS_IMX6_V1_0
	if ((rev & 0xfff0) == 0x0100) {
		char *fdt_env;

		/* reconfigure the UART to DCE mode dynamically if on V1.0 HW */
		setup_iomux_dce_uart();

		/* if using the default device tree, use version for V1.0 HW */
		fdt_env = env_get("fdt_file");
		if ((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) {
			env_set("fdt_file", FDT_FILE_V1_0);
			printf("patching fdt_file to " FDT_FILE_V1_0 "\n");
#ifndef CONFIG_ENV_IS_NOWHERE
			env_save();
#endif
		}
	}
#endif /* CONFIG_TDX_APALIS_IMX6_V1_0 */
#endif /* CONFIG_REVISION_TAG */

	return 0;
}
void setup_revision_tag(struct tag **in_params)
{
	u32 rev = 0;
	u32 get_board_rev(void);

	rev = get_board_rev();
	params->hdr.tag = ATAG_REVISION;
	params->hdr.size = tag_size (tag_revision);
	params->u.revision.rev = rev;
	params = tag_next (params);
}
Ejemplo n.º 7
0
int board_late_init(void)
{
	char buf[10];
#ifdef CONFIG_CMD_BMODE
	add_board_boot_modes(board_boot_modes);
#endif

	snprintf(buf, sizeof(buf), "%d", get_board_rev());
	env_set("board_rev", buf);

	return 0;
}
Ejemplo n.º 8
0
/*
 * Routine: misc_init_r
 * Description: display die ID
 */
int misc_init_r(void)
{
	u32 board_rev = get_board_rev();
	u32 rev_major = board_rev / 100;
	u32 rev_minor = board_rev - (rev_major * 100);

	if ((rev_minor / 10) * 10 == rev_minor)
		rev_minor = rev_minor / 10;

	printf("PCB:   %u.%u\n", rev_major, rev_minor);
	dieid_num_r();

	return 0;
}
Ejemplo n.º 9
0
/*
 * determine the oscillator frequency depending on the board revision
 *
 * rev 0x00  ... 25 MHz oscillator
 * rev 0x01  ... 24 MHz oscillator
 */
int calimain_get_osc_freq(void)
{
	u32 rev;
	int freq;

	rev = get_board_rev();
	switch (rev) {
	case 0x00:
		freq = 25000000;
		break;
	default:
		freq = 24000000;
		break;
	}
	return freq;
}
Ejemplo n.º 10
0
void setup_revision_tag(struct tag **in_params)
{
	u32 rev = 0;

#ifdef CONFIG_BOARD_REVISION
	rev = gd->bd->bi_board_revision;
#else
	u32 get_board_rev(void);
	rev = get_board_rev();
#endif

	params->hdr.tag = ATAG_REVISION;
	params->hdr.size = tag_size (tag_revision);
	params->u.revision.rev = rev;
	params = tag_next (params);
}
Ejemplo n.º 11
0
void set_board_info(void)
{
	char info[64];

	snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f,
		 (s5p_cpu_rev & 0xf0) >> 0x04);
	setenv("soc_rev", info);

	snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id);
	setenv("soc_id", info);

#ifdef CONFIG_REVISION_TAG
	snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev());
	setenv("board_rev", info);
#endif
#ifdef CONFIG_OF_LIBFDT
	snprintf(info, ARRAY_SIZE(info),  "%s%x-%s.dtb",
		 CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
	setenv("fdtfile", info);
#endif
}
Ejemplo n.º 12
0
int do_neo1973 ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	int i;

	if (!strcmp(argv[1], "info")) {
		printf("FIC Neo1973 Hardware Revision 0x%04x\n", get_board_rev());
	} else if (!strcmp(argv[1], "power-off")) {
		neo1973_poweroff();
	} else if (!strcmp(argv[1], "charger") || !strcmp(argv[1], "charge")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "status") || !strcmp(argv[2], "state")) {
			printf("%s\n", neo1973_get_charge_status());
		} else if (!strcmp(argv[2], "autofast")) {
			neo1973_set_charge_mode(NEO1973_CHGCMD_AUTOFAST);
		} else if (!strcmp(argv[2], "!autofast")) {
			neo1973_set_charge_mode(NEO1973_CHGCMD_NO_AUTOFAST);
		} else if (!strcmp(argv[2], "off")) {
			neo1973_set_charge_mode(NEO1973_CHGCMD_OFF);
		} else if (!strcmp(argv[2], "fast")) {
			neo1973_set_charge_mode(NEO1973_CHGCMD_FAST);
		} else
			goto out_help;
	} else if (!strcmp(argv[1], "backlight")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "on"))
			neo1973_backlight(1);
		else
			neo1973_backlight(0);
	} else if (!strcmp(argv[1], "led")) {
		long led = simple_strtol(argv[2], NULL, 10);
		if (argc < 4)
			goto out_help;
		if (!strcmp(argv[3], "on"))
			neo1973_led(led, 1);
		else
			neo1973_led(led, 0);
	} else if (!strcmp(argv[1], "vibrator")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "on"))
			neo1973_vibrator(1);
		else
			neo1973_vibrator(0);
	} else if (!strcmp(argv[1], "gsm")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "on"))
			neo1973_gsm(1);
		else if (!strcmp(argv[2], "off"))
			neo1973_gsm(0);
		else if (!strcmp(argv[2], "version"))
			neo1973_gsmver();
	} else if (!strcmp(argv[1], "gps")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "on"))
			neo1973_gps(1);
		else
			neo1973_gps(0);
	} else if (!strcmp(argv[1], "udc")) {
		if (argc < 3)
			goto out_help;
		if (!strcmp(argv[2], "pullup")) {
			if (argc < 4)
				goto out_help;
			if (!strcmp(argv[3], "on"))
				udc_connect();
			else
				udc_disconnect();
		} else
			goto out_help;
	} else {
out_help:
		printf("Usage:\n%s\n", cmdtp->usage);
		return 1;
	}

	return 0;
}