From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 22 Mar 2011 11:10:21 -0500 Subject: [U-Boot] [PATCH v6 4/7] jz4740 nand driver In-Reply-To: <4D885997.10607@openmobilefree.net> References: <1298876234-28115-1-git-send-email-xiangfu@openmobilefree.net> <1298876234-28115-2-git-send-email-xiangfu@openmobilefree.net> <1298876234-28115-3-git-send-email-xiangfu@openmobilefree.net> <1298876234-28115-4-git-send-email-xiangfu@openmobilefree.net> <1298876234-28115-5-git-send-email-xiangfu@openmobilefree.net> <20110307174436.6b4c8b21@schlenkerla> <4D885997.10607@openmobilefree.net> Message-ID: <20110322111021.742332ae@schlenkerla> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 22 Mar 2011 16:11:03 +0800 Xiangfu Liu wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 03/08/2011 07:44 AM, Scott Wood wrote: > >> +#if defined(CONFIG_QI_LB60) > >> > +#define KEY_U_OUT (32 * 2 + 16) > >> > +#define KEY_U_IN (32 * 3 + 19) > >> > + __gpio_as_input(KEY_U_IN); > >> > + __gpio_enable_pull(KEY_U_IN); > >> > + __gpio_as_output(KEY_U_OUT); > >> > + __gpio_clear_pin(KEY_U_OUT); > >> > + > >> > + if (__gpio_get_pin(KEY_U_IN) == 0) > >> > + usb_boot(); > >> > +#endif > >> > +#endif > > This stuff does not belong in the NAND driver; it belongs under your board > > or cpu directory. > > > > I have tried to move those 'usb_boot' to board files. the only problem is > I have to run this 'usb_boot' very early. after CPU load the real u-boot to memory > the usb_boot will not working. I will try to found more info about this. > then explain more in next email. OK, so you need to run it during the SPL phase -- but there should be some board/cpu-specific file for the SPL (if not, create one). Current examples of this include nand_spl/board/freescale/p1_p2_rdb/nand_boot.c and arch/powerpc/cpu/mpc83xx/nand_init.c. -Scott