Ejemplo n.º 1
0
static void setup_board_eeprom_env(void)
{
	char *name = "beagle_x15";
	int rc;

	rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
				  CONFIG_EEPROM_CHIP_ADDRESS);
	if (rc)
		goto invalid_eeprom;

	if (board_is_x15()) {
		if (board_is_x15_revb1())
			name = "beagle_x15_revb1";
		else
			name = "beagle_x15";
	} else if (board_is_am572x_evm()) {
		if (board_is_am572x_evm_reva3())
			name = "am57xx_evm_reva3";
		else
			name = "am57xx_evm";
	} else if (board_is_am572x_idk()) {
		name = "am572x_idk";
	} else if (board_is_am571x_idk()) {
		name = "am571x_idk";
	} else {
		printf("Unidentified board claims %s in eeprom header\n",
		       board_ti_get_name());
	}

invalid_eeprom:
	set_board_info_env(name);
}
Ejemplo n.º 2
0
/* Override function to read eeprom information: actual i2c read done by SPL*/
void do_board_detect(void)
{
	char *bname = NULL;
	int rc;

	rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
				  CONFIG_EEPROM_CHIP_ADDRESS);
	if (rc)
		printf("ti_i2c_eeprom_init failed %d\n", rc);

	if (board_is_x15())
		bname = "BeagleBoard X15";
	else if (board_is_am572x_evm())
		bname = "AM572x EVM";
	else if (board_is_am574x_idk())
		bname = "AM574x IDK";
	else if (board_is_am572x_idk())
		bname = "AM572x IDK";
	else if (board_is_am571x_idk())
		bname = "AM571x IDK";

	if (bname)
		snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN,
			 "Board: %s REV %s\n", bname, board_ti_get_rev());
}
Ejemplo n.º 3
0
int board_fit_config_name_match(const char *name)
{
	if (board_is_x15()) {
		if (board_is_x15_revb1()) {
			if (!strcmp(name, "am57xx-beagle-x15-revb1"))
				return 0;
		} else if (board_is_x15_revc()) {
			if (!strcmp(name, "am57xx-beagle-x15-revc"))
				return 0;
		} else if (!strcmp(name, "am57xx-beagle-x15")) {
			return 0;
		}
	} else if (board_is_am572x_evm() &&
		   !strcmp(name, "am57xx-beagle-x15")) {
		return 0;
	} else if (board_is_am572x_idk() && !strcmp(name, "am572x-idk")) {
		return 0;
	} else if (board_is_am574x_idk() && !strcmp(name, "am574x-idk")) {
		return 0;
	} else if (board_is_am571x_idk() && !strcmp(name, "am571x-idk")) {
		return 0;
	}

	return -1;
}
Ejemplo n.º 4
0
void am57x_idk_lcd_detect(void)
{
	int r = -ENODEV;
	char *idk_lcd = "no";
	uint8_t buf = 0;

	/* Only valid for IDKs */
	if (board_is_x15() || board_is_am572x_evm())
		return;

	/* Only AM571x IDK has gpio control detect.. so check that */
	if (board_is_am571x_idk() && !am571x_idk_needs_lcd())
		goto out;

	r = i2c_set_bus_num(OSD_TS_FT_BUS_ADDRESS);
	if (r) {
		printf("%s: Failed to set bus address to %d: %d\n",
		       __func__, OSD_TS_FT_BUS_ADDRESS, r);
		goto out;
	}
	r = i2c_probe(OSD_TS_FT_CHIP_ADDRESS);
	if (r) {
		/* AM572x IDK has no explicit settings for optional LCD kit */
		if (board_is_am571x_idk()) {
			printf("%s: Touch screen detect failed: %d!\n",
			       __func__, r);
		}
		goto out;
	}

	/* Read FT ID */
	r = i2c_read(OSD_TS_FT_CHIP_ADDRESS, OSD_TS_FT_REG_ID, 1, &buf, 1);
	if (r) {
		printf("%s: Touch screen ID read %d:0x%02x[0x%02x] failed:%d\n",
		       __func__, OSD_TS_FT_BUS_ADDRESS, OSD_TS_FT_CHIP_ADDRESS,
		       OSD_TS_FT_REG_ID, r);
		goto out;
	}

	switch (buf) {
	case OSD_TS_FT_ID_5606:
		idk_lcd = "osd101t2045";
		break;
	case OSD_TS_FT_ID_5x46:
		idk_lcd = "osd101t2587";
		break;
	default:
		printf("%s: Unidentifed Touch screen ID 0x%02x\n",
		       __func__, buf);
		/* we will let default be "no lcd" */
	}
out:
	setenv("idk_lcd", idk_lcd);
	return;
}
Ejemplo n.º 5
0
int board_fit_config_name_match(const char *name)
{
	if (board_is_x15() && !strcmp(name, "am57xx-beagle-x15"))
		return 0;
	else if (board_is_am572x_evm() && !strcmp(name, "am57xx-beagle-x15"))
		return 0;
	else if (board_is_am572x_idk() && !strcmp(name, "am572x-idk"))
		return 0;
	else if (board_is_am571x_idk() && !strcmp(name, "am571x-idk"))
		return 0;
	else
		return -1;
}
Ejemplo n.º 6
0
void recalibrate_iodelay(void)
{
	const struct pad_conf_entry *pconf;
	const struct iodelay_cfg_entry *iod;
	int pconf_sz, iod_sz;
	int ret;

	if (board_is_am572x_idk()) {
		pconf = core_padconf_array_essential_am572x_idk;
		pconf_sz = ARRAY_SIZE(core_padconf_array_essential_am572x_idk);
		iod = iodelay_cfg_array_am572x_idk;
		iod_sz = ARRAY_SIZE(iodelay_cfg_array_am572x_idk);
	} else if (board_is_am571x_idk()) {
		pconf = core_padconf_array_essential_am571x_idk;
		pconf_sz = ARRAY_SIZE(core_padconf_array_essential_am571x_idk);
		iod = iodelay_cfg_array_am571x_idk;
		iod_sz = ARRAY_SIZE(iodelay_cfg_array_am571x_idk);
	} else {
		/* Common for X15/GPEVM */
		pconf = core_padconf_array_essential_x15;
		pconf_sz = ARRAY_SIZE(core_padconf_array_essential_x15);
		/* There never was an SR1.0 X15.. So.. */
		if (omap_revision() == DRA752_ES1_1) {
			iod = iodelay_cfg_array_x15_sr1_1;
			iod_sz = ARRAY_SIZE(iodelay_cfg_array_x15_sr1_1);
		} else {
			/* Since full production should switch to SR2.0  */
			iod = iodelay_cfg_array_x15_sr2_0;
			iod_sz = ARRAY_SIZE(iodelay_cfg_array_x15_sr2_0);
		}
	}

	/* Setup I/O isolation */
	ret = __recalibrate_iodelay_start();
	if (ret)
		goto err;

	/* Do the muxing here */
	do_set_mux32((*ctrl)->control_padconf_core_base, pconf, pconf_sz);

	/* Now do the weird minor deltas that should be safe */
	if (board_is_x15() || board_is_am572x_evm()) {
		if (board_is_x15_revb1() || board_is_am572x_evm_reva3()) {
			pconf = core_padconf_array_delta_x15_sr2_0;
			pconf_sz = ARRAY_SIZE(core_padconf_array_delta_x15_sr2_0);
		} else {
			pconf = core_padconf_array_delta_x15_sr1_1;
			pconf_sz = ARRAY_SIZE(core_padconf_array_delta_x15_sr1_1);
		}
		do_set_mux32((*ctrl)->control_padconf_core_base, pconf, pconf_sz);
	}

	if (board_is_am571x_idk()) {
		if (am571x_idk_needs_lcd()) {
			pconf = core_padconf_array_vout_am571x_idk;
			pconf_sz = ARRAY_SIZE(core_padconf_array_vout_am571x_idk);
		} else {
			pconf = core_padconf_array_icss1eth_am571x_idk;
			pconf_sz = ARRAY_SIZE(core_padconf_array_icss1eth_am571x_idk);
		}
		do_set_mux32((*ctrl)->control_padconf_core_base, pconf, pconf_sz);
	}

	/* Setup IOdelay configuration */
	ret = do_set_iodelay((*ctrl)->iodelay_config_base, iod, iod_sz);
err:
	/* Closeup.. remove isolation */
	__recalibrate_iodelay_end(ret);
}