Skip to contentSkip to conversation

ARM: davinci: DT boot support for DA850

PATCH RESEND New Sekhar Nori 2 participants 11 messages Sep 12, 2012 – Oct 23, 2012 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ARM: davinci: DT boot support for DA850

This series adds basic DT boot support for DA850 EVM and EnBW CMC board. It applies to master branch of Linux DaVinci tree[1].

Resending this because I missed copying the DT and Documentation folks last time around. Sorry about that. There is no change in patch contents.

Thanks,
Sekhar

[1] git://gitorious.org/linux-davinci/linux-davinci.git

Heiko Schocher (2):
ARM: davinci: da850: add SoC DT data
ARM: davinci: add support for am1808 based EnBW CMC board

Sekhar Nori (7):
ARM: davinci: uncompress.h: bail out if uart not initialized
ARM: davinci: serial: provide API to initialze UART clocks
ARM: davinci: arrange kconfig selects in alphabetical order
ARM: davinci: da850: add DT boot support
ARM: davinci: da850 evm: add DT data
ARM: davinci: da850: generate dtbs for da850 boards
ARM: davinci: da8xx defconfig: enable DT config options

 Documentation/devicetree/bindings/arm/davinci.txt |   17 ++++++
 arch/arm/Kconfig                                  |    9 +--
 arch/arm/boot/dts/da850-enbw-cmc.dts              |   30 ++++++++++
 arch/arm/boot/dts/da850-evm.dts                   |   28 +++++++++
 arch/arm/boot/dts/da850.dtsi                      |   60 +++++++++++++++++++
 arch/arm/configs/da8xx_omapl_defconfig            |    3 +
 arch/arm/mach-davinci/Kconfig                     |    8 +++
 arch/arm/mach-davinci/Makefile                    |    1 +
 arch/arm/mach-davinci/Makefile.boot               |    2 +
 arch/arm/mach-davinci/da8xx-dt.c                  |   66 +++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/serial.h       |    1 +
 arch/arm/mach-davinci/include/mach/uncompress.h   |    6 ++
 arch/arm/mach-davinci/serial.c                    |   39 ++++++++----
 13 files changed, 254 insertions(+), 16 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/davinci.txt
 create mode 100644 arch/arm/boot/dts/da850-enbw-cmc.dts
 create mode 100644 arch/arm/boot/dts/da850-evm.dts
 create mode 100644 arch/arm/boot/dts/da850.dtsi
 create mode 100644 arch/arm/mach-davinci/da8xx-dt.c
Signature · 1 line
1.7.10.1

A message that is not in the archive (sent off-list or not yet received): 1347467732-1332-1-git-send-email-nsekhar-l0cyMroinI0@public.gmane.org

#2 lore raw

PATCH 1/9 ARM: davinci: uncompress.h: bail out if uart not initialized

Bail out of UART access functions in uncompress.h if the uart port is not setup. This will happen when booting from DT since machine type matching does not work in this case. This may also happen if a correct machine type is not setup by bootloader.

---
 arch/arm/mach-davinci/include/mach/uncompress.h |    6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-davinci/include/mach/uncompress.h +6 -0
index 18cfd49..3a0ff90 100644
@@ -32,6 +32,9 @@ u32 *uart;
 /* PORT_16C550A, in polled non-fifo mode */
 static void putc(char c)
 {
+	if (!uart)
+		return;
+
 	while (!(uart[UART_LSR] & UART_LSR_THRE))
 		barrier();
 	uart[UART_TX] = c;
@@ -39,6 +42,9 @@ static void putc(char c)
 
 static inline void flush(void)
 {
+	if (!uart)
+		return;
+
 	while (!(uart[UART_LSR] & UART_LSR_THRE))
 		barrier();
 }
Signature · 1 line
1.7.10.1
#3 lore raw

PATCH 2/9 ARM: davinci: serial: provide API to initialze UART clocks

In reply to a message not in the archive

Provide an API to initialize a UART clock. Refactor existing davinci_serial_init() to separate out the part which enables the clock.

This will later be used to help DA850 DT boot support.

---
 arch/arm/mach-davinci/include/mach/serial.h |    1 +
 arch/arm/mach-davinci/serial.c              |   39 ++++++++++++++++++---------
 2 files changed, 28 insertions(+), 12 deletions(-)
arch/arm/mach-davinci/include/mach/serial.h +1 -0
index 46b3cd1..2d9d921 100644
@@ -43,6 +43,7 @@ struct davinci_uart_config {
 };
 
 extern int davinci_serial_init(struct davinci_uart_config *);
+extern int davinci_serial_setup_clk(unsigned instance, unsigned int *rate);
 #endif
 
 #endif /* __ASM_ARCH_SERIAL_H */
arch/arm/mach-davinci/serial.c +27 -12
index 24ddb0d..f262581 100644
@@ -70,11 +70,33 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
 				 UART_DM646X_SCR_TX_WATERMARK);
 }
 
-int __init davinci_serial_init(struct davinci_uart_config *info)
+/* Enable UART clock and obtain its rate */
+int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
 {
-	int i;
 	char name[16];
-	struct clk *uart_clk;
+	struct clk *clk;
+	struct davinci_soc_info *soc_info = &davinci_soc_info;
+	struct device *dev = &soc_info->serial_dev->dev;
+
+	sprintf(name, "uart%d", instance);
+	clk = clk_get(dev, name);
+	if (IS_ERR(clk)) {
+		pr_err("%s:%d: failed to get UART%d clock\n",
+					__func__, __LINE__, instance);
+		return PTR_ERR(clk);
+	}
+
+	clk_prepare_enable(clk);
+
+	if (rate)
+		*rate = clk_get_rate(clk);
+
+	return 0;
+}
+
+int __init davinci_serial_init(struct davinci_uart_config *info)
+{
+	int i, ret;
 	struct davinci_soc_info *soc_info = &davinci_soc_info;
 	struct device *dev = &soc_info->serial_dev->dev;
 	struct plat_serial8250_port *p = dev->platform_data;
@@ -87,16 +109,9 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
 		if (!(info->enabled_uarts & (1 << i)))
 			continue;
 
-		sprintf(name, "uart%d", i);
-		uart_clk = clk_get(dev, name);
-		if (IS_ERR(uart_clk)) {
-			printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
-					__func__, __LINE__, i);
+		ret = davinci_serial_setup_clk(i, &p->uartclk);
+		if (ret)
 			continue;
-		}
-
-		clk_prepare_enable(uart_clk);
-		p->uartclk = clk_get_rate(uart_clk);
 
 		if (!p->membase && p->mapbase) {
 			p->membase = ioremap(p->mapbase, SZ_4K);
Signature · 1 line
1.7.10.1
#4 lore raw

PATCH 3/9 ARM: davinci: arrange kconfig selects in alphabetical order

In reply to a message not in the archive

Arrange Kconfig selects for DaVinci in alphabetical order. This makes it easier to avoid adding duplicate selects.

---
 arch/arm/Kconfig |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/Kconfig +4 -4
index c5f9ae5..df04b0b 100644
@@ -963,14 +963,14 @@ config ARCH_NOMADIK
 
 config ARCH_DAVINCI
 	bool "TI DaVinci"
-	select GENERIC_CLOCKEVENTS
+	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARCH_REQUIRE_GPIOLIB
-	select ZONE_DMA
-	select HAVE_IDE
 	select CLKDEV_LOOKUP
 	select GENERIC_ALLOCATOR
+	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
-	select ARCH_HAS_HOLES_MEMORYMODEL
+	select HAVE_IDE
+	select ZONE_DMA
 	help
 	  Support for TI's DaVinci platform.
 
Signature · 1 line
1.7.10.1
#5 lore raw

PATCH 4/9 ARM: davinci: da850: add DT boot support

In reply to a message not in the archive

Add support for booting DA850 using flattened device tree to describe the hardware. At this time only the very basic bootup using a serial console is supported.

---
 Documentation/devicetree/bindings/arm/davinci.txt |    9 +++
 arch/arm/Kconfig                                  |    1 +
 arch/arm/mach-davinci/Kconfig                     |    8 +++
 arch/arm/mach-davinci/Makefile                    |    1 +
 arch/arm/mach-davinci/da8xx-dt.c                  |   64 +++++++++++++++++++++
 5 files changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/davinci.txt
 create mode 100644 arch/arm/mach-davinci/da8xx-dt.c
Documentation/devicetree/bindings/arm/davinci.txt new file +9 -0
new file mode 100644
index 0000000..aa4e7a1
@@ -0,0 +1,9 @@
+Texas Instruments DaVinci Platforms Device Tree Bindings
+--------------------------------------------------------
+
+Generic DaVinci Boards
+----------------------
+
+DA850/OMAP-L138/AM18x generic board
+Required root node properties:
+    - compatible = "ti,da850";
arch/arm/Kconfig +1 -0
index df04b0b..d59765a 100644
@@ -970,6 +970,7 @@ config ARCH_DAVINCI
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
 	select HAVE_IDE
+	select USE_OF
 	select ZONE_DMA
 	help
 	  Support for TI's DaVinci platform.
arch/arm/mach-davinci/Kconfig +8 -0
index ab99c3c..5da2148 100644
@@ -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
arch/arm/mach-davinci/Makefile +1 -0
index 2227eff..fb5c1aa 100644
@@ -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
arch/arm/mach-davinci/da8xx-dt.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.7.10.1
#6 lore raw

PATCH 5/9 ARM: davinci: da850: add SoC DT data

In reply to a message not in the archive

From: Heiko Schocher <[email protected]>

Add DT data for DA850 SoC. Only interrupt controller and serial port information is being added at this time.

[[email protected]: refactored DT data into SoC specific and board specific and include SoC data into .dtsi file]

---
 arch/arm/boot/dts/da850.dtsi |   60 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 arch/arm/boot/dts/da850.dtsi
arch/arm/boot/dts/da850.dtsi new file +60 -0
new file mode 100644
index 0000000..640ab75
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2012 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * 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";
+		};
+	};
+};
Signature · 1 line
1.7.10.1
#7 lore raw

PATCH 6/9 ARM: davinci: da850 evm: add DT data

In reply to a message not in the archive

Add device tree data for DA850 EVM. At this time, only information on serial ports is added.

---
 Documentation/devicetree/bindings/arm/davinci.txt |    4 +++
 arch/arm/boot/dts/da850-evm.dts                   |   28 +++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c                  |    1 +
 3 files changed, 33 insertions(+)
 create mode 100644 arch/arm/boot/dts/da850-evm.dts
Documentation/devicetree/bindings/arm/davinci.txt +4 -0
index aa4e7a1..2dda756 100644
@@ -1,6 +1,10 @@
 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";
+
 Generic DaVinci Boards
 ----------------------
 
arch/arm/boot/dts/da850-evm.dts new file +28 -0
new file mode 100644
index 0000000..37dc5a3
@@ -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";
+		};
+	};
+};
arch/arm/mach-davinci/da8xx-dt.c +1 -0
index df393d9..94b09fd 100644
@@ -47,6 +47,7 @@ static void __init da850_init_machine(void)
 }
 
 static const char *da850_boards_compat[] __initdata = {
+	"ti,da850-evm",
 	"ti,da850",
 	NULL,
 };
Signature · 1 line
1.7.10.1
#8 lore raw

PATCH 7/9 ARM: davinci: add support for am1808 based EnBW CMC board

In reply to a message not in the archive

From: Heiko Schocher <[email protected]>

This board supports:

- AM1808 based board
- 64 MiB DDR ram
- 2 MiB Nor flash
- 128 MiB NAND flash
- use internal RTC
- I2C support
- hwmon lm75 support
- UBI/UBIFS support
- MMC support
- USB OTG support

This patch adds the basic DTS file enabling the serial ports. Other features will be added in due course of time.

Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc devicetree-discuss-uLR06cmDAlY/[email protected]
Cc davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Wolfgang Denk <[email protected]>

[[email protected]: modified after dtsi refactoring and added binding documentation]

---
 Documentation/devicetree/bindings/arm/davinci.txt |    4 +++
 arch/arm/boot/dts/da850-enbw-cmc.dts              |   30 +++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c                  |    1 +
 3 files changed, 35 insertions(+)
 create mode 100644 arch/arm/boot/dts/da850-enbw-cmc.dts
Documentation/devicetree/bindings/arm/davinci.txt +4 -0
index 2dda756..cfaeda4 100644
@@ -5,6 +5,10 @@ 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
 ----------------------
 
arch/arm/boot/dts/da850-enbw-cmc.dts new file +30 -0
new file mode 100644
index 0000000..422fdb3
@@ -0,0 +1,30 @@
+/*
+ * Device Tree for AM1808 EnBW CMC board
+ *
+ * Copyright 2012 DENX Software Engineering GmbH
+ * Heiko Schocher <[email protected]>
+ *
+ * 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";
+		};
+	};
+};
arch/arm/mach-davinci/da8xx-dt.c +1 -0
index 94b09fd..37c27af 100644
@@ -47,6 +47,7 @@ static void __init da850_init_machine(void)
 }
 
 static const char *da850_boards_compat[] __initdata = {
+	"enbw,cmc",
 	"ti,da850-evm",
 	"ti,da850",
 	NULL,
Signature · 1 line
1.7.10.1
#9 lore raw

PATCH 8/9 ARM: davinci: da850: generate dtbs for da850 boards

In reply to a message not in the archive

This helps generating device tree blobs for DaVinci DA850 boards with command:

'make ARCH=arm dtbs'.

---
 arch/arm/mach-davinci/Makefile.boot |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/Makefile.boot +2 -0
index 04a6c4e..5c5a95a 100644
@@ -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
Signature · 1 line
1.7.10.1
#10 lore raw

PATCH 9/9 ARM: davinci: da8xx defconfig: enable DT config options

In reply to a message not in the archive

Enable DT related config options in da8xx_omapl_defconfig

---
 arch/arm/configs/da8xx_omapl_defconfig |    3 +++
 1 file changed, 3 insertions(+)
arch/arm/configs/da8xx_omapl_defconfig +3 -0
index 88ccde0..f292239 100644
@@ -17,6 +17,7 @@ CONFIG_MODVERSIONS=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_ARCH_DAVINCI_DA830=y
 CONFIG_ARCH_DAVINCI_DA850=y
+CONFIG_MACH_DA8XX_DT=y
 CONFIG_MACH_MITYOMAPL138=y
 CONFIG_MACH_OMAPL138_HAWKBOARD=y
 CONFIG_DAVINCI_RESET_CLOCKS=y
@@ -26,6 +27,7 @@ CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
 CONFIG_LEDS=y
+CONFIG_USE_OF=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CPU_FREQ=y
@@ -75,6 +77,7 @@ CONFIG_SERIO_LIBPS2=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=3
+CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DAVINCI=y
Signature · 1 line
1.7.10.1
#11 lore raw

cover ARM: davinci: DT boot support for DA850

In reply to Sekhar Nori
Quoted 5 lines · Sekhar Nori

This series adds basic DT boot support for DA850 EVM and EnBW CMC board. It applies to master branch of Linux DaVinci tree[1].

Resending this because I missed copying the DT and Documentation folks last time around. Sorry about that. There is no change in patch contents.

I will be queuing these patches for inclusion in v3.8.

Thanks,
Sekhar