Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread Mark Kettenis
> Date: Tue, 13 Aug 2019 01:01:37 +
> From: ioh 
> 
> On Mon, Aug 12, Mark Kettenis wrote:
> > > Date: Sun, 11 Aug 2019 23:49:10 +
> > > From: ioh 
> > > 
> > > I have been able to successfully install OpenBSD Current Aug 06
> > > 2019 on the Olimex Teres laptop.  It has very similar hardware to
> > > the PineBook, arm64 allwinner, etc.  I used u-boot-sunxi-with-spl.bin
> > > from u-boot v2019.07 (teres_i_defconfig) and Arm Trusted Firmware
> > > v2.1. The dtb (sun50i-a64-teres-i.dtb) is from the OpenBSD 6.5-release
> > > ports tree.
> > > 
> > > To complete kernel initialization from either the install bsd.rd
> > > or bsd from an install, the ohci driver must be disabled.  I have
> > > included the serial console output and dmesg of first a boot without
> > > the ohci driver disabled, and then the boot log of my successful
> > > install with ohci disabled.  According to linux dmesg or the
> > > sun50i-a64-teres-i.dts, ohci is available so the driver is probed
> > > correctly - but even after several minutes the initialization process
> > > will not continue past the line "ohci0 at simplebus0".
> > 
> > The hang at that point suggests that accessing the OHCI registers
> > hangs the machine.  That happened in the past when the relevant clock
> > wasn't running or when the OHCI logic block wasn't brought out of
> > reset.  But those issues got fixed and ohci(4) works fine on other
> > boards that use the Allwinner A64 SoC.  What seems to be different is
> > that the Teres-i only has the 2nd USB controller enabled.
> > 
> > Adding printfs is probably the way to go here.  Start with
> > ohci_fdt_attach() in sys/dev/fdt/ohci_fdt.c and try to pinpoint at
> > which point it hangs.
> 
> This is the printf's I added, followed by the dmesg output.  The
> point at which init hangs is at bus_space_read_4() in ohci_fdt_attach().
> Do you need further digging in bus_space_read_4, ie adding printf's
> to that function too to find the exact line further, or is that
> enough information?

Thanks, yes, at least for now.

This confirms my suspicion and does point towards an issue with a
clock that isn't running and/or a reset that isn't deasserted.  You
could see what happens if you enable the other USB controller (both
ehci0 and ohci0) in the device tree if you know how to do that.  On my
end I'll try to do the opposite (disable ehci0 and ohci0) and see if I
can reproduce the issue.  It seems the Linux image you're using has
both controllers enabled.

Cheers,

Mark

> Index: dev/fdt/ohci_fdt.c
> ===
> RCS file: /cvs/src/sys/dev/fdt/ohci_fdt.c,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 ohci_fdt.c
> --- dev/fdt/ohci_fdt.c  7 Jan 2019 03:41:06 -   1.2
> +++ dev/fdt/ohci_fdt.c  13 Aug 2019 00:53:06 -
> @@ -71,6 +71,8 @@ ohci_fdt_match(struct device *parent, vo
>  void
>  ohci_fdt_attach(struct device *parent, struct device *self, void *aux)
>  {
> +printf("\nDEBUG: entering ohci_fdt_attach\n");
> +
> struct ohci_fdt_softc *sc = (struct ohci_fdt_softc *)self;
> struct fdt_attach_args *faa = aux;
> char *devname = sc->sc.sc_bus.bdev.dv_xname;
> @@ -96,9 +98,13 @@ ohci_fdt_attach(struct device *parent, s
> clock_enable_all(sc->sc_node);
> reset_deassert_all(sc->sc_node);
> 
> +printf("DEBUG: Make it to here\n");
> +
> /* Record what interrupts were enabled by SMM/BIOS. */
> sc->sc.sc_intre = bus_space_read_4(sc->sc.iot, sc->sc.ioh,
> OHCI_INTERRUPT_ENABLE);
> +
> +printf("DEBUG: Do not make it here\n");
> 
> /* Disable interrupts, so we don't get any spurious ones. */
> bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
> 
> 
> OpenBSD 6.5-current (CUSTOM) #2: Mon Aug 12 17:45:21 PDT 2019
> r...@hedges.my.domain:/sys/arch/arm64/compile/CUSTOM
> real mem  = 2018398208 (1924MB)
> avail mem = 1928859648 (1839MB)
> mainbus0 at root: Olimex A64 Teres-I
> cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
> cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
> cpu0: 512KB 64b/line 16-way L2 cache
> efi0 at mainbus0: UEFI 2.7
> efi0: Das U-Boot rev 0x20190700
> apm0 at mainbus0
> psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
> "osc24M_clk" at mainbus0 not configured
> "osc32k_clk" at mainbus0 not configured
> "internal-osc-clk" at mainbus0 not configured
> "sound_spdif" at mainbus0 not configured
> "spdif-out" at mainbus0 not configured
> agtimer0 at mainbus0: tick rate 24000 KHz
> simplebus0 at mainbus0: "soc"
> sxiccmu0 at simplebus0
> sxipio0 at simplebus0: 103 pins
> ampintc0 at simplebus0 nirq 224, ncpu 4: "interrupt-controller"
> sxiccmu1 at simplebus0
> sxipio1 at simplebus0: 13 pins
> sxirsb0 at simplebus0
> axppmic0 at sxirsb0 addr 0x3a3: AXP803
> "de2" at simplebus0 not configured
> "syscon" at simplebus0 not configured
> "dma-controller" at simplebus0 not configured
> "lcd-controller" at simplebus0 not configured
> "lcd-con

Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread Krystian Lewandowski
Maybe it's a more generic issue related to sxi/A64?

I.e. after reboot my USB WiFi dongle just stops working on
Pinebook until reinserted.
...
urtwn0: could not initialze DMA
...

And after reboot on A64 and Pinebook I lose CPU power regulator
even if it works just fine after cold boot:
...
cpu0: regulator not implemented
...

And - maybe completely unrelated - each time
(even after cold boot) on halt or reboot last thing printed is:
...
syncing disks... done
ehci0: halt timeout
ehci0: reset timeout

Attempting to power down...
...

-- 
Krystian



Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread ioh
On Tue, Aug 13, Mark Kettenis wrote:
> > Date: Tue, 13 Aug 2019 01:01:37 +
> > From: ioh 
> > 
> > On Mon, Aug 12, Mark Kettenis wrote:
> > > > Date: Sun, 11 Aug 2019 23:49:10 +
> > > > From: ioh 
> > > > 
> > > > I have been able to successfully install OpenBSD Current Aug 06
> > > > 2019 on the Olimex Teres laptop.  It has very similar hardware to
> > > > the PineBook, arm64 allwinner, etc.  I used u-boot-sunxi-with-spl.bin
> > > > from u-boot v2019.07 (teres_i_defconfig) and Arm Trusted Firmware
> > > > v2.1. The dtb (sun50i-a64-teres-i.dtb) is from the OpenBSD 6.5-release
> > > > ports tree.
> > > > 
> > > > To complete kernel initialization from either the install bsd.rd
> > > > or bsd from an install, the ohci driver must be disabled.  I have
> > > > included the serial console output and dmesg of first a boot without
> > > > the ohci driver disabled, and then the boot log of my successful
> > > > install with ohci disabled.  According to linux dmesg or the
> > > > sun50i-a64-teres-i.dts, ohci is available so the driver is probed
> > > > correctly - but even after several minutes the initialization process
> > > > will not continue past the line "ohci0 at simplebus0".
> > > 
> > > The hang at that point suggests that accessing the OHCI registers
> > > hangs the machine.  That happened in the past when the relevant clock
> > > wasn't running or when the OHCI logic block wasn't brought out of
> > > reset.  But those issues got fixed and ohci(4) works fine on other
> > > boards that use the Allwinner A64 SoC.  What seems to be different is
> > > that the Teres-i only has the 2nd USB controller enabled.
> > > 
> > > Adding printfs is probably the way to go here.  Start with
> > > ohci_fdt_attach() in sys/dev/fdt/ohci_fdt.c and try to pinpoint at
> > > which point it hangs.
> > 
> > This is the printf's I added, followed by the dmesg output.  The
> > point at which init hangs is at bus_space_read_4() in ohci_fdt_attach().
> > Do you need further digging in bus_space_read_4, ie adding printf's
> > to that function too to find the exact line further, or is that
> > enough information?
> 
> Thanks, yes, at least for now.
> 
> This confirms my suspicion and does point towards an issue with a
> clock that isn't running and/or a reset that isn't deasserted.  You
> could see what happens if you enable the other USB controller (both
> ehci0 and ohci0) in the device tree if you know how to do that.  On my
> end I'll try to do the opposite (disable ehci0 and ohci0) and see if I
> can reproduce the issue.  It seems the Linux image you're using has
> both controllers enabled.

I took the latest linux v5.3-rc4 and added some basic ehci0 and
ohci0 nodes. I built the dtb with musl-cross-make and by running
make dtbs in the linux source tree:

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
index 1069e7012c9c..a8596d742d68 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
@@ -100,6 +100,11 @@
status = "okay";
 };

+&ehci0 {
+   phys = <&usbphy 0>;
+   status = "okay";
+};
+
 &ehci1 {
status = "okay";
 };
@@ -153,6 +158,11 @@
status = "okay";
 };

+&ohci0 {
+   phys = <&usbphy 0>;
+   status = "okay";
+};
+
 &ohci1 {
status = "okay";
 };

This is how the nodes are in the pinebook dts and similar to an
armbian patch:
https://github.com/armbian/build/blob/master/patch/kernel/sunxi-dev/xxx-teres-fixed.patch

Here is my resulting dmesg and boot log. External usb ports were
unresponsive, inserting and removing a flash drive showed nothing
in dmesg and the light on the flash drive did not turn on. Also,
the usb wifi dongle was not recognized, and no keyboard in dmesg:

OpenBSD 6.5-current (GENERIC.MP) #158: Tue Aug  6 16:46:13 MDT 2019
dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 2018369536 (1924MB)
avail mem = 1928814592 (1839MB)
mainbus0 at root: Olimex A64 Teres-I
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
"pmu" at mainbus0 not configured
"sound" at mainbus0 not configured
"sound_spdif" at mainbus0 not configured
"spdif-out" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxiccmu0 at simplebus0
sxipio0 at simplebus0: 103 pins
ampintc0 at simplebus0 nirq 224, ncpu 4 ipi: 0, 1: "interrupt-controller"
sxiccmu1 at simplebus0
sxipio1 at simplebus0: 13 pins
sxirsb0 at simplebus0
axppmic0 at sxirsb0 addr 0x3a3: AXP803
"bus" at simplebus0 not configured
"syscon" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
"lc

Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread Mark Kettenis
> Date: Tue, 13 Aug 2019 22:01:30 +
> From: ioh 
> 
> On Tue, Aug 13, Mark Kettenis wrote:
> > > Date: Tue, 13 Aug 2019 01:01:37 +
> > > From: ioh 
> > > 
> > > On Mon, Aug 12, Mark Kettenis wrote:
> > > > > Date: Sun, 11 Aug 2019 23:49:10 +
> > > > > From: ioh 
> > > > > 
> > > > > I have been able to successfully install OpenBSD Current Aug 06
> > > > > 2019 on the Olimex Teres laptop.  It has very similar hardware to
> > > > > the PineBook, arm64 allwinner, etc.  I used u-boot-sunxi-with-spl.bin
> > > > > from u-boot v2019.07 (teres_i_defconfig) and Arm Trusted Firmware
> > > > > v2.1. The dtb (sun50i-a64-teres-i.dtb) is from the OpenBSD 6.5-release
> > > > > ports tree.
> > > > > 
> > > > > To complete kernel initialization from either the install bsd.rd
> > > > > or bsd from an install, the ohci driver must be disabled.  I have
> > > > > included the serial console output and dmesg of first a boot without
> > > > > the ohci driver disabled, and then the boot log of my successful
> > > > > install with ohci disabled.  According to linux dmesg or the
> > > > > sun50i-a64-teres-i.dts, ohci is available so the driver is probed
> > > > > correctly - but even after several minutes the initialization process
> > > > > will not continue past the line "ohci0 at simplebus0".
> > > > 
> > > > The hang at that point suggests that accessing the OHCI registers
> > > > hangs the machine.  That happened in the past when the relevant clock
> > > > wasn't running or when the OHCI logic block wasn't brought out of
> > > > reset.  But those issues got fixed and ohci(4) works fine on other
> > > > boards that use the Allwinner A64 SoC.  What seems to be different is
> > > > that the Teres-i only has the 2nd USB controller enabled.
> > > > 
> > > > Adding printfs is probably the way to go here.  Start with
> > > > ohci_fdt_attach() in sys/dev/fdt/ohci_fdt.c and try to pinpoint at
> > > > which point it hangs.
> > > 
> > > This is the printf's I added, followed by the dmesg output.  The
> > > point at which init hangs is at bus_space_read_4() in ohci_fdt_attach().
> > > Do you need further digging in bus_space_read_4, ie adding printf's
> > > to that function too to find the exact line further, or is that
> > > enough information?
> > 
> > Thanks, yes, at least for now.
> > 
> > This confirms my suspicion and does point towards an issue with a
> > clock that isn't running and/or a reset that isn't deasserted.  You
> > could see what happens if you enable the other USB controller (both
> > ehci0 and ohci0) in the device tree if you know how to do that.  On my
> > end I'll try to do the opposite (disable ehci0 and ohci0) and see if I
> > can reproduce the issue.  It seems the Linux image you're using has
> > both controllers enabled.
> 
> I took the latest linux v5.3-rc4 and added some basic ehci0 and
> ohci0 nodes. I built the dtb with musl-cross-make and by running
> make dtbs in the linux source tree:
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> index 1069e7012c9c..a8596d742d68 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> @@ -100,6 +100,11 @@
> status = "okay";
>  };
> 
> +&ehci0 {
> +   phys = <&usbphy 0>;
> +   status = "okay";
> +};
> +
>  &ehci1 {
> status = "okay";
>  };
> @@ -153,6 +158,11 @@
> status = "okay";
>  };
> 
> +&ohci0 {
> +   phys = <&usbphy 0>;
> +   status = "okay";
> +};
> +
>  &ohci1 {
> status = "okay";
>  };
> 
> This is how the nodes are in the pinebook dts and similar to an
> armbian patch:
> https://github.com/armbian/build/blob/master/patch/kernel/sunxi-dev/xxx-teres-fixed.patch
> 
> Here is my resulting dmesg and boot log. External usb ports were
> unresponsive, inserting and removing a flash drive showed nothing
> in dmesg and the light on the flash drive did not turn on. Also,
> the usb wifi dongle was not recognized, and no keyboard in dmesg:

Right, now you need my latest commits!

Latest snapshot kernel (dated Tue Aug 13) should be ok.
> 
> OpenBSD 6.5-current (GENERIC.MP) #158: Tue Aug  6 16:46:13 MDT 2019
> dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
> real mem  = 2018369536 (1924MB)
> avail mem = 1928814592 (1839MB)
> mainbus0 at root: Olimex A64 Teres-I
> cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
> cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
> cpu0: 512KB 64b/line 16-way L2 cache
> efi0 at mainbus0: UEFI 2.7
> efi0: Das U-Boot rev 0x20190700
> apm0 at mainbus0
> psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
> "osc24M_clk" at mainbus0 not configured
> "osc32k_clk" at mainbus0 not configured
> "pmu" at mainbus0 not configured
> "sound" at mainbus0 not configured
> "sound_spdif" at mainbus0 not configured
> "spdif-out" at mainbus0 not configured
> agtimer0 at mainbus0: tick rate 24000 KHz
> simplebus0 at m

Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread Krystian Lewandowski
I got similar behavior:
> ohci1: 1234 scheduling overruns
only on A64+ and not in Pinebook, with sxiuphy driver (enabling 2nd USB port)
from Patrick Wildt, sent earlier to this mailing list.

-- 
Krystian



Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread ioh
On Wed, Aug 14, Mark Kettenis wrote:
> > Date: Tue, 13 Aug 2019 22:01:30 +
> > From: ioh 
> > 
> > On Tue, Aug 13, Mark Kettenis wrote:
> > > > Date: Tue, 13 Aug 2019 01:01:37 +
> > > > From: ioh 
> > > > 
> > > > On Mon, Aug 12, Mark Kettenis wrote:
> > > > > > Date: Sun, 11 Aug 2019 23:49:10 +
> > > > > > From: ioh 
> > > > > > 
> > > > > > I have been able to successfully install OpenBSD Current Aug 06
> > > > > > 2019 on the Olimex Teres laptop.  It has very similar hardware to
> > > > > > the PineBook, arm64 allwinner, etc.  I used 
> > > > > > u-boot-sunxi-with-spl.bin
> > > > > > from u-boot v2019.07 (teres_i_defconfig) and Arm Trusted Firmware
> > > > > > v2.1. The dtb (sun50i-a64-teres-i.dtb) is from the OpenBSD 
> > > > > > 6.5-release
> > > > > > ports tree.
> > 
> > I took the latest linux v5.3-rc4 and added some basic ehci0 and
> > ohci0 nodes. I built the dtb with musl-cross-make and by running
> > make dtbs in the linux source tree:
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts 
> > b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > index 1069e7012c9c..a8596d742d68 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > @@ -100,6 +100,11 @@
> > status = "okay";
> >  };
> > 
> > +&ehci0 {
> > +   phys = <&usbphy 0>;
> > +   status = "okay";
> > +};
> > +
> >  &ehci1 {
> > status = "okay";
> >  };
> > @@ -153,6 +158,11 @@
> > status = "okay";
> >  };
> > 
> > +&ohci0 {
> > +   phys = <&usbphy 0>;
> > +   status = "okay";
> > +};
> > +
> >  &ohci1 {
> > status = "okay";
> >  };
> > 
> Right, now you need my latest commits!
> 
> Latest snapshot kernel (dated Tue Aug 13) should be ok.

I dd'd the latest snapshot miniroot66.fs to a microsd with the
u-boot and atf as described above and the patched dts.  It appears
the keyboard is recognized but no driver is attached. It also
appears the camera is not given the uvideo driver as it was before.
External usb nic and external flash drives work.

Here are the boot logs:

U-Boot SPL 2019.07 (Aug 06 2019 - 22:39:39 +)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.1(release):v2.1
NOTICE:  BL31: Built : 22:20:23, Aug  6 2019
NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC (1689)
NOTICE:  BL31: Found U-Boot DTB at 0x408a4a0, model: Olimex A64 Teres-I
NOTICE:  BL31: PMIC: Detected AXP803 on RSB.


U-Boot 2019.07 (Aug 06 2019 - 22:39:39 +) Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: Olimex A64 Teres-I
DRAM:  2 GiB
MMC:   Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c1'
mmc@1c0f000: 0, mmc@1c1: 2, mmc@1c11000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@1c1b000: USB EHCI 1.00
scanning bus usb@1c1b000 for devices...
  USB device not accepting new address (error=2)
4 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
24363 bytes read in 5 ms (4.6 MiB/s)
Found EFI removable media binary efi/boot/bootaa64.efi
Scanning disk m...@1c0f000.blk...
Card did not respond to voltage select!
Scanning disk m...@1c1.blk...
Disk m...@1c1.blk not ready
Scanning disk m...@1c11000.blk...
Found 6 disks
BootOrder not defined
EFI boot manager: Cannot load any image
161122 bytes read in 12 ms (12.8 MiB/s)
disks: sd0* sd1
>> OpenBSD/arm64 BOOTAA64 0.18
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2202188+619932+8747640+741088 
[220743+109+511728+198149]=0xff00c8
type 0x2 pa 0x4000 va 0x4000 pages 0x4000 attr 0x8
type 0x7 pa 0x4400 va 0x4400 pages 0x3ef7 attr 0x8
type 0x4 pa 0x47ef7000 va 0x47ef7000 pages 0x12 attr 0x8
type 0x7 pa 0x47f09000 va 0x47f09000 pages 0x702cc attr 0x8
type 0x2 pa 0xb81d5000 va 0xb81d5000 pages 0xd26 attr 0x8
type 0x1 pa 0xb8efb000 va 0xb8efb000 pages 0x28 attr 0x8
type 0x0 pa 0xb8f23000 va 0xb8f23000 pages 0x7 attr 0x8
type 0x6 pa 0xb8f2a000 va 0x3e024be000 pages 0x1 attr 0x8008
type 0x0 pa 0xb8f2b000 va 0xb8f2b000 pages 0x6 attr 0x8
type 0x6 pa 0xb8f31000 va 0x3e024c5000 pages 0x1 attr 0x8008
type 0x0 pa 0xb8f32000 va 0xb8f32000 pages 0x1 attr 0x8
type 0x2 pa 0xb8f33000 va 0xb8f33000 pages 0x501d attr 0x8
type 0x5 pa 0xbdf5 va 0x3e074e4000 pages 0x10 attr 0x8008
type 0x2 pa 0xbdf6 va 0xbdf6 pages 0xa0 attr 0x8
type 0x0 pa 0xbe00 va 0xbe00 pages 0x401 attr 0x8
type 0x2 pa 0xbe401000 va 0xbe401000 pages 0x1bff attr 0x8
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-beta (RAMDISK) #

Re: Booting and installing on the Olimex Teres laptop

2019-08-13 Thread ioh
> > > > > > I have been able to successfully install OpenBSD Current Aug 06
> > > > > > 2019 on the Olimex Teres laptop.  It has very similar hardware to
> > > > > > the PineBook, arm64 allwinner, etc.  I used 
> > > > > > u-boot-sunxi-with-spl.bin
> > > > > > from u-boot v2019.07 (teres_i_defconfig) and Arm Trusted Firmware
> > > > > > v2.1. The dtb (sun50i-a64-teres-i.dtb) is from the OpenBSD 
> > > > > > 6.5-release
> > > > > > ports tree.
> > 
> > I took the latest linux v5.3-rc4 and added some basic ehci0 and
> > ohci0 nodes. I built the dtb with musl-cross-make and by running
> > make dtbs in the linux source tree:
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts 
> > b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > index 1069e7012c9c..a8596d742d68 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts
> > @@ -100,6 +100,11 @@
> > status = "okay";
> >  };
> > 
> > +&ehci0 {
> > +   phys = <&usbphy 0>;
> > +   status = "okay";
> > +};
> > +
> >  &ehci1 {
> > status = "okay";
> >  };
> > @@ -153,6 +158,11 @@
> > status = "okay";
> >  };
> > 
> > +&ohci0 {
> > +   phys = <&usbphy 0>;
> > +   status = "okay";
> > +};
> > +
> >  &ohci1 {
> > status = "okay";
> >  };
> 
> Right, now you need my latest commits!
> 
> Latest snapshot kernel (dated Tue Aug 13) should be ok.

Okay dmesg from a full install is different than from the install
kernel. External usb devices work and the camera is recognized by
uvideo. The keyboard is picked up by umodem0 again.

Beneath the dmesg output here, I rebooted with umodem disabled and provided
lsusb -v output again:

OpenBSD 6.6-beta (GENERIC.MP) #174: Mon Aug 12 20:44:54 MDT 2019
dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 2018369536 (1924MB)
avail mem = 1928814592 (1839MB)
mainbus0 at root: Olimex A64 Teres-I
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
"pmu" at mainbus0 not configured
"sound" at mainbus0 not configured
"sound_spdif" at mainbus0 not configured
"spdif-out" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxiccmu0 at simplebus0
sxipio0 at simplebus0: 103 pins
ampintc0 at simplebus0 nirq 224, ncpu 4 ipi: 0, 1: "interrupt-controller"
sxirtc0 at simplebus0
sxiccmu1 at simplebus0
sxipio1 at simplebus0: 13 pins
sxirsb0 at simplebus0
axppmic0 at sxirsb0 addr 0x3a3: AXP803
"bus" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"video-codec" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
sximmc1 at simplebus0
sdmmc1 at sximmc1: 4-bit, sd high-speed, mmc high-speed, dma
sximmc2 at simplebus0
sdmmc2 at sximmc2: 8-bit, sd high-speed, mmc high-speed, dma
"eeprom" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci0 at simplebus0: version 1.0
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci1 at simplebus0: version 1.0
"dai" at simplebus0 not configured
"codec" at simplebus0 not configured
com0 at simplebus0: ns16550, no working fifo
com0: console
sxitwi0 at simplebus0
iic0 at sxitwi0
"gpu" at simplebus0 not configured
"pwm" at simplebus0 not configured
"hdmi-phy" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
"codec-analog" at simplebus0 not configured
"watchdog" at simplebus0 not configured
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
gpio7 at sxipio0: 32 pins
gpio8 at sxipio1: 32 pins
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
"backlight" at mainbus0 not configured
"gpio-keys" at mainbus0 not configured
"leds" at mainbus0 not configured
"usb1-vbus" at mainbus0 not configured
"wifi_pwrseq" at mainbus0 not configured
"audio-amplifier" at mainbus0 not configured
simplefb0 at mainbus0: 1366x768, 32bpp
wsdisplay0 at simplefb0 mux 1
wsdisplay0: screen 0-5 added (std, vt100 emulation)
cpu1 at mainbus0 mpidr 1: A