Re: iMX233 and Flash

Started by jlumme, September 19, 2012, 04:12:30 AM

Previous topic - Next topic

jlumme

I'm sorry to piggyback this thread a bit, but this is very close to a question I have..

First, my target: We have ordered Maxi board, as a reference platform for our project.
Now, as with many of these linux on arm projects, most of them boot from SD card. In our finished project, we were thinking of moving our kernel and filesystem to flash, and boot from there. We want to bitbake our own simple linux kernel, and use busybox for basis of our rootfs.

whophlungpoo or olimex, may I ask if you see any flaws in my thinking here ? Would we have to take care of anything else, except just use bitburner, to change the boot device from mmc to flash ?
Me and my friend are very new to this, and this is our first "full blown linux project", so any tips you have, are welcome..

Kean

@jlumme

What you describe should be quite possible, although I haven't tried it.  If you look at the Maxi board documentation, on page 50 it lists jumper settings that allow boot device selection.  Default it SD/MMC 1, but you can change it to one of two SPI Flash.  You should read the Freescale i.MX23 Reference Manual for more info on boot modes.  Many Internet routers (e.g. TP-LINK) are set up this way to boot from SPI flash, although I haven't come across one using the i.MX233 chip.

Kean

davidjf2001

Sounds like you should use the i.MX23 EVK as a reference point. At least look at the documentation and kernel builds for it.

jlumme

Hi,

First, once again whophlungpoo, I'm sorry to kind of hijack your thread - hopefully some good learning comes out of it ;)

Kean, thanks for the tip, I actually hadn't read manual so far yet ;) (The board is still in mail)
But indeed, that looks like what I need.

May I ask you, if you have experience on this kind of thing - how should I arrange flash? Is there some good instructions/books you would recommend me?
I have led myself to think that most important thing is that loader has to reside in a specific address (on flash). After that, loader needs input on from which address start loading second stage loader or kernel, so that's already a loader issue..
Can I just move the loader that is used for those mmc card images to flash [address], and then if it loads fine, just point to kernel start address that I have also moved to the flash ?

Regarding connecting flash chip itself.. how does one know which line is "SPI flash 1 master" ? According to i.mx23 documentation, there exists a general-purpose media interface (GPMI), to which flash ic's should be connected.
But, how does one state information to the system, that "flash chip with this specifications (block size etc), connected to these SPI lines" ? I don't understand how otherwise the boot mode selector could work.. 
Sorry for so many questions.. it's a lot of learning for us still.

davidjf2001, yes we looked at that as well, but at 4 times the price (and we need one for each), we decided to start working with maxi board instead..
But, I will definitely read through that documentation, I'm sure it will be useful!

Thanks for your time!

Kean

Quote from: jlumme on September 20, 2012, 03:50:40 AM
May I ask you, if you have experience on this kind of thing - how should I arrange flash? Is there some good instructions/books you would recommend me?

Sorry, no real experience (yet), just some ideas on how I think it actually works.
The Freescale docs, especially for the EVM, would be your best source of info.

davidjf2001

To me "reference platform" means you will design your own board basically copying pieces you want from the  "reference" design.  If you are basing your project on the Olimex board, that is different.  Clearly the Olimex board is more economical, I think it even has better tempurature specs.  Using Freescales "reference design" however means you will have a lot of documentation available from Freescale or from several other places.  The various embedded linux builds will have more info on the freescale design than the olimex design.  There will also likely be details about flash layout for different devices.  For a beginner you are starting at one of the hardest places, it is best to copy someone else's work.  BTW booting from SD cards is much faster than booting from (SPI) flash.

jlumme

Quote from: davidjf2001 on September 21, 2012, 10:39:20 PM
To me "reference platform" means you will design your own board basically copying pieces you want from the  "reference" design.  If you are basing your project on the Olimex board, that is different.  Clearly the Olimex board is more economical, I think it even has better tempurature specs.  Using Freescales "reference design" however means you will have a lot of documentation available from Freescale or from several other places.  The various embedded linux builds will have more info on the freescale design than the olimex design.  There will also likely be details about flash layout for different devices.  For a beginner you are starting at one of the hardest places, it is best to copy someone else's work.  BTW booting from SD cards is much faster than booting from (SPI) flash.

Hi davidjf2001,
I understand, and agree on your writing about a reference design. But for us cost is still an issue we have to put some thought into, and thus we decided to start working on this board as the starting point. It has 90% of the components already there, so we felt that last 10% didn't warrant 4x the price / board
Besides, how hard can it be ? :)

I have been reading through Embedded Linux Primer from Prentice&Hall, and I feel that I am slowly starting to get the parts of the puzzle together.. There are some things that I still don't understand, but booting a board from specific media, seems to be mostly a configuration question in the loader.
I just need to figure out what is the way to physically connect flash to it, and then how to reconfigure the loader.

But obviously I will need to go through the Freescale board design, and try to figure out what is different in that, and olimex board..

I would be happy about any other possible tips you could have.

Kean, thank you also for your comment, it seems to be in line with Davids

whophlungpoo

Let us know if you get anywhere with this, I think it would be awesome if we could boot u-boot from a flash device and have it look for USB thumb drives or even a hard drive to boot from......

jlumme

Sure - I'm waiting for flash samples to arrive, and I will start hacking.
I've decided to go with SPI interface, so that I can easily create a flash writing interface as well (well, at least thats the plan)

olimex

what amount of SPI flash you would add? as Linux image on the SD card is hundreds of MB

jlumme

Olimex, actually we're going to a very small size, our first try will be with 64mbit.
We don't have any need to run a real distribution, so our plan is to go with busybox, and of course our application binaries.

But this is our first attempt at this kind of thing (=so actually I'm not yet sure how much I will have to build into the kernel, also only the engine of our application is working, so space will be needed there as well), so maybe we will have to re-think something, but this is our current starting point.
It's still a very much learning/work in progress :)