Re: [PATCH v3 3/4] ARM: dts: dra7: add support for parallel NAND flash

2014-05-06 Thread Tony Lindgren
* Pekon Gupta pe...@ti.com [140422 02:03]:
 +
 +gpmc {
 + status = okay;
 + pinctrl-names = default;
 + pinctrl-0 = nand_flash_x16;
 + ranges = 0 0 0x0800 0x1000;

Here too please use the minimum 16MB GPMC partition for NAND.

 + nand@0,0 {
 + reg = 0 0 0;

And the true IO range size of the device registers here for reg.

Cheers,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/4] ARM: dts: dra7: add support for parallel NAND flash

2014-04-22 Thread Pekon Gupta
From: Minal Shah minalks...@gmail.com

DRA7xx platform has in-build GPMC and ELM h/w engines which can be used
for accessing externel NAND flash device. This patch:
- adds generic DT binding in dra7.dtsi for enabling GPMC and ELM h/w engines
- adds DT binding for Micron NAND Flash (MT29F2G16AADWP) present on dra7-evm
*Important*
On DRA7 EVM, GPMC_WPN and NAND_BOOTn are controlled by DIP switch
So following board settings are required for NAND device detection:
SW5.9 (GPMC_WPN) = LOW
SW5.1 (NAND_BOOTn) = HIGH

Signed-off-by: Minal Shah minalks...@gmail.com
Signed-off-by: Pekon Gupta pe...@ti.com
---
 arch/arm/boot/dts/dra7-evm.dts | 117 +
 arch/arm/boot/dts/dra7.dtsi|  20 +++
 2 files changed, 137 insertions(+)

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 5babba0..7b4e6f5 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -93,6 +93,37 @@
0x24c (PIN_INPUT_SLEW | MUX_MODE0) /* uart3_txd */
;
};
+
+   nand_flash_x16: nand_flash_x16 {
+   /* On DRA7 EVM, GPMC_WPN and NAND_BOOTn comes from DIP switch
+* So NAND flash requires following switch settings:
+* SW5.9 (GPMC_WPN) = LOW
+* SW5.1 (NAND_BOOTn) = HIGH */
+   pinctrl-single,pins = 
+   0x0 (PIN_INPUT  | MUX_MODE0)/* gpmc_ad0 
*/
+   0x4 (PIN_INPUT  | MUX_MODE0)/* gpmc_ad1 
*/
+   0x8 (PIN_INPUT  | MUX_MODE0)/* gpmc_ad2 
*/
+   0xc (PIN_INPUT  | MUX_MODE0)/* gpmc_ad3 
*/
+   0x10(PIN_INPUT  | MUX_MODE0)/* gpmc_ad4 
*/
+   0x14(PIN_INPUT  | MUX_MODE0)/* gpmc_ad5 
*/
+   0x18(PIN_INPUT  | MUX_MODE0)/* gpmc_ad6 
*/
+   0x1c(PIN_INPUT  | MUX_MODE0)/* gpmc_ad7 
*/
+   0x20(PIN_INPUT  | MUX_MODE0)/* gpmc_ad8 
*/
+   0x24(PIN_INPUT  | MUX_MODE0)/* gpmc_ad9 
*/
+   0x28(PIN_INPUT  | MUX_MODE0)/* gpmc_ad10
*/
+   0x2c(PIN_INPUT  | MUX_MODE0)/* gpmc_ad11
*/
+   0x30(PIN_INPUT  | MUX_MODE0)/* gpmc_ad12
*/
+   0x34(PIN_INPUT  | MUX_MODE0)/* gpmc_ad13
*/
+   0x38(PIN_INPUT  | MUX_MODE0)/* gpmc_ad14
*/
+   0x3c(PIN_INPUT  | MUX_MODE0)/* gpmc_ad15
*/
+   0xD8(PIN_INPUT_PULLUP  | MUX_MODE0) /* gpmc_wait0   
*/
+   0xCC(PIN_OUTPUT | MUX_MODE0)/* gpmc_wen 
*/
+   0xB4(PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_csn0
*/
+   0xC4(PIN_OUTPUT | MUX_MODE0)/* 
gpmc_advn_ale */
+   0xC8(PIN_OUTPUT | MUX_MODE0)/* gpmc_oen_ren 
 */
+   0xD0(PIN_OUTPUT | MUX_MODE0)/* 
gpmc_be0n_cle */
+   ;
+   };
 };
 
 i2c1 {
@@ -273,3 +304,89 @@
 cpu0 {
cpu0-supply = smps123_reg;
 };
+
+elm {
+   status = okay;
+};
+
+gpmc {
+   status = okay;
+   pinctrl-names = default;
+   pinctrl-0 = nand_flash_x16;
+   ranges = 0 0 0x0800 0x1000;
+   nand@0,0 {
+   reg = 0 0 0;
+   ti,nand-ecc-opt = bch8;
+   ti,elm-id = elm;
+   nand-bus-width = 16;
+   gpmc,device-width = 2;
+   gpmc,sync-clk-ps = 0;
+   gpmc,cs-on-ns = 0;
+   gpmc,cs-rd-off-ns = 40;
+   gpmc,cs-wr-off-ns = 40;
+   gpmc,adv-on-ns = 0;
+   gpmc,adv-rd-off-ns = 30;
+   gpmc,adv-wr-off-ns = 30;
+   gpmc,we-on-ns = 5;
+   gpmc,we-off-ns = 25;
+   gpmc,oe-on-ns = 2;
+   gpmc,oe-off-ns = 20;
+   gpmc,access-ns = 20;
+   gpmc,wr-access-ns = 40;
+   gpmc,rd-cycle-ns = 40;
+   gpmc,wr-cycle-ns = 40;
+   gpmc,wait-on-read = true;
+   gpmc,wait-on-write = true;
+   gpmc,bus-turnaround-ns = 0;
+   gpmc,cycle2cycle-delay-ns = 0;
+   gpmc,clk-activation-ns = 0;
+   gpmc,wait-monitoring-ns = 0;
+   gpmc,wr-data-mux-bus-ns = 0;
+   /* MTD partition table */
+   /* All SPL-* partitions are sized to minimal length
+* which can be independently programmable. For
+* NAND flash this is equal to size of erase-block */
+   #address-cells = 1;
+   #size-cells = 1;
+   partition@0 {
+