From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthieu CASTET Subject: Re: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support. Date: Wed, 27 Apr 2011 14:38:02 +0200 Message-ID: <4DB80E2A.4000203@parrot.com> References: <1302938249-4601-1-git-send-email-mnalajal@codeaurora.org> <4DABE8FE.5040300@parrot.com> <4DB6C13F.2020402@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from co202.xi-lite.net ([149.6.83.202]:39984 "EHLO co202.xi-lite.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756259Ab1D0Mii (ORCPT ); Wed, 27 Apr 2011 08:38:38 -0400 In-Reply-To: <4DB6C13F.2020402@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Murali Nalajala Cc: "dwmw2@infradead.org" , "linux-arm-msm@vger.kernel.org" , Dima Zavin , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Brian Swetland , "linux-mtd@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" Hi, Murali Nalajala a =C3=A9crit : > On 4/18/2011 1:02 PM, Matthieu CASTET wrote: >> Hi, >> >> Murali Nalajala a =C3=A9crit : >>> Add initial msm nand driver support for Qualcomm MSM platforms. >>> This driver is capable of handling both 2k and 4k page support >>> nand devices. >>> >>> This driver was originally developed by Arve Hj=C3=B8nnev=C3=A5g at= google. >>> Its source is available at >>> http://android.git.kernel.org/?p=3Dkernel/msm.git under >>> android-msm-2.6.35 branch. >>> >>> CC: Dima Zavin >>> CC: Brian Swetland >>> CC: Arve Hj=C3=B8nnev=C3=A5g >>> Signed-off-by: Murali Nalajala >>> --- >>> Changes in V2 >>> * Turn most of the pr_info() calls into pr_debug(). >>> >>> drivers/mtd/devices/Kconfig | 11 + >>> drivers/mtd/devices/Makefile | 1 + >>> drivers/mtd/devices/msm_nand.c | 1597 +++++++++++++++++++++++++++= +++++++++++++ >>> drivers/mtd/devices/msm_nand.h | 77 ++ >>> 4 files changed, 1686 insertions(+), 0 deletions(-) >>> create mode 100644 drivers/mtd/devices/msm_nand.c >>> create mode 100644 drivers/mtd/devices/msm_nand.h >>> >> For the record, I am not sure it is a great idea to make nand driver= s >> independent of the nand layer. >> By doing that you could change the expected behavior, and introduce = bug >> difficult to debug. >> >> Why do you need that ? Nand drivers can override callbacks of nand f= ramework. >> >> Maybe because the nand layer call the driver page per page, and you= want to >> work with more than one page. But in this case you can extend nand l= ayer. >> >> Or does your controller don't allow sending raw command ? >> And in that case all the nand logic is in the nand controller ? >=20 > Our controller doesn't allow sending RAW commands to the flash. All=20 > these commands are abstracted by the controller logic. Please refer t= he=20 > msm_nand.h file where you will find the commands which are different=20 > from the actual NAND device commands. Ok, but does the controller does all other check : status check, ... In the nand framework there is already controller like yours : see the = denali.c as example. >=20 > eg: To send read/write data command to the device we configure the=20 > controller with page address & controller specific command. Then the=20 > controller itself takes care of generating the internal h/w signals=20 > required by the flash and it polls for the R/B signal & wait states a= re=20 > internally controlled by the h/w. >=20 So you provide your own chip->ecc.read_page chip->ecc.read_page_raw chip->ecc.read_oob chip->write_page chip->ecc.write_oob and your done. Matthieu From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4DB80E2A.4000203@parrot.com> Date: Wed, 27 Apr 2011 14:38:02 +0200 From: Matthieu CASTET MIME-Version: 1.0 To: Murali Nalajala Subject: Re: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support. References: <1302938249-4601-1-git-send-email-mnalajal@codeaurora.org> <4DABE8FE.5040300@parrot.com> <4DB6C13F.2020402@codeaurora.org> In-Reply-To: <4DB6C13F.2020402@codeaurora.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: "linux-arm-msm@vger.kernel.org" , Dima Zavin , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , "linux-mtd@lists.infradead.org" , Brian Swetland , "dwmw2@infradead.org" , "linux-arm-kernel@lists.infradead.org" List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi, Murali Nalajala a écrit : > On 4/18/2011 1:02 PM, Matthieu CASTET wrote: >> Hi, >> >> Murali Nalajala a écrit : >>> Add initial msm nand driver support for Qualcomm MSM platforms. >>> This driver is capable of handling both 2k and 4k page support >>> nand devices. >>> >>> This driver was originally developed by Arve Hjønnevåg at google. >>> Its source is available at >>> http://android.git.kernel.org/?p=kernel/msm.git under >>> android-msm-2.6.35 branch. >>> >>> CC: Dima Zavin >>> CC: Brian Swetland >>> CC: Arve Hjønnevåg >>> Signed-off-by: Murali Nalajala >>> --- >>> Changes in V2 >>> * Turn most of the pr_info() calls into pr_debug(). >>> >>> drivers/mtd/devices/Kconfig | 11 + >>> drivers/mtd/devices/Makefile | 1 + >>> drivers/mtd/devices/msm_nand.c | 1597 ++++++++++++++++++++++++++++++++++++++++ >>> drivers/mtd/devices/msm_nand.h | 77 ++ >>> 4 files changed, 1686 insertions(+), 0 deletions(-) >>> create mode 100644 drivers/mtd/devices/msm_nand.c >>> create mode 100644 drivers/mtd/devices/msm_nand.h >>> >> For the record, I am not sure it is a great idea to make nand drivers >> independent of the nand layer. >> By doing that you could change the expected behavior, and introduce bug >> difficult to debug. >> >> Why do you need that ? Nand drivers can override callbacks of nand framework. >> >> Maybe because the nand layer call the driver page per page, and you want to >> work with more than one page. But in this case you can extend nand layer. >> >> Or does your controller don't allow sending raw command ? >> And in that case all the nand logic is in the nand controller ? > > Our controller doesn't allow sending RAW commands to the flash. All > these commands are abstracted by the controller logic. Please refer the > msm_nand.h file where you will find the commands which are different > from the actual NAND device commands. Ok, but does the controller does all other check : status check, ... In the nand framework there is already controller like yours : see the denali.c as example. > > eg: To send read/write data command to the device we configure the > controller with page address & controller specific command. Then the > controller itself takes care of generating the internal h/w signals > required by the flash and it polls for the R/B signal & wait states are > internally controlled by the h/w. > So you provide your own chip->ecc.read_page chip->ecc.read_page_raw chip->ecc.read_oob chip->write_page chip->ecc.write_oob and your done. Matthieu From mboxrd@z Thu Jan 1 00:00:00 1970 From: matthieu.castet@parrot.com (Matthieu CASTET) Date: Wed, 27 Apr 2011 14:38:02 +0200 Subject: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support. In-Reply-To: <4DB6C13F.2020402@codeaurora.org> References: <1302938249-4601-1-git-send-email-mnalajal@codeaurora.org> <4DABE8FE.5040300@parrot.com> <4DB6C13F.2020402@codeaurora.org> Message-ID: <4DB80E2A.4000203@parrot.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, Murali Nalajala a ?crit : > On 4/18/2011 1:02 PM, Matthieu CASTET wrote: >> Hi, >> >> Murali Nalajala a ?crit : >>> Add initial msm nand driver support for Qualcomm MSM platforms. >>> This driver is capable of handling both 2k and 4k page support >>> nand devices. >>> >>> This driver was originally developed by Arve Hj?nnev?g at google. >>> Its source is available at >>> http://android.git.kernel.org/?p=kernel/msm.git under >>> android-msm-2.6.35 branch. >>> >>> CC: Dima Zavin >>> CC: Brian Swetland >>> CC: Arve Hj?nnev?g >>> Signed-off-by: Murali Nalajala >>> --- >>> Changes in V2 >>> * Turn most of the pr_info() calls into pr_debug(). >>> >>> drivers/mtd/devices/Kconfig | 11 + >>> drivers/mtd/devices/Makefile | 1 + >>> drivers/mtd/devices/msm_nand.c | 1597 ++++++++++++++++++++++++++++++++++++++++ >>> drivers/mtd/devices/msm_nand.h | 77 ++ >>> 4 files changed, 1686 insertions(+), 0 deletions(-) >>> create mode 100644 drivers/mtd/devices/msm_nand.c >>> create mode 100644 drivers/mtd/devices/msm_nand.h >>> >> For the record, I am not sure it is a great idea to make nand drivers >> independent of the nand layer. >> By doing that you could change the expected behavior, and introduce bug >> difficult to debug. >> >> Why do you need that ? Nand drivers can override callbacks of nand framework. >> >> Maybe because the nand layer call the driver page per page, and you want to >> work with more than one page. But in this case you can extend nand layer. >> >> Or does your controller don't allow sending raw command ? >> And in that case all the nand logic is in the nand controller ? > > Our controller doesn't allow sending RAW commands to the flash. All > these commands are abstracted by the controller logic. Please refer the > msm_nand.h file where you will find the commands which are different > from the actual NAND device commands. Ok, but does the controller does all other check : status check, ... In the nand framework there is already controller like yours : see the denali.c as example. > > eg: To send read/write data command to the device we configure the > controller with page address & controller specific command. Then the > controller itself takes care of generating the internal h/w signals > required by the flash and it polls for the R/B signal & wait states are > internally controlled by the h/w. > So you provide your own chip->ecc.read_page chip->ecc.read_page_raw chip->ecc.read_oob chip->write_page chip->ecc.write_oob and your done. Matthieu