Upstream » History » Revision 84

Revision 83 (Denis 'GNUtoo' Carikli, 01/20/2019 08:32 PM) → Revision 84/408 (Denis 'GNUtoo' Carikli, 01/20/2019 08:38 PM)

h1. Upstream Linux 


 h2. Benefits of using Upstream Linux 

 Currently, Replicant uses device specific Hardware Abstraction Layers, because device manufacturers implemented non-standard kernel interfaces. However, Android works with upstream kernels and supports plug-n-play hardware nowadays, so it makes sense to have generic Hardware Abstraction Layers for the standard interfaces of the Linux kernel (ALSA, V4L2, etc). 

 * It would allow supporting external WiFi dongles such as the ones supported by the ath9k_htc driver and free firmwares without the need for a specific application or configuration. 
 * It would make devices last longer by alleviating the device specific maintenance burden: If LineageOS stops supporting a Replicant supported device, Replicant would need to maintain it by its own. This would require a lot of work, unless the device is already supported the upstream Linux kernel and generic hardware abstractions layers. This would also enable Replicant to support devices that are not currently supported by LineageOS with a lot less work. 
 * It would enable the support for devices that are or will be added to upstream Linux. 

 As GNU/Linux expects standard kernel interfaces, this would also enable to run GNU/Linux out of the box on such devices. 
 This has some interesting outcomes: 
 * The device specific work could be shared between GNU/Linux communities and Replicant communities. This could result in less work to do to support individual devices. Since Android libraries depends on Android's libc, non-standard proprietary libraries might be harder to reuse than the free software implementations, so we might get even more collaboration thanks to that. 
 * It would enable GNU/Linux distributions to more easily support smartphones and tablets, which would hopefully enable FSDG distributions to be able to focus on usability instead of hardware support. This way, if one day Android devices stop using the Linux kernel, stops being free software, or if the code takes directions that are too much problematic, already having GNU/Linux based Android alternatives would reduce the amount of work needed to be able to get again a fully free software distribution for smartphones and tablets. 
 * Older devices with less amount of RAM than Replicant current minimum requirements could be used with GNU/Linux and possibly repurposed for other usages, reducing the amount of electronic devices waste. 

 h2. Requirements 

 * For the other standard interfaces (like ASLA, etc) a device running a upstream Linux Kenrel with as few patches as possible is required. 

 h2. Devices 

 It is best to use a device that requires the least amount of work to be functional under Replicant. 
 More precisely we want to minimize: 
 * The work needed to have the device usable with upstream Linux. 
 * The work porting or writing Android hardware abstractions layers. 

 To achieve that we can choose a device that: 
 * requires no or very minimal work to be fully supported by Linux. 
 * have less hardware features (so we don't need to support them in Linux and in the HALs). 
 * is easy to buy, so the work can be shared among multiple people. 
 * doesn't have more freedom flaws than the devices currently supported by Replicant 

 It is also a good idea to keep one image per device at first, as trying to make a single image that 
 would work on all ARM device supported by upstream Linux is complicated: Even GNU/Linux 
 distributions have a hard time doing that for ARM devices. 

 h2. Linux upstream status 

 h3. Smartphones and tablets with a free software bootloader and work in progress upstream Linux support 

 |_. Formfactor |_. Vendor |_. Product    |_. Linux dts |_. Linux status | Verdict | 
 | Smartphone | LG | Optimus Black | "omap3-sniper.dts": | no display(no driver), very few peripherals | Too much work required | 
 | Tablet | Amazon | Kindle Fire (first generation) | "omap4-kc1.dts": | no display(no driver), very few peripherals | Too much work required | 
 | Smartphone | | GTA04 A3 | "omap3-gta04a3.dts": |/3. |/3. Good fit: Free software bootloader, very few parts not upstream    | 
 | Smartphone | | GTA04 A4 | "omap3-gta04a4.dts": | 
 | Smartphone | | GTA04 A5 | "omap3-gta04a5.dts": | 

 h3. Replicant supported Samsung Exynos devices 

 |_. Formfactor |_. Vendor |_. Product |_. Linux dts | Linux status page | Issues | Verdict | 
 | Smartphone | Samsung | Galaxy S II (i9100)    | "exynos4210-trats.dts":    | | Probably has a signed bootloader | | 
 | Smartphone | Samsung | Galaxy S III (i9300) | "exynos4412-i9300.dts": |/2. | signed bootloader | Good fit: Only the modem, touch keys, and small parts are missing upstream but are available as patches on top of it | 
 | Smartphone | Samsung | Galaxy Note 2 (N7100) | "exynos4412-n710x.dts": | signed bootloader | Good fit: the LCD, the modem, touch keys, and small parts are missing but are available as patches on top of it | 

 h3. Other devices with some upstream support. 

 |_. Formfactor    |_. Vendor |_. Product |_. Linux dts |_. Linux status page |_. Issues |_. Verdict | 
 | Tablet | Difrnce | DIT4350 | "sun5i-a13-difrnce-dit4350.dts": | | | | 
 | Tablet | Empire Electronix | D709 tablet | "sun5i-a13-empire-electronix-d709.dts": | | | | 
 | Tablet | Gemei | G9 Tablet | "sun4i-a10-gemei-g9.dts": | "TODO in the dts": | | "Missing touchscreen": | 
 | Smartphone | Samsung | Galaxy SIII 4G (i9305) | "exynos4412-i9305.dts": | | Signed bootloader | Good fit: 
 * Not fully supported by Replicant because of its modem but the work can be reused by the Galaxy SIII, Galaxy SII and Note 2  
 * touch keys, and small parts are missing upstream but are available as patches on top of it. | 
 | Smartphone | Nokia | N900 | "omap3-n900.dts": | | * Has a signed bootloader 
 * Has only 256M of RAM | Bad fit: not enough RAM | 
 | Smartphone | Nokia | N9 | "omap3-n9.dts": | |/2. * Probably have a signed bootloader 
 * Needs investigation to see if the touchscreen firmware is mandatory |/2. Would need investigation to see if the touchscreen firmware is mandatory | 
 | Smartphone | Nokia | N950 | "omap3-n950.dts": | | 
 | Smartphone | Motorolla | Droid 4 (XT894) | "omap4-droid4-xt894.dts": | | Probably has a signed bootloader, may have a signed kernel requiring kexec | Bad fit: requires a signed Linux kernel in the boot chain | 
 | Smartphone | | Nexus 7 (2012) | "qcom-apq8064-asus-nexus7-flo.dts": | |/8. Qualcomm SOC (signed bootloader, unknown modem isolation) |/8. Bad fit: 
 * Would need more guarantees requarding the modem isolation on recent qualcomm SOCs 
 * Would need more research to on the state of free software for more recent qualcom SOCs 
 * Not enough support in the Linux kernel for devices with Qualcomm SOCs | 
 | | | | "qcom-apq8064-sony-xperia-yuga.dts": |    | 
 | | | | "qcom-msm8974-sony-xperia-amami.dts": | | 
 | Tablet | Sony | Xperia Z2 | "qcom-msm8974-sony-xperia-castor.dts": |    | 
 | | | | "qcom-msm8974-sony-xperia-honami.dts": |    | 
 | Smartphone | | Nexus 5 | "qcom-msm8974-lge-nexus5-hammerhead.dts": | | 
 | Smartphone | Samsung | Galaxy S5 | "qcom-msm8974-samsung-klte.dts": | | 
 | | | Fairphone 2 | "qcom-msm8974-fairphone-fp2.dts": | | 

 h3. Allwinner devices 

 Devices with Allwinner SOCs are an interesting targets because: 
 * Many of them do not use signed bootloaders. 
 * Many of the SOCs and various devices using them have good Linux and u-boot mainline support 

 For instance the Lime 2 from Olimex is pretty well supported and is easy to find. 
 However this device is a single board computer and, as such it doesn't have the have the usual peripherals that are commonly found in tablets and smartphones. This makes a port on this device less relevant and less useful. 

 Some research is needed to identify which devices are easiest to work with. Tablets that don't have a modem seem to be better than smartphones, as supporting the modem would require to have it supported in Linux and the userspace libraries. This might even require to write and upstream a Linux driver for the modem. 

 A good tablet for this task should have: 
 * A SOC that has good mainline support, see "the Linux mainlining effort page on linux-sunxi": for more details. 
 * A Free software bootloader, or the ability to easily add support for the tablet to a free software bootloader. 
 * The ability to power and use an USB WiFi card or chip that is compatible with the ath9k_htc driver. 

 It would also be better if the chosen tablet doesn't use an AllWinner SOC with a PowerVR GPU, as MALI GPU have more probability to be usable with free software in the future. 

 h3. Rockchip devices 

 * There is a "Linux upstream status page": in the "opensource.rock-chips wiki": 
 * There is also "some information on u-boot": in the "opensource.rock-chips wiki": 

 h2. See also 

 * [[Google Summer of Code 2018]] 

 h1. Userspace 

 h2. Upstream userspace hardware support libraries 

 |_. Usage |_. Replicant |_. GNU/Linux |_. comments | 
 | Bluetooth stack | BlueDroid | Bluez | | 
 | GPS hardware support | ? | gpsd | | 

 h2. Upstream non-hardware specific userspace 

 |_. Usage |_. Replicant |_. GNU/Linux |_. comments | 
 | Unix command line tools | ? | Busybox, Coreutils | | 

 h2. Other projects interested in using upstream Linux and/or contributing to it 

 * "Postmarketos":