From: Wolfgang Denk Date: Mon, 31 Aug 2009 19:46:10 +0200 Subject: [U-Boot] [PATCH] atngw100: Use virtual address in CONFIG_ENV_ADDR In-Reply-To: <20090831155327.62b58f8f@hskinnemoen-d830> References: <1251448970-15252-1-git-send-email-haavard.skinnemoen@atmel.com> <20090828115610.A0A63833DBD2@gemini.denx.de> <20090828141405.6a48e9b3@hskinnemoen-d830> <20090828154955.7eb781fa@hskinnemoen-d830> <20090830173640.2af9ce3c@siona> <20090830181101.23C3A833DBD2@gemini.denx.de> <20090830224218.10f14dc4@siona> <20090831115718.B5E91834A950@gemini.denx.de> <20090831155327.62b58f8f@hskinnemoen-d830> Message-ID: <20090831174610.D5FF3834A950@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 Haavard Skinnemoen, In message <20090831155327.62b58f8f@hskinnemoen-d830> you wrote: > > Possibly. But it means even more effort and even larger code, so I'm > not exactly happy about it. Really? Sorry if I'm asking dumb questions - I don't know AVR32: is it true that stting up a non-1:1 mapping for the NOR flash (i. e. what you are doing now) is easier (less code) than setting up a 1:1 mapping? What exactly are the reasons for this? > > Indeed I am, and intentionally, because this is a different topic. If > > your system requires to set up the MMU to enable caching, then you > > are supposed to do it in a way compatible with the rest of the > > software design, i. e. as transparently as possible. None of the > > architectures I know resonably well have problems setting up a 1: 1 > > address mapping even when the MMU is on (but I have to admit that > > AVR32 is not among these architectures). > > I suspect quite a few other architectures run with caches disabled > because it's not safe to run with caches enabled with the current > software design. Well, usually we run with IC on and with DC off, usually because quite a number of drivers and other code do not use proper I/O accessors yet, and/or because it's easier and nobody really cares. For example on PowerPC, adding support for the data cache usually gives only a minimal performance boost. This may be different on other architectures. > > Cache should not be relevant at all when defining a physcal or > > virtual memory map. > > Physical, no, but it's very common that the MMU defines caching > properties (enabled/disabled, writeback/writethrough, etc.) Agreed. But it should be not so difficult to use the MMU to set up a 1:1 mapping if you have to set up the MMU at all - or is there any problems with that which I'm not aware of? > > Heh. If more platforms had broken this rule we would probably have > > become aware of these violations earlier, and stopped them doing such > > naughty things ;-) > > Seems like you think it's more important to follow arbitrary rules than > writing code that works well. Keeping the code as simple as possible is not exactly an arbitrary rule. At least not for me. 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 Any time things appear to be going better, you have overlooked some- thing.