From: Wolfgang Denk Date: Thu, 28 Jan 2010 11:15:37 +0100 Subject: [U-Boot] [PATCH 1/2 v2] cramfs: make cramfs usable on non NOR flash In-Reply-To: <4B613D24.7060604@denx.de> References: <4B459395.2050301@denx.de> <20100117235121.5E479C88AE@gemini.denx.de> <4B5FE9EC.6090909@denx.de> <4B5FEB9E.3040908@denx.de> <20100127192831.32327D334C9@gemini.denx.de> <4B613D24.7060604@denx.de> Message-ID: <20100128101537.501C83F6C0@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Heiko Schocher, In message <4B613D24.7060604@denx.de> you wrote: > > The cramfs image is located in RAM (where it first was copied from > whenever), and then files are read from it with the "cramfsload" > command ... OK. > >> +#if !defined(CONFIG_SYS_NO_FLASH) > >> part.offset = addr - flash_info[id.num].start[0]; > >> +#else > >> + part.offset = addr; > >> +#endif ... > No, we can have it in ROM or in RAM. OK. > > What about systems that have both NOR _and_ NAND? > > Are there such systems, with cramfs support? Actual cramfs support > in mainline is only for NOR devices ... Yes, but I understand that you want to also support cramfs when not stored in NOR. With your code I can read files from a cramfs image stored in RAM (when there is nor NOR flash), _or_ I can read it from NOR flash. Right? But what about reading from files a cramfs image stored in RAM on a system that _has_ NOR flash? And being able to read files a cramfs image stored in NOR as well? It seems your code cannot do this. I understand that the suggested patch is an improvement over the existing state (it adds the capability to read cramfs in RAM on NOR-les systems), but I think this restriction ("on NOR-less systems") should be lifted as well. In other words: I think, the decision whether to use part.offset = addr - flash_info[id.num].start[0]; or part.offset = addr; should be made at run time (based on the location of the image - in NOR versus in RAM - have a look at how this is done in the "cp" command), not at compile time. 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 G's Third Law: In spite of all evidence to the contra- ry, the entire universe is composed of only two basic substances: magic and bullshit. H's Dictum: There is no magic ...