From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 22 Jan 2016 23:30:11 +0100 Subject: [U-Boot] [PATCH 1/2] test/py: move find_ram_base() into u_boot_utils In-Reply-To: <1453417531-23669-1-git-send-email-swarren@wwwdotorg.org> References: <1453417531-23669-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <20160122223011.E743A3811CD@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 Stephen, In message <1453417531-23669-1-git-send-email-swarren@wwwdotorg.org> you wrote: > > find_ram_base() is a shared utility function, not a core part of the > U-Boot console interaction. On which boards did you test this feature? Eventually ARM only? > + with u_boot_console.log.section('find_ram_base'): > + response = u_boot_console.run_command('bdinfo') > + for l in response.split('\n'): > + if '-> start' in l: > + ram_base = int(l.split('=')[1].strip(), 16) > + break Searching for "-> start" is probably not exactly portable. For example, on a PowerPC system the output of "bdi" might look like this: => bdi memstart = 0x00000000 memsize = 0x04000000 flashstart = 0xFC000000 flashsize = 0x02000000 flashoffset = 0x0005D000 sramstart = 0x00000000 sramsize = 0x00000000 bootflags = 0x00000000 intfreq = 396 MHz busfreq = 132 MHz ethaddr = 00:D0:93:2A:C2:1A IP addr = 192.168.240.240 baudrate = 115200 bps relocaddr = 0x03F47000 => [example is from a TQM5200S, U-Boot 2016.01-00223-gb57843e] Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 When choosing between two evils, I always like to take the one I've never tried before. -- Mae West, "Klondike Annie"