* [U-Boot] Is there a better way? @ 2010-04-20 19:01 Chris Rigg 2010-04-20 19:59 ` Ira W. Snyder 2010-04-20 21:50 ` Wolfgang Denk 0 siblings, 2 replies; 7+ messages in thread From: Chris Rigg @ 2010-04-20 19:01 UTC (permalink / raw) To: u-boot Hello, I have a general design question and I can't think of a better forum than this one to ask it in. Let me know if this is not the right place to ask. My environment: I have an embedded system (u-boot/Embedded Linux) running on a PPC440 and configured as a target over a PCI bus. My host is a Linux server and I communicate over the PCI bus to it using the I2O messaging interface the PPC provides. I am making the entire 256MB of SDRAM on my board accessible over the PCI bus to the host. I have no persistent storage on my board (other than flash) that I can use to store log files that my embedded system produces. I have Linux running on the PPC with the filesystem in ram as a ramdisk. My goal: I need a way to get the files from the ramdisk on the PPC to the host over PCI. My solution: The best idea I could come up with was to map in the PPC's ramdisk memory on the host and then read it like I would a normal ext2 filesystem. For example, let's say the ramdisk is 1MB in size. I would simply map in that 1MB on the host side over the PCI bus. And then have a ext2 filesystem reader tool that can look at the filesystem and extract the log files I mentioned earlier. It would be like NFS but over PCI instead of ethernet. My problem: If I have an in-memory filesystem on my board (the ramdisk), and I have the entire 256MB of memory accessible to the host over the PCI bus, you'd think I could write a tool (or find a tool) that I could point at a block of physical memory and have it recognize it as an ext2 filesystem and read it as such. Unfortunately, there doesn't appear to be a precedent for doing this. Is there a better way to accomplish my goal of getting my logs off the ramdisk on the board from the host? Thanks in advance. Any advice/help/suggestions are greatly appreciated. Chris ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 19:01 [U-Boot] Is there a better way? Chris Rigg @ 2010-04-20 19:59 ` Ira W. Snyder 2010-04-20 21:37 ` Scott McNutt 2010-04-20 21:50 ` Wolfgang Denk 1 sibling, 1 reply; 7+ messages in thread From: Ira W. Snyder @ 2010-04-20 19:59 UTC (permalink / raw) To: u-boot On Tue, Apr 20, 2010 at 01:01:39PM -0600, Chris Rigg wrote: > Hello, > > I have a general design question and I can't think of a better forum than > this one to ask it in. Let me know if this is not the right place to ask. > > My environment: > I have an embedded system (u-boot/Embedded Linux) running on a PPC440 and > configured as a target over a PCI bus. My host is a Linux server and I > communicate over the PCI bus to it using the I2O messaging interface the PPC > provides. I am making the entire 256MB of SDRAM on my board accessible over > the PCI bus to the host. I have no persistent storage on my board (other > than flash) that I can use to store log files that my embedded system > produces. I have Linux running on the PPC with the filesystem in ram as a > ramdisk. > > My goal: > I need a way to get the files from the ramdisk on the PPC to the host over > PCI. > > My solution: > The best idea I could come up with was to map in the PPC's ramdisk memory on > the host and then read it like I would a normal ext2 filesystem. For > example, let's say the ramdisk is 1MB in size. I would simply map in that > 1MB on the host side over the PCI bus. And then have a ext2 filesystem > reader tool that can look at the filesystem and extract the log files I > mentioned earlier. It would be like NFS but over PCI instead of ethernet. > > My problem: > If I have an in-memory filesystem on my board (the ramdisk), and I have the > entire 256MB of memory accessible to the host over the PCI bus, you'd think > I could write a tool (or find a tool) that I could point at a block of > physical memory and have it recognize it as an ext2 filesystem and read it > as such. Unfortunately, there doesn't appear to be a precedent for doing > this. Is there a better way to accomplish my goal of getting my logs off the > ramdisk on the board from the host? > > Thanks in advance. Any advice/help/suggestions are greatly appreciated. > I've solved a relatively similar problem here. I have a mpc8349emds-based board that is a PCI target. I've written a couple of smallish drivers for U-Boot and Linux that make the board seem like an ethernet interface. This was all done through a 4KB section of the target's SDRAM exposed as a PCI BAR to the host system, plus the "doorbell registers" that the 83xx uses to generate interrupts on the PCI bus. I then attach all of the ethernet devices together on a Linux ethernet bridge (see the brctl command in your distro). Now everything is ethernet, and you can use NFS. In our case we use syslog-ng, logging to a remote server on our ethernet. We tftp our kernel and boot our board over NFS using the "ethernet" interface. So there is one alternative solution. Ira ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 19:59 ` Ira W. Snyder @ 2010-04-20 21:37 ` Scott McNutt 2010-04-20 22:03 ` Chris Rigg 0 siblings, 1 reply; 7+ messages in thread From: Scott McNutt @ 2010-04-20 21:37 UTC (permalink / raw) To: u-boot Hi Chris, Ira W. Snyder wrote: >> My problem: >> If I have an in-memory filesystem on my board (the ramdisk), and I have the >> entire 256MB of memory accessible to the host over the PCI bus, you'd think >> I could write a tool (or find a tool) that I could point at a block of >> physical memory and have it recognize it as an ext2 filesystem and read it >> as such. Unfortunately, there doesn't appear to be a precedent for doing >> this. Is there a better way to accomplish my goal of getting my logs off the >> ramdisk on the board from the host? >> > > I've solved a relatively similar problem here. I have a > mpc8349emds-based board that is a PCI target. I've written a couple of > smallish drivers for U-Boot and Linux that make the board seem like an > ethernet interface. Ditto. Ira's suggestion is a very elegant and useful technique ... and has been used successfully for many applications. > We tftp our kernel and boot our board over NFS using the "ethernet" > interface. As Ira suggests, once your target appears as an addressable host, the sky's the limit. You can telnet/ssh into your target, run tftpd, run a web server for configuration/status, etc. Cool stuff! Regards, --Scott ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 21:37 ` Scott McNutt @ 2010-04-20 22:03 ` Chris Rigg 2010-04-20 22:47 ` Ira W. Snyder 0 siblings, 1 reply; 7+ messages in thread From: Chris Rigg @ 2010-04-20 22:03 UTC (permalink / raw) To: u-boot Thanks guys. I'll take a look at this in more depth. It sounds like this would be the suggested solution to my problem. Is there an example somewhere that you could point me towards? On Tue, Apr 20, 2010 at 3:37 PM, Scott McNutt <smcnutt@psyent.com> wrote: > Hi Chris, > > Ira W. Snyder wrote: > >> My problem: >>> If I have an in-memory filesystem on my board (the ramdisk), and I have >>> the >>> entire 256MB of memory accessible to the host over the PCI bus, you'd >>> think >>> I could write a tool (or find a tool) that I could point at a block of >>> physical memory and have it recognize it as an ext2 filesystem and read >>> it >>> as such. Unfortunately, there doesn't appear to be a precedent for doing >>> this. Is there a better way to accomplish my goal of getting my logs off >>> the >>> ramdisk on the board from the host? >>> >>> >> I've solved a relatively similar problem here. I have a >> mpc8349emds-based board that is a PCI target. I've written a couple of >> smallish drivers for U-Boot and Linux that make the board seem like an >> ethernet interface. >> > > Ditto. Ira's suggestion is a very elegant and useful technique ... and > has been used successfully for many applications. > > > We tftp our kernel and boot our board over NFS using the "ethernet" >> interface. >> > > As Ira suggests, once your target appears as an addressable host, the > sky's the limit. You can telnet/ssh into your target, run tftpd, > run a web server for configuration/status, etc. Cool stuff! > > Regards, > --Scott > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 22:03 ` Chris Rigg @ 2010-04-20 22:47 ` Ira W. Snyder 0 siblings, 0 replies; 7+ messages in thread From: Ira W. Snyder @ 2010-04-20 22:47 UTC (permalink / raw) To: u-boot On Tue, Apr 20, 2010 at 04:03:01PM -0600, Chris Rigg wrote: > Thanks guys. I'll take a look at this in more depth. It sounds like this > would be the suggested solution to my problem. > > Is there an example somewhere that you could point me towards? > As this is a bit off-topic on this list, I'll reply to you with the patches attached. If anyone else wants the code, please ask me. Linux is seriously lacking a general purpose solution here. I've made some attempts at writing one, but haven't had the time to complete them. I'm happy to test a general solution anyone comes up with. I've been suggested that virtio would be a good choice here, since they have a highly optimized network driver. Ira > On Tue, Apr 20, 2010 at 3:37 PM, Scott McNutt <smcnutt@psyent.com> wrote: > > > Hi Chris, > > > > Ira W. Snyder wrote: > > > >> My problem: > >>> If I have an in-memory filesystem on my board (the ramdisk), and I have > >>> the > >>> entire 256MB of memory accessible to the host over the PCI bus, you'd > >>> think > >>> I could write a tool (or find a tool) that I could point at a block of > >>> physical memory and have it recognize it as an ext2 filesystem and read > >>> it > >>> as such. Unfortunately, there doesn't appear to be a precedent for doing > >>> this. Is there a better way to accomplish my goal of getting my logs off > >>> the > >>> ramdisk on the board from the host? > >>> > >>> > >> I've solved a relatively similar problem here. I have a > >> mpc8349emds-based board that is a PCI target. I've written a couple of > >> smallish drivers for U-Boot and Linux that make the board seem like an > >> ethernet interface. > >> > > > > Ditto. Ira's suggestion is a very elegant and useful technique ... and > > has been used successfully for many applications. > > > > > > We tftp our kernel and boot our board over NFS using the "ethernet" > >> interface. > >> > > > > As Ira suggests, once your target appears as an addressable host, the > > sky's the limit. You can telnet/ssh into your target, run tftpd, > > run a web server for configuration/status, etc. Cool stuff! > > > > Regards, > > --Scott > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 19:01 [U-Boot] Is there a better way? Chris Rigg 2010-04-20 19:59 ` Ira W. Snyder @ 2010-04-20 21:50 ` Wolfgang Denk 2010-04-20 22:06 ` Chris Rigg 1 sibling, 1 reply; 7+ messages in thread From: Wolfgang Denk @ 2010-04-20 21:50 UTC (permalink / raw) To: u-boot Dear Chris Rigg, In message <k2m7753e5291004201201u401d9a82xa172216f44d6312b@mail.gmail.com> you wrote: > > My goal: > I need a way to get the files from the ramdisk on the PPC to the host over > PCI. Design an interface. Or use an existing one. > My solution: > The best idea I could come up with was to map in the PPC's ramdisk memory on > the host and then read it like I would a normal ext2 filesystem. For > example, let's say the ramdisk is 1MB in size. I would simply map in that > 1MB on the host side over the PCI bus. And then have a ext2 filesystem > reader tool that can look at the filesystem and extract the log files I > mentioned earlier. It would be like NFS but over PCI instead of ethernet. You mean you want to do this while the file system is active, i. e. while it is being used by the Linux running on the PPC with the filesystem mounted? You will run into serious trouble, quickly, as the information in the ramdisk is most likely inconsistent, incomplete, and changing. Keep in mind that Linux caches both data and meta-data. Best regards, Wolfgang Denk -- 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 Respect is a rational process -- McCoy, "The Galileo Seven", stardate 2822.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] Is there a better way? 2010-04-20 21:50 ` Wolfgang Denk @ 2010-04-20 22:06 ` Chris Rigg 0 siblings, 0 replies; 7+ messages in thread From: Chris Rigg @ 2010-04-20 22:06 UTC (permalink / raw) To: u-boot Thanks Wolfgang. Yes, I was intending to read from the host side while the filesystem was active on the PPC (target) side. But after hearing back from you guys and doing some more research it doesn't seem like a good (or even workable) solution. At this point, I'm thinking I'll design my own host-read-target-write simple filesystem or use the IP-over-PCI suggestion that Ira and Scott made. Chris On Tue, Apr 20, 2010 at 3:50 PM, Wolfgang Denk <wd@denx.de> wrote: > Dear Chris Rigg, > > In message <k2m7753e5291004201201u401d9a82xa172216f44d6312b@mail.gmail.com> > you wrote: > > > > My goal: > > I need a way to get the files from the ramdisk on the PPC to the host > over > > PCI. > > Design an interface. Or use an existing one. > > > My solution: > > The best idea I could come up with was to map in the PPC's ramdisk memory > on > > the host and then read it like I would a normal ext2 filesystem. For > > example, let's say the ramdisk is 1MB in size. I would simply map in that > > 1MB on the host side over the PCI bus. And then have a ext2 filesystem > > reader tool that can look at the filesystem and extract the log files I > > mentioned earlier. It would be like NFS but over PCI instead of ethernet. > > You mean you want to do this while the file system is active, i. e. > while it is being used by the Linux running on the PPC with the > filesystem mounted? > > You will run into serious trouble, quickly, as the information in the > ramdisk is most likely inconsistent, incomplete, and changing. Keep in > mind that Linux caches both data and meta-data. > > > > Best regards, > > Wolfgang Denk > > -- > 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 > Respect is a rational process > -- McCoy, "The Galileo Seven", stardate 2822.3 > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-04-20 22:47 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-20 19:01 [U-Boot] Is there a better way? Chris Rigg 2010-04-20 19:59 ` Ira W. Snyder 2010-04-20 21:37 ` Scott McNutt 2010-04-20 22:03 ` Chris Rigg 2010-04-20 22:47 ` Ira W. Snyder 2010-04-20 21:50 ` Wolfgang Denk 2010-04-20 22:06 ` Chris Rigg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox