Xunlong Orange Pi One & Lite

Orange Pi One and Lite are H3 based development boards produced by Xunlong.

The One is clearly Orange Pi PC's little/smaller sibling. Compared to the PC the following is different: smaller size, 512MiB instead of 1GiB DRAM (still two DDR3L modules making use of the full 32 bit memory bandwidth), 2 USB host ports aren't exposed and the following is also missing: IR receiver, microphone and TRRS jack for Audio/CVBS video.

The Lite features RTL8189FTV WiFi (shipping with a small external antenna connected to the u.FL connector between the USB ports), saves the Ethernet port but regains one more USB port, IR receiver and microphone.

Xunlong chose a different voltage regulator on these two boards that requires software adjustments to get dynamic voltage frequency scaling (dvfs) working. Apart from that Xunlong tried to keep both small boards as compatible as possible to the PC so that all OS images for the PC work with One and Lite with just two drawbacks: Non functional dvfs without fex file adjustments and no WiFi without new drivers on the Lite.

= Identification = OPi One PCB has the following silkscreened on it: Orange Pi One V1.1 Orange Pi Lite shows: Orange Pi Lite V1.1

= Sunxi support =

Current status
The H3 and Orange Pi One support is progressing nicely. It is possible to find a usable mainline 4.x kernel (plus some patches) and a legacy 3.4 kernel in various work-in-progress git branches. See the Manual build section for more details.

Manual build
You can build things for yourself by following our Manual build howto and by choosing from the configurations available below.

Mainline U-Boot
Use the orangepi_pc build target (supported since v2016.01-rc2) unless orangepi_one or orangepi_lite targets are available.

The boards can boot from SD card or via FEL. Only the initial basic functionality is implemented and there is still no Ethernet driver for H3 in U-Boot v2016.05 (it affects only u-boot functionality, device would work in linux as long kernel supports it).

Sunxi/Legacy Kernel
The 3.4 kernel from the official Allwinner's git repository does not support H3 yet. But it is possible to use one of the kernel forks, based on the lichee H3 SDK tarball:
 * Siarhei Siamashka's branch '20151207-embedded-lima-memtester-h3' at https://github.com/ssvb/linux-sunxi/tree/20151207-embedded-lima-memtester-h3
 * Yann Dirson's fork added a few more fixes and adopted most of Boris Lovosevic' great initial work on Allwinner's H3 kernel

In the meantime a newer H3 BSP variant appeared with tons of fixes which has been made available by FriendlyARM. A cleaned up fork has been adopted by Armbian project and can be found here. On top of that Armbian maintains a bunch of 3.4.x patches for H3 devices: https://github.com/igorpecovnik/lib/tree/master/patch/kernel/sun8i-default (here you find also the necessary patch set to support the new 8189FTV WiFi chip on the Lite)

Configure this kernel using sun8i_h3_defconfig, the rest is explained in the kernel compilation guide.

Since the manufacturer did not provide new fex files when Orange Pi One has been released in early 2016 you might want to use Armbian's (community developed) fex files: orangepione.fex and orangepilite.fex since they support the different voltage regulator on these boards, the new WiFi chip on the Lite and implement community derived improved THS settings (dynamic voltage frequency scaling and optimized thermal/throttling settings -- look at the dvfs_table and cooler_table sections in the fex files above).

When booting the legacy 3.4 kernel with mainline U-Boot, add the following line to boot.cmd:

setenv machid 1029 setenv bootm_boot_mode sec

Mainline kernel
Since all H3 based Orange Pi are more or less similar please have a look at the current state for Orange Pi PC instead.

= Tips, Tricks, Caveats =

FEL mode
Both boards will fail over to FEL mode if it doesn't detect a card present in the µSD slot. There is no dedicated FEL button.

Compatibility
Since Xunlong didn't provide new OS images with Orange Pi One's release users try to use images/settings for Orange Pi PC. While this seems to work and Ethernet and USB are functional on the One the logs get flooded with "ARISC ERROR" messages due to a different voltage regulator (full log):

[ARISC ERROR] :message process error [ARISC ERROR] :message addr  : f004b840 [ARISC ERROR] :message state : 5 [ARISC ERROR] :message attr  : 2 [ARISC ERROR] :message type  : 30 [ARISC ERROR] :message result : ff [ARISC WARING] :callback not install [cpu_freq] ERR:set cpu frequency to 1008MHz failed!

On the Orange Pi PC the SY8106A is accessible through I2C and the H3's AR100 OpenRISC core tries to adjust the CPU core voltage (VDD_CPUX) this way. On One and Lite a different voltage regulator is used: the SY8113B (datasheet) is a step-down converter that can adjust its output voltage driven by two resistors. According to Xunlong staff on OPi One this is used to switch between 1.1V at 624 MHz and 1.3V at every cpufreq above. Users that looked a little bit closer discovered that the similar AX3833 is used on the first batch of boards instead (see Gallery and link to datasheet below).

To get reliable performance/thermal behaviour with OS images that use legacy 3.4.x kernels adopted fex settings are needed. Please have a look in the aforementioned fex files from Armbian that implement this correctly. Same regarding WiFi: Please see above where to get the necessary patches to get RTL8189FTV up and running (the good news: since OpenELEC team who fixed the drivers relied on 8189es driver already ported to mainline the necessary fixes can be easily used to get WiFi working with kernel 4.x too)

CPU clock speed limit
Xunlong advertises both boards as being only capable of running at 'up to 1.2GHz'. Since the SY8113B/AX3833 voltage regulator should only be able to switch between 1.1V and 1.3V this would prevent clocking the SoC higher than 1200MHz according to the common comments in the FEX files from various H3 SDK variants:
 * dvfs voltage-frequency table configuration
 * pmuic_type:0:none, 1:gpio, 2:i2c
 * pmu_gpio0: gpio config.
 * pmu_levelx: 0~9999: voltage(mV), 10000~90000:gpio0 state. voltage form high to low.
 * extremity_freq(Hz): cpu extremity frequency when run benckmark or demo apk
 * 1536MHz@1500mV with radiator, 1296MHz@1340mV without radiator
 * max_freq: cpu maximum frequency, based on Hz, can not be more than 1200MHz
 * min_freq: cpu minimum frequency, based on Hz, can not be less than 60MHz
 * LV_count: count of LV_freq/LV_volt, must be < 16
 * LV1: core vdd is 1.50v if cpu frequency is (1296Mhz, 1536Mhz]
 * LV2: core vdd is 1.34v if cpu frequency is (1200Mhz, 1296Mhz]
 * LV3: core vdd is 1.32v if cpu frequency is (1008Mhz, 1200Mhz]
 * LV4: core vdd is 1.20v if cpu frequency is (816Mhz,  1008Mhz]
 * LV5: core vdd is 1.10v if cpu frequency is (648Mhz,   816Mhz]
 * LV6: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]
 * LV7: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]
 * LV8: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]
 * LV5: core vdd is 1.10v if cpu frequency is (648Mhz,   816Mhz]
 * LV6: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]
 * LV7: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]
 * LV8: core vdd is 1.04v if cpu frequency is (0Mhz,     648Mhz]

DRAM clock speed limit
DRAM is clocked at 672 MHz by the hardware vendor. But the reliability still needs to be verified. One of the ways of doing reliability tests may be https://github.com/ssvb/lima-memtester/releases/tag/20151207-orange-pi-pc-fel-test (developed for Orange Pi PC). An adoption of this using a fex file suited for Orange Pi One's/Lite's different voltage regulator is available here (md5sum: e600db41f94446bb77224223fc1dc2a0 fel-boot-lima-memtester-on-orange-pi-one-v3.tgz). Use the fel-boot-lima-memtester-on-orange-pi-one script inside to test both boards.

'''We need still more test results in the table above in order to have more accurate statistics and finally pick a safe default DRAM clock speed for U-Boot. Preferably there should be at least 10 entries in the table (more is always better). And there are no "good" or "bad" test results. Even if your result looks very similar to the already reported results from the other people, please still add yours to the table! Because if people don't feel like reporting their "boring" results, then "interesting" outliers will unfortunately skew the statistics. Thanks!'''

DRAM clock speed limit (automated statistical analysis)
Below is an intermediate analysis of the currently reported results, using the lima-memtester-genchart script (run the script using this page URL as the command line argument). Assuming that the Gaussian distribution is a good approximation, try to predict what percentage of boards is expected to pass the lima-memetser test at different DRAM clock frequencies. The lima-memtester page provides more information.

Updating the analysis report: wget https://raw.githubusercontent.com/ssvb/lima-memtester/master/lima-memtester-genchart ruby lima-memtester-genchart https://linux-sunxi.org/Xunlong_Orange_Pi_One
 * 1) copy/paste the script output into the linux-sunxi wiki

LEDs
The boards have two LEDs next to the 40 pin GPIO header:
 * A red LED, connected to the PA15 pin.
 * A green LED, connected to the PL10 pin.

When using kernel 3.4 with Xunlong's or loboris' settings then the LEDs can only be switched on/off. By changing the definition in the fex files (see patch or the aforementioned fex files for the One/Lite OpenElec and Armbian use) both LEDs can be used the usual way (using different triggers and so on)

Camera module
Xunlong sells also a cheap 2MP camera (an attempt to fix the driver's limited resolutions can be found here). Unlike Orange Pi Plus/2 that can directly connect to the camera module for the Orange Pi PC/One/Lite an 'expansion board' is needed (see gallery below). If you order from Xunlong simply tell them that you need the camera for Orange Pi One or Lite and they ship camera together with the small board.

HDMI to DVI converters
When trying to use HDMI to DVI converters with Allwinner's 3.4.x kernel for H3/R16/A83T/H8/R58 a small fix has to be applied. The fex file has to be modified (and converted back to script.bin afterwards) so that the following has been added to the [hdmi_para] section: hdcp_enable = 0 hdmi_cts_compatibility = 1

Orientation of the GPIO header
Due to the position of USB and/or Ethernet jacks Xunlong chose to rotate the 40 pin GPIO connector by 180° so RPi HATs can still be used but will project over the board in the opposite direction than intended. Keep this also in mind when you want to power the board through GPIO pins 2/4/6 (2/4 being connected directly with DC-IN and 6 being GND)

Adding ports/connectors that are missing
On the One the two missing USB ports, analog audio out, microphone, IR receiver and TV out are still available for people with soldering skills. Have a look into the gallery below or in the aforementioned thread for details. Same applies to the one missing USB port, analog audio out and TV out on the Lite

Locating the UART
The UART pins are located next to Ethernet / USB jack on the boards. They are marked as TX, RX and GND on the PCB. Just attach some leads according to our UART Howto.

= Pictures =

Orange Pi Lite
Please note that the boards are sold without any heatsink. This is just the tester's standard heatsink for all H3 boards now.

= See also =


 * Xunlong Orange Pi site
 * Official Github Repository.
 * Official Orange Pi Form.
 * H3_Manual_build_howto
 * Opi One Schematic v1.1: [[File:ORANGE PI-ONE-V1_1.pdf]]
 * Opi Lite Schematic v1.1: [[File:Orange_pi-lite-v1_1.pdf]]
 * AX3833 datasheet: [[File:AX3833.pdf]]

OS images
At the moment only OS images relying on Allwinner's 3.4.x BSP kernel are available for the boards. Most of them suffer from wrong settings for the different voltage regulator used on One and Lite, the only known exceptions are currently the Armbian images and OpenELEC for both boards and WiFi support for the Lite. Xunlong also released a new Android image for the Lite that should support the new WiFi chip and also work with the One (just based on assumptions and not tested).

In case you want to use other OS images with One and Lite be prepared to adjust fex settings to get thermal/performance settings right, that you need a kernel patch for the new WiFi module on the Lite and that all OS images except OpenELEC/Armbian use a horribly outdated kernel version 3.4.39 missing tons of fixes.

= References =