41 41
Christos

Armbian for OrangePi PC2, AllWinner H5

Recommended Posts

OK, not sure how much I can do here. Legacy stuff uses ARISC core to shutdown, so it can kill both the clocks and the power reliably.

 

@zador.blood.stained, first of all - thanks a lot for your efforts. 

 

I totally agree with hojnikb - may be downclock everything, turn off ethernet, hdmi and usb (if possible, of course). 

 

In PC2 case, I think that will be quite enough, since previous versions raised power consumption and it was scary to leave board in this state unattended - things were too hot.

Share this post


Link to post
Share on other sites

Maybe revert changes and downclock the core, so it works on all boards and don't eat as much power ?

Well, there is a shutdown bit in the syscon register it's for EMAC, I must have scrolled too far while reading the datasheet, so it may work too. It's just a matter of determining what's more power efficient and reliable.

It doesn't need to work on all boards, since we have only 2 arm64 board families (that have shutdown via PSCI/ATF).

Edited by zador.blood.stained
No shutdown in syscon

Share this post


Link to post
Share on other sites

I'm having a problem. orangepipc2 connects over wifi and cable but it does not surf and does not update. NetworkManager is locked for editing. Using the nm-connection-editor command as sudo I can edit. But it does not connect. I have edited the sudoers file. I changed dns to 8.8.8.8 without result. I modified several things on the router without success. ping command works on any site. If I use the smartphone hotspot it works very well.

 

sorry googletranslation.

Share this post


Link to post
Share on other sites

I'm having a problem. orangepipc2 connects over wifi and cable but it does not surf and does not update. NetworkManager is locked for editing. Using the nm-connection-editor command as sudo I can edit. But it does not connect. I have edited the sudoers file. I changed dns to 8.8.8.8 without result. I modified several things on the router without success. ping command works on any site. If I use the smartphone hotspot it works very well.

 

sorry googletranslation.

 

If you have DHCP server, your wired connection should work out of the box. You don't need to do anything. On all boards this is the same.

 

OPi PC2 is under development and network could be temporally broken. Check today's (automated) build.

Share this post


Link to post
Share on other sites

If you have DHCP server, your wired connection should work out of the box. You don't need to do anything. On all boards this is the same.

 

OPi PC2 is under development and network could be temporally broken. Check today's (automated) build.

 

unsuccessfully. Only works when I connect pipc2 on the smartphone(hotspot wifi)

Share this post


Link to post
Share on other sites

This means you have some troubles with your network.

 

Wrote on mobile phone

 

My router is a 740n tplink and this is with dd-wrt firmware. Go back to the original and test. All other equipment works on the network. Smart tv; Smartphones; notebook; Arduino + esp8266; nodemcu.

Share this post


Link to post
Share on other sites

I updated the OS. I tried wifi without success. I shut off the shutdown button. Pipc2 has stopped working. Does not work anymore Ttl signal does not respond. :unsure:

Share this post


Link to post
Share on other sites

I updated the OS. I tried wifi without success. I shut off the shutdown button. Pipc2 has stopped working. Does not work anymore Ttl signal does not respond. :unsure:

 

I discovered the problem. Burned CI :blink:

Share this post


Link to post
Share on other sites

Well, there is a shutdown bit in the syscon register, so it may work too. It's just a matter of determining what's more power efficient and reliable.

 

@zador.blood.stained - can it be tested somehow in current build or further coding/patching needed ?

Share this post


Link to post
Share on other sites

There's a great audio repository for Debian/Ubuntu KXstudio, which I use on my laptops along with either Debian of (K)Ubuntu.

I understand that I can't use this on the earlier PC One board due to the fact that the SSE2 instruction set isn't supported.

Does anyone know if this is still the same for this newer board?

 

Hans

Share this post


Link to post
Share on other sites

There's a great audio repository for Debian/Ubuntu KXstudio, which I use on my laptops along with either Debian of (K)Ubuntu.

I understand that I can't use this on the earlier PC One board due to the fact that the SSE2 instruction set isn't supported.

Does anyone know if this is still the same for this newer board?

 

Hans

SSE2 is a x86 specific set of instructions, so likely those packages are compiled for x86 only and thus unusable on every ARM board ever made (that includes PC2)

Share this post


Link to post
Share on other sites

Hi All!

Well, there is a shutdown bit in the syscon register, so it may work too. It's just a matter of determining what's more power efficient and reliable.

It doesn't need to work on all boards, since we have only 2 arm64 board families (that have shutdown via PSCI/ATF).

 

Any updates on shutdown ?

 

I think that "custom shutdown hook" is still needed. Because when I issue the "shutdown -H" - to halt system without power down (to avoid reboot) it still goes to 600 mA consumption :(

 

So please can you point me to the right places in sysfs to

 

1) Set clock to lowest possible speed

2) Turn off HDMI completely

3) Turn off Ethernet (i think I can go with "ifdown eth0", but not sure this is correct)

 

Not sure USB must be turned off here, because, well you can have HDD mounted at this time...

Share this post


Link to post
Share on other sites

Can someone with access to OPi PC2 please post the output from 'sudo armbianmonitor -u' when running with our mainline image? And if possible also the output from 'cat /proc/interrupts' when running with any of Xunlong's 3.10 based OS images. Want to look into IRQ redistribution for PC2 and MiQi board soon.

Share this post


Link to post
Share on other sites

Can someone with access to OPi PC2 please post the output from 'sudo armbianmonitor -u' when running with our mainline image? And if possible also the output from 'cat /proc/interrupts' when running with any of Xunlong's 3.10 based OS images. Want to look into IRQ redistribution for PC2 and MiQi board soon.

 

armbianmonitor log posted to http://sprunge.us/AbfD

 

I'll boot up a xunlong image and post that info in a bit.

Share this post


Link to post
Share on other sites

And if possible also the output from 'cat /proc/interrupts' when running with any of Xunlong's 3.10 based OS images.

orangepi@Orangepi:~$ cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       
 27:       6050      14174       4081       5254       GIC  arch_timer
 32:        404          0          0          0       GIC  uart0
 38:          0          0          0          0       GIC  twi0
 39:          0          0          0          0       GIC  twi1
 43:          0          0          0          0       GIC  PIN_GRP
 49:          0          0          0          0       GIC  PIN_GRP
 50:          0          0          0          0       GIC  sunxi_timer
 55:          0          0          0          0       GIC  PIN_GRP
 62:          0          0          0          0       GIC  sunxikbd
 69:          0          0          0          0       GIC  RemoteIR_RX
 72:          0          0          0          0       GIC  1f00000.rtc
 77:          0          0          0          0       GIC  PIN_GRP
 82:         15          0          0          0       GIC  1c02000.dma-controller
 90:          0          0          0          0       GIC  cedar_dev
 92:       6600          0          0          0       GIC  sunxi-mmc
 97:          0          0          0          0       GIC  spi0
 98:          0          0          0          0       GIC  spi1
101:          0          0          0          0       GIC  mdfs
104:          0          0          0          0       GIC  ehci_hcd:usb1
105:          0          0          0          0       GIC  ohci_hcd:usb5
106:          2          0          0          0       GIC  ehci_hcd:usb2
107:        745          0          0          0       GIC  ohci_hcd:usb6
108:          0          0          0          0       GIC  ehci_hcd:usb3
109:          0          0          0          0       GIC  ohci_hcd:usb7
110:          2          0          0          0       GIC  ehci_hcd:usb4
111:         62          0          0          0       GIC  ohci_hcd:usb8
114:       2732          0          0          0       GIC  1c30000.eth
116:          0          0          0          0       GIC  vfe.13
117:          3          0          0          0       GIC  vfe_cci
118:       3511          0          0          0       GIC  dispaly
125:          0          0          0          0       GIC  DE-Interlace
126:          0          0          0          0       GIC  ss
279:          0          0          0          0         -  1c0f000.sdmmc cd
IPI0:      8311       5576       4672       4811       Rescheduling interrupts
IPI1:        62        150        182        190       Function call interrupts
IPI2:         6         10          1          4       Single function call interrupts
IPI3:         0          0          0          0       CPU stop interrupts
IPI4:         0          0          0          0       Timer broadcast interrupts
Err:          0
orangepi@Orangepi:~$ 

Here is /proc/interrupts from Ubuntu_Desktop_Xenial_xfce4_PC2_V1_0_0.img.xz

Share this post


Link to post
Share on other sites

 

Can someone with access to OPi PC2 please post the output from 'sudo armbianmonitor -u' when running with our mainline image? And if possible also the output from 'cat /proc/interrupts' when running with any of Xunlong's 3.10 based OS images. Want to look into IRQ redistribution for PC2 and MiQi board soon.

 

 

http://sprunge.us/cZOb is the first half. If you point me to a specific image you want me to run, I'll DL and burn it and get the data. I've never used any of their images, so I'm unfamiliar with their site.

Share this post


Link to post
Share on other sites

@HAK @willmore: Thank you both, looks good and like the job can be done without having to differentiate between legacy and mainline kernel (sunxi-mmc, usb and '1c30000.eth' seem useable as regex)

Share this post


Link to post
Share on other sites

Well, I added "temporary(?)" shutdown hook, because as I told before even "shutdown -H" (halt instead of poweroff) forces board to go to 600mA consumption and producing some heat :).

 

What it does:

  • Gets minimal possible frequency from list
  • Sets it
  • Downs Ethernet

Also I tried to turn off framebuffer, but usual recipes for blanking fb0 didn't worked...

echo 1 > /sys/class/graphics/fb0/blank

gave me only "Input/output error", but cursor blinking "off" worked, so I decided to leave it =). May be it will save some small amount of power =).

 

So the script is below, just create a pre_shutdown.sh executable in /usr/local/bin:

#!/bin/sh

###Get minimum CPU Speed

MINSPEED=`cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq`

echo "Setting CPU to $MINSPEED"

echo $MINSPEED >/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo $MINSPEED >/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq

echo "Trying to turn off HDMI..."
echo "Only cursor for now..."
echo 0 > /sys/class/graphics/fbcon/cursor_blink

echo "Down the network..."
ifdown eth0

Now, as @tkaiser advised, add it to  /etc/init.d/armhwinfo right in "stop" section, before unloading modules.

 

Something like this:

                case ${BOARD_NAME} in
			"Orange Pi PC2")
			/usr/local/bin/pre_shutdown.sh
			;;
		esac
		# some kernel modules are known to crash the kernel on shutdown (an example

If anyone has an idea to shut off HDMI via sysfs, thanks in advance.

 

If you don't feel adventurous and don't want to edit /etc/init.d/armhwinfo, you can run it manually before shutdown (mind eth0 down)

sudo /usr/local/bin/pre_shutdown.sh && sudo shutdown -h now

--or--

sudo /usr/local/bin/pre_shutdown.sh && sudo shutdown -H now 

Measurement results ( I used not the latest build, since shutdown leads to reboot)

 

No shutdown hook:

 

600ma

 

Only CPU downscaling:

 

270ma

 

CPU downscaling && Ethernet down:

 

170ma

 

Same numbers with cursor blinking off, but may be my "usb doctor" has not enough prescision to handle this  ;) .

 

Just as reference - 100ma after shutdown with legacy kernel/uboot, if I'm not mistaken. So now numbers are comparable...

 

May be it will help someone.

 

Looking forward for "true shutdown" :)

Share this post


Link to post
Share on other sites

Also I tried to turn off framebuffer, but usual recipes for blanking fb0 didn't worked...

echo 1 > /sys/class/graphics/fb0/blank

gave me only "Input/output error", but cursor blinking "off" worked, so I decided to leave it =). May be it will save some small amount of power =).

 

That won't work, because simplefb driver doesn't know how to do that. However, all clocks/gates/resets should be properly disabled during shutdown, if they were correctly specified in kernel and DT (at this point it is hard to tell).

Share this post


Link to post
Share on other sites

That won't work, because simplefb driver doesn't know how to do that. However, all clocks/gates/resets should be properly disabled during shutdown, if they were correctly specified in kernel and DT (at this point it is hard to tell).

 

Yes, sure. Hope it will be figured out someday, Xunglong is building new boards too fast :)

Share this post


Link to post
Share on other sites

Updated not-the-latest build via apt-get upgrade. After system halt consumption is 300ma instead of 600 without pre-shutdown sequence.

Great, so far.

 

But now according to armbian monitor cpu clock is almost always 1296 Mhz. Even if system load is 0.01. Is it normal ? As far as i remember system was auto downclocked without load.

Share this post


Link to post
Share on other sites

But now according to armbian monitor cpu clock is almost always 1296 Mhz. Even if system load is 0.01. Is it normal ? As far as i remember system was auto downclocked without load.

 

Why not checking what might be wrong on your own? Using cpufreq-info and comparing with /proc/config.gz is one option to detect mismatches between userspace settings and kernel and there is /sys/devices/system/cpu/cpu0/cpufreq/* to explore.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
41 41