armv7 with Banana Pi (BPI-M1)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

armv7 with Banana Pi (BPI-M1)

SASANO Takayoshi
Hello,

Is there any reports which succeeded to run OpenBSD/armv7
on Banana Pi BPI-M1?
I am trying now but it reboots with undefined instruction exception.

What should I do to solve this problem?

----
U-Boot SPL 2016.05 (Jun 02 2016 - 22:39:53)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1


U-Boot 2016.05 (Jun 02 2016 - 22:39:53 +0900) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: LeMaker Banana Pi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 720x576i composite-pal console (overscan 32x20)
In:    serial
Out:   vga
Err:   vga
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c50000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /sun7i-a20-bananapi.dtb
30295 bytes read in 32 ms (923.8 KiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
65556 bytes read in 44 ms (1.4 MiB/s)
## Starting EFI application at 0x42000000 ...
Scanning disks on scsi...
Scanning disks on usb...
Scanning disks on mmc...
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Found 2 disks
>> OpenBSD/armv7 BOOTARM 0.1
boot> boot bsd.rd
sd0: getdisklabel: no disk label
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:bsd.rd: sd0: getdisklabel: no disk label
2069160+7932832+419052 [64+292352+141260]=0xa6100c
undefined instruction
pc : [<3f501000>]          lr : [<79f1f180>]
reloc pc : [<0a5a9000>]    lr : [<44fc7180>]
sp : 7af2e840  ip : 00000000     fp : 7af2e968
r10: 7af2e980  r9 : ffffe7f8     r8 : 7af2e980
r7 : 79f2c89c  r6 : 7af2e844     r5 : 48000000  r4 : 00000000
r3 : 7ef9c5b8  r2 : 48000000     r1 : 00000000  r0 : 00000000
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...
----
SASANO Takayoshi <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: armv7 with Banana Pi (BPI-M1)

Jonathan Gray-11
On Fri, Jun 10, 2016 at 05:17:35AM +0900, SASANO Takayoshi wrote:
> Hello,
>
> Is there any reports which succeeded to run OpenBSD/armv7
> on Banana Pi BPI-M1?
> I am trying now but it reboots with undefined instruction exception.
>
> What should I do to solve this problem?

It seems you aren't using the version of u-boot from ports with
the patch to correct the efi loader?

For non-imx platforms u-boot must have the following commit, that is
included with u-boot v2016.07-rc1 or later.

commit 74c16acce30bb882ad5951829d8dafef8eea564c
Author: Alexander Graf <[hidden email]>
Date:   Fri May 27 12:25:03 2016 +0200

    efi_loader: Don't allocate from memory holes
   
    When a payload calls our memory allocator with the exact address hint, we
    happily allocate memory from completely unpopulated regions. Payloads however
    expect this to only succeed if they would be allocating from free conventional
    memory.
   
    This patch makes the logic behind those checks a bit more obvious and ensures
    that we always allocate from known good free conventional memory regions if we
    want to allocate ram.
   
    Reported-by: Jonathan Gray <[hidden email]>
    Signed-off-by: Alexander Graf <[hidden email]>


Further for sunxi because sunxi has a colon in the stdout-path the
following pending diff is required to find the console.

ie, stdout-path = "serial0:115200n8"

This patch will be in the next snapshot.

Index: armv7_machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/armv7/armv7_machdep.c,v
retrieving revision 1.29
diff -u -p -r1.29 armv7_machdep.c
--- armv7_machdep.c 8 Jun 2016 15:27:05 -0000 1.29
+++ armv7_machdep.c 9 Jun 2016 14:45:36 -0000
@@ -904,13 +904,21 @@ void *
 fdt_find_cons(const char *name)
 {
  char *alias = "serial0";
+ char buf[128];
  char *stdout = NULL;
+ char *p;
  void *node;
 
  /* First check if "stdout-path" is set. */
  node = fdt_find_node("/chosen");
  if (node) {
  if (fdt_node_property(node, "stdout-path", &stdout)) {
+ if (strchr(stdout, ':') != NULL) {
+ strlcpy(buf, stdout, sizeof(buf));
+ if ((p = strchr(buf, ':')) != NULL)
+ *p = '\0';
+ stdout = buf;
+ }
  if (stdout[0] != '/') {
  /* It's an alias. */
  alias = stdout;

Reply | Threaded
Open this post in threaded view
|

Re: armv7 with Banana Pi (BPI-M1)

SASANO Takayoshi
Hello,

Using u-boot v2016.07-rc1 and armv7_machdep.c patch, bsd is booted.
Thanks!

----
U-Boot SPL 2016.07-rc1 (Jun 10 2016 - 22:01:11)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1


U-Boot 2016.07-rc1 (Jun 10 2016 - 22:01:11 +0900) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: LeMaker Banana Pi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 720x576i composite-pal console (overscan 32x20)
In:    serial
Out:   vga
Err:   vga
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net:   eth0: ethernet@01c50000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
reading /sun7i-a20-bananapi.dtb
30295 bytes read in 34 ms (870.1 KiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
reading efi/boot/bootarm.efi
65556 bytes read in 44 ms (1.4 MiB/s)
## Starting EFI application at 0x42000000 ...
Scanning disks on scsi...
Scanning disks on usb...
Scanning disks on mmc...
MMC Device 1 not found
MMC Device 2 not found
MMC Device 3 not found
Found 6 disks
setjmp:64 target=0x7ef59944
>> OpenBSD/armv7 BOOTARM 0.1
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 3814052+104952+470236 [64+506192+230469]=0x4e8620

OpenBSD/armv7 booting ...
arg0 0x0 arg1 0x10bb arg2 0x48000000
Allocating page tables
freestart = 0x407e9000, free_pages = 259713 (0x0003f681)
IRQ stack: p0x40817000 v0xc0817000
ABT stack: p0x40818000 v0xc0818000
UND stack: p0x40819000 v0xc0819000
SVC stack: p0x4081a000 v0xc081a000
Creating L1 page table at 0x407ec000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 737100 bytes of bsd ELF symbol table ]
board type: 4283
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 6.0-beta (GENERIC) #0: Fri Jun 10 23:31:36 JST 2016
    [hidden email]:/usr/src/sys/arch/armv7/compile/GENERIC
real mem  = 1072078848 (1022MB)
avail mem = 1042829312 (994MB)
warning: no entropy supplied by boot loader
mainbus0 at root: LeMaker Banana Pi
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
agtimer0 at cortex0: tick rate 24000 KHz
sunxi0 at mainbus0
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
rgephy0 at sxie0 phy 0: RTL8169S/8110S/8211 PHY, rev. 5
rgephy1 at sxie0 phy 1: RTL8169S/8110S/8211 PHY, rev. 5
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at sunxi0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Allwinner EHCI root hub" rev 2.00/1.00 addr 1
gpio0 at sxipio0: 18 pins
gpio1 at sxipio0: 24 pins
gpio2 at sxipio0: 25 pins
gpio3 at sxipio0: 28 pins
gpio4 at sxipio0: 12 pins
gpio5 at sxipio0: 6 pins
gpio6 at sxipio0: 12 pins
gpio7 at sxipio0: 28 pins
gpio8 at sxipio0: 22 pins
simplebus0 at mainbus0: "soc"
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
boot device: lookup 'sd0a:/bsd' failed.
root device:

--
SASANO Takayoshi <[hidden email]>