Changes between Version 1 and Version 2 of Gen9A101TurboICSLinuxNotes

Timestamp:
09/13/13 09:28:41 (3 years ago)
Author:
comphuter
Comment:

Added wl12xx (wireless-compat) and btwilink (bluetooth-compat) kernel module build instructions and Bluetooth/UIM setup information

Legend:

Unmodified
Added
Removed
Modified
  • Gen9A101TurboICSLinuxNotes

    v1 v2  
    3 3 = Archos A101 G9 "Turbo ICS" Linux notes = 
    4 4  
    5   This is a collection of notes specific to a linux-based system. All of these notes are specific to the Archos 101 G9 Turbo and some things (such as kernel modules) might be different on non-Turbo models or Archos A80 G9 models, respectively. This notes are mostly system-independent, though some things might be Slackware-specific (ARMedslack 14.0) because that's the used baseline system. These notes are the basic low-level steps needed to provide specific functionalities on your native Linux system (e.g. Debian, Slackware or LFS) running on your Archos A101 G9 Turbo and might not be useful for Android systems. 
    6    
    7   == Hardware drivers / Kernel modules == 
    8    
    9   Note that it is highly recommended to use the [http://dev.openaos.org/search?q=wiki%3A%22Gen9Resources%22 archos-gpl-gen9-kernel-ics kernel provided by archos] (Also, I recommend to use the ''linux-ics-3.0.21'' branch of the git-tree). Otherwise there might be no support for the device with a '''very''' high possibility. 
    10    
    11   '''Note:''' Instructions on building a kernel image, a small initrd to boot a system from MicroSD are to come. Also, I will add some general information on what _exactly_ is needed to build a working kernel for the A101G9 Turbo (i.e., which kernel modules are really necessary and which are just G80/Whatever stuff). That needs some more investigation. 
      5 This is a collection of notes specific to a linux-based system. All of these notes are specific to the Archos 101 G9 Turbo and some things (such as kernel modules) might be different on non-Turbo models or Archos A80 G9 models, respectively. This notes are mostly system-independent. These notes are the basic low-level steps needed to provide specific functionalities on your native Linux system (e.g. Debian, Slackware or LFS) running on your Archos A101 G9 Turbo and might not be useful for Android systems. 
      6  
      7 Some work was already done beforehand by [http://www.basyskom.com/ BasysKom] and the Mer Project. Packages and patches of their gen9 adaption is still alive on their OBS, provided by some people: 
      8  * notmart: [https://build.merproject.org/project/show?project=home%3Anotmart%3AMer_Extras%3AAdaptation%3AArchos-gen9 omapfb] and [https://build.merproject.org/project/show?project=home%3Anotmart%3AMer_Extras%3AAdaptation%3AArchos-gen9%3Apvr pvr] 
      9  * wonko: [https://build.merproject.org/project/show?project=home%3Awonko%3Aarchos-g9-pa-adaptation omapfb] and [https://build.merproject.org/project/show?project=home%3Awonko%3Aarchos-g9-pa-adaptation%3Apvr pvr] 
      10  
      11 ---- 
      12 == Hardware drivers / Kernel source == 
      13  
      14 There two linux kernel sources available, knowing to work with the G9 series: 
      15  
      16 === archos-gpl-gen9-kernel-ics === 
      17 The [http://dev.openaos.org/search?q=wiki%3A%22Gen9Resources%22 archos-gpl-gen9-kernel-ics kernel provided by archos]. It provides two branches: The (''master'') 3.0.8 and the ''linux-ics-3.0.21'' branch. The latter one is basically what one might want, though there is trouble with the wifi driver. 
      18  
      19 === archos-gen9-mer-adaption-kernel-ics === 
      20 The [http://gitorious.org/archos-gen9-mer-adaptation-kernel/archos-gen9-mer-adaptation-kernel-ics/ Mer gen9 adaption kernel source]. This one also provides two branches: ''master'' and ''pvr''. The master branch is the same as the archos-gpl-gen9-kernel-ics 3.0.8 branch with some additional patches/fixes. The ''pvr'' branch contains several fixes and additional OMAPDRM support. If OMAPDRM is not important for you, you might still want to get the fixes provided by the ''pvr'' branch. If you still insist on sticking with the master branch, take a look at [https://build.merproject.org/package/files?package=kernel-adaptation-archos-gen9&project=home%3Anotmart%3AMer_Extras%3AAdaptation%3AArchos-gen9 notmarts Mer adaption kernel package]. ('''Note:''' The author uses the ''pvr'' branch of this kernel during all further kernel-related instructions) 
      21  
      22  
      23 '''Note:''' Whatever kernel you choose, if you use GCC >= 4.7  the compiled kernel '''will not boot''' unless you pass -mno-unaligned-access to the KBUILD_CFLAGS. There is a patch adding this flag in the [https://build.merproject.org/package/view_file?file=mer-toolchain-mno-unaligned-access.patch&package=kernel-adaptation-archos-gen9&project=home%3Anotmart%3AMer_Extras%3AAdaptation%3AArchos-gen9&rev=e9f6291a7b42fb3cc57272eeda6131ff Mer adaption branches]. (According to [http://seabright.co.nz/2012/06/11/kernel-not-booting-with-linaro-gcc/ this article], linaro-gcc is affected even in earlier versions) 
      24  
      25 ---- 
      26  
      27 == Additional wl12xx and btwilink drivers == 
      28  
      29 If you have problems getting the kernel-shipped versions of these drivers to work, or anyone of them is causing trouble (e.g. random connection loss, kernel oops), you might want to compile other versions provided by TI. Archos seemed to have taken [http://gitorious.org/archos/archos-gpl-gen9/source/4b2d3c4d1d351df6b7a00e1a09bb5aa53b832822:hardware/ti/wlan_openlink the same approach]. For the author it was impossible to compile the archos-provided compat-wireless sources, but at least the TI version used by them -- r5.00.18-build_199 -- was helpful. 
      30  
      31 === WLAN-OpenLink / wl12xx === 
      32  
      33 TI provides all the needed code on their [https://github.com/TI-OpenLink/ OpenLink github page]. What we are interested in are the ''compat'', ''compat-wireless'' and ''wl12xx'' repositories. Go to the work directory of your choice and clone these repositories: 
      34 ('''Note:''' Let $WORKDIR be the directory you wish to work in) 
      35  
      36 {{{ 
      37 $ cd $WORKDIR 
      38 $ git clone https://github.com/TI-OpenLink/compat.git 
      39 Cloning into 'compat'... 
      40 remote: Counting objects: 3658, done. 
      41 remote: Compressing objects: 100% (1495/1495), done. 
      42 remote: Total 3658 (delta 2100), reused 3657 (delta 2100) 
      43 Receiving objects: 100% (3658/3658), 1.11 MiB | 368 KiB/s, done. 
      44 Resolving deltas: 100% (2100/2100), done. 
      45 $ git clone https://github.com/TI-OpenLink/compat-wireless.git 
      46 Cloning into 'compat-wireless'... 
      47 remote: Counting objects: 8709, done. 
      48 remote: Compressing objects: 100% (3045/3045), done. 
      49 remote: Total 8709 (delta 5651), reused 8701 (delta 5648) 
      50 Receiving objects: 100% (8709/8709), 3.26 MiB | 1.06 MiB/s, done. 
      51 Resolving deltas: 100% (5651/5651), done. 
      52 $ git clone https://github.com/TI-OpenLink/wl12xx.git 
      53 Cloning into 'wl12xx'... 
      54 remote: Counting objects: 2379170, done. 
      55 remote: Compressing objects: 100% (363568/363568), done. 
      56 remote: Total 2379170 (delta 1993125), reused 2379074 (delta 1993039) 
      57 Receiving objects: 100% (2379170/2379170), 506.14 MiB | 1.11 MiB/s, done. 
      58 Resolving deltas: 100% (1993125/1993125), done. 
      59 Checking out files: 100% (37602/37602), done. 
      60 }}} 
      61  
      62 Now we need the correct branches of all of them. It is up to you to use the r5.00.18-build_199 tagged version of wl12xx or a newer one. The r5_3.2 branch is known to work well. For ''compat'' and ''compat-wireless'', just checkout the ''master'' branches. 
      63  
      64 {{{ 
      65 $ cd $WORKDIR/compat 
      66 $ git checkout master 
      67 Branch master set up to track remote branch master from origin. 
      68 Switched to a new branch 'master' 
      69 $ cd $WORKDIR/compat-wireless 
      70 $ git checkout master 
      71 Branch master set up to track remote branch master from origin. 
      72 Switched to a new branch 'master' 
      73 $ cd $WORKDIR/wl12xx 
      74 $ git checkout r5_3.2 
      75 Branch r5_3.2 set up to track remote branch r5_3.2 from origin. 
      76 Switched to a new branch 'r5_3.2' 
      77 }}} 
      78 ('''Note:''' If you wish to use the exact r5.00.18-build_199 version, replace ''r5_3.2'' in the last git command with ''r5.00.18-build_199') 
      79  
      80 Now we are ready to import all the files into our compat-wireless tree: 
      81  
      82 {{{ 
      83 $ cd $WORKDIR/compat-wireless 
      84 $ export GIT_TREE=$WORKDIR/wl12xx 
      85 $ export GIT_COMPAT_TREE=$WORKDIR/compat-wireless 
      86 $ ./scripts/admin-update.sh 
      87 ... lots of output ... 
      88 Base tree: wl12xx.git 
      89 Base tree version: r5.00.19-build_257 
      90 compat-wireless release: ol_R5.SP6.01 
      91 }}} 
      92  
      93 In general people are cross-compiling stuff for their mobile devices, so these instructions are for this case. If you are not cross-compiling and your tablet is currently using the kernel you wish to compile the module for, then just run ''make''. Otherwise, set KLIB to the proper directory in ''/lib/modules''. 
      94  
      95 We are ready to to build our module. Set KLIB_BUILD to the path of the kernel-source and KLIB to the path of the module directory you wish to install the modules into. CROSS_COMPILE takes the prefix of the cross compiler, e.g. ''armv7a-unknown-linux-gnueabi-'' or ''arm-linux-gnu-''. It depends on your toolchain. 
      96  
      97 {{{ 
      98 $ make ARCH=arm CROSS_COMPILE=armv7a-unknown-linux-gnueabi- KLIB=/path/to/target/kernel/module/dir KLIB_BUILD=/path/to/target/kernel/dir 
      99 $ make ARCH=arm CROSS_COMPILE=armv7a-unknown-linux-gnueabi- KLIB=/path/to/target/kernel/module/dir KLIB_BUILD=/path/to/target/kernel/dir install-modules 
      100 }}} 
      101  
      102 For the firmware, just use the one provided by the Archos android system. ('''Note:''' The author used the NVS files from the archos image and the firmware from [https://github.com/TI-OpenLink/firmwares the TI firmware repository]) 
      103  
      104 === Bluetooth / btwilink === 
      105  
      106 TI Provides a already set-up and working bluetooth-compat tree in their [http://git.omapzoom.org/?p=platform/hardware/ti/wpan.git;a=summary OmapZoom WPAN repository]. Clone it, check it out and build it like the wl12xx driver: 
      107 ('''Note:''' Instead of the ''ics-mr1-release'' branch, a newer one like ''jb-mr2-release'' might just work fine, though not tested) 
      108  
      109 {{{ 
      110 $ cd $WORKDIR 
      111 $ git clone git://git.omapzoom.org/platform/hardware/ti/wpan.git 
      112 $ cd wpan 
      113 $ git checkout ics-mr1-release 
      114 $ cd bluetooth-compat 
      115 $ make ARCH=arm CROSS_COMPILE=armv7a-unknown-linux-gnueabi- KLIB=/path/to/target/kernel/module/dir KLIB_BUILD=/path/to/target/kernel/dir 
      116 $ make ARCH=arm CROSS_COMPILE=armv7a-unknown-linux-gnueabi- KLIB=/path/to/target/kernel/module/dir KLIB_BUILD=/path/to/target/kernel/dir bt-install-modules 
      117 }}} 
      118  
      119 You can now use your new btwilink driver. Note that you still need the uim-sysfs package for TI shared transport, i.e. having BT and Wifi working at the same time. 
      120  
      121 ---- 
      122  
      123 == Bluetooth == 
      124  
      125 For getting bluetooth to work, you will need [http://gitorious.org/uim/uim UIM]. 
      126  
      127 {{{ 
      128 $ cd $WORKDIR 
      129 $ git clone git://gitorious.org/uim/uim.git 
      130 $ cd uim 
      131 $ make CC=armv7a-unknown-linux-gnu-gcc 
      132 }}} 
      133  
      134 Copy the ''uim'' binary over to a binary dir on your tablet system, e.g. ''/sbin''. Also, if it's not there, copy the 'TIInit_7.2.31.bts' from your android system over to '/lib/firmware/'. For starters, just start ''uim'' and load the ''btwilink'' module. The dmesg output should look like this: 
      135  
      136 {{{ 
      137 Bluetooth: Core ver 2.16 
      138 NET: Registered protocol family 31 
      139 Bluetooth: HCI device and connection manager initialized 
      140 Bluetooth: HCI socket layer initialized 
      141 Bluetooth: L2CAP socket layer initialized 
      142 Bluetooth: SCO socket layer initialized 
      143 Bluetooth: Bluetooth Driver for TI WiLink - Version 1.0 
      144 (stc): st_register(4)  
      145 (stc):  chnl_id list empty :4  
      146 (stk) : st_kim_start 
      147 plat_kim_chip_enable 
      148 (stk) :ldisc_install = 1 
      149 Bluetooth: BNEP (Ethernet Emulation) ver 1.3 
      150 Bluetooth: BNEP filters: protocol multicast 
      151 (stc): st_tty_open  
      152 (stk) :line discipline installed 
      153 (stk) :TIInit_7.2.31.bts 
      154 (stc): add_channel_to_table: id 4 
      155 (stc): st_register(2)  
      156 (stc): add_channel_to_table: id 2 
      157 (stc): st_register(3)  
      158 (stc): add_channel_to_table: id 3 
      159 Bluetooth: RFCOMM TTY layer initialized 
      160 Bluetooth: RFCOMM socket layer initialized 
      161 Bluetooth: RFCOMM ver 1.11 
      162 Bluetooth: HIDP (Human Interface Emulation) ver 1.2 
      163 }}} 
      164  
      165 You can now try to start your bluetooth service and try to pair a device, using your favourite BT frontend. If everything works fine, you will want to add a unit file/init script to your system, that UIM gets started automatically on system boot. 
      166  
      167 '''NOTE:''' There were issues in the authors case. If the wl12xx module is initializing itself (i.e. the network connection is established and the firmware is loaded) and the bluetooth module is loaded around that time, the wl12xx module just spits out errors. The currently used workaround is a 5 second sleep timeout after the network initialization script, before starting UIM and loading btwilink. 
      168  
      169 Here are some systemd unit files, as an example (Tested under ArchLinux-ARM). It should be sufficient to load the btwilink module via systemds default way (/etc/modules-load.d) and just put the sleep command into the first unit file: 
      170  
      171 ''btwilink.service'': 
      172 {{{ 
      173 [Unit] 
      174 Description=Extra BTWiLink module loader 
      175 After=network.target 
      176 Before=uim.service 
      177  
      178 [Service] 
      179 Type=oneshot 
      180 ExecStart=/bin/sleep 5 ; /sbin/modprobe btwilink 
      181 KillMode=process 
      182  
      183 [Install] 
      184 WantedBy=multi-user.target 
      185 }}} 
      186  
      187 ''uim.service'': 
      188 {{{ 
      189 [Unit] 
      190 Description=UIM Shared transport service 
      191 After=network.target 
      192 Before=bluetooth.target 
      193  
      194 [Service] 
      195 ExecStart=/usr/sbin/uim 
      196 KillMode=process 
      197  
      198 [Install] 
      199 WantedBy=multi-user.target 
      200 }}} 
    12 201  
    13 202 ---- 
     
    180 369 In that order, I will add the following topics (sorting criteria is importance vs. complexicity): 
    181 370  
    182    * Provide more kernel-related information (How to build a kernel, providing a archos-patchset used to patch something like the stock android-omap branch, therefore providing a much newer kernel with features like omapfb) 
      371  * Sound (Some talk about [http://omappedia.org/wiki/Audio_Drive_Arch OMAP path setting]) 
      372  * Provide more kernel-related information (How to build a kernel+initrd(Maybe? That should be clear), providing a newer kernel with the archos patches (WIP)) 
    183 373  * Graphics(Some words about OMAPDSS, Xorg on top of OMAPFB, when providing a newer kernel: OMAPDRM) 
    184    * Wireless 
    185    * Sound (Some talk about [http://omappedia.org/wiki/Audio_Drive_Arch OMAP path setting]) 
    186    * Bluetooth 
    187 374  * Android-gadget related information(USB-Tethering, ...) 
    188 375  * Ducati-IVA (Video acceleration & Camera)