Skip to contentSkip to conversation

ARM: davinci: add support for the am1808 based enbw_cmc board

PATCH In review Heiko Schocher 2 participants 3 messages Jul 5, 2012 – Aug 9, 2012 2 messages not in the archive

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

PATCH v6 7/7 ARM: davinci: add support for the am1808 based enbw_cmc board

- 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

Cc linux-arm-kernel at lists.infradead.org
Cc devicetree-discuss at lists.ozlabs.org
Cc davinci-linux-open-source at linux.davincidsp.com
Cc linux-mtd at lists.infradead.org
Cc linux-i2c at vger.kernel.org
Cc netdev at vger.kernel.org
Cc David Woodhouse <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Scott Wood <[email protected]>
Cc Sylwester Nawrocki <[email protected]>

---
- post this board support with USB support, even though USB is only working with the 10 ms "workaround", posted here:
http://comments.gmane.org/gmane.linux.usb.general/54505
I see this issue also on the AM1808 TMDXEXP1808L evalboard.
- MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support?

- changes for v2:
- changes in the nand node due to comments from Scott Wood:
- add "ti,davinci-" prefix
- Dashes are preferred to underscores
- rename "nandflash" to "nand"
- introduce new "ti,davinci" specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines
- changes for i2c due to comments from Sylwester Nawrocki:
- use "cell-index" instead "id"
- OF_DEV_AUXDATA in the machine code, instead pre-define platform device name
- add comment from Grant Likely for i2c:
- removed "id" resp. "cell-index" completely
- fixed documentation
- use of_match_ptr()
- use devm_kzalloc() for allocating plattform data mem
- fixed a whitespace issue
- add net comments from Grant Likely:
- add prefix "ti,davinci-" to davinci specific property names
- remove version property
- use compatible name "ti,davinci-dm6460-emac"
- add comment from Grant Likely:
- rename compatible node
- do not use cell-index
- CONFIG_OF required for this board
TODO:
- create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step?
- changes for v3:
- add comments from Sergei Shtylyov:
- rename compatible" prop to "ti,cp_intc"
- cp_intc_init now used for Interrupt controller init
- changes for v4:
add comment from Nori Sekhar:
- rename davinci emac compatible property to "ti,davinci-dm6467-emac"
- remove "pinmux-handle" property as discussed here:
http://www.spinics.net/lists/arm-kernel/msg175701.html
with Nori Sekhar

- changes for v5:
add comments from Grant Likely:
- rename compatible" prop to "ti,cp-intc"

- changes for v6:
rework this patch, as patch
ARM: davinci: cp_intc: Add OF support for TI interrupt controller was changed from Nori Sekhar on Jul 03, 2012; 9:16pm Changes therefore in this patch:

Call of_irq_init() in the generic DT board file and not in the interrupt controller code. See arch/arm/mach-at91/board-dt.c or arch/arm/mach-omap2/board-generic.c for examples.

At this point the question raises, if we should rename this board port from arch/arm/mach-davinci/enbw_cmc.c to arch/arm/mach-davinci/board-dt.c ? Also the defconfig to davinci_of_defconfig ... ? The USB and MMC callbacks are currently board specific, but if other boards come in, that could be easily adapted for their needs ...

 arch/arm/boot/dts/enbw_cmc.dts                  |  183 +++++++++++
 arch/arm/configs/enbw_cmc_defconfig             |  126 ++++++++
 arch/arm/mach-davinci/Kconfig                   |    9 +
 arch/arm/mach-davinci/Makefile                  |    1 +
 arch/arm/mach-davinci/board-enbw-cmc.c          |  385 +++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/uncompress.h |    1 +
 6 files changed, 705 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/enbw_cmc.dts
 create mode 100644 arch/arm/configs/enbw_cmc_defconfig
 create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c
arch/arm/boot/dts/enbw_cmc.dts new file +183 -0
new file mode 100644
index 0000000..32dc7a9
@@ -0,0 +1,183 @@
+/*
+ * Device Tree for the EnBW CMC plattform
+ *
+ * Copyright 2011 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/ "skeleton.dtsi"
+
+/ {
+	model = "EnBW CMC";
+	compatible = "enbw,cmc";
+
+	aliases {
+		ethernet0 = &eth0;
+	};
+
+	arm {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0xfffee000 0x00020000>;
+		intc: interrupt-controller at 1 {
+			compatible = "ti,cp-intc";
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			ti,intc-size = <101>;
+			reg = <0x0 0x2000>;
+		};
+	};
+	soc at 1c00000 {
+		compatible = "ti,da850";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x01c00000 0x400000>;
+
+		serial0: serial at 1c42000 {
+			compatible = "ti,da850", "ns16550a";
+			reg = <0x42000 0x100>;
+			clock-frequency = <150000000>;
+			reg-shift = <2>;
+			interrupts = <25>;
+			interrupt-parent = <&intc>;
+		};
+		serial1: serial at 1d0c000 {
+			compatible = "ti,da850", "ns16550a";
+			reg = <0x10c000 0x100>;
+			clock-frequency = <150000000>;
+			reg-shift = <2>;
+			interrupts = <53>;
+			interrupt-parent = <&intc>;
+		};
+		serial2: serial at 1d0d000 {
+			compatible = "ti,da850", "ns16550a";
+			reg = <0x10d000 0x100>;
+			clock-frequency = <150000000>;
+			reg-shift = <2>;
+			interrupts = <61>;
+			interrupt-parent = <&intc>;
+		};
+
+		eth0: emac at 1e20000 {
+			compatible = "ti,davinci-dm6467-emac";
+			reg = <0x220000 0x4000>;
+			ti,davinci-ctrl-reg-offset = <0x3000>;
+			ti,davinci-ctrl-mod-reg-offset = <0x2000>;
+			ti,davinci-ctrl-ram-offset = <0>;
+			ti,davinci-ctrl-ram-size = <0x2000>;
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			interrupts = <33
+					34
+					35
+					36
+					>;
+			interrupt-parent = <&intc>;
+		};
+
+		i2c at 1c22000 {
+			compatible = "ti,davinci-i2c";
+			reg = <0x22000 0x1000>;
+			clock-frequency = <100000>;
+			interrupts = <15>;
+			interrupt-parent = <&intc>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			dtt at 48 {
+				compatible = "national,lm75";
+				reg = <0x48>;
+			};
+		};
+
+		wdt at 1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x00021000 0x1000>;
+			period = <100>;
+		};
+		bootcount at 1c23000 {
+			compatible = "uboot,bootcount";
+			reg = <0x23060 0x20>;
+		};
+
+	};
+	onchipram at 8000000 {
+		compatible = "ti,davinci-onchipram";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x80000000 0x20000>;
+	};
+	aemif at 60000000 {
+		compatible = "ti,davinci-aemif";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <0x68000000 0x80000>;
+		ranges = <2 0 0x60000000 0x02000000
+			  3 0 0x62000000 0x02000000
+			  4 0 0x64000000 0x02000000
+			  5 0 0x66000000 0x02000000
+			  6 0 0x68000000 0x02000000>;
+		cs2 at 68000000 {
+			compatible = "ti,davinci-cs";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			/* all timings in nanoseconds */
+			cs = <2>;
+			asize = <1>;
+			ta = <0>;
+			rhold = <7>;
+			rstrobe = <42>;
+			rsetup = <14>;
+			whold = <7>;
+			wstrobe = <42>;
+			wsetup = <14>;
+			ew = <0>;
+			ss = <0>;
+		};
+		flash at 2,0 {
+			compatible = "cfi-flash";
+			reg = <2 0x0 0x400000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bank-width = <2>;
+			device-width = <2>;
+		};
+		nand_cs: cs3 at 68000000 {
+			compatible = "ti,davinci-cs";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			/* all timings in nanoseconds */
+			cs = <3>;
+			asize = <0>;
+			ta = <0>;
+			rhold = <7>;
+			rstrobe = <42>;
+			rsetup = <7>;
+			whold = <7>;
+			wstrobe = <14>;
+			wsetup = <7>;
+			ew = <0>;
+			ss = <0>;
+		};
+		nand at 3,0 {
+			compatible = "ti,davinci-nand";
+			reg = <3 0x0 0x807ff
+				6 0x0 0x8000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ti,davinci-chipselect = <1>;
+			ti,davinci-mask-ale = <0>;
+			ti,davinci-mask-cle = <0>;
+			ti,davinci-mask-chipsel = <0>;
+			ti,davinci-ecc-mode = "hw";
+			ti,davinci-ecc-bits = <4>;
+			ti,davinci-nand-use-bbt;
+			timing-handle = <&nand_cs>;
+		};
+
+	};
+};
arch/arm/configs/enbw_cmc_defconfig new file +126 -0

126 lines not on this page · raw message

arch/arm/mach-davinci/Kconfig +9 -0
index 32d837d..4cb0469 100644
@@ -202,6 +202,15 @@ config DA850_WL12XX
 	  Say Y if you want to use a wl1271 expansion card connected to the
 	  AM18x EVM.
 
+config MACH_ENBW_CMC
+	bool "EnBW Communication Module Compact"
+	default ARCH_DAVINCI_DA850
+	depends on ARCH_DAVINCI_DA850
+	select OF
+	help
+	  Say Y here to select the EnBW Communication Module Compact
+	  board.
+
 config GPIO_PCA953X
 	default MACH_DAVINCI_DA850_EVM
 
arch/arm/mach-davinci/Makefile +1 -0
index 2db78bd..12f3166 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_MACH_DAVINCI_DA850_EVM)	+= board-da850-evm.o
 obj-$(CONFIG_MACH_TNETV107X)		+= board-tnetv107x-evm.o
 obj-$(CONFIG_MACH_MITYOMAPL138)		+= board-mityomapl138.o
 obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD)	+= board-omapl138-hawk.o
+obj-$(CONFIG_MACH_ENBW_CMC)		+= board-enbw-cmc.o
 
 # Power Management
 obj-$(CONFIG_CPU_FREQ)			+= cpufreq.o
arch/arm/mach-davinci/board-enbw-cmc.c new file +385 -0

385 lines not on this page · raw message

arch/arm/mach-davinci/include/mach/uncompress.h +1 -0
index da2fb2c..6119543 100644
@@ -98,6 +98,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 		DEBUG_LL_DA8XX(davinci_da850_evm,	2);
 		DEBUG_LL_DA8XX(mityomapl138,		1);
 		DEBUG_LL_DA8XX(omapl138_hawkboard,	2);
+		DEBUG_LL_DA8XX(enbw_cmc,		2);
 
 		/* TNETV107x boards */
 		DEBUG_LL_TNETV107X(tnetv107x,		1);
Signature · 1 line
1.7.7.6
#2 lore raw
In reply to a message not in the archive

Hi Heiko,

Quoted 98 lines · Heiko Schocher

- 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

Cc linux-arm-kernel at lists.infradead.org
Cc devicetree-discuss at lists.ozlabs.org
Cc davinci-linux-open-source at linux.davincidsp.com
Cc linux-mtd at lists.infradead.org
Cc linux-i2c at vger.kernel.org
Cc netdev at vger.kernel.org
Cc David Woodhouse <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Sekhar Nori <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Scott Wood <[email protected]>
Cc Sylwester Nawrocki <[email protected]>

---
- post this board support with USB support, even though USB is only working with the 10 ms "workaround", posted here:
http://comments.gmane.org/gmane.linux.usb.general/54505
I see this issue also on the AM1808 TMDXEXP1808L evalboard.
- MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support?

- changes for v2:
- changes in the nand node due to comments from Scott Wood:
- add "ti,davinci-" prefix
- Dashes are preferred to underscores
- rename "nandflash" to "nand"
- introduce new "ti,davinci" specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines
- changes for i2c due to comments from Sylwester Nawrocki:
- use "cell-index" instead "id"
- OF_DEV_AUXDATA in the machine code, instead pre-define platform device name
- add comment from Grant Likely for i2c:
- removed "id" resp. "cell-index" completely
- fixed documentation
- use of_match_ptr()
- use devm_kzalloc() for allocating plattform data mem
- fixed a whitespace issue
- add net comments from Grant Likely:
- add prefix "ti,davinci-" to davinci specific property names
- remove version property
- use compatible name "ti,davinci-dm6460-emac"
- add comment from Grant Likely:
- rename compatible node
- do not use cell-index
- CONFIG_OF required for this board
TODO:
- create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step?
- changes for v3:
- add comments from Sergei Shtylyov:
- rename compatible" prop to "ti,cp_intc"
- cp_intc_init now used for Interrupt controller init
- changes for v4:
add comment from Nori Sekhar:
- rename davinci emac compatible property to "ti,davinci-dm6467-emac"
- remove "pinmux-handle" property as discussed here:
http://www.spinics.net/lists/arm-kernel/msg175701.html
with Nori Sekhar

- changes for v5:
add comments from Grant Likely:
- rename compatible" prop to "ti,cp-intc"

- changes for v6:
rework this patch, as patch
ARM: davinci: cp_intc: Add OF support for TI interrupt controller was changed from Nori Sekhar on Jul 03, 2012; 9:16pm Changes therefore in this patch:

Call of_irq_init() in the generic DT board file and not in the interrupt controller code. See arch/arm/mach-at91/board-dt.c or arch/arm/mach-omap2/board-generic.c for examples.

At this point the question raises, if we should rename this board port from arch/arm/mach-davinci/enbw_cmc.c to arch/arm/mach-davinci/board-dt.c ? Also the defconfig to davinci_of_defconfig ... ? The USB and MMC callbacks are currently board specific, but if other boards come in, that could be easily adapted for their needs ...

Quoted 10 lines
 arch/arm/boot/dts/enbw_cmc.dts                  |  183 +++++++++++
 arch/arm/configs/enbw_cmc_defconfig             |  126 ++++++++
 arch/arm/mach-davinci/Kconfig                   |    9 +
 arch/arm/mach-davinci/Makefile                  |    1 +
 arch/arm/mach-davinci/board-enbw-cmc.c          |  385 +++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/uncompress.h |    1 +
 6 files changed, 705 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/enbw_cmc.dts
 create mode 100644 arch/arm/configs/enbw_cmc_defconfig
 create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c

With the move to DT, we are not going to add more board specific files and defconfigs. I am working on adding a generic dt board file for DA850 (similar to what has been done for imx). That file is not going to do any platform device registrations. If you are OK with it, I will add the dts file for enbw_cmc board in the patch series I am planning to post.

Things like USB and MMC/SD will need to be converted to DT before they can be supported on new boards.

Thanks,
Sekhar

#4 lore raw
In reply to a message not in the archive

Hello Nori,

Quoted 112 lines · Sekhar Nori

Hi Heiko,

Quoted 105 lines · Heiko Schocher

- 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

Cc linux-arm-kernel at lists.infradead.org
Cc devicetree-discuss at lists.ozlabs.org
Cc davinci-linux-open-source at linux.davincidsp.com
Cc linux-mtd at lists.infradead.org
Cc linux-i2c at vger.kernel.org
Cc netdev at vger.kernel.org
Cc David Woodhouse<[email protected]>
Cc Ben Dooks<[email protected]>
Cc Wolfram Sang<[email protected]>
Cc Sekhar Nori<[email protected]>
Cc Kevin Hilman<[email protected]>
Cc Wolfgang Denk<[email protected]>
Cc Scott Wood<[email protected]>
Cc Sylwester Nawrocki<[email protected]>

---
- post this board support with USB support, even though USB is only working with the 10 ms "workaround", posted here:
http://comments.gmane.org/gmane.linux.usb.general/54505
I see this issue also on the AM1808 TMDXEXP1808L evalboard.
- MMC and USB are not using OF support yet, ideas how to port this are welcome. I need for USB and MMC boards board specific callbacks, how to solve this with OF support?

- changes for v2:
- changes in the nand node due to comments from Scott Wood:
- add "ti,davinci-" prefix
- Dashes are preferred to underscores
- rename "nandflash" to "nand"
- introduce new "ti,davinci" specific properties for setting up ecc_mode, ecc_bits, options and bbt options, instead using linux defines
- changes for i2c due to comments from Sylwester Nawrocki:
- use "cell-index" instead "id"
- OF_DEV_AUXDATA in the machine code, instead pre-define platform device name
- add comment from Grant Likely for i2c:
- removed "id" resp. "cell-index" completely
- fixed documentation
- use of_match_ptr()
- use devm_kzalloc() for allocating plattform data mem
- fixed a whitespace issue
- add net comments from Grant Likely:
- add prefix "ti,davinci-" to davinci specific property names
- remove version property
- use compatible name "ti,davinci-dm6460-emac"
- add comment from Grant Likely:
- rename compatible node
- do not use cell-index
- CONFIG_OF required for this board
TODO:
- create a generic board support file, as I got no answer to my ping to grant, maybe this could be done in a second step?
- changes for v3:
- add comments from Sergei Shtylyov:
- rename compatible" prop to "ti,cp_intc"
- cp_intc_init now used for Interrupt controller init
- changes for v4:
add comment from Nori Sekhar:
- rename davinci emac compatible property to "ti,davinci-dm6467-emac"
- remove "pinmux-handle" property as discussed here:
http://www.spinics.net/lists/arm-kernel/msg175701.html
with Nori Sekhar

- changes for v5:
add comments from Grant Likely:
- rename compatible" prop to "ti,cp-intc"

- changes for v6:
rework this patch, as patch
ARM: davinci: cp_intc: Add OF support for TI interrupt controller was changed from Nori Sekhar on Jul 03, 2012; 9:16pm Changes therefore in this patch:

Call of_irq_init() in the generic DT board file and not in the interrupt controller code. See arch/arm/mach-at91/board-dt.c or arch/arm/mach-omap2/board-generic.c for examples.

At this point the question raises, if we should rename this board port from arch/arm/mach-davinci/enbw_cmc.c to arch/arm/mach-davinci/board-dt.c ? Also the defconfig to davinci_of_defconfig ... ? The USB and MMC callbacks are currently board specific, but if other boards come in, that could be easily adapted for their needs ...

  arch/arm/boot/dts/enbw_cmc.dts                  |  183 +++++++++++
  arch/arm/configs/enbw_cmc_defconfig             |  126 ++++++++
  arch/arm/mach-davinci/Kconfig                   |    9 +
  arch/arm/mach-davinci/Makefile                  |    1 +
  arch/arm/mach-davinci/board-enbw-cmc.c          |  385 +++++++++++++++++++++++
  arch/arm/mach-davinci/include/mach/uncompress.h |    1 +
  6 files changed, 705 insertions(+), 0 deletions(-)
Quoted 3 lines

create mode 100644 arch/arm/boot/dts/enbw_cmc.dts create mode 100644 arch/arm/configs/enbw_cmc_defconfig create mode 100644 arch/arm/mach-davinci/board-enbw-cmc.c

Quoted 5 lines

With the move to DT, we are not going to add more board specific files and defconfigs. I am working on adding a generic dt board file for DA850 (similar to what has been done for imx). That file is not going to do any platform device registrations. If you are OK with it, I will add the dts file for enbw_cmc board in the patch series I am planning to post.

I am fine with that. If you have a working version, you can sent it (if you want) to me, so I can test it on the enbw_cmc board.

Quoted 2 lines

Things like USB and MMC/SD will need to be converted to DT before they can be supported on new boards.

Ok, understood.

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany