jernejsk / OpenELEC-OPi2

OpenELEC - The living room PC for everyone
http://openelec.tv
87 stars 25 forks source link

Add ability to build for different OrangePI #1

Closed runnerway closed 8 years ago

runnerway commented 8 years ago

Ex: For PC : PROJECT=OPi DEVICE=PC ARCH=arm make image For 2 : PROJECT=OPi DEVICE=2 ARCH=arm make image

fex for PC is the same as 2 with only USB fixed.

jernejsk commented 8 years ago

Thanks for the patch, however, don't you think that it would be better just to leave build system as it is and provide different binary scripts on FAT partition. Then you pre-load correct one in uEnv.txt to address 0x43000000? I think loboris uses something similar.

BTW, it seems that you must update your PR because I commited changes to orange_pi2.fex. I also updated resolution to 1920x1080@60Hz in it.

runnerway commented 8 years ago

The solution you pointed out seems good.

I will try to find how loboris did this. Until now i couldn't find anything.

jernejsk commented 8 years ago

I have intention to switch to mainline U-Boot anyway, so it would be best to use their solution for old kernels. You can take a look here: https://linux-sunxi.org/Mainline_U-Boot

Short instructions:

  1. Put any number of different compiled fex files on fat partition, e.g. orange_pi2.bin, orange_pi_pc.bin,...
  2. Add command "load mmc 0:1 0x43000000 orange_pi_pc.bin" in uEnv.txt
lymon66 commented 8 years ago

I have changed the line containing "uenvcmd" in uenv.txt to boot on my OPI-PC:

uenvcmd=fatload mmc 0:1 0x43000000 script.bin;fatload mmc 0:1 0x42000000 kernel;bootm 0x42000000

(make sure you have the correct script.bin for your device in the root of the SD-card.)

to boot on a OPI2, just remove script.bin from the sdcard

jernejsk commented 8 years ago

If I understand you correctly, you confirmed that approach that I described works? If so, can you update your patches so all fex files gets converted to bin files and copied to fat partition during image build?

Which build should be default then? Maybe we can leave OPi2 as default and describe somewhere how to change uenv.txt file for other boards?

jernejsk commented 8 years ago

I merged vonfritz's variant, which also includes mainline u-boot.