ARM: davinci: DT boot support for DA850
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
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
@@ -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
PATCH 2/9 ARM: davinci: serial: provide API to initialze UART clocks
In reply to a message not in the archiveProvide 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
@@ -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
@@ -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
PATCH 3/9 ARM: davinci: arrange kconfig selects in alphabetical order
In reply to a message not in the archiveArrange 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
@@ -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
PATCH 4/9 ARM: davinci: da850: add DT boot support
In reply to a message not in the archiveAdd 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 5/9 ARM: davinci: da850: add SoC DT data
In reply to a message not in the archiveFrom: 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
@@ -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
PATCH 6/9 ARM: davinci: da850 evm: add DT data
In reply to a message not in the archiveAdd 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
@@ -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
@@ -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
@@ -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
PATCH 7/9 ARM: davinci: add support for am1808 based EnBW CMC board
In reply to a message not in the archiveFrom: 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.
[[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
@@ -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
@@ -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
@@ -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
PATCH 8/9 ARM: davinci: da850: generate dtbs for da850 boards
In reply to a message not in the archiveThis 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
@@ -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
PATCH 9/9 ARM: davinci: da8xx defconfig: enable DT config options
In reply to a message not in the archiveEnable 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
@@ -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
cover ARM: davinci: DT boot support for DA850
In reply to Sekhar NoriQuoted 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