Posts Tagged ‘drivers’

How to Build a Single Kernel Module (Driver) in Ubuntu

March 6th, 2015 6 comments

When I bought UNI-T UT61E digital multimeter,  I planned to to use the open source tool Sigrok to capture voltage, current or resistance data with my Ubuntu 14.04 machine. Unfortunately, it was just not working for me and I kept getting some “Invalid function byte” error messages, so I asked on Sigrok mailing list, and since it worked for others, I was in big troubles. It turned out the RS-232 to USB dongle I used:

idVendor           0x1a86 QinHeng Electronics
idProduct          0x7523 HL-340 USB-Serial adapter

was most likely to culprit, so I decided to buy another random USB to serial dongle on eBay, and after a few weeks I received it only to find out it had the exact same VID:PID, so I was out of luck. Finally, I gave up on Sigrok on Linux, and tested the power consumption of some Rockchip RK3288 & Amlogic S802 devices in a Windows 7 virtual machine running in my Ubuntu 14.04 host PC. A few days later, Karl Parsonn left a comment saying ch341 driver just ignored parity (UNI-T DMM use odd parity), but that he wrote a patch that should eventually make it to mainline.


Since I did not want to wait I decided to build ch341.ko with the patched driver, and I can now use Sigrok with my HL-340 USB-Serial adapter successfully, but I’ll write more about that in another post, and today, I’ll document the steps I followed to build the driver for my machine.

Instructions to build a kernel module in Ubuntu are already available, but the patch for ch341 driver is for Linux 3.18.6, and Ubuntu 14.04 comes with Linux 3.13. So I had two choices:

  1. Backport the driver to Linux 3.13
  2. Upgrade my Ubuntu kernel to 3.18

I decided to go with option 1 at first, but I quickly changed my mind as there’s been a bit too many modifications between the two versions, and it started to be time consuming. So it was time for plan B, or rather option 2. I could probably have use the Karl’s Linux kernel, but I remembered having read that Canonical makes some changes to the Linux kernel, so instead I went to to download and install Linux 3.18 in my machine (This is 3.18.0, but with hindsights I should have gone with 3.18.6 instead, but it still worked):

cd /tmp/
sudo dpkg -i linux-headers-3.18.0-*.deb linux-image-3.18.0-*.deb

This steps requires a reboot. In case it does not boot at all, you should be able to boot one of the older Linux kernel via grub, and remove the new mainline kernel, so I believe this step is relatively safe.

Then I checkout the Linux kernel and downloaded and applied Ubuntu specific patchsets:

mkdir workddir
cd workdir
git clone git:// v3.18
patch -p1  < 0001-base-packaging.patch 
patch -p1  < 0002-debian-changelog.patch 
patch -p1  < 0003-configs-based-on-Ubuntu-3.18.0-6.7.patch 

Backup the current driver:

sudo mv -v /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ch341.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ch341.ko_backup

Then I mostly followed the build instructions found on Askubuntu to setup the kernel to build modules:

cd v3.18
make oldconfig
make prepare
make scripts
cp -v /usr/src/linux-headers-3.18.0-031800-generic/Module.symvers .

and update the code with the new driver, build and install the module:

cd drivers/usb/serial/
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install

Finally run depmod, unload the old module if needed, and load the newly built module.

sudo depmod
sudo modprobe -r ch341
sudo modprobe -v ch341

Done. I’ve now got a CH341 driver that supports no parity or odd/even parities.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

ARM Releases Kernel Drivers for Mali-T880 / T860 GPUs, User Space Drivers for Mali-T76x GPUs

February 23rd, 2015 17 comments

ARM Mali GPU drivers includes both open source kernel drivers, and binary userspace drivers supporting framebuffer and/ior X11 implementation. The former is rarely an issue and is quickly released, but the latter requires porting and testing for a specific hardware platform, as well legal work, which greatly delay the releases.


Release r5p0-06rel0 for User Space Binary Drivers

Mali-T880 GPU was announced at the beginning of the month together with ARM Cortex A72, and on February 17, 2015, ARM released an update to their Mali-T600 series, Mali-T700 series & Mali-T860/T880 GPU kernel device drivers with revision r5p1-00rel0 that adds supports to Mali-T860 and Mali-T880 GPU. These open source drivers are available for Android and Linux, and also support early Mali-T700 and T600 GPUs.

Separately, the company has also released Mali-T76X GPU drivers for Firefly board powered by Rockchip RK3288 quad core Cortex A17 processor featuring a Mali-T764 GPU. The first release only supports the framebuffer driver, but ARM is expecting to be able to release the X11 version in the next release (r5p1) planned at the end of March, which means some Linux desktop graphics accelerated will soon be available on Rockchip RK3288, and not only some OpenGL ES 3.0 demos on the framebuffer. The latest release (r5p0-06rel0) also supports Exynos powered Arndale Octa board, Samsung Chromebook 2, Arndale board, and Samsung Chromebook. According to an ARM representative, Rockchip also plans to release their own Linux GPU drivers targeting “TopMetal” hardware platform (should probably read PopMetal).

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Linux 3.18 Released

December 10th, 2014 2 comments

Linus Torvalds released Linux Kernel 3.18 last Sunday:

It’s been a quiet week, and the patch from rc7 is tiny, so 3.18 is out.

I’d love to say that we’ve figured out the problem that plagues 3.17 for a couple of people, but we haven’t. At the same time, there’s absolutely no point in having everybody else twiddling their thumbs when a couple of people are actively trying to bisect an older issue, so holding up the release just didn’t make sense. Especially since that would just have then held things up entirely over the holiday break.

So the merge window for 3.19 is open, and DaveJ will hopefully get his bisection done (or at least narrow things down sufficiently that we have that “Ahaa” moment) over the next week. But in solidarity with Dave (and to make my life easier too 😉 let’s try to avoid introducing any _new_ nasty issues, ok?


Linux 3.17 added support for Xbox One controllers, USB device sharing over IP, more secure random numbers, several modifications for perf and more.

Some of the changes made to Linux 3.18 include:

  • Performance improvements for the networking stack thanks to bulk network packet transmission, which “allows a relatively small system to drive a high-speed interface at full wire speed, even when small packets are being transmitted.”
  • Faster suspend and resume by replacing a 100ms polling loop with proper completion notification. This will mostly be noticeable on systems with a large number of cores. Git pull.
  • Berkeley Packet Filter bpf() system call. “The hooks to use this code (in tracing and packet filtering, for example) will take a little longer, but the core support for a “universal virtual machine” in the kernel is now present.”
  • Nouveau drivers for Nvidia GPUs now supports basic DisplayPort audio
  • Several filesystems improvements, notably for BTRFS and F2FS
  • Audio hardware. Codecs: Cirrus Logic CS35L32, Everest ES8328 and Freescale ES8328; others: Generic Freescale sound cards, Analog Devices SSM4567 audio amplifier

New features and improvements specific to the ARM architecture include:

  • Allwinner
    • Allwinner A31/A23 –  RTC  & Watchdog
    • Allwinner A23 – MMC, pinctrl, DMA and I2C
    • New boards: Olimex A20-OLinuXino-Lime, Merrii Hummingbird A20, and HSG H702 tablet board.
  • Rockchip
    • Added new clock-type for the cpuclk
    • Ethernet: Added support for Rockchip SoC layer device tree bindings for arc-emac driver, and emac nodes to the rk3188 device tree.
    • Added driver for Rockchip Successive Approximation Register (SAR) ADC.
    • RK808 PMIC: Added regulator driver, clkout driver, and mfd driver.
  • Amlogic – Added MesonX support, only Meson6 for now (Amlogic AML8726-MX). DTS for Geniatech ATV1200 media player
  • Added basic support for BCM63138 DSL SoC, Texas Instruments AM57xx family, Atmel SAMA5D4, Qualcomm IPQ8064, Renesas r8a7794 SoC,
  • New Device tree files for various board and products: Gateworks GW5520, SAMA5D4ek board,  i.MX1 Armadeus APF9828, i.MX1 ADS board, Technexion Thunder support (TAO3530 SOM based, Sony Xperia Z1, IFC6540 board, CM-QS600 SoM,  etc…

I could find a few changes for MIPS architecture in Linux 3.18 too:

  • SEAD3: Nuke PIC32 I2C driver.
  • Loongson: Make platform serial setup always built-in
  • Netlogic: handle modular USB case & AHCI builds
  • tlbex: Fix potential HTW race on TLBL/M/S handlers
  • cpu-probe: Set the FTLB probability bit on supported cores
  • fix EVA & non-SMP non-FPU FP context signal handling
  • Etc.. You can find a few more changes @

A more thorough changelog for Linux 3.18 will soon be published on Remember to also check ARM architecture and drivers sections, for more details about changes related to ARM platforms.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Qualcomm Releases Userspace Adreno 320 GPU Drivers for Ubuntu

October 30th, 2014 2 comments

Qualcomm Developer Network has just sent the October Newsletter by email, and they had some news specific to Ubuntu / Linux support on IFC6410 development board powered by a Snapdragon 600 processor. Firs they link to a guest blog post on Qualcomm website entitled “Video Conferencing on Linux with the Qualcomm Snapdragon 600 Processor“, where Qualcomm partner eInfochips stated:

Qualcomm Technologies, Inc.’s leadership in mobile market with Linux Android support is well established. As the demand for Qualcomm Snapdragon processors, a product of Qualcomm Technologies, Inc., increase in adjacent markets, the need for non-Android Linux support becomes evident.

Which is always good to read. The rest of the post blog provides a few more details about their a low-latency (50ms glass-to-glass) video conferencing solution based on OpenEmbedded build with Linaro Linux Kernel, and making use of Qt5, Gstreamer, and Sofia SIP library. Further improvements will be achieved with hardware video decoding.

Qualcomm also released a developer preview user-mode Ubuntu Linux driver binaries for Qualcomm Adreno 320 GPU on Inforce IFC6410 board. Linaro already releases a monthly Linaro Member Build for IFC6410 board. This release includes support for OpenGL ES 3.0 and has been tested with the Linaro 14.09 Ubuntu release. The Linaro image already included OpenGL 2.1 support for Adreno 320 GPU, but based on the open source freedreno GPU driver, instead of an official release by Qualcomm.

You can download adreno-ubuntu.tar.gz with your Qualcomm developer credentials.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Linux 3.17 Released

October 9th, 2014 5 comments

Linus Torvalds announced the release of Linux Kernel 3.17 on Sunday:

So the past week was fairly calm, and so I have no qualms about releasing 3.17 on the normal schedule (as opposed to the optimistic “maybe I can release it one week early” schedule that was not to be).

However, I now have travel coming up – something I hoped to avoid when I was hoping for releasing early. Which means that while 3.17 is out, I’m not going to be merging stuff very actively next week, and the week after that is LinuxCon EU…

What that means is that depending on how you want to see it, the 3.18 merge window will either be three weeks, or alternatively just have a rather slow start. I don’t mind getting pull requests starting now (in fact, I have a couple already pending in my inbox), but I likely won’t start processing them for a week.

Anyway, back to 3.17. Nothing major happened during the last week, as you can see from the appended shortlog. Mostly drivers (i915, nouveau, ethernet, scsi, sound) and some networking fixes. With some misc noise all over.

Go out and test,


Kernel 3.16 added Nouveau drivers for GK20A GPU (Tegra K1), ARM64/EFI boot, improved support for Xen, KVM, EFI, NFS, as well as various changed to networking, and more…  Some noticeable changes for Linux 3.17:

  • Gamepads – Added Microsoft Xbox One controller support, improvements to Sony SIXAXIS support
  • Toshiba “Active Protection Sensor” support which stops your harddrive from spinning when the accelerator detects your laptop is in free fall…
  • “Cross-thread filter setting” for secure computing facility:
        int seccomp(unsigned int operation, unsigned int flag, const char *args);

    See manpage for details.

  • Enhanced AMD Radeon R9 290 support
  • Miscellaneous Nouveau driver improvements, including Kepler GPU fixes

New features and improvements specific to the ARM architecture include:

  • AllWinner
    • A10/A20 – IR driver
    • A31 – PIO/R_PIO external interrupts, DMAengine, GMAC
    • A23: Timers, UARTs, initial bringup, Basic clocks,  PIO/R_PIO drivers
    • New boards: ba10-tvbox; Merrii A31 Hummingbird; pcDuino V3
  • Rockchip
    • Enabled RK3288 SoC support
    • Added RK3xxx I2S controller, RK3288 clock controller, RK3066 and RK3188 clock driver.
    • Added RK3288 evaluation boards
  • Added basic support for Mediatek MT6589 SoCs
  • NEON implementation of crypto algorithms (SHA1; SHA512).
  • Marvell Kirkwood now fully “device tree-ified”, mach-kirkwood directory deleted
  • Added APM X-Gene SoC ethernet driver support.
  • Various changes for Broadcom BCM7xxx STB SoCs, Fresscale i.MX, Samsung Exynos & S5PV210, Nvidia Tegra, Renesas SH and TI AM43xx SoCs.
  • ARM64 / ARMv8 – Added 48-bit adress space, CONFIG_CC_STACKPROTECTOR (GCC’s -fstack-protector), audit support, and context tracking

I’ve also been asked about MIPS changes last time, so here it is:

  • Add Loongson-3B support
  • Add NUMA support for Loongson-3
  • BCM47XX: Detect more then 128 MiB of RAM (HIGHMEM)
  • BCM47XX: add Microsoft MN-700 and Asus WL500G
  • Support CPU topology files in sysfs
  • kernel: cpu-probe: Add support for the HardWare Table Walker
  • perf: Add hardware events for P5600

Further details on Linux 3.17 changes will soon be available on For more details about ARM changes, remember to also check ARM architecture and drivers sections.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

MYIR ARM9 Linux Development Boards & Computer-on-Modules Powered by Freescale i.MX28 Processor

August 14th, 2014 No comments

MYIR MYD-IMX28X development boards and MYC-IMX28X CPU modules had been announced in May 2014, but I’ve just found out about them via the company’s newsletter. The CoMs are powered by Freescale i.MX28 ARM9 processors (i.MX283 or i.MX287), feature 128 MB RAM, 256 MB Flash, and connect to a baseboard to make the development boards. Target applications include smart gateways, human-machine interfaces (HMIs), handheld devices, scanners, portable medical, experimental education as well as other industrial applications.


MYIR_MYC-iMX28X_ARM9_CoMMYC-IMX28X computer-on-module specifications:

  • Processor – Freescale i.MX283 or i.MX287 ARM926EJ-STM processor up to 454MHz with 128KB SRAM, 128KB ROM, 1280 bits of OCOTP ROM, 16KB/32KB I and D Cache
  • System Memory – 128MB DDR2 SDRAM
  • Storage – 256MB NAND flash, 128KB SPI flash
  • Connectivity – On-board Ethernet PHY
  • Connectors – 2x 1.27mm pitch 2 x 40-pin SMT male expansion connectors with access to
    • Ethernet – Up to 2 Ethernet (two for i.MX287, one for i.MX283)
    • USB – 2x USB2.0 High-speed ports
    • Serial – Up to 6x Serial ports (including one Debug port)
    • 1x I2C, 2x SPI
    • Up to 8x ADC (one high-speed ADC, seven low-resolution ADC)
    • Up to 5x PWM
    • 1x SDIO
    • 2x CAN (i.MX287 only)
  • Misc – Power and user LEDs
  • Power Supply – 5V
  • Dimensions – 62mm x 38mm
  • Operating Temperature Range – Commercial: -20~70 Celsius; Industrial: -40 to +85 Celsius

The main differences between i.MX283 and i.MX287, are support for only 1 Ethernet port against 2 for i.MX287, and the latter features 2 CAN buses. The company provides an SDK with u-boot, Linux 2.6.35, and relevant drivers for the module.

MYD-IMX28X Boards

Click To Enlarge

MYD-IMX28X Development Board (Click To Enlarge)

The development boards have the following hardware specifications:

  • SoC/Memory/Storage – Based on MYC-IMX283 or MYC-IMX287 modules as described above: Freescale i.MX28 @ 454 MHz, 128 MB DDR2, 256 NAND flash, and 128KB SPI flash
  • External Storage – micro SD card slot
  • Display I/F – 1x LCD interface (16-bit true color, supports optional 4.3-inch and 7-inch TFT LCD), 1x 4-wire resistive touch screen interface
  • Audio – 3.5mm jacks for Audio IN and OUT, and headphone output, digital audio out (RCA), MIC IN interface, Buzzer
  • Serial ports – 1x 3-wire RS232 Debug serial port (DB9), 1x 5-wire RS232 serial port (UART0), 1x RS485
  • USB – 1x USB2.0 Host port, 1x USB2.0 OTG
  • Connectivity – 10/100Mbps Ethernet (two for i.MX287, one for i.MX283)
  • CAN – 2 x CAN interfaces (only for i.MX287)
  • Expansion connector – 2x 20-pin headers with access to 3x ADC (one high-speed ADC, two low-resolution ADC), 1x SPI, 2x I2C, 3x UART, 3x PWM
  • Debugging – 20-pin JTAG interface
  • Misc – 4 x Buttons (1 x Reset button, 3 x User buttons), 2 x User LEDs (Blue)
  • Power Supply – 5V barrel connector
  • Dimensions – 140mm x 90mm

MYD-IMX28X_Block_DiagramPublicly available documentation is limited with only Freescale i.MX28 datasheet, and MYD-IMX28X board and MYC-IMX28X module simplified datasheets with overview of the boards, header pinout, and a list of document and software packages available for the board. U-boot, Linux 2.6.35, and drivers will be provided with source code, as well as some code samples to control various peripherals (SPI. I2C, touchscreen, LCD…) and a Qt demo. MYIR also provides 4.3″ and 7″ resistive or capacitive touchscreen as option for $60 to $99.

The modules and development kits appears to be available now, MYC-IMX28X module starts at $39 for the commercial version, $59 for the industrial version, and the development board, probably excluding the CPU module, sells for $99 and $119, respectively for the commercial and industrial versions. You can find more details on MYIR’s MYC-IMX28X module page.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Linux 3.16 Released

August 6th, 2014 3 comments

Linus Torvalds announced the release of Linux Kernel 3.16 over the week-end:

So nothing particularly exciting happened this week, and 3.16 is out there.

And as usual (previous release being the exception) that means that the merge window for 3.17 is obviously open. And for the third time in a row, the timing sucks for me, as I have travel coming up the second week of the merge window. Many other core developers will be traveling too, since it’s just before the kernel summit in Chicago.

So we’ll see how the next merge window goes, but I’m not going to worry about it overmuch. If I end up not having time to do all the merges, I might delay things into the week of the kernel summit, but I’ll hope to get most of the big merging done this upcoming week before any travel takes place, so maybe it won’t come to that. So this is just a heads-up that the merge window *might* be extended.

Anyway, back to the changes since -rc7: it’s really fairly small stuff randomly all over, with a third being architecture updates, a third drivers, and a third “misc” (mainly mm and networking). The architecture stuff is small ARM updates (mostly DT), some x86 Xen fixups, some random small powerpc things. The shortlog gives a good idea of what kind of stuff it all is, but it’s really just 83 commits (plus merges and the release commit) and about a third of them are marked for stable.

So while 3.16 looked a bit iffy for a while, things cleared up nicely, and there was no reason to do extra release candidates like I feared just a couple of weeks ago.


Kernel 3.15 brought various file systems improvements, faster resume from suspend, etc… Some of Linux 3.16 main changes include:

  • Various KVM improvements: optimizations, support for migration, and GDB support for s390, little-endian support for POWER8, as well as MIPS improvements.
  • Xen – Virtual network interfaces now have multi-queue support for much better performance.
  • Goldfish virtual platform now has 64-bit support.
  • Hugepage migration has been turned off for all architectures except x86_64 since it is only tested on that architecture and there are bugs for some of the others.
  • Automatic NUMA balancing has been turned off for 32-bit x86. Existing 32-bit NUMA systems are not well supported by the code and the developers did not think the effort to support them would be worthwhile.
  • EFI – The kernel EFI code will now handle Unicode characters, and initial support for ARM64 (aarch64) had been added.
  • NFS – Patches to make loopback NFS mounts work reliably have been merged through the NFS tree.  External data representation (XDR) handling in NFS has been reworked to support access control lists (ACLs) larger than 4KB. It also returns readdir() results in chunks larger than 4KB giving better performance on large directories.
  • Modules now have the read-only (RO) and no-execute (NX) bits set on their data sections much earlier in the loading process, before parsing any module arguments. This will further reduce the time window in which a misbehaving (or malicious) module can modify or execute its data.
  • Support for TCP fast open over IPv6 has been added.
  • Support for busy polling on stream control transmission protocol (SCTP) sockets has been added. Busy polling is set on a socket using the SO_BUSY_POLL socket option; it can reduce the latency of receives on high-traffic interfaces that support the option.

New features and improvements specific to the ARM architecture include:

  • AllWinner – All platforms: AXP20x PMIC and MMC support, 5 drivers + SMP reworked for AllWinner A31, touchscreen drivers for AllWinner A10. DTS added for Mele M9 and R7. You can read details about AllWinner changes here.
  • Rockchip – RK3xxx SoC I2C drivers
  • Xen on ARM systems now supports suspend and resume.
  • Hibernation support added for ARM targets.
  • Initial support for ARM64 (aarch64) had been added
  • SMP support has been added for Marvell Armada 375 and 38x SoCs. SMP has been reworked for the Allwinner A31 SoC.
  • New ARM SoC added: ST Microelectronics STiH407; Freescale i.MX6SX; Samsung Exynos 3250, 5260, 5410, 5420, and 5800; and LSI Axxia AXM55xx.
  • Nouveau driver has initial support for NVIDIA Tegra K1 GK20A devices.
  • Various changes for Atmel AT91, Marvell Armada, Fresscale i.MX, Samsung Exynos, and TI AM43xx SoCs.

Further details on Linux 3.16 will eventually be available on For more details about ARM changes, remember to also check ARM architecture and drivers sections.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Amlogic GPL Source Code Release – Kernel 3.10, U-Boot, and Drivers (Wi-Fi, NAND, TVIN, Mali GPU)

March 10th, 2014 36 comments

Last month, I noticed Amlogic provided links to the Android SDK for S802 / M802 on their open source website, but the only way to get the source was to share your SSH public with Amlogic, so that they give you access. It did not happen, but the company has released the source for Linux 3.10.10, U-boot 2011.03, Realtek and Broadcom Wi-Fi drivers, NAND drivers, “TVIN”drivers, and kernel space GPU drivers for Mali-400 / 450 GPU. There are also some customer board files for Meson 6 only (AML8726-MX / M6) but they do not seem to match the kernel…


If you want to build the kernel, including the drivers, you’ll need to download a bunch of files:


You’ll need to extract these tarballs in specific directories:

tar xvf arm-src-kernel-2014-03-06-d5d0557b2b.tar.gz
mkdir -p hardware/amlogic/
mkdir -p hardware/wifi/realtek/drivers
mkdir -p hardware/wifi/broadcom/drivers
mkdir -p hardware/arm/
cd hardware/amlogic
tar xvf ../../../aml_nand-2014-03-06-39095c4296.tar.gz
mv aml_nand-amlogic-nand nand
cd ../wifi/realtek/drivers
tar xvf ../../../../rtk8192du-2014-03-06-7f70d95d29.tar.gz
tar xvf ../../../../rtk8192eu-2014-03-06-9766866350.tar.gz
tar xvf ../../../../rtk8192cu-2014-03-06-54bde7d73d.tar.gz 
tar xvf ../../../../rtk8188eu-2014-03-06-2462231f02.tar.gz
mv rtk8188eu-8188eu 8188eu
mv rtk8192du-8192du 8192du
mv rtk8192cu-8192cu 8192cu
mv rtk8192eu-8192eu 8192eu
cd ../../broadcom/drivers
tar xvf ../../../../brcmap6xxx-2014-03-06-302aca1a31.tar.gz
mv brcmap6xxx-ap6xxx ap6xxx
cd ../../../arm
tar xvf ../../gpu-2014-03-06-0425a1f681.tar.gz
mv gpu-r3p2-01rel3 gpu
cd ..
tar xvf ../../aml_tvin-2014-03-06-fb3ba6b1c8.tar.gz 
mv aml_tvin-amlogic-3.10-bringup tvin

You can also extract the customer file into the kernel directory to add some drivers. As I said above I’m not sure the source code inside matches the Linux kernel 3.10.10, because there’s now device tree file for the boards. In arch/arm/plat-meson/Kconfig, there are (commented out) references to customer/meson/dt/Kconfig and customer/drivers/Kconfig. The device tree is not available, but the drivers is, so you could give a try in order to build the touchscreen and sensors drivers available in the customer tarball:

cd ../linux-amlogic-3.10-bringup
tar xvf ../aml_customer-2014-03-06-76ce689191.tar.gz 
mv aml_customer-master customer

Finally, the development tree is ready to build the kernel. There must surely be a script somewhere to do that… I haven’t used the file wifi-fw-2014-03-06-d3b2263640.tar.gz, as the kernel did not complain about it, and it looks like it’s just for Android Kit Kat. There are four scripts to build the kernel:, mk_m6tv,, and The first three are for meson6 (dual core processor), and the last one meson8 (quad core S802/M802).

Let’s go with M8 build:

make ARCH=arm meson8_defconfig

Please not that I had to change, as it should just make computer hand requiring a hard reset. The culprity was the line:

make uImage -j

The manpage indicates “If the -j option is given without an argument, make  will  not  limit  the number of jobs that can run simultaneously”.  It does not seem like a good idea… ,s so I changed that to

make uImage -j8

Upon successful build, the end of log you look like:

UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.10.10
Created: Mon Mar 10 11:48:52 2014
Image Type: ARM Linux Kernel Image (lzo compressed)
Data Size: 7099978 Bytes = 6933.57 kB = 6.77 MB
Load Address: 00008000
Entry Point: 00008000
Image arch/arm/boot/uImage is ready
/home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/scripts/amlogic/ /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dtd
DTD_FILE: /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dtd
the middle dts file: /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts
process file /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts start
processing... please wait...
process file /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts end

CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
DTC arch/arm/boot/dts/amlogic/meson8_skt.dtb
rm /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts
-rw-r–r– 1 jaufranc jaufranc 11244948 Mar 10 11:48 ./m8boot.img
m8boot.img done

If you want to get U-boot code it’s not quite as messy, you jut need to download and extract two files:

tar xvf uboot-2014-03-06-323515c056.tar.gz
cd uboot-next
tar xvf ../aml_uboot_customer-2014-03-06-09887e87b4.tar.gz
mv aml_uboot_customer-next/ customer

Then just select a board in customer/board/ to build U-boot for your hardware. For example:

make m8_k03_M102_v1_config CROSS_COMPILE=arm-linux-gnueabihf-
make CROSS_COMPILE=arm-linux-gnueabihf- -j8

The build failed for me, but it might be I may need to use another compiler, e.g. arm-none-eabi-gcc.

[Update: arm-none-eabi-gcc does seem to go further, but you’ll also need an arc compiler as shown in my previous Amlogic U-boot build instructions].

Thanks to M][sko for the tip.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter