Difference between revisions of "CI20 upstream"

From eLinux.org
Jump to: navigation, search
(Update for 3.18 for core drivers)
m (Peripheral drivers)
 
(52 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{TOC right}}
 
{{TOC right}}
This page contains details about the latest kernel branch and any known quirks/special requirements.
+
This page contains details about the latest kernel branch running on the CI20.
  
 
It will be periodically updated to keep up to speed with the latest.
 
It will be periodically updated to keep up to speed with the latest.
Line 9: Line 9:
  
 
== Status of Linux Kernel Drivers ==
 
== Status of Linux Kernel Drivers ==
 +
 +
=== Overview ===
 +
 +
The CI20 uses the Ingenic JZ4780 SoC. Ingenic provided a 3.0.8 kernel with reasonable support for most peripherals on the JZ4780. However, Imagination Technologies has reworked many drivers and forward ported others.
 +
 +
Ingenic produce another SoC called the JZ4740. This SoC has many similarities to the JZ4780 and many of its drivers are in the mainline kernel, although some are rather outdated. With this in mind, the best practice would be to augment the JZ4740 drivers to work with the JZ4780.
 +
 +
The 3.16 branch was created to run the CI20 on a more recent kernel with the aforementioned similarities in mind. There was some work done on consolidation to use the existing JZ4740 drivers. But the core SoC parts were still disjoint.
 +
 +
After collaboration with the kernel community working on JZ4740, JZ4770, JZ4780. 3.18 was rewritten with heavy emphasis on consolidation of the core SoC driver. The resulting core patches are in-flight.
 +
 +
There is still lots of work to be done, so please do contribute to kernel development. We are very welcoming and friendly on #ci20 chatroom and the [https://groups.google.com/forum/#!forum/mips-creator-ci20 mailing list]
  
 
=== Core ===
 
=== Core ===
 +
 +
In-flight patch series for jz4780 core support in kernel can be seen here
 +
http://www.spinics.net/lists/mips/msg55258.html
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 33: Line 48:
 
| 4770 has [https://github.com/gcwnow/linux/commit/58cf5778deb2b72e45cca6b670d8b25809ecdc82], but clock infrastructure is different. Ingenic kernel had [https://github.com/ZubairLK/CI20_linux/blob/75f15b9f845416b349268dc62d1274be11455c13/arch/mips/xburst/soc-4775/common/cpufreq.c] for 4780. Not ported to 3.16 yet.
 
| 4770 has [https://github.com/gcwnow/linux/commit/58cf5778deb2b72e45cca6b670d8b25809ecdc82], but clock infrastructure is different. Ingenic kernel had [https://github.com/ZubairLK/CI20_linux/blob/75f15b9f845416b349268dc62d1274be11455c13/arch/mips/xburst/soc-4775/common/cpufreq.c] for 4780. Not ported to 3.16 yet.
 
|  
 
|  
 +
|-
 +
| CPUidle
 +
|
 +
|
 +
|
 +
|
 +
| Added: [https://github.com/MIPS/CI20_linux/pull/65]
 
|-
 
|-
 
| Device Tree
 
| Device Tree
Line 38: Line 60:
 
|
 
|
 
| N/A
 
| N/A
| Parsed on boot, but compiled into the kernel. Would be good to allow it to be passed from the bootloader.
+
| Parsed on boot, but compiled into the kernel. Would be good to allow it to be passed from the bootloader - allowing the bootloader to edit the DT beforehand.
 
| DT for jz4740 as well
 
| DT for jz4740 as well
 
|-
 
|-
Line 45: Line 67:
 
| drivers/dma/dma-jz4780.c
 
| drivers/dma/dma-jz4780.c
 
|  
 
|  
| needs combining into dma-jz4740. Works, just missing priority support
+
| Needs combining into dma-jz4740. Works, just missing priority support
| still needs combining
+
| See [http://www.spinics.net/lists/devicetree/msg70385.html]
 
|-
 
|-
 
| GPIO
 
| GPIO
Line 52: Line 74:
 
| drivers/pinctrl/pinctrl-jz4780.c
 
| drivers/pinctrl/pinctrl-jz4780.c
 
|  
 
|  
| should perhaps be in drivers/gpio/ (?)
+
| Should perhaps be in drivers/gpio/ (?)
 
|
 
|
 
|-
 
|-
Line 80: Line 102:
 
| drivers/pinctrl/pinctrl-jz4780.c
 
| drivers/pinctrl/pinctrl-jz4780.c
 
| N/A
 
| N/A
| Differs between SoCs. Functional, may need DT binding changes based on feedback from upstream. See also [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/pinctrl/ingenic/pinctrl-jz4770.c pinctrl-jz4770.c].
+
| Differs between SoCs. Functional but may need DT binding changes based on feedback from upstream. See also [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/pinctrl/ingenic/pinctrl-jz4770.c pinctrl-jz4770.c].
 
|
 
|
 
|-
 
|-
Line 88: Line 110:
 
|
 
|
 
|
 
|
|  
+
| Merged into IMG's tree - see [https://github.com/MIPS/CI20_linux/pull/33]
 
|-
 
|-
 
| Power Off & Reset
 
| Power Off & Reset
Line 95: Line 117:
 
|
 
|
 
|
 
|
|
+
| Works correctly as of [https://github.com/MIPS/CI20_linux/pull/59]
 
|-
 
|-
 
| RTC
 
| RTC
Line 109: Line 131:
 
|
 
|
 
| Works  
 
| Works  
|  
+
| Works, but interferes with PWM [http://elinux.org/CI20_Hardware#Primary_expansion_header]
 
|-
 
|-
 
| Watchdog
 
| Watchdog
Line 125: Line 147:
 
! State
 
! State
 
! Path
 
! Path
! Notes
+
! Notes 3.0.8
 +
! Notes 3.16
 +
! Notes 3.18+
 
|-
 
|-
 
| ADC
 
| ADC
| WIP
+
| Works
 +
|
 
|
 
|
 
| Check branches on https://github.com/ZubairLK/CI20_linux
 
| Check branches on https://github.com/ZubairLK/CI20_linux
 +
|
 
|-
 
|-
 
| Audio (ALSA)
 
| Audio (ALSA)
| WIP
+
| Works
 +
|
 
|
 
|
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 +
| Works. Uses jz4740 drivers with patches. i2s parts upstreamed. See [http://www.spinics.net/lists/devicetree/msg66966.html] and [http://www.spinics.net/lists/kernel/msg1941349.html]
 
|-
 
|-
 
| Camera
 
| Camera
Line 141: Line 169:
 
|
 
|
 
|  
 
|  
 +
|
 +
| Support for the camera interface and the OV5640. See [https://github.com/MIPS/CI20_linux/pull/64]
 +
|-
 +
| Efuse
 +
| Works
 +
| drivers/misc/jz_efuse.c
 +
|
 +
|
 +
| Works. Can read chip/serial id. Not linked with dm9000 for mac address. Upstream might face issues as yet another misc driver for eeprom. Efuse might need a subsystem talk etc
 
|-
 
|-
 
| Ethernet
 
| Ethernet
 
| Works
 
| Works
 
| drivers/net/ethernet/davicom/dm9000.c
 
| drivers/net/ethernet/davicom/dm9000.c
 +
|
 
| Requires regulator and reset GPIO support, see [https://github.com/ZubairLK/CI20_linux/commit/e2299336b2922cbbaf1036869690b6fdf953c435].
 
| Requires regulator and reset GPIO support, see [https://github.com/ZubairLK/CI20_linux/commit/e2299336b2922cbbaf1036869690b6fdf953c435].
 +
| Patch upstreamed. See [http://www.spinics.net/lists/netdev/msg312269.html]
 
|-
 
|-
 
| GPU
 
| GPU
|  
+
| External Kernel Module
 
|
 
|
 +
| Works
 
|
 
|
 +
| Kernel module and SGX userland driver have been rewritten and work as expected.
 
|-
 
|-
 
| HDMI
 
| HDMI
 
| WIP
 
| WIP
 
|
 
|
 +
| Resolution change requires kernel recompile
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 +
| No longer requires a kernel recompile to change resolution. See [http://www.spinics.net/lists/dri-devel/msg78713.html]. Needs atomic mode setting and universal plane update for upstreaming. Audio over HDMI now works: [https://github.com/MIPS/CI20_linux/pull/48].
 
|-
 
|-
 
| I2C
 
| I2C
 
| Works
 
| Works
 
| drivers/i2c/busses/i2c-jz4780.c
 
| drivers/i2c/busses/i2c-jz4780.c
 +
|
 
| 4740 has HW issue so uses gpio i2c instead. 4770 had [https://github.com/gcwnow/linux/commit/ffca0556] but unused so removed (also gave false positives on i2cdetect).
 
| 4740 has HW issue so uses gpio i2c instead. 4770 had [https://github.com/gcwnow/linux/commit/ffca0556] but unused so removed (also gave false positives on i2cdetect).
 +
| Works. Not 100% clear if gives spurious errors like 4770. Some i2x tx abrts etc. See [http://www.spinics.net/lists/linux-i2c/msg18892.html]
 
|-
 
|-
 
| IPU
 
| IPU
 
|  
 
|  
 +
|
 
|
 
|
 
| 4770 has driver integrated with fbdev driver, see [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/video/fbdev/jz4770_fb.c]. Plans to move to DRM+KVM but may take time.
 
| 4770 has driver integrated with fbdev driver, see [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/video/fbdev/jz4770_fb.c]. Plans to move to DRM+KVM but may take time.
 +
|
 
|-
 
|-
 
| IR
 
| IR
Line 171: Line 218:
 
| drivers/media/rc/gpio-ir-recv.c
 
| drivers/media/rc/gpio-ir-recv.c
 
| GPIO, so use upstream GPIO driver
 
| GPIO, so use upstream GPIO driver
 +
|
 +
| Using the generic gpio-ir-receiver driver has been merged into IMG's kernel - see [https://github.com/MIPS/CI20_linux/pull/41]
 
|-
 
|-
 
| MMC
 
| MMC
 
| Works
 
| Works
 
| drivers/mmc/host/jz4740_mmc.c
 
| drivers/mmc/host/jz4740_mmc.c
| Various changes needed, see [https://github.com/ZubairLK/CI20_linux/commits/wip-ci20-v3.16-merge/drivers/mmc/host/jz47xx_mmc.c]. Should not rename driver. Check whether affected by [https://github.com/gcwnow/linux/commit/69106c17a401ed897a71b1cd6f5d60d7ea3a6c13].
+
|
 +
| Various changes needed, see [https://github.com/ZubairLK/CI20_linux/commits/wip-ci20-v3.16-merge/drivers/mmc/host/jz47xx_mmc.c]. Should not rename driver. Check whether affected by [https://github.com/gcwnow/linux/commit/69106c17a401ed897a71b1cd6f5d60d7ea3a6c13]. See [https://github.com/gcwnow/linux/commits/jz-4.0-mmc]
 +
| JZ4740 driver has been merged into 3.18 - upstream support is coming soon.
 
|-
 
|-
 
| NAND
 
| NAND
Line 181: Line 232:
 
|
 
|
 
|  
 
|  
 +
| Works. Reworked driver
 +
| See [http://www.spinics.net/lists/kernel/msg1941334.html]
 
|-
 
|-
 
| PWM
 
| PWM
 
|
 
|
 
| drivers/pwm/pwm-jz4740.c
 
| drivers/pwm/pwm-jz4740.c
 +
|
 
| 4770 uses same driver as 4740. Maybe applicable to 4780 too. See [https://github.com/gcwnow/linux/commits/jz-3.18/drivers/pwm/pwm-jz4740.c].
 
| 4770 uses same driver as 4740. Maybe applicable to 4780 too. See [https://github.com/gcwnow/linux/commits/jz-3.18/drivers/pwm/pwm-jz4740.c].
 +
| A modified jz4770 driver and an updated DT file are available here [https://github.com/HarveyHunt/CI20_linux/tree/ci20-v3.18-pwm]. Note: SMP may be using the PWM clock - so perhaps it will need to be disabled?
 
|-
 
|-
 
| Regulator
 
| Regulator
 
| Works
 
| Works
 
|
 
|
|  
+
|
 +
| Works. Based on i2c driver.
 +
| Upstreamed. See [http://www.spinics.net/lists/kernel/msg1933852.html]
 
|-
 
|-
 
| SPI (SSI)
 
| SPI (SSI)
 
| None
 
| None
 
|
 
|
| SPIO GPIO should work, but a dedicated driver for the SSI hardware in drivers/spi/ would be better.
+
|
 +
| SPI GPIO should work, but a dedicated driver for the SSI hardware in drivers/spi/ would be better.
 +
| SPI over GPIO has been added [https://github.com/MIPS/CI20_linux/pull/40], but an SPI driver that uses the dedicated hardware would be better.
 
|-
 
|-
 
| UART
 
| UART
 +
| Works. Has polling support as of: [https://github.com/MIPS/CI20_linux/pull/47]
 +
|
 +
|
 +
| Quirks: see patches [https://github.com/ZubairLK/CI20_linux/commit/1d1d702613e0f4241ab7d8021b937e6366117c79] [https://github.com/MIPS/CI20_linux/commit/3939d3a65122eb40beec6aed1484c04ffc20cc27] See serial patches in series [http://www.spinics.net/lists/mips/msg55258.html].
 
| Works
 
| Works
|
 
| Quirks: see patches [https://github.com/ZubairLK/CI20_linux/commit/1d1d702613e0f4241ab7d8021b937e6366117c79] [https://github.com/MIPS/CI20_linux/commit/3939d3a65122eb40beec6aed1484c04ffc20cc27] need moving to wrapper driver, like 8250_dw and [https://lkml.org/lkml/2014/8/12/266 mediatek] which can be common between Ingenic SoCs.
 
 
|-
 
|-
 
| USB (EHCI)
 
| USB (EHCI)
Line 206: Line 267:
 
|
 
|
 
|  
 
|  
 +
|
 +
| Works
 
|-
 
|-
 
| USB (OHCI)
 
| USB (OHCI)
Line 211: Line 274:
 
|
 
|
 
|  
 
|  
 +
|
 +
| Works
 
|-
 
|-
| USB(OTG)
+
| USB(DWC)
 
| Works
 
| Works
 +
|
 
|
 
|
 
| Upstream driver supports only host mode as of 3.15
 
| Upstream driver supports only host mode as of 3.15
 +
| Works with Ingenic hack to disable over current warnings. See [https://github.com/MIPS/CI20_linux/pull/30]
 
|-
 
|-
 
| VPU
 
| VPU
 
|  
 
|  
 +
|
 
|
 
|
 
| Driver aimed at 4770, see [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/misc/jz_vpu.c]. For samples see [https://github.com/laanwj/gcw0_vpu_poc]. May be insecure (allows userland to do its own cache control and access TCSM banks). RemoteProc driver in progress, see [https://github.com/gcwnow/linux/commit/ab21d08a852431b5e90cda9ffea5ff524374fd8e].
 
| Driver aimed at 4770, see [https://github.com/gcwnow/linux/blob/jz-3.18/drivers/misc/jz_vpu.c]. For samples see [https://github.com/laanwj/gcw0_vpu_poc]. May be insecure (allows userland to do its own cache control and access TCSM banks). RemoteProc driver in progress, see [https://github.com/gcwnow/linux/commit/ab21d08a852431b5e90cda9ffea5ff524374fd8e].
 +
|
 
|-
 
|-
 
| Wifi
 
| Wifi
 
| WIP
 
| WIP
 +
|
 
|
 
|
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 
| Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev
 +
| Works. Uses some hacks to keep regulators on to enable the chip. Uses upstreamed driver and MMC/DMA.
 
|-
 
|-
 
| BT
 
| BT
 
| WIP
 
| WIP
 
|
 
|
| Check branches on https://github.com/ZubairLK/CI20_linux
+
|
 +
|
 +
| Almost works. Uses some hacks to keep regulators on to enable the chip. Scans ok however file transfer presents a few issues. It is possible that this is not entirely kernel's fault - it could be userland.
 
|}
 
|}
  
== List of other possible issues ==
+
== List of other possible issues when moving from 3.0.8 to 3.16+ ==
 +
 
 +
=== Ethernet MAC Address ===
 +
 
 +
Due to the manufacturing process for the CI20, the ethernet's MAC address isn't burned into its EEPROM - it is instead burnt into EEPROM on the other side of the board. The move to 3.18 means the MAC address has to be set at boot time (otherwise a random MAC will be chosen).
 +
 
 +
This can be done using U-BOOT - add the following to your bootargs:
 +
 
 +
    dm9000.mac_addr=${ethaddr}
 +
 
 +
'''Note''': Setting this bootarg for a kernel before 3.18 will cause a kernel panic.
 +
 
 +
=== WiFi firmware ===
 +
 
 +
WiFi on the CI20 is provided by a BRCM4330 chip that requires closed source firmware. These files cannot be shipped as part of the kernel repository and are instead loaded through user space.
 +
 
 +
The required files can be found [https://github.com/ZubairLK/ci20_other_files/tree/master/brcm here]
 +
or copied and renamed from the Debian NAND image, as is illustrated below:
 +
 
 +
    ci20:/lib/firmware/iw8103/fw_bcm4330b2.bin -> /lib/firmware/brcm/brcmfmac4330-sdio.bin
 +
 
 +
    ci20:/lib/firmware/iw8103/nv_4330b2.txt -> /lib/firmware/brcm/brcmfmac4330-sdio.txt
 +
 
 +
'''Note''': Without these files the wireless driver will fail when loading.
 +
 
 +
It is a good idea to unload the Broadcom module after copying over the firmware:
 +
 
 +
modprobe -r brcmfmac
 +
 
 +
Then load the module to enable WiFi:
 +
 
 +
modprobe brcmfmac
 +
 
 +
=== NAND ===
 +
 
 +
If you are using the default debian rootfs on NAND and just update the kernel then a change needs to be made to the bootargs.
 +
 
 +
The NAND drivers between 3.0.8 and 3.16 are different. And detect different partition structures - 3.0.8 detects rootfs on mtd1 whilst 3.18 detects rootfs on mtd3.
 +
 
 +
With this in mind, change U-BOOT's bootargs to:
 +
 
 +
setenv bootargs "console=ttyS4,115200 mem=256M@0x0  mem=768M@0x30000000 ubi.mtd=3 root=ubi0:root rootfstype=ubifs rw clock_ignore_unused"
 +
                                                                                ^
 +
'''Note''': You might want to add another file in /boot instead of changing vmlinux.img so that you can still boot your CI20 if something is wrong with your kernel.
 +
 
 +
setenv bootcmd "mtdparts default; ubi part system; ubifsmount ubi:boot; ubifsload 0x88000000 uImage.3.18; bootm 0x88000000"
 +
                                                                                              ^
 +
Finally, save the environment:
 +
 
 +
saveenv
 +
 
 +
=== SGX ===
 +
 
 +
GPU drivers rely on userland binaries and kernel module sources. The work to move to a [https://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure DRI] based system is on-going at IMG. Until the drivers are updated, using the GPU (openGL etc) will not be possible.
  
* /etc/init.d/iw8103 is the startup script for the BT/Wifi firmware in the default rootfs.
+
For normal usage, Xorg and framebuffer drivers do work. The default xorg.conf is configured to load the PowerVR module. Keep a copy of that somewhere else and use this [https://github.com/ZubairLK/ci20_other_files/blob/master/xorg.conf.fbdev xorg.conf]
  
If using 3.16, the script can cause the boot to hang. Please move the script out of /etc/init.d
+
'''Note''': Rename to xorg.conf. Don't leave it named xorg.conf.fbdev.
  
Add "root=/dev/mmcblk0p1 rootwait" to bootargs in uboot if you wish to boot a rootfs from mmc.
+
Place in:
 +
/etc/X11/xorg.conf
  
 
{{CI20}}
 
{{CI20}}
 
[[Category:CI20|Upstream]]
 
[[Category:CI20|Upstream]]

Latest revision as of 08:32, 18 September 2015

This page contains details about the latest kernel branch running on the CI20.

It will be periodically updated to keep up to speed with the latest.

The current branch tracking mainline 3.18.3

https://github.com/MIPS/CI20_linux

Status of Linux Kernel Drivers

Overview

The CI20 uses the Ingenic JZ4780 SoC. Ingenic provided a 3.0.8 kernel with reasonable support for most peripherals on the JZ4780. However, Imagination Technologies has reworked many drivers and forward ported others.

Ingenic produce another SoC called the JZ4740. This SoC has many similarities to the JZ4780 and many of its drivers are in the mainline kernel, although some are rather outdated. With this in mind, the best practice would be to augment the JZ4740 drivers to work with the JZ4780.

The 3.16 branch was created to run the CI20 on a more recent kernel with the aforementioned similarities in mind. There was some work done on consolidation to use the existing JZ4740 drivers. But the core SoC parts were still disjoint.

After collaboration with the kernel community working on JZ4740, JZ4770, JZ4780. 3.18 was rewritten with heavy emphasis on consolidation of the core SoC driver. The resulting core patches are in-flight.

There is still lots of work to be done, so please do contribute to kernel development. We are very welcoming and friendly on #ci20 chatroom and the mailing list

Core

In-flight patch series for jz4780 core support in kernel can be seen here

http://www.spinics.net/lists/mips/msg55258.html
Name State Path Notes 3.0.8 Notes 3.16 Notes 3.18 +
Clocks Works drivers/clk/jz47xx Could have common drivers/clk/ingenic for all SoCs with SoC specific binding using common components(?) Uses common clock framework with jz4740. Intended for upstream
CPUfreq 4770 has [1], but clock infrastructure is different. Ingenic kernel had [2] for 4780. Not ported to 3.16 yet.
CPUidle Added: [3]
Device Tree Mostly N/A Parsed on boot, but compiled into the kernel. Would be good to allow it to be passed from the bootloader - allowing the bootloader to edit the DT beforehand. DT for jz4740 as well
DMA Mostly drivers/dma/dma-jz4780.c Needs combining into dma-jz4740. Works, just missing priority support See [4]
GPIO Works drivers/pinctrl/pinctrl-jz4780.c Should perhaps be in drivers/gpio/ (?)
Hotplug
IRQ Controller drivers/irqchip/irq-jz4780.c Very similar between SoCs (4740 has one bank, 60,70,80 has two banks) Consolidated work in 3.18 headed upstream
MXU Context
PinCtrl Mostly drivers/pinctrl/pinctrl-jz4780.c N/A Differs between SoCs. Functional but may need DT binding changes based on feedback from upstream. See also pinctrl-jz4770.c.
Power Controller (LPCR Register) Merged into IMG's tree - see [5]
Power Off & Reset Works Works correctly as of [6]
RTC Works drivers/rtc/rtc-jz4740.c Consolidated with jz4740 Consolidated with jz4740
SMP Works Works Works, but interferes with PWM [7]
Watchdog Works Consolidated with jz4740

Peripheral drivers

Name State Path Notes 3.0.8 Notes 3.16 Notes 3.18+
ADC Works Check branches on https://github.com/ZubairLK/CI20_linux
Audio (ALSA) Works Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev Works. Uses jz4740 drivers with patches. i2s parts upstreamed. See [8] and [9]
Camera Support for the camera interface and the OV5640. See [10]
Efuse Works drivers/misc/jz_efuse.c Works. Can read chip/serial id. Not linked with dm9000 for mac address. Upstream might face issues as yet another misc driver for eeprom. Efuse might need a subsystem talk etc
Ethernet Works drivers/net/ethernet/davicom/dm9000.c Requires regulator and reset GPIO support, see [11]. Patch upstreamed. See [12]
GPU External Kernel Module Works Kernel module and SGX userland driver have been rewritten and work as expected.
HDMI WIP Resolution change requires kernel recompile Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev No longer requires a kernel recompile to change resolution. See [13]. Needs atomic mode setting and universal plane update for upstreaming. Audio over HDMI now works: [14].
I2C Works drivers/i2c/busses/i2c-jz4780.c 4740 has HW issue so uses gpio i2c instead. 4770 had [15] but unused so removed (also gave false positives on i2cdetect). Works. Not 100% clear if gives spurious errors like 4770. Some i2x tx abrts etc. See [16]
IPU 4770 has driver integrated with fbdev driver, see [17]. Plans to move to DRM+KVM but may take time.
IR Driver upstream drivers/media/rc/gpio-ir-recv.c GPIO, so use upstream GPIO driver Using the generic gpio-ir-receiver driver has been merged into IMG's kernel - see [18]
MMC Works drivers/mmc/host/jz4740_mmc.c Various changes needed, see [19]. Should not rename driver. Check whether affected by [20]. See [21] JZ4740 driver has been merged into 3.18 - upstream support is coming soon.
NAND Works Works. Reworked driver See [22]
PWM drivers/pwm/pwm-jz4740.c 4770 uses same driver as 4740. Maybe applicable to 4780 too. See [23]. A modified jz4770 driver and an updated DT file are available here [24]. Note: SMP may be using the PWM clock - so perhaps it will need to be disabled?
Regulator Works Works. Based on i2c driver. Upstreamed. See [25]
SPI (SSI) None SPI GPIO should work, but a dedicated driver for the SSI hardware in drivers/spi/ would be better. SPI over GPIO has been added [26], but an SPI driver that uses the dedicated hardware would be better.
UART Works. Has polling support as of: [27] Quirks: see patches [28] [29] See serial patches in series [30]. Works
USB (EHCI) Works Works
USB (OHCI) Works Works
USB(DWC) Works Upstream driver supports only host mode as of 3.15 Works with Ingenic hack to disable over current warnings. See [31]
VPU Driver aimed at 4770, see [32]. For samples see [33]. May be insecure (allows userland to do its own cache control and access TCSM banks). RemoteProc driver in progress, see [34].
Wifi WIP Check patches on https://groups.google.com/forum/#!forum/mips-creator-ci20-dev Works. Uses some hacks to keep regulators on to enable the chip. Uses upstreamed driver and MMC/DMA.
BT WIP Almost works. Uses some hacks to keep regulators on to enable the chip. Scans ok however file transfer presents a few issues. It is possible that this is not entirely kernel's fault - it could be userland.

List of other possible issues when moving from 3.0.8 to 3.16+

Ethernet MAC Address

Due to the manufacturing process for the CI20, the ethernet's MAC address isn't burned into its EEPROM - it is instead burnt into EEPROM on the other side of the board. The move to 3.18 means the MAC address has to be set at boot time (otherwise a random MAC will be chosen).

This can be done using U-BOOT - add the following to your bootargs:

   dm9000.mac_addr=${ethaddr}

Note: Setting this bootarg for a kernel before 3.18 will cause a kernel panic.

WiFi firmware

WiFi on the CI20 is provided by a BRCM4330 chip that requires closed source firmware. These files cannot be shipped as part of the kernel repository and are instead loaded through user space.

The required files can be found here or copied and renamed from the Debian NAND image, as is illustrated below:

   ci20:/lib/firmware/iw8103/fw_bcm4330b2.bin -> /lib/firmware/brcm/brcmfmac4330-sdio.bin
   ci20:/lib/firmware/iw8103/nv_4330b2.txt -> /lib/firmware/brcm/brcmfmac4330-sdio.txt

Note: Without these files the wireless driver will fail when loading.

It is a good idea to unload the Broadcom module after copying over the firmware:

modprobe -r brcmfmac

Then load the module to enable WiFi:

modprobe brcmfmac

NAND

If you are using the default debian rootfs on NAND and just update the kernel then a change needs to be made to the bootargs.

The NAND drivers between 3.0.8 and 3.16 are different. And detect different partition structures - 3.0.8 detects rootfs on mtd1 whilst 3.18 detects rootfs on mtd3.

With this in mind, change U-BOOT's bootargs to:

setenv bootargs "console=ttyS4,115200 mem=256M@0x0  mem=768M@0x30000000 ubi.mtd=3 root=ubi0:root rootfstype=ubifs rw clock_ignore_unused"
                                                                                ^

Note: You might want to add another file in /boot instead of changing vmlinux.img so that you can still boot your CI20 if something is wrong with your kernel.

setenv bootcmd "mtdparts default; ubi part system; ubifsmount ubi:boot; ubifsload 0x88000000 uImage.3.18; bootm 0x88000000"
                                                                                             ^

Finally, save the environment:

saveenv

SGX

GPU drivers rely on userland binaries and kernel module sources. The work to move to a DRI based system is on-going at IMG. Until the drivers are updated, using the GPU (openGL etc) will not be possible.

For normal usage, Xorg and framebuffer drivers do work. The default xorg.conf is configured to load the PowerVR module. Keep a copy of that somewhere else and use this xorg.conf

Note: Rename to xorg.conf. Don't leave it named xorg.conf.fbdev.

Place in:

/etc/X11/xorg.conf