Ejemplo n.º 1
0
static int __init fli7510_suspend_setup(void)
{

	struct sysconf_field *sc[2];
	int i;

	sc[0] = sysconf_claim(CKG_DDR_CTL_PLL_DDR_FREQ, 0, 0, "PM");
	sc[1] = sysconf_claim(CKG_DDR_STATUS_PLL_DDR, 0, 0, "PM");

	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (!sc[i])
			goto error;

	cga = ioremap(CGA, 0x1000);

	ca_ic_100_clk = clk_get(NULL, "comms_clk");
	ca_pll_clk = ca_ic_100_clk->parent;
	ca_ref_clk = ca_pll_clk->parent;

	return stm_suspend_register(&fli7510_suspend);

error:

	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (sc[i])
			sysconf_release(sc[i]);

	pr_err("[STM][PM] Error on Standby initialization\n");
	return 0;
}
static int __init stxh205_suspend_setup(void)
{
	struct sysconf_field *sc[2];
	int i;

	sc[0] = sysconf_claim(SYSCONF(169), 2, 2, "PM");
	/* ClockGen_D.Pll lock status */
	sc[1] = sysconf_claim(SYSCONF(154), 2, 2, "PM");


	for (i = 0; i < ARRAY_SIZE(sc); ++i)
		if (!sc[i])
			goto error;

	a0_ic_lp_on_clk = clk_get(NULL, "CLK_A0_IC_REG_LP_ON");
	a0_ref_clk = clk_get(NULL, "CLK_A0_REF");

	a1_pll0_hs_clk = clk_get(NULL, "CLK_A1_PLL0HS");
	a1_ddr_clk = clk_get(NULL, "CLK_A1_IC_DDRCTRL");
	a1_pll1_ls_clk = clk_get(NULL, "CLK_A1_PLL1LS");
	a1_eth_phy_clk = clk_get(NULL, "CLK_A1_ETH_PHY");

	if (a0_ref_clk == ERR_PTR(-ENOENT) ||
	    a0_ic_lp_on_clk == ERR_PTR(-ENOENT) ||
	    a1_pll0_hs_clk == ERR_PTR(-ENOENT) ||
	    a1_pll0_hs_clk == ERR_PTR(-ENOENT) ||
	    a1_pll1_ls_clk == ERR_PTR(-ENOENT) ||
	    a1_eth_phy_clk == ERR_PTR(-ENOENT))
		goto error;

	cga0 = ioremap_nocache(0xfde98000, 0x1000);
	cga1 = ioremap_nocache(0xfdab8000, 0x1000);

	return stm_suspend_register(&stxh205_suspend);

error:
	pr_err("[STM][PM] Error to acquire the sysconf registers\n");
	for (i = 0; i < ARRAY_SIZE(sc); ++i)
		if (sc[i])
			sysconf_release(sc[i]);

	return -EBUSY;
}
static int __init fli7610_suspend_setup(void)
{
	int i;

	INIT_LIST_HEAD(&fli7610_suspend.mem_tables);

	main_mcm = stx_mpe41_suspend_setup();
	peripheral_mcm = stx_tae_suspend_setup();

	if (!main_mcm || !peripheral_mcm) {
		pr_err("stm: Error on mcm registration\n");
		return -ENOSYS;
	}

	for (i = 0; i < ARRAY_SIZE(fli7610_suspend_tables); ++i)
		list_add_tail(&fli7610_suspend_tables[i].node,
			&fli7610_suspend.mem_tables);

	return stm_suspend_register(&fli7610_suspend);
}
Ejemplo n.º 4
0
static int __init stx5206_suspend_setup(void)
{
	int i;
	struct sysconf_field *sc[7];

	sc[0] = sysconf_claim(SYS_CFG, 4, 2, 2, "LMI - PM");
	sc[1] = sysconf_claim(SYS_CFG, 11, 12, 12, "LMI - PM");
	sc[2] = sysconf_claim(SYS_CFG, 11, 27, 27, "LMI - PM");
	sc[3] = sysconf_claim(SYS_CFG, 12, 10, 10, "LMI - PM");
	sc[4] = sysconf_claim(SYS_CFG, 38, 20, 20, "LMI - PM");

	sc[5] = sysconf_claim(SYS_STA, 3, 0, 0, "LMI - PM");
	sc[6] = sysconf_claim(SYS_STA, 4, 0, 0, "LMI - PM");

	for (i = 0; i < ARRAY_SIZE(sc); ++i)
		if (!sc[i])
			goto error;

	cga = ioremap(CGA, 0x1000);
	lmi = ioremap(LMI_BASE, 0x1000);

	ca_ref_clk = clk_get(NULL, "CLKA_REF");
	ca_pll1_clk = clk_get(NULL, "CLKA_PLL1");
	ca_ic_if_100_clk = clk_get(NULL, "CLKA_IC_IF_100");
	ca_eth_phy_clk = clk_get(NULL, "CLKA_ETH_PHY");

	if (!ca_ref_clk || !ca_pll1_clk ||
	    !ca_ic_if_100_clk || !ca_eth_phy_clk)
		goto error;

	return stm_suspend_register(&stx5206_suspend);
error:
	pr_err("[STM][PM] Error to acquire the sysconf registers\n");
	for (i = 0; i > ARRAY_SIZE(sc); ++i)
		if (sc[i])
			sysconf_release(sc[i]);

	return -1;
}
Ejemplo n.º 5
0
static int __init stx7111_suspend_setup(void)
{
	struct sysconf_field *sc[7];
	int i;

	sc[0] = sysconf_claim(SYS_STA, 4, 0, 0, "PM");
	sc[1] = sysconf_claim(SYS_STA, 3, 0, 0, "PM");
	sc[2] = sysconf_claim(SYS_CFG, 4, 2, 2, "PM");
	sc[3] = sysconf_claim(SYS_CFG, 11, 12, 12, "PM");
	sc[4] = sysconf_claim(SYS_CFG, 11, 27, 27, "PM");
	sc[5] = sysconf_claim(SYS_CFG, 12, 10, 10, "PM");
	sc[6] = sysconf_claim(SYS_CFG, 38, 20, 20, "PM");

	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (!sc[i])
			goto error;

	cga = ioremap(CGA, 0x1000);

	ca_ref_clk = clk_get(NULL, "CLKA_REF");
	ca_pll1_clk = clk_get(NULL, "CLKA_PLL1");
	ca_ic_if_100_clk = clk_get(NULL, "CLKA_IC_IF_100");
	ca_eth_phy_clk = clk_get(NULL, "CLKA_ETH_PHY");

	if (!ca_ref_clk || !ca_pll1_clk ||
	    !ca_ic_if_100_clk || !ca_eth_phy_clk)
		goto error;

	return stm_suspend_register(&stx7111_suspend);

error:
	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (sc[i])
			sysconf_release(sc[i]);
	pr_err("[STM][PM] Error on Standby initialization\n");

	return 0;
}
static int __init stig125_suspend_setup(void)
{
	int i;

	clks_base[0] = ioremap_nocache(0xFEE48000, 0x1000);

	if (!clks_base[0])
		goto err_0;
	clks_base[1] = ioremap_nocache(CLK_A1_BASE, 0x1000);
	if (!clks_base[1])
		goto err_1;

	INIT_LIST_HEAD(&stig125_suspend.mem_tables);

	 for (i = 0; i < ARRAY_SIZE(stig125_suspend_tables); ++i)
		list_add_tail(&stig125_suspend_tables[i].node,
			&stig125_suspend.mem_tables);

	return stm_suspend_register(&stig125_suspend);
err_1:
	iounmap(clks_base[0]);
err_0:
	return -EINVAL;
}
Ejemplo n.º 7
0
static int __init stx7105_suspend_setup(void)
{

	struct sysconf_field *sc[7];
	int i;

	sc[0] = sysconf_claim(SYS_STA, 4, 0, 0, "pm");
	sc[1] = sysconf_claim(SYS_STA, 3, 0, 0, "pm");
	sc[2] = sysconf_claim(SYS_CFG, 4, 2, 2, "pm");
	sc[3] = sysconf_claim(SYS_CFG, 11, 12, 12, "pm");
	sc[4] = sysconf_claim(SYS_CFG, 11, 27, 27, "pm");
	sc[5] = sysconf_claim(SYS_CFG, 12, 10, 10, "pm");
	sc[6] = sysconf_claim(SYS_CFG, 38, 20, 20, "pm");

	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (!sc[i])
			goto error;

	cga = ioremap(CGA, 0x1000);
	lmi = ioremap(LMI_BASE, 0x1000);

	ca_ref_clk = clk_get(NULL, "CLKA_REF");
	ca_pll1_clk = clk_get(NULL, "CLKA_PLL1");
	ca_ic_if_100_clk = clk_get(NULL, "CLKA_IC_IF_100");

	if (!ca_ref_clk || !ca_pll1_clk || !ca_ic_if_100_clk)
		goto error;

	return stm_suspend_register(&stx7105_suspend);

error:
	for (i = ARRAY_SIZE(sc)-1; i; --i)
		if (sc[i])
			sysconf_release(sc[i]);
	return 0;
}