Author: Demetris

Openwrt Designated Driver (Trunk) Build for Orange Pi PC/Pi Plus

[Copy link]

6

threads

35

posts

291

credits

Intermediate member

Rank: 3Rank: 3

credits
291
Published in 2016-2-16 13:12:52 | Show all floors
i try plug usb ethernet it looks like to be working (blinking lights) ,. how do i get into this device. telnet or ssh ? if so. what the ip addrs of the device (opi pc)  

1

threads

25

posts

216

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
216
 Author| Published in 2016-2-16 22:20:36 | Show all floors
It should be reachable at 192.168.1.1

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
Published in 2016-2-17 19:56:47 | Show all floors
>I have compiled an openwrt image for orange pi plus.
>And yes try to boot opi+ and let me know
>Sources are there will post a link soon i was just waiting for ethernet driver support
>and after but if you need them you can have them asap

I tried your OPI+ image today:

[root@karma openwrt-sunxi-orangepi_plus-sdcard-vfat-ext4.img]# dd if=/dev/zero of=${card} bs=1M count=1
[root@karma openwrt-sunxi-orangepi_plus-sdcard-vfat-ext4.img]# dd if=openwrt-sunxi-orangepi_plus-sdcard-vfat-ext4.img of=${card} bs=1M oflag=direct
70+0 records in
70+0 records out
73400320 bytes (73 MB) copied, 18.6308 seconds, 3.9 MB/s

[root@karma openwrt-sunxi-orangepi_plus-sdcard-vfat-ext4.img]# fdisk -lu ${card}

Disk /dev/sdc: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        2048       43007       20480    c  W95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary.
/dev/sdc2           45056      143359       49152   83  Linux

Boot.scr:
setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage
setenv loaddtb fatload mmc 0 \$fdt_addr_r 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



Nevertheless after booting no single LED is lit on and the board is inaccessible neither through WiFi, not ethernet port.

Could any progress be made?

Also, could you advise the way the images are built from sources?

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
Published in 2016-2-17 20:13:29 | Show all floors
Forgot to mention, that mouse LED was lit on. All the rest is switched off and the board is inaccessible.

1

threads

25

posts

216

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
216
 Author| Published in 2016-2-18 03:43:54 | Show all floors
Sorry cant help you much with Opi-Plus as i don’t own the board but i will check if Ethernet driver is enabled in source and recompile.

1

threads

9

posts

55

credits

Registered member

Rank: 2

credits
55
Published in 2016-2-19 15:06:16 | Show all floors
It seems that Openwrt does not boot on my Orangepi PC.The light on board is not flashing(the red light).How can I solve this?

0

threads

6

posts

216

credits

Intermediate member

Rank: 3Rank: 3

credits
216
Published in 2016-2-19 17:02:18 | Show all floors
Hi,Demetris. Image that you posted is very promising ,with ethernet support it wil be good i'l try it now  on OPI PC

2

threads

29

posts

112

credits

Registered member

Rank: 2

credits
112
Published in 2016-2-20 07:03:36 | Show all floors
Hi,

I look at src, it 's seem there is no definition of ethernet hardware in sun8i-h3.dtsi so start hard thing for novice like me!
With help of the hard work of Loboris, I notice the ethernet hardware use gmac driver and on openwrt side (sun6i-a31.dtsi) i find the same register address base, also same in sunxi_geth.h (loboris working kernel) :
  1. #if defined(CONFIG_ARCH_SUN8I)
  2. #define GETH_BASE                0x01c30000
Copy code


So maybe we can verify register used in sun6i-a31.dtsi (openwrt) with exelent Loboris work on ethernet support and try to make it work on H3?
Maybe there is another hardware difference...

trunk/build_dir/target-arm_cortex-a8+vfpv3_musl-1.1.12_eabi/linux-sunxi/linux-4.4/arch/arm/boot/dts/sun6i-a31.dtsi
Something usefull for ethernet support or g_ether via otg

  1. gmac: ethernet@01c30000 {
  2.                         compatible = "allwinner,sun7i-a20-gmac";
  3.                         reg = <0x01c30000 0x1054>;
  4.                         interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
  5.                         interrupt-names = "macirq";
  6.                         clocks = <&ahb1_gates 17>, <&gmac_tx_clk>;
  7.                         clock-names = "stmmaceth", "allwinner_gmac_tx";
  8.                         resets = <&ahb1_rst 17>;
  9.                         reset-names = "stmmaceth";
  10.                         snps,pbl = <2>;
  11.                         snps,fixed-burst;
  12.                         snps,force_sf_dma_mode;
  13.                         status = "disabled";
  14.                         #address-cells = <1>;
  15.                         #size-cells = <0>;
  16.                 };
  17. usb_otg: usb@01c19000 {
  18.                         compatible = "allwinner,sun6i-a31-musb";
  19.                         reg = <0x01c19000 0x0400>;
  20.                         clocks = <&ahb1_gates 24>;
  21.                         resets = <&ahb1_rst 24>;
  22.                         interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
  23.                         interrupt-names = "mc";
  24.                         phys = <&usbphy 0>;
  25.                         phy-names = "usb";
  26.                         extcon = <&usbphy 0>;
  27.                         status = "disabled";
  28.                 };
Copy code


How to find the equivalent dtsi information (register) in loboris kernel? I look for about OTG because the datasheet of H3 is empty for this section

2

threads

29

posts

112

credits

Registered member

Rank: 2

credits
112
Published in 2016-2-20 07:06:11 | Show all floors
Edited by boob at 2016-2-20 07:40

For compilation of trunk Openwrt, there is no complication or hard thing, just update to lastest openwrt and be patient for compiling toolchain
5 Hours on my old laptop
Be sure you have 1G free ram for compiling big binary like gcc5.2 and don't use -j 2 if you haven't 2G ram free for toolchain compilation. You wiil need at least 10GB of HDD space, 20GB is safety ;)
Testing from ubuntu14.04 32 bit

  1. svn update
  2. ./scripts/feeds update -a

  3. make menuconfig

  4. ---> select sunxi
  5.         ---> Target Profile (orangepi_plus)
  6. make defconfig
Copy code


2

threads

29

posts

112

credits

Registered member

Rank: 2

credits
112
Published in 2016-2-21 10:15:02 | Show all floors
Edited by boob at 2016-2-21 10:31

Hi I give a try to make ethernet with PHY internal to work,,,if someone want to try?
Experimental purpose, it's compile but I didnt try it maybe your board will explode
Modification : change IRQ according datasheet, add gmac and try to activate it, add reset for internal PHY.
I think the stmmac driver (dwmac-sunxi.c) can be work and one guy say gmac is working but no ethernet
This driver is already enable in kernel configuration (make kernel_menuconfig - type / to find where is stmmac)
I see that in datasheet and maybe it's a problem :

  1. EMAC Clock Register defaut value (H3 datasheet V1.1 page 153)
  2. 0b1011000000000000000 --- 0x58000
  3. CLK_SEL 24mhz = 1 (in the stmmac driver, there is a define for 25mhz...)
  4. led POL high active = 0
  5. shutdown = 1 (bit 16) (I add a reset way in dtsi to powerup internal ethernet...)
  6. Internal PHY = 1
Copy code


Just
  1. make kernel/linux/{clean,prepare}
Copy code

for patching all the dts files (generating) and prepare the build without building.

Editing/remplace 2 files : sun8i-h3.dtsi and sun8i-h3-orangepi-plus.dts in trunk/build_dir/target-arm_cortex-a8+vfpv3_musl-1.1.12_eabi/linux-sunxi/linux-4.4/arch/arm/boot/dts/
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list