BPI-M2+ source code on github


(bpi team) #1

All newest source code have update on this github site.

BPI-M2P-bsp Getting Started

Choose a board doing: ./build.sh,

Choose a board doing

“This tool supports the following BPI board(s):”

************************************************"

  1. BPI_M2P_720P"

  2. BPI_M2P_1080P"

  3. BPI_M2P_USB_720P"

  4. BPI_M2P_USB_1080P"

*************************************************"

BPI-M2P SD Card Info

Step 1.To be on safe side erase the first part of your SD Card (also clears the partition table).

 sudo  dd if=/dev/zero of=${card} bs=1M count=1

Step 2.Go to folder “Download”, put the file(s) to 100MB of the SD Card whit DD command.

sudo dd if=boot0_sdcard.fex     of=${card} bs=1k seek=8

sudo dd if=u-boot.fex           of=${card} bs=1k seek=16400

sudo dd if=sunxi_mbr.fex    of=${card} bs=1k seek=20480

sudo dd if=boot-resource.fex    of=${card} bs=1k seek=36864

sudo dd if=env.fex          of=${card} bs=1k seek=69632

#2

Can you please detail the complete SD card layout, so we can format the SD card from scratch and then dd the corresponding fex files?


(bpi team) #3

SD Card Layout , all allwinner chip is same.


(Ivan Ip) #4

Notice to who cannot compile properly

As the fact you’re compiling the image properly, except the environment configurations since @sinvoip will never release in a short period. So if you need to get your device ready with your homemade images, please flash a premade image by @sinovoip, after flashing your desired image/system, compile using ./build.sh and run the sub-option 1, 5, 6, 8 to make sure the image is placed/packed properly. Then you will want to go to the download/ folder and execute the following command:

sudo dd if=boot0_sdcard.fex     of=${card} bs=1k seek=8
sudo dd if=u-boot.fex           of=${card} bs=1k seek=16400
sudo dd if=sunxi_mbr.fex        of=${card} bs=1k seek=20480
sudo dd if=boot-resource.fex    of=${card} bs=1k seek=36864

Please remember to replace the ${card} with your absolute path, such as: /dev/mmcblk0 Or simply execute the following command before executing the above commands:

export card=/dev/mmcblk0

Do you mind explaining more about the differences, between the USB and without USB options? Also is that the 720p/1080p represents the default resolutions for bootup/system?

–lifehome

EDIT: I am always trying to build the BPI_M2P_USB_1080P option, however the system won’t boot after step 2. I have totally no idea how to overcome such situation… :cry:


(BPI_Justin) #6

HI: you can follow it .

Step 1: Format your SD Card

Step 2: Put the file(s) to 100MB of the SD Card whit DD command.

sudo dd if=boot0_sdcard.fex of=/dev/sdb bs=1k seek=8

sudo dd if=u-boot.fex of=/dev/sdb bs=1k seek=16400

sudo dd if=sunxi_mbr.fex of=/dev/sdb bs=1k seek=20480

sudo dd if=boot-resource.fex of=/dev/sdb bs=1k seek=36864

sudo dd if=env.fex of=/dev/sdb bs=1k seek=69632

Step 3: Check console log:

HELLO! BOOT0 is starting!
boot0 version : 4.0.0
boot0 commit : 368945ad3c87c1814bfe3eea5aab3ffc0e9d2d5c
 
fel_flag = 0x00000000
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x00000000
rtc[4] value = 0x00000000
rtc[5] value = 0x00000000
rtc[6] value = 0x00000000
rtc[7] value = 0x00000000
DRAM DRIVE INFO: V1.3
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
READ DQS LCDL = 001f1f1f
DRAM Type = 3 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
DRAM CLK = 672 MHz
DRAM zq value: 003b3bfb
DRAM dram para1: 10f40400
DRAM dram para2: 00000000
DRAM workmode1: 000009f4
DRAM SIZE =1024 M
odt delay 
dram size =1024
card boot number = 0
card no is 0
sdcard 0 line count 4
[mmc]: mmc driver ver 2015-04-13 16:07:39
[mmc]: ***Try SD card 0***
[mmc]: SD/MMC Card: 4bit, capacity: 7600MB
[mmc]: vendor: Man 00275048 Snr 7c8a57ca
[mmc]: product: SD8GB
[mmc]: revision: 3.0
[mmc]: ***SD/MMC 0 init OK!!!***
sdcard 0 init ok
The size of uboot is 000e4000.
sum=ed7a0298
src_sum=ed7a0298
Succeed in loading uboot from sdmmc flash.
Ready to disable icache.
Jump to secend Boot.
SUNXI_NORMAL_MODE   
already secure mode[      0.377]

U-Boot 2011.09-rc1-00000-g1d6fe6d (Jul 22 2016 - 08:46:44) Allwinner Technology 

[      0.385]version: 1.1.0
[      0.388]uboot commit : 1d6fe6d644f1df412458dcce24b1fec4ef72842a
 
normal mode
[      0.399]pmbus:   ready
not set main pmu id
axp_probe error
[board_vendor] vid_used not used
[      0.417]PMU: pll1 1008 Mhz,PLL6=600 Mhz
AXI=336 Mhz,AHB=200 Mhz, APB1=100 Mhz 
sid read already 
fel key new mode
run key detect
no key found
no key input
dram_para_set start
dram_para_set end
normal mode
[      0.448]DRAM:  1 GiB
relocation Offset is: 35af0000
[box standby] read rtc = 0x0
[box_start_os] mag be start_type no use
user_gpio config
user_gpio ok
gic: normal or no secure os mode
workmode = 0
MMC:	 0
[      0.526][mmc]: mmc driver ver 2015-04-13 14:50:00
[      0.531][mmc]: get sdc_phy_wipe fail.
[      0.535][mmc]: get sdc0 sdc_erase fail.
[      0.539][mmc]: get sdc_f_max fail,use default 50000000Hz
[      0.544][mmc]: get sdc_ex_dly_used fail,use default dly
[      0.550][mmc]: SUNXI SD/MMC: 0
[      0.563][mmc]: *Try SD card 0*
[      0.596][mmc]: CID 0x27504853 0x44384742 0x307c8a57 0xca00f8bb
[      0.601][mmc]: mmc clk 50000000
[      0.605][mmc]: SD/MMC Card: 4bit, capacity: 7600MB
[      0.610][mmc]: boot0 capacity: 0KB,boot1 capacity: 0KB
[      0.615][mmc]: ***SD/MMC 0 init OK!!!***
[      0.620][mmc]: erase_grp_size:0x1WrBlk * 0x200 = 0x200 Byte
[      0.625][mmc]: secure_feature 0x0
[      0.629][mmc]: secure_removal_type  0x0
[      0.633]sunxi flash init ok
script config pll_de to 864 Mhz
Not Found clk pll_video1 in script 
script config pll_video to 297 Mhz
script config pll_periph0 to 600 Mhz
[boot]disp_init_tv
[DISP_TV] disp_init_tv enter g_tv_used
screen 0 do not support TV TYPE!
[BOOOT_DISP_TV] disp tv device_registered
unable to find regulator vcc-hdmi-18 from [pmu1_regu] or [pmu2_regu] 
enable power vcc-hdmi-18, ret=-1
DRV_DISP_Init end
[disk_read_fs] no the partition
error: open tv_vdid.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
boot_disp.auto_hpd=1
auto hpd check has 0 times!
attched ok, mgr0<-->device0, type=4, mode=4----
ready to set mode
[      1.532]finally, output_type=0x4, output_mode=0x4, screen_id=0x0, disp_para=0x404
In:    serial
Out:   serial
Err:   serial
--------fastboot partitions--------
-total partitions:6-
-name-        -start-       -size-      
boot-res    : 1000000       2000000     
env         : 3000000       1000000     
boot        : 4000000       1000000     
rootfs      : 5000000       20000000    
klog        : 25000000      1000000     
UDISK       : 26000000      0           
-----------------------------------
base bootcmd=run setargs_nand boot_normal
bootcmd set setargs_mmc
key 0
cant find rcvy value
cant find fstbt value
no misc partition is found
to be run cmd=run setargs_mmc boot_normal
[      1.601][mmc]: MMC Device 2 not found
[      1.605][mmc]: Can not find mmc dev
[      1.608][mmc]: read first backup failed in fun sdmmc_secure_storage_read line 1854
sunxi_secstorage_read fail
get secure storage map err
check user data form private
the private part isn't exist
WORK_MODE_BOOT
adver not need show
sunxi_bmp_logo_display
f_read btr over hd12896
read byte = 6220854
[      1.949]screen_id =0, screen_width =1280, screen_height =720
[      1.955]frame buffer address 46400036
[      1.958]Hit any key to stop autoboot:  3  2  1  0 
[      5.214][mmc]: MMC Device 2 not found

** Invalid boot device **

** Unable to read "bananapi/bpi-m3/linux/uEnv.txt" from mmc 0:1 **

** Unable to read "uEnv.txt" from mmc 0:1 **
read boot or recovery all
boota: bad boot image magic, maybe not a boot.img?
try to read all
[      5.947]sunxi flash read :offset 4000000, 16777216 bytes OK
boota: bad boot image magic, maybe not a boot.img?
sunxi#

(Ivan Ip) #7

Uhm, your console log seems as same as mine, that CANNOT boot up properly.
Plus it hanged at ------sun8i_smp_init_ops----37----- log. Any idea?

HELLO! BOOT0 is starting!
boot0 version : 4.0.0
boot0 commit : 368945ad3c87c1814bfe3eea5aab3ffc0e9d2d5c
 
fel_flag = 0x00000000
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x00000000
rtc[4] value = 0x00000000
rtc[5] value = 0x00000000
rtc[6] value = 0x00000000
rtc[7] value = 0x00000000
DRAM DRIVE INFO: V1.3
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
READ DQS LCDL = 001f1f1f
DRAM Type = 3 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
DRAM CLK = 672 MHz
DRAM zq value: 003b3bfb
DRAM dram para1: 10f40400
DRAM dram para2: 00000000
DRAM workmode1: 000009f4
DRAM SIZE =1024 M
odt delay 
dram size =1024
card boot number = 0
card no is 0
sdcard 0 line count 4
[mmc]: mmc driver ver 2015-04-13 16:07:39
[mmc]: ***Try SD card 0***
[mmc]: SD/MMC Card: 4bit, capacity: 29608MB
[mmc]: vendor: Man 0002544d Snr 26669f87
[mmc]: product: SA32G
[mmc]: revision: 2.5
[mmc]: ***SD/MMC 0 init OK!!!***
sdcard 0 init ok
The size of uboot is 000e4000.
sum=146eb13e
src_sum=146eb13e
Succeed in loading uboot from sdmmc flash.
Ready to disable icache.
Jump to secend Boot.
SUNXI_NORMAL_MODE   
[      0.378]e mode

U-Boot 2011.09-rc1-00000-g1d6fe6d-dirty (Jul 22 2016 - 12:07:05) Allwinner Technology 

[      0.387]version: 1.1.0
[      0.390]uboot commit : 1d6fe6d644f1df412458dcce24b1fec4ef72842a
 
normal mode
[      0.401]pmbus:   ready
not set main pmu id
axp_probe error
[board_vendor] vid_used not used
[      0.419]PMU: pll1 1008 Mhz,PLL6=600 Mhz
AXI=336 Mhz,AHB=200 Mhz, APB1=100 Mhz 
sid read already 
fel key new mode
run key detect
no key found
no key input
dram_para_set start
dram_para_set end
normal mode
[      0.450]DRAM:  1 GiB
relocation Offset is: 35af0000
[box standby] read rtc = 0x0
[box_start_os] mag be start_type no use
user_gpio config
user_gpio ok
gic: normal or no secure os mode
workmode = 0
MMC:	 0
[      0.528][mmc]: mmc driver ver 2015-04-13 14:50:00
[      0.533][mmc]: get sdc_phy_wipe fail.
[      0.537][mmc]: get sdc0 sdc_erase fail.
[      0.541][mmc]: get sdc_f_max fail,use default 50000000Hz
[      0.546][mmc]: get sdc_ex_dly_used fail,use default dly
[      0.552][mmc]: SUNXI SD/MMC: 0
[      0.565][mmc]: *Try SD card 0*
[      0.598][mmc]: CID 0x2544d53 0x41333247 0x2526669f 0x87010529
[      0.603][mmc]: mmc clk 50000000
[      0.607][mmc]: SD/MMC Card: 4bit, capacity: 29608MB
[      0.612][mmc]: boot0 capacity: 0KB,boot1 capacity: 0KB
[      0.617][mmc]: ***SD/MMC 0 init OK!!!***
[      0.622][mmc]: erase_grp_size:0x1WrBlk * 0x200 = 0x200 Byte
[      0.628][mmc]: secure_feature 0x0
[      0.631][mmc]: secure_removal_type  0x0
[      0.635]sunxi flash init ok
script config pll_de to 864 Mhz
Not Found clk pll_video1 in script 
script config pll_video to 297 Mhz
script config pll_periph0 to 600 Mhz
[boot]disp_init_tv
[DISP_TV] disp_init_tv enter g_tv_used
screen 0 do not support TV TYPE!
[BOOOT_DISP_TV] disp tv device_registered
unable to find regulator vcc-hdmi-18 from [pmu1_regu] or [pmu2_regu] 
enable power vcc-hdmi-18, ret=-1
DRV_DISP_Init end
[disk_read_fs] no the partition
error: open tv_vdid.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
boot_disp.auto_hpd=1
auto hpd check has 100 times!
auto check no any connected, the output_type is 4
[      2.022]finally, output_type=0x4, output_mode=0x4, screen_id=0x0, disp_para=0x0
In:    serial
Out:   serial
Err:   serial
--------fastboot partitions--------
-total partitions:6-
-name-        -start-       -size-      
boot-res    : 1000000       2000000     
env         : 3000000       1000000     
boot        : 4000000       1000000     
rootfs      : 5000000       20000000    
klog        : 25000000      1000000     
UDISK       : 26000000      0           
-----------------------------------
base bootcmd=run setargs_nand boot_normal
bootcmd set setargs_mmc
key 0
cant find rcvy value
cant find fstbt value
no misc partition is found
to be run cmd=run setargs_mmc boot_normal
[      2.092][mmc]: MMC Device 2 not found
[      2.095][mmc]: Can not find mmc dev
[      2.099][mmc]: read first backup failed in fun sdmmc_secure_storage_read line 1854
sunxi_secstorage_read fail
get secure storage map err
check user data form private
the private part isn't exist
WORK_MODE_BOOT
adver not need show
sunxi_bmp_logo_display
f_read btr over hd12896
read byte = 6220854
[      2.436]screen_id =0, screen_width =0, screen_height =0
[      2.441]frame buffer address 46400036
[      2.445]Hit any key to stop autoboot:  0 
[      5.700][mmc]: MMC Device 2 not found

** Invalid boot device **
[      5.712][mmc]: blkcnt should not be 0
Loaded environment from uEnv.txt
Running uenvcmd ...
Banaan Pi bpi-m3 chip: a83t Service: linux

** Unable to read "bananapi/berryboot.img" from mmc 0:1 **
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.39-BPI-M3-Kernel
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5717288 Bytes = 5.5 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
[      6.097][mmc]: MMC Device 2 not found
[      6.101][mmc]:  mmc  not find,so not exit
[      6.105]
Starting kernel ...

[sun8i_fixup]: From boot, get meminfo:
	Start:	0x40000000
	Size:	1024MB
ion_carveout reserve: 96m 128m
ion_reserve_common: ion reserve: [0x78000000, 0x80000000]!
ion_cma reserve: 120m 176m 512m
ion_reserve_common: ion reserve: [0x75000000, 0x80000000]!
------sun8i_smp_init_ops----37-----

(Ivan Ip) #8

Moreover to your indication, I have found that the source that posted on GitHub is mostly M3 instead of M2+, you may find the wrong env settings in the following place:

[lifehome@term BPI-M2P-bsp]$ pt "board=bpi-m3"
sunxi-pack/chips/sun8iw7p1/configs/BPI_M2P_1080P/env.cfg
25:board=bpi-m3

sunxi-pack/chips/sun8iw7p1/configs/BPI_M2P_USB_1080P/env.cfg
25:board=bpi-m3

sunxi-pack/chips/sun8iw7p1/configs/BPI_M2P_USB_720P/env.cfg
25:board=bpi-m3

output/BPI_M2P_1080P/pack/env.cfg
25:board=bpi-m3

[lifehome@term BPI-M2P-bsp]$ 

In addition to this, all of the files (boot0_sdcard.fex, u-boot.fex, sunxi_mbr.fex, boot-resource.fex) are doing well in the dd process, however I suspect the env.fex is still adopting the code for BPI-M3 instead of BPI-M2+, therefore the env.fex will never work.


(Ivan Ip) #9

@sinovoip @BPI_Justin @lionwang @Jason @shadowninjazx @projectbananapi

Any updates on open sourcing the env.cfg? Making the repo compatible with M2+?


(bpi team) #10