diff mbox

[U-Boot] test/py: support 'memstart =' in u_boot_utils.find_ram_base()

Message ID 20160706104422.22359-1-daniel.schwierzeck@gmail.com
State Accepted
Commit d56dd0b1f8eb1dc13d4e6227a485fca5b9e94c1e
Delegated to: Tom Rini
Headers show

Commit Message

Daniel Schwierzeck July 6, 2016, 10:44 a.m. UTC
Some archs like MIPS or PPC have a different 'bdinfo' output
than ARM regarding the memory configuration. Also support
'memstart = 0x*' in u_boot_utils.find_ram_base() to make
all tests requiring the RAM base working on those archs.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

---

 test/py/u_boot_utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Warren July 6, 2016, 2:37 p.m. UTC | #1
On 07/06/2016 04:44 AM, Daniel Schwierzeck wrote:
> Some archs like MIPS or PPC have a different 'bdinfo' output
> than ARM regarding the memory configuration. Also support
> 'memstart = 0x*' in u_boot_utils.find_ram_base() to make
> all tests requiring the RAM base working on those archs.

Acked-by: Stephen Warren <swarren@nvidia.com>

... although wouldn't it be better to fix the bdinfo command so that it 
printed the same thing on all architectures?
Daniel Schwierzeck July 6, 2016, 2:49 p.m. UTC | #2
Am 06.07.2016 um 16:37 schrieb Stephen Warren:
> On 07/06/2016 04:44 AM, Daniel Schwierzeck wrote:
>> Some archs like MIPS or PPC have a different 'bdinfo' output
>> than ARM regarding the memory configuration. Also support
>> 'memstart = 0x*' in u_boot_utils.find_ram_base() to make
>> all tests requiring the RAM base working on those archs.
> 
> Acked-by: Stephen Warren <swarren@nvidia.com>
> 
> ... although wouldn't it be better to fix the bdinfo command so that it
> printed the same thing on all architectures?

yes, but bdinfo isn't the only one affected. Currently we have two variants in "struct bd_info" of how to store the memory configuration:

- bi_memstart and bi_memsize
- struct bi_dram[CONFIG_NR_DRAM_BANKS] if a board or arch defines CONFIG_NR_DRAM_BANKS

Maybe we could unify this one day. But this requires changes to other commands and generic board init. Until then test/py should support both variants.
Tom Rini July 9, 2016, 1:24 p.m. UTC | #3
On Wed, Jul 06, 2016 at 12:44:22PM +0200, Daniel Schwierzeck wrote:

> Some archs like MIPS or PPC have a different 'bdinfo' output
> than ARM regarding the memory configuration. Also support
> 'memstart = 0x*' in u_boot_utils.find_ram_base() to make
> all tests requiring the RAM base working on those archs.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Acked-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py
index 6a6b2ec..e4765e3 100644
--- a/test/py/u_boot_utils.py
+++ b/test/py/u_boot_utils.py
@@ -201,7 +201,7 @@  def find_ram_base(u_boot_console):
     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:
+            if '-> start' in l or 'memstart    =' in l:
                 ram_base = int(l.split('=')[1].strip(), 16)
                 break
         if ram_base is None: