Skip to content

Commit

Permalink
Merge tag 'davinci-for-v3.10/board-2-v2' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/nsekhar/linux-davinci into next/boards

From Sekhar Nori:
v3.10 board updates for DaVinci

This set of patches enables remoteproc support
on DA850 EVM and fixes some sparse warnings for
the same board.

* tag 'davinci-for-v3.10/board-2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: da850 evm: fix const qualifier placement
  ARM: davinci: da850 board: add remoteproc support
  ARM: davinci: ensure global variables are declared
  ARM: davinci: sram.c: fix incorrect type in assignment
  ARM: davinci: da8xx dt: make file local symbols static
  ARM: davinci: da8xx: add remoteproc support
  ARM: davinci: remove test for undefined Kconfig macro
  ARM: davinci: mmc: derive version information from device name
  ARM: davinci: da850: add ECAP & EHRPWM clock nodes
  ARM: davinci: clk framework support for enable/disable functionality
  • Loading branch information
Olof Johansson committed Apr 18, 2013
2 parents 392f919 + 58b6c5a commit 1556f4b
Show file tree
Hide file tree
Showing 28 changed files with 215 additions and 45 deletions.
6 changes: 6 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ parameter is applicable:
AVR32 AVR32 architecture is enabled.
AX25 Appropriate AX.25 support is enabled.
BLACKFIN Blackfin architecture is enabled.
CMA Contiguous Memory Area support is enabled.
DRM Direct Rendering Management support is enabled.
DYNAMIC_DEBUG Build in debug messages and enable them at runtime
EDD BIOS Enhanced Disk Drive Services (EDD) is enabled
Expand Down Expand Up @@ -2663,6 +2664,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Useful for devices that are detected asynchronously
(e.g. USB and MMC devices).

rproc_mem=nn[KMG][@address]
[KNL,ARM,CMA] Remoteproc physical memory block.
Memory area to be used by remote processor image,
managed by CMA.

rw [KNL] Mount root device read-write on boot

S [KNL] Run init in single mode
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-da830-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ static struct davinci_mmc_config da830_evm_mmc_config = {
.wires = 8,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_2,
};

static inline void da830_evm_init_mmc(void)
Expand Down
12 changes: 8 additions & 4 deletions arch/arm/mach-davinci/board-da850-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ enum da850_evm_ui_exp_pins {
DA850_EVM_UI_EXP_PB1,
};

static const char const *da850_evm_ui_exp[] = {
static const char * const da850_evm_ui_exp[] = {
[DA850_EVM_UI_EXP_SEL_C] = "sel_c",
[DA850_EVM_UI_EXP_SEL_B] = "sel_b",
[DA850_EVM_UI_EXP_SEL_A] = "sel_a",
Expand Down Expand Up @@ -560,7 +560,7 @@ enum da850_evm_bb_exp_pins {
DA850_EVM_BB_EXP_USER_SW8
};

static const char const *da850_evm_bb_exp[] = {
static const char * const da850_evm_bb_exp[] = {
[DA850_EVM_BB_EXP_DEEP_SLEEP_EN] = "deep_sleep_en",
[DA850_EVM_BB_EXP_SW_RST] = "sw_rst",
[DA850_EVM_BB_EXP_TP_23] = "tp_23",
Expand Down Expand Up @@ -797,7 +797,6 @@ static struct davinci_mmc_config da850_mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_2,
};

static const short da850_evm_mmcsd0_pins[] __initconst = {
Expand Down Expand Up @@ -1367,7 +1366,6 @@ static struct davinci_mmc_config da850_wl12xx_mmc_config = {
.max_freq = 25000000,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
MMC_CAP_POWER_OFF_CARD,
.version = MMC_CTLR_VERSION_2,
};

static const short da850_wl12xx_pins[] __initconst = {
Expand Down Expand Up @@ -1574,6 +1572,11 @@ static __init void da850_evm_init(void)
pr_warn("%s: SATA registration failed: %d\n", __func__, ret);

da850_evm_setup_mac_addr();

ret = da8xx_register_rproc();
if (ret)
pr_warn("%s: dsp/rproc registration failed: %d\n",
__func__, ret);
}

#ifdef CONFIG_SERIAL_8250_CONSOLE
Expand Down Expand Up @@ -1601,4 +1604,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M,
.restart = da8xx_restart,
.reserve = da8xx_rproc_reserve_cma,
MACHINE_END
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-dm355-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ static struct davinci_mmc_config dm355evm_mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_1,
};

/* Don't connect anything to J10 unless you're only using USB host
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-dm365-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ static struct davinci_mmc_config dm365evm_mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_2,
};

static void dm365evm_emac_configure(void)
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ static struct davinci_mmc_config dm6446evm_mmc_config = {
.get_cd = dm6444evm_mmc_get_cd,
.get_ro = dm6444evm_mmc_get_ro,
.wires = 4,
.version = MMC_CTLR_VERSION_1
};

static struct i2c_board_info __initdata i2c_info[] = {
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-neuros-osd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ static void __init davinci_ntosd2_map_io(void)

static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
.wires = 4,
.version = MMC_CTLR_VERSION_1
};

#define HAS_ATA IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710)
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/mach-davinci/board-omapl138-hawk.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static struct davinci_mmc_config da850_mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_2,
};

static __init void omapl138_hawk_mmc_init(void)
Expand Down Expand Up @@ -311,6 +310,11 @@ static __init void omapl138_hawk_init(void)
if (ret)
pr_warn("%s: watchdog registration failed: %d\n",
__func__, ret);

ret = da8xx_register_rproc();
if (ret)
pr_warn("%s: dsp/rproc registration failed: %d\n",
__func__, ret);
}

#ifdef CONFIG_SERIAL_8250_CONSOLE
Expand Down Expand Up @@ -338,4 +342,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
.init_late = davinci_init_late,
.dma_zone_size = SZ_128M,
.restart = da8xx_restart,
.reserve = da8xx_rproc_reserve_cma,
MACHINE_END
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/board-tnetv107x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ static struct davinci_mmc_config mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
.version = MMC_CTLR_VERSION_1,
};

static const short sdio1_pins[] __initconst = {
Expand Down
21 changes: 14 additions & 7 deletions arch/arm/mach-davinci/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
{
if (clk->parent)
__clk_enable(clk->parent);
if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
true, clk->flags);
if (clk->usecount++ == 0) {
if (clk->flags & CLK_PSC)
davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
true, clk->flags);
else if (clk->clk_enable)
clk->clk_enable(clk);
}
}

static void __clk_disable(struct clk *clk)
{
if (WARN_ON(clk->usecount == 0))
return;
if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
(clk->flags & CLK_PSC))
davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
false, clk->flags);
if (--clk->usecount == 0) {
if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC))
davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
false, clk->flags);
else if (clk->clk_disable)
clk->clk_disable(clk);
}
if (clk->parent)
__clk_disable(clk->parent);
}
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-davinci/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ struct clk {
int (*set_rate) (struct clk *clk, unsigned long rate);
int (*round_rate) (struct clk *clk, unsigned long rate);
int (*reset) (struct clk *clk, bool reset);
void (*clk_enable) (struct clk *clk);
void (*clk_disable) (struct clk *clk);
};

/* Clock flags: SoC-specific flags start at BIT(16) */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/da830.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static struct clk_lookup da830_clks[] = {
CLK(NULL, "tpcc", &tpcc_clk),
CLK(NULL, "tptc0", &tptc0_clk),
CLK(NULL, "tptc1", &tptc1_clk),
CLK("davinci_mmc.0", NULL, &mmcsd_clk),
CLK("da830-mmc.0", NULL, &mmcsd_clk),
CLK(NULL, "uart0", &uart0_clk),
CLK(NULL, "uart1", &uart1_clk),
CLK(NULL, "uart2", &uart2_clk),
Expand Down
50 changes: 48 additions & 2 deletions arch/arm/mach-davinci/da850.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,49 @@ static struct clk dsp_clk = {
.flags = PSC_LRST | PSC_FORCE,
};

static struct clk ehrpwm_clk = {
.name = "ehrpwm",
.parent = &pll0_sysclk2,
.lpsc = DA8XX_LPSC1_PWM,
.gpsc = 1,
.flags = DA850_CLK_ASYNC3,
};

#define DA8XX_EHRPWM_TBCLKSYNC BIT(12)

static void ehrpwm_tblck_enable(struct clk *clk)
{
u32 val;

val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
val |= DA8XX_EHRPWM_TBCLKSYNC;
writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
}

static void ehrpwm_tblck_disable(struct clk *clk)
{
u32 val;

val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
val &= ~DA8XX_EHRPWM_TBCLKSYNC;
writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
}

static struct clk ehrpwm_tbclk = {
.name = "ehrpwm_tbclk",
.parent = &ehrpwm_clk,
.clk_enable = ehrpwm_tblck_enable,
.clk_disable = ehrpwm_tblck_disable,
};

static struct clk ecap_clk = {
.name = "ecap",
.parent = &pll0_sysclk2,
.lpsc = DA8XX_LPSC1_ECAP,
.gpsc = 1,
.flags = DA850_CLK_ASYNC3,
};

static struct clk_lookup da850_clks[] = {
CLK(NULL, "ref", &ref_clk),
CLK(NULL, "pll0", &pll0_clk),
Expand Down Expand Up @@ -420,8 +463,8 @@ static struct clk_lookup da850_clks[] = {
CLK("davinci_emac.1", NULL, &emac_clk),
CLK("davinci-mcasp.0", NULL, &mcasp_clk),
CLK("da8xx_lcdc.0", "fck", &lcdc_clk),
CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
CLK("da830-mmc.0", NULL, &mmcsd0_clk),
CLK("da830-mmc.1", NULL, &mmcsd1_clk),
CLK(NULL, "aemif", &aemif_clk),
CLK(NULL, "usb11", &usb11_clk),
CLK(NULL, "usb20", &usb20_clk),
Expand All @@ -430,6 +473,9 @@ static struct clk_lookup da850_clks[] = {
CLK("vpif", NULL, &vpif_clk),
CLK("ahci", NULL, &sata_clk),
CLK("davinci-rproc.0", NULL, &dsp_clk),
CLK("ehrpwm", "fck", &ehrpwm_clk),
CLK("ehrpwm", "tbclk", &ehrpwm_tbclk),
CLK("ecap", "fck", &ecap_clk),
CLK(NULL, NULL, NULL),
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-davinci/da8xx-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define DA8XX_NUM_UARTS 3

void __init da8xx_uart_clk_enable(void)
static void __init da8xx_uart_clk_enable(void)
{
int i;
for (i = 0; i < DA8XX_NUM_UARTS; i++)
Expand All @@ -37,7 +37,7 @@ static void __init da8xx_init_irq(void)
of_irq_init(da8xx_irq_match);
}

struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
{}
Expand Down
Loading

0 comments on commit 1556f4b

Please sign in to comment.