Jump to content

Armbian 5.30 on Pine64 really wants a battery to work


pfeerick

Recommended Posts

I'm guessing it wasn't intentional that the current  legacy Armbian_5.30_Pine64_Ubuntu_xenial_default_3.10.105 image for the pine64 wouldn't work without the battery? :P Because the "Warning: Low battery power, shutting down to recharge" line (10th line from the end) is an absolute corker (or should I say showstopper?) when there is no battery connected to the pine64! :o It fell over on a 2G pine64 board that I was about to build up with Armbian. 

 

Spoiler

HELLO! BOOT0 is starting!
boot0 commit : 045061a8bb2580cb3fa02e301f52a015040c158f
 
boot0 version : 4.0.0
set pll start
set pll end
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x0000a101
rtc[4] value = 0x00000000
rtc[5] value = 0x00000000
DRAM driver version: V1.1
rsb_send_initseq: rsb clk 400Khz -> 3Mhz
PMU: AXP81X
ddr voltage = 1500 mv
DRAM Type = 3 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
DRAM clk = 672 MHz
DRAM zq value: 003b3bbb
DRAM single rank full DQ OK
DRAM size = 2048 MB
DRAM init ok
dram size =2048
card boot number = 0, boot0 copy = 0
card no is 0
sdcard 0 line count 4
[mmc]: mmc driver ver 2015-05-08 20:06
[mmc]: sdc0 spd mode error, 2
[mmc]: Wrong media type 0x00000000
[mmc]: ***Try SD card 0***
[mmc]: HSSDR52/SDR25 4 bit
[mmc]: 50000000 Hz
[mmc]: 30528 MB
[mmc]: ***SD/MMC 0 init OK!!!***
sdcard 0 init ok
The size of uboot is 000e8000.
sum=2a39a234
src_sum=2a39a234
Succeed in loading uboot from sdmmc flash.
boot0: start load other image
boot0: Loading BL3-1
Loading file 0 at address 0x40000000,size 0x0000a200 success
boot0: Loading scp
Loading file 2 at address 0x00040000,size 0x00019a00 success
set arisc reset to de-assert state
Ready to disable icache.
  Configuring SPC Controller
NOTICE:  BL3-1: v1.0(debug):3cdc5c3
NOTICE:  BL3-1: Built : 12:02:56, Jun  7 2017
INFO:    BL3-1: Initializing runtime services
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x4a000000
INFO:    BL3-1: Next image spsr = 0x1d3


U-Boot 2014.07-g6f37e5c-dirty (Jun 13 2017 - 15:42:40) Allwinner Technology 

uboot commit : 6f37e5cf6a65b0b10455d12dbd631effabe765ec
 
rsb: secure monitor exist
[      0.362]pmbus:   ready
[      0.365][ARISC] :arisc initialize
[      0.696][ARISC] :arisc_dvfs_cfg_vf_table: support only one vf_table
[SCP] :sunxi-arisc driver begin startup 2
[SCP] :arisc_para size:1a8
[SCP] :arisc version: [v0.1.76]
[SCP] :sunxi-arisc driver v1.10 is starting
[      0.825][ARISC] :sunxi-arisc driver startup succeeded
[      0.859]PMU: AXP81X
[      0.861]PMU: AXP81X found
bat_vol=1, ratio=0
[      0.867]PMU: dcdc2 1100
[      0.870]PMU: cpux 1008 Mhz,AXI=336 Mhz
PLL6=600 Mhz,AHB1=200 Mhz, APB1=100Mhz AHB2=300Mhz MBus=400Mhz
device_type = 3253, onoff=1
dcdc1_vol = 3300, onoff=1
dcdc2_vol = 1100, onoff=1
dcdc6_vol = 1100, onoff=1
aldo1_vol = 2800, onoff=0
aldo2_vol = 1800, onoff=1
aldo3_vol = 3000, onoff=1
dldo1_vol = 3300, onoff=0
dldo2_vol = 3300, onoff=0
dldo3_vol = 2800, onoff=0
dldo4_vol = 3300, onoff=1
eldo1_vol = 1800, onoff=1
eldo2_vol = 1800, onoff=0
eldo3_vol = 1800, onoff=0
fldo1_vol = 1200, onoff=0
fldo2_vol = 1100, onoff=1
gpio0_vol = 3100, onoff=0
vbus not exist
normal dc exist, limit to dc
run key detect
no key found
no uart input
DRAM:  2 GiB
fdt addr: 0xb6ebcf00
Relocation Offset is: 75f0f000
In:    serial
Out:   serial
Err:   serial
gic: sec monitor mode
[      1.181]start
drv_disp_init
init_clocks: finish init_clocks.
enable power vcc-hdmi-33, ret=0
drv_disp_init finish
boot_disp.output_disp=0
boot_disp.output_type=3
boot_disp.output_mode=10
fetch script data boot_disp.auto_hpd fail
disp0 device type(4) enable
attched ok, mgr0<-->device1, type=4, mode=10
plugin
[      2.221]end
workmode = 0,storage type = 1
[      2.225]MMC:        0
[mmc]: mmc driver ver 2015-06-03 13:50:00
SUNXI SD/MMC: 0
[mmc]: start mmc_calibrate_delay_unit, don't access device...
[mmc]: delay chain cal done, sample: 217(ps)
[mmc]: media type 0x0
[mmc]: Wrong media type 0x0
[mmc]: ************Try SD card 0************
[mmc]: host caps: 0x27
[mmc]: MID 1b PSN a20a5776
[mmc]: PNM 00000 -- 0x30-30-30-30-30
[mmc]: PRV 1.0
[mmc]: MDT m-2 y-2016
[mmc]: speed mode     : HSSDR52/SDR25 
[mmc]: clock          : 50000000 Hz
[mmc]: bus_width      : 4 bit
[mmc]: user capacity  : 30528 MB
[mmc]: ************SD/MMC 0 init OK!!!************
[mmc]: erase_grp_size      : 0x1WrBlk*0x200=0x200 Byte
[mmc]: secure_feature      : 0x0
[mmc]: secure_removal_type : 0x0
[      2.411]sunxi flash init ok

** Unable to use mmc 0:1 for loading the env **
Using default environment

--------fastboot partitions--------
mbr not exist
base bootcmd=run mmcbootcmd
bootcmd set setargs_mmc
key 0
recovery key high 12, low 10
fastboot key high 6, low 4
no misc partition is found
to be run cmd=run mmcbootcmd
update dtb dram start
update dtb dram  end
serial is: 040051900808080303ce
check for ANX9807
get Pine64 model from DRAM size
DRAM >512M
Pine64 model: pine64-plus
PowerBus = 2(0: not exist 1:vBus 2:acBus 3:vBus&acBus)
Battery Voltage=1, Ratio=0
key trigger
Warning: Low battery power, shutting down to recharge
fetch script data boot_disp.output_full fail
screen_id =0, screen_width =1920, screen_height =1080
frame buffer address 47400036
set next system normal
drv_disp_exit
[mmc]: MMC Device 2 not found
[mmc]: mmc 2 not find, so not exit
[      7.056]power off
set power off vol to default

 

 

After a little more prodding, it's related to powering on via the power button... the pine64 is correctly detecting 'no battery' if it is powered on via power insertion.

 

Spoiler

--------fastboot partitions--------
mbr not exist
base bootcmd=run mmcbootcmd
bootcmd set setargs_mmc
key 0
recovery key high 12, low 10
fastboot key high 6, low 4
no misc partition is found
to be run cmd=run mmcbootcmd
update dtb dram start
update dtb dram  end
serial is: 040051900808080303ce
check for ANX9807
get Pine64 model from DRAM size
DRAM >512M
Pine64 model: pine64-plus
no battery exist
sunxi bmp: unable to open file /boot/bootlogo.bmp
[      3.177]inter uboot shell
autoboot in 3 seconds, Press s or <Esc><Esc> to abort

 

 

There was also a (trivial in comparison) service failure during the first boot... i'm not sure it went away due to a dist-upgrade or was simply a first boot gremlin:

 

Spoiler

[  OK  ] Started Daily apt activities.
[  OK  ] Reached target Timers.
         Starting Armbian filesystem resize service...
[FAILED] Failed to start Set console font and keymap.
See 'systemctl status console-setup.service' for details.
[  OK  ] Started Armbian filesystem resize service.
[  OK  ] Reached target Basic System.

---

root@pine64:~# systemctl status console-setup.service
● console-setup.service - Set console font and keymap
   Loaded: loaded (/lib/systemd/system/console-setup.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-06-14 07:00:56 UTC; 1 months 16 days ago
     Docs: man:loadkeys(1)
 Main PID: 285 (code=exited, status=1/FAILURE)

Jun 14 07:00:56 pine64 setupcon[285]: /bin/setupcon: 809: /bin/setupcon: cannot open /tmp/tmpkbd.7JYIFD: No such file
Jun 14 07:00:56 pine64 systemd[1]: console-setup.service: Main process exited, code=exited, status=1/FAILURE
Jun 14 07:00:56 pine64 systemd[1]: Failed to start Set console font and keymap.
Jun 14 07:00:56 pine64 systemd[1]: console-setup.service: Unit entered failed state.
Jun 14 07:00:56 pine64 systemd[1]: console-setup.service: Failed with result 'exit-code'.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

 

 

Link to comment
Share on other sites

2 hours ago, pfeerick said:

I'm guessing it wasn't intentional that the current  legacy Armbian_5.30_Pine64_Ubuntu_xenial_default_3.10.105 image for the pine64 wouldn't work without the battery?

Obviously not, it's just that nobody uses a power button since you need a soldering iron for. Simple workaround: don't use the power button, most probably not so simple fix: dive into BSP power management code :)

 

If the problem also occurs with other 'distros' then it might be worth to compare DT and kernel config. But zero priority of course since you're the only Armbian user around having a power button soldered (or connected to EXP header) ;)

Link to comment
Share on other sites

4 hours ago, tkaiser said:

But zero priority of course since you're the only Armbian user around having a power button soldered (or connected to EXP header) ;)

 

Oh, well thanks a lot! :P I guessed that might be the reason it hadn't been spotted til' now... this is the first time I've hit this particular issue across all the longsleep, ayufan and even previous armbian images... so either I haven't been holding my tongue right, or it's a new 'feature' :D 

 

1 hour ago, zador.blood.stained said:

Obviously comparing the behavior to other releases would be good to see if it depends on u-boot DT (or maybe it's a "feature", not a bug).

 

Yeah, I'm going to  roll back through the earlier images I have saved, and see where it was introduced, as I don't don't think I had this problem with earlier images.  And are you mad? Mentioning AllWinner and "fix things" in the one sentence? Madness... sheer madness!

Link to comment
Share on other sites

11 minutes ago, pfeerick said:

Yeah, I'm going to  roll back through the earlier images I have saved, and see where it was introduced, as I don't don't think I had this problem with earlier images.

It would be good to compare this behavior to other images (longsleep minimal images, maybe some Android images,etc.). Please note that this bug should appear after powering off if ARISC firmware was used to kill the power.

Obviously the u-boot can be patched to bypass this battery check, or maybe leave it on only for the Pinebook, but I'm not sure if this is the right thing to do.

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