Difference between revisions of "Rock/Linux Mainline"
(Use linux-next tree for kernel development) |
RadxaYuntian (Talk | contribs) |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{rock_header}} | |
+ | {{Languages | rock/Linux_Mainline}} | ||
− | + | = Linux Kernel 3.18-rc5 = | |
− | == | + | == Status == |
− | + | What currently works in Linux mainline: | |
+ | * UART | ||
+ | * SPI | ||
+ | * I2C | ||
+ | * GPIOs / LEDs / IR | ||
+ | * PWM | ||
+ | * USB | ||
+ | * SD/MMC | ||
+ | * Ethernet | ||
+ | * Wifi | ||
+ | * BT | ||
− | git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git | + | What remains to be done: |
+ | * DRM Display driver / LCD controller | ||
+ | * HDMI drivers (ITE66121 / RK616) | ||
+ | * TV OUT drivers (RK1000) | ||
+ | * NAND flash support | ||
+ | |||
+ | == Requirements == | ||
+ | |||
+ | Ubuntu 14.10 / GCC 4.9+ (GCC 4.8 is not supported) | ||
+ | |||
+ | sudo apt-get install git build-essential gcc-arm-linux-gnueabihf lzop libncurses5-dev libssl-dev bc | ||
+ | |||
+ | == Get the source code == | ||
+ | |||
+ | Get '''linux-next''' kernel tree (stable branch), default config and updated device-tree. | ||
+ | |||
+ | git clone -b stable --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git | ||
cd linux-next | cd linux-next | ||
− | |||
− | |||
− | == Build == | + | wget http://rockchip.fr/radxa/linux/rockchip_defconfig -O arch/arm/configs/rockchip_defconfig |
+ | wget http://rockchip.fr/radxa/linux/rk3188-radxarock.dts -O arch/arm/boot/dts/rk3188-radxarock.dts | ||
+ | |||
+ | == Build kernel == | ||
+ | |||
+ | We have to build two files: | ||
+ | * '''zImage''' (the kernel) | ||
+ | * '''rk3188-radxarock.dtb''' (the device tree blob) | ||
+ | |||
+ | |||
+ | export ARCH=arm | ||
+ | export CROSS_COMPILE=arm-linux-gnueabihf- | ||
− | |||
make rockchip_defconfig | make rockchip_defconfig | ||
− | make -j8 rk3188-radxarock.dtb | + | make -j8 zImage dtbs |
− | + | ||
+ | == Create boot image == | ||
+ | |||
+ | Install mkbootimg if you don't have it on your system. | ||
+ | |||
+ | git clone https://github.com/neo-technologies/rockchip-mkbootimg.git | ||
+ | cd rockchip-mkbootimg | ||
+ | make | ||
+ | sudo make install | ||
+ | cd .. | ||
+ | |||
+ | We need to append the device tree blob to zImage (CONFIG_ARM_APPENDED_DTB option) until we can use U-Boot device tree support. | ||
+ | |||
+ | cat arch/arm/boot/zImage arch/arm/boot/dts/rk3188-radxarock.dtb > zImage-dtb | ||
+ | |||
+ | ==get ramdisk== | ||
+ | |||
+ | git clone https://github.com/radxa/initrd.git | ||
+ | find . ! -path "./.git*" | cpio -H newc -ov > initrd.img | ||
+ | |||
+ | Create the '''boot.img''' using mkbootimg (Rockchip version). | ||
+ | |||
+ | mkbootimg --kernel zImage-dtb --ramdisk initrd.img -o boot.img | ||
+ | |||
+ | == Flash parameter and boot image == | ||
+ | |||
+ | Get a parameter file from http://dl.radxa.com/rock/images/parameter | ||
+ | |||
+ | wget http://dl.radxa.com/rock/images/parameter/parameter_linux_sd | ||
+ | |||
+ | Flash parameter and boot.img using [https://github.com/linux-rockchip/rkflashtool '''rkflashtool'''] | ||
+ | |||
+ | rkflashtool P < parameter_linux_sd | ||
+ | rkflashtool w boot < boot.img | ||
+ | rkflashtool b | ||
+ | |||
+ | = Notes = | ||
+ | |||
+ | == Install Rootfs in first partition of SD card == | ||
+ | |||
+ | Your rootfs should be in ext4 format. It will be loaded from '''/dev/mmcblk0p1''' by default. | ||
+ | |||
+ | == Wireless == | ||
+ | |||
+ | The Realtek wifi chipsets require firmwares to be installed in '''/lib/firmware/rtlwifi''' | ||
+ | |||
+ | You can get them by installing the '''linux-firmware''' package from your Linux distribution | ||
+ | sudo apt-get install linux-firmware | ||
− | + | or download them from here: http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/rtlwifi | |
− | + | == BT == | |
− | + | ||
− | + | ||
− | + | ||
− | The | + | The '''rtl8723au_bt''' driver is not in the mainline kernel yet, but you can build it this way: |
− | = | + | git clone -b new https://github.com/lwfinger/rtl8723au_bt.git |
+ | cd rtl8723au_bt/Linux_BT_USB_2.11.20140423_8723BE/ | ||
+ | wget http://rockchip.fr/radxa/linux/patches/rtl8723au_bt/0001-Add-hci_recv_fragment-function.patch | ||
+ | git am 0001-Add-hci_recv_fragment-function.patch | ||
+ | make KDIR=../.. | ||
− | + | Copy the firmware files and '''rtk_btusb.ko''' into your rootfs: | |
− | + | 8723A/rtl8723a_fw -> /lib/firmware/rtl8723a_fw | |
− | + | 8723B/rtl8723b_fw -> /lib/firmware/rtl8723b_fw | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Latest revision as of 03:13, 29 September 2022
Contents
Linux Kernel 3.18-rc5
Status
What currently works in Linux mainline:
- UART
- SPI
- I2C
- GPIOs / LEDs / IR
- PWM
- USB
- SD/MMC
- Ethernet
- Wifi
- BT
What remains to be done:
- DRM Display driver / LCD controller
- HDMI drivers (ITE66121 / RK616)
- TV OUT drivers (RK1000)
- NAND flash support
Requirements
Ubuntu 14.10 / GCC 4.9+ (GCC 4.8 is not supported)
sudo apt-get install git build-essential gcc-arm-linux-gnueabihf lzop libncurses5-dev libssl-dev bc
Get the source code
Get linux-next kernel tree (stable branch), default config and updated device-tree.
git clone -b stable --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git cd linux-next
wget http://rockchip.fr/radxa/linux/rockchip_defconfig -O arch/arm/configs/rockchip_defconfig wget http://rockchip.fr/radxa/linux/rk3188-radxarock.dts -O arch/arm/boot/dts/rk3188-radxarock.dts
Build kernel
We have to build two files:
- zImage (the kernel)
- rk3188-radxarock.dtb (the device tree blob)
export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf-
make rockchip_defconfig make -j8 zImage dtbs
Create boot image
Install mkbootimg if you don't have it on your system.
git clone https://github.com/neo-technologies/rockchip-mkbootimg.git cd rockchip-mkbootimg make sudo make install cd ..
We need to append the device tree blob to zImage (CONFIG_ARM_APPENDED_DTB option) until we can use U-Boot device tree support.
cat arch/arm/boot/zImage arch/arm/boot/dts/rk3188-radxarock.dtb > zImage-dtb
get ramdisk
git clone https://github.com/radxa/initrd.git find . ! -path "./.git*" | cpio -H newc -ov > initrd.img
Create the boot.img using mkbootimg (Rockchip version).
mkbootimg --kernel zImage-dtb --ramdisk initrd.img -o boot.img
Flash parameter and boot image
Get a parameter file from http://dl.radxa.com/rock/images/parameter
wget http://dl.radxa.com/rock/images/parameter/parameter_linux_sd
Flash parameter and boot.img using rkflashtool
rkflashtool P < parameter_linux_sd rkflashtool w boot < boot.img rkflashtool b
Notes
Install Rootfs in first partition of SD card
Your rootfs should be in ext4 format. It will be loaded from /dev/mmcblk0p1 by default.
Wireless
The Realtek wifi chipsets require firmwares to be installed in /lib/firmware/rtlwifi
You can get them by installing the linux-firmware package from your Linux distribution
sudo apt-get install linux-firmware
or download them from here: http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/rtlwifi
BT
The rtl8723au_bt driver is not in the mainline kernel yet, but you can build it this way:
git clone -b new https://github.com/lwfinger/rtl8723au_bt.git cd rtl8723au_bt/Linux_BT_USB_2.11.20140423_8723BE/ wget http://rockchip.fr/radxa/linux/patches/rtl8723au_bt/0001-Add-hci_recv_fragment-function.patch git am 0001-Add-hci_recv_fragment-function.patch make KDIR=../..
Copy the firmware files and rtk_btusb.ko into your rootfs:
8723A/rtl8723a_fw -> /lib/firmware/rtl8723a_fw 8723B/rtl8723b_fw -> /lib/firmware/rtl8723b_fw