* Re: Elan SC520 - problem with MTD [not found] ` <005801c0cbd3$2bdb3c60$4d02010a@lrpeople.com> @ 2001-04-23 9:59 ` Robert Kaiser 2001-04-23 13:10 ` David Woodhouse 2001-04-23 13:45 ` Alex Lennon 0 siblings, 2 replies; 13+ messages in thread From: Robert Kaiser @ 2001-04-23 9:59 UTC (permalink / raw) To: Alexander Melichenko; +Cc: mtd Hi Alexander, On Mon, 23 Apr 2001 you wrote: > Hello Robert! > Thank You very much for Your help. > I worked with kernel 2.2.18 but could not achieve a success. > Now I use Linux kernel 2.4.0 and latest version MTD from CVS. After booting > in /proc/mtd I see : > dev: size erasesize name > mtd0: 00800000 00040000 "SC520CDP Flash Bank #0" > mtd1: 00800000 00040000 "SC520CDP Flash Bank #1" > > Das ist fantastik! > It was a good present for me last week ( my son was born last week!). Well, congratulations to you and your wife then!! > Now I must place a kernel to a flash and booting from it. > What steps should be undertaken to reach that result? One Question: Do you want to keep the BIOS ? If yes, then I have a working solution, but it is not very nice: Some Background info: In order to persuade the BIOS to boot from the Flash, you have to enable it's "disk" emulation: the BIOS can treat each of the flash banks as an emulated disk. So far so good, but: these "disk" functions are only accessible through the BIOS int 13h call, thus, you can't access it from Linux. Worse even, the BIOS insists on doing "wear levelling" (i.e. it tries to distribute erases evenly over all flash blocks). It does this by remapping flash blocks when they have seen to many write erases. Therefore, if you write a continuous stream of data to the flash using the BIOS int13h function, the BIOS will scatter your data all over the flash memory in an unpredictable way. There is no way (other than buying a customized BIOS from General Software) to disable his wear levelling. So the bottom line is: * If you want to use the BIOS to boot from Flash, you must enable it's Disk emulation. * If you use the Disk emulation, you must do all accesses to the boot flash through the BIOS int 13h. * Bootloaders can access the Flash through the BIOS, but Linux can't. Thus you essentially have to sacrifice one of the two banks entirely for booting a kernel from it. Quite a waste considering it has 8 MB. In order to get a bootable (via the BIOS) flash "disk", the easiest way is to put a minimal DOS system on it with your kernel and LOADLIN. You can then run LOADLIN from AUTOEXEC.BAT to boot your Linux Kernel. As I said, this is ugly, but it should work. However, if you want to get rid of the BIOS, you have to write your own startup code for the board, which is not a trivial task. Actually, I'm currently working on something like that, but it is not ready for release yet and I'm making only slow progress as I have about a hundred other things to do. However, I believe, Vipin Malik has gotten this to work for himself. Maybe if you ask him nicely... Cheers Rob ---------------------------------------------------------------- Robert Kaiser email: rkaiser@sysgo.de SYSGO RTS GmbH Am Pfaffenstein 14 phone: (49) 6136 9948-762 D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Elan SC520 - problem with MTD 2001-04-23 9:59 ` Elan SC520 - problem with MTD Robert Kaiser @ 2001-04-23 13:10 ` David Woodhouse 2001-04-23 13:45 ` Alex Lennon 1 sibling, 0 replies; 13+ messages in thread From: David Woodhouse @ 2001-04-23 13:10 UTC (permalink / raw) To: rob; +Cc: Alexander Melichenko, mtd rob@sysgo.de said: > Some Background info: > In order to persuade the BIOS to boot from the Flash, you have to > enable it's "disk" emulation: the BIOS can treat each of the flash > banks as an emulated disk. So far so good, but: these "disk" functions > are only accessible through the BIOS int 13h call, thus, you can't > access it from Linux. > Worse even, the BIOS insists on doing "wear levelling" (i.e. it tries > to distribute erases evenly over all flash blocks). It does this by > remapping flash blocks when they have seen to many write erases. > Therefore, if you write a continuous stream of data to the flash > using the BIOS int13h function, the BIOS will scatter your data all > over the flash memory in an unpredictable way. There is no way (other > than buying a customized BIOS from General Software) to disable his > wear levelling. So the bottom line is: Has nobody tried to reverse-engineer the format they use for this and provide a driver in Linux? See the FTL and NFTL drivers for examples and ideas on how the BIOS might be doing the translation. -- dwmw2 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Elan SC520 - problem with MTD 2001-04-23 9:59 ` Elan SC520 - problem with MTD Robert Kaiser 2001-04-23 13:10 ` David Woodhouse @ 2001-04-23 13:45 ` Alex Lennon 2001-04-23 13:54 ` Robert Kaiser 1 sibling, 1 reply; 13+ messages in thread From: Alex Lennon @ 2001-04-23 13:45 UTC (permalink / raw) To: rob, Alexander Melichenko; +Cc: mtd >> However, if you want to get rid of the BIOS, you have to write your own startup >> code for the board, which is not a trivial task. Actually, I'm currently >> working on something like that, but it is not ready for release yet and I'm >> making only slow progress as I have about a hundred other things to do. >> However, I believe, Vipin Malik has gotten this to work for himself. Maybe if >> you ask him nicely... I this BIOS compressed ? If not you should be able to write a simple BIOS extension to hook INT13h or INT19h. Then when your BIOS proper executes the interrupt your custom BIOS extension code loads your kernel out of linear flash - or do you see a problem with this approach ? Regards, Alex To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Elan SC520 - problem with MTD 2001-04-23 13:45 ` Alex Lennon @ 2001-04-23 13:54 ` Robert Kaiser 2001-04-23 14:26 ` Alex Lennon 0 siblings, 1 reply; 13+ messages in thread From: Robert Kaiser @ 2001-04-23 13:54 UTC (permalink / raw) To: Alex Lennon; +Cc: mtd On Mon, 23 Apr 2001 you wrote: > >> However, if you want to get rid of the BIOS, you have to write your own > startup > >> code for the board, which is not a trivial task. Actually, I'm currently > >> working on something like that, but it is not ready for release yet and > I'm > >> making only slow progress as I have about a hundred other things to do. > >> However, I believe, Vipin Malik has gotten this to work for himself. > Maybe if > >> you ask him nicely... > > I this BIOS compressed ? If not you should be able to write a simple BIOS > extension > to hook INT13h or INT19h. Then when your BIOS proper executes the interrupt > your > custom BIOS extension code loads your kernel out of linear flash - or do you > see a > problem with this approach ? Interesting idea -- a bit like the DOC approach ;-) Though I'm not sure if I understand that BIOS extension part right. As far as I can tell, the BIOS is not compressed, but it occupies the only ROM socket on the board. A BIOS extension would have to be put in a seperate ROM, along with an 0xaa55 header and a checksum so the BIOS calls it, right ? In principle this could work. One would basically have to put part of the MTD code into the BIOS extension to do the flash accesses. Keep in mind though that the BIOS must be entered and left in real-mode (i.e. no access beyond 1MB), so the BIOS extension would have to make the transition to protected mode and back. I've done this a couple of times but this stuff is sooo ugly that I always want to forget all about it immediately after the job is done ;-) To be honest, I don't think this is worth the trouble, I'd rather dump the BIOS completely and write my own startup code. Rob ---------------------------------------------------------------- Robert Kaiser email: rkaiser@sysgo.de SYSGO RTS GmbH Am Pfaffenstein 14 phone: (49) 6136 9948-762 D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Elan SC520 - problem with MTD 2001-04-23 13:54 ` Robert Kaiser @ 2001-04-23 14:26 ` Alex Lennon 2001-04-23 14:43 ` Robert Kaiser 0 siblings, 1 reply; 13+ messages in thread From: Alex Lennon @ 2001-04-23 14:26 UTC (permalink / raw) To: rob; +Cc: mtd Rob, >>Though I'm not sure if I understand that BIOS extension part right. As far as I >>can tell, the BIOS is not compressed, but it occupies the only ROM socket on the >>board. A BIOS extension would have to be put in a seperate ROM, along with an >>0xaa55 header and a checksum so the BIOS calls it, right ? Yes indeed - a cut and paste job with an EPROM burner should do the job, given there is a couple of Kb free up there :-) Alternatively, and I guess this is _particularly_ implementation specific, if the flash array is visible at boot time around 0xC000:0 - DFFF:0 you can put the BIOS extension in the flash array where the BIOS should pick it up >>In principle this could work. One would basically have to put part of the >>MTD code into the BIOS extension to do the flash accesses. Keep in mind though >>that the BIOS must be entered and left in real-mode (i.e. no access beyond >>1MB), so the BIOS extension would have to make the transition to protected mode >>and back. I've done this a couple of times but this stuff is sooo ugly >>that I always want to forget all about it immediately after the job is done ;-) I'm looking at this myself at the moment - the simplest solution is to perform the hook, load a zImage into low mem and let the Linux startup code handle the nasty protected mode bits 'n' pieces. Works fine for me under 2.2. Unfortunately I really can't seem to manage to get 2.4 down to < 500Kb so I need bzImage which means that - yes - there is some protected mode support required. Alternatively it might be possible to throw the kernel up to 0x100000 using 32-bit real mode. I need to check on this.... Regards, Alex To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: Elan SC520 - problem with MTD 2001-04-23 14:26 ` Alex Lennon @ 2001-04-23 14:43 ` Robert Kaiser 2001-04-23 23:07 ` Vipin Malik 0 siblings, 1 reply; 13+ messages in thread From: Robert Kaiser @ 2001-04-23 14:43 UTC (permalink / raw) To: Alex Lennon; +Cc: mtd On Mon, 23 Apr 2001 you wrote: > I'm looking at this myself at the moment - the simplest solution is to > perform the hook, > load a zImage into low mem and let the Linux startup code handle the nasty > protected > mode bits 'n' pieces. Works fine for me under 2.2. Unfortunately I really > can't seem to > manage to get 2.4 down to < 500Kb so I need bzImage which means that - yes - > there is some protected mode support required. Alternatively it might be > possible to > throw the kernel up to 0x100000 using 32-bit real mode. I need to check on > this.... If you're interested in this kind of stuff, have a look at our GPLed ROM loader. ftp://ftp.sysgo.de/pub/elinos/1.0/updates/rolo_1.1_src.tar.gz It loads a bzimage using 32-bit real mode. It is written mostly in C, but it doesn't compile with gcc (you need bcc). Rob ---------------------------------------------------------------- Robert Kaiser email: rkaiser@sysgo.de SYSGO RTS GmbH Am Pfaffenstein 14 phone: (49) 6136 9948-762 D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Elan SC520 - problem with MTD 2001-04-23 14:43 ` Robert Kaiser @ 2001-04-23 23:07 ` Vipin Malik 2001-04-24 7:56 ` Robert Kaiser 0 siblings, 1 reply; 13+ messages in thread From: Vipin Malik @ 2001-04-23 23:07 UTC (permalink / raw) To: rob; +Cc: Alex Lennon, mtd, jffs-dev Wow! Where (and why ;) were your hiding this gem for so long?!!! This is the answer to a lot of maiden's prayers! Robert, are you the "rob" in the CVS Id in the files? Vipin P.S. I saw a couple of mails ago that some folks mentioned that I have successfully booted the linux kernel directly out of flash and installed the JFFS(2) as the root fs (and a ext2 fs as a compressed fs in ramdisk). That is all true. Expect boot the kernel directly out of flash part, everything else is fully documented (some may say "painfully fully" documented) in my HOWTO in the CVS. I have supplied, on request, the files to boot the kernel out of flash. The original source of the hacked kernel boot code to do this was AMD (and it's open source of course). Please let me know if you want those. HOWEVER! The solution is not a very elegant one. It involves making changes to some startup files (bootset.S and setup.S) in the Linux startup code itself. Furthermore it only works with the 2.2.x series and with zImage (not bzImage). Hence i've not put it into CVS. I think, if I understood the capabilities of the linked ftp files below properly, this could be the very elegant solution that we all were looking for. I'll investigate this a bit further. Robert Kaiser wrote: > On Mon, 23 Apr 2001 you wrote: > > I'm looking at this myself at the moment - the simplest solution is to > > perform the hook, > > load a zImage into low mem and let the Linux startup code handle the nasty > > protected > > mode bits 'n' pieces. Works fine for me under 2.2. Unfortunately I really > > can't seem to > > manage to get 2.4 down to < 500Kb so I need bzImage which means that - yes - > > there is some protected mode support required. Alternatively it might be > > possible to > > throw the kernel up to 0x100000 using 32-bit real mode. I need to check on > > this.... > > If you're interested in this kind of stuff, have a look at our GPLed ROM loader. > > ftp://ftp.sysgo.de/pub/elinos/1.0/updates/rolo_1.1_src.tar.gz > > It loads a bzimage using 32-bit real mode. It is written mostly in C, but it > doesn't compile with gcc (you need bcc). > > Rob > > ---------------------------------------------------------------- > Robert Kaiser email: rkaiser@sysgo.de > SYSGO RTS GmbH > Am Pfaffenstein 14 phone: (49) 6136 9948-762 > D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10 > > To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Elan SC520 - problem with MTD 2001-04-23 23:07 ` Vipin Malik @ 2001-04-24 7:56 ` Robert Kaiser 2001-04-24 12:28 ` David Woodhouse [not found] ` <3AE5950D.D10C1F8B@daniel.com> 0 siblings, 2 replies; 13+ messages in thread From: Robert Kaiser @ 2001-04-24 7:56 UTC (permalink / raw) To: Vipin Malik; +Cc: Alex Lennon, mtd, jffs-dev On Die, 24 Apr 2001 you wrote: > Wow! Where (and why ;) were your hiding this gem for so long?!!! It's been there all the time .... > > This is the answer to a lot of maiden's prayers! Robert, are you the "rob" in the > CVS Id in the files? Yep :-) If there is enough public interest in this, maybe I can setup a home page/public CVS for it some day. If only I had more time :-( > P.S. I saw a couple of mails ago that some folks mentioned that I have > successfully booted the linux kernel directly out of flash and installed > the JFFS(2) as the root > fs (and a ext2 fs as a compressed fs in ramdisk). That is all true. > > I have supplied, on request, the files to boot the kernel out of flash. The > original source of the hacked kernel boot code to do this was AMD (and it's > open source of course). > Please let me know if you want those. Yes, please ! > HOWEVER! The solution is not a very > elegant one. > It involves making changes to some startup files (bootset.S and setup.S) in the > Linux startup code itself. I am currently writing code to support booting the SC520 CDP from ROM without BIOS using the above mentioned ROM bootloader (BTW, it's name is "ROLO" :-)). What I'm mostly interested in is the startup/initialization sequence for that board. Once it has been properly initialized, the generic ROLO code should work out of the box. I have some code that does the basic SC520 initialization right after reset and I am now trying to initialize the Super I/O chip (I have just received the chip manual from Acerlabs). After that, I need to figure out a way to setup the set up the PCI bridge... Another thing that is still missing in my code is a proper RAM size detection. So any working code you might have along these lines -no matter how ugly- would probably be helpful to me. Rob ---------------------------------------------------------------- Robert Kaiser email: rkaiser@sysgo.de SYSGO RTS GmbH Am Pfaffenstein 14 phone: (49) 6136 9948-762 D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Elan SC520 - problem with MTD 2001-04-24 7:56 ` Robert Kaiser @ 2001-04-24 12:28 ` David Woodhouse 2001-04-24 14:07 ` Ronald G Minnich [not found] ` <3AE5950D.D10C1F8B@daniel.com> 1 sibling, 1 reply; 13+ messages in thread From: David Woodhouse @ 2001-04-24 12:28 UTC (permalink / raw) To: rob; +Cc: Vipin Malik, Alex Lennon, mtd, jffs-dev, linuxbios rob@sysgo.de said: > I have some code that does the basic SC520 initialization right after > reset and I am now trying to initialize the Super I/O chip (I have > just received the chip manual from Acerlabs). After that, I need to > figure out a way to setup the set up the PCI bridge... Another thing > that is still missing in my code is a proper RAM size detection. > So any working code you might have along these lines -no matter how > ugly- would probably be helpful to me. Talk to the LinuxBIOS people. They have much of this working. -- dwmw2 To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Elan SC520 - problem with MTD 2001-04-24 12:28 ` David Woodhouse @ 2001-04-24 14:07 ` Ronald G Minnich 0 siblings, 0 replies; 13+ messages in thread From: Ronald G Minnich @ 2001-04-24 14:07 UTC (permalink / raw) To: David Woodhouse; +Cc: rob, Vipin Malik, Alex Lennon, mtd, jffs-dev, linuxbios On Tue, 24 Apr 2001, David Woodhouse wrote: > > just received the chip manual from Acerlabs). After that, I need to > > figure out a way to setup the set up the PCI bridge... Another thing > > that is still missing in my code is a proper RAM size detection. > > > So any working code you might have along these lines -no matter how > > ugly- would probably be helpful to me. > > Talk to the LinuxBIOS people. They have much of this working. hi rob, what is it you need to do? ron To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <3AE5950D.D10C1F8B@daniel.com>]
* Re: Boot kernel from flash on CDPSC520 w/o BIOS! [not found] ` <3AE5950D.D10C1F8B@daniel.com> @ 2001-04-27 12:03 ` Alexander Melichenko 2001-04-27 16:57 ` Vipin Malik 0 siblings, 1 reply; 13+ messages in thread From: Alexander Melichenko @ 2001-04-27 12:03 UTC (permalink / raw) To: Vipin Malik; +Cc: mtd Hello, Vipin! To boot kernel from flash I do : - reset the board (z). - init it (yi). - load lstart16.abs to it (ns lstart16.abs ff800, ns lstart16.abs 7ff800). - load zImage to it with offset 0 (ns zImage 0). After that I reboot CDP, but nothing is happening. What step is wrong? Alexander Melichenko. To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Boot kernel from flash on CDPSC520 w/o BIOS! 2001-04-27 12:03 ` Boot kernel from flash on CDPSC520 w/o BIOS! Alexander Melichenko @ 2001-04-27 16:57 ` Vipin Malik 2001-04-28 7:27 ` Alexander Melichenko 0 siblings, 1 reply; 13+ messages in thread From: Vipin Malik @ 2001-04-27 16:57 UTC (permalink / raw) To: Alexander Melichenko; +Cc: mtd Alexander Melichenko wrote: > Hello, Vipin! > To boot kernel from flash I do : > - reset the board (z). > - init it (yi). > - load lstart16.abs to it (ns lstart16.abs ff800, ns lstart16.abs 7ff800). Nope. You need to load the lstart16.abs file to the BIOS FLASH chip, NOT to the FLASH bank0 > > - load zImage to it with offset 0 (ns zImage 0). Where did you init the root fs? Whe zFlashImage boots, it will look to mount the root fs. Also you need to tell zFlah image what the root device is. See the HOWTO for more details. > > After that I reboot CDP, but nothing is happening. > What step is wrong? This is quite a complicated procedure. Make sure that you can read/write the /mtd partitions. Read the HOWTO. Vipin > > > Alexander Melichenko. To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Boot kernel from flash on CDPSC520 w/o BIOS! 2001-04-27 16:57 ` Vipin Malik @ 2001-04-28 7:27 ` Alexander Melichenko 0 siblings, 0 replies; 13+ messages in thread From: Alexander Melichenko @ 2001-04-28 7:27 UTC (permalink / raw) To: Vipin Malik; +Cc: mtd On Friday, April 27, Vipin Malic wrote : > Alexander Melichenko wrote: > > > Hello, Vipin! > > To boot kernel from flash I do : > > - reset the board (z). > > - init it (yi). > > - load lstart16.abs to it (ns lstart16.abs ff800, ns lstart16.abs 7ff800). > > Nope. You need to load the lstart16.abs file to the BIOS FLASH chip, NOT to > the FLASH bank0 > > > > > - load zImage to it with offset 0 (ns zImage 0). > > Where did you init the root fs? Whe zFlashImage boots, it will look to mount > the root fs. Also you need to > tell zFlah image what the root device is. See the HOWTO for more details. > > > > > After that I reboot CDP, but nothing is happening. > > What step is wrong? > > This is quite a complicated procedure. Make sure that you can read/write the > /mtd partitions. Read the HOWTO. > Hello, Vipin! Are the next steps correct? - put lstart16.abs to 29F040 flash with offset 40000 (ns lstart16.abs 40000); - put zImage to 29LV017 bank0 with offset 0 (???). - put zFlash (root file system) to 29LV017 bank1 with offset 0 (???). - rdev /dev/mtdblock?? /dev/mtdblock??. - rdev -R zImage 0. I experimented with that and other options, but currently result is bad. Thank You. Alexander. To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2001-04-28 8:27 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.21.0104161208120.12472-100000@dagobert.svc.sysgo.de>
[not found] ` <01041713245700.01481@rob>
[not found] ` <005801c0cbd3$2bdb3c60$4d02010a@lrpeople.com>
2001-04-23 9:59 ` Elan SC520 - problem with MTD Robert Kaiser
2001-04-23 13:10 ` David Woodhouse
2001-04-23 13:45 ` Alex Lennon
2001-04-23 13:54 ` Robert Kaiser
2001-04-23 14:26 ` Alex Lennon
2001-04-23 14:43 ` Robert Kaiser
2001-04-23 23:07 ` Vipin Malik
2001-04-24 7:56 ` Robert Kaiser
2001-04-24 12:28 ` David Woodhouse
2001-04-24 14:07 ` Ronald G Minnich
[not found] ` <3AE5950D.D10C1F8B@daniel.com>
2001-04-27 12:03 ` Boot kernel from flash on CDPSC520 w/o BIOS! Alexander Melichenko
2001-04-27 16:57 ` Vipin Malik
2001-04-28 7:27 ` Alexander Melichenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox