Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af1d09ee authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'davinci-for-v4.11/soc-2' of...

Merge tag 'davinci-for-v4.11/soc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc

Pull "SoC updates needed for SATA support on DA850" from Sekhar Nori:

This includes a merge of non-critical-fixes
branch already queued for v4.11 because
SATA clock addition conflicts with the fix-up
done earlier.

* tag 'davinci-for-v4.11/soc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: remove BUG_ON() from da850_register_sata()
  ARM: davinci: da850: model the SATA refclk
  ARM: davinci: da850: add con_id for the SATA clock
  ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for SATA
  ARM: davinci: add skeleton for pdata-quirks
  bus: da850-mstpri: fix my e-mail address
  ARM: davinci: da850: fix da850_set_pll0rate()
  ARM: davinci: da850: coding style fix
parents c6057e10 a3035886
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC) += irq.o
obj-$(CONFIG_CP_INTC)			+= cp_intc.o

# Board specific
obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o
obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
obj-$(CONFIG_MACH_SFFSDR)		+= board-sffsdr.o
obj-$(CONFIG_MACH_NEUROS_OSD2)		+= board-neuros-osd2.o
+19 −5
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ static struct clk_lookup da850_clks[] = {
	CLK("spi_davinci.0",	NULL,		&spi0_clk),
	CLK("spi_davinci.1",	NULL,		&spi1_clk),
	CLK("vpif",		NULL,		&vpif_clk),
	CLK("ahci_da850",		NULL,		&sata_clk),
	CLK("ahci_da850",	"fck",		&sata_clk),
	CLK("davinci-rproc.0",	NULL,		&dsp_clk),
	CLK(NULL,		NULL,		&ehrpwm_clk),
	CLK("ehrpwm.0",		"fck",		&ehrpwm0_clk),
@@ -1202,14 +1202,28 @@ static int da850_set_armrate(struct clk *clk, unsigned long index)
	return clk_set_rate(pllclk, index);
}

static int da850_set_pll0rate(struct clk *clk, unsigned long index)
static int da850_set_pll0rate(struct clk *clk, unsigned long rate)
{
	unsigned int prediv, mult, postdiv;
	struct da850_opp *opp;
	struct pll_data *pll = clk->pll_data;
	struct cpufreq_frequency_table *freq;
	unsigned int prediv, mult, postdiv;
	struct da850_opp *opp = NULL;
	int ret;

	opp = (struct da850_opp *) cpufreq_info.freq_table[index].driver_data;
	rate /= 1000;

	for (freq = da850_freq_table;
	     freq->frequency != CPUFREQ_TABLE_END; freq++) {
		/* rate is in Hz, freq->frequency is in KHz */
		if (freq->frequency == rate) {
			opp = (struct da850_opp *)freq->driver_data;
			break;
		}
	}

	if (!opp)
		return -EINVAL;

	prediv = opp->prediv;
	mult = opp->mult;
	postdiv = opp->postdiv;
+10 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
	OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci-da8xx", NULL),
	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
	OF_DEV_AUXDATA("ti,da830-usb-phy", 0x01c1417c, "da8xx-usb-phy", NULL),
	OF_DEV_AUXDATA("ti,da850-ahci", 0x01e18000, "ahci_da850", NULL),
	{}
};

@@ -49,6 +50,9 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {

static void __init da850_init_machine(void)
{
	/* All existing boards use 100MHz SATA refclkpn */
	static const unsigned long sata_refclkpn = 100 * 1000 * 1000;

	int ret;

	ret = da8xx_register_usb20_phy_clk(false);
@@ -60,8 +64,14 @@ static void __init da850_init_machine(void)
		pr_warn("%s: registering USB 1.1 PHY clock failed: %d",
			__func__, ret);

	ret = da850_register_sata_refclk(sata_refclkpn);
	if (ret)
		pr_warn("%s: registering SATA REFCLK failed: %d",
			__func__, ret);

	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
	davinci_pm_init();
	pdata_quirks_init();
}

static const char *const da850_boards_compat[] __initconst = {
+28 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <mach/common.h>
#include <mach/time.h>
#include <mach/da8xx.h>
#include <mach/clock.h>
#include "cpuidle.h"
#include "sram.h"

@@ -1023,6 +1024,28 @@ int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
}

#ifdef CONFIG_ARCH_DAVINCI_DA850
static struct clk sata_refclk = {
	.name		= "sata_refclk",
	.set_rate	= davinci_simple_set_rate,
};

static struct clk_lookup sata_refclk_lookup =
		CLK("ahci_da850", "refclk", &sata_refclk);

int __init da850_register_sata_refclk(int rate)
{
	int ret;

	sata_refclk.rate = rate;
	ret = clk_register(&sata_refclk);
	if (ret)
		return ret;

	clkdev_add(&sata_refclk_lookup);

	return 0;
}

static struct resource da850_sata_resources[] = {
	{
		.start	= DA850_SATA_BASE,
@@ -1055,8 +1078,11 @@ static struct platform_device da850_sata_device = {

int __init da850_register_sata(unsigned long refclkpn)
{
	/* please see comment in drivers/ata/ahci_da850.c */
	BUG_ON(refclkpn != 100 * 1000 * 1000);
	int ret;

	ret = da850_register_sata_refclk(refclkpn);
	if (ret)
		return ret;

	return platform_device_register(&da850_sata_device);
}
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ int davinci_pm_init(void);
static inline int davinci_pm_init(void) { return 0; }
#endif

void __init pdata_quirks_init(void);

#define SRAM_SIZE	SZ_128K

#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
Loading