* [U-Boot] IMX27 nand_probe problem
@ 2009-01-13 21:16 Alessandro Chies
2009-02-08 12:30 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Chies @ 2009-01-13 21:16 UTC (permalink / raw)
To: u-boot
Good morning,
I'm try to port uboot on a my board imx27 based. It has only DDR RAM and a
NAND flash.
UBoot runs very well (if i don't activate the NAND) compiling it and
uploading the bin directly to the processor via serial boot.
If I activate the NAND support and try to intialize driver and device
"nand0", I have a hang-up of the microprocessor in the probe function when
it trys "tmp=readw(0xd8000e1a)".
If I read with a "md 0xe8000e1a+0x02" from the uboot command line I don't
have hangs (of course without the nand device registration).
What could it be hanging me on this?
Thanks in advance.
Alessandro
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] IMX27 NAND Probe Problem
@ 2009-01-14 22:25 Alessandro Chies
0 siblings, 0 replies; 3+ messages in thread
From: Alessandro Chies @ 2009-01-14 22:25 UTC (permalink / raw)
To: u-boot
Hello again, I would like to add more infos on my problem:
When I try to register the device nand0, the call stack arrives to the
function in the file nand-imx.c in uboot v2.
static int __init imxnd_probe(struct device_d *dev)
{
struct nand_chip *this;
struct mtd_info *mtd;
struct imx_nand_platform_data *pdata = dev->platform_data;
struct imx_nand_host *host;
u16 tmp;
int err = 0;
#ifdef CONFIG_ARCH_MX27
PCCR1 |= PCCR1_NFC_BAUDEN;
#endif
/* Allocate memory for MTD device structure and private data
*/
host = kzalloc(sizeof(struct imx_nand_host), GFP_KERNEL);
if (!host)
return -ENOMEM;
host->dev = dev;
/* structures must be linked */
this = &host->nand;
mtd = &host->mtd;
mtd->priv = this;
/* 50 us command delay time */
this->chip_delay = 5;
this->priv = host;
this->dev_ready = imx_nand_dev_ready;
this->cmdfunc = imx_nand_command;
this->select_chip = imx_nand_select_chip;
this->read_byte = imx_nand_read_byte;
this->read_word = imx_nand_read_word;
this->write_buf = imx_nand_write_buf;
this->read_buf = imx_nand_read_buf;
this->verify_buf = imx_nand_verify_buf;
#if 0
host->clk = clk_get(&pdev->dev, "nfc_clk");
if (IS_ERR(host->clk))
goto eclk;
clk_enable(host->clk);
#endif
host->regs = (void __iomem *)dev->map_base;
tmp = readw(host->regs + NFC_CONFIG1);
tmp |= NFC_INT_MSK;
writew(tmp, host->regs + NFC_CONFIG1);
.
And it locks at tmp = readw(host->regs + NFC_CONFIG1);
If I exclude the nand, UBoot boots up very well from RAM but If I try
Md 0xd8000e1a+0x2
I receive a value that is not real (most of the times, the result of the
previous md instruction).
Please, can someone give me any type of help on what is happening?
Best regards
Alessandro
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] IMX27 nand_probe problem
2009-01-13 21:16 [U-Boot] IMX27 nand_probe problem Alessandro Chies
@ 2009-02-08 12:30 ` Sascha Hauer
0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2009-02-08 12:30 UTC (permalink / raw)
To: u-boot
Hi,
When writing about U-Boot-V2 please Cc me as I do not read this list as
regularly as I should.
On Tue, Jan 13, 2009 at 10:16:24PM +0100, Alessandro Chies wrote:
> Good morning,
> I'm try to port uboot on a my board imx27 based. It has only DDR RAM and a
> NAND flash.
> UBoot runs very well (if i don't activate the NAND) compiling it and
> uploading the bin directly to the processor via serial boot.
> If I activate the NAND support and try to intialize driver and device
> "nand0", I have a hang-up of the microprocessor in the probe function when
> it trys "tmp=readw(0xd8000e1a)".
> If I read with a "md 0xe8000e1a+0x02" from the uboot command line I don't
> have hangs (of course without the nand device registration).
> What could it be hanging me on this?
Have you checked the address? Is host->regs really set to the correct
value? Also, md does a 32bit access by default. To do 16bit accesses use
md -w. The area might not be accessible when the corresponding clock is
not turned on, but this should be done some lines above with
PCCR1 |= PCCR1_NFC_BAUDEN. The clock may be dependent on some other
clock, you could insert a PCCR0 = 0xffffffff; PCCR1 = 0xffffffff to turn
on all possible clocks to see if this is the reason.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-08 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 22:25 [U-Boot] IMX27 NAND Probe Problem Alessandro Chies
-- strict thread matches above, loose matches on Subject: below --
2009-01-13 21:16 [U-Boot] IMX27 nand_probe problem Alessandro Chies
2009-02-08 12:30 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox