Jump to content

Orange Pi Zero went to the market


zgoda_j

Recommended Posts

I have same issue (ping through WiFi ranges from 1 to 500 ms). People did found a solution - repeating ping with high frequency (20 small pings per second or more - "ping -s 1 -i 0.05 <orange-ip>"). Seems like a stupid incoming packets grouping in the driver to save power by processing large number of packets at once.

 

The source of the driver is available so there is no "seems" about it really. The wifi chip tells the host when there is something to read via an interrupt. If interrupts aren't working or delayed the driver will poll the chip at interval that depends on whether it thinks there is something going on or not.

It really would be better for people to spend their time looking at the driver instead of formulating theories about what is going on.

Link to comment
Share on other sites

I like the case!  I just printed one.  I flipped the colors.  Seemed more sense to make the orange design in orange. :)  I had to do a little trimming on the antenna hole and around the USB jack--near the back, mine have a fold that sticks out a tiny bit, maybe 0.2 or 0.3mm.  30 seconds with a hobby knife and it fit together just fine.  I used M3x8 self tapping screws instead of machine screws--because I have a ton.  They worked just fine.

 

I would like you post, but I just signed up for the forum to make this reply and I guess the forum doesn't trust me with that kind of power, yet.  So, here's my verbal thumbs up to you!

 

Thanks, yes - slight connector placement inconsistencies from board to board are expected but nothing major. The bigger USB connector on mine has a twirl of about 7 degrees from the pivot but still fits fine.

Link to comment
Share on other sites

My 512MB Orange Pi Zero arrived today.

 

Installed Armbian_5.24_Orangepizero_Debian_jessie_3.4.113.img from https://www.armbian.com/orange-pi-zero/

 

All works fine and its been great over ethernet all day.

 

Wifi worked straightaway but I'm getting poor connect rates:

wlan0     IEEE 802.11bgn  ESSID:"MWR"
          Mode:Managed  Frequency:2.412 GHz  Access Point: C4:3D:C7:3B:1D:5F
          Bit Rate=6.5 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=61/70  Signal level=-49 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1913  Invalid misc:1   Missed beacon:0

Link to comment
Share on other sites

 

My 512MB Orange Pi Zero arrived today.

 

Installed Armbian_5.24_Orangepizero_Debian_jessie_3.4.113.img from https://www.armbian.com/orange-pi-zero/

 

All works fine and its been great over ethernet all day.

 

Wifi worked straightaway but I'm getting poor connect rates:

wlan0     IEEE 802.11bgn  ESSID:"MWR"
          Mode:Managed  Frequency:2.412 GHz  Access Point: C4:3D:C7:3B:1D:5F
          Bit Rate=6.5 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=61/70  Signal level=-49 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1913  Invalid misc:1   Missed beacon:0

 

 

Turn wifi power management off and it'll likely behave much better:

iwconfig wlan0 power off
Link to comment
Share on other sites

My OPI PC+ has been shelved for a while (but not before hooking up via HDMI to a next gen e-ink diplay showing Game of Thrones video, hehe).  I never got wifi to work correctly on it, but this bug seems to have been resolved.  If I wanted to set up a wifi repeater/extender (lead wall paint) would it be worthwhile to use a OPI Zero (I might have trouble with setting with video via pins), or use the OPI PC+?

 

Any directions or links to setting up an Armbian as a repeater/extender?

Link to comment
Share on other sites

Got my (512mb) Orange Pi Zero a few days ago & have tried booting it with both an Orange Pi PC RetrOrangePi (latest) distro & a beta Armbian distro specifically for the Zero; both have booted & I've succeeded in logging in over SSH via Ethernet so I know it works.

 

CVBS / composite video doesn't seem to be enabled by default on it, however. Might be an idea.

Link to comment
Share on other sites

Yes, it will be in next releases.

Hurrah! As it happens last thing yesterday I grabbed the latest, latest beta Armbian & lo & behold, I got a composite picture on my screen from it. Excellent stuff!

 

Would copying some of the Fex settings to an Orange Pi One image (say, RetrOrangePi as I noticed that has a specific image for it) work or are they too different?

Link to comment
Share on other sites

Hi,

 

Are the any plans on fixing the g_hid module anytime soon? I'm using Armbian_5.24_Orangepizero_Debian_jessie_3.4.113. Need the device to be able to emulate mouse and keyboard.

 

 

 

root@orangepizero:/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget# strace modprobe g_hid

execve("/sbin/modprobe", ["modprobe", "g_hid"], [/* 20 vars */]) = 0

brk(0)                                  = 0xb8ee7000

uname({sys="Linux", node="orangepizero", ...}) = 0

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)

mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff9000

access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=22214, ...}) = 0

mmap2(NULL, 22214, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6ff3000

close(3)                                = 0

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0Mw\1\0004\0\0\0"..., 512) = 512

lseek(3, 908188, SEEK_SET)              = 908188

read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880

lseek(3, 904740, SEEK_SET)              = 904740

read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 53

fstat64(3, {st_mode=S_IFREG|0755, st_size=911068, ...}) = 0

mmap2(NULL, 980392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6eba000

mprotect(0xb6f95000, 61440, PROT_NONE)  = 0

mmap2(0xb6fa4000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xda000) = 0xb6fa4000

mmap2(0xb6fa7000, 9640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fa7000

close(3)                                = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff2000

set_tls(0xb6ff2850, 0xb6fd2050, 0xb6ff2f38, 0xb6ff2850, 0xb6fd2050) = 0

mprotect(0xb6fa4000, 8192, PROT_READ)   = 0

mprotect(0xb6ffb000, 4096, PROT_READ)   = 0

mprotect(0xb6fd1000, 4096, PROT_READ)   = 0

munmap(0xb6ff3000, 22214)               = 0

brk(0)                                  = 0xb8ee7000

brk(0xb8f08000)                         = 0xb8f08000

uname({sys="Linux", node="orangepizero", ...}) = 0

stat64("/etc/modprobe.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

openat(AT_FDCWD, "/etc/modprobe.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3

fcntl64(3, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)

getdents64(3, /* 5 entries */, 32768)   = 168

newfstatat(3, "orangepizero.conf", {st_mode=S_IFREG|0644, st_size=14, ...}, 0) = 0

newfstatat(3, "fbdev-blacklist.conf", {st_mode=S_IFREG|0644, st_size=390, ...}, 0) = 0

newfstatat(3, "xradio_wlan.conf", {st_mode=S_IFREG|0644, st_size=46, ...}, 0) = 0

getdents64(3, /* 0 entries */, 32768)   = 0

close(3)                                = 0

stat64("/run/modprobe.d", 0xbe8e6870)   = -1 ENOENT (No such file or directory)

stat64("/lib/modprobe.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

openat(AT_FDCWD, "/lib/modprobe.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3

getdents64(3, /* 3 entries */, 32768)   = 80

newfstatat(3, "aliases.conf", {st_mode=S_IFREG|0644, st_size=655, ...}, 0) = 0

getdents64(3, /* 0 entries */, 32768)   = 0

close(3)                                = 0

open("/lib/modprobe.d/aliases.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fcntl64(3, F_GETFL)                     = 0xa0000 (flags O_RDONLY|O_LARGEFILE|O_CLOEXEC)

fstat64(3, {st_mode=S_IFREG|0644, st_size=655, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff8000

_llseek(3, 0, [0], SEEK_CUR)            = 0

read(3, "# These are the standard aliases"..., 4096) = 655

read(3, "", 4096)                       = 0

close(3)                                = 0

munmap(0xb6ff8000, 4096)                = 0

open("/etc/modprobe.d/fbdev-blacklist.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fcntl64(3, F_GETFL)                     = 0xa0000 (flags O_RDONLY|O_LARGEFILE|O_CLOEXEC)

fstat64(3, {st_mode=S_IFREG|0644, st_size=390, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff8000

_llseek(3, 0, [0], SEEK_CUR)            = 0

read(3, "# This file blacklists most old-"..., 4096) = 390

read(3, "", 4096)                       = 0

close(3)                                = 0

munmap(0xb6ff8000, 4096)                = 0

open("/lib/modules/3.4.113-sun8i/modules.softdep", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fcntl64(3, F_GETFL)                     = 0xa0000 (flags O_RDONLY|O_LARGEFILE|O_CLOEXEC)

fstat64(3, {st_mode=S_IFREG|0644, st_size=55, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff8000

_llseek(3, 0, [0], SEEK_CUR)            = 0

read(3, "# Soft dependencies extracted fr"..., 4096) = 55

read(3, "", 4096)                       = 0

close(3)                                = 0

munmap(0xb6ff8000, 4096)                = 0

open("/etc/modprobe.d/orangepizero.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fcntl64(3, F_GETFL)                     = 0xa0000 (flags O_RDONLY|O_LARGEFILE|O_CLOEXEC)

fstat64(3, {st_mode=S_IFREG|0644, st_size=14, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff8000

_llseek(3, 0, [0], SEEK_CUR)            = 0

read(3, "blacklist dhd\n", 4096)        = 14

read(3, "", 4096)                       = 0

close(3)                                = 0

munmap(0xb6ff8000, 4096)                = 0

open("/etc/modprobe.d/xradio_wlan.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fcntl64(3, F_GETFL)                     = 0xa0000 (flags O_RDONLY|O_LARGEFILE|O_CLOEXEC)

fstat64(3, {st_mode=S_IFREG|0644, st_size=46, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff8000

_llseek(3, 0, [0], SEEK_CUR)            = 0

read(3, "options xradio_wlan macaddr=E4:8"..., 4096) = 46

read(3, "", 4096)                       = 0

close(3)                                = 0

munmap(0xb6ff8000, 4096)                = 0

open("/proc/cmdline", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

read(3, "root=UUID=85b7cc4a-3dd0-439a-941"..., 4095) = 339

read(3, "", 3756)                       = 0

close(3)                                = 0

open("/lib/modules/3.4.113-sun8i/modules.dep.bin", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=169464, ...}) = 0

mmap2(NULL, 169464, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6e90000

close(3)                                = 0

open("/lib/modules/3.4.113-sun8i/modules.alias.bin", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=355263, ...}) = 0

mmap2(NULL, 355263, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6e39000

close(3)                                = 0

open("/lib/modules/3.4.113-sun8i/modules.symbols.bin", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=121133, ...}) = 0

mmap2(NULL, 121133, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6e1b000

close(3)                                = 0

open("/lib/modules/3.4.113-sun8i/modules.builtin.bin", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=11690, ...}) = 0

mmap2(NULL, 11690, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6e18000

close(3)                                = 0

open("/sys/module/g_hid/initstate", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/sys/module/g_hid", 0xbe8e6818) = -1 ENOENT (No such file or directory)

open("/sys/module/g_hid/initstate", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/sys/module/g_hid", 0xbe8e6818) = -1 ENOENT (No such file or directory)

open("/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=38900, ...}) = 0

mmap2(NULL, 38900, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6e0e000

finit_module(3, "", 0)                  = -1 ENOSYS (Function not implemented)

init_module(0xb6e0e000, 38900, "")      = -1 ENODEV (No such device)

write(2, "modprobe: ERROR: could not inser"..., 58modprobe: ERROR: could not insert 'g_hid': No such device

) = 58

munmap(0xb6e0e000, 38900)               = 0

close(3)                                = 0

munmap(0xb6e90000, 169464)              = 0

munmap(0xb6e39000, 355263)              = 0

munmap(0xb6e1b000, 121133)              = 0

munmap(0xb6e18000, 11690)               = 0

exit_group(1)                           = ?

+++ exited with 1 +++
 
root@orangepizero:/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget# modprobe g_hid
modprobe: ERROR: could not insert 'g_hid': No such device

orangepizero:/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget# ls
g_cdc.ko  g_ether.ko  g_hid.ko  g_mass_storage.ko  g_multi.ko  g_ncm.ko  g_printer.ko  g_serial.ko

root@orangepizero:~# modprobe -v -v -v g_hid
modprobe: INFO: ../libkmod/libkmod.c:354 kmod_set_log_fn() custom logging function 0xb6f5ba6d registered
modprobe: DEBUG: ../libkmod/libkmod-index.c:790 index_mm_open() file=/lib/modules/3.4.113-sun8i/modules.dep.bin
modprobe: DEBUG: ../libkmod/libkmod-index.c:790 index_mm_open() file=/lib/modules/3.4.113-sun8i/modules.alias.bin
modprobe: DEBUG: ../libkmod/libkmod-index.c:790 index_mm_open() file=/lib/modules/3.4.113-sun8i/modules.symbols.bin
modprobe: DEBUG: ../libkmod/libkmod-index.c:790 index_mm_open() file=/lib/modules/3.4.113-sun8i/modules.builtin.bin
modprobe: DEBUG: ../libkmod/libkmod-module.c:540 kmod_module_new_from_lookup() input alias=g_hid, normalized=g_hid
modprobe: DEBUG: ../libkmod/libkmod-module.c:546 kmod_module_new_from_lookup() lookup modules.dep g_hid
modprobe: DEBUG: ../libkmod/libkmod.c:545 kmod_search_moddep() use mmaped index 'modules.dep' modname=g_hid
modprobe: DEBUG: ../libkmod/libkmod.c:392 kmod_pool_get_module() get module name='g_hid' found=(nil)
modprobe: DEBUG: ../libkmod/libkmod.c:400 kmod_pool_add_module() add 0xb80763d0 key='g_hid'
modprobe: DEBUG: ../libkmod/libkmod-module.c:196 kmod_module_parse_depline() 0 dependencies for g_hid
modprobe: DEBUG: ../libkmod/libkmod-module.c:567 kmod_module_new_from_lookup() lookup g_hid=0, list=0xb8076520
modprobe: DEBUG: ../libkmod/libkmod-module.c:1726 kmod_module_get_initstate() could not open '/sys/module/g_hid/initstate': No such file or directory

modprobe: DEBUG: ../libkmod/libkmod-module.c:1736 kmod_module_get_initstate() could not open '/sys/module/g_hid': No such file or directory
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=snd_pcsp mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=snd_usb_audio mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=cx88_alsa mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=snd_atiixp_modem mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=snd_intel8x0m mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=snd_via82xx_modem mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=xradio_wlan mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=hdmi mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1374 kmod_module_get_options() modname=disp mod->name=g_hid mod->alias=(null)
modprobe: DEBUG: ../libkmod/libkmod-module.c:1726 kmod_module_get_initstate() could not open '/sys/module/g_hid/initstate': No such file or directory

modprobe: DEBUG: ../libkmod/libkmod-module.c:1736 kmod_module_get_initstate() could not open '/sys/module/g_hid': No such file or directory
modprobe: DEBUG: ../libkmod/libkmod-module.c:728 kmod_module_get_path() name='g_hid' path='/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko'
modprobe: DEBUG: ../libkmod/libkmod-module.c:728 kmod_module_get_path() name='g_hid' path='/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko'
insmod /lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko
modprobe: DEBUG: ../libkmod/libkmod-module.c:728 kmod_module_get_path() name='g_hid' path='/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko'
modprobe: INFO: ../libkmod/libkmod-module.c:868 kmod_module_insert_module() Failed to insert module '/lib/modules/3.4.113-sun8i/kernel/drivers/usb/gadget/g_hid.ko': No such device
modprobe: ERROR: could not insert 'g_hid': No such device
modprobe: DEBUG: ../libkmod/libkmod-module.c:452 kmod_module_unref() kmod_module 0xb80763d0 released
modprobe: DEBUG: ../libkmod/libkmod.c:408 kmod_pool_del_module() del 0xb80763d0 key='g_hid'
modprobe: INFO: ../libkmod/libkmod.c:321 kmod_unref() context 0xb8076128 released

 

 

 

There's similar issue with g_multi module. All other loads fine.

Link to comment
Share on other sites

Why are you using the Nano Pi Air image on a OPi Zero instead of the OPi Zero specific image?

 

My mistake, i pasted wrong "link". In fact, i'm using Armbian_5.24_Orangepizero_Debian_jessie_3.4.113 obviously. I've recompiled kernel and compiled g_hid (with patched hid.c) into the kernel instead using it as a module as suggested here and i can see keyboard being emulated and working. Still, i need both keyboard and mouse, plus having it as a module would be a better option since that way you're limited to only single usb gadget and can't switch between g_serial, g_ether and g_hid if, for example, you need that.

Link to comment
Share on other sites

I've updated sun8i-h2-plus-orangepi-zero.dts (4.9x Linux) to include cpu thermal trip points and included the THS driver.  Able read the temp, /sys/class/thermal/thermal_zone0/temp reports   around 33794.

 

How to test to see if CPU throttling is working? 

Link to comment
Share on other sites

Not that involved in armbian, but it seems like good progress is being made here to support the Orange Pi Zero.

 

Just wanted to let you know that I patched Linux 4.9-rc8 with the emac patches and Ethernet is working. I tried the same kernel on the Orange Pi Zero with the Orange Pi PC dts and it works. Can't really guess how bad this is for my Orange Pi Zero, but it only uses around 400mW idle, SoC is not hot to the touch (no heat sink).

 

H3 emac support should arrive soon in mainline (4.10 maybe?), so my work isn't that relevant.

 

GitHub gist to patch/build 4.9-rc8 with emac: https://gist.github.com/halmartin/dcdaf3b14460a3c17c31f5a12438567f

Rambling about it on my blog: https://watchmysys.com/blog/2016/12/allwinner-h3-h2-linux-49-ethernet/

 

Hope this helps someone.

Link to comment
Share on other sites

How to test to see if CPU throttling is working? 

 

Just grab cpuburn-a7, run it and do a 'sudo armbianmonitor -m' in another shell to watch temperatures and cpufreq.

 

Just wanted to let you know that I patched Linux 4.9-rc8 with the emac patches and Ethernet is working. I tried the same kernel on the Orange Pi Zero with the Orange Pi PC dts and it works.

 

They have different voltage regulators so that's not the best idea. Armbian's build system partially supported Ethernet with mainline kernel since April (I have a few H3 GbE boards still in production running with 4.4) and we switched back 11 days ago to a repo with Ethernet, ths (thermal/throttling stuff) and even HDMI working. We just don't provide mainline kernel images now but using our build system complete OS images (or just kernel+modules) can be built. Some information: https://github.com/igorpecovnik/lib/issues/508

 

What's still missing in Armbian (since no one took the time to collect @dgp's bits of work, assemble them as a patch and pushes it to Armbian repo): Wi-Fi with mainline kernel. But everything's already there, it's just a few posts above: https://forum.armbian.com/index.php/topic/2808-orange-pi-zero-went-to-the-market/?p=20329

Link to comment
Share on other sites

What's still missing in Armbian (since no one took the time to collect @dgp's bits of work, assemble them as a patch and pushes it to Armbian repo): Wi-Fi with mainline kernel. But everything's already there, it's just a few posts above: https://forum.armbian.com/index.php/topic/2808-orange-pi-zero-went-to-the-market/?p=20329

 

Okay, I have the XR819 driver compiling against https://github.com/megous/linux/(this is the kernel source Armbian appears to have switched to).

 

linux-49-xradio.png

 

Should I submit a pull request to the above repo, or to the Armbian repo?

 

Not sure where the firmware for the radio comes from though, I just grabbed it out of the Armbian image.

 

Pull request submitted to megous/linux...

Link to comment
Share on other sites

Pull request submitted to megous/linux...

 

Thanks a lot. I wanted to do this myself but since I managed to break Wi-Fi on my OPi Zero and am unable to test I always postponed it. Let's hope megi accept's the PR soom and one of the Armbian devs who is able to test activates the necessary bits in board and kernel config.

 

BTW: Firmware for the chip we found in H2 SDK.

Link to comment
Share on other sites

That is good news !

So, I've started trying this out even before PR been merged.

It compiled fine, but boot freeze ...

Early investigation : boot freeze isn't related with xradio, but related with branch switch.

Using DTB from sun8i-emac-wip-v5 branch along with this new build binaries is Ok.

So, something is wrong in DT of orange-pi-4.9 branch for Zero !

More investigations tomorrow ...

Link to comment
Share on other sites

It compiled fine, but boot freeze ...

So, something is wrong in DT of orange-pi-4.9 branch for Zero !

 

I did think my PR did not include enough commits. I have a working kernel for Orange Pi Zero, but not with the other commits that have been included in the PR since my two. This includes a lot of work on support for Orange Pi Zero/PC.

 

To be clear: the kernel I have booting is only the megous:orange-pi-4.9 branch plus the two commits on my branch. The other 55 commits in the PR are not added by me, and I haven't tested. I can test, but I am not sure how to pull the extra commits in PR into my branch.

 

Note I am using Orange Pi PC defconfig for u-boot. Is there an Orange Pi Zero defconfig for u-boot? I can't find one in u-boot tree from denx. tkaiser will advise me on what a bad idea this is  ;)

 

Boot log:

U-Boot SPL 2016.11 (Dec 06 2016 - 22:52:18)
DRAM: 512 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from MMC1


U-Boot 2016.11 (Dec 06 2016 - 22:52:18 +0100) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi PC
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet@1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
USB4:   USB EHCI 1.00
USB5:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 4 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  2  1  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
454 bytes read in 69 ms (5.9 KiB/s)
## Executing script at 43100000
reading uImage
2362984 bytes read in 226 ms (10 MiB/s)
reading sun8i-h2-orangepi-zero.dtb
18997 bytes read in 81 ms (228.5 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-4.9.0-rc7
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2362920 Bytes = 2.3 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Kernel Image ... OK
   Using Device Tree in place at 43000000, end 43007a34

Starting kernel ...

dmesg:

 

 

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-rc7 (hmartin@hanau) (gcc version 6.2.0 (Arch Repository) ) #4 SMP Sun Dec 11 16:51:44 CET 2016
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Xunlong Orange Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 131072
[    0.000000] free_area_init_node: node 0, pgdat c0741380, node_mem_map dfba0000
[    0.000000]   Normal zone: 1024 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 131072 pages, LIFO batch:31
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 14 pages/cpu @dffb0000 s25612 r8192 d23540 u57344
[    0.000000] pcpu-alloc: s25612 r8192 d23540 u57344 alloc=14*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 512800K/524288K available (3072K kernel code, 262K rwdata, 1068K rodata, 1024K init, 230K bss, 11488K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf800000 - 0xc0000000   (   8 MB)
      .text : 0xc0008000 - 0xc0400000   (4064 kB)
      .init : 0xc0600000 - 0xc0700000   (1024 kB)
      .data : 0xc0700000 - 0xc0741a00   ( 263 kB)
       .bss : 0xc0743000 - 0xc077cb4c   ( 231 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (phys).
 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000012] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000038] Switching to timer-based delay loop, resolution 41ns
[    0.000455] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.001178] Console: colour dummy device 80x30
[    0.001222] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.001246] pid_max: default: 32768 minimum: 301
[    0.001510] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001530] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.002715] CPU: Testing write buffer coherency: ok
[    0.003118] CPU0: update cpu_capacity 1024
[    0.003140] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003186] Setting up static identity map for 0x40100000 - 0x4010004c
[    0.016053] CPU1: update cpu_capacity 1024
[    0.016066] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.027148] CPU2: update cpu_capacity 1024
[    0.027160] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.038231] CPU3: update cpu_capacity 1024
[    0.038243] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.038370] Brought up 4 CPUs
[    0.038431] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[    0.038445] CPU: All CPU(s) started in HYP mode.
[    0.038456] CPU: Virtualization extensions available.
[    0.040022] devtmpfs: initialized
[    0.051097] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.051574] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.051763] pinctrl core: initialized pinctrl subsystem
[    0.053258] NET: Registered protocol family 16
[    0.053817] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.078063] cpuidle: using governor ladder
[    0.118108] cpuidle: using governor menu
[    0.118320] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.118336] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.145320] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc/pinctrl@01f02c00/usb0_vbus_pin@0, deferring probe
[    0.146891] gpio-regulator vdd_cpu: could not find pctldev for node /soc/pinctrl@01f02c00/vdd_cpu_pins@0, deferring probe
[    0.147520] SCSI subsystem initialized
[    0.148008] usbcore: registered new interface driver usbfs
[    0.148134] usbcore: registered new interface driver hub
[    0.148296] usbcore: registered new device driver usb
[    0.151253] clocksource: Switched to clocksource arch_sys_counter
[    0.151719] FS-Cache: Loaded
[    0.171036] NET: Registered protocol family 2
[    0.172302] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.172414] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.172564] TCP: Hash tables configured (established 4096 bind 4096)
[    0.172652] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.172704] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.173014] NET: Registered protocol family 1
[    0.175711] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.176825] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.184572] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.184597] io scheduler noop registered
[    0.184612] io scheduler deadline registered
[    0.184668] io scheduler cfq registered (default)
[    0.185260] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/pinctrl@01c20800/usb0_id_detect_pin@0, deferring probe
[    0.195191] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.198997] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[    0.328013] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.331651] console [ttyS0] disabled
[    0.351884] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 35, base_baud = 1500000) is a U6_16550A
[    0.907075] console [ttyS0] enabled
[    0.912855] libphy: Fixed MDIO Bus: probed
[    0.918674] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.925255] ehci-platform: EHCI generic platform driver
[    0.930984] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.937227] ohci-platform: OHCI generic platform driver
[    0.943049] usbcore: registered new interface driver usb-storage
[    0.949629] udc-core: couldn't find an available UDC - added [zero] to list of pending drivers
[    0.958912] mousedev: PS/2 mouse device common for all mice
[    0.965543] sun6i-rtc 1f00000.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.972375] sun6i-rtc 1f00000.rtc: RTC enabled
[    0.976920] i2c /dev entries driver
[    0.981255] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.991635] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.051384] sunxi-mmc 1c0f000.mmc: base:0xe0861000 irq:23
[    1.059924] usbcore: registered new interface driver usbhid
[    1.065574] usbhid: USB HID core driver
[    1.070104] NET: Registered protocol family 10
[    1.076223] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.083708] NET: Registered protocol family 17
[    1.088383] Registering SWP/SWPB emulation handler
[    1.106988] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.112686] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.120633] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    1.138176] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.148170] mmc0: new high speed SDHC card at address 0001
[    1.151291] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.151647] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.151663] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.151675] usb usb1: Product: EHCI Host Controller
[    1.151687] usb usb1: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.151699] usb usb1: SerialNumber: 1c1a000.usb
[    1.152918] hub 1-0:1.0: USB hub found
[    1.152983] hub 1-0:1.0: 1 port detected
[    1.154153] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.154202] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 2
[    1.154390] ehci-platform 1c1b000.usb: irq 28, io mem 0x01c1b000
[    1.181299] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[    1.181616] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.181633] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.181645] usb usb2: Product: EHCI Host Controller
[    1.181656] usb usb2: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.181668] usb usb2: SerialNumber: 1c1b000.usb
[    1.182821] hub 2-0:1.0: USB hub found
[    1.182884] hub 2-0:1.0: 1 port detected
[    1.259656] mmcblk0: mmc0:0001 00000 29.8 GiB 
[    1.265798]  mmcblk0: p1 p2
[    1.341468] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.348132] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 3
[    1.356110] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    1.435593] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    1.442430] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.449657] usb usb3: Product: Generic Platform OHCI controller
[    1.455609] usb usb3: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.461301] usb usb3: SerialNumber: 1c1a400.usb
[    1.467003] hub 3-0:1.0: USB hub found
[    1.470821] hub 3-0:1.0: 1 port detected
[    1.475959] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    1.482651] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4
[    1.490557] ohci-platform 1c1b400.usb: irq 29, io mem 0x01c1b400
[    1.565588] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    1.572426] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.579654] usb usb4: Product: Generic Platform OHCI controller
[    1.585610] usb usb4: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.591303] usb usb4: SerialNumber: 1c1b400.usb
[    1.597050] hub 4-0:1.0: USB hub found
[    1.600867] hub 4-0:1.0: 1 port detected
[    1.606150] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.614097] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.619861] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[    1.628105] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[    1.634939] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.642198] usb usb5: Product: MUSB HDRC host driver
[    1.647171] usb usb5: Manufacturer: Linux 4.9.0-rc7 musb-hcd
[    1.652864] usb usb5: SerialNumber: musb-hdrc.1.auto
[    1.659040] hub 5-0:1.0: USB hub found
[    1.662901] hub 5-0:1.0: 1 port detected
[    1.711733] udc musb-hdrc.1.auto: registering UDC driver [zero]
[    1.711786] zero gadget: adding 'source/sink'/df4d29c0 to config 'source/sink'/c0736940
[    1.711814] zero gadget: dual speed source/sink: IN/ep1in, OUT/ep1out, ISO-IN/<none>, ISO-OUT/<none>
[    1.711828] zero gadget: adding 'loopback'/dec43280 to config 'loopback'/c07369b4
[    1.711844] zero gadget: dual speed loopback: IN/ep1in, OUT/ep1out
[    1.711861] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
[    1.717958] zero gadget: zero ready
[    1.723589] thermal thermal_zone0: binding zone cpu_thermal with cdev thermal-cpufreq-0 failed:-22
[    1.734156] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    1.951245] sunxi-mmc 1c10000.mmc: base:0xe0890000 irq:24
[    1.956826] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01 00:00:11 UTC (11)
[    1.965102] vcc3v0: disabling
[    1.968070] vcc5v0: disabling
[    1.970967] mmc1: new high speed SDIO card at address 0001
[    1.977770] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
atibilities
[    2.007358] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.015644] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.028941] Freeing unused kernel memory: 1024K (c0600000 - c0700000)
[    2.244861] random: systemd: uninitialized urandom read (16 bytes read)
[    2.253941] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    2.268072] systemd[1]: Detected architecture 'arm'.
[    2.286389] systemd[1]: Set hostname to <OrangePI>.
[    2.388702] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read)
[    2.478001] random: systemd: uninitialized urandom read (16 bytes read)
[    2.485208] random: systemd: uninitialized urandom read (16 bytes read)
[    2.493349] random: systemd: uninitialized urandom read (16 bytes read)
[    2.514923] random: systemd: uninitialized urandom read (16 bytes read)
[    2.522384] random: systemd: uninitialized urandom read (16 bytes read)
[    2.529267] random: systemd: uninitialized urandom read (16 bytes read)
[    2.574544] random: systemd: uninitialized urandom read (16 bytes read)
[    2.581281] random: systemd: uninitialized urandom read (16 bytes read)
[    2.662321] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    2.679990] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    2.688063] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.695755] systemd[1]: Expecting device dev-ttyS0.device...
[    2.701736] systemd[1]: Starting Remote File Systems (Pre).
[    2.708115] systemd[1]: Reached target Remote File Systems (Pre).
[    2.717919] systemd[1]: Starting Encrypted Volumes.
[    2.878157] random: fast init done
[    3.081324] systemd-udevd[119]: starting version 215
[    8.114104] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
[    8.252532] systemd-journald[102]: Received request to flush runtime journal from PID 1
[   18.480354] libphy: 1c30000.ethernet: probed
[   18.591741] Generic PHY 1c30000.ethernet:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1c30000.ethernet:01, irq=-1)
[   18.603084] sun8i-emac 1c30000.ethernet: device MAC address slot 0 02:20:64:aa:bb:cc
[   18.698903] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   21.762526] sun8i-emac 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   21.771123] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

 

 

Edited by hmartin
Link to comment
Share on other sites

Okay, I have the XR819 driver compiling against https://github.com/megous/linux/(this is the kernel source Armbian appears to have switched to).

 

Pull request submitted to megous/linux...

 

Might what to review the patches for the zero:

https://groups.google.com/forum/#!topic/linux-sunxi/mdrG_TVmzUE

 

I was doing the same thing:

- Used patches from SUNXI

- added Ethernet, and  CPUX regulator support

 

For u-boot I'm using orangePI-ONE defconfig.  IMHO, The Zero is more like the orangePI-ONE then the OrangePI-PC

 

FYI: I'm using buildroot.

Link to comment
Share on other sites

Further investigations : I did a fresh image build without the XR819 patches, using orangepi-4.9.0 branch, and it freeze during boot same way as before.

Last entries of serial log are :

[  OK  ] Listening on Syslog Socket.
         Starting Journal Service...
[  OK  ] Started Journal Service.
[  OK  ] Mounted Configuration File System.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Create Static Device Nodes in /dev.
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Kernel Device Manager.
         Starting Copy rules generated while the root was ro...
         Starting LSB: Tune IDE hard disks...
         Starting LSB: Set preliminary keymap...
[  OK  ] Started Copy rules generated while the root was ro.
[  OK  ] Started LSB: Tune IDE hard disks.

I've then took a copy of the sun8i-h3-orangepi-one.dtb from sun8i-emac-wip-v5 branch, and it boot properly.

 

So, there is definitively something wrong in DTS of the orangepi-4.9.0 branch.

 

(It is probably not booting on a PiOne either, but I didn't try that yet.)

 

EDIT : Ok ! it seems to be related with "cpufreq_init", if I remove the cpu0/operating-points/cpu_thermal sections in DTS, it is booting ...

(I remember facing similar issues 6 months ago, but I don't remember what changes were required, missing freq or something like)

Link to comment
Share on other sites

Which u-boot version and u-boot defconfig is everyone using?

 

Failure: u-boot v2016.11 with orangepi_one_defconfig, I get a freeze on boot.

Success: u-boot v2016.11 with orangepi_pc_defconfig, I get it to boot successfully.

 

I know Orange Pi One should be closer to Orange Pi Zero than Orange Pi PC. But it seems there is some bug between u-boot orangepi_one and this kernel which prevents booting. More investigation is needed.

 

Freeze on boot with orangepi_one_defconfig:

 

 

U-Boot SPL 2016.11 (Dec 12 2016 - 20:16:52)
DRAM: 512 MiB
Trying to boot from MMC1


U-Boot 2016.11 (Dec 12 2016 - 20:16:52 +0100) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet@1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 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...
Found U-Boot script /boot.scr
reading /boot.scr
454 bytes read in 71 ms (5.9 KiB/s)
## Executing script at 43100000
reading uImage
2362984 bytes read in 155 ms (14.5 MiB/s)
reading sun8i-h2-orangepi-zero.dtb
18997 bytes read in 80 ms (231.4 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-4.9.0-rc7
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2362920 Bytes = 2.3 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Kernel Image ... OK
   Using Device Tree in place at 43000000, end 43007a34

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-rc7 (hmartin@hanau) (gcc version 6.2.0 (Arch Repository) ) #4 SMP Sun Dec 11 16:51:44 CET 2016
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Xunlong Orange Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 14 pages/cpu @dffb0000 s25612 r8192 d23540 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 512800K/524288K available (3072K kernel code, 262K rwdata, 1068K rodata, 1024K init, 230K bss, 11488K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf800000 - 0xc0000000   (   8 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0400000   (4064 kB)
[    0.000000]       .init : 0xc0600000 - 0xc0700000   (1024 kB)
[    0.000000]       .data : 0xc0700000 - 0xc0741a00   ( 263 kB)
[    0.000000]        .bss : 0xc0743000 - 0xc077cb4c   ( 231 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000005] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000016] Switching to timer-based delay loop, resolution 41ns
[    0.000189] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000519] Console: colour dummy device 80x30
[    0.000542] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000552] pid_max: default: 32768 minimum: 301
[    0.000677] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000686] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001259] CPU: Testing write buffer coherency: ok
[    0.001489] CPU0: update cpu_capacity 1024
[    0.001499] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001524] Setting up static identity map for 0x40100000 - 0x4010004c
[    0.012947] CPU1: update cpu_capacity 1024
[    0.012952] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.023541] CPU2: update cpu_capacity 1024
[    0.023546] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.034117] CPU3: update cpu_capacity 1024
[    0.034122] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.034177] Brought up 4 CPUs
[    0.034204] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[    0.034210] CPU: All CPU(s) started in HYP mode.
[    0.034214] CPU: Virtualization extensions available.
[    0.034956] devtmpfs: initialized
[    0.039625] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.039848] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.039938] pinctrl core: initialized pinctrl subsystem
[    0.040635] NET: Registered protocol family 16
[    0.040896] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.063942] cpuidle: using governor ladder
[    0.103961] cpuidle: using governor menu
[    0.104055] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.104062] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.115277] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc/pinctrl@01f02c00/usb0_vbus_pin@0, deferring probe
[    0.115939] gpio-regulator vdd_cpu: could not find pctldev for node /soc/pinctrl@01f02c00/vdd_cpu_pins@0, deferring probe
[    0.116217] SCSI subsystem initialized
[    0.116427] usbcore: registered new interface driver usbfs
[    0.116480] usbcore: registered new interface driver hub
[    0.116547] usbcore: registered new device driver usb
[    0.117863] clocksource: Switched to clocksource arch_sys_counter
[    0.118084] FS-Cache: Loaded
[    0.125968] NET: Registered protocol family 2
[    0.126521] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.126566] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.126627] TCP: Hash tables configured (established 4096 bind 4096)
[    0.126669] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.126700] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.126853] NET: Registered protocol family 1
[    0.128086] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.128668] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.131982] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.131995] io scheduler noop registered
[    0.132001] io scheduler deadline registered
[    0.132026] io scheduler cfq registered (default)
[    0.132300] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/pinctrl@01c20800/usb0_id_detect_pin@0, deferring probe
[    0.136504] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.138168] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[    0.190027] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.191687] console [ttyS0] disabled
[    0.211823] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 35, base_baud = 1500000) is a U6_16550A
[    0.765820] console [ttyS0] enabled
[    0.770297] libphy: Fixed MDIO Bus: probed
[    0.775184] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.781736] ehci-platform: EHCI generic platform driver
[    0.787180] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.793383] ohci-platform: OHCI generic platform driver
[    0.798857] usbcore: registered new interface driver usb-storage
[    0.805096] udc-core: couldn't find an available UDC - added [zero] to list of pending drivers
[    0.813996] mousedev: PS/2 mouse device common for all mice
[    0.820042] sun6i-rtc 1f00000.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.826823] sun6i-rtc 1f00000.rtc: RTC enabled
[    0.831316] i2c /dev entries driver
[    0.835150] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.844154] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    0.907891] sunxi-mmc 1c0f000.mmc: base:0xe0861000 irq:23
[    0.914626] usbcore: registered new interface driver usbhid
[    0.920222] usbhid: USB HID core driver
[    0.924386] NET: Registered protocol family 10
[    0.929616] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.936185] NET: Registered protocol family 17
[    0.940763] Registering SWP/SWPB emulation handler
[    0.951925] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.957531] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.965411] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    0.997881] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.004137] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.010949] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.018182] usb usb1: Product: EHCI Host Controller
[    1.023061] usb usb1: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.028732] usb usb1: SerialNumber: 1c1a000.usb
[    1.033818] hub 1-0:1.0: USB hub found
[    1.037602] hub 1-0:1.0: 1 port detected
[    1.042076] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.047674] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 2
[    1.055429] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.055517] ehci-platform 1c1b000.usb: irq 28, io mem 0x01c1b000
[    1.071256] mmc0: new high speed SDHC card at address 0001
[    1.077159] mmcblk0: mmc0:0001 00000 29.8 GiB 
[    1.077877] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[    1.078020] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.078027] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.078032] usb usb2: Product: EHCI Host Controller
[    1.078037] usb usb2: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.078041] usb usb2: SerialNumber: 1c1b000.usb
[    1.078543] hub 2-0:1.0: USB hub found
[    1.078571] hub 2-0:1.0: 1 port detected
[    1.125471]  mmcblk0: p1 p2
[    1.187971] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.194601] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 3
[    1.202448] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    1.282011] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    1.288809] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.296022] usb usb3: Product: Generic Platform OHCI controller
[    1.301945] usb usb3: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.307596] usb usb3: SerialNumber: 1c1a400.usb
[    1.312640] hub 3-0:1.0: USB hub found
[    1.316411] hub 3-0:1.0: 1 port detected
[    1.320863] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    1.327486] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4
[    1.335316] ohci-platform 1c1b400.usb: irq 29, io mem 0x01c1b400
[    1.412016] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    1.418814] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.426027] usb usb4: Product: Generic Platform OHCI controller
[    1.431952] usb usb4: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.437604] usb usb4: SerialNumber: 1c1b400.usb
[    1.442646] hub 4-0:1.0: USB hub found
[    1.446416] hub 4-0:1.0: 1 port detected
[    1.450920] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.458457] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.464200] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[    1.472198] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[    1.478995] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.486208] usb usb5: Product: MUSB HDRC host driver
[    1.491179] usb usb5: Manufacturer: Linux 4.9.0-rc7 musb-hcd
[    1.496831] usb usb5: SerialNumber: musb-hdrc.1.auto
[    1.502327] hub 5-0:1.0: USB hub found
[    1.506099] hub 5-0:1.0: 1 port detected
[    1.558126] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
[    1.564212] zero gadget: zero ready
[    1.568692] thermal thermal_zone0: binding zone cpu_thermal with cdev thermal-cpufreq-0 failed:-22
[    1.578421] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    1.797879] sunxi-mmc 1c10000.mmc: base:0xe0890000 irq:24
[    1.803457] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01 00:00:07 UTC (7)
[    1.811671] vcc3v0: disabling
[    1.814639] vcc5v0: disabling
[    1.817580] mmc1: new high speed SDIO card at address 0001

Successful boot with orangepi_pc_defconfig:

U-Boot SPL 2016.11 (Dec 12 2016 - 20:22:53)
DRAM: 512 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from MMC1


U-Boot 2016.11 (Dec 12 2016 - 20:22:53 +0100) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi PC
I2C:   ready
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet@1c30000
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
USB4:   USB EHCI 1.00
USB5:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 4 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...
Found U-Boot script /boot.scr
reading /boot.scr
454 bytes read in 72 ms (5.9 KiB/s)
## Executing script at 43100000
reading uImage
2362984 bytes read in 226 ms (10 MiB/s)
reading sun8i-h2-orangepi-zero.dtb
18997 bytes read in 81 ms (228.5 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-4.9.0-rc7
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2362920 Bytes = 2.3 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Kernel Image ... OK
   Using Device Tree in place at 43000000, end 43007a34

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-rc7 (hmartin@hanau) (gcc version 6.2.0 (Arch Repository) ) #4 SMP Sun Dec 11 16:51:44 CET 2016
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Xunlong Orange Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 14 pages/cpu @dffb0000 s25612 r8192 d23540 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 512800K/524288K available (3072K kernel code, 262K rwdata, 1068K rodata, 1024K init, 230K bss, 11488K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf800000 - 0xc0000000   (   8 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0400000   (4064 kB)
[    0.000000]       .init : 0xc0600000 - 0xc0700000   (1024 kB)
[    0.000000]       .data : 0xc0700000 - 0xc0741a00   ( 263 kB)
[    0.000000]        .bss : 0xc0743000 - 0xc077cb4c   ( 231 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000012] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000037] Switching to timer-based delay loop, resolution 41ns
[    0.000453] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.001178] Console: colour dummy device 80x30
[    0.001222] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.001246] pid_max: default: 32768 minimum: 301
[    0.001512] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001532] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.002713] CPU: Testing write buffer coherency: ok
[    0.003123] CPU0: update cpu_capacity 1024
[    0.003144] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.003191] Setting up static identity map for 0x40100000 - 0x4010004c
[    0.016057] CPU1: update cpu_capacity 1024
[    0.016071] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.027154] CPU2: update cpu_capacity 1024
[    0.027166] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.038240] CPU3: update cpu_capacity 1024
[    0.038252] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.038381] Brought up 4 CPUs
[    0.038440] SMP: Total of 4 processors activated (192.00 BogoMIPS).
[    0.038454] CPU: All CPU(s) started in HYP mode.
[    0.038465] CPU: Virtualization extensions available.
[    0.040043] devtmpfs: initialized
[    0.051116] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.051583] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.051773] pinctrl core: initialized pinctrl subsystem
[    0.053266] NET: Registered protocol family 16
[    0.053826] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.078072] cpuidle: using governor ladder
[    0.118117] cpuidle: using governor menu
[    0.118329] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.118346] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.145297] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc/pinctrl@01f02c00/usb0_vbus_pin@0, deferring probe
[    0.146866] gpio-regulator vdd_cpu: could not find pctldev for node /soc/pinctrl@01f02c00/vdd_cpu_pins@0, deferring probe
[    0.147494] SCSI subsystem initialized
[    0.147977] usbcore: registered new interface driver usbfs
[    0.148109] usbcore: registered new interface driver hub
[    0.148270] usbcore: registered new device driver usb
[    0.151252] clocksource: Switched to clocksource arch_sys_counter
[    0.151706] FS-Cache: Loaded
[    0.171085] NET: Registered protocol family 2
[    0.172346] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.172457] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.172606] TCP: Hash tables configured (established 4096 bind 4096)
[    0.172691] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.172745] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.173051] NET: Registered protocol family 1
[    0.175753] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.176884] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.184648] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.184673] io scheduler noop registered
[    0.184689] io scheduler deadline registered
[    0.184751] io scheduler cfq registered (default)
[    0.185330] sun4i-usb-phy 1c19400.phy: could not find pctldev for node /soc/pinctrl@01c20800/usb0_id_detect_pin@0, deferring probe
[    0.195364] sun8i-h3-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.199129] sun8i-h3-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[    0.326365] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.329943] console [ttyS0] disabled
[    0.350189] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 35, base_baud = 1500000) is a U6_16550A
[    0.905376] console [ttyS0] enabled
[    0.911106] libphy: Fixed MDIO Bus: probed
[    0.917000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.923581] ehci-platform: EHCI generic platform driver
[    0.929317] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.935579] ohci-platform: OHCI generic platform driver
[    0.941403] usbcore: registered new interface driver usb-storage
[    0.947961] udc-core: couldn't find an available UDC - added [zero] to list of pending drivers
[    0.957259] mousedev: PS/2 mouse device common for all mice
[    0.963882] sun6i-rtc 1f00000.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.970679] sun6i-rtc 1f00000.rtc: RTC enabled
[    0.975258] i2c /dev entries driver
[    0.979559] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.989901] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.051315] sunxi-mmc 1c0f000.mmc: base:0xe0861000 irq:23
[    1.059890] usbcore: registered new interface driver usbhid
[    1.065535] usbhid: USB HID core driver
[    1.070059] NET: Registered protocol family 10
[    1.076248] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.083754] NET: Registered protocol family 17
[    1.088427] Registering SWP/SWPB emulation handler
[    1.106762] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.112463] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.120405] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    1.138227] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.148224] mmc0: new high speed SDHC card at address 0001
[    1.151296] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.151651] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.151667] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.151679] usb usb1: Product: EHCI Host Controller
[    1.151691] usb usb1: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.151703] usb usb1: SerialNumber: 1c1a000.usb
[    1.152933] hub 1-0:1.0: USB hub found
[    1.153000] hub 1-0:1.0: 1 port detected
[    1.154160] ehci-platform 1c1b000.usb: EHCI Host Controller
[    1.154208] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 2
[    1.154406] ehci-platform 1c1b000.usb: irq 28, io mem 0x01c1b000
[    1.181301] ehci-platform 1c1b000.usb: USB 2.0 started, EHCI 1.00
[    1.181619] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    1.181635] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.181648] usb usb2: Product: EHCI Host Controller
[    1.181659] usb usb2: Manufacturer: Linux 4.9.0-rc7 ehci_hcd
[    1.181670] usb usb2: SerialNumber: 1c1b000.usb
[    1.182806] hub 2-0:1.0: USB hub found
[    1.182867] hub 2-0:1.0: 1 port detected
[    1.259699] mmcblk0: mmc0:0001 00000 29.8 GiB 
[    1.265787]  mmcblk0: p1 p2
[    1.341470] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.348141] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 3
[    1.356114] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    1.435597] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    1.442434] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.449662] usb usb3: Product: Generic Platform OHCI controller
[    1.455615] usb usb3: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.461307] usb usb3: SerialNumber: 1c1a400.usb
[    1.467037] hub 3-0:1.0: USB hub found
[    1.470853] hub 3-0:1.0: 1 port detected
[    1.475998] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    1.482688] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 4
[    1.490580] ohci-platform 1c1b400.usb: irq 29, io mem 0x01c1b400
[    1.565587] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    1.572425] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.579653] usb usb4: Product: Generic Platform OHCI controller
[    1.585609] usb usb4: Manufacturer: Linux 4.9.0-rc7 ohci_hcd
[    1.591302] usb usb4: SerialNumber: 1c1b400.usb
[    1.597051] hub 4-0:1.0: USB hub found
[    1.600871] hub 4-0:1.0: 1 port detected
[    1.606167] usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.614122] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.619885] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[    1.628125] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[    1.634962] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.642220] usb usb5: Product: MUSB HDRC host driver
[    1.647192] usb usb5: Manufacturer: Linux 4.9.0-rc7 musb-hcd
[    1.652885] usb usb5: SerialNumber: musb-hdrc.1.auto
[    1.659063] hub 5-0:1.0: USB hub found
[    1.662916] hub 5-0:1.0: 1 port detected
[    1.711877] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
[    1.717974] zero gadget: zero ready
[    1.723598] thermal thermal_zone0: binding zone cpu_thermal with cdev thermal-cpufreq-0 failed:-22
[    1.734153] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[    1.951249] sunxi-mmc 1c10000.mmc: base:0xe0890000 irq:24
[    1.956834] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01 00:00:11 UTC (11)
[    1.965113] vcc3v0: disabling
[    1.968080] vcc5v0: disabling
[    1.970856] mmc1: new high speed SDIO card at address 0001
[    1.987719] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.996943] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[    2.029526] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.037805] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.051054] Freeing unused kernel memory: 1024K (c0600000 - c0700000)
[    2.274903] random: systemd: uninitialized urandom read (16 bytes read)
[    2.283972] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    2.298131] systemd[1]: Detected architecture 'arm'.

Welcome to Debian GNU/Linux 8 (jessie)!

[    2.335092] systemd[1]: Set hostname to <OrangePI>.
[    2.415261] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read)
[    2.523749] random: systemd: uninitialized urandom read (16 bytes read)
[    2.530898] random: systemd: uninitialized urandom read (16 bytes read)
[    2.539056] random: systemd: uninitialized urandom read (16 bytes read)
[    2.560420] random: systemd: uninitialized urandom read (16 bytes read)
[    2.567892] random: systemd: uninitialized urandom read (16 bytes read)
[    2.574807] random: systemd: uninitialized urandom read (16 bytes read)
[    2.620040] random: systemd: uninitialized urandom read (16 bytes read)
[    2.626809] random: systemd: uninitialized urandom read (16 bytes read)
[    2.707417] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    2.725113] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    2.733209] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.740868] systemd[1]: Expecting device dev-ttyS0.device...
         [    2.746850] systemd[1]: Starting Remote File Systems (Pre).
Expecting device dev-ttyS0.device...
[    2.753251] systemd[1]: Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems (Pre).
[    2.762589] systemd[1]: Starting Encrypted Volumes.
[  OK  ] Reached target Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Swap.
[  OK  ] Created slice Root Slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Listening on Delayed Shutdown Socket.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on Journal Socket.
[  OK  ] Created slice System Slice.
         Starting File System Check on Root Device...
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
         Starting Create list of required static device nodes...rrent kernel...
         Starting udev Coldplug all Devices...
         Starting Load Kernel Modules...
         Mounting Debug File System...
         Starting LSB: Set keymap...
         Starting Journal Service...
[  OK  ] Started Journal Service.
[  OK  ] Reached target Slices.
[  OK  ] Mounted Debug File System.
[  OK  ] Started Create list of required static device nodes ...current kernel.
[  OK  ] Started LSB: Set keymap.
[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
[    2.935314] random: fast init done
[  OK  ] Started File System Check on Root Device.
[  OK  ] Started udev Coldplug all Devices.
         Mounting Configuration File System...
         Starting Apply Kernel Variables...
         Starting Create Static Device Nodes in /dev...
[  OK  ] Mounted Configuration File System.
[    3.058008] systemd-fsck[91]: linux: clean, 18019/46464 files, 143488/185600 blocks
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Create Static Device Nodes in /dev.
         Starting udev Kernel Device Manager...
[    3.148235] systemd-udevd[119]: starting version 215
[  OK  ] Started udev Kernel Device Manager.
         Starting Copy rules generated while the root was ro...
         Starting LSB: Set preliminary keymap...
         Starting LSB: Tune IDE hard disks...
[  OK  ] Started Copy rules generated while the root was ro.
[  OK  ] Started LSB: Tune IDE hard disks.
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Started LSB: Set preliminary keymap.
         Starting Remount Root and Kernel File Systems...
[    8.191155] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
[  OK  ] Started Remount Root and Kernel File Systems.
         Starting Load/Save Random Seed...
[  OK  ] Reached target Local File Systems (Pre).
         Mounting /tmp...
[  OK  ] Mounted /tmp.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
         Starting LSB: Raise network interfaces....
[  OK  ] Reached target Remote File Systems.
         Starting Trigger Flushing of Journal to Persistent Storage...
         Starting LSB: Prepare console...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
[    8.405186] systemd-journald[98]: Received request to flush runtime journal from PID 1
[  OK  ] Started Trigger Flushing of Journal to Persistent Storage.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started LSB: Prepare console.
         Starting LSB: Set console font and keymap...
[  OK  ] Started LSB: Raise network interfaces..
[  OK  ] Reached target Network.
[  OK  ] Reached target Network is Online.
[  OK  ] Started LSB: Set console font and keymap.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Timers.
[  OK  ] Reached target Basic System.
         Starting OpenBSD Secure Shell server...
[  OK  ] Started OpenBSD Secure Shell server.
         Starting Network Manager...
         Starting /etc/rc.local Compatibility...
         Starting Login Service...
         Starting LSB: Start NTP daemon...
         Starting D-Bus System Message Bus...
[  OK  ] Started D-Bus System Message Bus.
         Starting Permit User Sessions...
[FAILED] Failed to start /etc/rc.local Compatibility.
See 'systemctl status rc-local.service' for details.
[  OK  ] Started LSB: Start NTP daemon.
[  OK  ] Started Permit User Sessions.
         Starting Getty on tty1...
[  OK  ] Started Getty on tty1.
         Starting Getty on tty2...
[  OK  ] Started Getty on tty2.
         Starting Serial Getty on ttyS0...
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started Login Service.
         Starting Authenticate and Authorize Users to Run Privileged Tasks...
[  OK  ] Started Authenticate and Authorize Users to Run Privileged Tasks.
[  OK  ] Started Network Manager.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[   18.589327] libphy: 1c30000.ethernet: probed
[  OK  ] Started Update UTMP about System Runlevel Changes.
[   18.691846] Generic PHY 1c30000.ethernet:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1c30000.ethernet:01, irq=-1)
[   18.703190] sun8i-emac 1c30000.ethernet: device MAC address slot 0 02:20:64:aa:bb:cc
[   18.790162] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

Debian GNU/Linux 8 OrangePI ttyS0

OrangePI login:

 

 

 

It seems to be due to u-boot setting the CPU frequency:

board/sunxi/board.c:553

	if (!power_failed)
		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
	else
            	printf("Failed to set core voltage! Can't set CPU frequency\n");

!power_failed is always true, because it's only set to failed if u-boot fails to set up the voltage regulator for VCC-CPUX, but since the Orange Pi One/Zero don't have a configurable regulator, the if statement is always taken.

 

So if you use the orangepi_pc_defconfig, it won't set the CPU frequency because it fails to set up the non-existent SY8106A voltage regulator. Then Linux is able to boot. So it seems like what we have here is: either u-boot is setting the CPU clock wrong, or Linux is. The frequency being set is: 1008000000

 

So what is the frequency of the SoC if clock_set_pll1(1008000000) doesn't run? I don't know where to add a printk statement to find out.

 

EDIT : Ok ! it seems to be related with "cpufreq_init", if I remove the cpu0/operating-points/cpu_thermal sections in DTS, it is booting ...

(I remember facing similar issues 6 months ago, but I don't remember what changes were required, missing freq or something like)

 

I would agree. Something is wrong with CPU clock setting...

 

EDIT:

Something seems wrong with this DTS. The vdd_cpu is:

gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;

But according to the schematic (page 4): PL6 is NC? Can this be right?

 

Can't find any GPIO pin assignment to CPUX-VSET in the datasheet (v1.1).

 

EDIT2: Okay, same for Orange Pi One. I'm stumped.

 

EDIT3: Seemingly PL6 is connected to SY8113B. When Linux boots, the voltage on 1V2C (VDD-CPUX) starts at 1.3V from u-boot. Around 2 seconds after Linux init, the voltage on 1V2C drops from 1.3V to 1.1V. At this point the system hangs with the following:

[    1.811746] vcc3v0: disabling
[    1.814713] vcc5v0: disabling
[    1.817654] mmc1: new high speed SDIO card at address 0001
[ 28.157942] INFO: rcu_sched detected stalls on CPUs/tasks: 
[ 28.163500] 1-...: (1 GPs behind) idle=107/140000000000000/0 softirq=9/9 fqs=27 
[ 28.170990] (detected by 0, t=2108 jiffies, g=-271, c=-272, q=3) 
[ 28.177125] Task dump for CPU 1: 
[ 28.180368] kworker/1:1 R running task 0 37 2 0x00000002 
[ 28.187514] Workqueue: events dbs_work_handler

So perhaps 1.1V is too low for whatever clock speed the CPU is running at this point? I tried changing all the operating-points to 1300000, but the voltage still drops to 1.1V

 

With the u-boot for the orangepi_pc_defconfig the voltage on 1V2C fluctuates between 1.3V and 1.1V during boot. However since it doesn't crash, I'm guessing that the CPU clock is running at less than 1.008GHz after u-boot init.

 

EDIT4: Yes, Linux is reducing the voltage too soon. I modified u-boot to manually set the SoC frequency to 408MHz instead of 1.008GHz, and Linux will boot with the dts without removing the vdd_cpux or operating-points sections. So either we reduce the CPU speed on boot, or don't drop the voltage on vdd_cpux so soon.

Edited by hmartin
Added spoiler tags
Link to comment
Share on other sites

 

Instead of controlling LCD ILI9341 with the Orange Pi as in the video,

I'm thinking of using ILI9341 as the Orange Pi Zero terminal display.

But then I'll may end up got very tiny unreadable font.

 

Can it be done directly, or I will need Arduino to read the Orange Pi serial console and drive the LCD?

Link to comment
Share on other sites

I modified u-boot to manually set the SoC frequency to 408MHz instead of 1.008GHz, and Linux will boot with the dts without removing the vdd_cpux or operating-points sections.

 

Where did you do such change ? (because in orangepi_zero_defconfig, it was already set to CONFIG_DRAM_CLK=408)

Link to comment
Share on other sites

Where did you do such change ? (because in orangepi_zero_defconfig, it was already set to CONFIG_DRAM_CLK=408)

 

board/sunxi/board.c around line 553:

	if (!power_failed)
		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
	else
            	printf("Failed to set core voltage! Can't set CPU frequency\n");

I couldn't find anywhere where CONFIG_SYS_CLK_FREQ was being set for the Orange Pi Zero, but by adding a printf it's clearly being set to 1008000000 somewhere. There are lots of header files for other vendors that set this with a #define but I can't find anything for allwinner/sunxi in the u-boot source. Since there is no power regulator to prevent the above if statement from executing, u-boot is setting the SoC frequency to 1.008GHz before handing off to Linux.

 

At some point during Linux init, the kernel is dropping the SY8113B into 1.1V before dropping the SoC clock (or isn't dropping the SoC clock enough), I think this is what is causing the freezing you noticed. If you manually replace clock_set_pll1(CONFIG_SYS_CLK_FREQ); with something like clock_set_pll1(480000000); recompile and flash u-boot, then Linux is able to boot with the orangepi_zero dts without freezing.

 

Even if I changed all the operating-points in the dts to 1300000 Linux still crashed if u-boot initialized the SoC clock to 1.008GHz.

 

I verified the voltage using a multimeter on the test point 1V2C (located between the SoC and the inductor by the micro USB port).

 

know this isn't the proper fix for this, but I honestly have no idea where to go looking in Linux for when it changes the vreg or frequency.

Link to comment
Share on other sites

The CONFIG_SYS_CLK_FREQ=480000000 is also defined in orangepi_zero_defconfig, so it is probably a build process issue that doesn't pass the defconfig value to compiler properly ?

 

EDIT : I've added a printf at the place you've mentioned and it was already the good value, and kernel still hang if I leave the DT stuff.

So, back to "square one" ... :(

 

EDIT2 : I've rebuild both OPiOne and OPiLite and they don't have this disease, it is only with OPiZero ... :angry:

 

EDIT3 : I've open this issue https://github.com/igorpecovnik/lib/issues/580to get attention from other Armbian developpers.

Link to comment
Share on other sites

The CONFIG_SYS_CLK_FREQ=480000000 is also defined in orangepi_zero_defconfig, so it is probably a build process issue that doesn't pass the defconfig value to compiler properly ?

 

EDIT : I've added a printf at the place you've mentioned and it was already the good value, and kernel still hang if I leave the DT stuff.

So, back to "square one" ... :(

 

EDIT2 : I've rebuild both OPiOne and OPiLite and they don't have this disease, it is only with OPiZero ... :angry:

 

EDIT3 : I've open this issue https://github.com/igorpecovnik/lib/issues/580to get attention from other Armbian developpers.

 

Where are you getting the u-boot source from? I'm using mainline u-boot from denx with my own orangepi_zero_defconfig which I modified from orangepi_one_defconfig.

 

If I compile denx v2016.11 u-boot with a lower CONFIG_SYS_CLK_FREQ it boots.

 

Sorry I don't have Orange Pi Lite/One to test with. Only Orange Pi PC and Orange Pi Zero.

 

But is the solution here really to lower SoC clock during boot?

 

Shouldn't the solution be to fix Linux power management of the SY8113B during boot so SoC is not undervolted?

 

Or is this just to debug?  :)

 

 

 

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 836a8c4..3df9b74 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -260,6 +260,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
 	sun8i-a83t-cubietruck-plus.dtb \
 	sun8i-a83t-sinovoip-bpi-m3.dtb
 dtb-$(CONFIG_MACH_SUN8I_H3) += \
+	sun8i-h2-orangepi-zero.dtb \
 	sun8i-h3-bananapi-m2-plus.dtb \
 	sun8i-h3-orangepi-2.dtb \
 	sun8i-h3-orangepi-lite.dtb \
diff --git a/arch/arm/dts/sun8i-h2-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-orangepi-zero.dts
new file mode 100644
index 0000000..25c0ba4
--- /dev/null
+++ b/arch/arm/dts/sun8i-h2-orangepi-zero.dts
@@ -0,0 +1,227 @@
+/*
+ * Copyright (C) 2015 Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *   Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-h3.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+	model = "Xunlong Orange Pi Zero";
+	compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h3";
+
+	aliases {
+		serial0 = &uart0;
+		ethernet0 = &emac;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&leds_opc>, <&leds_r_opc>;
+
+		pwr_led {
+			label = "orangepi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+			panic-indicator;
+		};
+
+		status_led {
+			label = "orangepi:red:status";
+			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+			linux,default_trigger = "heartbeat";
+			default-state = "off";
+		};
+	};
+
+	vdd_cpu: vdd_cpu {
+		compatible = "regulator-gpio";
+		pinctrl-names = "default";
+		pinctrl-0 = <&vdd_cpu_pins>;
+		regulator-name = "cpu-core";
+		regulator-min-microvolt = <1100000>;
+		regulator-max-microvolt = <1300000>;
+		regulator-boot-on;
+		regulator-always-on;		
+		gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
+//		enable-gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>;
+		states = <1300000 0x1
+			1100000 0x0>;
+
+		startup-delay-us = <100000>;
+		enable-active-high;
+	};
+
+	vdd_wifi: vdd_wifi {   
+                compatible = "regulator-fixed";
+                regulator-name = "wifi";
+                regulator-min-microvolt = <1800000>;
+                regulator-max-microvolt = <1800000>;
+                gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+                startup-delay-us = <70000>;
+                enable-active-high;
+        };
+
+	pwrseq_wifi: pwrseq_wifi@0 {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_rst>;	
+		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
+		post-power-on-delay-ms = <50>;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+	cd-inverted;
+	status = "okay";
+};
+
+/* usb */
+&ehci1 {
+	status = "okay";
+};
+
+
+&ohci1 {
+	status = "okay";
+};
+
+&reg_usb0_vbus {
+        pinctrl-0 = <&usb0_vbus_pin_opiz>;
+        gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+        status = "okay";
+};
+
+&pio {
+	leds_opc: led_pins@0 {
+		allwinner,pins = "PA17";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+                allwinner,pins = "PG12";
+                allwinner,function = "gpio_in";
+                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+        };
+
+	wifi_wake: wifi_wake@0 {
+		allwinner,pins = "PG10";
+                allwinner,function = "irq";
+                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&r_pio {
+	usb0_vbus_pin_opiz: usb0_vbus_pin@0 {
+                allwinner,pins = "PL2";
+                allwinner,function = "gpio_out";
+                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+        };
+
+	vdd_cpu_pins: vdd_cpu_pins@0 {
+		allwinner,pins = "PL6";
+                allwinner,function = "gpio_out";
+                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	wifi_rst: wifi_rst@0 {
+		allwinner,pins = "PL7";
+                allwinner,function = "gpio_out";
+                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	vdd_dram_en: vdd_dram_en@0 {
+		allwinner,pins = "PL9";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	leds_r_opc: led_pins@0 {
+		allwinner,pins = "PL10";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&usbphy {
+	/* USB VBUS is always on */
+	status = "okay";
+};
+
+&emac {
+	phy = <&phy1>;
+	phy-mode = "mii";
+	allwinner,use-internal-phy;
+	allwinner,leds-active-low;
+	status = "okay";
+	phy1: ethernet-phy@1 {
+		reg = <1>;
+	};
+};
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 5365638..8f7bfd8 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -550,10 +550,13 @@ void sunxi_board_init(void)
 	 * Only clock up the CPU to full speed if we are reasonably
 	 * assured it's being powered with suitable core voltage
 	 */
-	if (!power_failed)
-		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
-	else
+	if (!power_failed) {
+		//clock_set_pll1(CONFIG_SYS_CLK_FREQ);
+		clock_set_pll1(480000000);
+                printf("Set CPU frequency to 408MHz\n");
+        } else {
 		printf("Failed to set core voltage! Can't set CPU frequency\n");
+        }
 }
 #endif
 
diff --git a/configs/orangepi_zero_defconfig b/configs/orangepi_zero_defconfig
new file mode 100644
index 0000000..bbbb2c2
--- /dev/null
+++ b/configs/orangepi_zero_defconfig
@@ -0,0 +1,15 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN8I_H3=y
+CONFIG_DRAM_CLK=624
+CONFIG_DRAM_ZQ=3881979
+CONFIG_DRAM_ODT_EN=y
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-orangepi-zero"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CONSOLE_MUX=y
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y

 

 

Link to comment
Share on other sites

Okay, I have the XR819 driver compiling against https://github.com/megous/linux/(this is the kernel source Armbian appears to have switched to).

 

linux-49-xradio.png

 

Should I submit a pull request to the above repo, or to the Armbian repo?

 

Not sure where the firmware for the radio comes from though, I just grabbed it out of the Armbian image.

 

Pull request submitted to megous/linux...

 

I compiled Armbian against your repo but after loading the module nothing happens, wlan0 doesn't show up in ifconfig -a, nor is there any error message.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines