please choosego to mobile | Continue to access the PC version
Author: tcmichals

Orangepi2/plus2/PC H3 Linux mainline support

[Copy link]

2

threads

34

posts

305

credits

Intermediate member

Rank: 3Rank: 3

credits
305
Published in 2015-10-17 00:40:37 | Show all floors
elcct replied at 2015-10-16 23:08
How can I download these patches?

No idea if this can be automated. They are pretty old now anyway and probably would not apply cleanly. Best is probably to browse the mailing list archive and manually extract and apply the relevant code.
Quite frankly not sure this is worth the effort if one has worked on H3 mainline support since then, you'll end up with what I described above, 1 core running way below max cpu freq, no networking.

1

threads

47

posts

189

credits

Registered member

Rank: 2

credits
189
Published in 2015-10-17 16:22:40 | Show all floors
Edited by moinejf at 2015-10-17 16:23

I am also working (slowly) on the mainline kernel.
A first patch on the kernel 4.2 from Jens did boot with one CPU at slow speed and the UART.
I update Jens's patch for the kernel 4.3, but I should have done some error: the kernel does not boot and there is no trace because no UART!
Anyway, I uploaded this patch on my site - see http://moinejf.free.fr/opi2/.

Pratically, I build the kernel on my OPI2 (kernel 3.4) with gcc-5.2.1. At the end of generation (including the copy of the .dts at the end of the kernel), as root, I just copy the uImage to the first partition of the SDcard (with a name different of the 3.4) and install the modules.
To test the kernel, I reboot, stopping the automatic start in the U-boot, and replacing the 'uImage' name in the 'boot_normal' variable.

Otherwise, I tried to write a rtl8189es driver starting from the 8188ee, but I have only a few knowledge about SDIO, so,
I am writing a DRM video driver...



Published in 2015-10-21 20:06:49 | Show all floors
moinejf replied at 2015-10-17 09:22
I am also working (slowly) on the mainline kernel.
A first patch on the kernel 4.2 from Jens did boo ...

Your patch (http://moinejf.free.fr/opi2/kernel-3.4.patch) fix HDMI audio.So, you touched "HDMI files", could you try to add support form HDMI CEC ?

It it possible to use for exmaple these files:

https://github.com/orangepi-xunl ... rs/video/sunxi/hdmi
https://github.com/orangepi-xunl ... vers/video/hdmi-cec



Orange PI PC

0

threads

8

posts

281

credits

Intermediate member

Rank: 3Rank: 3

credits
281
Published in 2015-10-22 02:13:16 | Show all floors
Hi All,
I've had some success this evening booting the latest u-boot and the linux-next kernel with the patches that jemk has just pushed. I'll put some instructions together tomorrow morning if anybody wants them. There is still loads to do but this a massive step in the right direction.

https://gist.github.com/codekipper/e188f9ab36ae7869afa7

CK

5

threads

354

posts

2614

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
2614
Published in 2015-10-22 03:14:31 | Show all floors
There is a long road to go, but probably the only one who is worth.
It makes me a little angry that allwinner does absolutely nothing to support this effort.
Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....

1

threads

28

posts

136

credits

Registered member

Rank: 2

credits
136
Published in 2015-10-22 14:01:33 | Show all floors
@codekipper:

Thank you!  I'll let you know how it goes....

1

threads

28

posts

136

credits

Registered member

Rank: 2

credits
136
Published in 2015-10-22 14:03:13 | Show all floors
@Codekipper

Could I get your build technique?  Thanks!

0

threads

8

posts

281

credits

Intermediate member

Rank: 3Rank: 3

credits
281
Published in 2015-10-22 15:26:08 | Show all floors
@fritz - I'm certain Allwinner's business strategy is selling chipsets for the Android platform which is still stuck in the 3.blah kernel era. Mainlining is a time consuming business and considering that they're a small company unlikely to high up on their agenda. I use to work for a SoC vendor with 5 times the number of staff as AW and we struggled with both mainlining and selling chipsets. When a customer started requiring more attention then those resources working on mainlining were shipped to other areas. Most people just want cheap hardware. On the other hand it give us something to do in the community.

@faddat - I'm currently putting something together....you can get ahead by syncing the linux-next kernel git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next and these u-boot repos https://github.com/jwrdegoede/u-boot-sunxi and https://github.com/jemk/u-boot-sunxi.git. If you could apply these patches to the kernel then you're most of the way there
https://patchwork.kernel.org/patch/7458451/
https://patchwork.kernel.org/patch/7458441/
https://patchwork.kernel.org/patch/7458701/
https://patchwork.kernel.org/patch/7458631/
https://patchwork.kernel.org/patch/7458651/
https://patchwork.kernel.org/patch/7458661/

CK

0

threads

8

posts

281

credits

Intermediate member

Rank: 3Rank: 3

credits
281
Published in 2015-10-22 17:01:24 | Show all floors
Here are some more detailed instructions.
I'm always try to work with pretty much the latest u-boot and kernel. There may be some errors here as I use scripts for a lot of my building and setup. Most of below has been taken from my bash history.

Prepare your card

(echo n; echo p; echo 1; echo 2048; echo +15M; echo n; echo p; echo 2; echo 32768; echo +240M; echo p; echo w) | fdisk /dev/<CARD_LOCATION>
mkfs.vfat /dev/<CARD_LOCATION>1

Build u-boot

In your u-boot git have the following remotes.
git remote add jemk https://github.com/jemk/u-boot-sunxi.git (this is where the patches are)
git remote add sunxi-wip https://github.com/jwrdegoede/u-boot-sunxi (Hans' development track for u-boot)
git fetch --all
git branch orangepi sunxi-wip/sunxi-wip (creates new branch at the latest commit from Hans)
git checkout orangepi
git cherry-pick jemk/sunxi/h3~4..jemk/sunxi/h3 (this adds jemk's h3 patches to the latest u-boot)
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- xunlong_orangepi_plus_defconfig
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf-
dd if=u-boot-sunxi-with-spl.bin of=/dev/<CARD_LOCATION> bs=1024 seek=8
sync
At this point the card should boot to u-boot prompt

Build kernel

In your kernel git have the following remote.
git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
git fetch --all
git branch orangepi linux-next/master
Download the patches from these links
https://patchwork.kernel.org/patch/7458451/
https://patchwork.kernel.org/patch/7458441/
https://patchwork.kernel.org/patch/7458701/
https://patchwork.kernel.org/patch/7458631/
https://patchwork.kernel.org/patch/7458651/
https://patchwork.kernel.org/patch/7458661/
git am *.patch (make sure no other patches are in your repo directory)
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 INSTALL_MOD_PATH=output uImage dtbs modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install (can be ignored for now)

Write to card

mkdir /tmp/sdcard
mount -t vfat /dev/<CARD_LOCATION>1 /tmp/sdcard/
cp <kernel dir>/arch/arm/boot/uImage /tmp/sdcard/.
cp <kernel dir>/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dtb /tmp/sdcard/.

cat > /tmp/boot.cmd << "EOF"
#COMMON SETTINGS
setenv fdt_high ffffffff
#Settings for booting from the card.
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r sun8i-h3-orangepi-plus.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
run uenvcmd
EOF

mkimage -C none -A arm -T script -d /tmp/boot.cmd /tmp/sdcard/boot.scr

cat > /tmp/sdcard/uEnv.txt << EOF
setenv fdt_high ffffffff
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r sun8i-h3-orangepi-plus.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
run uenvcmd
EOF

cd /tmp/
wget http://downloads.openwrt.org/sna ... wrt-sunxi-root.ext4
resize2fs /tmp/openwrt-sunxi-root.ext4 240M
dd if=/tmp/openwrt-sunxi-root.ext4 of=/dev/<CARD_LOCATION>2 bs=128k
sync
umount /tmp/sdcard

This should now boot to the openwrt prompt.

0

threads

8

posts

281

credits

Intermediate member

Rank: 3Rank: 3

credits
281
Published in 2015-10-22 17:01:44 | Show all floors
Here are some more detailed instructions.
I'm always try to work with pretty much the latest u-boot and kernel. There may be some errors here as I use scripts for a lot of my building and setup. Most of below has been taken from my bash history.

Prepare your card

(echo n; echo p; echo 1; echo 2048; echo +15M; echo n; echo p; echo 2; echo 32768; echo +240M; echo p; echo w) | fdisk /dev/<CARD_LOCATION>
mkfs.vfat /dev/<CARD_LOCATION>1

Build u-boot

In your u-boot git have the following remotes.
git remote add jemk https://github.com/jemk/u-boot-sunxi.git (this is where the patches are)
git remote add sunxi-wip https://github.com/jwrdegoede/u-boot-sunxi (Hans' development track for u-boot)
git fetch --all
git branch orangepi sunxi-wip/sunxi-wip (creates new branch at the latest commit from Hans)
git checkout orangepi
git cherry-pick jemk/sunxi/h3~4..jemk/sunxi/h3 (this adds jemk's h3 patches to the latest u-boot)
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- xunlong_orangepi_plus_defconfig
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf-
dd if=u-boot-sunxi-with-spl.bin of=/dev/<CARD_LOCATION> bs=1024 seek=8
sync
At this point the card should boot to u-boot prompt

Build kernel

In your kernel git have the following remote.
git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
git fetch --all
git branch orangepi linux-next/master
Download the patches from these links
https://patchwork.kernel.org/patch/7458451/
https://patchwork.kernel.org/patch/7458441/
https://patchwork.kernel.org/patch/7458701/
https://patchwork.kernel.org/patch/7458631/
https://patchwork.kernel.org/patch/7458651/
https://patchwork.kernel.org/patch/7458661/
git am *.patch (make sure no other patches are in your repo directory)
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
make ARCH=arm -j 18 CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 INSTALL_MOD_PATH=output uImage dtbs modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install (can be ignored for now)

Write to card

mkdir /tmp/sdcard
mount -t vfat /dev/<CARD_LOCATION>1 /tmp/sdcard/
cp <kernel dir>/arch/arm/boot/uImage /tmp/sdcard/.
cp <kernel dir>/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dtb /tmp/sdcard/.

cat > /tmp/boot.cmd << "EOF"
#COMMON SETTINGS
setenv fdt_high ffffffff
#Settings for booting from the card.
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r sun8i-h3-orangepi-plus.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
run uenvcmd
EOF

mkimage -C none -A arm -T script -d /tmp/boot.cmd /tmp/sdcard/boot.scr

cat > /tmp/sdcard/uEnv.txt << EOF
setenv fdt_high ffffffff
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r sun8i-h3-orangepi-plus.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r
run uenvcmd
EOF

cd /tmp/
wget http://downloads.openwrt.org/sna ... wrt-sunxi-root.ext4
resize2fs /tmp/openwrt-sunxi-root.ext4 240M
dd if=/tmp/openwrt-sunxi-root.ext4 of=/dev/<CARD_LOCATION>2 bs=128k
sync
umount /tmp/sdcard

This should now boot to the openwrt prompt.
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list