コード例 #1
0
ファイル: board.c プロジェクト: RowanLiu/ported_uboot
static void print_chip_data(void)
{
    struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
    dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
    printf("\nCPU BOARD\n");
    printf("device: \t'%s'\n", settings.chip.sdevname);
    printf("hw version: \t'%s'\n", settings.chip.shwver);
    printf("max freq: \t%d MHz\n", dpll_mpu_opp100.m);
}
コード例 #2
0
ファイル: spl.c プロジェクト: Bing0/u-boot
void am33xx_spl_board_init(void)
{
	struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;

	/* Get the frequency */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);

	/* Set CORE Frequencies to OPP100 */
	do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

	/* Set MPU Frequency to what we detected now that voltages are set */
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
}
コード例 #3
0
ファイル: board.c プロジェクト: CheezeCake/edison-u-boot
void am33xx_spl_board_init(void)
{
	/*
	 * The pengwyn board uses the TPS650250 PMIC  without I2C
	 * interface and will output the following fixed voltages:
	 * DCDC1=3V3 (IO) DCDC2=1V5 (DDR) DCDC3=1V26 (Vmpu)
	 * VLDO1=1V8 (IO) VLDO2=1V8(IO)
	 * Vcore=1V1 is fixed, generated by TPS62231
	 */

	/* Get the frequency */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);

	/* Set CORE Frequencies to OPP100 */
	do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

	/* 720MHz cpu, this might change on newer board revisions */
	dpll_mpu_opp100.m = MPUPLL_M_720;
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
}
コード例 #4
0
ファイル: board.c プロジェクト: sysplay/bbb
void am33xx_spl_board_init(void)
{
	int mpu_vdd;

	/* Get the frequency */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);

	/* BeagleBone PMIC Code */
	int usb_cur_lim;


	if (i2c_probe(TPS65217_CHIP_PM))
		return;
	/*
	 * Override what we have detected since we know if we have
	 * a Beaglebone Black it supports 1GHz.
	 */
	dpll_mpu_opp100.m = MPUPLL_M_1000;

	/*
	 * Increase USB current limit to 1300mA or 1800mA and set
	 * the MPU voltage controller as needed.
	 */
	usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
	mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV;

	if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
				TPS65217_POWER_PATH,
				usb_cur_lim,
				TPS65217_USB_INPUT_CUR_LIMIT_MASK))
		puts("tps65217_reg_write failure\n");

	/* Set DCDC3 (CORE) voltage to 1.125V */
	if (tps65217_voltage_update(TPS65217_DEFDCDC3,
				TPS65217_DCDC_VOLT_SEL_1125MV)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}

	/* Set CORE Frequencies to OPP100 */
	do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

	/* Set DCDC2 (MPU) voltage */
	if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}

	/*
	 * Set LDO3 to 1.8V and LDO4 to 3.3V for Beaglebone Black.
	 */
	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
				TPS65217_DEFLS1,
				TPS65217_LDO_VOLTAGE_OUT_1_8,
				TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");

	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
				TPS65217_DEFLS2,
				TPS65217_LDO_VOLTAGE_OUT_3_3,
				TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");
	/* Set MPU Frequency to what we detected now that voltages are set */
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
}
コード例 #5
0
ファイル: common.c プロジェクト: RobertCNelson/u-boot-boards
void pmicsetup(u32 mpupll)
{
	int mpu_vdd;
	int usb_cur_lim;

	if (i2c_probe(TPS65217_CHIP_PM)) {
		puts("PMIC (0x24) not found! skip further initalization.\n");
		return;
	}

	/* Get the frequency which is defined by device fuses */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
	printf("detected max. frequency: %d - ", dpll_mpu_opp100.m);

	if (0 != mpupll) {
		dpll_mpu_opp100.m = MPUPLL_M_1000;
		printf("retuning MPU-PLL to: %d MHz.\n", dpll_mpu_opp100.m);
	} else {
		puts("ok.\n");
	}
	/*
	 * Increase USB current limit to 1300mA or 1800mA and set
	 * the MPU voltage controller as needed.
	 */
	if (dpll_mpu_opp100.m == MPUPLL_M_1000) {
		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV;
	} else {
		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA;
		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1275MV;
	}

	if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, TPS65217_POWER_PATH,
			       usb_cur_lim, TPS65217_USB_INPUT_CUR_LIMIT_MASK))
		puts("tps65217_reg_write failure\n");

	/* Set DCDC3 (CORE) voltage to 1.125V */
	if (tps65217_voltage_update(TPS65217_DEFDCDC3,
				    TPS65217_DCDC_VOLT_SEL_1125MV)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}

	/* Set CORE Frequencies to OPP100 */
	do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

	/* Set DCDC2 (MPU) voltage */
	if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}

	/* Set LDO3 to 1.8V */
	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
			       TPS65217_DEFLS1,
			       TPS65217_LDO_VOLTAGE_OUT_1_8,
			       TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");
	/* Set LDO4 to 3.3V */
	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
			       TPS65217_DEFLS2,
			       TPS65217_LDO_VOLTAGE_OUT_3_3,
			       TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");

	/* Set MPU Frequency to what we detected now that voltages are set */
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
	/* Set PWR_EN bit in Status Register */
	tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
			   TPS65217_STATUS, TPS65217_PWR_OFF, TPS65217_PWR_OFF);
}
コード例 #6
0
void am33xx_spl_board_init(void)
{
	struct am335x_baseboard_id header;
	int mpu_vdd;

	if (read_eeprom(&header) < 0)
	{
		puts("Wrong data in EEPROM.\n");
		hang();
	}

	if (!board_is_kalitap(&header) &&
            !board_is_luna(&header)    &&
            !board_is_catchwire(&header))
	{
		puts("Could not get board ID (CatchWire/KaliTAP).\n");
		hang();
 	}

	/* Get the frequency */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);

	/* BeagleBone and NEWT PMIC Code */
	int usb_cur_lim;

	if (i2c_probe(TPS65217_CHIP_PM))
		return;

	/*
	 * Override what we have detected since we know we have
	 * a CatchWire/KaliTAP that supports 1GHz.
	 */

         dpll_mpu_opp100.m = MPUPLL_M_1000;

	/*
	 * Increase USB current limit to 1300mA or 1800mA and set
	 * the MPU voltage controller as needed.
	 */
	if (dpll_mpu_opp100.m == MPUPLL_M_1000) {
		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV;
		puts("tps65217_reg_write USB_INPUT_CUR_LIMIT_1800MA\n");
	} else {
		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA;
		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1275MV;
		puts("tps65217_reg_write USB_INPUT_CUR_LIMIT_1300MA\n");
	}

	if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
			       TPS65217_POWER_PATH,
			       usb_cur_lim,
			       TPS65217_USB_INPUT_CUR_LIMIT_MASK))
	{ 
		puts("tps65217_reg_write POWER_PATH failure\n");
	}
	else
	{
		uchar pmic_power_path_reg = 0;
		puts("tps65217_reg_write POWER_PATH success\n");
                       tps65217_reg_read(TPS65217_POWER_PATH,
				  &pmic_power_path_reg);
		printf("POWER_PATH : 0%02X\n", pmic_power_path_reg); 
	}

	/* Set DCDC3 (CORE) voltage to 1.125V */
	if (tps65217_voltage_update(TPS65217_DEFDCDC3,
				    TPS65217_DCDC_VOLT_SEL_1125MV)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}

	/* Set CORE Frequencies to OPP100 */
	do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

	/* Set DCDC2 (MPU) voltage */
	if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
		puts("tps65217_voltage_update failure\n");
		return;
	}
	else
	{
		puts("tps65217_voltage_update success\n");
	}

	/*
	 * Set LDO3 to 1.8V and LDO4 to 3.3V for CatchWire/KaliTAP.
	 */
	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
			       TPS65217_DEFLS1,
			       TPS65217_LDO_VOLTAGE_OUT_1_8,
			       TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");

	if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
			       TPS65217_DEFLS2,
			       TPS65217_LDO_VOLTAGE_OUT_3_3,
			       TPS65217_LDO_MASK))
		puts("tps65217_reg_write failure\n");

	/* Set MPU Frequency to what we detected now that voltages are set */
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
}
コード例 #7
0
void am33xx_spl_board_init(void)
{

	struct am335x_baseboard_id header;
	int mpu_vdd;
	 puts("am33xx_spl_board_init \n");
	if (read_eeprom(&header) < 0)
		puts("Could not get board ID.\n");

	/* Get the frequency */
	dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);

	if (board_is_bone(&header) || board_is_bone_lt(&header)) {
		/* BeagleBone PMIC Code */
		int usb_cur_lim;

		/*
		 * Only perform PMIC configurations if board rev > A1
		 * on Beaglebone White
		 */
		//if (board_is_bone(&header) && !strncmp(header.version,
		//				       "00A1", 4))
		//	return;

		//if (i2c_probe(TPS65217_CHIP_PM))
		//	return;

		/*
		 * On Beaglebone White we need to ensure we have AC power
		 * before increasing the frequency.
		 */
/*		if (board_is_bone(&header)) {
			uchar pmic_status_reg;
			if (tps65217_reg_read(TPS65217_STATUS,
					      &pmic_status_reg))
				return;
			if (!(pmic_status_reg & TPS65217_PWR_SRC_AC_BITMASK)) {
				puts("No AC power, disabling frequency switch\n");
				return;
			}
		}*/

		/*
		 * Override what we have detected since we know if we have
		 * a Beaglebone Black it supports 1GHz.
		 */
//		if (board_is_bone_lt(&header))
			dpll_mpu_opp100.m = MPUPLL_M_1000;

		/*
		 * Increase USB current limit to 1300mA or 1800mA and set
		 * the MPU voltage controller as needed.
		 */
	//	if (dpll_mpu_opp100.m == MPUPLL_M_1000) {
	//		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
	//		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV;
	//	} else {
	//		usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA;
	//		mpu_vdd = TPS65217_DCDC_VOLT_SEL_1275MV;
	//	}

//		if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
//				       TPS65217_POWER_PATH,
//				       usb_cur_lim,
//				       TPS65217_USB_INPUT_CUR_LIMIT_MASK))
//			puts("tps65217_reg_write failure\n");

		/* Set DCDC3 (CORE) voltage to 1.125V */
//		if (tps65217_voltage_update(TPS65217_DEFDCDC3,
//					    TPS65217_DCDC_VOLT_SEL_1125MV)) {
//			puts("tps65217_voltage_update failure\n");
//			return;
//		}

		/* Set CORE Frequencies to OPP100 */
		do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);

		/* Set DCDC2 (MPU) voltage */
//		if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
//			puts("tps65217_voltage_update failure\n");
//			return;
//		}

		/*
		 * Set LDO3, LDO4 output voltage to 3.3V for Beaglebone.
		 * Set LDO3 to 1.8V and LDO4 to 3.3V for Beaglebone Black.
		 */
//		if (board_is_bone(&header)) {
//			if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
//					       TPS65217_DEFLS1,
//					       TPS65217_LDO_VOLTAGE_OUT_3_3,
//					       TPS65217_LDO_MASK))
//				puts("tps65217_reg_write failure\n");
//		} else {
///			if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
//					       TPS65217_DEFLS1,
//					       TPS65217_LDO_VOLTAGE_OUT_1_8,
//					       TPS65217_LDO_MASK))
//				puts("tps65217_reg_write failure\n");
//		}
//
///		if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
//				       TPS65217_DEFLS2,
//				       TPS65217_LDO_VOLTAGE_OUT_3_3,
//				       TPS65217_LDO_MASK))
//			puts("tps65217_reg_write failure\n");
	} else {
		int sil_rev;

		/*
		 * The GP EVM, IDK and EVM SK use a TPS65910 PMIC.  For all
		 * MPU frequencies we support we use a CORE voltage of
		 * 1.1375V.  For MPU voltage we need to switch based on
		 * the frequency we are running at.
		 */
	//	if (i2c_probe(TPS65910_CTRL_I2C_ADDR))
	//		return;

		/*
		 * Depending on MPU clock and PG we will need a different
		 * VDD to drive at that speed.
		 */
	//	sil_rev = readl(&cdev->deviceid) >> 28;
	//	mpu_vdd = am335x_get_tps65910_mpu_vdd(sil_rev,
//						      dpll_mpu_opp100.m);
//
		/* Tell the TPS65910 to use i2c */
	//	tps65910_set_i2c_control();

		/* First update MPU voltage. */
	//	if (tps65910_voltage_update(MPU, mpu_vdd))
//			return;

		/* Second, update the CORE voltage. */
	//	if (tps65910_voltage_update(CORE, TPS65910_OP_REG_SEL_1_1_3))
//			return;

		/* Set CORE Frequencies to OPP100 */
//		do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);
	}

	/* Set MPU Frequency to what we detected now that voltages are set */
	do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
puts("spl_board_init end \n");
}