Skip to content

Commit

Permalink
Merge tag 'davinci-for-v3.8/dt' of git://gitorious.org/linux-davinci/…
Browse files Browse the repository at this point in the history
…linux-davinci into next/dt

From Sekhar Nori:

These changes add DT boot support to DaVinci DA850
SoC.

* tag 'davinci-for-v3.8/dt' of git://gitorious.org/linux-davinci/linux-davinci:
  ARM: davinci: da850: generate dtbs for da850 boards
  ARM: davinci: add support for am1808 based EnBW CMC board
  ARM: davinci: da850 evm: add DT data
  ARM: davinci: da850: add SoC DT data
  ARM: davinci: da850: add DT boot support
  ARM: davinci: da8xx: add DA850 PRUSS support
  ARM: davinci: add platform hook to fetch the SRAM pool
  ARM: davinci: da850: changed SRAM allocator to shared ram.
  ARM: davinci: sram: switch from iotable to ioremapped regions
  uio: uio_pruss: replace private SRAM API with genalloc
  ARM: davinci: serial: provide API to initialze UART clocks
  ARM: davinci: convert platform code to use clk_prepare/clk_unprepare

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Nov 20, 2012
2 parents e014f77 + 3a37390 commit 6ee052a
Show file tree
Hide file tree
Showing 30 changed files with 378 additions and 68 deletions.
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/arm/davinci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Texas Instruments DaVinci Platforms Device Tree Bindings
--------------------------------------------------------

DA850/OMAP-L138/AM18x Evaluation Module (EVM) board
Required root node properties:
- compatible = "ti,da850-evm", "ti,da850";

EnBW AM1808 based CMC board
Required root node properties:
- compatible = "enbw,cmc", "ti,da850;

Generic DaVinci Boards
----------------------

DA850/OMAP-L138/AM18x generic board
Required root node properties:
- compatible = "ti,da850";
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ config ARCH_DAVINCI
select GENERIC_IRQ_CHIP
select HAVE_IDE
select NEED_MACH_GPIO_H
select USE_OF
select ZONE_DMA
help
Support for TI's DaVinci platform.
Expand Down
30 changes: 30 additions & 0 deletions arch/arm/boot/dts/da850-enbw-cmc.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Device Tree for AM1808 EnBW CMC board
*
* Copyright 2012 DENX Software Engineering GmbH
* Heiko Schocher <hs@denx.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
/dts-v1/;
/include/ "da850.dtsi"

/ {
compatible = "enbw,cmc", "ti,da850";
model = "EnBW CMC";

soc {
serial0: serial@1c42000 {
status = "okay";
};
serial1: serial@1d0c000 {
status = "okay";
};
serial2: serial@1d0d000 {
status = "okay";
};
};
};
28 changes: 28 additions & 0 deletions arch/arm/boot/dts/da850-evm.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Device Tree for DA850 EVM board
*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, version 2.
*/
/dts-v1/;
/include/ "da850.dtsi"

/ {
compatible = "ti,da850-evm", "ti,da850";
model = "DA850/AM1808/OMAP-L138 EVM";

soc {
serial0: serial@1c42000 {
status = "okay";
};
serial1: serial@1d0c000 {
status = "okay";
};
serial2: serial@1d0d000 {
status = "okay";
};
};
};
60 changes: 60 additions & 0 deletions arch/arm/boot/dts/da850.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2012 DENX Software Engineering GmbH
* Heiko Schocher <hs@denx.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
/include/ "skeleton.dtsi"

/ {
arm {
#address-cells = <1>;
#size-cells = <1>;
ranges;
intc: interrupt-controller {
compatible = "ti,cp-intc";
interrupt-controller;
#interrupt-cells = <1>;
ti,intc-size = <100>;
reg = <0xfffee000 0x2000>;
};
};
soc {
compatible = "simple-bus";
model = "da850";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x01c00000 0x400000>;

serial0: serial@1c42000 {
compatible = "ns16550a";
reg = <0x42000 0x100>;
clock-frequency = <150000000>;
reg-shift = <2>;
interrupts = <25>;
interrupt-parent = <&intc>;
status = "disabled";
};
serial1: serial@1d0c000 {
compatible = "ns16550a";
reg = <0x10c000 0x100>;
clock-frequency = <150000000>;
reg-shift = <2>;
interrupts = <53>;
interrupt-parent = <&intc>;
status = "disabled";
};
serial2: serial@1d0d000 {
compatible = "ns16550a";
reg = <0x10d000 0x100>;
clock-frequency = <150000000>;
reg-shift = <2>;
interrupts = <61>;
interrupt-parent = <&intc>;
status = "disabled";
};
};
};
8 changes: 8 additions & 0 deletions arch/arm/mach-davinci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ config ARCH_DAVINCI_TNETV107X

comment "DaVinci Board Type"

config MACH_DA8XX_DT
bool "Support DA8XX platforms using device tree"
default y
depends on ARCH_DAVINCI_DA8XX
help
Say y here to include support for TI DaVinci DA850 based using
Flattened Device Tree. More information at Documentation/devicetree

config MACH_DAVINCI_EVM
bool "TI DM644x EVM"
default ARCH_DAVINCI_DM644x
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-davinci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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_DAVINCI_EVM) += board-dm644x-evm.o
obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-davinci/Makefile.boot
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ else
params_phys-y := 0x80000100
initrd_phys-y := 0x80800000
endif

dtb-$(CONFIG_MACH_DA8XX_DT) += da850-enbw-cmc.dtb da850-evm.dtb
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/board-dm355-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static __init void dm355_evm_init(void)
if (IS_ERR(aemif))
WARN("%s: unable to get AEMIF clock\n", __func__);
else
clk_enable(aemif);
clk_prepare_enable(aemif);

platform_add_devices(davinci_evm_devices,
ARRAY_SIZE(davinci_evm_devices));
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/board-dm355-leopard.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static __init void dm355_leopard_init(void)
if (IS_ERR(aemif))
WARN("%s: unable to get AEMIF clock\n", __func__);
else
clk_enable(aemif);
clk_prepare_enable(aemif);

platform_add_devices(davinci_leopard_devices,
ARRAY_SIZE(davinci_leopard_devices));
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-davinci/board-dm365-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void __init evm_init_cpld(void)
aemif_clk = clk_get(NULL, "aemif");
if (IS_ERR(aemif_clk))
return;
clk_enable(aemif_clk);
clk_prepare_enable(aemif_clk);

if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE,
"cpld") == NULL)
Expand All @@ -489,7 +489,7 @@ static void __init evm_init_cpld(void)
SECTION_SIZE);
fail:
pr_err("ERROR: can't map CPLD\n");
clk_disable(aemif_clk);
clk_disable_unprepare(aemif_clk);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ static __init void davinci_evm_init(void)
struct davinci_soc_info *soc_info = &davinci_soc_info;

aemif_clk = clk_get(NULL, "aemif");
clk_enable(aemif_clk);
clk_prepare_enable(aemif_clk);

if (HAS_ATA) {
if (HAS_NAND || HAS_NOR)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/board-neuros-osd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static __init void davinci_ntosd2_init(void)
struct davinci_soc_info *soc_info = &davinci_soc_info;

aemif_clk = clk_get(NULL, "aemif");
clk_enable(aemif_clk);
clk_prepare_enable(aemif_clk);

if (HAS_ATA) {
if (HAS_NAND)
Expand Down
17 changes: 9 additions & 8 deletions arch/arm/mach-davinci/da850.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ static struct clk tptc2_clk = {
.flags = ALWAYS_ENABLED,
};

static struct clk pruss_clk = {
.name = "pruss",
.parent = &pll0_sysclk2,
.lpsc = DA8XX_LPSC0_PRUSS,
};

static struct clk uart0_clk = {
.name = "uart0",
.parent = &pll0_sysclk2,
Expand Down Expand Up @@ -385,6 +391,7 @@ static struct clk_lookup da850_clks[] = {
CLK(NULL, "tptc1", &tptc1_clk),
CLK(NULL, "tpcc1", &tpcc1_clk),
CLK(NULL, "tptc2", &tptc2_clk),
CLK("pruss_uio", "pruss", &pruss_clk),
CLK(NULL, "uart0", &uart0_clk),
CLK(NULL, "uart1", &uart1_clk),
CLK(NULL, "uart2", &uart2_clk),
Expand Down Expand Up @@ -781,12 +788,6 @@ static struct map_desc da850_io_desc[] = {
.length = DA8XX_CP_INTC_SIZE,
.type = MT_DEVICE
},
{
.virtual = SRAM_VIRT,
.pfn = __phys_to_pfn(DA8XX_ARM_RAM_BASE),
.length = SZ_8K,
.type = MT_DEVICE
},
};

static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE };
Expand Down Expand Up @@ -1239,8 +1240,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
.gpio_irq = IRQ_DA8XX_GPIO0,
.serial_dev = &da8xx_serial_device,
.emac_pdata = &da8xx_emac_pdata,
.sram_dma = DA8XX_ARM_RAM_BASE,
.sram_len = SZ_8K,
.sram_dma = DA8XX_SHARED_RAM_BASE,
.sram_len = SZ_128K,
};

void __init da850_init(void)
Expand Down
66 changes: 66 additions & 0 deletions arch/arm/mach-davinci/da8xx-dt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* Modified from mach-omap/omap2/board-generic.c
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/io.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/irqdomain.h>

#include <asm/mach/arch.h>

#include <mach/common.h>
#include <mach/cp_intc.h>
#include <mach/da8xx.h>

#define DA8XX_NUM_UARTS 3

void __init da8xx_uart_clk_enable(void)
{
int i;
for (i = 0; i < DA8XX_NUM_UARTS; i++)
davinci_serial_setup_clk(i, NULL);
}

static struct of_device_id da8xx_irq_match[] __initdata = {
{ .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
{ }
};

static void __init da8xx_init_irq(void)
{
of_irq_init(da8xx_irq_match);
}

#ifdef CONFIG_ARCH_DAVINCI_DA850

static void __init da850_init_machine(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);

da8xx_uart_clk_enable();
}

static const char *da850_boards_compat[] __initdata = {
"enbw,cmc",
"ti,da850-evm",
"ti,da850",
NULL,
};

DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
.map_io = da850_init,
.init_irq = da8xx_init_irq,
.timer = &davinci_timer,
.init_machine = da850_init_machine,
.dt_compat = da850_boards_compat,
.init_late = davinci_init_late,
.restart = da8xx_restart,
MACHINE_END

#endif
Loading

0 comments on commit 6ee052a

Please sign in to comment.