Skip to contentSkip to conversation

8/16 bit support for NAND at runtime

U-Boot Vipin KUMAR 4 participants 7 messages Mar 4, 2010 – Mar 23, 2010

lore
Share & tools
lore
#0 lore raw

Hi All,

This query is wrt NAND 8/16 bit device support at runtime. Currently, the u-boot code can support only one of these at a time.

Although the NAND device in itself can be recognized by reading the device id, the NAND controllers may need different platform specific initializations for different device attached.

The current u-boot is written in such a way that
1. Initializes chip->options for a particular buswidth option
2. calls board_nand_init once and proceeds to read the device id

Although it matches the buswidth selected through chip->options and the the buswidth of device id it reads and returns an error if they don't match, probably a better way can be to reinitialize NAND controller based on 16 bit device and re-read the device id.

This way both type of devices can be supported at runtime

Please let me know your opinion on this.
Please also let me know if I am missing something

Regards
Vipin

#1 lore raw

Dear Vipin KUMAR,

Quoted 3 lines · In message <[email protected]> you wrote:

This query is wrt NAND 8/16 bit device support at runtime. Currently, the u-boot code can support only one of these at a time.

Yes, indeed. I have yet to see a piece of hardware which implements both 8 and 16 bit interfaces on a single board. Hardware designers often have funny ideas, but this seems to be too weird even for them ;-)

Quoted 4 lines

Although it matches the buswidth selected through chip->options and the the buswidth of device id it reads and returns an error if they don't match, probably a better way can be to reinitialize NAND controller based on 16 bit device and re-read the device id.

Why would that be needed? Do you really expect to see both types of interfaces on the same piece of hardware?

Otherwise you just have misconfigured your board, and fixing the configuration should all that is needed to make the code work. Or am I missing something?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A little suffering is good for the soul.
	-- Kirk, "The Corbomite Maneuver", stardate 1514.0
#2 lore raw
Quoted 12 lines · Wolfgang Denk

Dear Vipin KUMAR,

Quoted 3 lines · In message <[email protected]> you wrote:

This query is wrt NAND 8/16 bit device support at runtime. Currently, the u-boot code can support only one of these at a time.

Yes, indeed. I have yet to see a piece of hardware which implements both 8 and 16 bit interfaces on a single board. Hardware designers often have funny ideas, but this seems to be too weird even for them ;-)

Quoted 8 lines
Quoted 4 lines

Although it matches the buswidth selected through chip->options and the the buswidth of device id it reads and returns an error if they don't match, probably a better way can be to reinitialize NAND controller based on 16 bit device and re-read the device id.

Why would that be needed? Do you really expect to see both types of interfaces on the same piece of hardware?

Yes, that's precisely the case with Spear SoC. It has an FSMC controller embedded in it. FSMC can support 8 as well as 16 bit devices(off-course with different initializations) for different banks

Quoted 5 lines

Otherwise you just have misconfigured your board, and fixing the configuration should all that is needed to make the code work. Or am I missing something?

I could make the code work with both 8 as well as 16 bit devices. The only thing is that I have to make a few changes and rebuild the uboot for a particular interface

Quoted 4 lines

Best regards,

Wolfgang Denk

#3 lore raw

Dear Vipin KUMAR,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Why would that be needed? Do you really expect to see both types of interfaces on the same piece of hardware?

Yes, that's precisely the case with Spear SoC. It has an FSMC controller embedded in it. FSMC can support 8 as well as 16 bit devices(off-course with different initializations) for different banks

The fact that it _can_ support different bus widths does not mean that anybody would go on and use both at the same time on the same board.

Do you really have any proof that ther eexisits any piece of hardware that has both an 8 bit and a 16 bit NAND flash on it?

Quoted 7 lines
Quoted 3 lines

Otherwise you just have misconfigured your board, and fixing the configuration should all that is needed to make the code work. Or am I missing something?

I could make the code work with both 8 as well as 16 bit devices. The only thing is that I have to make a few changes and rebuild the uboot for a particular interface

It seems to be no real problem to me when you have to reconfigure U-Boot and build another image when switching to another piece of hardware that is incompatible enough to use different bus widths.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Witch!  Witch!  They'll burn ya!
	-- Hag, "Tomorrow is Yesterday", stardate unknown
#4 lore raw

From: Wolfgang Denk

Quoted 13 lines

Dear Vipin KUMAR,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Why would that be needed? Do you really expect to see both types of interfaces on the same piece of hardware?

Yes, that's precisely the case with Spear SoC. It has an FSMC controller embedded in it. FSMC can support 8 as well as 16 bit devices(off-course with different initializations) for different banks

Quoted 6 lines

The fact that it _can_ support different bus widths does not mean that anybody would go on and use both at the same time on the same board.

Do you really have any proof that ther exisits any piece of hardware that has both an 8 bit and a 16 bit NAND flash on it?

Our internal 85xx system test boards (CTS) have a mux for the local-bus controller chip-select 0 to enable switching between 8-bit and 16-bit NAND devices.

Quoted 4 lines

It seems to be no real problem to me when you have to reconfigure U-Boot and build another image when switching to another piece of hardware that is incompatible enough to use different bus widths.

Yeh, that is what I do now, but it would be nice to have a single image.

-EdS

#5 lore raw
In reply to Wolfgang Denk
Quoted 11 lines · Wolfgang Denk

Dear Vipin KUMAR,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Why would that be needed? Do you really expect to see both types of interfaces on the same piece of hardware?

Yes, that's precisely the case with Spear SoC. It has an FSMC controller embedded in it. FSMC can support 8 as well as 16 bit devices(off-course with different initializations) for different banks

Quoted 6 lines

The fact that it _can_ support different bus widths does not mean that anybody would go on and use both at the same time on the same board.

Do you really have any proof that ther eexisits any piece of hardware that has both an 8 bit and a 16 bit NAND flash on it?

I agree with the above point. This is a board configuration but I am tempted to make a single image because it can be done in the software

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Otherwise you just have misconfigured your board, and fixing the configuration should all that is needed to make the code work. Or am I missing something?

Quoted 8 lines
Quoted 3 lines

I could make the code work with both 8 as well as 16 bit devices. The only thing is that I have to make a few changes and rebuild the uboot for a particular interface

It seems to be no real problem to me when you have to reconfigure U-Boot and build another image when switching to another piece of hardware that is incompatible enough to use different bus widths.

Again, the board config way is also fine with me. I was just thinking that it can be done at runtime also which obviates the need of a different configurations for a NAND device change

Quoted 4 lines

Best regards,

Wolfgang Denk

#6 lore raw
In reply to Vipin KUMAR
Quoted 9 lines · Vipin KUMAR

Hi All,

This query is wrt NAND 8/16 bit device support at runtime. Currently, the u-boot code can support only one of these at a time.

Although the NAND device in itself can be recognized by reading the device id, the NAND controllers may need different platform specific initializations for different device attached.

Quoted 8 lines

The current u-boot is written in such a way that
1. Initializes chip->options for a particular buswidth option
2. calls board_nand_init once and proceeds to read the device id

Although it matches the buswidth selected through chip->options and the the buswidth of device id it reads and returns an error if they don't match, probably a better way can be to reinitialize NAND controller based on 16 bit device and re-read the device id.

At some point I'd like to see u-boot transition to a more flexible NAND init such as what Linux has (nand_scan_ident/nand_scan_tail). These are actually in u-boot now, but they're covered up by less flexible init wrapper code.

That way, it would be up to the controller driver to manage this process. It could try different options if it wants, and only record the successful one in nand_info[]. It could also make changes between the ident phase and the bbt scan based on what the ident reveals, such as page size.

-Scott