From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Mon, 19 Nov 2007 16:34:19 +0100 Subject: [U-Boot-Users] post memory test In-Reply-To: <4741416E.1040707@tqs.de> (Jens Gehrlein's message of "Mon\, 19 Nov 2007 08\:55\:26 +0100") References: <20071116192117.42A7224887@gemini.denx.de> <4741416E.1040707@tqs.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, > Wolfgang Denk schrieb: >> In message <473D9B54.1010304@tqs.de> you wrote: >>>> As an example look at initdram() in board/Marvell/db64460/sdram_init.c >>>> where the platform uses Block Address Translations (BATs) to map RAM >>>> but exhausts these pretty scarce ressources and limits itself to >>>> mapping only the first 256MB (a usual limit for a BAT). >>> So it is possible to overlay the function memory_post_test() by a >>> board specific routine, which may cover almost all RAM? >> >> Everything is possible - this is software, so anything can be done. >> You can even make pigs fly. But not everything does make sense. >> >>> BTW, is it possible to overlay _all_ POST routines by board specific >>> routines? >> >> It could be done, but I consider it a very, very bad idea. >> >> Best regards, >> >> Wolfgang Denk >> > And what if the tests wouldn't meet certain requirements of the > developer or customer or if it had to be adapted to CPU- or > board-specific conditions? > I suppose, you wouldn't like much "#ifdef "s or "#ifdef "s > in common code. > Could you please make a proposal to solve this and to get such code > into the official U-Boot tree? Let me restate, that for me U-Boot gets its power from the shared source code, not from the "every board uses its own code". On the contrary, non-shared source is a constant source of trouble in this project that surely picked up speed in the last few months. Code sharing is a _central_ point of the whole U-Boot design and especially _test_ routines surely should fall into this category. So we should always strive to solve the problem in common code, probably using board specific data structures to cope with the differences. Instead of discussing the general "why shouldn't we override test xy" which I believe cannot be answered in a more general way than I tried in the previous paragraph, let's think about the post memory test. What we really need is (as I already hinted at in my first reply) a data structure that allows the post test to know how much memory is mapped where. At first I thought of a single scalar mem_mapped variable but discussion with Wolfgang showed me that we really need a list of mapped segments for the general case. So to answer your question, if you come up with an implementation of this idea (or something comparable) then I don't see why this could not go mainline. Cheers Detlev -- LISP is the most powerful programming language, and if you want an inter- preter, LISP is the best. None of the other languages come anywhere near LISP in their power. The most exciting things about LISP are read, eval, and print. If you look at other languages, they have no equivalent for any of those. -- Richard Stallman -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de