From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Dyer Date: Tue, 13 Sep 2005 11:55:04 -0500 Subject: [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest() In-Reply-To: <20050913161856.03D1B352B8B@atlas.denx.de> References: <20050913161856.03D1B352B8B@atlas.denx.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 On 9/13/05, Wolfgang Denk wrote: > > ChangeLog: > > * Patch by Andrew Dyer, 13 September 2005: > > if CFG_ALT_MEMTEST is defined without > > CFG_MEMTEST_SCRATCH, cmd_mem.c > > code will dereference a null pointer. Change > > No, it does not. It just points to address 0x0000. This is a > perfectly valid address on many systems. Not on MIPS (unless someone was daft enough to map it with the TLB). The code causes a TLB store miss exception. Since this is in 'common' code, I think it's a bug. > > the code to use the last word of the memory test > > area as the scratch location in this case. Print > > the scratch memory location used. > > Which problem is this patch supposed to fix in the first place? The > existing code compiles and works fine on many, many systems. There are two problems - 1) writing to address 0 is bad on MIPS and causes a crash. 2) I have a system with two banks of DRAM, 1 attached to the CPU directly and 1 hooked through an FPGA to do video stuff. Both are entirely accessable through the CPU, but via different external busses. I would like to be able to test either one with the same basic command. With a static define of the scratch address I can't test one of the memories correctly becuase the scratch address is pointing to the other memory, so the scratch writes don't serve their purpose. My solution was to just allocate a location in the test range as scratch if the static define isn't present. This guarantees the scratch address used is valid and in the bank of ram required. -- Hardware, n.: The parts of a computer system that can be kicked.