From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 4 May 2009 23:26:12 +0200 Subject: [U-Boot] kb9202/at91rm9200: compiler quirk? In-Reply-To: <20090504181315.GH9523@traven> References: <20090504181315.GH9523@traven> Message-ID: <20090504212612.GA13923@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 20:13 Mon 04 May , Matthias Kaehlcke wrote: > hi, > > i'm trying to do a forward port of the out of tree patches for the > kwikbyte kb9202b. my board is booting and detects the nand flash, but > only in certain circumstances. I've never test the nand on rm9200 as the rm9200ek does not have it but I'll try this > > the hwcontrol function looks like this: > > #define KB9202_NAND_NCE ((unsigned int)1 << 28) /* EN* on D28 */ unsigned int is not needed > > static void kb9202_nand_hwcontrol(struct mtd_info *mtd, int cmd, > unsigned int ctrl) > { > ... > > if (ctrl & NAND_NCE) > AT91C_BASE_PIOB->PIO_CODR = KB9202_NAND_NCE; try writel(KB9202_NAND_NCE, AT91C_BASE_PIOB->PIO_CODR); > else > AT91C_BASE_PIOB->PIO_SODR = KB9202_NAND_NCE; and writel(KB9202_NAND_NCE, AT91C_BASE_PIOB->PIO_SODR); > > ... > } > > the problem is that for some reason the enable signal isn't generated > when using the pre-processor constant KB9202_NAND_NCE. on the other > hand it is generated when using ((unsigned int)1 << 28), instead of > the define. it took me some hours to figure this out ... Best Regards, J.