Re: [PATCH v4 6/7] tests/boot_linux_console: Test booting U-Boot on the Raspberry Pi 3

2020-01-28 Thread Wainer dos Santos Moschetta



On 1/20/20 9:51 PM, Philippe Mathieu-Daudé wrote:

This test runs U-Boot on the Raspberry Pi 3.
It is very simple and fast:

   $ avocado --show=app,console run -t raspi3 -t u-boot tests/acceptance/
   JOB LOG: avocado/job-results/job-2020-01-20T23.40-2424777/job.log
(1/1) 
tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_aarch64_raspi3_uboot:
   console: MMC:   mmc@7e202000: 0, sdhci@7e30: 1
   console: Loading Environment from FAT... WARNING at 
drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
   console: WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
   console: Card did not respond to voltage select!
   console: In:serial
   console: Out:   vidconsole
   console: Err:   vidconsole
   console: Net:   No ethernet found.
   console: starting USB...
   console: Bus usb@7e98: Port not available.
   console: Hit any key to stop autoboot:  0
   console: U-Boot>
   console: U-Boot>
   console: U-Boot> bdinfo
   console: arch_number = 0x
   console: boot_params = 0x0100
   console: DRAM bank   = 0x
   console: -> start= 0x
   console: -> size = 0x3c00
   console: baudrate= 115200 bps
   console: TLB addr= 0x3bff
   console: relocaddr   = 0x3bf57000
   console: reloc off   = 0x3bed7000
   console: irq_sp  = 0x3bb52dd0
   console: sp start= 0x3bb52dd0
   console: FB base = 0x
   console: Early malloc usage: 7b0 / 2000
   console: fdt_blob= 0x3bfbf200
   console: U-Boot> version
   console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +)
   console: gcc (Debian 9.2.1-22) 9.2.1 20200104
   console: GNU ld (GNU Binutils for Debian) 2.33.1
   console: U-Boot> reset
   console: resetting ...
   PASS (1.79 s)

U-Boot is built by the Debian project, see:
https://wiki.debian.org/InstallingDebianOn/Allwinner#Creating_a_bootable_SD_Card_with_u-boot

Signed-off-by: Philippe Mathieu-Daudé 
---
  tests/acceptance/boot_linux_console.py | 25 +
  1 file changed, 25 insertions(+)



Reviewed-by: Wainer dos Santos Moschetta 




diff --git a/tests/acceptance/boot_linux_console.py 
b/tests/acceptance/boot_linux_console.py
index 682b801b4f..22b360118d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -513,6 +513,31 @@ class BootLinuxConsole(Test):
  exec_command_and_wait_for_pattern(self, 'version', 'U-Boot')
  exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...')
  
+def test_aarch64_raspi3_uboot(self):

+"""
+:avocado: tags=arch:aarch64
+:avocado: tags=machine:raspi3
+:avocado: tags=u-boot
+"""
+deb_url = ('https://snapshot.debian.org/archive/debian/'
+   '20200108T145233Z/pool/main/u/u-boot/'
+   'u-boot-rpi_2020.01%2Bdfsg-1_arm64.deb')
+deb_hash = 'f394386e02469d52f2eb3c07a2325b1c95aeb00b'
+deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+uboot_path = '/usr/lib/u-boot/rpi_3/u-boot.bin'
+uboot_path = self.extract_from_deb(deb_path, uboot_path)
+
+self.vm.set_console(console_index=1)
+self.vm.add_args('-kernel', uboot_path,
+ '-no-reboot')
+self.vm.launch()
+interrupt_interactive_console_until_pattern(self,
+   'Hit any key to stop autoboot:',
+   'Config file not found')
+exec_command_and_wait_for_pattern(self, 'bdinfo', 'U-Boot')
+exec_command_and_wait_for_pattern(self, 'version', 'U-Boot')
+exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...')
+
  def test_s390x_s390_ccw_virtio(self):
  """
  :avocado: tags=arch:s390x





[PATCH v4 6/7] tests/boot_linux_console: Test booting U-Boot on the Raspberry Pi 3

2020-01-20 Thread Philippe Mathieu-Daudé
This test runs U-Boot on the Raspberry Pi 3.
It is very simple and fast:

  $ avocado --show=app,console run -t raspi3 -t u-boot tests/acceptance/
  JOB LOG: avocado/job-results/job-2020-01-20T23.40-2424777/job.log
   (1/1) 
tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_aarch64_raspi3_uboot:
  console: MMC:   mmc@7e202000: 0, sdhci@7e30: 1
  console: Loading Environment from FAT... WARNING at 
drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
  console: WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
  console: Card did not respond to voltage select!
  console: In:serial
  console: Out:   vidconsole
  console: Err:   vidconsole
  console: Net:   No ethernet found.
  console: starting USB...
  console: Bus usb@7e98: Port not available.
  console: Hit any key to stop autoboot:  0
  console: U-Boot>
  console: U-Boot>
  console: U-Boot> bdinfo
  console: arch_number = 0x
  console: boot_params = 0x0100
  console: DRAM bank   = 0x
  console: -> start= 0x
  console: -> size = 0x3c00
  console: baudrate= 115200 bps
  console: TLB addr= 0x3bff
  console: relocaddr   = 0x3bf57000
  console: reloc off   = 0x3bed7000
  console: irq_sp  = 0x3bb52dd0
  console: sp start= 0x3bb52dd0
  console: FB base = 0x
  console: Early malloc usage: 7b0 / 2000
  console: fdt_blob= 0x3bfbf200
  console: U-Boot> version
  console: U-Boot 2020.01+dfsg-1 (Jan 08 2020 - 08:19:44 +)
  console: gcc (Debian 9.2.1-22) 9.2.1 20200104
  console: GNU ld (GNU Binutils for Debian) 2.33.1
  console: U-Boot> reset
  console: resetting ...
  PASS (1.79 s)

U-Boot is built by the Debian project, see:
https://wiki.debian.org/InstallingDebianOn/Allwinner#Creating_a_bootable_SD_Card_with_u-boot

Signed-off-by: Philippe Mathieu-Daudé 
---
 tests/acceptance/boot_linux_console.py | 25 +
 1 file changed, 25 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py 
b/tests/acceptance/boot_linux_console.py
index 682b801b4f..22b360118d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -513,6 +513,31 @@ class BootLinuxConsole(Test):
 exec_command_and_wait_for_pattern(self, 'version', 'U-Boot')
 exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...')
 
+def test_aarch64_raspi3_uboot(self):
+"""
+:avocado: tags=arch:aarch64
+:avocado: tags=machine:raspi3
+:avocado: tags=u-boot
+"""
+deb_url = ('https://snapshot.debian.org/archive/debian/'
+   '20200108T145233Z/pool/main/u/u-boot/'
+   'u-boot-rpi_2020.01%2Bdfsg-1_arm64.deb')
+deb_hash = 'f394386e02469d52f2eb3c07a2325b1c95aeb00b'
+deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
+uboot_path = '/usr/lib/u-boot/rpi_3/u-boot.bin'
+uboot_path = self.extract_from_deb(deb_path, uboot_path)
+
+self.vm.set_console(console_index=1)
+self.vm.add_args('-kernel', uboot_path,
+ '-no-reboot')
+self.vm.launch()
+interrupt_interactive_console_until_pattern(self,
+   'Hit any key to stop autoboot:',
+   'Config file not found')
+exec_command_and_wait_for_pattern(self, 'bdinfo', 'U-Boot')
+exec_command_and_wait_for_pattern(self, 'version', 'U-Boot')
+exec_command_and_wait_for_pattern(self, 'reset', 'resetting ...')
+
 def test_s390x_s390_ccw_virtio(self):
 """
 :avocado: tags=arch:s390x
-- 
2.21.1